= (props) => {\n const modalProps: ModalProps = {\n scrollBehavior: \"outside\",\n autoFocus: true,\n trapFocus: true,\n returnFocusOnClose: true,\n blockScrollOnMount: true,\n allowPinchZoom: false,\n motionPreset: \"scale\",\n lockFocusAcrossFrames: true,\n ...props,\n }\n\n const {\n portalProps,\n children,\n autoFocus,\n trapFocus,\n initialFocusRef,\n finalFocusRef,\n returnFocusOnClose,\n blockScrollOnMount,\n allowPinchZoom,\n preserveScrollBarGap,\n motionPreset,\n lockFocusAcrossFrames,\n onCloseComplete,\n } = modalProps\n\n const styles = useMultiStyleConfig(\"Modal\", modalProps)\n const modal = useModal(modalProps)\n\n const context = {\n ...modal,\n autoFocus,\n trapFocus,\n initialFocusRef,\n finalFocusRef,\n returnFocusOnClose,\n blockScrollOnMount,\n allowPinchZoom,\n preserveScrollBarGap,\n motionPreset,\n lockFocusAcrossFrames,\n }\n\n return (\n \n \n \n {context.isOpen && {children}}\n \n \n \n )\n}\n\nModal.displayName = \"Modal\"\n","import type { Target, TargetAndTransition, Transition } from \"framer-motion\"\n\nexport type TransitionProperties = {\n /**\n * Custom `transition` definition for `enter` and `exit`\n */\n transition?: TransitionConfig\n /**\n * Custom `transitionEnd` definition for `enter` and `exit`\n */\n transitionEnd?: TransitionEndConfig\n /**\n * Custom `delay` definition for `enter` and `exit`\n */\n delay?: number | DelayConfig\n}\n\ntype TargetResolver = (\n props: P & TransitionProperties,\n) => TargetAndTransition\n\ntype Variant
= TargetAndTransition | TargetResolver
\n\nexport type Variants
= {\n enter: Variant
\n exit: Variant
\n initial?: Variant
\n}\n\ntype WithMotionState
= Partial>\n\nexport type TransitionConfig = WithMotionState\n\nexport type TransitionEndConfig = WithMotionState\n\nexport type DelayConfig = WithMotionState\n\nexport const TRANSITION_EASINGS = {\n ease: [0.25, 0.1, 0.25, 1],\n easeIn: [0.4, 0, 1, 1],\n easeOut: [0, 0, 0.2, 1],\n easeInOut: [0.4, 0, 0.2, 1],\n} as const\n\nexport const TRANSITION_VARIANTS = {\n scale: {\n enter: { scale: 1 },\n exit: { scale: 0.95 },\n },\n fade: {\n enter: { opacity: 1 },\n exit: { opacity: 0 },\n },\n pushLeft: {\n enter: { x: \"100%\" },\n exit: { x: \"-30%\" },\n },\n pushRight: {\n enter: { x: \"-100%\" },\n exit: { x: \"30%\" },\n },\n pushUp: {\n enter: { y: \"100%\" },\n exit: { y: \"-30%\" },\n },\n pushDown: {\n enter: { y: \"-100%\" },\n exit: { y: \"30%\" },\n },\n slideLeft: {\n position: { left: 0, top: 0, bottom: 0, width: \"100%\" },\n enter: { x: 0, y: 0 },\n exit: { x: \"-100%\", y: 0 },\n },\n slideRight: {\n position: { right: 0, top: 0, bottom: 0, width: \"100%\" },\n enter: { x: 0, y: 0 },\n exit: { x: \"100%\", y: 0 },\n },\n slideUp: {\n position: { top: 0, left: 0, right: 0, maxWidth: \"100vw\" },\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"-100%\" },\n },\n slideDown: {\n position: { bottom: 0, left: 0, right: 0, maxWidth: \"100vw\" },\n enter: { x: 0, y: 0 },\n exit: { x: 0, y: \"100%\" },\n },\n}\n\nexport type SlideDirection = \"top\" | \"left\" | \"bottom\" | \"right\"\n\nexport function getSlideTransition(options?: { direction?: SlideDirection }) {\n const side = options?.direction ?? \"right\"\n switch (side) {\n case \"right\":\n return TRANSITION_VARIANTS.slideRight\n case \"left\":\n return TRANSITION_VARIANTS.slideLeft\n case \"bottom\":\n return TRANSITION_VARIANTS.slideDown\n case \"top\":\n return TRANSITION_VARIANTS.slideUp\n default:\n return TRANSITION_VARIANTS.slideRight\n }\n}\n\nexport const TRANSITION_DEFAULTS = {\n enter: {\n duration: 0.2,\n ease: TRANSITION_EASINGS.easeOut,\n },\n exit: {\n duration: 0.1,\n ease: TRANSITION_EASINGS.easeIn,\n },\n} as const\n\nexport type WithTransitionConfig = Omit
&\n TransitionProperties & {\n /**\n * If `true`, the element will unmount when `in={false}` and animation is done\n */\n unmountOnExit?: boolean\n /**\n * Show the component; triggers when enter or exit states\n */\n in?: boolean\n }\n\nexport const withDelay = {\n enter: (\n transition: Transition,\n delay?: number | DelayConfig,\n ): Transition & { delay: number | undefined } => ({\n ...transition,\n delay: typeof delay === \"number\" ? delay : delay?.[\"enter\"],\n }),\n exit: (\n transition: Transition,\n delay?: number | DelayConfig,\n ): Transition & { delay: number | undefined } => ({\n ...transition,\n delay: typeof delay === \"number\" ? delay : delay?.[\"exit\"],\n }),\n}\n","import { cx } from \"@chakra-ui/shared-utils\"\nimport {\n AnimatePresence,\n HTMLMotionProps,\n motion,\n Variants as _Variants,\n} from \"framer-motion\"\nimport { forwardRef } from \"react\"\nimport {\n TRANSITION_DEFAULTS,\n Variants,\n withDelay,\n WithTransitionConfig,\n} from \"./transition-utils\"\n\nexport interface FadeProps\n extends WithTransitionConfig> {}\n\nconst variants: Variants = {\n enter: ({ transition, transitionEnd, delay } = {}) => ({\n opacity: 1,\n transition:\n transition?.enter ?? withDelay.enter(TRANSITION_DEFAULTS.enter, delay),\n transitionEnd: transitionEnd?.enter,\n }),\n exit: ({ transition, transitionEnd, delay } = {}) => ({\n opacity: 0,\n transition:\n transition?.exit ?? withDelay.exit(TRANSITION_DEFAULTS.exit, delay),\n transitionEnd: transitionEnd?.exit,\n }),\n}\n\nexport const fadeConfig: HTMLMotionProps<\"div\"> = {\n initial: \"exit\",\n animate: \"enter\",\n exit: \"exit\",\n variants: variants as _Variants,\n}\n\nexport const Fade = forwardRef(function Fade(\n props,\n ref,\n) {\n const {\n unmountOnExit,\n in: isOpen,\n className,\n transition,\n transitionEnd,\n delay,\n ...rest\n } = props\n\n const animate = isOpen || unmountOnExit ? \"enter\" : \"exit\"\n const show = unmountOnExit ? isOpen && unmountOnExit : true\n\n const custom = { transition, transitionEnd, delay }\n\n return (\n \n {show && (\n \n )}\n \n )\n})\n\nFade.displayName = \"Fade\"\n","import { cx } from \"@chakra-ui/shared-utils\"\nimport {\n chakra,\n ChakraProps,\n SystemStyleObject,\n forwardRef,\n} from \"@chakra-ui/system\"\nimport { fadeConfig } from \"@chakra-ui/transition\"\nimport { motion, HTMLMotionProps } from \"framer-motion\"\n\nimport { useModalStyles, useModalContext } from \"./modal\"\n\nconst MotionDiv = chakra(motion.div)\n\nexport interface ModalOverlayProps\n extends Omit, \"color\" | \"transition\">,\n ChakraProps {\n children?: React.ReactNode\n motionProps?: HTMLMotionProps<\"div\">\n}\n\n/**\n * ModalOverlay renders a backdrop behind the modal. It is\n * also used as a wrapper for the modal content for better positioning.\n *\n * @see Docs https://chakra-ui.com/modal\n */\nexport const ModalOverlay = forwardRef(\n (props, ref) => {\n const { className, transition, motionProps: _motionProps, ...rest } = props\n const _className = cx(\"chakra-modal__overlay\", className)\n\n const styles = useModalStyles()\n const overlayStyle: SystemStyleObject = {\n pos: \"fixed\",\n left: \"0\",\n top: \"0\",\n w: \"100vw\",\n h: \"100vh\",\n ...styles.overlay,\n }\n\n const { motionPreset } = useModalContext()\n const defaultMotionProps: HTMLMotionProps<\"div\"> =\n motionPreset === \"none\" ? {} : fadeConfig\n\n const motionProps: any = _motionProps || defaultMotionProps\n\n return (\n \n )\n },\n)\n\nModalOverlay.displayName = \"ModalOverlay\"\n","import { cx } from \"@chakra-ui/shared-utils\"\nimport {\n AnimatePresence,\n HTMLMotionProps,\n motion,\n Variants as _Variants,\n} from \"framer-motion\"\nimport { forwardRef } from \"react\"\nimport {\n TRANSITION_DEFAULTS,\n Variants,\n withDelay,\n WithTransitionConfig,\n} from \"./transition-utils\"\n\ninterface SlideFadeOptions {\n /**\n * The offset on the horizontal or `x` axis\n * @default 0\n */\n offsetX?: string | number\n /**\n * The offset on the vertical or `y` axis\n * @default 8\n */\n offsetY?: string | number\n /**\n * If `true`, the element will be transitioned back to the offset when it leaves.\n * Otherwise, it'll only fade out\n * @default true\n */\n reverse?: boolean\n}\n\nconst variants: Variants = {\n initial: ({ offsetX, offsetY, transition, transitionEnd, delay }) => ({\n opacity: 0,\n x: offsetX,\n y: offsetY,\n transition:\n transition?.exit ?? withDelay.exit(TRANSITION_DEFAULTS.exit, delay),\n transitionEnd: transitionEnd?.exit,\n }),\n enter: ({ transition, transitionEnd, delay }) => ({\n opacity: 1,\n x: 0,\n y: 0,\n transition:\n transition?.enter ?? withDelay.enter(TRANSITION_DEFAULTS.enter, delay),\n transitionEnd: transitionEnd?.enter,\n }),\n exit: ({ offsetY, offsetX, transition, transitionEnd, reverse, delay }) => {\n const offset = { x: offsetX, y: offsetY }\n return {\n opacity: 0,\n transition:\n transition?.exit ?? withDelay.exit(TRANSITION_DEFAULTS.exit, delay),\n ...(reverse\n ? { ...offset, transitionEnd: transitionEnd?.exit }\n : { transitionEnd: { ...offset, ...transitionEnd?.exit } }),\n }\n },\n}\n\nexport const slideFadeConfig: HTMLMotionProps<\"div\"> = {\n initial: \"initial\",\n animate: \"enter\",\n exit: \"exit\",\n variants: variants as _Variants,\n}\n\nexport interface SlideFadeProps\n extends SlideFadeOptions,\n WithTransitionConfig> {}\n\nexport const SlideFade = forwardRef(\n function SlideFade(props, ref) {\n const {\n unmountOnExit,\n in: isOpen,\n reverse = true,\n className,\n offsetX = 0,\n offsetY = 8,\n transition,\n transitionEnd,\n delay,\n ...rest\n } = props\n\n const show = unmountOnExit ? isOpen && unmountOnExit : true\n const animate = isOpen || unmountOnExit ? \"enter\" : \"exit\"\n\n const custom = {\n offsetX,\n offsetY,\n reverse,\n transition,\n transitionEnd,\n delay,\n }\n\n return (\n \n {show && (\n \n )}\n \n )\n },\n)\n\nSlideFade.displayName = \"SlideFade\"\n","import { cx } from \"@chakra-ui/shared-utils\"\nimport {\n AnimatePresence,\n HTMLMotionProps,\n motion,\n Variants as _Variants,\n} from \"framer-motion\"\nimport { forwardRef } from \"react\"\nimport {\n TRANSITION_DEFAULTS,\n Variants,\n withDelay,\n WithTransitionConfig,\n} from \"./transition-utils\"\n\ninterface ScaleFadeOptions {\n /**\n * The initial scale of the element\n * @default 0.95\n */\n initialScale?: number\n /**\n * If `true`, the element will transition back to exit state\n * @default true\n */\n reverse?: boolean\n}\n\nconst variants: Variants = {\n exit: ({ reverse, initialScale, transition, transitionEnd, delay }) => ({\n opacity: 0,\n ...(reverse\n ? { scale: initialScale, transitionEnd: transitionEnd?.exit }\n : { transitionEnd: { scale: initialScale, ...transitionEnd?.exit } }),\n transition:\n transition?.exit ?? withDelay.exit(TRANSITION_DEFAULTS.exit, delay),\n }),\n enter: ({ transitionEnd, transition, delay }) => ({\n opacity: 1,\n scale: 1,\n transition:\n transition?.enter ?? withDelay.enter(TRANSITION_DEFAULTS.enter, delay),\n transitionEnd: transitionEnd?.enter,\n }),\n}\n\nexport const scaleFadeConfig: HTMLMotionProps<\"div\"> = {\n initial: \"exit\",\n animate: \"enter\",\n exit: \"exit\",\n variants: variants as _Variants,\n}\n\nexport interface ScaleFadeProps\n extends ScaleFadeOptions,\n WithTransitionConfig> {}\n\nexport const ScaleFade = forwardRef(\n function ScaleFade(props, ref) {\n const {\n unmountOnExit,\n in: isOpen,\n reverse = true,\n initialScale = 0.95,\n className,\n transition,\n transitionEnd,\n delay,\n ...rest\n } = props\n\n const show = unmountOnExit ? isOpen && unmountOnExit : true\n const animate = isOpen || unmountOnExit ? \"enter\" : \"exit\"\n\n const custom = { initialScale, reverse, transition, transitionEnd, delay }\n\n return (\n \n {show && (\n \n )}\n \n )\n },\n)\n\nScaleFade.displayName = \"ScaleFade\"\n","import { chakra, ChakraProps } from \"@chakra-ui/system\"\nimport { scaleFadeConfig, slideFadeConfig } from \"@chakra-ui/transition\"\nimport { HTMLMotionProps, motion } from \"framer-motion\"\nimport { forwardRef } from \"react\"\n\nexport interface ModalTransitionProps\n extends Omit, \"color\" | \"transition\">,\n ChakraProps {\n preset?:\n | \"slideInBottom\"\n | \"slideInRight\"\n | \"slideInTop\"\n | \"slideInLeft\"\n | \"scale\"\n | \"none\"\n motionProps?: HTMLMotionProps<\"section\">\n}\n\nconst transitions = {\n slideInBottom: {\n ...slideFadeConfig,\n custom: { offsetY: 16, reverse: true },\n },\n slideInRight: {\n ...slideFadeConfig,\n custom: { offsetX: 16, reverse: true },\n },\n slideInTop: {\n ...slideFadeConfig,\n custom: { offsetY: -16, reverse: true },\n },\n slideInLeft: {\n ...slideFadeConfig,\n custom: { offsetX: -16, reverse: true },\n },\n scale: {\n ...scaleFadeConfig,\n custom: { initialScale: 0.95, reverse: true },\n },\n none: {},\n}\n\nconst MotionSection = chakra(motion.section)\n\nconst getMotionProps = (preset: ModalTransitionProps[\"preset\"]) => {\n return transitions[preset || \"none\"]\n}\n\nexport const ModalTransition = forwardRef(\n (props: ModalTransitionProps, ref: React.Ref) => {\n const { preset, motionProps = getMotionProps(preset), ...rest } = props\n return (\n \n )\n },\n)\n\nModalTransition.displayName = \"ModalTransition\"\n","/**\n * defines a focus group\n */\nexport var FOCUS_GROUP = 'data-focus-lock';\n/**\n * disables element discovery inside a group marked by key\n */\nexport var FOCUS_DISABLED = 'data-focus-lock-disabled';\n/**\n * allows uncontrolled focus within the marked area, effectively disabling focus lock for it's content\n */\nexport var FOCUS_ALLOW = 'data-no-focus-lock';\n/**\n * instructs autofocus engine to pick default autofocus inside a given node\n * can be set on the element or container\n */\nexport var FOCUS_AUTO = 'data-autofocus-inside';\n/**\n * instructs autofocus to ignore elements within a given node\n * can be set on the element or container\n */\nexport var FOCUS_NO_AUTOFOCUS = 'data-no-autofocus';\n","/**\n * Assigns a value for a given ref, no matter of the ref format\n * @param {RefObject} ref - a callback function or ref object\n * @param value - a new value\n *\n * @see https://github.com/theKashey/use-callback-ref#assignref\n * @example\n * const refObject = useRef();\n * const refFn = (ref) => {....}\n *\n * assignRef(refObject, \"refValue\");\n * assignRef(refFn, \"refValue\");\n */\nexport function assignRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n }\n else if (ref) {\n ref.current = value;\n }\n return ref;\n}\n","import * as React from 'react';\nimport { assignRef } from './assignRef';\nimport { useCallbackRef } from './useRef';\nvar useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nvar currentValues = new WeakMap();\n/**\n * Merges two or more refs together providing a single interface to set their value\n * @param {RefObject|Ref} refs\n * @returns {MutableRefObject} - a new ref, which translates all changes to {refs}\n *\n * @see {@link mergeRefs} a version without buit-in memoization\n * @see https://github.com/theKashey/use-callback-ref#usemergerefs\n * @example\n * const Component = React.forwardRef((props, ref) => {\n * const ownRef = useRef();\n * const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together\n * return ...
\n * }\n */\nexport function useMergeRefs(refs, defaultValue) {\n var callbackRef = useCallbackRef(defaultValue || null, function (newValue) {\n return refs.forEach(function (ref) { return assignRef(ref, newValue); });\n });\n // handle refs changes - added or removed\n useIsomorphicLayoutEffect(function () {\n var oldValue = currentValues.get(callbackRef);\n if (oldValue) {\n var prevRefs_1 = new Set(oldValue);\n var nextRefs_1 = new Set(refs);\n var current_1 = callbackRef.current;\n prevRefs_1.forEach(function (ref) {\n if (!nextRefs_1.has(ref)) {\n assignRef(ref, null);\n }\n });\n nextRefs_1.forEach(function (ref) {\n if (!prevRefs_1.has(ref)) {\n assignRef(ref, current_1);\n }\n });\n }\n currentValues.set(callbackRef, refs);\n }, [refs]);\n return callbackRef;\n}\n","import { useState } from 'react';\n/**\n * creates a MutableRef with ref change callback\n * @param initialValue - initial ref value\n * @param {Function} callback - a callback to run when value changes\n *\n * @example\n * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);\n * ref.current = 1;\n * // prints 0 -> 1\n *\n * @see https://reactjs.org/docs/hooks-reference.html#useref\n * @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref\n * @returns {MutableRefObject}\n */\nexport function useCallbackRef(initialValue, callback) {\n var ref = useState(function () { return ({\n // value\n value: initialValue,\n // last callback\n callback: callback,\n // \"memoized\" public interface\n facade: {\n get current() {\n return ref.value;\n },\n set current(value) {\n var last = ref.value;\n if (last !== value) {\n ref.value = value;\n ref.callback(value, last);\n }\n },\n },\n }); })[0];\n // update callback\n ref.callback = callback;\n return ref.facade;\n}\n","import * as React from 'react';\nimport PropTypes from 'prop-types';\nexport var hiddenGuard = {\n width: '1px',\n height: '0px',\n padding: 0,\n overflow: 'hidden',\n position: 'fixed',\n top: '1px',\n left: '1px'\n};\nvar InFocusGuard = function InFocusGuard(_ref) {\n var _ref$children = _ref.children,\n children = _ref$children === void 0 ? null : _ref$children;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n \"data-focus-auto-guard\": true,\n style: hiddenGuard\n }), children, children && /*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-last\",\n \"data-focus-guard\": true,\n \"data-focus-auto-guard\": true,\n style: hiddenGuard\n }));\n};\nInFocusGuard.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: PropTypes.node\n} : {};\nexport default InFocusGuard;","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n};\n","import { __assign } from \"tslib\";\nfunction ItoI(a) {\n return a;\n}\nfunction innerCreateMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n var buffer = [];\n var assigned = false;\n var medium = {\n read: function () {\n if (assigned) {\n throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');\n }\n if (buffer.length) {\n return buffer[buffer.length - 1];\n }\n return defaults;\n },\n useMedium: function (data) {\n var item = middleware(data, assigned);\n buffer.push(item);\n return function () {\n buffer = buffer.filter(function (x) { return x !== item; });\n };\n },\n assignSyncMedium: function (cb) {\n assigned = true;\n while (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n }\n buffer = {\n push: function (x) { return cb(x); },\n filter: function () { return buffer; },\n };\n },\n assignMedium: function (cb) {\n assigned = true;\n var pendingQueue = [];\n if (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n pendingQueue = buffer;\n }\n var executeQueue = function () {\n var cbs = pendingQueue;\n pendingQueue = [];\n cbs.forEach(cb);\n };\n var cycle = function () { return Promise.resolve().then(executeQueue); };\n cycle();\n buffer = {\n push: function (x) {\n pendingQueue.push(x);\n cycle();\n },\n filter: function (filter) {\n pendingQueue = pendingQueue.filter(filter);\n return buffer;\n },\n };\n },\n };\n return medium;\n}\nexport function createMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n return innerCreateMedium(defaults, middleware);\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function createSidecarMedium(options) {\n if (options === void 0) { options = {}; }\n var medium = innerCreateMedium(null);\n medium.options = __assign({ async: true, ssr: false }, options);\n return medium;\n}\n","import { createMedium, createSidecarMedium } from 'use-sidecar';\nexport var mediumFocus = createMedium({}, function (_ref) {\n var target = _ref.target,\n currentTarget = _ref.currentTarget;\n return {\n target: target,\n currentTarget: currentTarget\n };\n});\nexport var mediumBlur = createMedium();\nexport var mediumEffect = createMedium();\nexport var mediumSidecar = createSidecarMedium({\n async: true,\n ssr: typeof document !== 'undefined'\n});","import { createContext } from 'react';\nexport var focusScope = /*#__PURE__*/createContext(undefined);","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport * as React from 'react';\nimport { node, bool, string, any, arrayOf, oneOfType, object, func } from 'prop-types';\nimport * as constants from 'focus-lock/constants';\nimport { useMergeRefs } from 'use-callback-ref';\nimport { hiddenGuard } from './FocusGuard';\nimport { mediumFocus, mediumBlur, mediumSidecar } from './medium';\nimport { focusScope } from './scope';\nvar emptyArray = [];\nvar FocusLock = /*#__PURE__*/React.forwardRef(function FocusLockUI(props, parentRef) {\n var _extends2;\n var _React$useState = React.useState(),\n realObserved = _React$useState[0],\n setObserved = _React$useState[1];\n var observed = React.useRef();\n var isActive = React.useRef(false);\n var originalFocusedElement = React.useRef(null);\n var _React$useState2 = React.useState({}),\n update = _React$useState2[1];\n var children = props.children,\n _props$disabled = props.disabled,\n disabled = _props$disabled === void 0 ? false : _props$disabled,\n _props$noFocusGuards = props.noFocusGuards,\n noFocusGuards = _props$noFocusGuards === void 0 ? false : _props$noFocusGuards,\n _props$persistentFocu = props.persistentFocus,\n persistentFocus = _props$persistentFocu === void 0 ? false : _props$persistentFocu,\n _props$crossFrame = props.crossFrame,\n crossFrame = _props$crossFrame === void 0 ? true : _props$crossFrame,\n _props$autoFocus = props.autoFocus,\n autoFocus = _props$autoFocus === void 0 ? true : _props$autoFocus,\n allowTextSelection = props.allowTextSelection,\n group = props.group,\n className = props.className,\n whiteList = props.whiteList,\n hasPositiveIndices = props.hasPositiveIndices,\n _props$shards = props.shards,\n shards = _props$shards === void 0 ? emptyArray : _props$shards,\n _props$as = props.as,\n Container = _props$as === void 0 ? 'div' : _props$as,\n _props$lockProps = props.lockProps,\n containerProps = _props$lockProps === void 0 ? {} : _props$lockProps,\n SideCar = props.sideCar,\n _props$returnFocus = props.returnFocus,\n shouldReturnFocus = _props$returnFocus === void 0 ? false : _props$returnFocus,\n focusOptions = props.focusOptions,\n onActivationCallback = props.onActivation,\n onDeactivationCallback = props.onDeactivation;\n var _React$useState3 = React.useState({}),\n id = _React$useState3[0];\n var onActivation = React.useCallback(function (_ref) {\n var captureFocusRestore = _ref.captureFocusRestore;\n if (!originalFocusedElement.current) {\n var _document;\n var activeElement = (_document = document) == null ? void 0 : _document.activeElement;\n originalFocusedElement.current = activeElement;\n if (activeElement !== document.body) {\n originalFocusedElement.current = captureFocusRestore(activeElement);\n }\n }\n if (observed.current && onActivationCallback) {\n onActivationCallback(observed.current);\n }\n isActive.current = true;\n update();\n }, [onActivationCallback]);\n var onDeactivation = React.useCallback(function () {\n isActive.current = false;\n if (onDeactivationCallback) {\n onDeactivationCallback(observed.current);\n }\n update();\n }, [onDeactivationCallback]);\n var returnFocus = React.useCallback(function (allowDefer) {\n var focusRestore = originalFocusedElement.current;\n if (focusRestore) {\n var returnFocusTo = (typeof focusRestore === 'function' ? focusRestore() : focusRestore) || document.body;\n var howToReturnFocus = typeof shouldReturnFocus === 'function' ? shouldReturnFocus(returnFocusTo) : shouldReturnFocus;\n if (howToReturnFocus) {\n var returnFocusOptions = typeof howToReturnFocus === 'object' ? howToReturnFocus : undefined;\n originalFocusedElement.current = null;\n if (allowDefer) {\n Promise.resolve().then(function () {\n return returnFocusTo.focus(returnFocusOptions);\n });\n } else {\n returnFocusTo.focus(returnFocusOptions);\n }\n }\n }\n }, [shouldReturnFocus]);\n var onFocus = React.useCallback(function (event) {\n if (isActive.current) {\n mediumFocus.useMedium(event);\n }\n }, []);\n var onBlur = mediumBlur.useMedium;\n var setObserveNode = React.useCallback(function (newObserved) {\n if (observed.current !== newObserved) {\n observed.current = newObserved;\n setObserved(newObserved);\n }\n }, []);\n if (process.env.NODE_ENV !== 'production') {\n if (typeof allowTextSelection !== 'undefined') {\n console.warn('React-Focus-Lock: allowTextSelection is deprecated and enabled by default');\n }\n React.useEffect(function () {\n if (!observed.current && typeof Container !== 'string') {\n console.error('FocusLock: could not obtain ref to internal node');\n }\n }, []);\n }\n var lockProps = _extends((_extends2 = {}, _extends2[constants.FOCUS_DISABLED] = disabled && 'disabled', _extends2[constants.FOCUS_GROUP] = group, _extends2), containerProps);\n var hasLeadingGuards = noFocusGuards !== true;\n var hasTailingGuards = hasLeadingGuards && noFocusGuards !== 'tail';\n var mergedRef = useMergeRefs([parentRef, setObserveNode]);\n var focusScopeValue = React.useMemo(function () {\n return {\n observed: observed,\n shards: shards,\n enabled: !disabled,\n active: isActive.current\n };\n }, [disabled, isActive.current, shards, realObserved]);\n return /*#__PURE__*/React.createElement(React.Fragment, null, hasLeadingGuards && [\n /*#__PURE__*/\n React.createElement(\"div\", {\n key: \"guard-first\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }), hasPositiveIndices ? /*#__PURE__*/React.createElement(\"div\", {\n key: \"guard-nearest\",\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 1,\n style: hiddenGuard\n }) : null], !disabled && /*#__PURE__*/React.createElement(SideCar, {\n id: id,\n sideCar: mediumSidecar,\n observed: realObserved,\n disabled: disabled,\n persistentFocus: persistentFocus,\n crossFrame: crossFrame,\n autoFocus: autoFocus,\n whiteList: whiteList,\n shards: shards,\n onActivation: onActivation,\n onDeactivation: onDeactivation,\n returnFocus: returnFocus,\n focusOptions: focusOptions,\n noFocusGuards: noFocusGuards\n }), /*#__PURE__*/React.createElement(Container, _extends({\n ref: mergedRef\n }, lockProps, {\n className: className,\n onBlur: onBlur,\n onFocus: onFocus\n }), /*#__PURE__*/React.createElement(focusScope.Provider, {\n value: focusScopeValue\n }, children)), hasTailingGuards && /*#__PURE__*/React.createElement(\"div\", {\n \"data-focus-guard\": true,\n tabIndex: disabled ? -1 : 0,\n style: hiddenGuard\n }));\n});\nFocusLock.propTypes = process.env.NODE_ENV !== \"production\" ? {\n children: node,\n disabled: bool,\n returnFocus: oneOfType([bool, object, func]),\n focusOptions: object,\n noFocusGuards: bool,\n hasPositiveIndices: bool,\n allowTextSelection: bool,\n autoFocus: bool,\n persistentFocus: bool,\n crossFrame: bool,\n group: string,\n className: string,\n whiteList: func,\n shards: arrayOf(any),\n as: oneOfType([string, func, object]),\n lockProps: object,\n onActivation: func,\n onDeactivation: func,\n sideCar: any.isRequired\n} : {};\nexport default FocusLock;","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import _inheritsLoose from '@babel/runtime/helpers/esm/inheritsLoose';\nimport _defineProperty from '@babel/runtime/helpers/esm/defineProperty';\nimport React, { PureComponent } from 'react';\n\nfunction withSideEffect(reducePropsToState, handleStateChangeOnClient) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof reducePropsToState !== 'function') {\n throw new Error('Expected reducePropsToState to be a function.');\n }\n\n if (typeof handleStateChangeOnClient !== 'function') {\n throw new Error('Expected handleStateChangeOnClient to be a function.');\n }\n }\n\n function getDisplayName(WrappedComponent) {\n return WrappedComponent.displayName || WrappedComponent.name || 'Component';\n }\n\n return function wrap(WrappedComponent) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof WrappedComponent !== 'function') {\n throw new Error('Expected WrappedComponent to be a React component.');\n }\n }\n\n var mountedInstances = [];\n var state;\n\n function emitChange() {\n state = reducePropsToState(mountedInstances.map(function (instance) {\n return instance.props;\n }));\n handleStateChangeOnClient(state);\n }\n\n var SideEffect = /*#__PURE__*/function (_PureComponent) {\n _inheritsLoose(SideEffect, _PureComponent);\n\n function SideEffect() {\n return _PureComponent.apply(this, arguments) || this;\n }\n\n // Try to use displayName of wrapped component\n SideEffect.peek = function peek() {\n return state;\n };\n\n var _proto = SideEffect.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n mountedInstances.push(this);\n emitChange();\n };\n\n _proto.componentDidUpdate = function componentDidUpdate() {\n emitChange();\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n var index = mountedInstances.indexOf(this);\n mountedInstances.splice(index, 1);\n emitChange();\n };\n\n _proto.render = function render() {\n return /*#__PURE__*/React.createElement(WrappedComponent, this.props);\n };\n\n return SideEffect;\n }(PureComponent);\n\n _defineProperty(SideEffect, \"displayName\", \"SideEffect(\" + getDisplayName(WrappedComponent) + \")\");\n\n return SideEffect;\n };\n}\n\nexport default withSideEffect;\n","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inheritsLoose(t, o) {\n t.prototype = Object.create(o.prototype), t.prototype.constructor = t, setPrototypeOf(t, o);\n}\nexport { _inheritsLoose as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","/*\nIE11 support\n */\nexport var toArray = function (a) {\n var ret = Array(a.length);\n for (var i = 0; i < a.length; ++i) {\n ret[i] = a[i];\n }\n return ret;\n};\nexport var asArray = function (a) { return (Array.isArray(a) ? a : [a]); };\nexport var getFirst = function (a) { return (Array.isArray(a) ? a[0] : a); };\n","import { FOCUS_NO_AUTOFOCUS } from '../constants';\nvar isElementHidden = function (node) {\n // we can measure only \"elements\"\n // consider others as \"visible\"\n if (node.nodeType !== Node.ELEMENT_NODE) {\n return false;\n }\n var computedStyle = window.getComputedStyle(node, null);\n if (!computedStyle || !computedStyle.getPropertyValue) {\n return false;\n }\n return (computedStyle.getPropertyValue('display') === 'none' || computedStyle.getPropertyValue('visibility') === 'hidden');\n};\nvar getParentNode = function (node) {\n // DOCUMENT_FRAGMENT_NODE can also point on ShadowRoot. In this case .host will point on the next node\n return node.parentNode && node.parentNode.nodeType === Node.DOCUMENT_FRAGMENT_NODE\n ? // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node.parentNode.host\n : node.parentNode;\n};\nvar isTopNode = function (node) {\n // @ts-ignore\n return node === document || (node && node.nodeType === Node.DOCUMENT_NODE);\n};\nvar isInert = function (node) { return node.hasAttribute('inert'); };\n/**\n * @see https://github.com/testing-library/jest-dom/blob/main/src/to-be-visible.js\n */\nvar isVisibleUncached = function (node, checkParent) {\n return !node || isTopNode(node) || (!isElementHidden(node) && !isInert(node) && checkParent(getParentNode(node)));\n};\nexport var isVisibleCached = function (visibilityCache, node) {\n var cached = visibilityCache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isVisibleUncached(node, isVisibleCached.bind(undefined, visibilityCache));\n visibilityCache.set(node, result);\n return result;\n};\nvar isAutoFocusAllowedUncached = function (node, checkParent) {\n return node && !isTopNode(node) ? (isAutoFocusAllowed(node) ? checkParent(getParentNode(node)) : false) : true;\n};\nexport var isAutoFocusAllowedCached = function (cache, node) {\n var cached = cache.get(node);\n if (cached !== undefined) {\n return cached;\n }\n var result = isAutoFocusAllowedUncached(node, isAutoFocusAllowedCached.bind(undefined, cache));\n cache.set(node, result);\n return result;\n};\nexport var getDataset = function (node) {\n // @ts-ignore\n return node.dataset;\n};\nexport var isHTMLButtonElement = function (node) { return node.tagName === 'BUTTON'; };\nexport var isHTMLInputElement = function (node) { return node.tagName === 'INPUT'; };\nexport var isRadioElement = function (node) {\n return isHTMLInputElement(node) && node.type === 'radio';\n};\nexport var notHiddenInput = function (node) {\n return !((isHTMLInputElement(node) || isHTMLButtonElement(node)) && (node.type === 'hidden' || node.disabled));\n};\nexport var isAutoFocusAllowed = function (node) {\n var attribute = node.getAttribute(FOCUS_NO_AUTOFOCUS);\n return ![true, 'true', ''].includes(attribute);\n};\nexport var isGuard = function (node) { var _a; return Boolean(node && ((_a = getDataset(node)) === null || _a === void 0 ? void 0 : _a.focusGuard)); };\nexport var isNotAGuard = function (node) { return !isGuard(node); };\nexport var isDefined = function (x) { return Boolean(x); };\n","import { toArray } from './array';\nexport var tabSort = function (a, b) {\n var aTab = Math.max(0, a.tabIndex);\n var bTab = Math.max(0, b.tabIndex);\n var tabDiff = aTab - bTab;\n var indexDiff = a.index - b.index;\n if (tabDiff) {\n if (!aTab) {\n return 1;\n }\n if (!bTab) {\n return -1;\n }\n }\n return tabDiff || indexDiff;\n};\nvar getTabIndex = function (node) {\n if (node.tabIndex < 0) {\n // all \"focusable\" elements are already preselected\n // but some might have implicit negative tabIndex\n // return 0 for