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,GAE3C,IAAMvF,EAAeyH,EAAUyD,EAAS,gBAClCjL,EAAmBwH,EAAUyD,EAAS,oBACtCnL,EAAsB0H,EAAUyD,EAAS,uBACzCjK,EAAcwG,EAClByD,EACA,cACA,2BAGFlL,SAAAA,IAEA,IAAMsB,EAAqB,WACzB0E,GAAM,WACA/E,GACFkI,EAAS3H,EAAmB0F,EAAMI,8BAEpCrH,SAAAA,GACF,KAGF,OAAIgB,GAAelB,GACjBA,EACEyB,EAAmB0F,EAAMI,8BACzBxF,KAAKR,EAAoBA,GACpB/E,OAGT+E,IACO/E,OAGT0F,MAAK,SAACmJ,GACJ,GAAIlE,EAAMlF,SAAWkF,EAAMnG,OACzB,OAAOxE,KAGT,IAAM8O,EAAU5D,EAAU2D,EAAc,WAClCE,EAAc7D,EAAU2D,EAAc,eAQ5C,OANAlE,EAAMlF,QAAS,EACfqJ,SAAAA,IAEAR,IAEAS,SAAAA,IACO/O,MAGToG,QAAO,SAAC4I,GACN,IAAKrE,EAAMlF,SAAWkF,EAAMnG,OAC1B,OAAOxE,KAGT,IAAMiP,EAAY/D,EAAU8D,EAAgB,aACtCE,EAAgBhE,EAAU8D,EAAgB,iBAShD,OAPArE,EAAMlF,QAAS,EACfwJ,SAAAA,IAEApD,IACAqC,IAEAgB,SAAAA,IACOlP,MAGT+F,wBAAuB,SAAC/B,GACtB,IAAMmL,EAAkB,GAAGpM,OAAOiB,GAAmB0I,OAAOnN,SAU5D,OARAoL,EAAMC,WAAauE,EAAgBrD,KAAI,SAAChF,GAAO,MAC1B,iBAAZA,EAAuByD,EAAIpH,cAAc2D,GAAWA,KAGzD6D,EAAMnG,QACRqH,IAGK7L,IACT,IAIG+F,wBAAwBsE,GAEtBrB,CACT","sources":["webpack:///./node_modules/focus-trap-react/dist/focus-trap-react.js","webpack:///./node_modules/focus-trap-react/node_modules/focus-trap/index.js"],"sourcesContent":["\"use strict\";\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nfunction _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\nfunction _toPropertyKey(arg) { var key = _toPrimitive(arg, \"string\"); return _typeof(key) === \"symbol\" ? key : String(key); }\nfunction _toPrimitive(input, hint) { if (_typeof(input) !== \"object\" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || \"default\"); if (_typeof(res) !== \"object\") return res; throw new TypeError(\"@@toPrimitive must return a primitive value.\"); } return (hint === \"string\" ? String : Number)(input); }\nvar React = require('react');\nvar PropTypes = require('prop-types');\nvar _require = require('focus-trap'),\n createFocusTrap = _require.createFocusTrap;\nvar _require2 = require('tabbable'),\n isFocusable = _require2.isFocusable;\nvar FocusTrap = /*#__PURE__*/function (_React$Component) {\n _inherits(FocusTrap, _React$Component);\n var _super = _createSuper(FocusTrap);\n function FocusTrap(props) {\n var _this;\n _classCallCheck(this, FocusTrap);\n _this = _super.call(this, props);\n _defineProperty(_assertThisInitialized(_this), \"getNodeForOption\", function (optionName) {\n var _this$internalOptions;\n // use internal options first, falling back to original options\n var optionValue = (_this$internalOptions = this.internalOptions[optionName]) !== null && _this$internalOptions !== void 0 ? _this$internalOptions : this.originalOptions[optionName];\n if (typeof optionValue === 'function') {\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 optionValue = optionValue.apply(void 0, params);\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 }\n // else, empty string (invalid), null (invalid), 0 (invalid)\n\n throw new Error(\"`\".concat(optionName, \"` was specified but was not a node, or did not return a node\"));\n }\n var node = optionValue; // could be HTMLElement, SVGElement, or non-empty string at this point\n\n if (typeof optionValue === 'string') {\n var _this$getDocument;\n node = (_this$getDocument = this.getDocument()) === null || _this$getDocument === void 0 ? void 0 : _this$getDocument.querySelector(optionValue); // resolve to node, or null if fails\n if (!node) {\n throw new Error(\"`\".concat(optionName, \"` as selector refers to no known node\"));\n }\n }\n return node;\n });\n _this.handleDeactivate = _this.handleDeactivate.bind(_assertThisInitialized(_this));\n _this.handlePostDeactivate = _this.handlePostDeactivate.bind(_assertThisInitialized(_this));\n _this.handleClickOutsideDeactivates = _this.handleClickOutsideDeactivates.bind(_assertThisInitialized(_this));\n\n // focus-trap options used internally when creating the trap\n _this.internalOptions = {\n // We need to hijack the returnFocusOnDeactivate option,\n // because React can move focus into the element before we arrived at\n // this lifecycle hook (e.g. with autoFocus inputs). So the component\n // captures the previouslyFocusedElement in componentWillMount,\n // then (optionally) returns focus to it in componentWillUnmount.\n returnFocusOnDeactivate: false,\n // the rest of these are also related to deactivation of the trap, and we\n // need to use them and control them as well\n checkCanReturnFocus: null,\n onDeactivate: _this.handleDeactivate,\n onPostDeactivate: _this.handlePostDeactivate,\n // we need to special-case this setting as well so that we can know if we should\n // NOT return focus if the trap gets auto-deactivated as the result of an\n // outside click (otherwise, we'll always think we should return focus because\n // of how we manage that flag internally here)\n clickOutsideDeactivates: _this.handleClickOutsideDeactivates\n };\n\n // original options provided by the consumer\n _this.originalOptions = {\n // because of the above `internalOptions`, we maintain our own flag for\n // this option, and default it to `true` because that's focus-trap's default\n returnFocusOnDeactivate: true,\n // because of the above `internalOptions`, we keep these separate since\n // they're part of the deactivation process which we configure (internally) to\n // be shared between focus-trap and focus-trap-react\n onDeactivate: null,\n onPostDeactivate: null,\n checkCanReturnFocus: null,\n // the user's setting, defaulted to false since focus-trap defaults this to false\n clickOutsideDeactivates: false\n };\n var focusTrapOptions = props.focusTrapOptions;\n for (var optionName in focusTrapOptions) {\n if (!Object.prototype.hasOwnProperty.call(focusTrapOptions, optionName)) {\n continue;\n }\n if (optionName === 'returnFocusOnDeactivate' || optionName === 'onDeactivate' || optionName === 'onPostDeactivate' || optionName === 'checkCanReturnFocus' || optionName === 'clickOutsideDeactivates') {\n _this.originalOptions[optionName] = focusTrapOptions[optionName];\n continue; // exclude from internalOptions\n }\n\n _this.internalOptions[optionName] = focusTrapOptions[optionName];\n }\n\n // if set, `{ target: Node, allowDeactivation: boolean }` where `target` is the outside\n // node that was clicked, and `allowDeactivation` is the result of the consumer's\n // option (stored in `this.originalOptions.clickOutsideDeactivates`, which may be a\n // function) whether to allow or deny auto-deactivation on click on this outside node\n _this.outsideClick = null;\n\n // elements from which to create the focus trap on mount; if a child is used\n // instead of the `containerElements` prop, we'll get the child's related\n // element when the trap renders and then is declared 'mounted'\n _this.focusTrapElements = props.containerElements || [];\n\n // now we remember what the currently focused element is, not relying on focus-trap\n _this.updatePreviousElement();\n return _this;\n }\n\n /**\n * Gets the configured document.\n * @returns {Document|undefined} Configured document, falling back to the main\n * document, if it exists. During SSR, `undefined` is returned since the\n * document doesn't exist.\n */\n _createClass(FocusTrap, [{\n key: \"getDocument\",\n value: function getDocument() {\n // SSR: careful to check if `document` exists before accessing it as a variable\n return this.props.focusTrapOptions.document || (typeof document !== 'undefined' ? document : undefined);\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 key: \"getReturnFocusNode\",\n value: function getReturnFocusNode() {\n var node = this.getNodeForOption('setReturnFocus', this.previouslyFocusedElement);\n return node ? node : node === false ? false : this.previouslyFocusedElement;\n }\n\n /** Update the previously focused element with the currently focused element. */\n }, {\n key: \"updatePreviousElement\",\n value: function updatePreviousElement() {\n var currentDocument = this.getDocument();\n if (currentDocument) {\n this.previouslyFocusedElement = currentDocument.activeElement;\n }\n }\n }, {\n key: \"deactivateTrap\",\n value: function deactivateTrap() {\n // NOTE: it's possible the focus trap has already been deactivated without our knowing it,\n // especially if the user set the `clickOutsideDeactivates: true` option on the trap,\n // and the mouse was clicked on some element outside the trap; at that point, focus-trap\n // will initiate its auto-deactivation process, which will call our own\n // handleDeactivate(), which will call into this method\n if (!this.focusTrap || !this.focusTrap.active) {\n return;\n }\n this.focusTrap.deactivate({\n // NOTE: we never let the trap return the focus since we do that ourselves\n returnFocus: false,\n // we'll call this in our own post deactivate handler so make sure the trap doesn't\n // do it prematurely\n checkCanReturnFocus: null,\n // let it call the user's original deactivate handler, if any, instead of\n // our own which calls back into this function\n onDeactivate: this.originalOptions.onDeactivate\n // NOTE: for post deactivate, don't specify anything so that it calls the\n // onPostDeactivate handler specified on `this.internalOptions`\n // which will always be our own `handlePostDeactivate()` handler, which\n // will finish things off by calling the user's provided onPostDeactivate\n // handler, if any, at the right time\n // onPostDeactivate: NOTHING\n });\n }\n }, {\n key: \"handleClickOutsideDeactivates\",\n value: function handleClickOutsideDeactivates(event) {\n // use consumer's option (or call their handler) as the permission or denial\n var allowDeactivation = typeof this.originalOptions.clickOutsideDeactivates === 'function' ? this.originalOptions.clickOutsideDeactivates.call(null, event) // call out of context\n : this.originalOptions.clickOutsideDeactivates; // boolean\n\n if (allowDeactivation) {\n // capture the outside target that was clicked so we can use it in the deactivation\n // process since the consumer allowed it to cause auto-deactivation\n this.outsideClick = {\n target: event.target,\n allowDeactivation: allowDeactivation\n };\n }\n return allowDeactivation;\n }\n }, {\n key: \"handleDeactivate\",\n value: function handleDeactivate() {\n if (this.originalOptions.onDeactivate) {\n this.originalOptions.onDeactivate.call(null); // call user's handler out of context\n }\n\n this.deactivateTrap();\n }\n }, {\n key: \"handlePostDeactivate\",\n value: function handlePostDeactivate() {\n var _this2 = this;\n var finishDeactivation = function finishDeactivation() {\n var returnFocusNode = _this2.getReturnFocusNode();\n var canReturnFocus = !!(\n // did the consumer allow it?\n\n _this2.originalOptions.returnFocusOnDeactivate && // can we actually focus the node?\n returnFocusNode !== null && returnFocusNode !== void 0 && returnFocusNode.focus && (\n // was there an outside click that allowed deactivation?\n !_this2.outsideClick ||\n // did the consumer allow deactivation when the outside node was clicked?\n _this2.outsideClick.allowDeactivation &&\n // is the outside node NOT focusable (implying that it did NOT receive focus\n // as a result of the click-through) -- in which case do NOT restore focus\n // to `returnFocusNode` because focus should remain on the outside node\n !isFocusable(_this2.outsideClick.target, _this2.internalOptions.tabbableOptions))\n\n // if no, the restore focus to `returnFocusNode` at this point\n );\n\n var _this2$internalOption = _this2.internalOptions.preventScroll,\n preventScroll = _this2$internalOption === void 0 ? false : _this2$internalOption;\n if (canReturnFocus) {\n // return focus to the element that had focus when the trap was activated\n returnFocusNode.focus({\n preventScroll: preventScroll\n });\n }\n if (_this2.originalOptions.onPostDeactivate) {\n _this2.originalOptions.onPostDeactivate.call(null); // don't call it in context of \"this\"\n }\n\n _this2.outsideClick = null; // reset: no longer needed\n };\n\n if (this.originalOptions.checkCanReturnFocus) {\n this.originalOptions.checkCanReturnFocus.call(null, this.getReturnFocusNode()) // call out of context\n .then(finishDeactivation, finishDeactivation);\n } else {\n finishDeactivation();\n }\n }\n }, {\n key: \"setupFocusTrap\",\n value: function setupFocusTrap() {\n if (this.focusTrap) {\n // trap already exists: it's possible we're in StrictMode and we're being remounted,\n // in which case, we will have deactivated the trap when we got unmounted (remember,\n // StrictMode, in development, purposely unmounts and remounts components after\n // mounting them the first time to make sure they have reusable state,\n // @see https://reactjs.org/docs/strict-mode.html#ensuring-reusable-state) so now\n // we need to restore the state of the trap according to our component state\n // NOTE: Strict mode __violates__ assumptions about the `componentWillUnmount()` API\n // which clearly states -- even for React 18 -- that, \"Once a component instance is\n // unmounted, __it will never be mounted again.__\" (emphasis ours). So when we get\n // unmounted, we assume we're gone forever and we deactivate the trap. But then\n // we get remounted and we're supposed to restore state. But if you had paused,\n // we've now deactivated (we don't know we're amount to get remounted again)\n // which means we need to reactivate and then pause. Otherwise, do nothing.\n if (this.props.active && !this.focusTrap.active) {\n this.focusTrap.activate();\n if (this.props.paused) {\n this.focusTrap.pause();\n }\n }\n } else {\n var nodesExist = this.focusTrapElements.some(Boolean);\n if (nodesExist) {\n // eslint-disable-next-line react/prop-types -- _createFocusTrap is an internal prop\n this.focusTrap = this.props._createFocusTrap(this.focusTrapElements, this.internalOptions);\n if (this.props.active) {\n this.focusTrap.activate();\n }\n if (this.props.paused) {\n this.focusTrap.pause();\n }\n }\n }\n }\n }, {\n key: \"componentDidMount\",\n value: function componentDidMount() {\n if (this.props.active) {\n this.setupFocusTrap();\n }\n // else, wait for later activation in case the `focusTrapOptions` will be updated\n // again before the trap is activated (e.g. if waiting to know what the document\n // object will be, so the Trap must be rendered, but the consumer is waiting to\n // activate until they have obtained the document from a ref)\n // @see https://github.com/focus-trap/focus-trap-react/issues/539\n }\n }, {\n key: \"componentDidUpdate\",\n value: function componentDidUpdate(prevProps) {\n if (this.focusTrap) {\n if (prevProps.containerElements !== this.props.containerElements) {\n this.focusTrap.updateContainerElements(this.props.containerElements);\n }\n var hasActivated = !prevProps.active && this.props.active;\n var hasDeactivated = prevProps.active && !this.props.active;\n var hasPaused = !prevProps.paused && this.props.paused;\n var hasUnpaused = prevProps.paused && !this.props.paused;\n if (hasActivated) {\n this.updatePreviousElement();\n this.focusTrap.activate();\n }\n if (hasDeactivated) {\n this.deactivateTrap();\n return; // un/pause does nothing on an inactive trap\n }\n\n if (hasPaused) {\n this.focusTrap.pause();\n }\n if (hasUnpaused) {\n this.focusTrap.unpause();\n }\n } else {\n // NOTE: if we're in `componentDidUpdate` and we don't have a trap yet,\n // it either means it shouldn't be active, or it should be but none of\n // of given `containerElements` were present in the DOM the last time\n // we tried to create the trap\n\n if (prevProps.containerElements !== this.props.containerElements) {\n this.focusTrapElements = this.props.containerElements;\n }\n\n // don't create the trap unless it should be active in case the consumer\n // is still updating `focusTrapOptions`\n // @see https://github.com/focus-trap/focus-trap-react/issues/539\n if (this.props.active) {\n this.updatePreviousElement();\n this.setupFocusTrap();\n }\n }\n }\n }, {\n key: \"componentWillUnmount\",\n value: function componentWillUnmount() {\n this.deactivateTrap();\n }\n }, {\n key: \"render\",\n value: function render() {\n var _this3 = this;\n var child = this.props.children ? React.Children.only(this.props.children) : undefined;\n if (child) {\n if (child.type && child.type === React.Fragment) {\n throw new Error('A focus-trap cannot use a Fragment as its child container. Try replacing it with a
element.');\n }\n var callbackRef = function callbackRef(element) {\n var containerElements = _this3.props.containerElements;\n if (child) {\n if (typeof child.ref === 'function') {\n child.ref(element);\n } else if (child.ref) {\n child.ref.current = element;\n }\n }\n _this3.focusTrapElements = containerElements ? containerElements : [element];\n };\n var childWithRef = React.cloneElement(child, {\n ref: callbackRef\n });\n return childWithRef;\n }\n return null;\n }\n }]);\n return FocusTrap;\n}(React.Component); // support server-side rendering where `Element` will not be defined\nvar ElementType = typeof Element === 'undefined' ? Function : Element;\nFocusTrap.propTypes = {\n active: PropTypes.bool,\n paused: PropTypes.bool,\n focusTrapOptions: PropTypes.shape({\n document: PropTypes.object,\n onActivate: PropTypes.func,\n onPostActivate: PropTypes.func,\n checkCanFocusTrap: PropTypes.func,\n onDeactivate: PropTypes.func,\n onPostDeactivate: PropTypes.func,\n checkCanReturnFocus: PropTypes.func,\n initialFocus: PropTypes.oneOfType([PropTypes.instanceOf(ElementType), PropTypes.string, PropTypes.bool, PropTypes.func]),\n fallbackFocus: PropTypes.oneOfType([PropTypes.instanceOf(ElementType), PropTypes.string,\n // NOTE: does not support `false` as value (or return value from function)\n PropTypes.func]),\n escapeDeactivates: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),\n clickOutsideDeactivates: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),\n returnFocusOnDeactivate: PropTypes.bool,\n setReturnFocus: PropTypes.oneOfType([PropTypes.instanceOf(ElementType), PropTypes.string, PropTypes.bool, PropTypes.func]),\n allowOutsideClick: PropTypes.oneOfType([PropTypes.bool, PropTypes.func]),\n preventScroll: PropTypes.bool,\n tabbableOptions: PropTypes.shape({\n displayCheck: PropTypes.oneOf(['full', 'legacy-full', 'non-zero-area', 'none']),\n getShadowRoot: PropTypes.oneOfType([PropTypes.bool, PropTypes.func])\n }),\n trapStack: PropTypes.array,\n isKeyForward: PropTypes.func,\n isKeyBackward: PropTypes.func\n }),\n containerElements: PropTypes.arrayOf(PropTypes.instanceOf(ElementType)),\n // DOM element ONLY\n children: PropTypes.oneOfType([PropTypes.element,\n // React element\n PropTypes.instanceOf(ElementType) // DOM element\n ])\n\n // NOTE: _createFocusTrap is internal, for testing purposes only, so we don't\n // specify it here. It's expected to be set to the function returned from\n // require('focus-trap'), or one with a compatible interface.\n};\n\nFocusTrap.defaultProps = {\n active: true,\n paused: false,\n focusTrapOptions: {},\n _createFocusTrap: createFocusTrap\n};\nmodule.exports = FocusTrap;","import { tabbable, focusable, isFocusable, isTabbable } from 'tabbable';\n\nconst activeFocusTraps = {\n activateTrap(trapStack, trap) {\n if (trapStack.length > 0) {\n const activeTrap = trapStack[trapStack.length - 1];\n if (activeTrap !== trap) {\n activeTrap.pause();\n }\n }\n\n const trapIndex = trapStack.indexOf(trap);\n if (trapIndex === -1) {\n trapStack.push(trap);\n } else {\n // move this existing trap to the front of the queue\n trapStack.splice(trapIndex, 1);\n trapStack.push(trap);\n }\n },\n\n deactivateTrap(trapStack, trap) {\n const trapIndex = trapStack.indexOf(trap);\n if (trapIndex !== -1) {\n trapStack.splice(trapIndex, 1);\n }\n\n if (trapStack.length > 0) {\n trapStack[trapStack.length - 1].unpause();\n }\n },\n};\n\nconst isSelectableInput = function (node) {\n return (\n node.tagName &&\n node.tagName.toLowerCase() === 'input' &&\n typeof node.select === 'function'\n );\n};\n\nconst isEscapeEvent = function (e) {\n return e.key === 'Escape' || e.key === 'Esc' || e.keyCode === 27;\n};\n\nconst isTabEvent = function (e) {\n return e.key === 'Tab' || e.keyCode === 9;\n};\n\n// checks for TAB by default\nconst isKeyForward = function (e) {\n return isTabEvent(e) && !e.shiftKey;\n};\n\n// checks for SHIFT+TAB by default\nconst isKeyBackward = function (e) {\n return isTabEvent(e) && e.shiftKey;\n};\n\nconst delay = function (fn) {\n return setTimeout(fn, 0);\n};\n\n// Array.find/findIndex() are not supported on IE; this replicates enough\n// of Array.findIndex() for our needs\nconst findIndex = function (arr, fn) {\n let idx = -1;\n\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\n return idx;\n};\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 */\nconst valueOrHandler = function (value, ...params) {\n return typeof value === 'function' ? value(...params) : value;\n};\n\nconst getActualTarget = function (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'\n ? event.composedPath()[0]\n : event.target;\n};\n\n// NOTE: this must be _outside_ `createFocusTrap()` to make sure all traps in this\n// current instance use the same stack if `userOptions.trapStack` isn't specified\nconst internalTrapStack = [];\n\nconst createFocusTrap = function (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 const doc = userOptions?.document || document;\n\n const trapStack = userOptions?.trapStack || internalTrapStack;\n\n const config = {\n returnFocusOnDeactivate: true,\n escapeDeactivates: true,\n delayInitialFocus: true,\n isKeyForward,\n isKeyBackward,\n ...userOptions,\n };\n\n const state = {\n // containers given to createFocusTrap()\n // @type {Array}\n containers: [],\n\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: [], // same order/length as `containers` list\n\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\n nodeFocusedBeforeActivation: null,\n mostRecentlyFocusedNode: null,\n active: false,\n paused: false,\n\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\n let 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 const getOption = (configOverrideOptions, optionName, configOptionName) => {\n return configOverrideOptions &&\n configOverrideOptions[optionName] !== undefined\n ? configOverrideOptions[optionName]\n : config[configOptionName || optionName];\n };\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 const findContainerIndex = function (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(\n ({ container, tabbableNodes }) =>\n container.contains(element) ||\n // 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((node) => 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 const getNodeForOption = function (optionName, ...params) {\n let optionValue = config[optionName];\n\n if (typeof optionValue === 'function') {\n optionValue = optionValue(...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 }\n // else, empty string (invalid), null (invalid), 0 (invalid)\n\n throw new Error(\n `\\`${optionName}\\` was specified but was not a node, or did not return a node`\n );\n }\n\n let 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 if (!node) {\n throw new Error(\n `\\`${optionName}\\` as selector refers to no known node`\n );\n }\n }\n\n return node;\n };\n\n const getInitialFocusNode = function () {\n let node = getNodeForOption('initialFocus');\n\n // false explicitly indicates we want no initialFocus at all\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 const firstTabbableGroup = state.tabbableGroups[0];\n const firstTabbableNode =\n firstTabbableGroup && firstTabbableGroup.firstTabbableNode;\n\n // NOTE: `fallbackFocus` option function cannot return `false` (not supported)\n node = firstTabbableNode || getNodeForOption('fallbackFocus');\n }\n }\n\n if (!node) {\n throw new Error(\n 'Your focus-trap needs to have at least one focusable element'\n );\n }\n\n return node;\n };\n\n const updateTabbableNodes = function () {\n state.containerGroups = state.containers.map((container) => {\n const tabbableNodes = tabbable(container, config.tabbableOptions);\n\n // NOTE: if we have tabbable nodes, we must have focusable nodes; focusable nodes\n // are a superset of tabbable nodes\n const focusableNodes = focusable(container, config.tabbableOptions);\n\n return {\n container,\n tabbableNodes,\n focusableNodes,\n firstTabbableNode: tabbableNodes.length > 0 ? tabbableNodes[0] : null,\n lastTabbableNode:\n tabbableNodes.length > 0\n ? tabbableNodes[tabbableNodes.length - 1]\n : 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(node, forward = 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 const nodeIdx = focusableNodes.findIndex((n) => n === node);\n if (nodeIdx < 0) {\n return undefined;\n }\n\n if (forward) {\n return focusableNodes\n .slice(nodeIdx + 1)\n .find((n) => isTabbable(n, config.tabbableOptions));\n }\n\n return focusableNodes\n .slice(0, nodeIdx)\n .reverse()\n .find((n) => isTabbable(n, config.tabbableOptions));\n },\n };\n });\n\n state.tabbableGroups = state.containerGroups.filter(\n (group) => group.tabbableNodes.length > 0\n );\n\n // throw if no groups have tabbable nodes and we don't have a fallback focus node either\n if (\n state.tabbableGroups.length <= 0 &&\n !getNodeForOption('fallbackFocus') // returning false not supported for this option\n ) {\n throw new Error(\n 'Your focus-trap must have at least one container with at least one tabbable node in it at all times'\n );\n }\n };\n\n const tryFocus = function (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({ preventScroll: !!config.preventScroll });\n state.mostRecentlyFocusedNode = node;\n\n if (isSelectableInput(node)) {\n node.select();\n }\n };\n\n const getReturnFocusNode = function (previousActiveElement) {\n const node = getNodeForOption('setReturnFocus', previousActiveElement);\n return node ? node : node === false ? false : previousActiveElement;\n };\n\n // This needs to be done on mousedown and touchstart instead of click\n // so that it precedes the focus event.\n const checkPointerDown = function (e) {\n const 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 // 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 (and if not focusable, to \"nothing\"); by setting\n // `returnFocus: true`, we'll attempt to re-focus the node originally-focused\n // on activation (or the configured `setReturnFocus` node), whether the\n // outside click was on a focusable node or not\n returnFocus: config.returnFocusOnDeactivate,\n });\n return;\n }\n\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 if (valueOrHandler(config.allowOutsideClick, e)) {\n // allow the click outside the trap to take place\n return;\n }\n\n // otherwise, prevent the click\n e.preventDefault();\n };\n\n // In case focus escapes the trap for some strange reason, pull it back in.\n const checkFocusIn = function (e) {\n const target = getActualTarget(e);\n const targetContained = findContainerIndex(target) >= 0;\n\n // In Firefox when you Tab out of an iframe the Document is briefly focused.\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 };\n\n // Hijack key nav 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 const checkKeyNav = function (event, isBackward = false) {\n const target = getActualTarget(event);\n updateTabbableNodes();\n\n let 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 const containerIndex = findContainerIndex(target);\n const containerGroup =\n 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 into...\n if (isBackward) {\n // ...the last node in the last group\n destinationNode =\n state.tabbableGroups[state.tabbableGroups.length - 1]\n .lastTabbableNode;\n } else {\n // ...the first node in the first group\n destinationNode = state.tabbableGroups[0].firstTabbableNode;\n }\n } else if (isBackward) {\n // REVERSE\n\n // is the target the first tabbable node in a group?\n let startOfGroupIndex = findIndex(\n state.tabbableGroups,\n ({ firstTabbableNode }) => target === firstTabbableNode\n );\n\n if (\n startOfGroupIndex < 0 &&\n (containerGroup.container === target ||\n (isFocusable(target, config.tabbableOptions) &&\n !isTabbable(target, config.tabbableOptions) &&\n !containerGroup.nextTabbableNode(target, false)))\n ) {\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 const destinationGroupIndex =\n startOfGroupIndex === 0\n ? state.tabbableGroups.length - 1\n : startOfGroupIndex - 1;\n\n const destinationGroup = state.tabbableGroups[destinationGroupIndex];\n destinationNode = destinationGroup.lastTabbableNode;\n } else if (!isTabEvent(event)) {\n // user must have customized the nav keys so we have to move focus manually _within_\n // the active group: do this based on the order determined by tabbable()\n destinationNode = containerGroup.nextTabbableNode(target, false);\n }\n } else {\n // FORWARD\n\n // is the target the last tabbable node in a group?\n let lastOfGroupIndex = findIndex(\n state.tabbableGroups,\n ({ lastTabbableNode }) => target === lastTabbableNode\n );\n\n if (\n lastOfGroupIndex < 0 &&\n (containerGroup.container === target ||\n (isFocusable(target, config.tabbableOptions) &&\n !isTabbable(target, config.tabbableOptions) &&\n !containerGroup.nextTabbableNode(target)))\n ) {\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 const destinationGroupIndex =\n lastOfGroupIndex === state.tabbableGroups.length - 1\n ? 0\n : lastOfGroupIndex + 1;\n\n const destinationGroup = state.tabbableGroups[destinationGroupIndex];\n destinationNode = destinationGroup.firstTabbableNode;\n } else if (!isTabEvent(event)) {\n // user must have customized the nav keys so we have to move focus manually _within_\n // the active group: do this based on the order determined by tabbable()\n destinationNode = containerGroup.nextTabbableNode(target);\n }\n }\n } else {\n // no groups available\n // NOTE: the fallbackFocus option does not support returning false to opt-out\n destinationNode = getNodeForOption('fallbackFocus');\n }\n\n if (destinationNode) {\n if (isTabEvent(event)) {\n // since tab natively moves focus, we wouldn't have a destination node unless we\n // were on the edge of a container and had to move to the next/previous edge, in\n // which case we want to prevent default to keep the browser from moving focus\n // to where it normally would\n event.preventDefault();\n }\n tryFocus(destinationNode);\n }\n // else, let the browser take care of [shift+]tab and move the focus\n };\n\n const checkKey = function (event) {\n if (\n isEscapeEvent(event) &&\n valueOrHandler(config.escapeDeactivates, event) !== false\n ) {\n event.preventDefault();\n trap.deactivate();\n return;\n }\n\n if (config.isKeyForward(event) || config.isKeyBackward(event)) {\n checkKeyNav(event, config.isKeyBackward(event));\n }\n };\n\n const checkClick = function (e) {\n const 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\n //\n // EVENT LISTENERS\n //\n\n const addListeners = function () {\n if (!state.active) {\n return;\n }\n\n // There can be only one listening focus trap at a time\n activeFocusTraps.activateTrap(trapStack, trap);\n\n // Delay ensures that the focused element doesn't capture the event\n // that caused the focus trap activation.\n state.delayInitialFocusTimer = config.delayInitialFocus\n ? delay(function () {\n tryFocus(getInitialFocusNode());\n })\n : tryFocus(getInitialFocusNode());\n\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\n return trap;\n };\n\n const removeListeners = function () {\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\n return trap;\n };\n\n //\n // TRAP DEFINITION\n //\n\n trap = {\n get active() {\n return state.active;\n },\n\n get paused() {\n return state.paused;\n },\n\n activate(activateOptions) {\n if (state.active) {\n return this;\n }\n\n const onActivate = getOption(activateOptions, 'onActivate');\n const onPostActivate = getOption(activateOptions, 'onPostActivate');\n const 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 onActivate?.();\n\n const finishActivation = () => {\n if (checkCanFocusTrap) {\n updateTabbableNodes();\n }\n addListeners();\n onPostActivate?.();\n };\n\n if (checkCanFocusTrap) {\n checkCanFocusTrap(state.containers.concat()).then(\n finishActivation,\n finishActivation\n );\n return this;\n }\n\n finishActivation();\n return this;\n },\n\n deactivate(deactivateOptions) {\n if (!state.active) {\n return this;\n }\n\n const options = {\n onDeactivate: config.onDeactivate,\n onPostDeactivate: config.onPostDeactivate,\n checkCanReturnFocus: config.checkCanReturnFocus,\n ...deactivateOptions,\n };\n\n clearTimeout(state.delayInitialFocusTimer); // noop if undefined\n state.delayInitialFocusTimer = undefined;\n\n removeListeners();\n state.active = false;\n state.paused = false;\n\n activeFocusTraps.deactivateTrap(trapStack, trap);\n\n const onDeactivate = getOption(options, 'onDeactivate');\n const onPostDeactivate = getOption(options, 'onPostDeactivate');\n const checkCanReturnFocus = getOption(options, 'checkCanReturnFocus');\n const returnFocus = getOption(\n options,\n 'returnFocus',\n 'returnFocusOnDeactivate'\n );\n\n onDeactivate?.();\n\n const finishDeactivation = () => {\n delay(() => {\n if (returnFocus) {\n tryFocus(getReturnFocusNode(state.nodeFocusedBeforeActivation));\n }\n onPostDeactivate?.();\n });\n };\n\n if (returnFocus && checkCanReturnFocus) {\n checkCanReturnFocus(\n getReturnFocusNode(state.nodeFocusedBeforeActivation)\n ).then(finishDeactivation, finishDeactivation);\n return this;\n }\n\n finishDeactivation();\n return this;\n },\n\n pause(pauseOptions) {\n if (state.paused || !state.active) {\n return this;\n }\n\n const onPause = getOption(pauseOptions, 'onPause');\n const onPostPause = getOption(pauseOptions, 'onPostPause');\n\n state.paused = true;\n onPause?.();\n\n removeListeners();\n\n onPostPause?.();\n return this;\n },\n\n unpause(unpauseOptions) {\n if (!state.paused || !state.active) {\n return this;\n }\n\n const onUnpause = getOption(unpauseOptions, 'onUnpause');\n const onPostUnpause = getOption(unpauseOptions, 'onPostUnpause');\n\n state.paused = false;\n onUnpause?.();\n\n updateTabbableNodes();\n addListeners();\n\n onPostUnpause?.();\n return this;\n },\n\n updateContainerElements(containerElements) {\n const elementsAsArray = [].concat(containerElements).filter(Boolean);\n\n state.containers = elementsAsArray.map((element) =>\n typeof element === 'string' ? doc.querySelector(element) : element\n );\n\n if (state.active) {\n updateTabbableNodes();\n }\n\n return this;\n },\n };\n\n // initialize container elements\n trap.updateContainerElements(elements);\n\n return trap;\n};\n\nexport { createFocusTrap };\n"],"names":["_typeof","obj","Symbol","iterator","constructor","prototype","_defineProperties","target","props","i","length","descriptor","enumerable","configurable","writable","Object","defineProperty","_toPropertyKey","key","_setPrototypeOf","o","p","setPrototypeOf","bind","__proto__","_createSuper","Derived","hasNativeReflectConstruct","Reflect","construct","sham","Proxy","Boolean","valueOf","call","e","_isNativeReflectConstruct","result","Super","_getPrototypeOf","NewTarget","this","arguments","apply","self","TypeError","_assertThisInitialized","_possibleConstructorReturn","ReferenceError","getPrototypeOf","arg","input","hint","prim","toPrimitive","undefined","res","String","Number","_toPrimitive","React","PropTypes","createFocusTrap","isFocusable","FocusTrap","_React$Component","subClass","superClass","create","value","_inherits","Constructor","protoProps","staticProps","_super","_this","instance","_classCallCheck","optionName","_this$internalOptions","optionValue","internalOptions","originalOptions","_len","params","Array","_key","Error","concat","_this$getDocument","node","getDocument","querySelector","handleDeactivate","handlePostDeactivate","handleClickOutsideDeactivates","returnFocusOnDeactivate","checkCanReturnFocus","onDeactivate","onPostDeactivate","clickOutsideDeactivates","focusTrapOptions","hasOwnProperty","outsideClick","focusTrapElements","containerElements","updatePreviousElement","document","getNodeForOption","previouslyFocusedElement","currentDocument","activeElement","focusTrap","active","deactivate","returnFocus","event","allowDeactivation","deactivateTrap","_this2","finishDeactivation","returnFocusNode","getReturnFocusNode","canReturnFocus","focus","tabbableOptions","_this2$internalOption","preventScroll","then","activate","paused","pause","some","_createFocusTrap","setupFocusTrap","prevProps","updateContainerElements","hasActivated","hasDeactivated","hasPaused","hasUnpaused","unpause","_this3","child","children","Children","only","type","Fragment","cloneElement","ref","element","current","Component","ElementType","Element","Function","propTypes","bool","shape","object","onActivate","func","onPostActivate","checkCanFocusTrap","initialFocus","oneOfType","instanceOf","string","fallbackFocus","escapeDeactivates","setReturnFocus","allowOutsideClick","displayCheck","oneOf","getShadowRoot","trapStack","array","isKeyForward","isKeyBackward","arrayOf","defaultProps","module","exports","activeFocusTraps","trap","activeTrap","trapIndex","indexOf","splice","push","isTabEvent","keyCode","shiftKey","delay","fn","setTimeout","findIndex","arr","idx","every","valueOrHandler","getActualTarget","shadowRoot","composedPath","internalTrapStack","elements","userOptions","doc","config","_objectSpread","delayInitialFocus","state","containers","containerGroups","tabbableGroups","nodeFocusedBeforeActivation","mostRecentlyFocusedNode","delayInitialFocusTimer","getOption","configOverrideOptions","configOptionName","findContainerIndex","container","tabbableNodes","contains","find","getInitialFocusNode","firstTabbableGroup","firstTabbableNode","updateTabbableNodes","map","tabbable","focusableNodes","focusable","lastTabbableNode","nextTabbableNode","forward","nodeIdx","n","slice","isTabbable","reverse","filter","group","tryFocus","tagName","toLowerCase","select","isSelectableInput","previousActiveElement","checkPointerDown","preventDefault","checkFocusIn","targetContained","Document","stopImmediatePropagation","checkKey","isBackward","destinationNode","containerIndex","containerGroup","startOfGroupIndex","destinationGroupIndex","lastOfGroupIndex","checkKeyNav","checkClick","addListeners","addEventListener","capture","passive","removeListeners","removeEventListener","activateOptions","finishActivation","deactivateOptions","options","clearTimeout","pauseOptions","onPause","onPostPause","unpauseOptions","onUnpause","onPostUnpause","elementsAsArray"],"sourceRoot":""}