} event The event source of the callback.\n * You can pull out the new value by accessing `event.target.value` (any).\n * **Warning**: This is a generic event not a change event unless the change event is caused by browser autofill.\n * @param {object} [child] The react element that was selected when `native` is `false` (default).\n */\n onChange: PropTypes.func,\n\n /**\n * Callback fired when the component requests to be closed.\n * Use in controlled mode (see open).\n *\n * @param {object} event The event source of the callback.\n */\n onClose: PropTypes.func,\n\n /**\n * Callback fired when the component requests to be opened.\n * Use in controlled mode (see open).\n *\n * @param {object} event The event source of the callback.\n */\n onOpen: PropTypes.func,\n\n /**\n * If `true`, the component is shown.\n * You can only use it when the `native` prop is `false` (default).\n */\n open: PropTypes.bool,\n\n /**\n * Render the selected value.\n * You can only use it when the `native` prop is `false` (default).\n *\n * @param {any} value The `value` provided to the component.\n * @returns {ReactNode}\n */\n renderValue: PropTypes.func,\n\n /**\n * Props applied to the clickable div element.\n */\n SelectDisplayProps: PropTypes.object,\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\n /**\n * The `input` value. Providing an empty string will select no options.\n * Set to an empty string `''` if you don't want any of the available options to be selected.\n *\n * If the value is an object it must have reference equality with the option in order to be selected.\n * If the value is not an object, the string representation must match with the string representation of the option in order to be selected.\n */\n value: PropTypes.any,\n\n /**\n * The variant to use.\n * @default 'outlined'\n */\n variant: PropTypes.oneOf(['filled', 'outlined', 'standard'])\n} : void 0;\nSelect.muiName = 'Select';\nexport default Select;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"addEndListener\", \"appear\", \"children\", \"container\", \"direction\", \"easing\", \"in\", \"onEnter\", \"onEntered\", \"onEntering\", \"onExit\", \"onExited\", \"onExiting\", \"style\", \"timeout\", \"TransitionComponent\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { Transition } from 'react-transition-group';\nimport { elementAcceptingRef, HTMLElementType, chainPropTypes } from '@mui/utils';\nimport debounce from '../utils/debounce';\nimport useForkRef from '../utils/useForkRef';\nimport useTheme from '../styles/useTheme';\nimport { reflow, getTransitionProps } from '../transitions/utils';\nimport { ownerWindow } from '../utils'; // Translate the node so it can't be seen on the screen.\n// Later, we're going to translate the node back to its original location with `none`.\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nfunction getTranslateValue(direction, node, resolvedContainer) {\n const rect = node.getBoundingClientRect();\n const containerRect = resolvedContainer && resolvedContainer.getBoundingClientRect();\n const containerWindow = ownerWindow(node);\n let transform;\n\n if (node.fakeTransform) {\n transform = node.fakeTransform;\n } else {\n const computedStyle = containerWindow.getComputedStyle(node);\n transform = computedStyle.getPropertyValue('-webkit-transform') || computedStyle.getPropertyValue('transform');\n }\n\n let offsetX = 0;\n let offsetY = 0;\n\n if (transform && transform !== 'none' && typeof transform === 'string') {\n const transformValues = transform.split('(')[1].split(')')[0].split(',');\n offsetX = parseInt(transformValues[4], 10);\n offsetY = parseInt(transformValues[5], 10);\n }\n\n if (direction === 'left') {\n if (containerRect) {\n return `translateX(${containerRect.right + offsetX - rect.left}px)`;\n }\n\n return `translateX(${containerWindow.innerWidth + offsetX - rect.left}px)`;\n }\n\n if (direction === 'right') {\n if (containerRect) {\n return `translateX(-${rect.right - containerRect.left - offsetX}px)`;\n }\n\n return `translateX(-${rect.left + rect.width - offsetX}px)`;\n }\n\n if (direction === 'up') {\n if (containerRect) {\n return `translateY(${containerRect.bottom + offsetY - rect.top}px)`;\n }\n\n return `translateY(${containerWindow.innerHeight + offsetY - rect.top}px)`;\n } // direction === 'down'\n\n\n if (containerRect) {\n return `translateY(-${rect.top - containerRect.top + rect.height - offsetY}px)`;\n }\n\n return `translateY(-${rect.top + rect.height - offsetY}px)`;\n}\n\nfunction resolveContainer(containerPropProp) {\n return typeof containerPropProp === 'function' ? containerPropProp() : containerPropProp;\n}\n\nexport function setTranslateValue(direction, node, containerProp) {\n const resolvedContainer = resolveContainer(containerProp);\n const transform = getTranslateValue(direction, node, resolvedContainer);\n\n if (transform) {\n node.style.webkitTransform = transform;\n node.style.transform = transform;\n }\n}\n/**\n * The Slide transition is used by the [Drawer](/material-ui/react-drawer/) component.\n * It uses [react-transition-group](https://github.com/reactjs/react-transition-group) internally.\n */\n\nconst Slide = /*#__PURE__*/React.forwardRef(function Slide(props, ref) {\n const theme = useTheme();\n const defaultEasing = {\n enter: theme.transitions.easing.easeOut,\n exit: theme.transitions.easing.sharp\n };\n const defaultTimeout = {\n enter: theme.transitions.duration.enteringScreen,\n exit: theme.transitions.duration.leavingScreen\n };\n\n const {\n addEndListener,\n appear = true,\n children,\n container: containerProp,\n direction = 'down',\n easing: easingProp = defaultEasing,\n in: inProp,\n onEnter,\n onEntered,\n onEntering,\n onExit,\n onExited,\n onExiting,\n style,\n timeout = defaultTimeout,\n // eslint-disable-next-line react/prop-types\n TransitionComponent = Transition\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const childrenRef = React.useRef(null);\n const handleRefIntermediary = useForkRef(children.ref, childrenRef);\n const handleRef = useForkRef(handleRefIntermediary, ref);\n\n const normalizedTransitionCallback = callback => isAppearing => {\n if (callback) {\n // onEnterXxx and onExitXxx callbacks have a different arguments.length value.\n if (isAppearing === undefined) {\n callback(childrenRef.current);\n } else {\n callback(childrenRef.current, isAppearing);\n }\n }\n };\n\n const handleEnter = normalizedTransitionCallback((node, isAppearing) => {\n setTranslateValue(direction, node, containerProp);\n reflow(node);\n\n if (onEnter) {\n onEnter(node, isAppearing);\n }\n });\n const handleEntering = normalizedTransitionCallback((node, isAppearing) => {\n const transitionProps = getTransitionProps({\n timeout,\n style,\n easing: easingProp\n }, {\n mode: 'enter'\n });\n node.style.webkitTransition = theme.transitions.create('-webkit-transform', _extends({}, transitionProps));\n node.style.transition = theme.transitions.create('transform', _extends({}, transitionProps));\n node.style.webkitTransform = 'none';\n node.style.transform = 'none';\n\n if (onEntering) {\n onEntering(node, isAppearing);\n }\n });\n const handleEntered = normalizedTransitionCallback(onEntered);\n const handleExiting = normalizedTransitionCallback(onExiting);\n const handleExit = normalizedTransitionCallback(node => {\n const transitionProps = getTransitionProps({\n timeout,\n style,\n easing: easingProp\n }, {\n mode: 'exit'\n });\n node.style.webkitTransition = theme.transitions.create('-webkit-transform', transitionProps);\n node.style.transition = theme.transitions.create('transform', transitionProps);\n setTranslateValue(direction, node, containerProp);\n\n if (onExit) {\n onExit(node);\n }\n });\n const handleExited = normalizedTransitionCallback(node => {\n // No need for transitions when the component is hidden\n node.style.webkitTransition = '';\n node.style.transition = '';\n\n if (onExited) {\n onExited(node);\n }\n });\n\n const handleAddEndListener = next => {\n if (addEndListener) {\n // Old call signature before `react-transition-group` implemented `nodeRef`\n addEndListener(childrenRef.current, next);\n }\n };\n\n const updatePosition = React.useCallback(() => {\n if (childrenRef.current) {\n setTranslateValue(direction, childrenRef.current, containerProp);\n }\n }, [direction, containerProp]);\n React.useEffect(() => {\n // Skip configuration where the position is screen size invariant.\n if (inProp || direction === 'down' || direction === 'right') {\n return undefined;\n }\n\n const handleResize = debounce(() => {\n if (childrenRef.current) {\n setTranslateValue(direction, childrenRef.current, containerProp);\n }\n });\n const containerWindow = ownerWindow(childrenRef.current);\n containerWindow.addEventListener('resize', handleResize);\n return () => {\n handleResize.clear();\n containerWindow.removeEventListener('resize', handleResize);\n };\n }, [direction, inProp, containerProp]);\n React.useEffect(() => {\n if (!inProp) {\n // We need to update the position of the drawer when the direction change and\n // when it's hidden.\n updatePosition();\n }\n }, [inProp, updatePosition]);\n return /*#__PURE__*/_jsx(TransitionComponent, _extends({\n nodeRef: childrenRef,\n onEnter: handleEnter,\n onEntered: handleEntered,\n onEntering: handleEntering,\n onExit: handleExit,\n onExited: handleExited,\n onExiting: handleExiting,\n addEndListener: handleAddEndListener,\n appear: appear,\n in: inProp,\n timeout: timeout\n }, other, {\n children: (state, childProps) => {\n return /*#__PURE__*/React.cloneElement(children, _extends({\n ref: handleRef,\n style: _extends({\n visibility: state === 'exited' && !inProp ? 'hidden' : undefined\n }, style, children.props.style)\n }, childProps));\n }\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? Slide.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * Add a custom transition end trigger. Called with the transitioning DOM\n * node and a done callback. Allows for more fine grained transition end\n * logic. Note: Timeouts are still used as a fallback if provided.\n */\n addEndListener: PropTypes.func,\n\n /**\n * Perform the enter transition when it first mounts if `in` is also `true`.\n * Set this to `false` to disable this behavior.\n * @default true\n */\n appear: PropTypes.bool,\n\n /**\n * A single child content element.\n */\n children: elementAcceptingRef.isRequired,\n\n /**\n * An HTML element, or a function that returns one.\n * It's used to set the container the Slide is transitioning from.\n */\n container: chainPropTypes(PropTypes.oneOfType([HTMLElementType, PropTypes.func]), props => {\n if (props.open) {\n const resolvedContainer = resolveContainer(props.container);\n\n if (resolvedContainer && resolvedContainer.nodeType === 1) {\n const box = resolvedContainer.getBoundingClientRect();\n\n if (process.env.NODE_ENV !== 'test' && box.top === 0 && box.left === 0 && box.right === 0 && box.bottom === 0) {\n return new Error(['MUI: The `container` prop provided to the component is invalid.', 'The anchor element should be part of the document layout.', \"Make sure the element is present in the document or that it's not display none.\"].join('\\n'));\n }\n } else if (!resolvedContainer || typeof resolvedContainer.getBoundingClientRect !== 'function' || resolvedContainer.contextElement != null && resolvedContainer.contextElement.nodeType !== 1) {\n return new Error(['MUI: The `container` prop provided to the component is invalid.', 'It should be an HTML element instance.'].join('\\n'));\n }\n }\n\n return null;\n }),\n\n /**\n * Direction the child node will enter from.\n * @default 'down'\n */\n direction: PropTypes.oneOf(['down', 'left', 'right', 'up']),\n\n /**\n * The transition timing function.\n * You may specify a single easing or a object containing enter and exit values.\n * @default {\n * enter: theme.transitions.easing.easeOut,\n * exit: theme.transitions.easing.sharp,\n * }\n */\n easing: PropTypes.oneOfType([PropTypes.shape({\n enter: PropTypes.string,\n exit: PropTypes.string\n }), PropTypes.string]),\n\n /**\n * If `true`, the component will transition in.\n */\n in: PropTypes.bool,\n\n /**\n * @ignore\n */\n onEnter: PropTypes.func,\n\n /**\n * @ignore\n */\n onEntered: PropTypes.func,\n\n /**\n * @ignore\n */\n onEntering: PropTypes.func,\n\n /**\n * @ignore\n */\n onExit: PropTypes.func,\n\n /**\n * @ignore\n */\n onExited: PropTypes.func,\n\n /**\n * @ignore\n */\n onExiting: PropTypes.func,\n\n /**\n * @ignore\n */\n style: PropTypes.object,\n\n /**\n * The duration for the transition, in milliseconds.\n * You may specify a single timeout for all transitions, or individually with an object.\n * @default {\n * enter: theme.transitions.duration.enteringScreen,\n * exit: theme.transitions.duration.leavingScreen,\n * }\n */\n timeout: PropTypes.oneOfType([PropTypes.number, PropTypes.shape({\n appear: PropTypes.number,\n enter: PropTypes.number,\n exit: PropTypes.number\n })])\n} : void 0;\nexport default Slide;","import * as React from 'react';\n/**\n * @ignore - internal component.\n */\n\nconst TableContext = /*#__PURE__*/React.createContext();\n\nif (process.env.NODE_ENV !== 'production') {\n TableContext.displayName = 'TableContext';\n}\n\nexport default TableContext;","import * as React from 'react';\n/**\n * @ignore - internal component.\n */\n\nconst Tablelvl2Context = /*#__PURE__*/React.createContext();\n\nif (process.env.NODE_ENV !== 'production') {\n Tablelvl2Context.displayName = 'Tablelvl2Context';\n}\n\nexport default Tablelvl2Context;","import { generateUtilityClass, generateUtilityClasses } from '@mui/base';\nexport function getTableCellUtilityClass(slot) {\n return generateUtilityClass('MuiTableCell', slot);\n}\nconst tableCellClasses = generateUtilityClasses('MuiTableCell', ['root', 'head', 'body', 'footer', 'sizeSmall', 'sizeMedium', 'paddingCheckbox', 'paddingNone', 'alignLeft', 'alignCenter', 'alignRight', 'alignJustify', 'stickyHeader']);\nexport default tableCellClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"align\", \"className\", \"component\", \"padding\", \"scope\", \"size\", \"sortDirection\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport { darken, alpha, lighten } from '@mui/system';\nimport capitalize from '../utils/capitalize';\nimport TableContext from '../Table/TableContext';\nimport Tablelvl2Context from '../Table/Tablelvl2Context';\nimport useThemeProps from '../styles/useThemeProps';\nimport styled from '../styles/styled';\nimport tableCellClasses, { getTableCellUtilityClass } from './tableCellClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n variant,\n align,\n padding,\n size,\n stickyHeader\n } = ownerState;\n const slots = {\n root: ['root', variant, stickyHeader && 'stickyHeader', align !== 'inherit' && `align${capitalize(align)}`, padding !== 'normal' && `padding${capitalize(padding)}`, `size${capitalize(size)}`]\n };\n return composeClasses(slots, getTableCellUtilityClass, classes);\n};\n\nconst TableCellRoot = styled('td', {\n name: 'MuiTableCell',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, styles[ownerState.variant], styles[`size${capitalize(ownerState.size)}`], ownerState.padding !== 'normal' && styles[`padding${capitalize(ownerState.padding)}`], ownerState.align !== 'inherit' && styles[`align${capitalize(ownerState.align)}`], ownerState.stickyHeader && styles.stickyHeader];\n }\n})(({\n theme,\n ownerState\n}) => _extends({}, theme.typography.body2, {\n display: 'table-cell',\n verticalAlign: 'inherit',\n // Workaround for a rendering bug with spanned columns in Chrome 62.0.\n // Removes the alpha (sets it to 1), and lightens or darkens the theme color.\n borderBottom: `1px solid\n ${theme.palette.mode === 'light' ? lighten(alpha(theme.palette.divider, 1), 0.88) : darken(alpha(theme.palette.divider, 1), 0.68)}`,\n textAlign: 'left',\n padding: 16\n}, ownerState.variant === 'head' && {\n color: theme.palette.text.primary,\n lineHeight: theme.typography.pxToRem(24),\n fontWeight: theme.typography.fontWeightMedium\n}, ownerState.variant === 'body' && {\n color: theme.palette.text.primary\n}, ownerState.variant === 'footer' && {\n color: theme.palette.text.secondary,\n lineHeight: theme.typography.pxToRem(21),\n fontSize: theme.typography.pxToRem(12)\n}, ownerState.size === 'small' && {\n padding: '6px 16px',\n [`&.${tableCellClasses.paddingCheckbox}`]: {\n width: 24,\n // prevent the checkbox column from growing\n padding: '0 12px 0 16px',\n '& > *': {\n padding: 0\n }\n }\n}, ownerState.padding === 'checkbox' && {\n width: 48,\n // prevent the checkbox column from growing\n padding: '0 0 0 4px'\n}, ownerState.padding === 'none' && {\n padding: 0\n}, ownerState.align === 'left' && {\n textAlign: 'left'\n}, ownerState.align === 'center' && {\n textAlign: 'center'\n}, ownerState.align === 'right' && {\n textAlign: 'right',\n flexDirection: 'row-reverse'\n}, ownerState.align === 'justify' && {\n textAlign: 'justify'\n}, ownerState.stickyHeader && {\n position: 'sticky',\n top: 0,\n zIndex: 2,\n backgroundColor: theme.palette.background.default\n}));\n/**\n * The component renders a `` element when the parent context is a header\n * or otherwise a ` | ` element.\n */\n\nconst TableCell = /*#__PURE__*/React.forwardRef(function TableCell(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiTableCell'\n });\n\n const {\n align = 'inherit',\n className,\n component: componentProp,\n padding: paddingProp,\n scope: scopeProp,\n size: sizeProp,\n sortDirection,\n variant: variantProp\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const table = React.useContext(TableContext);\n const tablelvl2 = React.useContext(Tablelvl2Context);\n const isHeadCell = tablelvl2 && tablelvl2.variant === 'head';\n let component;\n\n if (componentProp) {\n component = componentProp;\n } else {\n component = isHeadCell ? 'th' : 'td';\n }\n\n let scope = scopeProp;\n\n if (!scope && isHeadCell) {\n scope = 'col';\n }\n\n const variant = variantProp || tablelvl2 && tablelvl2.variant;\n\n const ownerState = _extends({}, props, {\n align,\n component,\n padding: paddingProp || (table && table.padding ? table.padding : 'normal'),\n size: sizeProp || (table && table.size ? table.size : 'medium'),\n sortDirection,\n stickyHeader: variant === 'head' && table && table.stickyHeader,\n variant\n });\n\n const classes = useUtilityClasses(ownerState);\n let ariaSort = null;\n\n if (sortDirection) {\n ariaSort = sortDirection === 'asc' ? 'ascending' : 'descending';\n }\n\n return /*#__PURE__*/_jsx(TableCellRoot, _extends({\n as: component,\n ref: ref,\n className: clsx(classes.root, className),\n \"aria-sort\": ariaSort,\n scope: scope,\n ownerState: ownerState\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? TableCell.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * Set the text-align on the table cell content.\n *\n * Monetary or generally number fields **should be right aligned** as that allows\n * you to add them up quickly in your head without having to worry about decimals.\n * @default 'inherit'\n */\n align: PropTypes.oneOf(['center', 'inherit', 'justify', 'left', 'right']),\n\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n\n /**\n * Sets the padding applied to the cell.\n * The prop defaults to the value (`'default'`) inherited from the parent Table component.\n */\n padding: PropTypes.oneOf(['checkbox', 'none', 'normal']),\n\n /**\n * Set scope attribute.\n */\n scope: PropTypes.string,\n\n /**\n * Specify the size of the cell.\n * The prop defaults to the value (`'medium'`) inherited from the parent Table component.\n */\n size: PropTypes.oneOf(['small', 'medium']),\n\n /**\n * Set aria-sort direction.\n */\n sortDirection: PropTypes.oneOf(['asc', 'desc', false]),\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\n /**\n * Specify the cell type.\n * The prop defaults to the value inherited from the parent TableHead, TableBody, or TableFooter components.\n */\n variant: PropTypes.oneOf(['body', 'footer', 'head'])\n} : void 0;\nexport default TableCell;","import { generateUtilityClass, generateUtilityClasses } from '@mui/base';\nexport function getTextFieldUtilityClass(slot) {\n return generateUtilityClass('MuiTextField', slot);\n}\nconst textFieldClasses = generateUtilityClasses('MuiTextField', ['root']);\nexport default textFieldClasses;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"autoComplete\", \"autoFocus\", \"children\", \"className\", \"color\", \"defaultValue\", \"disabled\", \"error\", \"FormHelperTextProps\", \"fullWidth\", \"helperText\", \"id\", \"InputLabelProps\", \"inputProps\", \"InputProps\", \"inputRef\", \"label\", \"maxRows\", \"minRows\", \"multiline\", \"name\", \"onBlur\", \"onChange\", \"onFocus\", \"placeholder\", \"required\", \"rows\", \"select\", \"SelectProps\", \"type\", \"value\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport { refType, unstable_useId as useId } from '@mui/utils';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport Input from '../Input';\nimport FilledInput from '../FilledInput';\nimport OutlinedInput from '../OutlinedInput';\nimport InputLabel from '../InputLabel';\nimport FormControl from '../FormControl';\nimport FormHelperText from '../FormHelperText';\nimport Select from '../Select';\nimport { getTextFieldUtilityClass } from './textFieldClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst variantComponent = {\n standard: Input,\n filled: FilledInput,\n outlined: OutlinedInput\n};\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['root']\n };\n return composeClasses(slots, getTextFieldUtilityClass, classes);\n};\n\nconst TextFieldRoot = styled(FormControl, {\n name: 'MuiTextField',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({});\n/**\n * The `TextField` is a convenience wrapper for the most common cases (80%).\n * It cannot be all things to all people, otherwise the API would grow out of control.\n *\n * ## Advanced Configuration\n *\n * It's important to understand that the text field is a simple abstraction\n * on top of the following components:\n *\n * - [FormControl](/material-ui/api/form-control/)\n * - [InputLabel](/material-ui/api/input-label/)\n * - [FilledInput](/material-ui/api/filled-input/)\n * - [OutlinedInput](/material-ui/api/outlined-input/)\n * - [Input](/material-ui/api/input/)\n * - [FormHelperText](/material-ui/api/form-helper-text/)\n *\n * If you wish to alter the props applied to the `input` element, you can do so as follows:\n *\n * ```jsx\n * const inputProps = {\n * step: 300,\n * };\n *\n * return ;\n * ```\n *\n * For advanced cases, please look at the source of TextField by clicking on the\n * \"Edit this page\" button above. Consider either:\n *\n * - using the upper case props for passing values directly to the components\n * - using the underlying components directly as shown in the demos\n */\n\nconst TextField = /*#__PURE__*/React.forwardRef(function TextField(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiTextField'\n });\n\n const {\n autoComplete,\n autoFocus = false,\n children,\n className,\n color = 'primary',\n defaultValue,\n disabled = false,\n error = false,\n FormHelperTextProps,\n fullWidth = false,\n helperText,\n id: idOverride,\n InputLabelProps,\n inputProps,\n InputProps,\n inputRef,\n label,\n maxRows,\n minRows,\n multiline = false,\n name,\n onBlur,\n onChange,\n onFocus,\n placeholder,\n required = false,\n rows,\n select = false,\n SelectProps,\n type,\n value,\n variant = 'outlined'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const ownerState = _extends({}, props, {\n autoFocus,\n color,\n disabled,\n error,\n fullWidth,\n multiline,\n required,\n select,\n variant\n });\n\n const classes = useUtilityClasses(ownerState);\n\n if (process.env.NODE_ENV !== 'production') {\n if (select && !children) {\n console.error('MUI: `children` must be passed when using the `TextField` component with `select`.');\n }\n }\n\n const InputMore = {};\n\n if (variant === 'outlined') {\n if (InputLabelProps && typeof InputLabelProps.shrink !== 'undefined') {\n InputMore.notched = InputLabelProps.shrink;\n }\n\n InputMore.label = label;\n }\n\n if (select) {\n // unset defaults from textbox inputs\n if (!SelectProps || !SelectProps.native) {\n InputMore.id = undefined;\n }\n\n InputMore['aria-describedby'] = undefined;\n }\n\n const id = useId(idOverride);\n const helperTextId = helperText && id ? `${id}-helper-text` : undefined;\n const inputLabelId = label && id ? `${id}-label` : undefined;\n const InputComponent = variantComponent[variant];\n\n const InputElement = /*#__PURE__*/_jsx(InputComponent, _extends({\n \"aria-describedby\": helperTextId,\n autoComplete: autoComplete,\n autoFocus: autoFocus,\n defaultValue: defaultValue,\n fullWidth: fullWidth,\n multiline: multiline,\n name: name,\n rows: rows,\n maxRows: maxRows,\n minRows: minRows,\n type: type,\n value: value,\n id: id,\n inputRef: inputRef,\n onBlur: onBlur,\n onChange: onChange,\n onFocus: onFocus,\n placeholder: placeholder,\n inputProps: inputProps\n }, InputMore, InputProps));\n\n return /*#__PURE__*/_jsxs(TextFieldRoot, _extends({\n className: clsx(classes.root, className),\n disabled: disabled,\n error: error,\n fullWidth: fullWidth,\n ref: ref,\n required: required,\n color: color,\n variant: variant,\n ownerState: ownerState\n }, other, {\n children: [label != null && label !== '' && /*#__PURE__*/_jsx(InputLabel, _extends({\n htmlFor: id,\n id: inputLabelId\n }, InputLabelProps, {\n children: label\n })), select ? /*#__PURE__*/_jsx(Select, _extends({\n \"aria-describedby\": helperTextId,\n id: id,\n labelId: inputLabelId,\n value: value,\n input: InputElement\n }, SelectProps, {\n children: children\n })) : InputElement, helperText && /*#__PURE__*/_jsx(FormHelperText, _extends({\n id: helperTextId\n }, FormHelperTextProps, {\n children: helperText\n }))]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? TextField.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * This prop helps users to fill forms faster, especially on mobile devices.\n * The name can be confusing, as it's more like an autofill.\n * You can learn more about it [following the specification](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#autofill).\n */\n autoComplete: PropTypes.string,\n\n /**\n * If `true`, the `input` element is focused during the first mount.\n * @default false\n */\n autoFocus: PropTypes.bool,\n\n /**\n * @ignore\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).\n * @default 'primary'\n */\n color: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.oneOf(['primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),\n\n /**\n * The default value. Use when the component is not controlled.\n */\n defaultValue: PropTypes.any,\n\n /**\n * If `true`, the component is disabled.\n * @default false\n */\n disabled: PropTypes.bool,\n\n /**\n * If `true`, the label is displayed in an error state.\n * @default false\n */\n error: PropTypes.bool,\n\n /**\n * Props applied to the [`FormHelperText`](/material-ui/api/form-helper-text/) element.\n */\n FormHelperTextProps: PropTypes.object,\n\n /**\n * If `true`, the input will take up the full width of its container.\n * @default false\n */\n fullWidth: PropTypes.bool,\n\n /**\n * The helper text content.\n */\n helperText: PropTypes.node,\n\n /**\n * The id of the `input` element.\n * Use this prop to make `label` and `helperText` accessible for screen readers.\n */\n id: PropTypes.string,\n\n /**\n * Props applied to the [`InputLabel`](/material-ui/api/input-label/) element.\n * Pointer events like `onClick` are enabled if and only if `shrink` is `true`.\n */\n InputLabelProps: PropTypes.object,\n\n /**\n * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.\n */\n inputProps: PropTypes.object,\n\n /**\n * Props applied to the Input element.\n * It will be a [`FilledInput`](/material-ui/api/filled-input/),\n * [`OutlinedInput`](/material-ui/api/outlined-input/) or [`Input`](/material-ui/api/input/)\n * component depending on the `variant` prop value.\n */\n InputProps: PropTypes.object,\n\n /**\n * Pass a ref to the `input` element.\n */\n inputRef: refType,\n\n /**\n * The label content.\n */\n label: PropTypes.node,\n\n /**\n * If `dense` or `normal`, will adjust vertical spacing of this and contained components.\n * @default 'none'\n */\n margin: PropTypes.oneOf(['dense', 'none', 'normal']),\n\n /**\n * Maximum number of rows to display when multiline option is set to true.\n */\n maxRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /**\n * Minimum number of rows to display when multiline option is set to true.\n */\n minRows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /**\n * If `true`, a `textarea` element is rendered instead of an input.\n * @default false\n */\n multiline: PropTypes.bool,\n\n /**\n * Name attribute of the `input` element.\n */\n name: PropTypes.string,\n\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n\n /**\n * Callback fired when the value is changed.\n *\n * @param {object} event The event source of the callback.\n * You can pull out the new value by accessing `event.target.value` (string).\n */\n onChange: PropTypes.func,\n\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n\n /**\n * The short hint displayed in the `input` before the user enters a value.\n */\n placeholder: PropTypes.string,\n\n /**\n * If `true`, the label is displayed as required and the `input` element is required.\n * @default false\n */\n required: PropTypes.bool,\n\n /**\n * Number of rows to display when multiline option is set to true.\n */\n rows: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /**\n * Render a [`Select`](/material-ui/api/select/) element while passing the Input element to `Select` as `input` parameter.\n * If this option is set you must pass the options of the select as children.\n * @default false\n */\n select: PropTypes.bool,\n\n /**\n * Props applied to the [`Select`](/material-ui/api/select/) element.\n */\n SelectProps: PropTypes.object,\n\n /**\n * The size of the component.\n */\n size: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),\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\n /**\n * Type of the `input` element. It should be [a valid HTML5 input type](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Form_%3Cinput%3E_types).\n */\n type: PropTypes\n /* @typescript-to-proptypes-ignore */\n .string,\n\n /**\n * The value of the `input` element, required for a controlled component.\n */\n value: PropTypes.any,\n\n /**\n * The variant to use.\n * @default 'outlined'\n */\n variant: PropTypes.oneOf(['filled', 'outlined', 'standard'])\n} : void 0;\nexport default TextField;","import { generateUtilityClass, generateUtilityClasses } from '@mui/base';\nexport function getToolbarUtilityClass(slot) {\n return generateUtilityClass('MuiToolbar', slot);\n}\nconst toolbarClasses = generateUtilityClasses('MuiToolbar', ['root', 'gutters', 'regular', 'dense']);\nexport default toolbarClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"component\", \"disableGutters\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport useThemeProps from '../styles/useThemeProps';\nimport styled from '../styles/styled';\nimport { getToolbarUtilityClass } from './toolbarClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n disableGutters,\n variant\n } = ownerState;\n const slots = {\n root: ['root', !disableGutters && 'gutters', variant]\n };\n return composeClasses(slots, getToolbarUtilityClass, classes);\n};\n\nconst ToolbarRoot = styled('div', {\n name: 'MuiToolbar',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, !ownerState.disableGutters && styles.gutters, styles[ownerState.variant]];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n position: 'relative',\n display: 'flex',\n alignItems: 'center'\n}, !ownerState.disableGutters && {\n paddingLeft: theme.spacing(2),\n paddingRight: theme.spacing(2),\n [theme.breakpoints.up('sm')]: {\n paddingLeft: theme.spacing(3),\n paddingRight: theme.spacing(3)\n }\n}, ownerState.variant === 'dense' && {\n minHeight: 48\n}), ({\n theme,\n ownerState\n}) => ownerState.variant === 'regular' && theme.mixins.toolbar);\nconst Toolbar = /*#__PURE__*/React.forwardRef(function Toolbar(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiToolbar'\n });\n\n const {\n className,\n component = 'div',\n disableGutters = false,\n variant = 'regular'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const ownerState = _extends({}, props, {\n component,\n disableGutters,\n variant\n });\n\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(ToolbarRoot, _extends({\n as: component,\n className: clsx(classes.root, className),\n ref: ref,\n ownerState: ownerState\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Toolbar.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The Toolbar children, usually a mixture of `IconButton`, `Button` and `Typography`.\n * The Toolbar is a flex container, allowing flex item properites to be used to lay out the children.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n\n /**\n * If `true`, disables gutter padding.\n * @default false\n */\n disableGutters: PropTypes.bool,\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\n /**\n * The variant to use.\n * @default 'regular'\n */\n variant: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.oneOf(['dense', 'regular']), PropTypes.string])\n} : void 0;\nexport default Toolbar;","import { generateUtilityClass, generateUtilityClasses } from '@mui/base';\nexport function getTooltipUtilityClass(slot) {\n return generateUtilityClass('MuiTooltip', slot);\n}\nconst tooltipClasses = generateUtilityClasses('MuiTooltip', ['popper', 'popperInteractive', 'popperArrow', 'popperClose', 'tooltip', 'tooltipArrow', 'touch', 'tooltipPlacementLeft', 'tooltipPlacementRight', 'tooltipPlacementTop', 'tooltipPlacementBottom', 'arrow']);\nexport default tooltipClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"arrow\", \"children\", \"classes\", \"components\", \"componentsProps\", \"describeChild\", \"disableFocusListener\", \"disableHoverListener\", \"disableInteractive\", \"disableTouchListener\", \"enterDelay\", \"enterNextDelay\", \"enterTouchDelay\", \"followCursor\", \"id\", \"leaveDelay\", \"leaveTouchDelay\", \"onClose\", \"onOpen\", \"open\", \"placement\", \"PopperComponent\", \"PopperProps\", \"title\", \"TransitionComponent\", \"TransitionProps\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { elementAcceptingRef } from '@mui/utils';\nimport { unstable_composeClasses as composeClasses, appendOwnerState } from '@mui/base';\nimport { alpha } from '@mui/system';\nimport styled from '../styles/styled';\nimport useTheme from '../styles/useTheme';\nimport useThemeProps from '../styles/useThemeProps';\nimport capitalize from '../utils/capitalize';\nimport Grow from '../Grow';\nimport Popper from '../Popper';\nimport useEventCallback from '../utils/useEventCallback';\nimport useForkRef from '../utils/useForkRef';\nimport useId from '../utils/useId';\nimport useIsFocusVisible from '../utils/useIsFocusVisible';\nimport useControlled from '../utils/useControlled';\nimport tooltipClasses, { getTooltipUtilityClass } from './tooltipClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n\nfunction round(value) {\n return Math.round(value * 1e5) / 1e5;\n}\n\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n disableInteractive,\n arrow,\n touch,\n placement\n } = ownerState;\n const slots = {\n popper: ['popper', !disableInteractive && 'popperInteractive', arrow && 'popperArrow'],\n tooltip: ['tooltip', arrow && 'tooltipArrow', touch && 'touch', `tooltipPlacement${capitalize(placement.split('-')[0])}`],\n arrow: ['arrow']\n };\n return composeClasses(slots, getTooltipUtilityClass, classes);\n};\n\nconst TooltipPopper = styled(Popper, {\n name: 'MuiTooltip',\n slot: 'Popper',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.popper, !ownerState.disableInteractive && styles.popperInteractive, ownerState.arrow && styles.popperArrow, !ownerState.open && styles.popperClose];\n }\n})(({\n theme,\n ownerState,\n open\n}) => _extends({\n zIndex: (theme.vars || theme).zIndex.tooltip,\n pointerEvents: 'none'\n}, !ownerState.disableInteractive && {\n pointerEvents: 'auto'\n}, !open && {\n pointerEvents: 'none'\n}, ownerState.arrow && {\n [`&[data-popper-placement*=\"bottom\"] .${tooltipClasses.arrow}`]: {\n top: 0,\n marginTop: '-0.71em',\n '&::before': {\n transformOrigin: '0 100%'\n }\n },\n [`&[data-popper-placement*=\"top\"] .${tooltipClasses.arrow}`]: {\n bottom: 0,\n marginBottom: '-0.71em',\n '&::before': {\n transformOrigin: '100% 0'\n }\n },\n [`&[data-popper-placement*=\"right\"] .${tooltipClasses.arrow}`]: _extends({}, !ownerState.isRtl ? {\n left: 0,\n marginLeft: '-0.71em'\n } : {\n right: 0,\n marginRight: '-0.71em'\n }, {\n height: '1em',\n width: '0.71em',\n '&::before': {\n transformOrigin: '100% 100%'\n }\n }),\n [`&[data-popper-placement*=\"left\"] .${tooltipClasses.arrow}`]: _extends({}, !ownerState.isRtl ? {\n right: 0,\n marginRight: '-0.71em'\n } : {\n left: 0,\n marginLeft: '-0.71em'\n }, {\n height: '1em',\n width: '0.71em',\n '&::before': {\n transformOrigin: '0 0'\n }\n })\n}));\nconst TooltipTooltip = styled('div', {\n name: 'MuiTooltip',\n slot: 'Tooltip',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.tooltip, ownerState.touch && styles.touch, ownerState.arrow && styles.tooltipArrow, styles[`tooltipPlacement${capitalize(ownerState.placement.split('-')[0])}`]];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.grey.darkChannel} / 0.92)` : alpha(theme.palette.grey[700], 0.92),\n borderRadius: (theme.vars || theme).shape.borderRadius,\n color: (theme.vars || theme).palette.common.white,\n fontFamily: theme.typography.fontFamily,\n padding: '4px 8px',\n fontSize: theme.typography.pxToRem(11),\n maxWidth: 300,\n margin: 2,\n wordWrap: 'break-word',\n fontWeight: theme.typography.fontWeightMedium\n}, ownerState.arrow && {\n position: 'relative',\n margin: 0\n}, ownerState.touch && {\n padding: '8px 16px',\n fontSize: theme.typography.pxToRem(14),\n lineHeight: `${round(16 / 14)}em`,\n fontWeight: theme.typography.fontWeightRegular\n}, {\n [`.${tooltipClasses.popper}[data-popper-placement*=\"left\"] &`]: _extends({\n transformOrigin: 'right center'\n }, !ownerState.isRtl ? _extends({\n marginRight: '14px'\n }, ownerState.touch && {\n marginRight: '24px'\n }) : _extends({\n marginLeft: '14px'\n }, ownerState.touch && {\n marginLeft: '24px'\n })),\n [`.${tooltipClasses.popper}[data-popper-placement*=\"right\"] &`]: _extends({\n transformOrigin: 'left center'\n }, !ownerState.isRtl ? _extends({\n marginLeft: '14px'\n }, ownerState.touch && {\n marginLeft: '24px'\n }) : _extends({\n marginRight: '14px'\n }, ownerState.touch && {\n marginRight: '24px'\n })),\n [`.${tooltipClasses.popper}[data-popper-placement*=\"top\"] &`]: _extends({\n transformOrigin: 'center bottom',\n marginBottom: '14px'\n }, ownerState.touch && {\n marginBottom: '24px'\n }),\n [`.${tooltipClasses.popper}[data-popper-placement*=\"bottom\"] &`]: _extends({\n transformOrigin: 'center top',\n marginTop: '14px'\n }, ownerState.touch && {\n marginTop: '24px'\n })\n}));\nconst TooltipArrow = styled('span', {\n name: 'MuiTooltip',\n slot: 'Arrow',\n overridesResolver: (props, styles) => styles.arrow\n})(({\n theme\n}) => ({\n overflow: 'hidden',\n position: 'absolute',\n width: '1em',\n height: '0.71em'\n /* = width / sqrt(2) = (length of the hypotenuse) */\n ,\n boxSizing: 'border-box',\n color: theme.vars ? `rgba(${theme.vars.palette.grey.darkChannel} / 0.9)` : alpha(theme.palette.grey[700], 0.9),\n '&::before': {\n content: '\"\"',\n margin: 'auto',\n display: 'block',\n width: '100%',\n height: '100%',\n backgroundColor: 'currentColor',\n transform: 'rotate(45deg)'\n }\n}));\nlet hystersisOpen = false;\nlet hystersisTimer = null;\nexport function testReset() {\n hystersisOpen = false;\n clearTimeout(hystersisTimer);\n}\n\nfunction composeEventHandler(handler, eventHandler) {\n return event => {\n if (eventHandler) {\n eventHandler(event);\n }\n\n handler(event);\n };\n} // TODO v6: Remove PopperComponent, PopperProps, TransitionComponent and TransitionProps.\n\n\nconst Tooltip = /*#__PURE__*/React.forwardRef(function Tooltip(inProps, ref) {\n var _components$Popper, _ref, _components$Transitio, _components$Tooltip, _components$Arrow, _componentsProps$popp;\n\n const props = useThemeProps({\n props: inProps,\n name: 'MuiTooltip'\n });\n\n const {\n arrow = false,\n children,\n components = {},\n componentsProps = {},\n describeChild = false,\n disableFocusListener = false,\n disableHoverListener = false,\n disableInteractive: disableInteractiveProp = false,\n disableTouchListener = false,\n enterDelay = 100,\n enterNextDelay = 0,\n enterTouchDelay = 700,\n followCursor = false,\n id: idProp,\n leaveDelay = 0,\n leaveTouchDelay = 1500,\n onClose,\n onOpen,\n open: openProp,\n placement = 'bottom',\n PopperComponent: PopperComponentProp,\n PopperProps = {},\n title,\n TransitionComponent: TransitionComponentProp = Grow,\n TransitionProps\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const theme = useTheme();\n const isRtl = theme.direction === 'rtl';\n const [childNode, setChildNode] = React.useState();\n const [arrowRef, setArrowRef] = React.useState(null);\n const ignoreNonTouchEvents = React.useRef(false);\n const disableInteractive = disableInteractiveProp || followCursor;\n const closeTimer = React.useRef();\n const enterTimer = React.useRef();\n const leaveTimer = React.useRef();\n const touchTimer = React.useRef();\n const [openState, setOpenState] = useControlled({\n controlled: openProp,\n default: false,\n name: 'Tooltip',\n state: 'open'\n });\n let open = openState;\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const {\n current: isControlled\n } = React.useRef(openProp !== undefined); // eslint-disable-next-line react-hooks/rules-of-hooks\n\n React.useEffect(() => {\n if (childNode && childNode.disabled && !isControlled && title !== '' && childNode.tagName.toLowerCase() === 'button') {\n console.error(['MUI: You are providing a disabled `button` child to the Tooltip component.', 'A disabled element does not fire events.', \"Tooltip needs to listen to the child element's events to display the title.\", '', 'Add a simple wrapper element, such as a `span`.'].join('\\n'));\n }\n }, [title, childNode, isControlled]);\n }\n\n const id = useId(idProp);\n const prevUserSelect = React.useRef();\n const stopTouchInteraction = React.useCallback(() => {\n if (prevUserSelect.current !== undefined) {\n document.body.style.WebkitUserSelect = prevUserSelect.current;\n prevUserSelect.current = undefined;\n }\n\n clearTimeout(touchTimer.current);\n }, []);\n React.useEffect(() => {\n return () => {\n clearTimeout(closeTimer.current);\n clearTimeout(enterTimer.current);\n clearTimeout(leaveTimer.current);\n stopTouchInteraction();\n };\n }, [stopTouchInteraction]);\n\n const handleOpen = event => {\n clearTimeout(hystersisTimer);\n hystersisOpen = true; // The mouseover event will trigger for every nested element in the tooltip.\n // We can skip rerendering when the tooltip is already open.\n // We are using the mouseover event instead of the mouseenter event to fix a hide/show issue.\n\n setOpenState(true);\n\n if (onOpen && !open) {\n onOpen(event);\n }\n };\n\n const handleClose = useEventCallback(\n /**\n * @param {React.SyntheticEvent | Event} event\n */\n event => {\n clearTimeout(hystersisTimer);\n hystersisTimer = setTimeout(() => {\n hystersisOpen = false;\n }, 800 + leaveDelay);\n setOpenState(false);\n\n if (onClose && open) {\n onClose(event);\n }\n\n clearTimeout(closeTimer.current);\n closeTimer.current = setTimeout(() => {\n ignoreNonTouchEvents.current = false;\n }, theme.transitions.duration.shortest);\n });\n\n const handleEnter = event => {\n if (ignoreNonTouchEvents.current && event.type !== 'touchstart') {\n return;\n } // Remove the title ahead of time.\n // We don't want to wait for the next render commit.\n // We would risk displaying two tooltips at the same time (native + this one).\n\n\n if (childNode) {\n childNode.removeAttribute('title');\n }\n\n clearTimeout(enterTimer.current);\n clearTimeout(leaveTimer.current);\n\n if (enterDelay || hystersisOpen && enterNextDelay) {\n enterTimer.current = setTimeout(() => {\n handleOpen(event);\n }, hystersisOpen ? enterNextDelay : enterDelay);\n } else {\n handleOpen(event);\n }\n };\n\n const handleLeave = event => {\n clearTimeout(enterTimer.current);\n clearTimeout(leaveTimer.current);\n leaveTimer.current = setTimeout(() => {\n handleClose(event);\n }, leaveDelay);\n };\n\n const {\n isFocusVisibleRef,\n onBlur: handleBlurVisible,\n onFocus: handleFocusVisible,\n ref: focusVisibleRef\n } = useIsFocusVisible(); // We don't necessarily care about the focusVisible state (which is safe to access via ref anyway).\n // We just need to re-render the Tooltip if the focus-visible state changes.\n\n const [, setChildIsFocusVisible] = React.useState(false);\n\n const handleBlur = event => {\n handleBlurVisible(event);\n\n if (isFocusVisibleRef.current === false) {\n setChildIsFocusVisible(false);\n handleLeave(event);\n }\n };\n\n const handleFocus = event => {\n // Workaround for https://github.com/facebook/react/issues/7769\n // The autoFocus of React might trigger the event before the componentDidMount.\n // We need to account for this eventuality.\n if (!childNode) {\n setChildNode(event.currentTarget);\n }\n\n handleFocusVisible(event);\n\n if (isFocusVisibleRef.current === true) {\n setChildIsFocusVisible(true);\n handleEnter(event);\n }\n };\n\n const detectTouchStart = event => {\n ignoreNonTouchEvents.current = true;\n const childrenProps = children.props;\n\n if (childrenProps.onTouchStart) {\n childrenProps.onTouchStart(event);\n }\n };\n\n const handleMouseOver = handleEnter;\n const handleMouseLeave = handleLeave;\n\n const handleTouchStart = event => {\n detectTouchStart(event);\n clearTimeout(leaveTimer.current);\n clearTimeout(closeTimer.current);\n stopTouchInteraction();\n prevUserSelect.current = document.body.style.WebkitUserSelect; // Prevent iOS text selection on long-tap.\n\n document.body.style.WebkitUserSelect = 'none';\n touchTimer.current = setTimeout(() => {\n document.body.style.WebkitUserSelect = prevUserSelect.current;\n handleEnter(event);\n }, enterTouchDelay);\n };\n\n const handleTouchEnd = event => {\n if (children.props.onTouchEnd) {\n children.props.onTouchEnd(event);\n }\n\n stopTouchInteraction();\n clearTimeout(leaveTimer.current);\n leaveTimer.current = setTimeout(() => {\n handleClose(event);\n }, leaveTouchDelay);\n };\n\n React.useEffect(() => {\n if (!open) {\n return undefined;\n }\n /**\n * @param {KeyboardEvent} nativeEvent\n */\n\n\n function handleKeyDown(nativeEvent) {\n // IE11, Edge (prior to using Bink?) use 'Esc'\n if (nativeEvent.key === 'Escape' || nativeEvent.key === 'Esc') {\n handleClose(nativeEvent);\n }\n }\n\n document.addEventListener('keydown', handleKeyDown);\n return () => {\n document.removeEventListener('keydown', handleKeyDown);\n };\n }, [handleClose, open]);\n const handleUseRef = useForkRef(setChildNode, ref);\n const handleFocusRef = useForkRef(focusVisibleRef, handleUseRef);\n const handleRef = useForkRef(children.ref, handleFocusRef); // There is no point in displaying an empty tooltip.\n\n if (title === '') {\n open = false;\n }\n\n const positionRef = React.useRef({\n x: 0,\n y: 0\n });\n const popperRef = React.useRef();\n\n const handleMouseMove = event => {\n const childrenProps = children.props;\n\n if (childrenProps.onMouseMove) {\n childrenProps.onMouseMove(event);\n }\n\n positionRef.current = {\n x: event.clientX,\n y: event.clientY\n };\n\n if (popperRef.current) {\n popperRef.current.update();\n }\n };\n\n const nameOrDescProps = {};\n const titleIsString = typeof title === 'string';\n\n if (describeChild) {\n nameOrDescProps.title = !open && titleIsString && !disableHoverListener ? title : null;\n nameOrDescProps['aria-describedby'] = open ? id : null;\n } else {\n nameOrDescProps['aria-label'] = titleIsString ? title : null;\n nameOrDescProps['aria-labelledby'] = open && !titleIsString ? id : null;\n }\n\n const childrenProps = _extends({}, nameOrDescProps, other, children.props, {\n className: clsx(other.className, children.props.className),\n onTouchStart: detectTouchStart,\n ref: handleRef\n }, followCursor ? {\n onMouseMove: handleMouseMove\n } : {});\n\n if (process.env.NODE_ENV !== 'production') {\n childrenProps['data-mui-internal-clone-element'] = true; // eslint-disable-next-line react-hooks/rules-of-hooks\n\n React.useEffect(() => {\n if (childNode && !childNode.getAttribute('data-mui-internal-clone-element')) {\n console.error(['MUI: The `children` component of the Tooltip is not forwarding its props correctly.', 'Please make sure that props are spread on the same element that the ref is applied to.'].join('\\n'));\n }\n }, [childNode]);\n }\n\n const interactiveWrapperListeners = {};\n\n if (!disableTouchListener) {\n childrenProps.onTouchStart = handleTouchStart;\n childrenProps.onTouchEnd = handleTouchEnd;\n }\n\n if (!disableHoverListener) {\n childrenProps.onMouseOver = composeEventHandler(handleMouseOver, childrenProps.onMouseOver);\n childrenProps.onMouseLeave = composeEventHandler(handleMouseLeave, childrenProps.onMouseLeave);\n\n if (!disableInteractive) {\n interactiveWrapperListeners.onMouseOver = handleMouseOver;\n interactiveWrapperListeners.onMouseLeave = handleMouseLeave;\n }\n }\n\n if (!disableFocusListener) {\n childrenProps.onFocus = composeEventHandler(handleFocus, childrenProps.onFocus);\n childrenProps.onBlur = composeEventHandler(handleBlur, childrenProps.onBlur);\n\n if (!disableInteractive) {\n interactiveWrapperListeners.onFocus = handleFocus;\n interactiveWrapperListeners.onBlur = handleBlur;\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (children.props.title) {\n console.error(['MUI: You have provided a `title` prop to the child of .', `Remove this title prop \\`${children.props.title}\\` or the Tooltip component.`].join('\\n'));\n }\n }\n\n const popperOptions = React.useMemo(() => {\n var _PopperProps$popperOp;\n\n let tooltipModifiers = [{\n name: 'arrow',\n enabled: Boolean(arrowRef),\n options: {\n element: arrowRef,\n padding: 4\n }\n }];\n\n if ((_PopperProps$popperOp = PopperProps.popperOptions) != null && _PopperProps$popperOp.modifiers) {\n tooltipModifiers = tooltipModifiers.concat(PopperProps.popperOptions.modifiers);\n }\n\n return _extends({}, PopperProps.popperOptions, {\n modifiers: tooltipModifiers\n });\n }, [arrowRef, PopperProps]);\n\n const ownerState = _extends({}, props, {\n isRtl,\n arrow,\n disableInteractive,\n placement,\n PopperComponentProp,\n touch: ignoreNonTouchEvents.current\n });\n\n const classes = useUtilityClasses(ownerState);\n const PopperComponent = (_components$Popper = components.Popper) != null ? _components$Popper : TooltipPopper;\n const TransitionComponent = (_ref = (_components$Transitio = components.Transition) != null ? _components$Transitio : TransitionComponentProp) != null ? _ref : Grow;\n const TooltipComponent = (_components$Tooltip = components.Tooltip) != null ? _components$Tooltip : TooltipTooltip;\n const ArrowComponent = (_components$Arrow = components.Arrow) != null ? _components$Arrow : TooltipArrow;\n const popperProps = appendOwnerState(PopperComponent, _extends({}, PopperProps, componentsProps.popper), ownerState);\n const transitionProps = appendOwnerState(TransitionComponent, _extends({}, TransitionProps, componentsProps.transition), ownerState);\n const tooltipProps = appendOwnerState(TooltipComponent, _extends({}, componentsProps.tooltip), ownerState);\n const tooltipArrowProps = appendOwnerState(ArrowComponent, _extends({}, componentsProps.arrow), ownerState);\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/React.cloneElement(children, childrenProps), /*#__PURE__*/_jsx(PopperComponent, _extends({\n as: PopperComponentProp != null ? PopperComponentProp : Popper,\n placement: placement,\n anchorEl: followCursor ? {\n getBoundingClientRect: () => ({\n top: positionRef.current.y,\n left: positionRef.current.x,\n right: positionRef.current.x,\n bottom: positionRef.current.y,\n width: 0,\n height: 0\n })\n } : childNode,\n popperRef: popperRef,\n open: childNode ? open : false,\n id: id,\n transition: true\n }, interactiveWrapperListeners, popperProps, {\n className: clsx(classes.popper, PopperProps == null ? void 0 : PopperProps.className, (_componentsProps$popp = componentsProps.popper) == null ? void 0 : _componentsProps$popp.className),\n popperOptions: popperOptions,\n children: ({\n TransitionProps: TransitionPropsInner\n }) => {\n var _componentsProps$tool, _componentsProps$arro;\n\n return /*#__PURE__*/_jsx(TransitionComponent, _extends({\n timeout: theme.transitions.duration.shorter\n }, TransitionPropsInner, transitionProps, {\n children: /*#__PURE__*/_jsxs(TooltipComponent, _extends({}, tooltipProps, {\n className: clsx(classes.tooltip, (_componentsProps$tool = componentsProps.tooltip) == null ? void 0 : _componentsProps$tool.className),\n children: [title, arrow ? /*#__PURE__*/_jsx(ArrowComponent, _extends({}, tooltipArrowProps, {\n className: clsx(classes.arrow, (_componentsProps$arro = componentsProps.arrow) == null ? void 0 : _componentsProps$arro.className),\n ref: setArrowRef\n })) : null]\n }))\n }));\n }\n }))]\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Tooltip.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * If `true`, adds an arrow to the tooltip.\n * @default false\n */\n arrow: PropTypes.bool,\n\n /**\n * Tooltip reference element.\n */\n children: elementAcceptingRef.isRequired,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The components used for each slot inside the Tooltip.\n * Either a string to use a HTML element or a component.\n * @default {}\n */\n components: PropTypes.shape({\n Arrow: PropTypes.elementType,\n Popper: PropTypes.elementType,\n Tooltip: PropTypes.elementType,\n Transition: PropTypes.elementType\n }),\n\n /**\n * The props used for each slot inside the Tooltip.\n * Note that `componentsProps.popper` prop values win over `PopperProps`\n * and `componentsProps.transition` prop values win over `TransitionProps` if both are applied.\n * @default {}\n */\n componentsProps: PropTypes.shape({\n arrow: PropTypes.object,\n popper: PropTypes.object,\n tooltip: PropTypes.object,\n transition: PropTypes.object\n }),\n\n /**\n * Set to `true` if the `title` acts as an accessible description.\n * By default the `title` acts as an accessible label for the child.\n * @default false\n */\n describeChild: PropTypes.bool,\n\n /**\n * Do not respond to focus-visible events.\n * @default false\n */\n disableFocusListener: PropTypes.bool,\n\n /**\n * Do not respond to hover events.\n * @default false\n */\n disableHoverListener: PropTypes.bool,\n\n /**\n * Makes a tooltip not interactive, i.e. it will close when the user\n * hovers over the tooltip before the `leaveDelay` is expired.\n * @default false\n */\n disableInteractive: PropTypes.bool,\n\n /**\n * Do not respond to long press touch events.\n * @default false\n */\n disableTouchListener: PropTypes.bool,\n\n /**\n * The number of milliseconds to wait before showing the tooltip.\n * This prop won't impact the enter touch delay (`enterTouchDelay`).\n * @default 100\n */\n enterDelay: PropTypes.number,\n\n /**\n * The number of milliseconds to wait before showing the tooltip when one was already recently opened.\n * @default 0\n */\n enterNextDelay: PropTypes.number,\n\n /**\n * The number of milliseconds a user must touch the element before showing the tooltip.\n * @default 700\n */\n enterTouchDelay: PropTypes.number,\n\n /**\n * If `true`, the tooltip follow the cursor over the wrapped element.\n * @default false\n */\n followCursor: PropTypes.bool,\n\n /**\n * This prop is used to help implement the accessibility logic.\n * If you don't provide this prop. It falls back to a randomly generated id.\n */\n id: PropTypes.string,\n\n /**\n * The number of milliseconds to wait before hiding the tooltip.\n * This prop won't impact the leave touch delay (`leaveTouchDelay`).\n * @default 0\n */\n leaveDelay: PropTypes.number,\n\n /**\n * The number of milliseconds after the user stops touching an element before hiding the tooltip.\n * @default 1500\n */\n leaveTouchDelay: PropTypes.number,\n\n /**\n * Callback fired when the component requests to be closed.\n *\n * @param {React.SyntheticEvent} event The event source of the callback.\n */\n onClose: PropTypes.func,\n\n /**\n * Callback fired when the component requests to be open.\n *\n * @param {React.SyntheticEvent} event The event source of the callback.\n */\n onOpen: PropTypes.func,\n\n /**\n * If `true`, the component is shown.\n */\n open: PropTypes.bool,\n\n /**\n * Tooltip placement.\n * @default 'bottom'\n */\n placement: PropTypes.oneOf(['bottom-end', 'bottom-start', 'bottom', 'left-end', 'left-start', 'left', 'right-end', 'right-start', 'right', 'top-end', 'top-start', 'top']),\n\n /**\n * The component used for the popper.\n * @default Popper\n */\n PopperComponent: PropTypes.elementType,\n\n /**\n * Props applied to the [`Popper`](/material-ui/api/popper/) element.\n * @default {}\n */\n PopperProps: PropTypes.object,\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\n /**\n * Tooltip title. Zero-length titles string are never displayed.\n */\n title: PropTypes\n /* @typescript-to-proptypes-ignore */\n .node.isRequired,\n\n /**\n * The component used for the transition.\n * [Follow this guide](/material-ui/transitions/#transitioncomponent-prop) to learn more about the requirements for this component.\n * @default Grow\n */\n TransitionComponent: PropTypes.elementType,\n\n /**\n * Props applied to the transition element.\n * By default, the element is based on this [`Transition`](http://reactcommunity.org/react-transition-group/transition/) component.\n */\n TransitionProps: PropTypes.object\n} : void 0;\nexport default Tooltip;","import { generateUtilityClass, generateUtilityClasses } from '@mui/base';\nexport function getTypographyUtilityClass(slot) {\n return generateUtilityClass('MuiTypography', slot);\n}\nconst typographyClasses = generateUtilityClasses('MuiTypography', ['root', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'subtitle1', 'subtitle2', 'body1', 'body2', 'inherit', 'button', 'caption', 'overline', 'alignLeft', 'alignRight', 'alignCenter', 'alignJustify', 'noWrap', 'gutterBottom', 'paragraph']);\nexport default typographyClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"align\", \"className\", \"component\", \"gutterBottom\", \"noWrap\", \"paragraph\", \"variant\", \"variantMapping\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_extendSxProp as extendSxProp } from '@mui/system';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport capitalize from '../utils/capitalize';\nimport { getTypographyUtilityClass } from './typographyClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n align,\n gutterBottom,\n noWrap,\n paragraph,\n variant,\n classes\n } = ownerState;\n const slots = {\n root: ['root', variant, ownerState.align !== 'inherit' && `align${capitalize(align)}`, gutterBottom && 'gutterBottom', noWrap && 'noWrap', paragraph && 'paragraph']\n };\n return composeClasses(slots, getTypographyUtilityClass, classes);\n};\n\nexport const TypographyRoot = styled('span', {\n name: 'MuiTypography',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.variant && styles[ownerState.variant], ownerState.align !== 'inherit' && styles[`align${capitalize(ownerState.align)}`], ownerState.noWrap && styles.noWrap, ownerState.gutterBottom && styles.gutterBottom, ownerState.paragraph && styles.paragraph];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n margin: 0\n}, ownerState.variant && theme.typography[ownerState.variant], ownerState.align !== 'inherit' && {\n textAlign: ownerState.align\n}, ownerState.noWrap && {\n overflow: 'hidden',\n textOverflow: 'ellipsis',\n whiteSpace: 'nowrap'\n}, ownerState.gutterBottom && {\n marginBottom: '0.35em'\n}, ownerState.paragraph && {\n marginBottom: 16\n}));\nconst defaultVariantMapping = {\n h1: 'h1',\n h2: 'h2',\n h3: 'h3',\n h4: 'h4',\n h5: 'h5',\n h6: 'h6',\n subtitle1: 'h6',\n subtitle2: 'h6',\n body1: 'p',\n body2: 'p',\n inherit: 'p'\n}; // TODO v6: deprecate these color values in v5.x and remove the transformation in v6\n\nconst colorTransformations = {\n primary: 'primary.main',\n textPrimary: 'text.primary',\n secondary: 'secondary.main',\n textSecondary: 'text.secondary',\n error: 'error.main'\n};\n\nconst transformDeprecatedColors = color => {\n return colorTransformations[color] || color;\n};\n\nconst Typography = /*#__PURE__*/React.forwardRef(function Typography(inProps, ref) {\n const themeProps = useThemeProps({\n props: inProps,\n name: 'MuiTypography'\n });\n const color = transformDeprecatedColors(themeProps.color);\n const props = extendSxProp(_extends({}, themeProps, {\n color\n }));\n\n const {\n align = 'inherit',\n className,\n component,\n gutterBottom = false,\n noWrap = false,\n paragraph = false,\n variant = 'body1',\n variantMapping = defaultVariantMapping\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const ownerState = _extends({}, props, {\n align,\n color,\n className,\n component,\n gutterBottom,\n noWrap,\n paragraph,\n variant,\n variantMapping\n });\n\n const Component = component || (paragraph ? 'p' : variantMapping[variant] || defaultVariantMapping[variant]) || 'span';\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(TypographyRoot, _extends({\n as: Component,\n ref: ref,\n ownerState: ownerState,\n className: clsx(classes.root, className)\n }, other));\n});\nprocess.env.NODE_ENV !== \"production\" ? Typography.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * Set the text-align on the component.\n * @default 'inherit'\n */\n align: PropTypes.oneOf(['center', 'inherit', 'justify', 'left', 'right']),\n\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n\n /**\n * If `true`, the text will have a bottom margin.\n * @default false\n */\n gutterBottom: PropTypes.bool,\n\n /**\n * If `true`, the text will not wrap, but instead will truncate with a text overflow ellipsis.\n *\n * Note that text overflow can only happen with block or inline-block level elements\n * (the element needs to have a width in order to overflow).\n * @default false\n */\n noWrap: PropTypes.bool,\n\n /**\n * If `true`, the element will be a paragraph element.\n * @default false\n */\n paragraph: PropTypes.bool,\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\n /**\n * Applies the theme typography styles.\n * @default 'body1'\n */\n variant: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.oneOf(['body1', 'body2', 'button', 'caption', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'inherit', 'overline', 'subtitle1', 'subtitle2']), PropTypes.string]),\n\n /**\n * The component maps the variant prop to a range of different HTML element types.\n * For instance, subtitle1 to ``.\n * If you wish to change that mapping, you can provide your own.\n * Alternatively, you can use the `component` prop.\n * @default {\n * h1: 'h1',\n * h2: 'h2',\n * h3: 'h3',\n * h4: 'h4',\n * h5: 'h5',\n * h6: 'h6',\n * subtitle1: 'h6',\n * subtitle2: 'h6',\n * body1: 'p',\n * body2: 'p',\n * inherit: 'p',\n * }\n */\n variantMapping: PropTypes\n /* @typescript-to-proptypes-ignore */\n .object\n} : void 0;\nexport default Typography;","import { generateUtilityClass, generateUtilityClasses } from '@mui/base';\nexport function getSwitchBaseUtilityClass(slot) {\n return generateUtilityClass('PrivateSwitchBase', slot);\n}\nconst switchBaseClasses = generateUtilityClasses('PrivateSwitchBase', ['root', 'checked', 'disabled', 'input', 'edgeStart', 'edgeEnd']);\nexport default switchBaseClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"autoFocus\", \"checked\", \"checkedIcon\", \"className\", \"defaultChecked\", \"disabled\", \"disableFocusRipple\", \"edge\", \"icon\", \"id\", \"inputProps\", \"inputRef\", \"name\", \"onBlur\", \"onChange\", \"onFocus\", \"readOnly\", \"required\", \"tabIndex\", \"type\", \"value\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { refType } from '@mui/utils';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport capitalize from '../utils/capitalize';\nimport styled from '../styles/styled';\nimport useControlled from '../utils/useControlled';\nimport useFormControl from '../FormControl/useFormControl';\nimport ButtonBase from '../ButtonBase';\nimport { getSwitchBaseUtilityClass } from './switchBaseClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n checked,\n disabled,\n edge\n } = ownerState;\n const slots = {\n root: ['root', checked && 'checked', disabled && 'disabled', edge && `edge${capitalize(edge)}`],\n input: ['input']\n };\n return composeClasses(slots, getSwitchBaseUtilityClass, classes);\n};\n\nconst SwitchBaseRoot = styled(ButtonBase)(({\n ownerState\n}) => _extends({\n padding: 9,\n borderRadius: '50%'\n}, ownerState.edge === 'start' && {\n marginLeft: ownerState.size === 'small' ? -3 : -12\n}, ownerState.edge === 'end' && {\n marginRight: ownerState.size === 'small' ? -3 : -12\n}));\nconst SwitchBaseInput = styled('input')({\n cursor: 'inherit',\n position: 'absolute',\n opacity: 0,\n width: '100%',\n height: '100%',\n top: 0,\n left: 0,\n margin: 0,\n padding: 0,\n zIndex: 1\n});\n/**\n * @ignore - internal component.\n */\n\nconst SwitchBase = /*#__PURE__*/React.forwardRef(function SwitchBase(props, ref) {\n const {\n autoFocus,\n checked: checkedProp,\n checkedIcon,\n className,\n defaultChecked,\n disabled: disabledProp,\n disableFocusRipple = false,\n edge = false,\n icon,\n id,\n inputProps,\n inputRef,\n name,\n onBlur,\n onChange,\n onFocus,\n readOnly,\n required,\n tabIndex,\n type,\n value\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const [checked, setCheckedState] = useControlled({\n controlled: checkedProp,\n default: Boolean(defaultChecked),\n name: 'SwitchBase',\n state: 'checked'\n });\n const muiFormControl = useFormControl();\n\n const handleFocus = event => {\n if (onFocus) {\n onFocus(event);\n }\n\n if (muiFormControl && muiFormControl.onFocus) {\n muiFormControl.onFocus(event);\n }\n };\n\n const handleBlur = event => {\n if (onBlur) {\n onBlur(event);\n }\n\n if (muiFormControl && muiFormControl.onBlur) {\n muiFormControl.onBlur(event);\n }\n };\n\n const handleInputChange = event => {\n // Workaround for https://github.com/facebook/react/issues/9023\n if (event.nativeEvent.defaultPrevented) {\n return;\n }\n\n const newChecked = event.target.checked;\n setCheckedState(newChecked);\n\n if (onChange) {\n // TODO v6: remove the second argument.\n onChange(event, newChecked);\n }\n };\n\n let disabled = disabledProp;\n\n if (muiFormControl) {\n if (typeof disabled === 'undefined') {\n disabled = muiFormControl.disabled;\n }\n }\n\n const hasLabelFor = type === 'checkbox' || type === 'radio';\n\n const ownerState = _extends({}, props, {\n checked,\n disabled,\n disableFocusRipple,\n edge\n });\n\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(SwitchBaseRoot, _extends({\n component: \"span\",\n className: clsx(classes.root, className),\n centerRipple: true,\n focusRipple: !disableFocusRipple,\n disabled: disabled,\n tabIndex: null,\n role: undefined,\n onFocus: handleFocus,\n onBlur: handleBlur,\n ownerState: ownerState,\n ref: ref\n }, other, {\n children: [/*#__PURE__*/_jsx(SwitchBaseInput, _extends({\n autoFocus: autoFocus,\n checked: checkedProp,\n defaultChecked: defaultChecked,\n className: classes.input,\n disabled: disabled,\n id: hasLabelFor && id,\n name: name,\n onChange: handleInputChange,\n readOnly: readOnly,\n ref: inputRef,\n required: required,\n ownerState: ownerState,\n tabIndex: tabIndex,\n type: type\n }, type === 'checkbox' && value === undefined ? {} : {\n value\n }, inputProps)), checked ? checkedIcon : icon]\n }));\n}); // NB: If changed, please update Checkbox, Switch and Radio\n// so that the API documentation is updated.\n\nprocess.env.NODE_ENV !== \"production\" ? SwitchBase.propTypes = {\n /**\n * If `true`, the `input` element is focused during the first mount.\n */\n autoFocus: PropTypes.bool,\n\n /**\n * If `true`, the component is checked.\n */\n checked: PropTypes.bool,\n\n /**\n * The icon to display when the component is checked.\n */\n checkedIcon: PropTypes.node.isRequired,\n\n /**\n * Override or extend the styles applied to the component.\n * See [CSS API](#css) below for more details.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * @ignore\n */\n defaultChecked: PropTypes.bool,\n\n /**\n * If `true`, the component is disabled.\n */\n disabled: PropTypes.bool,\n\n /**\n * If `true`, the keyboard focus ripple is disabled.\n * @default false\n */\n disableFocusRipple: PropTypes.bool,\n\n /**\n * If given, uses a negative margin to counteract the padding on one\n * side (this is often helpful for aligning the left or right\n * side of the icon with content above or below, without ruining the border\n * size and shape).\n * @default false\n */\n edge: PropTypes.oneOf(['end', 'start', false]),\n\n /**\n * The icon to display when the component is unchecked.\n */\n icon: PropTypes.node.isRequired,\n\n /**\n * The id of the `input` element.\n */\n id: PropTypes.string,\n\n /**\n * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.\n */\n inputProps: PropTypes.object,\n\n /**\n * Pass a ref to the `input` element.\n */\n inputRef: refType,\n\n /*\n * @ignore\n */\n name: PropTypes.string,\n\n /**\n * @ignore\n */\n onBlur: PropTypes.func,\n\n /**\n * Callback fired when the state is changed.\n *\n * @param {object} event The event source of the callback.\n * You can pull out the new checked state by accessing `event.target.checked` (boolean).\n */\n onChange: PropTypes.func,\n\n /**\n * @ignore\n */\n onFocus: PropTypes.func,\n\n /**\n * It prevents the user from changing the value of the field\n * (not from interacting with the field).\n */\n readOnly: PropTypes.bool,\n\n /**\n * If `true`, the `input` element is required.\n */\n required: PropTypes.bool,\n\n /**\n * The system prop that allows defining system overrides as well as additional CSS styles.\n */\n sx: PropTypes.object,\n\n /**\n * @ignore\n */\n tabIndex: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n\n /**\n * The input component prop `type`.\n */\n type: PropTypes.string.isRequired,\n\n /**\n * The value of the component.\n */\n value: PropTypes.any\n} : void 0;\nexport default SwitchBase;","import * as React from 'react';\nimport createSvgIcon from '../../utils/createSvgIcon';\n/**\n * @ignore - internal component.\n */\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M7 10l5 5 5-5z\"\n}), 'ArrowDropDown');","import * as React from 'react';\nimport createSvgIcon from '../../utils/createSvgIcon';\n/**\n * @ignore - internal component.\n */\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M18.41 16.59L13.82 12l4.59-4.59L17 6l-6 6 6 6zM6 6h2v12H6z\"\n}), 'FirstPage');","import * as React from 'react';\nimport createSvgIcon from '../../utils/createSvgIcon';\n/**\n * @ignore - internal component.\n */\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M5.59 7.41L10.18 12l-4.59 4.59L7 18l6-6-6-6zM16 6h2v12h-2z\"\n}), 'LastPage');","import _extends from \"@babel/runtime/helpers/esm/extends\";\n\n/* eslint-disable no-constant-condition */\nimport * as React from 'react';\nimport { unstable_setRef as setRef, unstable_useEventCallback as useEventCallback, unstable_useControlled as useControlled, unstable_useId as useId } from '@mui/utils'; // https://stackoverflow.com/questions/990904/remove-accents-diacritics-in-a-string-in-javascript\n// Give up on IE11 support for this feature\n\nfunction stripDiacritics(string) {\n return typeof string.normalize !== 'undefined' ? string.normalize('NFD').replace(/[\\u0300-\\u036f]/g, '') : string;\n}\n\nexport function createFilterOptions(config = {}) {\n const {\n ignoreAccents = true,\n ignoreCase = true,\n limit,\n matchFrom = 'any',\n stringify,\n trim = false\n } = config;\n return (options, {\n inputValue,\n getOptionLabel\n }) => {\n let input = trim ? inputValue.trim() : inputValue;\n\n if (ignoreCase) {\n input = input.toLowerCase();\n }\n\n if (ignoreAccents) {\n input = stripDiacritics(input);\n }\n\n const filteredOptions = options.filter(option => {\n let candidate = (stringify || getOptionLabel)(option);\n\n if (ignoreCase) {\n candidate = candidate.toLowerCase();\n }\n\n if (ignoreAccents) {\n candidate = stripDiacritics(candidate);\n }\n\n return matchFrom === 'start' ? candidate.indexOf(input) === 0 : candidate.indexOf(input) > -1;\n });\n return typeof limit === 'number' ? filteredOptions.slice(0, limit) : filteredOptions;\n };\n} // To replace with .findIndex() once we stop IE11 support.\n\nfunction findIndex(array, comp) {\n for (let i = 0; i < array.length; i += 1) {\n if (comp(array[i])) {\n return i;\n }\n }\n\n return -1;\n}\n\nconst defaultFilterOptions = createFilterOptions(); // Number of options to jump in list box when pageup and pagedown keys are used.\n\nconst pageSize = 5;\nexport default function useAutocomplete(props) {\n const {\n autoComplete = false,\n autoHighlight = false,\n autoSelect = false,\n blurOnSelect = false,\n disabled: disabledProp,\n clearOnBlur = !props.freeSolo,\n clearOnEscape = false,\n componentName = 'useAutocomplete',\n defaultValue = props.multiple ? [] : null,\n disableClearable = false,\n disableCloseOnSelect = false,\n disabledItemsFocusable = false,\n disableListWrap = false,\n filterOptions = defaultFilterOptions,\n filterSelectedOptions = false,\n freeSolo = false,\n getOptionDisabled,\n getOptionLabel: getOptionLabelProp = option => {\n var _option$label;\n\n return (_option$label = option.label) != null ? _option$label : option;\n },\n isOptionEqualToValue = (option, value) => option === value,\n groupBy,\n handleHomeEndKeys = !props.freeSolo,\n id: idProp,\n includeInputInList = false,\n inputValue: inputValueProp,\n multiple = false,\n onChange,\n onClose,\n onHighlightChange,\n onInputChange,\n onOpen,\n open: openProp,\n openOnFocus = false,\n options,\n readOnly = false,\n selectOnFocus = !props.freeSolo,\n value: valueProp\n } = props;\n const id = useId(idProp);\n let getOptionLabel = getOptionLabelProp;\n\n getOptionLabel = option => {\n const optionLabel = getOptionLabelProp(option);\n\n if (typeof optionLabel !== 'string') {\n if (process.env.NODE_ENV !== 'production') {\n const erroneousReturn = optionLabel === undefined ? 'undefined' : `${typeof optionLabel} (${optionLabel})`;\n console.error(`MUI: The \\`getOptionLabel\\` method of ${componentName} returned ${erroneousReturn} instead of a string for ${JSON.stringify(option)}.`);\n }\n\n return String(optionLabel);\n }\n\n return optionLabel;\n };\n\n const ignoreFocus = React.useRef(false);\n const firstFocus = React.useRef(true);\n const inputRef = React.useRef(null);\n const listboxRef = React.useRef(null);\n const [anchorEl, setAnchorEl] = React.useState(null);\n const [focusedTag, setFocusedTag] = React.useState(-1);\n const defaultHighlighted = autoHighlight ? 0 : -1;\n const highlightedIndexRef = React.useRef(defaultHighlighted);\n const [value, setValueState] = useControlled({\n controlled: valueProp,\n default: defaultValue,\n name: componentName\n });\n const [inputValue, setInputValueState] = useControlled({\n controlled: inputValueProp,\n default: '',\n name: componentName,\n state: 'inputValue'\n });\n const [focused, setFocused] = React.useState(false);\n const resetInputValue = React.useCallback((event, newValue) => {\n // retain current `inputValue` if new option isn't selected and `clearOnBlur` is false\n // When `multiple` is enabled, `newValue` is an array of all selected items including the newly selected item\n const isOptionSelected = multiple ? value.length < newValue.length : newValue !== null;\n\n if (!isOptionSelected && !clearOnBlur) {\n return;\n }\n\n let newInputValue;\n\n if (multiple) {\n newInputValue = '';\n } else if (newValue == null) {\n newInputValue = '';\n } else {\n const optionLabel = getOptionLabel(newValue);\n newInputValue = typeof optionLabel === 'string' ? optionLabel : '';\n }\n\n if (inputValue === newInputValue) {\n return;\n }\n\n setInputValueState(newInputValue);\n\n if (onInputChange) {\n onInputChange(event, newInputValue, 'reset');\n }\n }, [getOptionLabel, inputValue, multiple, onInputChange, setInputValueState, clearOnBlur, value]);\n const prevValue = React.useRef();\n React.useEffect(() => {\n const valueChange = value !== prevValue.current;\n prevValue.current = value;\n\n if (focused && !valueChange) {\n return;\n } // Only reset the input's value when freeSolo if the component's value changes.\n\n\n if (freeSolo && !valueChange) {\n return;\n }\n\n resetInputValue(null, value);\n }, [value, resetInputValue, focused, prevValue, freeSolo]);\n const [open, setOpenState] = useControlled({\n controlled: openProp,\n default: false,\n name: componentName,\n state: 'open'\n });\n const [inputPristine, setInputPristine] = React.useState(true);\n const inputValueIsSelectedValue = !multiple && value != null && inputValue === getOptionLabel(value);\n const popupOpen = open && !readOnly;\n const filteredOptions = popupOpen ? filterOptions(options.filter(option => {\n if (filterSelectedOptions && (multiple ? value : [value]).some(value2 => value2 !== null && isOptionEqualToValue(option, value2))) {\n return false;\n }\n\n return true;\n }), // we use the empty string to manipulate `filterOptions` to not filter any options\n // i.e. the filter predicate always returns true\n {\n inputValue: inputValueIsSelectedValue && inputPristine ? '' : inputValue,\n getOptionLabel\n }) : [];\n const listboxAvailable = open && filteredOptions.length > 0 && !readOnly;\n\n if (process.env.NODE_ENV !== 'production') {\n if (value !== null && !freeSolo && options.length > 0) {\n const missingValue = (multiple ? value : [value]).filter(value2 => !options.some(option => isOptionEqualToValue(option, value2)));\n\n if (missingValue.length > 0) {\n console.warn([`MUI: The value provided to ${componentName} is invalid.`, `None of the options match with \\`${missingValue.length > 1 ? JSON.stringify(missingValue) : JSON.stringify(missingValue[0])}\\`.`, 'You can use the `isOptionEqualToValue` prop to customize the equality test.'].join('\\n'));\n }\n }\n }\n\n const focusTag = useEventCallback(tagToFocus => {\n if (tagToFocus === -1) {\n inputRef.current.focus();\n } else {\n anchorEl.querySelector(`[data-tag-index=\"${tagToFocus}\"]`).focus();\n }\n }); // Ensure the focusedTag is never inconsistent\n\n React.useEffect(() => {\n if (multiple && focusedTag > value.length - 1) {\n setFocusedTag(-1);\n focusTag(-1);\n }\n }, [value, multiple, focusedTag, focusTag]);\n\n function validOptionIndex(index, direction) {\n if (!listboxRef.current || index === -1) {\n return -1;\n }\n\n let nextFocus = index;\n\n while (true) {\n // Out of range\n if (direction === 'next' && nextFocus === filteredOptions.length || direction === 'previous' && nextFocus === -1) {\n return -1;\n }\n\n const option = listboxRef.current.querySelector(`[data-option-index=\"${nextFocus}\"]`); // Same logic as MenuList.js\n\n const nextFocusDisabled = disabledItemsFocusable ? false : !option || option.disabled || option.getAttribute('aria-disabled') === 'true';\n\n if (option && !option.hasAttribute('tabindex') || nextFocusDisabled) {\n // Move to the next element.\n nextFocus += direction === 'next' ? 1 : -1;\n } else {\n return nextFocus;\n }\n }\n }\n\n const setHighlightedIndex = useEventCallback(({\n event,\n index,\n reason = 'auto'\n }) => {\n highlightedIndexRef.current = index; // does the index exist?\n\n if (index === -1) {\n inputRef.current.removeAttribute('aria-activedescendant');\n } else {\n inputRef.current.setAttribute('aria-activedescendant', `${id}-option-${index}`);\n }\n\n if (onHighlightChange) {\n onHighlightChange(event, index === -1 ? null : filteredOptions[index], reason);\n }\n\n if (!listboxRef.current) {\n return;\n }\n\n const prev = listboxRef.current.querySelector('[role=\"option\"].Mui-focused');\n\n if (prev) {\n prev.classList.remove('Mui-focused');\n prev.classList.remove('Mui-focusVisible');\n }\n\n const listboxNode = listboxRef.current.parentElement.querySelector('[role=\"listbox\"]'); // \"No results\"\n\n if (!listboxNode) {\n return;\n }\n\n if (index === -1) {\n listboxNode.scrollTop = 0;\n return;\n }\n\n const option = listboxRef.current.querySelector(`[data-option-index=\"${index}\"]`);\n\n if (!option) {\n return;\n }\n\n option.classList.add('Mui-focused');\n\n if (reason === 'keyboard') {\n option.classList.add('Mui-focusVisible');\n } // Scroll active descendant into view.\n // Logic copied from https://www.w3.org/TR/wai-aria-practices/examples/listbox/js/listbox.js\n //\n // Consider this API instead once it has a better browser support:\n // .scrollIntoView({ scrollMode: 'if-needed', block: 'nearest' });\n\n\n if (listboxNode.scrollHeight > listboxNode.clientHeight && reason !== 'mouse') {\n const element = option;\n const scrollBottom = listboxNode.clientHeight + listboxNode.scrollTop;\n const elementBottom = element.offsetTop + element.offsetHeight;\n\n if (elementBottom > scrollBottom) {\n listboxNode.scrollTop = elementBottom - listboxNode.clientHeight;\n } else if (element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0) < listboxNode.scrollTop) {\n listboxNode.scrollTop = element.offsetTop - element.offsetHeight * (groupBy ? 1.3 : 0);\n }\n }\n });\n const changeHighlightedIndex = useEventCallback(({\n event,\n diff,\n direction = 'next',\n reason = 'auto'\n }) => {\n if (!popupOpen) {\n return;\n }\n\n const getNextIndex = () => {\n const maxIndex = filteredOptions.length - 1;\n\n if (diff === 'reset') {\n return defaultHighlighted;\n }\n\n if (diff === 'start') {\n return 0;\n }\n\n if (diff === 'end') {\n return maxIndex;\n }\n\n const newIndex = highlightedIndexRef.current + diff;\n\n if (newIndex < 0) {\n if (newIndex === -1 && includeInputInList) {\n return -1;\n }\n\n if (disableListWrap && highlightedIndexRef.current !== -1 || Math.abs(diff) > 1) {\n return 0;\n }\n\n return maxIndex;\n }\n\n if (newIndex > maxIndex) {\n if (newIndex === maxIndex + 1 && includeInputInList) {\n return -1;\n }\n\n if (disableListWrap || Math.abs(diff) > 1) {\n return maxIndex;\n }\n\n return 0;\n }\n\n return newIndex;\n };\n\n const nextIndex = validOptionIndex(getNextIndex(), direction);\n setHighlightedIndex({\n index: nextIndex,\n reason,\n event\n }); // Sync the content of the input with the highlighted option.\n\n if (autoComplete && diff !== 'reset') {\n if (nextIndex === -1) {\n inputRef.current.value = inputValue;\n } else {\n const option = getOptionLabel(filteredOptions[nextIndex]);\n inputRef.current.value = option; // The portion of the selected suggestion that has not been typed by the user,\n // a completion string, appears inline after the input cursor in the textbox.\n\n const index = option.toLowerCase().indexOf(inputValue.toLowerCase());\n\n if (index === 0 && inputValue.length > 0) {\n inputRef.current.setSelectionRange(inputValue.length, option.length);\n }\n }\n }\n });\n const syncHighlightedIndex = React.useCallback(() => {\n if (!popupOpen) {\n return;\n }\n\n const valueItem = multiple ? value[0] : value; // The popup is empty, reset\n\n if (filteredOptions.length === 0 || valueItem == null) {\n changeHighlightedIndex({\n diff: 'reset'\n });\n return;\n }\n\n if (!listboxRef.current) {\n return;\n } // Synchronize the value with the highlighted index\n\n\n if (valueItem != null) {\n const currentOption = filteredOptions[highlightedIndexRef.current]; // Keep the current highlighted index if possible\n\n if (multiple && currentOption && findIndex(value, val => isOptionEqualToValue(currentOption, val)) !== -1) {\n return;\n }\n\n const itemIndex = findIndex(filteredOptions, optionItem => isOptionEqualToValue(optionItem, valueItem));\n\n if (itemIndex === -1) {\n changeHighlightedIndex({\n diff: 'reset'\n });\n } else {\n setHighlightedIndex({\n index: itemIndex\n });\n }\n\n return;\n } // Prevent the highlighted index to leak outside the boundaries.\n\n\n if (highlightedIndexRef.current >= filteredOptions.length - 1) {\n setHighlightedIndex({\n index: filteredOptions.length - 1\n });\n return;\n } // Restore the focus to the previous index.\n\n\n setHighlightedIndex({\n index: highlightedIndexRef.current\n }); // Ignore filteredOptions (and options, isOptionEqualToValue, getOptionLabel) not to break the scroll position\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [// Only sync the highlighted index when the option switch between empty and not\n filteredOptions.length, // Don't sync the highlighted index with the value when multiple\n // eslint-disable-next-line react-hooks/exhaustive-deps\n multiple ? false : value, filterSelectedOptions, changeHighlightedIndex, setHighlightedIndex, popupOpen, inputValue, multiple]);\n const handleListboxRef = useEventCallback(node => {\n setRef(listboxRef, node);\n\n if (!node) {\n return;\n }\n\n syncHighlightedIndex();\n });\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useEffect(() => {\n if (!inputRef.current || inputRef.current.nodeName !== 'INPUT') {\n if (inputRef.current && inputRef.current.nodeName === 'TEXTAREA') {\n console.warn([`A textarea element was provided to ${componentName} where input was expected.`, `This is not a supported scenario but it may work under certain conditions.`, `A textarea keyboard navigation may conflict with Autocomplete controls (e.g. enter and arrow keys).`, `Make sure to test keyboard navigation and add custom event handlers if necessary.`].join('\\n'));\n } else {\n console.error([`MUI: Unable to find the input element. It was resolved to ${inputRef.current} while an HTMLInputElement was expected.`, `Instead, ${componentName} expects an input element.`, '', componentName === 'useAutocomplete' ? 'Make sure you have binded getInputProps correctly and that the normal ref/effect resolutions order is guaranteed.' : 'Make sure you have customized the input component correctly.'].join('\\n'));\n }\n }\n }, [componentName]);\n }\n\n React.useEffect(() => {\n syncHighlightedIndex();\n }, [syncHighlightedIndex]);\n\n const handleOpen = event => {\n if (open) {\n return;\n }\n\n setOpenState(true);\n setInputPristine(true);\n\n if (onOpen) {\n onOpen(event);\n }\n };\n\n const handleClose = (event, reason) => {\n if (!open) {\n return;\n }\n\n setOpenState(false);\n\n if (onClose) {\n onClose(event, reason);\n }\n };\n\n const handleValue = (event, newValue, reason, details) => {\n if (multiple) {\n if (value.length === newValue.length && value.every((val, i) => val === newValue[i])) {\n return;\n }\n } else if (value === newValue) {\n return;\n }\n\n if (onChange) {\n onChange(event, newValue, reason, details);\n }\n\n setValueState(newValue);\n };\n\n const isTouch = React.useRef(false);\n\n const selectNewValue = (event, option, reasonProp = 'selectOption', origin = 'options') => {\n let reason = reasonProp;\n let newValue = option;\n\n if (multiple) {\n newValue = Array.isArray(value) ? value.slice() : [];\n\n if (process.env.NODE_ENV !== 'production') {\n const matches = newValue.filter(val => isOptionEqualToValue(option, val));\n\n if (matches.length > 1) {\n console.error([`MUI: The \\`isOptionEqualToValue\\` method of ${componentName} do not handle the arguments correctly.`, `The component expects a single value to match a given option but found ${matches.length} matches.`].join('\\n'));\n }\n }\n\n const itemIndex = findIndex(newValue, valueItem => isOptionEqualToValue(option, valueItem));\n\n if (itemIndex === -1) {\n newValue.push(option);\n } else if (origin !== 'freeSolo') {\n newValue.splice(itemIndex, 1);\n reason = 'removeOption';\n }\n }\n\n resetInputValue(event, newValue);\n handleValue(event, newValue, reason, {\n option\n });\n\n if (!disableCloseOnSelect && !event.ctrlKey && !event.metaKey) {\n handleClose(event, reason);\n }\n\n if (blurOnSelect === true || blurOnSelect === 'touch' && isTouch.current || blurOnSelect === 'mouse' && !isTouch.current) {\n inputRef.current.blur();\n }\n };\n\n function validTagIndex(index, direction) {\n if (index === -1) {\n return -1;\n }\n\n let nextFocus = index;\n\n while (true) {\n // Out of range\n if (direction === 'next' && nextFocus === value.length || direction === 'previous' && nextFocus === -1) {\n return -1;\n }\n\n const option = anchorEl.querySelector(`[data-tag-index=\"${nextFocus}\"]`); // Same logic as MenuList.js\n\n if (!option || !option.hasAttribute('tabindex') || option.disabled || option.getAttribute('aria-disabled') === 'true') {\n nextFocus += direction === 'next' ? 1 : -1;\n } else {\n return nextFocus;\n }\n }\n }\n\n const handleFocusTag = (event, direction) => {\n if (!multiple) {\n return;\n }\n\n if (inputValue === '') {\n handleClose(event, 'toggleInput');\n }\n\n let nextTag = focusedTag;\n\n if (focusedTag === -1) {\n if (inputValue === '' && direction === 'previous') {\n nextTag = value.length - 1;\n }\n } else {\n nextTag += direction === 'next' ? 1 : -1;\n\n if (nextTag < 0) {\n nextTag = 0;\n }\n\n if (nextTag === value.length) {\n nextTag = -1;\n }\n }\n\n nextTag = validTagIndex(nextTag, direction);\n setFocusedTag(nextTag);\n focusTag(nextTag);\n };\n\n const handleClear = event => {\n ignoreFocus.current = true;\n setInputValueState('');\n\n if (onInputChange) {\n onInputChange(event, '', 'clear');\n }\n\n handleValue(event, multiple ? [] : null, 'clear');\n };\n\n const handleKeyDown = other => event => {\n if (other.onKeyDown) {\n other.onKeyDown(event);\n }\n\n if (event.defaultMuiPrevented) {\n return;\n }\n\n if (focusedTag !== -1 && ['ArrowLeft', 'ArrowRight'].indexOf(event.key) === -1) {\n setFocusedTag(-1);\n focusTag(-1);\n } // Wait until IME is settled.\n\n\n if (event.which !== 229) {\n switch (event.key) {\n case 'Home':\n if (popupOpen && handleHomeEndKeys) {\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: 'start',\n direction: 'next',\n reason: 'keyboard',\n event\n });\n }\n\n break;\n\n case 'End':\n if (popupOpen && handleHomeEndKeys) {\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: 'end',\n direction: 'previous',\n reason: 'keyboard',\n event\n });\n }\n\n break;\n\n case 'PageUp':\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: -pageSize,\n direction: 'previous',\n reason: 'keyboard',\n event\n });\n handleOpen(event);\n break;\n\n case 'PageDown':\n // Prevent scroll of the page\n event.preventDefault();\n changeHighlightedIndex({\n diff: pageSize,\n direction: 'next',\n reason: 'keyboard',\n event\n });\n handleOpen(event);\n break;\n\n case 'ArrowDown':\n // Prevent cursor move\n event.preventDefault();\n changeHighlightedIndex({\n diff: 1,\n direction: 'next',\n reason: 'keyboard',\n event\n });\n handleOpen(event);\n break;\n\n case 'ArrowUp':\n // Prevent cursor move\n event.preventDefault();\n changeHighlightedIndex({\n diff: -1,\n direction: 'previous',\n reason: 'keyboard',\n event\n });\n handleOpen(event);\n break;\n\n case 'ArrowLeft':\n handleFocusTag(event, 'previous');\n break;\n\n case 'ArrowRight':\n handleFocusTag(event, 'next');\n break;\n\n case 'Enter':\n if (highlightedIndexRef.current !== -1 && popupOpen) {\n const option = filteredOptions[highlightedIndexRef.current];\n const disabled = getOptionDisabled ? getOptionDisabled(option) : false; // Avoid early form validation, let the end-users continue filling the form.\n\n event.preventDefault();\n\n if (disabled) {\n return;\n }\n\n selectNewValue(event, option, 'selectOption'); // Move the selection to the end.\n\n if (autoComplete) {\n inputRef.current.setSelectionRange(inputRef.current.value.length, inputRef.current.value.length);\n }\n } else if (freeSolo && inputValue !== '' && inputValueIsSelectedValue === false) {\n if (multiple) {\n // Allow people to add new values before they submit the form.\n event.preventDefault();\n }\n\n selectNewValue(event, inputValue, 'createOption', 'freeSolo');\n }\n\n break;\n\n case 'Escape':\n if (popupOpen) {\n // Avoid Opera to exit fullscreen mode.\n event.preventDefault(); // Avoid the Modal to handle the event.\n\n event.stopPropagation();\n handleClose(event, 'escape');\n } else if (clearOnEscape && (inputValue !== '' || multiple && value.length > 0)) {\n // Avoid Opera to exit fullscreen mode.\n event.preventDefault(); // Avoid the Modal to handle the event.\n\n event.stopPropagation();\n handleClear(event);\n }\n\n break;\n\n case 'Backspace':\n if (multiple && !readOnly && inputValue === '' && value.length > 0) {\n const index = focusedTag === -1 ? value.length - 1 : focusedTag;\n const newValue = value.slice();\n newValue.splice(index, 1);\n handleValue(event, newValue, 'removeOption', {\n option: value[index]\n });\n }\n\n break;\n\n default:\n }\n }\n };\n\n const handleFocus = event => {\n setFocused(true);\n\n if (openOnFocus && !ignoreFocus.current) {\n handleOpen(event);\n }\n };\n\n const handleBlur = event => {\n // Ignore the event when using the scrollbar with IE11\n if (listboxRef.current !== null && listboxRef.current.parentElement.contains(document.activeElement)) {\n inputRef.current.focus();\n return;\n }\n\n setFocused(false);\n firstFocus.current = true;\n ignoreFocus.current = false;\n\n if (autoSelect && highlightedIndexRef.current !== -1 && popupOpen) {\n selectNewValue(event, filteredOptions[highlightedIndexRef.current], 'blur');\n } else if (autoSelect && freeSolo && inputValue !== '') {\n selectNewValue(event, inputValue, 'blur', 'freeSolo');\n } else if (clearOnBlur) {\n resetInputValue(event, value);\n }\n\n handleClose(event, 'blur');\n };\n\n const handleInputChange = event => {\n const newValue = event.target.value;\n\n if (inputValue !== newValue) {\n setInputValueState(newValue);\n setInputPristine(false);\n\n if (onInputChange) {\n onInputChange(event, newValue, 'input');\n }\n }\n\n if (newValue === '') {\n if (!disableClearable && !multiple) {\n handleValue(event, null, 'clear');\n }\n } else {\n handleOpen(event);\n }\n };\n\n const handleOptionMouseOver = event => {\n setHighlightedIndex({\n event,\n index: Number(event.currentTarget.getAttribute('data-option-index')),\n reason: 'mouse'\n });\n };\n\n const handleOptionTouchStart = () => {\n isTouch.current = true;\n };\n\n const handleOptionClick = event => {\n const index = Number(event.currentTarget.getAttribute('data-option-index'));\n selectNewValue(event, filteredOptions[index], 'selectOption');\n isTouch.current = false;\n };\n\n const handleTagDelete = index => event => {\n const newValue = value.slice();\n newValue.splice(index, 1);\n handleValue(event, newValue, 'removeOption', {\n option: value[index]\n });\n };\n\n const handlePopupIndicator = event => {\n if (open) {\n handleClose(event, 'toggleInput');\n } else {\n handleOpen(event);\n }\n }; // Prevent input blur when interacting with the combobox\n\n\n const handleMouseDown = event => {\n if (event.target.getAttribute('id') !== id) {\n event.preventDefault();\n }\n }; // Focus the input when interacting with the combobox\n\n\n const handleClick = () => {\n inputRef.current.focus();\n\n if (selectOnFocus && firstFocus.current && inputRef.current.selectionEnd - inputRef.current.selectionStart === 0) {\n inputRef.current.select();\n }\n\n firstFocus.current = false;\n };\n\n const handleInputMouseDown = event => {\n if (inputValue === '' || !open) {\n handlePopupIndicator(event);\n }\n };\n\n let dirty = freeSolo && inputValue.length > 0;\n dirty = dirty || (multiple ? value.length > 0 : value !== null);\n let groupedOptions = filteredOptions;\n\n if (groupBy) {\n // used to keep track of key and indexes in the result array\n const indexBy = new Map();\n let warn = false;\n groupedOptions = filteredOptions.reduce((acc, option, index) => {\n const group = groupBy(option);\n\n if (acc.length > 0 && acc[acc.length - 1].group === group) {\n acc[acc.length - 1].options.push(option);\n } else {\n if (process.env.NODE_ENV !== 'production') {\n if (indexBy.get(group) && !warn) {\n console.warn(`MUI: The options provided combined with the \\`groupBy\\` method of ${componentName} returns duplicated headers.`, 'You can solve the issue by sorting the options with the output of `groupBy`.');\n warn = true;\n }\n\n indexBy.set(group, true);\n }\n\n acc.push({\n key: index,\n index,\n group,\n options: [option]\n });\n }\n\n return acc;\n }, []);\n }\n\n if (disabledProp && focused) {\n handleBlur();\n }\n\n return {\n getRootProps: (other = {}) => _extends({\n 'aria-owns': listboxAvailable ? `${id}-listbox` : null\n }, other, {\n onKeyDown: handleKeyDown(other),\n onMouseDown: handleMouseDown,\n onClick: handleClick\n }),\n getInputLabelProps: () => ({\n id: `${id}-label`,\n htmlFor: id\n }),\n getInputProps: () => ({\n id,\n value: inputValue,\n onBlur: handleBlur,\n onFocus: handleFocus,\n onChange: handleInputChange,\n onMouseDown: handleInputMouseDown,\n // if open then this is handled imperativeley so don't let react override\n // only have an opinion about this when closed\n 'aria-activedescendant': popupOpen ? '' : null,\n 'aria-autocomplete': autoComplete ? 'both' : 'list',\n 'aria-controls': listboxAvailable ? `${id}-listbox` : undefined,\n 'aria-expanded': listboxAvailable,\n // Disable browser's suggestion that might overlap with the popup.\n // Handle autocomplete but not autofill.\n autoComplete: 'off',\n ref: inputRef,\n autoCapitalize: 'none',\n spellCheck: 'false',\n role: 'combobox'\n }),\n getClearProps: () => ({\n tabIndex: -1,\n onClick: handleClear\n }),\n getPopupIndicatorProps: () => ({\n tabIndex: -1,\n onClick: handlePopupIndicator\n }),\n getTagProps: ({\n index\n }) => _extends({\n key: index,\n 'data-tag-index': index,\n tabIndex: -1\n }, !readOnly && {\n onDelete: handleTagDelete(index)\n }),\n getListboxProps: () => ({\n role: 'listbox',\n id: `${id}-listbox`,\n 'aria-labelledby': `${id}-label`,\n ref: handleListboxRef,\n onMouseDown: event => {\n // Prevent blur\n event.preventDefault();\n }\n }),\n getOptionProps: ({\n index,\n option\n }) => {\n const selected = (multiple ? value : [value]).some(value2 => value2 != null && isOptionEqualToValue(option, value2));\n const disabled = getOptionDisabled ? getOptionDisabled(option) : false;\n return {\n key: getOptionLabel(option),\n tabIndex: -1,\n role: 'option',\n id: `${id}-option-${index}`,\n onMouseOver: handleOptionMouseOver,\n onClick: handleOptionClick,\n onTouchStart: handleOptionTouchStart,\n 'data-option-index': index,\n 'aria-disabled': disabled,\n 'aria-selected': selected\n };\n },\n id,\n inputValue,\n value,\n dirty,\n popupOpen,\n focused: focused || focusedTag !== -1,\n anchorEl,\n setAnchorEl,\n focusedTag,\n groupedOptions\n };\n}","import * as React from 'react';\nimport * as ReactDOM from 'react-dom';\nimport PropTypes from 'prop-types';\nimport { exactProp, HTMLElementType, unstable_useEnhancedEffect as useEnhancedEffect, unstable_useForkRef as useForkRef, unstable_setRef as setRef } from '@mui/utils';\n\nfunction getContainer(container) {\n return typeof container === 'function' ? container() : container;\n}\n/**\n * Portals provide a first-class way to render children into a DOM node\n * that exists outside the DOM hierarchy of the parent component.\n */\n\n\nconst Portal = /*#__PURE__*/React.forwardRef(function Portal(props, ref) {\n const {\n children,\n container,\n disablePortal = false\n } = props;\n const [mountNode, setMountNode] = React.useState(null);\n const handleRef = useForkRef( /*#__PURE__*/React.isValidElement(children) ? children.ref : null, ref);\n useEnhancedEffect(() => {\n if (!disablePortal) {\n setMountNode(getContainer(container) || document.body);\n }\n }, [container, disablePortal]);\n useEnhancedEffect(() => {\n if (mountNode && !disablePortal) {\n setRef(ref, mountNode);\n return () => {\n setRef(ref, null);\n };\n }\n\n return undefined;\n }, [ref, mountNode, disablePortal]);\n\n if (disablePortal) {\n if ( /*#__PURE__*/React.isValidElement(children)) {\n return /*#__PURE__*/React.cloneElement(children, {\n ref: handleRef\n });\n }\n\n return children;\n }\n\n return mountNode ? /*#__PURE__*/ReactDOM.createPortal(children, mountNode) : mountNode;\n});\nprocess.env.NODE_ENV !== \"production\" ? Portal.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The children to render into the `container`.\n */\n children: PropTypes.node,\n\n /**\n * An HTML element or function that returns one.\n * The `container` will have the portal children appended to it.\n *\n * By default, it uses the body of the top-level document object,\n * so it's simply `document.body` most of the time.\n */\n container: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([HTMLElementType, PropTypes.func]),\n\n /**\n * The `children` will be under the DOM hierarchy of the parent component.\n * @default false\n */\n disablePortal: PropTypes.bool\n} : void 0;\n\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n Portal['propTypes' + ''] = exactProp(Portal.propTypes);\n}\n\nexport default Portal;","/* eslint-disable consistent-return, jsx-a11y/no-noninteractive-tabindex */\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp, elementAcceptingRef, unstable_useForkRef as useForkRef, unstable_ownerDocument as ownerDocument } from '@mui/utils'; // Inspired by https://github.com/focus-trap/tabbable\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst candidatesSelector = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable=\"false\"])'].join(',');\n\nfunction getTabIndex(node) {\n const tabindexAttr = parseInt(node.getAttribute('tabindex'), 10);\n\n if (!Number.isNaN(tabindexAttr)) {\n return tabindexAttr;\n } // Browsers do not return `tabIndex` correctly for contentEditable nodes;\n // https://bugs.chromium.org/p/chromium/issues/detail?id=661108&q=contenteditable%20tabindex&can=2\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n // in Chrome, , and elements get a default\n // `tabIndex` of -1 when the 'tabindex' attribute isn't specified in the DOM,\n // yet they are still part of the regular tab order; in FF, they get a default\n // `tabIndex` of 0; since Chrome still puts those elements in the regular tab\n // order, consider their tab index to be 0.\n\n\n if (node.contentEditable === 'true' || (node.nodeName === 'AUDIO' || node.nodeName === 'VIDEO' || node.nodeName === 'DETAILS') && node.getAttribute('tabindex') === null) {\n return 0;\n }\n\n return node.tabIndex;\n}\n\nfunction isNonTabbableRadio(node) {\n if (node.tagName !== 'INPUT' || node.type !== 'radio') {\n return false;\n }\n\n if (!node.name) {\n return false;\n }\n\n const getRadio = selector => node.ownerDocument.querySelector(`input[type=\"radio\"]${selector}`);\n\n let roving = getRadio(`[name=\"${node.name}\"]:checked`);\n\n if (!roving) {\n roving = getRadio(`[name=\"${node.name}\"]`);\n }\n\n return roving !== node;\n}\n\nfunction isNodeMatchingSelectorFocusable(node) {\n if (node.disabled || node.tagName === 'INPUT' && node.type === 'hidden' || isNonTabbableRadio(node)) {\n return false;\n }\n\n return true;\n}\n\nfunction defaultGetTabbable(root) {\n const regularTabNodes = [];\n const orderedTabNodes = [];\n Array.from(root.querySelectorAll(candidatesSelector)).forEach((node, i) => {\n const nodeTabIndex = getTabIndex(node);\n\n if (nodeTabIndex === -1 || !isNodeMatchingSelectorFocusable(node)) {\n return;\n }\n\n if (nodeTabIndex === 0) {\n regularTabNodes.push(node);\n } else {\n orderedTabNodes.push({\n documentOrder: i,\n tabIndex: nodeTabIndex,\n node\n });\n }\n });\n return orderedTabNodes.sort((a, b) => a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex).map(a => a.node).concat(regularTabNodes);\n}\n\nfunction defaultIsEnabled() {\n return true;\n}\n/**\n * Utility component that locks focus inside the component.\n */\n\n\nfunction TrapFocus(props) {\n const {\n children,\n disableAutoFocus = false,\n disableEnforceFocus = false,\n disableRestoreFocus = false,\n getTabbable = defaultGetTabbable,\n isEnabled = defaultIsEnabled,\n open\n } = props;\n const ignoreNextEnforceFocus = React.useRef();\n const sentinelStart = React.useRef(null);\n const sentinelEnd = React.useRef(null);\n const nodeToRestore = React.useRef(null);\n const reactFocusEventTarget = React.useRef(null); // This variable is useful when disableAutoFocus is true.\n // It waits for the active element to move into the component to activate.\n\n const activated = React.useRef(false);\n const rootRef = React.useRef(null);\n const handleRef = useForkRef(children.ref, rootRef);\n const lastKeydown = React.useRef(null);\n React.useEffect(() => {\n // We might render an empty child.\n if (!open || !rootRef.current) {\n return;\n }\n\n activated.current = !disableAutoFocus;\n }, [disableAutoFocus, open]);\n React.useEffect(() => {\n // We might render an empty child.\n if (!open || !rootRef.current) {\n return;\n }\n\n const doc = ownerDocument(rootRef.current);\n\n if (!rootRef.current.contains(doc.activeElement)) {\n if (!rootRef.current.hasAttribute('tabIndex')) {\n if (process.env.NODE_ENV !== 'production') {\n console.error(['MUI: The modal content node does not accept focus.', 'For the benefit of assistive technologies, ' + 'the tabIndex of the node is being set to \"-1\".'].join('\\n'));\n }\n\n rootRef.current.setAttribute('tabIndex', -1);\n }\n\n if (activated.current) {\n rootRef.current.focus();\n }\n }\n\n return () => {\n // restoreLastFocus()\n if (!disableRestoreFocus) {\n // In IE11 it is possible for document.activeElement to be null resulting\n // in nodeToRestore.current being null.\n // Not all elements in IE11 have a focus method.\n // Once IE11 support is dropped the focus() call can be unconditional.\n if (nodeToRestore.current && nodeToRestore.current.focus) {\n ignoreNextEnforceFocus.current = true;\n nodeToRestore.current.focus();\n }\n\n nodeToRestore.current = null;\n }\n }; // Missing `disableRestoreFocus` which is fine.\n // We don't support changing that prop on an open TrapFocus\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [open]);\n React.useEffect(() => {\n // We might render an empty child.\n if (!open || !rootRef.current) {\n return;\n }\n\n const doc = ownerDocument(rootRef.current);\n\n const contain = nativeEvent => {\n const {\n current: rootElement\n } = rootRef; // Cleanup functions are executed lazily in React 17.\n // Contain can be called between the component being unmounted and its cleanup function being run.\n\n if (rootElement === null) {\n return;\n }\n\n if (!doc.hasFocus() || disableEnforceFocus || !isEnabled() || ignoreNextEnforceFocus.current) {\n ignoreNextEnforceFocus.current = false;\n return;\n }\n\n if (!rootElement.contains(doc.activeElement)) {\n // if the focus event is not coming from inside the children's react tree, reset the refs\n if (nativeEvent && reactFocusEventTarget.current !== nativeEvent.target || doc.activeElement !== reactFocusEventTarget.current) {\n reactFocusEventTarget.current = null;\n } else if (reactFocusEventTarget.current !== null) {\n return;\n }\n\n if (!activated.current) {\n return;\n }\n\n let tabbable = [];\n\n if (doc.activeElement === sentinelStart.current || doc.activeElement === sentinelEnd.current) {\n tabbable = getTabbable(rootRef.current);\n }\n\n if (tabbable.length > 0) {\n var _lastKeydown$current, _lastKeydown$current2;\n\n const isShiftTab = Boolean(((_lastKeydown$current = lastKeydown.current) == null ? void 0 : _lastKeydown$current.shiftKey) && ((_lastKeydown$current2 = lastKeydown.current) == null ? void 0 : _lastKeydown$current2.key) === 'Tab');\n const focusNext = tabbable[0];\n const focusPrevious = tabbable[tabbable.length - 1];\n\n if (isShiftTab) {\n focusPrevious.focus();\n } else {\n focusNext.focus();\n }\n } else {\n rootElement.focus();\n }\n }\n };\n\n const loopFocus = nativeEvent => {\n lastKeydown.current = nativeEvent;\n\n if (disableEnforceFocus || !isEnabled() || nativeEvent.key !== 'Tab') {\n return;\n } // Make sure the next tab starts from the right place.\n // doc.activeElement referes to the origin.\n\n\n if (doc.activeElement === rootRef.current && nativeEvent.shiftKey) {\n // We need to ignore the next contain as\n // it will try to move the focus back to the rootRef element.\n ignoreNextEnforceFocus.current = true;\n sentinelEnd.current.focus();\n }\n };\n\n doc.addEventListener('focusin', contain);\n doc.addEventListener('keydown', loopFocus, true); // With Edge, Safari and Firefox, no focus related events are fired when the focused area stops being a focused area.\n // e.g. https://bugzilla.mozilla.org/show_bug.cgi?id=559561.\n // Instead, we can look if the active element was restored on the BODY element.\n //\n // The whatwg spec defines how the browser should behave but does not explicitly mention any events:\n // https://html.spec.whatwg.org/multipage/interaction.html#focus-fixup-rule.\n\n const interval = setInterval(() => {\n if (doc.activeElement.tagName === 'BODY') {\n contain();\n }\n }, 50);\n return () => {\n clearInterval(interval);\n doc.removeEventListener('focusin', contain);\n doc.removeEventListener('keydown', loopFocus, true);\n };\n }, [disableAutoFocus, disableEnforceFocus, disableRestoreFocus, isEnabled, open, getTabbable]);\n\n const onFocus = event => {\n if (nodeToRestore.current === null) {\n nodeToRestore.current = event.relatedTarget;\n }\n\n activated.current = true;\n reactFocusEventTarget.current = event.target;\n const childrenPropsHandler = children.props.onFocus;\n\n if (childrenPropsHandler) {\n childrenPropsHandler(event);\n }\n };\n\n const handleFocusSentinel = event => {\n if (nodeToRestore.current === null) {\n nodeToRestore.current = event.relatedTarget;\n }\n\n activated.current = true;\n };\n\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(\"div\", {\n tabIndex: 0,\n onFocus: handleFocusSentinel,\n ref: sentinelStart,\n \"data-test\": \"sentinelStart\"\n }), /*#__PURE__*/React.cloneElement(children, {\n ref: handleRef,\n onFocus\n }), /*#__PURE__*/_jsx(\"div\", {\n tabIndex: 0,\n onFocus: handleFocusSentinel,\n ref: sentinelEnd,\n \"data-test\": \"sentinelEnd\"\n })]\n });\n}\n\nprocess.env.NODE_ENV !== \"production\" ? TrapFocus.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * A single child content element.\n */\n children: elementAcceptingRef,\n\n /**\n * If `true`, the trap focus will not automatically shift focus to itself when it opens, and\n * replace it to the last focused element when it closes.\n * This also works correctly with any trap focus children that have the `disableAutoFocus` prop.\n *\n * Generally this should never be set to `true` as it makes the trap focus less\n * accessible to assistive technologies, like screen readers.\n * @default false\n */\n disableAutoFocus: PropTypes.bool,\n\n /**\n * If `true`, the trap focus will not prevent focus from leaving the trap focus while open.\n *\n * Generally this should never be set to `true` as it makes the trap focus less\n * accessible to assistive technologies, like screen readers.\n * @default false\n */\n disableEnforceFocus: PropTypes.bool,\n\n /**\n * If `true`, the trap focus will not restore focus to previously focused element once\n * trap focus is hidden or unmounted.\n * @default false\n */\n disableRestoreFocus: PropTypes.bool,\n\n /**\n * Returns an array of ordered tabbable nodes (i.e. in tab order) within the root.\n * For instance, you can provide the \"tabbable\" npm dependency.\n * @param {HTMLElement} root\n */\n getTabbable: PropTypes.func,\n\n /**\n * This prop extends the `open` prop.\n * It allows to toggle the open state without having to wait for a rerender when changing the `open` prop.\n * This prop should be memoized.\n * It can be used to support multiple trap focus mounted at the same time.\n * @default function defaultIsEnabled() {\n * return true;\n * }\n */\n isEnabled: PropTypes.func,\n\n /**\n * If `true`, focus is locked.\n */\n open: PropTypes.bool.isRequired\n} : void 0;\n\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n TrapFocus['propTypes' + ''] = exactProp(TrapFocus.propTypes);\n}\n\nexport default TrapFocus;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport isHostComponent from './isHostComponent';\n/**\n * Appends the ownerState object to the props, merging with the existing one if necessary.\n *\n * @param elementType Type of the element that owns the `existingProps`. If the element is a DOM node, `ownerState` are not applied.\n * @param existingProps Props of the element.\n * @param ownerState\n */\n\nexport default function appendOwnerState(elementType, existingProps = {}, ownerState) {\n if (isHostComponent(elementType)) {\n return existingProps;\n }\n\n return _extends({}, existingProps, {\n ownerState: _extends({}, existingProps.ownerState, ownerState)\n });\n}","/**\n * Determines if a given element is a DOM element name (i.e. not a React component).\n */\nfunction isHostComponent(element) {\n return typeof element === 'string';\n}\n\nexport default isHostComponent;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function createMixins(breakpoints, mixins) {\n return _extends({\n toolbar: {\n minHeight: 56,\n [`${breakpoints.up('xs')} and (orientation: landscape)`]: {\n minHeight: 48\n },\n [breakpoints.up('sm')]: {\n minHeight: 64\n }\n }\n }, mixins);\n}","const common = {\n black: '#000',\n white: '#fff'\n};\nexport default common;","const grey = {\n 50: '#fafafa',\n 100: '#f5f5f5',\n 200: '#eeeeee',\n 300: '#e0e0e0',\n 400: '#bdbdbd',\n 500: '#9e9e9e',\n 600: '#757575',\n 700: '#616161',\n 800: '#424242',\n 900: '#212121',\n A100: '#f5f5f5',\n A200: '#eeeeee',\n A400: '#bdbdbd',\n A700: '#616161'\n};\nexport default grey;","const purple = {\n 50: '#f3e5f5',\n 100: '#e1bee7',\n 200: '#ce93d8',\n 300: '#ba68c8',\n 400: '#ab47bc',\n 500: '#9c27b0',\n 600: '#8e24aa',\n 700: '#7b1fa2',\n 800: '#6a1b9a',\n 900: '#4a148c',\n A100: '#ea80fc',\n A200: '#e040fb',\n A400: '#d500f9',\n A700: '#aa00ff'\n};\nexport default purple;","const red = {\n 50: '#ffebee',\n 100: '#ffcdd2',\n 200: '#ef9a9a',\n 300: '#e57373',\n 400: '#ef5350',\n 500: '#f44336',\n 600: '#e53935',\n 700: '#d32f2f',\n 800: '#c62828',\n 900: '#b71c1c',\n A100: '#ff8a80',\n A200: '#ff5252',\n A400: '#ff1744',\n A700: '#d50000'\n};\nexport default red;","const orange = {\n 50: '#fff3e0',\n 100: '#ffe0b2',\n 200: '#ffcc80',\n 300: '#ffb74d',\n 400: '#ffa726',\n 500: '#ff9800',\n 600: '#fb8c00',\n 700: '#f57c00',\n 800: '#ef6c00',\n 900: '#e65100',\n A100: '#ffd180',\n A200: '#ffab40',\n A400: '#ff9100',\n A700: '#ff6d00'\n};\nexport default orange;","const blue = {\n 50: '#e3f2fd',\n 100: '#bbdefb',\n 200: '#90caf9',\n 300: '#64b5f6',\n 400: '#42a5f5',\n 500: '#2196f3',\n 600: '#1e88e5',\n 700: '#1976d2',\n 800: '#1565c0',\n 900: '#0d47a1',\n A100: '#82b1ff',\n A200: '#448aff',\n A400: '#2979ff',\n A700: '#2962ff'\n};\nexport default blue;","const lightBlue = {\n 50: '#e1f5fe',\n 100: '#b3e5fc',\n 200: '#81d4fa',\n 300: '#4fc3f7',\n 400: '#29b6f6',\n 500: '#03a9f4',\n 600: '#039be5',\n 700: '#0288d1',\n 800: '#0277bd',\n 900: '#01579b',\n A100: '#80d8ff',\n A200: '#40c4ff',\n A400: '#00b0ff',\n A700: '#0091ea'\n};\nexport default lightBlue;","const green = {\n 50: '#e8f5e9',\n 100: '#c8e6c9',\n 200: '#a5d6a7',\n 300: '#81c784',\n 400: '#66bb6a',\n 500: '#4caf50',\n 600: '#43a047',\n 700: '#388e3c',\n 800: '#2e7d32',\n 900: '#1b5e20',\n A100: '#b9f6ca',\n A200: '#69f0ae',\n A400: '#00e676',\n A700: '#00c853'\n};\nexport default green;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport { formatMuiErrorMessage as _formatMuiErrorMessage } from \"@mui/utils\";\nconst _excluded = [\"mode\", \"contrastThreshold\", \"tonalOffset\"];\nimport { deepmerge } from '@mui/utils';\nimport { darken, getContrastRatio, lighten } from '@mui/system';\nimport common from '../colors/common';\nimport grey from '../colors/grey';\nimport purple from '../colors/purple';\nimport red from '../colors/red';\nimport orange from '../colors/orange';\nimport blue from '../colors/blue';\nimport lightBlue from '../colors/lightBlue';\nimport green from '../colors/green';\nexport const light = {\n // The colors used to style the text.\n text: {\n // The most important text.\n primary: 'rgba(0, 0, 0, 0.87)',\n // Secondary text.\n secondary: 'rgba(0, 0, 0, 0.6)',\n // Disabled text have even lower visual prominence.\n disabled: 'rgba(0, 0, 0, 0.38)'\n },\n // The color used to divide different elements.\n divider: 'rgba(0, 0, 0, 0.12)',\n // The background colors used to style the surfaces.\n // Consistency between these values is important.\n background: {\n paper: common.white,\n default: common.white\n },\n // The colors used to style the action elements.\n action: {\n // The color of an active action like an icon button.\n active: 'rgba(0, 0, 0, 0.54)',\n // The color of an hovered action.\n hover: 'rgba(0, 0, 0, 0.04)',\n hoverOpacity: 0.04,\n // The color of a selected action.\n selected: 'rgba(0, 0, 0, 0.08)',\n selectedOpacity: 0.08,\n // The color of a disabled action.\n disabled: 'rgba(0, 0, 0, 0.26)',\n // The background color of a disabled action.\n disabledBackground: 'rgba(0, 0, 0, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(0, 0, 0, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.12\n }\n};\nexport const dark = {\n text: {\n primary: common.white,\n secondary: 'rgba(255, 255, 255, 0.7)',\n disabled: 'rgba(255, 255, 255, 0.5)',\n icon: 'rgba(255, 255, 255, 0.5)'\n },\n divider: 'rgba(255, 255, 255, 0.12)',\n background: {\n paper: '#121212',\n default: '#121212'\n },\n action: {\n active: common.white,\n hover: 'rgba(255, 255, 255, 0.08)',\n hoverOpacity: 0.08,\n selected: 'rgba(255, 255, 255, 0.16)',\n selectedOpacity: 0.16,\n disabled: 'rgba(255, 255, 255, 0.3)',\n disabledBackground: 'rgba(255, 255, 255, 0.12)',\n disabledOpacity: 0.38,\n focus: 'rgba(255, 255, 255, 0.12)',\n focusOpacity: 0.12,\n activatedOpacity: 0.24\n }\n};\n\nfunction addLightOrDark(intent, direction, shade, tonalOffset) {\n const tonalOffsetLight = tonalOffset.light || tonalOffset;\n const tonalOffsetDark = tonalOffset.dark || tonalOffset * 1.5;\n\n if (!intent[direction]) {\n if (intent.hasOwnProperty(shade)) {\n intent[direction] = intent[shade];\n } else if (direction === 'light') {\n intent.light = lighten(intent.main, tonalOffsetLight);\n } else if (direction === 'dark') {\n intent.dark = darken(intent.main, tonalOffsetDark);\n }\n }\n}\n\nfunction getDefaultPrimary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: blue[200],\n light: blue[50],\n dark: blue[400]\n };\n }\n\n return {\n main: blue[700],\n light: blue[400],\n dark: blue[800]\n };\n}\n\nfunction getDefaultSecondary(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: purple[200],\n light: purple[50],\n dark: purple[400]\n };\n }\n\n return {\n main: purple[500],\n light: purple[300],\n dark: purple[700]\n };\n}\n\nfunction getDefaultError(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: red[500],\n light: red[300],\n dark: red[700]\n };\n }\n\n return {\n main: red[700],\n light: red[400],\n dark: red[800]\n };\n}\n\nfunction getDefaultInfo(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: lightBlue[400],\n light: lightBlue[300],\n dark: lightBlue[700]\n };\n }\n\n return {\n main: lightBlue[700],\n light: lightBlue[500],\n dark: lightBlue[900]\n };\n}\n\nfunction getDefaultSuccess(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: green[400],\n light: green[300],\n dark: green[700]\n };\n }\n\n return {\n main: green[800],\n light: green[500],\n dark: green[900]\n };\n}\n\nfunction getDefaultWarning(mode = 'light') {\n if (mode === 'dark') {\n return {\n main: orange[400],\n light: orange[300],\n dark: orange[700]\n };\n }\n\n return {\n main: '#ed6c02',\n // closest to orange[800] that pass 3:1.\n light: orange[500],\n dark: orange[900]\n };\n}\n\nexport default function createPalette(palette) {\n const {\n mode = 'light',\n contrastThreshold = 3,\n tonalOffset = 0.2\n } = palette,\n other = _objectWithoutPropertiesLoose(palette, _excluded);\n\n const primary = palette.primary || getDefaultPrimary(mode);\n const secondary = palette.secondary || getDefaultSecondary(mode);\n const error = palette.error || getDefaultError(mode);\n const info = palette.info || getDefaultInfo(mode);\n const success = palette.success || getDefaultSuccess(mode);\n const warning = palette.warning || getDefaultWarning(mode); // Use the same logic as\n // Bootstrap: https://github.com/twbs/bootstrap/blob/1d6e3710dd447de1a200f29e8fa521f8a0908f70/scss/_functions.scss#L59\n // and material-components-web https://github.com/material-components/material-components-web/blob/ac46b8863c4dab9fc22c4c662dc6bd1b65dd652f/packages/mdc-theme/_functions.scss#L54\n\n function getContrastText(background) {\n const contrastText = getContrastRatio(background, dark.text.primary) >= contrastThreshold ? dark.text.primary : light.text.primary;\n\n if (process.env.NODE_ENV !== 'production') {\n const contrast = getContrastRatio(background, contrastText);\n\n if (contrast < 3) {\n console.error([`MUI: The contrast ratio of ${contrast}:1 for ${contrastText} on ${background}`, 'falls below the WCAG recommended absolute minimum contrast ratio of 3:1.', 'https://www.w3.org/TR/2008/REC-WCAG20-20081211/#visual-audio-contrast-contrast'].join('\\n'));\n }\n }\n\n return contrastText;\n }\n\n const augmentColor = ({\n color,\n name,\n mainShade = 500,\n lightShade = 300,\n darkShade = 700\n }) => {\n color = _extends({}, color);\n\n if (!color.main && color[mainShade]) {\n color.main = color[mainShade];\n }\n\n if (!color.hasOwnProperty('main')) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\nThe color object needs to have a \\`main\\` property or a \\`${mainShade}\\` property.` : _formatMuiErrorMessage(11, name ? ` (${name})` : '', mainShade));\n }\n\n if (typeof color.main !== 'string') {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: The color${name ? ` (${name})` : ''} provided to augmentColor(color) is invalid.\n\\`color.main\\` should be a string, but \\`${JSON.stringify(color.main)}\\` was provided instead.\n\nDid you intend to use one of the following approaches?\n\nimport { green } from \"@mui/material/colors\";\n\nconst theme1 = createTheme({ palette: {\n primary: green,\n} });\n\nconst theme2 = createTheme({ palette: {\n primary: { main: green[500] },\n} });` : _formatMuiErrorMessage(12, name ? ` (${name})` : '', JSON.stringify(color.main)));\n }\n\n addLightOrDark(color, 'light', lightShade, tonalOffset);\n addLightOrDark(color, 'dark', darkShade, tonalOffset);\n\n if (!color.contrastText) {\n color.contrastText = getContrastText(color.main);\n }\n\n return color;\n };\n\n const modes = {\n dark,\n light\n };\n\n if (process.env.NODE_ENV !== 'production') {\n if (!modes[mode]) {\n console.error(`MUI: The palette mode \\`${mode}\\` is not supported.`);\n }\n }\n\n const paletteOutput = deepmerge(_extends({\n // A collection of common colors.\n common: _extends({}, common),\n // prevent mutable object.\n // The palette mode, can be light or dark.\n mode,\n // The colors used to represent primary interface elements for a user.\n primary: augmentColor({\n color: primary,\n name: 'primary'\n }),\n // The colors used to represent secondary interface elements for a user.\n secondary: augmentColor({\n color: secondary,\n name: 'secondary',\n mainShade: 'A400',\n lightShade: 'A200',\n darkShade: 'A700'\n }),\n // The colors used to represent interface elements that the user should be made aware of.\n error: augmentColor({\n color: error,\n name: 'error'\n }),\n // The colors used to represent potentially dangerous actions or important messages.\n warning: augmentColor({\n color: warning,\n name: 'warning'\n }),\n // The colors used to present information to the user that is neutral and not necessarily important.\n info: augmentColor({\n color: info,\n name: 'info'\n }),\n // The colors used to indicate the successful completion of an action that user triggered.\n success: augmentColor({\n color: success,\n name: 'success'\n }),\n // The grey colors.\n grey,\n // Used by `getContrastText()` to maximize the contrast between\n // the background and the text.\n contrastThreshold,\n // Takes a background color and returns the text color that maximizes the contrast.\n getContrastText,\n // Generate a rich color object.\n augmentColor,\n // Used by the functions below to shift a color's luminance by approximately\n // two indexes within its tonal palette.\n // E.g., shift from Red 500 to Red 300 or Red 700.\n tonalOffset\n }, modes[mode]), other);\n return paletteOutput;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"fontFamily\", \"fontSize\", \"fontWeightLight\", \"fontWeightRegular\", \"fontWeightMedium\", \"fontWeightBold\", \"htmlFontSize\", \"allVariants\", \"pxToRem\"];\nimport { deepmerge } from '@mui/utils';\n\nfunction round(value) {\n return Math.round(value * 1e5) / 1e5;\n}\n\nconst caseAllCaps = {\n textTransform: 'uppercase'\n};\nconst defaultFontFamily = '\"Roboto\", \"Helvetica\", \"Arial\", sans-serif';\n/**\n * @see @link{https://material.io/design/typography/the-type-system.html}\n * @see @link{https://material.io/design/typography/understanding-typography.html}\n */\n\nexport default function createTypography(palette, typography) {\n const _ref = typeof typography === 'function' ? typography(palette) : typography,\n {\n fontFamily = defaultFontFamily,\n // The default font size of the Material Specification.\n fontSize = 14,\n // px\n fontWeightLight = 300,\n fontWeightRegular = 400,\n fontWeightMedium = 500,\n fontWeightBold = 700,\n // Tell MUI what's the font-size on the html element.\n // 16px is the default font-size used by browsers.\n htmlFontSize = 16,\n // Apply the CSS properties to all the variants.\n allVariants,\n pxToRem: pxToRem2\n } = _ref,\n other = _objectWithoutPropertiesLoose(_ref, _excluded);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof fontSize !== 'number') {\n console.error('MUI: `fontSize` is required to be a number.');\n }\n\n if (typeof htmlFontSize !== 'number') {\n console.error('MUI: `htmlFontSize` is required to be a number.');\n }\n }\n\n const coef = fontSize / 14;\n\n const pxToRem = pxToRem2 || (size => `${size / htmlFontSize * coef}rem`);\n\n const buildVariant = (fontWeight, size, lineHeight, letterSpacing, casing) => _extends({\n fontFamily,\n fontWeight,\n fontSize: pxToRem(size),\n // Unitless following https://meyerweb.com/eric/thoughts/2006/02/08/unitless-line-heights/\n lineHeight\n }, fontFamily === defaultFontFamily ? {\n letterSpacing: `${round(letterSpacing / size)}em`\n } : {}, casing, allVariants);\n\n const variants = {\n h1: buildVariant(fontWeightLight, 96, 1.167, -1.5),\n h2: buildVariant(fontWeightLight, 60, 1.2, -0.5),\n h3: buildVariant(fontWeightRegular, 48, 1.167, 0),\n h4: buildVariant(fontWeightRegular, 34, 1.235, 0.25),\n h5: buildVariant(fontWeightRegular, 24, 1.334, 0),\n h6: buildVariant(fontWeightMedium, 20, 1.6, 0.15),\n subtitle1: buildVariant(fontWeightRegular, 16, 1.75, 0.15),\n subtitle2: buildVariant(fontWeightMedium, 14, 1.57, 0.1),\n body1: buildVariant(fontWeightRegular, 16, 1.5, 0.15),\n body2: buildVariant(fontWeightRegular, 14, 1.43, 0.15),\n button: buildVariant(fontWeightMedium, 14, 1.75, 0.4, caseAllCaps),\n caption: buildVariant(fontWeightRegular, 12, 1.66, 0.4),\n overline: buildVariant(fontWeightRegular, 12, 2.66, 1, caseAllCaps)\n };\n return deepmerge(_extends({\n htmlFontSize,\n pxToRem,\n fontFamily,\n fontSize,\n fontWeightLight,\n fontWeightRegular,\n fontWeightMedium,\n fontWeightBold\n }, variants), other, {\n clone: false // No need to clone deep\n\n });\n}","const shadowKeyUmbraOpacity = 0.2;\nconst shadowKeyPenumbraOpacity = 0.14;\nconst shadowAmbientShadowOpacity = 0.12;\n\nfunction createShadow(...px) {\n return [`${px[0]}px ${px[1]}px ${px[2]}px ${px[3]}px rgba(0,0,0,${shadowKeyUmbraOpacity})`, `${px[4]}px ${px[5]}px ${px[6]}px ${px[7]}px rgba(0,0,0,${shadowKeyPenumbraOpacity})`, `${px[8]}px ${px[9]}px ${px[10]}px ${px[11]}px rgba(0,0,0,${shadowAmbientShadowOpacity})`].join(',');\n} // Values from https://github.com/material-components/material-components-web/blob/be8747f94574669cb5e7add1a7c54fa41a89cec7/packages/mdc-elevation/_variables.scss\n\n\nconst shadows = ['none', createShadow(0, 2, 1, -1, 0, 1, 1, 0, 0, 1, 3, 0), createShadow(0, 3, 1, -2, 0, 2, 2, 0, 0, 1, 5, 0), createShadow(0, 3, 3, -2, 0, 3, 4, 0, 0, 1, 8, 0), createShadow(0, 2, 4, -1, 0, 4, 5, 0, 0, 1, 10, 0), createShadow(0, 3, 5, -1, 0, 5, 8, 0, 0, 1, 14, 0), createShadow(0, 3, 5, -1, 0, 6, 10, 0, 0, 1, 18, 0), createShadow(0, 4, 5, -2, 0, 7, 10, 1, 0, 2, 16, 1), createShadow(0, 5, 5, -3, 0, 8, 10, 1, 0, 3, 14, 2), createShadow(0, 5, 6, -3, 0, 9, 12, 1, 0, 3, 16, 2), createShadow(0, 6, 6, -3, 0, 10, 14, 1, 0, 4, 18, 3), createShadow(0, 6, 7, -4, 0, 11, 15, 1, 0, 4, 20, 3), createShadow(0, 7, 8, -4, 0, 12, 17, 2, 0, 5, 22, 4), createShadow(0, 7, 8, -4, 0, 13, 19, 2, 0, 5, 24, 4), createShadow(0, 7, 9, -4, 0, 14, 21, 2, 0, 5, 26, 4), createShadow(0, 8, 9, -5, 0, 15, 22, 2, 0, 6, 28, 5), createShadow(0, 8, 10, -5, 0, 16, 24, 2, 0, 6, 30, 5), createShadow(0, 8, 11, -5, 0, 17, 26, 2, 0, 6, 32, 5), createShadow(0, 9, 11, -5, 0, 18, 28, 2, 0, 7, 34, 6), createShadow(0, 9, 12, -6, 0, 19, 29, 2, 0, 7, 36, 6), createShadow(0, 10, 13, -6, 0, 20, 31, 3, 0, 8, 38, 7), createShadow(0, 10, 13, -6, 0, 21, 33, 3, 0, 8, 40, 7), createShadow(0, 10, 14, -6, 0, 22, 35, 3, 0, 8, 42, 7), createShadow(0, 11, 14, -7, 0, 23, 36, 3, 0, 9, 44, 8), createShadow(0, 11, 15, -7, 0, 24, 38, 3, 0, 9, 46, 8)];\nexport default shadows;","// We need to centralize the zIndex definitions as they work\n// like global values in the browser.\nconst zIndex = {\n mobileStepper: 1000,\n fab: 1050,\n speedDial: 1050,\n appBar: 1100,\n drawer: 1200,\n modal: 1300,\n snackbar: 1400,\n tooltip: 1500\n};\nexport default zIndex;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"breakpoints\", \"mixins\", \"spacing\", \"palette\", \"transitions\", \"typography\", \"shape\"];\nimport { deepmerge } from '@mui/utils';\nimport { generateUtilityClass } from '@mui/base';\nimport { createTheme as systemCreateTheme } from '@mui/system';\nimport createMixins from './createMixins';\nimport createPalette from './createPalette';\nimport createTypography from './createTypography';\nimport shadows from './shadows';\nimport createTransitions from './createTransitions';\nimport zIndex from './zIndex';\n\nfunction createTheme(options = {}, ...args) {\n const {\n mixins: mixinsInput = {},\n palette: paletteInput = {},\n transitions: transitionsInput = {},\n typography: typographyInput = {}\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n\n const palette = createPalette(paletteInput);\n const systemTheme = systemCreateTheme(options);\n let muiTheme = deepmerge(systemTheme, {\n mixins: createMixins(systemTheme.breakpoints, mixinsInput),\n palette,\n // Don't use [...shadows] until you've verified its transpiled code is not invoking the iterator protocol.\n shadows: shadows.slice(),\n typography: createTypography(palette, typographyInput),\n transitions: createTransitions(transitionsInput),\n zIndex: _extends({}, zIndex)\n });\n muiTheme = deepmerge(muiTheme, other);\n muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);\n\n if (process.env.NODE_ENV !== 'production') {\n const stateClasses = ['active', 'checked', 'completed', 'disabled', 'error', 'expanded', 'focused', 'focusVisible', 'required', 'selected'];\n\n const traverse = (node, component) => {\n let key; // eslint-disable-next-line guard-for-in, no-restricted-syntax\n\n for (key in node) {\n const child = node[key];\n\n if (stateClasses.indexOf(key) !== -1 && Object.keys(child).length > 0) {\n if (process.env.NODE_ENV !== 'production') {\n const stateClass = generateUtilityClass('', key);\n console.error([`MUI: The \\`${component}\\` component increases ` + `the CSS specificity of the \\`${key}\\` internal state.`, 'You can not override it like this: ', JSON.stringify(node, null, 2), '', `Instead, you need to use the '&.${stateClass}' syntax:`, JSON.stringify({\n root: {\n [`&.${stateClass}`]: child\n }\n }, null, 2), '', 'https://mui.com/r/state-classes-guide'].join('\\n'));\n } // Remove the style to prevent global conflicts.\n\n\n node[key] = {};\n }\n }\n };\n\n Object.keys(muiTheme.components).forEach(component => {\n const styleOverrides = muiTheme.components[component].styleOverrides;\n\n if (styleOverrides && component.indexOf('Mui') === 0) {\n traverse(styleOverrides, component);\n }\n });\n }\n\n return muiTheme;\n}\n\nlet warnedOnce = false;\nexport function createMuiTheme(...args) {\n if (process.env.NODE_ENV !== 'production') {\n if (!warnedOnce) {\n warnedOnce = true;\n console.error(['MUI: the createMuiTheme function was renamed to createTheme.', '', \"You should use `import { createTheme } from '@mui/material/styles'`\"].join('\\n'));\n }\n }\n\n return createTheme(...args);\n}\nexport default createTheme;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"duration\", \"easing\", \"delay\"];\n// Follow https://material.google.com/motion/duration-easing.html#duration-easing-natural-easing-curves\n// to learn the context in which each easing should be used.\nexport const easing = {\n // This is the most common easing curve.\n easeInOut: 'cubic-bezier(0.4, 0, 0.2, 1)',\n // Objects enter the screen at full velocity from off-screen and\n // slowly decelerate to a resting point.\n easeOut: 'cubic-bezier(0.0, 0, 0.2, 1)',\n // Objects leave the screen at full velocity. They do not decelerate when off-screen.\n easeIn: 'cubic-bezier(0.4, 0, 1, 1)',\n // The sharp curve is used by objects that may return to the screen at any time.\n sharp: 'cubic-bezier(0.4, 0, 0.6, 1)'\n}; // Follow https://material.io/guidelines/motion/duration-easing.html#duration-easing-common-durations\n// to learn when use what timing\n\nexport const duration = {\n shortest: 150,\n shorter: 200,\n short: 250,\n // most basic recommended timing\n standard: 300,\n // this is to be used in complex animations\n complex: 375,\n // recommended when something is entering screen\n enteringScreen: 225,\n // recommended when something is leaving screen\n leavingScreen: 195\n};\n\nfunction formatMs(milliseconds) {\n return `${Math.round(milliseconds)}ms`;\n}\n\nfunction getAutoHeightDuration(height) {\n if (!height) {\n return 0;\n }\n\n const constant = height / 36; // https://www.wolframalpha.com/input/?i=(4+%2B+15+*+(x+%2F+36+)+**+0.25+%2B+(x+%2F+36)+%2F+5)+*+10\n\n return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);\n}\n\nexport default function createTransitions(inputTransitions) {\n const mergedEasing = _extends({}, easing, inputTransitions.easing);\n\n const mergedDuration = _extends({}, duration, inputTransitions.duration);\n\n const create = (props = ['all'], options = {}) => {\n const {\n duration: durationOption = mergedDuration.standard,\n easing: easingOption = mergedEasing.easeInOut,\n delay = 0\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n\n if (process.env.NODE_ENV !== 'production') {\n const isString = value => typeof value === 'string'; // IE11 support, replace with Number.isNaN\n // eslint-disable-next-line no-restricted-globals\n\n\n const isNumber = value => !isNaN(parseFloat(value));\n\n if (!isString(props) && !Array.isArray(props)) {\n console.error('MUI: Argument \"props\" must be a string or Array.');\n }\n\n if (!isNumber(durationOption) && !isString(durationOption)) {\n console.error(`MUI: Argument \"duration\" must be a number or a string but found ${durationOption}.`);\n }\n\n if (!isString(easingOption)) {\n console.error('MUI: Argument \"easing\" must be a string.');\n }\n\n if (!isNumber(delay) && !isString(delay)) {\n console.error('MUI: Argument \"delay\" must be a number or a string.');\n }\n\n if (Object.keys(other).length !== 0) {\n console.error(`MUI: Unrecognized argument(s) [${Object.keys(other).join(',')}].`);\n }\n }\n\n return (Array.isArray(props) ? props : [props]).map(animatedProp => `${animatedProp} ${typeof durationOption === 'string' ? durationOption : formatMs(durationOption)} ${easingOption} ${typeof delay === 'string' ? delay : formatMs(delay)}`).join(',');\n };\n\n return _extends({\n getAutoHeightDuration,\n create\n }, inputTransitions, {\n easing: mergedEasing,\n duration: mergedDuration\n });\n}","import createTheme from './createTheme';\nconst defaultTheme = createTheme();\nexport default defaultTheme;","import { createStyled, shouldForwardProp } from '@mui/system';\nimport defaultTheme from './defaultTheme';\nexport const rootShouldForwardProp = prop => shouldForwardProp(prop) && prop !== 'classes';\nexport const slotShouldForwardProp = shouldForwardProp;\nconst styled = createStyled({\n defaultTheme,\n rootShouldForwardProp\n});\nexport default styled;","import * as React from 'react';\nimport { useTheme as useThemeSystem } from '@mui/system';\nimport defaultTheme from './defaultTheme';\nexport default function useTheme() {\n const theme = useThemeSystem(defaultTheme);\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n\n return theme;\n}","import { useThemeProps as systemUseThemeProps } from '@mui/system';\nimport defaultTheme from './defaultTheme';\nexport default function useThemeProps({\n props,\n name\n}) {\n return systemUseThemeProps({\n props,\n name,\n defaultTheme\n });\n}","export const reflow = node => node.scrollTop;\nexport function getTransitionProps(props, options) {\n var _style$transitionDura, _style$transitionTimi;\n\n const {\n timeout,\n easing,\n style = {}\n } = props;\n return {\n duration: (_style$transitionDura = style.transitionDuration) != null ? _style$transitionDura : typeof timeout === 'number' ? timeout : timeout[options.mode] || 0,\n easing: (_style$transitionTimi = style.transitionTimingFunction) != null ? _style$transitionTimi : typeof easing === 'object' ? easing[options.mode] : easing,\n delay: style.transitionDelay\n };\n}","import { unstable_capitalize as capitalize } from '@mui/utils';\nexport default capitalize;","import { generateUtilityClass, generateUtilityClasses } from '@mui/base';\nexport function getSvgIconUtilityClass(slot) {\n return generateUtilityClass('MuiSvgIcon', slot);\n}\nconst svgIconClasses = generateUtilityClasses('MuiSvgIcon', ['root', 'colorPrimary', 'colorSecondary', 'colorAction', 'colorError', 'colorDisabled', 'fontSizeInherit', 'fontSizeSmall', 'fontSizeMedium', 'fontSizeLarge']);\nexport default svgIconClasses;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"className\", \"color\", \"component\", \"fontSize\", \"htmlColor\", \"inheritViewBox\", \"titleAccess\", \"viewBox\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport capitalize from '../utils/capitalize';\nimport useThemeProps from '../styles/useThemeProps';\nimport styled from '../styles/styled';\nimport { getSvgIconUtilityClass } from './svgIconClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n color,\n fontSize,\n classes\n } = ownerState;\n const slots = {\n root: ['root', color !== 'inherit' && `color${capitalize(color)}`, `fontSize${capitalize(fontSize)}`]\n };\n return composeClasses(slots, getSvgIconUtilityClass, classes);\n};\n\nconst SvgIconRoot = styled('svg', {\n name: 'MuiSvgIcon',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.color !== 'inherit' && styles[`color${capitalize(ownerState.color)}`], styles[`fontSize${capitalize(ownerState.fontSize)}`]];\n }\n})(({\n theme,\n ownerState\n}) => {\n var _theme$transitions, _theme$transitions$cr, _theme$transitions2, _theme$transitions2$d, _theme$typography, _theme$typography$pxT, _theme$typography2, _theme$typography2$px, _theme$typography3, _theme$typography3$px, _palette$ownerState$c, _palette, _palette$ownerState$c2, _palette2, _palette2$action, _palette3, _palette3$action;\n\n return {\n userSelect: 'none',\n width: '1em',\n height: '1em',\n display: 'inline-block',\n fill: 'currentColor',\n flexShrink: 0,\n transition: (_theme$transitions = theme.transitions) == null ? void 0 : (_theme$transitions$cr = _theme$transitions.create) == null ? void 0 : _theme$transitions$cr.call(_theme$transitions, 'fill', {\n duration: (_theme$transitions2 = theme.transitions) == null ? void 0 : (_theme$transitions2$d = _theme$transitions2.duration) == null ? void 0 : _theme$transitions2$d.shorter\n }),\n fontSize: {\n inherit: 'inherit',\n small: ((_theme$typography = theme.typography) == null ? void 0 : (_theme$typography$pxT = _theme$typography.pxToRem) == null ? void 0 : _theme$typography$pxT.call(_theme$typography, 20)) || '1.25rem',\n medium: ((_theme$typography2 = theme.typography) == null ? void 0 : (_theme$typography2$px = _theme$typography2.pxToRem) == null ? void 0 : _theme$typography2$px.call(_theme$typography2, 24)) || '1.5rem',\n large: ((_theme$typography3 = theme.typography) == null ? void 0 : (_theme$typography3$px = _theme$typography3.pxToRem) == null ? void 0 : _theme$typography3$px.call(_theme$typography3, 35)) || '2.1875'\n }[ownerState.fontSize],\n // TODO v5 deprecate, v6 remove for sx\n color: (_palette$ownerState$c = (_palette = (theme.vars || theme).palette) == null ? void 0 : (_palette$ownerState$c2 = _palette[ownerState.color]) == null ? void 0 : _palette$ownerState$c2.main) != null ? _palette$ownerState$c : {\n action: (_palette2 = (theme.vars || theme).palette) == null ? void 0 : (_palette2$action = _palette2.action) == null ? void 0 : _palette2$action.active,\n disabled: (_palette3 = (theme.vars || theme).palette) == null ? void 0 : (_palette3$action = _palette3.action) == null ? void 0 : _palette3$action.disabled,\n inherit: undefined\n }[ownerState.color]\n };\n});\nconst SvgIcon = /*#__PURE__*/React.forwardRef(function SvgIcon(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiSvgIcon'\n });\n\n const {\n children,\n className,\n color = 'inherit',\n component = 'svg',\n fontSize = 'medium',\n htmlColor,\n inheritViewBox = false,\n titleAccess,\n viewBox = '0 0 24 24'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const ownerState = _extends({}, props, {\n color,\n component,\n fontSize,\n instanceFontSize: inProps.fontSize,\n inheritViewBox,\n viewBox\n });\n\n const more = {};\n\n if (!inheritViewBox) {\n more.viewBox = viewBox;\n }\n\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsxs(SvgIconRoot, _extends({\n as: component,\n className: clsx(classes.root, className),\n ownerState: ownerState,\n focusable: \"false\",\n color: htmlColor,\n \"aria-hidden\": titleAccess ? undefined : true,\n role: titleAccess ? 'img' : undefined,\n ref: ref\n }, more, other, {\n children: [children, titleAccess ? /*#__PURE__*/_jsx(\"title\", {\n children: titleAccess\n }) : null]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? SvgIcon.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * Node passed into the SVG element.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).\n * You can use the `htmlColor` prop to apply a color attribute to the SVG element.\n * @default 'inherit'\n */\n color: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.oneOf(['inherit', 'action', 'disabled', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n\n /**\n * The fontSize applied to the icon. Defaults to 24px, but can be configure to inherit font size.\n * @default 'medium'\n */\n fontSize: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.oneOf(['inherit', 'large', 'medium', 'small']), PropTypes.string]),\n\n /**\n * Applies a color attribute to the SVG element.\n */\n htmlColor: PropTypes.string,\n\n /**\n * If `true`, the root node will inherit the custom `component`'s viewBox and the `viewBox`\n * prop will be ignored.\n * Useful when you want to reference a custom `component` and have `SvgIcon` pass that\n * `component`'s viewBox to the root node.\n * @default false\n */\n inheritViewBox: PropTypes.bool,\n\n /**\n * The shape-rendering attribute. The behavior of the different options is described on the\n * [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/SVG/Attribute/shape-rendering).\n * If you are having issues with blurry icons you should investigate this prop.\n */\n shapeRendering: PropTypes.string,\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\n /**\n * Provides a human-readable title for the element that contains it.\n * https://www.w3.org/TR/SVG-access/#Equivalent\n */\n titleAccess: PropTypes.string,\n\n /**\n * Allows you to redefine what the coordinates without units mean inside an SVG element.\n * For example, if the SVG element is 500 (width) by 200 (height),\n * and you pass viewBox=\"0 0 50 20\",\n * this means that the coordinates inside the SVG will go from the top left corner (0,0)\n * to bottom right (50,20) and each unit will be worth 10px.\n * @default '0 0 24 24'\n */\n viewBox: PropTypes.string\n} : void 0;\nSvgIcon.muiName = 'SvgIcon';\nexport default SvgIcon;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport SvgIcon from '../SvgIcon';\n/**\n * Private module reserved for @mui packages.\n */\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default function createSvgIcon(path, displayName) {\n const Component = (props, ref) => /*#__PURE__*/_jsx(SvgIcon, _extends({\n \"data-testid\": `${displayName}Icon`,\n ref: ref\n }, props, {\n children: path\n }));\n\n if (process.env.NODE_ENV !== 'production') {\n // Need to set `displayName` on the inner component for React.memo.\n // React prior to 16.14 ignores `displayName` on the wrapper.\n Component.displayName = `${displayName}Icon`;\n }\n\n Component.muiName = SvgIcon.muiName;\n return /*#__PURE__*/React.memo( /*#__PURE__*/React.forwardRef(Component));\n}","import { unstable_debounce as debounce } from '@mui/utils';\nexport default debounce;","import { unstable_createChainedFunction as createChainedFunction } from '@mui/utils';\nexport default createChainedFunction;","import { unstable_deprecatedPropType as deprecatedPropType } from '@mui/utils';\nexport default deprecatedPropType;","export default function deprecatedPropType(validator, reason) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n }\n\n return (props, propName, componentName, location, propFullName) => {\n const componentNameSafe = componentName || '<>';\n const propFullNameSafe = propFullName || propName;\n\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The ${location} \\`${propFullNameSafe}\\` of ` + `\\`${componentNameSafe}\\` is deprecated. ${reason}`);\n }\n\n return null;\n };\n}","import { unstable_requirePropFactory as requirePropFactory } from '@mui/utils';\nexport default requirePropFactory;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport default function requirePropFactory(componentNameInError, Component) {\n if (process.env.NODE_ENV === 'production') {\n return () => null;\n } // eslint-disable-next-line react/forbid-foreign-prop-types\n\n\n const prevPropTypes = Component ? _extends({}, Component.propTypes) : null;\n\n const requireProp = requiredProp => (props, propName, componentName, location, propFullName, ...args) => {\n const propFullNameSafe = propFullName || propName;\n const defaultTypeChecker = prevPropTypes == null ? void 0 : prevPropTypes[propFullNameSafe];\n\n if (defaultTypeChecker) {\n const typeCheckerResult = defaultTypeChecker(props, propName, componentName, location, propFullName, ...args);\n\n if (typeCheckerResult) {\n return typeCheckerResult;\n }\n }\n\n if (typeof props[propName] !== 'undefined' && !props[requiredProp]) {\n return new Error(`The prop \\`${propFullNameSafe}\\` of ` + `\\`${componentNameInError}\\` can only be used together with the \\`${requiredProp}\\` prop.`);\n }\n\n return null;\n };\n\n return requireProp;\n}","import { unstable_setRef as setRef } from '@mui/utils';\nexport default setRef;","import { unstable_unsupportedProp as unsupportedProp } from '@mui/utils';\nexport default unsupportedProp;","export default function unsupportedProp(props, propName, componentName, location, propFullName) {\n if (process.env.NODE_ENV === 'production') {\n return null;\n }\n\n const propFullNameSafe = propFullName || propName;\n\n if (typeof props[propName] !== 'undefined') {\n return new Error(`The prop \\`${propFullNameSafe}\\` is not supported. Please remove it.`);\n }\n\n return null;\n}","import { unstable_ClassNameGenerator as ClassNameGenerator } from '@mui/base/className';\nexport { default as capitalize } from './capitalize';\nexport { default as createChainedFunction } from './createChainedFunction';\nexport { default as createSvgIcon } from './createSvgIcon';\nexport { default as debounce } from './debounce';\nexport { default as deprecatedPropType } from './deprecatedPropType';\nexport { default as isMuiElement } from './isMuiElement';\nexport { default as ownerDocument } from './ownerDocument';\nexport { default as ownerWindow } from './ownerWindow';\nexport { default as requirePropFactory } from './requirePropFactory';\nexport { default as setRef } from './setRef';\nexport { default as unstable_useEnhancedEffect } from './useEnhancedEffect';\nexport { default as unstable_useId } from './useId';\nexport { default as unsupportedProp } from './unsupportedProp';\nexport { default as useControlled } from './useControlled';\nexport { default as useEventCallback } from './useEventCallback';\nexport { default as useForkRef } from './useForkRef';\nexport { default as useIsFocusVisible } from './useIsFocusVisible'; // TODO: remove this export once ClassNameGenerator is stable\n// eslint-disable-next-line @typescript-eslint/naming-convention\n\nexport const unstable_ClassNameGenerator = {\n configure: generator => {\n console.warn(['MUI: `ClassNameGenerator` import from `@mui/material/utils` is outdated and might cause unexpected issues.', '', \"You should use `import { unstable_ClassNameGenerator } from '@mui/material/className'` instead\", '', 'The detail of the issue: https://github.com/mui/material-ui/issues/30011#issuecomment-1024993401', '', 'The updated documentation: https://mui.com/guides/classname-generator/'].join('\\n'));\n ClassNameGenerator.configure(generator);\n }\n};","import { unstable_isMuiElement as isMuiElement } from '@mui/utils';\nexport default isMuiElement;","import * as React from 'react';\nexport default function isMuiElement(element, muiNames) {\n return /*#__PURE__*/React.isValidElement(element) && muiNames.indexOf(element.type.muiName) !== -1;\n}","import { unstable_ownerDocument as ownerDocument } from '@mui/utils';\nexport default ownerDocument;","import { unstable_ownerWindow as ownerWindow } from '@mui/utils';\nexport default ownerWindow;","import { unstable_useControlled as useControlled } from '@mui/utils';\nexport default useControlled;","import { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/utils';\nexport default useEnhancedEffect;","import { unstable_useEventCallback as useEventCallback } from '@mui/utils';\nexport default useEventCallback;","import { unstable_useForkRef as useForkRef } from '@mui/utils';\nexport default useForkRef;","import { unstable_useId as useId } from '@mui/utils';\nexport default useId;","// based on https://github.com/WICG/focus-visible/blob/v4.1.5/src/focus-visible.js\nimport * as React from 'react';\nlet hadKeyboardEvent = true;\nlet hadFocusVisibleRecently = false;\nlet hadFocusVisibleRecentlyTimeout;\nconst inputTypesWhitelist = {\n text: true,\n search: true,\n url: true,\n tel: true,\n email: true,\n password: true,\n number: true,\n date: true,\n month: true,\n week: true,\n time: true,\n datetime: true,\n 'datetime-local': true\n};\n/**\n * Computes whether the given element should automatically trigger the\n * `focus-visible` class being added, i.e. whether it should always match\n * `:focus-visible` when focused.\n * @param {Element} node\n * @returns {boolean}\n */\n\nfunction focusTriggersKeyboardModality(node) {\n const {\n type,\n tagName\n } = node;\n\n if (tagName === 'INPUT' && inputTypesWhitelist[type] && !node.readOnly) {\n return true;\n }\n\n if (tagName === 'TEXTAREA' && !node.readOnly) {\n return true;\n }\n\n if (node.isContentEditable) {\n return true;\n }\n\n return false;\n}\n/**\n * Keep track of our keyboard modality state with `hadKeyboardEvent`.\n * If the most recent user interaction was via the keyboard;\n * and the key press did not include a meta, alt/option, or control key;\n * then the modality is keyboard. Otherwise, the modality is not keyboard.\n * @param {KeyboardEvent} event\n */\n\n\nfunction handleKeyDown(event) {\n if (event.metaKey || event.altKey || event.ctrlKey) {\n return;\n }\n\n hadKeyboardEvent = true;\n}\n/**\n * If at any point a user clicks with a pointing device, ensure that we change\n * the modality away from keyboard.\n * This avoids the situation where a user presses a key on an already focused\n * element, and then clicks on a different element, focusing it with a\n * pointing device, while we still think we're in keyboard modality.\n */\n\n\nfunction handlePointerDown() {\n hadKeyboardEvent = false;\n}\n\nfunction handleVisibilityChange() {\n if (this.visibilityState === 'hidden') {\n // If the tab becomes active again, the browser will handle calling focus\n // on the element (Safari actually calls it twice).\n // If this tab change caused a blur on an element with focus-visible,\n // re-apply the class when the user switches back to the tab.\n if (hadFocusVisibleRecently) {\n hadKeyboardEvent = true;\n }\n }\n}\n\nfunction prepare(doc) {\n doc.addEventListener('keydown', handleKeyDown, true);\n doc.addEventListener('mousedown', handlePointerDown, true);\n doc.addEventListener('pointerdown', handlePointerDown, true);\n doc.addEventListener('touchstart', handlePointerDown, true);\n doc.addEventListener('visibilitychange', handleVisibilityChange, true);\n}\n\nexport function teardown(doc) {\n doc.removeEventListener('keydown', handleKeyDown, true);\n doc.removeEventListener('mousedown', handlePointerDown, true);\n doc.removeEventListener('pointerdown', handlePointerDown, true);\n doc.removeEventListener('touchstart', handlePointerDown, true);\n doc.removeEventListener('visibilitychange', handleVisibilityChange, true);\n}\n\nfunction isFocusVisible(event) {\n const {\n target\n } = event;\n\n try {\n return target.matches(':focus-visible');\n } catch (error) {// Browsers not implementing :focus-visible will throw a SyntaxError.\n // We use our own heuristic for those browsers.\n // Rethrow might be better if it's not the expected error but do we really\n // want to crash if focus-visible malfunctioned?\n } // No need for validFocusTarget check. The user does that by attaching it to\n // focusable events only.\n\n\n return hadKeyboardEvent || focusTriggersKeyboardModality(target);\n}\n\nexport default function useIsFocusVisible() {\n const ref = React.useCallback(node => {\n if (node != null) {\n prepare(node.ownerDocument);\n }\n }, []);\n const isFocusVisibleRef = React.useRef(false);\n /**\n * Should be called if a blur event is fired\n */\n\n function handleBlurVisible() {\n // checking against potential state variable does not suffice if we focus and blur synchronously.\n // React wouldn't have time to trigger a re-render so `focusVisible` would be stale.\n // Ideally we would adjust `isFocusVisible(event)` to look at `relatedTarget` for blur events.\n // This doesn't work in IE11 due to https://github.com/facebook/react/issues/3751\n // TODO: check again if React releases their internal changes to focus event handling (https://github.com/facebook/react/pull/19186).\n if (isFocusVisibleRef.current) {\n // To detect a tab/window switch, we look for a blur event followed\n // rapidly by a visibility change.\n // If we don't see a visibility change within 100ms, it's probably a\n // regular focus change.\n hadFocusVisibleRecently = true;\n window.clearTimeout(hadFocusVisibleRecentlyTimeout);\n hadFocusVisibleRecentlyTimeout = window.setTimeout(() => {\n hadFocusVisibleRecently = false;\n }, 100);\n isFocusVisibleRef.current = false;\n return true;\n }\n\n return false;\n }\n /**\n * Should be called if a blur event is fired\n */\n\n\n function handleFocusVisible(event) {\n if (isFocusVisible(event)) {\n isFocusVisibleRef.current = true;\n return true;\n }\n\n return false;\n }\n\n return {\n isFocusVisibleRef,\n onFocus: handleFocusVisible,\n onBlur: handleBlurVisible,\n ref\n };\n}","import { unstable_useIsFocusVisible as useIsFocusVisible } from '@mui/utils';\nexport default useIsFocusVisible;","const hasSymbol = typeof Symbol === 'function' && Symbol.for;\nexport default hasSymbol ? Symbol.for('mui.nested') : '__THEME_NESTED__';","import * as React from 'react';\nconst ThemeContext = /*#__PURE__*/React.createContext(null);\n\nif (process.env.NODE_ENV !== 'production') {\n ThemeContext.displayName = 'ThemeContext';\n}\n\nexport default ThemeContext;","import * as React from 'react';\nimport ThemeContext from './ThemeContext';\nexport default function useTheme() {\n const theme = React.useContext(ThemeContext);\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(theme);\n }\n\n return theme;\n}","var _typeof = typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; };\n\nexport var isBrowser = (typeof window === \"undefined\" ? \"undefined\" : _typeof(window)) === \"object\" && (typeof document === \"undefined\" ? \"undefined\" : _typeof(document)) === 'object' && document.nodeType === 9;\n\nexport default isBrowser;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport isInBrowser from 'is-in-browser';\nimport warning from 'tiny-warning';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\n\nvar plainObjectConstrurctor = {}.constructor;\nfunction cloneStyle(style) {\n if (style == null || typeof style !== 'object') return style;\n if (Array.isArray(style)) return style.map(cloneStyle);\n if (style.constructor !== plainObjectConstrurctor) return style;\n var newStyle = {};\n\n for (var name in style) {\n newStyle[name] = cloneStyle(style[name]);\n }\n\n return newStyle;\n}\n\n/**\n * Create a rule instance.\n */\n\nfunction createRule(name, decl, options) {\n if (name === void 0) {\n name = 'unnamed';\n }\n\n var jss = options.jss;\n var declCopy = cloneStyle(decl);\n var rule = jss.plugins.onCreateRule(name, declCopy, options);\n if (rule) return rule; // It is an at-rule and it has no instance.\n\n if (name[0] === '@') {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown rule \" + name) : void 0;\n }\n\n return null;\n}\n\nvar join = function join(value, by) {\n var result = '';\n\n for (var i = 0; i < value.length; i++) {\n // Remove !important from the value, it will be readded later.\n if (value[i] === '!important') break;\n if (result) result += by;\n result += value[i];\n }\n\n return result;\n};\n/**\n * Converts JSS array value to a CSS string.\n *\n * `margin: [['5px', '10px']]` > `margin: 5px 10px;`\n * `border: ['1px', '2px']` > `border: 1px, 2px;`\n * `margin: [['5px', '10px'], '!important']` > `margin: 5px 10px !important;`\n * `color: ['red', !important]` > `color: red !important;`\n */\n\n\nvar toCssValue = function toCssValue(value, ignoreImportant) {\n if (ignoreImportant === void 0) {\n ignoreImportant = false;\n }\n\n if (!Array.isArray(value)) return value;\n var cssValue = ''; // Support space separated values via `[['5px', '10px']]`.\n\n if (Array.isArray(value[0])) {\n for (var i = 0; i < value.length; i++) {\n if (value[i] === '!important') break;\n if (cssValue) cssValue += ', ';\n cssValue += join(value[i], ' ');\n }\n } else cssValue = join(value, ', '); // Add !important, because it was ignored.\n\n\n if (!ignoreImportant && value[value.length - 1] === '!important') {\n cssValue += ' !important';\n }\n\n return cssValue;\n};\n\nfunction getWhitespaceSymbols(options) {\n if (options && options.format === false) {\n return {\n linebreak: '',\n space: ''\n };\n }\n\n return {\n linebreak: '\\n',\n space: ' '\n };\n}\n\n/**\n * Indent a string.\n * http://jsperf.com/array-join-vs-for\n */\n\nfunction indentStr(str, indent) {\n var result = '';\n\n for (var index = 0; index < indent; index++) {\n result += ' ';\n }\n\n return result + str;\n}\n/**\n * Converts a Rule to CSS string.\n */\n\n\nfunction toCss(selector, style, options) {\n if (options === void 0) {\n options = {};\n }\n\n var result = '';\n if (!style) return result;\n var _options = options,\n _options$indent = _options.indent,\n indent = _options$indent === void 0 ? 0 : _options$indent;\n var fallbacks = style.fallbacks;\n\n if (options.format === false) {\n indent = -Infinity;\n }\n\n var _getWhitespaceSymbols = getWhitespaceSymbols(options),\n linebreak = _getWhitespaceSymbols.linebreak,\n space = _getWhitespaceSymbols.space;\n\n if (selector) indent++; // Apply fallbacks first.\n\n if (fallbacks) {\n // Array syntax {fallbacks: [{prop: value}]}\n if (Array.isArray(fallbacks)) {\n for (var index = 0; index < fallbacks.length; index++) {\n var fallback = fallbacks[index];\n\n for (var prop in fallback) {\n var value = fallback[prop];\n\n if (value != null) {\n if (result) result += linebreak;\n result += indentStr(prop + \":\" + space + toCssValue(value) + \";\", indent);\n }\n }\n }\n } else {\n // Object syntax {fallbacks: {prop: value}}\n for (var _prop in fallbacks) {\n var _value = fallbacks[_prop];\n\n if (_value != null) {\n if (result) result += linebreak;\n result += indentStr(_prop + \":\" + space + toCssValue(_value) + \";\", indent);\n }\n }\n }\n }\n\n for (var _prop2 in style) {\n var _value2 = style[_prop2];\n\n if (_value2 != null && _prop2 !== 'fallbacks') {\n if (result) result += linebreak;\n result += indentStr(_prop2 + \":\" + space + toCssValue(_value2) + \";\", indent);\n }\n } // Allow empty style in this case, because properties will be added dynamically.\n\n\n if (!result && !options.allowEmpty) return result; // When rule is being stringified before selector was defined.\n\n if (!selector) return result;\n indent--;\n if (result) result = \"\" + linebreak + result + linebreak;\n return indentStr(\"\" + selector + space + \"{\" + result, indent) + indentStr('}', indent);\n}\n\nvar escapeRegex = /([[\\].#*$><+~=|^:(),\"'`\\s])/g;\nvar nativeEscape = typeof CSS !== 'undefined' && CSS.escape;\nvar escape = (function (str) {\n return nativeEscape ? nativeEscape(str) : str.replace(escapeRegex, '\\\\$1');\n});\n\nvar BaseStyleRule =\n/*#__PURE__*/\nfunction () {\n function BaseStyleRule(key, style, options) {\n this.type = 'style';\n this.isProcessed = false;\n var sheet = options.sheet,\n Renderer = options.Renderer;\n this.key = key;\n this.options = options;\n this.style = style;\n if (sheet) this.renderer = sheet.renderer;else if (Renderer) this.renderer = new Renderer();\n }\n /**\n * Get or set a style property.\n */\n\n\n var _proto = BaseStyleRule.prototype;\n\n _proto.prop = function prop(name, value, options) {\n // It's a getter.\n if (value === undefined) return this.style[name]; // Don't do anything if the value has not changed.\n\n var force = options ? options.force : false;\n if (!force && this.style[name] === value) return this;\n var newValue = value;\n\n if (!options || options.process !== false) {\n newValue = this.options.jss.plugins.onChangeValue(value, name, this);\n }\n\n var isEmpty = newValue == null || newValue === false;\n var isDefined = name in this.style; // Value is empty and wasn't defined before.\n\n if (isEmpty && !isDefined && !force) return this; // We are going to remove this value.\n\n var remove = isEmpty && isDefined;\n if (remove) delete this.style[name];else this.style[name] = newValue; // Renderable is defined if StyleSheet option `link` is true.\n\n if (this.renderable && this.renderer) {\n if (remove) this.renderer.removeProperty(this.renderable, name);else this.renderer.setProperty(this.renderable, name, newValue);\n return this;\n }\n\n var sheet = this.options.sheet;\n\n if (sheet && sheet.attached) {\n process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Rule is not linked. Missing sheet option \"link: true\".') : void 0;\n }\n\n return this;\n };\n\n return BaseStyleRule;\n}();\nvar StyleRule =\n/*#__PURE__*/\nfunction (_BaseStyleRule) {\n _inheritsLoose(StyleRule, _BaseStyleRule);\n\n function StyleRule(key, style, options) {\n var _this;\n\n _this = _BaseStyleRule.call(this, key, style, options) || this;\n var selector = options.selector,\n scoped = options.scoped,\n sheet = options.sheet,\n generateId = options.generateId;\n\n if (selector) {\n _this.selectorText = selector;\n } else if (scoped !== false) {\n _this.id = generateId(_assertThisInitialized(_assertThisInitialized(_this)), sheet);\n _this.selectorText = \".\" + escape(_this.id);\n }\n\n return _this;\n }\n /**\n * Set selector string.\n * Attention: use this with caution. Most browsers didn't implement\n * selectorText setter, so this may result in rerendering of entire Style Sheet.\n */\n\n\n var _proto2 = StyleRule.prototype;\n\n /**\n * Apply rule to an element inline.\n */\n _proto2.applyTo = function applyTo(renderable) {\n var renderer = this.renderer;\n\n if (renderer) {\n var json = this.toJSON();\n\n for (var prop in json) {\n renderer.setProperty(renderable, prop, json[prop]);\n }\n }\n\n return this;\n }\n /**\n * Returns JSON representation of the rule.\n * Fallbacks are not supported.\n * Useful for inline styles.\n */\n ;\n\n _proto2.toJSON = function toJSON() {\n var json = {};\n\n for (var prop in this.style) {\n var value = this.style[prop];\n if (typeof value !== 'object') json[prop] = value;else if (Array.isArray(value)) json[prop] = toCssValue(value);\n }\n\n return json;\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto2.toString = function toString(options) {\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n var opts = link ? _extends({}, options, {\n allowEmpty: true\n }) : options;\n return toCss(this.selectorText, this.style, opts);\n };\n\n _createClass(StyleRule, [{\n key: \"selector\",\n set: function set(selector) {\n if (selector === this.selectorText) return;\n this.selectorText = selector;\n var renderer = this.renderer,\n renderable = this.renderable;\n if (!renderable || !renderer) return;\n var hasChanged = renderer.setSelector(renderable, selector); // If selector setter is not implemented, rerender the rule.\n\n if (!hasChanged) {\n renderer.replaceRule(renderable, this);\n }\n }\n /**\n * Get selector string.\n */\n ,\n get: function get() {\n return this.selectorText;\n }\n }]);\n\n return StyleRule;\n}(BaseStyleRule);\nvar pluginStyleRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n if (key[0] === '@' || options.parent && options.parent.type === 'keyframes') {\n return null;\n }\n\n return new StyleRule(key, style, options);\n }\n};\n\nvar defaultToStringOptions = {\n indent: 1,\n children: true\n};\nvar atRegExp = /@([\\w-]+)/;\n/**\n * Conditional rule for @media, @supports\n */\n\nvar ConditionalRule =\n/*#__PURE__*/\nfunction () {\n function ConditionalRule(key, styles, options) {\n this.type = 'conditional';\n this.isProcessed = false;\n this.key = key;\n var atMatch = key.match(atRegExp);\n this.at = atMatch ? atMatch[1] : 'unknown'; // Key might contain a unique suffix in case the `name` passed by user was duplicate.\n\n this.query = options.name || \"@\" + this.at;\n this.options = options;\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n /**\n * Get a rule.\n */\n\n\n var _proto = ConditionalRule.prototype;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Create and register rule, run plugins.\n */\n ;\n\n _proto.addRule = function addRule(name, style, options) {\n var rule = this.rules.add(name, style, options);\n if (!rule) return null;\n this.options.jss.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Replace rule, run plugins.\n */\n ;\n\n _proto.replaceRule = function replaceRule(name, style, options) {\n var newRule = this.rules.replace(name, style, options);\n if (newRule) this.options.jss.plugins.onProcessRule(newRule);\n return newRule;\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n if (options === void 0) {\n options = defaultToStringOptions;\n }\n\n var _getWhitespaceSymbols = getWhitespaceSymbols(options),\n linebreak = _getWhitespaceSymbols.linebreak;\n\n if (options.indent == null) options.indent = defaultToStringOptions.indent;\n if (options.children == null) options.children = defaultToStringOptions.children;\n\n if (options.children === false) {\n return this.query + \" {}\";\n }\n\n var children = this.rules.toString(options);\n return children ? this.query + \" {\" + linebreak + children + linebreak + \"}\" : '';\n };\n\n return ConditionalRule;\n}();\nvar keyRegExp = /@media|@supports\\s+/;\nvar pluginConditionalRule = {\n onCreateRule: function onCreateRule(key, styles, options) {\n return keyRegExp.test(key) ? new ConditionalRule(key, styles, options) : null;\n }\n};\n\nvar defaultToStringOptions$1 = {\n indent: 1,\n children: true\n};\nvar nameRegExp = /@keyframes\\s+([\\w-]+)/;\n/**\n * Rule for @keyframes\n */\n\nvar KeyframesRule =\n/*#__PURE__*/\nfunction () {\n function KeyframesRule(key, frames, options) {\n this.type = 'keyframes';\n this.at = '@keyframes';\n this.isProcessed = false;\n var nameMatch = key.match(nameRegExp);\n\n if (nameMatch && nameMatch[1]) {\n this.name = nameMatch[1];\n } else {\n this.name = 'noname';\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Bad keyframes name \" + key) : void 0;\n }\n\n this.key = this.type + \"-\" + this.name;\n this.options = options;\n var scoped = options.scoped,\n sheet = options.sheet,\n generateId = options.generateId;\n this.id = scoped === false ? this.name : escape(generateId(this, sheet));\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var name in frames) {\n this.rules.add(name, frames[name], _extends({}, options, {\n parent: this\n }));\n }\n\n this.rules.process();\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = KeyframesRule.prototype;\n\n _proto.toString = function toString(options) {\n if (options === void 0) {\n options = defaultToStringOptions$1;\n }\n\n var _getWhitespaceSymbols = getWhitespaceSymbols(options),\n linebreak = _getWhitespaceSymbols.linebreak;\n\n if (options.indent == null) options.indent = defaultToStringOptions$1.indent;\n if (options.children == null) options.children = defaultToStringOptions$1.children;\n\n if (options.children === false) {\n return this.at + \" \" + this.id + \" {}\";\n }\n\n var children = this.rules.toString(options);\n if (children) children = \"\" + linebreak + children + linebreak;\n return this.at + \" \" + this.id + \" {\" + children + \"}\";\n };\n\n return KeyframesRule;\n}();\nvar keyRegExp$1 = /@keyframes\\s+/;\nvar refRegExp = /\\$([\\w-]+)/g;\n\nvar findReferencedKeyframe = function findReferencedKeyframe(val, keyframes) {\n if (typeof val === 'string') {\n return val.replace(refRegExp, function (match, name) {\n if (name in keyframes) {\n return keyframes[name];\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Referenced keyframes rule \\\"\" + name + \"\\\" is not defined.\") : void 0;\n return match;\n });\n }\n\n return val;\n};\n/**\n * Replace the reference for a animation name.\n */\n\n\nvar replaceRef = function replaceRef(style, prop, keyframes) {\n var value = style[prop];\n var refKeyframe = findReferencedKeyframe(value, keyframes);\n\n if (refKeyframe !== value) {\n style[prop] = refKeyframe;\n }\n};\n\nvar pluginKeyframesRule = {\n onCreateRule: function onCreateRule(key, frames, options) {\n return typeof key === 'string' && keyRegExp$1.test(key) ? new KeyframesRule(key, frames, options) : null;\n },\n // Animation name ref replacer.\n onProcessStyle: function onProcessStyle(style, rule, sheet) {\n if (rule.type !== 'style' || !sheet) return style;\n if ('animation-name' in style) replaceRef(style, 'animation-name', sheet.keyframes);\n if ('animation' in style) replaceRef(style, 'animation', sheet.keyframes);\n return style;\n },\n onChangeValue: function onChangeValue(val, prop, rule) {\n var sheet = rule.options.sheet;\n\n if (!sheet) {\n return val;\n }\n\n switch (prop) {\n case 'animation':\n return findReferencedKeyframe(val, sheet.keyframes);\n\n case 'animation-name':\n return findReferencedKeyframe(val, sheet.keyframes);\n\n default:\n return val;\n }\n }\n};\n\nvar KeyframeRule =\n/*#__PURE__*/\nfunction (_BaseStyleRule) {\n _inheritsLoose(KeyframeRule, _BaseStyleRule);\n\n function KeyframeRule() {\n return _BaseStyleRule.apply(this, arguments) || this;\n }\n\n var _proto = KeyframeRule.prototype;\n\n /**\n * Generates a CSS string.\n */\n _proto.toString = function toString(options) {\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n var opts = link ? _extends({}, options, {\n allowEmpty: true\n }) : options;\n return toCss(this.key, this.style, opts);\n };\n\n return KeyframeRule;\n}(BaseStyleRule);\nvar pluginKeyframeRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n if (options.parent && options.parent.type === 'keyframes') {\n return new KeyframeRule(key, style, options);\n }\n\n return null;\n }\n};\n\nvar FontFaceRule =\n/*#__PURE__*/\nfunction () {\n function FontFaceRule(key, style, options) {\n this.type = 'font-face';\n this.at = '@font-face';\n this.isProcessed = false;\n this.key = key;\n this.style = style;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = FontFaceRule.prototype;\n\n _proto.toString = function toString(options) {\n var _getWhitespaceSymbols = getWhitespaceSymbols(options),\n linebreak = _getWhitespaceSymbols.linebreak;\n\n if (Array.isArray(this.style)) {\n var str = '';\n\n for (var index = 0; index < this.style.length; index++) {\n str += toCss(this.at, this.style[index]);\n if (this.style[index + 1]) str += linebreak;\n }\n\n return str;\n }\n\n return toCss(this.at, this.style, options);\n };\n\n return FontFaceRule;\n}();\nvar keyRegExp$2 = /@font-face/;\nvar pluginFontFaceRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n return keyRegExp$2.test(key) ? new FontFaceRule(key, style, options) : null;\n }\n};\n\nvar ViewportRule =\n/*#__PURE__*/\nfunction () {\n function ViewportRule(key, style, options) {\n this.type = 'viewport';\n this.at = '@viewport';\n this.isProcessed = false;\n this.key = key;\n this.style = style;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n\n\n var _proto = ViewportRule.prototype;\n\n _proto.toString = function toString(options) {\n return toCss(this.key, this.style, options);\n };\n\n return ViewportRule;\n}();\nvar pluginViewportRule = {\n onCreateRule: function onCreateRule(key, style, options) {\n return key === '@viewport' || key === '@-ms-viewport' ? new ViewportRule(key, style, options) : null;\n }\n};\n\nvar SimpleRule =\n/*#__PURE__*/\nfunction () {\n function SimpleRule(key, value, options) {\n this.type = 'simple';\n this.isProcessed = false;\n this.key = key;\n this.value = value;\n this.options = options;\n }\n /**\n * Generates a CSS string.\n */\n // eslint-disable-next-line no-unused-vars\n\n\n var _proto = SimpleRule.prototype;\n\n _proto.toString = function toString(options) {\n if (Array.isArray(this.value)) {\n var str = '';\n\n for (var index = 0; index < this.value.length; index++) {\n str += this.key + \" \" + this.value[index] + \";\";\n if (this.value[index + 1]) str += '\\n';\n }\n\n return str;\n }\n\n return this.key + \" \" + this.value + \";\";\n };\n\n return SimpleRule;\n}();\nvar keysMap = {\n '@charset': true,\n '@import': true,\n '@namespace': true\n};\nvar pluginSimpleRule = {\n onCreateRule: function onCreateRule(key, value, options) {\n return key in keysMap ? new SimpleRule(key, value, options) : null;\n }\n};\n\nvar plugins = [pluginStyleRule, pluginConditionalRule, pluginKeyframesRule, pluginKeyframeRule, pluginFontFaceRule, pluginViewportRule, pluginSimpleRule];\n\nvar defaultUpdateOptions = {\n process: true\n};\nvar forceUpdateOptions = {\n force: true,\n process: true\n /**\n * Contains rules objects and allows adding/removing etc.\n * Is used for e.g. by `StyleSheet` or `ConditionalRule`.\n */\n\n};\n\nvar RuleList =\n/*#__PURE__*/\nfunction () {\n // Rules registry for access by .get() method.\n // It contains the same rule registered by name and by selector.\n // Original styles object.\n // Used to ensure correct rules order.\n function RuleList(options) {\n this.map = {};\n this.raw = {};\n this.index = [];\n this.counter = 0;\n this.options = options;\n this.classes = options.classes;\n this.keyframes = options.keyframes;\n }\n /**\n * Create and register rule.\n *\n * Will not render after Style Sheet was rendered the first time.\n */\n\n\n var _proto = RuleList.prototype;\n\n _proto.add = function add(name, decl, ruleOptions) {\n var _this$options = this.options,\n parent = _this$options.parent,\n sheet = _this$options.sheet,\n jss = _this$options.jss,\n Renderer = _this$options.Renderer,\n generateId = _this$options.generateId,\n scoped = _this$options.scoped;\n\n var options = _extends({\n classes: this.classes,\n parent: parent,\n sheet: sheet,\n jss: jss,\n Renderer: Renderer,\n generateId: generateId,\n scoped: scoped,\n name: name,\n keyframes: this.keyframes,\n selector: undefined\n }, ruleOptions); // When user uses .createStyleSheet(), duplicate names are not possible, but\n // `sheet.addRule()` opens the door for any duplicate rule name. When this happens\n // we need to make the key unique within this RuleList instance scope.\n\n\n var key = name;\n\n if (name in this.raw) {\n key = name + \"-d\" + this.counter++;\n } // We need to save the original decl before creating the rule\n // because cache plugin needs to use it as a key to return a cached rule.\n\n\n this.raw[key] = decl;\n\n if (key in this.classes) {\n // E.g. rules inside of @media container\n options.selector = \".\" + escape(this.classes[key]);\n }\n\n var rule = createRule(key, decl, options);\n if (!rule) return null;\n this.register(rule);\n var index = options.index === undefined ? this.index.length : options.index;\n this.index.splice(index, 0, rule);\n return rule;\n }\n /**\n * Replace rule.\n * Create a new rule and remove old one instead of overwriting\n * because we want to invoke onCreateRule hook to make plugins work.\n */\n ;\n\n _proto.replace = function replace(name, decl, ruleOptions) {\n var oldRule = this.get(name);\n var oldIndex = this.index.indexOf(oldRule);\n\n if (oldRule) {\n this.remove(oldRule);\n }\n\n var options = ruleOptions;\n if (oldIndex !== -1) options = _extends({}, ruleOptions, {\n index: oldIndex\n });\n return this.add(name, decl, options);\n }\n /**\n * Get a rule by name or selector.\n */\n ;\n\n _proto.get = function get(nameOrSelector) {\n return this.map[nameOrSelector];\n }\n /**\n * Delete a rule.\n */\n ;\n\n _proto.remove = function remove(rule) {\n this.unregister(rule);\n delete this.raw[rule.key];\n this.index.splice(this.index.indexOf(rule), 1);\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.index.indexOf(rule);\n }\n /**\n * Run `onProcessRule()` plugins on every rule.\n */\n ;\n\n _proto.process = function process() {\n var plugins = this.options.jss.plugins; // We need to clone array because if we modify the index somewhere else during a loop\n // we end up with very hard-to-track-down side effects.\n\n this.index.slice(0).forEach(plugins.onProcessRule, plugins);\n }\n /**\n * Register a rule in `.map`, `.classes` and `.keyframes` maps.\n */\n ;\n\n _proto.register = function register(rule) {\n this.map[rule.key] = rule;\n\n if (rule instanceof StyleRule) {\n this.map[rule.selector] = rule;\n if (rule.id) this.classes[rule.key] = rule.id;\n } else if (rule instanceof KeyframesRule && this.keyframes) {\n this.keyframes[rule.name] = rule.id;\n }\n }\n /**\n * Unregister a rule.\n */\n ;\n\n _proto.unregister = function unregister(rule) {\n delete this.map[rule.key];\n\n if (rule instanceof StyleRule) {\n delete this.map[rule.selector];\n delete this.classes[rule.key];\n } else if (rule instanceof KeyframesRule) {\n delete this.keyframes[rule.name];\n }\n }\n /**\n * Update the function values with a new data.\n */\n ;\n\n _proto.update = function update() {\n var name;\n var data;\n var options;\n\n if (typeof (arguments.length <= 0 ? undefined : arguments[0]) === 'string') {\n name = arguments.length <= 0 ? undefined : arguments[0];\n data = arguments.length <= 1 ? undefined : arguments[1];\n options = arguments.length <= 2 ? undefined : arguments[2];\n } else {\n data = arguments.length <= 0 ? undefined : arguments[0];\n options = arguments.length <= 1 ? undefined : arguments[1];\n name = null;\n }\n\n if (name) {\n this.updateOne(this.get(name), data, options);\n } else {\n for (var index = 0; index < this.index.length; index++) {\n this.updateOne(this.index[index], data, options);\n }\n }\n }\n /**\n * Execute plugins, update rule props.\n */\n ;\n\n _proto.updateOne = function updateOne(rule, data, options) {\n if (options === void 0) {\n options = defaultUpdateOptions;\n }\n\n var _this$options2 = this.options,\n plugins = _this$options2.jss.plugins,\n sheet = _this$options2.sheet; // It is a rules container like for e.g. ConditionalRule.\n\n if (rule.rules instanceof RuleList) {\n rule.rules.update(data, options);\n return;\n }\n\n var style = rule.style;\n plugins.onUpdate(data, rule, sheet, options); // We rely on a new `style` ref in case it was mutated during onUpdate hook.\n\n if (options.process && style && style !== rule.style) {\n // We need to run the plugins in case new `style` relies on syntax plugins.\n plugins.onProcessStyle(rule.style, rule, sheet); // Update and add props.\n\n for (var prop in rule.style) {\n var nextValue = rule.style[prop];\n var prevValue = style[prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.\n // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.\n\n if (nextValue !== prevValue) {\n rule.prop(prop, nextValue, forceUpdateOptions);\n }\n } // Remove props.\n\n\n for (var _prop in style) {\n var _nextValue = rule.style[_prop];\n var _prevValue = style[_prop]; // We need to use `force: true` because `rule.style` has been updated during onUpdate hook, so `rule.prop()` will not update the CSSOM rule.\n // We do this comparison to avoid unneeded `rule.prop()` calls, since we have the old `style` object here.\n\n if (_nextValue == null && _nextValue !== _prevValue) {\n rule.prop(_prop, null, forceUpdateOptions);\n }\n }\n }\n }\n /**\n * Convert rules to a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n var str = '';\n var sheet = this.options.sheet;\n var link = sheet ? sheet.options.link : false;\n\n var _getWhitespaceSymbols = getWhitespaceSymbols(options),\n linebreak = _getWhitespaceSymbols.linebreak;\n\n for (var index = 0; index < this.index.length; index++) {\n var rule = this.index[index];\n var css = rule.toString(options); // No need to render an empty rule.\n\n if (!css && !link) continue;\n if (str) str += linebreak;\n str += css;\n }\n\n return str;\n };\n\n return RuleList;\n}();\n\nvar StyleSheet =\n/*#__PURE__*/\nfunction () {\n function StyleSheet(styles, options) {\n this.attached = false;\n this.deployed = false;\n this.classes = {};\n this.keyframes = {};\n this.options = _extends({}, options, {\n sheet: this,\n parent: this,\n classes: this.classes,\n keyframes: this.keyframes\n });\n\n if (options.Renderer) {\n this.renderer = new options.Renderer(this);\n }\n\n this.rules = new RuleList(this.options);\n\n for (var name in styles) {\n this.rules.add(name, styles[name]);\n }\n\n this.rules.process();\n }\n /**\n * Attach renderable to the render tree.\n */\n\n\n var _proto = StyleSheet.prototype;\n\n _proto.attach = function attach() {\n if (this.attached) return this;\n if (this.renderer) this.renderer.attach();\n this.attached = true; // Order is important, because we can't use insertRule API if style element is not attached.\n\n if (!this.deployed) this.deploy();\n return this;\n }\n /**\n * Remove renderable from render tree.\n */\n ;\n\n _proto.detach = function detach() {\n if (!this.attached) return this;\n if (this.renderer) this.renderer.detach();\n this.attached = false;\n return this;\n }\n /**\n * Add a rule to the current stylesheet.\n * Will insert a rule also after the stylesheet has been rendered first time.\n */\n ;\n\n _proto.addRule = function addRule(name, decl, options) {\n var queue = this.queue; // Plugins can create rules.\n // In order to preserve the right order, we need to queue all `.addRule` calls,\n // which happen after the first `rules.add()` call.\n\n if (this.attached && !queue) this.queue = [];\n var rule = this.rules.add(name, decl, options);\n if (!rule) return null;\n this.options.jss.plugins.onProcessRule(rule);\n\n if (this.attached) {\n if (!this.deployed) return rule; // Don't insert rule directly if there is no stringified version yet.\n // It will be inserted all together when .attach is called.\n\n if (queue) queue.push(rule);else {\n this.insertRule(rule);\n\n if (this.queue) {\n this.queue.forEach(this.insertRule, this);\n this.queue = undefined;\n }\n }\n return rule;\n } // We can't add rules to a detached style node.\n // We will redeploy the sheet once user will attach it.\n\n\n this.deployed = false;\n return rule;\n }\n /**\n * Replace a rule in the current stylesheet.\n */\n ;\n\n _proto.replaceRule = function replaceRule(nameOrSelector, decl, options) {\n var oldRule = this.rules.get(nameOrSelector);\n if (!oldRule) return this.addRule(nameOrSelector, decl, options);\n var newRule = this.rules.replace(nameOrSelector, decl, options);\n\n if (newRule) {\n this.options.jss.plugins.onProcessRule(newRule);\n }\n\n if (this.attached) {\n if (!this.deployed) return newRule; // Don't replace / delete rule directly if there is no stringified version yet.\n // It will be inserted all together when .attach is called.\n\n if (this.renderer) {\n if (!newRule) {\n this.renderer.deleteRule(oldRule);\n } else if (oldRule.renderable) {\n this.renderer.replaceRule(oldRule.renderable, newRule);\n }\n }\n\n return newRule;\n } // We can't replace rules to a detached style node.\n // We will redeploy the sheet once user will attach it.\n\n\n this.deployed = false;\n return newRule;\n }\n /**\n * Insert rule into the StyleSheet\n */\n ;\n\n _proto.insertRule = function insertRule(rule) {\n if (this.renderer) {\n this.renderer.insertRule(rule);\n }\n }\n /**\n * Create and add rules.\n * Will render also after Style Sheet was rendered the first time.\n */\n ;\n\n _proto.addRules = function addRules(styles, options) {\n var added = [];\n\n for (var name in styles) {\n var rule = this.addRule(name, styles[name], options);\n if (rule) added.push(rule);\n }\n\n return added;\n }\n /**\n * Get a rule by name or selector.\n */\n ;\n\n _proto.getRule = function getRule(nameOrSelector) {\n return this.rules.get(nameOrSelector);\n }\n /**\n * Delete a rule by name.\n * Returns `true`: if rule has been deleted from the DOM.\n */\n ;\n\n _proto.deleteRule = function deleteRule(name) {\n var rule = typeof name === 'object' ? name : this.rules.get(name);\n\n if (!rule || // Style sheet was created without link: true and attached, in this case we\n // won't be able to remove the CSS rule from the DOM.\n this.attached && !rule.renderable) {\n return false;\n }\n\n this.rules.remove(rule);\n\n if (this.attached && rule.renderable && this.renderer) {\n return this.renderer.deleteRule(rule.renderable);\n }\n\n return true;\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Deploy pure CSS string to a renderable.\n */\n ;\n\n _proto.deploy = function deploy() {\n if (this.renderer) this.renderer.deploy();\n this.deployed = true;\n return this;\n }\n /**\n * Update the function values with a new data.\n */\n ;\n\n _proto.update = function update() {\n var _this$rules;\n\n (_this$rules = this.rules).update.apply(_this$rules, arguments);\n\n return this;\n }\n /**\n * Updates a single rule.\n */\n ;\n\n _proto.updateOne = function updateOne(rule, data, options) {\n this.rules.updateOne(rule, data, options);\n return this;\n }\n /**\n * Convert rules to a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n return this.rules.toString(options);\n };\n\n return StyleSheet;\n}();\n\nvar PluginsRegistry =\n/*#__PURE__*/\nfunction () {\n function PluginsRegistry() {\n this.plugins = {\n internal: [],\n external: []\n };\n this.registry = {};\n }\n\n var _proto = PluginsRegistry.prototype;\n\n /**\n * Call `onCreateRule` hooks and return an object if returned by a hook.\n */\n _proto.onCreateRule = function onCreateRule(name, decl, options) {\n for (var i = 0; i < this.registry.onCreateRule.length; i++) {\n var rule = this.registry.onCreateRule[i](name, decl, options);\n if (rule) return rule;\n }\n\n return null;\n }\n /**\n * Call `onProcessRule` hooks.\n */\n ;\n\n _proto.onProcessRule = function onProcessRule(rule) {\n if (rule.isProcessed) return;\n var sheet = rule.options.sheet;\n\n for (var i = 0; i < this.registry.onProcessRule.length; i++) {\n this.registry.onProcessRule[i](rule, sheet);\n }\n\n if (rule.style) this.onProcessStyle(rule.style, rule, sheet);\n rule.isProcessed = true;\n }\n /**\n * Call `onProcessStyle` hooks.\n */\n ;\n\n _proto.onProcessStyle = function onProcessStyle(style, rule, sheet) {\n for (var i = 0; i < this.registry.onProcessStyle.length; i++) {\n rule.style = this.registry.onProcessStyle[i](rule.style, rule, sheet);\n }\n }\n /**\n * Call `onProcessSheet` hooks.\n */\n ;\n\n _proto.onProcessSheet = function onProcessSheet(sheet) {\n for (var i = 0; i < this.registry.onProcessSheet.length; i++) {\n this.registry.onProcessSheet[i](sheet);\n }\n }\n /**\n * Call `onUpdate` hooks.\n */\n ;\n\n _proto.onUpdate = function onUpdate(data, rule, sheet, options) {\n for (var i = 0; i < this.registry.onUpdate.length; i++) {\n this.registry.onUpdate[i](data, rule, sheet, options);\n }\n }\n /**\n * Call `onChangeValue` hooks.\n */\n ;\n\n _proto.onChangeValue = function onChangeValue(value, prop, rule) {\n var processedValue = value;\n\n for (var i = 0; i < this.registry.onChangeValue.length; i++) {\n processedValue = this.registry.onChangeValue[i](processedValue, prop, rule);\n }\n\n return processedValue;\n }\n /**\n * Register a plugin.\n */\n ;\n\n _proto.use = function use(newPlugin, options) {\n if (options === void 0) {\n options = {\n queue: 'external'\n };\n }\n\n var plugins = this.plugins[options.queue]; // Avoids applying same plugin twice, at least based on ref.\n\n if (plugins.indexOf(newPlugin) !== -1) {\n return;\n }\n\n plugins.push(newPlugin);\n this.registry = [].concat(this.plugins.external, this.plugins.internal).reduce(function (registry, plugin) {\n for (var name in plugin) {\n if (name in registry) {\n registry[name].push(plugin[name]);\n } else {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Unknown hook \\\"\" + name + \"\\\".\") : void 0;\n }\n }\n\n return registry;\n }, {\n onCreateRule: [],\n onProcessRule: [],\n onProcessStyle: [],\n onProcessSheet: [],\n onChangeValue: [],\n onUpdate: []\n });\n };\n\n return PluginsRegistry;\n}();\n\n/**\n * Sheets registry to access all instances in one place.\n */\n\nvar SheetsRegistry =\n/*#__PURE__*/\nfunction () {\n function SheetsRegistry() {\n this.registry = [];\n }\n\n var _proto = SheetsRegistry.prototype;\n\n /**\n * Register a Style Sheet.\n */\n _proto.add = function add(sheet) {\n var registry = this.registry;\n var index = sheet.options.index;\n if (registry.indexOf(sheet) !== -1) return;\n\n if (registry.length === 0 || index >= this.index) {\n registry.push(sheet);\n return;\n } // Find a position.\n\n\n for (var i = 0; i < registry.length; i++) {\n if (registry[i].options.index > index) {\n registry.splice(i, 0, sheet);\n return;\n }\n }\n }\n /**\n * Reset the registry.\n */\n ;\n\n _proto.reset = function reset() {\n this.registry = [];\n }\n /**\n * Remove a Style Sheet.\n */\n ;\n\n _proto.remove = function remove(sheet) {\n var index = this.registry.indexOf(sheet);\n this.registry.splice(index, 1);\n }\n /**\n * Convert all attached sheets to a CSS string.\n */\n ;\n\n _proto.toString = function toString(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n attached = _ref.attached,\n options = _objectWithoutPropertiesLoose(_ref, [\"attached\"]);\n\n var _getWhitespaceSymbols = getWhitespaceSymbols(options),\n linebreak = _getWhitespaceSymbols.linebreak;\n\n var css = '';\n\n for (var i = 0; i < this.registry.length; i++) {\n var sheet = this.registry[i];\n\n if (attached != null && sheet.attached !== attached) {\n continue;\n }\n\n if (css) css += linebreak;\n css += sheet.toString(options);\n }\n\n return css;\n };\n\n _createClass(SheetsRegistry, [{\n key: \"index\",\n\n /**\n * Current highest index number.\n */\n get: function get() {\n return this.registry.length === 0 ? 0 : this.registry[this.registry.length - 1].options.index;\n }\n }]);\n\n return SheetsRegistry;\n}();\n\n/**\n * This is a global sheets registry. Only DomRenderer will add sheets to it.\n * On the server one should use an own SheetsRegistry instance and add the\n * sheets to it, because you need to make sure to create a new registry for\n * each request in order to not leak sheets across requests.\n */\n\nvar sheets = new SheetsRegistry();\n\n/* eslint-disable */\n\n/**\n * Now that `globalThis` is available on most platforms\n * (https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/globalThis#browser_compatibility)\n * we check for `globalThis` first. `globalThis` is necessary for jss\n * to run in Agoric's secure version of JavaScript (SES). Under SES,\n * `globalThis` exists, but `window`, `self`, and `Function('return\n * this')()` are all undefined for security reasons.\n *\n * https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\n */\nvar globalThis$1 = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' && window.Math === Math ? window : typeof self !== 'undefined' && self.Math === Math ? self : Function('return this')();\n\nvar ns = '2f1acc6c3a606b082e5eef5e54414ffb';\nif (globalThis$1[ns] == null) globalThis$1[ns] = 0; // Bundle may contain multiple JSS versions at the same time. In order to identify\n// the current version with just one short number and use it for classes generation\n// we use a counter. Also it is more accurate, because user can manually reevaluate\n// the module.\n\nvar moduleId = globalThis$1[ns]++;\n\nvar maxRules = 1e10;\n/**\n * Returns a function which generates unique class names based on counters.\n * When new generator function is created, rule counter is reseted.\n * We need to reset the rule counter for SSR for each request.\n */\n\nvar createGenerateId = function createGenerateId(options) {\n if (options === void 0) {\n options = {};\n }\n\n var ruleCounter = 0;\n\n var generateId = function generateId(rule, sheet) {\n ruleCounter += 1;\n\n if (ruleCounter > maxRules) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] You might have a memory leak. Rule counter is at \" + ruleCounter + \".\") : void 0;\n }\n\n var jssId = '';\n var prefix = '';\n\n if (sheet) {\n if (sheet.options.classNamePrefix) {\n prefix = sheet.options.classNamePrefix;\n }\n\n if (sheet.options.jss.id != null) {\n jssId = String(sheet.options.jss.id);\n }\n }\n\n if (options.minify) {\n // Using \"c\" because a number can't be the first char in a class name.\n return \"\" + (prefix || 'c') + moduleId + jssId + ruleCounter;\n }\n\n return prefix + rule.key + \"-\" + moduleId + (jssId ? \"-\" + jssId : '') + \"-\" + ruleCounter;\n };\n\n return generateId;\n};\n\n/**\n * Cache the value from the first time a function is called.\n */\n\nvar memoize = function memoize(fn) {\n var value;\n return function () {\n if (!value) value = fn();\n return value;\n };\n};\n/**\n * Get a style property value.\n */\n\n\nvar getPropertyValue = function getPropertyValue(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n return cssRule.attributeStyleMap.get(prop);\n }\n\n return cssRule.style.getPropertyValue(prop);\n } catch (err) {\n // IE may throw if property is unknown.\n return '';\n }\n};\n/**\n * Set a style property.\n */\n\n\nvar setProperty = function setProperty(cssRule, prop, value) {\n try {\n var cssValue = value;\n\n if (Array.isArray(value)) {\n cssValue = toCssValue(value, true);\n\n if (value[value.length - 1] === '!important') {\n cssRule.style.setProperty(prop, cssValue, 'important');\n return true;\n }\n } // Support CSSTOM.\n\n\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.set(prop, cssValue);\n } else {\n cssRule.style.setProperty(prop, cssValue);\n }\n } catch (err) {\n // IE may throw if property is unknown.\n return false;\n }\n\n return true;\n};\n/**\n * Remove a style property.\n */\n\n\nvar removeProperty = function removeProperty(cssRule, prop) {\n try {\n // Support CSSTOM.\n if (cssRule.attributeStyleMap) {\n cssRule.attributeStyleMap.delete(prop);\n } else {\n cssRule.style.removeProperty(prop);\n }\n } catch (err) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] DOMException \\\"\" + err.message + \"\\\" was thrown. Tried to remove property \\\"\" + prop + \"\\\".\") : void 0;\n }\n};\n/**\n * Set the selector.\n */\n\n\nvar setSelector = function setSelector(cssRule, selectorText) {\n cssRule.selectorText = selectorText; // Return false if setter was not successful.\n // Currently works in chrome only.\n\n return cssRule.selectorText === selectorText;\n};\n/**\n * Gets the `head` element upon the first call and caches it.\n * We assume it can't be null.\n */\n\n\nvar getHead = memoize(function () {\n return document.querySelector('head');\n});\n/**\n * Find attached sheet with an index higher than the passed one.\n */\n\nfunction findHigherSheet(registry, options) {\n for (var i = 0; i < registry.length; i++) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.index > options.index && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}\n/**\n * Find attached sheet with the highest index.\n */\n\n\nfunction findHighestSheet(registry, options) {\n for (var i = registry.length - 1; i >= 0; i--) {\n var sheet = registry[i];\n\n if (sheet.attached && sheet.options.insertionPoint === options.insertionPoint) {\n return sheet;\n }\n }\n\n return null;\n}\n/**\n * Find a comment with \"jss\" inside.\n */\n\n\nfunction findCommentNode(text) {\n var head = getHead();\n\n for (var i = 0; i < head.childNodes.length; i++) {\n var node = head.childNodes[i];\n\n if (node.nodeType === 8 && node.nodeValue.trim() === text) {\n return node;\n }\n }\n\n return null;\n}\n/**\n * Find a node before which we can insert the sheet.\n */\n\n\nfunction findPrevNode(options) {\n var registry = sheets.registry;\n\n if (registry.length > 0) {\n // Try to insert before the next higher sheet.\n var sheet = findHigherSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element\n };\n } // Otherwise insert after the last attached.\n\n\n sheet = findHighestSheet(registry, options);\n\n if (sheet && sheet.renderer) {\n return {\n parent: sheet.renderer.element.parentNode,\n node: sheet.renderer.element.nextSibling\n };\n }\n } // Try to find a comment placeholder if registry is empty.\n\n\n var insertionPoint = options.insertionPoint;\n\n if (insertionPoint && typeof insertionPoint === 'string') {\n var comment = findCommentNode(insertionPoint);\n\n if (comment) {\n return {\n parent: comment.parentNode,\n node: comment.nextSibling\n };\n } // If user specifies an insertion point and it can't be found in the document -\n // bad specificity issues may appear.\n\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Insertion point \\\"\" + insertionPoint + \"\\\" not found.\") : void 0;\n }\n\n return false;\n}\n/**\n * Insert style element into the DOM.\n */\n\n\nfunction insertStyle(style, options) {\n var insertionPoint = options.insertionPoint;\n var nextNode = findPrevNode(options);\n\n if (nextNode !== false && nextNode.parent) {\n nextNode.parent.insertBefore(style, nextNode.node);\n return;\n } // Works with iframes and any node types.\n\n\n if (insertionPoint && typeof insertionPoint.nodeType === 'number') {\n var insertionPointElement = insertionPoint;\n var parentNode = insertionPointElement.parentNode;\n if (parentNode) parentNode.insertBefore(style, insertionPointElement.nextSibling);else process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Insertion point is not in the DOM.') : void 0;\n return;\n }\n\n getHead().appendChild(style);\n}\n/**\n * Read jss nonce setting from the page if the user has set it.\n */\n\n\nvar getNonce = memoize(function () {\n var node = document.querySelector('meta[property=\"csp-nonce\"]');\n return node ? node.getAttribute('content') : null;\n});\n\nvar _insertRule = function insertRule(container, rule, index) {\n try {\n if ('insertRule' in container) {\n container.insertRule(rule, index);\n } // Keyframes rule.\n else if ('appendRule' in container) {\n container.appendRule(rule);\n }\n } catch (err) {\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] \" + err.message) : void 0;\n return false;\n }\n\n return container.cssRules[index];\n};\n\nvar getValidRuleInsertionIndex = function getValidRuleInsertionIndex(container, index) {\n var maxIndex = container.cssRules.length; // In case previous insertion fails, passed index might be wrong\n\n if (index === undefined || index > maxIndex) {\n // eslint-disable-next-line no-param-reassign\n return maxIndex;\n }\n\n return index;\n};\n\nvar createStyle = function createStyle() {\n var el = document.createElement('style'); // Without it, IE will have a broken source order specificity if we\n // insert rules after we insert the style tag.\n // It seems to kick-off the source order specificity algorithm.\n\n el.textContent = '\\n';\n return el;\n};\n\nvar DomRenderer =\n/*#__PURE__*/\nfunction () {\n // Will be empty if link: true option is not set, because\n // it is only for use together with insertRule API.\n function DomRenderer(sheet) {\n this.getPropertyValue = getPropertyValue;\n this.setProperty = setProperty;\n this.removeProperty = removeProperty;\n this.setSelector = setSelector;\n this.hasInsertedRules = false;\n this.cssRules = [];\n // There is no sheet when the renderer is used from a standalone StyleRule.\n if (sheet) sheets.add(sheet);\n this.sheet = sheet;\n\n var _ref = this.sheet ? this.sheet.options : {},\n media = _ref.media,\n meta = _ref.meta,\n element = _ref.element;\n\n this.element = element || createStyle();\n this.element.setAttribute('data-jss', '');\n if (media) this.element.setAttribute('media', media);\n if (meta) this.element.setAttribute('data-meta', meta);\n var nonce = getNonce();\n if (nonce) this.element.setAttribute('nonce', nonce);\n }\n /**\n * Insert style element into render tree.\n */\n\n\n var _proto = DomRenderer.prototype;\n\n _proto.attach = function attach() {\n // In the case the element node is external and it is already in the DOM.\n if (this.element.parentNode || !this.sheet) return;\n insertStyle(this.element, this.sheet.options); // When rules are inserted using `insertRule` API, after `sheet.detach().attach()`\n // most browsers create a new CSSStyleSheet, except of all IEs.\n\n var deployed = Boolean(this.sheet && this.sheet.deployed);\n\n if (this.hasInsertedRules && deployed) {\n this.hasInsertedRules = false;\n this.deploy();\n }\n }\n /**\n * Remove style element from render tree.\n */\n ;\n\n _proto.detach = function detach() {\n if (!this.sheet) return;\n var parentNode = this.element.parentNode;\n if (parentNode) parentNode.removeChild(this.element); // In the most browsers, rules inserted using insertRule() API will be lost when style element is removed.\n // Though IE will keep them and we need a consistent behavior.\n\n if (this.sheet.options.link) {\n this.cssRules = [];\n this.element.textContent = '\\n';\n }\n }\n /**\n * Inject CSS string into element.\n */\n ;\n\n _proto.deploy = function deploy() {\n var sheet = this.sheet;\n if (!sheet) return;\n\n if (sheet.options.link) {\n this.insertRules(sheet.rules);\n return;\n }\n\n this.element.textContent = \"\\n\" + sheet.toString() + \"\\n\";\n }\n /**\n * Insert RuleList into an element.\n */\n ;\n\n _proto.insertRules = function insertRules(rules, nativeParent) {\n for (var i = 0; i < rules.index.length; i++) {\n this.insertRule(rules.index[i], i, nativeParent);\n }\n }\n /**\n * Insert a rule into element.\n */\n ;\n\n _proto.insertRule = function insertRule(rule, index, nativeParent) {\n if (nativeParent === void 0) {\n nativeParent = this.element.sheet;\n }\n\n if (rule.rules) {\n var parent = rule;\n var latestNativeParent = nativeParent;\n\n if (rule.type === 'conditional' || rule.type === 'keyframes') {\n var _insertionIndex = getValidRuleInsertionIndex(nativeParent, index); // We need to render the container without children first.\n\n\n latestNativeParent = _insertRule(nativeParent, parent.toString({\n children: false\n }), _insertionIndex);\n\n if (latestNativeParent === false) {\n return false;\n }\n\n this.refCssRule(rule, _insertionIndex, latestNativeParent);\n }\n\n this.insertRules(parent.rules, latestNativeParent);\n return latestNativeParent;\n }\n\n var ruleStr = rule.toString();\n if (!ruleStr) return false;\n var insertionIndex = getValidRuleInsertionIndex(nativeParent, index);\n\n var nativeRule = _insertRule(nativeParent, ruleStr, insertionIndex);\n\n if (nativeRule === false) {\n return false;\n }\n\n this.hasInsertedRules = true;\n this.refCssRule(rule, insertionIndex, nativeRule);\n return nativeRule;\n };\n\n _proto.refCssRule = function refCssRule(rule, index, cssRule) {\n rule.renderable = cssRule; // We only want to reference the top level rules, deleteRule API doesn't support removing nested rules\n // like rules inside media queries or keyframes\n\n if (rule.options.parent instanceof StyleSheet) {\n this.cssRules.splice(index, 0, cssRule);\n }\n }\n /**\n * Delete a rule.\n */\n ;\n\n _proto.deleteRule = function deleteRule(cssRule) {\n var sheet = this.element.sheet;\n var index = this.indexOf(cssRule);\n if (index === -1) return false;\n sheet.deleteRule(index);\n this.cssRules.splice(index, 1);\n return true;\n }\n /**\n * Get index of a CSS Rule.\n */\n ;\n\n _proto.indexOf = function indexOf(cssRule) {\n return this.cssRules.indexOf(cssRule);\n }\n /**\n * Generate a new CSS rule and replace the existing one.\n */\n ;\n\n _proto.replaceRule = function replaceRule(cssRule, rule) {\n var index = this.indexOf(cssRule);\n if (index === -1) return false;\n this.element.sheet.deleteRule(index);\n this.cssRules.splice(index, 1);\n return this.insertRule(rule, index);\n }\n /**\n * Get all rules elements.\n */\n ;\n\n _proto.getRules = function getRules() {\n return this.element.sheet.cssRules;\n };\n\n return DomRenderer;\n}();\n\nvar instanceCounter = 0;\n\nvar Jss =\n/*#__PURE__*/\nfunction () {\n function Jss(options) {\n this.id = instanceCounter++;\n this.version = \"10.9.0\";\n this.plugins = new PluginsRegistry();\n this.options = {\n id: {\n minify: false\n },\n createGenerateId: createGenerateId,\n Renderer: isInBrowser ? DomRenderer : null,\n plugins: []\n };\n this.generateId = createGenerateId({\n minify: false\n });\n\n for (var i = 0; i < plugins.length; i++) {\n this.plugins.use(plugins[i], {\n queue: 'internal'\n });\n }\n\n this.setup(options);\n }\n /**\n * Prepares various options, applies plugins.\n * Should not be used twice on the same instance, because there is no plugins\n * deduplication logic.\n */\n\n\n var _proto = Jss.prototype;\n\n _proto.setup = function setup(options) {\n if (options === void 0) {\n options = {};\n }\n\n if (options.createGenerateId) {\n this.options.createGenerateId = options.createGenerateId;\n }\n\n if (options.id) {\n this.options.id = _extends({}, this.options.id, options.id);\n }\n\n if (options.createGenerateId || options.id) {\n this.generateId = this.options.createGenerateId(this.options.id);\n }\n\n if (options.insertionPoint != null) this.options.insertionPoint = options.insertionPoint;\n\n if ('Renderer' in options) {\n this.options.Renderer = options.Renderer;\n } // eslint-disable-next-line prefer-spread\n\n\n if (options.plugins) this.use.apply(this, options.plugins);\n return this;\n }\n /**\n * Create a Style Sheet.\n */\n ;\n\n _proto.createStyleSheet = function createStyleSheet(styles, options) {\n if (options === void 0) {\n options = {};\n }\n\n var _options = options,\n index = _options.index;\n\n if (typeof index !== 'number') {\n index = sheets.index === 0 ? 0 : sheets.index + 1;\n }\n\n var sheet = new StyleSheet(styles, _extends({}, options, {\n jss: this,\n generateId: options.generateId || this.generateId,\n insertionPoint: this.options.insertionPoint,\n Renderer: this.options.Renderer,\n index: index\n }));\n this.plugins.onProcessSheet(sheet);\n return sheet;\n }\n /**\n * Detach the Style Sheet and remove it from the registry.\n */\n ;\n\n _proto.removeStyleSheet = function removeStyleSheet(sheet) {\n sheet.detach();\n sheets.remove(sheet);\n return this;\n }\n /**\n * Create a rule without a Style Sheet.\n * [Deprecated] will be removed in the next major version.\n */\n ;\n\n _proto.createRule = function createRule$1(name, style, options) {\n if (style === void 0) {\n style = {};\n }\n\n if (options === void 0) {\n options = {};\n }\n\n // Enable rule without name for inline styles.\n if (typeof name === 'object') {\n return this.createRule(undefined, name, style);\n }\n\n var ruleOptions = _extends({}, options, {\n name: name,\n jss: this,\n Renderer: this.options.Renderer\n });\n\n if (!ruleOptions.generateId) ruleOptions.generateId = this.generateId;\n if (!ruleOptions.classes) ruleOptions.classes = {};\n if (!ruleOptions.keyframes) ruleOptions.keyframes = {};\n\n var rule = createRule(name, style, ruleOptions);\n\n if (rule) this.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Register plugin. Passed function will be invoked with a rule instance.\n */\n ;\n\n _proto.use = function use() {\n var _this = this;\n\n for (var _len = arguments.length, plugins = new Array(_len), _key = 0; _key < _len; _key++) {\n plugins[_key] = arguments[_key];\n }\n\n plugins.forEach(function (plugin) {\n _this.plugins.use(plugin);\n });\n return this;\n };\n\n return Jss;\n}();\n\nvar createJss = function createJss(options) {\n return new Jss(options);\n};\n\n/**\n * SheetsManager is like a WeakMap which is designed to count StyleSheet\n * instances and attach/detach automatically.\n * Used in react-jss.\n */\n\nvar SheetsManager =\n/*#__PURE__*/\nfunction () {\n function SheetsManager() {\n this.length = 0;\n this.sheets = new WeakMap();\n }\n\n var _proto = SheetsManager.prototype;\n\n _proto.get = function get(key) {\n var entry = this.sheets.get(key);\n return entry && entry.sheet;\n };\n\n _proto.add = function add(key, sheet) {\n if (this.sheets.has(key)) return;\n this.length++;\n this.sheets.set(key, {\n sheet: sheet,\n refs: 0\n });\n };\n\n _proto.manage = function manage(key) {\n var entry = this.sheets.get(key);\n\n if (entry) {\n if (entry.refs === 0) {\n entry.sheet.attach();\n }\n\n entry.refs++;\n return entry.sheet;\n }\n\n warning(false, \"[JSS] SheetsManager: can't find sheet to manage\");\n return undefined;\n };\n\n _proto.unmanage = function unmanage(key) {\n var entry = this.sheets.get(key);\n\n if (entry) {\n if (entry.refs > 0) {\n entry.refs--;\n if (entry.refs === 0) entry.sheet.detach();\n }\n } else {\n warning(false, \"SheetsManager: can't find sheet to unmanage\");\n }\n };\n\n _createClass(SheetsManager, [{\n key: \"size\",\n get: function get() {\n return this.length;\n }\n }]);\n\n return SheetsManager;\n}();\n\n/**\n* Export a constant indicating if this browser has CSSTOM support.\n* https://developers.google.com/web/updates/2018/03/cssom\n*/\nvar hasCSSTOMSupport = typeof CSS === 'object' && CSS != null && 'number' in CSS;\n\n/**\n * Extracts a styles object with only props that contain function values.\n */\nfunction getDynamicStyles(styles) {\n var to = null;\n\n for (var key in styles) {\n var value = styles[key];\n var type = typeof value;\n\n if (type === 'function') {\n if (!to) to = {};\n to[key] = value;\n } else if (type === 'object' && value !== null && !Array.isArray(value)) {\n var extracted = getDynamicStyles(value);\n\n if (extracted) {\n if (!to) to = {};\n to[key] = extracted;\n }\n }\n }\n\n return to;\n}\n\n/**\n * A better abstraction over CSS.\n *\n * @copyright Oleg Isonen (Slobodskoi) / Isonen 2014-present\n * @website https://github.com/cssinjs/jss\n * @license MIT\n */\nvar index = createJss();\n\nexport default index;\nexport { RuleList, SheetsManager, SheetsRegistry, createJss as create, createGenerateId, createRule, getDynamicStyles, hasCSSTOMSupport, sheets, toCssValue };\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { getDisplayName } from '@mui/utils';\nexport default function mergeClasses(options = {}) {\n const {\n baseClasses,\n newClasses,\n Component\n } = options;\n\n if (!newClasses) {\n return baseClasses;\n }\n\n const nextClasses = _extends({}, baseClasses);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof newClasses === 'string') {\n console.error([`MUI: The value \\`${newClasses}\\` ` + `provided to the classes prop of ${getDisplayName(Component)} is incorrect.`, 'You might want to use the className prop instead.'].join('\\n'));\n return baseClasses;\n }\n }\n\n Object.keys(newClasses).forEach(key => {\n if (process.env.NODE_ENV !== 'production') {\n if (!baseClasses[key] && newClasses[key]) {\n console.error([`MUI: The key \\`${key}\\` ` + `provided to the classes prop is not implemented in ${getDisplayName(Component)}.`, `You can only override one of the following: ${Object.keys(baseClasses).join(',')}.`].join('\\n'));\n }\n\n if (newClasses[key] && typeof newClasses[key] !== 'string') {\n console.error([`MUI: The key \\`${key}\\` ` + `provided to the classes prop is not valid for ${getDisplayName(Component)}.`, `You need to provide a non empty string instead of: ${newClasses[key]}.`].join('\\n'));\n }\n }\n\n if (newClasses[key]) {\n nextClasses[key] = `${baseClasses[key]} ${newClasses[key]}`;\n }\n });\n return nextClasses;\n}","// Used https://github.com/thinkloop/multi-key-cache as inspiration\nconst multiKeyStore = {\n set: (cache, key1, key2, value) => {\n let subCache = cache.get(key1);\n\n if (!subCache) {\n subCache = new Map();\n cache.set(key1, subCache);\n }\n\n subCache.set(key2, value);\n },\n get: (cache, key1, key2) => {\n const subCache = cache.get(key1);\n return subCache ? subCache.get(key2) : undefined;\n },\n delete: (cache, key1, key2) => {\n const subCache = cache.get(key1);\n subCache.delete(key2);\n }\n};\nexport default multiKeyStore;","import { unstable_nested as nested } from '@mui/private-theming/ThemeProvider';\n/**\n * This is the list of the style rule name we use as drop in replacement for the built-in\n * pseudo classes (:checked, :disabled, :focused, etc.).\n *\n * Why do they exist in the first place?\n * These classes are used at a specificity of 2.\n * It allows them to override previously defined styles as well as\n * being untouched by simple user overrides.\n */\n\nconst stateClasses = ['checked', 'disabled', 'error', 'focused', 'focusVisible', 'required', 'expanded', 'selected']; // Returns a function which generates unique class names based on counters.\n// When new generator function is created, rule counter is reset.\n// We need to reset the rule counter for SSR for each request.\n//\n// It's inspired by\n// https://github.com/cssinjs/jss/blob/4e6a05dd3f7b6572fdd3ab216861d9e446c20331/src/utils/createGenerateClassName.js\n\nexport default function createGenerateClassName(options = {}) {\n const {\n disableGlobal = false,\n productionPrefix = 'jss',\n seed = ''\n } = options;\n const seedPrefix = seed === '' ? '' : `${seed}-`;\n let ruleCounter = 0;\n\n const getNextCounterId = () => {\n ruleCounter += 1;\n\n if (process.env.NODE_ENV !== 'production') {\n if (ruleCounter >= 1e10) {\n console.warn(['MUI: You might have a memory leak.', 'The ruleCounter is not supposed to grow that much.'].join(''));\n }\n }\n\n return ruleCounter;\n };\n\n return (rule, styleSheet) => {\n const name = styleSheet.options.name; // Is a global static MUI style?\n\n if (name && name.indexOf('Mui') === 0 && !styleSheet.options.link && !disableGlobal) {\n // We can use a shorthand class name, we never use the keys to style the components.\n if (stateClasses.indexOf(rule.key) !== -1) {\n return `Mui-${rule.key}`;\n }\n\n const prefix = `${seedPrefix}${name}-${rule.key}`;\n\n if (!styleSheet.options.theme[nested] || seed !== '') {\n return prefix;\n }\n\n return `${prefix}-${getNextCounterId()}`;\n }\n\n if (process.env.NODE_ENV === 'production') {\n return `${seedPrefix}${productionPrefix}${getNextCounterId()}`;\n }\n\n const suffix = `${rule.key}-${getNextCounterId()}`; // Help with debuggability.\n\n if (styleSheet.options.classNamePrefix) {\n return `${seedPrefix}${styleSheet.options.classNamePrefix}-${suffix}`;\n }\n\n return `${seedPrefix}${suffix}`;\n };\n}","import warning from 'tiny-warning';\nimport { createRule } from 'jss';\n\nvar now = Date.now();\nvar fnValuesNs = \"fnValues\" + now;\nvar fnRuleNs = \"fnStyle\" + ++now;\n\nvar functionPlugin = function functionPlugin() {\n return {\n onCreateRule: function onCreateRule(name, decl, options) {\n if (typeof decl !== 'function') return null;\n var rule = createRule(name, {}, options);\n rule[fnRuleNs] = decl;\n return rule;\n },\n onProcessStyle: function onProcessStyle(style, rule) {\n // We need to extract function values from the declaration, so that we can keep core unaware of them.\n // We need to do that only once.\n // We don't need to extract functions on each style update, since this can happen only once.\n // We don't support function values inside of function rules.\n if (fnValuesNs in rule || fnRuleNs in rule) return style;\n var fnValues = {};\n\n for (var prop in style) {\n var value = style[prop];\n if (typeof value !== 'function') continue;\n delete style[prop];\n fnValues[prop] = value;\n }\n\n rule[fnValuesNs] = fnValues;\n return style;\n },\n onUpdate: function onUpdate(data, rule, sheet, options) {\n var styleRule = rule;\n var fnRule = styleRule[fnRuleNs]; // If we have a style function, the entire rule is dynamic and style object\n // will be returned from that function.\n\n if (fnRule) {\n // Empty object will remove all currently defined props\n // in case function rule returns a falsy value.\n styleRule.style = fnRule(data) || {};\n\n if (process.env.NODE_ENV === 'development') {\n for (var prop in styleRule.style) {\n if (typeof styleRule.style[prop] === 'function') {\n process.env.NODE_ENV !== \"production\" ? warning(false, '[JSS] Function values inside function rules are not supported.') : void 0;\n break;\n }\n }\n }\n }\n\n var fnValues = styleRule[fnValuesNs]; // If we have a fn values map, it is a rule with function values.\n\n if (fnValues) {\n for (var _prop in fnValues) {\n styleRule.prop(_prop, fnValues[_prop](data), options);\n }\n }\n }\n };\n};\n\nexport default functionPlugin;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport { RuleList } from 'jss';\n\nvar at = '@global';\nvar atPrefix = '@global ';\n\nvar GlobalContainerRule =\n/*#__PURE__*/\nfunction () {\n function GlobalContainerRule(key, styles, options) {\n this.type = 'global';\n this.at = at;\n this.isProcessed = false;\n this.key = key;\n this.options = options;\n this.rules = new RuleList(_extends({}, options, {\n parent: this\n }));\n\n for (var selector in styles) {\n this.rules.add(selector, styles[selector]);\n }\n\n this.rules.process();\n }\n /**\n * Get a rule.\n */\n\n\n var _proto = GlobalContainerRule.prototype;\n\n _proto.getRule = function getRule(name) {\n return this.rules.get(name);\n }\n /**\n * Create and register rule, run plugins.\n */\n ;\n\n _proto.addRule = function addRule(name, style, options) {\n var rule = this.rules.add(name, style, options);\n if (rule) this.options.jss.plugins.onProcessRule(rule);\n return rule;\n }\n /**\n * Replace rule, run plugins.\n */\n ;\n\n _proto.replaceRule = function replaceRule(name, style, options) {\n var newRule = this.rules.replace(name, style, options);\n if (newRule) this.options.jss.plugins.onProcessRule(newRule);\n return newRule;\n }\n /**\n * Get index of a rule.\n */\n ;\n\n _proto.indexOf = function indexOf(rule) {\n return this.rules.indexOf(rule);\n }\n /**\n * Generates a CSS string.\n */\n ;\n\n _proto.toString = function toString(options) {\n return this.rules.toString(options);\n };\n\n return GlobalContainerRule;\n}();\n\nvar GlobalPrefixedRule =\n/*#__PURE__*/\nfunction () {\n function GlobalPrefixedRule(key, style, options) {\n this.type = 'global';\n this.at = at;\n this.isProcessed = false;\n this.key = key;\n this.options = options;\n var selector = key.substr(atPrefix.length);\n this.rule = options.jss.createRule(selector, style, _extends({}, options, {\n parent: this\n }));\n }\n\n var _proto2 = GlobalPrefixedRule.prototype;\n\n _proto2.toString = function toString(options) {\n return this.rule ? this.rule.toString(options) : '';\n };\n\n return GlobalPrefixedRule;\n}();\n\nvar separatorRegExp = /\\s*,\\s*/g;\n\nfunction addScope(selector, scope) {\n var parts = selector.split(separatorRegExp);\n var scoped = '';\n\n for (var i = 0; i < parts.length; i++) {\n scoped += scope + \" \" + parts[i].trim();\n if (parts[i + 1]) scoped += ', ';\n }\n\n return scoped;\n}\n\nfunction handleNestedGlobalContainerRule(rule, sheet) {\n var options = rule.options,\n style = rule.style;\n var rules = style ? style[at] : null;\n if (!rules) return;\n\n for (var name in rules) {\n sheet.addRule(name, rules[name], _extends({}, options, {\n selector: addScope(name, rule.selector)\n }));\n }\n\n delete style[at];\n}\n\nfunction handlePrefixedGlobalRule(rule, sheet) {\n var options = rule.options,\n style = rule.style;\n\n for (var prop in style) {\n if (prop[0] !== '@' || prop.substr(0, at.length) !== at) continue;\n var selector = addScope(prop.substr(at.length), rule.selector);\n sheet.addRule(selector, style[prop], _extends({}, options, {\n selector: selector\n }));\n delete style[prop];\n }\n}\n/**\n * Convert nested rules to separate, remove them from original styles.\n */\n\n\nfunction jssGlobal() {\n function onCreateRule(name, styles, options) {\n if (!name) return null;\n\n if (name === at) {\n return new GlobalContainerRule(name, styles, options);\n }\n\n if (name[0] === '@' && name.substr(0, atPrefix.length) === atPrefix) {\n return new GlobalPrefixedRule(name, styles, options);\n }\n\n var parent = options.parent;\n\n if (parent) {\n if (parent.type === 'global' || parent.options.parent && parent.options.parent.type === 'global') {\n options.scoped = false;\n }\n }\n\n if (!options.selector && options.scoped === false) {\n options.selector = name;\n }\n\n return null;\n }\n\n function onProcessRule(rule, sheet) {\n if (rule.type !== 'style' || !sheet) return;\n handleNestedGlobalContainerRule(rule, sheet);\n handlePrefixedGlobalRule(rule, sheet);\n }\n\n return {\n onCreateRule: onCreateRule,\n onProcessRule: onProcessRule\n };\n}\n\nexport default jssGlobal;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport warning from 'tiny-warning';\n\nvar separatorRegExp = /\\s*,\\s*/g;\nvar parentRegExp = /&/g;\nvar refRegExp = /\\$([\\w-]+)/g;\n/**\n * Convert nested rules to separate, remove them from original styles.\n */\n\nfunction jssNested() {\n // Get a function to be used for $ref replacement.\n function getReplaceRef(container, sheet) {\n return function (match, key) {\n var rule = container.getRule(key) || sheet && sheet.getRule(key);\n\n if (rule) {\n return rule.selector;\n }\n\n process.env.NODE_ENV !== \"production\" ? warning(false, \"[JSS] Could not find the referenced rule \\\"\" + key + \"\\\" in \\\"\" + (container.options.meta || container.toString()) + \"\\\".\") : void 0;\n return key;\n };\n }\n\n function replaceParentRefs(nestedProp, parentProp) {\n var parentSelectors = parentProp.split(separatorRegExp);\n var nestedSelectors = nestedProp.split(separatorRegExp);\n var result = '';\n\n for (var i = 0; i < parentSelectors.length; i++) {\n var parent = parentSelectors[i];\n\n for (var j = 0; j < nestedSelectors.length; j++) {\n var nested = nestedSelectors[j];\n if (result) result += ', '; // Replace all & by the parent or prefix & with the parent.\n\n result += nested.indexOf('&') !== -1 ? nested.replace(parentRegExp, parent) : parent + \" \" + nested;\n }\n }\n\n return result;\n }\n\n function getOptions(rule, container, prevOptions) {\n // Options has been already created, now we only increase index.\n if (prevOptions) return _extends({}, prevOptions, {\n index: prevOptions.index + 1\n });\n var nestingLevel = rule.options.nestingLevel;\n nestingLevel = nestingLevel === undefined ? 1 : nestingLevel + 1;\n\n var options = _extends({}, rule.options, {\n nestingLevel: nestingLevel,\n index: container.indexOf(rule) + 1 // We don't need the parent name to be set options for chlid.\n\n });\n\n delete options.name;\n return options;\n }\n\n function onProcessStyle(style, rule, sheet) {\n if (rule.type !== 'style') return style;\n var styleRule = rule;\n var container = styleRule.options.parent;\n var options;\n var replaceRef;\n\n for (var prop in style) {\n var isNested = prop.indexOf('&') !== -1;\n var isNestedConditional = prop[0] === '@';\n if (!isNested && !isNestedConditional) continue;\n options = getOptions(styleRule, container, options);\n\n if (isNested) {\n var selector = replaceParentRefs(prop, styleRule.selector); // Lazily create the ref replacer function just once for\n // all nested rules within the sheet.\n\n if (!replaceRef) replaceRef = getReplaceRef(container, sheet); // Replace all $refs.\n\n selector = selector.replace(refRegExp, replaceRef);\n var name = styleRule.key + \"-\" + prop;\n\n if ('replaceRule' in container) {\n // for backward compatibility\n container.replaceRule(name, style[prop], _extends({}, options, {\n selector: selector\n }));\n } else {\n container.addRule(name, style[prop], _extends({}, options, {\n selector: selector\n }));\n }\n } else if (isNestedConditional) {\n // Place conditional right after the parent rule to ensure right ordering.\n container.addRule(prop, {}, options).addRule(styleRule.key, style[prop], {\n selector: styleRule.selector\n });\n }\n\n delete style[prop];\n }\n\n return style;\n }\n\n return {\n onProcessStyle: onProcessStyle\n };\n}\n\nexport default jssNested;\n","/* eslint-disable no-var, prefer-template */\nvar uppercasePattern = /[A-Z]/g\nvar msPattern = /^ms-/\nvar cache = {}\n\nfunction toHyphenLower(match) {\n return '-' + match.toLowerCase()\n}\n\nfunction hyphenateStyleName(name) {\n if (cache.hasOwnProperty(name)) {\n return cache[name]\n }\n\n var hName = name.replace(uppercasePattern, toHyphenLower)\n return (cache[name] = msPattern.test(hName) ? '-' + hName : hName)\n}\n\nexport default hyphenateStyleName\n","import hyphenate from 'hyphenate-style-name';\n\n/**\n * Convert camel cased property names to dash separated.\n */\n\nfunction convertCase(style) {\n var converted = {};\n\n for (var prop in style) {\n var key = prop.indexOf('--') === 0 ? prop : hyphenate(prop);\n converted[key] = style[prop];\n }\n\n if (style.fallbacks) {\n if (Array.isArray(style.fallbacks)) converted.fallbacks = style.fallbacks.map(convertCase);else converted.fallbacks = convertCase(style.fallbacks);\n }\n\n return converted;\n}\n/**\n * Allow camel cased property names by converting them back to dasherized.\n */\n\n\nfunction camelCase() {\n function onProcessStyle(style) {\n if (Array.isArray(style)) {\n // Handle rules like @font-face, which can have multiple styles in an array\n for (var index = 0; index < style.length; index++) {\n style[index] = convertCase(style[index]);\n }\n\n return style;\n }\n\n return convertCase(style);\n }\n\n function onChangeValue(value, prop, rule) {\n if (prop.indexOf('--') === 0) {\n return value;\n }\n\n var hyphenatedProp = hyphenate(prop); // There was no camel case in place\n\n if (prop === hyphenatedProp) return value;\n rule.prop(hyphenatedProp, value); // Core will ignore that property value we set the proper one above.\n\n return null;\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default camelCase;\n","import { hasCSSTOMSupport } from 'jss';\n\nvar px = hasCSSTOMSupport && CSS ? CSS.px : 'px';\nvar ms = hasCSSTOMSupport && CSS ? CSS.ms : 'ms';\nvar percent = hasCSSTOMSupport && CSS ? CSS.percent : '%';\n/**\n * Generated jss-plugin-default-unit CSS property units\n */\n\nvar defaultUnits = {\n // Animation properties\n 'animation-delay': ms,\n 'animation-duration': ms,\n // Background properties\n 'background-position': px,\n 'background-position-x': px,\n 'background-position-y': px,\n 'background-size': px,\n // Border Properties\n border: px,\n 'border-bottom': px,\n 'border-bottom-left-radius': px,\n 'border-bottom-right-radius': px,\n 'border-bottom-width': px,\n 'border-left': px,\n 'border-left-width': px,\n 'border-radius': px,\n 'border-right': px,\n 'border-right-width': px,\n 'border-top': px,\n 'border-top-left-radius': px,\n 'border-top-right-radius': px,\n 'border-top-width': px,\n 'border-width': px,\n 'border-block': px,\n 'border-block-end': px,\n 'border-block-end-width': px,\n 'border-block-start': px,\n 'border-block-start-width': px,\n 'border-block-width': px,\n 'border-inline': px,\n 'border-inline-end': px,\n 'border-inline-end-width': px,\n 'border-inline-start': px,\n 'border-inline-start-width': px,\n 'border-inline-width': px,\n 'border-start-start-radius': px,\n 'border-start-end-radius': px,\n 'border-end-start-radius': px,\n 'border-end-end-radius': px,\n // Margin properties\n margin: px,\n 'margin-bottom': px,\n 'margin-left': px,\n 'margin-right': px,\n 'margin-top': px,\n 'margin-block': px,\n 'margin-block-end': px,\n 'margin-block-start': px,\n 'margin-inline': px,\n 'margin-inline-end': px,\n 'margin-inline-start': px,\n // Padding properties\n padding: px,\n 'padding-bottom': px,\n 'padding-left': px,\n 'padding-right': px,\n 'padding-top': px,\n 'padding-block': px,\n 'padding-block-end': px,\n 'padding-block-start': px,\n 'padding-inline': px,\n 'padding-inline-end': px,\n 'padding-inline-start': px,\n // Mask properties\n 'mask-position-x': px,\n 'mask-position-y': px,\n 'mask-size': px,\n // Width and height properties\n height: px,\n width: px,\n 'min-height': px,\n 'max-height': px,\n 'min-width': px,\n 'max-width': px,\n // Position properties\n bottom: px,\n left: px,\n top: px,\n right: px,\n inset: px,\n 'inset-block': px,\n 'inset-block-end': px,\n 'inset-block-start': px,\n 'inset-inline': px,\n 'inset-inline-end': px,\n 'inset-inline-start': px,\n // Shadow properties\n 'box-shadow': px,\n 'text-shadow': px,\n // Column properties\n 'column-gap': px,\n 'column-rule': px,\n 'column-rule-width': px,\n 'column-width': px,\n // Font and text properties\n 'font-size': px,\n 'font-size-delta': px,\n 'letter-spacing': px,\n 'text-decoration-thickness': px,\n 'text-indent': px,\n 'text-stroke': px,\n 'text-stroke-width': px,\n 'word-spacing': px,\n // Motion properties\n motion: px,\n 'motion-offset': px,\n // Outline properties\n outline: px,\n 'outline-offset': px,\n 'outline-width': px,\n // Perspective properties\n perspective: px,\n 'perspective-origin-x': percent,\n 'perspective-origin-y': percent,\n // Transform properties\n 'transform-origin': percent,\n 'transform-origin-x': percent,\n 'transform-origin-y': percent,\n 'transform-origin-z': percent,\n // Transition properties\n 'transition-delay': ms,\n 'transition-duration': ms,\n // Alignment properties\n 'vertical-align': px,\n 'flex-basis': px,\n // Some random properties\n 'shape-margin': px,\n size: px,\n gap: px,\n // Grid properties\n grid: px,\n 'grid-gap': px,\n 'row-gap': px,\n 'grid-row-gap': px,\n 'grid-column-gap': px,\n 'grid-template-rows': px,\n 'grid-template-columns': px,\n 'grid-auto-rows': px,\n 'grid-auto-columns': px,\n // Not existing properties.\n // Used to avoid issues with jss-plugin-expand integration.\n 'box-shadow-x': px,\n 'box-shadow-y': px,\n 'box-shadow-blur': px,\n 'box-shadow-spread': px,\n 'font-line-height': px,\n 'text-shadow-x': px,\n 'text-shadow-y': px,\n 'text-shadow-blur': px\n};\n\n/**\n * Clones the object and adds a camel cased property version.\n */\n\nfunction addCamelCasedVersion(obj) {\n var regExp = /(-[a-z])/g;\n\n var replace = function replace(str) {\n return str[1].toUpperCase();\n };\n\n var newObj = {};\n\n for (var key in obj) {\n newObj[key] = obj[key];\n newObj[key.replace(regExp, replace)] = obj[key];\n }\n\n return newObj;\n}\n\nvar units = addCamelCasedVersion(defaultUnits);\n/**\n * Recursive deep style passing function\n */\n\nfunction iterate(prop, value, options) {\n if (value == null) return value;\n\n if (Array.isArray(value)) {\n for (var i = 0; i < value.length; i++) {\n value[i] = iterate(prop, value[i], options);\n }\n } else if (typeof value === 'object') {\n if (prop === 'fallbacks') {\n for (var innerProp in value) {\n value[innerProp] = iterate(innerProp, value[innerProp], options);\n }\n } else {\n for (var _innerProp in value) {\n value[_innerProp] = iterate(prop + \"-\" + _innerProp, value[_innerProp], options);\n }\n } // eslint-disable-next-line no-restricted-globals\n\n } else if (typeof value === 'number' && isNaN(value) === false) {\n var unit = options[prop] || units[prop]; // Add the unit if available, except for the special case of 0px.\n\n if (unit && !(value === 0 && unit === px)) {\n return typeof unit === 'function' ? unit(value).toString() : \"\" + value + unit;\n }\n\n return value.toString();\n }\n\n return value;\n}\n/**\n * Add unit to numeric values.\n */\n\n\nfunction defaultUnit(options) {\n if (options === void 0) {\n options = {};\n }\n\n var camelCasedOptions = addCamelCasedVersion(options);\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n\n for (var prop in style) {\n style[prop] = iterate(prop, style[prop], camelCasedOptions);\n }\n\n return style;\n }\n\n function onChangeValue(value, prop) {\n return iterate(prop, value, camelCasedOptions);\n }\n\n return {\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default defaultUnit;\n","import isInBrowser from 'is-in-browser';\nimport _toConsumableArray from '@babel/runtime/helpers/esm/toConsumableArray';\n\n// Export javascript style and css style vendor prefixes.\nvar js = '';\nvar css = '';\nvar vendor = '';\nvar browser = '';\nvar isTouch = isInBrowser && 'ontouchstart' in document.documentElement; // We should not do anything if required serverside.\n\nif (isInBrowser) {\n // Order matters. We need to check Webkit the last one because\n // other vendors use to add Webkit prefixes to some properties\n var jsCssMap = {\n Moz: '-moz-',\n ms: '-ms-',\n O: '-o-',\n Webkit: '-webkit-'\n };\n\n var _document$createEleme = document.createElement('p'),\n style = _document$createEleme.style;\n\n var testProp = 'Transform';\n\n for (var key in jsCssMap) {\n if (key + testProp in style) {\n js = key;\n css = jsCssMap[key];\n break;\n }\n } // Correctly detect the Edge browser.\n\n\n if (js === 'Webkit' && 'msHyphens' in style) {\n js = 'ms';\n css = jsCssMap.ms;\n browser = 'edge';\n } // Correctly detect the Safari browser.\n\n\n if (js === 'Webkit' && '-apple-trailing-word' in style) {\n vendor = 'apple';\n }\n}\n/**\n * Vendor prefix string for the current browser.\n *\n * @type {{js: String, css: String, vendor: String, browser: String}}\n * @api public\n */\n\n\nvar prefix = {\n js: js,\n css: css,\n vendor: vendor,\n browser: browser,\n isTouch: isTouch\n};\n\n/**\n * Test if a keyframe at-rule should be prefixed or not\n *\n * @param {String} vendor prefix string for the current browser.\n * @return {String}\n * @api public\n */\n\nfunction supportedKeyframes(key) {\n // Keyframes is already prefixed. e.g. key = '@-webkit-keyframes a'\n if (key[1] === '-') return key; // No need to prefix IE/Edge. Older browsers will ignore unsupported rules.\n // https://caniuse.com/#search=keyframes\n\n if (prefix.js === 'ms') return key;\n return \"@\" + prefix.css + \"keyframes\" + key.substr(10);\n}\n\n// https://caniuse.com/#search=appearance\n\nvar appearence = {\n noPrefill: ['appearance'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'appearance') return false;\n if (prefix.js === 'ms') return \"-webkit-\" + prop;\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=color-adjust\n\nvar colorAdjust = {\n noPrefill: ['color-adjust'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'color-adjust') return false;\n if (prefix.js === 'Webkit') return prefix.css + \"print-\" + prop;\n return prop;\n }\n};\n\nvar regExp = /[-\\s]+(.)?/g;\n/**\n * Replaces the letter with the capital letter\n *\n * @param {String} match\n * @param {String} c\n * @return {String}\n * @api private\n */\n\nfunction toUpper(match, c) {\n return c ? c.toUpperCase() : '';\n}\n/**\n * Convert dash separated strings to camel-cased.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\n\nfunction camelize(str) {\n return str.replace(regExp, toUpper);\n}\n\n/**\n * Convert dash separated strings to pascal cased.\n *\n * @param {String} str\n * @return {String}\n * @api private\n */\n\nfunction pascalize(str) {\n return camelize(\"-\" + str);\n}\n\n// but we can use a longhand property instead.\n// https://caniuse.com/#search=mask\n\nvar mask = {\n noPrefill: ['mask'],\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^mask/.test(prop)) return false;\n\n if (prefix.js === 'Webkit') {\n var longhand = 'mask-image';\n\n if (camelize(longhand) in style) {\n return prop;\n }\n\n if (prefix.js + pascalize(longhand) in style) {\n return prefix.css + prop;\n }\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=text-orientation\n\nvar textOrientation = {\n noPrefill: ['text-orientation'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'text-orientation') return false;\n\n if (prefix.vendor === 'apple' && !prefix.isTouch) {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=transform\n\nvar transform = {\n noPrefill: ['transform'],\n supportedProperty: function supportedProperty(prop, style, options) {\n if (prop !== 'transform') return false;\n\n if (options.transform) {\n return prop;\n }\n\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=transition\n\nvar transition = {\n noPrefill: ['transition'],\n supportedProperty: function supportedProperty(prop, style, options) {\n if (prop !== 'transition') return false;\n\n if (options.transition) {\n return prop;\n }\n\n return prefix.css + prop;\n }\n};\n\n// https://caniuse.com/#search=writing-mode\n\nvar writingMode = {\n noPrefill: ['writing-mode'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'writing-mode') return false;\n\n if (prefix.js === 'Webkit' || prefix.js === 'ms' && prefix.browser !== 'edge') {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=user-select\n\nvar userSelect = {\n noPrefill: ['user-select'],\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'user-select') return false;\n\n if (prefix.js === 'Moz' || prefix.js === 'ms' || prefix.vendor === 'apple') {\n return prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=multicolumn\n// https://github.com/postcss/autoprefixer/issues/491\n// https://github.com/postcss/autoprefixer/issues/177\n\nvar breakPropsOld = {\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^break-/.test(prop)) return false;\n\n if (prefix.js === 'Webkit') {\n var jsProp = \"WebkitColumn\" + pascalize(prop);\n return jsProp in style ? prefix.css + \"column-\" + prop : false;\n }\n\n if (prefix.js === 'Moz') {\n var _jsProp = \"page\" + pascalize(prop);\n\n return _jsProp in style ? \"page-\" + prop : false;\n }\n\n return false;\n }\n};\n\n// See https://github.com/postcss/autoprefixer/issues/324.\n\nvar inlineLogicalOld = {\n supportedProperty: function supportedProperty(prop, style) {\n if (!/^(border|margin|padding)-inline/.test(prop)) return false;\n if (prefix.js === 'Moz') return prop;\n var newProp = prop.replace('-inline', '');\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n};\n\n// Camelization is required because we can't test using.\n// CSS syntax for e.g. in FF.\n\nvar unprefixed = {\n supportedProperty: function supportedProperty(prop, style) {\n return camelize(prop) in style ? prop : false;\n }\n};\n\nvar prefixed = {\n supportedProperty: function supportedProperty(prop, style) {\n var pascalized = pascalize(prop); // Return custom CSS variable without prefixing.\n\n if (prop[0] === '-') return prop; // Return already prefixed value without prefixing.\n\n if (prop[0] === '-' && prop[1] === '-') return prop;\n if (prefix.js + pascalized in style) return prefix.css + prop; // Try webkit fallback.\n\n if (prefix.js !== 'Webkit' && \"Webkit\" + pascalized in style) return \"-webkit-\" + prop;\n return false;\n }\n};\n\n// https://caniuse.com/#search=scroll-snap\n\nvar scrollSnap = {\n supportedProperty: function supportedProperty(prop) {\n if (prop.substring(0, 11) !== 'scroll-snap') return false;\n\n if (prefix.js === 'ms') {\n return \"\" + prefix.css + prop;\n }\n\n return prop;\n }\n};\n\n// https://caniuse.com/#search=overscroll-behavior\n\nvar overscrollBehavior = {\n supportedProperty: function supportedProperty(prop) {\n if (prop !== 'overscroll-behavior') return false;\n\n if (prefix.js === 'ms') {\n return prefix.css + \"scroll-chaining\";\n }\n\n return prop;\n }\n};\n\nvar propMap = {\n 'flex-grow': 'flex-positive',\n 'flex-shrink': 'flex-negative',\n 'flex-basis': 'flex-preferred-size',\n 'justify-content': 'flex-pack',\n order: 'flex-order',\n 'align-items': 'flex-align',\n 'align-content': 'flex-line-pack' // 'align-self' is handled by 'align-self' plugin.\n\n}; // Support old flex spec from 2012.\n\nvar flex2012 = {\n supportedProperty: function supportedProperty(prop, style) {\n var newProp = propMap[prop];\n if (!newProp) return false;\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n};\n\nvar propMap$1 = {\n flex: 'box-flex',\n 'flex-grow': 'box-flex',\n 'flex-direction': ['box-orient', 'box-direction'],\n order: 'box-ordinal-group',\n 'align-items': 'box-align',\n 'flex-flow': ['box-orient', 'box-direction'],\n 'justify-content': 'box-pack'\n};\nvar propKeys = Object.keys(propMap$1);\n\nvar prefixCss = function prefixCss(p) {\n return prefix.css + p;\n}; // Support old flex spec from 2009.\n\n\nvar flex2009 = {\n supportedProperty: function supportedProperty(prop, style, _ref) {\n var multiple = _ref.multiple;\n\n if (propKeys.indexOf(prop) > -1) {\n var newProp = propMap$1[prop];\n\n if (!Array.isArray(newProp)) {\n return prefix.js + pascalize(newProp) in style ? prefix.css + newProp : false;\n }\n\n if (!multiple) return false;\n\n for (var i = 0; i < newProp.length; i++) {\n if (!(prefix.js + pascalize(newProp[0]) in style)) {\n return false;\n }\n }\n\n return newProp.map(prefixCss);\n }\n\n return false;\n }\n};\n\n// plugins = [\n// ...plugins,\n// breakPropsOld,\n// inlineLogicalOld,\n// unprefixed,\n// prefixed,\n// scrollSnap,\n// flex2012,\n// flex2009\n// ]\n// Plugins without 'noPrefill' value, going last.\n// 'flex-*' plugins should be at the bottom.\n// 'flex2009' going after 'flex2012'.\n// 'prefixed' going after 'unprefixed'\n\nvar plugins = [appearence, colorAdjust, mask, textOrientation, transform, transition, writingMode, userSelect, breakPropsOld, inlineLogicalOld, unprefixed, prefixed, scrollSnap, overscrollBehavior, flex2012, flex2009];\nvar propertyDetectors = plugins.filter(function (p) {\n return p.supportedProperty;\n}).map(function (p) {\n return p.supportedProperty;\n});\nvar noPrefill = plugins.filter(function (p) {\n return p.noPrefill;\n}).reduce(function (a, p) {\n a.push.apply(a, _toConsumableArray(p.noPrefill));\n return a;\n}, []);\n\nvar el;\nvar cache = {};\n\nif (isInBrowser) {\n el = document.createElement('p'); // We test every property on vendor prefix requirement.\n // Once tested, result is cached. It gives us up to 70% perf boost.\n // http://jsperf.com/element-style-object-access-vs-plain-object\n //\n // Prefill cache with known css properties to reduce amount of\n // properties we need to feature test at runtime.\n // http://davidwalsh.name/vendor-prefix\n\n var computed = window.getComputedStyle(document.documentElement, '');\n\n for (var key$1 in computed) {\n // eslint-disable-next-line no-restricted-globals\n if (!isNaN(key$1)) cache[computed[key$1]] = computed[key$1];\n } // Properties that cannot be correctly detected using the\n // cache prefill method.\n\n\n noPrefill.forEach(function (x) {\n return delete cache[x];\n });\n}\n/**\n * Test if a property is supported, returns supported property with vendor\n * prefix if required. Returns `false` if not supported.\n *\n * @param {String} prop dash separated\n * @param {Object} [options]\n * @return {String|Boolean}\n * @api public\n */\n\n\nfunction supportedProperty(prop, options) {\n if (options === void 0) {\n options = {};\n }\n\n // For server-side rendering.\n if (!el) return prop; // Remove cache for benchmark tests or return property from the cache.\n\n if (process.env.NODE_ENV !== 'benchmark' && cache[prop] != null) {\n return cache[prop];\n } // Check if 'transition' or 'transform' natively supported in browser.\n\n\n if (prop === 'transition' || prop === 'transform') {\n options[prop] = prop in el.style;\n } // Find a plugin for current prefix property.\n\n\n for (var i = 0; i < propertyDetectors.length; i++) {\n cache[prop] = propertyDetectors[i](prop, el.style, options); // Break loop, if value found.\n\n if (cache[prop]) break;\n } // Reset styles for current property.\n // Firefox can even throw an error for invalid properties, e.g., \"0\".\n\n\n try {\n el.style[prop] = '';\n } catch (err) {\n return false;\n }\n\n return cache[prop];\n}\n\nvar cache$1 = {};\nvar transitionProperties = {\n transition: 1,\n 'transition-property': 1,\n '-webkit-transition': 1,\n '-webkit-transition-property': 1\n};\nvar transPropsRegExp = /(^\\s*[\\w-]+)|, (\\s*[\\w-]+)(?![^()]*\\))/g;\nvar el$1;\n/**\n * Returns prefixed value transition/transform if needed.\n *\n * @param {String} match\n * @param {String} p1\n * @param {String} p2\n * @return {String}\n * @api private\n */\n\nfunction prefixTransitionCallback(match, p1, p2) {\n if (p1 === 'var') return 'var';\n if (p1 === 'all') return 'all';\n if (p2 === 'all') return ', all';\n var prefixedValue = p1 ? supportedProperty(p1) : \", \" + supportedProperty(p2);\n if (!prefixedValue) return p1 || p2;\n return prefixedValue;\n}\n\nif (isInBrowser) el$1 = document.createElement('p');\n/**\n * Returns prefixed value if needed. Returns `false` if value is not supported.\n *\n * @param {String} property\n * @param {String} value\n * @return {String|Boolean}\n * @api public\n */\n\nfunction supportedValue(property, value) {\n // For server-side rendering.\n var prefixedValue = value;\n if (!el$1 || property === 'content') return value; // It is a string or a number as a string like '1'.\n // We want only prefixable values here.\n // eslint-disable-next-line no-restricted-globals\n\n if (typeof prefixedValue !== 'string' || !isNaN(parseInt(prefixedValue, 10))) {\n return prefixedValue;\n } // Create cache key for current value.\n\n\n var cacheKey = property + prefixedValue; // Remove cache for benchmark tests or return value from cache.\n\n if (process.env.NODE_ENV !== 'benchmark' && cache$1[cacheKey] != null) {\n return cache$1[cacheKey];\n } // IE can even throw an error in some cases, for e.g. style.content = 'bar'.\n\n\n try {\n // Test value as it is.\n el$1.style[property] = prefixedValue;\n } catch (err) {\n // Return false if value not supported.\n cache$1[cacheKey] = false;\n return false;\n } // If 'transition' or 'transition-property' property.\n\n\n if (transitionProperties[property]) {\n prefixedValue = prefixedValue.replace(transPropsRegExp, prefixTransitionCallback);\n } else if (el$1.style[property] === '') {\n // Value with a vendor prefix.\n prefixedValue = prefix.css + prefixedValue; // Hardcode test to convert \"flex\" to \"-ms-flexbox\" for IE10.\n\n if (prefixedValue === '-ms-flex') el$1.style[property] = '-ms-flexbox'; // Test prefixed value.\n\n el$1.style[property] = prefixedValue; // Return false if value not supported.\n\n if (el$1.style[property] === '') {\n cache$1[cacheKey] = false;\n return false;\n }\n } // Reset styles for current property.\n\n\n el$1.style[property] = ''; // Write current value to cache.\n\n cache$1[cacheKey] = prefixedValue;\n return cache$1[cacheKey];\n}\n\nexport { prefix, supportedKeyframes, supportedProperty, supportedValue };\n","import { supportedKeyframes, supportedValue, supportedProperty } from 'css-vendor';\nimport { toCssValue } from 'jss';\n\n/**\n * Add vendor prefix to a property name when needed.\n */\n\nfunction jssVendorPrefixer() {\n function onProcessRule(rule) {\n if (rule.type === 'keyframes') {\n var atRule = rule;\n atRule.at = supportedKeyframes(atRule.at);\n }\n }\n\n function prefixStyle(style) {\n for (var prop in style) {\n var value = style[prop];\n\n if (prop === 'fallbacks' && Array.isArray(value)) {\n style[prop] = value.map(prefixStyle);\n continue;\n }\n\n var changeProp = false;\n var supportedProp = supportedProperty(prop);\n if (supportedProp && supportedProp !== prop) changeProp = true;\n var changeValue = false;\n var supportedValue$1 = supportedValue(supportedProp, toCssValue(value));\n if (supportedValue$1 && supportedValue$1 !== value) changeValue = true;\n\n if (changeProp || changeValue) {\n if (changeProp) delete style[prop];\n style[supportedProp || prop] = supportedValue$1 || value;\n }\n }\n\n return style;\n }\n\n function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n return prefixStyle(style);\n }\n\n function onChangeValue(value, prop) {\n return supportedValue(prop, toCssValue(value)) || value;\n }\n\n return {\n onProcessRule: onProcessRule,\n onProcessStyle: onProcessStyle,\n onChangeValue: onChangeValue\n };\n}\n\nexport default jssVendorPrefixer;\n","/**\n * Sort props by length.\n */\nfunction jssPropsSort() {\n var sort = function sort(prop0, prop1) {\n if (prop0.length === prop1.length) {\n return prop0 > prop1 ? 1 : -1;\n }\n\n return prop0.length - prop1.length;\n };\n\n return {\n onProcessStyle: function onProcessStyle(style, rule) {\n if (rule.type !== 'style') return style;\n var newStyle = {};\n var props = Object.keys(style).sort(sort);\n\n for (var i = 0; i < props.length; i++) {\n newStyle[props[i]] = style[props[i]];\n }\n\n return newStyle;\n }\n };\n}\n\nexport default jssPropsSort;\n","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"injectFirst\", \"disableGeneration\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { exactProp } from '@mui/utils';\nimport { create } from 'jss';\nimport createGenerateClassName from '../createGenerateClassName';\nimport jssPreset from '../jssPreset'; // Default JSS instance.\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst jss = create(jssPreset()); // Use a singleton or the provided one by the context.\n//\n// The counter-based approach doesn't tolerate any mistake.\n// It's much safer to use the same counter everywhere.\n\nconst generateClassName = createGenerateClassName(); // Exported for test purposes\n\nexport const sheetsManager = new Map();\nconst defaultOptions = {\n disableGeneration: false,\n generateClassName,\n jss,\n sheetsCache: null,\n sheetsManager,\n sheetsRegistry: null\n};\nexport const StylesContext = /*#__PURE__*/React.createContext(defaultOptions);\n\nif (process.env.NODE_ENV !== 'production') {\n StylesContext.displayName = 'StylesContext';\n}\n\nlet injectFirstNode;\nexport default function StylesProvider(props) {\n const {\n children,\n injectFirst = false,\n disableGeneration = false\n } = props,\n localOptions = _objectWithoutPropertiesLoose(props, _excluded);\n\n const outerOptions = React.useContext(StylesContext);\n\n const context = _extends({}, outerOptions, {\n disableGeneration\n }, localOptions);\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof window === 'undefined' && !context.sheetsManager) {\n console.error('MUI: You need to use the ServerStyleSheets API when rendering on the server.');\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (context.jss.options.insertionPoint && injectFirst) {\n console.error('MUI: You cannot use a custom insertionPoint and at the same time.');\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (injectFirst && localOptions.jss) {\n console.error('MUI: You cannot use the jss and injectFirst props at the same time.');\n }\n }\n\n if (!context.jss.options.insertionPoint && injectFirst && typeof window !== 'undefined') {\n if (!injectFirstNode) {\n const head = document.head;\n injectFirstNode = document.createComment('mui-inject-first');\n head.insertBefore(injectFirstNode, head.firstChild);\n }\n\n context.jss = create({\n plugins: jssPreset().plugins,\n insertionPoint: injectFirstNode\n });\n }\n\n return /*#__PURE__*/_jsx(StylesContext.Provider, {\n value: context,\n children: children\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? StylesProvider.propTypes = {\n /**\n * Your component tree.\n */\n children: PropTypes.node,\n\n /**\n * You can disable the generation of the styles with this option.\n * It can be useful when traversing the React tree outside of the HTML\n * rendering step on the server.\n * Let's say you are using react-apollo to extract all\n * the queries made by the interface server-side - you can significantly speed up the traversal with this prop.\n */\n disableGeneration: PropTypes.bool,\n\n /**\n * JSS's class name generator.\n */\n generateClassName: PropTypes.func,\n\n /**\n * By default, the styles are injected last in the element of the page.\n * As a result, they gain more specificity than any other style sheet.\n * If you want to override MUI's styles, set this prop.\n */\n injectFirst: PropTypes.bool,\n\n /**\n * JSS's instance.\n */\n jss: PropTypes.object,\n\n /**\n * @ignore\n */\n serverGenerateClassName: PropTypes.func,\n\n /**\n * @ignore\n *\n * Beta feature.\n *\n * Cache for the sheets.\n */\n sheetsCache: PropTypes.object,\n\n /**\n * @ignore\n *\n * The sheetsManager is used to deduplicate style sheet injection in the page.\n * It's deduplicating using the (theme, styles) couple.\n * On the server, you should provide a new instance for each request.\n */\n sheetsManager: PropTypes.object,\n\n /**\n * @ignore\n *\n * Collect the sheets.\n */\n sheetsRegistry: PropTypes.object\n} : void 0;\n\nif (process.env.NODE_ENV !== 'production') {\n process.env.NODE_ENV !== \"production\" ? StylesProvider.propTypes = exactProp(StylesProvider.propTypes) : void 0;\n}","import functions from 'jss-plugin-rule-value-function';\nimport global from 'jss-plugin-global';\nimport nested from 'jss-plugin-nested';\nimport camelCase from 'jss-plugin-camel-case';\nimport defaultUnit from 'jss-plugin-default-unit';\nimport vendorPrefixer from 'jss-plugin-vendor-prefixer';\nimport propsSort from 'jss-plugin-props-sort'; // Subset of jss-preset-default with only the plugins the MUI components are using.\n\nexport default function jssPreset() {\n return {\n plugins: [functions(), global(), nested(), camelCase(), defaultUnit(), // Disable the vendor prefixer server-side, it does nothing.\n // This way, we can get a performance boost.\n // In the documentation, we are using `autoprefixer` to solve this problem.\n typeof window === 'undefined' ? null : vendorPrefixer(), propsSort()]\n };\n}","/* eslint-disable import/prefer-default-export */\n// Global index counter to preserve source order.\n// We create the style sheet during the creation of the component,\n// children are handled after the parents, so the order of style elements would be parent->child.\n// It is a problem though when a parent passes a className\n// which needs to override any child's styles.\n// StyleSheet of the child has a higher specificity, because of the source order.\n// So our solution is to render sheets them in the reverse order child->sheet, so\n// that parent has a higher specificity.\nlet indexCounter = -1e9;\nexport function increment() {\n indexCounter += 1;\n\n if (process.env.NODE_ENV !== 'production') {\n if (indexCounter >= 0) {\n console.warn(['MUI: You might have a memory leak.', 'The indexCounter is not supposed to grow that much.'].join('\\n'));\n }\n }\n\n return indexCounter;\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"variant\"];\nimport { unstable_capitalize as capitalize } from '@mui/utils';\n\nfunction isEmpty(string) {\n return string.length === 0;\n}\n/**\n * Generates string classKey based on the properties provided. It starts with the\n * variant if defined, and then it appends all other properties in alphabetical order.\n * @param {object} props - the properties for which the classKey should be created\n */\n\n\nexport default function propsToClassKey(props) {\n const {\n variant\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n let classKey = variant || '';\n Object.keys(other).sort().forEach(key => {\n if (key === 'color') {\n classKey += isEmpty(classKey) ? props[key] : capitalize(props[key]);\n } else {\n classKey += `${isEmpty(classKey) ? key : capitalize(key)}${capitalize(props[key].toString())}`;\n }\n });\n return classKey;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { deepmerge } from '@mui/utils';\nimport propsToClassKey from '../propsToClassKey';\nimport noopTheme from './noopTheme';\nexport default function getStylesCreator(stylesOrCreator) {\n const themingEnabled = typeof stylesOrCreator === 'function';\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof stylesOrCreator !== 'object' && !themingEnabled) {\n console.error(['MUI: The `styles` argument provided is invalid.', 'You need to provide a function generating the styles or a styles object.'].join('\\n'));\n }\n }\n\n return {\n create: (theme, name) => {\n let styles;\n\n try {\n styles = themingEnabled ? stylesOrCreator(theme) : stylesOrCreator;\n } catch (err) {\n if (process.env.NODE_ENV !== 'production') {\n if (themingEnabled === true && theme === noopTheme) {\n // TODO: prepend error message/name instead\n console.error(['MUI: The `styles` argument provided is invalid.', 'You are providing a function without a theme in the context.', 'One of the parent elements needs to use a ThemeProvider.'].join('\\n'));\n }\n }\n\n throw err;\n }\n\n if (!name || !theme.components || !theme.components[name] || !theme.components[name].styleOverrides && !theme.components[name].variants) {\n return styles;\n }\n\n const overrides = theme.components[name].styleOverrides || {};\n const variants = theme.components[name].variants || [];\n\n const stylesWithOverrides = _extends({}, styles);\n\n Object.keys(overrides).forEach(key => {\n if (process.env.NODE_ENV !== 'production') {\n if (!stylesWithOverrides[key]) {\n console.warn(['MUI: You are trying to override a style that does not exist.', `Fix the \\`${key}\\` key of \\`theme.components.${name}.styleOverrides\\`.`, '', `If you intentionally wanted to add a new key, please use the theme.components[${name}].variants option.`].join('\\n'));\n }\n }\n\n stylesWithOverrides[key] = deepmerge(stylesWithOverrides[key] || {}, overrides[key]);\n });\n variants.forEach(definition => {\n const classKey = propsToClassKey(definition.props);\n stylesWithOverrides[classKey] = deepmerge(stylesWithOverrides[classKey] || {}, definition.style);\n });\n return stylesWithOverrides;\n },\n options: {}\n };\n}","// We use the same empty object to ref count the styles that don't need a theme object.\nconst noopTheme = {};\nexport default noopTheme;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"name\", \"classNamePrefix\", \"Component\", \"defaultTheme\"];\nimport * as React from 'react';\nimport { getDynamicStyles } from 'jss';\nimport mergeClasses from '../mergeClasses';\nimport multiKeyStore from './multiKeyStore';\nimport useTheme from '../useTheme';\nimport { StylesContext } from '../StylesProvider';\nimport { increment } from './indexCounter';\nimport getStylesCreator from '../getStylesCreator';\nimport noopTheme from '../getStylesCreator/noopTheme';\n\nfunction getClasses({\n state,\n stylesOptions\n}, classes, Component) {\n if (stylesOptions.disableGeneration) {\n return classes || {};\n }\n\n if (!state.cacheClasses) {\n state.cacheClasses = {\n // Cache for the finalized classes value.\n value: null,\n // Cache for the last used classes prop pointer.\n lastProp: null,\n // Cache for the last used rendered classes pointer.\n lastJSS: {}\n };\n } // Tracks if either the rendered classes or classes prop has changed,\n // requiring the generation of a new finalized classes object.\n\n\n let generate = false;\n\n if (state.classes !== state.cacheClasses.lastJSS) {\n state.cacheClasses.lastJSS = state.classes;\n generate = true;\n }\n\n if (classes !== state.cacheClasses.lastProp) {\n state.cacheClasses.lastProp = classes;\n generate = true;\n }\n\n if (generate) {\n state.cacheClasses.value = mergeClasses({\n baseClasses: state.cacheClasses.lastJSS,\n newClasses: classes,\n Component\n });\n }\n\n return state.cacheClasses.value;\n}\n\nfunction attach({\n state,\n theme,\n stylesOptions,\n stylesCreator,\n name\n}, props) {\n if (stylesOptions.disableGeneration) {\n return;\n }\n\n let sheetManager = multiKeyStore.get(stylesOptions.sheetsManager, stylesCreator, theme);\n\n if (!sheetManager) {\n sheetManager = {\n refs: 0,\n staticSheet: null,\n dynamicStyles: null\n };\n multiKeyStore.set(stylesOptions.sheetsManager, stylesCreator, theme, sheetManager);\n }\n\n const options = _extends({}, stylesCreator.options, stylesOptions, {\n theme,\n flip: typeof stylesOptions.flip === 'boolean' ? stylesOptions.flip : theme.direction === 'rtl'\n });\n\n options.generateId = options.serverGenerateClassName || options.generateClassName;\n const sheetsRegistry = stylesOptions.sheetsRegistry;\n\n if (sheetManager.refs === 0) {\n let staticSheet;\n\n if (stylesOptions.sheetsCache) {\n staticSheet = multiKeyStore.get(stylesOptions.sheetsCache, stylesCreator, theme);\n }\n\n const styles = stylesCreator.create(theme, name);\n\n if (!staticSheet) {\n staticSheet = stylesOptions.jss.createStyleSheet(styles, _extends({\n link: false\n }, options));\n staticSheet.attach();\n\n if (stylesOptions.sheetsCache) {\n multiKeyStore.set(stylesOptions.sheetsCache, stylesCreator, theme, staticSheet);\n }\n }\n\n if (sheetsRegistry) {\n sheetsRegistry.add(staticSheet);\n }\n\n sheetManager.staticSheet = staticSheet;\n sheetManager.dynamicStyles = getDynamicStyles(styles);\n }\n\n if (sheetManager.dynamicStyles) {\n const dynamicSheet = stylesOptions.jss.createStyleSheet(sheetManager.dynamicStyles, _extends({\n link: true\n }, options));\n dynamicSheet.update(props);\n dynamicSheet.attach();\n state.dynamicSheet = dynamicSheet;\n state.classes = mergeClasses({\n baseClasses: sheetManager.staticSheet.classes,\n newClasses: dynamicSheet.classes\n });\n\n if (sheetsRegistry) {\n sheetsRegistry.add(dynamicSheet);\n }\n } else {\n state.classes = sheetManager.staticSheet.classes;\n }\n\n sheetManager.refs += 1;\n}\n\nfunction update({\n state\n}, props) {\n if (state.dynamicSheet) {\n state.dynamicSheet.update(props);\n }\n}\n\nfunction detach({\n state,\n theme,\n stylesOptions,\n stylesCreator\n}) {\n if (stylesOptions.disableGeneration) {\n return;\n }\n\n const sheetManager = multiKeyStore.get(stylesOptions.sheetsManager, stylesCreator, theme);\n sheetManager.refs -= 1;\n const sheetsRegistry = stylesOptions.sheetsRegistry;\n\n if (sheetManager.refs === 0) {\n multiKeyStore.delete(stylesOptions.sheetsManager, stylesCreator, theme);\n stylesOptions.jss.removeStyleSheet(sheetManager.staticSheet);\n\n if (sheetsRegistry) {\n sheetsRegistry.remove(sheetManager.staticSheet);\n }\n }\n\n if (state.dynamicSheet) {\n stylesOptions.jss.removeStyleSheet(state.dynamicSheet);\n\n if (sheetsRegistry) {\n sheetsRegistry.remove(state.dynamicSheet);\n }\n }\n}\n\nfunction useSynchronousEffect(func, values) {\n const key = React.useRef([]);\n let output; // Store \"generation\" key. Just returns a new object every time\n\n const currentKey = React.useMemo(() => ({}), values); // eslint-disable-line react-hooks/exhaustive-deps\n // \"the first render\", or \"memo dropped the value\"\n\n if (key.current !== currentKey) {\n key.current = currentKey;\n output = func();\n }\n\n React.useEffect(() => () => {\n if (output) {\n output();\n }\n }, [currentKey] // eslint-disable-line react-hooks/exhaustive-deps\n );\n}\n\nexport default function makeStyles(stylesOrCreator, options = {}) {\n const {\n // alias for classNamePrefix, if provided will listen to theme (required for theme.components[name].styleOverrides)\n name,\n // Help with debuggability.\n classNamePrefix: classNamePrefixOption,\n Component,\n defaultTheme = noopTheme\n } = options,\n stylesOptions2 = _objectWithoutPropertiesLoose(options, _excluded);\n\n const stylesCreator = getStylesCreator(stylesOrCreator);\n const classNamePrefix = name || classNamePrefixOption || 'makeStyles';\n stylesCreator.options = {\n index: increment(),\n name,\n meta: classNamePrefix,\n classNamePrefix\n };\n\n const useStyles = (props = {}) => {\n const theme = useTheme() || defaultTheme;\n\n const stylesOptions = _extends({}, React.useContext(StylesContext), stylesOptions2);\n\n const instance = React.useRef();\n const shouldUpdate = React.useRef();\n useSynchronousEffect(() => {\n const current = {\n name,\n state: {},\n stylesCreator,\n stylesOptions,\n theme\n };\n attach(current, props);\n shouldUpdate.current = false;\n instance.current = current;\n return () => {\n detach(current);\n };\n }, [theme, stylesCreator]);\n React.useEffect(() => {\n if (shouldUpdate.current) {\n update(instance.current, props);\n }\n\n shouldUpdate.current = true;\n });\n const classes = getClasses(instance.current, props.classes, Component);\n\n if (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line react-hooks/rules-of-hooks\n React.useDebugValue(classes);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n const supportedComponents = ['MuiAvatar', 'MuiBadge', 'MuiButton', 'MuiButtonGroup', 'MuiChip', 'MuiDivider', 'MuiFab', 'MuiPaper', 'MuiToolbar', 'MuiTypography', 'MuiAlert', 'MuiPagination', 'MuiPaginationItem', 'MuiSkeleton', 'MuiTimelineDot'];\n\n if (name && supportedComponents.indexOf(name) >= 0 && props.variant && !classes[props.variant]) {\n console.error([`MUI: You are using a variant value \\`${props.variant}\\` for which you didn't define styles.`, `Please create a new variant matcher in your theme for this variant. To learn more about matchers visit https://mui.com/r/custom-component-variants.`].join('\\n'));\n }\n }\n\n return classes;\n };\n\n return useStyles;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\n\n/* eslint-disable no-restricted-syntax */\nexport default function getThemeProps(params) {\n const {\n theme,\n name,\n props\n } = params;\n\n if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {\n return props;\n }\n\n const output = _extends({}, props); // Resolve default props, code borrow from React source.\n // https://github.com/facebook/react/blob/15a8f031838a553e41c0b66eb1bcf1da8448104d/packages/react/src/ReactElement.js#L221\n\n\n const defaultProps = theme.components[name].defaultProps;\n let propName;\n\n for (propName in defaultProps) {\n if (output[propName] === undefined) {\n output[propName] = defaultProps[propName];\n }\n }\n\n return output;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"defaultTheme\", \"withTheme\", \"name\"],\n _excluded2 = [\"classes\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport { getDisplayName } from '@mui/utils';\nimport makeStyles from '../makeStyles';\nimport getThemeProps from '../getThemeProps';\nimport useTheme from '../useTheme'; // Link a style sheet with a component.\n// It does not modify the component passed to it;\n// instead, it returns a new component, with a `classes` property.\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst withStyles = (stylesOrCreator, options = {}) => Component => {\n const {\n defaultTheme,\n withTheme = false,\n name\n } = options,\n stylesOptions = _objectWithoutPropertiesLoose(options, _excluded);\n\n if (process.env.NODE_ENV !== 'production') {\n if (Component === undefined) {\n throw new Error(['You are calling withStyles(styles)(Component) with an undefined component.', 'You may have forgotten to import it.'].join('\\n'));\n }\n }\n\n let classNamePrefix = name;\n\n if (process.env.NODE_ENV !== 'production') {\n if (!name) {\n // Provide a better DX outside production.\n const displayName = getDisplayName(Component);\n\n if (displayName !== undefined) {\n classNamePrefix = displayName;\n }\n }\n }\n\n const useStyles = makeStyles(stylesOrCreator, _extends({\n defaultTheme,\n Component,\n name: name || Component.displayName,\n classNamePrefix\n }, stylesOptions));\n const WithStyles = /*#__PURE__*/React.forwardRef(function WithStyles(props, ref) {\n const other = _objectWithoutPropertiesLoose(props, _excluded2); // The wrapper receives only user supplied props, which could be a subset of\n // the actual props Component might receive due to merging with defaultProps.\n // So copying it here would give us the same result in the wrapper as well.\n\n\n const classes = useStyles(_extends({}, Component.defaultProps, props));\n let theme;\n let more = other;\n\n if (typeof name === 'string' || withTheme) {\n // name and withTheme are invariant in the outer scope\n // eslint-disable-next-line react-hooks/rules-of-hooks\n theme = useTheme() || defaultTheme;\n\n if (name) {\n more = getThemeProps({\n theme,\n name,\n props: other\n });\n } // Provide the theme to the wrapped component.\n // So we don't have to use the `withTheme()` Higher-order Component.\n\n\n if (withTheme && !more.theme) {\n more.theme = theme;\n }\n }\n\n return /*#__PURE__*/_jsx(Component, _extends({\n ref: ref,\n classes: classes\n }, more));\n });\n process.env.NODE_ENV !== \"production\" ? WithStyles.propTypes = {\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object\n } : void 0;\n\n if (process.env.NODE_ENV !== 'production') {\n WithStyles.displayName = `WithStyles(${getDisplayName(Component)})`;\n }\n\n hoistNonReactStatics(WithStyles, Component);\n\n if (process.env.NODE_ENV !== 'production') {\n // Exposed for test purposes.\n WithStyles.Naked = Component;\n WithStyles.options = options;\n WithStyles.useStyles = useStyles;\n }\n\n return WithStyles;\n};\n\nexport default withStyles;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport PropTypes from 'prop-types';\nimport { deepmerge } from '@mui/utils';\nimport merge from './merge'; // The breakpoint **start** at this value.\n// For instance with the first breakpoint xs: [xs, sm[.\n\nexport const values = {\n xs: 0,\n // phone\n sm: 600,\n // tablet\n md: 900,\n // small laptop\n lg: 1200,\n // desktop\n xl: 1536 // large screen\n\n};\nconst defaultBreakpoints = {\n // Sorted ASC by size. That's important.\n // It can't be configured as it's used statically for propTypes.\n keys: ['xs', 'sm', 'md', 'lg', 'xl'],\n up: key => `@media (min-width:${values[key]}px)`\n};\nexport function handleBreakpoints(props, propValue, styleFromPropValue) {\n const theme = props.theme || {};\n\n if (Array.isArray(propValue)) {\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n return propValue.reduce((acc, item, index) => {\n acc[themeBreakpoints.up(themeBreakpoints.keys[index])] = styleFromPropValue(propValue[index]);\n return acc;\n }, {});\n }\n\n if (typeof propValue === 'object') {\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n return Object.keys(propValue).reduce((acc, breakpoint) => {\n // key is breakpoint\n if (Object.keys(themeBreakpoints.values || values).indexOf(breakpoint) !== -1) {\n const mediaKey = themeBreakpoints.up(breakpoint);\n acc[mediaKey] = styleFromPropValue(propValue[breakpoint], breakpoint);\n } else {\n const cssKey = breakpoint;\n acc[cssKey] = propValue[cssKey];\n }\n\n return acc;\n }, {});\n }\n\n const output = styleFromPropValue(propValue);\n return output;\n}\n\nfunction breakpoints(styleFunction) {\n const newStyleFunction = props => {\n const theme = props.theme || {};\n const base = styleFunction(props);\n const themeBreakpoints = theme.breakpoints || defaultBreakpoints;\n const extended = themeBreakpoints.keys.reduce((acc, key) => {\n if (props[key]) {\n acc = acc || {};\n acc[themeBreakpoints.up(key)] = styleFunction(_extends({\n theme\n }, props[key]));\n }\n\n return acc;\n }, null);\n return merge(base, extended);\n };\n\n newStyleFunction.propTypes = process.env.NODE_ENV !== 'production' ? _extends({}, styleFunction.propTypes, {\n xs: PropTypes.object,\n sm: PropTypes.object,\n md: PropTypes.object,\n lg: PropTypes.object,\n xl: PropTypes.object\n }) : {};\n newStyleFunction.filterProps = ['xs', 'sm', 'md', 'lg', 'xl', ...styleFunction.filterProps];\n return newStyleFunction;\n}\n\nexport function createEmptyBreakpointObject(breakpointsInput = {}) {\n var _breakpointsInput$key;\n\n const breakpointsInOrder = breakpointsInput == null ? void 0 : (_breakpointsInput$key = breakpointsInput.keys) == null ? void 0 : _breakpointsInput$key.reduce((acc, key) => {\n const breakpointStyleKey = breakpointsInput.up(key);\n acc[breakpointStyleKey] = {};\n return acc;\n }, {});\n return breakpointsInOrder || {};\n}\nexport function removeUnusedBreakpoints(breakpointKeys, style) {\n return breakpointKeys.reduce((acc, key) => {\n const breakpointOutput = acc[key];\n const isBreakpointUnused = !breakpointOutput || Object.keys(breakpointOutput).length === 0;\n\n if (isBreakpointUnused) {\n delete acc[key];\n }\n\n return acc;\n }, style);\n}\nexport function mergeBreakpointsInOrder(breakpointsInput, ...styles) {\n const emptyBreakpoints = createEmptyBreakpointObject(breakpointsInput);\n const mergedOutput = [emptyBreakpoints, ...styles].reduce((prev, next) => deepmerge(prev, next), {});\n return removeUnusedBreakpoints(Object.keys(emptyBreakpoints), mergedOutput);\n} // compute base for responsive values; e.g.,\n// [1,2,3] => {xs: true, sm: true, md: true}\n// {xs: 1, sm: 2, md: 3} => {xs: true, sm: true, md: true}\n\nexport function computeBreakpointsBase(breakpointValues, themeBreakpoints) {\n // fixed value\n if (typeof breakpointValues !== 'object') {\n return {};\n }\n\n const base = {};\n const breakpointsKeys = Object.keys(themeBreakpoints);\n\n if (Array.isArray(breakpointValues)) {\n breakpointsKeys.forEach((breakpoint, i) => {\n if (i < breakpointValues.length) {\n base[breakpoint] = true;\n }\n });\n } else {\n breakpointsKeys.forEach(breakpoint => {\n if (breakpointValues[breakpoint] != null) {\n base[breakpoint] = true;\n }\n });\n }\n\n return base;\n}\nexport function resolveBreakpointValues({\n values: breakpointValues,\n breakpoints: themeBreakpoints,\n base: customBase\n}) {\n const base = customBase || computeBreakpointsBase(breakpointValues, themeBreakpoints);\n const keys = Object.keys(base);\n\n if (keys.length === 0) {\n return breakpointValues;\n }\n\n let previous;\n return keys.reduce((acc, breakpoint, i) => {\n if (Array.isArray(breakpointValues)) {\n acc[breakpoint] = breakpointValues[i] != null ? breakpointValues[i] : breakpointValues[previous];\n previous = i;\n } else {\n acc[breakpoint] = breakpointValues[breakpoint] != null ? breakpointValues[breakpoint] : breakpointValues[previous] || breakpointValues;\n previous = breakpoint;\n }\n\n return acc;\n }, {});\n}\nexport default breakpoints;","import { formatMuiErrorMessage as _formatMuiErrorMessage } from \"@mui/utils\";\n\n/**\n * Returns a number whose value is limited to the given range.\n * @param {number} value The value to be clamped\n * @param {number} min The lower boundary of the output range\n * @param {number} max The upper boundary of the output range\n * @returns {number} A number in the range [min, max]\n */\nfunction clamp(value, min = 0, max = 1) {\n if (process.env.NODE_ENV !== 'production') {\n if (value < min || value > max) {\n console.error(`MUI: The value provided ${value} is out of range [${min}, ${max}].`);\n }\n }\n\n return Math.min(Math.max(min, value), max);\n}\n/**\n * Converts a color from CSS hex format to CSS rgb format.\n * @param {string} color - Hex color, i.e. #nnn or #nnnnnn\n * @returns {string} A CSS rgb color string\n */\n\n\nexport function hexToRgb(color) {\n color = color.slice(1);\n const re = new RegExp(`.{1,${color.length >= 6 ? 2 : 1}}`, 'g');\n let colors = color.match(re);\n\n if (colors && colors[0].length === 1) {\n colors = colors.map(n => n + n);\n }\n\n return colors ? `rgb${colors.length === 4 ? 'a' : ''}(${colors.map((n, index) => {\n return index < 3 ? parseInt(n, 16) : Math.round(parseInt(n, 16) / 255 * 1000) / 1000;\n }).join(', ')})` : '';\n}\n\nfunction intToHex(int) {\n const hex = int.toString(16);\n return hex.length === 1 ? `0${hex}` : hex;\n}\n/**\n * Returns an object with the type and values of a color.\n *\n * Note: Does not support rgb % values.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {object} - A MUI color object: {type: string, values: number[]}\n */\n\n\nexport function decomposeColor(color) {\n // Idempotent\n if (color.type) {\n return color;\n }\n\n if (color.charAt(0) === '#') {\n return decomposeColor(hexToRgb(color));\n }\n\n const marker = color.indexOf('(');\n const type = color.substring(0, marker);\n\n if (['rgb', 'rgba', 'hsl', 'hsla', 'color'].indexOf(type) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: Unsupported \\`${color}\\` color.\nThe following formats are supported: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().` : _formatMuiErrorMessage(9, color));\n }\n\n let values = color.substring(marker + 1, color.length - 1);\n let colorSpace;\n\n if (type === 'color') {\n values = values.split(' ');\n colorSpace = values.shift();\n\n if (values.length === 4 && values[3].charAt(0) === '/') {\n values[3] = values[3].slice(1);\n }\n\n if (['srgb', 'display-p3', 'a98-rgb', 'prophoto-rgb', 'rec-2020'].indexOf(colorSpace) === -1) {\n throw new Error(process.env.NODE_ENV !== \"production\" ? `MUI: unsupported \\`${colorSpace}\\` color space.\nThe following color spaces are supported: srgb, display-p3, a98-rgb, prophoto-rgb, rec-2020.` : _formatMuiErrorMessage(10, colorSpace));\n }\n } else {\n values = values.split(',');\n }\n\n values = values.map(value => parseFloat(value));\n return {\n type,\n values,\n colorSpace\n };\n}\n/**\n * Returns a channel created from the input color.\n *\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {string} - The channel for the color, that can be used in rgba or hsla colors\n */\n\nexport const colorChannel = color => {\n const decomposedColor = decomposeColor(color);\n return decomposedColor.values.slice(0, 3).map((val, idx) => decomposedColor.type.indexOf('hsl') !== -1 && idx !== 0 ? `${val}%` : val).join(' ');\n};\n/**\n * Converts a color object with type and values to a string.\n * @param {object} color - Decomposed color\n * @param {string} color.type - One of: 'rgb', 'rgba', 'hsl', 'hsla'\n * @param {array} color.values - [n,n,n] or [n,n,n,n]\n * @returns {string} A CSS color string\n */\n\nexport function recomposeColor(color) {\n const {\n type,\n colorSpace\n } = color;\n let {\n values\n } = color;\n\n if (type.indexOf('rgb') !== -1) {\n // Only convert the first 3 values to int (i.e. not alpha)\n values = values.map((n, i) => i < 3 ? parseInt(n, 10) : n);\n } else if (type.indexOf('hsl') !== -1) {\n values[1] = `${values[1]}%`;\n values[2] = `${values[2]}%`;\n }\n\n if (type.indexOf('color') !== -1) {\n values = `${colorSpace} ${values.join(' ')}`;\n } else {\n values = `${values.join(', ')}`;\n }\n\n return `${type}(${values})`;\n}\n/**\n * Converts a color from CSS rgb format to CSS hex format.\n * @param {string} color - RGB color, i.e. rgb(n, n, n)\n * @returns {string} A CSS rgb color string, i.e. #nnnnnn\n */\n\nexport function rgbToHex(color) {\n // Idempotent\n if (color.indexOf('#') === 0) {\n return color;\n }\n\n const {\n values\n } = decomposeColor(color);\n return `#${values.map((n, i) => intToHex(i === 3 ? Math.round(255 * n) : n)).join('')}`;\n}\n/**\n * Converts a color from hsl format to rgb format.\n * @param {string} color - HSL color values\n * @returns {string} rgb color values\n */\n\nexport function hslToRgb(color) {\n color = decomposeColor(color);\n const {\n values\n } = color;\n const h = values[0];\n const s = values[1] / 100;\n const l = values[2] / 100;\n const a = s * Math.min(l, 1 - l);\n\n const f = (n, k = (n + h / 30) % 12) => l - a * Math.max(Math.min(k - 3, 9 - k, 1), -1);\n\n let type = 'rgb';\n const rgb = [Math.round(f(0) * 255), Math.round(f(8) * 255), Math.round(f(4) * 255)];\n\n if (color.type === 'hsla') {\n type += 'a';\n rgb.push(values[3]);\n }\n\n return recomposeColor({\n type,\n values: rgb\n });\n}\n/**\n * The relative brightness of any point in a color space,\n * normalized to 0 for darkest black and 1 for lightest white.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @returns {number} The relative brightness of the color in the range 0 - 1\n */\n\nexport function getLuminance(color) {\n color = decomposeColor(color);\n let rgb = color.type === 'hsl' ? decomposeColor(hslToRgb(color)).values : color.values;\n rgb = rgb.map(val => {\n if (color.type !== 'color') {\n val /= 255; // normalized\n }\n\n return val <= 0.03928 ? val / 12.92 : ((val + 0.055) / 1.055) ** 2.4;\n }); // Truncate at 3 digits\n\n return Number((0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2]).toFixed(3));\n}\n/**\n * Calculates the contrast ratio between two colors.\n *\n * Formula: https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests\n * @param {string} foreground - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @param {string} background - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla()\n * @returns {number} A contrast ratio value in the range 0 - 21.\n */\n\nexport function getContrastRatio(foreground, background) {\n const lumA = getLuminance(foreground);\n const lumB = getLuminance(background);\n return (Math.max(lumA, lumB) + 0.05) / (Math.min(lumA, lumB) + 0.05);\n}\n/**\n * Sets the absolute transparency of a color.\n * Any existing alpha values are overwritten.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} value - value to set the alpha channel to in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\n\nexport function alpha(color, value) {\n color = decomposeColor(color);\n value = clamp(value);\n\n if (color.type === 'rgb' || color.type === 'hsl') {\n color.type += 'a';\n }\n\n if (color.type === 'color') {\n color.values[3] = `/${value}`;\n } else {\n color.values[3] = value;\n }\n\n return recomposeColor(color);\n}\n/**\n * Darkens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\n\nexport function darken(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clamp(coefficient);\n\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] *= 1 - coefficient;\n } else if (color.type.indexOf('rgb') !== -1 || color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] *= 1 - coefficient;\n }\n }\n\n return recomposeColor(color);\n}\n/**\n * Lightens a color.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\n\nexport function lighten(color, coefficient) {\n color = decomposeColor(color);\n coefficient = clamp(coefficient);\n\n if (color.type.indexOf('hsl') !== -1) {\n color.values[2] += (100 - color.values[2]) * coefficient;\n } else if (color.type.indexOf('rgb') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (255 - color.values[i]) * coefficient;\n }\n } else if (color.type.indexOf('color') !== -1) {\n for (let i = 0; i < 3; i += 1) {\n color.values[i] += (1 - color.values[i]) * coefficient;\n }\n }\n\n return recomposeColor(color);\n}\n/**\n * Darken or lighten a color, depending on its luminance.\n * Light colors are darkened, dark colors are lightened.\n * @param {string} color - CSS color, i.e. one of: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color()\n * @param {number} coefficient=0.15 - multiplier in the range 0 - 1\n * @returns {string} A CSS color string. Hex input values are returned as rgb\n */\n\nexport function emphasize(color, coefficient = 0.15) {\n return getLuminance(color) > 0.5 ? darken(color, coefficient) : lighten(color, coefficient);\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"variant\"];\nimport { unstable_capitalize as capitalize } from '@mui/utils';\n\nfunction isEmpty(string) {\n return string.length === 0;\n}\n/**\n * Generates string classKey based on the properties provided. It starts with the\n * variant if defined, and then it appends all other properties in alphabetical order.\n * @param {object} props - the properties for which the classKey should be created.\n */\n\n\nexport default function propsToClassKey(props) {\n const {\n variant\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n let classKey = variant || '';\n Object.keys(other).sort().forEach(key => {\n if (key === 'color') {\n classKey += isEmpty(classKey) ? props[key] : capitalize(props[key]);\n } else {\n classKey += `${isEmpty(classKey) ? key : capitalize(key)}${capitalize(props[key].toString())}`;\n }\n });\n return classKey;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"name\", \"slot\", \"skipVariantsResolver\", \"skipSx\", \"overridesResolver\"],\n _excluded2 = [\"theme\"],\n _excluded3 = [\"theme\"];\nimport styledEngineStyled from '@mui/styled-engine';\nimport { getDisplayName } from '@mui/utils';\nimport createTheme from './createTheme';\nimport propsToClassKey from './propsToClassKey';\nimport defaultStyleFunctionSx from './styleFunctionSx';\n\nfunction isEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n\nconst getStyleOverrides = (name, theme) => {\n if (theme.components && theme.components[name] && theme.components[name].styleOverrides) {\n return theme.components[name].styleOverrides;\n }\n\n return null;\n};\n\nconst getVariantStyles = (name, theme) => {\n let variants = [];\n\n if (theme && theme.components && theme.components[name] && theme.components[name].variants) {\n variants = theme.components[name].variants;\n }\n\n const variantsStyles = {};\n variants.forEach(definition => {\n const key = propsToClassKey(definition.props);\n variantsStyles[key] = definition.style;\n });\n return variantsStyles;\n};\n\nconst variantsResolver = (props, styles, theme, name) => {\n var _theme$components, _theme$components$nam;\n\n const {\n ownerState = {}\n } = props;\n const variantsStyles = [];\n const themeVariants = theme == null ? void 0 : (_theme$components = theme.components) == null ? void 0 : (_theme$components$nam = _theme$components[name]) == null ? void 0 : _theme$components$nam.variants;\n\n if (themeVariants) {\n themeVariants.forEach(themeVariant => {\n let isMatch = true;\n Object.keys(themeVariant.props).forEach(key => {\n if (ownerState[key] !== themeVariant.props[key] && props[key] !== themeVariant.props[key]) {\n isMatch = false;\n }\n });\n\n if (isMatch) {\n variantsStyles.push(styles[propsToClassKey(themeVariant.props)]);\n }\n });\n }\n\n return variantsStyles;\n}; // Update /system/styled/#api in case if this changes\n\n\nexport function shouldForwardProp(prop) {\n return prop !== 'ownerState' && prop !== 'theme' && prop !== 'sx' && prop !== 'as';\n}\nexport const systemDefaultTheme = createTheme();\n\nconst lowercaseFirstLetter = string => {\n return string.charAt(0).toLowerCase() + string.slice(1);\n};\n\nexport default function createStyled(input = {}) {\n const {\n defaultTheme = systemDefaultTheme,\n rootShouldForwardProp = shouldForwardProp,\n slotShouldForwardProp = shouldForwardProp,\n styleFunctionSx = defaultStyleFunctionSx\n } = input;\n return (tag, inputOptions = {}) => {\n const {\n name: componentName,\n slot: componentSlot,\n skipVariantsResolver: inputSkipVariantsResolver,\n skipSx: inputSkipSx,\n overridesResolver\n } = inputOptions,\n options = _objectWithoutPropertiesLoose(inputOptions, _excluded); // if skipVariantsResolver option is defined, take the value, otherwise, true for root and false for other slots.\n\n\n const skipVariantsResolver = inputSkipVariantsResolver !== undefined ? inputSkipVariantsResolver : componentSlot && componentSlot !== 'Root' || false;\n const skipSx = inputSkipSx || false;\n let label;\n\n if (process.env.NODE_ENV !== 'production') {\n if (componentName) {\n label = `${componentName}-${lowercaseFirstLetter(componentSlot || 'Root')}`;\n }\n }\n\n let shouldForwardPropOption = shouldForwardProp;\n\n if (componentSlot === 'Root') {\n shouldForwardPropOption = rootShouldForwardProp;\n } else if (componentSlot) {\n // any other slot specified\n shouldForwardPropOption = slotShouldForwardProp;\n }\n\n const defaultStyledResolver = styledEngineStyled(tag, _extends({\n shouldForwardProp: shouldForwardPropOption,\n label\n }, options));\n\n const muiStyledResolver = (styleArg, ...expressions) => {\n const expressionsWithDefaultTheme = expressions ? expressions.map(stylesArg => {\n // On the server emotion doesn't use React.forwardRef for creating components, so the created\n // component stays as a function. This condition makes sure that we do not interpolate functions\n // which are basically components used as a selectors.\n // eslint-disable-next-line no-underscore-dangle\n return typeof stylesArg === 'function' && stylesArg.__emotion_real !== stylesArg ? _ref => {\n let {\n theme: themeInput\n } = _ref,\n other = _objectWithoutPropertiesLoose(_ref, _excluded2);\n\n return stylesArg(_extends({\n theme: isEmpty(themeInput) ? defaultTheme : themeInput\n }, other));\n } : stylesArg;\n }) : [];\n let transformedStyleArg = styleArg;\n\n if (componentName && overridesResolver) {\n expressionsWithDefaultTheme.push(props => {\n const theme = isEmpty(props.theme) ? defaultTheme : props.theme;\n const styleOverrides = getStyleOverrides(componentName, theme);\n\n if (styleOverrides) {\n const resolvedStyleOverrides = {};\n Object.entries(styleOverrides).forEach(([slotKey, slotStyle]) => {\n resolvedStyleOverrides[slotKey] = typeof slotStyle === 'function' ? slotStyle(_extends({}, props, {\n theme\n })) : slotStyle;\n });\n return overridesResolver(props, resolvedStyleOverrides);\n }\n\n return null;\n });\n }\n\n if (componentName && !skipVariantsResolver) {\n expressionsWithDefaultTheme.push(props => {\n const theme = isEmpty(props.theme) ? defaultTheme : props.theme;\n return variantsResolver(props, getVariantStyles(componentName, theme), theme, componentName);\n });\n }\n\n if (!skipSx) {\n expressionsWithDefaultTheme.push(props => {\n const theme = isEmpty(props.theme) ? defaultTheme : props.theme;\n return styleFunctionSx(_extends({}, props, {\n theme\n }));\n });\n }\n\n const numOfCustomFnsApplied = expressionsWithDefaultTheme.length - expressions.length;\n\n if (Array.isArray(styleArg) && numOfCustomFnsApplied > 0) {\n const placeholders = new Array(numOfCustomFnsApplied).fill(''); // If the type is array, than we need to add placeholders in the template for the overrides, variants and the sx styles.\n\n transformedStyleArg = [...styleArg, ...placeholders];\n transformedStyleArg.raw = [...styleArg.raw, ...placeholders];\n } else if (typeof styleArg === 'function' && // On the server emotion doesn't use React.forwardRef for creating components, so the created\n // component stays as a function. This condition makes sure that we do not interpolate functions\n // which are basically components used as a selectors.\n // eslint-disable-next-line no-underscore-dangle\n styleArg.__emotion_real !== styleArg) {\n // If the type is function, we need to define the default theme.\n transformedStyleArg = _ref2 => {\n let {\n theme: themeInput\n } = _ref2,\n other = _objectWithoutPropertiesLoose(_ref2, _excluded3);\n\n return styleArg(_extends({\n theme: isEmpty(themeInput) ? defaultTheme : themeInput\n }, other));\n };\n }\n\n const Component = defaultStyledResolver(transformedStyleArg, ...expressionsWithDefaultTheme);\n\n if (process.env.NODE_ENV !== 'production') {\n let displayName;\n\n if (componentName) {\n displayName = `${componentName}${componentSlot || ''}`;\n }\n\n if (displayName === undefined) {\n displayName = `Styled(${getDisplayName(tag)})`;\n }\n\n Component.displayName = displayName;\n }\n\n return Component;\n };\n\n if (defaultStyledResolver.withConfig) {\n muiStyledResolver.withConfig = defaultStyledResolver.withConfig;\n }\n\n return muiStyledResolver;\n };\n}","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"values\", \"unit\", \"step\"];\n// Sorted ASC by size. That's important.\n// It can't be configured as it's used statically for propTypes.\nexport const breakpointKeys = ['xs', 'sm', 'md', 'lg', 'xl'];\n\nconst sortBreakpointsValues = values => {\n const breakpointsAsArray = Object.keys(values).map(key => ({\n key,\n val: values[key]\n })) || []; // Sort in ascending order\n\n breakpointsAsArray.sort((breakpoint1, breakpoint2) => breakpoint1.val - breakpoint2.val);\n return breakpointsAsArray.reduce((acc, obj) => {\n return _extends({}, acc, {\n [obj.key]: obj.val\n });\n }, {});\n}; // Keep in mind that @media is inclusive by the CSS specification.\n\n\nexport default function createBreakpoints(breakpoints) {\n const {\n // The breakpoint **start** at this value.\n // For instance with the first breakpoint xs: [xs, sm).\n values = {\n xs: 0,\n // phone\n sm: 600,\n // tablet\n md: 900,\n // small laptop\n lg: 1200,\n // desktop\n xl: 1536 // large screen\n\n },\n unit = 'px',\n step = 5\n } = breakpoints,\n other = _objectWithoutPropertiesLoose(breakpoints, _excluded);\n\n const sortedValues = sortBreakpointsValues(values);\n const keys = Object.keys(sortedValues);\n\n function up(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (min-width:${value}${unit})`;\n }\n\n function down(key) {\n const value = typeof values[key] === 'number' ? values[key] : key;\n return `@media (max-width:${value - step / 100}${unit})`;\n }\n\n function between(start, end) {\n const endIndex = keys.indexOf(end);\n return `@media (min-width:${typeof values[start] === 'number' ? values[start] : start}${unit}) and ` + `(max-width:${(endIndex !== -1 && typeof values[keys[endIndex]] === 'number' ? values[keys[endIndex]] : end) - step / 100}${unit})`;\n }\n\n function only(key) {\n if (keys.indexOf(key) + 1 < keys.length) {\n return between(key, keys[keys.indexOf(key) + 1]);\n }\n\n return up(key);\n }\n\n function not(key) {\n // handle first and last key separately, for better readability\n const keyIndex = keys.indexOf(key);\n\n if (keyIndex === 0) {\n return up(keys[1]);\n }\n\n if (keyIndex === keys.length - 1) {\n return down(keys[keyIndex]);\n }\n\n return between(key, keys[keys.indexOf(key) + 1]).replace('@media', '@media not all and');\n }\n\n return _extends({\n keys,\n values: sortedValues,\n up,\n down,\n between,\n only,\n not,\n unit\n }, other);\n}","const shape = {\n borderRadius: 4\n};\nexport default shape;","import { createUnarySpacing } from '../spacing';\n\n/* tslint:enable:unified-signatures */\nexport default function createSpacing(spacingInput = 8) {\n // Already transformed.\n if (spacingInput.mui) {\n return spacingInput;\n } // Material Design layouts are visually balanced. Most measurements align to an 8dp grid, which aligns both spacing and the overall layout.\n // Smaller components, such as icons, can align to a 4dp grid.\n // https://material.io/design/layout/understanding-layout.html#usage\n\n\n const transform = createUnarySpacing({\n spacing: spacingInput\n });\n\n const spacing = (...argsInput) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!(argsInput.length <= 4)) {\n console.error(`MUI: Too many arguments provided, expected between 0 and 4, got ${argsInput.length}`);\n }\n }\n\n const args = argsInput.length === 0 ? [1] : argsInput;\n return args.map(argument => {\n const output = transform(argument);\n return typeof output === 'number' ? `${output}px` : output;\n }).join(' ');\n };\n\n spacing.mui = true;\n return spacing;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"breakpoints\", \"palette\", \"spacing\", \"shape\"];\nimport { deepmerge } from '@mui/utils';\nimport createBreakpoints from './createBreakpoints';\nimport shape from './shape';\nimport createSpacing from './createSpacing';\n\nfunction createTheme(options = {}, ...args) {\n const {\n breakpoints: breakpointsInput = {},\n palette: paletteInput = {},\n spacing: spacingInput,\n shape: shapeInput = {}\n } = options,\n other = _objectWithoutPropertiesLoose(options, _excluded);\n\n const breakpoints = createBreakpoints(breakpointsInput);\n const spacing = createSpacing(spacingInput);\n let muiTheme = deepmerge({\n breakpoints,\n direction: 'ltr',\n components: {},\n // Inject component definitions.\n palette: _extends({\n mode: 'light'\n }, paletteInput),\n spacing,\n shape: _extends({}, shape, shapeInput)\n }, other);\n muiTheme = args.reduce((acc, argument) => deepmerge(acc, argument), muiTheme);\n return muiTheme;\n}\n\nexport default createTheme;","import merge from './merge';\n\nfunction compose(...styles) {\n const handlers = styles.reduce((acc, style) => {\n style.filterProps.forEach(prop => {\n acc[prop] = style;\n });\n return acc;\n }, {});\n\n const fn = props => {\n return Object.keys(props).reduce((acc, prop) => {\n if (handlers[prop]) {\n return merge(acc, handlers[prop](props));\n }\n\n return acc;\n }, {});\n };\n\n fn.propTypes = process.env.NODE_ENV !== 'production' ? styles.reduce((acc, style) => Object.assign(acc, style.propTypes), {}) : {};\n fn.filterProps = styles.reduce((acc, style) => acc.concat(style.filterProps), []);\n return fn;\n}\n\nexport default compose;","import responsivePropType from './responsivePropType';\nimport style from './style';\nimport compose from './compose';\nimport { createUnaryUnit, getValue } from './spacing';\nimport { handleBreakpoints } from './breakpoints';\n\nfunction getBorder(value) {\n if (typeof value !== 'number') {\n return value;\n }\n\n return `${value}px solid`;\n}\n\nexport const border = style({\n prop: 'border',\n themeKey: 'borders',\n transform: getBorder\n});\nexport const borderTop = style({\n prop: 'borderTop',\n themeKey: 'borders',\n transform: getBorder\n});\nexport const borderRight = style({\n prop: 'borderRight',\n themeKey: 'borders',\n transform: getBorder\n});\nexport const borderBottom = style({\n prop: 'borderBottom',\n themeKey: 'borders',\n transform: getBorder\n});\nexport const borderLeft = style({\n prop: 'borderLeft',\n themeKey: 'borders',\n transform: getBorder\n});\nexport const borderColor = style({\n prop: 'borderColor',\n themeKey: 'palette'\n});\nexport const borderTopColor = style({\n prop: 'borderTopColor',\n themeKey: 'palette'\n});\nexport const borderRightColor = style({\n prop: 'borderRightColor',\n themeKey: 'palette'\n});\nexport const borderBottomColor = style({\n prop: 'borderBottomColor',\n themeKey: 'palette'\n});\nexport const borderLeftColor = style({\n prop: 'borderLeftColor',\n themeKey: 'palette'\n});\nexport const borderRadius = props => {\n if (props.borderRadius !== undefined && props.borderRadius !== null) {\n const transformer = createUnaryUnit(props.theme, 'shape.borderRadius', 4, 'borderRadius');\n\n const styleFromPropValue = propValue => ({\n borderRadius: getValue(transformer, propValue)\n });\n\n return handleBreakpoints(props, props.borderRadius, styleFromPropValue);\n }\n\n return null;\n};\nborderRadius.propTypes = process.env.NODE_ENV !== 'production' ? {\n borderRadius: responsivePropType\n} : {};\nborderRadius.filterProps = ['borderRadius'];\nconst borders = compose(border, borderTop, borderRight, borderBottom, borderLeft, borderColor, borderTopColor, borderRightColor, borderBottomColor, borderLeftColor, borderRadius);\nexport default borders;","import style from './style';\nimport compose from './compose';\nexport const displayPrint = style({\n prop: 'displayPrint',\n cssProperty: false,\n transform: value => ({\n '@media print': {\n display: value\n }\n })\n});\nexport const displayRaw = style({\n prop: 'display'\n});\nexport const overflow = style({\n prop: 'overflow'\n});\nexport const textOverflow = style({\n prop: 'textOverflow'\n});\nexport const visibility = style({\n prop: 'visibility'\n});\nexport const whiteSpace = style({\n prop: 'whiteSpace'\n});\nexport default compose(displayPrint, displayRaw, overflow, textOverflow, visibility, whiteSpace);","import style from './style';\nimport compose from './compose';\nexport const flexBasis = style({\n prop: 'flexBasis'\n});\nexport const flexDirection = style({\n prop: 'flexDirection'\n});\nexport const flexWrap = style({\n prop: 'flexWrap'\n});\nexport const justifyContent = style({\n prop: 'justifyContent'\n});\nexport const alignItems = style({\n prop: 'alignItems'\n});\nexport const alignContent = style({\n prop: 'alignContent'\n});\nexport const order = style({\n prop: 'order'\n});\nexport const flex = style({\n prop: 'flex'\n});\nexport const flexGrow = style({\n prop: 'flexGrow'\n});\nexport const flexShrink = style({\n prop: 'flexShrink'\n});\nexport const alignSelf = style({\n prop: 'alignSelf'\n});\nexport const justifyItems = style({\n prop: 'justifyItems'\n});\nexport const justifySelf = style({\n prop: 'justifySelf'\n});\nconst flexbox = compose(flexBasis, flexDirection, flexWrap, justifyContent, alignItems, alignContent, order, flex, flexGrow, flexShrink, alignSelf, justifyItems, justifySelf);\nexport default flexbox;","import style from './style';\nimport compose from './compose';\nimport { createUnaryUnit, getValue } from './spacing';\nimport { handleBreakpoints } from './breakpoints';\nimport responsivePropType from './responsivePropType';\nexport const gap = props => {\n if (props.gap !== undefined && props.gap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'gap');\n\n const styleFromPropValue = propValue => ({\n gap: getValue(transformer, propValue)\n });\n\n return handleBreakpoints(props, props.gap, styleFromPropValue);\n }\n\n return null;\n};\ngap.propTypes = process.env.NODE_ENV !== 'production' ? {\n gap: responsivePropType\n} : {};\ngap.filterProps = ['gap'];\nexport const columnGap = props => {\n if (props.columnGap !== undefined && props.columnGap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'columnGap');\n\n const styleFromPropValue = propValue => ({\n columnGap: getValue(transformer, propValue)\n });\n\n return handleBreakpoints(props, props.columnGap, styleFromPropValue);\n }\n\n return null;\n};\ncolumnGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n columnGap: responsivePropType\n} : {};\ncolumnGap.filterProps = ['columnGap'];\nexport const rowGap = props => {\n if (props.rowGap !== undefined && props.rowGap !== null) {\n const transformer = createUnaryUnit(props.theme, 'spacing', 8, 'rowGap');\n\n const styleFromPropValue = propValue => ({\n rowGap: getValue(transformer, propValue)\n });\n\n return handleBreakpoints(props, props.rowGap, styleFromPropValue);\n }\n\n return null;\n};\nrowGap.propTypes = process.env.NODE_ENV !== 'production' ? {\n rowGap: responsivePropType\n} : {};\nrowGap.filterProps = ['rowGap'];\nexport const gridColumn = style({\n prop: 'gridColumn'\n});\nexport const gridRow = style({\n prop: 'gridRow'\n});\nexport const gridAutoFlow = style({\n prop: 'gridAutoFlow'\n});\nexport const gridAutoColumns = style({\n prop: 'gridAutoColumns'\n});\nexport const gridAutoRows = style({\n prop: 'gridAutoRows'\n});\nexport const gridTemplateColumns = style({\n prop: 'gridTemplateColumns'\n});\nexport const gridTemplateRows = style({\n prop: 'gridTemplateRows'\n});\nexport const gridTemplateAreas = style({\n prop: 'gridTemplateAreas'\n});\nexport const gridArea = style({\n prop: 'gridArea'\n});\nconst grid = compose(gap, columnGap, rowGap, gridColumn, gridRow, gridAutoFlow, gridAutoColumns, gridAutoRows, gridTemplateColumns, gridTemplateRows, gridTemplateAreas, gridArea);\nexport default grid;","import style from './style';\nimport compose from './compose';\nexport const position = style({\n prop: 'position'\n});\nexport const zIndex = style({\n prop: 'zIndex',\n themeKey: 'zIndex'\n});\nexport const top = style({\n prop: 'top'\n});\nexport const right = style({\n prop: 'right'\n});\nexport const bottom = style({\n prop: 'bottom'\n});\nexport const left = style({\n prop: 'left'\n});\nexport default compose(position, zIndex, top, right, bottom, left);","import style from './style';\nimport compose from './compose';\nexport const color = style({\n prop: 'color',\n themeKey: 'palette'\n});\nexport const bgcolor = style({\n prop: 'bgcolor',\n cssProperty: 'backgroundColor',\n themeKey: 'palette'\n});\nexport const backgroundColor = style({\n prop: 'backgroundColor',\n themeKey: 'palette'\n});\nconst palette = compose(color, bgcolor, backgroundColor);\nexport default palette;","import style from './style';\nconst boxShadow = style({\n prop: 'boxShadow',\n themeKey: 'shadows'\n});\nexport default boxShadow;","import style from './style';\nimport compose from './compose';\nimport { handleBreakpoints, values as breakpointsValues } from './breakpoints';\n\nfunction transform(value) {\n return value <= 1 && value !== 0 ? `${value * 100}%` : value;\n}\n\nexport const width = style({\n prop: 'width',\n transform\n});\nexport const maxWidth = props => {\n if (props.maxWidth !== undefined && props.maxWidth !== null) {\n const styleFromPropValue = propValue => {\n var _props$theme, _props$theme$breakpoi, _props$theme$breakpoi2;\n\n const breakpoint = ((_props$theme = props.theme) == null ? void 0 : (_props$theme$breakpoi = _props$theme.breakpoints) == null ? void 0 : (_props$theme$breakpoi2 = _props$theme$breakpoi.values) == null ? void 0 : _props$theme$breakpoi2[propValue]) || breakpointsValues[propValue];\n return {\n maxWidth: breakpoint || transform(propValue)\n };\n };\n\n return handleBreakpoints(props, props.maxWidth, styleFromPropValue);\n }\n\n return null;\n};\nmaxWidth.filterProps = ['maxWidth'];\nexport const minWidth = style({\n prop: 'minWidth',\n transform\n});\nexport const height = style({\n prop: 'height',\n transform\n});\nexport const maxHeight = style({\n prop: 'maxHeight',\n transform\n});\nexport const minHeight = style({\n prop: 'minHeight',\n transform\n});\nexport const sizeWidth = style({\n prop: 'size',\n cssProperty: 'width',\n transform\n});\nexport const sizeHeight = style({\n prop: 'size',\n cssProperty: 'height',\n transform\n});\nexport const boxSizing = style({\n prop: 'boxSizing'\n});\nconst sizing = compose(width, maxWidth, minWidth, height, maxHeight, minHeight, boxSizing);\nexport default sizing;","import style from './style';\nimport compose from './compose';\nexport const fontFamily = style({\n prop: 'fontFamily',\n themeKey: 'typography'\n});\nexport const fontSize = style({\n prop: 'fontSize',\n themeKey: 'typography'\n});\nexport const fontStyle = style({\n prop: 'fontStyle',\n themeKey: 'typography'\n});\nexport const fontWeight = style({\n prop: 'fontWeight',\n themeKey: 'typography'\n});\nexport const letterSpacing = style({\n prop: 'letterSpacing'\n});\nexport const textTransform = style({\n prop: 'textTransform'\n});\nexport const lineHeight = style({\n prop: 'lineHeight'\n});\nexport const textAlign = style({\n prop: 'textAlign'\n});\nexport const typographyVariant = style({\n prop: 'typography',\n cssProperty: false,\n themeKey: 'typography'\n});\nconst typography = compose(typographyVariant, fontFamily, fontSize, fontStyle, fontWeight, letterSpacing, lineHeight, textAlign, textTransform);\nexport default typography;","import borders from './borders';\nimport display from './display';\nimport flexbox from './flexbox';\nimport grid from './grid';\nimport positions from './positions';\nimport palette from './palette';\nimport shadows from './shadows';\nimport sizing from './sizing';\nimport spacing from './spacing';\nimport typography from './typography';\nconst filterPropsMapping = {\n borders: borders.filterProps,\n display: display.filterProps,\n flexbox: flexbox.filterProps,\n grid: grid.filterProps,\n positions: positions.filterProps,\n palette: palette.filterProps,\n shadows: shadows.filterProps,\n sizing: sizing.filterProps,\n spacing: spacing.filterProps,\n typography: typography.filterProps\n};\nexport const styleFunctionMapping = {\n borders,\n display,\n flexbox,\n grid,\n positions,\n palette,\n shadows,\n sizing,\n spacing,\n typography\n};\nexport const propToStyleFunction = Object.keys(filterPropsMapping).reduce((acc, styleFnName) => {\n filterPropsMapping[styleFnName].forEach(propName => {\n acc[propName] = styleFunctionMapping[styleFnName];\n });\n return acc;\n}, {});\n\nfunction getThemeValue(prop, value, theme) {\n const inputProps = {\n [prop]: value,\n theme\n };\n const styleFunction = propToStyleFunction[prop];\n return styleFunction ? styleFunction(inputProps) : {\n [prop]: value\n };\n}\n\nexport default getThemeValue;","import { deepmerge } from '@mui/utils';\n\nfunction merge(acc, item) {\n if (!item) {\n return acc;\n }\n\n return deepmerge(acc, item, {\n clone: false // No need to clone deep, it's way faster.\n\n });\n}\n\nexport default merge;","import responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nimport { getPath } from './style';\nimport merge from './merge';\nimport memoize from './memoize';\nconst properties = {\n m: 'margin',\n p: 'padding'\n};\nconst directions = {\n t: 'Top',\n r: 'Right',\n b: 'Bottom',\n l: 'Left',\n x: ['Left', 'Right'],\n y: ['Top', 'Bottom']\n};\nconst aliases = {\n marginX: 'mx',\n marginY: 'my',\n paddingX: 'px',\n paddingY: 'py'\n}; // memoize() impact:\n// From 300,000 ops/sec\n// To 350,000 ops/sec\n\nconst getCssProperties = memoize(prop => {\n // It's not a shorthand notation.\n if (prop.length > 2) {\n if (aliases[prop]) {\n prop = aliases[prop];\n } else {\n return [prop];\n }\n }\n\n const [a, b] = prop.split('');\n const property = properties[a];\n const direction = directions[b] || '';\n return Array.isArray(direction) ? direction.map(dir => property + dir) : [property + direction];\n});\nconst marginKeys = ['m', 'mt', 'mr', 'mb', 'ml', 'mx', 'my', 'margin', 'marginTop', 'marginRight', 'marginBottom', 'marginLeft', 'marginX', 'marginY', 'marginInline', 'marginInlineStart', 'marginInlineEnd', 'marginBlock', 'marginBlockStart', 'marginBlockEnd'];\nconst paddingKeys = ['p', 'pt', 'pr', 'pb', 'pl', 'px', 'py', 'padding', 'paddingTop', 'paddingRight', 'paddingBottom', 'paddingLeft', 'paddingX', 'paddingY', 'paddingInline', 'paddingInlineStart', 'paddingInlineEnd', 'paddingBlock', 'paddingBlockStart', 'paddingBlockEnd'];\nconst spacingKeys = [...marginKeys, ...paddingKeys];\nexport function createUnaryUnit(theme, themeKey, defaultValue, propName) {\n var _getPath;\n\n const themeSpacing = (_getPath = getPath(theme, themeKey)) != null ? _getPath : defaultValue;\n\n if (typeof themeSpacing === 'number') {\n return abs => {\n if (typeof abs === 'string') {\n return abs;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (typeof abs !== 'number') {\n console.error(`MUI: Expected ${propName} argument to be a number or a string, got ${abs}.`);\n }\n }\n\n return themeSpacing * abs;\n };\n }\n\n if (Array.isArray(themeSpacing)) {\n return abs => {\n if (typeof abs === 'string') {\n return abs;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!Number.isInteger(abs)) {\n console.error([`MUI: The \\`theme.${themeKey}\\` array type cannot be combined with non integer values.` + `You should either use an integer value that can be used as index, or define the \\`theme.${themeKey}\\` as a number.`].join('\\n'));\n } else if (abs > themeSpacing.length - 1) {\n console.error([`MUI: The value provided (${abs}) overflows.`, `The supported values are: ${JSON.stringify(themeSpacing)}.`, `${abs} > ${themeSpacing.length - 1}, you need to add the missing values.`].join('\\n'));\n }\n }\n\n return themeSpacing[abs];\n };\n }\n\n if (typeof themeSpacing === 'function') {\n return themeSpacing;\n }\n\n if (process.env.NODE_ENV !== 'production') {\n console.error([`MUI: The \\`theme.${themeKey}\\` value (${themeSpacing}) is invalid.`, 'It should be a number, an array or a function.'].join('\\n'));\n }\n\n return () => undefined;\n}\nexport function createUnarySpacing(theme) {\n return createUnaryUnit(theme, 'spacing', 8, 'spacing');\n}\nexport function getValue(transformer, propValue) {\n if (typeof propValue === 'string' || propValue == null) {\n return propValue;\n }\n\n const abs = Math.abs(propValue);\n const transformed = transformer(abs);\n\n if (propValue >= 0) {\n return transformed;\n }\n\n if (typeof transformed === 'number') {\n return -transformed;\n }\n\n return `-${transformed}`;\n}\nexport function getStyleFromPropValue(cssProperties, transformer) {\n return propValue => cssProperties.reduce((acc, cssProperty) => {\n acc[cssProperty] = getValue(transformer, propValue);\n return acc;\n }, {});\n}\n\nfunction resolveCssProperty(props, keys, prop, transformer) {\n // Using a hash computation over an array iteration could be faster, but with only 28 items,\n // it's doesn't worth the bundle size.\n if (keys.indexOf(prop) === -1) {\n return null;\n }\n\n const cssProperties = getCssProperties(prop);\n const styleFromPropValue = getStyleFromPropValue(cssProperties, transformer);\n const propValue = props[prop];\n return handleBreakpoints(props, propValue, styleFromPropValue);\n}\n\nfunction style(props, keys) {\n const transformer = createUnarySpacing(props.theme);\n return Object.keys(props).map(prop => resolveCssProperty(props, keys, prop, transformer)).reduce(merge, {});\n}\n\nexport function margin(props) {\n return style(props, marginKeys);\n}\nmargin.propTypes = process.env.NODE_ENV !== 'production' ? marginKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nmargin.filterProps = marginKeys;\nexport function padding(props) {\n return style(props, paddingKeys);\n}\npadding.propTypes = process.env.NODE_ENV !== 'production' ? paddingKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\npadding.filterProps = paddingKeys;\n\nfunction spacing(props) {\n return style(props, spacingKeys);\n}\n\nspacing.propTypes = process.env.NODE_ENV !== 'production' ? spacingKeys.reduce((obj, key) => {\n obj[key] = responsivePropType;\n return obj;\n}, {}) : {};\nspacing.filterProps = spacingKeys;\nexport default spacing;","export default function memoize(fn) {\n const cache = {};\n return arg => {\n if (cache[arg] === undefined) {\n cache[arg] = fn(arg);\n }\n\n return cache[arg];\n };\n}","import { unstable_capitalize as capitalize } from '@mui/utils';\nimport responsivePropType from './responsivePropType';\nimport { handleBreakpoints } from './breakpoints';\nexport function getPath(obj, path) {\n if (!path || typeof path !== 'string') {\n return null;\n } // Check if CSS variables are used\n\n\n if (obj && obj.vars) {\n const val = `vars.${path}`.split('.').reduce((acc, item) => acc && acc[item] ? acc[item] : null, obj);\n\n if (val != null) {\n return val;\n }\n }\n\n return path.split('.').reduce((acc, item) => {\n if (acc && acc[item] != null) {\n return acc[item];\n }\n\n return null;\n }, obj);\n}\n\nfunction getValue(themeMapping, transform, propValueFinal, userValue = propValueFinal) {\n let value;\n\n if (typeof themeMapping === 'function') {\n value = themeMapping(propValueFinal);\n } else if (Array.isArray(themeMapping)) {\n value = themeMapping[propValueFinal] || userValue;\n } else {\n value = getPath(themeMapping, propValueFinal) || userValue;\n }\n\n if (transform) {\n value = transform(value);\n }\n\n return value;\n}\n\nfunction style(options) {\n const {\n prop,\n cssProperty = options.prop,\n themeKey,\n transform\n } = options;\n\n const fn = props => {\n if (props[prop] == null) {\n return null;\n }\n\n const propValue = props[prop];\n const theme = props.theme;\n const themeMapping = getPath(theme, themeKey) || {};\n\n const styleFromPropValue = propValueFinal => {\n let value = getValue(themeMapping, transform, propValueFinal);\n\n if (propValueFinal === value && typeof propValueFinal === 'string') {\n // Haven't found value\n value = getValue(themeMapping, transform, `${prop}${propValueFinal === 'default' ? '' : capitalize(propValueFinal)}`, propValueFinal);\n }\n\n if (cssProperty === false) {\n return value;\n }\n\n return {\n [cssProperty]: value\n };\n };\n\n return handleBreakpoints(props, propValue, styleFromPropValue);\n };\n\n fn.propTypes = process.env.NODE_ENV !== 'production' ? {\n [prop]: responsivePropType\n } : {};\n fn.filterProps = [prop];\n return fn;\n}\n\nexport default style;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"sx\"];\nimport { isPlainObject } from '@mui/utils';\nimport { propToStyleFunction } from '../getThemeValue';\n\nconst splitProps = props => {\n const result = {\n systemProps: {},\n otherProps: {}\n };\n Object.keys(props).forEach(prop => {\n if (propToStyleFunction[prop]) {\n result.systemProps[prop] = props[prop];\n } else {\n result.otherProps[prop] = props[prop];\n }\n });\n return result;\n};\n\nexport default function extendSxProp(props) {\n const {\n sx: inSx\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const {\n systemProps,\n otherProps\n } = splitProps(other);\n let finalSx;\n\n if (Array.isArray(inSx)) {\n finalSx = [systemProps, ...inSx];\n } else if (typeof inSx === 'function') {\n finalSx = (...args) => {\n const result = inSx(...args);\n\n if (!isPlainObject(result)) {\n return systemProps;\n }\n\n return _extends({}, systemProps, result);\n };\n } else {\n finalSx = _extends({}, systemProps, inSx);\n }\n\n return _extends({}, otherProps, {\n sx: finalSx\n });\n}","import merge from '../merge';\nimport { styleFunctionMapping as defaultStyleFunctionMapping } from '../getThemeValue';\nimport { handleBreakpoints, createEmptyBreakpointObject, removeUnusedBreakpoints } from '../breakpoints';\n\nfunction objectsHaveSameKeys(...objects) {\n const allKeys = objects.reduce((keys, object) => keys.concat(Object.keys(object)), []);\n const union = new Set(allKeys);\n return objects.every(object => union.size === Object.keys(object).length);\n}\n\nfunction callIfFn(maybeFn, arg) {\n return typeof maybeFn === 'function' ? maybeFn(arg) : maybeFn;\n} // eslint-disable-next-line @typescript-eslint/naming-convention\n\n\nexport function unstable_createStyleFunctionSx(styleFunctionMapping = defaultStyleFunctionMapping) {\n const propToStyleFunction = Object.keys(styleFunctionMapping).reduce((acc, styleFnName) => {\n styleFunctionMapping[styleFnName].filterProps.forEach(propName => {\n acc[propName] = styleFunctionMapping[styleFnName];\n });\n return acc;\n }, {});\n\n function getThemeValue(prop, value, theme) {\n const inputProps = {\n [prop]: value,\n theme\n };\n const styleFunction = propToStyleFunction[prop];\n return styleFunction ? styleFunction(inputProps) : {\n [prop]: value\n };\n }\n\n function styleFunctionSx(props) {\n const {\n sx,\n theme = {}\n } = props || {};\n\n if (!sx) {\n return null; // emotion & styled-components will neglect null\n }\n /*\n * Receive `sxInput` as object or callback\n * and then recursively check keys & values to create media query object styles.\n * (the result will be used in `styled`)\n */\n\n\n function traverse(sxInput) {\n let sxObject = sxInput;\n\n if (typeof sxInput === 'function') {\n sxObject = sxInput(theme);\n } else if (typeof sxInput !== 'object') {\n // value\n return sxInput;\n }\n\n if (!sxObject) {\n return null;\n }\n\n const emptyBreakpoints = createEmptyBreakpointObject(theme.breakpoints);\n const breakpointsKeys = Object.keys(emptyBreakpoints);\n let css = emptyBreakpoints;\n Object.keys(sxObject).forEach(styleKey => {\n const value = callIfFn(sxObject[styleKey], theme);\n\n if (value !== null && value !== undefined) {\n if (typeof value === 'object') {\n if (propToStyleFunction[styleKey]) {\n css = merge(css, getThemeValue(styleKey, value, theme));\n } else {\n const breakpointsValues = handleBreakpoints({\n theme\n }, value, x => ({\n [styleKey]: x\n }));\n\n if (objectsHaveSameKeys(breakpointsValues, value)) {\n css[styleKey] = styleFunctionSx({\n sx: value,\n theme\n });\n } else {\n css = merge(css, breakpointsValues);\n }\n }\n } else {\n css = merge(css, getThemeValue(styleKey, value, theme));\n }\n }\n });\n return removeUnusedBreakpoints(breakpointsKeys, css);\n }\n\n return Array.isArray(sx) ? sx.map(traverse) : traverse(sx);\n }\n\n return styleFunctionSx;\n}\nconst styleFunctionSx = unstable_createStyleFunctionSx();\nstyleFunctionSx.filterProps = ['sx'];\nexport default styleFunctionSx;","import createTheme from './createTheme';\nimport useThemeWithoutDefault from './useThemeWithoutDefault';\nexport const systemDefaultTheme = createTheme();\n\nfunction useTheme(defaultTheme = systemDefaultTheme) {\n return useThemeWithoutDefault(defaultTheme);\n}\n\nexport default useTheme;","import getThemeProps from './getThemeProps';\nimport useTheme from '../useTheme';\nexport default function useThemeProps({\n props,\n name,\n defaultTheme\n}) {\n const theme = useTheme(defaultTheme);\n const mergedProps = getThemeProps({\n theme,\n name,\n props\n });\n return mergedProps;\n}","import { internal_resolveProps as resolveProps } from '@mui/utils';\nexport default function getThemeProps(params) {\n const {\n theme,\n name,\n props\n } = params;\n\n if (!theme || !theme.components || !theme.components[name] || !theme.components[name].defaultProps) {\n return props;\n }\n\n return resolveProps(theme.components[name].defaultProps, props);\n}","import { useTheme as muiUseTheme } from '@mui/private-theming';\n\nfunction isObjectEmpty(obj) {\n return Object.keys(obj).length === 0;\n}\n\nfunction useTheme(defaultTheme = null) {\n const contextTheme = muiUseTheme();\n return !contextTheme || isObjectEmpty(contextTheme) ? defaultTheme : contextTheme;\n}\n\nexport default useTheme;","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|abbr|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|enterKeyHint|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|translate|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|incremental|fallback|inert|itemProp|itemScope|itemType|itemID|itemRef|on|option|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar isPropValid = /* #__PURE__ */memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default isPropValid;\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport * as React from 'react';\nimport { useContext, createElement, Fragment } from 'react';\nimport isPropValid from '@emotion/is-prop-valid';\nimport { withEmotionCache, ThemeContext } from '@emotion/react';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\n\nvar testOmitPropsOnStringTag = isPropValid;\n\nvar testOmitPropsOnComponent = function testOmitPropsOnComponent(key) {\n return key !== 'theme';\n};\n\nvar getDefaultShouldForwardProp = function getDefaultShouldForwardProp(tag) {\n return typeof tag === 'string' && // 96 is one less than the char code\n // for \"a\" so this is checking that\n // it's a lowercase character\n tag.charCodeAt(0) > 96 ? testOmitPropsOnStringTag : testOmitPropsOnComponent;\n};\nvar composeShouldForwardProps = function composeShouldForwardProps(tag, options, isReal) {\n var shouldForwardProp;\n\n if (options) {\n var optionsShouldForwardProp = options.shouldForwardProp;\n shouldForwardProp = tag.__emotion_forwardProp && optionsShouldForwardProp ? function (propName) {\n return tag.__emotion_forwardProp(propName) && optionsShouldForwardProp(propName);\n } : optionsShouldForwardProp;\n }\n\n if (typeof shouldForwardProp !== 'function' && isReal) {\n shouldForwardProp = tag.__emotion_forwardProp;\n }\n\n return shouldForwardProp;\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : function useInsertionEffect(create) {\n create();\n};\nfunction useInsertionEffectMaybe(create) {\n\n useInsertionEffect(create);\n}\n\nvar ILLEGAL_ESCAPE_SEQUENCE_ERROR = \"You have illegal escape sequence in your template literal, most likely inside content's property value.\\nBecause you write your CSS inside a JavaScript string you actually have to do double escaping, so for example \\\"content: '\\\\00d7';\\\" should become \\\"content: '\\\\\\\\00d7';\\\".\\nYou can read more about this here:\\nhttps://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Template_literals#ES2018_revision_of_illegal_escape_sequences\";\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n var rules = useInsertionEffectMaybe(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar createStyled = function createStyled(tag, options) {\n if (process.env.NODE_ENV !== 'production') {\n if (tag === undefined) {\n throw new Error('You are trying to create a styled element with an undefined component.\\nYou may have forgotten to import it.');\n }\n }\n\n var isReal = tag.__emotion_real === tag;\n var baseTag = isReal && tag.__emotion_base || tag;\n var identifierName;\n var targetClassName;\n\n if (options !== undefined) {\n identifierName = options.label;\n targetClassName = options.target;\n }\n\n var shouldForwardProp = composeShouldForwardProps(tag, options, isReal);\n var defaultShouldForwardProp = shouldForwardProp || getDefaultShouldForwardProp(baseTag);\n var shouldUseAs = !defaultShouldForwardProp('as');\n return function () {\n var args = arguments;\n var styles = isReal && tag.__emotion_styles !== undefined ? tag.__emotion_styles.slice(0) : [];\n\n if (identifierName !== undefined) {\n styles.push(\"label:\" + identifierName + \";\");\n }\n\n if (args[0] == null || args[0].raw === undefined) {\n styles.push.apply(styles, args);\n } else {\n if (process.env.NODE_ENV !== 'production' && args[0][0] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles.push(args[0][0]);\n var len = args.length;\n var i = 1;\n\n for (; i < len; i++) {\n if (process.env.NODE_ENV !== 'production' && args[0][i] === undefined) {\n console.error(ILLEGAL_ESCAPE_SEQUENCE_ERROR);\n }\n\n styles.push(args[i], args[0][i]);\n }\n } // $FlowFixMe: we need to cast StatelessFunctionalComponent to our PrivateStyledComponent class\n\n\n var Styled = withEmotionCache(function (props, cache, ref) {\n var FinalTag = shouldUseAs && props.as || baseTag;\n var className = '';\n var classInterpolations = [];\n var mergedProps = props;\n\n if (props.theme == null) {\n mergedProps = {};\n\n for (var key in props) {\n mergedProps[key] = props[key];\n }\n\n mergedProps.theme = useContext(ThemeContext);\n }\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, classInterpolations, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(styles.concat(classInterpolations), cache.registered, mergedProps);\n className += cache.key + \"-\" + serialized.name;\n\n if (targetClassName !== undefined) {\n className += \" \" + targetClassName;\n }\n\n var finalShouldForwardProp = shouldUseAs && shouldForwardProp === undefined ? getDefaultShouldForwardProp(FinalTag) : defaultShouldForwardProp;\n var newProps = {};\n\n for (var _key in props) {\n if (shouldUseAs && _key === 'as') continue;\n\n if ( // $FlowFixMe\n finalShouldForwardProp(_key)) {\n newProps[_key] = props[_key];\n }\n }\n\n newProps.className = className;\n newProps.ref = ref;\n return /*#__PURE__*/createElement(Fragment, null, /*#__PURE__*/createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof FinalTag === 'string'\n }), /*#__PURE__*/createElement(FinalTag, newProps));\n });\n Styled.displayName = identifierName !== undefined ? identifierName : \"Styled(\" + (typeof baseTag === 'string' ? baseTag : baseTag.displayName || baseTag.name || 'Component') + \")\";\n Styled.defaultProps = tag.defaultProps;\n Styled.__emotion_real = Styled;\n Styled.__emotion_base = baseTag;\n Styled.__emotion_styles = styles;\n Styled.__emotion_forwardProp = shouldForwardProp;\n Object.defineProperty(Styled, 'toString', {\n value: function value() {\n if (targetClassName === undefined && process.env.NODE_ENV !== 'production') {\n return 'NO_COMPONENT_SELECTOR';\n } // $FlowFixMe: coerce undefined to string\n\n\n return \".\" + targetClassName;\n }\n });\n\n Styled.withComponent = function (nextTag, nextOptions) {\n return createStyled(nextTag, _extends({}, options, nextOptions, {\n shouldForwardProp: composeShouldForwardProps(Styled, nextOptions, true)\n })).apply(void 0, styles);\n };\n\n return Styled;\n };\n};\n\nexport default createStyled;\n","import '@babel/runtime/helpers/extends';\nimport 'react';\nimport '@emotion/is-prop-valid';\nimport createStyled from '../base/dist/emotion-styled-base.browser.esm.js';\nimport '@emotion/react';\nimport '@emotion/utils';\nimport '@emotion/serialize';\n\nvar tags = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'marquee', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG\n'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];\n\nvar newStyled = createStyled.bind();\ntags.forEach(function (tagName) {\n // $FlowFixMe: we can ignore this because its exposed type is defined by the CreateStyled type\n newStyled[tagName] = newStyled(tagName);\n});\n\nexport default newStyled;\n","/** @license MUI v5.8.0\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 */\nimport emStyled from '@emotion/styled';\nexport default function styled(tag, options) {\n const stylesFactory = emStyled(tag, options);\n\n if (process.env.NODE_ENV !== 'production') {\n return (...styles) => {\n const component = typeof tag === 'string' ? `\"${tag}\"` : 'component';\n\n if (styles.length === 0) {\n console.error([`MUI: Seems like you called \\`styled(${component})()\\` without a \\`style\\` argument.`, 'You must provide a `styles` argument: `styled(\"div\")(styleYouForgotToPass)`.'].join('\\n'));\n } else if (styles.some(style => style === undefined)) {\n console.error(`MUI: the styled(${component})(...args) API requires all its args to be defined.`);\n }\n\n return stylesFactory(...styles);\n };\n }\n\n return stylesFactory;\n}\nexport { ThemeContext, keyframes, css } from '@emotion/react';\nexport { default as StyledEngineProvider } from './StyledEngineProvider';\nexport { default as GlobalStyles } from './GlobalStyles';","const defaultGenerator = componentName => componentName;\n\nconst createClassNameGenerator = () => {\n let generate = defaultGenerator;\n return {\n configure(generator) {\n generate = generator;\n },\n\n generate(componentName) {\n return generate(componentName);\n },\n\n reset() {\n generate = defaultGenerator;\n }\n\n };\n};\n\nconst ClassNameGenerator = createClassNameGenerator();\nexport default ClassNameGenerator;","import _formatMuiErrorMessage from \"./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\n return string.charAt(0).toUpperCase() + string.slice(1);\n}","export default function composeClasses(slots, getUtilityClass, classes) {\n const output = {};\n Object.keys(slots).forEach( // `Objet.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 if (classes && classes[key]) {\n acc.push(classes[key]);\n }\n\n acc.push(getUtilityClass(key));\n }\n\n return acc;\n }, []).join(' ');\n });\n return output;\n}","/**\n * Safe chained function.\n *\n * Will only create a new function if needed,\n * otherwise will pass back existing functions or null.\n */\nexport default function createChainedFunction(...funcs) {\n return funcs.reduce((acc, func) => {\n if (func == null) {\n return acc;\n }\n\n return function chainedFunction(...args) {\n acc.apply(this, args);\n func.apply(this, args);\n };\n }, () => {});\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\n function debounced(...args) {\n const later = () => {\n func.apply(this, args);\n };\n\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n }\n\n debounced.clear = () => {\n clearTimeout(timeout);\n };\n\n return debounced;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport function isPlainObject(item) {\n return item !== null && typeof item === 'object' && item.constructor === Object;\n}\nexport default function deepmerge(target, source, options = {\n clone: true\n}) {\n const output = options.clone ? _extends({}, target) : target;\n\n if (isPlainObject(target) && isPlainObject(source)) {\n Object.keys(source).forEach(key => {\n // Avoid prototype pollution\n if (key === '__proto__') {\n return;\n }\n\n if (isPlainObject(source[key]) && key in target && isPlainObject(target[key])) {\n // Since `output` is a clone of `target` and we have narrowed `target` in this block we can cast to the same type.\n output[key] = deepmerge(target[key], source[key], options);\n } else {\n output[key] = source[key];\n }\n });\n }\n\n return output;\n}","/**\n * WARNING: Don't import this directly.\n * Use `MuiError` from `@mui/utils/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 iff we're concatenating primitives\n // see https://babeljs.io/docs/en/babel-plugin-transform-template-literals#loose\n\n /* eslint-disable prefer-template */\n let url = 'https://mui.com/production-error/?code=' + code;\n\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\n return 'Minified MUI error #' + code + '; visit ' + url + ' for the full message.';\n /* eslint-enable prefer-template */\n}","import ClassNameGenerator from '../ClassNameGenerator';\nconst globalStateClassesMapping = {\n active: 'Mui-active',\n checked: 'Mui-checked',\n completed: 'Mui-completed',\n disabled: 'Mui-disabled',\n error: 'Mui-error',\n expanded: 'Mui-expanded',\n focused: 'Mui-focused',\n focusVisible: 'Mui-focusVisible',\n required: 'Mui-required',\n selected: 'Mui-selected'\n};\nexport default function generateUtilityClass(componentName, slot) {\n const globalStateClass = globalStateClassesMapping[slot];\n return globalStateClass || `${ClassNameGenerator.generate(componentName)}-${slot}`;\n}","import generateUtilityClass from '../generateUtilityClass';\nexport default function generateUtilityClasses(componentName, slots) {\n const result = {};\n slots.forEach(slot => {\n result[slot] = generateUtilityClass(componentName, slot);\n });\n return result;\n}","// A change of the browser zoom change the scrollbar size.\n// Credit https://github.com/twbs/bootstrap/blob/488fd8afc535ca3a6ad4dc581f5e89217b6a36ac/js/src/util/scrollbar.js#L14-L18\nexport default function getScrollbarSize(doc) {\n // https://developer.mozilla.org/en-US/docs/Web/API/Window/innerWidth#usage_notes\n const documentWidth = doc.documentElement.clientWidth;\n return Math.abs(window.innerWidth - documentWidth);\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}","import _extends from \"@babel/runtime/helpers/esm/extends\";\n\n/**\n * Add keys, values of `defaultProps` that does not exist in `props`\n * @param {object} defaultProps\n * @param {object} props\n * @returns {object} resolved props\n */\nexport default function resolveProps(defaultProps, props) {\n const output = _extends({}, props);\n\n Object.keys(defaultProps).forEach(propName => {\n if (output[propName] === undefined) {\n output[propName] = defaultProps[propName];\n }\n });\n return output;\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}","/* eslint-disable react-hooks/rules-of-hooks, react-hooks/exhaustive-deps */\nimport * as React from 'react';\nexport default function useControlled({\n controlled,\n default: defaultProp,\n name,\n state = 'value'\n}) {\n // isControlled is ignored in the hook dependency lists as it should never change.\n const {\n current: isControlled\n } = React.useRef(controlled !== undefined);\n const [valueState, setValue] = React.useState(defaultProp);\n const value = isControlled ? controlled : valueState;\n\n if (process.env.NODE_ENV !== 'production') {\n React.useEffect(() => {\n if (isControlled !== (controlled !== undefined)) {\n console.error([`MUI: A component is changing the ${isControlled ? '' : 'un'}controlled ${state} state of ${name} to be ${isControlled ? 'un' : ''}controlled.`, 'Elements should not switch from uncontrolled to controlled (or vice versa).', `Decide between using a controlled or uncontrolled ${name} ` + 'element for the lifetime of the component.', \"The nature of the state is determined during the first render. It's considered controlled if the value is not `undefined`.\", 'More info: https://fb.me/react-controlled-components'].join('\\n'));\n }\n }, [state, name, controlled]);\n const {\n current: defaultValue\n } = React.useRef(defaultProp);\n React.useEffect(() => {\n if (!isControlled && defaultValue !== defaultProp) {\n console.error([`MUI: A component is changing the default ${state} state of an uncontrolled ${name} after being initialized. ` + `To suppress this warning opt to use a controlled ${name}.`].join('\\n'));\n }\n }, [JSON.stringify(defaultProp)]);\n }\n\n const setValueIfUncontrolled = React.useCallback(newValue => {\n if (!isControlled) {\n setValue(newValue);\n }\n }, []);\n return [value, setValueIfUncontrolled];\n}","import * as React from 'react';\nconst useEnhancedEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nexport default useEnhancedEffect;","import * as React from 'react';\nimport useEnhancedEffect from './useEnhancedEffect';\n/**\n * https://github.com/facebook/react/issues/14099#issuecomment-440013892\n */\n\nexport default function useEventCallback(fn) {\n const ref = React.useRef(fn);\n useEnhancedEffect(() => {\n ref.current = fn;\n });\n return React.useCallback((...args) => // @ts-expect-error hide `this`\n // tslint:disable-next-line:ban-comma-operator\n (0, ref.current)(...args), []);\n}","import * as React from 'react';\nimport setRef from './setRef';\nexport default function useForkRef(refA, refB) {\n /**\n * This will create a new function if the ref props change and are 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 (refA == null && refB == null) {\n return null;\n }\n\n return refValue => {\n setRef(refA, refValue);\n setRef(refB, refValue);\n };\n }, [refA, refB]);\n}","import * as React from 'react';\nlet globalId = 0;\n\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} // eslint-disable-next-line no-useless-concat -- Workaround for https://github.com/webpack/webpack/issues/14814\n\n\nconst maybeReactUseId = React['useId' + ''];\n/**\n *\n * @example \n * @param idOverride\n * @returns {string}\n */\n\nexport default function useId(idOverride) {\n if (maybeReactUseId !== undefined) {\n const reactId = maybeReactUseId();\n return idOverride != null ? idOverride : reactId;\n } // eslint-disable-next-line react-hooks/rules-of-hooks -- `React.useId` is invariant at runtime.\n\n\n return useGlobalId(idOverride);\n}","import { generateUtilityClasses, generateUtilityClass } from '@mui/material';\nexport function getDataGridUtilityClass(slot) {\n return generateUtilityClass('MuiDataGrid', slot);\n}\nexport const gridClasses = generateUtilityClasses('MuiDataGrid', ['actionsCell', 'autoHeight', 'booleanCell', 'cell--editable', 'cell--editing', 'cell--textCenter', 'cell--textLeft', 'cell--textRight', 'cell--withRenderer', 'cell', 'cellContent', 'cellCheckbox', 'checkboxInput', 'columnHeader--alignCenter', 'columnHeader--alignLeft', 'columnHeader--alignRight', 'columnHeader--dragging', 'columnHeader--moving', 'columnHeader--numeric', 'columnHeader--sortable', 'columnHeader--sorted', 'columnHeader--filtered', 'columnHeader', 'columnHeaderCheckbox', 'columnHeaderDraggableContainer', 'columnHeaderDropZone', 'columnHeaderTitle', 'columnHeaderTitleContainer', 'columnHeaderTitleContainerContent', 'columnHeaders', 'columnHeadersInner', 'columnHeadersInner--scrollable', 'columnSeparator--resizable', 'columnSeparator--resizing', 'columnSeparator--sideLeft', 'columnSeparator--sideRight', 'columnSeparator', 'columnsPanel', 'columnsPanelRow', 'detailPanel', 'detailPanels', 'detailPanelToggleCell', 'detailPanelToggleCell--expanded', 'panel', 'panelHeader', 'panelWrapper', 'panelContent', 'panelFooter', 'paper', 'editBooleanCell', 'editInputCell', 'filterForm', 'filterFormDeleteIcon', 'filterFormLinkOperatorInput', 'filterFormColumnInput', 'filterFormOperatorInput', 'filterFormValueInput', 'filterIcon', 'footerContainer', 'iconButtonContainer', 'iconSeparator', 'main', 'menu', 'menuIcon', 'menuIconButton', 'menuOpen', 'menuList', 'overlay', 'root', 'root--densityStandard', 'root--densityComfortable', 'root--densityCompact', 'row', 'row--editable', 'row--editing', 'row--lastVisible', 'row--dragging', 'rowReorderCellPlaceholder', 'rowCount', 'rowReorderCellContainer', 'rowReorderCell', 'rowReorderCell--draggable', 'scrollArea--left', 'scrollArea--right', 'scrollArea', 'selectedRowCount', 'sortIcon', 'toolbarContainer', 'toolbarFilterList', 'virtualScroller', 'virtualScrollerContent', 'virtualScrollerContent--overflowed', 'virtualScrollerRenderZone', 'pinnedColumns', 'pinnedColumns--left', 'pinnedColumns--right', 'pinnedColumnHeaders', 'pinnedColumnHeaders--left', 'pinnedColumnHeaders--right', 'withBorder', 'treeDataGroupingCell', 'treeDataGroupingCellToggle', 'groupingCriteriaCell', 'groupingCriteriaCellToggle']);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { darken, lighten, alpha, styled } from '@mui/material/styles';\nimport { gridClasses } from '../../constants/gridClasses';\nexport const GridRootStyles = styled('div', {\n name: 'MuiDataGrid',\n slot: 'Root',\n overridesResolver: (props, styles) => [{\n [`&.${gridClasses.autoHeight}`]: styles.autoHeight\n }, {\n [`& .${gridClasses.editBooleanCell}`]: styles.editBooleanCell\n }, {\n [`& .${gridClasses['cell--editing']}`]: styles['cell--editing']\n }, {\n [`& .${gridClasses['cell--textCenter']}`]: styles['cell--textCenter']\n }, {\n [`& .${gridClasses['cell--textLeft']}`]: styles['cell--textLeft']\n }, {\n [`& .${gridClasses['cell--textRight']}`]: styles['cell--textRight']\n }, // TODO v6: Remove\n {\n [`& .${gridClasses['cell--withRenderer']}`]: styles['cell--withRenderer']\n }, {\n [`& .${gridClasses.cell}`]: styles.cell\n }, {\n [`& .${gridClasses.cellContent}`]: styles.cellContent\n }, {\n [`& .${gridClasses.cellCheckbox}`]: styles.cellCheckbox\n }, {\n [`& .${gridClasses.checkboxInput}`]: styles.checkboxInput\n }, {\n [`& .${gridClasses['columnHeader--alignCenter']}`]: styles['columnHeader--alignCenter']\n }, {\n [`& .${gridClasses['columnHeader--alignLeft']}`]: styles['columnHeader--alignLeft']\n }, {\n [`& .${gridClasses['columnHeader--alignRight']}`]: styles['columnHeader--alignRight']\n }, {\n [`& .${gridClasses['columnHeader--dragging']}`]: styles['columnHeader--dragging']\n }, {\n [`& .${gridClasses['columnHeader--moving']}`]: styles['columnHeader--moving']\n }, {\n [`& .${gridClasses['columnHeader--numeric']}`]: styles['columnHeader--numeric']\n }, {\n [`& .${gridClasses['columnHeader--sortable']}`]: styles['columnHeader--sortable']\n }, {\n [`& .${gridClasses['columnHeader--sorted']}`]: styles['columnHeader--sorted']\n }, {\n [`& .${gridClasses.columnHeader}`]: styles.columnHeader\n }, {\n [`& .${gridClasses.columnHeaderCheckbox}`]: styles.columnHeaderCheckbox\n }, {\n [`& .${gridClasses.columnHeaderDraggableContainer}`]: styles.columnHeaderDraggableContainer\n }, {\n [`& .${gridClasses.columnHeaderTitleContainer}`]: styles.columnHeaderTitleContainer\n }, {\n [`& .${gridClasses['columnSeparator--resizable']}`]: styles['columnSeparator--resizable']\n }, {\n [`& .${gridClasses['columnSeparator--resizing']}`]: styles['columnSeparator--resizing']\n }, {\n [`& .${gridClasses.columnSeparator}`]: styles.columnSeparator\n }, {\n [`& .${gridClasses.filterIcon}`]: styles.filterIcon\n }, {\n [`& .${gridClasses.iconSeparator}`]: styles.iconSeparator\n }, {\n [`& .${gridClasses.menuIcon}`]: styles.menuIcon\n }, {\n [`& .${gridClasses.menuIconButton}`]: styles.menuIconButton\n }, {\n [`& .${gridClasses.menuOpen}`]: styles.menuOpen\n }, {\n [`& .${gridClasses.menuList}`]: styles.menuList\n }, {\n [`& .${gridClasses['row--editable']}`]: styles['row--editable']\n }, {\n [`& .${gridClasses['row--editing']}`]: styles['row--editing']\n }, {\n [`& .${gridClasses['row--dragging']}`]: styles['row--dragging']\n }, {\n [`& .${gridClasses.row}`]: styles.row\n }, {\n [`& .${gridClasses.rowReorderCellPlaceholder}`]: styles.rowReorderCellPlaceholder\n }, {\n [`& .${gridClasses.rowReorderCell}`]: styles.rowReorderCell\n }, {\n [`& .${gridClasses['rowReorderCell--draggable']}`]: styles['rowReorderCell--draggable']\n }, {\n [`& .${gridClasses.sortIcon}`]: styles.sortIcon\n }, {\n [`& .${gridClasses.withBorder}`]: styles.withBorder\n }, {\n [`& .${gridClasses.treeDataGroupingCell}`]: styles.treeDataGroupingCell\n }, {\n [`& .${gridClasses.treeDataGroupingCellToggle}`]: styles.treeDataGroupingCellToggle\n }, {\n [`& .${gridClasses.detailPanelToggleCell}`]: styles.detailPanelToggleCell\n }, {\n [`& .${gridClasses['detailPanelToggleCell--expanded']}`]: styles['detailPanelToggleCell--expanded']\n }, styles.root]\n})(({\n theme\n}) => {\n const borderColor = theme.palette.mode === 'light' ? lighten(alpha(theme.palette.divider, 1), 0.88) : darken(alpha(theme.palette.divider, 1), 0.68);\n\n const gridStyle = _extends({\n flex: 1,\n boxSizing: 'border-box',\n position: 'relative',\n border: `1px solid ${borderColor}`,\n borderRadius: theme.shape.borderRadius,\n color: theme.palette.text.primary\n }, theme.typography.body2, {\n outline: 'none',\n height: '100%',\n display: 'flex',\n flexDirection: 'column',\n [`&.${gridClasses.autoHeight}`]: {\n height: 'auto',\n [`& .${gridClasses['row--lastVisible']} .${gridClasses.cell}`]: {\n borderBottomColor: 'transparent'\n }\n },\n [`& .${gridClasses['virtualScrollerContent--overflowed']} .${gridClasses['row--lastVisible']} .${gridClasses.cell}`]: {\n borderBottomColor: 'transparent'\n },\n [`& .${gridClasses.columnHeader}, & .${gridClasses.cell}`]: {\n WebkitTapHighlightColor: 'transparent',\n lineHeight: null,\n padding: '0 10px',\n boxSizing: 'border-box'\n },\n [`& .${gridClasses.columnHeader}:focus-within, & .${gridClasses.cell}:focus-within`]: {\n outline: `solid ${alpha(theme.palette.primary.main, 0.5)} 1px`,\n outlineWidth: 1,\n outlineOffset: -1\n },\n [`& .${gridClasses.columnHeader}:focus, & .${gridClasses.cell}:focus`]: {\n outline: `solid ${theme.palette.primary.main} 1px`\n },\n [`& .${gridClasses.columnHeaderCheckbox}, & .${gridClasses.cellCheckbox}`]: {\n padding: 0,\n justifyContent: 'center',\n alignItems: 'center'\n },\n [`& .${gridClasses.columnHeader}`]: {\n position: 'relative',\n display: 'flex',\n alignItems: 'center'\n },\n [`& .${gridClasses['columnHeader--sorted']} .${gridClasses.iconButtonContainer}, & .${gridClasses['columnHeader--filtered']} .${gridClasses.iconButtonContainer}`]: {\n visibility: 'visible',\n width: 'auto'\n },\n [`& .${gridClasses.columnHeader}:not(.${gridClasses['columnHeader--sorted']}) .${gridClasses.sortIcon}`]: {\n opacity: 0,\n transition: theme.transitions.create(['opacity'], {\n duration: theme.transitions.duration.shorter\n })\n },\n [`& .${gridClasses.columnHeader}:not(.${gridClasses['columnHeader--sorted']}):hover .${gridClasses.sortIcon}`]: {\n opacity: 0.5\n },\n [`& .${gridClasses.columnHeaderTitleContainer}`]: {\n display: 'flex',\n alignItems: 'center',\n minWidth: 0,\n flex: 1,\n whiteSpace: 'nowrap',\n overflow: 'hidden'\n },\n [`& .${gridClasses.columnHeaderTitleContainerContent}`]: {\n overflow: 'hidden',\n display: 'flex',\n alignItems: 'center'\n },\n [`& .${gridClasses.sortIcon}, & .${gridClasses.filterIcon}`]: {\n fontSize: 'inherit'\n },\n [`& .${gridClasses['columnHeader--sortable']}`]: {\n cursor: 'pointer'\n },\n [`& .${gridClasses['columnHeader--alignCenter']} .${gridClasses.columnHeaderTitleContainer}`]: {\n justifyContent: 'center'\n },\n [`& .${gridClasses['columnHeader--alignRight']} .${gridClasses.columnHeaderDraggableContainer}, & .${gridClasses['columnHeader--alignRight']} .${gridClasses.columnHeaderTitleContainer}`]: {\n flexDirection: 'row-reverse'\n },\n [`& .${gridClasses['columnHeader--alignCenter']} .${gridClasses.menuIcon}, & .${gridClasses['columnHeader--alignRight']} .${gridClasses.menuIcon}`]: {\n marginRight: 'auto',\n marginLeft: -6\n },\n [`& .${gridClasses['columnHeader--alignRight']} .${gridClasses.menuIcon}, & .${gridClasses['columnHeader--alignRight']} .${gridClasses.menuIcon}`]: {\n marginRight: 'auto',\n marginLeft: -10\n },\n [`& .${gridClasses['columnHeader--moving']}`]: {\n backgroundColor: theme.palette.action.hover\n },\n [`& .${gridClasses.columnSeparator}`]: {\n position: 'absolute',\n zIndex: 100,\n display: 'flex',\n flexDirection: 'column',\n justifyContent: 'center',\n color: borderColor\n },\n [`& .${gridClasses['columnSeparator--sideLeft']}`]: {\n left: -12\n },\n [`& .${gridClasses['columnSeparator--sideRight']}`]: {\n right: -12\n },\n [`& .${gridClasses['columnSeparator--resizable']}`]: {\n cursor: 'col-resize',\n touchAction: 'none',\n '&:hover': {\n color: theme.palette.text.primary,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n color: borderColor\n }\n },\n [`&.${gridClasses['columnSeparator--resizing']}`]: {\n color: theme.palette.text.primary\n }\n },\n [`& .${gridClasses.iconSeparator}`]: {\n color: 'inherit'\n },\n [`& .${gridClasses.menuIcon}`]: {\n width: 0,\n visibility: 'hidden',\n fontSize: 20,\n marginRight: -10,\n display: 'flex',\n alignItems: 'center'\n },\n [`& .${gridClasses.columnHeader}:hover`]: {\n [`& .${gridClasses.iconButtonContainer}`]: {\n visibility: 'visible',\n width: 'auto'\n },\n [`& .${gridClasses.menuIcon}`]: {\n width: 'auto',\n visibility: 'visible'\n }\n },\n [`.${gridClasses.menuOpen}`]: {\n visibility: 'visible',\n width: 'auto'\n },\n [`& .${gridClasses.row}`]: {\n display: 'flex',\n width: 'fit-content',\n breakInside: 'avoid',\n // Avoid the row to be broken in two different print pages.\n '&:hover, &.Mui-hovered': {\n backgroundColor: theme.palette.action.hover,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n },\n '&.Mui-selected': {\n backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),\n '&:hover, &.Mui-hovered': {\n backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity)\n }\n }\n }\n },\n [`& .${gridClasses.cell}`]: {\n display: 'flex',\n alignItems: 'center',\n overflow: 'hidden',\n whiteSpace: 'nowrap',\n borderBottom: `1px solid ${borderColor}`\n },\n [`& .${gridClasses.cellContent}`]: {\n overflow: 'hidden',\n textOverflow: 'ellipsis'\n },\n [`& .${gridClasses.cell}.${gridClasses['cell--editing']}`]: {\n padding: 1,\n display: 'flex',\n boxShadow: theme.shadows[2],\n backgroundColor: theme.palette.background.paper,\n '&:focus-within': {\n outline: `solid ${theme.palette.primary.main} 1px`,\n outlineOffset: '-1px'\n }\n },\n [`& .${gridClasses['row--editing']}`]: {\n boxShadow: theme.shadows[2]\n },\n [`& .${gridClasses['row--editing']} .${gridClasses.cell}`]: {\n boxShadow: theme.shadows[0],\n backgroundColor: theme.palette.background.paper\n },\n [`& .${gridClasses.editBooleanCell}`]: {\n display: 'flex',\n height: '100%',\n width: '100%',\n alignItems: 'center',\n justifyContent: 'center'\n },\n [`& .${gridClasses.booleanCell}[data-value=\"true\"]`]: {\n color: theme.palette.text.secondary\n },\n [`& .${gridClasses.booleanCell}[data-value=\"false\"]`]: {\n color: theme.palette.text.disabled\n },\n [`& .${gridClasses.actionsCell}`]: {\n display: 'inline-flex',\n alignItems: 'center',\n gridGap: theme.spacing(1)\n },\n [`& .${gridClasses.rowReorderCell}`]: {\n display: 'inline-flex',\n flex: 1,\n alignItems: 'center',\n justifyContent: 'center',\n opacity: theme.palette.action.disabledOpacity\n },\n [`& .${gridClasses['rowReorderCell--draggable']}`]: {\n cursor: 'move',\n opacity: 1\n },\n [`& .${gridClasses.rowReorderCellContainer}`]: {\n padding: 0,\n alignItems: 'stretch'\n },\n [`& .${gridClasses.withBorder}`]: {\n borderRight: `1px solid ${borderColor}`\n },\n [`& .${gridClasses['cell--textLeft']}`]: {\n justifyContent: 'flex-start'\n },\n [`& .${gridClasses['cell--textRight']}`]: {\n justifyContent: 'flex-end'\n },\n [`& .${gridClasses['cell--textCenter']}`]: {\n justifyContent: 'center'\n },\n [`& .${gridClasses.columnHeaderDraggableContainer}`]: {\n display: 'flex',\n width: '100%'\n },\n [`& .${gridClasses.rowReorderCellPlaceholder}`]: {\n display: 'none'\n },\n [`& .${gridClasses['columnHeader--dragging']}, & .${gridClasses['row--dragging']}`]: {\n background: theme.palette.background.paper,\n padding: '0 12px',\n borderRadius: theme.shape.borderRadius,\n opacity: theme.palette.action.disabledOpacity\n },\n [`& .${gridClasses['row--dragging']}`]: {\n background: theme.palette.background.paper,\n padding: '0 12px',\n borderRadius: theme.shape.borderRadius,\n opacity: theme.palette.action.disabledOpacity,\n [`& .${gridClasses.rowReorderCellPlaceholder}`]: {\n display: 'flex'\n }\n },\n [`& .${gridClasses.treeDataGroupingCell}`]: {\n display: 'flex',\n alignItems: 'center',\n width: '100%'\n },\n [`& .${gridClasses.treeDataGroupingCellToggle}`]: {\n flex: '0 0 28px',\n alignSelf: 'stretch',\n marginRight: theme.spacing(2)\n },\n [`& .${gridClasses.groupingCriteriaCell}`]: {\n display: 'flex',\n alignItems: 'center',\n width: '100%'\n },\n [`& .${gridClasses.groupingCriteriaCellToggle}`]: {\n flex: '0 0 28px',\n alignSelf: 'stretch',\n marginRight: theme.spacing(2)\n }\n });\n\n return gridStyle;\n});","// Cache implementation based on Erik Rasmussen's `lru-memoize`:\n// https://github.com/erikras/lru-memoize\nvar NOT_FOUND = 'NOT_FOUND';\n\nfunction createSingletonCache(equals) {\n var entry;\n return {\n get: function get(key) {\n if (entry && equals(entry.key, key)) {\n return entry.value;\n }\n\n return NOT_FOUND;\n },\n put: function put(key, value) {\n entry = {\n key: key,\n value: value\n };\n },\n getEntries: function getEntries() {\n return entry ? [entry] : [];\n },\n clear: function clear() {\n entry = undefined;\n }\n };\n}\n\nfunction createLruCache(maxSize, equals) {\n var entries = [];\n\n function get(key) {\n var cacheIndex = entries.findIndex(function (entry) {\n return equals(key, entry.key);\n }); // We found a cached entry\n\n if (cacheIndex > -1) {\n var entry = entries[cacheIndex]; // Cached entry not at top of cache, move it to the top\n\n if (cacheIndex > 0) {\n entries.splice(cacheIndex, 1);\n entries.unshift(entry);\n }\n\n return entry.value;\n } // No entry found in cache, return sentinel\n\n\n return NOT_FOUND;\n }\n\n function put(key, value) {\n if (get(key) === NOT_FOUND) {\n // TODO Is unshift slow?\n entries.unshift({\n key: key,\n value: value\n });\n\n if (entries.length > maxSize) {\n entries.pop();\n }\n }\n }\n\n function getEntries() {\n return entries;\n }\n\n function clear() {\n entries = [];\n }\n\n return {\n get: get,\n put: put,\n getEntries: getEntries,\n clear: clear\n };\n}\n\nexport var defaultEqualityCheck = function defaultEqualityCheck(a, b) {\n return a === b;\n};\nexport function createCacheKeyComparator(equalityCheck) {\n return function areArgumentsShallowlyEqual(prev, next) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n } // Do this in a for loop (and not a `forEach` or an `every`) so we can determine equality as fast as possible.\n\n\n var length = prev.length;\n\n for (var i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n\n return true;\n };\n}\n// defaultMemoize now supports a configurable cache size with LRU behavior,\n// and optional comparison of the result value with existing values\nexport function defaultMemoize(func, equalityCheckOrOptions) {\n var providedOptions = typeof equalityCheckOrOptions === 'object' ? equalityCheckOrOptions : {\n equalityCheck: equalityCheckOrOptions\n };\n var _providedOptions$equa = providedOptions.equalityCheck,\n equalityCheck = _providedOptions$equa === void 0 ? defaultEqualityCheck : _providedOptions$equa,\n _providedOptions$maxS = providedOptions.maxSize,\n maxSize = _providedOptions$maxS === void 0 ? 1 : _providedOptions$maxS,\n resultEqualityCheck = providedOptions.resultEqualityCheck;\n var comparator = createCacheKeyComparator(equalityCheck);\n var cache = maxSize === 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator); // we reference arguments instead of spreading them for performance reasons\n\n function memoized() {\n var value = cache.get(arguments);\n\n if (value === NOT_FOUND) {\n // @ts-ignore\n value = func.apply(null, arguments);\n\n if (resultEqualityCheck) {\n var entries = cache.getEntries();\n var matchingEntry = entries.find(function (entry) {\n return resultEqualityCheck(entry.value, value);\n });\n\n if (matchingEntry) {\n value = matchingEntry.value;\n }\n }\n\n cache.put(arguments, value);\n }\n\n return value;\n }\n\n memoized.clearCache = function () {\n return cache.clear();\n };\n\n return memoized;\n}","import { defaultMemoize, defaultEqualityCheck } from './defaultMemoize';\nexport { defaultMemoize, defaultEqualityCheck };\n\nfunction getDependencies(funcs) {\n var dependencies = Array.isArray(funcs[0]) ? funcs[0] : funcs;\n\n if (!dependencies.every(function (dep) {\n return typeof dep === 'function';\n })) {\n var dependencyTypes = dependencies.map(function (dep) {\n return typeof dep === 'function' ? \"function \" + (dep.name || 'unnamed') + \"()\" : typeof dep;\n }).join(', ');\n throw new Error(\"createSelector expects all input-selectors to be functions, but received the following types: [\" + dependencyTypes + \"]\");\n }\n\n return dependencies;\n}\n\nexport function createSelectorCreator(memoize) {\n for (var _len = arguments.length, memoizeOptionsFromArgs = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n memoizeOptionsFromArgs[_key - 1] = arguments[_key];\n }\n\n var createSelector = function createSelector() {\n for (var _len2 = arguments.length, funcs = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n funcs[_key2] = arguments[_key2];\n }\n\n var _recomputations = 0;\n\n var _lastResult; // Due to the intricacies of rest params, we can't do an optional arg after `...funcs`.\n // So, start by declaring the default value here.\n // (And yes, the words 'memoize' and 'options' appear too many times in this next sequence.)\n\n\n var directlyPassedOptions = {\n memoizeOptions: undefined\n }; // Normally, the result func or \"output selector\" is the last arg\n\n var resultFunc = funcs.pop(); // If the result func is actually an _object_, assume it's our options object\n\n if (typeof resultFunc === 'object') {\n directlyPassedOptions = resultFunc; // and pop the real result func off\n\n resultFunc = funcs.pop();\n }\n\n if (typeof resultFunc !== 'function') {\n throw new Error(\"createSelector expects an output function after the inputs, but received: [\" + typeof resultFunc + \"]\");\n } // Determine which set of options we're using. Prefer options passed directly,\n // but fall back to options given to createSelectorCreator.\n\n\n var _directlyPassedOption = directlyPassedOptions,\n _directlyPassedOption2 = _directlyPassedOption.memoizeOptions,\n memoizeOptions = _directlyPassedOption2 === void 0 ? memoizeOptionsFromArgs : _directlyPassedOption2; // Simplifying assumption: it's unlikely that the first options arg of the provided memoizer\n // is an array. In most libs I've looked at, it's an equality function or options object.\n // Based on that, if `memoizeOptions` _is_ an array, we assume it's a full\n // user-provided array of options. Otherwise, it must be just the _first_ arg, and so\n // we wrap it in an array so we can apply it.\n\n var finalMemoizeOptions = Array.isArray(memoizeOptions) ? memoizeOptions : [memoizeOptions];\n var dependencies = getDependencies(funcs);\n var memoizedResultFunc = memoize.apply(void 0, [function () {\n _recomputations++; // apply arguments instead of spreading for performance.\n\n return resultFunc.apply(null, arguments);\n }].concat(finalMemoizeOptions)); // If a selector is called with the exact same arguments we don't need to traverse our dependencies again.\n\n var selector = memoize(function () {\n var params = [];\n var length = dependencies.length;\n\n for (var i = 0; i < length; i++) {\n // apply arguments instead of spreading and mutate a local list of params for performance.\n // @ts-ignore\n params.push(dependencies[i].apply(null, arguments));\n } // apply arguments instead of spreading for performance.\n\n\n _lastResult = memoizedResultFunc.apply(null, params);\n return _lastResult;\n });\n Object.assign(selector, {\n resultFunc: resultFunc,\n memoizedResultFunc: memoizedResultFunc,\n dependencies: dependencies,\n lastResult: function lastResult() {\n return _lastResult;\n },\n recomputations: function recomputations() {\n return _recomputations;\n },\n resetRecomputations: function resetRecomputations() {\n return _recomputations = 0;\n }\n });\n return selector;\n }; // @ts-ignore\n\n\n return createSelector;\n}\nexport var createSelector = /* #__PURE__ */createSelectorCreator(defaultMemoize);\n// Manual definition of state and output arguments\nexport var createStructuredSelector = function createStructuredSelector(selectors, selectorCreator) {\n if (selectorCreator === void 0) {\n selectorCreator = createSelector;\n }\n\n if (typeof selectors !== 'object') {\n throw new Error('createStructuredSelector expects first argument to be an object ' + (\"where each property is a selector, instead received a \" + typeof selectors));\n }\n\n var objectKeys = Object.keys(selectors);\n var resultSelector = selectorCreator( // @ts-ignore\n objectKeys.map(function (key) {\n return selectors[key];\n }), function () {\n for (var _len3 = arguments.length, values = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n values[_key3] = arguments[_key3];\n }\n\n return values.reduce(function (composition, value, index) {\n composition[objectKeys[index]] = value;\n return composition;\n }, {});\n });\n return resultSelector;\n};","export const buildWarning = (message, gravity = 'warning') => {\n let alreadyWarned = false;\n const cleanMessage = Array.isArray(message) ? message.join('\\n') : message;\n return () => {\n if (!alreadyWarned) {\n alreadyWarned = true;\n\n if (gravity === 'error') {\n console.error(cleanMessage);\n } else {\n console.warn(cleanMessage);\n }\n }\n };\n};\nexport const wrapWithWarningOnCall = (method, message) => {\n if (process.env.NODE_ENV === 'production') {\n return method;\n }\n\n const warning = buildWarning(message);\n return (...args) => {\n warning();\n return method(...args);\n };\n};","import { createSelector as reselectCreateSelector } from 'reselect';\nimport { buildWarning } from './warning';\nconst cacheContainer = {\n cache: null\n};\nconst missingInstanceIdWarning = buildWarning(['MUI: A selector was called without passing the instance ID, which may impact the performance of the grid.', 'To fix, call it with `apiRef`, e.g. `mySelector(apiRef)`, or pass the instance ID explicitly, e.g `mySelector(state, apiRef.current.instanceId)`.']);\nexport const createSelector = (...args) => {\n if (cacheContainer.cache === null) {\n cacheContainer.cache = {};\n }\n\n const selector = (...selectorArgs) => {\n const [stateOrApiRef, instanceId] = selectorArgs;\n const isApiRef = !!stateOrApiRef.current;\n const cacheKey = isApiRef ? stateOrApiRef.current.instanceId : instanceId != null ? instanceId : 'default';\n const state = isApiRef ? stateOrApiRef.current.state : stateOrApiRef;\n\n if (process.env.NODE_ENV !== 'production') {\n if (cacheKey === 'default') {\n missingInstanceIdWarning();\n }\n }\n\n if (cacheContainer.cache === null) {\n cacheContainer.cache = {};\n }\n\n const {\n cache\n } = cacheContainer;\n\n if (cache[cacheKey] && cache[cacheKey].get(args)) {\n // We pass the cache key because the called selector might have as\n // dependency another selector created with this `createSelector`.\n return cache[cacheKey].get(args)(state, cacheKey);\n }\n\n const newSelector = reselectCreateSelector(...args);\n\n if (!cache[cacheKey]) {\n cache[cacheKey] = new Map();\n }\n\n cache[cacheKey].set(args, newSelector);\n return newSelector(state, cacheKey);\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\n\n selector.acceptsApiRef = true;\n return selector;\n}; // eslint-disable-next-line @typescript-eslint/naming-convention\n\nexport const unstable_resetCreateSelectorCache = () => {\n cacheContainer.cache = null;\n};","import { createSelector } from '../../../utils/createSelector';\nimport { wrapWithWarningOnCall } from '../../../utils/warning';\n/**\n * @category Columns\n * @deprecated Use the selector returning exactly the value you are looking for.\n * @ignore - do not document.\n * TODO v6: Rename `gridColumnsStateSelector`\n */\n\nexport const gridColumnsSelector = state => state.columns;\n/**\n * Get the field of each column.\n * @category Columns\n */\n\nexport const gridColumnFieldsSelector = createSelector(gridColumnsSelector, columnsState => columnsState.all);\n/**\n * Get the columns as a lookup (an object containing the field for keys and the definition for values).\n * @category Columns\n */\n\nexport const gridColumnLookupSelector = createSelector(gridColumnsSelector, columnsState => columnsState.lookup);\n/**\n * Get the columns as an array.\n * @category Columns\n */\n\nexport const gridColumnDefinitionsSelector = createSelector(gridColumnFieldsSelector, gridColumnLookupSelector, (allFields, lookup) => allFields.map(field => lookup[field]));\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 */\n\nexport const gridColumnVisibilityModelSelector = createSelector(gridColumnsSelector, columnsState => columnsState.columnVisibilityModel);\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 */\n\nexport const gridVisibleColumnDefinitionsSelector = createSelector(gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector, (columns, columnVisibilityModel) => columns.filter(column => columnVisibilityModel[column.field] !== false));\n/**\n * Get the field of each visible column.\n * @category Visible Columns\n */\n\nexport const gridVisibleColumnFieldsSelector = createSelector(gridVisibleColumnDefinitionsSelector, visibleColumns => visibleColumns.map(column => column.field));\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 */\n\nexport const gridColumnPositionsSelector = createSelector(gridVisibleColumnDefinitionsSelector, visibleColumns => {\n const positions = [];\n let currentPosition = 0;\n\n for (let i = 0; i < visibleColumns.length; i += 1) {\n positions.push(currentPosition);\n currentPosition += visibleColumns[i].computedWidth;\n }\n\n return positions;\n});\n/**\n * Get the summed width of all the visible columns.\n * @category Visible Columns\n */\n\nexport const gridColumnsTotalWidthSelector = createSelector(gridVisibleColumnDefinitionsSelector, gridColumnPositionsSelector, (visibleColumns, positions) => {\n const colCount = visibleColumns.length;\n\n if (colCount === 0) {\n return 0;\n }\n\n return positions[colCount - 1] + visibleColumns[colCount - 1].computedWidth;\n});\n/**\n * Get the filterable columns as an array.\n * @category Columns\n */\n\nexport const gridFilterableColumnDefinitionsSelector = createSelector(gridColumnDefinitionsSelector, columns => columns.filter(col => col.filterable));\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 */\n\nexport const gridFilterableColumnLookupSelector = createSelector(gridColumnDefinitionsSelector, columns => columns.reduce((acc, col) => {\n if (col.filterable) {\n acc[col.field] = col;\n }\n\n return acc;\n}, {}));\n/**\n * @category Columns\n * @deprecated Use `gridColumnFieldsSelector` instead.\n * @ignore - do not document.\n */\n\nexport const allGridColumnsFieldsSelector = wrapWithWarningOnCall(gridColumnFieldsSelector, ['MUI: The method allGridColumnsFieldsSelector is deprecated and will be removed in the next major version.', 'Use gridColumnFieldsSelector instead']);\n/**\n * @category Columns\n * @deprecated Use `gridColumnDefinitionsSelector` instead.\n * @ignore - do not document.\n */\n\nexport const allGridColumnsSelector = wrapWithWarningOnCall(gridColumnDefinitionsSelector, ['MUI: The method allGridColumnsSelector is deprecated and will be removed in the next major version.', 'Use gridColumnDefinitionsSelector instead']);\n/**\n * @category Visible Columns\n * @deprecated Use `gridVisibleColumnDefinitionsSelector` instead.\n * @ignore - do not document.\n */\n\nexport const visibleGridColumnsSelector = wrapWithWarningOnCall(gridVisibleColumnDefinitionsSelector, ['MUI: The method visibleGridColumnsSelector is deprecated and will be removed in the next major version.', 'Use gridVisibleColumnDefinitionsSelector instead']);\n/**\n * @category Columns\n * @deprecated Use `gridFilterableColumnDefinitionsSelector` instead.\n * @ignore - do not document.\n */\n\nexport const filterableGridColumnsSelector = wrapWithWarningOnCall(gridFilterableColumnDefinitionsSelector, ['MUI: The method filterableGridColumnsSelector is deprecated and will be removed in the next major version.', 'Use gridFilterableColumnDefinitionsSelector instead']);\n/**\n * @category Columns\n * @deprecated Use `gridFilterableColumnLookupSelector` instead (not the same return format).\n * @ignore - do not document.\n */\n\nexport const filterableGridColumnsIdsSelector = wrapWithWarningOnCall(createSelector(gridFilterableColumnDefinitionsSelector, columns => columns.map(col => col.field)), ['MUI: The method filterableGridColumnsIdsSelector is deprecated and will be removed in the next major version.', 'Use gridFilterableColumnDefinitionsSelector instead.', 'The return format is now a lookup, if you want to get the same output as before, use the following code:', '', 'const lookup = gridFilterableColumnLookupSelector(apiRef);', 'const fields = gridColumnFieldsSelector(apiRef).filter(field => lookup[field]);']);\n/**\n * Get the amount of visible columns.\n * @category Visible Columns\n * @deprecated Use the length of the array returned by `gridVisibleColumnDefinitionsSelector` instead.\n * @ignore - do not document.\n */\n\nexport const visibleGridColumnsLengthSelector = wrapWithWarningOnCall(createSelector(gridVisibleColumnDefinitionsSelector, visibleColumns => visibleColumns.length), ['MUI: The method visibleGridColumnsLengthSelector is deprecated and will be removed in the next major version.', 'Use the length of the array returned by gridVisibleColumnDefinitionsSelector instead.']);\n/**\n * @category Visible Columns\n * @deprecated Use `gridColumnsTotalWidthSelector` or `gridColumnPositionsSelector` instead.\n * @ignore - do not document.\n */\n\nexport const gridColumnsMetaSelector = wrapWithWarningOnCall(createSelector(gridColumnPositionsSelector, gridColumnsTotalWidthSelector, (positions, totalWidth) => ({\n totalWidth,\n positions\n})), ['MUI: The method gridColumnsMetaSelector is deprecated and will be removed in the next major version.', 'Use gridColumnsTotalWidthSelector or gridColumnPositionsSelector instead']);","import { buildWarning } from '../../utils/warning';\n\nfunction isOutputSelector(selector) {\n return selector.acceptsApiRef;\n}\n\nconst stateNotInitializedWarning = buildWarning(['MUI: `useGridSelector` has been called before the initialization of the state.', 'This hook can only be used inside the context of the grid.']);\nexport const useGridSelector = (apiRef, selector) => {\n if (process.env.NODE_ENV !== 'production') {\n if (!apiRef.current.state) {\n stateNotInitializedWarning();\n }\n }\n\n if (isOutputSelector(selector)) {\n return selector(apiRef);\n }\n\n return selector(apiRef.current.state);\n};","import * as React from 'react';\nexport const GridApiContext = /*#__PURE__*/React.createContext(undefined);\n\nif (process.env.NODE_ENV !== 'production') {\n GridApiContext.displayName = 'GridApiContext';\n}","import * as React from 'react';\nimport { GridApiContext } from '../../components/GridApiContext';\nexport function useGridApiContext() {\n const apiRef = React.useContext(GridApiContext);\n\n if (apiRef === undefined) {\n throw new Error(['MUI: Could not find the data grid context.', 'It looks like you rendered your component outside of a DataGrid or DataGridPro parent component.', 'This can also happen if you are bundling multiple versions of the data grid.'].join('\\n'));\n }\n\n return apiRef;\n}","import * as React from 'react';\nconst GridRootPropsContext = /*#__PURE__*/React.createContext(undefined);\n\nif (process.env.NODE_ENV !== 'production') {\n GridRootPropsContext.displayName = 'GridRootPropsContext';\n}\n\nexport { GridRootPropsContext };","import * as React from 'react';\nimport { GridRootPropsContext } from '../../context/GridRootPropsContext';\nexport const useGridRootProps = () => {\n const contextValue = React.useContext(GridRootPropsContext);\n\n if (!contextValue) {\n throw new Error('MUI: useGridRootProps should only be used inside the DataGrid/DataGridPro component.');\n }\n\n return contextValue;\n};","import { createSelector } from '../../../utils/createSelector';\nexport const 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);\nexport const gridRowsLookupSelector = createSelector(gridRowsStateSelector, rows => rows.idRowsLookup);\nexport const gridRowsIdToIdLookupSelector = createSelector(gridRowsStateSelector, rows => rows.idToIdLookup);\nexport const gridRowTreeSelector = createSelector(gridRowsStateSelector, rows => rows.tree);\nexport const gridRowGroupingNameSelector = createSelector(gridRowsStateSelector, rows => rows.groupingName);\nexport const gridRowTreeDepthSelector = createSelector(gridRowsStateSelector, rows => rows.treeDepth);\nexport const gridRowIdsSelector = createSelector(gridRowsStateSelector, rows => rows.ids);","import { createSelector } from '../../../utils/createSelector';\nexport const gridDensitySelector = state => state.density;\nexport const gridDensityValueSelector = createSelector(gridDensitySelector, density => density.value);\nexport const gridDensityRowHeightSelector = createSelector(gridDensitySelector, density => density.rowHeight);\nexport const gridDensityHeaderHeightSelector = createSelector(gridDensitySelector, density => density.headerHeight);\nexport const gridDensityFactorSelector = createSelector(gridDensitySelector, density => density.factor);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"className\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { useForkRef, unstable_useEnhancedEffect as useEnhancedEffect, capitalize } from '@mui/material/utils';\nimport { unstable_composeClasses as composeClasses } from '@mui/material';\nimport { GridRootStyles } from './GridRootStyles';\nimport { gridVisibleColumnDefinitionsSelector } from '../../hooks/features/columns/gridColumnsSelector';\nimport { useGridSelector } from '../../hooks/utils/useGridSelector';\nimport { useGridApiContext } from '../../hooks/utils/useGridApiContext';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { gridRowCountSelector } from '../../hooks/features/rows/gridRowsSelector';\nimport { gridDensityValueSelector } from '../../hooks/features/density/densitySelector';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n autoHeight,\n density,\n classes\n } = ownerState;\n const slots = {\n root: ['root', autoHeight && 'autoHeight', `root--density${capitalize(density)}`]\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\n\nconst GridRoot = /*#__PURE__*/React.forwardRef(function GridRoot(props, ref) {\n const rootProps = useGridRootProps();\n\n const {\n children,\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const apiRef = useGridApiContext();\n const visibleColumns = useGridSelector(apiRef, gridVisibleColumnDefinitionsSelector);\n const totalRowCount = useGridSelector(apiRef, gridRowCountSelector);\n const densityValue = useGridSelector(apiRef, gridDensityValueSelector);\n const rootContainerRef = React.useRef(null);\n const handleRef = useForkRef(rootContainerRef, ref);\n const ownerState = {\n density: densityValue,\n classes: rootProps.classes,\n autoHeight: rootProps.autoHeight\n };\n const classes = useUtilityClasses(ownerState);\n apiRef.current.rootElementRef = rootContainerRef; // Our implementation of \n\n const [mountedState, setMountedState] = React.useState(false);\n useEnhancedEffect(() => {\n setMountedState(true);\n }, []);\n useEnhancedEffect(() => {\n if (mountedState) {\n apiRef.current.unstable_updateGridDimensionsRef();\n }\n }, [apiRef, mountedState]);\n\n if (!mountedState) {\n return null;\n }\n\n return /*#__PURE__*/_jsx(GridRootStyles, _extends({\n ref: handleRef,\n className: clsx(className, classes.root),\n role: \"grid\",\n \"aria-colcount\": visibleColumns.length,\n \"aria-rowcount\": totalRowCount,\n \"aria-multiselectable\": !rootProps.disableMultipleSelection,\n \"aria-label\": rootProps['aria-label'],\n \"aria-labelledby\": rootProps['aria-labelledby']\n }, other, {\n children: children\n }));\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\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 * as React from 'react';\nexport function useGridLogger(apiRef, name) {\n const logger = React.useRef(null);\n\n if (logger.current) {\n return logger.current;\n }\n\n const newLogger = apiRef.current.getLogger(name);\n logger.current = newLogger;\n return newLogger;\n}","import * as React from 'react';\nimport { unstable_composeClasses as composeClasses } from '@mui/material';\nimport { styled } from '@mui/material/styles';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['main']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\n\nconst GridMainContainerRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'Main',\n overridesResolver: (props, styles) => styles.main\n})(() => ({\n position: 'relative',\n flexGrow: 1,\n display: 'flex',\n flexDirection: 'column',\n overflow: 'hidden'\n}));\nexport function GridMainContainer(props) {\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes\n };\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(GridMainContainerRoot, {\n className: classes.root,\n children: props.children\n });\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n}","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n return assertThisInitialized(self);\n}","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nimport possibleConstructorReturn from \"./possibleConstructorReturn.js\";\nexport default function _createSuper(Derived) {\n var hasNativeReflectConstruct = isNativeReflectConstruct();\n return function _createSuperInternal() {\n var Super = getPrototypeOf(Derived),\n result;\n if (hasNativeReflectConstruct) {\n var NewTarget = getPrototypeOf(this).constructor;\n result = Reflect.construct(Super, arguments, NewTarget);\n } else {\n result = Super.apply(this, arguments);\n }\n return possibleConstructorReturn(this, result);\n };\n}","export default function _isNativeReflectConstruct() {\n if (typeof Reflect === \"undefined\" || !Reflect.construct) return false;\n if (Reflect.construct.sham) return false;\n if (typeof Proxy === \"function\") return true;\n try {\n Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n return true;\n } catch (e) {\n return false;\n }\n}","import * as React from 'react';\nexport class ErrorBoundary extends React.Component {\n static getDerivedStateFromError(error) {\n // Update state so the next render will show the fallback UI.\n return {\n hasError: true,\n error\n };\n }\n\n componentDidCatch(error, errorInfo) {\n if (this.props.api.current) {\n this.logError(error); // Allows to trigger the Error event and all listener can run on Error\n\n this.props.api.current.showError({\n error,\n errorInfo\n });\n }\n }\n\n logError(error, errorInfo) {\n this.props.logger.error(`An unexpected error occurred. Error: ${error && error.message}. `, error, errorInfo);\n }\n\n render() {\n var _this$state;\n\n if (this.props.hasError || (_this$state = this.state) != null && _this$state.hasError) {\n // You can render any custom fallback UI\n return this.props.render(this.props.componentProps || this.state);\n }\n\n return this.props.children;\n }\n\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGridApiContext } from '../../hooks/utils/useGridApiContext';\nimport { useGridLogger } from '../../hooks/utils/useGridLogger';\nimport { GridMainContainer } from '../containers/GridMainContainer';\nimport { ErrorBoundary } from '../ErrorBoundary';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nfunction GridErrorHandler(props) {\n const {\n children\n } = props;\n const apiRef = useGridApiContext();\n const logger = useGridLogger(apiRef, 'GridErrorHandler');\n const rootProps = useGridRootProps();\n const error = apiRef.current.state.error;\n return /*#__PURE__*/_jsx(ErrorBoundary, {\n hasError: error != null,\n componentProps: error,\n api: apiRef,\n logger: logger,\n render: errorProps => {\n var _rootProps$components;\n\n return /*#__PURE__*/_jsx(GridMainContainer, {\n children: /*#__PURE__*/_jsx(rootProps.components.ErrorOverlay, _extends({}, errorProps, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.errorOverlay))\n });\n },\n children: children\n });\n}\n\nprocess.env.NODE_ENV !== \"production\" ? GridErrorHandler.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n children: PropTypes.node\n} : void 0;\nexport { GridErrorHandler };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridApiContext } from '../../hooks/utils/useGridApiContext';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function GridHeaderPlaceholder() {\n var _rootProps$components;\n\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const headerRef = React.useRef(null);\n apiRef.current.headerRef = headerRef;\n return /*#__PURE__*/_jsx(\"div\", {\n ref: headerRef,\n children: /*#__PURE__*/_jsx(rootProps.components.Header, _extends({}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.header))\n });\n}","/**\n * Detect Element Resize.\n * https://github.com/sdecima/javascript-detect-element-resize\n * Sebastian Decima\n *\n * Forked from version 0.5.3; includes the following modifications:\n * 1) Guard against unsafe 'window' and 'document' references (to support SSR).\n * 2) Defer initialization code via a top-level function wrapper (to support SSR).\n * 3) Avoid unnecessary reflows by not measuring size for scroll events bubbling from children.\n * 4) Add nonce for style element.\n *\n * TODO replace with https://developer.mozilla.org/en-US/docs/Web/API/ResizeObserver\n * once browser support allows it.\n **/\nexport default function createDetectElementResize(nonce, hostWindow) {\n var resetTriggers = function resetTriggers(element) {\n var triggers = element.__resizeTriggers__,\n expand = triggers.firstElementChild,\n contract = triggers.lastElementChild,\n expandChild = expand.firstElementChild;\n contract.scrollLeft = contract.scrollWidth;\n contract.scrollTop = contract.scrollHeight;\n expandChild.style.width = expand.offsetWidth + 1 + 'px';\n expandChild.style.height = expand.offsetHeight + 1 + 'px';\n expand.scrollLeft = expand.scrollWidth;\n expand.scrollTop = expand.scrollHeight;\n };\n\n var checkTriggers = function checkTriggers(element) {\n return element.offsetWidth != element.__resizeLast__.width || element.offsetHeight != element.__resizeLast__.height;\n };\n\n var scrollListener = function scrollListener(e) {\n // Don't measure (which forces) reflow for scrolls that happen inside of children!\n if (e.target.className.indexOf('contract-trigger') < 0 && e.target.className.indexOf('expand-trigger') < 0) {\n return;\n }\n\n var element = this;\n resetTriggers(this);\n\n if (this.__resizeRAF__) {\n hostWindow.cancelAnimationFrame(this.__resizeRAF__);\n }\n\n this.__resizeRAF__ = hostWindow.requestAnimationFrame(function () {\n if (checkTriggers(element)) {\n element.__resizeLast__.width = element.offsetWidth;\n element.__resizeLast__.height = element.offsetHeight;\n\n element.__resizeListeners__.forEach(function (fn) {\n fn.call(element, e);\n });\n }\n });\n };\n /* Detect CSS Animations support to detect element display/re-attach */\n\n\n var animation = false,\n keyframeprefix = '',\n animationstartevent = 'animationstart',\n domPrefixes = 'Webkit Moz O ms'.split(' '),\n startEvents = 'webkitAnimationStart animationstart oAnimationStart MSAnimationStart'.split(' '),\n pfx = '';\n {\n var elm = document.createElement('fakeelement');\n\n if (elm.style.animationName !== undefined) {\n animation = true;\n }\n\n if (animation === false) {\n for (var i = 0; i < domPrefixes.length; i++) {\n if (elm.style[domPrefixes[i] + 'AnimationName'] !== undefined) {\n pfx = domPrefixes[i];\n keyframeprefix = '-' + pfx.toLowerCase() + '-';\n animationstartevent = startEvents[i];\n animation = true;\n break;\n }\n }\n }\n }\n var animationName = 'resizeanim';\n var animationKeyframes = '@' + keyframeprefix + 'keyframes ' + animationName + ' { from { opacity: 0; } to { opacity: 0; } } ';\n var animationStyle = keyframeprefix + 'animation: 1ms ' + animationName + '; ';\n\n var createStyles = function createStyles(doc) {\n if (!doc.getElementById('muiDetectElementResize')) {\n //opacity:0 works around a chrome bug https://code.google.com/p/chromium/issues/detail?id=286360\n var css = (animationKeyframes ? animationKeyframes : '') + '.Mui-resizeTriggers { ' + (animationStyle ? animationStyle : '') + 'visibility: hidden; opacity: 0; } ' + '.Mui-resizeTriggers, .Mui-resizeTriggers > div, .contract-trigger:before { content: \" \"; display: block; position: absolute; top: 0; left: 0; height: 100%; width: 100%; overflow: hidden; z-index: -1; } .Mui-resizeTriggers > div { background: #eee; overflow: auto; } .contract-trigger:before { width: 200%; height: 200%; }',\n head = doc.head || doc.getElementsByTagName('head')[0],\n style = doc.createElement('style');\n style.id = 'muiDetectElementResize';\n style.type = 'text/css';\n\n if (nonce != null) {\n style.setAttribute('nonce', nonce);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(doc.createTextNode(css));\n }\n\n head.appendChild(style);\n }\n };\n\n var addResizeListener = function addResizeListener(element, fn) {\n if (!element.__resizeTriggers__) {\n var doc = element.ownerDocument;\n var elementStyle = hostWindow.getComputedStyle(element);\n\n if (elementStyle && elementStyle.position == 'static') {\n element.style.position = 'relative';\n }\n\n createStyles(doc);\n element.__resizeLast__ = {};\n element.__resizeListeners__ = [];\n (element.__resizeTriggers__ = doc.createElement('div')).className = 'Mui-resizeTriggers';\n element.__resizeTriggers__.innerHTML = '' + '';\n element.appendChild(element.__resizeTriggers__);\n resetTriggers(element);\n element.addEventListener('scroll', scrollListener, true);\n /* Listen for a css animation to detect element display/re-attach */\n\n if (animationstartevent) {\n element.__resizeTriggers__.__animationListener__ = function animationListener(e) {\n if (e.animationName == animationName) {\n resetTriggers(element);\n }\n };\n\n element.__resizeTriggers__.addEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__);\n }\n }\n\n element.__resizeListeners__.push(fn);\n };\n\n var removeResizeListener = function removeResizeListener(element, fn) {\n element.__resizeListeners__.splice(element.__resizeListeners__.indexOf(fn), 1);\n\n if (!element.__resizeListeners__.length) {\n element.removeEventListener('scroll', scrollListener, true);\n\n if (element.__resizeTriggers__.__animationListener__) {\n element.__resizeTriggers__.removeEventListener(animationstartevent, element.__resizeTriggers__.__animationListener__);\n\n element.__resizeTriggers__.__animationListener__ = null;\n }\n\n try {\n element.__resizeTriggers__ = !element.removeChild(element.__resizeTriggers__);\n } catch (e) {// Preact compat; see developit/preact-compat/issues/228\n }\n }\n };\n\n return {\n addResizeListener,\n removeResizeListener\n };\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"children\", \"defaultHeight\", \"defaultWidth\", \"disableHeight\", \"disableWidth\", \"nonce\", \"onResize\", \"style\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useForkRef, ownerWindow, useEventCallback, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';\nimport createDetectElementResize from '../lib/createDetectElementResize'; // TODO replace with https://caniuse.com/resizeobserver.\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GridAutoSizer = /*#__PURE__*/React.forwardRef(function AutoSizer(props, ref) {\n const {\n children,\n defaultHeight = null,\n defaultWidth = null,\n disableHeight = false,\n disableWidth = false,\n nonce,\n onResize,\n style\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const [state, setState] = React.useState({\n height: defaultHeight,\n width: defaultWidth\n });\n const rootRef = React.useRef(null);\n const parentElement = React.useRef(null);\n const handleResize = useEventCallback(() => {\n // Guard against AutoSizer component being removed from the DOM immediately after being added.\n // This can result in invalid style values which can result in NaN values if we don't handle them.\n // See issue #150 for more context.\n if (parentElement.current) {\n const height = parentElement.current.offsetHeight || 0;\n const width = parentElement.current.offsetWidth || 0;\n const win = ownerWindow(parentElement.current);\n const computedStyle = win.getComputedStyle(parentElement.current);\n const paddingLeft = parseInt(computedStyle.paddingLeft, 10) || 0;\n const paddingRight = parseInt(computedStyle.paddingRight, 10) || 0;\n const paddingTop = parseInt(computedStyle.paddingTop, 10) || 0;\n const paddingBottom = parseInt(computedStyle.paddingBottom, 10) || 0;\n const newHeight = height - paddingTop - paddingBottom;\n const newWidth = width - paddingLeft - paddingRight;\n\n if (!disableHeight && state.height !== newHeight || !disableWidth && state.width !== newWidth) {\n setState({\n height: newHeight,\n width: newWidth\n });\n\n if (onResize) {\n onResize({\n height: newHeight,\n width: newWidth\n });\n }\n }\n }\n });\n useEnhancedEffect(() => {\n var _parentElement$curren;\n\n parentElement.current = rootRef.current.parentElement;\n\n if (!parentElement) {\n return undefined;\n }\n\n const win = ownerWindow((_parentElement$curren = parentElement.current) != null ? _parentElement$curren : undefined);\n const detectElementResize = createDetectElementResize(nonce, win);\n detectElementResize.addResizeListener(parentElement.current, handleResize);\n handleResize();\n return () => {\n detectElementResize.removeResizeListener(parentElement.current, handleResize);\n };\n }, [nonce, handleResize]); // Outer div should not force width/height since that may prevent containers from shrinking.\n // Inner component should overflow and use calculated width/height.\n // See issue #68 for more information.\n\n const outerStyle = {\n overflow: 'visible'\n };\n const childParams = {};\n\n if (!disableHeight) {\n outerStyle.height = 0;\n childParams.height = state.height;\n }\n\n if (!disableWidth) {\n outerStyle.width = 0;\n childParams.width = state.width;\n }\n\n const handleRef = useForkRef(rootRef, ref);\n return /*#__PURE__*/_jsx(\"div\", _extends({\n ref: handleRef,\n style: _extends({}, outerStyle, style)\n }, other, {\n children: state.height === null && state.width === null ? null : children(childParams)\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? GridAutoSizer.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * Default height to use for initial render; useful for SSR.\n * @default null\n */\n defaultHeight: PropTypes.number,\n\n /**\n * Default width to use for initial render; useful for SSR.\n * @default null\n */\n defaultWidth: PropTypes.number,\n\n /**\n * If `true`, disable dynamic :height property.\n * @default false\n */\n disableHeight: PropTypes.bool,\n\n /**\n * If `true`, disable dynamic :width property.\n * @default false\n */\n disableWidth: PropTypes.bool,\n\n /**\n * Nonce of the inlined stylesheet for Content Security Policy.\n */\n nonce: PropTypes.string,\n\n /**\n * Callback to be invoked on-resize.\n * @param {AutoSizerSize} size The grid's size.\n */\n onResize: PropTypes.func\n} : void 0;\nexport { GridAutoSizer };","import { createSelector } from '../../../utils/createSelector';\nimport { gridRowsLookupSelector } from '../rows/gridRowsSelector';\n/**\n * @category Sorting\n * @ignore - do not document.\n */\n\nexport const gridSortingStateSelector = state => state.sorting;\n/**\n * Get the id of the rows after the sorting process.\n * @category Sorting\n */\n\nexport const gridSortedRowIdsSelector = createSelector(gridSortingStateSelector, sortingState => sortingState.sortedRows);\n/**\n * Get the id and the model of the rows after the sorting process.\n * @category Sorting\n */\n\nexport const gridSortedRowEntriesSelector = createSelector(gridSortedRowIdsSelector, gridRowsLookupSelector, (sortedIds, idRowsLookup) => sortedIds.map(id => ({\n id,\n model: idRowsLookup[id]\n})));\n/**\n * Get the current sorting model.\n * @category Sorting\n */\n\nexport const gridSortModelSelector = createSelector(gridSortingStateSelector, sorting => sorting.sortModel);\n\n/**\n * @category Sorting\n * @ignore - do not document.\n */\nexport const gridSortColumnLookupSelector = createSelector(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 } from '../../../utils/createSelector';\nimport { gridSortedRowEntriesSelector } from '../sorting/gridSortingSelector';\nimport { gridColumnLookupSelector } from '../columns/gridColumnsSelector';\nimport { gridRowTreeDepthSelector, gridRowTreeSelector } from '../rows/gridRowsSelector';\n/**\n * @category Filtering\n */\n\nexport const gridFilterStateSelector = state => state.filter;\n/**\n * Get the current filter model.\n * @category Filtering\n */\n\nexport const gridFilterModelSelector = createSelector(gridFilterStateSelector, filterState => filterState.filterModel);\n/**\n * @category Filtering\n * @ignore - do not document.\n */\n\nexport const gridVisibleRowsLookupSelector = createSelector(gridFilterStateSelector, filterState => filterState.visibleRowsLookup);\n/**\n * @category Filtering\n * @ignore - do not document.\n */\n\nexport const gridFilteredRowsLookupSelector = createSelector(gridFilterStateSelector, filterState => filterState.filteredRowsLookup);\n/**\n * @category Filtering\n * @ignore - do not document.\n */\n\nexport const gridFilteredDescendantCountLookupSelector = createSelector(gridFilterStateSelector, filterState => filterState.filteredDescendantCountLookup);\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 */\n\nexport const gridVisibleSortedRowEntriesSelector = createSelector(gridVisibleRowsLookupSelector, gridSortedRowEntriesSelector, (visibleRowsLookup, sortedRows) => sortedRows.filter(row => visibleRowsLookup[row.id] !== false));\n/**\n * Get the id of the rows accessible after the filtering process.\n * Does not contain the collapsed children.\n * @category Filtering\n */\n\nexport const gridVisibleSortedRowIdsSelector = createSelector(gridVisibleSortedRowEntriesSelector, visibleSortedRowEntries => visibleSortedRowEntries.map(row => row.id));\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 */\n\nexport const gridFilteredSortedRowEntriesSelector = createSelector(gridFilteredRowsLookupSelector, gridSortedRowEntriesSelector, (filteredRowsLookup, sortedRows) => sortedRows.filter(row => filteredRowsLookup[row.id] !== false));\n/**\n * Get the id of the rows accessible after the filtering process.\n * Contains the collapsed children.\n * @category Filtering\n */\n\nexport const gridFilteredSortedRowIdsSelector = createSelector(gridFilteredSortedRowEntriesSelector, filteredSortedRowEntries => filteredSortedRowEntries.map(row => row.id));\n/**\n * @category Filtering\n * @deprecated Use `gridVisibleSortedRowIdsSelector` instead\n * @ignore - do not document.\n * TODO: Add deprecation warning once we have the new selectors without the \"visible\" keyword.\n */\n\nexport const gridVisibleRowsSelector = gridVisibleSortedRowIdsSelector;\n/**\n * Get the id and the model of the top level rows accessible after the filtering process.\n * @category Filtering\n */\n\nexport const gridVisibleSortedTopLevelRowEntriesSelector = createSelector(gridVisibleSortedRowEntriesSelector, gridRowTreeSelector, gridRowTreeDepthSelector, (visibleSortedRows, rowTree, rowTreeDepth) => {\n if (rowTreeDepth < 2) {\n return visibleSortedRows;\n }\n\n return visibleSortedRows.filter(row => {\n var _rowTree$row$id;\n\n return ((_rowTree$row$id = rowTree[row.id]) == null ? void 0 : _rowTree$row$id.depth) === 0;\n });\n});\n/**\n * Get the amount of rows accessible after the filtering process.\n * @category Filtering\n */\n\nexport const gridVisibleRowCountSelector = createSelector(gridVisibleSortedRowEntriesSelector, visibleSortedRows => visibleSortedRows.length);\n/**\n * Get the amount of top level rows accessible after the filtering process.\n * @category Filtering\n */\n\nexport const gridVisibleTopLevelRowCountSelector = createSelector(gridVisibleSortedTopLevelRowEntriesSelector, visibleSortedTopLevelRows => visibleSortedTopLevelRows.length);\n/**\n * @category Filtering\n * @ignore - do not document.\n */\n\nexport const gridFilterActiveItemsSelector = createSelector(gridFilterModelSelector, gridColumnLookupSelector, (filterModel, columnLookup) => {\n var _filterModel$items;\n\n return (_filterModel$items = filterModel.items) == null ? void 0 : _filterModel$items.filter(item => {\n var _column$filterOperato, _item$value;\n\n if (!item.columnField) {\n return false;\n }\n\n const column = columnLookup[item.columnField];\n\n if (!(column != null && column.filterOperators) || (column == null ? void 0 : (_column$filterOperato = column.filterOperators) == null ? void 0 : _column$filterOperato.length) === 0) {\n return false;\n }\n\n const filterOperator = column.filterOperators.find(operator => operator.value === item.operatorValue);\n\n if (!filterOperator) {\n return false;\n }\n\n return !filterOperator.InputComponent || item.value != null && ((_item$value = item.value) == null ? void 0 : _item$value.toString()) !== '';\n });\n});\n\n/**\n * @category Filtering\n * @ignore - do not document.\n */\nexport const gridFilterActiveItemsLookupSelector = createSelector(gridFilterActiveItemsSelector, activeFilters => {\n const result = activeFilters.reduce((res, filterItem) => {\n if (!res[filterItem.columnField]) {\n res[filterItem.columnField] = [filterItem];\n } else {\n res[filterItem.columnField].push(filterItem);\n }\n\n return res;\n }, {});\n return result;\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';\nimport { useGridSelector } from '../../hooks/utils/useGridSelector';\nimport { gridVisibleRowCountSelector } from '../../hooks/features/filter/gridFilterSelector';\nimport { gridRowCountSelector, gridRowsLoadingSelector } from '../../hooks/features/rows/gridRowsSelector';\nimport { useGridApiContext } from '../../hooks/utils/useGridApiContext';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { gridDensityHeaderHeightSelector } from '../../hooks/features/density/densitySelector';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nfunction GridOverlayWrapper(props) {\n var _viewportInnerSize$he, _viewportInnerSize$wi;\n\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const headerHeight = useGridSelector(apiRef, gridDensityHeaderHeightSelector);\n const [viewportInnerSize, setViewportInnerSize] = React.useState(() => {\n var _apiRef$current$getRo, _apiRef$current$getRo2;\n\n return (_apiRef$current$getRo = (_apiRef$current$getRo2 = apiRef.current.getRootDimensions()) == null ? void 0 : _apiRef$current$getRo2.viewportInnerSize) != null ? _apiRef$current$getRo : null;\n });\n const handleViewportSizeChange = React.useCallback(() => {\n var _apiRef$current$getRo3, _apiRef$current$getRo4;\n\n setViewportInnerSize((_apiRef$current$getRo3 = (_apiRef$current$getRo4 = apiRef.current.getRootDimensions()) == null ? void 0 : _apiRef$current$getRo4.viewportInnerSize) != null ? _apiRef$current$getRo3 : null);\n }, [apiRef]);\n useEnhancedEffect(() => {\n return apiRef.current.subscribeEvent('viewportInnerSizeChange', handleViewportSizeChange);\n }, [apiRef, handleViewportSizeChange]);\n let height = (_viewportInnerSize$he = viewportInnerSize == null ? void 0 : viewportInnerSize.height) != null ? _viewportInnerSize$he : 0;\n\n if (rootProps.autoHeight && height === 0) {\n height = 'auto';\n }\n\n if (!viewportInnerSize) {\n return null;\n }\n\n return /*#__PURE__*/_jsx(\"div\", _extends({\n style: {\n height,\n width: (_viewportInnerSize$wi = viewportInnerSize == null ? void 0 : viewportInnerSize.width) != null ? _viewportInnerSize$wi : 0,\n position: 'absolute',\n top: headerHeight,\n bottom: height === 'auto' ? 0 : undefined\n }\n }, props));\n}\n\nexport function GridOverlays() {\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const totalRowCount = useGridSelector(apiRef, gridRowCountSelector);\n const visibleRowCount = useGridSelector(apiRef, gridVisibleRowCountSelector);\n const loading = useGridSelector(apiRef, gridRowsLoadingSelector);\n const showNoRowsOverlay = !loading && totalRowCount === 0;\n const showNoResultsOverlay = !loading && totalRowCount > 0 && visibleRowCount === 0;\n let overlay = null;\n\n if (showNoRowsOverlay) {\n var _rootProps$components;\n\n overlay = /*#__PURE__*/_jsx(rootProps.components.NoRowsOverlay, _extends({}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.noRowsOverlay));\n }\n\n if (showNoResultsOverlay) {\n var _rootProps$components2;\n\n overlay = /*#__PURE__*/_jsx(rootProps.components.NoResultsOverlay, _extends({}, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.noResultsOverlay));\n }\n\n if (loading) {\n var _rootProps$components3;\n\n overlay = /*#__PURE__*/_jsx(rootProps.components.LoadingOverlay, _extends({}, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.loadingOverlay));\n }\n\n if (overlay === null) {\n return null;\n }\n\n return /*#__PURE__*/_jsx(GridOverlayWrapper, {\n children: overlay\n });\n}","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGridApiContext } from '../../hooks/utils/useGridApiContext';\nimport { GridMainContainer } from '../containers/GridMainContainer';\nimport { GridAutoSizer } from '../GridAutoSizer';\nimport { GridOverlays } from './GridOverlays';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { useGridSelector } from '../../hooks/utils/useGridSelector';\nimport { gridDensityHeaderHeightSelector } from '../../hooks/features/density/densitySelector';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n\nfunction GridBody(props) {\n const {\n children,\n VirtualScrollerComponent,\n ColumnHeadersComponent\n } = props;\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const headerHeight = useGridSelector(apiRef, gridDensityHeaderHeightSelector);\n const [isVirtualizationDisabled, setIsVirtualizationDisabled] = React.useState(rootProps.disableVirtualization);\n const disableVirtualization = React.useCallback(() => {\n setIsVirtualizationDisabled(true);\n }, []);\n const enableVirtualization = React.useCallback(() => {\n setIsVirtualizationDisabled(false);\n }, []); // The `useGridApiMethod` hook can't be used here, because it only installs the\n // method if it doesn't exist yet. Once installed, it's never updated again.\n // This break the methods above, since their closure comes from the first time\n // they were installed. Which means that calling `setIsVirtualizationDisabled`\n // will trigger a re-render, but it won't update the state. That can be solved\n // by migrating the virtualization status to the global state.\n\n apiRef.current.unstable_disableVirtualization = disableVirtualization;\n apiRef.current.unstable_enableVirtualization = enableVirtualization;\n const columnHeadersRef = React.useRef(null);\n const columnsContainerRef = React.useRef(null);\n const windowRef = React.useRef(null);\n const renderingZoneRef = React.useRef(null);\n apiRef.current.columnHeadersContainerElementRef = columnsContainerRef;\n apiRef.current.columnHeadersElementRef = columnHeadersRef;\n apiRef.current.windowRef = windowRef; // TODO rename, it's not attached to the window anymore\n\n apiRef.current.renderingZoneRef = renderingZoneRef; // TODO remove, nobody should have access to internal parts of the virtualization\n\n const handleResize = React.useCallback(size => {\n apiRef.current.publishEvent('resize', size);\n }, [apiRef]);\n return /*#__PURE__*/_jsxs(GridMainContainer, {\n children: [/*#__PURE__*/_jsx(GridOverlays, {}), /*#__PURE__*/_jsx(ColumnHeadersComponent, {\n ref: columnsContainerRef,\n innerRef: columnHeadersRef\n }), /*#__PURE__*/_jsx(GridAutoSizer, {\n nonce: rootProps.nonce,\n disableHeight: rootProps.autoHeight,\n onResize: handleResize,\n children: size => {\n const style = {\n width: size.width,\n // If `autoHeight` is on, there will be no height value.\n // In this case, let the container to grow whatever it needs.\n height: size.height ? size.height - headerHeight : 'auto',\n marginTop: headerHeight\n };\n return /*#__PURE__*/_jsx(VirtualScrollerComponent, {\n ref: windowRef,\n style: style,\n disableVirtualization: isVirtualizationDisabled\n });\n }\n }), children]\n });\n}\n\nprocess.env.NODE_ENV !== \"production\" ? GridBody.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n children: PropTypes.node,\n ColumnHeadersComponent: PropTypes.elementType.isRequired,\n VirtualScrollerComponent: PropTypes.elementType.isRequired\n} : void 0;\nexport { GridBody };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridApiContext } from '../../hooks/utils/useGridApiContext';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport function GridFooterPlaceholder() {\n var _rootProps$components;\n\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const footerRef = React.useRef(null);\n apiRef.current.footerRef = footerRef;\n\n if (rootProps.hideFooter) {\n return null;\n }\n\n return /*#__PURE__*/_jsx(\"div\", {\n ref: footerRef,\n children: /*#__PURE__*/_jsx(rootProps.components.Footer, _extends({}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.footer))\n });\n}","import * as React from 'react';\nimport { GridApiContext } from '../components/GridApiContext';\nimport { GridRootPropsContext } from './GridRootPropsContext';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const GridContextProvider = ({\n apiRef,\n props,\n children\n}) => {\n return /*#__PURE__*/_jsx(GridRootPropsContext.Provider, {\n value: props,\n children: /*#__PURE__*/_jsx(GridApiContext.Provider, {\n value: apiRef,\n children: children\n })\n });\n};","export function isNumber(value) {\n return typeof value === 'number';\n}\nexport function isFunction(value) {\n return typeof value === 'function';\n}\nexport function isObject(value) {\n return typeof value === 'object';\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 * Follows the CSS specification behavior for min and max\n * If min > max, then the min have priority\n */\n\nexport const clamp = (value, min, max) => Math.max(min, Math.min(max, value));\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\n if (a && b && typeof a === 'object' && typeof b === 'object') {\n if (a.constructor !== b.constructor) {\n return false;\n }\n\n if (Array.isArray(a)) {\n const length = a.length;\n\n if (length !== b.length) {\n return false;\n }\n\n for (let i = 0; i < length; i += 1) {\n if (!isDeepEqual(a[i], b[i])) {\n return false;\n }\n }\n\n return true;\n }\n\n if (a instanceof Map && b instanceof Map) {\n if (a.size !== b.size) {\n return false;\n }\n\n const entriesA = Array.from(a.entries());\n\n for (let i = 0; i < entriesA.length; i += 1) {\n if (!b.has(entriesA[i][0])) {\n return false;\n }\n }\n\n for (let i = 0; i < entriesA.length; i += 1) {\n const entryA = entriesA[i];\n\n if (!isDeepEqual(entryA[1], b.get(entryA[0]))) {\n return false;\n }\n }\n\n return true;\n }\n\n if (a instanceof Set && b instanceof Set) {\n if (a.size !== b.size) {\n return false;\n }\n\n const entries = Array.from(a.entries());\n\n for (let i = 0; i < entries.length; i += 1) {\n if (!b.has(entries[i][0])) {\n return false;\n }\n }\n\n return true;\n }\n\n if (ArrayBuffer.isView(a) && ArrayBuffer.isView(b)) {\n const length = a.length;\n\n if (length !== b.length) {\n return false;\n }\n\n for (let i = 0; i < length; i += 1) {\n if (a[i] !== b[i]) {\n return false;\n }\n }\n\n return true;\n }\n\n if (a.constructor === RegExp) {\n return a.source === b.source && a.flags === b.flags;\n }\n\n if (a.valueOf !== Object.prototype.valueOf) {\n return a.valueOf() === b.valueOf();\n }\n\n if (a.toString !== Object.prototype.toString) {\n return a.toString() === b.toString();\n }\n\n const keys = Object.keys(a);\n const length = keys.length;\n\n if (length !== Object.keys(b).length) {\n return false;\n }\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\n for (let i = 0; i < length; i += 1) {\n const key = keys[i];\n\n if (!isDeepEqual(a[key], b[key])) {\n return false;\n }\n }\n\n return true;\n } // true if both NaN, false otherwise\n // eslint-disable-next-line no-self-compare\n\n\n return a !== a && b !== b;\n}","import * as React from 'react';\nimport { localStorageAvailable } from '../../utils/utils';\nconst forceDebug = localStorageAvailable() && window.localStorage.getItem('DEBUG') != null;\n\nconst noop = () => {};\n\nconst noopLogger = {\n debug: noop,\n info: noop,\n warn: noop,\n error: noop\n};\nconst LOG_LEVELS = ['debug', 'info', 'warn', 'error'];\n\nfunction getAppender(name, logLevel, appender = console) {\n const minLogLevelIdx = LOG_LEVELS.indexOf(logLevel);\n\n if (minLogLevelIdx === -1) {\n throw new Error(`MUI: Log level ${logLevel} not recognized.`);\n }\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: ${name} - ${message}`, ...other);\n };\n } else {\n loggerObj[method] = noop;\n }\n\n return loggerObj;\n }, {});\n return logger;\n}\n\nexport const useGridLoggerFactory = (apiRef, props) => {\n apiRef.current.getLogger = React.useCallback(name => {\n if (forceDebug) {\n return getAppender(name, 'debug', props.logger);\n }\n\n if (!props.logLevel) {\n return noopLogger;\n }\n\n return getAppender(name, props.logLevel.toString(), props.logger);\n }, [props.logLevel, props.logger]);\n};","import * as React from 'react';\nexport function useGridApiMethod(apiRef, apiMethods, // TODO: Remove `apiName\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\napiName) {\n const apiMethodsRef = React.useRef(apiMethods);\n const [apiMethodsNames] = React.useState(Object.keys(apiMethods));\n const installMethods = React.useCallback(() => {\n if (!apiRef.current) {\n return;\n }\n\n apiMethodsNames.forEach(methodName => {\n if (!apiRef.current.hasOwnProperty(methodName)) {\n apiRef.current[methodName] = (...args) => apiMethodsRef.current[methodName](...args);\n }\n });\n }, [apiMethodsNames, apiRef]);\n React.useEffect(() => {\n apiMethodsRef.current = apiMethods;\n }, [apiMethods]);\n React.useEffect(() => {\n installMethods();\n }, [installMethods]);\n installMethods();\n}","// 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\n register(object, unsubscribe, unregisterToken) {\n if (!this.timeouts) {\n this.timeouts = new Map();\n }\n\n const timeout = setTimeout(() => {\n if (typeof unsubscribe === 'function') {\n unsubscribe();\n }\n\n this.timeouts.delete(unregisterToken.cleanupToken);\n }, this.cleanupTimeout);\n this.timeouts.set(unregisterToken.cleanupToken, timeout);\n }\n\n unregister(unregisterToken) {\n const timeout = this.timeouts.get(unregisterToken.cleanupToken);\n\n if (timeout) {\n this.timeouts.delete(unregisterToken.cleanupToken);\n clearTimeout(timeout);\n }\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\n}","import * as React from 'react';\nimport { TimerBasedCleanupTracking } from '../../utils/cleanupTracking/TimerBasedCleanupTracking';\nimport { FinalizationRegistryBasedCleanupTracking } from '../../utils/cleanupTracking/FinalizationRegistryBasedCleanupTracking';\n\n/**\n * Signal to the underlying logic what version of the public component API\n * of the data grid is exposed.\n */\nvar GridSignature;\n\n(function (GridSignature) {\n GridSignature[\"DataGrid\"] = \"DataGrid\";\n GridSignature[\"DataGridPro\"] = \"DataGridPro\";\n})(GridSignature || (GridSignature = {}));\n\n// We use class to make it easier to detect in heap snapshots by name\nclass ObjectToBeRetainedByReact {} // 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\n\n\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\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\n if (!subscription.current && handlerRef.current) {\n const enhancedHandler = (params, event, details) => {\n if (!event.defaultMuiPrevented) {\n var _handlerRef$current;\n\n (_handlerRef$current = handlerRef.current) == null ? void 0 : _handlerRef$current.call(handlerRef, params, event, details);\n }\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, // The callback below will be called once this reference stops being retained\n () => {\n var _subscription$current;\n\n (_subscription$current = subscription.current) == null ? void 0 : _subscription$current.call(subscription);\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\n if (cleanupTokenRef.current) {\n registryContainer.registry.unregister(cleanupTokenRef.current);\n cleanupTokenRef.current = null;\n }\n }\n\n React.useEffect(() => {\n if (!subscription.current && handlerRef.current) {\n const enhancedHandler = (params, event, details) => {\n if (!event.defaultMuiPrevented) {\n var _handlerRef$current2;\n\n (_handlerRef$current2 = handlerRef.current) == null ? void 0 : _handlerRef$current2.call(handlerRef, params, event, details);\n }\n };\n\n subscription.current = apiRef.current.subscribeEvent(eventName, enhancedHandler, options);\n }\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\n return () => {\n var _subscription$current2;\n\n (_subscription$current2 = subscription.current) == null ? void 0 : _subscription$current2.call(subscription);\n subscription.current = null;\n };\n }, [apiRef, eventName, options]);\n };\n}\nconst registryContainer = {\n registry: null\n}; // TODO: move to @mui/x-data-grid/internals\n// eslint-disable-next-line @typescript-eslint/naming-convention\n\nexport const unstable_resetCleanupTracking = () => {\n var _registryContainer$re;\n\n (_registryContainer$re = registryContainer.registry) == null ? void 0 : _registryContainer$re.reset();\n registryContainer.registry = null;\n};\nexport const useGridApiEventHandler = createUseGridApiEventHandler(registryContainer);\nconst optionsSubscriberOptions = {\n isFirst: true\n};\nexport function useGridApiOptionHandler(apiRef, eventName, handler) {\n // Validate that only one per event name?\n useGridApiEventHandler(apiRef, eventName, handler, optionsSubscriberOptions);\n}\nexport { GridSignature };","export class FinalizationRegistryBasedCleanupTracking {\n constructor() {\n this.registry = new FinalizationRegistry(unsubscribe => {\n if (typeof unsubscribe === 'function') {\n unsubscribe();\n }\n });\n }\n\n register(object, unsubscribe, unregisterToken) {\n this.registry.register(object, unsubscribe, unregisterToken);\n }\n\n unregister(unregisterToken) {\n this.registry.unregister(unregisterToken);\n } // eslint-disable-next-line class-methods-use-this\n\n\n reset() {}\n\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 = 10;\n this.warnOnce = false;\n this.events = {};\n }\n\n on(eventName, listener, options = {}) {\n let collection = this.events[eventName];\n\n if (!collection) {\n collection = {\n highPriority: new Map(),\n regular: new Map()\n };\n this.events[eventName] = collection;\n }\n\n if (options.isFirst) {\n collection.highPriority.set(listener, true);\n } else {\n collection.regular.set(listener, true);\n }\n\n if (process.env.NODE_ENV !== 'production') {\n const collectionSize = collection.highPriority.size + collection.regular.size;\n\n if (collectionSize > this.maxListeners && !this.warnOnce) {\n this.warnOnce = true;\n console.warn([`Possible EventEmitter memory leak detected. ${collectionSize} ${eventName} listeners added.`, `Use emitter.setMaxListeners() to increase limit.`].join('\\n'));\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\n removeAllListeners() {\n this.events = {};\n }\n\n emit(eventName, ...args) {\n const collection = this.events[eventName];\n\n if (!collection) {\n return;\n }\n\n const highPriorityListeners = Array.from(collection.highPriority.keys());\n const regularListeners = Array.from(collection.regular.keys());\n\n for (let i = highPriorityListeners.length - 1; i >= 0; i -= 1) {\n const listener = highPriorityListeners[i];\n\n if (collection.highPriority.has(listener)) {\n listener.apply(this, args);\n }\n }\n\n for (let i = 0; i < regularListeners.length; i += 1) {\n const listener = regularListeners[i];\n\n if (collection.regular.has(listener)) {\n listener.apply(this, args);\n }\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\n}","import * as React from 'react';\nimport { useGridApiMethod } from '../utils/useGridApiMethod';\nimport { GridSignature } from '../utils/useGridApiEventHandler';\nimport { EventManager } from '../../utils/EventManager';\n\nconst isSyntheticEvent = event => {\n return event.isPropagationStopped !== undefined;\n};\n\nlet globalId = 0;\nexport function useGridApiInitialization(inputApiRef, props) {\n const apiRef = React.useRef();\n\n if (!apiRef.current) {\n apiRef.current = {\n unstable_eventManager: new EventManager(),\n unstable_caches: {},\n state: {},\n instanceId: globalId\n };\n globalId += 1;\n }\n\n React.useImperativeHandle(inputApiRef, () => apiRef.current, [apiRef]);\n const publishEvent = React.useCallback((...args) => {\n const [name, params, event = {}] = args;\n event.defaultMuiPrevented = false;\n\n if (isSyntheticEvent(event) && event.isPropagationStopped()) {\n return;\n }\n\n const details = props.signature === GridSignature.DataGridPro ? {\n api: apiRef.current\n } : {};\n apiRef.current.unstable_eventManager.emit(name, params, event, details);\n }, [apiRef, props.signature]);\n const subscribeEvent = React.useCallback((event, handler, options) => {\n apiRef.current.unstable_eventManager.on(event, handler, options);\n const api = apiRef.current;\n return () => {\n api.unstable_eventManager.removeListener(event, handler);\n };\n }, [apiRef]);\n const showError = React.useCallback(args => {\n apiRef.current.publishEvent('componentError', args);\n }, [apiRef]);\n useGridApiMethod(apiRef, {\n subscribeEvent,\n publishEvent,\n showError\n }, 'GridCoreApi');\n React.useEffect(() => {\n const api = apiRef.current;\n return () => {\n api.publishEvent('unmount');\n };\n }, [apiRef]);\n return apiRef;\n}","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nexport default function _toPropertyKey(arg) {\n var key = toPrimitive(arg, \"string\");\n return _typeof(key) === \"symbol\" ? key : String(key);\n}","import _typeof from \"./typeof.js\";\nexport default function _toPrimitive(input, hint) {\n if (_typeof(input) !== \"object\" || input === null) return input;\n var prim = input[Symbol.toPrimitive];\n if (prim !== undefined) {\n var res = prim.call(input, hint || \"default\");\n if (_typeof(res) !== \"object\") return res;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (hint === \"string\" ? String : Number)(input);\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';\n\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.unstable_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.unstable_requestPipeProcessorsApplication` is called for the given group.\n */\nexport const useGridPipeProcessing = apiRef => {\n const processorsCache = React.useRef({});\n const runAppliers = React.useCallback(groupCache => {\n if (!groupCache) {\n return;\n }\n\n Object.values(groupCache.appliers).forEach(callback => {\n callback();\n });\n }, []);\n const registerPipeProcessor = React.useCallback((group, id, processor) => {\n if (!processorsCache.current[group]) {\n processorsCache.current[group] = {\n processors: new Map(),\n appliers: {}\n };\n }\n\n const groupCache = processorsCache.current[group];\n const oldProcessor = groupCache.processors.get(id);\n\n if (oldProcessor !== processor) {\n groupCache.processors.set(id, processor);\n runAppliers(groupCache);\n }\n\n return () => {\n processorsCache.current[group].processors.set(id, null);\n };\n }, [runAppliers]);\n const registerPipeApplier = React.useCallback((group, id, applier) => {\n if (!processorsCache.current[group]) {\n processorsCache.current[group] = {\n processors: new Map(),\n appliers: {}\n };\n }\n\n processorsCache.current[group].appliers[id] = applier;\n return () => {\n const _appliers = processorsCache.current[group].appliers,\n otherAppliers = _objectWithoutPropertiesLoose(_appliers, [id].map(_toPropertyKey));\n\n processorsCache.current[group].appliers = otherAppliers;\n };\n }, []);\n const requestPipeProcessorsApplication = React.useCallback(group => {\n const groupCache = processorsCache.current[group];\n runAppliers(groupCache);\n }, [runAppliers]);\n const applyPipeProcessors = React.useCallback((...args) => {\n const [group, value, context] = args;\n\n if (!processorsCache.current[group]) {\n return value;\n }\n\n const preProcessors = Array.from(processorsCache.current[group].processors.values());\n return preProcessors.reduce((acc, preProcessor) => {\n if (!preProcessor) {\n return acc;\n }\n\n return preProcessor(acc, context);\n }, value);\n }, []);\n const preProcessingApi = {\n unstable_registerPipeProcessor: registerPipeProcessor,\n unstable_registerPipeApplier: registerPipeApplier,\n unstable_requestPipeProcessorsApplication: requestPipeProcessorsApplication,\n unstable_applyPipeProcessors: applyPipeProcessors\n };\n useGridApiMethod(apiRef, preProcessingApi, 'GridPipeProcessingApi');\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';\nexport const GRID_DEFAULT_STRATEGY = 'none';\nexport const GRID_STRATEGIES_PROCESSORS = {\n rowTreeCreation: 'rowTree',\n filtering: 'rowTree',\n sorting: 'rowTree'\n};\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.unstable_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.unstable_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\n strategiesCache.current[processorName] = otherProcessors;\n };\n\n if (!strategiesCache.current[processorName]) {\n strategiesCache.current[processorName] = {};\n }\n\n const groupPreProcessors = strategiesCache.current[processorName];\n const previousProcessor = groupPreProcessors[strategyName];\n groupPreProcessors[strategyName] = processor;\n\n if (!previousProcessor || previousProcessor === processor) {\n return cleanup;\n }\n\n if (strategyName === apiRef.current.unstable_getActiveStrategy(GRID_STRATEGIES_PROCESSORS[processorName])) {\n apiRef.current.publishEvent('activeStrategyProcessorChange', processorName);\n }\n\n return cleanup;\n }, [apiRef]);\n const applyStrategyProcessor = React.useCallback((processorName, params) => {\n const activeStrategy = apiRef.current.unstable_getActiveStrategy(GRID_STRATEGIES_PROCESSORS[processorName]);\n\n if (activeStrategy == null) {\n throw new Error(\"Can't apply a strategy processor before defining an active strategy\");\n }\n\n const groupCache = strategiesCache.current[processorName];\n\n if (!groupCache || !groupCache[activeStrategy]) {\n throw new Error(`No processor found for processor \"${processorName}\" on strategy \"${activeStrategy}\"`);\n }\n\n const processor = groupCache[activeStrategy];\n return processor(params);\n }, [apiRef]);\n const getActiveStrategy = React.useCallback(strategyGroup => {\n var _availableStrategyEnt;\n\n const strategyEntries = Array.from(availableStrategies.current.entries());\n const availableStrategyEntry = strategyEntries.find(([, strategy]) => {\n if (strategy.group !== strategyGroup) {\n return false;\n }\n\n return strategy.isAvailable();\n });\n return (_availableStrategyEnt = availableStrategyEntry == null ? void 0 : availableStrategyEntry[0]) != null ? _availableStrategyEnt : 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 unstable_registerStrategyProcessor: registerStrategyProcessor,\n unstable_applyStrategyProcessor: applyStrategyProcessor,\n unstable_getActiveStrategy: getActiveStrategy,\n unstable_setStrategyAvailability: setStrategyAvailability\n };\n useGridApiMethod(apiRef, strategyProcessingApi, 'GridStrategyProcessing');\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"stateId\"];\nimport * as React from 'react';\nimport { GridSignature } from '../utils/useGridApiEventHandler';\nimport { useGridApiMethod } from '../utils';\nimport { isFunction } from '../../utils/utils';\nexport const useGridStateInitialization = (apiRef, props) => {\n const controlStateMapRef = React.useRef({});\n const [, rawForceUpdate] = React.useState();\n const updateControlState = React.useCallback(controlStateItem => {\n const {\n stateId\n } = controlStateItem,\n others = _objectWithoutPropertiesLoose(controlStateItem, _excluded);\n\n controlStateMapRef.current[stateId] = _extends({}, others, {\n stateId\n });\n }, []);\n const setState = React.useCallback(state => {\n let newState;\n\n if (isFunction(state)) {\n newState = state(apiRef.current.state);\n } else {\n newState = state;\n }\n\n if (apiRef.current.state === newState) {\n return false;\n }\n\n let ignoreSetState = false; // Apply the control state constraints\n\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\n if (newSubState === oldSubState) {\n return;\n }\n\n updatedControlStateIds.push({\n stateId: controlState.stateId,\n hasPropChanged: newSubState !== controlState.propModel\n }); // The state is controlled, the prop should always win\n\n if (controlState.propModel !== undefined && newSubState !== controlState.propModel) {\n ignoreSetState = true;\n }\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\n if (!ignoreSetState) {\n // We always assign it as we mutate rows for perf reason.\n apiRef.current.state = newState;\n\n if (apiRef.current.publishEvent) {\n apiRef.current.publishEvent('stateChange', newState);\n }\n }\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\n if (controlState.propOnChange && hasPropChanged) {\n const details = props.signature === GridSignature.DataGridPro ? {\n api: apiRef.current\n } : {};\n controlState.propOnChange(model, details);\n }\n\n if (!ignoreSetState) {\n apiRef.current.publishEvent(controlState.changeEvent, model);\n }\n }\n\n return !ignoreSetState;\n }, [apiRef, props.signature]);\n const forceUpdate = React.useCallback(() => rawForceUpdate(() => apiRef.current.state), [apiRef]);\n const stateApi = {\n setState,\n forceUpdate,\n unstable_updateControlState: updateControlState\n };\n useGridApiMethod(apiRef, stateApi, 'GridStateApi');\n};","import { useGridLoggerFactory } from './useGridLoggerFactory';\nimport { useGridApiInitialization } from './useGridApiInitialization';\nimport { useGridErrorHandler } from './useGridErrorHandler';\nimport { useGridLocaleText } from './useGridLocaleText';\nimport { useGridPipeProcessing } from './pipeProcessing';\nimport { useGridStrategyProcessing } from './strategyProcessing';\nimport { useGridStateInitialization } from './useGridStateInitialization';\n/**\n * Initialize the technical pieces of the DataGrid (logger, state, ...) that any DataGrid implementation needs\n */\n\nexport const useGridInitialization = (inputApiRef, props) => {\n const apiRef = useGridApiInitialization(inputApiRef, props);\n useGridLoggerFactory(apiRef, props);\n useGridErrorHandler(apiRef, props);\n useGridStateInitialization(apiRef, props);\n useGridPipeProcessing(apiRef);\n useGridStrategyProcessing(apiRef);\n useGridLocaleText(apiRef, props);\n return apiRef;\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridApiEventHandler } from '../utils/useGridApiEventHandler';\nexport function useGridErrorHandler(apiRef, props) {\n const handleError = React.useCallback(args => {\n // We are handling error here, to set up the handler as early as possible and be able to catch error thrown at init time.\n apiRef.current.setState(state => _extends({}, state, {\n error: args\n }));\n }, [apiRef]);\n React.useEffect(() => {\n handleError(props.error);\n }, [handleError, props.error]);\n useGridApiEventHandler(apiRef, 'componentError', handleError);\n}","import * as React from 'react';\nimport { useGridApiMethod } from '../utils/useGridApiMethod';\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\n return props.localeText[key];\n }, [props.localeText]);\n const localeTextApi = {\n getLocaleText\n };\n useGridApiMethod(apiRef, localeTextApi, 'LocaleTextApi');\n};","import * as React from 'react';\nexport const useGridInitializeState = (initializer, apiRef, props) => {\n const isInitialized = React.useRef(false);\n\n if (!isInitialized.current) {\n apiRef.current.state = initializer(apiRef.current.state, props, apiRef);\n isInitialized.current = true;\n }\n};","import * as React from 'react';\nimport { useGridApiMethod, useGridNativeEventListener } from '../../utils';\n\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\n try {\n document.execCommand('copy');\n } finally {\n document.body.removeChild(span);\n }\n}\n/**\n * @requires useGridCsvExport (method)\n * @requires useGridSelection (method)\n */\n\n\nexport const useGridClipboard = apiRef => {\n const copySelectedRowsToClipboard = React.useCallback((includeHeaders = false) => {\n if (apiRef.current.getSelectedRows().size === 0) {\n return;\n }\n\n const data = apiRef.current.getDataAsCsv({\n includeHeaders,\n delimiter: '\\t'\n });\n\n if (navigator.clipboard) {\n navigator.clipboard.writeText(data).catch(() => {\n writeToClipboardPolyfill(data);\n });\n } else {\n writeToClipboardPolyfill(data);\n }\n }, [apiRef]);\n const handleKeydown = React.useCallback(event => {\n var _window$getSelection;\n\n const isModifierKeyPressed = event.ctrlKey || event.metaKey || event.altKey; // event.key === 'c' is not enough as alt+c can lead to ©, ç, or other characters on macOS.\n // event.code === 'KeyC' is not enough as event.code assume a QWERTY keyboard layout which would\n // be wrong with a Dvorak keyboard (as if pressing J).\n\n if (String.fromCharCode(event.keyCode) !== 'C' || !isModifierKeyPressed) {\n return;\n } // Do nothing if there's a native selection\n\n\n if (((_window$getSelection = window.getSelection()) == null ? void 0 : _window$getSelection.toString()) !== '') {\n return;\n }\n\n apiRef.current.unstable_copySelectedRowsToClipboard(event.altKey);\n }, [apiRef]);\n useGridNativeEventListener(apiRef, apiRef.current.rootElementRef, 'keydown', handleKeydown);\n const clipboardApi = {\n unstable_copySelectedRowsToClipboard: copySelectedRowsToClipboard\n };\n useGridApiMethod(apiRef, clipboardApi, 'GridClipboardApi');\n};","import * as React from 'react';\nimport { isFunction } from '../../utils/utils';\nimport { useGridLogger } from './useGridLogger';\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 wrapHandler = React.useCallback(args => {\n return handlerRef.current && handlerRef.current(args);\n }, []);\n React.useEffect(() => {\n handlerRef.current = handler;\n }, [handler]);\n React.useEffect(() => {\n let targetElement;\n\n if (isFunction(ref)) {\n targetElement = ref();\n } else {\n targetElement = ref && ref.current ? ref.current : null;\n }\n\n if (targetElement && wrapHandler && eventName && !added) {\n logger.debug(`Binding native ${eventName} event`);\n targetElement.addEventListener(eventName, wrapHandler, options);\n const boundElem = targetElement;\n setAdded(true);\n\n const unsubscribe = () => {\n logger.debug(`Clearing native ${eventName} event`);\n boundElem.removeEventListener(eventName, wrapHandler, options);\n };\n\n apiRef.current.subscribeEvent('unmount', unsubscribe);\n }\n }, [ref, wrapHandler, eventName, added, logger, options, apiRef]);\n};","export const gridColumnMenuSelector = state => state.columnMenu;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridLogger, useGridApiMethod, useGridApiEventHandler } from '../../utils';\nimport { gridColumnMenuSelector } from './columnMenuSelector';\nexport const columnMenuStateInitializer = state => _extends({}, state, {\n columnMenu: {\n open: false\n }\n});\n/**\n * @requires useGridColumnResize (event)\n * @requires useGridInfiniteLoader (event)\n */\n\nexport const useGridColumnMenu = apiRef => {\n const logger = useGridLogger(apiRef, 'useGridColumnMenu');\n /**\n * API METHODS\n */\n\n const showColumnMenu = React.useCallback(field => {\n const shouldUpdate = apiRef.current.setState(state => {\n if (state.columnMenu.open && state.columnMenu.field === field) {\n return state;\n }\n\n logger.debug('Opening Column Menu');\n return _extends({}, state, {\n columnMenu: {\n open: true,\n field\n }\n });\n });\n\n if (shouldUpdate) {\n apiRef.current.hidePreferences();\n apiRef.current.forceUpdate();\n }\n }, [apiRef, logger]);\n const hideColumnMenu = React.useCallback(() => {\n const shouldUpdate = apiRef.current.setState(state => {\n if (!state.columnMenu.open && state.columnMenu.field === undefined) {\n return state;\n }\n\n logger.debug('Hiding Column Menu');\n return _extends({}, state, {\n columnMenu: _extends({}, state.columnMenu, {\n open: false,\n field: undefined\n })\n });\n });\n\n if (shouldUpdate) {\n apiRef.current.forceUpdate();\n }\n }, [apiRef, logger]);\n const toggleColumnMenu = React.useCallback(field => {\n logger.debug('Toggle Column Menu');\n const columnMenu = gridColumnMenuSelector(apiRef.current.state);\n\n if (!columnMenu.open || columnMenu.field !== field) {\n showColumnMenu(field);\n } else {\n hideColumnMenu();\n }\n }, [apiRef, logger, showColumnMenu, hideColumnMenu]);\n const columnMenuApi = {\n showColumnMenu,\n hideColumnMenu,\n toggleColumnMenu\n };\n useGridApiMethod(apiRef, columnMenuApi, 'GridColumnMenuApi');\n /**\n * EVENTS\n */\n\n useGridApiEventHandler(apiRef, 'columnResizeStart', hideColumnMenu);\n useGridApiEventHandler(apiRef, 'virtualScrollerWheel', apiRef.current.hideColumnMenu);\n useGridApiEventHandler(apiRef, 'virtualScrollerTouchMove', apiRef.current.hideColumnMenu);\n};","import * as React from 'react';\nexport const useFirstRender = callback => {\n const isFirstRender = React.useRef(true);\n\n if (isFirstRender.current) {\n isFirstRender.current = false;\n callback();\n }\n};","import * as React from 'react';\nimport { useFirstRender } from '../../utils/useFirstRender';\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.unstable_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\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';\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.unstable_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\n return () => {\n if (cleanup.current) {\n cleanup.current();\n cleanup.current = null;\n }\n };\n }, [registerPreProcessor]);\n};","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(\"path\", {\n d: \"M11 19V5h2v14z\"\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');","import { generateUtilityClass, generateUtilityClasses } from '@mui/base';\nexport function getMenuItemUtilityClass(slot) {\n return generateUtilityClass('MuiMenuItem', slot);\n}\nconst menuItemClasses = generateUtilityClasses('MuiMenuItem', ['root', 'focusVisible', 'dense', 'disabled', 'divider', 'gutters', 'selected']);\nexport default menuItemClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"autoFocus\", \"component\", \"dense\", \"divider\", \"disableGutters\", \"focusVisibleClassName\", \"role\", \"tabIndex\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport { alpha } from '@mui/system';\nimport styled, { rootShouldForwardProp } from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport ListContext from '../List/ListContext';\nimport ButtonBase from '../ButtonBase';\nimport useEnhancedEffect from '../utils/useEnhancedEffect';\nimport useForkRef from '../utils/useForkRef';\nimport { dividerClasses } from '../Divider';\nimport { listItemIconClasses } from '../ListItemIcon';\nimport { listItemTextClasses } from '../ListItemText';\nimport menuItemClasses, { getMenuItemUtilityClass } from './menuItemClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const overridesResolver = (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.dense && styles.dense, ownerState.divider && styles.divider, !ownerState.disableGutters && styles.gutters];\n};\n\nconst useUtilityClasses = ownerState => {\n const {\n disabled,\n dense,\n divider,\n disableGutters,\n selected,\n classes\n } = ownerState;\n const slots = {\n root: ['root', dense && 'dense', disabled && 'disabled', !disableGutters && 'gutters', divider && 'divider', selected && 'selected']\n };\n const composedClasses = composeClasses(slots, getMenuItemUtilityClass, classes);\n return _extends({}, classes, composedClasses);\n};\n\nconst MenuItemRoot = styled(ButtonBase, {\n shouldForwardProp: prop => rootShouldForwardProp(prop) || prop === 'classes',\n name: 'MuiMenuItem',\n slot: 'Root',\n overridesResolver\n})(({\n theme,\n ownerState\n}) => _extends({}, theme.typography.body1, {\n display: 'flex',\n justifyContent: 'flex-start',\n alignItems: 'center',\n position: 'relative',\n textDecoration: 'none',\n minHeight: 48,\n paddingTop: 6,\n paddingBottom: 6,\n boxSizing: 'border-box',\n whiteSpace: 'nowrap'\n}, !ownerState.disableGutters && {\n paddingLeft: 16,\n paddingRight: 16\n}, ownerState.divider && {\n borderBottom: `1px solid ${(theme.vars || theme).palette.divider}`,\n backgroundClip: 'padding-box'\n}, {\n '&:hover': {\n textDecoration: 'none',\n backgroundColor: (theme.vars || theme).palette.action.hover,\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n },\n [`&.${menuItemClasses.selected}`]: {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity),\n [`&.${menuItemClasses.focusVisible}`]: {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.focusOpacity}))` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.focusOpacity)\n }\n },\n [`&.${menuItemClasses.selected}:hover`]: {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / calc(${theme.vars.palette.action.selectedOpacity} + ${theme.vars.palette.action.hoverOpacity}))` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity + theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: theme.vars ? `rgba(${theme.vars.palette.primary.mainChannel} / ${theme.vars.palette.action.selectedOpacity})` : alpha(theme.palette.primary.main, theme.palette.action.selectedOpacity)\n }\n },\n [`&.${menuItemClasses.focusVisible}`]: {\n backgroundColor: (theme.vars || theme).palette.action.focus\n },\n [`&.${menuItemClasses.disabled}`]: {\n opacity: (theme.vars || theme).palette.action.disabledOpacity\n },\n [`& + .${dividerClasses.root}`]: {\n marginTop: theme.spacing(1),\n marginBottom: theme.spacing(1)\n },\n [`& + .${dividerClasses.inset}`]: {\n marginLeft: 52\n },\n [`& .${listItemTextClasses.root}`]: {\n marginTop: 0,\n marginBottom: 0\n },\n [`& .${listItemTextClasses.inset}`]: {\n paddingLeft: 36\n },\n [`& .${listItemIconClasses.root}`]: {\n minWidth: 36\n }\n}, !ownerState.dense && {\n [theme.breakpoints.up('sm')]: {\n minHeight: 'auto'\n }\n}, ownerState.dense && _extends({\n minHeight: 32,\n // https://material.io/components/menus#specs > Dense\n paddingTop: 4,\n paddingBottom: 4\n}, theme.typography.body2, {\n [`& .${listItemIconClasses.root} svg`]: {\n fontSize: '1.25rem'\n }\n})));\nconst MenuItem = /*#__PURE__*/React.forwardRef(function MenuItem(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiMenuItem'\n });\n\n const {\n autoFocus = false,\n component = 'li',\n dense = false,\n divider = false,\n disableGutters = false,\n focusVisibleClassName,\n role = 'menuitem',\n tabIndex: tabIndexProp\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const context = React.useContext(ListContext);\n const childContext = {\n dense: dense || context.dense || false,\n disableGutters\n };\n const menuItemRef = React.useRef(null);\n useEnhancedEffect(() => {\n if (autoFocus) {\n if (menuItemRef.current) {\n menuItemRef.current.focus();\n } else if (process.env.NODE_ENV !== 'production') {\n console.error('MUI: Unable to set focus to a MenuItem whose component has not been rendered.');\n }\n }\n }, [autoFocus]);\n\n const ownerState = _extends({}, props, {\n dense: childContext.dense,\n divider,\n disableGutters\n });\n\n const classes = useUtilityClasses(props);\n const handleRef = useForkRef(menuItemRef, ref);\n let tabIndex;\n\n if (!props.disabled) {\n tabIndex = tabIndexProp !== undefined ? tabIndexProp : -1;\n }\n\n return /*#__PURE__*/_jsx(ListContext.Provider, {\n value: childContext,\n children: /*#__PURE__*/_jsx(MenuItemRoot, _extends({\n ref: handleRef,\n role: role,\n tabIndex: tabIndex,\n component: component,\n focusVisibleClassName: clsx(classes.focusVisible, focusVisibleClassName)\n }, other, {\n ownerState: ownerState,\n classes: classes\n }))\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? MenuItem.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * If `true`, the list item is focused during the first mount.\n * Focus will also be triggered if the value changes from false to true.\n * @default false\n */\n autoFocus: PropTypes.bool,\n\n /**\n * The content of the component.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n\n /**\n * If `true`, compact vertical padding designed for keyboard and mouse input is used.\n * The prop defaults to the value inherited from the parent Menu component.\n * @default false\n */\n dense: PropTypes.bool,\n\n /**\n * @ignore\n */\n disabled: PropTypes.bool,\n\n /**\n * If `true`, the left and right padding is removed.\n * @default false\n */\n disableGutters: PropTypes.bool,\n\n /**\n * If `true`, a 1px light border is added to the bottom of the menu item.\n * @default false\n */\n divider: PropTypes.bool,\n\n /**\n * This prop can help identify which element has keyboard focus.\n * The class name will be applied when the element gains the focus through keyboard interaction.\n * It's a polyfill for the [CSS :focus-visible selector](https://drafts.csswg.org/selectors-4/#the-focus-visible-pseudo).\n * The rationale for using this feature [is explained here](https://github.com/WICG/focus-visible/blob/HEAD/explainer.md).\n * A [polyfill can be used](https://github.com/WICG/focus-visible) to apply a `focus-visible` class to other components\n * if needed.\n */\n focusVisibleClassName: PropTypes.string,\n\n /**\n * @ignore\n */\n role: PropTypes\n /* @typescript-to-proptypes-ignore */\n .string,\n\n /**\n * @ignore\n */\n selected: PropTypes.bool,\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\n /**\n * @default 0\n */\n tabIndex: PropTypes.number\n} : void 0;\nexport default MenuItem;","export function getValueFromOption(option) {\n if (typeof option === 'object' && option !== null) {\n return option.value;\n }\n\n return option;\n}\nexport function getValueFromValueOptions(value, valueOptions) {\n if (valueOptions === undefined) {\n return undefined;\n }\n\n const result = valueOptions.find(option => {\n const optionValue = getValueFromOption(option);\n return String(optionValue) === String(value);\n });\n return getValueFromOption(result);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"item\", \"applyValue\", \"type\", \"apiRef\", \"focusElementRef\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useId as useId } from '@mui/material/utils';\nimport MenuItem from '@mui/material/MenuItem';\nimport { GridLoadIcon } from '../../icons';\nimport { useGridRootProps } from '../../../hooks/utils/useGridRootProps';\nimport { getValueFromValueOptions } from './filterPanelUtils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst warnedOnce = {};\n\nfunction warnDeprecatedTypeSupport(type) {\n console.warn([`MUI: Using GridFilterInputValue with a \"${type}\" column is deprecated.`, 'Use GridFilterInputSingleSelect instead.'].join('\\n'));\n warnedOnce[type] = true;\n}\n\nconst renderSingleSelectOptions = ({\n valueOptions,\n valueFormatter,\n field\n}, api, OptionComponent) => {\n const iterableColumnValues = typeof valueOptions === 'function' ? ['', ...valueOptions({\n field\n })] : ['', ...(valueOptions || [])];\n return iterableColumnValues.map(option => {\n const isOptionTypeObject = typeof option === 'object';\n const key = isOptionTypeObject ? option.value : option;\n const value = isOptionTypeObject ? option.value : option;\n const formattedValue = valueFormatter && option !== '' ? valueFormatter({\n value: option,\n field,\n api\n }) : option;\n const content = isOptionTypeObject ? option.label : formattedValue;\n return /*#__PURE__*/_jsx(OptionComponent, {\n value: value,\n children: content\n }, key);\n });\n};\n\nexport const SUBMIT_FILTER_STROKE_TIME = 500;\n\nfunction GridFilterInputValue(props) {\n var _item$value, _rootProps$components, _baseSelectProps$nati, _rootProps$components2, _rootProps$components3;\n\n const {\n item,\n applyValue,\n type,\n apiRef,\n focusElementRef\n } = props,\n others = _objectWithoutPropertiesLoose(props, _excluded);\n\n if (process.env.NODE_ENV !== 'production' && ['date', 'datetime-local', 'singleSelect'].includes(type) && !warnedOnce[type]) {\n warnDeprecatedTypeSupport(type);\n }\n\n const filterTimeout = React.useRef();\n const [filterValueState, setFilterValueState] = React.useState((_item$value = item.value) != null ? _item$value : '');\n const [applying, setIsApplying] = React.useState(false);\n const id = useId();\n const rootProps = useGridRootProps();\n const baseSelectProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseSelect) || {};\n const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;\n const singleSelectProps = type === 'singleSelect' ? {\n select: true,\n SelectProps: _extends({\n native: isSelectNative\n }, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect),\n children: renderSingleSelectOptions(apiRef.current.getColumn(item.columnField), apiRef.current, isSelectNative ? 'option' : MenuItem)\n } : {};\n const onFilterChange = React.useCallback(event => {\n let value = event.target.value; // NativeSelect casts the value to a string.\n\n if (type === 'singleSelect') {\n const column = apiRef.current.getColumn(item.columnField);\n const columnValueOptions = typeof column.valueOptions === 'function' ? column.valueOptions({\n field: column.field\n }) : column.valueOptions;\n value = getValueFromValueOptions(value, columnValueOptions);\n }\n\n clearTimeout(filterTimeout.current);\n setFilterValueState(String(value));\n setIsApplying(true); // TODO singleSelect doesn't debounce\n\n filterTimeout.current = setTimeout(() => {\n applyValue(_extends({}, item, {\n value\n }));\n setIsApplying(false);\n }, SUBMIT_FILTER_STROKE_TIME);\n }, [apiRef, applyValue, item, type]);\n React.useEffect(() => {\n return () => {\n clearTimeout(filterTimeout.current);\n };\n }, []);\n React.useEffect(() => {\n var _item$value2;\n\n const itemValue = (_item$value2 = item.value) != null ? _item$value2 : '';\n setFilterValueState(String(itemValue));\n }, [item.value]);\n const InputProps = applying ? {\n endAdornment: /*#__PURE__*/_jsx(GridLoadIcon, {})\n } : others.InputProps;\n return /*#__PURE__*/_jsx(rootProps.components.BaseTextField, _extends({\n id: id,\n label: apiRef.current.getLocaleText('filterPanelInputLabel'),\n placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),\n value: filterValueState,\n onChange: onFilterChange,\n type: type || 'text',\n variant: \"standard\",\n InputProps: InputProps,\n InputLabelProps: {\n shrink: true\n },\n inputRef: focusElementRef\n }, singleSelectProps, others, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.baseTextField));\n}\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n apiRef: PropTypes.any.isRequired,\n applyValue: PropTypes.func.isRequired,\n focusElementRef: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.func, PropTypes.object]),\n item: PropTypes.shape({\n columnField: PropTypes.string.isRequired,\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n operatorValue: PropTypes.string,\n value: PropTypes.any\n }).isRequired\n} : void 0;\nexport { GridFilterInputValue };","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\", \"getValue\", \"isValidating\", \"debounceMs\", \"isProcessingProps\", \"onValueChange\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_composeClasses as composeClasses } from '@mui/material';\nimport { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';\nimport { styled } from '@mui/material/styles';\nimport InputBase from '@mui/material/InputBase';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { GridLoadIcon } from '../icons/index';\nimport { SUBMIT_FILTER_STROKE_TIME } from '../panel/filterPanel/GridFilterInputValue';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['editInputCell']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\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}));\n\nfunction GridEditInputCell(props) {\n var _rootProps$experiment;\n\n const rootProps = useGridRootProps();\n\n const {\n id,\n value,\n api,\n field,\n colDef,\n hasFocus,\n debounceMs = (_rootProps$experiment = rootProps.experimentalFeatures) != null && _rootProps$experiment.newEditingApi ? 200 : SUBMIT_FILTER_STROKE_TIME,\n isProcessingProps,\n onValueChange\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const inputRef = React.useRef();\n const [valueState, setValueState] = React.useState(value);\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.value;\n\n if (onValueChange) {\n await onValueChange(event, newValue);\n }\n\n setValueState(newValue);\n api.setEditCellValue({\n id,\n field,\n value: newValue,\n debounceMs\n }, event);\n }, [api, debounceMs, field, id, 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(GridEditInputCellRoot, _extends({\n inputRef: inputRef,\n className: classes.root,\n fullWidth: true,\n type: colDef.type === 'number' ? colDef.type : 'text',\n value: valueState != null ? valueState : '',\n onChange: handleChange,\n endAdornment: isProcessingProps ? /*#__PURE__*/_jsx(GridLoadIcon, {}) : undefined\n }, other));\n}\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * GridApi that let you manipulate the grid.\n * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)\n */\n api: PropTypes.any.isRequired,\n\n /**\n * The mode of the cell.\n */\n cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,\n\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 /**\n * The column field of the cell that triggered the event.\n */\n field: PropTypes.string.isRequired,\n\n /**\n * The cell value formatted with the column valueFormatter.\n */\n formattedValue: PropTypes.any,\n\n /**\n * Get the cell value of a row and field.\n * @param {GridRowId} id The row id.\n * @param {string} field The field.\n * @returns {any} The cell value.\n * @deprecated Use `params.row` to directly access the fields you want instead.\n */\n getValue: PropTypes.func.isRequired,\n\n /**\n * If true, the cell is the active element.\n */\n hasFocus: PropTypes.bool.isRequired,\n\n /**\n * The grid row id.\n */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n\n /**\n * If true, the cell is editable.\n */\n isEditable: PropTypes.bool,\n isProcessingProps: PropTypes.bool,\n isValidating: PropTypes.bool,\n\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 /**\n * The row model of the row that the current cell belongs to.\n */\n row: PropTypes.object.isRequired,\n\n /**\n * The node of the row that the current cell belongs to.\n */\n rowNode: PropTypes.object.isRequired,\n\n /**\n * the tabIndex value.\n */\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\n\n /**\n * The cell value, but if the column has valueGetter, use getValue.\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 { buildWarning } from '../../../utils/warning';\nconst sortModelDisableMultiColumnsSortingWarning = buildWarning(['MUI: 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');\nexport const sanitizeSortModel = (model, disableMultipleColumnsSorting) => {\n if (disableMultipleColumnsSorting && model.length > 1) {\n sortModelDisableMultiColumnsSortingWarning();\n return [model[0]];\n }\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});\n\nconst isDesc = direction => direction === 'desc';\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 */\n\n\nconst parseSortItem = (sortItem, apiRef) => {\n const column = apiRef.current.getColumn(sortItem.field);\n\n if (!column) {\n return null;\n }\n\n const comparator = isDesc(sortItem.sort) ? (...args) => -1 * column.sortComparator(...args) : column.sortComparator;\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\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 {GridSortCellParams} row1Params The params of the 1st row for each sort item.\n * @param {GridSortCellParams} row2Params The params of the 2nd row for each sort item.\n */\n\n\nconst compareRows = (parsedSortItems, row1Params, row2Params) => {\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\n const sortCellParams1 = row1Params[index];\n const sortCellParams2 = row2Params[index];\n res = item.comparator(sortCellParams1.value, sortCellParams2.value, sortCellParams1, sortCellParams2);\n return res;\n }, 0);\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 */\n\n\nexport const buildAggregatedSortingApplier = (sortModel, apiRef) => {\n const comparatorList = sortModel.map(item => parseSortItem(item, apiRef)).filter(comparator => !!comparator);\n\n if (comparatorList.length === 0) {\n return null;\n }\n\n return rowList => rowList.map(value => ({\n value,\n params: comparatorList.map(el => el.getSortCellParams(value.id))\n })).sort((a, b) => compareRows(comparatorList, a.params, b.params)).map(row => row.value.id);\n};\nexport const getNextGridSortDirection = (sortingOrder, current) => {\n const currentIdx = sortingOrder.indexOf(current);\n\n if (!current || currentIdx === -1 || currentIdx + 1 === sortingOrder.length) {\n return sortingOrder[0];\n }\n\n return sortingOrder[currentIdx + 1];\n};\n\nconst gridNillComparator = (v1, v2) => {\n if (v1 == null && v2 != null) {\n return -1;\n }\n\n if (v2 == null && v1 != null) {\n return 1;\n }\n\n if (v1 == null && v2 == null) {\n return 0;\n }\n\n return null;\n};\n\nconst collator = new Intl.Collator();\nexport const gridStringOrNumberComparator = (value1, value2) => {\n const nillResult = gridNillComparator(value1, value2);\n\n if (nillResult !== null) {\n return nillResult;\n }\n\n if (typeof value1 === 'string') {\n return collator.compare(value1.toString(), value2.toString());\n }\n\n return value1 - value2;\n};\nexport const gridNumberComparator = (value1, value2) => {\n const nillResult = gridNillComparator(value1, value2);\n\n if (nillResult !== null) {\n return nillResult;\n }\n\n return Number(value1) - Number(value2);\n};\nexport const gridDateComparator = (value1, value2) => {\n const nillResult = gridNillComparator(value1, value2);\n\n if (nillResult !== null) {\n return nillResult;\n }\n\n if (value1 > value2) {\n return 1;\n }\n\n if (value1 < value2) {\n return -1;\n }\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\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport Autocomplete from '@mui/material/Autocomplete';\nimport Chip from '@mui/material/Chip';\nimport TextField from '@mui/material/TextField';\nimport { unstable_useId as useId } from '@mui/material/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nfunction GridFilterInputMultipleValue(props) {\n const {\n item,\n applyValue,\n type,\n apiRef,\n focusElementRef\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const [filterValueState, setFilterValueState] = React.useState(item.value || []);\n const id = useId();\n React.useEffect(() => {\n var _item$value;\n\n const itemValue = (_item$value = item.value) != null ? _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 limitTags: 1,\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) => /*#__PURE__*/_jsx(Chip, _extends({\n variant: \"outlined\",\n size: \"small\",\n label: option\n }, getTagProps({\n index\n })))),\n renderInput: params => /*#__PURE__*/_jsx(TextField, _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 variant: \"standard\"\n }))\n }, other));\n}\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n apiRef: PropTypes.any.isRequired,\n applyValue: PropTypes.func.isRequired,\n focusElementRef: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.func, PropTypes.object]),\n item: PropTypes.shape({\n columnField: PropTypes.string.isRequired,\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n operatorValue: PropTypes.string,\n value: PropTypes.any\n }).isRequired,\n type: PropTypes.oneOf(['number', 'text'])\n} : void 0;\nexport { GridFilterInputMultipleValue };","import { GridFilterInputValue } from '../components/panel/filterPanel/GridFilterInputValue';\nimport { escapeRegExp } from '../utils/utils';\nimport { GridFilterInputMultipleValue } from '../components/panel/filterPanel/GridFilterInputMultipleValue';\nexport const getGridStringQuickFilterFn = value => {\n if (!value) {\n return null;\n }\n\n const filterRegex = new RegExp(escapeRegExp(value), 'i');\n return ({\n value: columnValue\n }) => {\n return columnValue != null ? filterRegex.test(columnValue.toString()) : false;\n };\n};\nexport const getGridStringOperators = () => [{\n value: 'contains',\n getApplyFilterFn: filterItem => {\n if (!filterItem.value) {\n return null;\n }\n\n const filterRegex = new RegExp(escapeRegExp(filterItem.value), 'i');\n return ({\n value\n }) => {\n return value != null ? filterRegex.test(value.toString()) : false;\n };\n },\n InputComponent: GridFilterInputValue\n}, {\n value: 'equals',\n getApplyFilterFn: filterItem => {\n if (!filterItem.value) {\n return null;\n }\n\n const collator = new Intl.Collator(undefined, {\n sensitivity: 'base',\n usage: 'search'\n });\n return ({\n value\n }) => {\n return value != null ? collator.compare(filterItem.value, value.toString()) === 0 : false;\n };\n },\n InputComponent: GridFilterInputValue\n}, {\n value: 'startsWith',\n getApplyFilterFn: filterItem => {\n if (!filterItem.value) {\n return null;\n }\n\n const filterRegex = new RegExp(`^${escapeRegExp(filterItem.value)}.*$`, 'i');\n return ({\n value\n }) => {\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\n const filterRegex = new RegExp(`.*${escapeRegExp(filterItem.value)}$`, 'i');\n return ({\n value\n }) => {\n return value != null ? filterRegex.test(value.toString()) : false;\n };\n },\n InputComponent: GridFilterInputValue\n}, {\n value: 'isEmpty',\n getApplyFilterFn: () => {\n return ({\n value\n }) => {\n return value === '' || value == null;\n };\n }\n}, {\n value: 'isNotEmpty',\n getApplyFilterFn: () => {\n return ({\n value\n }) => {\n return value !== '' && value != null;\n };\n }\n}, {\n value: 'isAnyOf',\n getApplyFilterFn: filterItem => {\n if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {\n return null;\n }\n\n const collator = new Intl.Collator(undefined, {\n sensitivity: 'base',\n usage: 'search'\n });\n return ({\n value\n }) => value != null ? filterItem.value.some(filterValue => {\n return collator.compare(filterValue, value.toString() || '') === 0;\n }) : false;\n },\n InputComponent: GridFilterInputMultipleValue\n}];","import { renderEditInputCell } from '../components/cell/GridEditInputCell';\nimport { gridStringOrNumberComparator } from '../hooks/features/sorting/gridSortingUtils';\nimport { getGridStringOperators, getGridStringQuickFilterFn } from './gridStringOperators';\nexport const GRID_STRING_COL_DEF = {\n width: 100,\n minWidth: 50,\n maxWidth: Infinity,\n hide: false,\n hideable: true,\n sortable: true,\n resizable: true,\n filterable: true,\n groupable: true,\n pinnable: true,\n editable: false,\n sortComparator: gridStringOrNumberComparator,\n type: 'string',\n align: 'left',\n filterOperators: getGridStringOperators(),\n renderEditCell: renderEditInputCell,\n getApplyQuickFilterFn: getGridStringQuickFilterFn\n};","import { GridFilterInputValue } from '../components/panel/filterPanel/GridFilterInputValue';\nimport { GridFilterInputMultipleValue } from '../components/panel/filterPanel/GridFilterInputMultipleValue';\nimport { wrapWithWarningOnCall } from '../utils/warning';\n\nconst parseNumericValue = value => {\n if (value == null) {\n return null;\n }\n\n return Number(value);\n};\n\nexport const getGridNumericQuickFilterFn = value => {\n if (value == null || Number.isNaN(value) || value === '') {\n return null;\n }\n\n return ({\n value: columnValue\n }) => {\n return parseNumericValue(columnValue) === parseNumericValue(value);\n };\n};\nexport const getGridNumericOperators = () => [{\n label: '=',\n value: '=',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || Number.isNaN(filterItem.value)) {\n return null;\n }\n\n return ({\n value\n }) => {\n return parseNumericValue(value) === filterItem.value;\n };\n },\n InputComponent: GridFilterInputValue,\n InputComponentProps: {\n type: 'number'\n }\n}, {\n label: '!=',\n value: '!=',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || Number.isNaN(filterItem.value)) {\n return null;\n }\n\n return ({\n value\n }) => {\n return parseNumericValue(value) !== filterItem.value;\n };\n },\n InputComponent: GridFilterInputValue,\n InputComponentProps: {\n type: 'number'\n }\n}, {\n label: '>',\n value: '>',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || Number.isNaN(filterItem.value)) {\n return null;\n }\n\n return ({\n value\n }) => {\n if (value == null) {\n return false;\n }\n\n return parseNumericValue(value) > filterItem.value;\n };\n },\n InputComponent: GridFilterInputValue,\n InputComponentProps: {\n type: 'number'\n }\n}, {\n label: '>=',\n value: '>=',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || Number.isNaN(filterItem.value)) {\n return null;\n }\n\n return ({\n value\n }) => {\n if (value == null) {\n return false;\n }\n\n return parseNumericValue(value) >= filterItem.value;\n };\n },\n InputComponent: GridFilterInputValue,\n InputComponentProps: {\n type: 'number'\n }\n}, {\n label: '<',\n value: '<',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || Number.isNaN(filterItem.value)) {\n return null;\n }\n\n return ({\n value\n }) => {\n if (value == null) {\n return false;\n }\n\n return parseNumericValue(value) < filterItem.value;\n };\n },\n InputComponent: GridFilterInputValue,\n InputComponentProps: {\n type: 'number'\n }\n}, {\n label: '<=',\n value: '<=',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || Number.isNaN(filterItem.value)) {\n return null;\n }\n\n return ({\n value\n }) => {\n if (value == null) {\n return false;\n }\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 ({\n value\n }) => {\n return value == null;\n };\n }\n}, {\n value: 'isNotEmpty',\n getApplyFilterFn: () => {\n return ({\n value\n }) => {\n return value != null;\n };\n }\n}, {\n value: 'isAnyOf',\n getApplyFilterFn: filterItem => {\n if (!Array.isArray(filterItem.value) || filterItem.value.length === 0) {\n return null;\n }\n\n return ({\n value\n }) => {\n return value != null && filterItem.value.includes(Number(value));\n };\n },\n InputComponent: GridFilterInputMultipleValue,\n InputComponentProps: {\n type: 'number'\n }\n}];\n/**\n * @deprecated Use `getGridNumericOperators` instead.\n */\n\nexport const getGridNumericColumnOperators = wrapWithWarningOnCall(getGridNumericOperators, ['MUI: The method getGridNumericColumnOperators is deprecated and will be removed in the next major version.', 'Use getGridNumericOperators instead.']);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { gridNumberComparator } from '../hooks/features/sorting/gridSortingUtils';\nimport { isNumber } from '../utils/utils';\nimport { getGridNumericOperators, getGridNumericQuickFilterFn } from './gridNumericOperators';\nimport { GRID_STRING_COL_DEF } from './gridStringColDef';\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: ({\n value\n }) => value && isNumber(value) && value.toLocaleString() || value,\n filterOperators: getGridNumericOperators(),\n getApplyQuickFilterFn: getGridNumericQuickFilterFn\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\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useId as useId } from '@mui/material/utils';\nimport { GridLoadIcon } from '../../icons';\nimport { useGridRootProps } from '../../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const SUBMIT_FILTER_DATE_STROKE_TIME = 500;\n\nfunction GridFilterInputDate(props) {\n var _item$value, _rootProps$components;\n\n const {\n item,\n applyValue,\n type,\n apiRef,\n focusElementRef,\n InputProps\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const filterTimeout = React.useRef();\n const [filterValueState, setFilterValueState] = React.useState((_item$value = item.value) != null ? _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 value = event.target.value;\n clearTimeout(filterTimeout.current);\n setFilterValueState(String(value));\n setIsApplying(true);\n filterTimeout.current = setTimeout(() => {\n applyValue(_extends({}, item, {\n value\n }));\n setIsApplying(false);\n }, SUBMIT_FILTER_DATE_STROKE_TIME);\n }, [applyValue, item]);\n React.useEffect(() => {\n return () => {\n clearTimeout(filterTimeout.current);\n };\n }, []);\n React.useEffect(() => {\n var _item$value2;\n\n const itemValue = (_item$value2 = item.value) != null ? _item$value2 : '';\n setFilterValueState(String(itemValue));\n }, [item.value]);\n return /*#__PURE__*/_jsx(rootProps.components.BaseTextField, _extends({\n id: id,\n label: apiRef.current.getLocaleText('filterPanelInputLabel'),\n placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),\n value: filterValueState,\n onChange: onFilterChange,\n type: type || 'text',\n variant: \"standard\",\n InputLabelProps: {\n shrink: true\n },\n inputRef: focusElementRef,\n InputProps: _extends({}, applying ? {\n endAdornment: /*#__PURE__*/_jsx(GridLoadIcon, {})\n } : {}, InputProps, {\n inputProps: _extends({\n max: type === 'datetime-local' ? '9999-12-31T23:59' : '9999-12-31'\n }, InputProps == null ? void 0 : InputProps.inputProps)\n })\n }, other, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseTextField));\n}\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n apiRef: PropTypes.any.isRequired,\n applyValue: PropTypes.func.isRequired,\n focusElementRef: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.func, PropTypes.object]),\n item: PropTypes.shape({\n columnField: PropTypes.string.isRequired,\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n operatorValue: PropTypes.string,\n value: PropTypes.any\n }).isRequired\n} : void 0;\nexport { GridFilterInputDate };","import { GridFilterInputDate } from '../components/panel/filterPanel/GridFilterInputDate';\nconst dateRegex = /(\\d+)-(\\d+)-(\\d+)/;\nconst dateTimeRegex = /(\\d+)-(\\d+)-(\\d+)T(\\d+):(\\d+)/;\n\nfunction buildApplyFilterFn(filterItem, compareFn, showTime, keepHours) {\n if (!filterItem.value) {\n return null;\n }\n\n const [year, month, day, hour, minute] = filterItem.value.match(showTime ? dateTimeRegex : dateRegex).slice(1).map(Number);\n const time = new Date(year, month - 1, day, hour || 0, minute || 0).getTime();\n return ({\n value\n }) => {\n if (!value) {\n return false;\n }\n\n const valueAsDate = value instanceof Date ? value : new Date(value.toString());\n\n if (keepHours) {\n return compareFn(valueAsDate.getTime(), time);\n } // Make a copy of the date to not reset the hours in the original object\n\n\n const dateCopy = value instanceof Date ? new Date(valueAsDate) : valueAsDate;\n const timeToCompare = dateCopy.setHours(showTime ? valueAsDate.getHours() : 0, showTime ? valueAsDate.getMinutes() : 0, 0, 0);\n return compareFn(timeToCompare, time);\n };\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 ({\n value\n }) => {\n return value == null;\n };\n }\n}, {\n value: 'isNotEmpty',\n getApplyFilterFn: () => {\n return ({\n value\n }) => {\n return value != null;\n };\n }\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\", \"getValue\", \"inputProps\", \"isValidating\", \"isProcessingProps\", \"onValueChange\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_composeClasses as composeClasses } from '@mui/material';\nimport { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';\nimport InputBase from '@mui/material/InputBase';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['editInputCell']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\n\nfunction GridEditDateCell(props) {\n const {\n id,\n value: valueProp,\n api,\n field,\n colDef,\n hasFocus,\n inputProps,\n onValueChange\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const isDateTime = colDef.type === 'dateTime';\n const inputRef = React.useRef();\n const valueTransformed = React.useMemo(() => {\n let parsedDate;\n\n if (valueProp == null) {\n parsedDate = null;\n } else if (valueProp instanceof Date) {\n parsedDate = valueProp;\n } else {\n parsedDate = new Date((valueProp != null ? valueProp : '').toString());\n }\n\n let formattedDate;\n\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\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 handleChange = React.useCallback(async event => {\n const newFormattedDate = event.target.value;\n let newParsedDate;\n\n if (newFormattedDate === '') {\n newParsedDate = null;\n } else {\n const [date, time] = newFormattedDate.split('T');\n const [year, month, day] = date.split('-');\n newParsedDate = new Date();\n newParsedDate.setFullYear(year, Number(month) - 1, day);\n newParsedDate.setHours(0, 0, 0, 0);\n\n if (time) {\n const [hours, minutes] = time.split(':');\n newParsedDate.setHours(Number(hours), Number(minutes), 0, 0);\n }\n }\n\n if (onValueChange) {\n await onValueChange(event, newParsedDate);\n }\n\n setValueState({\n parsed: newParsedDate,\n formatted: newFormattedDate\n });\n api.setEditCellValue({\n id,\n field,\n value: newParsedDate\n }, event);\n }, [api, field, id, onValueChange]);\n React.useEffect(() => {\n setValueState(state => {\n var _valueTransformed$par, _state$parsed;\n\n if (valueTransformed.parsed !== state.parsed && ((_valueTransformed$par = valueTransformed.parsed) == null ? void 0 : _valueTransformed$par.getTime()) !== ((_state$parsed = state.parsed) == null ? void 0 : _state$parsed.getTime())) {\n return valueTransformed;\n }\n\n return state;\n });\n }, [valueTransformed]);\n useEnhancedEffect(() => {\n if (hasFocus) {\n inputRef.current.focus();\n }\n }, [hasFocus]);\n return /*#__PURE__*/_jsx(InputBase, _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}\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * GridApi that let you manipulate the grid.\n * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)\n */\n api: PropTypes.any.isRequired,\n\n /**\n * The mode of the cell.\n */\n cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,\n\n /**\n * The column of the row that the current cell belongs to.\n */\n colDef: PropTypes.object.isRequired,\n\n /**\n * The column field of the cell that triggered the event.\n */\n field: PropTypes.string.isRequired,\n\n /**\n * The cell value formatted with the column valueFormatter.\n */\n formattedValue: PropTypes.any,\n\n /**\n * Get the cell value of a row and field.\n * @param {GridRowId} id The row id.\n * @param {string} field The field.\n * @returns {any} The cell value.\n * @deprecated Use `params.row` to directly access the fields you want instead.\n */\n getValue: PropTypes.func.isRequired,\n\n /**\n * If true, the cell is the active element.\n */\n hasFocus: PropTypes.bool.isRequired,\n\n /**\n * The grid row id.\n */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n\n /**\n * If true, the cell is editable.\n */\n isEditable: PropTypes.bool,\n isProcessingProps: PropTypes.bool,\n isValidating: PropTypes.bool,\n\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 /**\n * The row model of the row that the current cell belongs to.\n */\n row: PropTypes.object.isRequired,\n\n /**\n * The node of the row that the current cell belongs to.\n */\n rowNode: PropTypes.object.isRequired,\n\n /**\n * the tabIndex value.\n */\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\n\n /**\n * The cell value, but if the column has valueGetter, use getValue.\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';\nimport { getGridDateOperators } from './gridDateOperators';\nimport { GRID_STRING_COL_DEF } from './gridStringColDef';\nimport { renderEditDateCell } from '../components/cell/GridEditDateCell';\nexport function gridDateFormatter({\n value\n}) {\n if (value instanceof Date) {\n return value.toLocaleDateString();\n }\n\n return value != null ? value : '';\n}\nexport function gridDateTimeFormatter({\n value\n}) {\n if (value instanceof Date) {\n return value.toLocaleString();\n }\n\n return value != null ? value : '';\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 getApplyQuickFilterFn: undefined\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 getApplyQuickFilterFn: undefined\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\", \"getValue\"];\nimport * as React from 'react';\nimport { unstable_composeClasses as composeClasses } from '@mui/material';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['booleanCell']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\n\nexport const GridBooleanCell = /*#__PURE__*/React.memo(props => {\n const {\n value,\n api\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes\n };\n const classes = useUtilityClasses(ownerState);\n const Icon = React.useMemo(() => value ? rootProps.components.BooleanCellTrueIcon : rootProps.components.BooleanCellFalseIcon, [rootProps.components.BooleanCellFalseIcon, rootProps.components.BooleanCellTrueIcon, value]);\n return /*#__PURE__*/_jsx(Icon, _extends({\n fontSize: \"small\",\n className: classes.root,\n titleAccess: api.getLocaleText(value ? 'booleanCellTrueLabel' : 'booleanCellFalseLabel'),\n \"data-value\": Boolean(value)\n }, other));\n});\nexport const renderBooleanCell = params => {\n if (params.rowNode.isAutoGenerated) {\n return '';\n }\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\", \"getValue\", \"hasFocus\", \"isValidating\", \"isProcessingProps\", \"error\", \"onValueChange\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/material';\nimport { unstable_useId as useId, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['editBooleanCell']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\n\nfunction GridEditBooleanCell(props) {\n var _rootProps$components;\n\n const {\n id: idProp,\n value,\n api,\n field,\n className,\n hasFocus,\n onValueChange\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\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\n if (onValueChange) {\n await onValueChange(event, newValue);\n }\n\n setValueState(newValue);\n await api.setEditCellValue({\n id: idProp,\n field,\n value: newValue\n }, event);\n }, [api, 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.components.BaseCheckbox, _extends({\n id: id,\n inputRef: inputRef,\n checked: Boolean(valueState),\n onChange: handleChange,\n size: \"small\"\n }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseCheckbox))\n }));\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * GridApi that let you manipulate the grid.\n * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)\n */\n api: PropTypes.any.isRequired,\n\n /**\n * The mode of the cell.\n */\n cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,\n\n /**\n * The column of the row that the current cell belongs to.\n */\n colDef: PropTypes.object.isRequired,\n\n /**\n * The column field of the cell that triggered the event.\n */\n field: PropTypes.string.isRequired,\n\n /**\n * The cell value formatted with the column valueFormatter.\n */\n formattedValue: PropTypes.any,\n\n /**\n * Get the cell value of a row and field.\n * @param {GridRowId} id The row id.\n * @param {string} field The field.\n * @returns {any} The cell value.\n * @deprecated Use `params.row` to directly access the fields you want instead.\n */\n getValue: PropTypes.func.isRequired,\n\n /**\n * If true, the cell is the active element.\n */\n hasFocus: PropTypes.bool.isRequired,\n\n /**\n * The grid row id.\n */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n\n /**\n * If true, the cell is editable.\n */\n isEditable: PropTypes.bool,\n isProcessingProps: PropTypes.bool,\n isValidating: PropTypes.bool,\n\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 /**\n * The row model of the row that the current cell belongs to.\n */\n row: PropTypes.object.isRequired,\n\n /**\n * The node of the row that the current cell belongs to.\n */\n rowNode: PropTypes.object.isRequired,\n\n /**\n * the tabIndex value.\n */\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\n\n /**\n * The cell value, but if the column has valueGetter, use getValue.\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\"];\nimport * as React from 'react';\nimport MenuItem from '@mui/material/MenuItem';\nimport { useGridRootProps } from '../../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nexport function GridFilterInputBoolean(props) {\n var _rootProps$components, _baseSelectProps$nati, _rootProps$components2, _rootProps$components3;\n\n const {\n item,\n applyValue,\n apiRef,\n focusElementRef\n } = props,\n others = _objectWithoutPropertiesLoose(props, _excluded);\n\n const [filterValueState, setFilterValueState] = React.useState(item.value || '');\n const rootProps = useGridRootProps();\n const baseSelectProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseSelect) || {};\n const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;\n const OptionComponent = isSelectNative ? 'option' : MenuItem;\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 return /*#__PURE__*/_jsxs(rootProps.components.BaseTextField, _extends({\n label: apiRef.current.getLocaleText('filterPanelInputLabel'),\n value: filterValueState,\n onChange: onFilterChange,\n variant: \"standard\",\n select: true,\n SelectProps: _extends({\n native: isSelectNative,\n displayEmpty: true\n }, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect),\n InputLabelProps: {\n shrink: true\n },\n inputRef: focusElementRef\n }, others, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.baseTextField, {\n children: [/*#__PURE__*/_jsx(OptionComponent, {\n value: \"\",\n children: apiRef.current.getLocaleText('filterValueAny')\n }), /*#__PURE__*/_jsx(OptionComponent, {\n value: \"true\",\n children: apiRef.current.getLocaleText('filterValueTrue')\n }), /*#__PURE__*/_jsx(OptionComponent, {\n value: \"false\",\n children: apiRef.current.getLocaleText('filterValueFalse')\n })]\n }));\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { GRID_STRING_COL_DEF } from './gridStringColDef';\nimport { renderBooleanCell } from '../components/cell/GridBooleanCell';\nimport { renderEditBooleanCell } from '../components/cell/GridEditBooleanCell';\nimport { gridNumberComparator } from '../hooks/features/sorting/gridSortingUtils';\nimport { getGridBooleanOperators } from './gridBooleanOperators';\n\nfunction gridBooleanFormatter({\n value,\n api\n}) {\n return value ? api.getLocaleText('booleanCellTrueLabel') : api.getLocaleText('booleanCellFalseLabel');\n}\n\nexport const GRID_BOOLEAN_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {\n type: 'boolean',\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});","// TODO v6: rename to GridEditingState\nvar GridEditModes;\n\n(function (GridEditModes) {\n GridEditModes[\"Cell\"] = \"cell\";\n GridEditModes[\"Row\"] = \"row\";\n})(GridEditModes || (GridEditModes = {}));\n\nvar GridCellModes;\n\n(function (GridCellModes) {\n GridCellModes[\"Edit\"] = \"edit\";\n GridCellModes[\"View\"] = \"view\";\n})(GridCellModes || (GridCellModes = {}));\n\nvar GridRowModes;\n\n(function (GridRowModes) {\n GridRowModes[\"Edit\"] = \"edit\";\n GridRowModes[\"View\"] = \"view\";\n})(GridRowModes || (GridRowModes = {}));\n\nexport { GridEditModes, GridCellModes, GridRowModes };","import { GridFilterInputBoolean } from '../components/panel/filterPanel/GridFilterInputBoolean';\nexport const getGridBooleanOperators = () => [{\n value: 'is',\n getApplyFilterFn: filterItem => {\n if (!filterItem.value) {\n return null;\n }\n\n const valueAsBoolean = filterItem.value === 'true';\n return ({\n value\n }) => {\n return Boolean(value) === valueAsBoolean;\n };\n },\n InputComponent: GridFilterInputBoolean\n}];","export const isEscapeKey = key => key === 'Escape'; // TODO remove\n\nexport const isEnterKey = key => key === 'Enter'; // TODO remove\n\nexport const isTabKey = key => key === 'Tab'; // TODO remove\n\nexport const isSpaceKey = key => key === ' ';\nexport const isArrowKeys = key => key.indexOf('Arrow') === 0;\nexport const isHomeOrEndKeys = key => key === 'Home' || key === 'End';\nexport const isPageKeys = key => key.indexOf('Page') === 0;\nexport const isDeleteKeys = key => key === 'Delete' || key === 'Backspace';\nconst printableCharRegex = /^(\\p{L}|\\p{M}\\p{L}|\\p{M}|\\p{N}|\\p{Z}|\\p{S}|\\p{P})$/iu;\nexport const isPrintableKey = key => printableCharRegex.test(key);\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 = key => isEnterKey(key) || isDeleteKeys(key) || isPrintableKey(key);\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 => isHomeOrEndKeys(key) || isArrowKeys(key) || isPageKeys(key) || isSpaceKey(key);\nexport const isKeyboardEvent = event => !!event.key;\nexport const isHideMenuKey = key => isTabKey(key) || isEscapeKey(key);","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\", \"getValue\", \"hasFocus\", \"isValidating\", \"isProcessingProps\", \"error\", \"onValueChange\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';\nimport MenuItem from '@mui/material/MenuItem';\nimport { isEscapeKey } from '../../utils/keyboardUtils';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { GridEditModes } from '../../models/gridEditRowModel';\nimport { getValueFromValueOptions } from '../panel/filterPanel/filterPanelUtils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst renderSingleSelectOptions = (option, OptionComponent) => {\n const isOptionTypeObject = typeof option === 'object';\n const key = isOptionTypeObject ? option.value : option;\n const value = isOptionTypeObject ? option.value : option;\n const content = isOptionTypeObject ? option.label : option;\n return /*#__PURE__*/_jsx(OptionComponent, {\n value: value,\n children: content\n }, key);\n};\n\nfunction GridEditSingleSelectCell(props) {\n var _rootProps$components, _baseSelectProps$nati, _rootProps$components2;\n\n const {\n id,\n value,\n api,\n field,\n row,\n colDef,\n hasFocus,\n error,\n onValueChange\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const ref = React.useRef();\n const inputRef = React.useRef();\n const rootProps = useGridRootProps();\n const [open, setOpen] = React.useState(rootProps.editMode === 'cell');\n const baseSelectProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseSelect) || {};\n const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : false;\n let valueOptionsFormatted;\n\n if (typeof colDef.valueOptions === 'function') {\n valueOptionsFormatted = colDef.valueOptions({\n id,\n row,\n field\n });\n } else {\n valueOptionsFormatted = colDef.valueOptions;\n }\n\n if (colDef.valueFormatter) {\n valueOptionsFormatted = valueOptionsFormatted.map(option => {\n if (typeof option === 'object') {\n return option;\n }\n\n const params = {\n field,\n api,\n value: option\n };\n return {\n value: option,\n label: String(colDef.valueFormatter(params))\n };\n });\n }\n\n const handleChange = async event => {\n var _rootProps$experiment;\n\n setOpen(false);\n const target = event.target; // NativeSelect casts the value to a string.\n\n const formattedTargetValue = getValueFromValueOptions(target.value, valueOptionsFormatted);\n\n if (onValueChange) {\n await onValueChange(event, formattedTargetValue);\n }\n\n const isValid = await api.setEditCellValue({\n id,\n field,\n value: formattedTargetValue\n }, event);\n\n if ((_rootProps$experiment = rootProps.experimentalFeatures) != null && _rootProps$experiment.newEditingApi) {\n return;\n } // We use isValid === false because the default return is undefined which evaluates to true with !isValid\n\n\n if (rootProps.editMode === GridEditModes.Row || isValid === false) {\n return;\n }\n\n const canCommit = await Promise.resolve(api.commitCellChange({\n id,\n field\n }, event));\n\n if (canCommit) {\n api.setCellMode(id, field, 'view');\n\n if (event.key) {\n // TODO v6: remove once we stop ignoring events fired from portals\n const params = api.getCellParams(id, field);\n api.publishEvent('cellNavigationKeyDown', params, event);\n }\n }\n };\n\n const handleClose = (event, reason) => {\n if (rootProps.editMode === GridEditModes.Row) {\n setOpen(false);\n return;\n }\n\n if (reason === 'backdropClick' || isEscapeKey(event.key)) {\n var _rootProps$experiment2;\n\n if ((_rootProps$experiment2 = rootProps.experimentalFeatures) != null && _rootProps$experiment2.newEditingApi) {\n api.stopCellEditMode({\n id,\n field,\n ignoreModifications: true\n });\n } else {\n api.setCellMode(id, field, 'view');\n }\n }\n };\n\n const handleOpen = () => {\n setOpen(true);\n };\n\n useEnhancedEffect(() => {\n if (hasFocus) {\n inputRef.current.focus();\n }\n }, [hasFocus]);\n return /*#__PURE__*/_jsx(rootProps.components.BaseSelect, _extends({\n ref: ref,\n inputRef: inputRef,\n value: value,\n onChange: handleChange,\n open: open,\n onOpen: handleOpen,\n MenuProps: {\n onClose: handleClose\n },\n error: error,\n native: isSelectNative,\n fullWidth: true\n }, other, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect, {\n children: valueOptionsFormatted.map(valueOptions => renderSingleSelectOptions(valueOptions, isSelectNative ? 'option' : MenuItem))\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * GridApi that let you manipulate the grid.\n * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)\n */\n api: PropTypes.any.isRequired,\n\n /**\n * The mode of the cell.\n */\n cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,\n\n /**\n * The column of the row that the current cell belongs to.\n */\n colDef: PropTypes.object.isRequired,\n\n /**\n * The column field of the cell that triggered the event.\n */\n field: PropTypes.string.isRequired,\n\n /**\n * The cell value formatted with the column valueFormatter.\n */\n formattedValue: PropTypes.any,\n\n /**\n * Get the cell value of a row and field.\n * @param {GridRowId} id The row id.\n * @param {string} field The field.\n * @returns {any} The cell value.\n * @deprecated Use `params.row` to directly access the fields you want instead.\n */\n getValue: PropTypes.func.isRequired,\n\n /**\n * If true, the cell is the active element.\n */\n hasFocus: PropTypes.bool.isRequired,\n\n /**\n * The grid row id.\n */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n\n /**\n * If true, the cell is editable.\n */\n isEditable: PropTypes.bool,\n isProcessingProps: PropTypes.bool,\n isValidating: PropTypes.bool,\n\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 /**\n * The row model of the row that the current cell belongs to.\n */\n row: PropTypes.object.isRequired,\n\n /**\n * The node of the row that the current cell belongs to.\n */\n rowNode: PropTypes.object.isRequired,\n\n /**\n * the tabIndex value.\n */\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\n\n /**\n * The cell value, but if the column has valueGetter, use getValue.\n */\n value: PropTypes.any\n} : void 0;\nexport { GridEditSingleSelectCell };\nexport const renderEditSingleSelectCell = params => /*#__PURE__*/_jsx(GridEditSingleSelectCell, _extends({}, params));","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"item\", \"applyValue\", \"type\", \"apiRef\", \"focusElementRef\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_useId as useId } from '@mui/material/utils';\nimport MenuItem from '@mui/material/MenuItem';\nimport { useGridRootProps } from '../../../hooks/utils/useGridRootProps';\nimport { getValueFromValueOptions } from './filterPanelUtils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst renderSingleSelectOptions = ({\n valueOptions,\n valueFormatter,\n field\n}, api, OptionComponent) => {\n const iterableColumnValues = typeof valueOptions === 'function' ? ['', ...valueOptions({\n field\n })] : ['', ...(valueOptions || [])];\n return iterableColumnValues.map(option => {\n const isOptionTypeObject = typeof option === 'object';\n const key = isOptionTypeObject ? option.value : option;\n const value = isOptionTypeObject ? option.value : option;\n const formattedValue = valueFormatter && option !== '' ? valueFormatter({\n value: option,\n field,\n api\n }) : option;\n const content = isOptionTypeObject ? option.label : formattedValue;\n return /*#__PURE__*/_jsx(OptionComponent, {\n value: value,\n children: content\n }, key);\n });\n};\n\nfunction GridFilterInputSingleSelect(props) {\n var _item$value, _rootProps$components, _baseSelectProps$nati, _rootProps$components2, _rootProps$components3;\n\n const {\n item,\n applyValue,\n type,\n apiRef,\n focusElementRef\n } = props,\n others = _objectWithoutPropertiesLoose(props, _excluded);\n\n const [filterValueState, setFilterValueState] = React.useState((_item$value = item.value) != null ? _item$value : '');\n const id = useId();\n const rootProps = useGridRootProps();\n const baseSelectProps = ((_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.baseSelect) || {};\n const isSelectNative = (_baseSelectProps$nati = baseSelectProps.native) != null ? _baseSelectProps$nati : true;\n const currentColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;\n const currentValueOptions = React.useMemo(() => {\n return typeof currentColumn.valueOptions === 'function' ? currentColumn.valueOptions({\n field: currentColumn.field\n }) : currentColumn.valueOptions;\n }, [currentColumn]);\n const onFilterChange = React.useCallback(event => {\n let value = event.target.value; // NativeSelect casts the value to a string.\n\n value = getValueFromValueOptions(value, currentValueOptions);\n setFilterValueState(String(value));\n applyValue(_extends({}, item, {\n value\n }));\n }, [applyValue, item, currentValueOptions]);\n React.useEffect(() => {\n var _itemValue;\n\n let itemValue;\n\n if (currentValueOptions !== undefined) {\n // sanitize if valueOptions are provided\n itemValue = getValueFromValueOptions(item.value, currentValueOptions);\n\n if (itemValue !== item.value) {\n applyValue(_extends({}, item, {\n value: itemValue\n }));\n return;\n }\n } else {\n itemValue = item.value;\n }\n\n itemValue = (_itemValue = itemValue) != null ? _itemValue : '';\n setFilterValueState(String(itemValue));\n }, [item, currentValueOptions, applyValue]);\n return /*#__PURE__*/_jsx(rootProps.components.BaseTextField, _extends({\n id: id,\n label: apiRef.current.getLocaleText('filterPanelInputLabel'),\n placeholder: apiRef.current.getLocaleText('filterPanelInputPlaceholder'),\n value: filterValueState,\n onChange: onFilterChange,\n type: type || 'text',\n variant: \"standard\",\n InputLabelProps: {\n shrink: true\n },\n inputRef: focusElementRef,\n select: true,\n SelectProps: _extends({\n native: isSelectNative\n }, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.baseSelect)\n }, others, (_rootProps$components3 = rootProps.componentsProps) == null ? void 0 : _rootProps$components3.baseTextField, {\n children: renderSingleSelectOptions(apiRef.current.getColumn(item.columnField), apiRef.current, isSelectNative ? 'option' : MenuItem)\n }));\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n apiRef: PropTypes.any.isRequired,\n applyValue: PropTypes.func.isRequired,\n focusElementRef: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.func, PropTypes.object]),\n item: PropTypes.shape({\n columnField: PropTypes.string.isRequired,\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n operatorValue: PropTypes.string,\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\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport Autocomplete, { createFilterOptions } from '@mui/material/Autocomplete';\nimport Chip from '@mui/material/Chip';\nimport TextField from '@mui/material/TextField';\nimport { unstable_useId as useId } from '@mui/material/utils';\nimport { getValueFromOption } from './filterPanelUtils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst isOptionEqualToValue = (option, value) => getValueFromOption(option) === getValueFromOption(value);\n\nconst filter = createFilterOptions();\n\nfunction GridFilterInputMultipleSingleSelect(props) {\n const {\n item,\n applyValue,\n apiRef,\n focusElementRef\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const id = useId();\n const resolvedColumn = item.columnField ? apiRef.current.getColumn(item.columnField) : null;\n const resolvedValueOptions = React.useMemo(() => {\n return typeof (resolvedColumn == null ? void 0 : resolvedColumn.valueOptions) === 'function' ? resolvedColumn.valueOptions({\n field: resolvedColumn.field\n }) : resolvedColumn == null ? void 0 : resolvedColumn.valueOptions;\n }, [resolvedColumn]);\n const resolvedFormattedValueOptions = React.useMemo(() => {\n return resolvedValueOptions == null ? void 0 : resolvedValueOptions.map(getValueFromOption);\n }, [resolvedValueOptions]);\n const {\n valueFormatter,\n field\n } = apiRef.current.getColumn(item.columnField);\n\n const filterValueOptionFormatter = option => {\n if (typeof option === 'object') {\n return option.label;\n }\n\n return valueFormatter && option !== '' ? valueFormatter({\n value: option,\n field,\n api: apiRef.current\n }) : option;\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\n\n const filterValues = React.useMemo(() => {\n if (!Array.isArray(item.value)) {\n return [];\n }\n\n if (resolvedValueOptions !== undefined) {\n const itemValueIndexes = item.value.map(element => {\n // get the index matching between values and valueoptions\n const formattedElement = getValueFromOption(element);\n const index = (resolvedFormattedValueOptions == null ? void 0 : resolvedFormattedValueOptions.findIndex(formatedOption => formatedOption === formattedElement)) || 0;\n return index;\n });\n return itemValueIndexes.filter(index => index >= 0).map(index => resolvedValueOptions[index]);\n }\n\n return item.value;\n }, [item.value, resolvedValueOptions, resolvedFormattedValueOptions]);\n React.useEffect(() => {\n if (!Array.isArray(item.value) || filterValues.length !== item.value.length) {\n // update the state if the filter value has been cleaned by the component\n applyValue(_extends({}, item, {\n value: filterValues.map(getValueFromOption)\n }));\n }\n }, [item, filterValues, applyValue]);\n const handleChange = React.useCallback((event, value) => {\n applyValue(_extends({}, item, {\n value: [...value.map(getValueFromOption)]\n }));\n }, [applyValue, item]);\n return /*#__PURE__*/_jsx(Autocomplete, _extends({\n multiple: true,\n freeSolo: false,\n limitTags: 1,\n options: resolvedValueOptions // TODO: avoid `any`?\n ,\n isOptionEqualToValue: isOptionEqualToValue,\n filterOptions: filter,\n id: id,\n value: filterValues,\n onChange: handleChange,\n renderTags: (value, getTagProps) => value.map((option, index) => /*#__PURE__*/_jsx(Chip, _extends({\n variant: \"outlined\",\n size: \"small\",\n label: filterValueOptionFormatter(option)\n }, getTagProps({\n index\n })))),\n renderInput: params => /*#__PURE__*/_jsx(TextField, _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 variant: \"standard\"\n }))\n }, other));\n}\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n apiRef: PropTypes.shape({\n current: PropTypes.object.isRequired\n }).isRequired,\n applyValue: PropTypes.func.isRequired,\n focusElementRef: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.func, PropTypes.object]),\n item: PropTypes.shape({\n columnField: PropTypes.string.isRequired,\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),\n operatorValue: PropTypes.string,\n value: PropTypes.any\n }).isRequired,\n type: PropTypes.oneOf(['singleSelect'])\n} : void 0;\nexport { GridFilterInputMultipleSingleSelect };","import { GridFilterInputSingleSelect } from '../components/panel/filterPanel/GridFilterInputSingleSelect';\nimport { GridFilterInputMultipleSingleSelect } from '../components/panel/filterPanel/GridFilterInputMultipleSingleSelect';\n\nconst parseObjectValue = value => {\n if (value == null || typeof value !== 'object') {\n return value;\n }\n\n return value.value;\n};\n\nexport const getGridSingleSelectQuickFilterFn = (value, column, apiRef) => {\n if (!value) {\n return null;\n }\n\n const {\n valueOptions,\n valueFormatter,\n field\n } = column;\n const potentialValues = [parseObjectValue(value).toString()];\n const iterableColumnValues = typeof valueOptions === 'function' ? valueOptions({\n field\n }) : valueOptions || [];\n\n if (iterableColumnValues) {\n iterableColumnValues.forEach(option => {\n // for each valueOption, check if the formatted value\n let optionValue;\n let optionLabel;\n\n if (typeof option === 'object') {\n optionValue = option.value;\n optionLabel = option.label;\n } else {\n optionValue = option;\n\n if (valueFormatter) {\n optionLabel = valueFormatter({\n value: option,\n field,\n api: apiRef.current\n });\n } else {\n optionLabel = option;\n }\n }\n\n if (optionLabel.slice(0, value.length).toLowerCase() === value.toLowerCase()) {\n if (!potentialValues.includes(optionValue)) {\n potentialValues.push(optionValue.toString());\n }\n }\n });\n }\n\n return ({\n value: columnValue\n }) => {\n return columnValue != null ? potentialValues.includes(parseObjectValue(columnValue).toString()) : false;\n };\n};\nexport const getGridSingleSelectOperators = () => [{\n value: 'is',\n getApplyFilterFn: filterItem => {\n if (filterItem.value == null || filterItem.value === '') {\n return null;\n }\n\n return ({\n value\n }) => 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\n return ({\n value\n }) => 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\n const filterItemValues = filterItem.value.map(parseObjectValue);\n return ({\n value\n }) => filterItemValues.includes(parseObjectValue(value));\n },\n InputComponent: GridFilterInputMultipleSingleSelect\n}];","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { GRID_STRING_COL_DEF } from './gridStringColDef';\nimport { renderEditSingleSelectCell } from '../components/cell/GridEditSingleSelectCell';\nimport { getGridSingleSelectOperators, getGridSingleSelectQuickFilterFn } from './gridSingleSelectOperators';\nexport const GRID_SINGLE_SELECT_COL_DEF = _extends({}, GRID_STRING_COL_DEF, {\n type: 'singleSelect',\n renderEditCell: renderEditSingleSelectCell,\n filterOperators: getGridSingleSelectOperators(),\n getApplyQuickFilterFn: getGridSingleSelectQuickFilterFn\n});","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { elementAcceptingRef, exactProp, unstable_ownerDocument as ownerDocument, unstable_useForkRef as useForkRef, unstable_useEventCallback as useEventCallback } from '@mui/utils'; // TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase : never` once generatePropTypes runs with TS 4.1\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nfunction mapEventPropToEvent(eventProp) {\n return eventProp.substring(2).toLowerCase();\n}\n\nfunction clickedRootScrollbar(event, doc) {\n return doc.documentElement.clientWidth < event.clientX || doc.documentElement.clientHeight < event.clientY;\n}\n\n/**\n * Listen for click events that occur somewhere in the document, outside of the element itself.\n * For instance, if you need to hide a menu when people click anywhere else on your page.\n *\n * Demos:\n *\n * - [Click away listener](https://mui.com/base/react-click-away-listener/)\n *\n * API:\n *\n * - [ClickAwayListener API](https://mui.com/base/api/click-away-listener/)\n */\nfunction ClickAwayListener(props) {\n const {\n children,\n disableReactTree = false,\n mouseEvent = 'onClick',\n onClickAway,\n touchEvent = 'onTouchEnd'\n } = props;\n const movedRef = React.useRef(false);\n const nodeRef = React.useRef(null);\n const activatedRef = React.useRef(false);\n const syntheticEventRef = React.useRef(false);\n React.useEffect(() => {\n // Ensure that this component is not \"activated\" synchronously.\n // https://github.com/facebook/react/issues/20074\n setTimeout(() => {\n activatedRef.current = true;\n }, 0);\n return () => {\n activatedRef.current = false;\n };\n }, []);\n const handleRef = useForkRef( // @ts-expect-error TODO upstream fix\n children.ref, nodeRef); // The handler doesn't take event.defaultPrevented into account:\n //\n // event.preventDefault() is meant to stop default behaviors like\n // clicking a checkbox to check it, hitting a button to submit a form,\n // and hitting left arrow to move the cursor in a text input etc.\n // Only special HTML elements have these default behaviors.\n\n const handleClickAway = useEventCallback(event => {\n // Given developers can stop the propagation of the synthetic event,\n // we can only be confident with a positive value.\n const insideReactTree = syntheticEventRef.current;\n syntheticEventRef.current = false;\n const doc = ownerDocument(nodeRef.current); // 1. IE11 support, which trigger the handleClickAway even after the unbind\n // 2. The child might render null.\n // 3. Behave like a blur listener.\n\n if (!activatedRef.current || !nodeRef.current || 'clientX' in event && clickedRootScrollbar(event, doc)) {\n return;\n } // Do not act if user performed touchmove\n\n\n if (movedRef.current) {\n movedRef.current = false;\n return;\n }\n\n let insideDOM; // If not enough, can use https://github.com/DieterHolvoet/event-propagation-path/blob/master/propagationPath.js\n\n if (event.composedPath) {\n insideDOM = event.composedPath().indexOf(nodeRef.current) > -1;\n } else {\n insideDOM = !doc.documentElement.contains( // @ts-expect-error returns `false` as intended when not dispatched from a Node\n event.target) || nodeRef.current.contains( // @ts-expect-error returns `false` as intended when not dispatched from a Node\n event.target);\n }\n\n if (!insideDOM && (disableReactTree || !insideReactTree)) {\n onClickAway(event);\n }\n }); // Keep track of mouse/touch events that bubbled up through the portal.\n\n const createHandleSynthetic = handlerName => event => {\n syntheticEventRef.current = true;\n const childrenPropsHandler = children.props[handlerName];\n\n if (childrenPropsHandler) {\n childrenPropsHandler(event);\n }\n };\n\n const childrenProps = {\n ref: handleRef\n };\n\n if (touchEvent !== false) {\n childrenProps[touchEvent] = createHandleSynthetic(touchEvent);\n }\n\n React.useEffect(() => {\n if (touchEvent !== false) {\n const mappedTouchEvent = mapEventPropToEvent(touchEvent);\n const doc = ownerDocument(nodeRef.current);\n\n const handleTouchMove = () => {\n movedRef.current = true;\n };\n\n doc.addEventListener(mappedTouchEvent, handleClickAway);\n doc.addEventListener('touchmove', handleTouchMove);\n return () => {\n doc.removeEventListener(mappedTouchEvent, handleClickAway);\n doc.removeEventListener('touchmove', handleTouchMove);\n };\n }\n\n return undefined;\n }, [handleClickAway, touchEvent]);\n\n if (mouseEvent !== false) {\n childrenProps[mouseEvent] = createHandleSynthetic(mouseEvent);\n }\n\n React.useEffect(() => {\n if (mouseEvent !== false) {\n const mappedMouseEvent = mapEventPropToEvent(mouseEvent);\n const doc = ownerDocument(nodeRef.current);\n doc.addEventListener(mappedMouseEvent, handleClickAway);\n return () => {\n doc.removeEventListener(mappedMouseEvent, handleClickAway);\n };\n }\n\n return undefined;\n }, [handleClickAway, mouseEvent]);\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: /*#__PURE__*/React.cloneElement(children, childrenProps)\n });\n}\n\nprocess.env.NODE_ENV !== \"production\" ? ClickAwayListener.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The wrapped element.\n */\n children: elementAcceptingRef.isRequired,\n\n /**\n * If `true`, the React tree is ignored and only the DOM tree is considered.\n * This prop changes how portaled elements are handled.\n * @default false\n */\n disableReactTree: PropTypes.bool,\n\n /**\n * The mouse event to listen to. You can disable the listener by providing `false`.\n * @default 'onClick'\n */\n mouseEvent: PropTypes.oneOf(['onClick', 'onMouseDown', 'onMouseUp', 'onPointerDown', 'onPointerUp', false]),\n\n /**\n * Callback fired when a \"click away\" event is detected.\n */\n onClickAway: PropTypes.func.isRequired,\n\n /**\n * The touch event to listen to. You can disable the listener by providing `false`.\n * @default 'onTouchEnd'\n */\n touchEvent: PropTypes.oneOf(['onTouchEnd', 'onTouchStart', false])\n} : void 0;\n\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n ClickAwayListener['propTypes' + ''] = exactProp(ClickAwayListener.propTypes);\n}\n\nexport default ClickAwayListener;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"open\", \"target\", \"onClickAway\", \"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 } from '@mui/material';\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 { HTMLElementType } from '@mui/utils';\nimport { getDataGridUtilityClass, gridClasses } from '../../constants/gridClasses';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['menu']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\n\nconst GridMenuRoot = styled(Popper, {\n name: 'MuiDataGrid',\n slot: 'Menu',\n overridesResolver: (props, 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};\n\nconst GridMenu = props => {\n var _rootProps$components;\n\n const {\n open,\n target,\n onClickAway,\n children,\n position,\n className,\n onExited\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const prevTarget = React.useRef(target);\n const prevOpen = React.useRef(open);\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes\n };\n const classes = useUtilityClasses(ownerState);\n React.useEffect(() => {\n if (prevOpen.current && prevTarget.current) {\n prevTarget.current.focus();\n }\n\n prevOpen.current = open;\n prevTarget.current = target;\n }, [open, target]);\n\n const handleExited = popperOnExited => node => {\n if (popperOnExited) {\n popperOnExited();\n }\n\n if (onExited) {\n onExited(node);\n }\n };\n\n return /*#__PURE__*/_jsx(GridMenuRoot, _extends({\n as: rootProps.components.BasePopper,\n className: clsx(className, classes.root),\n open: open,\n anchorEl: target,\n transition: true,\n placement: position\n }, other, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.basePopper, {\n children: ({\n TransitionProps,\n placement\n }) => /*#__PURE__*/_jsx(ClickAwayListener, {\n onClickAway: onClickAway,\n mouseEvent: \"onMouseDown\",\n children: /*#__PURE__*/_jsx(Grow, _extends({}, TransitionProps, {\n style: {\n transformOrigin: transformOrigin[placement]\n },\n onExited: handleExited(TransitionProps == null ? void 0 : TransitionProps.onExited),\n children: /*#__PURE__*/_jsx(Paper, {\n children: children\n })\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n onClickAway: PropTypes.func.isRequired,\n onExited: PropTypes.func,\n\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 = [\"colDef\", \"id\", \"api\", \"hasFocus\", \"isEditable\", \"field\", \"value\", \"formattedValue\", \"row\", \"rowNode\", \"cellMode\", \"getValue\", \"tabIndex\", \"position\", \"focusElementRef\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport IconButton from '@mui/material/IconButton';\nimport MenuList from '@mui/material/MenuList';\nimport { unstable_useId as useId } from '@mui/material/utils';\nimport { gridClasses } from '../../constants/gridClasses';\nimport { GridMenu } from '../menu/GridMenu';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { useGridApiContext } from '../../hooks/utils/useGridApiContext';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n\nconst hasActions = colDef => typeof colDef.getActions === 'function';\n\nconst 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\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 menuId = useId();\n const buttonId = useId();\n const rootProps = useGridRootProps();\n React.useLayoutEffect(() => {\n if (!hasFocus) {\n Object.entries(touchRippleRefs.current).forEach(([index, ref]) => {\n ref == null ? void 0 : 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\n if (focusedButtonIndex >= rootRef.current.children.length) {\n return;\n }\n\n const child = rootRef.current.children[focusedButtonIndex];\n child.focus();\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 setFocusedButtonIndex(0);\n }\n }\n\n }), []);\n\n if (!hasActions(colDef)) {\n throw new Error('MUI: Missing the `getActions` property in the `GridColDef`.');\n }\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.useEffect(() => {\n if (focusedButtonIndex >= numberOfButtons) {\n setFocusedButtonIndex(numberOfButtons - 1);\n }\n }, [focusedButtonIndex, numberOfButtons]);\n\n const showMenu = () => {\n setOpen(true);\n setFocusedButtonIndex(numberOfButtons - 1);\n ignoreCallToFocus.current = true;\n };\n\n const hideMenu = () => {\n setOpen(false);\n };\n\n const handleTouchRippleRef = index => instance => {\n touchRippleRefs.current[index] = instance;\n };\n\n const handleButtonClick = (index, onClick) => event => {\n setFocusedButtonIndex(index);\n ignoreCallToFocus.current = true;\n\n if (onClick) {\n onClick(event);\n }\n };\n\n const handleRootKeyDown = event => {\n if (numberOfButtons <= 1) {\n return;\n }\n\n let newIndex = focusedButtonIndex;\n\n if (event.key === 'ArrowRight') {\n newIndex += 1;\n } else if (event.key === 'ArrowLeft') {\n newIndex -= 1;\n }\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\n if (newIndex !== focusedButtonIndex) {\n event.preventDefault(); // Prevent scrolling\n\n event.stopPropagation(); // Don't stop propagation for other keys, e.g. ArrowUp\n\n setFocusedButtonIndex(newIndex);\n }\n };\n\n const handleListKeyDown = event => {\n if (event.key === 'Tab') {\n event.preventDefault();\n }\n\n if (['Tab', 'Enter', 'Escape'].includes(event.key)) {\n hideMenu();\n }\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(IconButton, {\n ref: buttonRef,\n id: buttonId,\n \"aria-label\": apiRef.current.getLocaleText('actionsCellMore'),\n \"aria-controls\": menuId,\n \"aria-expanded\": open ? 'true' : undefined,\n \"aria-haspopup\": \"true\",\n role: \"menuitem\",\n size: \"small\",\n onClick: showMenu,\n touchRippleRef: handleTouchRippleRef(buttonId),\n tabIndex: focusedButtonIndex === iconButtons.length ? tabIndex : -1,\n children: /*#__PURE__*/_jsx(rootProps.components.MoreActionsIcon, {\n fontSize: \"small\"\n })\n }), menuButtons.length > 0 && /*#__PURE__*/_jsx(GridMenu, {\n onClickAway: hideMenu,\n onClick: hideMenu,\n open: open,\n target: buttonRef.current,\n position: position,\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 }))\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * GridApi that let you manipulate the grid.\n * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)\n */\n api: PropTypes.any.isRequired,\n\n /**\n * The mode of the cell.\n */\n cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,\n\n /**\n * The column of the row that the current cell belongs to.\n */\n colDef: PropTypes.object.isRequired,\n\n /**\n * The column field of the cell that triggered the event.\n */\n field: PropTypes.string.isRequired,\n\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 formattedValue: PropTypes.any,\n\n /**\n * Get the cell value of a row and field.\n * @param {GridRowId} id The row id.\n * @param {string} field The field.\n * @returns {any} The cell value.\n * @deprecated Use `params.row` to directly access the fields you want instead.\n */\n getValue: PropTypes.func.isRequired,\n\n /**\n * If true, the cell is the active element.\n */\n hasFocus: PropTypes.bool.isRequired,\n\n /**\n * The grid row id.\n */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n\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 /**\n * The row model of the row that the current cell belongs to.\n */\n row: PropTypes.object.isRequired,\n\n /**\n * The node of the row that the current cell belongs to.\n */\n rowNode: PropTypes.object.isRequired,\n\n /**\n * the tabIndex value.\n */\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\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';\nimport { renderActionsCell } from '../components/cell/GridActionsCell';\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 width: 100,\n align: 'center',\n headerAlign: 'center',\n headerName: '',\n disableColumnMenu: true,\n disableExport: true,\n renderCell: renderActionsCell,\n getApplyQuickFilterFn: undefined\n});","import { GRID_STRING_COL_DEF } from './gridStringColDef';\nimport { GRID_NUMERIC_COL_DEF } from './gridNumericColDef';\nimport { GRID_DATE_COL_DEF, GRID_DATETIME_COL_DEF } from './gridDateColDef';\nimport { GRID_BOOLEAN_COL_DEF } from './gridBooleanColDef';\nimport { GRID_SINGLE_SELECT_COL_DEF } from './gridSingleSelectColDef';\nimport { GRID_ACTIONS_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from './gridActionsColDef';\nexport const DEFAULT_GRID_COL_TYPE_KEY = '__default__';\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 [DEFAULT_GRID_COL_TYPE_KEY]: GRID_STRING_COL_DEF\n };\n return nativeColumnTypes;\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { DEFAULT_GRID_COL_TYPE_KEY, getGridDefaultColumnTypes } from '../../../colDef';\nimport { gridColumnsSelector, gridColumnVisibilityModelSelector } from './gridColumnsSelector';\nimport { clamp } from '../../../utils/utils';\nexport const COLUMNS_DIMENSION_PROPERTIES = ['maxWidth', 'minWidth', 'width', 'flex'];\nexport const computeColumnTypes = (customColumnTypes = {}) => {\n const mergedColumnTypes = _extends({}, getGridDefaultColumnTypes());\n\n Object.entries(customColumnTypes).forEach(([colType, colTypeDef]) => {\n if (mergedColumnTypes[colType]) {\n mergedColumnTypes[colType] = _extends({}, mergedColumnTypes[colType], colTypeDef);\n } else {\n mergedColumnTypes[colType] = _extends({}, mergedColumnTypes[colTypeDef.extendType || DEFAULT_GRID_COL_TYPE_KEY], colTypeDef);\n }\n });\n return mergedColumnTypes;\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 */\n\nexport function computeFlexColumnsWidth({\n initialFreeSpace,\n totalFlexUnits,\n flexColumns\n}) {\n const flexColumnsLookup = {\n all: {},\n frozenFields: [],\n freeze: field => {\n const value = flexColumnsLookup.all[field];\n\n if (value && value.frozen !== true) {\n flexColumnsLookup.all[field].frozen = true;\n flexColumnsLookup.frozenFields.push(field);\n }\n }\n }; // Step 5 of https://drafts.csswg.org/css-flexbox-1/#resolve-flexible-lengths\n\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 === flexColumns.length) {\n return;\n }\n\n const violationsLookup = {\n min: {},\n max: {}\n };\n let remainingFreeSpace = initialFreeSpace;\n let flexUnits = totalFlexUnits;\n let totalViolation = 0; // 5b: Calculate the remaining free space\n\n flexColumnsLookup.frozenFields.forEach(field => {\n remainingFreeSpace -= flexColumnsLookup.all[field].computedWidth;\n flexUnits -= flexColumnsLookup.all[field].flex;\n });\n\n for (let i = 0; i < flexColumns.length; i += 1) {\n const column = flexColumns[i];\n\n if (flexColumnsLookup.all[column.field] && flexColumnsLookup.all[column.field].frozen === true) {\n // eslint-disable-next-line no-continue\n continue;\n } // 5c: Distribute remaining free space proportional to the flex factors\n\n\n const widthPerFlexUnit = remainingFreeSpace / flexUnits;\n let computedWidth = widthPerFlexUnit * column.flex; // 5d: Fix min/max violations\n\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\n flexColumnsLookup.all[column.field] = {\n frozen: false,\n computedWidth,\n flex: column.flex\n };\n } // 5e: Freeze over-flexed items\n\n\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 } // 5f: Return to the start of this loop\n\n\n loopOverFlexItems();\n }\n\n loopOverFlexItems();\n return flexColumnsLookup.all;\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 */\n\nexport const hydrateColumnsWidth = (rawState, viewportInnerWidth) => {\n const columnsLookup = {};\n let totalFlexUnits = 0;\n let widthAllocatedBeforeFlex = 0;\n const flexColumns = []; // For the non-flex columns, compute their width\n // For the flex columns, compute there minimum width and how much width must be allocated during the flex allocation\n\n rawState.all.forEach(columnField => {\n const newColumn = _extends({}, rawState.lookup[columnField]);\n\n if (rawState.columnVisibilityModel[columnField] === false) {\n newColumn.computedWidth = 0;\n } else {\n let computedWidth;\n\n if (newColumn.flex && newColumn.flex > 0) {\n totalFlexUnits += newColumn.flex;\n computedWidth = 0;\n flexColumns.push(newColumn);\n } else {\n computedWidth = clamp(newColumn.width, newColumn.minWidth, newColumn.maxWidth);\n }\n\n widthAllocatedBeforeFlex += computedWidth;\n newColumn.computedWidth = computedWidth;\n }\n\n columnsLookup[columnField] = newColumn;\n });\n const initialFreeSpace = Math.max(viewportInnerWidth - widthAllocatedBeforeFlex, 0); // Allocate the remaining space to the flex columns\n\n if (totalFlexUnits > 0 && viewportInnerWidth > 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\n return _extends({}, rawState, {\n lookup: columnsLookup\n });\n};\nlet columnTypeWarnedOnce = false;\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 */\n\nexport const applyInitialState = (columnsState, initialState) => {\n if (!initialState) {\n return columnsState;\n }\n\n const {\n orderedFields = [],\n dimensions = {}\n } = initialState;\n const columnsWithUpdatedDimensions = Object.keys(dimensions);\n\n if (columnsWithUpdatedDimensions.length === 0 && orderedFields.length === 0) {\n return columnsState;\n }\n\n const orderedFieldsLookup = {};\n const cleanOrderedFields = [];\n\n for (let i = 0; i < orderedFields.length; i += 1) {\n const field = orderedFields[i]; // Ignores the fields in the initialState that matches no field on the current column state\n\n if (columnsState.lookup[field]) {\n orderedFieldsLookup[field] = true;\n cleanOrderedFields.push(field);\n }\n }\n\n const newOrderedFields = cleanOrderedFields.length === 0 ? columnsState.all : [...cleanOrderedFields, ...columnsState.all.filter(field => !orderedFieldsLookup[field])];\n\n const newColumnLookup = _extends({}, columnsState.lookup);\n\n for (let i = 0; i < columnsWithUpdatedDimensions.length; i += 1) {\n const field = columnsWithUpdatedDimensions[i];\n\n const newColDef = _extends({}, newColumnLookup[field], {\n hasBeenResized: true\n });\n\n Object.entries(dimensions[field]).forEach(([key, value]) => {\n newColDef[key] = value === -1 ? Infinity : value;\n });\n newColumnLookup[field] = newColDef;\n }\n\n const newColumnsState = {\n all: newOrderedFields,\n lookup: newColumnLookup\n };\n return newColumnsState;\n};\n/**\n * @deprecated Should have been internal only, you can inline the logic.\n */\n\nexport const getGridColDef = (columnTypes, type) => {\n if (!type) {\n return columnTypes[DEFAULT_GRID_COL_TYPE_KEY];\n }\n\n if (process.env.NODE_ENV !== 'production') {\n if (!columnTypeWarnedOnce && !columnTypes[type]) {\n console.warn([`MUI: The column type \"${type}\" you are using is not supported.`, `Column type \"string\" is being used instead.`].join('\\n'));\n columnTypeWarnedOnce = true;\n }\n }\n\n if (!columnTypes[type]) {\n return columnTypes[DEFAULT_GRID_COL_TYPE_KEY];\n }\n\n return columnTypes[type];\n};\nexport const createColumnsState = ({\n apiRef,\n columnsToUpsert,\n initialState,\n columnTypes,\n currentColumnVisibilityModel = gridColumnVisibilityModelSelector(apiRef),\n shouldRegenColumnVisibilityModelFromColumns,\n keepOnlyColumnsToUpsert = false\n}) => {\n var _apiRef$current$getRo, _apiRef$current$getRo2, _apiRef$current, _apiRef$current$getRo3;\n\n const isInsideStateInitializer = !apiRef.current.state.columns;\n let columnsStateWithoutColumnVisibilityModel;\n\n if (isInsideStateInitializer) {\n columnsStateWithoutColumnVisibilityModel = {\n all: [],\n lookup: {}\n };\n } else {\n const currentState = gridColumnsSelector(apiRef.current.state);\n columnsStateWithoutColumnVisibilityModel = {\n all: keepOnlyColumnsToUpsert ? [] : [...currentState.all],\n lookup: _extends({}, currentState.lookup) // Will be cleaned later if keepOnlyColumnsToUpsert=true\n\n };\n }\n\n let columnsToKeep = {};\n\n if (keepOnlyColumnsToUpsert && !isInsideStateInitializer) {\n columnsToKeep = Object.keys(columnsStateWithoutColumnVisibilityModel.lookup).reduce((acc, key) => _extends({}, acc, {\n [key]: false\n }), {});\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 = columnsStateWithoutColumnVisibilityModel.lookup[field];\n\n if (existingState == null) {\n // New Column\n existingState = _extends({}, getGridColDef(columnTypes, newColumn.type), {\n // TODO v6: Inline `getGridColDef`\n field,\n hasBeenResized: false\n });\n columnsStateWithoutColumnVisibilityModel.all.push(field);\n } else if (keepOnlyColumnsToUpsert) {\n columnsStateWithoutColumnVisibilityModel.all.push(field);\n }\n\n let hasBeenResized = existingState.hasBeenResized;\n COLUMNS_DIMENSION_PROPERTIES.forEach(key => {\n if (newColumn[key] !== undefined) {\n hasBeenResized = true;\n\n if (newColumn[key] === -1) {\n newColumn[key] = Infinity;\n }\n }\n });\n columnsStateWithoutColumnVisibilityModel.lookup[field] = _extends({}, existingState, {\n hide: newColumn.hide == null ? false : newColumn.hide\n }, newColumn, {\n hasBeenResized\n });\n });\n\n if (keepOnlyColumnsToUpsert && !isInsideStateInitializer) {\n Object.keys(columnsStateWithoutColumnVisibilityModel.lookup).forEach(field => {\n if (!columnsToKeep[field]) {\n delete columnsStateWithoutColumnVisibilityModel.lookup[field];\n }\n });\n }\n\n const columnsLookupBeforePreProcessing = _extends({}, columnsStateWithoutColumnVisibilityModel.lookup);\n\n const columnsStateWithPreProcessing = apiRef.current.unstable_applyPipeProcessors('hydrateColumns', columnsStateWithoutColumnVisibilityModel); // TODO v6: remove the sync between the columns `hide` option and the model.\n\n let columnVisibilityModel = {};\n\n if (shouldRegenColumnVisibilityModelFromColumns) {\n let hasModelChanged = false;\n\n const newColumnVisibilityModel = _extends({}, currentColumnVisibilityModel);\n\n if (isInsideStateInitializer) {\n columnsStateWithPreProcessing.all.forEach(field => {\n newColumnVisibilityModel[field] = !columnsStateWithoutColumnVisibilityModel.lookup[field].hide;\n });\n } else if (keepOnlyColumnsToUpsert) {\n // At this point, `keepOnlyColumnsToUpsert` has a new meaning: keep the columns\n // passed via `columnToUpsert` + columns added by the pre-processors. We do the following\n // cleanup because a given column may have been removed from the `columns` prop but it still\n // exists in the state.\n Object.keys(newColumnVisibilityModel).forEach(field => {\n if (!columnsStateWithPreProcessing.lookup[field]) {\n delete newColumnVisibilityModel[field];\n hasModelChanged = true;\n }\n });\n }\n\n columnsStateWithPreProcessing.all.forEach(field => {\n // If neither the `columnsToUpsert` nor the pre-processors updated the column,\n // Then we don't want to update the visibility status of the column in the model.\n if (!columnsToUpsertLookup[field] && columnsLookupBeforePreProcessing[field] === columnsStateWithPreProcessing.lookup[field]) {\n return;\n } // We always assume that a column not in the model is visible by default. However, there's an\n // edge case where the column is not in the model but it also doesn't exist in the `columns`\n // prop, meaning that the column is being added. In that case, we assume that the column was\n // not visible before for it be added to the model.\n\n\n let isVisibleBefore = currentColumnVisibilityModel[field];\n\n if (isVisibleBefore === undefined) {\n if (isInsideStateInitializer) {\n isVisibleBefore = true;\n } else {\n const currentState = gridColumnsSelector(apiRef.current.state);\n isVisibleBefore = !!currentState.lookup[field];\n }\n }\n\n const isVisibleAfter = !columnsStateWithPreProcessing.lookup[field].hide;\n\n if (isVisibleAfter !== isVisibleBefore) {\n hasModelChanged = true;\n newColumnVisibilityModel[field] = isVisibleAfter;\n }\n });\n\n if (hasModelChanged || isInsideStateInitializer) {\n columnVisibilityModel = newColumnVisibilityModel;\n } else {\n columnVisibilityModel = currentColumnVisibilityModel;\n }\n } else {\n columnVisibilityModel = currentColumnVisibilityModel;\n }\n\n const columnsStateWithPortableColumns = applyInitialState(columnsStateWithPreProcessing, initialState);\n\n const columnsState = _extends({}, columnsStateWithPortableColumns, {\n columnVisibilityModel\n });\n\n return hydrateColumnsWidth(columnsState, (_apiRef$current$getRo = (_apiRef$current$getRo2 = (_apiRef$current = apiRef.current).getRootDimensions) == null ? void 0 : (_apiRef$current$getRo3 = _apiRef$current$getRo2.call(_apiRef$current)) == null ? void 0 : _apiRef$current$getRo3.viewportInnerSize.width) != null ? _apiRef$current$getRo : 0);\n};\nexport const mergeColumnsState = columnsState => state => _extends({}, state, {\n columns: columnsState\n});\nexport function getFirstNonSpannedColumnToRender({\n firstColumnToRender,\n apiRef,\n firstRowToRender,\n lastRowToRender,\n visibleRows\n}) {\n let firstNonSpannedColumnToRender = firstColumnToRender;\n\n for (let i = firstRowToRender; i < lastRowToRender; i += 1) {\n const row = visibleRows[i];\n\n if (row) {\n const rowId = visibleRows[i].id;\n const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, firstColumnToRender);\n\n if (cellColSpanInfo && cellColSpanInfo.spannedByColSpan) {\n firstNonSpannedColumnToRender = cellColSpanInfo.leftVisibleCellIndex;\n }\n }\n }\n\n return firstNonSpannedColumnToRender;\n}\nexport function getFirstColumnIndexToRender({\n firstColumnIndex,\n minColumnIndex,\n columnBuffer,\n firstRowToRender,\n lastRowToRender,\n apiRef,\n visibleRows\n}) {\n const initialFirstColumnToRender = Math.max(firstColumnIndex - columnBuffer, minColumnIndex);\n const firstColumnToRender = getFirstNonSpannedColumnToRender({\n firstColumnToRender: initialFirstColumnToRender,\n apiRef,\n firstRowToRender,\n lastRowToRender,\n visibleRows\n });\n return firstColumnToRender;\n}","var GridPreferencePanelsValue;\n\n(function (GridPreferencePanelsValue) {\n GridPreferencePanelsValue[\"filters\"] = \"filters\";\n GridPreferencePanelsValue[\"columns\"] = \"columns\";\n})(GridPreferencePanelsValue || (GridPreferencePanelsValue = {}));\n\nexport { GridPreferencePanelsValue };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridColumnFieldsSelector, gridColumnDefinitionsSelector, gridColumnLookupSelector, gridColumnsMetaSelector, gridColumnsSelector, gridColumnVisibilityModelSelector, gridVisibleColumnDefinitionsSelector, gridColumnPositionsSelector } from './gridColumnsSelector';\nimport { useGridApiEventHandler, useGridApiOptionHandler } from '../../utils/useGridApiEventHandler';\nimport { useGridRegisterPipeProcessor, useGridRegisterPipeApplier } from '../../core/pipeProcessing';\nimport { hydrateColumnsWidth, computeColumnTypes, createColumnsState, mergeColumnsState, COLUMNS_DIMENSION_PROPERTIES } from './gridColumnsUtils';\nimport { GridPreferencePanelsValue } from '../preferencesPanel';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const columnsStateInitializer = (state, props, apiRef) => {\n var _props$initialState, _props$initialState$c, _props$initialState2, _ref, _props$columnVisibili, _props$initialState3, _props$initialState3$;\n\n const isUsingColumnVisibilityModel = !!props.columnVisibilityModel || !!((_props$initialState = props.initialState) != null && (_props$initialState$c = _props$initialState.columns) != null && _props$initialState$c.columnVisibilityModel);\n const columnsTypes = computeColumnTypes(props.columnTypes);\n const columnsState = createColumnsState({\n apiRef,\n columnTypes: columnsTypes,\n columnsToUpsert: props.columns,\n initialState: (_props$initialState2 = props.initialState) == null ? void 0 : _props$initialState2.columns,\n shouldRegenColumnVisibilityModelFromColumns: !isUsingColumnVisibilityModel,\n currentColumnVisibilityModel: (_ref = (_props$columnVisibili = props.columnVisibilityModel) != null ? _props$columnVisibili : (_props$initialState3 = props.initialState) == null ? void 0 : (_props$initialState3$ = _props$initialState3.columns) == null ? void 0 : _props$initialState3$.columnVisibilityModel) != null ? _ref : {},\n keepOnlyColumnsToUpsert: true\n });\n return _extends({}, state, {\n columns: columnsState\n });\n};\n/**\n * @requires useGridParamsApi (method)\n * @requires useGridDimensions (method, event) - can be after\n * TODO: Impossible priority - useGridParamsApi also needs to be after useGridColumns\n */\n\nexport function useGridColumns(apiRef, props) {\n var _props$initialState4, _props$initialState4$, _props$componentsProp2;\n\n const logger = useGridLogger(apiRef, 'useGridColumns');\n const columnTypes = React.useMemo(() => computeColumnTypes(props.columnTypes), [props.columnTypes]);\n const previousColumnsProp = React.useRef(props.columns);\n const previousColumnTypesProp = React.useRef(columnTypes);\n /**\n * If `initialState.columns.columnVisibilityModel` or `columnVisibilityModel` was defined during the 1st render, we are directly updating the model\n * If not, we keep the old behavior and update the `GridColDef.hide` option (which will update the state model through the `GridColDef.hide` => `columnVisibilityModel` sync in `createColumnsState`\n */\n\n const isUsingColumnVisibilityModel = React.useRef(!!props.columnVisibilityModel || !!((_props$initialState4 = props.initialState) != null && (_props$initialState4$ = _props$initialState4.columns) != null && _props$initialState4$.columnVisibilityModel));\n apiRef.current.unstable_updateControlState({\n stateId: 'visibleColumns',\n propModel: props.columnVisibilityModel,\n propOnChange: props.onColumnVisibilityModelChange,\n stateSelector: gridColumnVisibilityModelSelector,\n changeEvent: 'columnVisibilityModelChange'\n });\n const setGridColumnsState = React.useCallback(columnsState => {\n logger.debug('Updating columns state.');\n apiRef.current.setState(mergeColumnsState(columnsState));\n apiRef.current.forceUpdate();\n apiRef.current.publishEvent('columnsChange', columnsState.all);\n }, [logger, apiRef]);\n /**\n * API METHODS\n */\n\n const getColumn = React.useCallback(field => gridColumnLookupSelector(apiRef)[field], [apiRef]);\n const getAllColumns = React.useCallback(() => gridColumnDefinitionsSelector(apiRef), [apiRef]);\n const getVisibleColumns = React.useCallback(() => gridVisibleColumnDefinitionsSelector(apiRef), [apiRef]);\n const getColumnsMeta = React.useCallback(() => gridColumnsMetaSelector(apiRef), [apiRef]);\n const getColumnIndex = React.useCallback((field, useVisibleColumns = true) => {\n const columns = useVisibleColumns ? gridVisibleColumnDefinitionsSelector(apiRef) : gridColumnDefinitionsSelector(apiRef);\n return columns.findIndex(col => col.field === field);\n }, [apiRef]);\n const getColumnPosition = React.useCallback(field => {\n const index = getColumnIndex(field);\n return gridColumnPositionsSelector(apiRef)[index];\n }, [apiRef, getColumnIndex]);\n const setColumnVisibilityModel = React.useCallback(model => {\n const currentModel = gridColumnVisibilityModelSelector(apiRef);\n\n if (currentModel !== model) {\n apiRef.current.setState(state => _extends({}, state, {\n columns: createColumnsState({\n apiRef,\n columnTypes,\n columnsToUpsert: [],\n initialState: undefined,\n shouldRegenColumnVisibilityModelFromColumns: false,\n currentColumnVisibilityModel: model,\n keepOnlyColumnsToUpsert: false\n })\n }));\n apiRef.current.forceUpdate();\n }\n }, [apiRef, columnTypes]);\n const updateColumns = React.useCallback(columns => {\n const columnsState = createColumnsState({\n apiRef,\n columnTypes,\n columnsToUpsert: columns,\n initialState: undefined,\n shouldRegenColumnVisibilityModelFromColumns: true,\n keepOnlyColumnsToUpsert: false\n });\n setGridColumnsState(columnsState);\n }, [apiRef, setGridColumnsState, columnTypes]);\n const updateColumn = React.useCallback(column => apiRef.current.updateColumns([column]), [apiRef]);\n const setColumnVisibility = React.useCallback((field, isVisible) => {\n // We keep updating the `hide` option of `GridColDef` when not controlling the model to avoid any breaking change.\n // `updateColumns` take care of updating the model itself if needs be.\n // TODO v6: stop using the `hide` field even when the model is not defined\n if (isUsingColumnVisibilityModel.current) {\n var _columnVisibilityMode;\n\n const columnVisibilityModel = gridColumnVisibilityModelSelector(apiRef);\n const isCurrentlyVisible = (_columnVisibilityMode = columnVisibilityModel[field]) != null ? _columnVisibilityMode : true;\n\n if (isVisible !== isCurrentlyVisible) {\n const newModel = _extends({}, columnVisibilityModel, {\n [field]: isVisible\n });\n\n apiRef.current.setColumnVisibilityModel(newModel);\n }\n } else {\n const column = apiRef.current.getColumn(field);\n\n const newColumn = _extends({}, column, {\n hide: !isVisible\n });\n\n apiRef.current.updateColumns([newColumn]);\n const params = {\n field,\n colDef: newColumn,\n isVisible\n };\n apiRef.current.publishEvent('columnVisibilityChange', params);\n }\n }, [apiRef]);\n const setColumnIndex = React.useCallback((field, targetIndexPosition) => {\n const allColumns = gridColumnFieldsSelector(apiRef);\n const oldIndexPosition = allColumns.findIndex(col => col === field);\n\n if (oldIndexPosition === targetIndexPosition) {\n return;\n }\n\n logger.debug(`Moving column ${field} to index ${targetIndexPosition}`);\n const updatedColumns = [...allColumns];\n updatedColumns.splice(targetIndexPosition, 0, updatedColumns.splice(oldIndexPosition, 1)[0]);\n setGridColumnsState(_extends({}, gridColumnsSelector(apiRef.current.state), {\n all: updatedColumns\n }));\n const params = {\n field,\n element: apiRef.current.getColumnHeaderElement(field),\n colDef: apiRef.current.getColumn(field),\n targetIndex: targetIndexPosition,\n oldIndex: oldIndexPosition\n };\n apiRef.current.publishEvent('columnOrderChange', params);\n }, [apiRef, logger, setGridColumnsState]);\n const setColumnWidth = React.useCallback((field, width) => {\n logger.debug(`Updating column ${field} width to ${width}`);\n const column = apiRef.current.getColumn(field);\n\n const newColumn = _extends({}, column, {\n width\n });\n\n apiRef.current.updateColumns([newColumn]);\n apiRef.current.publishEvent('columnWidthChange', {\n element: apiRef.current.getColumnHeaderElement(field),\n colDef: newColumn,\n width\n });\n }, [apiRef, logger]);\n const columnApi = {\n getColumn,\n getAllColumns,\n getColumnIndex,\n getColumnPosition,\n getVisibleColumns,\n getColumnsMeta,\n updateColumn,\n updateColumns,\n setColumnVisibilityModel,\n setColumnVisibility,\n setColumnIndex,\n setColumnWidth\n };\n useGridApiMethod(apiRef, columnApi, 'GridColumnApi');\n /**\n * PRE-PROCESSING\n */\n\n const stateExportPreProcessing = React.useCallback(prevState => {\n const columnsStateToExport = {};\n\n if (isUsingColumnVisibilityModel.current) {\n const columnVisibilityModelToExport = gridColumnVisibilityModelSelector(apiRef);\n const hasHiddenColumns = Object.values(columnVisibilityModelToExport).some(value => value === false);\n\n if (hasHiddenColumns) {\n columnsStateToExport.columnVisibilityModel = columnVisibilityModelToExport;\n }\n }\n\n columnsStateToExport.orderedFields = gridColumnFieldsSelector(apiRef);\n const columns = gridColumnDefinitionsSelector(apiRef);\n const dimensions = {};\n columns.forEach(colDef => {\n if (colDef.hasBeenResized) {\n const colDefDimensions = {};\n COLUMNS_DIMENSION_PROPERTIES.forEach(propertyName => {\n let propertyValue = colDef[propertyName];\n\n if (propertyValue === Infinity) {\n propertyValue = -1;\n }\n\n colDefDimensions[propertyName] = propertyValue;\n });\n dimensions[colDef.field] = colDefDimensions;\n }\n });\n\n if (Object.keys(dimensions).length > 0) {\n columnsStateToExport.dimensions = dimensions;\n }\n\n return _extends({}, prevState, {\n columns: columnsStateToExport\n });\n }, [apiRef]);\n const stateRestorePreProcessing = React.useCallback((params, context) => {\n var _context$stateToResto;\n\n const columnVisibilityModelToImport = isUsingColumnVisibilityModel.current ? (_context$stateToResto = context.stateToRestore.columns) == null ? void 0 : _context$stateToResto.columnVisibilityModel : undefined;\n const initialState = context.stateToRestore.columns;\n\n if (columnVisibilityModelToImport == null && initialState == null) {\n return params;\n }\n\n const columnsState = createColumnsState({\n apiRef,\n columnTypes,\n columnsToUpsert: [],\n initialState,\n shouldRegenColumnVisibilityModelFromColumns: !isUsingColumnVisibilityModel.current,\n currentColumnVisibilityModel: columnVisibilityModelToImport,\n keepOnlyColumnsToUpsert: false\n });\n apiRef.current.setState(mergeColumnsState(columnsState));\n\n if (initialState != null) {\n apiRef.current.publishEvent('columnsChange', columnsState.all);\n }\n\n return params;\n }, [apiRef, columnTypes]);\n const preferencePanelPreProcessing = React.useCallback((initialValue, value) => {\n if (value === GridPreferencePanelsValue.columns) {\n var _props$componentsProp;\n\n const ColumnsPanel = props.components.ColumnsPanel;\n return /*#__PURE__*/_jsx(ColumnsPanel, _extends({}, (_props$componentsProp = props.componentsProps) == null ? void 0 : _props$componentsProp.columnsPanel));\n }\n\n return initialValue;\n }, [props.components.ColumnsPanel, (_props$componentsProp2 = props.componentsProps) == null ? void 0 : _props$componentsProp2.columnsPanel]);\n useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);\n useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);\n useGridRegisterPipeProcessor(apiRef, 'preferencePanel', preferencePanelPreProcessing);\n /**\n * EVENTS\n */\n\n const prevInnerWidth = React.useRef(null);\n\n const handleGridSizeChange = viewportInnerSize => {\n if (prevInnerWidth.current !== viewportInnerSize.width) {\n prevInnerWidth.current = viewportInnerSize.width;\n setGridColumnsState(hydrateColumnsWidth(gridColumnsSelector(apiRef.current.state), viewportInnerSize.width));\n }\n };\n\n useGridApiEventHandler(apiRef, 'viewportInnerSizeChange', handleGridSizeChange);\n useGridApiOptionHandler(apiRef, 'columnVisibilityChange', props.onColumnVisibilityChange);\n /**\n * APPLIERS\n */\n\n const hydrateColumns = React.useCallback(() => {\n logger.info(`Columns pipe processing have changed, regenerating the columns`);\n const columnsState = createColumnsState({\n apiRef,\n columnTypes,\n columnsToUpsert: [],\n initialState: undefined,\n shouldRegenColumnVisibilityModelFromColumns: !isUsingColumnVisibilityModel.current,\n keepOnlyColumnsToUpsert: false\n });\n setGridColumnsState(columnsState);\n }, [apiRef, logger, setGridColumnsState, columnTypes]);\n useGridRegisterPipeApplier(apiRef, 'hydrateColumns', hydrateColumns);\n /**\n * EFFECTS\n */\n // The effect do not track any value defined synchronously during the 1st render by hooks called after `useGridColumns`\n // As a consequence, the state generated by the 1st run of this useEffect will always be equal to the initialization one\n\n const isFirstRender = React.useRef(true);\n React.useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n return;\n }\n\n logger.info(`GridColumns have changed, new length ${props.columns.length}`);\n\n if (previousColumnsProp.current === props.columns && previousColumnTypesProp.current === columnTypes) {\n return;\n }\n\n const columnsState = createColumnsState({\n apiRef,\n columnTypes,\n initialState: undefined,\n // If the user provides a model, we don't want to set it in the state here because it has it's dedicated `useEffect` which calls `setColumnVisibilityModel`\n shouldRegenColumnVisibilityModelFromColumns: !isUsingColumnVisibilityModel.current,\n columnsToUpsert: props.columns,\n keepOnlyColumnsToUpsert: true\n });\n previousColumnsProp.current = props.columns;\n previousColumnTypesProp.current = columnTypes;\n setGridColumnsState(columnsState);\n }, [logger, apiRef, setGridColumnsState, props.columns, columnTypes]);\n React.useEffect(() => {\n if (props.columnVisibilityModel !== undefined) {\n apiRef.current.setColumnVisibilityModel(props.columnVisibilityModel);\n }\n }, [apiRef, logger, props.columnVisibilityModel]);\n}","/**\n * Available densities.\n */\n\n/**\n * Density enum.\n */\nvar GridDensityTypes;\n\n(function (GridDensityTypes) {\n GridDensityTypes[\"Compact\"] = \"compact\";\n GridDensityTypes[\"Standard\"] = \"standard\";\n GridDensityTypes[\"Comfortable\"] = \"comfortable\";\n})(GridDensityTypes || (GridDensityTypes = {}));\n\nexport { GridDensityTypes };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { GridDensityTypes } from '../../../models/gridDensity';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { gridDensitySelector } from './densitySelector';\nimport { isDeepEqual } from '../../../utils/utils';\nexport const COMPACT_DENSITY_FACTOR = 0.7;\nexport const COMFORTABLE_DENSITY_FACTOR = 1.3; // TODO v6: revise keeping headerHeight and rowHeight in state\n\nconst getUpdatedDensityState = (newDensity, newHeaderHeight, newRowHeight) => {\n switch (newDensity) {\n case GridDensityTypes.Compact:\n return {\n value: newDensity,\n headerHeight: Math.floor(newHeaderHeight * COMPACT_DENSITY_FACTOR),\n rowHeight: Math.floor(newRowHeight * COMPACT_DENSITY_FACTOR),\n factor: COMPACT_DENSITY_FACTOR\n };\n\n case GridDensityTypes.Comfortable:\n return {\n value: newDensity,\n headerHeight: Math.floor(newHeaderHeight * COMFORTABLE_DENSITY_FACTOR),\n rowHeight: Math.floor(newRowHeight * COMFORTABLE_DENSITY_FACTOR),\n factor: COMFORTABLE_DENSITY_FACTOR\n };\n\n default:\n return {\n value: newDensity,\n headerHeight: newHeaderHeight,\n rowHeight: newRowHeight,\n factor: 1\n };\n }\n};\n\nexport const densityStateInitializer = (state, props) => _extends({}, state, {\n density: getUpdatedDensityState(props.density, props.headerHeight, props.rowHeight)\n});\nexport const useGridDensity = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useDensity');\n const setDensity = React.useCallback((newDensity, newHeaderHeight = props.headerHeight, newRowHeight = props.rowHeight) => {\n logger.debug(`Set grid density to ${newDensity}`);\n apiRef.current.setState(state => {\n const currentDensityState = gridDensitySelector(state);\n const newDensityState = getUpdatedDensityState(newDensity, newHeaderHeight, newRowHeight);\n\n if (isDeepEqual(currentDensityState, newDensityState)) {\n return state;\n }\n\n return _extends({}, state, {\n density: newDensityState\n });\n });\n apiRef.current.forceUpdate();\n }, [logger, apiRef, props.headerHeight, props.rowHeight]);\n React.useEffect(() => {\n apiRef.current.setDensity(props.density, props.headerHeight, props.rowHeight);\n }, [apiRef, props.density, props.rowHeight, props.headerHeight]);\n const densityApi = {\n setDensity\n };\n useGridApiMethod(apiRef, densityApi, 'GridDensityApi');\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\", \"getValue\", \"api\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { unstable_composeClasses as composeClasses } from '@mui/material';\nimport { useForkRef } from '@mui/material/utils';\nimport { isNavigationKey, isSpaceKey } from '../../utils/keyboardUtils';\nimport { useGridApiContext } from '../../hooks/utils/useGridApiContext';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['checkboxInput']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\n\nconst GridCellCheckboxForwardRef = /*#__PURE__*/React.forwardRef(function GridCellCheckboxRenderer(props, ref) {\n var _rootProps$components;\n\n const {\n field,\n id,\n value: isChecked,\n hasFocus,\n tabIndex\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\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();\n const handleRef = useForkRef(checkboxElement, ref);\n const element = apiRef.current.getCellElement(id, field);\n\n const handleChange = event => {\n const params = {\n value: event.target.checked,\n id\n };\n apiRef.current.publishEvent('rowSelectionCheckboxChange', params, event);\n };\n\n React.useLayoutEffect(() => {\n if (tabIndex === 0 && element) {\n element.tabIndex = -1;\n }\n }, [element, tabIndex]);\n React.useLayoutEffect(() => {\n if (hasFocus) {\n var _checkboxElement$curr;\n\n const input = (_checkboxElement$curr = checkboxElement.current) == null ? void 0 : _checkboxElement$curr.querySelector('input');\n input == null ? void 0 : input.focus();\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 (isSpaceKey(event.key)) {\n event.stopPropagation();\n }\n\n if (isNavigationKey(event.key) && !event.shiftKey) {\n apiRef.current.publishEvent('cellNavigationKeyDown', props, event);\n }\n }, [apiRef, props]);\n const isSelectable = !rootProps.isRowSelectable || rootProps.isRowSelectable(apiRef.current.getRowParams(id));\n const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectRow' : 'checkboxSelectionSelectRow');\n return /*#__PURE__*/_jsx(rootProps.components.BaseCheckbox, _extends({\n ref: handleRef,\n tabIndex: tabIndex,\n checked: isChecked,\n onChange: handleChange,\n className: classes.root,\n color: \"primary\",\n inputProps: {\n 'aria-label': label\n },\n onKeyDown: handleKeyDown,\n disabled: !isSelectable,\n touchRippleRef: rippleRef\n }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * GridApi that let you manipulate the grid.\n * @deprecated Use the `apiRef` returned by `useGridApiContext` or `useGridApiRef` (only available in `@mui/x-data-grid-pro`)\n */\n api: PropTypes.any.isRequired,\n\n /**\n * The mode of the cell.\n */\n cellMode: PropTypes.oneOf(['edit', 'view']).isRequired,\n\n /**\n * The column of the row that the current cell belongs to.\n */\n colDef: PropTypes.object.isRequired,\n\n /**\n * The column field of the cell that triggered the event.\n */\n field: PropTypes.string.isRequired,\n\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 /**\n * The cell value formatted with the column valueFormatter.\n */\n formattedValue: PropTypes.any,\n\n /**\n * Get the cell value of a row and field.\n * @param {GridRowId} id The row id.\n * @param {string} field The field.\n * @returns {any} The cell value.\n * @deprecated Use `params.row` to directly access the fields you want instead.\n */\n getValue: PropTypes.func.isRequired,\n\n /**\n * If true, the cell is the active element.\n */\n hasFocus: PropTypes.bool.isRequired,\n\n /**\n * The grid row id.\n */\n id: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n\n /**\n * If true, the cell is editable.\n */\n isEditable: PropTypes.bool,\n\n /**\n * The row model of the row that the current cell belongs to.\n */\n row: PropTypes.object.isRequired,\n\n /**\n * The node of the row that the current cell belongs to.\n */\n rowNode: PropTypes.object.isRequired,\n\n /**\n * the tabIndex value.\n */\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\n\n /**\n * The cell value, but if the column has valueGetter, use getValue.\n */\n value: PropTypes.any\n} : void 0;\nexport { GridCellCheckboxForwardRef };\nexport const GridCellCheckboxRenderer = /*#__PURE__*/React.memo(GridCellCheckboxForwardRef);","import { createSelector } from '../../../utils/createSelector';\nexport const gridFocusStateSelector = state => state.focus;\nexport const gridFocusCellSelector = createSelector(gridFocusStateSelector, focusState => focusState.cell);\nexport const gridFocusColumnHeaderSelector = createSelector(gridFocusStateSelector, focusState => focusState.columnHeader);\nexport const gridTabIndexStateSelector = state => state.tabIndex;\nexport const gridTabIndexCellSelector = createSelector(gridTabIndexStateSelector, state => state.cell);\nexport const gridTabIndexColumnHeaderSelector = createSelector(gridTabIndexStateSelector, state => state.columnHeader);","import { createSelector } from '../../../utils/createSelector';\nimport { gridRowsLookupSelector } from '../rows/gridRowsSelector';\nexport const gridSelectionStateSelector = state => state.selection;\nexport const selectedGridRowsCountSelector = createSelector(gridSelectionStateSelector, selection => selection.length);\nexport const selectedGridRowsSelector = createSelector(gridSelectionStateSelector, gridRowsLookupSelector, (selectedRows, rowsLookup) => new Map(selectedRows.map(id => [id, rowsLookup[id]])));\nexport const selectedIdsLookupSelector = createSelector(gridSelectionStateSelector, selection => selection.reduce((lookup, rowId) => {\n lookup[rowId] = rowId;\n return lookup;\n}, {}));","import { createSelector } from '../../../utils/createSelector';\nimport { gridVisibleSortedRowEntriesSelector, gridVisibleSortedRowIdsSelector, gridVisibleSortedTopLevelRowEntriesSelector } from '../filter/gridFilterSelector';\nimport { gridRowTreeDepthSelector, gridRowTreeSelector } from '../rows/gridRowsSelector';\n/**\n * @category Pagination\n * @ignore - do not document.\n */\n\nexport const gridPaginationSelector = state => state.pagination;\n/**\n * Get the index of the page to render if the pagination is enabled\n * @category Pagination\n */\n\nexport const gridPageSelector = createSelector(gridPaginationSelector, pagination => pagination.page);\n/**\n * Get the maximum amount of rows to display on a single page if the pagination is enabled\n * @category Pagination\n */\n\nexport const gridPageSizeSelector = createSelector(gridPaginationSelector, pagination => pagination.pageSize);\n/**\n * Get the amount of pages needed to display all the rows if the pagination is enabled\n * @category Pagination\n */\n\nexport const gridPageCountSelector = createSelector(gridPaginationSelector, pagination => pagination.pageCount);\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 */\n\nexport const gridPaginationRowRangeSelector = createSelector(gridPaginationSelector, gridRowTreeSelector, gridRowTreeDepthSelector, gridVisibleSortedRowEntriesSelector, gridVisibleSortedTopLevelRowEntriesSelector, (pagination, rowTree, rowTreeDepth, visibleSortedRowEntries, visibleSortedTopLevelRowEntries) => {\n const visibleTopLevelRowCount = visibleSortedTopLevelRowEntries.length;\n const topLevelFirstRowIndex = Math.min(pagination.pageSize * pagination.page, visibleTopLevelRowCount - 1);\n const topLevelLastRowIndex = Math.min(topLevelFirstRowIndex + pagination.pageSize - 1, visibleTopLevelRowCount - 1); // The range contains no element\n\n if (topLevelFirstRowIndex === -1 || topLevelLastRowIndex === -1) {\n return null;\n } // The tree is flat, there is no need to look for children\n\n\n if (rowTreeDepth < 2) {\n return {\n firstRowIndex: topLevelFirstRowIndex,\n lastRowIndex: topLevelLastRowIndex\n };\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\n while (lastRowIndex < visibleSortedRowEntries.length && topLevelRowAdded <= topLevelRowsInCurrentPageCount) {\n const row = visibleSortedRowEntries[lastRowIndex];\n const depth = rowTree[row.id].depth;\n\n if (topLevelRowAdded < topLevelRowsInCurrentPageCount || depth > 0) {\n lastRowIndex += 1;\n }\n\n if (depth === 0) {\n topLevelRowAdded += 1;\n }\n }\n\n return {\n firstRowIndex,\n lastRowIndex: lastRowIndex - 1\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 */\n\nexport const gridPaginatedVisibleSortedGridRowEntriesSelector = createSelector(gridVisibleSortedRowEntriesSelector, gridPaginationRowRangeSelector, (visibleSortedRowEntries, paginationRange) => {\n if (!paginationRange) {\n return [];\n }\n\n return visibleSortedRowEntries.slice(paginationRange.firstRowIndex, paginationRange.lastRowIndex + 1);\n});\n/**\n * Get the id of each row to include in the current page if the pagination is enabled.\n * @category Pagination\n */\n\nexport const gridPaginatedVisibleSortedGridRowIdsSelector = createSelector(gridVisibleSortedRowIdsSelector, gridPaginationRowRangeSelector, (visibleSortedRowIds, paginationRange) => {\n if (!paginationRange) {\n return [];\n }\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 { unstable_composeClasses as composeClasses } from '@mui/material';\nimport { useGridSelector } from '../../hooks/utils/useGridSelector';\nimport { gridTabIndexColumnHeaderSelector } from '../../hooks/features/focus/gridFocusStateSelector';\nimport { gridSelectionStateSelector } from '../../hooks/features/selection/gridSelectionSelector';\nimport { isNavigationKey } from '../../utils/keyboardUtils';\nimport { useGridApiContext } from '../../hooks/utils/useGridApiContext';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { gridVisibleSortedRowIdsSelector } from '../../hooks/features/filter/gridFilterSelector';\nimport { gridPaginatedVisibleSortedGridRowIdsSelector } from '../../hooks/features/pagination/gridPaginationSelector';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['checkboxInput']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\n\nconst GridHeaderCheckbox = /*#__PURE__*/React.forwardRef(function GridHeaderCheckbox(props, ref) {\n var _rootProps$components;\n\n const other = _objectWithoutPropertiesLoose(props, _excluded);\n\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, gridSelectionStateSelector);\n const visibleRowIds = useGridSelector(apiRef, gridVisibleSortedRowIdsSelector);\n const paginatedVisibleRowIds = useGridSelector(apiRef, gridPaginatedVisibleSortedGridRowIdsSelector);\n const filteredSelection = React.useMemo(() => {\n if (typeof rootProps.isRowSelectable !== 'function') {\n return selection;\n }\n\n return selection.filter(id => {\n // The row might have been deleted\n if (!apiRef.current.getRow(id)) {\n return false;\n }\n\n return rootProps.isRowSelectable(apiRef.current.getRowParams(id));\n });\n }, [apiRef, rootProps.isRowSelectable, selection]); // All the rows that could be selected / unselected by toggling this checkbox\n\n const selectionCandidates = React.useMemo(() => {\n const rowIds = !rootProps.pagination || !rootProps.checkboxSelectionVisibleOnly ? visibleRowIds : paginatedVisibleRowIds; // 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\n return rowIds.reduce((acc, id) => {\n acc[id] = true;\n return acc;\n }, {});\n }, [rootProps.pagination, rootProps.checkboxSelectionVisibleOnly, paginatedVisibleRowIds, visibleRowIds]); // Amount of rows selected and that are visible in the current page\n\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\n const handleChange = event => {\n const params = {\n value: event.target.checked\n };\n apiRef.current.publishEvent('headerSelectionCheckboxChange', params);\n };\n\n const tabIndex = tabIndexState !== null && tabIndexState.field === props.field ? 0 : -1;\n React.useLayoutEffect(() => {\n const element = apiRef.current.getColumnHeaderElement(props.field);\n\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 } // TODO v6 remove columnHeaderNavigationKeyDown events which are not used internally anymore\n\n\n if (isNavigationKey(event.key) && !event.shiftKey) {\n apiRef.current.publishEvent('columnHeaderNavigationKeyDown', props, event);\n }\n }, [apiRef, props, isChecked]);\n const handleSelectionChange = React.useCallback(() => {\n forceUpdate(p => !p);\n }, []);\n React.useEffect(() => {\n return apiRef.current.subscribeEvent('selectionChange', handleSelectionChange);\n }, [apiRef, handleSelectionChange]);\n const label = apiRef.current.getLocaleText(isChecked ? 'checkboxSelectionUnselectAllRows' : 'checkboxSelectionSelectAllRows');\n return /*#__PURE__*/_jsx(rootProps.components.BaseCheckbox, _extends({\n ref: ref,\n indeterminate: isIndeterminate,\n checked: isChecked,\n onChange: handleChange,\n className: classes.root,\n color: \"primary\",\n inputProps: {\n 'aria-label': label\n },\n tabIndex: tabIndex,\n onKeyDown: handleKeyDown\n }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The column of the current header component.\n */\n colDef: PropTypes.object.isRequired,\n\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';\nimport { GridHeaderCheckbox } from '../components/columnSelection/GridHeaderCheckbox';\nimport { selectedIdsLookupSelector } from '../hooks/features/selection/gridSelectionSelector';\nimport { GRID_BOOLEAN_COL_DEF } from './gridBooleanColDef';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const GRID_CHECKBOX_SELECTION_COL_DEF = _extends({}, GRID_BOOLEAN_COL_DEF, {\n field: '__check__',\n type: 'checkboxSelection',\n width: 50,\n resizable: false,\n sortable: false,\n filterable: false,\n disableColumnMenu: true,\n disableReorder: true,\n disableExport: true,\n getApplyQuickFilterFn: undefined,\n valueGetter: params => {\n const selectionLookup = selectedIdsLookupSelector(params.api.state, params.api.instanceId);\n return selectionLookup[params.id] !== undefined;\n },\n renderHeader: params => /*#__PURE__*/_jsx(GridHeaderCheckbox, _extends({}, params)),\n renderCell: params => /*#__PURE__*/_jsx(GridCellCheckboxRenderer, _extends({}, params))\n});","import { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../../colDef';\nimport { buildWarning } from '../../../../utils/warning';\n\nconst serializeCellValue = (value, delimiterCharacter) => {\n if (typeof value === 'string') {\n const formattedValue = value.replace(/\"/g, '\"\"'); // Make sure value containing delimiter or line break won't be split into multiple rows\n\n if ([delimiterCharacter, '\\n', '\\r'].some(delimiter => formattedValue.includes(delimiter))) {\n return `\"${formattedValue}\"`;\n }\n\n return formattedValue;\n }\n\n return value;\n};\n\nconst objectFormattedValueWarning = buildWarning(['MUI: 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\nconst serializeRow = (id, columns, getCellParams, delimiterCharacter) => columns.map(column => {\n const cellParams = getCellParams(id, column.field);\n\n if (process.env.NODE_ENV !== 'production') {\n if (String(cellParams.formattedValue) === '[object Object]') {\n objectFormattedValueWarning();\n }\n }\n\n return serializeCellValue(cellParams.formattedValue, delimiterCharacter);\n});\n\nexport function buildCSV(options) {\n const {\n columns,\n rowIds,\n getCellParams,\n delimiterCharacter,\n includeHeaders\n } = options;\n const CSVBody = rowIds.reduce((acc, id) => `${acc}${serializeRow(id, columns, getCellParams, delimiterCharacter).join(delimiterCharacter)}\\r\\n`, '').trim();\n\n if (!includeHeaders) {\n return CSVBody;\n }\n\n const CSVHead = `${columns.filter(column => column.field !== GRID_CHECKBOX_SELECTION_COL_DEF.field).map(column => serializeCellValue(column.headerName || column.field, delimiterCharacter)).join(delimiterCharacter)}\\r\\n`;\n return `${CSVHead}${CSVBody}`.trim();\n}","import { gridColumnDefinitionsSelector, gridVisibleColumnDefinitionsSelector } from '../columns';\nimport { gridFilteredSortedRowIdsSelector } from '../filter';\nexport const getColumnsToExport = ({\n apiRef,\n options\n}) => {\n const columns = gridColumnDefinitionsSelector(apiRef);\n\n if (options.fields) {\n return options.fields.map(field => columns.find(column => column.field === field)).filter(column => !!column);\n }\n\n const validColumns = options.allColumns ? columns : gridVisibleColumnDefinitionsSelector(apiRef);\n return validColumns.filter(column => !column.disableExport);\n};\nexport const defaultGetRowsToExport = ({\n apiRef\n}) => {\n const filteredSortedRowIds = gridFilteredSortedRowIdsSelector(apiRef);\n const selectedRows = apiRef.current.getSelectedRows();\n\n if (selectedRows.size > 0) {\n return filteredSortedRowIds.filter(id => selectedRows.has(id));\n }\n\n return filteredSortedRowIds;\n};","/**\n * Filter item definition interface.\n */\nvar GridLinkOperator;\n\n(function (GridLinkOperator) {\n GridLinkOperator[\"And\"] = \"and\";\n GridLinkOperator[\"Or\"] = \"or\";\n})(GridLinkOperator || (GridLinkOperator = {}));\n\nexport { GridLinkOperator };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"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';\nimport { GridToolbarExportContainer } from './GridToolbarExportContainer';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const GridCsvExportMenuItem = props => {\n const apiRef = useGridApiContext();\n const {\n hideMenu,\n options\n } = props;\n return /*#__PURE__*/_jsx(MenuItem, {\n onClick: () => {\n apiRef.current.exportDataAsCsv(options);\n hideMenu == null ? void 0 : hideMenu();\n },\n children: apiRef.current.getLocaleText('toolbarExportCSV')\n });\n};\nexport const GridPrintExportMenuItem = props => {\n const apiRef = useGridApiContext();\n const {\n hideMenu,\n options\n } = props;\n return /*#__PURE__*/_jsx(MenuItem, {\n onClick: () => {\n apiRef.current.exportDataAsPrint(options);\n hideMenu == null ? void 0 : hideMenu();\n },\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, _excluded);\n\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\n if (preProcessedButtons.length === 0) {\n return null;\n }\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n csvOptions: PropTypes.object,\n printOptions: PropTypes.object\n} : void 0;\nexport { GridToolbarExport };","import * as React from 'react';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { exportAs } from '../../../utils/exportAs';\nimport { buildCSV } from './serializers/csvSerializer';\nimport { getColumnsToExport, defaultGetRowsToExport } from './utils';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { GridCsvExportMenuItem } from '../../../components/toolbar/GridToolbarExport';\n/**\n * @requires useGridColumns (state)\n * @requires useGridFilter (state)\n * @requires useGridSorting (state)\n * @requires useGridSelection (state)\n * @requires useGridParamsApi (method)\n */\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const useGridCsvExport = apiRef => {\n const logger = useGridLogger(apiRef, 'useGridCsvExport');\n const getDataAsCsv = React.useCallback((options = {}) => {\n var _options$getRowsToExp, _options$includeHeade;\n\n logger.debug(`Get data as CSV`);\n const exportedColumns = getColumnsToExport({\n apiRef,\n options\n });\n const getRowsToExport = (_options$getRowsToExp = options.getRowsToExport) != null ? _options$getRowsToExp : defaultGetRowsToExport;\n const exportedRowIds = getRowsToExport({\n apiRef\n });\n return buildCSV({\n columns: exportedColumns,\n rowIds: exportedRowIds,\n getCellParams: apiRef.current.getCellParams,\n delimiterCharacter: options.delimiter || ',',\n includeHeaders: (_options$includeHeade = options.includeHeaders) != null ? _options$includeHeade : true\n });\n }, [logger, apiRef]);\n const exportDataAsCsv = React.useCallback(options => {\n logger.debug(`Export data as CSV`);\n const csv = getDataAsCsv(options);\n const blob = new Blob([options != null && options.utf8WithBom ? new Uint8Array([0xef, 0xbb, 0xbf]) : '', csv], {\n type: 'text/csv'\n });\n exportAs(blob, 'csv', options == null ? void 0 : options.fileName);\n }, [logger, getDataAsCsv]);\n const csvExportApi = {\n getDataAsCsv,\n exportDataAsCsv\n };\n useGridApiMethod(apiRef, csvExportApi, 'GridCsvExportApi');\n /**\n * PRE-PROCESSING\n */\n\n const addExportMenuButtons = React.useCallback((initialValue, options) => {\n var _options$csvOptions;\n\n if ((_options$csvOptions = options.csvOptions) != null && _options$csvOptions.disableToolbarButton) {\n return initialValue;\n }\n\n return [...initialValue, {\n component: /*#__PURE__*/_jsx(GridCsvExportMenuItem, {\n options: options.csvOptions\n }),\n componentName: 'csvExport'\n }];\n }, []);\n useGridRegisterPipeProcessor(apiRef, 'exportMenu', addExportMenuButtons);\n};","/**\n * I have hesitated to use https://github.com/eligrey/FileSaver.js.\n * If we get bug reports that this project solves, we should consider using it.\n *\n * Related resources.\n * https://blog.logrocket.com/programmatic-file-downloads-in-the-browser-9a5186298d5c/\n * https://github.com/mbrn/filefy/blob/ec4ed0b7415d93be7158c23029f2ea1fa0b8e2d9/src/core/BaseBuilder.ts\n * https://unpkg.com/browse/@progress/kendo-file-saver@1.0.7/dist/es/save-as.js\n * https://github.com/ag-grid/ag-grid/blob/9565c219b6210aa85fa833c929d0728f9d163a91/community-modules/csv-export/src/csvExport/downloader.ts\n */\nexport function exportAs(blob, extension = 'csv', filename = document.title || 'untitled') {\n const fullName = `${filename}.${extension}`; // Test download attribute first\n // https://github.com/eligrey/FileSaver.js/issues/193\n\n if ('download' in HTMLAnchorElement.prototype) {\n // Create an object URL for the blob object\n const url = URL.createObjectURL(blob); // Create a new anchor element\n\n const a = document.createElement('a');\n a.href = url;\n a.download = fullName; // Programmatically trigger a click on the anchor element\n // Useful if you want the download to happen automatically\n // Without attaching the anchor element to the DOM\n\n a.click(); // https://github.com/eligrey/FileSaver.js/issues/205\n\n setTimeout(() => {\n URL.revokeObjectURL(url);\n });\n return;\n }\n\n throw new Error('MUI: exportAs not supported');\n}","export const gridRowsMetaSelector = state => state.rowsMeta;","export const GridFeatureModeConstant = {\n client: 'client',\n server: 'server'\n};","import { GridLinkOperator } from '../../../models/gridFilterItem';\nexport const getDefaultGridFilterModel = () => ({\n items: [],\n linkOperator: GridLinkOperator.And,\n quickFilterValues: [],\n quickFilterLogicOperator: GridLinkOperator.And\n});","import * as React from 'react';\nimport { useFirstRender } from '../../utils/useFirstRender';\nexport const useGridRegisterStrategyProcessor = (apiRef, strategyName, group, processor) => {\n const registerPreProcessor = React.useCallback(() => {\n apiRef.current.unstable_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 _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { GridLinkOperator } from '../../../models';\nimport { buildWarning } from '../../../utils/warning';\nimport { gridColumnFieldsSelector } from '../columns';\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 operatorValue.\n * TODO: Make the typing reflect the different between GridFilterInputItem and GridFilterItem.\n */\nconst cleanFilterItem = (item, apiRef) => {\n const cleanItem = _extends({}, item);\n\n if (cleanItem.id == null) {\n cleanItem.id = Math.round(Math.random() * 1e5);\n }\n\n if (cleanItem.operatorValue == null) {\n // we select a default operator\n const column = apiRef.current.getColumn(cleanItem.columnField);\n cleanItem.operatorValue = column && column.filterOperators[0].value;\n }\n\n return cleanItem;\n};\n\nconst filterModelDisableMultiColumnsFilteringWarning = buildWarning(['MUI: 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');\nconst filterModelMissingItemIdWarning = buildWarning(\"MUI: The 'id' field is required on `filterModel.items` when you use multiple filters.\", 'error');\nconst filterModelMissingItemOperatorWarning = buildWarning(['MUI: One of your filtering item have no `operatorValue` provided.', 'This property will become required on `@mui/x-data-grid@6.X`.']);\nexport const sanitizeFilterModel = (model, disableMultipleColumnsFiltering, apiRef) => {\n const hasSeveralItems = model.items.length > 1;\n let items;\n\n if (hasSeveralItems && disableMultipleColumnsFiltering) {\n filterModelDisableMultiColumnsFilteringWarning();\n items = [model.items[0]];\n } else {\n items = model.items;\n }\n\n const hasItemsWithoutIds = hasSeveralItems && items.some(item => item.id == null);\n const hasItemWithoutOperator = items.some(item => item.operatorValue == null);\n\n if (hasItemsWithoutIds) {\n filterModelMissingItemIdWarning();\n }\n\n if (hasItemWithoutOperator) {\n filterModelMissingItemOperatorWarning();\n }\n\n if (hasItemWithoutOperator || hasItemsWithoutIds) {\n return _extends({}, model, {\n items: items.map(item => cleanFilterItem(item, apiRef))\n });\n }\n\n if (model.items !== items) {\n return _extends({}, model, {\n items\n });\n }\n\n return model;\n};\nexport const mergeStateWithFilterModel = (filterModel, disableMultipleColumnsFiltering, apiRef) => state => _extends({}, state, {\n filter: _extends({}, state.filter, {\n filterModel: sanitizeFilterModel(filterModel, disableMultipleColumnsFiltering, apiRef)\n })\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 */\n\nexport const buildAggregatedFilterItemsApplier = (filterModel, apiRef) => {\n const {\n items,\n linkOperator = GridLinkOperator.And\n } = filterModel;\n\n const getFilterCallbackFromItem = filterItem => {\n if (!filterItem.columnField || !filterItem.operatorValue) {\n return null;\n }\n\n const column = apiRef.current.getColumn(filterItem.columnField);\n\n if (!column) {\n return null;\n }\n\n let parsedValue;\n\n if (column.valueParser) {\n var _filterItem$value;\n\n const parser = column.valueParser;\n parsedValue = Array.isArray(filterItem.value) ? (_filterItem$value = filterItem.value) == null ? void 0 : _filterItem$value.map(x => parser(x)) : parser(filterItem.value);\n } else {\n parsedValue = filterItem.value;\n }\n\n const newFilterItem = _extends({}, filterItem, {\n value: parsedValue\n });\n\n const filterOperators = column.filterOperators;\n\n if (!(filterOperators != null && filterOperators.length)) {\n throw new Error(`MUI: No filter operators found for column '${column.field}'.`);\n }\n\n const filterOperator = filterOperators.find(operator => operator.value === newFilterItem.operatorValue);\n\n if (!filterOperator) {\n throw new Error(`MUI: No filter operator found for column '${column.field}' and operator value '${newFilterItem.operatorValue}'.`);\n }\n\n const applyFilterOnRow = filterOperator.getApplyFilterFn(newFilterItem, column);\n\n if (typeof applyFilterOnRow !== 'function') {\n return null;\n }\n\n const fn = rowId => {\n const cellParams = apiRef.current.getCellParams(rowId, newFilterItem.columnField);\n return applyFilterOnRow(cellParams);\n };\n\n return {\n fn,\n item: newFilterItem\n };\n };\n\n const appliers = items.map(getFilterCallbackFromItem).filter(callback => !!callback);\n\n if (appliers.length === 0) {\n return null;\n }\n\n return (rowId, shouldApplyFilter) => {\n const filteredAppliers = shouldApplyFilter ? appliers.filter(applier => shouldApplyFilter(applier.item.columnField)) : appliers; // Return `false` as soon as we have a failing filter\n\n if (linkOperator === GridLinkOperator.And) {\n return filteredAppliers.every(applier => applier.fn(rowId));\n } // Return `true` as soon as we have a passing filter\n\n\n return filteredAppliers.some(applier => applier.fn(rowId));\n };\n};\n/**\n * Generates a method to easily check if a row is matching the current quick filter.\n * @param {any[]} values 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 */\n\nexport const buildAggregatedQuickFilterApplier = (filterModel, apiRef) => {\n const {\n quickFilterValues = [],\n quickFilterLogicOperator = GridLinkOperator.And\n } = filterModel;\n\n if (quickFilterValues.length === 0) {\n return null;\n }\n\n const columnsFields = gridColumnFieldsSelector(apiRef);\n const appliersPerColumnField = {};\n columnsFields.forEach(field => {\n const column = apiRef.current.getColumn(field);\n const getApplyQuickFilterFn = column == null ? void 0 : column.getApplyQuickFilterFn;\n\n if (!getApplyQuickFilterFn) {\n return;\n }\n\n appliersPerColumnField[field] = quickFilterValues.map(value => getApplyQuickFilterFn(value, column, apiRef));\n }); // If some value does not have an applier we ignore them\n\n const sanitizedQuickFilterValues = quickFilterValues.filter((value, index) => Object.keys(appliersPerColumnField).some(field => appliersPerColumnField[field][index] != null));\n return (rowId, shouldApplyFilter) => {\n const usedCellParams = {};\n Object.keys(appliersPerColumnField).forEach(columnField => {\n if (!shouldApplyFilter || shouldApplyFilter(columnField)) {\n usedCellParams[columnField] = apiRef.current.getCellParams(rowId, columnField);\n }\n }); // Return `false` as soon as we have a quick filter value that does not match any column\n\n if (quickFilterLogicOperator === GridLinkOperator.And) {\n return sanitizedQuickFilterValues.every((value, index) => Object.keys(appliersPerColumnField).some(field => {\n var _appliersPerColumnFie, _appliersPerColumnFie2;\n\n if (appliersPerColumnField[field][index] == null) {\n return false;\n }\n\n return (_appliersPerColumnFie = (_appliersPerColumnFie2 = appliersPerColumnField[field])[index]) == null ? void 0 : _appliersPerColumnFie.call(_appliersPerColumnFie2, usedCellParams[field]);\n }));\n } // Return `true` as soon as we have have a quick filter value that match any column\n\n\n return sanitizedQuickFilterValues.some((value, index) => Object.keys(appliersPerColumnField).some(field => {\n var _appliersPerColumnFie3, _appliersPerColumnFie4;\n\n if (appliersPerColumnField[field][index] == null) {\n return false;\n }\n\n return (_appliersPerColumnFie3 = (_appliersPerColumnFie4 = appliersPerColumnField[field])[index]) == null ? void 0 : _appliersPerColumnFie3.call(_appliersPerColumnFie4, usedCellParams[field]);\n }));\n };\n};\nexport const buildAggregatedFilterApplier = (filterModel, apiRef) => {\n const isRowMatchingFilterItems = buildAggregatedFilterItemsApplier(filterModel, apiRef);\n const isRowMatchingQuickFilter = buildAggregatedQuickFilterApplier(filterModel, apiRef);\n\n if (isRowMatchingFilterItems == null && isRowMatchingQuickFilter == null) {\n return null;\n }\n\n if (isRowMatchingFilterItems == null) {\n return isRowMatchingQuickFilter;\n }\n\n if (isRowMatchingQuickFilter == null) {\n return isRowMatchingFilterItems;\n }\n\n return (rowId, shouldApplyFilter) => isRowMatchingFilterItems(rowId, shouldApplyFilter) && isRowMatchingQuickFilter(rowId, shouldApplyFilter);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { GridFeatureModeConstant } from '../../../models/gridFeatureMode';\nimport { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridFilterableColumnLookupSelector } from '../columns/gridColumnsSelector';\nimport { GridPreferencePanelsValue } from '../preferencesPanel/gridPreferencePanelsValue';\nimport { getDefaultGridFilterModel } from './gridFilterState';\nimport { gridFilterModelSelector, gridVisibleSortedRowEntriesSelector } from './gridFilterSelector';\nimport { useFirstRender } from '../../utils/useFirstRender';\nimport { gridRowIdsSelector } from '../rows';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { GRID_DEFAULT_STRATEGY, useGridRegisterStrategyProcessor } from '../../core/strategyProcessing';\nimport { buildAggregatedFilterApplier, sanitizeFilterModel, mergeStateWithFilterModel } from './gridFilterUtils';\nimport { isDeepEqual } from '../../../utils/utils';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const filterStateInitializer = (state, props, apiRef) => {\n var _ref, _props$filterModel, _props$initialState, _props$initialState$f;\n\n const filterModel = (_ref = (_props$filterModel = props.filterModel) != null ? _props$filterModel : (_props$initialState = props.initialState) == null ? void 0 : (_props$initialState$f = _props$initialState.filter) == null ? void 0 : _props$initialState$f.filterModel) != null ? _ref : getDefaultGridFilterModel();\n return _extends({}, state, {\n filter: {\n filterModel: sanitizeFilterModel(filterModel, props.disableMultipleColumnsFiltering, apiRef),\n visibleRowsLookup: {},\n filteredDescendantCountLookup: {}\n }\n });\n};\n/**\n * @requires useGridColumns (method, event)\n * @requires useGridParamsApi (method)\n * @requires useGridRows (event)\n */\n\nexport const useGridFilter = (apiRef, props) => {\n var _props$componentsProp2;\n\n const logger = useGridLogger(apiRef, 'useGridFilter');\n apiRef.current.unstable_updateControlState({\n stateId: 'filter',\n propModel: props.filterModel,\n propOnChange: props.onFilterModelChange,\n stateSelector: gridFilterModelSelector,\n changeEvent: 'filterModelChange'\n });\n const updateFilteredRows = React.useCallback(() => {\n apiRef.current.setState(state => {\n const filterModel = gridFilterModelSelector(state, apiRef.current.instanceId);\n const isRowMatchingFilters = props.filterMode === GridFeatureModeConstant.client ? buildAggregatedFilterApplier(filterModel, apiRef) : null;\n const filteringResult = apiRef.current.unstable_applyStrategyProcessor('filtering', {\n isRowMatchingFilters\n });\n return _extends({}, state, {\n filter: _extends({}, state.filter, filteringResult)\n });\n });\n apiRef.current.publishEvent('filteredRowsSet');\n }, [props.filterMode, apiRef]);\n /**\n * API METHODS\n */\n\n const applyFilters = React.useCallback(() => {\n updateFilteredRows();\n apiRef.current.forceUpdate();\n }, [apiRef, updateFilteredRows]);\n const upsertFilterItem = React.useCallback(item => {\n const filterModel = gridFilterModelSelector(apiRef);\n const items = [...filterModel.items];\n const itemIndex = items.findIndex(filterItem => filterItem.id === item.id);\n\n if (itemIndex === -1) {\n items.push(item);\n } else {\n items[itemIndex] = item;\n }\n\n apiRef.current.setFilterModel(_extends({}, filterModel, {\n items\n }));\n }, [apiRef]);\n const deleteFilterItem = React.useCallback(itemToDelete => {\n const filterModel = gridFilterModelSelector(apiRef);\n const items = filterModel.items.filter(item => item.id !== itemToDelete.id);\n\n if (items.length === filterModel.items.length) {\n return;\n }\n\n apiRef.current.setFilterModel(_extends({}, filterModel, {\n items\n }));\n }, [apiRef]);\n const showFilterPanel = React.useCallback(targetColumnField => {\n logger.debug('Displaying filter panel');\n\n if (targetColumnField) {\n const filterModel = gridFilterModelSelector(apiRef);\n const filterItemsWithValue = filterModel.items.filter(item => item.value !== undefined);\n let newFilterItems;\n const filterItemOnTarget = filterItemsWithValue.find(item => item.columnField === targetColumnField);\n\n if (filterItemOnTarget) {\n newFilterItems = filterItemsWithValue;\n } else if (props.disableMultipleColumnsFiltering) {\n newFilterItems = [{\n columnField: targetColumnField\n }];\n } else {\n newFilterItems = [...filterItemsWithValue, {\n columnField: targetColumnField\n }];\n }\n\n apiRef.current.setFilterModel(_extends({}, filterModel, {\n items: newFilterItems\n }));\n }\n\n apiRef.current.showPreferences(GridPreferencePanelsValue.filters);\n }, [apiRef, logger, props.disableMultipleColumnsFiltering]);\n const hideFilterPanel = React.useCallback(() => {\n logger.debug('Hiding filter panel');\n apiRef.current.hidePreferences();\n }, [apiRef, logger]);\n const setFilterLinkOperator = React.useCallback(linkOperator => {\n const filterModel = gridFilterModelSelector(apiRef);\n\n if (filterModel.linkOperator === linkOperator) {\n return;\n }\n\n apiRef.current.setFilterModel(_extends({}, filterModel, {\n linkOperator\n }));\n }, [apiRef]);\n const setQuickFilterValues = React.useCallback(values => {\n const filterModel = gridFilterModelSelector(apiRef);\n\n if (isDeepEqual(filterModel.quickFilterValues, values)) {\n return;\n }\n\n apiRef.current.setFilterModel(_extends({}, filterModel, {\n quickFilterValues: [...values]\n }));\n }, [apiRef]);\n const setFilterModel = React.useCallback(model => {\n const currentModel = gridFilterModelSelector(apiRef);\n\n if (currentModel !== model) {\n logger.debug('Setting filter model');\n apiRef.current.setState(mergeStateWithFilterModel(model, props.disableMultipleColumnsFiltering, apiRef));\n apiRef.current.unstable_applyFilters();\n }\n }, [apiRef, logger, props.disableMultipleColumnsFiltering]);\n const getVisibleRowModels = React.useCallback(() => {\n const visibleSortedRows = gridVisibleSortedRowEntriesSelector(apiRef);\n return new Map(visibleSortedRows.map(row => [row.id, row.model]));\n }, [apiRef]);\n const filterApi = {\n setFilterLinkOperator,\n unstable_applyFilters: applyFilters,\n deleteFilterItem,\n upsertFilterItem,\n setFilterModel,\n showFilterPanel,\n hideFilterPanel,\n getVisibleRowModels,\n setQuickFilterValues\n };\n useGridApiMethod(apiRef, filterApi, 'GridFilterApi');\n /**\n * PRE-PROCESSING\n */\n\n const stateExportPreProcessing = React.useCallback(prevState => {\n const filterModelToExport = gridFilterModelSelector(apiRef);\n\n if (filterModelToExport.items.length === 0 && filterModelToExport.linkOperator === getDefaultGridFilterModel().linkOperator) {\n return prevState;\n }\n\n return _extends({}, prevState, {\n filter: {\n filterModel: filterModelToExport\n }\n });\n }, [apiRef]);\n const stateRestorePreProcessing = React.useCallback((params, context) => {\n var _context$stateToResto;\n\n const filterModel = (_context$stateToResto = context.stateToRestore.filter) == null ? void 0 : _context$stateToResto.filterModel;\n\n if (filterModel == null) {\n return params;\n }\n\n apiRef.current.setState(mergeStateWithFilterModel(filterModel, props.disableMultipleColumnsFiltering, apiRef));\n return _extends({}, params, {\n callbacks: [...params.callbacks, apiRef.current.unstable_applyFilters]\n });\n }, [apiRef, props.disableMultipleColumnsFiltering]);\n const preferencePanelPreProcessing = React.useCallback((initialValue, value) => {\n if (value === GridPreferencePanelsValue.filters) {\n var _props$componentsProp;\n\n const FilterPanel = props.components.FilterPanel;\n return /*#__PURE__*/_jsx(FilterPanel, _extends({}, (_props$componentsProp = props.componentsProps) == null ? void 0 : _props$componentsProp.filterPanel));\n }\n\n return initialValue;\n }, [props.components.FilterPanel, (_props$componentsProp2 = props.componentsProps) == null ? void 0 : _props$componentsProp2.filterPanel]);\n const flatFilteringMethod = React.useCallback(params => {\n if (props.filterMode === GridFeatureModeConstant.client && params.isRowMatchingFilters) {\n const rowIds = gridRowIdsSelector(apiRef);\n const filteredRowsLookup = {};\n\n for (let i = 0; i < rowIds.length; i += 1) {\n const rowId = rowIds[i];\n filteredRowsLookup[rowId] = params.isRowMatchingFilters(rowId);\n }\n\n return {\n filteredRowsLookup,\n // For flat tree, the `visibleRowsLookup` and the `filteredRowsLookup` since no row is collapsed.\n visibleRowsLookup: filteredRowsLookup,\n filteredDescendantCountLookup: {}\n };\n }\n\n return {\n visibleRowsLookup: {},\n filteredRowsLookup: {},\n filteredDescendantCountLookup: {}\n };\n }, [apiRef, props.filterMode]);\n useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);\n useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);\n useGridRegisterPipeProcessor(apiRef, 'preferencePanel', preferencePanelPreProcessing);\n useGridRegisterStrategyProcessor(apiRef, GRID_DEFAULT_STRATEGY, 'filtering', flatFilteringMethod);\n /**\n * EVENTS\n */\n\n const handleColumnsChange = React.useCallback(() => {\n logger.debug('onColUpdated - GridColumns changed, applying filters');\n const filterModel = gridFilterModelSelector(apiRef);\n const filterableColumnsLookup = gridFilterableColumnLookupSelector(apiRef);\n const newFilterItems = filterModel.items.filter(item => item.columnField && filterableColumnsLookup[item.columnField]);\n\n if (newFilterItems.length < filterModel.items.length) {\n apiRef.current.setFilterModel(_extends({}, filterModel, {\n items: newFilterItems\n }));\n }\n }, [apiRef, logger]);\n const handleStrategyProcessorChange = React.useCallback(methodName => {\n if (methodName === 'filtering') {\n apiRef.current.unstable_applyFilters();\n }\n }, [apiRef]); // Do not call `apiRef.current.forceUpdate` to avoid re-render before updating the sorted rows.\n // Otherwise, the state is not consistent during the render\n\n useGridApiEventHandler(apiRef, 'rowsSet', updateFilteredRows);\n useGridApiEventHandler(apiRef, 'rowExpansionChange', apiRef.current.unstable_applyFilters);\n useGridApiEventHandler(apiRef, 'columnsChange', handleColumnsChange);\n useGridApiEventHandler(apiRef, 'activeStrategyProcessorChange', handleStrategyProcessorChange);\n /**\n * 1ST RENDER\n */\n\n useFirstRender(() => {\n apiRef.current.unstable_applyFilters();\n });\n /**\n * EFFECTS\n */\n\n React.useEffect(() => {\n if (props.filterModel !== undefined) {\n apiRef.current.setFilterModel(props.filterModel);\n }\n }, [apiRef, logger, props.filterModel]);\n};","import * as React from 'react';\nimport { gridPaginationRowRangeSelector, gridPaginatedVisibleSortedGridRowEntriesSelector } from '../features/pagination/gridPaginationSelector';\nimport { gridVisibleSortedRowEntriesSelector } from '../features/filter/gridFilterSelector';\nexport const getVisibleRows = (apiRef, props) => {\n let rows;\n let range;\n\n if (props.pagination && props.paginationMode === 'client') {\n range = gridPaginationRowRangeSelector(apiRef);\n rows = gridPaginatedVisibleSortedGridRowEntriesSelector(apiRef);\n } else {\n rows = gridVisibleSortedRowEntriesSelector(apiRef);\n\n if (rows.length === 0) {\n range = null;\n } else {\n range = {\n firstRowIndex: 0,\n lastRowIndex: rows.length - 1\n };\n }\n }\n\n return {\n rows,\n range\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 */\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};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { ownerDocument } from '@mui/material/utils';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';\nimport { isNavigationKey } from '../../../utils/keyboardUtils';\nimport { gridFocusCellSelector } from './gridFocusStateSelector';\nimport { gridVisibleColumnDefinitionsSelector } from '../columns/gridColumnsSelector';\nimport { getVisibleRows } from '../../utils/useGridVisibleRows';\nimport { clamp } from '../../../utils/utils';\nexport const focusStateInitializer = state => _extends({}, state, {\n focus: {\n cell: null,\n columnHeader: null\n },\n tabIndex: {\n cell: null,\n columnHeader: null\n }\n});\n/**\n * @requires useGridParamsApi (method)\n * @requires useGridRows (method)\n * @requires useGridEditing (event)\n */\n\nexport const useGridFocus = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridFocus');\n const lastClickedCell = React.useRef(null);\n const setCellFocus = React.useCallback((id, field) => {\n const focusedCell = gridFocusCellSelector(apiRef);\n\n if ((focusedCell == null ? void 0 : focusedCell.id) === id && (focusedCell == null ? void 0 : focusedCell.field) === field) {\n return;\n }\n\n apiRef.current.setState(state => {\n logger.debug(`Focusing on cell with id=${id} and field=${field}`);\n return _extends({}, state, {\n tabIndex: {\n cell: {\n id,\n field\n },\n columnHeader: null\n },\n focus: {\n cell: {\n id,\n field\n },\n columnHeader: null\n }\n });\n });\n apiRef.current.forceUpdate(); // The row might have been deleted\n\n if (!apiRef.current.getRow(id)) {\n return;\n }\n\n apiRef.current.publishEvent('cellFocusIn', apiRef.current.getCellParams(id, field));\n }, [apiRef, logger]);\n const setColumnHeaderFocus = React.useCallback((field, event = {}) => {\n const cell = gridFocusCellSelector(apiRef);\n\n if (cell) {\n apiRef.current.publishEvent('cellFocusOut', apiRef.current.getCellParams(cell.id, cell.field), event);\n }\n\n apiRef.current.setState(state => {\n logger.debug(`Focusing on column header with colIndex=${field}`);\n return _extends({}, state, {\n tabIndex: {\n columnHeader: {\n field\n },\n cell: null\n },\n focus: {\n columnHeader: {\n field\n },\n cell: null\n }\n });\n });\n apiRef.current.forceUpdate();\n }, [apiRef, logger]);\n const moveFocusToRelativeCell = React.useCallback((id, field, direction) => {\n let columnIndexToFocus = apiRef.current.getColumnIndex(field);\n let rowIndexToFocus = apiRef.current.getRowIndexRelativeToVisibleRows(id);\n const visibleColumns = gridVisibleColumnDefinitionsSelector(apiRef);\n\n if (direction === 'right') {\n columnIndexToFocus += 1;\n } else if (direction === 'left') {\n columnIndexToFocus -= 1;\n } else {\n rowIndexToFocus += 1;\n }\n\n const currentPage = getVisibleRows(apiRef, {\n pagination: props.pagination,\n paginationMode: props.paginationMode\n });\n\n if (columnIndexToFocus >= visibleColumns.length) {\n // Go to next row if we are after the last column\n rowIndexToFocus += 1;\n\n if (rowIndexToFocus < currentPage.rows.length) {\n // Go to first column of the next row if there's one more row\n columnIndexToFocus = 0;\n }\n } else if (columnIndexToFocus < 0) {\n // Go to previous row if we are before the first column\n rowIndexToFocus -= 1;\n\n if (rowIndexToFocus >= 0) {\n // Go to last column of the previous if there's one more row\n columnIndexToFocus = visibleColumns.length - 1;\n }\n }\n\n rowIndexToFocus = clamp(rowIndexToFocus, 0, currentPage.rows.length - 1);\n columnIndexToFocus = clamp(columnIndexToFocus, 0, visibleColumns.length - 1);\n const rowToFocus = currentPage.rows[rowIndexToFocus];\n const columnToFocus = visibleColumns[columnIndexToFocus];\n apiRef.current.setCellFocus(rowToFocus.id, columnToFocus.field);\n }, [apiRef, props.pagination, props.paginationMode]);\n const handleCellDoubleClick = React.useCallback(({\n id,\n field\n }) => {\n apiRef.current.setCellFocus(id, field);\n }, [apiRef]);\n const handleCellKeyDown = React.useCallback((params, event) => {\n // GRID_CELL_NAVIGATION_KEY_DOWN handles the focus on Enter, Tab and navigation keys\n if (event.key === 'Enter' || event.key === 'Tab' || isNavigationKey(event.key)) {\n return;\n }\n\n apiRef.current.setCellFocus(params.id, params.field);\n }, [apiRef]);\n const handleColumnHeaderFocus = React.useCallback(({\n field\n }, event) => {\n if (event.target !== event.currentTarget) {\n return;\n }\n\n apiRef.current.setColumnHeaderFocus(field, event);\n }, [apiRef]);\n const handleBlur = React.useCallback(() => {\n logger.debug(`Clearing focus`);\n apiRef.current.setState(state => _extends({}, state, {\n focus: {\n cell: null,\n columnHeader: null\n }\n }));\n }, [logger, apiRef]);\n const handleCellMouseUp = React.useCallback(params => {\n lastClickedCell.current = params;\n }, []);\n const handleDocumentClick = React.useCallback(event => {\n const cellParams = lastClickedCell.current;\n lastClickedCell.current = null;\n const focusedCell = gridFocusCellSelector(apiRef);\n\n if (!focusedCell) {\n if (cellParams) {\n apiRef.current.setCellFocus(cellParams.id, cellParams.field);\n }\n\n return;\n }\n\n if ((cellParams == null ? void 0 : cellParams.id) === focusedCell.id && (cellParams == null ? void 0 : cellParams.field) === focusedCell.field) {\n return;\n }\n\n const cellElement = apiRef.current.getCellElement(focusedCell.id, focusedCell.field);\n\n if (cellElement != null && cellElement.contains(event.target)) {\n return;\n } // The row might have been deleted during the click\n\n\n if (!apiRef.current.getRow(focusedCell.id)) {\n return;\n } // There's a focused cell but another cell was clicked\n // Publishes an event to notify that the focus was lost\n\n\n apiRef.current.publishEvent('cellFocusOut', apiRef.current.getCellParams(focusedCell.id, focusedCell.field), event);\n\n if (cellParams) {\n apiRef.current.setCellFocus(cellParams.id, cellParams.field);\n } else {\n apiRef.current.setState(state => _extends({}, state, {\n focus: {\n cell: null,\n columnHeader: null\n }\n }));\n apiRef.current.forceUpdate();\n }\n }, [apiRef]);\n const handleCellModeChange = React.useCallback(params => {\n if (params.cellMode === 'view') {\n return;\n }\n\n const cell = gridFocusCellSelector(apiRef);\n\n if ((cell == null ? void 0 : cell.id) !== params.id || (cell == null ? void 0 : cell.field) !== params.field) {\n apiRef.current.setCellFocus(params.id, params.field);\n }\n }, [apiRef]);\n const handleRowSet = React.useCallback(() => {\n const cell = gridFocusCellSelector(apiRef); // If the focused cell is in a row which does not exist anymore, then remove the focus\n\n if (cell && !apiRef.current.getRow(cell.id)) {\n apiRef.current.setState(state => _extends({}, state, {\n focus: {\n cell: null,\n columnHeader: null\n }\n }));\n }\n }, [apiRef]);\n useGridApiMethod(apiRef, {\n setCellFocus,\n setColumnHeaderFocus,\n unstable_moveFocusToRelativeCell: moveFocusToRelativeCell\n }, 'GridFocusApi');\n React.useEffect(() => {\n const doc = ownerDocument(apiRef.current.rootElementRef.current);\n doc.addEventListener('click', handleDocumentClick);\n return () => {\n doc.removeEventListener('click', handleDocumentClick);\n };\n }, [apiRef, handleDocumentClick]);\n useGridApiEventHandler(apiRef, 'columnHeaderBlur', handleBlur);\n useGridApiEventHandler(apiRef, 'cellDoubleClick', handleCellDoubleClick);\n useGridApiEventHandler(apiRef, 'cellMouseUp', handleCellMouseUp);\n useGridApiEventHandler(apiRef, 'cellKeyDown', handleCellKeyDown);\n useGridApiEventHandler(apiRef, 'cellModeChange', handleCellModeChange);\n useGridApiEventHandler(apiRef, 'columnHeaderFocus', handleColumnHeaderFocus);\n useGridApiEventHandler(apiRef, 'rowsSet', handleRowSet);\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 * as React from 'react';\nimport { useGridLogger, useGridApiMethod, useGridApiEventHandler, useGridSelector } from '../../utils';\nimport { gridPageSizeSelector } from './gridPaginationSelector';\nimport { gridDensityRowHeightSelector } from '../density';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nexport const defaultPageSize = autoPageSize => autoPageSize ? 0 : 100;\n\nconst mergeStateWithPageSize = pageSize => state => _extends({}, state, {\n pagination: _extends({}, state.pagination, {\n pageSize\n })\n});\n/**\n * @requires useGridDimensions (event) - can be after\n */\n\n\nexport const useGridPageSize = (apiRef, props) => {\n var _props$initialState2, _props$initialState2$;\n\n const logger = useGridLogger(apiRef, 'useGridPageSize');\n const rowHeight = useGridSelector(apiRef, gridDensityRowHeightSelector);\n apiRef.current.unstable_updateControlState({\n stateId: 'pageSize',\n propModel: props.pageSize,\n propOnChange: props.onPageSizeChange,\n stateSelector: gridPageSizeSelector,\n changeEvent: 'pageSizeChange'\n });\n /**\n * API METHODS\n */\n\n const setPageSize = React.useCallback(pageSize => {\n if (pageSize === gridPageSizeSelector(apiRef)) {\n return;\n }\n\n logger.debug(`Setting page size to ${pageSize}`);\n apiRef.current.setState(mergeStateWithPageSize(pageSize));\n apiRef.current.forceUpdate();\n }, [apiRef, logger]);\n const pageSizeApi = {\n setPageSize\n };\n useGridApiMethod(apiRef, pageSizeApi, 'GridPageSizeApi');\n /**\n * PRE-PROCESSING\n */\n\n const stateExportPreProcessing = React.useCallback(prevState => {\n var _props$initialState, _props$initialState$p;\n\n const pageSizeToExport = gridPageSizeSelector(apiRef);\n const shouldExportPageSize = // Always export if the page size is controlled\n props.pageSize != null || // Always export if the page size has been initialized\n ((_props$initialState = props.initialState) == null ? void 0 : (_props$initialState$p = _props$initialState.pagination) == null ? void 0 : _props$initialState$p.pageSize) != null || // Export if the page size value is not equal to the default value\n pageSizeToExport !== defaultPageSize(props.autoPageSize);\n\n if (!shouldExportPageSize) {\n return prevState;\n }\n\n return _extends({}, prevState, {\n pagination: _extends({}, prevState.pagination, {\n pageSize: pageSizeToExport\n })\n });\n }, [apiRef, props.pageSize, (_props$initialState2 = props.initialState) == null ? void 0 : (_props$initialState2$ = _props$initialState2.pagination) == null ? void 0 : _props$initialState2$.pageSize, props.autoPageSize]);\n /**\n * TODO: Add error if `prop.autoHeight = true`\n */\n\n const stateRestorePreProcessing = React.useCallback((params, context) => {\n var _context$stateToResto;\n\n const pageSize = (_context$stateToResto = context.stateToRestore.pagination) == null ? void 0 : _context$stateToResto.pageSize;\n\n if (pageSize != null) {\n apiRef.current.setState(mergeStateWithPageSize(pageSize));\n }\n\n return params;\n }, [apiRef]);\n useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);\n useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);\n /**\n * EVENTS\n */\n\n const handleUpdateAutoPageSize = React.useCallback(() => {\n const dimensions = apiRef.current.getRootDimensions();\n\n if (!props.autoPageSize || !dimensions) {\n return;\n }\n\n const maximumPageSizeWithoutScrollBar = Math.floor(dimensions.viewportInnerSize.height / rowHeight);\n apiRef.current.setPageSize(maximumPageSizeWithoutScrollBar);\n }, [apiRef, props.autoPageSize, rowHeight]);\n useGridApiEventHandler(apiRef, 'viewportInnerSizeChange', handleUpdateAutoPageSize);\n /**\n * EFFECTS\n */\n\n React.useEffect(() => {\n if (props.pageSize != null && !props.autoPageSize) {\n apiRef.current.setPageSize(props.pageSize);\n }\n }, [apiRef, props.autoPageSize, props.pageSize]);\n React.useEffect(() => {\n handleUpdateAutoPageSize();\n }, [handleUpdateAutoPageSize]);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridLogger, useGridSelector, useGridApiMethod, useGridApiEventHandler } from '../../utils';\nimport { gridVisibleTopLevelRowCountSelector } from '../filter';\nimport { gridPageSelector, gridPageSizeSelector } from './gridPaginationSelector';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { buildWarning } from '../../../utils/warning';\nexport const getPageCount = (rowCount, pageSize) => {\n if (pageSize > 0 && rowCount > 0) {\n return Math.ceil(rowCount / pageSize);\n }\n\n return 0;\n};\n\nconst applyValidPage = paginationState => {\n if (!paginationState.pageCount) {\n return paginationState;\n }\n\n return _extends({}, paginationState, {\n page: Math.max(Math.min(paginationState.page, paginationState.pageCount - 1), 0)\n });\n};\n\nconst mergeStateWithPage = page => state => _extends({}, state, {\n pagination: applyValidPage(_extends({}, state.pagination, {\n page\n }))\n});\n\nconst noRowCountInServerMode = buildWarning([\"MUI: the 'rowCount' prop is undefined while using paginationMode='server'\", 'For more detail, see http://mui.com/components/data-grid/pagination/#basic-implementation'], 'error');\n/**\n * @requires useGridPageSize (event)\n */\n\nexport const useGridPage = (apiRef, props) => {\n var _props$initialState2, _props$initialState2$;\n\n const logger = useGridLogger(apiRef, 'useGridPage');\n const visibleTopLevelRowCount = useGridSelector(apiRef, gridVisibleTopLevelRowCountSelector);\n apiRef.current.unstable_updateControlState({\n stateId: 'page',\n propModel: props.page,\n propOnChange: props.onPageChange,\n stateSelector: gridPageSelector,\n changeEvent: 'pageChange'\n });\n /**\n * API METHODS\n */\n\n const setPage = React.useCallback(page => {\n logger.debug(`Setting page to ${page}`);\n apiRef.current.setState(mergeStateWithPage(page));\n apiRef.current.forceUpdate();\n }, [apiRef, logger]);\n const pageApi = {\n setPage\n };\n useGridApiMethod(apiRef, pageApi, 'GridPageApi');\n /**\n * PRE-PROCESSING\n */\n\n const stateExportPreProcessing = React.useCallback(prevState => {\n var _props$initialState, _props$initialState$p;\n\n const pageToExport = gridPageSelector(apiRef);\n const shouldExportPage = // Always export if the page is controlled\n props.page != null || // Always export if the page has been initialized\n ((_props$initialState = props.initialState) == null ? void 0 : (_props$initialState$p = _props$initialState.pagination) == null ? void 0 : _props$initialState$p.page) != null || // Export if the page value is not equal to the default value\n pageToExport !== 0;\n\n if (!shouldExportPage) {\n return prevState;\n }\n\n return _extends({}, prevState, {\n pagination: _extends({}, prevState.pagination, {\n page: pageToExport\n })\n });\n }, [apiRef, props.page, (_props$initialState2 = props.initialState) == null ? void 0 : (_props$initialState2$ = _props$initialState2.pagination) == null ? void 0 : _props$initialState2$.page]);\n const stateRestorePreProcessing = React.useCallback((params, context) => {\n var _context$stateToResto, _context$stateToResto2;\n\n // We apply the constraint even if the page did not change in case the pageSize changed.\n const page = (_context$stateToResto = (_context$stateToResto2 = context.stateToRestore.pagination) == null ? void 0 : _context$stateToResto2.page) != null ? _context$stateToResto : gridPageSelector(apiRef);\n apiRef.current.setState(mergeStateWithPage(page));\n return params;\n }, [apiRef]);\n useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);\n useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);\n /**\n * EVENTS\n */\n\n const handlePageSizeChange = pageSize => {\n apiRef.current.setState(state => {\n const pageCount = getPageCount(state.pagination.rowCount, pageSize);\n return _extends({}, state, {\n pagination: applyValidPage(_extends({}, state.pagination, {\n pageCount,\n page: state.pagination.page\n }))\n });\n });\n apiRef.current.forceUpdate();\n };\n\n const handlePageChange = () => apiRef.current.scrollToIndexes({\n rowIndex: gridPageSelector(apiRef) * gridPageSizeSelector(apiRef)\n });\n\n useGridApiEventHandler(apiRef, 'pageSizeChange', handlePageSizeChange);\n useGridApiEventHandler(apiRef, 'pageChange', handlePageChange);\n /**\n * EFFECTS\n */\n\n React.useEffect(() => {\n if (process.env.NODE_ENV !== 'production') {\n if (props.paginationMode === 'server' && props.rowCount == null) {\n noRowCountInServerMode();\n }\n }\n }, [props.rowCount, props.paginationMode]);\n React.useEffect(() => {\n apiRef.current.setState(state => {\n const rowCount = props.rowCount !== undefined ? props.rowCount : visibleTopLevelRowCount;\n const pageCount = getPageCount(rowCount, state.pagination.pageSize);\n const page = props.page == null ? state.pagination.page : props.page;\n return _extends({}, state, {\n pagination: applyValidPage(_extends({}, state.pagination, {\n page,\n rowCount,\n pageCount\n }))\n });\n });\n apiRef.current.forceUpdate();\n }, [visibleTopLevelRowCount, props.rowCount, props.page, props.paginationMode, apiRef]);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport { useGridPageSize, defaultPageSize } from './useGridPageSize';\nimport { useGridPage, getPageCount } from './useGridPage';\nexport const paginationStateInitializer = (state, props) => {\n var _props$initialState, _props$initialState$p, _ref, _props$page, _props$initialState2, _props$initialState2$, _props$rowCount, _props$rowCount2;\n\n let pageSize;\n\n if (props.pageSize != null) {\n pageSize = props.pageSize;\n } else if (((_props$initialState = props.initialState) == null ? void 0 : (_props$initialState$p = _props$initialState.pagination) == null ? void 0 : _props$initialState$p.pageSize) != null) {\n pageSize = props.initialState.pagination.pageSize;\n } else {\n pageSize = defaultPageSize(props.autoPageSize);\n }\n\n return _extends({}, state, {\n pagination: {\n pageSize,\n page: (_ref = (_props$page = props.page) != null ? _props$page : (_props$initialState2 = props.initialState) == null ? void 0 : (_props$initialState2$ = _props$initialState2.pagination) == null ? void 0 : _props$initialState2$.page) != null ? _ref : 0,\n pageCount: getPageCount((_props$rowCount = props.rowCount) != null ? _props$rowCount : 0, pageSize),\n rowCount: (_props$rowCount2 = props.rowCount) != null ? _props$rowCount2 : 0\n }\n });\n};\n/**\n * @requires useGridFilter (state)\n * @requires useGridDimensions (event) - can be after\n */\n\nexport const useGridPagination = (apiRef, props) => {\n useGridPageSize(apiRef, props);\n useGridPage(apiRef, props);\n};","export const gridPreferencePanelStateSelector = state => state.preferencePanel;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { gridPreferencePanelStateSelector } from './gridPreferencePanelSelector';\nexport const preferencePanelStateInitializer = (state, props) => {\n var _props$initialState$p, _props$initialState;\n\n return _extends({}, state, {\n preferencePanel: (_props$initialState$p = (_props$initialState = props.initialState) == null ? void 0 : _props$initialState.preferencePanel) != null ? _props$initialState$p : {\n open: false\n }\n });\n};\n/**\n * TODO: Add a single `setPreferencePanel` method to avoid multiple `setState`\n */\n\nexport const useGridPreferencesPanel = apiRef => {\n const logger = useGridLogger(apiRef, 'useGridPreferencesPanel');\n const hideTimeout = React.useRef();\n const immediateTimeout = React.useRef();\n /**\n * API METHODS\n */\n\n const hidePreferences = React.useCallback(() => {\n logger.debug('Hiding Preferences Panel');\n const preferencePanelState = gridPreferencePanelStateSelector(apiRef.current.state);\n\n if (preferencePanelState.openedPanelValue) {\n apiRef.current.publishEvent('preferencePanelClose', {\n openedPanelValue: preferencePanelState.openedPanelValue\n });\n }\n\n apiRef.current.setState(state => _extends({}, state, {\n preferencePanel: {\n open: false\n }\n }));\n apiRef.current.forceUpdate();\n }, [apiRef, logger]); // This is to prevent the preferences from closing when you open a select box or another panel,\n // The issue is in MUI core V4 => Fixed in V5\n\n const doNotHidePanel = React.useCallback(() => {\n immediateTimeout.current = setTimeout(() => clearTimeout(hideTimeout.current), 0);\n }, []); // This is a hack for the issue with Core V4, by delaying hiding the panel on the clickAwayListener,\n // we can cancel the action if the trigger element still need the panel...\n\n const hidePreferencesDelayed = React.useCallback(() => {\n hideTimeout.current = setTimeout(hidePreferences, 100);\n }, [hidePreferences]);\n const showPreferences = React.useCallback(newValue => {\n logger.debug('Opening Preferences Panel');\n doNotHidePanel();\n apiRef.current.setState(state => _extends({}, state, {\n preferencePanel: _extends({}, state.preferencePanel, {\n open: true,\n openedPanelValue: newValue\n })\n }));\n apiRef.current.publishEvent('preferencePanelOpen', {\n openedPanelValue: newValue\n });\n apiRef.current.forceUpdate();\n }, [logger, doNotHidePanel, apiRef]);\n useGridApiMethod(apiRef, {\n showPreferences,\n hidePreferences: hidePreferencesDelayed\n }, 'ColumnMenuApi');\n /**\n * PRE-PROCESSING\n */\n\n const stateExportPreProcessing = React.useCallback(prevState => {\n const preferencePanelToExport = gridPreferencePanelStateSelector(apiRef.current.state);\n\n if (!preferencePanelToExport.open && !preferencePanelToExport.openedPanelValue) {\n return prevState;\n }\n\n return _extends({}, prevState, {\n preferencePanel: preferencePanelToExport\n });\n }, [apiRef]);\n const stateRestorePreProcessing = React.useCallback((params, context) => {\n const preferencePanel = context.stateToRestore.preferencePanel;\n\n if (preferencePanel != null) {\n apiRef.current.setState(state => _extends({}, state, {\n preferencePanel\n }));\n }\n\n return params;\n }, [apiRef]);\n useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);\n useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);\n /**\n * EFFECTS\n */\n\n React.useEffect(() => {\n return () => {\n clearTimeout(hideTimeout.current);\n clearTimeout(immediateTimeout.current);\n };\n }, []);\n};","// TODO v6: rename to gridEditingStateSelector\nexport const gridEditRowsStateSelector = state => state.editRows;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useEventCallback } from '@mui/material/utils';\nimport { useGridApiOptionHandler, useGridApiEventHandler } from '../../utils/useGridApiEventHandler';\nimport { GridCellModes, GridEditModes } from '../../../models/gridEditRowModel';\nimport { isKeyboardEvent, isPrintableKey, isCellEnterEditModeKeys, isCellExitEditModeKeys, isCellEditCommitKeys, isDeleteKeys } from '../../../utils/keyboardUtils';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridFocusCellSelector } from '../focus/gridFocusStateSelector';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { gridEditRowsStateSelector } from './gridEditRowsSelector';\n\nfunction isPromise(promise) {\n return typeof promise.then === 'function';\n}\n\nexport const useCellEditing = (apiRef, props) => {\n var _props$experimentalFe2;\n\n const logger = useGridLogger(apiRef, 'useGridEditRows');\n\n const buildCallback = callback => (...args) => {\n if (props.editMode === GridEditModes.Cell) {\n callback(...args);\n }\n };\n\n const setCellMode = React.useCallback((id, field, mode) => {\n if (apiRef.current.getCellMode(id, field) === mode) {\n return;\n }\n\n logger.debug(`Switching cell id: ${id} field: ${field} to mode: ${mode}`);\n apiRef.current.setState(state => {\n const newEditRowsState = _extends({}, state.editRows);\n\n newEditRowsState[id] = _extends({}, newEditRowsState[id]);\n\n if (mode === GridCellModes.Edit) {\n newEditRowsState[id][field] = {\n value: apiRef.current.getCellValue(id, field)\n };\n } else {\n delete newEditRowsState[id][field];\n\n if (!Object.keys(newEditRowsState[id]).length) {\n delete newEditRowsState[id];\n }\n }\n\n return _extends({}, state, {\n editRows: newEditRowsState\n });\n });\n apiRef.current.forceUpdate();\n apiRef.current.publishEvent('cellModeChange', apiRef.current.getCellParams(id, field));\n }, [apiRef, logger]);\n const getCellMode = React.useCallback((id, field) => {\n const editRowsState = gridEditRowsStateSelector(apiRef.current.state);\n const isEditing = editRowsState[id] && editRowsState[id][field];\n return isEditing ? GridCellModes.Edit : GridCellModes.View;\n }, [apiRef]); // TODO v6: it should always return a promise\n\n const commitCellChange = React.useCallback((params, event = {}) => {\n var _props$experimentalFe;\n\n const {\n id,\n field\n } = params;\n apiRef.current.unstable_runPendingEditCellValueMutation(id, field);\n const model = apiRef.current.getEditRowsModel();\n\n if (!model[id] || !model[id][field]) {\n throw new Error(`MUI: Cell at id: ${id} and field: ${field} is not in edit mode.`);\n }\n\n const editCellProps = model[id][field];\n const column = apiRef.current.getColumn(field);\n const row = apiRef.current.getRow(id);\n\n if ((_props$experimentalFe = props.experimentalFeatures) != null && _props$experimentalFe.preventCommitWhileValidating) {\n const cellProps = model[id][field];\n\n if (cellProps.isValidating || cellProps.error) {\n return false;\n }\n }\n\n const commitParams = _extends({}, params, {\n value: editCellProps.value\n });\n\n let hasError = !!editCellProps.error;\n\n if (!hasError && typeof column.preProcessEditCellProps === 'function') {\n const result = column.preProcessEditCellProps({\n id,\n row,\n props: editCellProps\n });\n\n if (isPromise(result)) {\n return result.then(newEditCellProps => {\n apiRef.current.unstable_setEditCellProps({\n id,\n field,\n props: newEditCellProps\n });\n\n if (newEditCellProps.error) {\n return false;\n }\n\n apiRef.current.publishEvent('cellEditCommit', commitParams, event);\n return true;\n });\n }\n\n apiRef.current.unstable_setEditCellProps({\n id,\n field,\n props: result\n });\n hasError = !!result.error;\n }\n\n if (!hasError) {\n apiRef.current.publishEvent('cellEditCommit', commitParams, event);\n return true;\n }\n\n return false;\n }, [apiRef, (_props$experimentalFe2 = props.experimentalFeatures) == null ? void 0 : _props$experimentalFe2.preventCommitWhileValidating]);\n const setCellEditingEditCellValue = React.useCallback(params => {\n const column = apiRef.current.getColumn(params.field);\n const row = apiRef.current.getRow(params.id);\n return new Promise(resolve => {\n let newEditCellProps = {\n value: params.value\n };\n const model = apiRef.current.getEditRowsModel();\n const editCellProps = model[params.id][params.field];\n\n if (typeof column.preProcessEditCellProps !== 'function') {\n apiRef.current.unstable_setEditCellProps(_extends({}, params, {\n props: newEditCellProps\n }));\n resolve(true);\n return;\n } // setEditCellProps runs the value parser and returns the updated props\n\n\n newEditCellProps = apiRef.current.unstable_setEditCellProps(_extends({}, params, {\n props: _extends({}, editCellProps, {\n isValidating: true\n })\n }));\n Promise.resolve(column.preProcessEditCellProps({\n id: params.id,\n row,\n props: _extends({}, newEditCellProps, {\n value: apiRef.current.unstable_parseValue(params.id, params.field, params.value)\n })\n })).then(newEditCellPropsProcessed => {\n apiRef.current.unstable_setEditCellProps(_extends({}, params, {\n props: _extends({}, newEditCellPropsProcessed, {\n isValidating: false\n })\n }));\n resolve(!newEditCellPropsProcessed.error);\n });\n });\n }, [apiRef]);\n const cellEditingApi = {\n setCellMode,\n getCellMode,\n commitCellChange,\n unstable_setCellEditingEditCellValue: setCellEditingEditCellValue\n };\n useGridApiMethod(apiRef, cellEditingApi, 'EditRowApi');\n const handleCellKeyDown = React.useCallback(async (params, event) => {\n const {\n id,\n field,\n cellMode,\n isEditable\n } = params;\n\n if (!isEditable) {\n return;\n }\n\n const isEditMode = cellMode === GridCellModes.Edit;\n const isModifierKeyPressed = event.ctrlKey || event.metaKey || event.altKey;\n\n if (!isEditMode && isCellEnterEditModeKeys(event.key) && !isModifierKeyPressed && !(event.key === ' ' && event.shiftKey)) {\n apiRef.current.publishEvent('cellEditStart', params, event);\n }\n\n if (!isEditMode && isDeleteKeys(event.key)) {\n apiRef.current.setEditCellValue({\n id,\n field,\n value: ''\n });\n apiRef.current.commitCellChange({\n id,\n field\n }, event);\n apiRef.current.publishEvent('cellEditStop', params, event);\n }\n\n if (isEditMode && isCellEditCommitKeys(event.key)) {\n const commitParams = {\n id,\n field\n };\n const isValid = await apiRef.current.commitCellChange(commitParams, event);\n\n if (!isValid) {\n return;\n }\n }\n\n if (isEditMode && isCellExitEditModeKeys(event.key)) {\n apiRef.current.publishEvent('cellEditStop', params, event);\n }\n }, [apiRef]);\n const handleCellDoubleClick = React.useCallback((params, event) => {\n if (!params.isEditable) {\n return;\n }\n\n apiRef.current.publishEvent('cellEditStart', params, event);\n }, [apiRef]);\n\n const commitPropsAndExit = async (params, event) => {\n if (params.cellMode === GridCellModes.View) {\n return;\n }\n\n await apiRef.current.commitCellChange(params, event);\n apiRef.current.publishEvent('cellEditStop', params, event);\n };\n\n const handleCellFocusOut = useEventCallback((params, event) => {\n commitPropsAndExit(params, event);\n });\n const handleColumnHeaderDragStart = useEventCallback(() => {\n const cell = gridFocusCellSelector(apiRef);\n\n if (!cell) {\n return;\n }\n\n const params = apiRef.current.getCellParams(cell.id, cell.field);\n commitPropsAndExit(params, {});\n });\n const handleCellEditStart = React.useCallback((params, event) => {\n if (!params.isEditable) {\n return;\n }\n\n apiRef.current.setCellMode(params.id, params.field, GridCellModes.Edit);\n\n if (isKeyboardEvent(event) && isPrintableKey(event.key)) {\n apiRef.current.unstable_setEditCellProps({\n id: params.id,\n field: params.field,\n props: {\n value: ''\n }\n });\n }\n }, [apiRef]);\n const handleCellEditStop = React.useCallback((params, event) => {\n apiRef.current.setCellMode(params.id, params.field, GridCellModes.View);\n\n if (!isKeyboardEvent(event)) {\n return;\n }\n\n if (isCellEditCommitKeys(event.key)) {\n apiRef.current.publishEvent('cellNavigationKeyDown', params, event);\n return;\n }\n\n if (event.key === 'Escape' || isDeleteKeys(event.key)) {\n apiRef.current.setCellFocus(params.id, params.field);\n }\n }, [apiRef]);\n const handleCellEditCommit = React.useCallback(params => {\n const {\n id,\n field\n } = params;\n const model = apiRef.current.getEditRowsModel();\n const {\n value\n } = model[id][field];\n logger.debug(`Setting cell id: ${id} field: ${field} to value: ${value == null ? void 0 : value.toString()}`);\n const row = apiRef.current.getRow(id);\n\n if (row) {\n const column = apiRef.current.getColumn(params.field);\n\n let rowUpdate = _extends({}, row, {\n [field]: value\n });\n\n if (column.valueSetter) {\n rowUpdate = column.valueSetter({\n row,\n value\n });\n }\n\n apiRef.current.updateRows([rowUpdate]);\n }\n }, [apiRef, logger]);\n const handleEditCellPropsChange = React.useCallback(params => {\n const row = apiRef.current.getRow(params.id);\n const column = apiRef.current.getColumn(params.field);\n const editCellProps = column.preProcessEditCellProps ? column.preProcessEditCellProps({\n id: params.id,\n row,\n props: params.props\n }) : params.props;\n\n if (isPromise(editCellProps)) {\n editCellProps.then(newEditCellProps => {\n apiRef.current.unstable_setEditCellProps(_extends({}, params, {\n props: newEditCellProps\n }));\n });\n } else {\n apiRef.current.unstable_setEditCellProps(_extends({}, params, {\n props: editCellProps\n }));\n }\n }, [apiRef]);\n useGridApiEventHandler(apiRef, 'cellKeyDown', buildCallback(handleCellKeyDown));\n useGridApiEventHandler(apiRef, 'cellDoubleClick', buildCallback(handleCellDoubleClick));\n useGridApiEventHandler(apiRef, 'cellFocusOut', buildCallback(handleCellFocusOut));\n useGridApiEventHandler(apiRef, 'columnHeaderDragStart', buildCallback(handleColumnHeaderDragStart));\n useGridApiEventHandler(apiRef, 'cellEditStart', buildCallback(handleCellEditStart));\n useGridApiEventHandler(apiRef, 'cellEditStop', buildCallback(handleCellEditStop));\n useGridApiEventHandler(apiRef, 'cellEditCommit', buildCallback(handleCellEditCommit));\n useGridApiEventHandler(apiRef, 'editCellPropsChange', buildCallback(handleEditCellPropsChange));\n useGridApiOptionHandler(apiRef, 'cellEditCommit', props.onCellEditCommit);\n useGridApiOptionHandler(apiRef, 'cellEditStart', props.onCellEditStart);\n useGridApiOptionHandler(apiRef, 'cellEditStop', props.onCellEditStop);\n};","// TODO v6 - remove\n\n/**\n * Params passed to `apiRef.current.setEditCellValue`.\n */\n// TODO v6 - remove\n// TODO v6 - remove\nvar GridCellEditStartReasons;\n/**\n * Params passed to the `cellEditStart` event.\n */\n\n(function (GridCellEditStartReasons) {\n GridCellEditStartReasons[\"enterKeyDown\"] = \"enterKeyDown\";\n GridCellEditStartReasons[\"cellDoubleClick\"] = \"cellDoubleClick\";\n GridCellEditStartReasons[\"printableKeyDown\"] = \"printableKeyDown\";\n GridCellEditStartReasons[\"deleteKeyDown\"] = \"deleteKeyDown\";\n})(GridCellEditStartReasons || (GridCellEditStartReasons = {}));\n\nvar GridCellEditStopReasons;\n/**\n * Params passed to the `cellEditStop event.\n */\n\n(function (GridCellEditStopReasons) {\n GridCellEditStopReasons[\"cellFocusOut\"] = \"cellFocusOut\";\n GridCellEditStopReasons[\"escapeKeyDown\"] = \"escapeKeyDown\";\n GridCellEditStopReasons[\"enterKeyDown\"] = \"enterKeyDown\";\n GridCellEditStopReasons[\"tabKeyDown\"] = \"tabKeyDown\";\n GridCellEditStopReasons[\"shiftTabKeyDown\"] = \"shiftTabKeyDown\";\n})(GridCellEditStopReasons || (GridCellEditStopReasons = {}));\n\n// https://github.com/mui/mui-x/pull/3738#discussion_r798504277\nexport { GridCellEditStartReasons, GridCellEditStopReasons };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { GridCellModes } from '../../../models/gridEditRowModel';\nimport { useGridApiEventHandler, useGridApiOptionHandler } from '../../utils/useGridApiEventHandler';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridEditRowsStateSelector } from './gridEditRowsSelector';\nimport { useCellEditing } from './useGridCellEditing.old';\nimport { useGridRowEditing } from './useGridRowEditing.old';\nexport const editingStateInitializer = state => _extends({}, state, {\n editRows: {}\n});\n/**\n * @requires useGridFocus - can be after, async only\n * @requires useGridParamsApi (method)\n * @requires useGridColumns (state)\n */\n\nexport function useGridEditing(apiRef, props) {\n var _props$experimentalFe2;\n\n const logger = useGridLogger(apiRef, 'useGridEditRows');\n useCellEditing(apiRef, props);\n useGridRowEditing(apiRef, props);\n const debounceMap = React.useRef({});\n apiRef.current.unstable_updateControlState({\n stateId: 'editRows',\n propModel: props.editRowsModel,\n propOnChange: props.onEditRowsModelChange,\n stateSelector: gridEditRowsStateSelector,\n changeEvent: 'editRowsModelChange'\n });\n const isCellEditable = React.useCallback(params => !params.rowNode.isAutoGenerated && !!params.colDef.editable && !!params.colDef.renderEditCell && (!props.isCellEditable || props.isCellEditable(params)), // eslint-disable-next-line react-hooks/exhaustive-deps\n [props.isCellEditable]);\n\n const maybeDebounce = (id, field, debounceMs, callback) => {\n if (!debounceMs) {\n callback();\n return;\n }\n\n if (!debounceMap.current[id]) {\n debounceMap.current[id] = {};\n }\n\n if (debounceMap.current[id][field]) {\n const [timeout] = debounceMap.current[id][field];\n clearTimeout(timeout);\n }\n\n const callbackToRunImmediately = () => {\n callback();\n const [timeout] = debounceMap.current[id][field];\n clearTimeout(timeout);\n delete debounceMap.current[id][field];\n };\n\n const timeout = setTimeout(() => {\n callback();\n delete debounceMap.current[id][field];\n }, debounceMs);\n debounceMap.current[id][field] = [timeout, callbackToRunImmediately];\n };\n\n const runPendingEditCellValueMutation = React.useCallback((id, field) => {\n if (!debounceMap.current[id]) {\n return;\n }\n\n if (!field) {\n Object.keys(debounceMap.current[id]).forEach(debouncedField => {\n const [, callback] = debounceMap.current[id][debouncedField];\n callback();\n });\n } else if (debounceMap.current[id][field]) {\n const [, callback] = debounceMap.current[id][field];\n callback();\n }\n }, []);\n const setEditCellValue = React.useCallback((params, event = {}) => {\n maybeDebounce(params.id, params.field, params.debounceMs, () => {\n var _props$experimentalFe;\n\n if ((_props$experimentalFe = props.experimentalFeatures) != null && _props$experimentalFe.preventCommitWhileValidating) {\n if (props.editMode === 'row') {\n return apiRef.current.unstable_setRowEditingEditCellValue(params);\n }\n\n return apiRef.current.unstable_setCellEditingEditCellValue(params);\n }\n\n const newParams = {\n id: params.id,\n field: params.field,\n props: {\n value: params.value\n }\n };\n return apiRef.current.publishEvent('editCellPropsChange', newParams, event);\n });\n }, [apiRef, props.editMode, (_props$experimentalFe2 = props.experimentalFeatures) == null ? void 0 : _props$experimentalFe2.preventCommitWhileValidating]);\n const parseValue = React.useCallback((id, field, value) => {\n const column = apiRef.current.getColumn(field);\n return column.valueParser ? column.valueParser(value, apiRef.current.getCellParams(id, field)) : value;\n }, [apiRef]);\n const setEditCellProps = React.useCallback(params => {\n const {\n id,\n field,\n props: editProps\n } = params;\n logger.debug(`Setting cell props on id: ${id} field: ${field}`);\n apiRef.current.setState(state => {\n const editRowsModel = _extends({}, state.editRows);\n\n editRowsModel[id] = _extends({}, state.editRows[id]);\n editRowsModel[id][field] = _extends({}, editProps, {\n value: parseValue(id, field, editProps.value)\n });\n return _extends({}, state, {\n editRows: editRowsModel\n });\n });\n apiRef.current.forceUpdate();\n const editRowsState = gridEditRowsStateSelector(apiRef.current.state);\n return editRowsState[id][field];\n }, [apiRef, logger, parseValue]);\n const setEditRowsModel = React.useCallback(model => {\n const currentModel = gridEditRowsStateSelector(apiRef.current.state);\n\n if (currentModel !== model) {\n logger.debug(`Setting editRows model`);\n apiRef.current.setState(state => _extends({}, state, {\n editRows: model\n }));\n apiRef.current.forceUpdate();\n }\n }, [apiRef, logger]);\n const getEditRowsModel = React.useCallback(() => gridEditRowsStateSelector(apiRef.current.state), [apiRef]);\n const preventTextSelection = React.useCallback((params, event) => {\n const isMoreThanOneClick = event.detail > 1;\n\n if (params.isEditable && params.cellMode === GridCellModes.View && isMoreThanOneClick) {\n // If we click more than one time, then we prevent the default behavior of selecting the text cell.\n event.preventDefault();\n }\n }, []);\n useGridApiEventHandler(apiRef, 'cellMouseDown', preventTextSelection);\n useGridApiOptionHandler(apiRef, 'editCellPropsChange', props.onEditCellPropsChange); // TODO v6: remove, use `preProcessEditCellProps` instead\n\n const editingSharedApi = {\n isCellEditable,\n setEditRowsModel,\n getEditRowsModel,\n setEditCellValue,\n unstable_setEditCellProps: setEditCellProps,\n unstable_parseValue: parseValue,\n unstable_runPendingEditCellValueMutation: runPendingEditCellValueMutation\n };\n useGridApiMethod(apiRef, editingSharedApi, 'EditRowApi');\n React.useEffect(() => {\n if (props.editRowsModel !== undefined) {\n apiRef.current.setEditRowsModel(props.editRowsModel);\n }\n }, [apiRef, props.editRowsModel]);\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useEventCallback } from '@mui/material/utils';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { GridRowModes, GridEditModes, GridCellModes } from '../../../models/gridEditRowModel';\nimport { useGridSelector } from '../../utils/useGridSelector';\nimport { gridColumnDefinitionsSelector } from '../columns/gridColumnsSelector';\nimport { gridEditRowsStateSelector } from './gridEditRowsSelector';\nimport { gridFocusCellSelector } from '../focus/gridFocusStateSelector';\nimport { useGridApiOptionHandler, useGridApiEventHandler } from '../../utils/useGridApiEventHandler';\nexport const useGridRowEditing = (apiRef, props) => {\n var _props$experimentalFe2, _props$experimentalFe4;\n\n const focusTimeout = React.useRef(null);\n const nextFocusedCell = React.useRef(null);\n const columns = useGridSelector(apiRef, gridColumnDefinitionsSelector);\n\n const buildCallback = callback => (...args) => {\n if (props.editMode === GridEditModes.Row) {\n callback(...args);\n }\n };\n\n const setRowMode = React.useCallback((id, mode) => {\n if (mode === apiRef.current.getRowMode(id)) {\n return;\n }\n\n apiRef.current.setState(state => {\n const newEditRowsState = _extends({}, state.editRows);\n\n if (mode === GridRowModes.Edit) {\n newEditRowsState[id] = {};\n columns.forEach(column => {\n const cellParams = apiRef.current.getCellParams(id, column.field);\n\n if (cellParams.isEditable) {\n newEditRowsState[id][column.field] = {\n value: cellParams.value\n };\n }\n });\n } else {\n delete newEditRowsState[id];\n }\n\n return _extends({}, state, {\n editRows: newEditRowsState\n });\n });\n apiRef.current.forceUpdate();\n }, [apiRef, columns]);\n const getRowMode = React.useCallback(id => {\n if (props.editMode === GridEditModes.Cell) {\n return GridRowModes.View;\n }\n\n const editRowsState = gridEditRowsStateSelector(apiRef.current.state);\n return editRowsState[id] ? GridRowModes.Edit : GridRowModes.View;\n }, [apiRef, props.editMode]);\n const commitRowChange = React.useCallback((id, event = {}) => {\n var _props$experimentalFe;\n\n if (props.editMode === GridEditModes.Cell) {\n throw new Error(`MUI: You can't commit changes when the edit mode is 'cell'.`);\n }\n\n apiRef.current.unstable_runPendingEditCellValueMutation(id);\n const model = apiRef.current.getEditRowsModel();\n const editRowProps = model[id];\n\n if (!editRowProps) {\n throw new Error(`MUI: Row at id: ${id} is not being edited.`);\n }\n\n if ((_props$experimentalFe = props.experimentalFeatures) != null && _props$experimentalFe.preventCommitWhileValidating) {\n const isValid = Object.keys(editRowProps).reduce((acc, field) => {\n return acc && !editRowProps[field].isValidating && !editRowProps[field].error;\n }, true);\n\n if (!isValid) {\n return false;\n }\n }\n\n const hasFieldWithError = Object.values(editRowProps).some(value => !!value.error);\n\n if (hasFieldWithError) {\n return false;\n }\n\n const fieldsWithValidator = Object.keys(editRowProps).filter(field => {\n const column = apiRef.current.getColumn(field);\n return typeof column.preProcessEditCellProps === 'function';\n });\n\n if (fieldsWithValidator.length > 0) {\n const row = apiRef.current.getRow(id);\n const validatorErrors = fieldsWithValidator.map(async field => {\n const column = apiRef.current.getColumn(field);\n const newEditCellProps = await Promise.resolve(column.preProcessEditCellProps({\n id,\n row,\n props: editRowProps[field]\n }));\n apiRef.current.unstable_setEditCellProps({\n id,\n field,\n props: newEditCellProps\n });\n return newEditCellProps.error;\n });\n return Promise.all(validatorErrors).then(errors => {\n if (errors.some(error => !!error)) {\n return false;\n }\n\n apiRef.current.publishEvent('rowEditCommit', id, event);\n return true;\n });\n }\n\n apiRef.current.publishEvent('rowEditCommit', id, event);\n return true;\n }, [apiRef, props.editMode, (_props$experimentalFe2 = props.experimentalFeatures) == null ? void 0 : _props$experimentalFe2.preventCommitWhileValidating]);\n const setRowEditingEditCellValue = React.useCallback(params => {\n const model = apiRef.current.getEditRowsModel();\n const editRow = model[params.id];\n const row = apiRef.current.getRow(params.id);\n let isValid = true;\n return new Promise(resolve => {\n Object.keys(editRow).forEach(async field => {\n const column = apiRef.current.getColumn(field);\n let editCellProps = field === params.field ? {\n value: params.value\n } : editRow[field]; // setEditCellProps runs the value parser and returns the updated props\n\n editCellProps = apiRef.current.unstable_setEditCellProps({\n id: params.id,\n field,\n props: _extends({}, editCellProps, {\n isValidating: true\n })\n });\n\n if (column.preProcessEditCellProps) {\n editCellProps = await Promise.resolve(column.preProcessEditCellProps({\n id: params.id,\n row,\n props: _extends({}, editCellProps, {\n value: field === params.field ? apiRef.current.unstable_parseValue(params.id, field, params.value) : editCellProps.value\n })\n }));\n }\n\n if (editCellProps.error) {\n isValid = false;\n }\n\n apiRef.current.unstable_setEditCellProps({\n id: params.id,\n field,\n props: _extends({}, editCellProps, {\n isValidating: false\n })\n });\n });\n resolve(isValid);\n });\n }, [apiRef]);\n const rowEditingApi = {\n setRowMode,\n getRowMode,\n commitRowChange,\n unstable_setRowEditingEditCellValue: setRowEditingEditCellValue\n };\n useGridApiMethod(apiRef, rowEditingApi, 'EditRowApi');\n const handleCellKeyDown = React.useCallback(async (params, event) => {\n const {\n cellMode,\n isEditable\n } = params;\n\n if (!isEditable) {\n return;\n }\n\n const isEditMode = cellMode === GridCellModes.Edit;\n const rowParams = apiRef.current.getRowParams(params.id);\n\n if (isEditMode) {\n if (event.key === 'Enter') {\n var _props$experimentalFe3;\n\n // TODO: check the return before firing 'rowEditStop'\n // On cell editing, it won't exits the edit mode with error\n const isValid = await apiRef.current.commitRowChange(params.id);\n\n if (!isValid && (_props$experimentalFe3 = props.experimentalFeatures) != null && _props$experimentalFe3.preventCommitWhileValidating) {\n return;\n }\n\n apiRef.current.publishEvent('rowEditStop', rowParams, event);\n } else if (event.key === 'Escape') {\n apiRef.current.publishEvent('rowEditStop', rowParams, event);\n }\n } else if (event.key === 'Enter') {\n apiRef.current.publishEvent('rowEditStart', rowParams, event);\n }\n }, [apiRef, (_props$experimentalFe4 = props.experimentalFeatures) == null ? void 0 : _props$experimentalFe4.preventCommitWhileValidating]);\n const handleCellDoubleClick = React.useCallback((params, event) => {\n if (!params.isEditable) {\n return;\n }\n\n const rowParams = apiRef.current.getRowParams(params.id);\n apiRef.current.publishEvent('rowEditStart', rowParams, event);\n }, [apiRef]);\n const handleEditCellPropsChange = React.useCallback(params => {\n const row = apiRef.current.getRow(params.id);\n const model = apiRef.current.getEditRowsModel();\n const editRow = model[params.id];\n Object.keys(editRow).forEach(async field => {\n const column = apiRef.current.getColumn(field);\n\n if (column.preProcessEditCellProps) {\n const editCellProps = field === params.field ? params.props : editRow[field];\n const newEditCellProps = await Promise.resolve(column.preProcessEditCellProps({\n id: params.id,\n row,\n props: editCellProps\n }));\n apiRef.current.unstable_setEditCellProps({\n id: params.id,\n field,\n props: newEditCellProps\n });\n } else if (field === params.field) {\n apiRef.current.unstable_setEditCellProps(params);\n }\n });\n }, [apiRef]);\n const handleRowEditStart = React.useCallback(params => {\n apiRef.current.setRowMode(params.id, GridRowModes.Edit);\n }, [apiRef]);\n const handleRowEditStop = React.useCallback((params, event) => {\n apiRef.current.setRowMode(params.id, GridRowModes.View);\n\n if (event.key === 'Enter') {\n apiRef.current.publishEvent('cellNavigationKeyDown', params, event);\n }\n }, [apiRef]);\n const handleRowEditCommit = React.useCallback(id => {\n const model = apiRef.current.getEditRowsModel();\n const editRow = model[id];\n\n if (!editRow) {\n throw new Error(`MUI: Row at id: ${id} is not being edited.`);\n }\n\n const row = apiRef.current.getRow(id);\n\n if (row) {\n let rowUpdate = _extends({}, row);\n\n Object.keys(editRow).forEach(field => {\n const column = apiRef.current.getColumn(field);\n const value = editRow[field].value;\n\n if (column.valueSetter) {\n rowUpdate = column.valueSetter({\n row: rowUpdate,\n value\n });\n } else {\n rowUpdate[field] = value;\n }\n });\n apiRef.current.updateRows([rowUpdate]);\n }\n }, [apiRef]);\n const handleCellFocusIn = React.useCallback(params => {\n nextFocusedCell.current = params;\n }, []);\n\n const commitPropsAndExit = async (params, event) => {\n if (params.cellMode === GridCellModes.View) {\n return;\n }\n\n nextFocusedCell.current = null;\n focusTimeout.current = setTimeout(async () => {\n var _nextFocusedCell$curr;\n\n if (((_nextFocusedCell$curr = nextFocusedCell.current) == null ? void 0 : _nextFocusedCell$curr.id) !== params.id) {\n await apiRef.current.commitRowChange(params.id, event);\n const rowParams = apiRef.current.getRowParams(params.id);\n apiRef.current.publishEvent('rowEditStop', rowParams, event);\n }\n });\n };\n\n const handleCellFocusOut = useEventCallback((params, event) => {\n commitPropsAndExit(params, event);\n });\n const handleColumnHeaderDragStart = useEventCallback(() => {\n const cell = gridFocusCellSelector(apiRef);\n\n if (!cell) {\n return;\n }\n\n const params = apiRef.current.getCellParams(cell.id, cell.field);\n commitPropsAndExit(params, {});\n });\n useGridApiEventHandler(apiRef, 'cellKeyDown', buildCallback(handleCellKeyDown));\n useGridApiEventHandler(apiRef, 'cellDoubleClick', buildCallback(handleCellDoubleClick));\n useGridApiEventHandler(apiRef, 'editCellPropsChange', buildCallback(handleEditCellPropsChange));\n useGridApiEventHandler(apiRef, 'rowEditStart', buildCallback(handleRowEditStart));\n useGridApiEventHandler(apiRef, 'rowEditStop', buildCallback(handleRowEditStop));\n useGridApiEventHandler(apiRef, 'rowEditCommit', buildCallback(handleRowEditCommit));\n useGridApiEventHandler(apiRef, 'cellFocusIn', buildCallback(handleCellFocusIn));\n useGridApiEventHandler(apiRef, 'cellFocusOut', buildCallback(handleCellFocusOut));\n useGridApiEventHandler(apiRef, 'columnHeaderDragStart', buildCallback(handleColumnHeaderDragStart));\n useGridApiOptionHandler(apiRef, 'rowEditCommit', props.onRowEditCommit);\n useGridApiOptionHandler(apiRef, 'rowEditStart', props.onRowEditStart);\n useGridApiOptionHandler(apiRef, 'rowEditStop', props.onRowEditStop);\n};","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _toPropertyKey from \"@babel/runtime/helpers/esm/toPropertyKey\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"id\", \"field\"],\n _excluded2 = [\"id\", \"field\"];\nimport * as React from 'react';\nimport { useGridApiEventHandler, useGridApiOptionHandler, GridSignature } from '../../utils/useGridApiEventHandler';\nimport { GridEditModes, GridCellModes } from '../../../models/gridEditRowModel';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { gridEditRowsStateSelector } from './gridEditRowsSelector';\nimport { isPrintableKey } from '../../../utils/keyboardUtils';\nimport { buildWarning } from '../../../utils/warning';\nimport { gridRowsIdToIdLookupSelector } from '../rows/gridRowsSelector';\nimport { GridCellEditStartReasons, GridCellEditStopReasons } from '../../../models/params/gridEditCellParams';\nconst missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. ` ...} />`.', 'For more detail, see http://mui.com/components/data-grid/editing/#persistence.'], 'error');\nexport const useGridCellEditing = (apiRef, props) => {\n const [cellModesModel, setCellModesModel] = React.useState({});\n const prevCellModesModel = React.useRef({});\n const {\n processRowUpdate,\n onProcessRowUpdateError,\n cellModesModel: cellModesModelProp,\n onCellModesModelChange,\n signature\n } = props;\n\n const runIfEditModeIsCell = callback => (...args) => {\n if (props.editMode === GridEditModes.Cell) {\n callback(...args);\n }\n };\n\n const throwIfNotEditable = React.useCallback((id, field) => {\n const params = apiRef.current.getCellParams(id, field);\n\n if (!apiRef.current.isCellEditable(params)) {\n throw new Error(`MUI: The cell with id=${id} and field=${field} is not editable.`);\n }\n }, [apiRef]);\n const throwIfNotInMode = React.useCallback((id, field, mode) => {\n if (apiRef.current.getCellMode(id, field) !== mode) {\n throw new Error(`MUI: The cell with id=${id} and field=${field} is not in ${mode} mode.`);\n }\n }, [apiRef]);\n const handleCellDoubleClick = React.useCallback((params, event) => {\n if (!params.isEditable) {\n return;\n }\n\n if (params.cellMode === GridCellModes.Edit) {\n return;\n }\n\n const newParams = _extends({}, params, {\n reason: GridCellEditStartReasons.cellDoubleClick\n });\n\n apiRef.current.publishEvent('cellEditStart', newParams, event);\n }, [apiRef]);\n const handleCellFocusOut = React.useCallback((params, event) => {\n if (params.cellMode === GridCellModes.View) {\n return;\n }\n\n const newParams = _extends({}, params, {\n reason: GridCellEditStopReasons.cellFocusOut\n });\n\n apiRef.current.publishEvent('cellEditStop', newParams, event);\n }, [apiRef]);\n const handleCellKeyDown = React.useCallback((params, event) => {\n if (params.cellMode === GridCellModes.Edit) {\n let reason;\n\n if (event.key === 'Escape') {\n reason = GridCellEditStopReasons.escapeKeyDown;\n } else if (event.key === 'Enter') {\n reason = GridCellEditStopReasons.enterKeyDown;\n } else if (event.key === 'Tab') {\n reason = event.shiftKey ? GridCellEditStopReasons.shiftTabKeyDown : GridCellEditStopReasons.tabKeyDown;\n event.preventDefault(); // Prevent going to the next element in the tab sequence\n }\n\n if (reason) {\n const newParams = _extends({}, params, {\n reason\n });\n\n apiRef.current.publishEvent('cellEditStop', newParams, event);\n }\n } else if (params.isEditable) {\n let reason;\n\n if (isPrintableKey(event.key)) {\n if (event.shiftKey || event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n\n reason = GridCellEditStartReasons.printableKeyDown;\n } else if (event.key === 'Enter') {\n reason = GridCellEditStartReasons.enterKeyDown;\n } else if (event.key === 'Delete') {\n reason = GridCellEditStartReasons.deleteKeyDown;\n }\n\n if (reason) {\n const newParams = _extends({}, params, {\n reason\n });\n\n apiRef.current.publishEvent('cellEditStart', newParams, event);\n }\n }\n }, [apiRef]);\n const handleCellEditStart = React.useCallback(params => {\n const {\n id,\n field,\n reason\n } = params;\n const startCellEditModeParams = {\n id,\n field\n };\n\n if (reason === GridCellEditStartReasons.deleteKeyDown || reason === GridCellEditStartReasons.printableKeyDown) {\n startCellEditModeParams.deleteValue = true;\n }\n\n apiRef.current.startCellEditMode(startCellEditModeParams);\n }, [apiRef]);\n const handleCellEditStop = React.useCallback(params => {\n const {\n id,\n field,\n reason\n } = params;\n let cellToFocusAfter;\n\n if (reason === GridCellEditStopReasons.enterKeyDown) {\n cellToFocusAfter = 'below';\n } else if (reason === GridCellEditStopReasons.tabKeyDown) {\n cellToFocusAfter = 'right';\n } else if (reason === GridCellEditStopReasons.shiftTabKeyDown) {\n cellToFocusAfter = 'left';\n }\n\n let ignoreModifications = reason === 'escapeKeyDown';\n const editingState = gridEditRowsStateSelector(apiRef.current.state);\n\n if (editingState[id][field].isProcessingProps) {\n // The user wants to stop editing the cell but we can't wait for the props to be processed.\n // In this case, discard the modifications.\n ignoreModifications = true;\n }\n\n apiRef.current.stopCellEditMode({\n id,\n field,\n ignoreModifications,\n cellToFocusAfter\n });\n }, [apiRef]);\n useGridApiEventHandler(apiRef, 'cellDoubleClick', runIfEditModeIsCell(handleCellDoubleClick));\n useGridApiEventHandler(apiRef, 'cellFocusOut', runIfEditModeIsCell(handleCellFocusOut));\n useGridApiEventHandler(apiRef, 'cellKeyDown', runIfEditModeIsCell(handleCellKeyDown));\n useGridApiEventHandler(apiRef, 'cellEditStart', runIfEditModeIsCell(handleCellEditStart));\n useGridApiEventHandler(apiRef, 'cellEditStop', runIfEditModeIsCell(handleCellEditStop));\n useGridApiOptionHandler(apiRef, 'cellEditStart', props.onCellEditStart);\n useGridApiOptionHandler(apiRef, 'cellEditStop', props.onCellEditStop);\n const getCellMode = React.useCallback((id, field) => {\n const editingState = gridEditRowsStateSelector(apiRef.current.state);\n const isEditing = editingState[id] && editingState[id][field];\n return isEditing ? GridCellModes.Edit : GridCellModes.View;\n }, [apiRef]);\n const updateCellModesModel = React.useCallback(newModel => {\n const isNewModelDifferentFromProp = newModel !== props.cellModesModel;\n\n if (onCellModesModelChange && isNewModelDifferentFromProp) {\n const details = signature === GridSignature.DataGridPro ? {\n api: apiRef.current\n } : {};\n onCellModesModelChange(newModel, details);\n }\n\n if (props.cellModesModel && isNewModelDifferentFromProp) {\n return; // The prop always win\n }\n\n setCellModesModel(newModel);\n apiRef.current.publishEvent('cellModesModelChange', newModel);\n }, [apiRef, onCellModesModelChange, props.cellModesModel, signature]);\n const updateFieldInCellModesModel = React.useCallback((id, field, newProps) => {\n const newModel = _extends({}, cellModesModel);\n\n if (newProps !== null) {\n newModel[id] = _extends({}, newModel[id], {\n [field]: _extends({}, newProps)\n });\n } else {\n const _cellModesModel$id = cellModesModel[id],\n otherFields = _objectWithoutPropertiesLoose(_cellModesModel$id, [field].map(_toPropertyKey)); // Ensure that we have a new object, not a reference\n\n\n newModel[id] = otherFields;\n\n if (Object.keys(newModel[id]).length === 0) {\n delete newModel[id];\n }\n }\n\n updateCellModesModel(newModel);\n }, [cellModesModel, updateCellModesModel]);\n const updateOrDeleteFieldState = React.useCallback((id, field, newProps) => {\n apiRef.current.setState(state => {\n const newEditingState = _extends({}, state.editRows);\n\n if (newProps !== null) {\n newEditingState[id] = _extends({}, newEditingState[id], {\n [field]: _extends({}, newProps)\n });\n } else {\n delete newEditingState[id][field];\n\n if (Object.keys(newEditingState[id]).length === 0) {\n delete newEditingState[id];\n }\n }\n\n return _extends({}, state, {\n editRows: newEditingState\n });\n });\n apiRef.current.forceUpdate();\n }, [apiRef]);\n const startCellEditMode = React.useCallback(params => {\n const {\n id,\n field\n } = params,\n other = _objectWithoutPropertiesLoose(params, _excluded);\n\n throwIfNotEditable(id, field);\n throwIfNotInMode(id, field, GridCellModes.View);\n updateFieldInCellModesModel(id, field, _extends({\n mode: GridCellModes.Edit\n }, other));\n }, [throwIfNotEditable, throwIfNotInMode, updateFieldInCellModesModel]);\n const updateStateToStartCellEditMode = React.useCallback(params => {\n const {\n id,\n field,\n deleteValue\n } = params;\n const newProps = {\n value: deleteValue ? '' : apiRef.current.getCellValue(id, field),\n error: false,\n isProcessingProps: false\n };\n updateOrDeleteFieldState(id, field, newProps);\n apiRef.current.setCellFocus(id, field);\n }, [apiRef, updateOrDeleteFieldState]);\n const stopCellEditMode = React.useCallback(params => {\n const {\n id,\n field\n } = params,\n other = _objectWithoutPropertiesLoose(params, _excluded2);\n\n throwIfNotInMode(id, field, GridCellModes.Edit);\n updateFieldInCellModesModel(id, field, _extends({\n mode: GridCellModes.View\n }, other));\n }, [throwIfNotInMode, updateFieldInCellModesModel]);\n const updateStateToStopCellEditMode = React.useCallback(async params => {\n const {\n id,\n field,\n ignoreModifications,\n cellToFocusAfter = 'none'\n } = params;\n throwIfNotInMode(id, field, GridCellModes.Edit);\n apiRef.current.unstable_runPendingEditCellValueMutation(id, field);\n\n const finishCellEditMode = () => {\n if (cellToFocusAfter !== 'none') {\n apiRef.current.unstable_moveFocusToRelativeCell(id, field, cellToFocusAfter);\n }\n\n updateOrDeleteFieldState(id, field, null);\n updateFieldInCellModesModel(id, field, null);\n };\n\n if (ignoreModifications) {\n finishCellEditMode();\n return;\n }\n\n const editingState = gridEditRowsStateSelector(apiRef.current.state);\n const {\n error,\n isProcessingProps\n } = editingState[id][field];\n\n if (error || isProcessingProps) {\n return;\n }\n\n const rowUpdate = apiRef.current.unstable_getRowWithUpdatedValuesFromCellEditing(id, field);\n\n if (processRowUpdate) {\n const handleError = errorThrown => {\n if (onProcessRowUpdateError) {\n onProcessRowUpdateError(errorThrown);\n } else {\n missingOnProcessRowUpdateErrorWarning();\n }\n };\n\n try {\n const row = apiRef.current.getRow(id);\n Promise.resolve(processRowUpdate(rowUpdate, row)).then(finalRowUpdate => {\n apiRef.current.updateRows([finalRowUpdate]);\n finishCellEditMode();\n }).catch(handleError);\n } catch (errorThrown) {\n handleError(errorThrown);\n }\n } else {\n apiRef.current.updateRows([rowUpdate]);\n finishCellEditMode();\n }\n }, [apiRef, onProcessRowUpdateError, processRowUpdate, throwIfNotInMode, updateFieldInCellModesModel, updateOrDeleteFieldState]);\n const setCellEditingEditCellValue = React.useCallback(async params => {\n const {\n id,\n field,\n value\n } = params;\n throwIfNotEditable(id, field);\n throwIfNotInMode(id, field, GridCellModes.Edit);\n const column = apiRef.current.getColumn(field);\n const row = apiRef.current.getRow(id);\n let parsedValue = value;\n\n if (column.valueParser) {\n parsedValue = column.valueParser(value, apiRef.current.getCellParams(id, field));\n }\n\n let editingState = gridEditRowsStateSelector(apiRef.current.state);\n\n let newProps = _extends({}, editingState[id][field], {\n value: parsedValue\n });\n\n if (column.preProcessEditCellProps) {\n const hasChanged = value !== editingState[id][field].value;\n newProps = _extends({}, newProps, {\n isProcessingProps: true\n });\n updateOrDeleteFieldState(id, field, newProps);\n newProps = await Promise.resolve(column.preProcessEditCellProps({\n id,\n row,\n props: newProps,\n hasChanged\n }));\n } // Check again if the cell is in edit mode because the user may have\n // discarded the changes while the props were being processed.\n\n\n if (apiRef.current.getCellMode(id, field) === GridCellModes.View) {\n return false;\n }\n\n editingState = gridEditRowsStateSelector(apiRef.current.state);\n newProps = _extends({}, newProps, {\n isProcessingProps: false\n }); // We don't update the value with the one coming from the props pre-processing\n // because when the promise resolves it may be already outdated. The only\n // exception to this rule is when there's no pre-processing.\n\n newProps.value = column.preProcessEditCellProps ? editingState[id][field].value : parsedValue;\n updateOrDeleteFieldState(id, field, newProps);\n editingState = gridEditRowsStateSelector(apiRef.current.state);\n return !editingState[id][field].error;\n }, [apiRef, throwIfNotEditable, throwIfNotInMode, updateOrDeleteFieldState]);\n const getRowWithUpdatedValuesFromCellEditing = React.useCallback((id, field) => {\n const column = apiRef.current.getColumn(field);\n const editingState = gridEditRowsStateSelector(apiRef.current.state);\n const {\n value\n } = editingState[id][field];\n const row = apiRef.current.getRow(id);\n return column.valueSetter ? column.valueSetter({\n value,\n row\n }) : _extends({}, row, {\n [field]: value\n });\n }, [apiRef]);\n const editingApi = {\n getCellMode,\n startCellEditMode,\n stopCellEditMode,\n unstable_setCellEditingEditCellValue: setCellEditingEditCellValue,\n unstable_getRowWithUpdatedValuesFromCellEditing: getRowWithUpdatedValuesFromCellEditing\n };\n useGridApiMethod(apiRef, editingApi, 'EditingApi');\n React.useEffect(() => {\n if (cellModesModelProp) {\n updateCellModesModel(cellModesModelProp);\n }\n }, [cellModesModelProp, updateCellModesModel]);\n React.useEffect(() => {\n const idToIdLookup = gridRowsIdToIdLookupSelector(apiRef);\n Object.entries(cellModesModel).forEach(([id, fields]) => {\n Object.entries(fields).forEach(([field, params]) => {\n var _prevCellModesModel$c, _prevCellModesModel$c2, _idToIdLookup$id;\n\n const prevMode = ((_prevCellModesModel$c = prevCellModesModel.current[id]) == null ? void 0 : (_prevCellModesModel$c2 = _prevCellModesModel$c[field]) == null ? void 0 : _prevCellModesModel$c2.mode) || GridCellModes.View;\n const originalId = (_idToIdLookup$id = idToIdLookup[id]) != null ? _idToIdLookup$id : id;\n\n if (params.mode === GridCellModes.Edit && prevMode === GridCellModes.View) {\n updateStateToStartCellEditMode(_extends({\n id: originalId,\n field\n }, params));\n } else if (params.mode === GridCellModes.View && prevMode === GridCellModes.Edit) {\n updateStateToStopCellEditMode(_extends({\n id: originalId,\n field\n }, params));\n }\n });\n });\n prevCellModesModel.current = cellModesModel;\n }, [apiRef, cellModesModel, updateStateToStartCellEditMode, updateStateToStopCellEditMode]);\n};","/**\n * Object passed as parameter in the row callbacks.\n */\n\n/**\n * Object passed as parameter in the row `getRowClassName` callback prop.\n */\n\n/**\n * Object passed as parameter in the row `getRowHeight` callback prop.\n */\n\n/**\n * The getRowHeight return value.\n */\nvar GridRowEditStartReasons;\n/**\n * Params passed to the `rowEditStart` event.\n */\n\n(function (GridRowEditStartReasons) {\n GridRowEditStartReasons[\"enterKeyDown\"] = \"enterKeyDown\";\n GridRowEditStartReasons[\"cellDoubleClick\"] = \"cellDoubleClick\";\n GridRowEditStartReasons[\"printableKeyDown\"] = \"printableKeyDown\";\n GridRowEditStartReasons[\"deleteKeyDown\"] = \"deleteKeyDown\";\n})(GridRowEditStartReasons || (GridRowEditStartReasons = {}));\n\nvar GridRowEditStopReasons;\n\n(function (GridRowEditStopReasons) {\n GridRowEditStopReasons[\"rowFocusOut\"] = \"rowFocusOut\";\n GridRowEditStopReasons[\"escapeKeyDown\"] = \"escapeKeyDown\";\n GridRowEditStopReasons[\"enterKeyDown\"] = \"enterKeyDown\";\n GridRowEditStopReasons[\"tabKeyDown\"] = \"tabKeyDown\";\n GridRowEditStopReasons[\"shiftTabKeyDown\"] = \"shiftTabKeyDown\";\n})(GridRowEditStopReasons || (GridRowEditStopReasons = {}));\n\n// https://github.com/mui/mui-x/pull/3738#discussion_r798504277\nexport { GridRowEditStartReasons, GridRowEditStopReasons };","import _toPropertyKey from \"@babel/runtime/helpers/esm/toPropertyKey\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"id\"],\n _excluded2 = [\"id\"];\nimport * as React from 'react';\nimport { useGridApiEventHandler, useGridApiOptionHandler, GridSignature } from '../../utils/useGridApiEventHandler';\nimport { GridEditModes, GridRowModes } from '../../../models/gridEditRowModel';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { gridEditRowsStateSelector } from './gridEditRowsSelector';\nimport { isPrintableKey } from '../../../utils/keyboardUtils';\nimport { gridColumnFieldsSelector } from '../columns/gridColumnsSelector';\nimport { buildWarning } from '../../../utils/warning';\nimport { gridRowsIdToIdLookupSelector } from '../rows/gridRowsSelector';\nimport { GridRowEditStopReasons, GridRowEditStartReasons } from '../../../models/params/gridRowParams';\nconst missingOnProcessRowUpdateErrorWarning = buildWarning(['MUI: A call to `processRowUpdate` threw an error which was not handled because `onProcessRowUpdateError` is missing.', 'To handle the error pass a callback to the `onProcessRowUpdateError` prop, e.g. ` ...} />`.', 'For more detail, see http://mui.com/components/data-grid/editing/#persistence.'], 'error');\nexport const useGridRowEditing = (apiRef, props) => {\n const [rowModesModel, setRowModesModel] = React.useState({});\n const prevRowModesModel = React.useRef({});\n const focusTimeout = React.useRef(null);\n const nextFocusedCell = React.useRef(null);\n const {\n processRowUpdate,\n onProcessRowUpdateError,\n rowModesModel: rowModesModelProp,\n onRowModesModelChange,\n signature\n } = props;\n\n const runIfEditModeIsRow = callback => (...args) => {\n if (props.editMode === GridEditModes.Row) {\n callback(...args);\n }\n };\n\n const throwIfNotEditable = React.useCallback((id, field) => {\n const params = apiRef.current.getCellParams(id, field);\n\n if (!apiRef.current.isCellEditable(params)) {\n throw new Error(`MUI: The cell with id=${id} and field=${field} is not editable.`);\n }\n }, [apiRef]);\n const throwIfNotInMode = React.useCallback((id, mode) => {\n if (apiRef.current.getRowMode(id) !== mode) {\n throw new Error(`MUI: The row with id=${id} is not in ${mode} mode.`);\n }\n }, [apiRef]);\n const handleCellDoubleClick = React.useCallback((params, event) => {\n if (!params.isEditable) {\n return;\n }\n\n if (apiRef.current.getRowMode(params.id) === GridRowModes.Edit) {\n return;\n }\n\n const rowParams = apiRef.current.getRowParams(params.id);\n\n const newParams = _extends({}, rowParams, {\n field: params.field,\n reason: GridRowEditStartReasons.cellDoubleClick\n });\n\n apiRef.current.publishEvent('rowEditStart', newParams, event);\n }, [apiRef]);\n const handleCellFocusIn = React.useCallback(params => {\n nextFocusedCell.current = params;\n }, []);\n const handleCellFocusOut = React.useCallback((params, event) => {\n if (!params.isEditable) {\n return;\n }\n\n if (apiRef.current.getRowMode(params.id) === GridRowModes.View) {\n return;\n } // The mechanism to detect if we can stop editing a row is different from\n // the cell editing. Instead of triggering it when clicking outside a cell,\n // we must check if another cell in the same row was not clicked. To achieve\n // that, first we keep track of all cells that gained focus. When a cell loses\n // focus we check if the next cell that received focus is from a different row.\n\n\n nextFocusedCell.current = null;\n focusTimeout.current = setTimeout(() => {\n var _nextFocusedCell$curr;\n\n focusTimeout.current = null;\n\n if (((_nextFocusedCell$curr = nextFocusedCell.current) == null ? void 0 : _nextFocusedCell$curr.id) !== params.id) {\n // The row might have been deleted during the click\n if (!apiRef.current.getRow(params.id)) {\n return;\n }\n\n const rowParams = apiRef.current.getRowParams(params.id);\n\n const newParams = _extends({}, rowParams, {\n field: params.field,\n reason: GridRowEditStopReasons.rowFocusOut\n });\n\n apiRef.current.publishEvent('rowEditStop', newParams, event);\n }\n });\n }, [apiRef]);\n React.useEffect(() => {\n return () => {\n clearTimeout(focusTimeout.current);\n };\n }, []);\n const handleCellKeyDown = React.useCallback((params, event) => {\n if (params.cellMode === GridRowModes.Edit) {\n let reason;\n\n if (event.key === 'Escape') {\n reason = GridRowEditStopReasons.escapeKeyDown;\n } else if (event.key === 'Enter') {\n reason = GridRowEditStopReasons.enterKeyDown;\n } else if (event.key === 'Tab') {\n const columnFields = gridColumnFieldsSelector(apiRef).filter(field => apiRef.current.isCellEditable(apiRef.current.getCellParams(params.id, field)));\n\n if (event.shiftKey) {\n if (params.field === columnFields[0]) {\n // Exit if user pressed Shift+Tab on the first field\n reason = GridRowEditStopReasons.shiftTabKeyDown;\n }\n } else if (params.field === columnFields[columnFields.length - 1]) {\n // Exit if user pressed Tab on the last field\n reason = GridRowEditStopReasons.tabKeyDown;\n }\n\n if (reason) {\n event.preventDefault(); // Prevent going to the next element in the tab sequence\n }\n }\n\n if (reason) {\n const rowParams = apiRef.current.getRowParams(params.id);\n\n const newParams = _extends({}, rowParams, {\n reason,\n field: params.field\n });\n\n apiRef.current.publishEvent('rowEditStop', newParams, event);\n }\n } else if (params.isEditable) {\n let reason;\n\n if (isPrintableKey(event.key)) {\n if (event.shiftKey || event.ctrlKey || event.metaKey || event.altKey) {\n return;\n }\n\n reason = GridRowEditStartReasons.printableKeyDown;\n } else if (event.key === 'Enter') {\n reason = GridRowEditStartReasons.enterKeyDown;\n } else if (event.key === 'Delete') {\n reason = GridRowEditStartReasons.deleteKeyDown;\n }\n\n if (reason) {\n const rowParams = apiRef.current.getRowParams(params.id);\n\n const newParams = _extends({}, rowParams, {\n field: params.field,\n reason\n });\n\n apiRef.current.publishEvent('rowEditStart', newParams, event);\n }\n }\n }, [apiRef]);\n const handleRowEditStart = React.useCallback(params => {\n const {\n id,\n field,\n reason\n } = params;\n const startRowEditModeParams = {\n id,\n fieldToFocus: field\n };\n\n if (reason === GridRowEditStartReasons.deleteKeyDown || reason === GridRowEditStartReasons.printableKeyDown) {\n startRowEditModeParams.deleteValue = !!field;\n }\n\n apiRef.current.startRowEditMode(startRowEditModeParams);\n }, [apiRef]);\n const handleRowEditStop = React.useCallback(params => {\n const {\n id,\n reason,\n field\n } = params;\n apiRef.current.unstable_runPendingEditCellValueMutation(id);\n let cellToFocusAfter;\n\n if (reason === GridRowEditStopReasons.enterKeyDown) {\n cellToFocusAfter = 'below';\n } else if (reason === GridRowEditStopReasons.tabKeyDown) {\n cellToFocusAfter = 'right';\n } else if (reason === GridRowEditStopReasons.shiftTabKeyDown) {\n cellToFocusAfter = 'left';\n }\n\n let ignoreModifications = reason === 'escapeKeyDown';\n const editingState = gridEditRowsStateSelector(apiRef.current.state);\n\n if (!ignoreModifications) {\n // The user wants to stop editing the cell but we can't wait for the props to be processed.\n // In this case, discard the modifications if any field is processing its props.\n ignoreModifications = Object.values(editingState[id]).some(fieldProps => {\n return fieldProps.isProcessingProps;\n });\n }\n\n apiRef.current.stopRowEditMode({\n id,\n ignoreModifications,\n field,\n cellToFocusAfter\n });\n }, [apiRef]);\n useGridApiEventHandler(apiRef, 'cellDoubleClick', runIfEditModeIsRow(handleCellDoubleClick));\n useGridApiEventHandler(apiRef, 'cellFocusIn', runIfEditModeIsRow(handleCellFocusIn));\n useGridApiEventHandler(apiRef, 'cellFocusOut', runIfEditModeIsRow(handleCellFocusOut));\n useGridApiEventHandler(apiRef, 'cellKeyDown', runIfEditModeIsRow(handleCellKeyDown));\n useGridApiEventHandler(apiRef, 'rowEditStart', runIfEditModeIsRow(handleRowEditStart));\n useGridApiEventHandler(apiRef, 'rowEditStop', runIfEditModeIsRow(handleRowEditStop));\n useGridApiOptionHandler(apiRef, 'rowEditStart', props.onRowEditStart);\n useGridApiOptionHandler(apiRef, 'rowEditStop', props.onRowEditStop);\n const getRowMode = React.useCallback(id => {\n if (props.editMode === GridEditModes.Cell) {\n return GridRowModes.View;\n }\n\n const editingState = gridEditRowsStateSelector(apiRef.current.state);\n const isEditing = editingState[id] && Object.keys(editingState[id]).length > 0;\n return isEditing ? GridRowModes.Edit : GridRowModes.View;\n }, [apiRef, props.editMode]);\n const updateRowModesModel = React.useCallback(newModel => {\n const isNewModelDifferentFromProp = newModel !== props.rowModesModel;\n\n if (onRowModesModelChange && isNewModelDifferentFromProp) {\n const details = signature === GridSignature.DataGridPro ? {\n api: apiRef.current\n } : {};\n onRowModesModelChange(newModel, details);\n }\n\n if (props.rowModesModel && isNewModelDifferentFromProp) {\n return; // The prop always win\n }\n\n setRowModesModel(newModel);\n apiRef.current.publishEvent('rowModesModelChange', newModel);\n }, [apiRef, onRowModesModelChange, props.rowModesModel, signature]);\n const updateRowInRowModesModel = React.useCallback((id, newProps) => {\n const newModel = _extends({}, rowModesModel);\n\n if (newProps !== null) {\n newModel[id] = _extends({}, newProps);\n } else {\n delete newModel[id];\n }\n\n updateRowModesModel(newModel);\n }, [rowModesModel, updateRowModesModel]);\n const updateOrDeleteRowState = React.useCallback((id, newProps) => {\n apiRef.current.setState(state => {\n const newEditingState = _extends({}, state.editRows);\n\n if (newProps !== null) {\n newEditingState[id] = newProps;\n } else {\n delete newEditingState[id];\n }\n\n return _extends({}, state, {\n editRows: newEditingState\n });\n });\n apiRef.current.forceUpdate();\n }, [apiRef]);\n const updateOrDeleteFieldState = React.useCallback((id, field, newProps) => {\n apiRef.current.setState(state => {\n const newEditingState = _extends({}, state.editRows);\n\n if (newProps !== null) {\n newEditingState[id] = _extends({}, newEditingState[id], {\n [field]: _extends({}, newProps)\n });\n } else {\n delete newEditingState[id][field];\n\n if (Object.keys(newEditingState[id]).length === 0) {\n delete newEditingState[id];\n }\n }\n\n return _extends({}, state, {\n editRows: newEditingState\n });\n });\n apiRef.current.forceUpdate();\n }, [apiRef]);\n const startRowEditMode = React.useCallback(params => {\n const {\n id\n } = params,\n other = _objectWithoutPropertiesLoose(params, _excluded);\n\n throwIfNotInMode(id, GridRowModes.View);\n updateRowInRowModesModel(id, _extends({\n mode: GridRowModes.Edit\n }, other));\n }, [throwIfNotInMode, updateRowInRowModesModel]);\n const updateStateToStartRowEditMode = React.useCallback(params => {\n const {\n id,\n fieldToFocus,\n deleteValue\n } = params;\n const columnFields = gridColumnFieldsSelector(apiRef);\n const newProps = columnFields.reduce((acc, field) => {\n const cellParams = apiRef.current.getCellParams(id, field);\n\n if (!cellParams.isEditable) {\n return acc;\n }\n\n const shouldDeleteValue = deleteValue && fieldToFocus === field;\n acc[field] = {\n value: shouldDeleteValue ? '' : apiRef.current.getCellValue(id, field),\n error: false,\n isProcessingProps: false\n };\n return acc;\n }, {});\n updateOrDeleteRowState(id, newProps);\n\n if (fieldToFocus) {\n apiRef.current.setCellFocus(id, fieldToFocus);\n }\n }, [apiRef, updateOrDeleteRowState]);\n const stopRowEditMode = React.useCallback(params => {\n const {\n id\n } = params,\n other = _objectWithoutPropertiesLoose(params, _excluded2);\n\n throwIfNotInMode(id, GridRowModes.Edit);\n updateRowInRowModesModel(id, _extends({\n mode: GridRowModes.View\n }, other));\n }, [throwIfNotInMode, updateRowInRowModesModel]);\n const updateStateToStopRowEditMode = React.useCallback(params => {\n const {\n id,\n ignoreModifications,\n field: focusedField,\n cellToFocusAfter = 'none'\n } = params;\n apiRef.current.unstable_runPendingEditCellValueMutation(id);\n\n const finishRowEditMode = () => {\n if (cellToFocusAfter !== 'none' && focusedField) {\n apiRef.current.unstable_moveFocusToRelativeCell(id, focusedField, cellToFocusAfter);\n }\n\n updateOrDeleteRowState(id, null);\n updateRowInRowModesModel(id, null);\n };\n\n if (ignoreModifications) {\n finishRowEditMode();\n return;\n }\n\n const editingState = gridEditRowsStateSelector(apiRef.current.state);\n const row = apiRef.current.getRow(id);\n const isSomeFieldProcessingProps = Object.values(editingState[id]).some(fieldProps => fieldProps.isProcessingProps);\n\n if (isSomeFieldProcessingProps) {\n return;\n }\n\n const hasSomeFieldWithError = Object.values(editingState[id]).some(fieldProps => fieldProps.error);\n\n if (hasSomeFieldWithError) {\n return;\n }\n\n const rowUpdate = apiRef.current.unstable_getRowWithUpdatedValuesFromRowEditing(id);\n\n if (processRowUpdate) {\n const handleError = errorThrown => {\n if (onProcessRowUpdateError) {\n onProcessRowUpdateError(errorThrown);\n } else {\n missingOnProcessRowUpdateErrorWarning();\n }\n };\n\n try {\n Promise.resolve(processRowUpdate(rowUpdate, row)).then(finalRowUpdate => {\n apiRef.current.updateRows([finalRowUpdate]);\n finishRowEditMode();\n }).catch(handleError);\n } catch (errorThrown) {\n handleError(errorThrown);\n }\n } else {\n apiRef.current.updateRows([rowUpdate]);\n finishRowEditMode();\n }\n }, [apiRef, onProcessRowUpdateError, processRowUpdate, updateOrDeleteRowState, updateRowInRowModesModel]);\n const setRowEditingEditCellValue = React.useCallback(params => {\n const {\n id,\n field,\n value\n } = params;\n throwIfNotEditable(id, field);\n const column = apiRef.current.getColumn(field);\n const row = apiRef.current.getRow(id);\n let parsedValue = value;\n\n if (column.valueParser) {\n parsedValue = column.valueParser(value, apiRef.current.getCellParams(id, field));\n }\n\n let editingState = gridEditRowsStateSelector(apiRef.current.state);\n\n let newProps = _extends({}, editingState[id][field], {\n value: parsedValue\n });\n\n if (!column.preProcessEditCellProps) {\n updateOrDeleteFieldState(id, field, newProps);\n }\n\n return new Promise(resolve => {\n const promises = [];\n\n if (column.preProcessEditCellProps) {\n const hasChanged = newProps.value !== editingState[id][field].value;\n newProps = _extends({}, newProps, {\n isProcessingProps: true\n });\n updateOrDeleteFieldState(id, field, newProps);\n\n const _editingState$id = editingState[id],\n otherFieldsProps = _objectWithoutPropertiesLoose(_editingState$id, [field].map(_toPropertyKey));\n\n const promise = Promise.resolve(column.preProcessEditCellProps({\n id,\n row,\n props: newProps,\n hasChanged,\n otherFieldsProps\n })).then(processedProps => {\n // Check again if the row is in edit mode because the user may have\n // discarded the changes while the props were being processed.\n if (apiRef.current.getRowMode(id) === GridRowModes.View) {\n resolve(false);\n return;\n }\n\n editingState = gridEditRowsStateSelector(apiRef.current.state);\n processedProps = _extends({}, processedProps, {\n isProcessingProps: false\n }); // We don't reuse the value from the props pre-processing because when the\n // promise resolves it may be already outdated. The only exception to this rule\n // is when there's no pre-processing.\n\n processedProps.value = column.preProcessEditCellProps ? editingState[id][field].value : parsedValue;\n updateOrDeleteFieldState(id, field, processedProps);\n });\n promises.push(promise);\n }\n\n Object.entries(editingState[id]).forEach(([thisField, fieldProps]) => {\n if (thisField === field) {\n return;\n }\n\n const fieldColumn = apiRef.current.getColumn(thisField);\n\n if (!fieldColumn.preProcessEditCellProps) {\n return;\n }\n\n fieldProps = _extends({}, fieldProps, {\n isProcessingProps: true\n });\n updateOrDeleteFieldState(id, thisField, fieldProps);\n editingState = gridEditRowsStateSelector(apiRef.current.state);\n\n const _editingState$id2 = editingState[id],\n otherFieldsProps = _objectWithoutPropertiesLoose(_editingState$id2, [thisField].map(_toPropertyKey));\n\n const promise = Promise.resolve(fieldColumn.preProcessEditCellProps({\n id,\n row,\n props: fieldProps,\n hasChanged: false,\n otherFieldsProps\n })).then(processedProps => {\n // Check again if the row is in edit mode because the user may have\n // discarded the changes while the props were being processed.\n if (apiRef.current.getRowMode(id) === GridRowModes.View) {\n resolve(false);\n return;\n }\n\n processedProps = _extends({}, processedProps, {\n isProcessingProps: false\n });\n updateOrDeleteFieldState(id, thisField, processedProps);\n });\n promises.push(promise);\n });\n Promise.all(promises).then(() => {\n if (apiRef.current.getRowMode(id) === GridRowModes.Edit) {\n editingState = gridEditRowsStateSelector(apiRef.current.state);\n resolve(!editingState[id][field].error);\n } else {\n resolve(false);\n }\n });\n });\n }, [apiRef, throwIfNotEditable, updateOrDeleteFieldState]);\n const getRowWithUpdatedValuesFromRowEditing = React.useCallback(id => {\n const editingState = gridEditRowsStateSelector(apiRef.current.state);\n const row = apiRef.current.getRow(id);\n\n let rowUpdate = _extends({}, row);\n\n Object.entries(editingState[id]).forEach(([field, fieldProps]) => {\n const column = apiRef.current.getColumn(field);\n\n if (column.valueSetter) {\n rowUpdate = column.valueSetter({\n value: fieldProps.value,\n row: rowUpdate\n });\n } else {\n rowUpdate[field] = fieldProps.value;\n }\n });\n return rowUpdate;\n }, [apiRef]);\n const editingApi = {\n getRowMode,\n startRowEditMode,\n stopRowEditMode,\n unstable_setRowEditingEditCellValue: setRowEditingEditCellValue,\n unstable_getRowWithUpdatedValuesFromRowEditing: getRowWithUpdatedValuesFromRowEditing\n };\n useGridApiMethod(apiRef, editingApi, 'EditingApi');\n React.useEffect(() => {\n if (rowModesModelProp) {\n updateRowModesModel(rowModesModelProp);\n }\n }, [rowModesModelProp, updateRowModesModel]);\n React.useEffect(() => {\n const idToIdLookup = gridRowsIdToIdLookupSelector(apiRef);\n Object.entries(rowModesModel).forEach(([id, params]) => {\n var _prevRowModesModel$cu, _idToIdLookup$id;\n\n const prevMode = ((_prevRowModesModel$cu = prevRowModesModel.current[id]) == null ? void 0 : _prevRowModesModel$cu.mode) || GridRowModes.View;\n const originalId = (_idToIdLookup$id = idToIdLookup[id]) != null ? _idToIdLookup$id : id;\n\n if (params.mode === GridRowModes.Edit && prevMode === GridRowModes.View) {\n updateStateToStartRowEditMode(_extends({\n id: originalId\n }, params));\n } else if (params.mode === GridRowModes.View && prevMode === GridRowModes.Edit) {\n updateStateToStopRowEditMode(_extends({\n id: originalId\n }, params));\n }\n });\n prevRowModesModel.current = rowModesModel;\n }, [apiRef, rowModesModel, updateStateToStartRowEditMode, updateStateToStopRowEditMode]);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridCellEditing } from './useGridCellEditing.new';\nimport { GridCellModes, GridEditModes } from '../../../models/gridEditRowModel';\nimport { useGridRowEditing } from './useGridRowEditing.new';\nexport const editingStateInitializer = state => _extends({}, state, {\n editRows: {}\n});\nexport const useGridEditing = (apiRef, props) => {\n useGridCellEditing(apiRef, props);\n useGridRowEditing(apiRef, props);\n const debounceMap = React.useRef({});\n const {\n isCellEditable: isCellEditableProp\n } = props;\n const isCellEditable = React.useCallback(params => {\n if (params.rowNode.isAutoGenerated) {\n return false;\n }\n\n if (!params.colDef.editable) {\n return false;\n }\n\n if (!params.colDef.renderEditCell) {\n return false;\n }\n\n if (isCellEditableProp) {\n return isCellEditableProp(params);\n }\n\n return true;\n }, [isCellEditableProp]);\n\n const maybeDebounce = (id, field, debounceMs, callback) => {\n if (!debounceMs) {\n callback();\n return;\n }\n\n if (!debounceMap.current[id]) {\n debounceMap.current[id] = {};\n }\n\n if (debounceMap.current[id][field]) {\n const [timeout] = debounceMap.current[id][field];\n clearTimeout(timeout);\n } // To run the callback immediatelly without waiting the timeout\n\n\n const runImmediately = () => {\n const [timeout] = debounceMap.current[id][field];\n clearTimeout(timeout);\n callback();\n delete debounceMap.current[id][field];\n };\n\n const timeout = setTimeout(() => {\n callback();\n delete debounceMap.current[id][field];\n }, debounceMs);\n debounceMap.current[id][field] = [timeout, runImmediately];\n };\n\n React.useEffect(() => {\n const debounces = debounceMap.current;\n return () => {\n Object.entries(debounces).forEach(([id, fields]) => {\n Object.keys(fields).forEach(field => {\n const [timeout] = debounces[id][field];\n clearTimeout(timeout);\n delete debounces[id][field];\n });\n });\n };\n }, []);\n const runPendingEditCellValueMutation = React.useCallback((id, field) => {\n if (!debounceMap.current[id]) {\n return;\n }\n\n if (!field) {\n Object.keys(debounceMap.current[id]).forEach(debouncedField => {\n const [, runCallback] = debounceMap.current[id][debouncedField];\n runCallback();\n });\n } else if (debounceMap.current[id][field]) {\n const [, runCallback] = debounceMap.current[id][field];\n runCallback();\n }\n }, []);\n const setEditCellValue = React.useCallback(params => {\n const {\n id,\n field,\n debounceMs\n } = params;\n return new Promise(resolve => {\n maybeDebounce(id, field, debounceMs, async () => {\n const setEditCellValueToCall = props.editMode === GridEditModes.Row ? apiRef.current.unstable_setRowEditingEditCellValue : apiRef.current.unstable_setCellEditingEditCellValue; // Check if the cell is in edit mode\n // By the time this callback runs the user may have cancelled the editing\n\n if (apiRef.current.getCellMode(id, field) === GridCellModes.Edit) {\n const result = await setEditCellValueToCall(params);\n resolve(result);\n }\n });\n });\n }, [apiRef, props.editMode]);\n const getRowWithUpdatedValues = React.useCallback((id, field) => {\n return props.editMode === GridEditModes.Cell ? apiRef.current.unstable_getRowWithUpdatedValuesFromCellEditing(id, field) : apiRef.current.unstable_getRowWithUpdatedValuesFromRowEditing(id);\n }, [apiRef, props.editMode]);\n const editingSharedApi = {\n isCellEditable,\n setEditCellValue,\n unstable_runPendingEditCellValueMutation: runPendingEditCellValueMutation,\n unstable_getRowWithUpdatedValues: getRowWithUpdatedValues\n };\n useGridApiMethod(apiRef, editingSharedApi, 'EditingApi');\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"rowsBeforePartialUpdates\"];\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: 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}) => {\n const cache = {\n rowsBeforePartialUpdates: rows,\n loadingPropBeforePartialUpdates: loading,\n idRowsLookup: {},\n idToIdLookup: {},\n ids: []\n };\n\n for (let i = 0; i < rows.length; i += 1) {\n const row = rows[i];\n const id = getRowIdFromRowModel(row, getRowId);\n cache.idRowsLookup[id] = row;\n cache.idToIdLookup[id] = id;\n cache.ids.push(id);\n }\n\n return cache;\n};\nexport const getRowsStateFromCache = ({\n apiRef,\n previousTree,\n rowCountProp,\n loadingProp\n}) => {\n const _apiRef$current$unsta = apiRef.current.unstable_caches.rows,\n cacheForGrouping = _objectWithoutPropertiesLoose(_apiRef$current$unsta, _excluded);\n\n const rowCount = rowCountProp != null ? rowCountProp : 0;\n const groupingResponse = apiRef.current.unstable_applyStrategyProcessor('rowTreeCreation', _extends({}, cacheForGrouping, {\n previousTree\n }));\n const processedGroupingResponse = apiRef.current.unstable_applyPipeProcessors('hydrateRows', groupingResponse);\n const dataTopLevelRowCount = processedGroupingResponse.treeDepth === 1 ? processedGroupingResponse.ids.length : Object.values(processedGroupingResponse.tree).filter(node => node.parent == null).length;\n return _extends({}, processedGroupingResponse, {\n groupingResponseBeforeRowHydration: groupingResponse,\n loading: loadingProp,\n totalRowCount: Math.max(rowCount, processedGroupingResponse.ids.length),\n totalTopLevelRowCount: Math.max(rowCount, dataTopLevelRowCount)\n });\n};\nexport const getTreeNodeDescendants = (tree, parentId, skipAutoGeneratedRows) => {\n var _tree$parentId;\n\n const children = (_tree$parentId = tree[parentId]) == null ? void 0 : _tree$parentId.children;\n\n if (children == null) {\n return [];\n }\n\n const validDescendants = [];\n\n for (let i = 0; i < children.length; i += 1) {\n const child = children[i];\n const childNode = tree[child];\n\n if (!skipAutoGeneratedRows || !childNode.isAutoGenerated) {\n validDescendants.push(child);\n }\n\n validDescendants.push(...getTreeNodeDescendants(tree, childNode.id, skipAutoGeneratedRows));\n }\n\n return validDescendants;\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridRowCountSelector, gridRowsLookupSelector, gridRowTreeSelector, gridRowIdsSelector, gridRowGroupingNameSelector } from './gridRowsSelector';\nimport { GridSignature, useGridApiEventHandler } from '../../utils/useGridApiEventHandler';\nimport { useGridVisibleRows } from '../../utils/useGridVisibleRows';\nimport { gridSortedRowIdsSelector } from '../sorting/gridSortingSelector';\nimport { gridFilteredRowsLookupSelector } from '../filter/gridFilterSelector';\nimport { getTreeNodeDescendants, createRowsInternalCache, getRowsStateFromCache, getRowIdFromRowModel } from './gridRowsUtils';\nimport { useGridRegisterPipeApplier } from '../../core/pipeProcessing';\nexport const rowsStateInitializer = (state, props, apiRef) => {\n apiRef.current.unstable_caches.rows = createRowsInternalCache({\n rows: props.rows,\n getRowId: props.getRowId,\n loading: props.loading\n });\n return _extends({}, state, {\n rows: getRowsStateFromCache({\n apiRef,\n previousTree: null,\n rowCountProp: props.rowCount,\n loadingProp: props.loading\n })\n });\n};\nexport const useGridRows = (apiRef, props) => {\n if (process.env.NODE_ENV !== 'production') {\n // Freeze rows for immutability\n Object.freeze(props.rows);\n }\n\n const logger = useGridLogger(apiRef, 'useGridRows');\n const currentPage = useGridVisibleRows(apiRef, props);\n const lastUpdateMs = React.useRef(Date.now());\n const timeout = React.useRef(null);\n const getRow = React.useCallback(id => {\n var _ref;\n\n return (_ref = gridRowsLookupSelector(apiRef)[id]) != null ? _ref : null;\n }, [apiRef]);\n const lookup = React.useMemo(() => currentPage.rows.reduce((acc, {\n id\n }, index) => {\n acc[id] = index;\n return acc;\n }, {}), [currentPage.rows]);\n const throttledRowsChange = React.useCallback((newCache, throttle) => {\n const run = () => {\n timeout.current = null;\n lastUpdateMs.current = Date.now();\n apiRef.current.setState(state => _extends({}, state, {\n rows: getRowsStateFromCache({\n apiRef,\n previousTree: gridRowTreeSelector(apiRef),\n rowCountProp: props.rowCount,\n loadingProp: props.loading\n })\n }));\n apiRef.current.publishEvent('rowsSet');\n apiRef.current.forceUpdate();\n };\n\n if (timeout.current) {\n clearTimeout(timeout.current);\n timeout.current = null;\n }\n\n apiRef.current.unstable_caches.rows = newCache;\n\n if (!throttle) {\n run();\n return;\n }\n\n const throttleRemainingTimeMs = props.throttleRowsMs - (Date.now() - lastUpdateMs.current);\n\n if (throttleRemainingTimeMs > 0) {\n timeout.current = setTimeout(run, throttleRemainingTimeMs);\n return;\n }\n\n run();\n }, [props.throttleRowsMs, props.rowCount, props.loading, apiRef]);\n /**\n * API METHODS\n */\n\n const setRows = React.useCallback(rows => {\n logger.debug(`Updating all rows, new length ${rows.length}`);\n throttledRowsChange(createRowsInternalCache({\n rows,\n getRowId: props.getRowId,\n loading: props.loading\n }), true);\n }, [logger, props.getRowId, props.loading, throttledRowsChange]);\n const updateRows = React.useCallback(updates => {\n if (props.signature === GridSignature.DataGrid && updates.length > 1) {\n // TODO: Add test with direct call to `apiRef.current.updateRows` in DataGrid after enabling the `apiRef` on the free plan.\n throw new Error([\"MUI: You can't update several rows at once in `apiRef.current.updateRows` on the DataGrid.\", 'You need to upgrade to the DataGridPro component to unlock this feature.'].join('\\n'));\n } // we remove duplicate updates. A server can batch updates, and send several updates for the same row in one fn call.\n\n\n const uniqUpdates = new Map();\n updates.forEach(update => {\n const id = getRowIdFromRowModel(update, props.getRowId, 'A row was provided without id when calling updateRows():');\n\n if (uniqUpdates.has(id)) {\n uniqUpdates.set(id, _extends({}, uniqUpdates.get(id), update));\n } else {\n uniqUpdates.set(id, update);\n }\n });\n const deletedRowIds = [];\n const prevCache = apiRef.current.unstable_caches.rows;\n const newCache = {\n rowsBeforePartialUpdates: prevCache.rowsBeforePartialUpdates,\n loadingPropBeforePartialUpdates: prevCache.loadingPropBeforePartialUpdates,\n idRowsLookup: _extends({}, prevCache.idRowsLookup),\n idToIdLookup: _extends({}, prevCache.idToIdLookup),\n ids: [...prevCache.ids]\n };\n uniqUpdates.forEach((partialRow, id) => {\n // eslint-disable-next-line no-underscore-dangle\n if (partialRow._action === 'delete') {\n delete newCache.idRowsLookup[id];\n delete newCache.idToIdLookup[id];\n deletedRowIds.push(id);\n return;\n }\n\n const oldRow = apiRef.current.getRow(id);\n\n if (!oldRow) {\n newCache.idRowsLookup[id] = partialRow;\n newCache.idToIdLookup[id] = id;\n newCache.ids.push(id);\n return;\n }\n\n newCache.idRowsLookup[id] = _extends({}, apiRef.current.getRow(id), partialRow);\n });\n\n if (deletedRowIds.length > 0) {\n newCache.ids = newCache.ids.filter(id => !deletedRowIds.includes(id));\n }\n\n throttledRowsChange(newCache, true);\n }, [props.signature, props.getRowId, throttledRowsChange, apiRef]);\n const getRowModels = React.useCallback(() => {\n const allRows = gridRowIdsSelector(apiRef);\n const idRowsLookup = gridRowsLookupSelector(apiRef);\n return new Map(allRows.map(id => [id, idRowsLookup[id]]));\n }, [apiRef]);\n const getRowsCount = React.useCallback(() => gridRowCountSelector(apiRef), [apiRef]);\n const getAllRowIds = React.useCallback(() => gridRowIdsSelector(apiRef), [apiRef]);\n const getRowIndexRelativeToVisibleRows = React.useCallback(id => lookup[id], [lookup]);\n const setRowChildrenExpansion = React.useCallback((id, isExpanded) => {\n const currentNode = apiRef.current.getRowNode(id);\n\n if (!currentNode) {\n throw new Error(`MUI: No row with id #${id} found`);\n }\n\n const newNode = _extends({}, currentNode, {\n childrenExpanded: isExpanded\n });\n\n apiRef.current.setState(state => {\n return _extends({}, state, {\n rows: _extends({}, state.rows, {\n tree: _extends({}, state.rows.tree, {\n [id]: newNode\n })\n })\n });\n });\n apiRef.current.forceUpdate();\n apiRef.current.publishEvent('rowExpansionChange', newNode);\n }, [apiRef]);\n const getRowNode = React.useCallback(id => {\n var _gridRowTreeSelector$;\n\n return (_gridRowTreeSelector$ = gridRowTreeSelector(apiRef)[id]) != null ? _gridRowTreeSelector$ : null;\n }, [apiRef]);\n const getRowGroupChildren = React.useCallback(({\n skipAutoGeneratedRows = true,\n groupId,\n applySorting,\n applyFiltering\n }) => {\n const tree = gridRowTreeSelector(apiRef);\n let children;\n\n if (applySorting) {\n const groupNode = tree[groupId];\n\n if (!groupNode) {\n return [];\n }\n\n const sortedRowIds = gridSortedRowIdsSelector(apiRef);\n children = [];\n const startIndex = sortedRowIds.findIndex(id => id === groupId) + 1;\n\n for (let index = startIndex; index < sortedRowIds.length && tree[sortedRowIds[index]].depth > groupNode.depth; index += 1) {\n const id = sortedRowIds[index];\n const node = tree[id];\n\n if (!skipAutoGeneratedRows || !node.isAutoGenerated) {\n children.push(id);\n }\n }\n } else {\n children = getTreeNodeDescendants(tree, groupId, skipAutoGeneratedRows);\n }\n\n if (applyFiltering) {\n const filteredRowsLookup = gridFilteredRowsLookupSelector(apiRef);\n children = children.filter(childId => filteredRowsLookup[childId] !== false);\n }\n\n return children;\n }, [apiRef]);\n const setRowIndex = React.useCallback((rowId, targetIndex) => {\n const allRows = gridRowIdsSelector(apiRef);\n const oldIndex = allRows.findIndex(row => row === rowId);\n\n if (oldIndex === -1 || oldIndex === targetIndex) {\n return;\n }\n\n logger.debug(`Moving row ${rowId} to index ${targetIndex}`);\n const updatedRows = [...allRows];\n updatedRows.splice(targetIndex, 0, updatedRows.splice(oldIndex, 1)[0]);\n apiRef.current.setState(state => _extends({}, state, {\n rows: _extends({}, state.rows, {\n ids: updatedRows\n })\n }));\n apiRef.current.applySorting();\n }, [apiRef, logger]);\n const rowApi = {\n getRow,\n getRowModels,\n getRowsCount,\n getAllRowIds,\n setRows,\n setRowIndex,\n updateRows,\n setRowChildrenExpansion,\n getRowNode,\n getRowIndexRelativeToVisibleRows,\n getRowGroupChildren\n };\n /**\n * EVENTS\n */\n\n const groupRows = React.useCallback(() => {\n logger.info(`Row grouping pre-processing have changed, regenerating the row tree`);\n let cache;\n\n if (apiRef.current.unstable_caches.rows.rowsBeforePartialUpdates === props.rows) {\n // The `props.rows` did not change since the last row grouping\n // We can use the current rows cache which contains the partial updates done recently.\n cache = apiRef.current.unstable_caches.rows;\n } else {\n // The `props.rows` has changed since the last row grouping\n // We must use the new `props.rows` on the new grouping\n // This occurs because this event is triggered before the `useEffect` on the rows when both the grouping pre-processing and the rows changes on the same render\n cache = createRowsInternalCache({\n rows: props.rows,\n getRowId: props.getRowId,\n loading: props.loading\n });\n }\n\n throttledRowsChange(cache, false);\n }, [logger, apiRef, props.rows, props.getRowId, props.loading, throttledRowsChange]);\n const handleStrategyProcessorChange = React.useCallback(methodName => {\n if (methodName === 'rowTreeCreation') {\n groupRows();\n }\n }, [groupRows]);\n const handleStrategyActivityChange = React.useCallback(() => {\n // `rowTreeCreation` is the only processor ran when `strategyAvailabilityChange` is fired.\n // All the other processors listen to `rowsSet` which will be published by the `groupRows` method below.\n if (apiRef.current.unstable_getActiveStrategy('rowTree') !== gridRowGroupingNameSelector(apiRef)) {\n groupRows();\n }\n }, [apiRef, groupRows]);\n useGridApiEventHandler(apiRef, 'activeStrategyProcessorChange', handleStrategyProcessorChange);\n useGridApiEventHandler(apiRef, 'strategyAvailabilityChange', handleStrategyActivityChange);\n /**\n * APPLIERS\n */\n\n const applyHydrateRowsProcessor = React.useCallback(() => {\n apiRef.current.setState(state => _extends({}, state, {\n rows: _extends({}, state.rows, apiRef.current.unstable_applyPipeProcessors('hydrateRows', state.rows.groupingResponseBeforeRowHydration))\n }));\n apiRef.current.publishEvent('rowsSet');\n apiRef.current.forceUpdate();\n }, [apiRef]);\n useGridRegisterPipeApplier(apiRef, 'hydrateRows', applyHydrateRowsProcessor);\n useGridApiMethod(apiRef, rowApi, 'GridRowApi');\n /**\n * EFFECTS\n */\n\n React.useEffect(() => {\n return () => {\n if (timeout.current !== null) {\n clearTimeout(timeout.current);\n }\n };\n }, []); // The effect do not track any value defined synchronously during the 1st render by hooks called after `useGridRows`\n // As a consequence, the state generated by the 1st run of this useEffect will always be equal to the initialization one\n\n const isFirstRender = React.useRef(true);\n React.useEffect(() => {\n if (isFirstRender.current) {\n isFirstRender.current = false;\n return;\n } // The new rows have already been applied (most likely in the `'rowGroupsPreProcessingChange'` listener)\n\n\n if (apiRef.current.unstable_caches.rows.rowsBeforePartialUpdates === props.rows && apiRef.current.unstable_caches.rows.loadingPropBeforePartialUpdates === props.loading) {\n return;\n }\n\n logger.debug(`Updating all rows, new length ${props.rows.length}`);\n throttledRowsChange(createRowsInternalCache({\n rows: props.rows,\n getRowId: props.getRowId,\n loading: props.loading\n }), false);\n }, [props.rows, props.rowCount, props.getRowId, props.loading, logger, throttledRowsChange, apiRef]);\n};","import { GRID_DEFAULT_STRATEGY, useGridRegisterStrategyProcessor } from '../../core/strategyProcessing';\n\nconst flatRowTreeCreationMethod = ({\n ids,\n idRowsLookup,\n idToIdLookup,\n previousTree\n}) => {\n const tree = {};\n\n for (let i = 0; i < ids.length; i += 1) {\n const rowId = ids[i];\n\n if (previousTree && previousTree[rowId]) {\n tree[rowId] = previousTree[rowId];\n } else {\n tree[rowId] = {\n id: rowId,\n depth: 0,\n parent: null,\n groupingKey: '',\n groupingField: null\n };\n }\n }\n\n return {\n groupingName: GRID_DEFAULT_STRATEGY,\n tree,\n treeDepth: 1,\n idRowsLookup,\n idToIdLookup,\n ids\n };\n};\n\nexport const useGridRowsPreProcessors = apiRef => {\n useGridRegisterStrategyProcessor(apiRef, GRID_DEFAULT_STRATEGY, 'rowTreeCreation', flatRowTreeCreationMethod);\n};","import { gridClasses } from '../constants/gridClasses';\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}\nexport function getRowEl(cell) {\n if (!cell) {\n return null;\n }\n\n return findParentElementFromClassName(cell, gridClasses.row);\n} // TODO remove\n\nexport function isGridCellRoot(elem) {\n return elem != null && elem.classList.contains(gridClasses.cell);\n}\nexport function isGridHeaderCellRoot(elem) {\n return elem != null && elem.classList.contains(gridClasses.columnHeader);\n}\n\nfunction escapeOperandAttributeSelector(operand) {\n return operand.replace(/[\"\\\\]/g, '\\\\$&');\n}\n\nexport function getGridColumnHeaderElement(root, field) {\n return root.querySelector(`[role=\"columnheader\"][data-field=\"${escapeOperandAttributeSelector(field)}\"]`);\n}\nexport function getGridRowElement(root, id) {\n return root.querySelector(`.${gridClasses.row}[data-id=\"${escapeOperandAttributeSelector(String(id))}\"]`);\n}\nexport function getGridCellElement(root, {\n id,\n field\n}) {\n const row = getGridRowElement(root, id);\n\n if (!row) {\n return null;\n }\n\n return row.querySelector(`.${gridClasses.cell}[data-field=\"${escapeOperandAttributeSelector(field)}\"]`);\n}","import * as React from 'react';\nimport { getGridCellElement, getGridColumnHeaderElement, getGridRowElement } from '../../../utils/domUtils';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { gridFocusCellSelector, gridTabIndexCellSelector } from '../focus/gridFocusStateSelector';\nimport { buildWarning } from '../../../utils/warning';\nlet warnedOnceMissingColumn = false;\n\nfunction warnMissingColumn(field) {\n console.warn([`MUI: You are calling getValue('${field}') but the column \\`${field}\\` is not defined.`, `Instead, you can access the data from \\`params.row.${field}\\`.`].join('\\n'));\n warnedOnceMissingColumn = true;\n}\n\nconst getCellValueWarning = buildWarning([`MUI: You are calling getValue. This method is deprecated and will be removed in the next major version.`, 'Instead, you can access the data from `params.row`.']);\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 */\n\nexport function useGridParamsApi(apiRef) {\n const getColumnHeaderParams = React.useCallback(field => ({\n field,\n colDef: apiRef.current.getColumn(field)\n }), [apiRef]);\n /**\n * We want to remove the `getValue` param from `getRowParams`, `getCellParams` and `getBaseCellParams`\n */\n\n const getCellValueWithDeprecationWarning = React.useCallback((...args) => {\n if (process.env.NODE_ENV !== 'production') {\n getCellValueWarning();\n }\n\n return apiRef.current.getCellValue(...args);\n }, [apiRef]);\n const getRowParams = React.useCallback(id => {\n const row = apiRef.current.getRow(id);\n\n if (!row) {\n throw new Error(`No row with id #${id} found`);\n }\n\n const params = {\n id,\n columns: apiRef.current.getAllColumns(),\n row,\n // TODO v6: remove\n getValue: getCellValueWithDeprecationWarning\n };\n return params;\n }, [apiRef, getCellValueWithDeprecationWarning]);\n const getBaseCellParams = React.useCallback((id, field) => {\n const row = apiRef.current.getRow(id);\n const rowNode = apiRef.current.getRowNode(id);\n\n if (!row || !rowNode) {\n throw new Error(`No row with id #${id} found`);\n }\n\n const cellFocus = gridFocusCellSelector(apiRef);\n const cellTabIndex = gridTabIndexCellSelector(apiRef);\n const params = {\n id,\n field,\n row,\n rowNode,\n value: row[field],\n colDef: apiRef.current.getColumn(field),\n cellMode: apiRef.current.getCellMode(id, field),\n // TODO v6: remove\n getValue: getCellValueWithDeprecationWarning,\n api: apiRef.current,\n hasFocus: cellFocus !== null && cellFocus.field === field && cellFocus.id === id,\n tabIndex: cellTabIndex && cellTabIndex.field === field && cellTabIndex.id === id ? 0 : -1\n };\n return params;\n }, [apiRef, getCellValueWithDeprecationWarning]);\n const getCellParams = React.useCallback((id, field) => {\n const colDef = apiRef.current.getColumn(field);\n const value = apiRef.current.getCellValue(id, field);\n const row = apiRef.current.getRow(id);\n const rowNode = apiRef.current.getRowNode(id);\n\n if (!row || !rowNode) {\n throw new Error(`No row with id #${id} found`);\n }\n\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 // TODO v6: remove\n getValue: getCellValueWithDeprecationWarning,\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 };\n\n if (colDef.valueFormatter) {\n params.formattedValue = colDef.valueFormatter({\n id,\n field: params.field,\n value: params.value,\n api: apiRef.current\n });\n }\n\n params.isEditable = colDef && apiRef.current.isCellEditable(params);\n return params;\n }, [apiRef, getCellValueWithDeprecationWarning]);\n const getCellValue = React.useCallback((id, field) => {\n const colDef = apiRef.current.getColumn(field);\n\n if (process.env.NODE_ENV !== 'production') {\n if (!colDef && !warnedOnceMissingColumn) {\n warnMissingColumn(field);\n }\n }\n\n if (!colDef || !colDef.valueGetter) {\n const rowModel = apiRef.current.getRow(id);\n\n if (!rowModel) {\n throw new Error(`No row with id #${id} found`);\n }\n\n return rowModel[field];\n }\n\n return colDef.valueGetter(getBaseCellParams(id, field));\n }, [apiRef, getBaseCellParams]);\n const getColumnHeaderElement = React.useCallback(field => {\n if (!apiRef.current.rootElementRef.current) {\n return null;\n }\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\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\n return getGridCellElement(apiRef.current.rootElementRef.current, {\n id,\n field\n });\n }, [apiRef]);\n const paramsApi = {\n getCellValue,\n getCellParams,\n getCellElement,\n getRowParams,\n getRowElement,\n getColumnHeaderParams,\n getColumnHeaderElement\n };\n useGridApiMethod(apiRef, paramsApi, 'GridParamsApi');\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridRowsLookupSelector } from '../rows/gridRowsSelector';\nimport { gridSelectionStateSelector, selectedGridRowsSelector, selectedIdsLookupSelector } from './gridSelectionSelector';\nimport { gridPaginatedVisibleSortedGridRowIdsSelector } from '../pagination';\nimport { gridFocusCellSelector } from '../focus/gridFocusStateSelector';\nimport { gridVisibleSortedRowIdsSelector } from '../filter/gridFilterSelector';\nimport { GRID_CHECKBOX_SELECTION_COL_DEF, GRID_ACTIONS_COLUMN_TYPE } from '../../../colDef';\nimport { GridCellModes } from '../../../models/gridEditRowModel';\nimport { isKeyboardEvent, isNavigationKey } from '../../../utils/keyboardUtils';\nimport { getVisibleRows, useGridVisibleRows } from '../../utils/useGridVisibleRows';\nimport { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPanelToggleField';\n\nconst getSelectionModelPropValue = (selectionModelProp, prevSelectionModel) => {\n if (selectionModelProp == null) {\n return selectionModelProp;\n }\n\n if (Array.isArray(selectionModelProp)) {\n return selectionModelProp;\n }\n\n if (prevSelectionModel && prevSelectionModel[0] === selectionModelProp) {\n return prevSelectionModel;\n }\n\n return [selectionModelProp];\n};\n\nexport const selectionStateInitializer = (state, props) => {\n var _getSelectionModelPro;\n\n return _extends({}, state, {\n selection: (_getSelectionModelPro = getSelectionModelPropValue(props.selectionModel)) != null ? _getSelectionModelPro : []\n });\n};\n/**\n * @requires useGridRows (state, method) - can be after\n * @requires useGridParamsApi (method) - can be after\n * @requires useGridFocus (state) - can be after\n * @requires useGridKeyboardNavigation (`cellKeyDown` event must first be consumed by it)\n */\n\nexport const useGridSelection = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridSelection');\n const propSelectionModel = React.useMemo(() => {\n return getSelectionModelPropValue(props.selectionModel, gridSelectionStateSelector(apiRef.current.state));\n }, [apiRef, props.selectionModel]);\n const lastRowToggled = React.useRef(null);\n apiRef.current.unstable_updateControlState({\n stateId: 'selection',\n propModel: propSelectionModel,\n propOnChange: props.onSelectionModelChange,\n stateSelector: gridSelectionStateSelector,\n changeEvent: 'selectionChange'\n });\n const {\n checkboxSelection,\n disableMultipleSelection,\n disableSelectionOnClick,\n isRowSelectable,\n pagination,\n paginationMode\n } = props;\n const canHaveMultipleSelection = !disableMultipleSelection || checkboxSelection;\n const visibleRows = useGridVisibleRows(apiRef, props);\n const expandMouseRowRangeSelection = React.useCallback(id => {\n var _lastRowToggled$curre;\n\n let endId = id;\n const startId = (_lastRowToggled$curre = lastRowToggled.current) != null ? _lastRowToggled$curre : id;\n const isSelected = apiRef.current.isRowSelected(id);\n\n if (isSelected) {\n const visibleRowIds = gridVisibleSortedRowIdsSelector(apiRef);\n const startIndex = visibleRowIds.findIndex(rowId => rowId === startId);\n const endIndex = visibleRowIds.findIndex(rowId => rowId === endId);\n\n if (startIndex === endIndex) {\n return;\n }\n\n if (startIndex > endIndex) {\n endId = visibleRowIds[endIndex + 1];\n } else {\n endId = visibleRowIds[endIndex - 1];\n }\n }\n\n lastRowToggled.current = id;\n apiRef.current.selectRowRange({\n startId,\n endId\n }, !isSelected);\n }, [apiRef]);\n /**\n * API METHODS\n */\n\n const setSelectionModel = React.useCallback(model => {\n const currentModel = gridSelectionStateSelector(apiRef.current.state);\n\n if (currentModel !== model) {\n logger.debug(`Setting selection model`);\n apiRef.current.setState(state => _extends({}, state, {\n selection: model\n }));\n apiRef.current.forceUpdate();\n }\n }, [apiRef, logger]);\n const isRowSelected = React.useCallback(id => gridSelectionStateSelector(apiRef.current.state).includes(id), [apiRef]);\n const getSelectedRows = React.useCallback(() => selectedGridRowsSelector(apiRef), [apiRef]);\n const selectRow = React.useCallback((id, isSelected = true, resetSelection = false) => {\n if (isRowSelectable && !isRowSelectable(apiRef.current.getRowParams(id))) {\n return;\n }\n\n lastRowToggled.current = id;\n\n if (resetSelection) {\n logger.debug(`Setting selection for row ${id}`);\n apiRef.current.setSelectionModel(isSelected ? [id] : []);\n } else {\n logger.debug(`Toggling selection for row ${id}`);\n const selection = gridSelectionStateSelector(apiRef.current.state);\n const newSelection = selection.filter(el => el !== id);\n\n if (isSelected) {\n newSelection.push(id);\n }\n\n const isSelectionValid = newSelection.length < 2 || canHaveMultipleSelection;\n\n if (isSelectionValid) {\n apiRef.current.setSelectionModel(newSelection);\n }\n }\n }, [apiRef, isRowSelectable, logger, canHaveMultipleSelection]);\n const selectRows = React.useCallback((ids, isSelected = true, resetSelection = false) => {\n logger.debug(`Setting selection for several rows`);\n const selectableIds = isRowSelectable ? ids.filter(id => isRowSelectable(apiRef.current.getRowParams(id))) : ids;\n let newSelection;\n\n if (resetSelection) {\n newSelection = isSelected ? selectableIds : [];\n } else {\n // We clone the existing object to avoid mutating the same object returned by the selector to others part of the project\n const selectionLookup = _extends({}, selectedIdsLookupSelector(apiRef));\n\n selectableIds.forEach(id => {\n if (isSelected) {\n selectionLookup[id] = id;\n } else {\n delete selectionLookup[id];\n }\n });\n newSelection = Object.values(selectionLookup);\n }\n\n const isSelectionValid = newSelection.length < 2 || canHaveMultipleSelection;\n\n if (isSelectionValid) {\n apiRef.current.setSelectionModel(newSelection);\n }\n }, [apiRef, isRowSelectable, logger, canHaveMultipleSelection]);\n const selectRowRange = React.useCallback(({\n startId,\n endId\n }, isSelected = true, resetSelection) => {\n if (!apiRef.current.getRow(startId) || !apiRef.current.getRow(endId)) {\n return;\n }\n\n logger.debug(`Expanding selection from row ${startId} to row ${endId}`); // Using rows from all pages allow to select a range across several pages\n\n const allPagesRowIds = gridVisibleSortedRowIdsSelector(apiRef);\n const startIndex = allPagesRowIds.indexOf(startId);\n const endIndex = allPagesRowIds.indexOf(endId);\n const [start, end] = startIndex > endIndex ? [endIndex, startIndex] : [startIndex, endIndex];\n const rowsBetweenStartAndEnd = allPagesRowIds.slice(start, end + 1);\n apiRef.current.selectRows(rowsBetweenStartAndEnd, isSelected, resetSelection);\n }, [apiRef, logger]);\n const selectionApi = {\n selectRow,\n selectRows,\n selectRowRange,\n setSelectionModel,\n getSelectedRows,\n isRowSelected\n };\n useGridApiMethod(apiRef, selectionApi, 'GridSelectionApi');\n /**\n * EVENTS\n */\n\n const removeOutdatedSelection = React.useCallback(() => {\n if (props.keepNonExistentRowsSelected) {\n return;\n }\n\n const currentSelection = gridSelectionStateSelector(apiRef.current.state);\n const rowsLookup = gridRowsLookupSelector(apiRef); // We clone the existing object to avoid mutating the same object returned by the selector to others part of the project\n\n const selectionLookup = _extends({}, selectedIdsLookupSelector(apiRef));\n\n let hasChanged = false;\n currentSelection.forEach(id => {\n if (!rowsLookup[id]) {\n delete selectionLookup[id];\n hasChanged = true;\n }\n });\n\n if (hasChanged) {\n apiRef.current.setSelectionModel(Object.values(selectionLookup));\n }\n }, [apiRef, props.keepNonExistentRowsSelected]);\n const handleSingleRowSelection = React.useCallback((id, event) => {\n const hasCtrlKey = event.metaKey || event.ctrlKey; // multiple selection is only allowed if:\n // - it is a checkboxSelection\n // - it is a keyboard selection\n // - Ctrl is pressed\n\n const isMultipleSelectionDisabled = !checkboxSelection && !hasCtrlKey && !isKeyboardEvent(event);\n const resetSelection = !canHaveMultipleSelection || isMultipleSelectionDisabled;\n const isSelected = apiRef.current.isRowSelected(id);\n\n if (resetSelection) {\n apiRef.current.selectRow(id, !isMultipleSelectionDisabled ? !isSelected : true, true);\n } else {\n apiRef.current.selectRow(id, !isSelected, false);\n }\n }, [apiRef, canHaveMultipleSelection, checkboxSelection]);\n const handleCellClick = React.useCallback((params, event) => {\n if (disableSelectionOnClick) {\n return;\n }\n\n if (params.field === GRID_CHECKBOX_SELECTION_COL_DEF.field) {\n // click on checkbox should not trigger row selection\n return;\n }\n\n if (params.field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {\n // click to open the detail panel should not select the row\n return;\n }\n\n if (params.field) {\n const column = apiRef.current.getColumn(params.field);\n\n if (column.type === GRID_ACTIONS_COLUMN_TYPE) {\n return;\n }\n }\n\n if (event.shiftKey && (canHaveMultipleSelection || checkboxSelection)) {\n expandMouseRowRangeSelection(params.id);\n } else {\n handleSingleRowSelection(params.id, event);\n }\n }, [disableSelectionOnClick, canHaveMultipleSelection, checkboxSelection, apiRef, expandMouseRowRangeSelection, handleSingleRowSelection]);\n const preventSelectionOnShift = React.useCallback((params, event) => {\n if (canHaveMultipleSelection && event.shiftKey) {\n var _window$getSelection;\n\n (_window$getSelection = window.getSelection()) == null ? void 0 : _window$getSelection.removeAllRanges();\n }\n }, [canHaveMultipleSelection]);\n const handleRowSelectionCheckboxChange = React.useCallback((params, event) => {\n if (event.nativeEvent.shiftKey) {\n expandMouseRowRangeSelection(params.id);\n } else {\n apiRef.current.selectRow(params.id, params.value);\n }\n }, [apiRef, expandMouseRowRangeSelection]);\n const handleHeaderSelectionCheckboxChange = React.useCallback(params => {\n const shouldLimitSelectionToCurrentPage = props.checkboxSelectionVisibleOnly && props.pagination;\n const rowsToBeSelected = shouldLimitSelectionToCurrentPage ? gridPaginatedVisibleSortedGridRowIdsSelector(apiRef) : gridVisibleSortedRowIdsSelector(apiRef);\n apiRef.current.selectRows(rowsToBeSelected, params.value);\n }, [apiRef, props.checkboxSelectionVisibleOnly, props.pagination]);\n const handleCellKeyDown = React.useCallback((params, event) => {\n // Get the most recent cell mode because it may have been changed by another listener\n if (apiRef.current.getCellMode(params.id, params.field) === GridCellModes.Edit) {\n return;\n } // Ignore portal\n // Do not apply shortcuts if the focus is not on the cell root component\n\n\n if (!event.currentTarget.contains(event.target)) {\n return;\n }\n\n if (isNavigationKey(event.key) && event.shiftKey) {\n // The cell that has focus after the keyboard navigation\n const focusCell = gridFocusCellSelector(apiRef);\n\n if (focusCell && focusCell.id !== params.id) {\n event.preventDefault();\n const isNextRowSelected = apiRef.current.isRowSelected(focusCell.id);\n\n if (!canHaveMultipleSelection) {\n apiRef.current.selectRow(focusCell.id, !isNextRowSelected, true);\n return;\n }\n\n const newRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(focusCell.id);\n const previousRowIndex = apiRef.current.getRowIndexRelativeToVisibleRows(params.id);\n let start;\n let end;\n\n if (newRowIndex > previousRowIndex) {\n if (isNextRowSelected) {\n // We are navigating to the bottom of the page and adding selected rows\n start = previousRowIndex;\n end = newRowIndex - 1;\n } else {\n // We are navigating to the bottom of the page and removing selected rows\n start = previousRowIndex;\n end = newRowIndex;\n }\n } else {\n // eslint-disable-next-line no-lonely-if\n if (isNextRowSelected) {\n // We are navigating to the top of the page and removing selected rows\n start = newRowIndex + 1;\n end = previousRowIndex;\n } else {\n // We are navigating to the top of the page and adding selected rows\n start = newRowIndex;\n end = previousRowIndex;\n }\n }\n\n const rowsBetweenStartAndEnd = visibleRows.rows.slice(start, end + 1).map(row => row.id);\n apiRef.current.selectRows(rowsBetweenStartAndEnd, !isNextRowSelected);\n return;\n }\n }\n\n if (event.key === ' ' && event.shiftKey) {\n event.preventDefault();\n handleSingleRowSelection(params.id, event);\n return;\n }\n\n if (event.key.toLowerCase() === 'a' && (event.ctrlKey || event.metaKey)) {\n event.preventDefault();\n selectRows(apiRef.current.getAllRowIds(), true);\n }\n }, [apiRef, handleSingleRowSelection, selectRows, visibleRows.rows, canHaveMultipleSelection]);\n useGridApiEventHandler(apiRef, 'sortedRowsSet', removeOutdatedSelection);\n useGridApiEventHandler(apiRef, 'cellClick', handleCellClick);\n useGridApiEventHandler(apiRef, 'rowSelectionCheckboxChange', handleRowSelectionCheckboxChange);\n useGridApiEventHandler(apiRef, 'headerSelectionCheckboxChange', handleHeaderSelectionCheckboxChange);\n useGridApiEventHandler(apiRef, 'cellMouseDown', preventSelectionOnShift);\n useGridApiEventHandler(apiRef, 'cellKeyDown', handleCellKeyDown);\n /**\n * EFFECTS\n */\n\n React.useEffect(() => {\n if (propSelectionModel !== undefined) {\n apiRef.current.setSelectionModel(propSelectionModel);\n }\n }, [apiRef, propSelectionModel]);\n const isStateControlled = propSelectionModel != null;\n React.useEffect(() => {\n if (isStateControlled) {\n return;\n } // isRowSelectable changed\n\n\n const currentSelection = gridSelectionStateSelector(apiRef.current.state);\n\n if (isRowSelectable) {\n const newSelection = currentSelection.filter(id => isRowSelectable(apiRef.current.getRowParams(id)));\n\n if (newSelection.length < currentSelection.length) {\n apiRef.current.setSelectionModel(newSelection);\n }\n }\n }, [apiRef, isRowSelectable, isStateControlled]);\n React.useEffect(() => {\n const currentSelection = gridSelectionStateSelector(apiRef.current.state);\n\n if (!canHaveMultipleSelection && currentSelection.length > 1) {\n const {\n rows: currentPageRows\n } = getVisibleRows(apiRef, {\n pagination,\n paginationMode\n });\n const currentPageRowsLookup = currentPageRows.reduce((acc, {\n id\n }) => {\n acc[id] = true;\n return acc;\n }, {});\n const firstSelectableRow = currentSelection.find(id => {\n let isSelectable = true;\n\n if (isRowSelectable) {\n isSelectable = isRowSelectable(apiRef.current.getRowParams(id));\n }\n\n return isSelectable && currentPageRowsLookup[id]; // Check if the row is in the current page\n });\n apiRef.current.setSelectionModel(firstSelectableRow !== undefined ? [firstSelectableRow] : []);\n }\n }, [apiRef, canHaveMultipleSelection, checkboxSelection, disableMultipleSelection, isRowSelectable, pagination, paginationMode]);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { unstable_composeClasses as composeClasses } from '@mui/material';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { getDataGridUtilityClass } from '../../../constants';\nimport { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../colDef';\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n return React.useMemo(() => {\n const slots = {\n cellCheckbox: ['cellCheckbox'],\n columnHeaderCheckbox: ['columnHeaderCheckbox']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n }, [classes]);\n};\n\nexport const useGridSelectionPreProcessors = (apiRef, props) => {\n const ownerState = {\n classes: props.classes\n };\n const classes = useUtilityClasses(ownerState);\n const updateSelectionColumn = React.useCallback(columnsState => {\n const selectionColumn = _extends({}, GRID_CHECKBOX_SELECTION_COL_DEF, {\n cellClassName: classes.cellCheckbox,\n headerClassName: classes.columnHeaderCheckbox,\n headerName: apiRef.current.getLocaleText('checkboxSelectionHeaderName')\n });\n\n const shouldHaveSelectionColumn = props.checkboxSelection;\n const haveSelectionColumn = columnsState.lookup[selectionColumn.field] != null;\n\n if (shouldHaveSelectionColumn && !haveSelectionColumn) {\n columnsState.lookup[selectionColumn.field] = selectionColumn;\n columnsState.all = [selectionColumn.field, ...columnsState.all];\n } else if (!shouldHaveSelectionColumn && haveSelectionColumn) {\n delete columnsState.lookup[selectionColumn.field];\n columnsState.all = columnsState.all.filter(field => field !== selectionColumn.field);\n }\n\n return columnsState;\n }, [apiRef, classes, props.checkboxSelection]);\n useGridRegisterPipeProcessor(apiRef, 'hydrateColumns', updateSelectionColumn);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { GridFeatureModeConstant } from '../../../models/gridFeatureMode';\nimport { isEnterKey } from '../../../utils/keyboardUtils';\nimport { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridColumnLookupSelector } from '../columns/gridColumnsSelector';\nimport { gridSortedRowEntriesSelector, gridSortedRowIdsSelector, gridSortModelSelector } from './gridSortingSelector';\nimport { gridRowIdsSelector, gridRowTreeSelector } from '../rows';\nimport { useFirstRender } from '../../utils/useFirstRender';\nimport { useGridRegisterStrategyProcessor, GRID_DEFAULT_STRATEGY } from '../../core/strategyProcessing';\nimport { buildAggregatedSortingApplier, mergeStateWithSortModel, getNextGridSortDirection, sanitizeSortModel } from './gridSortingUtils';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nexport const sortingStateInitializer = (state, props) => {\n var _ref, _props$sortModel, _props$initialState, _props$initialState$s;\n\n const sortModel = (_ref = (_props$sortModel = props.sortModel) != null ? _props$sortModel : (_props$initialState = props.initialState) == null ? void 0 : (_props$initialState$s = _props$initialState.sorting) == null ? void 0 : _props$initialState$s.sortModel) != null ? _ref : [];\n return _extends({}, state, {\n sorting: {\n sortModel: sanitizeSortModel(sortModel, props.disableMultipleColumnsSorting),\n sortedRows: []\n }\n });\n};\n/**\n * @requires useGridRows (event)\n * @requires useGridColumns (event)\n */\n\nexport const useGridSorting = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridSorting');\n apiRef.current.unstable_updateControlState({\n stateId: 'sortModel',\n propModel: props.sortModel,\n propOnChange: props.onSortModelChange,\n stateSelector: gridSortModelSelector,\n changeEvent: 'sortModelChange'\n });\n const upsertSortModel = React.useCallback((field, sortItem) => {\n const sortModel = gridSortModelSelector(apiRef);\n const existingIdx = sortModel.findIndex(c => c.field === field);\n let newSortModel = [...sortModel];\n\n if (existingIdx > -1) {\n if (!sortItem) {\n newSortModel.splice(existingIdx, 1);\n } else {\n newSortModel.splice(existingIdx, 1, sortItem);\n }\n } else {\n newSortModel = [...sortModel, sortItem];\n }\n\n return newSortModel;\n }, [apiRef]);\n const createSortItem = React.useCallback((col, directionOverride) => {\n var _col$sortingOrder2;\n\n const sortModel = gridSortModelSelector(apiRef);\n const existing = sortModel.find(c => c.field === col.field);\n\n if (existing) {\n var _col$sortingOrder;\n\n const nextSort = directionOverride === undefined ? getNextGridSortDirection((_col$sortingOrder = col.sortingOrder) != null ? _col$sortingOrder : props.sortingOrder, existing.sort) : directionOverride;\n return nextSort == null ? undefined : _extends({}, existing, {\n sort: nextSort\n });\n }\n\n return {\n field: col.field,\n sort: directionOverride === undefined ? getNextGridSortDirection((_col$sortingOrder2 = col.sortingOrder) != null ? _col$sortingOrder2 : props.sortingOrder) : directionOverride\n };\n }, [apiRef, props.sortingOrder]);\n /**\n * API METHODS\n */\n\n const applySorting = React.useCallback(() => {\n apiRef.current.setState(state => {\n if (props.sortingMode === GridFeatureModeConstant.server) {\n logger.debug('Skipping sorting rows as sortingMode = server');\n return _extends({}, state, {\n sorting: _extends({}, state.sorting, {\n sortedRows: gridRowIdsSelector(state, apiRef.current.instanceId)\n })\n });\n }\n\n const sortModel = gridSortModelSelector(state, apiRef.current.instanceId);\n const sortRowList = buildAggregatedSortingApplier(sortModel, apiRef);\n const sortedRows = apiRef.current.unstable_applyStrategyProcessor('sorting', {\n sortRowList\n });\n return _extends({}, state, {\n sorting: _extends({}, state.sorting, {\n sortedRows\n })\n });\n });\n apiRef.current.publishEvent('sortedRowsSet');\n apiRef.current.forceUpdate();\n }, [apiRef, logger, props.sortingMode]);\n const setSortModel = React.useCallback(model => {\n const currentModel = gridSortModelSelector(apiRef);\n\n if (currentModel !== model) {\n logger.debug(`Setting sort model`);\n apiRef.current.setState(mergeStateWithSortModel(model, props.disableMultipleColumnsSorting));\n apiRef.current.forceUpdate();\n apiRef.current.applySorting();\n }\n }, [apiRef, logger, props.disableMultipleColumnsSorting]);\n const sortColumn = React.useCallback((column, direction, allowMultipleSorting) => {\n if (!column.sortable) {\n return;\n }\n\n const sortItem = createSortItem(column, direction);\n let sortModel;\n\n if (!allowMultipleSorting || props.disableMultipleColumnsSorting) {\n sortModel = !sortItem ? [] : [sortItem];\n } else {\n sortModel = upsertSortModel(column.field, sortItem);\n }\n\n apiRef.current.setSortModel(sortModel);\n }, [apiRef, upsertSortModel, createSortItem, props.disableMultipleColumnsSorting]);\n const getSortModel = React.useCallback(() => gridSortModelSelector(apiRef), [apiRef]);\n const getSortedRows = React.useCallback(() => {\n const sortedRows = gridSortedRowEntriesSelector(apiRef);\n return sortedRows.map(row => row.model);\n }, [apiRef]);\n const getSortedRowIds = React.useCallback(() => gridSortedRowIdsSelector(apiRef), [apiRef]);\n const getRowIndex = React.useCallback(id => apiRef.current.getSortedRowIds().indexOf(id), [apiRef]);\n const getRowIdFromRowIndex = React.useCallback(index => apiRef.current.getSortedRowIds()[index], [apiRef]);\n const sortApi = {\n getSortModel,\n getSortedRows,\n getSortedRowIds,\n getRowIndex,\n getRowIdFromRowIndex,\n setSortModel,\n sortColumn,\n applySorting\n };\n useGridApiMethod(apiRef, sortApi, 'GridSortApi');\n /**\n * PRE-PROCESSING\n */\n\n const stateExportPreProcessing = React.useCallback(prevState => {\n const sortModelToExport = gridSortModelSelector(apiRef);\n\n if (sortModelToExport.length === 0) {\n return prevState;\n }\n\n return _extends({}, prevState, {\n sorting: {\n sortModel: sortModelToExport\n }\n });\n }, [apiRef]);\n const stateRestorePreProcessing = React.useCallback((params, context) => {\n var _context$stateToResto;\n\n const sortModel = (_context$stateToResto = context.stateToRestore.sorting) == null ? void 0 : _context$stateToResto.sortModel;\n\n if (sortModel == null) {\n return params;\n }\n\n apiRef.current.setState(mergeStateWithSortModel(sortModel, props.disableMultipleColumnsSorting));\n return _extends({}, params, {\n callbacks: [...params.callbacks, apiRef.current.applySorting]\n });\n }, [apiRef, props.disableMultipleColumnsSorting]);\n const flatSortingMethod = React.useCallback(params => {\n if (!params.sortRowList) {\n return gridRowIdsSelector(apiRef);\n }\n\n const rowTree = gridRowTreeSelector(apiRef);\n return params.sortRowList(Object.values(rowTree));\n }, [apiRef]);\n useGridRegisterPipeProcessor(apiRef, 'exportState', stateExportPreProcessing);\n useGridRegisterPipeProcessor(apiRef, 'restoreState', stateRestorePreProcessing);\n useGridRegisterStrategyProcessor(apiRef, GRID_DEFAULT_STRATEGY, 'sorting', flatSortingMethod);\n /**\n * EVENTS\n */\n\n const handleColumnHeaderClick = React.useCallback(({\n colDef\n }, event) => {\n const allowMultipleSorting = event.shiftKey || event.metaKey || event.ctrlKey;\n sortColumn(colDef, undefined, allowMultipleSorting);\n }, [sortColumn]);\n const handleColumnHeaderKeyDown = React.useCallback(({\n colDef\n }, event) => {\n // Ctrl + Enter opens the column menu\n if (isEnterKey(event.key) && !event.ctrlKey && !event.metaKey) {\n sortColumn(colDef, undefined, event.shiftKey);\n }\n }, [sortColumn]);\n const handleColumnsChange = React.useCallback(() => {\n // When the columns change we check that the sorted columns are still part of the dataset\n const sortModel = gridSortModelSelector(apiRef);\n const latestColumns = gridColumnLookupSelector(apiRef);\n\n if (sortModel.length > 0) {\n const newModel = sortModel.filter(sortItem => latestColumns[sortItem.field]);\n\n if (newModel.length < sortModel.length) {\n apiRef.current.setSortModel(newModel);\n }\n }\n }, [apiRef]);\n const handleStrategyProcessorChange = React.useCallback(methodName => {\n if (methodName === 'sorting') {\n apiRef.current.applySorting();\n }\n }, [apiRef]);\n useGridApiEventHandler(apiRef, 'columnHeaderClick', handleColumnHeaderClick);\n useGridApiEventHandler(apiRef, 'columnHeaderKeyDown', handleColumnHeaderKeyDown);\n useGridApiEventHandler(apiRef, 'rowsSet', apiRef.current.applySorting);\n useGridApiEventHandler(apiRef, 'columnsChange', handleColumnsChange);\n useGridApiEventHandler(apiRef, 'activeStrategyProcessorChange', handleStrategyProcessorChange);\n /**\n * 1ST RENDER\n */\n\n useFirstRender(() => {\n apiRef.current.applySorting();\n });\n /**\n * EFFECTS\n */\n\n React.useEffect(() => {\n if (props.sortModel !== undefined) {\n apiRef.current.setSortModel(props.sortModel);\n }\n }, [apiRef, props.sortModel]);\n};","import * as React from 'react';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridColumnPositionsSelector, gridVisibleColumnDefinitionsSelector } from '../columns/gridColumnsSelector';\nimport { useGridSelector } from '../../utils/useGridSelector';\nimport { gridPageSelector, gridPageSizeSelector } from '../pagination/gridPaginationSelector';\nimport { gridRowCountSelector } from '../rows/gridRowsSelector';\nimport { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { gridVisibleSortedRowEntriesSelector } from '../filter/gridFilterSelector'; // Logic copied from https://www.w3.org/TR/wai-aria-practices/examples/listbox/js/listbox.js\n// Similar to https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollIntoView\n\nfunction scrollIntoView(dimensions) {\n const {\n clientHeight,\n scrollTop,\n offsetHeight,\n offsetTop\n } = dimensions;\n const elementBottom = offsetTop + offsetHeight; // Always scroll to top when cell is higher than viewport to avoid scroll jump\n // See https://github.com/mui/mui-x/issues/4513 and https://github.com/mui/mui-x/issues/4514\n\n if (offsetHeight > clientHeight) {\n return offsetTop;\n }\n\n if (elementBottom - clientHeight > scrollTop) {\n return elementBottom - clientHeight;\n }\n\n if (offsetTop < scrollTop) {\n return offsetTop;\n }\n\n return undefined;\n}\n/**\n * @requires useGridPagination (state) - can be after, async only\n * @requires useGridColumns (state) - can be after, async only\n * @requires useGridRows (state) - can be after, async only\n * @requires useGridRowsMeta (state) - can be after, async only\n * @requires useGridFilter (state)\n * @requires useGridColumnSpanning (method)\n */\n\n\nexport const useGridScroll = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridScroll');\n const colRef = apiRef.current.columnHeadersElementRef;\n const windowRef = apiRef.current.windowRef;\n const visibleSortedRows = useGridSelector(apiRef, gridVisibleSortedRowEntriesSelector);\n const scrollToIndexes = React.useCallback(params => {\n const totalRowCount = gridRowCountSelector(apiRef);\n const visibleColumns = gridVisibleColumnDefinitionsSelector(apiRef);\n const scrollToHeader = params.rowIndex == null;\n\n if (!scrollToHeader && totalRowCount === 0 || visibleColumns.length === 0) {\n return false;\n }\n\n logger.debug(`Scrolling to cell at row ${params.rowIndex}, col: ${params.colIndex} `);\n let scrollCoordinates = {};\n\n if (params.colIndex != null) {\n const columnPositions = gridColumnPositionsSelector(apiRef);\n let cellWidth;\n\n if (typeof params.rowIndex !== 'undefined') {\n var _visibleSortedRows$pa;\n\n const rowId = (_visibleSortedRows$pa = visibleSortedRows[params.rowIndex]) == null ? void 0 : _visibleSortedRows$pa.id;\n const cellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, params.colIndex);\n\n if (cellColSpanInfo && !cellColSpanInfo.spannedByColSpan) {\n cellWidth = cellColSpanInfo.cellProps.width;\n }\n }\n\n if (typeof cellWidth === 'undefined') {\n cellWidth = visibleColumns[params.colIndex].computedWidth;\n }\n\n scrollCoordinates.left = scrollIntoView({\n clientHeight: windowRef.current.clientWidth,\n scrollTop: windowRef.current.scrollLeft,\n offsetHeight: cellWidth,\n offsetTop: columnPositions[params.colIndex]\n });\n }\n\n if (params.rowIndex != null) {\n const rowsMeta = gridRowsMetaSelector(apiRef.current.state);\n const page = gridPageSelector(apiRef);\n const pageSize = gridPageSizeSelector(apiRef);\n const elementIndex = !props.pagination ? params.rowIndex : params.rowIndex - page * pageSize;\n const targetOffsetHeight = rowsMeta.positions[elementIndex + 1] ? rowsMeta.positions[elementIndex + 1] - rowsMeta.positions[elementIndex] : rowsMeta.currentPageTotalHeight - rowsMeta.positions[elementIndex];\n scrollCoordinates.top = scrollIntoView({\n clientHeight: windowRef.current.clientHeight,\n scrollTop: windowRef.current.scrollTop,\n offsetHeight: targetOffsetHeight,\n offsetTop: rowsMeta.positions[elementIndex]\n });\n }\n\n scrollCoordinates = apiRef.current.unstable_applyPipeProcessors('scrollToIndexes', scrollCoordinates, params);\n\n if (typeof scrollCoordinates.left !== undefined || typeof scrollCoordinates.top !== undefined) {\n apiRef.current.scroll(scrollCoordinates);\n return true;\n }\n\n return false;\n }, [logger, apiRef, windowRef, props.pagination, visibleSortedRows]);\n const scroll = React.useCallback(params => {\n if (windowRef.current && params.left != null && colRef.current) {\n colRef.current.scrollLeft = params.left;\n windowRef.current.scrollLeft = params.left;\n logger.debug(`Scrolling left: ${params.left}`);\n }\n\n if (windowRef.current && params.top != null) {\n windowRef.current.scrollTop = params.top;\n logger.debug(`Scrolling top: ${params.top}`);\n }\n\n logger.debug(`Scrolling, updating container, and viewport`);\n }, [windowRef, colRef, logger]);\n const getScrollPosition = React.useCallback(() => {\n if (!(windowRef != null && windowRef.current)) {\n return {\n top: 0,\n left: 0\n };\n }\n\n return {\n top: windowRef.current.scrollTop,\n left: windowRef.current.scrollLeft\n };\n }, [windowRef]);\n const scrollApi = {\n scroll,\n scrollToIndexes,\n getScrollPosition\n };\n useGridApiMethod(apiRef, scrollApi, 'GridScrollApi');\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { useGridVisibleRows } from '../../utils/useGridVisibleRows';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridSelector } from '../../utils/useGridSelector';\nimport { gridDensityRowHeightSelector, gridDensityFactorSelector } from '../density/densitySelector';\nimport { gridFilterStateSelector } from '../filter/gridFilterSelector';\nimport { gridPaginationSelector } from '../pagination/gridPaginationSelector';\nimport { gridSortingStateSelector } from '../sorting/gridSortingSelector';\nimport { useGridRegisterPipeApplier } from '../../core/pipeProcessing';\nexport const rowsMetaStateInitializer = state => _extends({}, state, {\n rowsMeta: {\n currentPageTotalHeight: 0,\n positions: []\n }\n});\n/**\n * @requires useGridPageSize (method)\n * @requires useGridPage (method)\n */\n\nexport const useGridRowsMeta = (apiRef, props) => {\n const {\n getRowHeight,\n getRowSpacing\n } = props;\n const rowsHeightLookup = React.useRef({});\n const rowHeight = useGridSelector(apiRef, gridDensityRowHeightSelector);\n const filterState = useGridSelector(apiRef, gridFilterStateSelector);\n const paginationState = useGridSelector(apiRef, gridPaginationSelector);\n const sortingState = useGridSelector(apiRef, gridSortingStateSelector);\n const currentPage = useGridVisibleRows(apiRef, props);\n const hydrateRowsMeta = React.useCallback(() => {\n apiRef.current.setState(state => {\n const positions = [];\n const densityFactor = gridDensityFactorSelector(state, apiRef.current.instanceId);\n const currentRowHeight = gridDensityRowHeightSelector(state, apiRef.current.instanceId);\n const currentPageTotalHeight = currentPage.rows.reduce((acc, row) => {\n positions.push(acc);\n let baseRowHeight;\n const isResized = rowsHeightLookup.current[row.id] && rowsHeightLookup.current[row.id].isResized || false;\n\n if (isResized) {\n // do not recalculate resized row height and use the value from the lookup\n baseRowHeight = rowsHeightLookup.current[row.id].value;\n } else {\n baseRowHeight = currentRowHeight;\n\n if (getRowHeight) {\n var _getRowHeight;\n\n // Default back to base rowHeight if getRowHeight returns null or undefined.\n baseRowHeight = (_getRowHeight = getRowHeight(_extends({}, row, {\n densityFactor\n }))) != null ? _getRowHeight : currentRowHeight;\n }\n } // We use an object to make simple to check if a height is already added or not\n\n\n const initialHeights = {\n base: baseRowHeight\n };\n\n if (getRowSpacing) {\n var _spacing$top, _spacing$bottom;\n\n const indexRelativeToCurrentPage = apiRef.current.getRowIndexRelativeToVisibleRows(row.id);\n const spacing = getRowSpacing(_extends({}, row, {\n isFirstVisible: indexRelativeToCurrentPage === 0,\n isLastVisible: indexRelativeToCurrentPage === currentPage.rows.length - 1,\n indexRelativeToCurrentPage\n }));\n initialHeights.spacingTop = (_spacing$top = spacing.top) != null ? _spacing$top : 0;\n initialHeights.spacingBottom = (_spacing$bottom = spacing.bottom) != null ? _spacing$bottom : 0;\n }\n\n const sizes = apiRef.current.unstable_applyPipeProcessors('rowHeight', initialHeights, row);\n const finalRowHeight = Object.values(sizes).reduce((acc2, value) => acc2 + value, 0);\n rowsHeightLookup.current[row.id] = {\n value: baseRowHeight,\n sizes,\n isResized\n };\n return acc + finalRowHeight;\n }, 0);\n return _extends({}, state, {\n rowsMeta: {\n currentPageTotalHeight,\n positions\n }\n });\n });\n apiRef.current.forceUpdate();\n }, [apiRef, currentPage.rows, getRowSpacing, getRowHeight]);\n\n const getTargetRowHeight = rowId => {\n var _rowsHeightLookup$cur;\n\n return ((_rowsHeightLookup$cur = rowsHeightLookup.current[rowId]) == null ? void 0 : _rowsHeightLookup$cur.value) || rowHeight;\n };\n\n const getRowInternalSizes = rowId => {\n var _rowsHeightLookup$cur2;\n\n return (_rowsHeightLookup$cur2 = rowsHeightLookup.current[rowId]) == null ? void 0 : _rowsHeightLookup$cur2.sizes;\n };\n\n const setRowHeight = React.useCallback((id, height) => {\n rowsHeightLookup.current[id] = {\n value: height,\n isResized: true,\n sizes: _extends({}, rowsHeightLookup.current[id].sizes, {\n base: height\n })\n };\n hydrateRowsMeta();\n }, [hydrateRowsMeta]); // The effect is used to build the rows meta data - currentPageTotalHeight and positions.\n // Because of variable row height this is needed for the virtualization\n\n React.useEffect(() => {\n hydrateRowsMeta();\n }, [rowHeight, filterState, paginationState, sortingState, hydrateRowsMeta]);\n useGridRegisterPipeApplier(apiRef, 'rowHeight', hydrateRowsMeta);\n const rowsMetaApi = {\n unstable_getRowHeight: getTargetRowHeight,\n unstable_getRowInternalSizes: getRowInternalSizes,\n unstable_setRowHeight: setRowHeight\n };\n useGridApiMethod(apiRef, rowsMetaApi, 'GridRowsMetaApi');\n};","import { useGridInitialization } from '../hooks/core/useGridInitialization';\nimport { useGridInitializeState } from '../hooks/utils/useGridInitializeState';\nimport { useGridClipboard } from '../hooks/features/clipboard/useGridClipboard';\nimport { columnMenuStateInitializer, useGridColumnMenu } from '../hooks/features/columnMenu/useGridColumnMenu';\nimport { useGridColumns, columnsStateInitializer } from '../hooks/features/columns/useGridColumns';\nimport { densityStateInitializer, useGridDensity } from '../hooks/features/density/useGridDensity';\nimport { useGridCsvExport } from '../hooks/features/export/useGridCsvExport';\nimport { useGridPrintExport } from '../hooks/features/export/useGridPrintExport';\nimport { useGridFilter, filterStateInitializer } from '../hooks/features/filter/useGridFilter';\nimport { focusStateInitializer, useGridFocus } from '../hooks/features/focus/useGridFocus';\nimport { useGridKeyboardNavigation } from '../hooks/features/keyboardNavigation/useGridKeyboardNavigation';\nimport { useGridPagination, paginationStateInitializer } from '../hooks/features/pagination/useGridPagination';\nimport { useGridPreferencesPanel, preferencePanelStateInitializer } from '../hooks/features/preferencesPanel/useGridPreferencesPanel';\nimport { useGridEditing as useGridEditing_old, editingStateInitializer as editingStateInitializer_old } from '../hooks/features/editRows/useGridEditing.old';\nimport { useGridEditing as useGridEditing_new, editingStateInitializer as editingStateInitializer_new } from '../hooks/features/editRows/useGridEditing.new';\nimport { useGridRows, rowsStateInitializer } from '../hooks/features/rows/useGridRows';\nimport { useGridRowsPreProcessors } from '../hooks/features/rows/useGridRowsPreProcessors';\nimport { useGridParamsApi } from '../hooks/features/rows/useGridParamsApi';\nimport { selectionStateInitializer, useGridSelection } from '../hooks/features/selection/useGridSelection';\nimport { useGridSelectionPreProcessors } from '../hooks/features/selection/useGridSelectionPreProcessors';\nimport { useGridSorting, sortingStateInitializer } from '../hooks/features/sorting/useGridSorting';\nimport { useGridScroll } from '../hooks/features/scroll/useGridScroll';\nimport { useGridEvents } from '../hooks/features/events/useGridEvents';\nimport { useGridDimensions } from '../hooks/features/dimensions/useGridDimensions';\nimport { rowsMetaStateInitializer, useGridRowsMeta } from '../hooks/features/rows/useGridRowsMeta';\nimport { useGridStatePersistence } from '../hooks/features/statePersistence/useGridStatePersistence';\nimport { useGridColumnSpanning } from '../hooks/features/columns/useGridColumnSpanning';\nexport const useDataGridComponent = props => {\n var _props$experimentalFe, _props$experimentalFe2;\n\n const apiRef = useGridInitialization(undefined, props);\n /**\n * Register all pre-processors called during state initialization here.\n */\n\n useGridSelectionPreProcessors(apiRef, props);\n useGridRowsPreProcessors(apiRef);\n /**\n * Register all state initializers here.\n */\n\n useGridInitializeState(selectionStateInitializer, apiRef, props);\n useGridInitializeState(columnsStateInitializer, apiRef, props);\n useGridInitializeState(rowsStateInitializer, apiRef, props);\n useGridInitializeState((_props$experimentalFe = props.experimentalFeatures) != null && _props$experimentalFe.newEditingApi ? editingStateInitializer_new : editingStateInitializer_old, apiRef, props);\n useGridInitializeState(focusStateInitializer, apiRef, props);\n useGridInitializeState(sortingStateInitializer, apiRef, props);\n useGridInitializeState(preferencePanelStateInitializer, apiRef, props);\n useGridInitializeState(filterStateInitializer, apiRef, props);\n useGridInitializeState(densityStateInitializer, apiRef, props);\n useGridInitializeState(paginationStateInitializer, apiRef, props);\n useGridInitializeState(rowsMetaStateInitializer, apiRef, props);\n useGridInitializeState(columnMenuStateInitializer, apiRef, props);\n useGridKeyboardNavigation(apiRef, props);\n useGridSelection(apiRef, props);\n useGridColumns(apiRef, props);\n useGridRows(apiRef, props);\n useGridParamsApi(apiRef);\n useGridColumnSpanning(apiRef);\n const useGridEditing = (_props$experimentalFe2 = props.experimentalFeatures) != null && _props$experimentalFe2.newEditingApi ? useGridEditing_new : useGridEditing_old;\n useGridEditing(apiRef, props);\n useGridFocus(apiRef, props);\n useGridPreferencesPanel(apiRef);\n useGridFilter(apiRef, props);\n useGridSorting(apiRef, props);\n useGridDensity(apiRef, props);\n useGridPagination(apiRef, props);\n useGridRowsMeta(apiRef, props);\n useGridScroll(apiRef, props);\n useGridColumnMenu(apiRef);\n useGridCsvExport(apiRef);\n useGridPrintExport(apiRef, props);\n useGridClipboard(apiRef);\n useGridDimensions(apiRef, props);\n useGridEvents(apiRef, props);\n useGridStatePersistence(apiRef);\n return apiRef;\n};","import * as React from 'react';\nimport { gridVisibleColumnDefinitionsSelector } from '../columns/gridColumnsSelector';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';\nimport { gridVisibleSortedRowEntriesSelector } from '../filter/gridFilterSelector';\nimport { useGridVisibleRows } from '../../utils/useGridVisibleRows';\nimport { GRID_CHECKBOX_SELECTION_COL_DEF } from '../../../colDef/gridCheckboxSelectionColDef';\nimport { gridClasses } from '../../../constants/gridClasses';\nimport { GridCellModes } from '../../../models/gridEditRowModel';\nimport { isNavigationKey } from '../../../utils/keyboardUtils';\nimport { GRID_DETAIL_PANEL_TOGGLE_FIELD } from '../../../constants/gridDetailPanelToggleField';\n/**\n * @requires useGridSorting (method) - can be after\n * @requires useGridFilter (state) - can be after\n * @requires useGridColumns (state, method) - can be after\n * @requires useGridDimensions (method) - can be after\n * @requires useGridFocus (method) - can be after\n * @requires useGridScroll (method) - can be after\n * @requires useGridColumnSpanning (method) - can be after\n */\n\nexport const useGridKeyboardNavigation = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridKeyboardNavigation');\n const currentPage = useGridVisibleRows(apiRef, props);\n /**\n * @param {number} colIndex Index of the column to focus\n * @param {number} rowIndex index of the row to focus\n * @param {string} closestColumnToUse Which closest column cell to use when the cell is spanned by `colSpan`.\n */\n\n const goToCell = React.useCallback((colIndex, rowIndex, closestColumnToUse = 'left') => {\n var _visibleSortedRows$ro;\n\n const visibleSortedRows = gridVisibleSortedRowEntriesSelector(apiRef);\n const rowId = (_visibleSortedRows$ro = visibleSortedRows[rowIndex]) == null ? void 0 : _visibleSortedRows$ro.id;\n const nextCellColSpanInfo = apiRef.current.unstable_getCellColSpanInfo(rowId, colIndex);\n\n if (nextCellColSpanInfo && nextCellColSpanInfo.spannedByColSpan) {\n if (closestColumnToUse === 'left') {\n colIndex = nextCellColSpanInfo.leftVisibleCellIndex;\n } else if (closestColumnToUse === 'right') {\n colIndex = nextCellColSpanInfo.rightVisibleCellIndex;\n }\n }\n\n logger.debug(`Navigating to cell row ${rowIndex}, col ${colIndex}`);\n apiRef.current.scrollToIndexes({\n colIndex,\n rowIndex\n });\n const field = apiRef.current.getVisibleColumns()[colIndex].field;\n apiRef.current.setCellFocus(rowId, field);\n }, [apiRef, logger]);\n const goToHeader = React.useCallback((colIndex, event) => {\n logger.debug(`Navigating to header col ${colIndex}`);\n apiRef.current.scrollToIndexes({\n colIndex\n });\n const field = apiRef.current.getVisibleColumns()[colIndex].field;\n apiRef.current.setColumnHeaderFocus(field, event);\n }, [apiRef, logger]);\n const handleCellNavigationKeyDown = React.useCallback((params, event) => {\n const dimensions = apiRef.current.getRootDimensions();\n\n if (!currentPage.range || !dimensions) {\n return;\n }\n\n const viewportPageSize = apiRef.current.unstable_getViewportPageSize();\n const visibleSortedRows = gridVisibleSortedRowEntriesSelector(apiRef);\n const colIndexBefore = params.field ? apiRef.current.getColumnIndex(params.field) : 0;\n const rowIndexBefore = visibleSortedRows.findIndex(row => row.id === params.id);\n const firstRowIndexInPage = currentPage.range.firstRowIndex;\n const lastRowIndexInPage = currentPage.range.lastRowIndex;\n const firstColIndex = 0;\n const lastColIndex = gridVisibleColumnDefinitionsSelector(apiRef).length - 1;\n let shouldPreventDefault = true;\n\n switch (event.key) {\n case 'ArrowDown':\n case 'Enter':\n {\n // \"Enter\" is only triggered by the row / cell editing feature\n if (rowIndexBefore < lastRowIndexInPage) {\n goToCell(colIndexBefore, rowIndexBefore + 1);\n }\n\n break;\n }\n\n case 'ArrowUp':\n {\n if (rowIndexBefore > firstRowIndexInPage) {\n goToCell(colIndexBefore, rowIndexBefore - 1);\n } else {\n goToHeader(colIndexBefore, event);\n }\n\n break;\n }\n\n case 'ArrowRight':\n {\n if (colIndexBefore < lastColIndex) {\n goToCell(colIndexBefore + 1, rowIndexBefore, 'right');\n }\n\n break;\n }\n\n case 'ArrowLeft':\n {\n if (colIndexBefore > firstColIndex) {\n goToCell(colIndexBefore - 1, rowIndexBefore);\n }\n\n break;\n }\n\n case 'Tab':\n {\n // \"Tab\" is only triggered by the row / cell editing feature\n if (event.shiftKey && colIndexBefore > firstColIndex) {\n goToCell(colIndexBefore - 1, rowIndexBefore, 'left');\n } else if (!event.shiftKey && colIndexBefore < lastColIndex) {\n goToCell(colIndexBefore + 1, rowIndexBefore, 'right');\n }\n\n break;\n }\n\n case ' ':\n {\n const field = params.field;\n\n if (field === GRID_DETAIL_PANEL_TOGGLE_FIELD) {\n break;\n }\n\n const colDef = params.colDef;\n\n if (colDef && colDef.type === 'treeDataGroup') {\n break;\n }\n\n if (!event.shiftKey && rowIndexBefore < lastRowIndexInPage) {\n goToCell(colIndexBefore, Math.min(rowIndexBefore + viewportPageSize, lastRowIndexInPage));\n }\n\n break;\n }\n\n case 'PageDown':\n {\n if (rowIndexBefore < lastRowIndexInPage) {\n goToCell(colIndexBefore, Math.min(rowIndexBefore + viewportPageSize, lastRowIndexInPage));\n }\n\n break;\n }\n\n case 'PageUp':\n {\n // Go to the first row before going to header\n const nextRowIndex = Math.max(rowIndexBefore - viewportPageSize, firstRowIndexInPage);\n\n if (nextRowIndex !== rowIndexBefore && nextRowIndex >= firstRowIndexInPage) {\n goToCell(colIndexBefore, nextRowIndex);\n } else {\n goToHeader(colIndexBefore, event);\n }\n\n break;\n }\n\n case 'Home':\n {\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n goToCell(firstColIndex, firstRowIndexInPage);\n } else {\n goToCell(firstColIndex, rowIndexBefore);\n }\n\n break;\n }\n\n case 'End':\n {\n if (event.ctrlKey || event.metaKey || event.shiftKey) {\n goToCell(lastColIndex, lastRowIndexInPage);\n } else {\n goToCell(lastColIndex, rowIndexBefore);\n }\n\n break;\n }\n\n default:\n {\n shouldPreventDefault = false;\n }\n }\n\n if (shouldPreventDefault) {\n event.preventDefault();\n }\n }, [apiRef, currentPage, goToCell, goToHeader]);\n const handleColumnHeaderKeyDown = React.useCallback((params, event) => {\n var _currentPage$range$fi, _currentPage$range, _currentPage$range$la, _currentPage$range2;\n\n const headerTitleNode = event.currentTarget.querySelector(`.${gridClasses.columnHeaderTitleContainerContent}`);\n const isFromInsideContent = !!headerTitleNode && headerTitleNode.contains(event.target);\n\n if (isFromInsideContent && params.field !== GRID_CHECKBOX_SELECTION_COL_DEF.field) {\n // When focus is on a nested input, keyboard events have no effect to avoid conflicts with native events.\n // There is one exception for the checkBoxHeader\n return;\n }\n\n const dimensions = apiRef.current.getRootDimensions();\n\n if (!dimensions) {\n return;\n }\n\n const viewportPageSize = apiRef.current.unstable_getViewportPageSize();\n const colIndexBefore = params.field ? apiRef.current.getColumnIndex(params.field) : 0;\n const firstRowIndexInPage = (_currentPage$range$fi = (_currentPage$range = currentPage.range) == null ? void 0 : _currentPage$range.firstRowIndex) != null ? _currentPage$range$fi : null;\n const lastRowIndexInPage = (_currentPage$range$la = (_currentPage$range2 = currentPage.range) == null ? void 0 : _currentPage$range2.lastRowIndex) != null ? _currentPage$range$la : null;\n const firstColIndex = 0;\n const lastColIndex = gridVisibleColumnDefinitionsSelector(apiRef).length - 1;\n let shouldPreventDefault = true;\n\n switch (event.key) {\n case 'ArrowDown':\n {\n if (firstRowIndexInPage !== null) {\n goToCell(colIndexBefore, firstRowIndexInPage);\n }\n\n break;\n }\n\n case 'ArrowRight':\n {\n if (colIndexBefore < lastColIndex) {\n goToHeader(colIndexBefore + 1, event);\n }\n\n break;\n }\n\n case 'ArrowLeft':\n {\n if (colIndexBefore > firstColIndex) {\n goToHeader(colIndexBefore - 1, event);\n }\n\n break;\n }\n\n case 'PageDown':\n {\n if (firstRowIndexInPage !== null && lastRowIndexInPage !== null) {\n goToCell(colIndexBefore, Math.min(firstRowIndexInPage + viewportPageSize, lastRowIndexInPage));\n }\n\n break;\n }\n\n case 'Home':\n {\n goToHeader(firstColIndex, event);\n break;\n }\n\n case 'End':\n {\n goToHeader(lastColIndex, event);\n break;\n }\n\n case 'Enter':\n {\n if (event.ctrlKey || event.metaKey) {\n apiRef.current.toggleColumnMenu(params.field);\n }\n\n break;\n }\n\n case ' ':\n {\n // prevent Space event from scrolling\n break;\n }\n\n default:\n {\n shouldPreventDefault = false;\n }\n }\n\n if (shouldPreventDefault) {\n event.preventDefault();\n }\n }, [apiRef, currentPage, goToCell, goToHeader]);\n const handleCellKeyDown = React.useCallback((params, event) => {\n // Ignore portal\n if (!event.currentTarget.contains(event.target)) {\n return;\n } // Get the most recent params because the cell mode may have changed by another listener\n\n\n const cellParams = apiRef.current.getCellParams(params.id, params.field);\n\n if (cellParams.cellMode !== GridCellModes.Edit && isNavigationKey(event.key)) {\n apiRef.current.publishEvent('cellNavigationKeyDown', cellParams, event);\n }\n }, [apiRef]);\n useGridApiEventHandler(apiRef, 'cellNavigationKeyDown', handleCellNavigationKeyDown);\n useGridApiEventHandler(apiRef, 'columnHeaderKeyDown', handleColumnHeaderKeyDown);\n useGridApiEventHandler(apiRef, 'cellKeyDown', handleCellKeyDown);\n};","import React from 'react';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridApiEventHandler } from '../../utils/useGridApiEventHandler';\n\n/**\n * @requires useGridColumns (method, event)\n * @requires useGridParamsApi (method)\n */\nexport const useGridColumnSpanning = apiRef => {\n const lookup = React.useRef({});\n const setCellColSpanInfo = React.useCallback((rowId, columnIndex, cellColSpanInfo) => {\n const sizes = lookup.current;\n\n if (!sizes[rowId]) {\n sizes[rowId] = {};\n }\n\n sizes[rowId][columnIndex] = cellColSpanInfo;\n }, []);\n const getCellColSpanInfo = React.useCallback((rowId, columnIndex) => {\n var _lookup$current$rowId;\n\n return (_lookup$current$rowId = lookup.current[rowId]) == null ? void 0 : _lookup$current$rowId[columnIndex];\n }, []); // Calculate `colSpan` for the cell.\n\n const calculateCellColSpan = React.useCallback(params => {\n const {\n columnIndex,\n rowId,\n minFirstColumnIndex,\n maxLastColumnIndex\n } = params;\n const visibleColumns = apiRef.current.getVisibleColumns();\n const columnsLength = visibleColumns.length;\n const column = visibleColumns[columnIndex];\n const colSpan = typeof column.colSpan === 'function' ? column.colSpan(apiRef.current.getCellParams(rowId, column.field)) : column.colSpan;\n\n if (!colSpan || colSpan === 1) {\n setCellColSpanInfo(rowId, columnIndex, {\n spannedByColSpan: false,\n cellProps: {\n colSpan: 1,\n width: column.computedWidth\n }\n });\n return {\n colSpan: 1\n };\n }\n\n let width = column.computedWidth;\n\n for (let j = 1; j < colSpan; j += 1) {\n const nextColumnIndex = columnIndex + j; // Cells should be spanned only within their column section (left-pinned, right-pinned and unpinned).\n\n if (nextColumnIndex >= minFirstColumnIndex && nextColumnIndex < maxLastColumnIndex) {\n const nextColumn = visibleColumns[nextColumnIndex];\n width += nextColumn.computedWidth;\n setCellColSpanInfo(rowId, columnIndex + j, {\n spannedByColSpan: true,\n rightVisibleCellIndex: Math.min(columnIndex + colSpan, columnsLength - 1),\n leftVisibleCellIndex: columnIndex\n });\n }\n\n setCellColSpanInfo(rowId, columnIndex, {\n spannedByColSpan: false,\n cellProps: {\n colSpan,\n width\n }\n });\n }\n\n return {\n colSpan\n };\n }, [apiRef, setCellColSpanInfo]); // Calculate `colSpan` for each cell in the row\n\n const calculateColSpan = React.useCallback(({\n rowId,\n minFirstColumn,\n maxLastColumn\n }) => {\n for (let i = minFirstColumn; i < maxLastColumn; i += 1) {\n const cellProps = calculateCellColSpan({\n columnIndex: i,\n rowId,\n minFirstColumnIndex: minFirstColumn,\n maxLastColumnIndex: maxLastColumn\n });\n\n if (cellProps.colSpan > 1) {\n i += cellProps.colSpan - 1;\n }\n }\n }, [calculateCellColSpan]);\n const columnSpanningApi = {\n unstable_getCellColSpanInfo: getCellColSpanInfo,\n unstable_calculateColSpan: calculateColSpan\n };\n useGridApiMethod(apiRef, columnSpanningApi, 'GridColumnSpanningAPI');\n const handleColumnReorderChange = React.useCallback(() => {\n // `colSpan` needs to be recalculated after column reordering\n lookup.current = {};\n }, []);\n useGridApiEventHandler(apiRef, 'columnOrderChange', handleColumnReorderChange);\n};","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { ownerDocument } from '@mui/material/utils';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridVisibleRowCountSelector } from '../filter/gridFilterSelector';\nimport { gridColumnDefinitionsSelector, gridColumnVisibilityModelSelector } from '../columns/gridColumnsSelector';\nimport { gridDensityHeaderHeightSelector } from '../density/densitySelector';\nimport { gridClasses } from '../../../constants/gridClasses';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';\nimport { getColumnsToExport } from './utils';\nimport { useGridRegisterPipeProcessor } from '../../core/pipeProcessing';\nimport { GridPrintExportMenuItem } from '../../../components/toolbar/GridToolbarExport';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\n/**\n * @requires useGridColumns (state)\n * @requires useGridFilter (state)\n * @requires useGridSorting (state)\n * @requires useGridParamsApi (method)\n */\nexport const useGridPrintExport = (apiRef, props) => {\n const logger = useGridLogger(apiRef, 'useGridPrintExport');\n const doc = React.useRef(null);\n const previousGridState = React.useRef(null);\n const previousColumnVisibility = React.useRef({});\n React.useEffect(() => {\n doc.current = ownerDocument(apiRef.current.rootElementRef.current);\n }, [apiRef]); // Returns a promise because updateColumns triggers state update and\n // the new state needs to be in place before the grid can be sized correctly\n\n const updateGridColumnsForPrint = React.useCallback((fields, allColumns) => new Promise(resolve => {\n if (!fields && !allColumns) {\n resolve();\n return;\n }\n\n const exportedColumnFields = getColumnsToExport({\n apiRef,\n options: {\n fields,\n allColumns\n }\n }).map(column => column.field);\n const columns = gridColumnDefinitionsSelector(apiRef);\n const newColumnVisibilityModel = {};\n columns.forEach(column => {\n newColumnVisibilityModel[column.field] = exportedColumnFields.includes(column.field);\n });\n apiRef.current.setColumnVisibilityModel(newColumnVisibilityModel);\n resolve();\n }), [apiRef]);\n const buildPrintWindow = React.useCallback(title => {\n const iframeEl = document.createElement('iframe');\n iframeEl.id = 'grid-print-window'; // Without this 'onload' event won't fire in some browsers\n\n iframeEl.src = window.location.href;\n iframeEl.style.position = 'absolute';\n iframeEl.style.width = '0px';\n iframeEl.style.height = '0px';\n iframeEl.title = title || document.title;\n return iframeEl;\n }, []);\n const handlePrintWindowLoad = React.useCallback((printWindow, options) => {\n var _printWindow$contentW, _querySelector, _querySelector2;\n\n const normalizeOptions = _extends({\n copyStyles: true,\n hideToolbar: false,\n hideFooter: false\n }, options); // Some agents, such as IE11 and Enzyme (as of 2 Jun 2020) continuously call the\n // `onload` callback. This ensures that it is only called once.\n\n\n printWindow.onload = null;\n const printDoc = printWindow.contentDocument || ((_printWindow$contentW = printWindow.contentWindow) == null ? void 0 : _printWindow$contentW.document);\n\n if (!printDoc) {\n return;\n }\n\n const headerHeight = gridDensityHeaderHeightSelector(apiRef);\n const rowsMeta = gridRowsMetaSelector(apiRef.current.state);\n const gridRootElement = apiRef.current.rootElementRef.current;\n const gridClone = gridRootElement.cloneNode(true);\n const gridCloneViewport = gridClone.querySelector(`.${gridClasses.virtualScroller}`); // Expand the viewport window to prevent clipping\n\n gridCloneViewport.style.height = 'auto';\n gridCloneViewport.style.width = 'auto';\n gridCloneViewport.parentElement.style.width = 'auto';\n gridCloneViewport.parentElement.style.height = 'auto'; // Allow to overflow to not hide the border of the last row\n\n const gridMain = gridClone.querySelector(`.${gridClasses.main}`);\n gridMain.style.overflow = 'visible';\n const columnHeaders = gridClone.querySelector(`.${gridClasses.columnHeaders}`);\n const columnHeadersInner = columnHeaders.querySelector(`.${gridClasses.columnHeadersInner}`);\n columnHeadersInner.style.width = '100%';\n let gridToolbarElementHeight = ((_querySelector = gridRootElement.querySelector(`.${gridClasses.toolbarContainer}`)) == null ? void 0 : _querySelector.clientHeight) || 0;\n let gridFooterElementHeight = ((_querySelector2 = gridRootElement.querySelector(`.${gridClasses.footerContainer}`)) == null ? void 0 : _querySelector2.clientHeight) || 0;\n\n if (normalizeOptions.hideToolbar) {\n var _gridClone$querySelec;\n\n (_gridClone$querySelec = gridClone.querySelector(`.${gridClasses.toolbarContainer}`)) == null ? void 0 : _gridClone$querySelec.remove();\n gridToolbarElementHeight = 0;\n }\n\n if (normalizeOptions.hideFooter) {\n var _gridClone$querySelec2;\n\n (_gridClone$querySelec2 = gridClone.querySelector(`.${gridClasses.footerContainer}`)) == null ? void 0 : _gridClone$querySelec2.remove();\n gridFooterElementHeight = 0;\n } // Expand container height to accommodate all rows\n\n\n gridClone.style.height = `${rowsMeta.currentPageTotalHeight + headerHeight + gridToolbarElementHeight + gridFooterElementHeight}px`; // Remove all loaded elements from the current host\n\n printDoc.body.innerHTML = '';\n printDoc.body.appendChild(gridClone);\n const defaultPageStyle = typeof normalizeOptions.pageStyle === 'function' ? normalizeOptions.pageStyle() : normalizeOptions.pageStyle;\n\n if (typeof defaultPageStyle === 'string') {\n // TODO custom styles should always win\n const styleElement = printDoc.createElement('style');\n styleElement.appendChild(printDoc.createTextNode(defaultPageStyle));\n printDoc.head.appendChild(styleElement);\n }\n\n if (normalizeOptions.bodyClassName) {\n printDoc.body.classList.add(...normalizeOptions.bodyClassName.split(' '));\n }\n\n if (normalizeOptions.copyStyles) {\n const headStyleElements = doc.current.querySelectorAll(\"style, link[rel='stylesheet']\");\n\n for (let i = 0; i < headStyleElements.length; i += 1) {\n const node = headStyleElements[i];\n\n if (node.tagName === 'STYLE') {\n const newHeadStyleElements = printDoc.createElement(node.tagName);\n const sheet = node.sheet;\n\n if (sheet) {\n let styleCSS = ''; // NOTE: for-of is not supported by IE\n\n for (let j = 0; j < sheet.cssRules.length; j += 1) {\n if (typeof sheet.cssRules[j].cssText === 'string') {\n styleCSS += `${sheet.cssRules[j].cssText}\\r\\n`;\n }\n }\n\n newHeadStyleElements.appendChild(printDoc.createTextNode(styleCSS));\n printDoc.head.appendChild(newHeadStyleElements);\n }\n } else if (node.getAttribute('href')) {\n // If `href` tag is empty, avoid loading these links\n const newHeadStyleElements = printDoc.createElement(node.tagName);\n\n for (let j = 0; j < node.attributes.length; j += 1) {\n const attr = node.attributes[j];\n\n if (attr) {\n newHeadStyleElements.setAttribute(attr.nodeName, attr.nodeValue || '');\n }\n }\n\n printDoc.head.appendChild(newHeadStyleElements);\n }\n }\n } // Trigger print\n\n\n if (process.env.NODE_ENV !== 'test') {\n printWindow.contentWindow.print();\n }\n }, [apiRef, doc]);\n const handlePrintWindowAfterPrint = React.useCallback(printWindow => {\n var _previousGridState$cu, _previousGridState$cu2;\n\n // Remove the print iframe\n doc.current.body.removeChild(printWindow); // Revert grid to previous state\n\n apiRef.current.restoreState(previousGridState.current || {});\n\n if (!((_previousGridState$cu = previousGridState.current) != null && (_previousGridState$cu2 = _previousGridState$cu.columns) != null && _previousGridState$cu2.columnVisibilityModel)) {\n // if the apiRef.current.exportState(); did not exported the column visibility, we update it\n apiRef.current.setColumnVisibilityModel(previousColumnVisibility.current);\n }\n\n apiRef.current.unstable_enableVirtualization(); // Clear local state\n\n previousGridState.current = null;\n previousColumnVisibility.current = {};\n }, [apiRef]);\n const exportDataAsPrint = React.useCallback(async options => {\n logger.debug(`Export data as Print`);\n\n if (!apiRef.current.rootElementRef.current) {\n throw new Error('MUI: No grid root element available.');\n }\n\n previousGridState.current = apiRef.current.exportState(); // It appends that the visibility model is not exported, especially if columnVisibility is not controlled\n\n previousColumnVisibility.current = gridColumnVisibilityModelSelector(apiRef);\n\n if (props.pagination) {\n const visibleRowCount = gridVisibleRowCountSelector(apiRef);\n apiRef.current.setPageSize(visibleRowCount);\n }\n\n await updateGridColumnsForPrint(options == null ? void 0 : options.fields, options == null ? void 0 : options.allColumns);\n apiRef.current.unstable_disableVirtualization();\n const printWindow = buildPrintWindow(options == null ? void 0 : options.fileName);\n doc.current.body.appendChild(printWindow);\n\n if (process.env.NODE_ENV === 'test') {\n // In test env, run the all pipeline without waiting for loading\n handlePrintWindowLoad(printWindow, options);\n handlePrintWindowAfterPrint(printWindow);\n } else {\n printWindow.onload = () => handlePrintWindowLoad(printWindow, options);\n\n printWindow.contentWindow.onafterprint = () => handlePrintWindowAfterPrint(printWindow);\n }\n }, [props, logger, apiRef, buildPrintWindow, handlePrintWindowLoad, handlePrintWindowAfterPrint, updateGridColumnsForPrint]);\n const printExportApi = {\n exportDataAsPrint\n };\n useGridApiMethod(apiRef, printExportApi, 'GridPrintExportApi');\n /**\n * PRE-PROCESSING\n */\n\n const addExportMenuButtons = React.useCallback((initialValue, options) => {\n var _options$printOptions;\n\n if ((_options$printOptions = options.printOptions) != null && _options$printOptions.disableToolbarButton) {\n return initialValue;\n }\n\n return [...initialValue, {\n component: /*#__PURE__*/_jsx(GridPrintExportMenuItem, {\n options: options.printOptions\n }),\n componentName: 'printExport'\n }];\n }, []);\n useGridRegisterPipeProcessor(apiRef, 'exportMenu', addExportMenuButtons);\n};","import * as React from 'react';\nimport { debounce, ownerDocument, unstable_useEnhancedEffect as useEnhancedEffect } from '@mui/material/utils';\nimport { useGridApiEventHandler, useGridApiOptionHandler } from '../../utils/useGridApiEventHandler';\nimport { useGridApiMethod } from '../../utils/useGridApiMethod';\nimport { useGridLogger } from '../../utils/useGridLogger';\nimport { gridColumnsTotalWidthSelector } from '../columns';\nimport { gridDensityHeaderHeightSelector, gridDensityRowHeightSelector } from '../density';\nimport { useGridSelector } from '../../utils';\nimport { getVisibleRows } from '../../utils/useGridVisibleRows';\nimport { gridRowsMetaSelector } from '../rows/gridRowsMetaSelector';\nconst isTestEnvironment = process.env.NODE_ENV === 'test';\n\nconst hasScroll = ({\n content,\n container,\n scrollBarSize\n}) => {\n const hasScrollXIfNoYScrollBar = content.width > container.width;\n const hasScrollYIfNoXScrollBar = content.height > container.height;\n let hasScrollX = false;\n let hasScrollY = false;\n\n if (hasScrollXIfNoYScrollBar || hasScrollYIfNoXScrollBar) {\n hasScrollX = hasScrollXIfNoYScrollBar;\n hasScrollY = content.height + (hasScrollX ? scrollBarSize : 0) > container.height; // We recalculate the scroll x to consider the size of the y scrollbar.\n\n if (hasScrollY) {\n hasScrollX = content.width + scrollBarSize > container.width;\n }\n }\n\n return {\n hasScrollX,\n hasScrollY\n };\n};\n\nexport function useGridDimensions(apiRef, props) {\n const logger = useGridLogger(apiRef, 'useResizeContainer');\n const warningShown = React.useRef(false);\n const rootDimensionsRef = React.useRef(null);\n const fullDimensionsRef = React.useRef(null);\n const rowsMeta = useGridSelector(apiRef, gridRowsMetaSelector);\n const headerHeight = useGridSelector(apiRef, gridDensityHeaderHeightSelector);\n const updateGridDimensionsRef = React.useCallback(() => {\n var _apiRef$current$rootE;\n\n const rootElement = (_apiRef$current$rootE = apiRef.current.rootElementRef) == null ? void 0 : _apiRef$current$rootE.current;\n const columnsTotalWidth = gridColumnsTotalWidthSelector(apiRef);\n\n if (!rootDimensionsRef.current) {\n return;\n }\n\n let scrollBarSize;\n\n if (props.scrollbarSize != null) {\n scrollBarSize = props.scrollbarSize;\n } else if (!columnsTotalWidth || !rootElement) {\n scrollBarSize = 0;\n } else {\n const doc = ownerDocument(rootElement);\n const scrollDiv = doc.createElement('div');\n scrollDiv.style.width = '99px';\n scrollDiv.style.height = '99px';\n scrollDiv.style.position = 'absolute';\n scrollDiv.style.overflow = 'scroll';\n scrollDiv.className = 'scrollDiv';\n rootElement.appendChild(scrollDiv);\n scrollBarSize = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n rootElement.removeChild(scrollDiv);\n }\n\n const viewportOuterSize = {\n width: rootDimensionsRef.current.width,\n height: props.autoHeight ? rowsMeta.currentPageTotalHeight : rootDimensionsRef.current.height - headerHeight\n };\n const {\n hasScrollX,\n hasScrollY\n } = hasScroll({\n content: {\n width: Math.round(columnsTotalWidth),\n height: rowsMeta.currentPageTotalHeight\n },\n container: viewportOuterSize,\n scrollBarSize\n });\n const viewportInnerSize = {\n width: viewportOuterSize.width - (hasScrollY ? scrollBarSize : 0),\n height: viewportOuterSize.height - (hasScrollX ? scrollBarSize : 0)\n };\n const newFullDimensions = {\n viewportOuterSize,\n viewportInnerSize,\n hasScrollX,\n hasScrollY\n };\n const prevDimensions = fullDimensionsRef.current;\n fullDimensionsRef.current = newFullDimensions;\n\n if (newFullDimensions.viewportInnerSize.width !== (prevDimensions == null ? void 0 : prevDimensions.viewportInnerSize.width) || newFullDimensions.viewportInnerSize.height !== (prevDimensions == null ? void 0 : prevDimensions.viewportInnerSize.height)) {\n apiRef.current.publishEvent('viewportInnerSizeChange', newFullDimensions.viewportInnerSize);\n }\n }, [apiRef, props.scrollbarSize, props.autoHeight, headerHeight, rowsMeta.currentPageTotalHeight]);\n const resize = React.useCallback(() => {\n updateGridDimensionsRef();\n apiRef.current.publishEvent('debouncedResize', rootDimensionsRef.current);\n }, [apiRef, updateGridDimensionsRef]);\n const getRootDimensions = React.useCallback(() => fullDimensionsRef.current, []);\n const getViewportPageSize = React.useCallback(() => {\n const dimensions = apiRef.current.getRootDimensions();\n\n if (!dimensions) {\n return 0;\n }\n\n const currentPage = getVisibleRows(apiRef, {\n pagination: props.pagination,\n paginationMode: props.paginationMode\n }); // TODO: Use a combination of scrollTop, dimensions.viewportInnerSize.height and rowsMeta.possitions\n // to find out the maximum number of rows that can fit in the visible part of the grid\n\n if (props.getRowHeight) {\n const renderContext = apiRef.current.unstable_getRenderContext();\n const viewportPageSize = renderContext.lastRowIndex - renderContext.firstRowIndex;\n return Math.min(viewportPageSize - 1, currentPage.rows.length);\n }\n\n const maximumPageSizeWithoutScrollBar = Math.floor(dimensions.viewportInnerSize.height / gridDensityRowHeightSelector(apiRef));\n return Math.min(maximumPageSizeWithoutScrollBar, currentPage.rows.length);\n }, [apiRef, props.pagination, props.paginationMode, props.getRowHeight]);\n const dimensionsApi = {\n resize,\n getRootDimensions,\n unstable_getViewportPageSize: getViewportPageSize,\n unstable_updateGridDimensionsRef: updateGridDimensionsRef\n };\n useGridApiMethod(apiRef, dimensionsApi, 'GridDimensionsApi');\n const debounceResize = React.useMemo(() => debounce(resize, 60), [resize]);\n const isFirstSizing = React.useRef(true);\n const handleResize = React.useCallback(size => {\n rootDimensionsRef.current = size; // jsdom has no layout capabilities\n\n const isJSDOM = /jsdom/.test(window.navigator.userAgent);\n\n if (size.height === 0 && !warningShown.current && !props.autoHeight && !isJSDOM) {\n logger.warn(['The parent of the grid has an empty height.', 'You need to make sure the container has an intrinsic height.', 'The grid displays with a height of 0px.', '', 'You can find a solution in the docs:', 'https://mui.com/x/react-data-grid/layout/'].join('\\n'));\n warningShown.current = true;\n }\n\n if (size.width === 0 && !warningShown.current && !isJSDOM) {\n logger.warn(['The parent of the grid has an empty width.', 'You need to make sure the container has an intrinsic width.', 'The grid displays with a width of 0px.', '', 'You can find a solution in the docs:', 'https://mui.com/x/react-data-grid/layout/'].join('\\n'));\n warningShown.current = true;\n }\n\n if (isTestEnvironment) {\n // We don't need to debounce the resize for tests.\n resize();\n isFirstSizing.current = false;\n return;\n }\n\n if (isFirstSizing.current) {\n // We want to initialize the grid dimensions as soon as possible to avoid flickering\n resize();\n isFirstSizing.current = false;\n return;\n }\n\n debounceResize();\n }, [props.autoHeight, debounceResize, logger, resize]);\n useEnhancedEffect(() => updateGridDimensionsRef(), [updateGridDimensionsRef]);\n useGridApiOptionHandler(apiRef, 'sortedRowsSet', updateGridDimensionsRef);\n useGridApiOptionHandler(apiRef, 'pageChange', updateGridDimensionsRef);\n useGridApiOptionHandler(apiRef, 'pageSizeChange', updateGridDimensionsRef);\n useGridApiOptionHandler(apiRef, 'columnsChange', updateGridDimensionsRef);\n useGridApiEventHandler(apiRef, 'resize', handleResize);\n useGridApiOptionHandler(apiRef, 'debouncedResize', props.onResize);\n}","import { useGridApiOptionHandler } from '../../utils/useGridApiEventHandler';\n\n/**\n * @requires useGridFocus (event) - can be after, async only\n * @requires useGridColumns (event) - can be after, async only\n */\nexport function useGridEvents(apiRef, props) {\n useGridApiOptionHandler(apiRef, 'columnHeaderClick', props.onColumnHeaderClick);\n useGridApiOptionHandler(apiRef, 'columnHeaderDoubleClick', props.onColumnHeaderDoubleClick);\n useGridApiOptionHandler(apiRef, 'columnHeaderOver', props.onColumnHeaderOver);\n useGridApiOptionHandler(apiRef, 'columnHeaderOut', props.onColumnHeaderOut);\n useGridApiOptionHandler(apiRef, 'columnHeaderEnter', props.onColumnHeaderEnter);\n useGridApiOptionHandler(apiRef, 'columnHeaderLeave', props.onColumnHeaderLeave);\n useGridApiOptionHandler(apiRef, 'columnOrderChange', props.onColumnOrderChange);\n useGridApiOptionHandler(apiRef, 'cellClick', props.onCellClick);\n useGridApiOptionHandler(apiRef, 'cellDoubleClick', props.onCellDoubleClick);\n useGridApiOptionHandler(apiRef, 'cellKeyDown', props.onCellKeyDown);\n useGridApiOptionHandler(apiRef, 'cellFocusOut', props.onCellFocusOut);\n useGridApiOptionHandler(apiRef, 'preferencePanelClose', props.onPreferencePanelClose);\n useGridApiOptionHandler(apiRef, 'preferencePanelOpen', props.onPreferencePanelOpen);\n useGridApiOptionHandler(apiRef, 'rowDoubleClick', props.onRowDoubleClick);\n useGridApiOptionHandler(apiRef, 'rowClick', props.onRowClick);\n useGridApiOptionHandler(apiRef, 'componentError', props.onError);\n useGridApiOptionHandler(apiRef, 'stateChange', props.onStateChange);\n}","import * as React from 'react';\nimport { useGridApiMethod } from '../../utils';\nexport const useGridStatePersistence = apiRef => {\n const exportState = React.useCallback(() => {\n const stateToExport = apiRef.current.unstable_applyPipeProcessors('exportState', {});\n return stateToExport;\n }, [apiRef]);\n const restoreState = React.useCallback(stateToRestore => {\n const response = apiRef.current.unstable_applyPipeProcessors('restoreState', {\n callbacks: []\n }, {\n stateToRestore\n });\n response.callbacks.forEach(callback => {\n callback();\n });\n apiRef.current.forceUpdate();\n }, [apiRef]);\n const statePersistenceApi = {\n exportState,\n restoreState\n };\n useGridApiMethod(apiRef, statePersistenceApi, 'GridStatePersistenceApi');\n};","export const GRID_DEFAULT_LOCALE_TEXT = {\n // Root\n noRowsLabel: 'No rows',\n noResultsOverlayLabel: 'No results found.',\n errorOverlayDefaultLabel: 'An error occurred.',\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 panel text\n columnsPanelTextFieldLabel: 'Find column',\n columnsPanelTextFieldPlaceholder: 'Column title',\n columnsPanelDragIconLabel: 'Reorder column',\n columnsPanelShowAllButton: 'Show all',\n columnsPanelHideAllButton: 'Hide all',\n // Filter panel text\n filterPanelAddFilter: 'Add filter',\n filterPanelDeleteIconLabel: 'Delete',\n filterPanelLinkOperator: 'Logic operator',\n filterPanelOperators: 'Operator',\n // TODO v6: rename to filterPanelOperator\n filterPanelOperatorAnd: 'And',\n filterPanelOperatorOr: 'Or',\n filterPanelColumns: 'Columns',\n filterPanelInputLabel: 'Value',\n filterPanelInputPlaceholder: 'Filter value',\n // Filter operators text\n filterOperatorContains: 'contains',\n filterOperatorEquals: 'equals',\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 // Filter values text\n filterValueAny: 'any',\n filterValueTrue: 'true',\n filterValueFalse: 'false',\n // Column menu text\n columnMenuLabel: 'Menu',\n columnMenuShowColumns: 'Show columns',\n columnMenuFilter: 'Filter',\n columnMenuHideColumn: 'Hide',\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 expandDetailPanel: 'Expand',\n collapseDetailPanel: 'Collapse',\n // Used core components translation keys\n MuiTablePagination: {},\n // Row reordering text\n rowReorderingHeaderName: 'Row reordering'\n};","import { generateUtilityClass, generateUtilityClasses } from '@mui/base';\nexport function getSwitchUtilityClass(slot) {\n return generateUtilityClass('MuiSwitch', slot);\n}\nconst switchClasses = generateUtilityClasses('MuiSwitch', ['root', 'edgeStart', 'edgeEnd', 'switchBase', 'colorPrimary', 'colorSecondary', 'sizeSmall', 'sizeMedium', 'checked', 'disabled', 'input', 'thumb', 'track']);\nexport default switchClasses;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"align\", \"children\", \"colIndex\", \"colDef\", \"cellMode\", \"field\", \"formattedValue\", \"hasFocus\", \"height\", \"isEditable\", \"rowId\", \"tabIndex\", \"value\", \"width\", \"className\", \"showRightBorder\", \"extendRowFullWidth\", \"row\", \"colSpan\", \"onClick\", \"onDoubleClick\", \"onMouseDown\", \"onMouseUp\", \"onKeyDown\", \"onDragEnter\", \"onDragOver\"];\n\n/* eslint-disable jsx-a11y/no-noninteractive-element-interactions */\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { unstable_composeClasses as composeClasses } from '@mui/material';\nimport { ownerDocument, capitalize } from '@mui/material/utils';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { GridCellModes } from '../../models';\nimport { useGridApiContext } from '../../hooks/utils/useGridApiContext';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { gridFocusCellSelector } from '../../hooks/features/focus/gridFocusStateSelector';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n// Based on https://stackoverflow.com/a/59518678\nlet cachedSupportsPreventScroll;\n\nfunction doesSupportPreventScroll() {\n if (cachedSupportsPreventScroll === undefined) {\n document.createElement('div').focus({\n get preventScroll() {\n cachedSupportsPreventScroll = true;\n return false;\n }\n\n });\n }\n\n return cachedSupportsPreventScroll;\n}\n\nconst useUtilityClasses = ownerState => {\n const {\n align,\n showRightBorder,\n isEditable,\n classes\n } = ownerState;\n const slots = {\n root: ['cell', `cell--text${capitalize(align)}`, isEditable && 'cell--editable', showRightBorder && 'withBorder'],\n content: ['cellContent']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\n\nlet warnedOnce = false;\n\nfunction GridCell(props) {\n var _rootProps$experiment;\n\n const {\n align,\n children,\n colIndex,\n cellMode,\n field,\n formattedValue,\n hasFocus,\n height,\n isEditable,\n rowId,\n tabIndex,\n value,\n width,\n className,\n showRightBorder,\n colSpan,\n onClick,\n onDoubleClick,\n onMouseDown,\n onMouseUp,\n onKeyDown,\n onDragEnter,\n onDragOver\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const valueToRender = formattedValue == null ? value : formattedValue;\n const cellRef = React.useRef(null);\n const focusElementRef = React.useRef(null);\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const ownerState = {\n align,\n showRightBorder,\n isEditable,\n classes: rootProps.classes\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\n if (onMouseUp) {\n onMouseUp(event);\n }\n }, [apiRef, field, onMouseUp, rowId]);\n const publish = React.useCallback((eventName, propHandler) => event => {\n // Ignore portal\n if (!event.currentTarget.contains(event.target)) {\n return;\n } // The row might have been deleted during the click\n\n\n if (!apiRef.current.getRow(rowId)) {\n return;\n }\n\n const params = apiRef.current.getCellParams(rowId, field || '');\n apiRef.current.publishEvent(eventName, params, event);\n\n if (propHandler) {\n propHandler(event);\n }\n }, [apiRef, field, rowId]);\n const style = {\n minWidth: width,\n maxWidth: width,\n minHeight: height,\n maxHeight: height\n };\n React.useLayoutEffect(() => {\n if (!hasFocus || cellMode === GridCellModes.Edit) {\n return;\n }\n\n const doc = ownerDocument(apiRef.current.rootElementRef.current);\n\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\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 let handleFocus = other.onFocus;\n\n if (process.env.NODE_ENV === 'test' && (_rootProps$experiment = rootProps.experimentalFeatures) != null && _rootProps$experiment.warnIfFocusStateIsNotSynced) {\n handleFocus = event => {\n const focusedCell = gridFocusCellSelector(apiRef);\n\n if ((focusedCell == null ? void 0 : focusedCell.id) === rowId && focusedCell.field === field) {\n if (typeof other.onFocus === 'function') {\n other.onFocus(event);\n }\n\n return;\n }\n\n if (!warnedOnce) {\n console.warn([`MUI: The cell with id=${rowId} and field=${field} received focus.`, `According to the state, the focus should be at id=${focusedCell == null ? void 0 : focusedCell.id}, field=${focusedCell == null ? void 0 : 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\n const column = apiRef.current.getColumn(field);\n const managesOwnFocus = column.type === 'actions';\n\n const renderChildren = () => {\n if (children == null) {\n return /*#__PURE__*/_jsx(\"div\", {\n className: classes.content,\n children: valueToRender == null ? void 0 : valueToRender.toString()\n });\n }\n\n if ( /*#__PURE__*/React.isValidElement(children) && managesOwnFocus) {\n return /*#__PURE__*/React.cloneElement(children, {\n focusElementRef\n });\n }\n\n return children;\n };\n\n return /*#__PURE__*/_jsx(\"div\", _extends({\n ref: cellRef,\n className: clsx(className, classes.root),\n role: \"cell\",\n \"data-field\": field,\n \"data-colindex\": colIndex,\n \"aria-colindex\": colIndex + 1,\n \"aria-colspan\": colSpan,\n style: style,\n tabIndex: (cellMode === 'view' || !isEditable) && !managesOwnFocus ? tabIndex : -1,\n onClick: publish('cellClick', onClick),\n onDoubleClick: publish('cellDoubleClick', onDoubleClick),\n onMouseDown: publish('cellMouseDown', onMouseDown),\n onMouseUp: publishMouseUp('cellMouseUp'),\n onKeyDown: publish('cellKeyDown', onKeyDown),\n onDragEnter: publish('cellDragEnter', onDragEnter),\n onDragOver: publish('cellDragOver', onDragOver)\n }, other, {\n onFocus: handleFocus,\n children: renderChildren()\n }));\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n align: PropTypes.oneOf(['center', 'left', 'right']).isRequired,\n cellMode: PropTypes.oneOf(['edit', 'view']),\n children: PropTypes.node,\n className: PropTypes.string,\n colIndex: PropTypes.number.isRequired,\n colSpan: PropTypes.number,\n field: PropTypes.string.isRequired,\n formattedValue: PropTypes.any,\n hasFocus: PropTypes.bool,\n height: PropTypes.number.isRequired,\n isEditable: PropTypes.bool,\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 rowId: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,\n showRightBorder: PropTypes.bool,\n tabIndex: PropTypes.oneOf([-1, 0]).isRequired,\n value: PropTypes.any,\n width: PropTypes.number.isRequired\n} : void 0;\nexport { GridCell };","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"className\", \"color\", \"edge\", \"size\", \"sx\"];\n// @inheritedComponent IconButton\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { refType } from '@mui/utils';\nimport { unstable_composeClasses as composeClasses } from '@mui/base';\nimport { alpha, darken, lighten } from '@mui/system';\nimport capitalize from '../utils/capitalize';\nimport SwitchBase from '../internal/SwitchBase';\nimport useThemeProps from '../styles/useThemeProps';\nimport styled from '../styles/styled';\nimport switchClasses, { getSwitchUtilityClass } from './switchClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes,\n edge,\n size,\n color,\n checked,\n disabled\n } = ownerState;\n const slots = {\n root: ['root', edge && `edge${capitalize(edge)}`, `size${capitalize(size)}`],\n switchBase: ['switchBase', `color${capitalize(color)}`, checked && 'checked', disabled && 'disabled'],\n thumb: ['thumb'],\n track: ['track'],\n input: ['input']\n };\n const composedClasses = composeClasses(slots, getSwitchUtilityClass, classes);\n return _extends({}, classes, composedClasses);\n};\n\nconst SwitchRoot = styled('span', {\n name: 'MuiSwitch',\n slot: 'Root',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.root, ownerState.edge && styles[`edge${capitalize(ownerState.edge)}`], styles[`size${capitalize(ownerState.size)}`]];\n }\n})(({\n ownerState\n}) => _extends({\n display: 'inline-flex',\n width: 34 + 12 * 2,\n height: 14 + 12 * 2,\n overflow: 'hidden',\n padding: 12,\n boxSizing: 'border-box',\n position: 'relative',\n flexShrink: 0,\n zIndex: 0,\n // Reset the stacking context.\n verticalAlign: 'middle',\n // For correct alignment with the text.\n '@media print': {\n colorAdjust: 'exact'\n }\n}, ownerState.edge === 'start' && {\n marginLeft: -8\n}, ownerState.edge === 'end' && {\n marginRight: -8\n}, ownerState.size === 'small' && {\n width: 40,\n height: 24,\n padding: 7,\n [`& .${switchClasses.thumb}`]: {\n width: 16,\n height: 16\n },\n [`& .${switchClasses.switchBase}`]: {\n padding: 4,\n [`&.${switchClasses.checked}`]: {\n transform: 'translateX(16px)'\n }\n }\n}));\nconst SwitchSwitchBase = styled(SwitchBase, {\n name: 'MuiSwitch',\n slot: 'SwitchBase',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.switchBase, {\n [`& .${switchClasses.input}`]: styles.input\n }, ownerState.color !== 'default' && styles[`color${capitalize(ownerState.color)}`]];\n }\n})(({\n theme\n}) => ({\n position: 'absolute',\n top: 0,\n left: 0,\n zIndex: 1,\n // Render above the focus ripple.\n color: theme.palette.mode === 'light' ? theme.palette.common.white : theme.palette.grey[300],\n transition: theme.transitions.create(['left', 'transform'], {\n duration: theme.transitions.duration.shortest\n }),\n [`&.${switchClasses.checked}`]: {\n transform: 'translateX(20px)'\n },\n [`&.${switchClasses.disabled}`]: {\n color: theme.palette.mode === 'light' ? theme.palette.grey[100] : theme.palette.grey[600]\n },\n [`&.${switchClasses.checked} + .${switchClasses.track}`]: {\n opacity: 0.5\n },\n [`&.${switchClasses.disabled} + .${switchClasses.track}`]: {\n opacity: theme.palette.mode === 'light' ? 0.12 : 0.2\n },\n [`& .${switchClasses.input}`]: {\n left: '-100%',\n width: '300%'\n }\n}), ({\n theme,\n ownerState\n}) => _extends({\n '&:hover': {\n backgroundColor: alpha(theme.palette.action.active, theme.palette.action.hoverOpacity),\n // Reset on touch devices, it doesn't add specificity\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n }\n}, ownerState.color !== 'default' && {\n [`&.${switchClasses.checked}`]: {\n color: theme.palette[ownerState.color].main,\n '&:hover': {\n backgroundColor: alpha(theme.palette[ownerState.color].main, theme.palette.action.hoverOpacity),\n '@media (hover: none)': {\n backgroundColor: 'transparent'\n }\n },\n [`&.${switchClasses.disabled}`]: {\n color: theme.palette.mode === 'light' ? lighten(theme.palette[ownerState.color].main, 0.62) : darken(theme.palette[ownerState.color].main, 0.55)\n }\n },\n [`&.${switchClasses.checked} + .${switchClasses.track}`]: {\n backgroundColor: theme.palette[ownerState.color].main\n }\n}));\nconst SwitchTrack = styled('span', {\n name: 'MuiSwitch',\n slot: 'Track',\n overridesResolver: (props, styles) => styles.track\n})(({\n theme\n}) => ({\n height: '100%',\n width: '100%',\n borderRadius: 14 / 2,\n zIndex: -1,\n transition: theme.transitions.create(['opacity', 'background-color'], {\n duration: theme.transitions.duration.shortest\n }),\n backgroundColor: theme.palette.mode === 'light' ? theme.palette.common.black : theme.palette.common.white,\n opacity: theme.palette.mode === 'light' ? 0.38 : 0.3\n}));\nconst SwitchThumb = styled('span', {\n name: 'MuiSwitch',\n slot: 'Thumb',\n overridesResolver: (props, styles) => styles.thumb\n})(({\n theme\n}) => ({\n boxShadow: theme.shadows[1],\n backgroundColor: 'currentColor',\n width: 20,\n height: 20,\n borderRadius: '50%'\n}));\nconst Switch = /*#__PURE__*/React.forwardRef(function Switch(inProps, ref) {\n const props = useThemeProps({\n props: inProps,\n name: 'MuiSwitch'\n });\n\n const {\n className,\n color = 'primary',\n edge = false,\n size = 'medium',\n sx\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const ownerState = _extends({}, props, {\n color,\n edge,\n size\n });\n\n const classes = useUtilityClasses(ownerState);\n\n const icon = /*#__PURE__*/_jsx(SwitchThumb, {\n className: classes.thumb,\n ownerState: ownerState\n });\n\n return /*#__PURE__*/_jsxs(SwitchRoot, {\n className: clsx(classes.root, className),\n sx: sx,\n ownerState: ownerState,\n children: [/*#__PURE__*/_jsx(SwitchSwitchBase, _extends({\n type: \"checkbox\",\n icon: icon,\n checkedIcon: icon,\n ref: ref,\n ownerState: ownerState\n }, other, {\n classes: _extends({}, classes, {\n root: classes.switchBase\n })\n })), /*#__PURE__*/_jsx(SwitchTrack, {\n className: classes.track,\n ownerState: ownerState\n })]\n });\n});\nprocess.env.NODE_ENV !== \"production\" ? Switch.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * If `true`, the component is checked.\n */\n checked: PropTypes.bool,\n\n /**\n * The icon to display when the component is checked.\n */\n checkedIcon: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).\n * @default 'primary'\n */\n color: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),\n\n /**\n * The default checked state. Use when the component is not controlled.\n */\n defaultChecked: PropTypes.bool,\n\n /**\n * If `true`, the component is disabled.\n */\n disabled: PropTypes.bool,\n\n /**\n * If `true`, the ripple effect is disabled.\n */\n disableRipple: PropTypes.bool,\n\n /**\n * If given, uses a negative margin to counteract the padding on one\n * side (this is often helpful for aligning the left or right\n * side of the icon with content above or below, without ruining the border\n * size and shape).\n * @default false\n */\n edge: PropTypes.oneOf(['end', 'start', false]),\n\n /**\n * The icon to display when the component is unchecked.\n */\n icon: PropTypes.node,\n\n /**\n * The id of the `input` element.\n */\n id: PropTypes.string,\n\n /**\n * [Attributes](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input#Attributes) applied to the `input` element.\n */\n inputProps: PropTypes.object,\n\n /**\n * Pass a ref to the `input` element.\n */\n inputRef: refType,\n\n /**\n * Callback fired when the state is changed.\n *\n * @param {React.ChangeEvent} event The event source of the callback.\n * You can pull out the new value by accessing `event.target.value` (string).\n * You can pull out the new checked state by accessing `event.target.checked` (boolean).\n */\n onChange: PropTypes.func,\n\n /**\n * If `true`, the `input` element is required.\n */\n required: PropTypes.bool,\n\n /**\n * The size of the component.\n * `small` is equivalent to the dense switch styling.\n * @default 'medium'\n */\n size: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.oneOf(['medium', 'small']), PropTypes.string]),\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\n /**\n * The value of the component. The DOM API casts this to a string.\n * The browser uses \"on\" as the default value.\n */\n value: PropTypes.any\n} : void 0;\nexport default Switch;","import * as React from 'react';\n\nconst usePreviousProps = value => {\n const ref = React.useRef({});\n React.useEffect(() => {\n ref.current = value;\n });\n return ref.current;\n};\n\nexport default usePreviousProps;","import generateUtilityClasses from '../generateUtilityClasses';\nimport generateUtilityClass from '../generateUtilityClass';\nexport function getBadgeUnstyledUtilityClass(slot) {\n return generateUtilityClass('BaseBadge', slot);\n}\nconst badgeUnstyledClasses = generateUtilityClasses('BaseBadge', ['root', 'badge', 'invisible']);\nexport default badgeUnstyledClasses;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"badgeContent\", \"component\", \"children\", \"className\", \"components\", \"componentsProps\", \"invisible\", \"max\", \"showZero\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport composeClasses from '../composeClasses';\nimport appendOwnerState from '../utils/appendOwnerState';\nimport useBadge from './useBadge';\nimport { getBadgeUnstyledUtilityClass } from './badgeUnstyledClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n invisible\n } = ownerState;\n const slots = {\n root: ['root'],\n badge: ['badge', invisible && 'invisible']\n };\n return composeClasses(slots, getBadgeUnstyledUtilityClass, undefined);\n};\n\nconst BadgeUnstyled = /*#__PURE__*/React.forwardRef(function BadgeUnstyled(props, ref) {\n const {\n component,\n children,\n className,\n components = {},\n componentsProps = {},\n max: maxProp = 99,\n showZero = false\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const {\n badgeContent,\n max,\n displayValue,\n invisible\n } = useBadge(_extends({}, props, {\n max: maxProp\n }));\n\n const ownerState = _extends({}, props, {\n badgeContent,\n invisible,\n max,\n showZero\n });\n\n const classes = useUtilityClasses(ownerState);\n const Root = component || components.Root || 'span';\n const rootProps = appendOwnerState(Root, _extends({}, other, componentsProps.root), ownerState);\n const Badge = components.Badge || 'span';\n const badgeProps = appendOwnerState(Badge, componentsProps.badge, ownerState);\n return /*#__PURE__*/_jsxs(Root, _extends({}, rootProps, {\n ref: ref\n }, other, {\n className: clsx(classes.root, rootProps.className, className),\n children: [children, /*#__PURE__*/_jsx(Badge, _extends({}, badgeProps, {\n className: clsx(classes.badge, badgeProps.className),\n children: displayValue\n }))]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? BadgeUnstyled.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The content rendered within the badge.\n */\n badgeContent: PropTypes.node,\n\n /**\n * The badge will be added relative to this node.\n */\n children: PropTypes.node,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n\n /**\n * The components used for each slot inside the Badge.\n * Either a string to use a HTML element or a component.\n * @default {}\n */\n components: PropTypes.shape({\n Badge: PropTypes.elementType,\n Root: PropTypes.elementType\n }),\n\n /**\n * The props used for each slot inside the Badge.\n * @default {}\n */\n componentsProps: PropTypes.shape({\n badge: PropTypes.object,\n root: PropTypes.object\n }),\n\n /**\n * If `true`, the badge is invisible.\n * @default false\n */\n invisible: PropTypes.bool,\n\n /**\n * Max count to show.\n * @default 99\n */\n max: PropTypes.number,\n\n /**\n * Controls whether the badge is hidden when `badgeContent` is zero.\n * @default false\n */\n showZero: PropTypes.bool\n} : void 0;\nexport default BadgeUnstyled;","import { usePreviousProps } from '@mui/utils';\nexport default function useBadge(props) {\n const {\n badgeContent: badgeContentProp,\n invisible: invisibleProp = false,\n max: maxProp = 99,\n showZero = false\n } = props;\n const prevProps = usePreviousProps({\n badgeContent: badgeContentProp,\n max: maxProp\n });\n let invisible = invisibleProp;\n\n if (invisibleProp === false && badgeContentProp === 0 && !showZero) {\n invisible = true;\n }\n\n const {\n badgeContent,\n max = maxProp\n } = invisible ? prevProps : props;\n const displayValue = badgeContent && Number(badgeContent) > max ? `${max}+` : badgeContent;\n return {\n badgeContent,\n invisible,\n max,\n displayValue\n };\n}","import { isHostComponent } from '@mui/base';\n\nconst shouldSpreadAdditionalProps = Slot => {\n return !Slot || !isHostComponent(Slot);\n};\n\nexport default shouldSpreadAdditionalProps;","import generateUtilityClasses from '@mui/base/generateUtilityClasses';\nimport generateUtilityClass from '@mui/base/generateUtilityClass';\nexport function getBadgeUtilityClass(slot) {\n return generateUtilityClass('MuiBadge', slot);\n}\nconst badgeClasses = generateUtilityClasses('MuiBadge', ['root', 'badge', 'dot', 'standard', 'anchorOriginTopRight', 'anchorOriginBottomRight', 'anchorOriginTopLeft', 'anchorOriginBottomLeft', 'invisible', 'colorError', 'colorInfo', 'colorPrimary', 'colorSecondary', 'colorSuccess', 'colorWarning', 'overlapRectangular', 'overlapCircular', // TODO: v6 remove the overlap value from these class keys\n'anchorOriginTopLeftCircular', 'anchorOriginTopLeftRectangular', 'anchorOriginTopRightCircular', 'anchorOriginTopRightRectangular', 'anchorOriginBottomLeftCircular', 'anchorOriginBottomLeftRectangular', 'anchorOriginBottomRightCircular', 'anchorOriginBottomRightRectangular']);\nexport default badgeClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\nconst _excluded = [\"anchorOrigin\", \"className\", \"component\", \"components\", \"componentsProps\", \"overlap\", \"color\", \"invisible\", \"max\", \"badgeContent\", \"showZero\", \"variant\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { usePreviousProps } from '@mui/utils';\nimport composeClasses from '@mui/base/composeClasses';\nimport BadgeUnstyled from '@mui/base/BadgeUnstyled';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport shouldSpreadAdditionalProps from '../utils/shouldSpreadAdditionalProps';\nimport capitalize from '../utils/capitalize';\nimport badgeClasses, { getBadgeUtilityClass } from './badgeClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst RADIUS_STANDARD = 10;\nconst RADIUS_DOT = 4;\n\nconst useUtilityClasses = ownerState => {\n const {\n color,\n anchorOrigin,\n invisible,\n overlap,\n variant,\n classes = {}\n } = ownerState;\n const slots = {\n root: ['root'],\n badge: ['badge', variant, invisible && 'invisible', `anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}`, `anchorOrigin${capitalize(anchorOrigin.vertical)}${capitalize(anchorOrigin.horizontal)}${capitalize(overlap)}`, `overlap${capitalize(overlap)}`, color !== 'default' && `color${capitalize(color)}`]\n };\n return composeClasses(slots, getBadgeUtilityClass, classes);\n};\n\nconst BadgeRoot = styled('span', {\n name: 'MuiBadge',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})({\n position: 'relative',\n display: 'inline-flex',\n // For correct alignment with the text.\n verticalAlign: 'middle',\n flexShrink: 0\n});\nconst BadgeBadge = styled('span', {\n name: 'MuiBadge',\n slot: 'Badge',\n overridesResolver: (props, styles) => {\n const {\n ownerState\n } = props;\n return [styles.badge, styles[ownerState.variant], styles[`anchorOrigin${capitalize(ownerState.anchorOrigin.vertical)}${capitalize(ownerState.anchorOrigin.horizontal)}${capitalize(ownerState.overlap)}`], ownerState.color !== 'default' && styles[`color${capitalize(ownerState.color)}`], ownerState.invisible && styles.invisible];\n }\n})(({\n theme,\n ownerState\n}) => _extends({\n display: 'flex',\n flexDirection: 'row',\n flexWrap: 'wrap',\n justifyContent: 'center',\n alignContent: 'center',\n alignItems: 'center',\n position: 'absolute',\n boxSizing: 'border-box',\n fontFamily: theme.typography.fontFamily,\n fontWeight: theme.typography.fontWeightMedium,\n fontSize: theme.typography.pxToRem(12),\n minWidth: RADIUS_STANDARD * 2,\n lineHeight: 1,\n padding: '0 6px',\n height: RADIUS_STANDARD * 2,\n borderRadius: RADIUS_STANDARD,\n zIndex: 1,\n // Render the badge on top of potential ripples.\n transition: theme.transitions.create('transform', {\n easing: theme.transitions.easing.easeInOut,\n duration: theme.transitions.duration.enteringScreen\n })\n}, ownerState.color !== 'default' && {\n backgroundColor: (theme.vars || theme).palette[ownerState.color].main,\n color: (theme.vars || theme).palette[ownerState.color].contrastText\n}, ownerState.variant === 'dot' && {\n borderRadius: RADIUS_DOT,\n height: RADIUS_DOT * 2,\n minWidth: RADIUS_DOT * 2,\n padding: 0\n}, ownerState.anchorOrigin.vertical === 'top' && ownerState.anchorOrigin.horizontal === 'right' && ownerState.overlap === 'rectangular' && {\n top: 0,\n right: 0,\n transform: 'scale(1) translate(50%, -50%)',\n transformOrigin: '100% 0%',\n [`&.${badgeClasses.invisible}`]: {\n transform: 'scale(0) translate(50%, -50%)'\n }\n}, ownerState.anchorOrigin.vertical === 'bottom' && ownerState.anchorOrigin.horizontal === 'right' && ownerState.overlap === 'rectangular' && {\n bottom: 0,\n right: 0,\n transform: 'scale(1) translate(50%, 50%)',\n transformOrigin: '100% 100%',\n [`&.${badgeClasses.invisible}`]: {\n transform: 'scale(0) translate(50%, 50%)'\n }\n}, ownerState.anchorOrigin.vertical === 'top' && ownerState.anchorOrigin.horizontal === 'left' && ownerState.overlap === 'rectangular' && {\n top: 0,\n left: 0,\n transform: 'scale(1) translate(-50%, -50%)',\n transformOrigin: '0% 0%',\n [`&.${badgeClasses.invisible}`]: {\n transform: 'scale(0) translate(-50%, -50%)'\n }\n}, ownerState.anchorOrigin.vertical === 'bottom' && ownerState.anchorOrigin.horizontal === 'left' && ownerState.overlap === 'rectangular' && {\n bottom: 0,\n left: 0,\n transform: 'scale(1) translate(-50%, 50%)',\n transformOrigin: '0% 100%',\n [`&.${badgeClasses.invisible}`]: {\n transform: 'scale(0) translate(-50%, 50%)'\n }\n}, ownerState.anchorOrigin.vertical === 'top' && ownerState.anchorOrigin.horizontal === 'right' && ownerState.overlap === 'circular' && {\n top: '14%',\n right: '14%',\n transform: 'scale(1) translate(50%, -50%)',\n transformOrigin: '100% 0%',\n [`&.${badgeClasses.invisible}`]: {\n transform: 'scale(0) translate(50%, -50%)'\n }\n}, ownerState.anchorOrigin.vertical === 'bottom' && ownerState.anchorOrigin.horizontal === 'right' && ownerState.overlap === 'circular' && {\n bottom: '14%',\n right: '14%',\n transform: 'scale(1) translate(50%, 50%)',\n transformOrigin: '100% 100%',\n [`&.${badgeClasses.invisible}`]: {\n transform: 'scale(0) translate(50%, 50%)'\n }\n}, ownerState.anchorOrigin.vertical === 'top' && ownerState.anchorOrigin.horizontal === 'left' && ownerState.overlap === 'circular' && {\n top: '14%',\n left: '14%',\n transform: 'scale(1) translate(-50%, -50%)',\n transformOrigin: '0% 0%',\n [`&.${badgeClasses.invisible}`]: {\n transform: 'scale(0) translate(-50%, -50%)'\n }\n}, ownerState.anchorOrigin.vertical === 'bottom' && ownerState.anchorOrigin.horizontal === 'left' && ownerState.overlap === 'circular' && {\n bottom: '14%',\n left: '14%',\n transform: 'scale(1) translate(-50%, 50%)',\n transformOrigin: '0% 100%',\n [`&.${badgeClasses.invisible}`]: {\n transform: 'scale(0) translate(-50%, 50%)'\n }\n}, ownerState.invisible && {\n transition: theme.transitions.create('transform', {\n easing: theme.transitions.easing.easeInOut,\n duration: theme.transitions.duration.leavingScreen\n })\n}));\nconst Badge = /*#__PURE__*/React.forwardRef(function Badge(inProps, ref) {\n var _componentsProps$root, _componentsProps$root2, _componentsProps$badg, _componentsProps$badg2;\n\n const props = useThemeProps({\n props: inProps,\n name: 'MuiBadge'\n });\n\n const {\n anchorOrigin: anchorOriginProp = {\n vertical: 'top',\n horizontal: 'right'\n },\n className,\n component = 'span',\n components = {},\n componentsProps = {},\n overlap: overlapProp = 'rectangular',\n color: colorProp = 'default',\n invisible: invisibleProp = false,\n max,\n badgeContent: badgeContentProp,\n showZero = false,\n variant: variantProp = 'standard'\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const prevProps = usePreviousProps({\n anchorOrigin: anchorOriginProp,\n color: colorProp,\n overlap: overlapProp,\n variant: variantProp\n });\n let invisible = invisibleProp;\n\n if (invisibleProp === false && (badgeContentProp === 0 && !showZero || badgeContentProp == null && variantProp !== 'dot')) {\n invisible = true;\n }\n\n const {\n color = colorProp,\n overlap = overlapProp,\n anchorOrigin = anchorOriginProp,\n variant = variantProp\n } = invisible ? prevProps : props;\n\n const ownerState = _extends({}, props, {\n anchorOrigin,\n invisible,\n color,\n overlap,\n variant\n });\n\n const classes = useUtilityClasses(ownerState);\n let displayValue;\n\n if (variant !== 'dot') {\n displayValue = badgeContentProp && Number(badgeContentProp) > max ? `${max}+` : badgeContentProp;\n }\n\n return /*#__PURE__*/_jsx(BadgeUnstyled, _extends({\n invisible: invisibleProp,\n badgeContent: displayValue,\n showZero: showZero,\n max: max\n }, other, {\n components: _extends({\n Root: BadgeRoot,\n Badge: BadgeBadge\n }, components),\n className: clsx(className, classes.root, (_componentsProps$root = componentsProps.root) == null ? void 0 : _componentsProps$root.className),\n componentsProps: {\n root: _extends({}, componentsProps.root, shouldSpreadAdditionalProps(components.Root) && {\n as: component,\n ownerState: _extends({}, (_componentsProps$root2 = componentsProps.root) == null ? void 0 : _componentsProps$root2.ownerState, {\n anchorOrigin,\n color,\n overlap,\n variant\n })\n }),\n badge: _extends({}, componentsProps.badge, {\n className: clsx(classes.badge, (_componentsProps$badg = componentsProps.badge) == null ? void 0 : _componentsProps$badg.className)\n }, shouldSpreadAdditionalProps(components.Badge) && {\n ownerState: _extends({}, (_componentsProps$badg2 = componentsProps.badge) == null ? void 0 : _componentsProps$badg2.ownerState, {\n anchorOrigin,\n color,\n overlap,\n variant\n })\n })\n },\n ref: ref\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? Badge.propTypes\n/* remove-proptypes */\n= {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the d.ts file and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n\n /**\n * The anchor of the badge.\n * @default {\n * vertical: 'top',\n * horizontal: 'right',\n * }\n */\n anchorOrigin: PropTypes.shape({\n horizontal: PropTypes.oneOf(['left', 'right']).isRequired,\n vertical: PropTypes.oneOf(['bottom', 'top']).isRequired\n }),\n\n /**\n * The content rendered within the badge.\n */\n badgeContent: PropTypes.node,\n\n /**\n * The badge will be added relative to this node.\n */\n children: PropTypes.node,\n\n /**\n * Override or extend the styles applied to the component.\n */\n classes: PropTypes.object,\n\n /**\n * @ignore\n */\n className: PropTypes.string,\n\n /**\n * The color of the component.\n * It supports both default and custom theme colors, which can be added as shown in the\n * [palette customization guide](https://mui.com/material-ui/customization/palette/#adding-new-colors).\n * @default 'default'\n */\n color: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.oneOf(['default', 'primary', 'secondary', 'error', 'info', 'success', 'warning']), PropTypes.string]),\n\n /**\n * The component used for the root node.\n * Either a string to use a HTML element or a component.\n */\n component: PropTypes.elementType,\n\n /**\n * The components used for each slot inside the Badge.\n * Either a string to use a HTML element or a component.\n * @default {}\n */\n components: PropTypes.shape({\n Badge: PropTypes.elementType,\n Root: PropTypes.elementType\n }),\n\n /**\n * The props used for each slot inside the Badge.\n * @default {}\n */\n componentsProps: PropTypes.shape({\n badge: PropTypes.object,\n root: PropTypes.object\n }),\n\n /**\n * If `true`, the badge is invisible.\n * @default false\n */\n invisible: PropTypes.bool,\n\n /**\n * Max count to show.\n * @default 99\n */\n max: PropTypes.number,\n\n /**\n * Wrapped shape the badge should overlap.\n * @default 'rectangular'\n */\n overlap: PropTypes.oneOf(['circular', 'rectangular']),\n\n /**\n * Controls whether the badge is hidden when `badgeContent` is zero.\n * @default false\n */\n showZero: PropTypes.bool,\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\n /**\n * The variant to use.\n * @default 'standard'\n */\n variant: PropTypes\n /* @typescript-to-proptypes-ignore */\n .oneOfType([PropTypes.oneOf(['dot', 'standard']), PropTypes.string])\n} : void 0;\nexport default Badge;","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 { unstable_composeClasses as composeClasses } from '@mui/material';\nimport { styled } from '@mui/material/styles';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['iconButtonContainer']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\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\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes\n };\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(GridIconButtonContainerRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className)\n }, other));\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nconst _excluded = [\"hideMenu\", \"currentColumn\", \"open\", \"id\", \"labelledby\", \"className\", \"children\"];\nimport clsx from 'clsx';\nimport PropTypes from 'prop-types';\nimport * as React from 'react';\nimport MenuList from '@mui/material/MenuList';\nimport { isHideMenuKey, isTabKey } from '../../../utils/keyboardUtils';\nimport { gridClasses } from '../../../constants/gridClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GridColumnMenuContainer = /*#__PURE__*/React.forwardRef(function GridColumnMenuContainer(props, ref) {\n const {\n hideMenu,\n open,\n id,\n labelledby,\n className,\n children\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const handleListKeyDown = React.useCallback(event => {\n if (isTabKey(event.key)) {\n event.preventDefault();\n }\n\n if (isHideMenuKey(event.key)) {\n hideMenu(event);\n }\n }, [hideMenu]);\n return /*#__PURE__*/_jsx(MenuList, _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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n currentColumn: 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 _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\n\nvar _LastPageIcon, _FirstPageIcon, _KeyboardArrowRight, _KeyboardArrowLeft, _KeyboardArrowLeft2, _KeyboardArrowRight2, _FirstPageIcon2, _LastPageIcon2;\n\nconst _excluded = [\"backIconButtonProps\", \"count\", \"getItemAriaLabel\", \"nextIconButtonProps\", \"onPageChange\", \"page\", \"rowsPerPage\", \"showFirstButton\", \"showLastButton\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport KeyboardArrowLeft from '../internal/svg-icons/KeyboardArrowLeft';\nimport KeyboardArrowRight from '../internal/svg-icons/KeyboardArrowRight';\nimport useTheme from '../styles/useTheme';\nimport IconButton from '../IconButton';\nimport LastPageIcon from '../internal/svg-icons/LastPage';\nimport FirstPageIcon from '../internal/svg-icons/FirstPage';\n/**\n * @ignore - internal component.\n */\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst TablePaginationActions = /*#__PURE__*/React.forwardRef(function TablePaginationActions(props, ref) {\n const {\n backIconButtonProps,\n count,\n getItemAriaLabel,\n nextIconButtonProps,\n onPageChange,\n page,\n rowsPerPage,\n showFirstButton,\n showLastButton\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const theme = useTheme();\n\n const handleFirstPageButtonClick = event => {\n onPageChange(event, 0);\n };\n\n const handleBackButtonClick = event => {\n onPageChange(event, page - 1);\n };\n\n const handleNextButtonClick = event => {\n onPageChange(event, page + 1);\n };\n\n const handleLastPageButtonClick = event => {\n onPageChange(event, Math.max(0, Math.ceil(count / rowsPerPage) - 1));\n };\n\n return /*#__PURE__*/_jsxs(\"div\", _extends({\n ref: ref\n }, other, {\n children: [showFirstButton && /*#__PURE__*/_jsx(IconButton, {\n onClick: handleFirstPageButtonClick,\n disabled: page === 0,\n \"aria-label\": getItemAriaLabel('first', page),\n title: getItemAriaLabel('first', page),\n children: theme.direction === 'rtl' ? _LastPageIcon || (_LastPageIcon = /*#__PURE__*/_jsx(LastPageIcon, {})) : _FirstPageIcon || (_FirstPageIcon = /*#__PURE__*/_jsx(FirstPageIcon, {}))\n }), /*#__PURE__*/_jsx(IconButton, _extends({\n onClick: handleBackButtonClick,\n disabled: page === 0,\n color: \"inherit\",\n \"aria-label\": getItemAriaLabel('previous', page),\n title: getItemAriaLabel('previous', page)\n }, backIconButtonProps, {\n children: theme.direction === 'rtl' ? _KeyboardArrowRight || (_KeyboardArrowRight = /*#__PURE__*/_jsx(KeyboardArrowRight, {})) : _KeyboardArrowLeft || (_KeyboardArrowLeft = /*#__PURE__*/_jsx(KeyboardArrowLeft, {}))\n })), /*#__PURE__*/_jsx(IconButton, _extends({\n onClick: handleNextButtonClick,\n disabled: count !== -1 ? page >= Math.ceil(count / rowsPerPage) - 1 : false,\n color: \"inherit\",\n \"aria-label\": getItemAriaLabel('next', page),\n title: getItemAriaLabel('next', page)\n }, nextIconButtonProps, {\n children: theme.direction === 'rtl' ? _KeyboardArrowLeft2 || (_KeyboardArrowLeft2 = /*#__PURE__*/_jsx(KeyboardArrowLeft, {})) : _KeyboardArrowRight2 || (_KeyboardArrowRight2 = /*#__PURE__*/_jsx(KeyboardArrowRight, {}))\n })), showLastButton && /*#__PURE__*/_jsx(IconButton, {\n onClick: handleLastPageButtonClick,\n disabled: page >= Math.ceil(count / rowsPerPage) - 1,\n \"aria-label\": getItemAriaLabel('last', page),\n title: getItemAriaLabel('last', page),\n children: theme.direction === 'rtl' ? _FirstPageIcon2 || (_FirstPageIcon2 = /*#__PURE__*/_jsx(FirstPageIcon, {})) : _LastPageIcon2 || (_LastPageIcon2 = /*#__PURE__*/_jsx(LastPageIcon, {}))\n })]\n }));\n});\nprocess.env.NODE_ENV !== \"production\" ? TablePaginationActions.propTypes = {\n /**\n * Props applied to the back arrow [`IconButton`](/material-ui/api/icon-button/) element.\n */\n backIconButtonProps: PropTypes.object,\n\n /**\n * The total number of rows.\n */\n count: PropTypes.number.isRequired,\n\n /**\n * Accepts a function which returns a string value that provides a user-friendly name for the current page.\n *\n * For localization purposes, you can use the provided [translations](/material-ui/guides/localization/).\n *\n * @param {string} type The link or button type to format ('page' | 'first' | 'last' | 'next' | 'previous'). Defaults to 'page'.\n * @param {number} page The page number to format.\n * @returns {string}\n */\n getItemAriaLabel: PropTypes.func.isRequired,\n\n /**\n * Props applied to the next arrow [`IconButton`](/material-ui/api/icon-button/) element.\n */\n nextIconButtonProps: PropTypes.object,\n\n /**\n * Callback fired when the page is changed.\n *\n * @param {object} event The event source of the callback.\n * @param {number} page The page selected.\n */\n onPageChange: PropTypes.func.isRequired,\n\n /**\n * The zero-based index of the current page.\n */\n page: PropTypes.number.isRequired,\n\n /**\n * The number of rows per page.\n */\n rowsPerPage: PropTypes.number.isRequired,\n\n /**\n * If `true`, show the first-page button.\n */\n showFirstButton: PropTypes.bool.isRequired,\n\n /**\n * If `true`, show the last-page button.\n */\n showLastButton: PropTypes.bool.isRequired\n} : void 0;\nexport default TablePaginationActions;","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport MenuItem from '@mui/material/MenuItem';\nimport { GridPreferencePanelsValue } from '../../../hooks/features/preferencesPanel/gridPreferencePanelsValue';\nimport { useGridApiContext } from '../../../hooks/utils/useGridApiContext';\nimport { useGridRootProps } from '../../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst GridColumnsMenuItem = props => {\n const {\n onClick\n } = props;\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const showColumns = React.useCallback(event => {\n onClick(event);\n apiRef.current.showPreferences(GridPreferencePanelsValue.columns);\n }, [apiRef, onClick]);\n\n if (rootProps.disableColumnSelector) {\n return null;\n }\n\n return /*#__PURE__*/_jsx(MenuItem, {\n onClick: showColumns,\n children: apiRef.current.getLocaleText('columnMenuShowColumns')\n });\n};\n\nprocess.env.NODE_ENV !== \"production\" ? GridColumnsMenuItem.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n column: PropTypes.object.isRequired,\n onClick: PropTypes.func.isRequired\n} : void 0;\nexport { GridColumnsMenuItem };","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport MenuItem from '@mui/material/MenuItem';\nimport { useGridApiContext } from '../../../hooks/utils/useGridApiContext';\nimport { useGridRootProps } from '../../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst GridFilterMenuItem = props => {\n const {\n column,\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(column == null ? void 0 : column.field);\n }, [apiRef, column == null ? void 0 : column.field, onClick]);\n\n if (rootProps.disableColumnFilter || !(column != null && column.filterable)) {\n return null;\n }\n\n return /*#__PURE__*/_jsx(MenuItem, {\n onClick: showFilter,\n children: apiRef.current.getLocaleText('columnMenuFilter')\n });\n};\n\nprocess.env.NODE_ENV !== \"production\" ? GridFilterMenuItem.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n column: PropTypes.object.isRequired,\n onClick: PropTypes.func.isRequired\n} : void 0;\nexport { GridFilterMenuItem };","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport MenuItem from '@mui/material/MenuItem';\nimport { useGridApiContext } from '../../../hooks/utils/useGridApiContext';\nimport { useGridRootProps } from '../../../hooks/utils/useGridRootProps';\nimport { gridVisibleColumnDefinitionsSelector } from '../../../hooks/features/columns';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst HideGridColMenuItem = props => {\n const {\n column,\n onClick\n } = props;\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const timeoutRef = React.useRef();\n const visibleColumns = gridVisibleColumnDefinitionsSelector(apiRef);\n const columnsWithMenu = visibleColumns.filter(col => col.disableColumnMenu !== true); // do not allow to hide the last column with menu\n\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\n onClick(event); // time for the transition\n\n timeoutRef.current = setTimeout(() => {\n apiRef.current.setColumnVisibility(column == null ? void 0 : column.field, false);\n }, 100);\n }, [apiRef, column == null ? void 0 : column.field, onClick, disabled]);\n React.useEffect(() => {\n return () => clearTimeout(timeoutRef.current);\n }, []);\n\n if (rootProps.disableColumnSelector) {\n return null;\n }\n\n if (column.hideable === false) {\n return null;\n }\n\n return /*#__PURE__*/_jsx(MenuItem, {\n onClick: toggleColumn,\n disabled: disabled,\n children: apiRef.current.getLocaleText('columnMenuHideColumn')\n });\n};\n\nprocess.env.NODE_ENV !== \"production\" ? HideGridColMenuItem.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n column: PropTypes.object.isRequired,\n onClick: PropTypes.func.isRequired\n} : void 0;\nexport { HideGridColMenuItem };","import * as React from 'react';\nimport PropTypes from 'prop-types';\nimport MenuItem from '@mui/material/MenuItem';\nimport { useGridSelector } from '../../../hooks/utils/useGridSelector';\nimport { gridSortModelSelector } from '../../../hooks/features/sorting/gridSortingSelector';\nimport { useGridApiContext } from '../../../hooks/utils/useGridApiContext';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n\nconst SortGridMenuItems = props => {\n const {\n column,\n onClick\n } = props;\n const apiRef = useGridApiContext();\n const sortModel = useGridSelector(apiRef, gridSortModelSelector);\n const sortDirection = React.useMemo(() => {\n if (!column) {\n return null;\n }\n\n const sortItem = sortModel.find(item => item.field === column.field);\n return sortItem == null ? void 0 : sortItem.sort;\n }, [column, sortModel]);\n const onSortMenuItemClick = React.useCallback(event => {\n onClick(event);\n const direction = event.currentTarget.getAttribute('data-value') || null;\n apiRef.current.sortColumn(column, direction);\n }, [apiRef, column, onClick]);\n\n if (!column || !column.sortable) {\n return null;\n }\n\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(MenuItem, {\n onClick: onSortMenuItemClick,\n disabled: sortDirection == null,\n children: apiRef.current.getLocaleText('columnMenuUnsort')\n }), /*#__PURE__*/_jsx(MenuItem, {\n onClick: onSortMenuItemClick,\n \"data-value\": \"asc\",\n disabled: sortDirection === 'asc',\n children: apiRef.current.getLocaleText('columnMenuSortAsc')\n }), /*#__PURE__*/_jsx(MenuItem, {\n onClick: onSortMenuItemClick,\n \"data-value\": \"desc\",\n disabled: sortDirection === 'desc',\n children: apiRef.current.getLocaleText('columnMenuSortDesc')\n })]\n });\n};\n\nprocess.env.NODE_ENV !== \"production\" ? SortGridMenuItems.propTypes = {\n // ----------------------------- Warning --------------------------------\n // | These PropTypes are generated from the TypeScript type definitions |\n // | To update them edit the TypeScript types and run \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n column: PropTypes.object.isRequired,\n onClick: PropTypes.func.isRequired\n} : void 0;\nexport { SortGridMenuItems };","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { GridColumnMenuContainer } from './GridColumnMenuContainer';\nimport { GridColumnsMenuItem } from './GridColumnsMenuItem';\nimport { GridFilterMenuItem } from './GridFilterMenuItem';\nimport { HideGridColMenuItem } from './HideGridColMenuItem';\nimport { SortGridMenuItems } from './SortGridMenuItems';\nimport { useGridApiContext } from '../../../hooks/utils/useGridApiContext';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GridColumnMenu = /*#__PURE__*/React.forwardRef(function GridColumnMenu(props, ref) {\n const {\n hideMenu,\n currentColumn\n } = props;\n const apiRef = useGridApiContext();\n const defaultButtons = [/*#__PURE__*/_jsx(SortGridMenuItems, {\n onClick: hideMenu,\n column: currentColumn\n }),\n /*#__PURE__*/\n // TODO update types to allow `onClick` and `column` to be optional\n _jsx(GridFilterMenuItem, {\n onClick: hideMenu,\n column: currentColumn\n }), /*#__PURE__*/_jsx(HideGridColMenuItem, {\n onClick: hideMenu,\n column: currentColumn\n }), /*#__PURE__*/_jsx(GridColumnsMenuItem, {\n onClick: hideMenu,\n column: currentColumn\n })];\n const preProcessedButtons = apiRef.current.unstable_applyPipeProcessors('columnMenu', defaultButtons, currentColumn);\n return /*#__PURE__*/_jsx(GridColumnMenuContainer, _extends({\n ref: ref\n }, props, {\n children: preProcessedButtons.map((button, index) => /*#__PURE__*/React.cloneElement(button, {\n key: index,\n onClick: hideMenu,\n column: currentColumn\n }))\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n currentColumn: 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 { GridColumnMenu };","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 { unstable_composeClasses as composeClasses } from '@mui/material';\nimport { styled } from '@mui/material/styles';\nimport { useGridApiContext } from '../hooks/utils/useGridApiContext';\nimport { getDataGridUtilityClass } from '../constants/gridClasses';\nimport { useGridRootProps } from '../hooks/utils/useGridRootProps';\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['rowCount']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\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\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes\n };\n const classes = useUtilityClasses(ownerState);\n\n if (rowCount === 0) {\n return null;\n }\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 }, 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 \"yarn 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 _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 { unstable_composeClasses as composeClasses } from '@mui/material';\nimport { styled } from '@mui/material/styles';\nimport { useGridApiContext } from '../hooks/utils/useGridApiContext';\nimport { getDataGridUtilityClass } from '../constants/gridClasses';\nimport { useGridRootProps } from '../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['selectedRowCount']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\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\n const apiRef = useGridApiContext();\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes\n };\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 }, 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 \"yarn 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 _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_composeClasses as composeClasses } from '@mui/material';\nimport { styled, alpha, lighten, darken } from '@mui/material/styles';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['footerContainer']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\n\nconst GridFooterContainerRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'FooterContainer',\n overridesResolver: (props, styles) => styles.footerContainer\n})(({\n theme\n}) => {\n const borderColor = theme.palette.mode === 'light' ? lighten(alpha(theme.palette.divider, 1), 0.88) : darken(alpha(theme.palette.divider, 1), 0.68);\n return {\n display: 'flex',\n justifyContent: 'space-between',\n alignItems: 'center',\n minHeight: 52,\n // Match TablePagination min height\n borderTop: `1px solid ${borderColor}`\n };\n});\nconst GridFooterContainer = /*#__PURE__*/React.forwardRef(function GridFooterContainer(props, ref) {\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes\n };\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(GridFooterContainerRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className)\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 \"yarn 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 * as React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGridSelector } from '../hooks/utils/useGridSelector';\nimport { gridTopLevelRowCountSelector } from '../hooks/features/rows/gridRowsSelector';\nimport { selectedGridRowsCountSelector } from '../hooks/features/selection/gridSelectionSelector';\nimport { gridVisibleTopLevelRowCountSelector } from '../hooks/features/filter/gridFilterSelector';\nimport { useGridApiContext } from '../hooks/utils/useGridApiContext';\nimport { GridRowCount } from './GridRowCount';\nimport { GridSelectedRowCount } from './GridSelectedRowCount';\nimport { GridFooterContainer } from './containers/GridFooterContainer';\nimport { useGridRootProps } from '../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst GridFooter = /*#__PURE__*/React.forwardRef(function GridFooter(props, ref) {\n var _rootProps$components;\n\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, gridVisibleTopLevelRowCountSelector);\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(GridRowCount, {\n rowCount: totalTopLevelRowCount,\n visibleRowCount: visibleTopLevelRowCount\n }) : null;\n\n const paginationElement = rootProps.pagination && !rootProps.hideFooterPagination && rootProps.components.Pagination && /*#__PURE__*/_jsx(rootProps.components.Pagination, _extends({}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.pagination));\n\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 \"yarn 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 { useGridRootProps } from '../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nexport const GridHeader = /*#__PURE__*/React.forwardRef(function GridHeader(props, ref) {\n var _rootProps$components, _rootProps$components2;\n\n const rootProps = useGridRootProps();\n return /*#__PURE__*/_jsxs(\"div\", _extends({\n ref: ref\n }, props, {\n children: [/*#__PURE__*/_jsx(rootProps.components.PreferencesPanel, _extends({}, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.preferencesPanel)), rootProps.components.Toolbar && /*#__PURE__*/_jsx(rootProps.components.Toolbar, _extends({}, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.toolbar))]\n }));\n});","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { gridColumnDefinitionsSelector } from '../../hooks/features/columns/gridColumnsSelector';\nimport { useGridSelector } from '../../hooks/utils/useGridSelector';\nimport { gridPreferencePanelStateSelector } from '../../hooks/features/preferencesPanel/gridPreferencePanelSelector';\nimport { GridPreferencePanelsValue } from '../../hooks/features/preferencesPanel/gridPreferencePanelsValue';\nimport { useGridApiContext } from '../../hooks/utils/useGridApiContext';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport const GridPreferencesPanel = /*#__PURE__*/React.forwardRef(function GridPreferencesPanel(props, ref) {\n var _preferencePanelState, _rootProps$components, _rootProps$components2;\n\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 = preferencePanelState.openedPanelValue) != null ? _preferencePanelState : GridPreferencePanelsValue.filters);\n return /*#__PURE__*/_jsx(rootProps.components.Panel, _extends({\n ref: ref,\n as: rootProps.components.BasePopper,\n open: columns.length > 0 && preferencePanelState.open\n }, (_rootProps$components = rootProps.componentsProps) == null ? void 0 : _rootProps$components.panel, props, (_rootProps$components2 = rootProps.componentsProps) == null ? void 0 : _rootProps$components2.basePopper, {\n children: panelContent\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_composeClasses as composeClasses } from '@mui/material';\nimport { alpha, styled } from '@mui/material/styles';\nimport { getDataGridUtilityClass } from '../../constants/gridClasses';\nimport { useGridRootProps } from '../../hooks/utils/useGridRootProps';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\n\nconst useUtilityClasses = ownerState => {\n const {\n classes\n } = ownerState;\n const slots = {\n root: ['overlay']\n };\n return composeClasses(slots, getDataGridUtilityClass, classes);\n};\n\nconst GridOverlayRoot = styled('div', {\n name: 'MuiDataGrid',\n slot: 'Overlay',\n overridesResolver: (props, styles) => styles.overlay\n})(({\n theme\n}) => ({\n display: 'flex',\n height: '100%',\n alignSelf: 'center',\n alignItems: 'center',\n justifyContent: 'center',\n backgroundColor: alpha(theme.palette.background.default, theme.palette.action.disabledOpacity)\n}));\nconst GridOverlay = /*#__PURE__*/React.forwardRef(function GridOverlay(props, ref) {\n const {\n className\n } = props,\n other = _objectWithoutPropertiesLoose(props, _excluded);\n\n const rootProps = useGridRootProps();\n const ownerState = {\n classes: rootProps.classes\n };\n const classes = useUtilityClasses(ownerState);\n return /*#__PURE__*/_jsx(GridOverlayRoot, _extends({\n ref: ref,\n className: clsx(classes.root, className)\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 \"yarn 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 * as React from 'react';\nimport PropTypes from 'prop-types';\nimport CircularProgress from '@mui/material/CircularProgress';\nimport { GridOverlay } from './containers/GridOverlay';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nconst GridLoadingOverlay = /*#__PURE__*/React.forwardRef(function GridLoadingOverlay(props, ref) {\n return /*#__PURE__*/_jsx(GridOverlay, _extends({\n ref: ref\n }, props, {\n children: /*#__PURE__*/_jsx(CircularProgress, {})\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 \"yarn proptypes\" |\n // ----------------------------------------------------------------------\n sx: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.oneOfType([PropTypes.func, PropTypes.object, PropTypes.bool])), PropTypes.func, PropTypes.object])\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';\nimport { GridOverlay } from './containers/GridOverlay';\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 \"yarn 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 * as React from 'react';\nimport createSvgIcon from '../../utils/createSvgIcon';\n/**\n * @ignore - internal component.\n */\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M15.41 16.09l-4.58-4.59 4.58-4.59L14 5.5l-6 6 6 6z\"\n}), 'KeyboardArrowLeft');","import * as React from 'react';\nimport createSvgIcon from '../../utils/createSvgIcon';\n/**\n * @ignore - internal component.\n */\n\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nexport default createSvgIcon( /*#__PURE__*/_jsx(\"path\", {\n d: \"M8.59 16.34l4.58-4.59-4.58-4.59L10 5.75l6 6-6 6z\"\n}), 'KeyboardArrowRight');","import { generateUtilityClass, generateUtilityClasses } from '@mui/base';\nexport function getTablePaginationUtilityClass(slot) {\n return generateUtilityClass('MuiTablePagination', slot);\n}\nconst tablePaginationClasses = generateUtilityClasses('MuiTablePagination', ['root', 'toolbar', 'spacer', 'selectLabel', 'selectRoot', 'select', 'selectIcon', 'input', 'menuItem', 'displayedRows', 'actions']);\nexport default tablePaginationClasses;","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _extends from \"@babel/runtime/helpers/esm/extends\";\n\nvar _InputBase;\n\nconst _excluded = [\"ActionsComponent\", \"backIconButtonProps\", \"className\", \"colSpan\", \"component\", \"count\", \"getItemAriaLabel\", \"labelDisplayedRows\", \"labelRowsPerPage\", \"nextIconButtonProps\", \"onPageChange\", \"onRowsPerPageChange\", \"page\", \"rowsPerPage\", \"rowsPerPageOptions\", \"SelectProps\", \"showFirstButton\", \"showLastButton\"];\nimport * as React from 'react';\nimport PropTypes from 'prop-types';\nimport clsx from 'clsx';\nimport { chainPropTypes, integerPropType } from '@mui/utils';\nimport { unstable_composeClasses as composeClasses, isHostComponent } from '@mui/base';\nimport styled from '../styles/styled';\nimport useThemeProps from '../styles/useThemeProps';\nimport InputBase from '../InputBase';\nimport MenuItem from '../MenuItem';\nimport Select from '../Select';\nimport TableCell from '../TableCell';\nimport Toolbar from '../Toolbar';\nimport TablePaginationActions from './TablePaginationActions';\nimport useId from '../utils/useId';\nimport tablePaginationClasses, { getTablePaginationUtilityClass } from './tablePaginationClasses';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { createElement as _createElement } from \"react\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nconst TablePaginationRoot = styled(TableCell, {\n name: 'MuiTablePagination',\n slot: 'Root',\n overridesResolver: (props, styles) => styles.root\n})(({\n theme\n}) => ({\n overflow: 'auto',\n color: (theme.vars || theme).palette.text.primary,\n fontSize: theme.typography.pxToRem(14),\n // Increase the specificity to override TableCell.\n '&:last-child': {\n padding: 0\n }\n}));\nconst TablePaginationToolbar = styled(Toolbar, {\n name: 'MuiTablePagination',\n slot: 'Toolbar',\n overridesResolver: (props, styles) => _extends({\n [`& .${tablePaginationClasses.actions}`]: styles.actions\n }, styles.toolbar)\n})(({\n theme\n}) => ({\n minHeight: 52,\n paddingRight: 2,\n [`${theme.breakpoints.up('xs')} and (orientation: landscape)`]: {\n minHeight: 52\n },\n [theme.breakpoints.up('sm')]: {\n minHeight: 52,\n paddingRight: 2\n },\n [`& .${tablePaginationClasses.actions}`]: {\n flexShrink: 0,\n marginLeft: 20\n }\n}));\nconst TablePaginationSpacer = styled('div', {\n name: 'MuiTablePagination',\n slot: 'Spacer',\n overridesResolver: (props, styles) => styles.spacer\n})({\n flex: '1 1 100%'\n});\nconst TablePaginationSelectLabel = styled('p', {\n name: 'MuiTablePagination',\n slot: 'SelectLabel',\n overridesResolver: (props, styles) => styles.selectLabel\n})(({\n theme\n}) => _extends({}, theme.typography.body2, {\n flexShrink: 0\n}));\nconst TablePaginationSelect = styled(Select, {\n name: 'MuiTablePagination',\n slot: 'Select',\n overridesResolver: (props, styles) => _extends({\n [`& .${tablePaginationClasses.selectIcon}`]: styles.selectIcon,\n [`& .${tablePaginationClasses.select}`]: styles.select\n }, styles.input, styles.selectRoot)\n})({\n color: 'inherit',\n fontSize: 'inherit',\n flexShrink: 0,\n marginRight: 32,\n marginLeft: 8,\n [`& .${tablePaginationClasses.select}`]: {\n paddingLeft: 8,\n paddingRight: 24,\n textAlign: 'right',\n textAlignLast: 'right' // Align |