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EAASgG,EAAqBN,WAA8G,SAA/C,OAAhDO,EAAwBf,EAAYlF,cAAmB,EAASiG,EAAsBR,MAChNW,EAAYN,EAAS,GACrBO,EAAgBP,EAASA,EAASC,OAAS,GACxB,iBAAdK,GAAmD,iBAAlBC,IACtCH,EACFG,EAAcf,QAEdc,EAAUd,QAIhB,MACEM,EAAYN,OACd,EAEFhF,EAAIkB,iBAAiB,UAAWmE,GAChCrF,EAAIkB,iBAAiB,UAAW+D,GAAW,GAQ3C,MAAMe,EAAWC,aAAY,KACvBjG,EAAI6E,eAA+C,SAA9B7E,EAAI6E,cAAcjC,SACzCyC,GACF,GACC,IACH,MAAO,KACLa,cAAcF,GACdhG,EAAImB,oBAAoB,UAAWkE,GACnCrF,EAAImB,oBAAoB,UAAW8D,GAAW,EAAK,CACpD,GACA,CAAClB,EAAkBC,EAAqBC,EAAqBE,EAAWC,EAAMF,IACjF,MAWMiC,EAAsBrG,IACI,OAA1B0E,EAAc9E,UAChB8E,EAAc9E,QAAUI,EAAMsG,eAEhC1B,EAAUhF,SAAU,CAAI,EAE1B,OAAoB,UAAM,WAAgB,CACxCV,SAAU,EAAc,SAAK,MAAO,CAClCyD,SAAU2B,EAAO,GAAK,EACtBiC,QAASF,EACTvG,IAAK0E,EACL,cAAe,kBACA,eAAmBtF,EAAU,CAC5CY,IAAKD,EACL0G,QAzBYvG,IACgB,OAA1B0E,EAAc9E,UAChB8E,EAAc9E,QAAUI,EAAMsG,eAEhC1B,EAAUhF,SAAU,EACpB+E,EAAsB/E,QAAUI,EAAMa,OACtC,MAAMG,EAAuB9B,EAASD,MAAMsH,QACxCvF,GACFA,EAAqBhB,EACvB,KAiBiB,SAAK,MAAO,CAC3B2C,SAAU2B,EAAO,GAAK,EACtBiC,QAASF,EACTvG,IAAK2E,EACL,cAAe,kBAGrB,C","sources":["webpack:///./node_modules/@mui/base/ClickAwayListener/ClickAwayListener.js","webpack:///./node_modules/@mui/base/FocusTrap/FocusTrap.js"],"sourcesContent":["'use client';\n\nimport * 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';\n\n// TODO: return `EventHandlerName extends `on${infer EventName}` ? Lowercase<EventName> : never` once generatePropTypes runs with TS 4.1\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nfunction mapEventPropToEvent(eventProp) {\n return eventProp.substring(2).toLowerCase();\n}\nfunction clickedRootScrollbar(event, doc) {\n return doc.documentElement.clientWidth < event.clientX || doc.documentElement.clientHeight < event.clientY;\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-ui/react-click-away-listener/)\n *\n * API:\n *\n * - [ClickAwayListener API](https://mui.com/base-ui/react-click-away-listener/components-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(\n // @ts-expect-error TODO upstream fix\n children.ref, nodeRef);\n\n // 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 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);\n\n // 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 if (!activatedRef.current || !nodeRef.current || 'clientX' in event && clickedRootScrollbar(event, doc)) {\n return;\n }\n\n // Do not act if user performed touchmove\n if (movedRef.current) {\n movedRef.current = false;\n return;\n }\n let insideDOM;\n\n // If not enough, can use https://github.com/DieterHolvoet/event-propagation-path/blob/master/propagationPath.js\n if (event.composedPath) {\n insideDOM = event.composedPath().indexOf(nodeRef.current) > -1;\n } else {\n insideDOM = !doc.documentElement.contains(\n // @ts-expect-error returns `false` as intended when not dispatched from a Node\n event.target) || nodeRef.current.contains(\n // @ts-expect-error returns `false` as intended when not dispatched from a Node\n event.target);\n }\n if (!insideDOM && (disableReactTree || !insideReactTree)) {\n onClickAway(event);\n }\n });\n\n // Keep track of mouse/touch events that bubbled up through the portal.\n const createHandleSynthetic = handlerName => event => {\n syntheticEventRef.current = true;\n const childrenPropsHandler = children.props[handlerName];\n if (childrenPropsHandler) {\n childrenPropsHandler(event);\n }\n };\n const childrenProps = {\n ref: handleRef\n };\n if (touchEvent !== false) {\n childrenProps[touchEvent] = createHandleSynthetic(touchEvent);\n }\n React.useEffect(() => {\n if (touchEvent !== false) {\n const mappedTouchEvent = mapEventPropToEvent(touchEvent);\n const doc = ownerDocument(nodeRef.current);\n const handleTouchMove = () => {\n movedRef.current = true;\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 return undefined;\n }, [handleClickAway, touchEvent]);\n if (mouseEvent !== false) {\n childrenProps[mouseEvent] = createHandleSynthetic(mouseEvent);\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 return undefined;\n }, [handleClickAway, mouseEvent]);\n return /*#__PURE__*/_jsx(React.Fragment, {\n children: /*#__PURE__*/React.cloneElement(children, childrenProps)\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? ClickAwayListener.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────â”\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * The wrapped element.\n */\n children: elementAcceptingRef.isRequired,\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 * 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 * Callback fired when a \"click away\" event is detected.\n */\n onClickAway: PropTypes.func.isRequired,\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;\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n ClickAwayListener['propTypes' + ''] = exactProp(ClickAwayListener.propTypes);\n}\nexport { ClickAwayListener };","'use client';\n\n/* 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';\nimport { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\n// Inspired by https://github.com/focus-trap/tabbable\nconst candidatesSelector = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable=\"false\"])'].join(',');\nfunction getTabIndex(node) {\n const tabindexAttr = parseInt(node.getAttribute('tabindex') || '', 10);\n if (!Number.isNaN(tabindexAttr)) {\n return tabindexAttr;\n }\n\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, <details/>, <audio controls/> and <video controls/> 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 if (node.contentEditable === 'true' || (node.nodeName === 'AUDIO' || node.nodeName === 'VIDEO' || node.nodeName === 'DETAILS') && node.getAttribute('tabindex') === null) {\n return 0;\n }\n return node.tabIndex;\n}\nfunction isNonTabbableRadio(node) {\n if (node.tagName !== 'INPUT' || node.type !== 'radio') {\n return false;\n }\n if (!node.name) {\n return false;\n }\n const getRadio = selector => node.ownerDocument.querySelector(`input[type=\"radio\"]${selector}`);\n let roving = getRadio(`[name=\"${node.name}\"]:checked`);\n if (!roving) {\n roving = getRadio(`[name=\"${node.name}\"]`);\n }\n return roving !== node;\n}\nfunction isNodeMatchingSelectorFocusable(node) {\n if (node.disabled || node.tagName === 'INPUT' && node.type === 'hidden' || isNonTabbableRadio(node)) {\n return false;\n }\n return true;\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 if (nodeTabIndex === -1 || !isNodeMatchingSelectorFocusable(node)) {\n return;\n }\n if (nodeTabIndex === 0) {\n regularTabNodes.push(node);\n } else {\n orderedTabNodes.push({\n documentOrder: i,\n tabIndex: nodeTabIndex,\n node: 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}\nfunction defaultIsEnabled() {\n return true;\n}\n\n/**\n * Utility component that locks focus inside the component.\n *\n * Demos:\n *\n * - [Focus Trap](https://mui.com/base-ui/react-focus-trap/)\n *\n * API:\n *\n * - [FocusTrap API](https://mui.com/base-ui/react-focus-trap/components-api/#focus-trap)\n */\nfunction FocusTrap(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(false);\n const sentinelStart = React.useRef(null);\n const sentinelEnd = React.useRef(null);\n const nodeToRestore = React.useRef(null);\n const reactFocusEventTarget = React.useRef(null);\n // This variable is useful when disableAutoFocus is true.\n // It waits for the active element to move into the component to activate.\n const activated = React.useRef(false);\n const rootRef = React.useRef(null);\n // @ts-expect-error TODO upstream fix\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 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 const doc = ownerDocument(rootRef.current);\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 rootRef.current.setAttribute('tabIndex', '-1');\n }\n if (activated.current) {\n rootRef.current.focus();\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 nodeToRestore.current = null;\n }\n };\n // Missing `disableRestoreFocus` which is fine.\n // We don't support changing that prop on an open FocusTrap\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 const doc = ownerDocument(rootRef.current);\n const loopFocus = nativeEvent => {\n lastKeydown.current = nativeEvent;\n if (disableEnforceFocus || !isEnabled() || nativeEvent.key !== 'Tab') {\n return;\n }\n\n // Make sure the next tab starts from the right place.\n // doc.activeElement refers to the origin.\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 if (sentinelEnd.current) {\n sentinelEnd.current.focus();\n }\n }\n };\n const contain = () => {\n const rootElement = rootRef.current;\n\n // 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 if (rootElement === null) {\n return;\n }\n if (!doc.hasFocus() || !isEnabled() || ignoreNextEnforceFocus.current) {\n ignoreNextEnforceFocus.current = false;\n return;\n }\n\n // The focus is already inside\n if (rootElement.contains(doc.activeElement)) {\n return;\n }\n\n // The disableEnforceFocus is set and the focus is outside of the focus trap (and sentinel nodes)\n if (disableEnforceFocus && doc.activeElement !== sentinelStart.current && doc.activeElement !== sentinelEnd.current) {\n return;\n }\n\n // if the focus event is not coming from inside the children's react tree, reset the refs\n if (doc.activeElement !== reactFocusEventTarget.current) {\n reactFocusEventTarget.current = null;\n } else if (reactFocusEventTarget.current !== null) {\n return;\n }\n if (!activated.current) {\n return;\n }\n let tabbable = [];\n if (doc.activeElement === sentinelStart.current || doc.activeElement === sentinelEnd.current) {\n tabbable = getTabbable(rootRef.current);\n }\n\n // one of the sentinel nodes was focused, so move the focus\n // to the first/last tabbable element inside the focus trap\n if (tabbable.length > 0) {\n var _lastKeydown$current, _lastKeydown$current2;\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 if (typeof focusNext !== 'string' && typeof focusPrevious !== 'string') {\n if (isShiftTab) {\n focusPrevious.focus();\n } else {\n focusNext.focus();\n }\n }\n // no tabbable elements in the trap focus or the focus was outside of the focus trap\n } else {\n rootElement.focus();\n }\n };\n doc.addEventListener('focusin', contain);\n doc.addEventListener('keydown', loopFocus, true);\n\n // With Edge, Safari and Firefox, no focus related events are fired when the focused area stops being a focused area.\n // for example 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 const interval = setInterval(() => {\n if (doc.activeElement && 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 const onFocus = event => {\n if (nodeToRestore.current === null) {\n nodeToRestore.current = event.relatedTarget;\n }\n activated.current = true;\n reactFocusEventTarget.current = event.target;\n const childrenPropsHandler = children.props.onFocus;\n if (childrenPropsHandler) {\n childrenPropsHandler(event);\n }\n };\n const handleFocusSentinel = event => {\n if (nodeToRestore.current === null) {\n nodeToRestore.current = event.relatedTarget;\n }\n activated.current = true;\n };\n return /*#__PURE__*/_jsxs(React.Fragment, {\n children: [/*#__PURE__*/_jsx(\"div\", {\n tabIndex: open ? 0 : -1,\n onFocus: handleFocusSentinel,\n ref: sentinelStart,\n \"data-testid\": \"sentinelStart\"\n }), /*#__PURE__*/React.cloneElement(children, {\n ref: handleRef,\n onFocus\n }), /*#__PURE__*/_jsx(\"div\", {\n tabIndex: open ? 0 : -1,\n onFocus: handleFocusSentinel,\n ref: sentinelEnd,\n \"data-testid\": \"sentinelEnd\"\n })]\n });\n}\nprocess.env.NODE_ENV !== \"production\" ? FocusTrap.propTypes /* remove-proptypes */ = {\n // ┌────────────────────────────── Warning ──────────────────────────────â”\n // │ These PropTypes are generated from the TypeScript type definitions. │\n // │ To update them, edit the TypeScript types and run `pnpm proptypes`. │\n // └─────────────────────────────────────────────────────────────────────┘\n /**\n * A single child content element.\n */\n children: elementAcceptingRef,\n /**\n * If `true`, the focus trap 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 focus trap children that have the `disableAutoFocus` prop.\n *\n * Generally this should never be set to `true` as it makes the focus trap less\n * accessible to assistive technologies, like screen readers.\n * @default false\n */\n disableAutoFocus: PropTypes.bool,\n /**\n * If `true`, the focus trap will not prevent focus from leaving the focus trap while open.\n *\n * Generally this should never be set to `true` as it makes the focus trap less\n * accessible to assistive technologies, like screen readers.\n * @default false\n */\n disableEnforceFocus: PropTypes.bool,\n /**\n * If `true`, the focus trap will not restore focus to previously focused element once\n * focus trap is hidden or unmounted.\n * @default false\n */\n disableRestoreFocus: PropTypes.bool,\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 * 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 focus trap mounted at the same time.\n * @default function defaultIsEnabled(): boolean {\n * return true;\n * }\n */\n isEnabled: PropTypes.func,\n /**\n * If `true`, focus is locked.\n */\n open: PropTypes.bool.isRequired\n} : void 0;\nif (process.env.NODE_ENV !== 'production') {\n // eslint-disable-next-line\n FocusTrap['propTypes' + ''] = exactProp(FocusTrap.propTypes);\n}\nexport { FocusTrap };"],"names":["mapEventPropToEvent","eventProp","substring","toLowerCase","ClickAwayListener","props","children","disableReactTree","mouseEvent","onClickAway","touchEvent","movedRef","nodeRef","activatedRef","syntheticEventRef","setTimeout","current","handleRef","ref","handleClickAway","event","insideReactTree","doc","documentElement","clientWidth","clientX","clientHeight","clientY","clickedRootScrollbar","insideDOM","composedPath","indexOf","contains","target","createHandleSynthetic","handlerName","childrenPropsHandler","childrenProps","mappedTouchEvent","handleTouchMove","addEventListener","removeEventListener","mappedMouseEvent","candidatesSelector","join","defaultGetTabbable","root","regularTabNodes","orderedTabNodes","Array","from","querySelectorAll","forEach","node","i","nodeTabIndex","tabindexAttr","parseInt","getAttribute","Number","isNaN","contentEditable","nodeName","tabIndex","getTabIndex","disabled","tagName","type","name","getRadio","selector","ownerDocument","querySelector","roving","isNonTabbableRadio","isNodeMatchingSelectorFocusable","push","documentOrder","sort","a","b","map","concat","defaultIsEnabled","FocusTrap","disableAutoFocus","disableEnforceFocus","disableRestoreFocus","getTabbable","isEnabled","open","ignoreNextEnforceFocus","sentinelStart","sentinelEnd","nodeToRestore","reactFocusEventTarget","activated","rootRef","lastKeydown","activeElement","hasAttribute","setAttribute","focus","loopFocus","nativeEvent","key","shiftKey","contain","rootElement","hasFocus","tabbable","length","_lastKeydown$current","_lastKeydown$current2","isShiftTab","Boolean","focusNext","focusPrevious","interval","setInterval","clearInterval","handleFocusSentinel","relatedTarget","onFocus"],"sourceRoot":""}