{"version":3,"file":"index.2a4a93e5.js","sources":["../../../frontend/contexts/Modal/ModalRoot/index.js","../../../frontend/contexts/Modal/ModalContext/index.js","../../../frontend/contexts/Modal/ModalProvider/index.js","../../../frontend/features/ideation/hooks/base/useScrollDisable.js","../../../frontend/features/common/hooks/useKeyListener.js","../../../node_modules/tabbable/dist/index.esm.js","../../../node_modules/focus-trap/dist/focus-trap.esm.js","../../../frontend/features/ideation/hooks/base/useFocusTrap.js","../../../frontend/features/ideation/components/base/BaseModal/index.js","../../../frontend/features/ideation/components/base/Modal/index.js"],"sourcesContent":["// Libraries\nimport PropTypes from 'prop-types';\n\nconst ModalRoot = ({ activeModal }) => {\n if (!activeModal) return null;\n\n return activeModal;\n};\n\nModalRoot.propTypes = {\n activeModal: PropTypes.node,\n setActiveModal: PropTypes.func.isRequired,\n};\n\nModalRoot.defaultProps = {\n activeModal: null,\n};\n\nexport default ModalRoot;\n","// Libraries\nimport { createContext } from 'react';\n\nexport default createContext({});\n","// Libraries\nimport React, { useState } from 'react';\nimport PropTypes from 'prop-types';\n\n// Root\nimport ModalRoot from 'contexts/Modal/ModalRoot';\n\n// Context\nimport ModalContext from 'contexts/Modal/ModalContext';\n\nconst ModalProvider = ({ children }) => {\n const [activeModal, setActiveModal] = useState();\n\n return (\n \n {children}\n \n \n );\n};\n\nModalProvider.propTypes = {\n children: PropTypes.node.isRequired,\n};\n\nexport default ModalProvider;\n","// Libraries\nimport { useEffect } from 'react';\n\nexport const useScrollDisable = () => {\n const htmlClassList = window.document.documentElement.classList;\n\n useEffect(() => {\n if (!htmlClassList) return null;\n htmlClassList.add('is-clipped');\n return () => {\n htmlClassList.remove('is-clipped');\n };\n }, []);\n};\n","// Libraries\nimport { useEffect } from 'react';\n\nexport const useKeyListener = (key, onKeyPress) => {\n const keyListener = (event) => {\n if (event.key === key) {\n onKeyPress(event);\n }\n };\n\n useEffect(() => {\n window.addEventListener('keydown', keyListener);\n return () => window.removeEventListener('keydown', keyListener);\n });\n};\n","/*!\n* tabbable 5.3.3\n* @license MIT, https://github.com/focus-trap/tabbable/blob/master/LICENSE\n*/\nvar candidateSelectors = ['input', 'select', 'textarea', 'a[href]', 'button', '[tabindex]:not(slot)', 'audio[controls]', 'video[controls]', '[contenteditable]:not([contenteditable=\"false\"])', 'details>summary:first-of-type', 'details'];\nvar candidateSelector = /* #__PURE__ */candidateSelectors.join(',');\nvar NoElement = typeof Element === 'undefined';\nvar matches = NoElement ? function () {} : Element.prototype.matches || Element.prototype.msMatchesSelector || Element.prototype.webkitMatchesSelector;\nvar getRootNode = !NoElement && Element.prototype.getRootNode ? function (element) {\n return element.getRootNode();\n} : function (element) {\n return element.ownerDocument;\n};\n/**\n * @param {Element} el container to check in\n * @param {boolean} includeContainer add container to check\n * @param {(node: Element) => boolean} filter filter candidates\n * @returns {Element[]}\n */\n\nvar getCandidates = function getCandidates(el, includeContainer, filter) {\n var candidates = Array.prototype.slice.apply(el.querySelectorAll(candidateSelector));\n\n if (includeContainer && matches.call(el, candidateSelector)) {\n candidates.unshift(el);\n }\n\n candidates = candidates.filter(filter);\n return candidates;\n};\n/**\n * @callback GetShadowRoot\n * @param {Element} element to check for shadow root\n * @returns {ShadowRoot|boolean} ShadowRoot if available or boolean indicating if a shadowRoot is attached but not available.\n */\n\n/**\n * @callback ShadowRootFilter\n * @param {Element} shadowHostNode the element which contains shadow content\n * @returns {boolean} true if a shadow root could potentially contain valid candidates.\n */\n\n/**\n * @typedef {Object} CandidatesScope\n * @property {Element} scope contains inner candidates\n * @property {Element[]} candidates\n */\n\n/**\n * @typedef {Object} IterativeOptions\n * @property {GetShadowRoot|boolean} getShadowRoot true if shadow support is enabled; falsy if not;\n * if a function, implies shadow support is enabled and either returns the shadow root of an element\n * or a boolean stating if it has an undisclosed shadow root\n * @property {(node: Element) => boolean} filter filter candidates\n * @property {boolean} flatten if true then result will flatten any CandidatesScope into the returned list\n * @property {ShadowRootFilter} shadowRootFilter filter shadow roots;\n */\n\n/**\n * @param {Element[]} elements list of element containers to match candidates from\n * @param {boolean} includeContainer add container list to check\n * @param {IterativeOptions} options\n * @returns {Array.}\n */\n\n\nvar getCandidatesIteratively = function getCandidatesIteratively(elements, includeContainer, options) {\n var candidates = [];\n var elementsToCheck = Array.from(elements);\n\n while (elementsToCheck.length) {\n var element = elementsToCheck.shift();\n\n if (element.tagName === 'SLOT') {\n // add shadow dom slot scope (slot itself cannot be focusable)\n var assigned = element.assignedElements();\n var content = assigned.length ? assigned : element.children;\n var nestedCandidates = getCandidatesIteratively(content, true, options);\n\n if (options.flatten) {\n candidates.push.apply(candidates, nestedCandidates);\n } else {\n candidates.push({\n scope: element,\n candidates: nestedCandidates\n });\n }\n } else {\n // check candidate element\n var validCandidate = matches.call(element, candidateSelector);\n\n if (validCandidate && options.filter(element) && (includeContainer || !elements.includes(element))) {\n candidates.push(element);\n } // iterate over shadow content if possible\n\n\n var shadowRoot = element.shadowRoot || // check for an undisclosed shadow\n typeof options.getShadowRoot === 'function' && options.getShadowRoot(element);\n var validShadowRoot = !options.shadowRootFilter || options.shadowRootFilter(element);\n\n if (shadowRoot && validShadowRoot) {\n // add shadow dom scope IIF a shadow root node was given; otherwise, an undisclosed\n // shadow exists, so look at light dom children as fallback BUT create a scope for any\n // child candidates found because they're likely slotted elements (elements that are\n // children of the web component element (which has the shadow), in the light dom, but\n // slotted somewhere _inside_ the undisclosed shadow) -- the scope is created below,\n // _after_ we return from this recursive call\n var _nestedCandidates = getCandidatesIteratively(shadowRoot === true ? element.children : shadowRoot.children, true, options);\n\n if (options.flatten) {\n candidates.push.apply(candidates, _nestedCandidates);\n } else {\n candidates.push({\n scope: element,\n candidates: _nestedCandidates\n });\n }\n } else {\n // there's not shadow so just dig into the element's (light dom) children\n // __without__ giving the element special scope treatment\n elementsToCheck.unshift.apply(elementsToCheck, element.children);\n }\n }\n }\n\n return candidates;\n};\n\nvar getTabindex = function getTabindex(node, isScope) {\n if (node.tabIndex < 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 // Also browsers do not return `tabIndex` correctly for contentEditable nodes;\n // so if they don't have a tabindex attribute specifically set, assume it's 0.\n //\n // isScope is positive for custom element with shadow root or slot that by default\n // have tabIndex -1, but need to be sorted by document order in order for their\n // content to be inserted in the correct position\n if ((isScope || /^(AUDIO|VIDEO|DETAILS)$/.test(node.tagName) || node.isContentEditable) && isNaN(parseInt(node.getAttribute('tabindex'), 10))) {\n return 0;\n }\n }\n\n return node.tabIndex;\n};\n\nvar sortOrderedTabbables = function sortOrderedTabbables(a, b) {\n return a.tabIndex === b.tabIndex ? a.documentOrder - b.documentOrder : a.tabIndex - b.tabIndex;\n};\n\nvar isInput = function isInput(node) {\n return node.tagName === 'INPUT';\n};\n\nvar isHiddenInput = function isHiddenInput(node) {\n return isInput(node) && node.type === 'hidden';\n};\n\nvar isDetailsWithSummary = function isDetailsWithSummary(node) {\n var r = node.tagName === 'DETAILS' && Array.prototype.slice.apply(node.children).some(function (child) {\n return child.tagName === 'SUMMARY';\n });\n return r;\n};\n\nvar getCheckedRadio = function getCheckedRadio(nodes, form) {\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].checked && nodes[i].form === form) {\n return nodes[i];\n }\n }\n};\n\nvar isTabbableRadio = function isTabbableRadio(node) {\n if (!node.name) {\n return true;\n }\n\n var radioScope = node.form || getRootNode(node);\n\n var queryRadios = function queryRadios(name) {\n return radioScope.querySelectorAll('input[type=\"radio\"][name=\"' + name + '\"]');\n };\n\n var radioSet;\n\n if (typeof window !== 'undefined' && typeof window.CSS !== 'undefined' && typeof window.CSS.escape === 'function') {\n radioSet = queryRadios(window.CSS.escape(node.name));\n } else {\n try {\n radioSet = queryRadios(node.name);\n } catch (err) {\n // eslint-disable-next-line no-console\n console.error('Looks like you have a radio button with a name attribute containing invalid CSS selector characters and need the CSS.escape polyfill: %s', err.message);\n return false;\n }\n }\n\n var checked = getCheckedRadio(radioSet, node.form);\n return !checked || checked === node;\n};\n\nvar isRadio = function isRadio(node) {\n return isInput(node) && node.type === 'radio';\n};\n\nvar isNonTabbableRadio = function isNonTabbableRadio(node) {\n return isRadio(node) && !isTabbableRadio(node);\n};\n\nvar isZeroArea = function isZeroArea(node) {\n var _node$getBoundingClie = node.getBoundingClientRect(),\n width = _node$getBoundingClie.width,\n height = _node$getBoundingClie.height;\n\n return width === 0 && height === 0;\n};\n\nvar isHidden = function isHidden(node, _ref) {\n var displayCheck = _ref.displayCheck,\n getShadowRoot = _ref.getShadowRoot;\n\n // NOTE: visibility will be `undefined` if node is detached from the document\n // (see notes about this further down), which means we will consider it visible\n // (this is legacy behavior from a very long way back)\n // NOTE: we check this regardless of `displayCheck=\"none\"` because this is a\n // _visibility_ check, not a _display_ check\n if (getComputedStyle(node).visibility === 'hidden') {\n return true;\n }\n\n var isDirectSummary = matches.call(node, 'details>summary:first-of-type');\n var nodeUnderDetails = isDirectSummary ? node.parentElement : node;\n\n if (matches.call(nodeUnderDetails, 'details:not([open]) *')) {\n return true;\n } // The root node is the shadow root if the node is in a shadow DOM; some document otherwise\n // (but NOT _the_ document; see second 'If' comment below for more).\n // If rootNode is shadow root, it'll have a host, which is the element to which the shadow\n // is attached, and the one we need to check if it's in the document or not (because the\n // shadow, and all nodes it contains, is never considered in the document since shadows\n // behave like self-contained DOMs; but if the shadow's HOST, which is part of the document,\n // is hidden, or is not in the document itself but is detached, it will affect the shadow's\n // visibility, including all the nodes it contains). The host could be any normal node,\n // or a custom element (i.e. web component). Either way, that's the one that is considered\n // part of the document, not the shadow root, nor any of its children (i.e. the node being\n // tested).\n // If rootNode is not a shadow root, it won't have a host, and so rootNode should be the\n // document (per the docs) and while it's a Document-type object, that document does not\n // appear to be the same as the node's `ownerDocument` for some reason, so it's safer\n // to ignore the rootNode at this point, and use `node.ownerDocument`. Otherwise,\n // using `rootNode.contains(node)` will _always_ be true we'll get false-positives when\n // node is actually detached.\n\n\n var nodeRootHost = getRootNode(node).host;\n var nodeIsAttached = (nodeRootHost === null || nodeRootHost === void 0 ? void 0 : nodeRootHost.ownerDocument.contains(nodeRootHost)) || node.ownerDocument.contains(node);\n\n if (!displayCheck || displayCheck === 'full') {\n if (typeof getShadowRoot === 'function') {\n // figure out if we should consider the node to be in an undisclosed shadow and use the\n // 'non-zero-area' fallback\n var originalNode = node;\n\n while (node) {\n var parentElement = node.parentElement;\n var rootNode = getRootNode(node);\n\n if (parentElement && !parentElement.shadowRoot && getShadowRoot(parentElement) === true // check if there's an undisclosed shadow\n ) {\n // node has an undisclosed shadow which means we can only treat it as a black box, so we\n // fall back to a non-zero-area test\n return isZeroArea(node);\n } else if (node.assignedSlot) {\n // iterate up slot\n node = node.assignedSlot;\n } else if (!parentElement && rootNode !== node.ownerDocument) {\n // cross shadow boundary\n node = rootNode.host;\n } else {\n // iterate up normal dom\n node = parentElement;\n }\n }\n\n node = originalNode;\n } // else, `getShadowRoot` might be true, but all that does is enable shadow DOM support\n // (i.e. it does not also presume that all nodes might have undisclosed shadows); or\n // it might be a falsy value, which means shadow DOM support is disabled\n // Since we didn't find it sitting in an undisclosed shadow (or shadows are disabled)\n // now we can just test to see if it would normally be visible or not, provided it's\n // attached to the main document.\n // NOTE: We must consider case where node is inside a shadow DOM and given directly to\n // `isTabbable()` or `isFocusable()` -- regardless of `getShadowRoot` option setting.\n\n\n if (nodeIsAttached) {\n // this works wherever the node is: if there's at least one client rect, it's\n // somehow displayed; it also covers the CSS 'display: contents' case where the\n // node itself is hidden in place of its contents; and there's no need to search\n // up the hierarchy either\n return !node.getClientRects().length;\n } // Else, the node isn't attached to the document, which means the `getClientRects()`\n // API will __always__ return zero rects (this can happen, for example, if React\n // is used to render nodes onto a detached tree, as confirmed in this thread:\n // https://github.com/facebook/react/issues/9117#issuecomment-284228870)\n //\n // It also means that even window.getComputedStyle(node).display will return `undefined`\n // because styles are only computed for nodes that are in the document.\n //\n // NOTE: THIS HAS BEEN THE CASE FOR YEARS. It is not new, nor is it caused by tabbable\n // somehow. Though it was never stated officially, anyone who has ever used tabbable\n // APIs on nodes in detached containers has actually implicitly used tabbable in what\n // was later (as of v5.2.0 on Apr 9, 2021) called `displayCheck=\"none\"` mode -- essentially\n // considering __everything__ to be visible because of the innability to determine styles.\n\n } else if (displayCheck === 'non-zero-area') {\n // NOTE: Even though this tests that the node's client rect is non-zero to determine\n // whether it's displayed, and that a detached node will __always__ have a zero-area\n // client rect, we don't special-case for whether the node is attached or not. In\n // this mode, we do want to consider nodes that have a zero area to be hidden at all\n // times, and that includes attached or not.\n return isZeroArea(node);\n } // visible, as far as we can tell, or per current `displayCheck` mode\n\n\n return false;\n}; // form fields (nested) inside a disabled fieldset are not focusable/tabbable\n// unless they are in the _first_ element of the top-most disabled\n// fieldset\n\n\nvar isDisabledFromFieldset = function isDisabledFromFieldset(node) {\n if (/^(INPUT|BUTTON|SELECT|TEXTAREA)$/.test(node.tagName)) {\n var parentNode = node.parentElement; // check if `node` is contained in a disabled \n\n while (parentNode) {\n if (parentNode.tagName === 'FIELDSET' && parentNode.disabled) {\n // look for the first among the children of the disabled \n for (var i = 0; i < parentNode.children.length; i++) {\n var child = parentNode.children.item(i); // when the first (in document order) is found\n\n if (child.tagName === 'LEGEND') {\n // if its parent is not nested in another disabled ,\n // return whether `node` is a descendant of its first \n return matches.call(parentNode, 'fieldset[disabled] *') ? true : !child.contains(node);\n }\n } // the disabled containing `node` has no \n\n\n return true;\n }\n\n parentNode = parentNode.parentElement;\n }\n } // else, node's tabbable/focusable state should not be affected by a fieldset's\n // enabled/disabled state\n\n\n return false;\n};\n\nvar isNodeMatchingSelectorFocusable = function isNodeMatchingSelectorFocusable(options, node) {\n if (node.disabled || isHiddenInput(node) || isHidden(node, options) || // For a details element with a summary, the summary element gets the focus\n isDetailsWithSummary(node) || isDisabledFromFieldset(node)) {\n return false;\n }\n\n return true;\n};\n\nvar isNodeMatchingSelectorTabbable = function isNodeMatchingSelectorTabbable(options, node) {\n if (isNonTabbableRadio(node) || getTabindex(node) < 0 || !isNodeMatchingSelectorFocusable(options, node)) {\n return false;\n }\n\n return true;\n};\n\nvar isValidShadowRootTabbable = function isValidShadowRootTabbable(shadowHostNode) {\n var tabIndex = parseInt(shadowHostNode.getAttribute('tabindex'), 10);\n\n if (isNaN(tabIndex) || tabIndex >= 0) {\n return true;\n } // If a custom element has an explicit negative tabindex,\n // browsers will not allow tab targeting said element's children.\n\n\n return false;\n};\n/**\n * @param {Array.} candidates\n * @returns Element[]\n */\n\n\nvar sortByOrder = function sortByOrder(candidates) {\n var regularTabbables = [];\n var orderedTabbables = [];\n candidates.forEach(function (item, i) {\n var isScope = !!item.scope;\n var element = isScope ? item.scope : item;\n var candidateTabindex = getTabindex(element, isScope);\n var elements = isScope ? sortByOrder(item.candidates) : element;\n\n if (candidateTabindex === 0) {\n isScope ? regularTabbables.push.apply(regularTabbables, elements) : regularTabbables.push(element);\n } else {\n orderedTabbables.push({\n documentOrder: i,\n tabIndex: candidateTabindex,\n item: item,\n isScope: isScope,\n content: elements\n });\n }\n });\n return orderedTabbables.sort(sortOrderedTabbables).reduce(function (acc, sortable) {\n sortable.isScope ? acc.push.apply(acc, sortable.content) : acc.push(sortable.content);\n return acc;\n }, []).concat(regularTabbables);\n};\n\nvar tabbable = function tabbable(el, options) {\n options = options || {};\n var candidates;\n\n if (options.getShadowRoot) {\n candidates = getCandidatesIteratively([el], options.includeContainer, {\n filter: isNodeMatchingSelectorTabbable.bind(null, options),\n flatten: false,\n getShadowRoot: options.getShadowRoot,\n shadowRootFilter: isValidShadowRootTabbable\n });\n } else {\n candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorTabbable.bind(null, options));\n }\n\n return sortByOrder(candidates);\n};\n\nvar focusable = function focusable(el, options) {\n options = options || {};\n var candidates;\n\n if (options.getShadowRoot) {\n candidates = getCandidatesIteratively([el], options.includeContainer, {\n filter: isNodeMatchingSelectorFocusable.bind(null, options),\n flatten: true,\n getShadowRoot: options.getShadowRoot\n });\n } else {\n candidates = getCandidates(el, options.includeContainer, isNodeMatchingSelectorFocusable.bind(null, options));\n }\n\n return candidates;\n};\n\nvar isTabbable = function isTabbable(node, options) {\n options = options || {};\n\n if (!node) {\n throw new Error('No node provided');\n }\n\n if (matches.call(node, candidateSelector) === false) {\n return false;\n }\n\n return isNodeMatchingSelectorTabbable(options, node);\n};\n\nvar focusableCandidateSelector = /* #__PURE__ */candidateSelectors.concat('iframe').join(',');\n\nvar isFocusable = function isFocusable(node, options) {\n options = options || {};\n\n if (!node) {\n throw new Error('No node provided');\n }\n\n if (matches.call(node, focusableCandidateSelector) === false) {\n return false;\n }\n\n return isNodeMatchingSelectorFocusable(options, node);\n};\n\nexport { focusable, isFocusable, isTabbable, tabbable };\n//# sourceMappingURL=index.esm.js.map\n","/*!\n* focus-trap 6.9.4\n* @license MIT, https://github.com/focus-trap/focus-trap/blob/master/LICENSE\n*/\nimport { tabbable, focusable, isTabbable, isFocusable } from 'tabbable';\n\nfunction ownKeys(object, enumerableOnly) {\n var keys = Object.keys(object);\n\n if (Object.getOwnPropertySymbols) {\n var symbols = Object.getOwnPropertySymbols(object);\n enumerableOnly && (symbols = symbols.filter(function (sym) {\n return Object.getOwnPropertyDescriptor(object, sym).enumerable;\n })), keys.push.apply(keys, symbols);\n }\n\n return keys;\n}\n\nfunction _objectSpread2(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = null != arguments[i] ? arguments[i] : {};\n i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {\n _defineProperty(target, key, source[key]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {\n Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));\n });\n }\n\n return target;\n}\n\nfunction _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nvar activeFocusTraps = function () {\n var trapQueue = [];\n return {\n activateTrap: function activateTrap(trap) {\n if (trapQueue.length > 0) {\n var activeTrap = trapQueue[trapQueue.length - 1];\n\n if (activeTrap !== trap) {\n activeTrap.pause();\n }\n }\n\n var trapIndex = trapQueue.indexOf(trap);\n\n if (trapIndex === -1) {\n trapQueue.push(trap);\n } else {\n // move this existing trap to the front of the queue\n trapQueue.splice(trapIndex, 1);\n trapQueue.push(trap);\n }\n },\n deactivateTrap: function deactivateTrap(trap) {\n var trapIndex = trapQueue.indexOf(trap);\n\n if (trapIndex !== -1) {\n trapQueue.splice(trapIndex, 1);\n }\n\n if (trapQueue.length > 0) {\n trapQueue[trapQueue.length - 1].unpause();\n }\n }\n };\n}();\n\nvar isSelectableInput = function isSelectableInput(node) {\n return node.tagName && node.tagName.toLowerCase() === 'input' && typeof node.select === 'function';\n};\n\nvar isEscapeEvent = function isEscapeEvent(e) {\n return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;\n};\n\nvar isTabEvent = function isTabEvent(e) {\n return e.key === 'Tab' || e.keyCode === 9;\n};\n\nvar delay = function delay(fn) {\n return setTimeout(fn, 0);\n}; // Array.find/findIndex() are not supported on IE; this replicates enough\n// of Array.findIndex() for our needs\n\n\nvar findIndex = function findIndex(arr, fn) {\n var idx = -1;\n arr.every(function (value, i) {\n if (fn(value)) {\n idx = i;\n return false; // break\n }\n\n return true; // next\n });\n return idx;\n};\n/**\n * Get an option's value when it could be a plain value, or a handler that provides\n * the value.\n * @param {*} value Option's value to check.\n * @param {...*} [params] Any parameters to pass to the handler, if `value` is a function.\n * @returns {*} The `value`, or the handler's returned value.\n */\n\n\nvar valueOrHandler = function valueOrHandler(value) {\n for (var _len = arguments.length, params = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n params[_key - 1] = arguments[_key];\n }\n\n return typeof value === 'function' ? value.apply(void 0, params) : value;\n};\n\nvar getActualTarget = function getActualTarget(event) {\n // NOTE: If the trap is _inside_ a shadow DOM, event.target will always be the\n // shadow host. However, event.target.composedPath() will be an array of\n // nodes \"clicked\" from inner-most (the actual element inside the shadow) to\n // outer-most (the host HTML document). If we have access to composedPath(),\n // then use its first element; otherwise, fall back to event.target (and\n // this only works for an _open_ shadow DOM; otherwise,\n // composedPath()[0] === event.target always).\n return event.target.shadowRoot && typeof event.composedPath === 'function' ? event.composedPath()[0] : event.target;\n};\n\nvar createFocusTrap = function createFocusTrap(elements, userOptions) {\n // SSR: a live trap shouldn't be created in this type of environment so this\n // should be safe code to execute if the `document` option isn't specified\n var doc = (userOptions === null || userOptions === void 0 ? void 0 : userOptions.document) || document;\n\n var config = _objectSpread2({\n returnFocusOnDeactivate: true,\n escapeDeactivates: true,\n delayInitialFocus: true\n }, userOptions);\n\n var state = {\n // containers given to createFocusTrap()\n // @type {Array}\n containers: [],\n // list of objects identifying tabbable nodes in `containers` in the trap\n // NOTE: it's possible that a group has no tabbable nodes if nodes get removed while the trap\n // is active, but the trap should never get to a state where there isn't at least one group\n // with at least one tabbable node in it (that would lead to an error condition that would\n // result in an error being thrown)\n // @type {Array<{\n // container: HTMLElement,\n // tabbableNodes: Array, // empty if none\n // focusableNodes: Array, // empty if none\n // firstTabbableNode: HTMLElement|null,\n // lastTabbableNode: HTMLElement|null,\n // nextTabbableNode: (node: HTMLElement, forward: boolean) => HTMLElement|undefined\n // }>}\n containerGroups: [],\n // same order/length as `containers` list\n // references to objects in `containerGroups`, but only those that actually have\n // tabbable nodes in them\n // NOTE: same order as `containers` and `containerGroups`, but __not necessarily__\n // the same length\n tabbableGroups: [],\n nodeFocusedBeforeActivation: null,\n mostRecentlyFocusedNode: null,\n active: false,\n paused: false,\n // timer ID for when delayInitialFocus is true and initial focus in this trap\n // has been delayed during activation\n delayInitialFocusTimer: undefined\n };\n var trap; // eslint-disable-line prefer-const -- some private functions reference it, and its methods reference private functions, so we must declare here and define later\n\n /**\n * Gets a configuration option value.\n * @param {Object|undefined} configOverrideOptions If true, and option is defined in this set,\n * value will be taken from this object. Otherwise, value will be taken from base configuration.\n * @param {string} optionName Name of the option whose value is sought.\n * @param {string|undefined} [configOptionName] Name of option to use __instead of__ `optionName`\n * IIF `configOverrideOptions` is not defined. Otherwise, `optionName` is used.\n */\n\n var getOption = function getOption(configOverrideOptions, optionName, configOptionName) {\n return configOverrideOptions && configOverrideOptions[optionName] !== undefined ? configOverrideOptions[optionName] : config[configOptionName || optionName];\n };\n /**\n * Finds the index of the container that contains the element.\n * @param {HTMLElement} element\n * @returns {number} Index of the container in either `state.containers` or\n * `state.containerGroups` (the order/length of these lists are the same); -1\n * if the element isn't found.\n */\n\n\n var findContainerIndex = function findContainerIndex(element) {\n // NOTE: search `containerGroups` because it's possible a group contains no tabbable\n // nodes, but still contains focusable nodes (e.g. if they all have `tabindex=-1`)\n // and we still need to find the element in there\n return state.containerGroups.findIndex(function (_ref) {\n var container = _ref.container,\n tabbableNodes = _ref.tabbableNodes;\n return container.contains(element) || // fall back to explicit tabbable search which will take into consideration any\n // web components if the `tabbableOptions.getShadowRoot` option was used for\n // the trap, enabling shadow DOM support in tabbable (`Node.contains()` doesn't\n // look inside web components even if open)\n tabbableNodes.find(function (node) {\n return node === element;\n });\n });\n };\n /**\n * Gets the node for the given option, which is expected to be an option that\n * can be either a DOM node, a string that is a selector to get a node, `false`\n * (if a node is explicitly NOT given), or a function that returns any of these\n * values.\n * @param {string} optionName\n * @returns {undefined | false | HTMLElement | SVGElement} Returns\n * `undefined` if the option is not specified; `false` if the option\n * resolved to `false` (node explicitly not given); otherwise, the resolved\n * DOM node.\n * @throws {Error} If the option is set, not `false`, and is not, or does not\n * resolve to a node.\n */\n\n\n var getNodeForOption = function getNodeForOption(optionName) {\n var optionValue = config[optionName];\n\n if (typeof optionValue === 'function') {\n for (var _len2 = arguments.length, params = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n params[_key2 - 1] = arguments[_key2];\n }\n\n optionValue = optionValue.apply(void 0, params);\n }\n\n if (optionValue === true) {\n optionValue = undefined; // use default value\n }\n\n if (!optionValue) {\n if (optionValue === undefined || optionValue === false) {\n return optionValue;\n } // else, empty string (invalid), null (invalid), 0 (invalid)\n\n\n throw new Error(\"`\".concat(optionName, \"` was specified but was not a node, or did not return a node\"));\n }\n\n var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point\n\n if (typeof optionValue === 'string') {\n node = doc.querySelector(optionValue); // resolve to node, or null if fails\n\n if (!node) {\n throw new Error(\"`\".concat(optionName, \"` as selector refers to no known node\"));\n }\n }\n\n return node;\n };\n\n var getInitialFocusNode = function getInitialFocusNode() {\n var node = getNodeForOption('initialFocus'); // false explicitly indicates we want no initialFocus at all\n\n if (node === false) {\n return false;\n }\n\n if (node === undefined) {\n // option not specified: use fallback options\n if (findContainerIndex(doc.activeElement) >= 0) {\n node = doc.activeElement;\n } else {\n var firstTabbableGroup = state.tabbableGroups[0];\n var firstTabbableNode = firstTabbableGroup && firstTabbableGroup.firstTabbableNode; // NOTE: `fallbackFocus` option function cannot return `false` (not supported)\n\n node = firstTabbableNode || getNodeForOption('fallbackFocus');\n }\n }\n\n if (!node) {\n throw new Error('Your focus-trap needs to have at least one focusable element');\n }\n\n return node;\n };\n\n var updateTabbableNodes = function updateTabbableNodes() {\n state.containerGroups = state.containers.map(function (container) {\n var tabbableNodes = tabbable(container, config.tabbableOptions); // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes\n // are a superset of tabbable nodes\n\n var focusableNodes = focusable(container, config.tabbableOptions);\n return {\n container: container,\n tabbableNodes: tabbableNodes,\n focusableNodes: focusableNodes,\n firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,\n lastTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[tabbableNodes.length - 1] : null,\n\n /**\n * Finds the __tabbable__ node that follows the given node in the specified direction,\n * in this container, if any.\n * @param {HTMLElement} node\n * @param {boolean} [forward] True if going in forward tab order; false if going\n * in reverse.\n * @returns {HTMLElement|undefined} The next tabbable node, if any.\n */\n nextTabbableNode: function nextTabbableNode(node) {\n var forward = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;\n // NOTE: If tabindex is positive (in order to manipulate the tab order separate\n // from the DOM order), this __will not work__ because the list of focusableNodes,\n // while it contains tabbable nodes, does not sort its nodes in any order other\n // than DOM order, because it can't: Where would you place focusable (but not\n // tabbable) nodes in that order? They have no order, because they aren't tabbale...\n // Support for positive tabindex is already broken and hard to manage (possibly\n // not supportable, TBD), so this isn't going to make things worse than they\n // already are, and at least makes things better for the majority of cases where\n // tabindex is either 0/unset or negative.\n // FYI, positive tabindex issue: https://github.com/focus-trap/focus-trap/issues/375\n var nodeIdx = focusableNodes.findIndex(function (n) {\n return n === node;\n });\n\n if (nodeIdx < 0) {\n return undefined;\n }\n\n if (forward) {\n return focusableNodes.slice(nodeIdx + 1).find(function (n) {\n return isTabbable(n, config.tabbableOptions);\n });\n }\n\n return focusableNodes.slice(0, nodeIdx).reverse().find(function (n) {\n return isTabbable(n, config.tabbableOptions);\n });\n }\n };\n });\n state.tabbableGroups = state.containerGroups.filter(function (group) {\n return group.tabbableNodes.length > 0;\n }); // throw if no groups have tabbable nodes and we don't have a fallback focus node either\n\n if (state.tabbableGroups.length <= 0 && !getNodeForOption('fallbackFocus') // returning false not supported for this option\n ) {\n throw new Error('Your focus-trap must have at least one container with at least one tabbable node in it at all times');\n }\n };\n\n var tryFocus = function tryFocus(node) {\n if (node === false) {\n return;\n }\n\n if (node === doc.activeElement) {\n return;\n }\n\n if (!node || !node.focus) {\n tryFocus(getInitialFocusNode());\n return;\n }\n\n node.focus({\n preventScroll: !!config.preventScroll\n });\n state.mostRecentlyFocusedNode = node;\n\n if (isSelectableInput(node)) {\n node.select();\n }\n };\n\n var getReturnFocusNode = function getReturnFocusNode(previousActiveElement) {\n var node = getNodeForOption('setReturnFocus', previousActiveElement);\n return node ? node : node === false ? false : previousActiveElement;\n }; // This needs to be done on mousedown and touchstart instead of click\n // so that it precedes the focus event.\n\n\n var checkPointerDown = function checkPointerDown(e) {\n var target = getActualTarget(e);\n\n if (findContainerIndex(target) >= 0) {\n // allow the click since it ocurred inside the trap\n return;\n }\n\n if (valueOrHandler(config.clickOutsideDeactivates, e)) {\n // immediately deactivate the trap\n trap.deactivate({\n // if, on deactivation, we should return focus to the node originally-focused\n // when the trap was activated (or the configured `setReturnFocus` node),\n // then assume it's also OK to return focus to the outside node that was\n // just clicked, causing deactivation, as long as that node is focusable;\n // if it isn't focusable, then return focus to the original node focused\n // on activation (or the configured `setReturnFocus` node)\n // NOTE: by setting `returnFocus: false`, deactivate() will do nothing,\n // which will result in the outside click setting focus to the node\n // that was clicked, whether it's focusable or not; by setting\n // `returnFocus: true`, we'll attempt to re-focus the node originally-focused\n // on activation (or the configured `setReturnFocus` node)\n returnFocus: config.returnFocusOnDeactivate && !isFocusable(target, config.tabbableOptions)\n });\n return;\n } // This is needed for mobile devices.\n // (If we'll only let `click` events through,\n // then on mobile they will be blocked anyways if `touchstart` is blocked.)\n\n\n if (valueOrHandler(config.allowOutsideClick, e)) {\n // allow the click outside the trap to take place\n return;\n } // otherwise, prevent the click\n\n\n e.preventDefault();\n }; // In case focus escapes the trap for some strange reason, pull it back in.\n\n\n var checkFocusIn = function checkFocusIn(e) {\n var target = getActualTarget(e);\n var targetContained = findContainerIndex(target) >= 0; // In Firefox when you Tab out of an iframe the Document is briefly focused.\n\n if (targetContained || target instanceof Document) {\n if (targetContained) {\n state.mostRecentlyFocusedNode = target;\n }\n } else {\n // escaped! pull it back in to where it just left\n e.stopImmediatePropagation();\n tryFocus(state.mostRecentlyFocusedNode || getInitialFocusNode());\n }\n }; // Hijack Tab events on the first and last focusable nodes of the trap,\n // in order to prevent focus from escaping. If it escapes for even a\n // moment it can end up scrolling the page and causing confusion so we\n // kind of need to capture the action at the keydown phase.\n\n\n var checkTab = function checkTab(e) {\n var target = getActualTarget(e);\n updateTabbableNodes();\n var destinationNode = null;\n\n if (state.tabbableGroups.length > 0) {\n // make sure the target is actually contained in a group\n // NOTE: the target may also be the container itself if it's focusable\n // with tabIndex='-1' and was given initial focus\n var containerIndex = findContainerIndex(target);\n var containerGroup = containerIndex >= 0 ? state.containerGroups[containerIndex] : undefined;\n\n if (containerIndex < 0) {\n // target not found in any group: quite possible focus has escaped the trap,\n // so bring it back in to...\n if (e.shiftKey) {\n // ...the last node in the last group\n destinationNode = state.tabbableGroups[state.tabbableGroups.length - 1].lastTabbableNode;\n } else {\n // ...the first node in the first group\n destinationNode = state.tabbableGroups[0].firstTabbableNode;\n }\n } else if (e.shiftKey) {\n // REVERSE\n // is the target the first tabbable node in a group?\n var startOfGroupIndex = findIndex(state.tabbableGroups, function (_ref2) {\n var firstTabbableNode = _ref2.firstTabbableNode;\n return target === firstTabbableNode;\n });\n\n if (startOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target, false))) {\n // an exception case where the target is either the container itself, or\n // a non-tabbable node that was given focus (i.e. tabindex is negative\n // and user clicked on it or node was programmatically given focus)\n // and is not followed by any other tabbable node, in which\n // case, we should handle shift+tab as if focus were on the container's\n // first tabbable node, and go to the last tabbable node of the LAST group\n startOfGroupIndex = containerIndex;\n }\n\n if (startOfGroupIndex >= 0) {\n // YES: then shift+tab should go to the last tabbable node in the\n // previous group (and wrap around to the last tabbable node of\n // the LAST group if it's the first tabbable node of the FIRST group)\n var destinationGroupIndex = startOfGroupIndex === 0 ? state.tabbableGroups.length - 1 : startOfGroupIndex - 1;\n var destinationGroup = state.tabbableGroups[destinationGroupIndex];\n destinationNode = destinationGroup.lastTabbableNode;\n }\n } else {\n // FORWARD\n // is the target the last tabbable node in a group?\n var lastOfGroupIndex = findIndex(state.tabbableGroups, function (_ref3) {\n var lastTabbableNode = _ref3.lastTabbableNode;\n return target === lastTabbableNode;\n });\n\n if (lastOfGroupIndex < 0 && (containerGroup.container === target || isFocusable(target, config.tabbableOptions) && !isTabbable(target, config.tabbableOptions) && !containerGroup.nextTabbableNode(target))) {\n // an exception case where the target is the container itself, or\n // a non-tabbable node that was given focus (i.e. tabindex is negative\n // and user clicked on it or node was programmatically given focus)\n // and is not followed by any other tabbable node, in which\n // case, we should handle tab as if focus were on the container's\n // last tabbable node, and go to the first tabbable node of the FIRST group\n lastOfGroupIndex = containerIndex;\n }\n\n if (lastOfGroupIndex >= 0) {\n // YES: then tab should go to the first tabbable node in the next\n // group (and wrap around to the first tabbable node of the FIRST\n // group if it's the last tabbable node of the LAST group)\n var _destinationGroupIndex = lastOfGroupIndex === state.tabbableGroups.length - 1 ? 0 : lastOfGroupIndex + 1;\n\n var _destinationGroup = state.tabbableGroups[_destinationGroupIndex];\n destinationNode = _destinationGroup.firstTabbableNode;\n }\n }\n } else {\n // NOTE: the fallbackFocus option does not support returning false to opt-out\n destinationNode = getNodeForOption('fallbackFocus');\n }\n\n if (destinationNode) {\n e.preventDefault();\n tryFocus(destinationNode);\n } // else, let the browser take care of [shift+]tab and move the focus\n\n };\n\n var checkKey = function checkKey(e) {\n if (isEscapeEvent(e) && valueOrHandler(config.escapeDeactivates, e) !== false) {\n e.preventDefault();\n trap.deactivate();\n return;\n }\n\n if (isTabEvent(e)) {\n checkTab(e);\n return;\n }\n };\n\n var checkClick = function checkClick(e) {\n var target = getActualTarget(e);\n\n if (findContainerIndex(target) >= 0) {\n return;\n }\n\n if (valueOrHandler(config.clickOutsideDeactivates, e)) {\n return;\n }\n\n if (valueOrHandler(config.allowOutsideClick, e)) {\n return;\n }\n\n e.preventDefault();\n e.stopImmediatePropagation();\n }; //\n // EVENT LISTENERS\n //\n\n\n var addListeners = function addListeners() {\n if (!state.active) {\n return;\n } // There can be only one listening focus trap at a time\n\n\n activeFocusTraps.activateTrap(trap); // Delay ensures that the focused element doesn't capture the event\n // that caused the focus trap activation.\n\n state.delayInitialFocusTimer = config.delayInitialFocus ? delay(function () {\n tryFocus(getInitialFocusNode());\n }) : tryFocus(getInitialFocusNode());\n doc.addEventListener('focusin', checkFocusIn, true);\n doc.addEventListener('mousedown', checkPointerDown, {\n capture: true,\n passive: false\n });\n doc.addEventListener('touchstart', checkPointerDown, {\n capture: true,\n passive: false\n });\n doc.addEventListener('click', checkClick, {\n capture: true,\n passive: false\n });\n doc.addEventListener('keydown', checkKey, {\n capture: true,\n passive: false\n });\n return trap;\n };\n\n var removeListeners = function removeListeners() {\n if (!state.active) {\n return;\n }\n\n doc.removeEventListener('focusin', checkFocusIn, true);\n doc.removeEventListener('mousedown', checkPointerDown, true);\n doc.removeEventListener('touchstart', checkPointerDown, true);\n doc.removeEventListener('click', checkClick, true);\n doc.removeEventListener('keydown', checkKey, true);\n return trap;\n }; //\n // TRAP DEFINITION\n //\n\n\n trap = {\n get active() {\n return state.active;\n },\n\n get paused() {\n return state.paused;\n },\n\n activate: function activate(activateOptions) {\n if (state.active) {\n return this;\n }\n\n var onActivate = getOption(activateOptions, 'onActivate');\n var onPostActivate = getOption(activateOptions, 'onPostActivate');\n var checkCanFocusTrap = getOption(activateOptions, 'checkCanFocusTrap');\n\n if (!checkCanFocusTrap) {\n updateTabbableNodes();\n }\n\n state.active = true;\n state.paused = false;\n state.nodeFocusedBeforeActivation = doc.activeElement;\n\n if (onActivate) {\n onActivate();\n }\n\n var finishActivation = function finishActivation() {\n if (checkCanFocusTrap) {\n updateTabbableNodes();\n }\n\n addListeners();\n\n if (onPostActivate) {\n onPostActivate();\n }\n };\n\n if (checkCanFocusTrap) {\n checkCanFocusTrap(state.containers.concat()).then(finishActivation, finishActivation);\n return this;\n }\n\n finishActivation();\n return this;\n },\n deactivate: function deactivate(deactivateOptions) {\n if (!state.active) {\n return this;\n }\n\n var options = _objectSpread2({\n onDeactivate: config.onDeactivate,\n onPostDeactivate: config.onPostDeactivate,\n checkCanReturnFocus: config.checkCanReturnFocus\n }, deactivateOptions);\n\n clearTimeout(state.delayInitialFocusTimer); // noop if undefined\n\n state.delayInitialFocusTimer = undefined;\n removeListeners();\n state.active = false;\n state.paused = false;\n activeFocusTraps.deactivateTrap(trap);\n var onDeactivate = getOption(options, 'onDeactivate');\n var onPostDeactivate = getOption(options, 'onPostDeactivate');\n var checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');\n var returnFocus = getOption(options, 'returnFocus', 'returnFocusOnDeactivate');\n\n if (onDeactivate) {\n onDeactivate();\n }\n\n var finishDeactivation = function finishDeactivation() {\n delay(function () {\n if (returnFocus) {\n tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));\n }\n\n if (onPostDeactivate) {\n onPostDeactivate();\n }\n });\n };\n\n if (returnFocus && checkCanReturnFocus) {\n checkCanReturnFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation)).then(finishDeactivation, finishDeactivation);\n return this;\n }\n\n finishDeactivation();\n return this;\n },\n pause: function pause() {\n if (state.paused || !state.active) {\n return this;\n }\n\n state.paused = true;\n removeListeners();\n return this;\n },\n unpause: function unpause() {\n if (!state.paused || !state.active) {\n return this;\n }\n\n state.paused = false;\n updateTabbableNodes();\n addListeners();\n return this;\n },\n updateContainerElements: function updateContainerElements(containerElements) {\n var elementsAsArray = [].concat(containerElements).filter(Boolean);\n state.containers = elementsAsArray.map(function (element) {\n return typeof element === 'string' ? doc.querySelector(element) : element;\n });\n\n if (state.active) {\n updateTabbableNodes();\n }\n\n return this;\n }\n }; // initialize container elements\n\n trap.updateContainerElements(elements);\n return trap;\n};\n\nexport { createFocusTrap };\n//# sourceMappingURL=focus-trap.esm.js.map\n","// Libraries\nimport { useEffect } from 'react';\nimport { createFocusTrap } from 'focus-trap';\n\nexport const useFocusTrap = (trapFocus, focusTrapRef, initialFocus) => {\n useEffect(() => {\n let focusTrap;\n const focusTrapElement = focusTrapRef.current;\n if (trapFocus && focusTrapElement) {\n focusTrap = createFocusTrap(focusTrapElement, { initialFocus });\n focusTrap.activate();\n }\n return () => {\n if (focusTrap) {\n focusTrap.deactivate();\n }\n };\n }, []);\n};\n","// TODO: Refactor existing modals to use this API and move to common\n\n// Libraries\nimport React, { useRef } from 'react';\nimport PropTypes from 'prop-types';\nimport classNames from 'classnames';\n\n// Hooks\nimport { useScrollDisable } from 'ideation/hooks/base/useScrollDisable';\nimport { useKeyListener } from 'common/hooks/useKeyListener';\nimport { useFocusTrap } from 'ideation/hooks/base/useFocusTrap';\n\n// Enums\nimport Keys from 'common/enums/Key';\n\n// TODO: Remove 'skipFocusTrap' prop after bulk options modal refactor\nconst BaseModal = ({ children, onClose, className, skipFocusTrap, header, footer }) => {\n const modalRef = useRef(null);\n\n useScrollDisable();\n useKeyListener(Keys.ESCAPE, onClose);\n useFocusTrap(!skipFocusTrap, modalRef);\n\n return (\n \n
\n
\n
\n
\n {header ||
}\n
\n \n ×\n \n \n
\n
\n
{children}
\n {footer &&
}\n
{footer}
\n
\n
\n
\n );\n};\n\nBaseModal.propTypes = {\n children: PropTypes.node.isRequired,\n onClose: PropTypes.func,\n className: PropTypes.string,\n skipFocusTrap: PropTypes.bool,\n header: PropTypes.node,\n footer: PropTypes.node,\n};\n\nBaseModal.defaultProps = {\n onClose: () => {},\n className: null,\n skipFocusTrap: false,\n header: null,\n footer: null,\n};\n\nexport default BaseModal;\n","// TODO: Refactor existing modals to use this API and move to common\n\n// Libraries\nimport React, { useEffect, useContext } from 'react';\nimport PropTypes from 'prop-types';\n\n// Contexts\nimport ModalContext from 'contexts/Modal/ModalContext';\n\n// Components\nimport BaseModal from 'ideation/components/base/BaseModal';\n\n// TODO: Remove 'skipFocusTrap' prop after bulk options modal refactor\nconst Modal = ({ isOpen, onClose, children, skipFocusTrap, className, header }) => {\n const { setActiveModal } = useContext(ModalContext);\n useEffect(() => {\n setActiveModal(\n isOpen ? (\n \n {children}\n \n ) : null\n );\n }, [isOpen]);\n return null;\n};\n\nModal.propTypes = {\n isOpen: PropTypes.bool.isRequired,\n onClose: PropTypes.func,\n children: PropTypes.node.isRequired,\n className: PropTypes.string,\n skipFocusTrap: PropTypes.bool,\n header: PropTypes.node,\n};\n\nModal.defaultProps = {\n skipFocusTrap: false,\n className: null,\n header: null,\n onClose: () => {},\n};\n\nexport default Modal;\n"],"names":["ModalRoot","activeModal","PropTypes","createContext","ModalProvider","children","setActiveModal","useState","React","ModalContext","useScrollDisable","htmlClassList","useEffect","useKeyListener","key","onKeyPress","keyListener","event","candidateSelectors","candidateSelector","NoElement","matches","getRootNode","element","getCandidates","el","includeContainer","filter","candidates","getCandidatesIteratively","elements","options","elementsToCheck","assigned","content","nestedCandidates","validCandidate","shadowRoot","validShadowRoot","_nestedCandidates","getTabindex","node","isScope","sortOrderedTabbables","a","b","isInput","isHiddenInput","isDetailsWithSummary","r","child","getCheckedRadio","nodes","form","i","isTabbableRadio","radioScope","queryRadios","name","radioSet","err","checked","isRadio","isNonTabbableRadio","isZeroArea","_node$getBoundingClie","width","height","isHidden","_ref","displayCheck","getShadowRoot","isDirectSummary","nodeUnderDetails","nodeRootHost","nodeIsAttached","originalNode","parentElement","rootNode","isDisabledFromFieldset","parentNode","isNodeMatchingSelectorFocusable","isNodeMatchingSelectorTabbable","isValidShadowRootTabbable","shadowHostNode","tabIndex","sortByOrder","regularTabbables","orderedTabbables","item","candidateTabindex","acc","sortable","tabbable","focusable","isTabbable","focusableCandidateSelector","isFocusable","ownKeys","object","enumerableOnly","keys","symbols","sym","_objectSpread2","target","source","_defineProperty","obj","value","activeFocusTraps","trapQueue","trap","activeTrap","trapIndex","isSelectableInput","isEscapeEvent","isTabEvent","delay","fn","findIndex","arr","idx","valueOrHandler","_len","params","_key","getActualTarget","createFocusTrap","userOptions","doc","config","state","getOption","configOverrideOptions","optionName","configOptionName","findContainerIndex","container","tabbableNodes","getNodeForOption","optionValue","_len2","_key2","getInitialFocusNode","firstTabbableGroup","firstTabbableNode","updateTabbableNodes","focusableNodes","forward","nodeIdx","n","group","tryFocus","getReturnFocusNode","previousActiveElement","checkPointerDown","e","checkFocusIn","targetContained","checkTab","destinationNode","containerIndex","containerGroup","startOfGroupIndex","_ref2","destinationGroupIndex","destinationGroup","lastOfGroupIndex","_ref3","lastTabbableNode","_destinationGroupIndex","_destinationGroup","checkKey","checkClick","addListeners","removeListeners","activateOptions","onActivate","onPostActivate","checkCanFocusTrap","finishActivation","deactivateOptions","onDeactivate","onPostDeactivate","checkCanReturnFocus","returnFocus","finishDeactivation","containerElements","elementsAsArray","useFocusTrap","trapFocus","focusTrapRef","initialFocus","focusTrap","focusTrapElement","BaseModal","onClose","className","skipFocusTrap","header","footer","modalRef","useRef","Keys","classNames","Modal","isOpen","useContext"],"mappings":"uhBAGA,MAAMA,EAAY,CAAC,CAAE,YAAAC,KACdA,GAAoB,KAK3BD,EAAU,UAAY,CACpB,YAAaE,EAAU,QAAA,KACvB,eAAgBA,EAAAA,QAAU,KAAK,UACjC,EAEAF,EAAU,aAAe,CACvB,YAAa,IACf,ECbA,MAAeG,EAAAA,EAAAA,QAAAA,cAAc,CAAA,CAAE,ECOzBC,GAAgB,CAAC,CAAE,SAAAC,KAAe,CACtC,KAAM,CAACJ,EAAaK,CAAc,EAAIC,EAAS,QAAA,SAAA,EAG7C,OAAAC,EAAA,cAACC,EAAa,SAAb,CAAsB,MAAO,CAAE,YAAAR,EAAa,eAAAK,CAAe,CAAA,EACzDD,EACAG,EAAA,cAAAR,EAAA,CAAU,YAAAC,EAA0B,eAAAK,CAAgC,CAAA,CACvE,CAEJ,EAEAF,GAAc,UAAY,CACxB,SAAUF,EAAAA,QAAU,KAAK,UAC3B,ECpBO,MAAMQ,GAAmB,IAAM,CAC9B,MAAAC,EAAgB,OAAO,SAAS,gBAAgB,UAEtDC,EAAAA,QAAAA,UAAU,IACHD,GACLA,EAAc,IAAI,YAAY,EACvB,IAAM,CACXA,EAAc,OAAO,YAAY,CAAA,GAHR,KAK1B,CAAE,CAAA,CACP,ECVaE,GAAiB,CAACC,EAAKC,IAAe,CAC3C,MAAAC,EAAeC,GAAU,CACzBA,EAAM,MAAQH,GAChBC,EAAWE,CAAK,CAClB,EAG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