| HTMLElement} ref The element boundary\n * @param {function} onRootClose\n * @param {object=} options\n * @param {boolean=} options.disabled\n * @param {string=} options.clickTrigger The DOM event name (click, mousedown, etc) to attach listeners on\n */\nfunction useRootClose(ref, onRootClose, _temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n disabled = _ref.disabled,\n _ref$clickTrigger = _ref.clickTrigger,\n clickTrigger = _ref$clickTrigger === void 0 ? 'click' : _ref$clickTrigger;\n\n var preventMouseRootCloseRef = useRef(false);\n var onClose = onRootClose || noop;\n var handleMouseCapture = useCallback(function (e) {\n var currentTarget = getRefTarget(ref);\n warning(!!currentTarget, 'RootClose captured a close event but does not have a ref to compare it to. ' + 'useRootClose(), should be passed a ref that resolves to a DOM node');\n preventMouseRootCloseRef.current = !currentTarget || isModifiedEvent(e) || !isLeftClickEvent(e) || !!contains(currentTarget, e.target);\n }, [ref]);\n var handleMouse = useEventCallback(function (e) {\n if (!preventMouseRootCloseRef.current) {\n onClose(e);\n }\n });\n var handleKeyUp = useEventCallback(function (e) {\n if (e.keyCode === escapeKeyCode) {\n onClose(e);\n }\n });\n useEffect(function () {\n if (disabled || ref == null) return undefined; // Store the current event to avoid triggering handlers immediately\n // https://github.com/facebook/react/issues/20074\n\n var currentEvent = window.event;\n var doc = ownerDocument(getRefTarget(ref)); // Use capture for this listener so it fires before React's listener, to\n // avoid false positives in the contains() check below if the target DOM\n // element is removed in the React mouse callback.\n\n var removeMouseCaptureListener = listen(doc, clickTrigger, handleMouseCapture, true);\n var removeMouseListener = listen(doc, clickTrigger, function (e) {\n // skip if this event is the same as the one running when we added the handlers\n if (e === currentEvent) {\n currentEvent = undefined;\n return;\n }\n\n handleMouse(e);\n });\n var removeKeyupListener = listen(doc, 'keyup', function (e) {\n // skip if this event is the same as the one running when we added the handlers\n if (e === currentEvent) {\n currentEvent = undefined;\n return;\n }\n\n handleKeyUp(e);\n });\n var mobileSafariHackListeners = [];\n\n if ('ontouchstart' in doc.documentElement) {\n mobileSafariHackListeners = [].slice.call(doc.body.children).map(function (el) {\n return listen(el, 'mousemove', noop);\n });\n }\n\n return function () {\n removeMouseCaptureListener();\n removeMouseListener();\n removeKeyupListener();\n mobileSafariHackListeners.forEach(function (remove) {\n return remove();\n });\n };\n }, [ref, disabled, clickTrigger, handleMouseCapture, handleMouse, handleKeyUp]);\n}\n\nexport default useRootClose;","import ownerDocument from 'dom-helpers/ownerDocument';\nimport { useState, useEffect } from 'react';\nexport var resolveContainerRef = function resolveContainerRef(ref) {\n var _ref;\n\n if (typeof document === 'undefined') return null;\n if (ref == null) return ownerDocument().body;\n if (typeof ref === 'function') ref = ref();\n if (ref && 'current' in ref) ref = ref.current;\n if ((_ref = ref) != null && _ref.nodeType) return ref || null;\n return null;\n};\nexport default function useWaitForDOMRef(ref, onResolved) {\n var _useState = useState(function () {\n return resolveContainerRef(ref);\n }),\n resolvedRef = _useState[0],\n setRef = _useState[1];\n\n if (!resolvedRef) {\n var earlyRef = resolveContainerRef(ref);\n if (earlyRef) setRef(earlyRef);\n }\n\n useEffect(function () {\n if (onResolved && resolvedRef) {\n onResolved(resolvedRef);\n }\n }, [onResolved, resolvedRef]);\n useEffect(function () {\n var nextRef = resolveContainerRef(ref);\n\n if (nextRef !== resolvedRef) {\n setRef(nextRef);\n }\n }, [ref, resolvedRef]);\n return resolvedRef;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nexport function toModifierMap(modifiers) {\n var result = {};\n\n if (!Array.isArray(modifiers)) {\n return modifiers || result;\n } // eslint-disable-next-line no-unused-expressions\n\n\n modifiers == null ? void 0 : modifiers.forEach(function (m) {\n result[m.name] = m;\n });\n return result;\n}\nexport function toModifierArray(map) {\n if (map === void 0) {\n map = {};\n }\n\n if (Array.isArray(map)) return map;\n return Object.keys(map).map(function (k) {\n map[k].name = k;\n return map[k];\n });\n}\nexport default function mergeOptionsWithPopperConfig(_ref) {\n var _modifiers$preventOve, _modifiers$preventOve2, _modifiers$offset, _modifiers$arrow;\n\n var enabled = _ref.enabled,\n enableEvents = _ref.enableEvents,\n placement = _ref.placement,\n flip = _ref.flip,\n offset = _ref.offset,\n fixed = _ref.fixed,\n containerPadding = _ref.containerPadding,\n arrowElement = _ref.arrowElement,\n _ref$popperConfig = _ref.popperConfig,\n popperConfig = _ref$popperConfig === void 0 ? {} : _ref$popperConfig;\n var modifiers = toModifierMap(popperConfig.modifiers);\n return _extends({}, popperConfig, {\n placement: placement,\n enabled: enabled,\n strategy: fixed ? 'fixed' : popperConfig.strategy,\n modifiers: toModifierArray(_extends({}, modifiers, {\n eventListeners: {\n enabled: enableEvents\n },\n preventOverflow: _extends({}, modifiers.preventOverflow, {\n options: containerPadding ? _extends({\n padding: containerPadding\n }, (_modifiers$preventOve = modifiers.preventOverflow) == null ? void 0 : _modifiers$preventOve.options) : (_modifiers$preventOve2 = modifiers.preventOverflow) == null ? void 0 : _modifiers$preventOve2.options\n }),\n offset: {\n options: _extends({\n offset: offset\n }, (_modifiers$offset = modifiers.offset) == null ? void 0 : _modifiers$offset.options)\n },\n arrow: _extends({}, modifiers.arrow, {\n enabled: !!arrowElement,\n options: _extends({}, (_modifiers$arrow = modifiers.arrow) == null ? void 0 : _modifiers$arrow.options, {\n element: arrowElement\n })\n }),\n flip: _extends({\n enabled: !!flip\n }, modifiers.flip)\n }))\n });\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport PropTypes from 'prop-types';\nimport React, { useState } from 'react';\nimport ReactDOM from 'react-dom';\nimport useCallbackRef from '@restart/hooks/useCallbackRef';\nimport useMergedRefs from '@restart/hooks/useMergedRefs';\nimport { placements } from './popper';\nimport usePopper from './usePopper';\nimport useRootClose from './useRootClose';\nimport useWaitForDOMRef from './useWaitForDOMRef';\nimport mergeOptionsWithPopperConfig from './mergeOptionsWithPopperConfig';\n\n/**\n * Built on top of `Popper.js`, the overlay component is\n * great for custom tooltip overlays.\n */\nvar Overlay = /*#__PURE__*/React.forwardRef(function (props, outerRef) {\n var flip = props.flip,\n offset = props.offset,\n placement = props.placement,\n _props$containerPaddi = props.containerPadding,\n containerPadding = _props$containerPaddi === void 0 ? 5 : _props$containerPaddi,\n _props$popperConfig = props.popperConfig,\n popperConfig = _props$popperConfig === void 0 ? {} : _props$popperConfig,\n Transition = props.transition;\n\n var _useCallbackRef = useCallbackRef(),\n rootElement = _useCallbackRef[0],\n attachRef = _useCallbackRef[1];\n\n var _useCallbackRef2 = useCallbackRef(),\n arrowElement = _useCallbackRef2[0],\n attachArrowRef = _useCallbackRef2[1];\n\n var mergedRef = useMergedRefs(attachRef, outerRef);\n var container = useWaitForDOMRef(props.container);\n var target = useWaitForDOMRef(props.target);\n\n var _useState = useState(!props.show),\n exited = _useState[0],\n setExited = _useState[1];\n\n var _usePopper = usePopper(target, rootElement, mergeOptionsWithPopperConfig({\n placement: placement,\n enableEvents: !!props.show,\n containerPadding: containerPadding || 5,\n flip: flip,\n offset: offset,\n arrowElement: arrowElement,\n popperConfig: popperConfig\n })),\n styles = _usePopper.styles,\n attributes = _usePopper.attributes,\n popper = _objectWithoutPropertiesLoose(_usePopper, [\"styles\", \"attributes\"]);\n\n if (props.show) {\n if (exited) setExited(false);\n } else if (!props.transition && !exited) {\n setExited(true);\n }\n\n var handleHidden = function handleHidden() {\n setExited(true);\n\n if (props.onExited) {\n props.onExited.apply(props, arguments);\n }\n }; // Don't un-render the overlay while it's transitioning out.\n\n\n var mountOverlay = props.show || Transition && !exited;\n useRootClose(rootElement, props.onHide, {\n disabled: !props.rootClose || props.rootCloseDisabled,\n clickTrigger: props.rootCloseEvent\n });\n\n if (!mountOverlay) {\n // Don't bother showing anything if we don't have to.\n return null;\n }\n\n var child = props.children(_extends({}, popper, {\n show: !!props.show,\n props: _extends({}, attributes.popper, {\n style: styles.popper,\n ref: mergedRef\n }),\n arrowProps: _extends({}, attributes.arrow, {\n style: styles.arrow,\n ref: attachArrowRef\n })\n }));\n\n if (Transition) {\n var onExit = props.onExit,\n onExiting = props.onExiting,\n onEnter = props.onEnter,\n onEntering = props.onEntering,\n onEntered = props.onEntered;\n child = /*#__PURE__*/React.createElement(Transition, {\n \"in\": props.show,\n appear: true,\n onExit: onExit,\n onExiting: onExiting,\n onExited: handleHidden,\n onEnter: onEnter,\n onEntering: onEntering,\n onEntered: onEntered\n }, child);\n }\n\n return container ? /*#__PURE__*/ReactDOM.createPortal(child, container) : null;\n});\nOverlay.displayName = 'Overlay';\nOverlay.propTypes = {\n /**\n * Set the visibility of the Overlay\n */\n show: PropTypes.bool,\n\n /** Specify where the overlay element is positioned in relation to the target element */\n placement: PropTypes.oneOf(placements),\n\n /**\n * A DOM Element, Ref to an element, or function that returns either. The `target` element is where\n * the overlay is positioned relative to.\n */\n target: PropTypes.any,\n\n /**\n * A DOM Element, Ref to an element, or function that returns either. The `container` will have the Portal children\n * appended to it.\n */\n container: PropTypes.any,\n\n /**\n * Enables the Popper.js `flip` modifier, allowing the Overlay to\n * automatically adjust it's placement in case of overlap with the viewport or toggle.\n * Refer to the [flip docs](https://popper.js.org/popper-documentation.html#modifiers..flip.enabled) for more info\n */\n flip: PropTypes.bool,\n\n /**\n * A render prop that returns an element to overlay and position. See\n * the [react-popper documentation](https://github.com/FezVrasta/react-popper#children) for more info.\n *\n * @type {Function ({\n * show: boolean,\n * placement: Placement,\n * update: () => void,\n * forceUpdate: () => void,\n * props: {\n * ref: (?HTMLElement) => void,\n * style: { [string]: string | number },\n * aria-labelledby: ?string\n * [string]: string | number,\n * },\n * arrowProps: {\n * ref: (?HTMLElement) => void,\n * style: { [string]: string | number },\n * [string]: string | number,\n * },\n * }) => React.Element}\n */\n children: PropTypes.func.isRequired,\n\n /**\n * Control how much space there is between the edge of the boundary element and overlay.\n * A convenience shortcut to setting `popperConfig.modfiers.preventOverflow.padding`\n */\n containerPadding: PropTypes.number,\n\n /**\n * A set of popper options and props passed directly to react-popper's Popper component.\n */\n popperConfig: PropTypes.object,\n\n /**\n * Specify whether the overlay should trigger `onHide` when the user clicks outside the overlay\n */\n rootClose: PropTypes.bool,\n\n /**\n * Specify event for toggling overlay\n */\n rootCloseEvent: PropTypes.oneOf(['click', 'mousedown']),\n\n /**\n * Specify disabled for disable RootCloseWrapper\n */\n rootCloseDisabled: PropTypes.bool,\n\n /**\n * A Callback fired by the Overlay when it wishes to be hidden.\n *\n * __required__ when `rootClose` is `true`.\n *\n * @type func\n */\n onHide: function onHide(props) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (props.rootClose) {\n var _PropTypes$func;\n\n return (_PropTypes$func = PropTypes.func).isRequired.apply(_PropTypes$func, [props].concat(args));\n }\n\n return PropTypes.func.apply(PropTypes, [props].concat(args));\n },\n\n /**\n * A `react-transition-group@2.0.0` `` component\n * used to animate the overlay as it changes visibility.\n */\n // @ts-ignore\n transition: PropTypes.elementType,\n\n /**\n * Callback fired before the Overlay transitions in\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired as the Overlay begins to transition in\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the Overlay finishes transitioning in\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired right before the Overlay transitions out\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired as the Overlay begins to transition out\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the Overlay finishes transitioning out\n */\n onExited: PropTypes.func\n};\nexport default Overlay;","export default function hasClass(element, className) {\n if (element.classList) return !!className && element.classList.contains(className);\n return (\" \" + (element.className.baseVal || element.className) + \" \").indexOf(\" \" + className + \" \") !== -1;\n}","import { useCallback, useMemo, useRef } from 'react';\nimport hasClass from 'dom-helpers/hasClass';\nimport { useBootstrapPrefix } from './ThemeProvider';\n\nfunction getMargins(element) {\n var styles = window.getComputedStyle(element);\n var top = parseFloat(styles.marginTop) || 0;\n var right = parseFloat(styles.marginRight) || 0;\n var bottom = parseFloat(styles.marginBottom) || 0;\n var left = parseFloat(styles.marginLeft) || 0;\n return {\n top: top,\n right: right,\n bottom: bottom,\n left: left\n };\n}\n\nexport default function usePopperMarginModifiers() {\n var overlayRef = useRef(null);\n var margins = useRef(null);\n var popoverClass = useBootstrapPrefix(undefined, 'popover');\n var dropdownMenuClass = useBootstrapPrefix(undefined, 'dropdown-menu');\n var callback = useCallback(function (overlay) {\n if (!overlay || !(hasClass(overlay, popoverClass) || hasClass(overlay, dropdownMenuClass))) return;\n margins.current = getMargins(overlay);\n overlay.style.margin = '0';\n overlayRef.current = overlay;\n }, [popoverClass, dropdownMenuClass]);\n var offset = useMemo(function () {\n return {\n name: 'offset',\n options: {\n offset: function offset(_ref) {\n var placement = _ref.placement;\n if (!margins.current) return [0, 0];\n var _margins$current = margins.current,\n top = _margins$current.top,\n left = _margins$current.left,\n bottom = _margins$current.bottom,\n right = _margins$current.right;\n\n switch (placement.split('-')[0]) {\n case 'top':\n return [0, bottom];\n\n case 'left':\n return [0, right];\n\n case 'bottom':\n return [0, top];\n\n case 'right':\n return [0, left];\n\n default:\n return [0, 0];\n }\n }\n }\n };\n }, [margins]); // Converts popover arrow margin to arrow modifier padding\n\n var popoverArrowMargins = useMemo(function () {\n return {\n name: 'popoverArrowMargins',\n enabled: true,\n phase: 'main',\n requiresIfExists: ['arrow'],\n effect: function effect(_ref2) {\n var state = _ref2.state;\n\n if (!overlayRef.current || !state.elements.arrow || !hasClass(overlayRef.current, popoverClass) || !state.modifiersData['arrow#persistent']) {\n return undefined;\n }\n\n var _getMargins = getMargins(state.elements.arrow),\n top = _getMargins.top,\n right = _getMargins.right;\n\n var padding = top || right;\n state.modifiersData['arrow#persistent'].padding = {\n top: padding,\n left: padding,\n right: padding,\n bottom: padding\n };\n state.elements.arrow.style.margin = '0';\n return function () {\n if (state.elements.arrow) state.elements.arrow.style.margin = '';\n };\n }\n };\n }, [popoverClass]);\n return [callback, [offset, popoverArrowMargins]];\n}","export default {\n disabled: false\n};","import React from 'react';\nexport default React.createContext(null);","import _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport PropTypes from 'prop-types';\nimport React from 'react';\nimport ReactDOM from 'react-dom';\nimport config from './config';\nimport { timeoutsShape } from './utils/PropTypes';\nimport TransitionGroupContext from './TransitionGroupContext';\nexport var UNMOUNTED = 'unmounted';\nexport var EXITED = 'exited';\nexport var ENTERING = 'entering';\nexport var ENTERED = 'entered';\nexport var EXITING = 'exiting';\n/**\n * The Transition component lets you describe a transition from one component\n * state to another _over time_ with a simple declarative API. Most commonly\n * it's used to animate the mounting and unmounting of a component, but can also\n * be used to describe in-place transition states as well.\n *\n * ---\n *\n * **Note**: `Transition` is a platform-agnostic base component. If you're using\n * transitions in CSS, you'll probably want to use\n * [`CSSTransition`](https://reactcommunity.org/react-transition-group/css-transition)\n * instead. It inherits all the features of `Transition`, but contains\n * additional features necessary to play nice with CSS transitions (hence the\n * name of the component).\n *\n * ---\n *\n * By default the `Transition` component does not alter the behavior of the\n * component it renders, it only tracks \"enter\" and \"exit\" states for the\n * components. It's up to you to give meaning and effect to those states. For\n * example we can add styles to a component when it enters or exits:\n *\n * ```jsx\n * import { Transition } from 'react-transition-group';\n *\n * const duration = 300;\n *\n * const defaultStyle = {\n * transition: `opacity ${duration}ms ease-in-out`,\n * opacity: 0,\n * }\n *\n * const transitionStyles = {\n * entering: { opacity: 1 },\n * entered: { opacity: 1 },\n * exiting: { opacity: 0 },\n * exited: { opacity: 0 },\n * };\n *\n * const Fade = ({ in: inProp }) => (\n * \n * {state => (\n * \n * I'm a fade Transition!\n *
\n * )}\n * \n * );\n * ```\n *\n * There are 4 main states a Transition can be in:\n * - `'entering'`\n * - `'entered'`\n * - `'exiting'`\n * - `'exited'`\n *\n * Transition state is toggled via the `in` prop. When `true` the component\n * begins the \"Enter\" stage. During this stage, the component will shift from\n * its current transition state, to `'entering'` for the duration of the\n * transition and then to the `'entered'` stage once it's complete. Let's take\n * the following example (we'll use the\n * [useState](https://reactjs.org/docs/hooks-reference.html#usestate) hook):\n *\n * ```jsx\n * function App() {\n * const [inProp, setInProp] = useState(false);\n * return (\n * \n * \n * {state => (\n * // ...\n * )}\n * \n * \n *
\n * );\n * }\n * ```\n *\n * When the button is clicked the component will shift to the `'entering'` state\n * and stay there for 500ms (the value of `timeout`) before it finally switches\n * to `'entered'`.\n *\n * When `in` is `false` the same thing happens except the state moves from\n * `'exiting'` to `'exited'`.\n */\n\nvar Transition = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(Transition, _React$Component);\n\n function Transition(props, context) {\n var _this;\n\n _this = _React$Component.call(this, props, context) || this;\n var parentGroup = context; // In the context of a TransitionGroup all enters are really appears\n\n var appear = parentGroup && !parentGroup.isMounting ? props.enter : props.appear;\n var initialStatus;\n _this.appearStatus = null;\n\n if (props.in) {\n if (appear) {\n initialStatus = EXITED;\n _this.appearStatus = ENTERING;\n } else {\n initialStatus = ENTERED;\n }\n } else {\n if (props.unmountOnExit || props.mountOnEnter) {\n initialStatus = UNMOUNTED;\n } else {\n initialStatus = EXITED;\n }\n }\n\n _this.state = {\n status: initialStatus\n };\n _this.nextCallback = null;\n return _this;\n }\n\n Transition.getDerivedStateFromProps = function getDerivedStateFromProps(_ref, prevState) {\n var nextIn = _ref.in;\n\n if (nextIn && prevState.status === UNMOUNTED) {\n return {\n status: EXITED\n };\n }\n\n return null;\n } // getSnapshotBeforeUpdate(prevProps) {\n // let nextStatus = null\n // if (prevProps !== this.props) {\n // const { status } = this.state\n // if (this.props.in) {\n // if (status !== ENTERING && status !== ENTERED) {\n // nextStatus = ENTERING\n // }\n // } else {\n // if (status === ENTERING || status === ENTERED) {\n // nextStatus = EXITING\n // }\n // }\n // }\n // return { nextStatus }\n // }\n ;\n\n var _proto = Transition.prototype;\n\n _proto.componentDidMount = function componentDidMount() {\n this.updateStatus(true, this.appearStatus);\n };\n\n _proto.componentDidUpdate = function componentDidUpdate(prevProps) {\n var nextStatus = null;\n\n if (prevProps !== this.props) {\n var status = this.state.status;\n\n if (this.props.in) {\n if (status !== ENTERING && status !== ENTERED) {\n nextStatus = ENTERING;\n }\n } else {\n if (status === ENTERING || status === ENTERED) {\n nextStatus = EXITING;\n }\n }\n }\n\n this.updateStatus(false, nextStatus);\n };\n\n _proto.componentWillUnmount = function componentWillUnmount() {\n this.cancelNextCallback();\n };\n\n _proto.getTimeouts = function getTimeouts() {\n var timeout = this.props.timeout;\n var exit, enter, appear;\n exit = enter = appear = timeout;\n\n if (timeout != null && typeof timeout !== 'number') {\n exit = timeout.exit;\n enter = timeout.enter; // TODO: remove fallback for next major\n\n appear = timeout.appear !== undefined ? timeout.appear : enter;\n }\n\n return {\n exit: exit,\n enter: enter,\n appear: appear\n };\n };\n\n _proto.updateStatus = function updateStatus(mounting, nextStatus) {\n if (mounting === void 0) {\n mounting = false;\n }\n\n if (nextStatus !== null) {\n // nextStatus will always be ENTERING or EXITING.\n this.cancelNextCallback();\n\n if (nextStatus === ENTERING) {\n this.performEnter(mounting);\n } else {\n this.performExit();\n }\n } else if (this.props.unmountOnExit && this.state.status === EXITED) {\n this.setState({\n status: UNMOUNTED\n });\n }\n };\n\n _proto.performEnter = function performEnter(mounting) {\n var _this2 = this;\n\n var enter = this.props.enter;\n var appearing = this.context ? this.context.isMounting : mounting;\n\n var _ref2 = this.props.nodeRef ? [appearing] : [ReactDOM.findDOMNode(this), appearing],\n maybeNode = _ref2[0],\n maybeAppearing = _ref2[1];\n\n var timeouts = this.getTimeouts();\n var enterTimeout = appearing ? timeouts.appear : timeouts.enter; // no enter animation skip right to ENTERED\n // if we are mounting and running this it means appear _must_ be set\n\n if (!mounting && !enter || config.disabled) {\n this.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode);\n });\n return;\n }\n\n this.props.onEnter(maybeNode, maybeAppearing);\n this.safeSetState({\n status: ENTERING\n }, function () {\n _this2.props.onEntering(maybeNode, maybeAppearing);\n\n _this2.onTransitionEnd(enterTimeout, function () {\n _this2.safeSetState({\n status: ENTERED\n }, function () {\n _this2.props.onEntered(maybeNode, maybeAppearing);\n });\n });\n });\n };\n\n _proto.performExit = function performExit() {\n var _this3 = this;\n\n var exit = this.props.exit;\n var timeouts = this.getTimeouts();\n var maybeNode = this.props.nodeRef ? undefined : ReactDOM.findDOMNode(this); // no exit animation skip right to EXITED\n\n if (!exit || config.disabled) {\n this.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n return;\n }\n\n this.props.onExit(maybeNode);\n this.safeSetState({\n status: EXITING\n }, function () {\n _this3.props.onExiting(maybeNode);\n\n _this3.onTransitionEnd(timeouts.exit, function () {\n _this3.safeSetState({\n status: EXITED\n }, function () {\n _this3.props.onExited(maybeNode);\n });\n });\n });\n };\n\n _proto.cancelNextCallback = function cancelNextCallback() {\n if (this.nextCallback !== null) {\n this.nextCallback.cancel();\n this.nextCallback = null;\n }\n };\n\n _proto.safeSetState = function safeSetState(nextState, callback) {\n // This shouldn't be necessary, but there are weird race conditions with\n // setState callbacks and unmounting in testing, so always make sure that\n // we can cancel any pending setState callbacks after we unmount.\n callback = this.setNextCallback(callback);\n this.setState(nextState, callback);\n };\n\n _proto.setNextCallback = function setNextCallback(callback) {\n var _this4 = this;\n\n var active = true;\n\n this.nextCallback = function (event) {\n if (active) {\n active = false;\n _this4.nextCallback = null;\n callback(event);\n }\n };\n\n this.nextCallback.cancel = function () {\n active = false;\n };\n\n return this.nextCallback;\n };\n\n _proto.onTransitionEnd = function onTransitionEnd(timeout, handler) {\n this.setNextCallback(handler);\n var node = this.props.nodeRef ? this.props.nodeRef.current : ReactDOM.findDOMNode(this);\n var doesNotHaveTimeoutOrListener = timeout == null && !this.props.addEndListener;\n\n if (!node || doesNotHaveTimeoutOrListener) {\n setTimeout(this.nextCallback, 0);\n return;\n }\n\n if (this.props.addEndListener) {\n var _ref3 = this.props.nodeRef ? [this.nextCallback] : [node, this.nextCallback],\n maybeNode = _ref3[0],\n maybeNextCallback = _ref3[1];\n\n this.props.addEndListener(maybeNode, maybeNextCallback);\n }\n\n if (timeout != null) {\n setTimeout(this.nextCallback, timeout);\n }\n };\n\n _proto.render = function render() {\n var status = this.state.status;\n\n if (status === UNMOUNTED) {\n return null;\n }\n\n var _this$props = this.props,\n children = _this$props.children,\n _in = _this$props.in,\n _mountOnEnter = _this$props.mountOnEnter,\n _unmountOnExit = _this$props.unmountOnExit,\n _appear = _this$props.appear,\n _enter = _this$props.enter,\n _exit = _this$props.exit,\n _timeout = _this$props.timeout,\n _addEndListener = _this$props.addEndListener,\n _onEnter = _this$props.onEnter,\n _onEntering = _this$props.onEntering,\n _onEntered = _this$props.onEntered,\n _onExit = _this$props.onExit,\n _onExiting = _this$props.onExiting,\n _onExited = _this$props.onExited,\n _nodeRef = _this$props.nodeRef,\n childProps = _objectWithoutPropertiesLoose(_this$props, [\"children\", \"in\", \"mountOnEnter\", \"unmountOnExit\", \"appear\", \"enter\", \"exit\", \"timeout\", \"addEndListener\", \"onEnter\", \"onEntering\", \"onEntered\", \"onExit\", \"onExiting\", \"onExited\", \"nodeRef\"]);\n\n return (\n /*#__PURE__*/\n // allows for nested Transitions\n React.createElement(TransitionGroupContext.Provider, {\n value: null\n }, typeof children === 'function' ? children(status, childProps) : React.cloneElement(React.Children.only(children), childProps))\n );\n };\n\n return Transition;\n}(React.Component);\n\nTransition.contextType = TransitionGroupContext;\nTransition.propTypes = process.env.NODE_ENV !== \"production\" ? {\n /**\n * A React reference to DOM element that need to transition:\n * https://stackoverflow.com/a/51127130/4671932\n *\n * - When `nodeRef` prop is used, `node` is not passed to callback functions\n * (e.g. `onEnter`) because user already has direct access to the node.\n * - When changing `key` prop of `Transition` in a `TransitionGroup` a new\n * `nodeRef` need to be provided to `Transition` with changed `key` prop\n * (see\n * [test/CSSTransition-test.js](https://github.com/reactjs/react-transition-group/blob/13435f897b3ab71f6e19d724f145596f5910581c/test/CSSTransition-test.js#L362-L437)).\n */\n nodeRef: PropTypes.shape({\n current: typeof Element === 'undefined' ? PropTypes.any : PropTypes.instanceOf(Element)\n }),\n\n /**\n * A `function` child can be used instead of a React element. This function is\n * called with the current transition status (`'entering'`, `'entered'`,\n * `'exiting'`, `'exited'`), which can be used to apply context\n * specific props to a component.\n *\n * ```jsx\n * \n * {state => (\n * \n * )}\n * \n * ```\n */\n children: PropTypes.oneOfType([PropTypes.func.isRequired, PropTypes.element.isRequired]).isRequired,\n\n /**\n * Show the component; triggers the enter or exit states\n */\n in: PropTypes.bool,\n\n /**\n * By default the child component is mounted immediately along with\n * the parent `Transition` component. If you want to \"lazy mount\" the component on the\n * first `in={true}` you can set `mountOnEnter`. After the first enter transition the component will stay\n * mounted, even on \"exited\", unless you also specify `unmountOnExit`.\n */\n mountOnEnter: PropTypes.bool,\n\n /**\n * By default the child component stays mounted after it reaches the `'exited'` state.\n * Set `unmountOnExit` if you'd prefer to unmount the component after it finishes exiting.\n */\n unmountOnExit: PropTypes.bool,\n\n /**\n * By default the child component does not perform the enter transition when\n * it first mounts, regardless of the value of `in`. If you want this\n * behavior, set both `appear` and `in` to `true`.\n *\n * > **Note**: there are no special appear states like `appearing`/`appeared`, this prop\n * > only adds an additional enter transition. However, in the\n * > `` component that first enter transition does result in\n * > additional `.appear-*` classes, that way you can choose to style it\n * > differently.\n */\n appear: PropTypes.bool,\n\n /**\n * Enable or disable enter transitions.\n */\n enter: PropTypes.bool,\n\n /**\n * Enable or disable exit transitions.\n */\n exit: PropTypes.bool,\n\n /**\n * The duration of the transition, in milliseconds.\n * Required unless `addEndListener` is provided.\n *\n * You may specify a single timeout for all transitions:\n *\n * ```jsx\n * timeout={500}\n * ```\n *\n * or individually:\n *\n * ```jsx\n * timeout={{\n * appear: 500,\n * enter: 300,\n * exit: 500,\n * }}\n * ```\n *\n * - `appear` defaults to the value of `enter`\n * - `enter` defaults to `0`\n * - `exit` defaults to `0`\n *\n * @type {number | { enter?: number, exit?: number, appear?: number }}\n */\n timeout: function timeout(props) {\n var pt = timeoutsShape;\n if (!props.addEndListener) pt = pt.isRequired;\n\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return pt.apply(void 0, [props].concat(args));\n },\n\n /**\n * Add a custom transition end trigger. Called with the transitioning\n * DOM node and a `done` callback. Allows for more fine grained transition end\n * logic. Timeouts are still used as a fallback if provided.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * ```jsx\n * addEndListener={(node, done) => {\n * // use the css transitionend event to mark the finish of a transition\n * node.addEventListener('transitionend', done, false);\n * }}\n * ```\n */\n addEndListener: PropTypes.func,\n\n /**\n * Callback fired before the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEnter: PropTypes.func,\n\n /**\n * Callback fired after the \"entering\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool)\n */\n onEntering: PropTypes.func,\n\n /**\n * Callback fired after the \"entered\" status is applied. An extra parameter\n * `isAppearing` is supplied to indicate if the enter stage is occurring on the initial mount\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement, isAppearing: bool) -> void\n */\n onEntered: PropTypes.func,\n\n /**\n * Callback fired before the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExit: PropTypes.func,\n\n /**\n * Callback fired after the \"exiting\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed.\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExiting: PropTypes.func,\n\n /**\n * Callback fired after the \"exited\" status is applied.\n *\n * **Note**: when `nodeRef` prop is passed, `node` is not passed\n *\n * @type Function(node: HtmlElement) -> void\n */\n onExited: PropTypes.func\n} : {}; // Name the function so it is clearer in the documentation\n\nfunction noop() {}\n\nTransition.defaultProps = {\n in: false,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false,\n enter: true,\n exit: true,\n onEnter: noop,\n onEntering: noop,\n onEntered: noop,\n onExit: noop,\n onExiting: noop,\n onExited: noop\n};\nTransition.UNMOUNTED = UNMOUNTED;\nTransition.EXITED = EXITED;\nTransition.ENTERING = ENTERING;\nTransition.ENTERED = ENTERED;\nTransition.EXITING = EXITING;\nexport default Transition;","import ownerWindow from './ownerWindow';\nexport default function getComputedStyle(node, psuedoElement) {\n return ownerWindow(node).getComputedStyle(node, psuedoElement);\n}","import ownerDocument from './ownerDocument';\nexport default function ownerWindow(node) {\n var doc = ownerDocument(node);\n return doc && doc.defaultView || window;\n}","var rUpper = /([A-Z])/g;\nexport default function hyphenate(string) {\n return string.replace(rUpper, '-$1').toLowerCase();\n}","/**\n * Copyright 2013-2014, Facebook, Inc.\n * All rights reserved.\n * https://github.com/facebook/react/blob/2aeb8a2a6beb00617a4217f7f8284924fa2ad819/src/vendor/core/hyphenateStyleName.js\n */\nimport hyphenate from './hyphenate';\nvar msPattern = /^ms-/;\nexport default function hyphenateStyleName(string) {\n return hyphenate(string).replace(msPattern, '-ms-');\n}","var supportedTransforms = /^((translate|rotate|scale)(X|Y|Z|3d)?|matrix(3d)?|perspective|skew(X|Y)?)$/i;\nexport default function isTransform(value) {\n return !!(value && supportedTransforms.test(value));\n}","import getComputedStyle from './getComputedStyle';\nimport hyphenate from './hyphenateStyle';\nimport isTransform from './isTransform';\n\nfunction style(node, property) {\n var css = '';\n var transforms = '';\n\n if (typeof property === 'string') {\n return node.style.getPropertyValue(hyphenate(property)) || getComputedStyle(node).getPropertyValue(hyphenate(property));\n }\n\n Object.keys(property).forEach(function (key) {\n var value = property[key];\n\n if (!value && value !== 0) {\n node.style.removeProperty(hyphenate(key));\n } else if (isTransform(key)) {\n transforms += key + \"(\" + value + \") \";\n } else {\n css += hyphenate(key) + \": \" + value + \";\";\n }\n });\n\n if (transforms) {\n css += \"transform: \" + transforms + \";\";\n }\n\n node.style.cssText += \";\" + css;\n}\n\nexport default style;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\n\nvar _fadeStyles;\n\nimport classNames from 'classnames';\nimport React, { useCallback } from 'react';\nimport Transition, { ENTERED, ENTERING } from 'react-transition-group/Transition';\nimport transitionEndListener from './transitionEndListener';\nimport triggerBrowserReflow from './triggerBrowserReflow';\nvar defaultProps = {\n in: false,\n timeout: 300,\n mountOnEnter: false,\n unmountOnExit: false,\n appear: false\n};\nvar fadeStyles = (_fadeStyles = {}, _fadeStyles[ENTERING] = 'show', _fadeStyles[ENTERED] = 'show', _fadeStyles);\nvar Fade = /*#__PURE__*/React.forwardRef(function (_ref, ref) {\n var className = _ref.className,\n children = _ref.children,\n props = _objectWithoutPropertiesLoose(_ref, [\"className\", \"children\"]);\n\n var handleEnter = useCallback(function (node) {\n triggerBrowserReflow(node);\n if (props.onEnter) props.onEnter(node);\n }, [props]);\n return /*#__PURE__*/React.createElement(Transition, _extends({\n ref: ref,\n addEndListener: transitionEndListener\n }, props, {\n onEnter: handleEnter\n }), function (status, innerProps) {\n return /*#__PURE__*/React.cloneElement(children, _extends({}, innerProps, {\n className: classNames('fade', className, children.props.className, fadeStyles[status])\n }));\n });\n});\nFade.defaultProps = defaultProps;\nFade.displayName = 'Fade';\nexport default Fade;","import css from './css';\nimport listen from './listen';\n\nfunction parseDuration(node) {\n var str = css(node, 'transitionDuration') || '';\n var mult = str.indexOf('ms') === -1 ? 1000 : 1;\n return parseFloat(str) * mult;\n}\n\nfunction triggerTransitionEnd(element) {\n var evt = document.createEvent('HTMLEvents');\n evt.initEvent('transitionend', true, true);\n element.dispatchEvent(evt);\n}\n\nfunction emulateTransitionEnd(element, duration, padding) {\n if (padding === void 0) {\n padding = 5;\n }\n\n var called = false;\n var handle = setTimeout(function () {\n if (!called) triggerTransitionEnd(element);\n }, duration + padding);\n var remove = listen(element, 'transitionend', function () {\n called = true;\n }, {\n once: true\n });\n return function () {\n clearTimeout(handle);\n remove();\n };\n}\n\nexport default function transitionEnd(element, handler, duration, padding) {\n if (duration == null) duration = parseDuration(element) || 0;\n var removeEmulate = emulateTransitionEnd(element, duration, padding);\n var remove = listen(element, 'transitionend', handler);\n return function () {\n removeEmulate();\n remove();\n };\n}","import css from 'dom-helpers/css';\nimport transitionEnd from 'dom-helpers/transitionEnd';\n\nfunction parseDuration(node, property) {\n var str = css(node, property) || '';\n var mult = str.indexOf('ms') === -1 ? 1000 : 1;\n return parseFloat(str) * mult;\n}\n\nexport default function transitionEndListener(element, handler) {\n var duration = parseDuration(element, 'transitionDuration');\n var delay = parseDuration(element, 'transitionDelay');\n var remove = transitionEnd(element, function (e) {\n if (e.target === element) {\n remove();\n handler(e);\n }\n }, duration + delay);\n}","// reading a dimension prop will cause the browser to recalculate,\n// which will let our animations work\nexport default function triggerBrowserReflow(node) {\n // eslint-disable-next-line @typescript-eslint/no-unused-expressions\n node.offsetHeight;\n}","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport React, { useRef } from 'react';\nimport classNames from 'classnames';\nimport BaseOverlay from 'react-overlays/Overlay';\nimport safeFindDOMNode from 'react-overlays/safeFindDOMNode';\nimport usePopperMarginModifiers from './usePopperMarginModifiers';\nimport Fade from './Fade';\nvar defaultProps = {\n transition: Fade,\n rootClose: false,\n show: false,\n placement: 'top'\n};\n\nfunction wrapRefs(props, arrowProps) {\n var ref = props.ref;\n var aRef = arrowProps.ref;\n\n props.ref = ref.__wrapped || (ref.__wrapped = function (r) {\n return ref(safeFindDOMNode(r));\n });\n\n arrowProps.ref = aRef.__wrapped || (aRef.__wrapped = function (r) {\n return aRef(safeFindDOMNode(r));\n });\n}\n\nfunction Overlay(_ref) {\n var overlay = _ref.children,\n transition = _ref.transition,\n _ref$popperConfig = _ref.popperConfig,\n popperConfig = _ref$popperConfig === void 0 ? {} : _ref$popperConfig,\n outerProps = _objectWithoutPropertiesLoose(_ref, [\"children\", \"transition\", \"popperConfig\"]);\n\n var popperRef = useRef({});\n\n var _usePopperMarginModif = usePopperMarginModifiers(),\n ref = _usePopperMarginModif[0],\n marginModifiers = _usePopperMarginModif[1];\n\n var actualTransition = transition === true ? Fade : transition || null;\n return /*#__PURE__*/React.createElement(BaseOverlay, _extends({}, outerProps, {\n ref: ref,\n popperConfig: _extends({}, popperConfig, {\n modifiers: marginModifiers.concat(popperConfig.modifiers || [])\n }),\n transition: actualTransition\n }), function (_ref2) {\n var _state$modifiersData$;\n\n var overlayProps = _ref2.props,\n arrowProps = _ref2.arrowProps,\n show = _ref2.show,\n update = _ref2.update,\n _ = _ref2.forceUpdate,\n placement = _ref2.placement,\n state = _ref2.state,\n props = _objectWithoutPropertiesLoose(_ref2, [\"props\", \"arrowProps\", \"show\", \"update\", \"forceUpdate\", \"placement\", \"state\"]);\n\n wrapRefs(overlayProps, arrowProps);\n var popper = Object.assign(popperRef.current, {\n state: state,\n scheduleUpdate: update,\n placement: placement,\n outOfBoundaries: (state == null ? void 0 : (_state$modifiersData$ = state.modifiersData.hide) == null ? void 0 : _state$modifiersData$.isReferenceHidden) || false\n });\n if (typeof overlay === 'function') return overlay(_extends({}, props, overlayProps, {\n placement: placement,\n show: show\n }, !transition && show && {\n className: 'show'\n }, {\n popper: popper,\n arrowProps: arrowProps\n }));\n return /*#__PURE__*/React.cloneElement(overlay, _extends({}, props, overlayProps, {\n placement: placement,\n arrowProps: arrowProps,\n popper: popper,\n className: classNames(overlay.props.className, !transition && show && 'show'),\n style: _extends({}, overlay.props.style, overlayProps.style)\n }));\n });\n}\n\nOverlay.defaultProps = defaultProps;\nexport default Overlay;","import _extends from \"@babel/runtime/helpers/esm/extends\";\nimport _objectWithoutPropertiesLoose from \"@babel/runtime/helpers/esm/objectWithoutPropertiesLoose\";\nimport _inheritsLoose from \"@babel/runtime/helpers/esm/inheritsLoose\";\nimport contains from 'dom-helpers/contains';\nimport React, { cloneElement, useCallback, useRef } from 'react';\nimport useTimeout from '@restart/hooks/useTimeout';\nimport safeFindDOMNode from 'react-overlays/safeFindDOMNode';\nimport warning from 'warning';\nimport { useUncontrolledProp } from 'uncontrollable';\nimport Overlay from './Overlay';\n\nvar RefHolder = /*#__PURE__*/function (_React$Component) {\n _inheritsLoose(RefHolder, _React$Component);\n\n function RefHolder() {\n return _React$Component.apply(this, arguments) || this;\n }\n\n var _proto = RefHolder.prototype;\n\n _proto.render = function render() {\n return this.props.children;\n };\n\n return RefHolder;\n}(React.Component);\n\nfunction normalizeDelay(delay) {\n return delay && typeof delay === 'object' ? delay : {\n show: delay,\n hide: delay\n };\n} // Simple implementation of mouseEnter and mouseLeave.\n// React's built version is broken: https://github.com/facebook/react/issues/4251\n// for cases when the trigger is disabled and mouseOut/Over can cause flicker\n// moving from one child element to another.\n\n\nfunction handleMouseOverOut( // eslint-disable-next-line @typescript-eslint/no-shadow\nhandler, args, relatedNative) {\n var e = args[0];\n var target = e.currentTarget;\n var related = e.relatedTarget || e.nativeEvent[relatedNative];\n\n if ((!related || related !== target) && !contains(target, related)) {\n handler.apply(void 0, args);\n }\n}\n\nvar defaultProps = {\n defaultShow: false,\n trigger: ['hover', 'focus']\n};\n\nfunction OverlayTrigger(_ref) {\n var trigger = _ref.trigger,\n overlay = _ref.overlay,\n children = _ref.children,\n _ref$popperConfig = _ref.popperConfig,\n popperConfig = _ref$popperConfig === void 0 ? {} : _ref$popperConfig,\n propsShow = _ref.show,\n _ref$defaultShow = _ref.defaultShow,\n defaultShow = _ref$defaultShow === void 0 ? false : _ref$defaultShow,\n onToggle = _ref.onToggle,\n propsDelay = _ref.delay,\n placement = _ref.placement,\n _ref$flip = _ref.flip,\n flip = _ref$flip === void 0 ? placement && placement.indexOf('auto') !== -1 : _ref$flip,\n props = _objectWithoutPropertiesLoose(_ref, [\"trigger\", \"overlay\", \"children\", \"popperConfig\", \"show\", \"defaultShow\", \"onToggle\", \"delay\", \"placement\", \"flip\"]);\n\n var triggerNodeRef = useRef(null);\n var timeout = useTimeout();\n var hoverStateRef = useRef('');\n\n var _useUncontrolledProp = useUncontrolledProp(propsShow, defaultShow, onToggle),\n show = _useUncontrolledProp[0],\n setShow = _useUncontrolledProp[1];\n\n var delay = normalizeDelay(propsDelay);\n\n var _ref2 = typeof children !== 'function' ? React.Children.only(children).props : {},\n onFocus = _ref2.onFocus,\n onBlur = _ref2.onBlur,\n onClick = _ref2.onClick;\n\n var getTarget = useCallback(function () {\n return safeFindDOMNode(triggerNodeRef.current);\n }, []);\n var handleShow = useCallback(function () {\n timeout.clear();\n hoverStateRef.current = 'show';\n\n if (!delay.show) {\n setShow(true);\n return;\n }\n\n timeout.set(function () {\n if (hoverStateRef.current === 'show') setShow(true);\n }, delay.show);\n }, [delay.show, setShow, timeout]);\n var handleHide = useCallback(function () {\n timeout.clear();\n hoverStateRef.current = 'hide';\n\n if (!delay.hide) {\n setShow(false);\n return;\n }\n\n timeout.set(function () {\n if (hoverStateRef.current === 'hide') setShow(false);\n }, delay.hide);\n }, [delay.hide, setShow, timeout]);\n var handleFocus = useCallback(function () {\n handleShow();\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n onFocus == null ? void 0 : onFocus.apply(void 0, args);\n }, [handleShow, onFocus]);\n var handleBlur = useCallback(function () {\n handleHide();\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n onBlur == null ? void 0 : onBlur.apply(void 0, args);\n }, [handleHide, onBlur]);\n var handleClick = useCallback(function () {\n setShow(!show);\n if (onClick) onClick.apply(void 0, arguments);\n }, [onClick, setShow, show]);\n var handleMouseOver = useCallback(function () {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n handleMouseOverOut(handleShow, args, 'fromElement');\n }, [handleShow]);\n var handleMouseOut = useCallback(function () {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n handleMouseOverOut(handleHide, args, 'toElement');\n }, [handleHide]);\n var triggers = trigger == null ? [] : [].concat(trigger);\n var triggerProps = {};\n\n if (triggers.indexOf('click') !== -1) {\n triggerProps.onClick = handleClick;\n }\n\n if (triggers.indexOf('focus') !== -1) {\n triggerProps.onFocus = handleFocus;\n triggerProps.onBlur = handleBlur;\n }\n\n if (triggers.indexOf('hover') !== -1) {\n process.env.NODE_ENV !== \"production\" ? warning(triggers.length > 1, '[react-bootstrap] Specifying only the `\"hover\"` trigger limits the visibility of the overlay to just mouse users. Consider also including the `\"focus\"` trigger so that touch and keyboard only users can see the overlay as well.') : void 0;\n triggerProps.onMouseOver = handleMouseOver;\n triggerProps.onMouseOut = handleMouseOut;\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, typeof children === 'function' ? children(_extends({}, triggerProps, {\n ref: triggerNodeRef\n })) : /*#__PURE__*/React.createElement(RefHolder, {\n ref: triggerNodeRef\n }, /*#__PURE__*/cloneElement(children, triggerProps)), /*#__PURE__*/React.createElement(Overlay, _extends({}, props, {\n show: show,\n onHide: handleHide,\n flip: flip,\n placement: placement,\n popperConfig: popperConfig,\n target: getTarget\n }), overlay));\n}\n\nOverlayTrigger.defaultProps = defaultProps;\nexport default OverlayTrigger;","export default __webpack_public_path__ + \"static/media/getFetch.d7d6010d.cjs\";","/*\nobject-assign\n(c) Sindre Sorhus\n@license MIT\n*/\n\n'use strict';\n/* eslint-disable no-unused-vars */\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nvar propIsEnumerable = Object.prototype.propertyIsEnumerable;\n\nfunction toObject(val) {\n\tif (val === null || val === undefined) {\n\t\tthrow new TypeError('Object.assign cannot be called with null or undefined');\n\t}\n\n\treturn Object(val);\n}\n\nfunction shouldUseNative() {\n\ttry {\n\t\tif (!Object.assign) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Detect buggy property enumeration order in older V8 versions.\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=4118\n\t\tvar test1 = new String('abc'); // eslint-disable-line no-new-wrappers\n\t\ttest1[5] = 'de';\n\t\tif (Object.getOwnPropertyNames(test1)[0] === '5') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test2 = {};\n\t\tfor (var i = 0; i < 10; i++) {\n\t\t\ttest2['_' + String.fromCharCode(i)] = i;\n\t\t}\n\t\tvar order2 = Object.getOwnPropertyNames(test2).map(function (n) {\n\t\t\treturn test2[n];\n\t\t});\n\t\tif (order2.join('') !== '0123456789') {\n\t\t\treturn false;\n\t\t}\n\n\t\t// https://bugs.chromium.org/p/v8/issues/detail?id=3056\n\t\tvar test3 = {};\n\t\t'abcdefghijklmnopqrst'.split('').forEach(function (letter) {\n\t\t\ttest3[letter] = letter;\n\t\t});\n\t\tif (Object.keys(Object.assign({}, test3)).join('') !==\n\t\t\t\t'abcdefghijklmnopqrst') {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t} catch (err) {\n\t\t// We don't expect any of the above to throw, but better to be safe.\n\t\treturn false;\n\t}\n}\n\nmodule.exports = shouldUseNative() ? Object.assign : function (target, source) {\n\tvar from;\n\tvar to = toObject(target);\n\tvar symbols;\n\n\tfor (var s = 1; s < arguments.length; s++) {\n\t\tfrom = Object(arguments[s]);\n\n\t\tfor (var key in from) {\n\t\t\tif (hasOwnProperty.call(from, key)) {\n\t\t\t\tto[key] = from[key];\n\t\t\t}\n\t\t}\n\n\t\tif (getOwnPropertySymbols) {\n\t\t\tsymbols = getOwnPropertySymbols(from);\n\t\t\tfor (var i = 0; i < symbols.length; i++) {\n\t\t\t\tif (propIsEnumerable.call(from, symbols[i])) {\n\t\t\t\t\tto[symbols[i]] = from[symbols[i]];\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn to;\n};\n","module.exports = extend\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction extend() {\n var target = {}\n\n for (var i = 0; i < arguments.length; i++) {\n var source = arguments[i]\n\n for (var key in source) {\n if (hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n\n return target\n}\n","'use strict'\n\nfunction normalizeIdentifier(value) {\n return (\n value // Collapse Markdown whitespace.\n .replace(/[\\t\\n\\r ]+/g, ' ') // Trim.\n .replace(/^ | $/g, '') // Some characters are considered “uppercase”, but if their lowercase\n // counterpart is uppercased will result in a different uppercase\n // character.\n // Hence, to get that form, we perform both lower- and uppercase.\n // Upper case makes sure keys will not interact with default prototypal\n // methods: no object method is uppercase.\n .toLowerCase()\n .toUpperCase()\n )\n}\n\nmodule.exports = normalizeIdentifier\n","'use strict'\n\nfunction miniflat(value) {\n return value === null || value === undefined\n ? []\n : 'length' in value\n ? value\n : [value]\n}\n\nmodule.exports = miniflat\n","'use strict'\n\nvar chunkedSplice = require('./chunked-splice.js')\n\nfunction chunkedPush(list, items) {\n if (list.length) {\n chunkedSplice(list, list.length, 0, items)\n return list\n }\n\n return items\n}\n\nmodule.exports = chunkedPush\n","'use strict'\n\nfunction resolveAll(constructs, events, context) {\n var called = []\n var index = -1\n var resolve\n\n while (++index < constructs.length) {\n resolve = constructs[index].resolveAll\n\n if (resolve && called.indexOf(resolve) < 0) {\n events = resolve(events, context)\n called.push(resolve)\n }\n }\n\n return events\n}\n\nmodule.exports = resolveAll\n","'use strict'\n\nvar regexCheck = require('../util/regex-check.js')\n\nvar asciiAlpha = regexCheck(/[A-Za-z]/)\n\nmodule.exports = asciiAlpha\n","'use strict'\n\nvar markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js')\nvar chunkedPush = require('../util/chunked-push.js')\nvar chunkedSplice = require('../util/chunked-splice.js')\nvar normalizeIdentifier = require('../util/normalize-identifier.js')\nvar resolveAll = require('../util/resolve-all.js')\nvar shallow = require('../util/shallow.js')\nvar factoryDestination = require('./factory-destination.js')\nvar factoryLabel = require('./factory-label.js')\nvar factoryTitle = require('./factory-title.js')\nvar factoryWhitespace = require('./factory-whitespace.js')\n\nvar labelEnd = {\n name: 'labelEnd',\n tokenize: tokenizeLabelEnd,\n resolveTo: resolveToLabelEnd,\n resolveAll: resolveAllLabelEnd\n}\nvar resourceConstruct = {\n tokenize: tokenizeResource\n}\nvar fullReferenceConstruct = {\n tokenize: tokenizeFullReference\n}\nvar collapsedReferenceConstruct = {\n tokenize: tokenizeCollapsedReference\n}\n\nfunction resolveAllLabelEnd(events) {\n var index = -1\n var token\n\n while (++index < events.length) {\n token = events[index][1]\n\n if (\n !token._used &&\n (token.type === 'labelImage' ||\n token.type === 'labelLink' ||\n token.type === 'labelEnd')\n ) {\n // Remove the marker.\n events.splice(index + 1, token.type === 'labelImage' ? 4 : 2)\n token.type = 'data'\n index++\n }\n }\n\n return events\n}\n\nfunction resolveToLabelEnd(events, context) {\n var index = events.length\n var offset = 0\n var group\n var label\n var text\n var token\n var open\n var close\n var media // Find an opening.\n\n while (index--) {\n token = events[index][1]\n\n if (open) {\n // If we see another link, or inactive link label, we’ve been here before.\n if (\n token.type === 'link' ||\n (token.type === 'labelLink' && token._inactive)\n ) {\n break\n } // Mark other link openings as inactive, as we can’t have links in\n // links.\n\n if (events[index][0] === 'enter' && token.type === 'labelLink') {\n token._inactive = true\n }\n } else if (close) {\n if (\n events[index][0] === 'enter' &&\n (token.type === 'labelImage' || token.type === 'labelLink') &&\n !token._balanced\n ) {\n open = index\n\n if (token.type !== 'labelLink') {\n offset = 2\n break\n }\n }\n } else if (token.type === 'labelEnd') {\n close = index\n }\n }\n\n group = {\n type: events[open][1].type === 'labelLink' ? 'link' : 'image',\n start: shallow(events[open][1].start),\n end: shallow(events[events.length - 1][1].end)\n }\n label = {\n type: 'label',\n start: shallow(events[open][1].start),\n end: shallow(events[close][1].end)\n }\n text = {\n type: 'labelText',\n start: shallow(events[open + offset + 2][1].end),\n end: shallow(events[close - 2][1].start)\n }\n media = [\n ['enter', group, context],\n ['enter', label, context]\n ] // Opening marker.\n\n media = chunkedPush(media, events.slice(open + 1, open + offset + 3)) // Text open.\n\n media = chunkedPush(media, [['enter', text, context]]) // Between.\n\n media = chunkedPush(\n media,\n resolveAll(\n context.parser.constructs.insideSpan.null,\n events.slice(open + offset + 4, close - 3),\n context\n )\n ) // Text close, marker close, label close.\n\n media = chunkedPush(media, [\n ['exit', text, context],\n events[close - 2],\n events[close - 1],\n ['exit', label, context]\n ]) // Reference, resource, or so.\n\n media = chunkedPush(media, events.slice(close + 1)) // Media close.\n\n media = chunkedPush(media, [['exit', group, context]])\n chunkedSplice(events, open, events.length, media)\n return events\n}\n\nfunction tokenizeLabelEnd(effects, ok, nok) {\n var self = this\n var index = self.events.length\n var labelStart\n var defined // Find an opening.\n\n while (index--) {\n if (\n (self.events[index][1].type === 'labelImage' ||\n self.events[index][1].type === 'labelLink') &&\n !self.events[index][1]._balanced\n ) {\n labelStart = self.events[index][1]\n break\n }\n }\n\n return start\n\n function start(code) {\n if (!labelStart) {\n return nok(code)\n } // It’s a balanced bracket, but contains a link.\n\n if (labelStart._inactive) return balanced(code)\n defined =\n self.parser.defined.indexOf(\n normalizeIdentifier(\n self.sliceSerialize({\n start: labelStart.end,\n end: self.now()\n })\n )\n ) > -1\n effects.enter('labelEnd')\n effects.enter('labelMarker')\n effects.consume(code)\n effects.exit('labelMarker')\n effects.exit('labelEnd')\n return afterLabelEnd\n }\n\n function afterLabelEnd(code) {\n // Resource: `[asd](fgh)`.\n if (code === 40) {\n return effects.attempt(\n resourceConstruct,\n ok,\n defined ? ok : balanced\n )(code)\n } // Collapsed (`[asd][]`) or full (`[asd][fgh]`) reference?\n\n if (code === 91) {\n return effects.attempt(\n fullReferenceConstruct,\n ok,\n defined\n ? effects.attempt(collapsedReferenceConstruct, ok, balanced)\n : balanced\n )(code)\n } // Shortcut reference: `[asd]`?\n\n return defined ? ok(code) : balanced(code)\n }\n\n function balanced(code) {\n labelStart._balanced = true\n return nok(code)\n }\n}\n\nfunction tokenizeResource(effects, ok, nok) {\n return start\n\n function start(code) {\n effects.enter('resource')\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n return factoryWhitespace(effects, open)\n }\n\n function open(code) {\n if (code === 41) {\n return end(code)\n }\n\n return factoryDestination(\n effects,\n destinationAfter,\n nok,\n 'resourceDestination',\n 'resourceDestinationLiteral',\n 'resourceDestinationLiteralMarker',\n 'resourceDestinationRaw',\n 'resourceDestinationString',\n 3\n )(code)\n }\n\n function destinationAfter(code) {\n return markdownLineEndingOrSpace(code)\n ? factoryWhitespace(effects, between)(code)\n : end(code)\n }\n\n function between(code) {\n if (code === 34 || code === 39 || code === 40) {\n return factoryTitle(\n effects,\n factoryWhitespace(effects, end),\n nok,\n 'resourceTitle',\n 'resourceTitleMarker',\n 'resourceTitleString'\n )(code)\n }\n\n return end(code)\n }\n\n function end(code) {\n if (code === 41) {\n effects.enter('resourceMarker')\n effects.consume(code)\n effects.exit('resourceMarker')\n effects.exit('resource')\n return ok\n }\n\n return nok(code)\n }\n}\n\nfunction tokenizeFullReference(effects, ok, nok) {\n var self = this\n return start\n\n function start(code) {\n return factoryLabel.call(\n self,\n effects,\n afterLabel,\n nok,\n 'reference',\n 'referenceMarker',\n 'referenceString'\n )(code)\n }\n\n function afterLabel(code) {\n return self.parser.defined.indexOf(\n normalizeIdentifier(\n self.sliceSerialize(self.events[self.events.length - 1][1]).slice(1, -1)\n )\n ) < 0\n ? nok(code)\n : ok(code)\n }\n}\n\nfunction tokenizeCollapsedReference(effects, ok, nok) {\n return start\n\n function start(code) {\n effects.enter('reference')\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n return open\n }\n\n function open(code) {\n if (code === 93) {\n effects.enter('referenceMarker')\n effects.consume(code)\n effects.exit('referenceMarker')\n effects.exit('reference')\n return ok\n }\n\n return nok(code)\n }\n}\n\nmodule.exports = labelEnd\n","import _extends from '@babel/runtime/helpers/esm/extends';\nimport _objectWithoutPropertiesLoose from '@babel/runtime/helpers/esm/objectWithoutPropertiesLoose';\nimport React, { useState, useCallback, forwardRef, useRef, useEffect, useImperativeHandle, useMemo } from 'react';\n\nconst is = {\n arr: Array.isArray,\n obj: a => Object.prototype.toString.call(a) === '[object Object]',\n fun: a => typeof a === 'function',\n str: a => typeof a === 'string',\n num: a => typeof a === 'number',\n und: a => a === void 0,\n nul: a => a === null,\n set: a => a instanceof Set,\n map: a => a instanceof Map,\n\n equ(a, b) {\n if (typeof a !== typeof b) return false;\n if (is.str(a) || is.num(a)) return a === b;\n if (is.obj(a) && is.obj(b) && Object.keys(a).length + Object.keys(b).length === 0) return true;\n let i;\n\n for (i in a) if (!(i in b)) return false;\n\n for (i in b) if (a[i] !== b[i]) return false;\n\n return is.und(i) ? a === b : true;\n }\n\n};\nfunction merge(target, lowercase) {\n if (lowercase === void 0) {\n lowercase = true;\n }\n\n return object => (is.arr(object) ? object : Object.keys(object)).reduce((acc, element) => {\n const key = lowercase ? element[0].toLowerCase() + element.substring(1) : element;\n acc[key] = target(key);\n return acc;\n }, target);\n}\nfunction useForceUpdate() {\n const _useState = useState(false),\n f = _useState[1];\n\n const forceUpdate = useCallback(() => f(v => !v), []);\n return forceUpdate;\n}\nfunction withDefault(value, defaultValue) {\n return is.und(value) || is.nul(value) ? defaultValue : value;\n}\nfunction toArray(a) {\n return !is.und(a) ? is.arr(a) ? a : [a] : [];\n}\nfunction callProp(obj) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n return is.fun(obj) ? obj(...args) : obj;\n}\n\nfunction getForwardProps(props) {\n const to = props.to,\n from = props.from,\n config = props.config,\n onStart = props.onStart,\n onRest = props.onRest,\n onFrame = props.onFrame,\n children = props.children,\n reset = props.reset,\n reverse = props.reverse,\n force = props.force,\n immediate = props.immediate,\n delay = props.delay,\n attach = props.attach,\n destroyed = props.destroyed,\n interpolateTo = props.interpolateTo,\n ref = props.ref,\n lazy = props.lazy,\n forward = _objectWithoutPropertiesLoose(props, [\"to\", \"from\", \"config\", \"onStart\", \"onRest\", \"onFrame\", \"children\", \"reset\", \"reverse\", \"force\", \"immediate\", \"delay\", \"attach\", \"destroyed\", \"interpolateTo\", \"ref\", \"lazy\"]);\n\n return forward;\n}\n\nfunction interpolateTo(props) {\n const forward = getForwardProps(props);\n if (is.und(forward)) return _extends({\n to: forward\n }, props);\n const rest = Object.keys(props).reduce((a, k) => !is.und(forward[k]) ? a : _extends({}, a, {\n [k]: props[k]\n }), {});\n return _extends({\n to: forward\n }, rest);\n}\nfunction handleRef(ref, forward) {\n if (forward) {\n // If it's a function, assume it's a ref callback\n if (is.fun(forward)) forward(ref);else if (is.obj(forward)) {\n forward.current = ref;\n }\n }\n\n return ref;\n}\n\nclass Animated {\n constructor() {\n this.payload = void 0;\n this.children = [];\n }\n\n getAnimatedValue() {\n return this.getValue();\n }\n\n getPayload() {\n return this.payload || this;\n }\n\n attach() {}\n\n detach() {}\n\n getChildren() {\n return this.children;\n }\n\n addChild(child) {\n if (this.children.length === 0) this.attach();\n this.children.push(child);\n }\n\n removeChild(child) {\n const index = this.children.indexOf(child);\n this.children.splice(index, 1);\n if (this.children.length === 0) this.detach();\n }\n\n}\nclass AnimatedArray extends Animated {\n constructor() {\n super(...arguments);\n this.payload = [];\n\n this.attach = () => this.payload.forEach(p => p instanceof Animated && p.addChild(this));\n\n this.detach = () => this.payload.forEach(p => p instanceof Animated && p.removeChild(this));\n }\n\n}\nclass AnimatedObject extends Animated {\n constructor() {\n super(...arguments);\n this.payload = {};\n\n this.attach = () => Object.values(this.payload).forEach(s => s instanceof Animated && s.addChild(this));\n\n this.detach = () => Object.values(this.payload).forEach(s => s instanceof Animated && s.removeChild(this));\n }\n\n getValue(animated) {\n if (animated === void 0) {\n animated = false;\n }\n\n const payload = {};\n\n for (const key in this.payload) {\n const value = this.payload[key];\n if (animated && !(value instanceof Animated)) continue;\n payload[key] = value instanceof Animated ? value[animated ? 'getAnimatedValue' : 'getValue']() : value;\n }\n\n return payload;\n }\n\n getAnimatedValue() {\n return this.getValue(true);\n }\n\n}\n\nlet applyAnimatedValues;\nfunction injectApplyAnimatedValues(fn, transform) {\n applyAnimatedValues = {\n fn,\n transform\n };\n}\nlet colorNames;\nfunction injectColorNames(names) {\n colorNames = names;\n}\nlet requestFrame = cb => typeof window !== 'undefined' ? window.requestAnimationFrame(cb) : -1;\nlet cancelFrame = id => {\n typeof window !== 'undefined' && window.cancelAnimationFrame(id);\n};\nfunction injectFrame(raf, caf) {\n requestFrame = raf;\n cancelFrame = caf;\n}\nlet interpolation;\nfunction injectStringInterpolator(fn) {\n interpolation = fn;\n}\nlet now = () => Date.now();\nfunction injectNow(nowFn) {\n now = nowFn;\n}\nlet defaultElement;\nfunction injectDefaultElement(el) {\n defaultElement = el;\n}\nlet animatedApi = node => node.current;\nfunction injectAnimatedApi(fn) {\n animatedApi = fn;\n}\nlet createAnimatedStyle;\nfunction injectCreateAnimatedStyle(factory) {\n createAnimatedStyle = factory;\n}\nlet manualFrameloop;\nfunction injectManualFrameloop(callback) {\n manualFrameloop = callback;\n}\n\nvar Globals = /*#__PURE__*/Object.freeze({\n get applyAnimatedValues () { return applyAnimatedValues; },\n injectApplyAnimatedValues: injectApplyAnimatedValues,\n get colorNames () { return colorNames; },\n injectColorNames: injectColorNames,\n get requestFrame () { return requestFrame; },\n get cancelFrame () { return cancelFrame; },\n injectFrame: injectFrame,\n get interpolation () { return interpolation; },\n injectStringInterpolator: injectStringInterpolator,\n get now () { return now; },\n injectNow: injectNow,\n get defaultElement () { return defaultElement; },\n injectDefaultElement: injectDefaultElement,\n get animatedApi () { return animatedApi; },\n injectAnimatedApi: injectAnimatedApi,\n get createAnimatedStyle () { return createAnimatedStyle; },\n injectCreateAnimatedStyle: injectCreateAnimatedStyle,\n get manualFrameloop () { return manualFrameloop; },\n injectManualFrameloop: injectManualFrameloop\n});\n\n/**\n * Wraps the `style` property with `AnimatedStyle`.\n */\n\nclass AnimatedProps extends AnimatedObject {\n constructor(props, callback) {\n super();\n this.update = void 0;\n this.payload = !props.style ? props : _extends({}, props, {\n style: createAnimatedStyle(props.style)\n });\n this.update = callback;\n this.attach();\n }\n\n}\n\nconst isFunctionComponent = val => is.fun(val) && !(val.prototype instanceof React.Component);\n\nconst createAnimatedComponent = Component => {\n const AnimatedComponent = forwardRef((props, ref) => {\n const forceUpdate = useForceUpdate();\n const mounted = useRef(true);\n const propsAnimated = useRef(null);\n const node = useRef(null);\n const attachProps = useCallback(props => {\n const oldPropsAnimated = propsAnimated.current;\n\n const callback = () => {\n let didUpdate = false;\n\n if (node.current) {\n didUpdate = applyAnimatedValues.fn(node.current, propsAnimated.current.getAnimatedValue());\n }\n\n if (!node.current || didUpdate === false) {\n // If no referenced node has been found, or the update target didn't have a\n // native-responder, then forceUpdate the animation ...\n forceUpdate();\n }\n };\n\n propsAnimated.current = new AnimatedProps(props, callback);\n oldPropsAnimated && oldPropsAnimated.detach();\n }, []);\n useEffect(() => () => {\n mounted.current = false;\n propsAnimated.current && propsAnimated.current.detach();\n }, []);\n useImperativeHandle(ref, () => animatedApi(node, mounted, forceUpdate));\n attachProps(props);\n\n const _getValue = propsAnimated.current.getValue(),\n scrollTop = _getValue.scrollTop,\n scrollLeft = _getValue.scrollLeft,\n animatedProps = _objectWithoutPropertiesLoose(_getValue, [\"scrollTop\", \"scrollLeft\"]); // Functions cannot have refs, see:\n // See: https://github.com/react-spring/react-spring/issues/569\n\n\n const refFn = isFunctionComponent(Component) ? undefined : childRef => node.current = handleRef(childRef, ref);\n return React.createElement(Component, _extends({}, animatedProps, {\n ref: refFn\n }));\n });\n return AnimatedComponent;\n};\n\nlet active = false;\nconst controllers = new Set();\n\nconst update = () => {\n if (!active) return false;\n let time = now();\n\n for (let controller of controllers) {\n let isActive = false;\n\n for (let configIdx = 0; configIdx < controller.configs.length; configIdx++) {\n let config = controller.configs[configIdx];\n let endOfAnimation, lastTime;\n\n for (let valIdx = 0; valIdx < config.animatedValues.length; valIdx++) {\n let animation = config.animatedValues[valIdx]; // If an animation is done, skip, until all of them conclude\n\n if (animation.done) continue;\n let from = config.fromValues[valIdx];\n let to = config.toValues[valIdx];\n let position = animation.lastPosition;\n let isAnimated = to instanceof Animated;\n let velocity = Array.isArray(config.initialVelocity) ? config.initialVelocity[valIdx] : config.initialVelocity;\n if (isAnimated) to = to.getValue(); // Conclude animation if it's either immediate, or from-values match end-state\n\n if (config.immediate) {\n animation.setValue(to);\n animation.done = true;\n continue;\n } // Break animation when string values are involved\n\n\n if (typeof from === 'string' || typeof to === 'string') {\n animation.setValue(to);\n animation.done = true;\n continue;\n }\n\n if (config.duration !== void 0) {\n /** Duration easing */\n position = from + config.easing((time - animation.startTime) / config.duration) * (to - from);\n endOfAnimation = time >= animation.startTime + config.duration;\n } else if (config.decay) {\n /** Decay easing */\n position = from + velocity / (1 - 0.998) * (1 - Math.exp(-(1 - 0.998) * (time - animation.startTime)));\n endOfAnimation = Math.abs(animation.lastPosition - position) < 0.1;\n if (endOfAnimation) to = position;\n } else {\n /** Spring easing */\n lastTime = animation.lastTime !== void 0 ? animation.lastTime : time;\n velocity = animation.lastVelocity !== void 0 ? animation.lastVelocity : config.initialVelocity; // If we lost a lot of frames just jump to the end.\n\n if (time > lastTime + 64) lastTime = time; // http://gafferongames.com/game-physics/fix-your-timestep/\n\n let numSteps = Math.floor(time - lastTime);\n\n for (let i = 0; i < numSteps; ++i) {\n let force = -config.tension * (position - to);\n let damping = -config.friction * velocity;\n let acceleration = (force + damping) / config.mass;\n velocity = velocity + acceleration * 1 / 1000;\n position = position + velocity * 1 / 1000;\n } // Conditions for stopping the spring animation\n\n\n let isOvershooting = config.clamp && config.tension !== 0 ? from < to ? position > to : position < to : false;\n let isVelocity = Math.abs(velocity) <= config.precision;\n let isDisplacement = config.tension !== 0 ? Math.abs(to - position) <= config.precision : true;\n endOfAnimation = isOvershooting || isVelocity && isDisplacement;\n animation.lastVelocity = velocity;\n animation.lastTime = time;\n } // Trails aren't done until their parents conclude\n\n\n if (isAnimated && !config.toValues[valIdx].done) endOfAnimation = false;\n\n if (endOfAnimation) {\n // Ensure that we end up with a round value\n if (animation.value !== to) position = to;\n animation.done = true;\n } else isActive = true;\n\n animation.setValue(position);\n animation.lastPosition = position;\n } // Keep track of updated values only when necessary\n\n\n if (controller.props.onFrame) controller.values[config.name] = config.interpolation.getValue();\n } // Update callbacks in the end of the frame\n\n\n if (controller.props.onFrame) controller.props.onFrame(controller.values); // Either call onEnd or next frame\n\n if (!isActive) {\n controllers.delete(controller);\n controller.stop(true);\n }\n } // Loop over as long as there are controllers ...\n\n\n if (controllers.size) {\n if (manualFrameloop) manualFrameloop();else requestFrame(update);\n } else {\n active = false;\n }\n\n return active;\n};\n\nconst start = controller => {\n if (!controllers.has(controller)) controllers.add(controller);\n\n if (!active) {\n active = true;\n if (manualFrameloop) requestFrame(manualFrameloop);else requestFrame(update);\n }\n};\n\nconst stop = controller => {\n if (controllers.has(controller)) controllers.delete(controller);\n};\n\nfunction createInterpolator(range, output, extrapolate) {\n if (typeof range === 'function') {\n return range;\n }\n\n if (Array.isArray(range)) {\n return createInterpolator({\n range,\n output: output,\n extrapolate\n });\n }\n\n if (interpolation && typeof range.output[0] === 'string') {\n return interpolation(range);\n }\n\n const config = range;\n const outputRange = config.output;\n const inputRange = config.range || [0, 1];\n const extrapolateLeft = config.extrapolateLeft || config.extrapolate || 'extend';\n const extrapolateRight = config.extrapolateRight || config.extrapolate || 'extend';\n\n const easing = config.easing || (t => t);\n\n return input => {\n const range = findRange(input, inputRange);\n return interpolate(input, inputRange[range], inputRange[range + 1], outputRange[range], outputRange[range + 1], easing, extrapolateLeft, extrapolateRight, config.map);\n };\n}\n\nfunction interpolate(input, inputMin, inputMax, outputMin, outputMax, easing, extrapolateLeft, extrapolateRight, map) {\n let result = map ? map(input) : input; // Extrapolate\n\n if (result < inputMin) {\n if (extrapolateLeft === 'identity') return result;else if (extrapolateLeft === 'clamp') result = inputMin;\n }\n\n if (result > inputMax) {\n if (extrapolateRight === 'identity') return result;else if (extrapolateRight === 'clamp') result = inputMax;\n }\n\n if (outputMin === outputMax) return outputMin;\n if (inputMin === inputMax) return input <= inputMin ? outputMin : outputMax; // Input Range\n\n if (inputMin === -Infinity) result = -result;else if (inputMax === Infinity) result = result - inputMin;else result = (result - inputMin) / (inputMax - inputMin); // Easing\n\n result = easing(result); // Output Range\n\n if (outputMin === -Infinity) result = -result;else if (outputMax === Infinity) result = result + outputMin;else result = result * (outputMax - outputMin) + outputMin;\n return result;\n}\n\nfunction findRange(input, inputRange) {\n for (var i = 1; i < inputRange.length - 1; ++i) if (inputRange[i] >= input) break;\n\n return i - 1;\n}\n\nclass AnimatedInterpolation extends AnimatedArray {\n constructor(parents, range, output, extrapolate) {\n super();\n this.calc = void 0;\n this.payload = parents instanceof AnimatedArray && !(parents instanceof AnimatedInterpolation) ? parents.getPayload() : Array.isArray(parents) ? parents : [parents];\n this.calc = createInterpolator(range, output, extrapolate);\n }\n\n getValue() {\n return this.calc(...this.payload.map(value => value.getValue()));\n }\n\n updateConfig(range, output, extrapolate) {\n this.calc = createInterpolator(range, output, extrapolate);\n }\n\n interpolate(range, output, extrapolate) {\n return new AnimatedInterpolation(this, range, output, extrapolate);\n }\n\n}\n\nconst interpolate$1 = (parents, range, output) => parents && new AnimatedInterpolation(parents, range, output);\n\nconst config = {\n default: {\n tension: 170,\n friction: 26\n },\n gentle: {\n tension: 120,\n friction: 14\n },\n wobbly: {\n tension: 180,\n friction: 12\n },\n stiff: {\n tension: 210,\n friction: 20\n },\n slow: {\n tension: 280,\n friction: 60\n },\n molasses: {\n tension: 280,\n friction: 120\n }\n};\n\n/** API\n * useChain(references, timeSteps, timeFrame)\n */\n\nfunction useChain(refs, timeSteps, timeFrame) {\n if (timeFrame === void 0) {\n timeFrame = 1000;\n }\n\n const previous = useRef();\n useEffect(() => {\n if (is.equ(refs, previous.current)) refs.forEach((_ref) => {\n let current = _ref.current;\n return current && current.start();\n });else if (timeSteps) {\n refs.forEach((_ref2, index) => {\n let current = _ref2.current;\n\n if (current) {\n const ctrls = current.controllers;\n\n if (ctrls.length) {\n const t = timeFrame * timeSteps[index];\n ctrls.forEach(ctrl => {\n ctrl.queue = ctrl.queue.map(e => _extends({}, e, {\n delay: e.delay + t\n }));\n ctrl.start();\n });\n }\n }\n });\n } else refs.reduce((q, _ref3, rI) => {\n let current = _ref3.current;\n return q = q.then(() => current.start());\n }, Promise.resolve());\n previous.current = refs;\n });\n}\n\n/**\n * Animated works by building a directed acyclic graph of dependencies\n * transparently when you render your Animated components.\n *\n * new Animated.Value(0)\n * .interpolate() .interpolate() new Animated.Value(1)\n * opacity translateY scale\n * style transform\n * View#234 style\n * View#123\n *\n * A) Top Down phase\n * When an AnimatedValue is updated, we recursively go down through this\n * graph in order to find leaf nodes: the views that we flag as needing\n * an update.\n *\n * B) Bottom Up phase\n * When a view is flagged as needing an update, we recursively go back up\n * in order to build the new value that it needs. The reason why we need\n * this two-phases process is to deal with composite props such as\n * transform which can receive values from multiple parents.\n */\nfunction addAnimatedStyles(node, styles) {\n if ('update' in node) {\n styles.add(node);\n } else {\n node.getChildren().forEach(child => addAnimatedStyles(child, styles));\n }\n}\n\nclass AnimatedValue extends Animated {\n constructor(_value) {\n var _this;\n\n super();\n _this = this;\n this.animatedStyles = new Set();\n this.value = void 0;\n this.startPosition = void 0;\n this.lastPosition = void 0;\n this.lastVelocity = void 0;\n this.startTime = void 0;\n this.lastTime = void 0;\n this.done = false;\n\n this.setValue = function (value, flush) {\n if (flush === void 0) {\n flush = true;\n }\n\n _this.value = value;\n if (flush) _this.flush();\n };\n\n this.value = _value;\n this.startPosition = _value;\n this.lastPosition = _value;\n }\n\n flush() {\n if (this.animatedStyles.size === 0) {\n addAnimatedStyles(this, this.animatedStyles);\n }\n\n this.animatedStyles.forEach(animatedStyle => animatedStyle.update());\n }\n\n clearStyles() {\n this.animatedStyles.clear();\n }\n\n getValue() {\n return this.value;\n }\n\n interpolate(range, output, extrapolate) {\n return new AnimatedInterpolation(this, range, output, extrapolate);\n }\n\n}\n\nclass AnimatedValueArray extends AnimatedArray {\n constructor(values) {\n super();\n this.payload = values.map(n => new AnimatedValue(n));\n }\n\n setValue(value, flush) {\n if (flush === void 0) {\n flush = true;\n }\n\n if (Array.isArray(value)) {\n if (value.length === this.payload.length) {\n value.forEach((v, i) => this.payload[i].setValue(v, flush));\n }\n } else {\n this.payload.forEach(p => p.setValue(value, flush));\n }\n }\n\n getValue() {\n return this.payload.map(v => v.getValue());\n }\n\n interpolate(range, output) {\n return new AnimatedInterpolation(this, range, output);\n }\n\n}\n\nlet G = 0;\n\nclass Controller {\n constructor() {\n this.id = void 0;\n this.idle = true;\n this.hasChanged = false;\n this.guid = 0;\n this.local = 0;\n this.props = {};\n this.merged = {};\n this.animations = {};\n this.interpolations = {};\n this.values = {};\n this.configs = [];\n this.listeners = [];\n this.queue = [];\n this.localQueue = void 0;\n\n this.getValues = () => this.interpolations;\n\n this.id = G++;\n }\n /** update(props)\n * This function filters input props and creates an array of tasks which are executed in .start()\n * Each task is allowed to carry a delay, which means it can execute asnychroneously */\n\n\n update(args) {\n //this._id = n + this.id\n if (!args) return this; // Extract delay and the to-prop from props\n\n const _ref = interpolateTo(args),\n _ref$delay = _ref.delay,\n delay = _ref$delay === void 0 ? 0 : _ref$delay,\n to = _ref.to,\n props = _objectWithoutPropertiesLoose(_ref, [\"delay\", \"to\"]);\n\n if (is.arr(to) || is.fun(to)) {\n // If config is either a function or an array queue it up as is\n this.queue.push(_extends({}, props, {\n delay,\n to\n }));\n } else if (to) {\n // Otherwise go through each key since it could be delayed individually\n let ops = {};\n Object.entries(to).forEach((_ref2) => {\n let k = _ref2[0],\n v = _ref2[1];\n\n // Fetch delay and create an entry, consisting of the to-props, the delay, and basic props\n const entry = _extends({\n to: {\n [k]: v\n },\n delay: callProp(delay, k)\n }, props);\n\n const previous = ops[entry.delay] && ops[entry.delay].to;\n ops[entry.delay] = _extends({}, ops[entry.delay], entry, {\n to: _extends({}, previous, entry.to)\n });\n });\n this.queue = Object.values(ops);\n } // Sort queue, so that async calls go last\n\n\n this.queue = this.queue.sort((a, b) => a.delay - b.delay); // Diff the reduced props immediately (they'll contain the from-prop and some config)\n\n this.diff(props);\n return this;\n }\n /** start(onEnd)\n * This function either executes a queue, if present, or starts the frameloop, which animates */\n\n\n start(onEnd) {\n // If a queue is present we must excecute it\n if (this.queue.length) {\n this.idle = false; // Updates can interrupt trailing queues, in that case we just merge values\n\n if (this.localQueue) {\n this.localQueue.forEach((_ref3) => {\n let _ref3$from = _ref3.from,\n from = _ref3$from === void 0 ? {} : _ref3$from,\n _ref3$to = _ref3.to,\n to = _ref3$to === void 0 ? {} : _ref3$to;\n if (is.obj(from)) this.merged = _extends({}, from, this.merged);\n if (is.obj(to)) this.merged = _extends({}, this.merged, to);\n });\n } // The guid helps us tracking frames, a new queue over an old one means an override\n // We discard async calls in that caseÍ\n\n\n const local = this.local = ++this.guid;\n const queue = this.localQueue = this.queue;\n this.queue = []; // Go through each entry and execute it\n\n queue.forEach((_ref4, index) => {\n let delay = _ref4.delay,\n props = _objectWithoutPropertiesLoose(_ref4, [\"delay\"]);\n\n const cb = finished => {\n if (index === queue.length - 1 && local === this.guid && finished) {\n this.idle = true;\n if (this.props.onRest) this.props.onRest(this.merged);\n }\n\n if (onEnd) onEnd();\n }; // Entries can be delayed, ansyc or immediate\n\n\n let async = is.arr(props.to) || is.fun(props.to);\n\n if (delay) {\n setTimeout(() => {\n if (local === this.guid) {\n if (async) this.runAsync(props, cb);else this.diff(props).start(cb);\n }\n }, delay);\n } else if (async) this.runAsync(props, cb);else this.diff(props).start(cb);\n });\n } // Otherwise we kick of the frameloop\n else {\n if (is.fun(onEnd)) this.listeners.push(onEnd);\n if (this.props.onStart) this.props.onStart();\n start(this);\n }\n\n return this;\n }\n\n stop(finished) {\n this.listeners.forEach(onEnd => onEnd(finished));\n this.listeners = [];\n return this;\n }\n /** Pause sets onEnd listeners free, but also removes the controller from the frameloop */\n\n\n pause(finished) {\n this.stop(true);\n if (finished) stop(this);\n return this;\n }\n\n runAsync(_ref5, onEnd) {\n var _this = this;\n\n let delay = _ref5.delay,\n props = _objectWithoutPropertiesLoose(_ref5, [\"delay\"]);\n\n const local = this.local; // If \"to\" is either a function or an array it will be processed async, therefor \"to\" should be empty right now\n // If the view relies on certain values \"from\" has to be present\n\n let queue = Promise.resolve(undefined);\n\n if (is.arr(props.to)) {\n for (let i = 0; i < props.to.length; i++) {\n const index = i;\n\n const fresh = _extends({}, props, interpolateTo(props.to[index]));\n\n if (is.arr(fresh.config)) fresh.config = fresh.config[index];\n queue = queue.then(() => {\n //this.stop()\n if (local === this.guid) return new Promise(r => this.diff(fresh).start(r));\n });\n }\n } else if (is.fun(props.to)) {\n let index = 0;\n let last;\n queue = queue.then(() => props.to( // next(props)\n p => {\n const fresh = _extends({}, props, interpolateTo(p));\n\n if (is.arr(fresh.config)) fresh.config = fresh.config[index];\n index++; //this.stop()\n\n if (local === this.guid) return last = new Promise(r => this.diff(fresh).start(r));\n return;\n }, // cancel()\n function (finished) {\n if (finished === void 0) {\n finished = true;\n }\n\n return _this.stop(finished);\n }).then(() => last));\n }\n\n queue.then(onEnd);\n }\n\n diff(props) {\n this.props = _extends({}, this.props, props);\n let _this$props = this.props,\n _this$props$from = _this$props.from,\n from = _this$props$from === void 0 ? {} : _this$props$from,\n _this$props$to = _this$props.to,\n to = _this$props$to === void 0 ? {} : _this$props$to,\n _this$props$config = _this$props.config,\n config = _this$props$config === void 0 ? {} : _this$props$config,\n reverse = _this$props.reverse,\n attach = _this$props.attach,\n reset = _this$props.reset,\n immediate = _this$props.immediate; // Reverse values when requested\n\n if (reverse) {\n var _ref6 = [to, from];\n from = _ref6[0];\n to = _ref6[1];\n } // This will collect all props that were ever set, reset merged props when necessary\n\n\n this.merged = _extends({}, from, this.merged, to);\n this.hasChanged = false; // Attachment handling, trailed springs can \"attach\" themselves to a previous spring\n\n let target = attach && attach(this); // Reduces input { name: value } pairs into animated values\n\n this.animations = Object.entries(this.merged).reduce((acc, _ref7) => {\n let name = _ref7[0],\n value = _ref7[1];\n // Issue cached entries, except on reset\n let entry = acc[name] || {}; // Figure out what the value is supposed to be\n\n const isNumber = is.num(value);\n const isString = is.str(value) && !value.startsWith('#') && !/\\d/.test(value) && !colorNames[value];\n const isArray = is.arr(value);\n const isInterpolation = !isNumber && !isArray && !isString;\n let fromValue = !is.und(from[name]) ? from[name] : value;\n let toValue = isNumber || isArray ? value : isString ? value : 1;\n let toConfig = callProp(config, name);\n if (target) toValue = target.animations[name].parent;\n let parent = entry.parent,\n interpolation$$1 = entry.interpolation,\n toValues = toArray(target ? toValue.getPayload() : toValue),\n animatedValues;\n let newValue = value;\n if (isInterpolation) newValue = interpolation({\n range: [0, 1],\n output: [value, value]\n })(1);\n let currentValue = interpolation$$1 && interpolation$$1.getValue(); // Change detection flags\n\n const isFirst = is.und(parent);\n const isActive = !isFirst && entry.animatedValues.some(v => !v.done);\n const currentValueDiffersFromGoal = !is.equ(newValue, currentValue);\n const hasNewGoal = !is.equ(newValue, entry.previous);\n const hasNewConfig = !is.equ(toConfig, entry.config); // Change animation props when props indicate a new goal (new value differs from previous one)\n // and current values differ from it. Config changes trigger a new update as well (though probably shouldn't?)\n\n if (reset || hasNewGoal && currentValueDiffersFromGoal || hasNewConfig) {\n // Convert regular values into animated values, ALWAYS re-use if possible\n if (isNumber || isString) parent = interpolation$$1 = entry.parent || new AnimatedValue(fromValue);else if (isArray) parent = interpolation$$1 = entry.parent || new AnimatedValueArray(fromValue);else if (isInterpolation) {\n let prev = entry.interpolation && entry.interpolation.calc(entry.parent.value);\n prev = prev !== void 0 && !reset ? prev : fromValue;\n\n if (entry.parent) {\n parent = entry.parent;\n parent.setValue(0, false);\n } else parent = new AnimatedValue(0);\n\n const range = {\n output: [prev, value]\n };\n\n if (entry.interpolation) {\n interpolation$$1 = entry.interpolation;\n entry.interpolation.updateConfig(range);\n } else interpolation$$1 = parent.interpolate(range);\n }\n toValues = toArray(target ? toValue.getPayload() : toValue);\n animatedValues = toArray(parent.getPayload());\n if (reset && !isInterpolation) parent.setValue(fromValue, false);\n this.hasChanged = true; // Reset animated values\n\n animatedValues.forEach(value => {\n value.startPosition = value.value;\n value.lastPosition = value.value;\n value.lastVelocity = isActive ? value.lastVelocity : undefined;\n value.lastTime = isActive ? value.lastTime : undefined;\n value.startTime = now();\n value.done = false;\n value.animatedStyles.clear();\n }); // Set immediate values\n\n if (callProp(immediate, name)) {\n parent.setValue(isInterpolation ? toValue : value, false);\n }\n\n return _extends({}, acc, {\n [name]: _extends({}, entry, {\n name,\n parent,\n interpolation: interpolation$$1,\n animatedValues,\n toValues,\n previous: newValue,\n config: toConfig,\n fromValues: toArray(parent.getValue()),\n immediate: callProp(immediate, name),\n initialVelocity: withDefault(toConfig.velocity, 0),\n clamp: withDefault(toConfig.clamp, false),\n precision: withDefault(toConfig.precision, 0.01),\n tension: withDefault(toConfig.tension, 170),\n friction: withDefault(toConfig.friction, 26),\n mass: withDefault(toConfig.mass, 1),\n duration: toConfig.duration,\n easing: withDefault(toConfig.easing, t => t),\n decay: toConfig.decay\n })\n });\n } else {\n if (!currentValueDiffersFromGoal) {\n // So ... the current target value (newValue) appears to be different from the previous value,\n // which normally constitutes an update, but the actual value (currentValue) matches the target!\n // In order to resolve this without causing an animation update we silently flag the animation as done,\n // which it technically is. Interpolations also needs a config update with their target set to 1.\n if (isInterpolation) {\n parent.setValue(1, false);\n interpolation$$1.updateConfig({\n output: [newValue, newValue]\n });\n }\n\n parent.done = true;\n this.hasChanged = true;\n return _extends({}, acc, {\n [name]: _extends({}, acc[name], {\n previous: newValue\n })\n });\n }\n\n return acc;\n }\n }, this.animations);\n\n if (this.hasChanged) {\n // Make animations available to frameloop\n this.configs = Object.values(this.animations);\n this.values = {};\n this.interpolations = {};\n\n for (let key in this.animations) {\n this.interpolations[key] = this.animations[key].interpolation;\n this.values[key] = this.animations[key].interpolation.getValue();\n }\n }\n\n return this;\n }\n\n destroy() {\n this.stop();\n this.props = {};\n this.merged = {};\n this.animations = {};\n this.interpolations = {};\n this.values = {};\n this.configs = [];\n this.local = 0;\n }\n\n}\n\n/** API\n * const props = useSprings(number, [{ ... }, { ... }, ...])\n * const [props, set] = useSprings(number, (i, controller) => ({ ... }))\n */\n\nconst useSprings = (length, props) => {\n const mounted = useRef(false);\n const ctrl = useRef();\n const isFn = is.fun(props); // The controller maintains the animation values, starts and stops animations\n\n const _useMemo = useMemo(() => {\n // Remove old controllers\n if (ctrl.current) {\n ctrl.current.map(c => c.destroy());\n ctrl.current = undefined;\n }\n\n let ref;\n return [new Array(length).fill().map((_, i) => {\n const ctrl = new Controller();\n const newProps = isFn ? callProp(props, i, ctrl) : props[i];\n if (i === 0) ref = newProps.ref;\n ctrl.update(newProps);\n if (!ref) ctrl.start();\n return ctrl;\n }), ref];\n }, [length]),\n controllers = _useMemo[0],\n ref = _useMemo[1];\n\n ctrl.current = controllers; // The hooks reference api gets defined here ...\n\n const api = useImperativeHandle(ref, () => ({\n start: () => Promise.all(ctrl.current.map(c => new Promise(r => c.start(r)))),\n stop: finished => ctrl.current.forEach(c => c.stop(finished)),\n\n get controllers() {\n return ctrl.current;\n }\n\n })); // This function updates the controllers\n\n const updateCtrl = useMemo(() => updateProps => ctrl.current.map((c, i) => {\n c.update(isFn ? callProp(updateProps, i, c) : updateProps[i]);\n if (!ref) c.start();\n }), [length]); // Update controller if props aren't functional\n\n useEffect(() => {\n if (mounted.current) {\n if (!isFn) updateCtrl(props);\n } else if (!ref) ctrl.current.forEach(c => c.start());\n }); // Update mounted flag and destroy controller on unmount\n\n useEffect(() => (mounted.current = true, () => ctrl.current.forEach(c => c.destroy())), []); // Return animated props, or, anim-props + the update-setter above\n\n const propValues = ctrl.current.map(c => c.getValues());\n return isFn ? [propValues, updateCtrl, finished => ctrl.current.forEach(c => c.pause(finished))] : propValues;\n};\n\n/** API\n * const props = useSpring({ ... })\n * const [props, set] = useSpring(() => ({ ... }))\n */\n\nconst useSpring = props => {\n const isFn = is.fun(props);\n\n const _useSprings = useSprings(1, isFn ? props : [props]),\n result = _useSprings[0],\n set = _useSprings[1],\n pause = _useSprings[2];\n\n return isFn ? [result[0], set, pause] : result;\n};\n\n/** API\n * const trails = useTrail(number, { ... })\n * const [trails, set] = useTrail(number, () => ({ ... }))\n */\n\nconst useTrail = (length, props) => {\n const mounted = useRef(false);\n const isFn = is.fun(props);\n const updateProps = callProp(props);\n const instances = useRef();\n\n const _useSprings = useSprings(length, (i, ctrl) => {\n if (i === 0) instances.current = [];\n instances.current.push(ctrl);\n return _extends({}, updateProps, {\n config: callProp(updateProps.config, i),\n attach: i > 0 && (() => instances.current[i - 1])\n });\n }),\n result = _useSprings[0],\n set = _useSprings[1],\n pause = _useSprings[2]; // Set up function to update controller\n\n\n const updateCtrl = useMemo(() => props => set((i, ctrl) => {\n const last = props.reverse ? i === 0 : length - 1 === i;\n const attachIdx = props.reverse ? i + 1 : i - 1;\n const attachController = instances.current[attachIdx];\n return _extends({}, props, {\n config: callProp(props.config || updateProps.config, i),\n attach: attachController && (() => attachController)\n });\n }), [length, updateProps.reverse]); // Update controller if props aren't functional\n\n useEffect(() => void (mounted.current && !isFn && updateCtrl(props))); // Update mounted flag and destroy controller on unmount\n\n useEffect(() => void (mounted.current = true), []);\n return isFn ? [result, updateCtrl, pause] : result;\n};\n\n/** API\n * const transitions = useTransition(items, itemKeys, { ... })\n * const [transitions, update] = useTransition(items, itemKeys, () => ({ ... }))\n */\n\nlet guid = 0;\nconst ENTER = 'enter';\nconst LEAVE = 'leave';\nconst UPDATE = 'update';\n\nconst mapKeys = (items, keys) => (typeof keys === 'function' ? items.map(keys) : toArray(keys)).map(String);\n\nconst get = props => {\n let items = props.items,\n _props$keys = props.keys,\n keys = _props$keys === void 0 ? item => item : _props$keys,\n rest = _objectWithoutPropertiesLoose(props, [\"items\", \"keys\"]);\n\n items = toArray(items !== void 0 ? items : null);\n return _extends({\n items,\n keys: mapKeys(items, keys)\n }, rest);\n};\n\nfunction useTransition(input, keyTransform, config) {\n const props = _extends({\n items: input,\n keys: keyTransform || (i => i)\n }, config);\n\n const _get = get(props),\n _get$lazy = _get.lazy,\n lazy = _get$lazy === void 0 ? false : _get$lazy,\n _get$unique = _get.unique,\n _get$reset = _get.reset,\n reset = _get$reset === void 0 ? false : _get$reset,\n enter = _get.enter,\n leave = _get.leave,\n update = _get.update,\n onDestroyed = _get.onDestroyed,\n keys = _get.keys,\n items = _get.items,\n onFrame = _get.onFrame,\n _onRest = _get.onRest,\n onStart = _get.onStart,\n ref = _get.ref,\n extra = _objectWithoutPropertiesLoose(_get, [\"lazy\", \"unique\", \"reset\", \"enter\", \"leave\", \"update\", \"onDestroyed\", \"keys\", \"items\", \"onFrame\", \"onRest\", \"onStart\", \"ref\"]);\n\n const forceUpdate = useForceUpdate();\n const mounted = useRef(false);\n const state = useRef({\n mounted: false,\n first: true,\n deleted: [],\n current: {},\n transitions: [],\n prevProps: {},\n paused: !!props.ref,\n instances: !mounted.current && new Map(),\n forceUpdate\n });\n useImperativeHandle(props.ref, () => ({\n start: () => Promise.all(Array.from(state.current.instances).map((_ref) => {\n let c = _ref[1];\n return new Promise(r => c.start(r));\n })),\n stop: finished => Array.from(state.current.instances).forEach((_ref2) => {\n let c = _ref2[1];\n return c.stop(finished);\n }),\n\n get controllers() {\n return Array.from(state.current.instances).map((_ref3) => {\n let c = _ref3[1];\n return c;\n });\n }\n\n })); // Update state\n\n state.current = diffItems(state.current, props);\n\n if (state.current.changed) {\n // Update state\n state.current.transitions.forEach(transition => {\n const slot = transition.slot,\n from = transition.from,\n to = transition.to,\n config = transition.config,\n trail = transition.trail,\n key = transition.key,\n item = transition.item;\n if (!state.current.instances.has(key)) state.current.instances.set(key, new Controller()); // update the map object\n\n const ctrl = state.current.instances.get(key);\n\n const newProps = _extends({}, extra, {\n to,\n from,\n config,\n ref,\n onRest: values => {\n if (state.current.mounted) {\n if (transition.destroyed) {\n // If no ref is given delete destroyed items immediately\n if (!ref && !lazy) cleanUp(state, key);\n if (onDestroyed) onDestroyed(item);\n } // A transition comes to rest once all its springs conclude\n\n\n const curInstances = Array.from(state.current.instances);\n const active = curInstances.some((_ref4) => {\n let c = _ref4[1];\n return !c.idle;\n });\n if (!active && (ref || lazy) && state.current.deleted.length > 0) cleanUp(state);\n if (_onRest) _onRest(item, slot, values);\n }\n },\n onStart: onStart && (() => onStart(item, slot)),\n onFrame: onFrame && (values => onFrame(item, slot, values)),\n delay: trail,\n reset: reset && slot === ENTER // Update controller\n\n });\n\n ctrl.update(newProps);\n if (!state.current.paused) ctrl.start();\n });\n }\n\n useEffect(() => {\n state.current.mounted = mounted.current = true;\n return () => {\n state.current.mounted = mounted.current = false;\n Array.from(state.current.instances).map((_ref5) => {\n let c = _ref5[1];\n return c.destroy();\n });\n state.current.instances.clear();\n };\n }, []);\n return state.current.transitions.map((_ref6) => {\n let item = _ref6.item,\n slot = _ref6.slot,\n key = _ref6.key;\n return {\n item,\n key,\n state: slot,\n props: state.current.instances.get(key).getValues()\n };\n });\n}\n\nfunction cleanUp(state, filterKey) {\n const deleted = state.current.deleted;\n\n for (let _ref7 of deleted) {\n let key = _ref7.key;\n\n const filter = t => t.key !== key;\n\n if (is.und(filterKey) || filterKey === key) {\n state.current.instances.delete(key);\n state.current.transitions = state.current.transitions.filter(filter);\n state.current.deleted = state.current.deleted.filter(filter);\n }\n }\n\n state.current.forceUpdate();\n}\n\nfunction diffItems(_ref8, props) {\n let first = _ref8.first,\n prevProps = _ref8.prevProps,\n state = _objectWithoutPropertiesLoose(_ref8, [\"first\", \"prevProps\"]);\n\n let _get2 = get(props),\n items = _get2.items,\n keys = _get2.keys,\n initial = _get2.initial,\n from = _get2.from,\n enter = _get2.enter,\n leave = _get2.leave,\n update = _get2.update,\n _get2$trail = _get2.trail,\n trail = _get2$trail === void 0 ? 0 : _get2$trail,\n unique = _get2.unique,\n config = _get2.config,\n _get2$order = _get2.order,\n order = _get2$order === void 0 ? [ENTER, LEAVE, UPDATE] : _get2$order;\n\n let _get3 = get(prevProps),\n _keys = _get3.keys,\n _items = _get3.items;\n\n let current = _extends({}, state.current);\n\n let deleted = [...state.deleted]; // Compare next keys with current keys\n\n let currentKeys = Object.keys(current);\n let currentSet = new Set(currentKeys);\n let nextSet = new Set(keys);\n let added = keys.filter(item => !currentSet.has(item));\n let removed = state.transitions.filter(item => !item.destroyed && !nextSet.has(item.originalKey)).map(i => i.originalKey);\n let updated = keys.filter(item => currentSet.has(item));\n let delay = -trail;\n\n while (order.length) {\n const changeType = order.shift();\n\n switch (changeType) {\n case ENTER:\n {\n added.forEach((key, index) => {\n // In unique mode, remove fading out transitions if their key comes in again\n if (unique && deleted.find(d => d.originalKey === key)) deleted = deleted.filter(t => t.originalKey !== key);\n const keyIndex = keys.indexOf(key);\n const item = items[keyIndex];\n const slot = first && initial !== void 0 ? 'initial' : ENTER;\n current[key] = {\n slot,\n originalKey: key,\n key: unique ? String(key) : guid++,\n item,\n trail: delay = delay + trail,\n config: callProp(config, item, slot),\n from: callProp(first ? initial !== void 0 ? initial || {} : from : from, item),\n to: callProp(enter, item)\n };\n });\n break;\n }\n\n case LEAVE:\n {\n removed.forEach(key => {\n const keyIndex = _keys.indexOf(key);\n\n const item = _items[keyIndex];\n const slot = LEAVE;\n deleted.unshift(_extends({}, current[key], {\n slot,\n destroyed: true,\n left: _keys[Math.max(0, keyIndex - 1)],\n right: _keys[Math.min(_keys.length, keyIndex + 1)],\n trail: delay = delay + trail,\n config: callProp(config, item, slot),\n to: callProp(leave, item)\n }));\n delete current[key];\n });\n break;\n }\n\n case UPDATE:\n {\n updated.forEach(key => {\n const keyIndex = keys.indexOf(key);\n const item = items[keyIndex];\n const slot = UPDATE;\n current[key] = _extends({}, current[key], {\n item,\n slot,\n trail: delay = delay + trail,\n config: callProp(config, item, slot),\n to: callProp(update, item)\n });\n });\n break;\n }\n }\n }\n\n let out = keys.map(key => current[key]); // This tries to restore order for deleted items by finding their last known siblings\n // only using the left sibling to keep order placement consistent for all deleted items\n\n deleted.forEach((_ref9) => {\n let left = _ref9.left,\n right = _ref9.right,\n item = _objectWithoutPropertiesLoose(_ref9, [\"left\", \"right\"]);\n\n let pos; // Was it the element on the left, if yes, move there ...\n\n if ((pos = out.findIndex(t => t.originalKey === left)) !== -1) pos += 1; // And if nothing else helps, move it to the start ¯\\_(ツ)_/¯\n\n pos = Math.max(0, pos);\n out = [...out.slice(0, pos), item, ...out.slice(pos)];\n });\n return _extends({}, state, {\n changed: added.length || removed.length || updated.length,\n first: first && added.length === 0,\n transitions: out,\n current,\n deleted,\n prevProps: props\n });\n}\n\nclass AnimatedStyle extends AnimatedObject {\n constructor(style) {\n if (style === void 0) {\n style = {};\n }\n\n super();\n\n if (style.transform && !(style.transform instanceof Animated)) {\n style = applyAnimatedValues.transform(style);\n }\n\n this.payload = style;\n }\n\n}\n\n// http://www.w3.org/TR/css3-color/#svg-color\nconst colors = {\n transparent: 0x00000000,\n aliceblue: 0xf0f8ffff,\n antiquewhite: 0xfaebd7ff,\n aqua: 0x00ffffff,\n aquamarine: 0x7fffd4ff,\n azure: 0xf0ffffff,\n beige: 0xf5f5dcff,\n bisque: 0xffe4c4ff,\n black: 0x000000ff,\n blanchedalmond: 0xffebcdff,\n blue: 0x0000ffff,\n blueviolet: 0x8a2be2ff,\n brown: 0xa52a2aff,\n burlywood: 0xdeb887ff,\n burntsienna: 0xea7e5dff,\n cadetblue: 0x5f9ea0ff,\n chartreuse: 0x7fff00ff,\n chocolate: 0xd2691eff,\n coral: 0xff7f50ff,\n cornflowerblue: 0x6495edff,\n cornsilk: 0xfff8dcff,\n crimson: 0xdc143cff,\n cyan: 0x00ffffff,\n darkblue: 0x00008bff,\n darkcyan: 0x008b8bff,\n darkgoldenrod: 0xb8860bff,\n darkgray: 0xa9a9a9ff,\n darkgreen: 0x006400ff,\n darkgrey: 0xa9a9a9ff,\n darkkhaki: 0xbdb76bff,\n darkmagenta: 0x8b008bff,\n darkolivegreen: 0x556b2fff,\n darkorange: 0xff8c00ff,\n darkorchid: 0x9932ccff,\n darkred: 0x8b0000ff,\n darksalmon: 0xe9967aff,\n darkseagreen: 0x8fbc8fff,\n darkslateblue: 0x483d8bff,\n darkslategray: 0x2f4f4fff,\n darkslategrey: 0x2f4f4fff,\n darkturquoise: 0x00ced1ff,\n darkviolet: 0x9400d3ff,\n deeppink: 0xff1493ff,\n deepskyblue: 0x00bfffff,\n dimgray: 0x696969ff,\n dimgrey: 0x696969ff,\n dodgerblue: 0x1e90ffff,\n firebrick: 0xb22222ff,\n floralwhite: 0xfffaf0ff,\n forestgreen: 0x228b22ff,\n fuchsia: 0xff00ffff,\n gainsboro: 0xdcdcdcff,\n ghostwhite: 0xf8f8ffff,\n gold: 0xffd700ff,\n goldenrod: 0xdaa520ff,\n gray: 0x808080ff,\n green: 0x008000ff,\n greenyellow: 0xadff2fff,\n grey: 0x808080ff,\n honeydew: 0xf0fff0ff,\n hotpink: 0xff69b4ff,\n indianred: 0xcd5c5cff,\n indigo: 0x4b0082ff,\n ivory: 0xfffff0ff,\n khaki: 0xf0e68cff,\n lavender: 0xe6e6faff,\n lavenderblush: 0xfff0f5ff,\n lawngreen: 0x7cfc00ff,\n lemonchiffon: 0xfffacdff,\n lightblue: 0xadd8e6ff,\n lightcoral: 0xf08080ff,\n lightcyan: 0xe0ffffff,\n lightgoldenrodyellow: 0xfafad2ff,\n lightgray: 0xd3d3d3ff,\n lightgreen: 0x90ee90ff,\n lightgrey: 0xd3d3d3ff,\n lightpink: 0xffb6c1ff,\n lightsalmon: 0xffa07aff,\n lightseagreen: 0x20b2aaff,\n lightskyblue: 0x87cefaff,\n lightslategray: 0x778899ff,\n lightslategrey: 0x778899ff,\n lightsteelblue: 0xb0c4deff,\n lightyellow: 0xffffe0ff,\n lime: 0x00ff00ff,\n limegreen: 0x32cd32ff,\n linen: 0xfaf0e6ff,\n magenta: 0xff00ffff,\n maroon: 0x800000ff,\n mediumaquamarine: 0x66cdaaff,\n mediumblue: 0x0000cdff,\n mediumorchid: 0xba55d3ff,\n mediumpurple: 0x9370dbff,\n mediumseagreen: 0x3cb371ff,\n mediumslateblue: 0x7b68eeff,\n mediumspringgreen: 0x00fa9aff,\n mediumturquoise: 0x48d1ccff,\n mediumvioletred: 0xc71585ff,\n midnightblue: 0x191970ff,\n mintcream: 0xf5fffaff,\n mistyrose: 0xffe4e1ff,\n moccasin: 0xffe4b5ff,\n navajowhite: 0xffdeadff,\n navy: 0x000080ff,\n oldlace: 0xfdf5e6ff,\n olive: 0x808000ff,\n olivedrab: 0x6b8e23ff,\n orange: 0xffa500ff,\n orangered: 0xff4500ff,\n orchid: 0xda70d6ff,\n palegoldenrod: 0xeee8aaff,\n palegreen: 0x98fb98ff,\n paleturquoise: 0xafeeeeff,\n palevioletred: 0xdb7093ff,\n papayawhip: 0xffefd5ff,\n peachpuff: 0xffdab9ff,\n peru: 0xcd853fff,\n pink: 0xffc0cbff,\n plum: 0xdda0ddff,\n powderblue: 0xb0e0e6ff,\n purple: 0x800080ff,\n rebeccapurple: 0x663399ff,\n red: 0xff0000ff,\n rosybrown: 0xbc8f8fff,\n royalblue: 0x4169e1ff,\n saddlebrown: 0x8b4513ff,\n salmon: 0xfa8072ff,\n sandybrown: 0xf4a460ff,\n seagreen: 0x2e8b57ff,\n seashell: 0xfff5eeff,\n sienna: 0xa0522dff,\n silver: 0xc0c0c0ff,\n skyblue: 0x87ceebff,\n slateblue: 0x6a5acdff,\n slategray: 0x708090ff,\n slategrey: 0x708090ff,\n snow: 0xfffafaff,\n springgreen: 0x00ff7fff,\n steelblue: 0x4682b4ff,\n tan: 0xd2b48cff,\n teal: 0x008080ff,\n thistle: 0xd8bfd8ff,\n tomato: 0xff6347ff,\n turquoise: 0x40e0d0ff,\n violet: 0xee82eeff,\n wheat: 0xf5deb3ff,\n white: 0xffffffff,\n whitesmoke: 0xf5f5f5ff,\n yellow: 0xffff00ff,\n yellowgreen: 0x9acd32ff\n};\n\n// const INTEGER = '[-+]?\\\\d+';\nconst NUMBER = '[-+]?\\\\d*\\\\.?\\\\d+';\nconst PERCENTAGE = NUMBER + '%';\n\nfunction call() {\n for (var _len = arguments.length, parts = new Array(_len), _key = 0; _key < _len; _key++) {\n parts[_key] = arguments[_key];\n }\n\n return '\\\\(\\\\s*(' + parts.join(')\\\\s*,\\\\s*(') + ')\\\\s*\\\\)';\n}\n\nconst rgb = new RegExp('rgb' + call(NUMBER, NUMBER, NUMBER));\nconst rgba = new RegExp('rgba' + call(NUMBER, NUMBER, NUMBER, NUMBER));\nconst hsl = new RegExp('hsl' + call(NUMBER, PERCENTAGE, PERCENTAGE));\nconst hsla = new RegExp('hsla' + call(NUMBER, PERCENTAGE, PERCENTAGE, NUMBER));\nconst hex3 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;\nconst hex4 = /^#([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/;\nconst hex6 = /^#([0-9a-fA-F]{6})$/;\nconst hex8 = /^#([0-9a-fA-F]{8})$/;\n\n/*\nhttps://github.com/react-community/normalize-css-color\n\nBSD 3-Clause License\n\nCopyright (c) 2016, React Community\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are met:\n\n* Redistributions of source code must retain the above copyright notice, this\n list of conditions and the following disclaimer.\n\n* Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n* Neither the name of the copyright holder nor the names of its\n contributors may be used to endorse or promote products derived from\n this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\nAND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\nIMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE\nDISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE\nFOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL\nDAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\nSERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\nCAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,\nOR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n*/\nfunction normalizeColor(color) {\n let match;\n\n if (typeof color === 'number') {\n return color >>> 0 === color && color >= 0 && color <= 0xffffffff ? color : null;\n } // Ordered based on occurrences on Facebook codebase\n\n\n if (match = hex6.exec(color)) return parseInt(match[1] + 'ff', 16) >>> 0;\n if (colors.hasOwnProperty(color)) return colors[color];\n\n if (match = rgb.exec(color)) {\n return (parse255(match[1]) << 24 | // r\n parse255(match[2]) << 16 | // g\n parse255(match[3]) << 8 | // b\n 0x000000ff) >>> // a\n 0;\n }\n\n if (match = rgba.exec(color)) {\n return (parse255(match[1]) << 24 | // r\n parse255(match[2]) << 16 | // g\n parse255(match[3]) << 8 | // b\n parse1(match[4])) >>> // a\n 0;\n }\n\n if (match = hex3.exec(color)) {\n return parseInt(match[1] + match[1] + // r\n match[2] + match[2] + // g\n match[3] + match[3] + // b\n 'ff', // a\n 16) >>> 0;\n } // https://drafts.csswg.org/css-color-4/#hex-notation\n\n\n if (match = hex8.exec(color)) return parseInt(match[1], 16) >>> 0;\n\n if (match = hex4.exec(color)) {\n return parseInt(match[1] + match[1] + // r\n match[2] + match[2] + // g\n match[3] + match[3] + // b\n match[4] + match[4], // a\n 16) >>> 0;\n }\n\n if (match = hsl.exec(color)) {\n return (hslToRgb(parse360(match[1]), // h\n parsePercentage(match[2]), // s\n parsePercentage(match[3]) // l\n ) | 0x000000ff) >>> // a\n 0;\n }\n\n if (match = hsla.exec(color)) {\n return (hslToRgb(parse360(match[1]), // h\n parsePercentage(match[2]), // s\n parsePercentage(match[3]) // l\n ) | parse1(match[4])) >>> // a\n 0;\n }\n\n return null;\n}\n\nfunction hue2rgb(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n}\n\nfunction hslToRgb(h, s, l) {\n const q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n const p = 2 * l - q;\n const r = hue2rgb(p, q, h + 1 / 3);\n const g = hue2rgb(p, q, h);\n const b = hue2rgb(p, q, h - 1 / 3);\n return Math.round(r * 255) << 24 | Math.round(g * 255) << 16 | Math.round(b * 255) << 8;\n}\n\nfunction parse255(str) {\n const int = parseInt(str, 10);\n if (int < 0) return 0;\n if (int > 255) return 255;\n return int;\n}\n\nfunction parse360(str) {\n const int = parseFloat(str);\n return (int % 360 + 360) % 360 / 360;\n}\n\nfunction parse1(str) {\n const num = parseFloat(str);\n if (num < 0) return 0;\n if (num > 1) return 255;\n return Math.round(num * 255);\n}\n\nfunction parsePercentage(str) {\n // parseFloat conveniently ignores the final %\n const int = parseFloat(str);\n if (int < 0) return 0;\n if (int > 100) return 1;\n return int / 100;\n}\n\nfunction colorToRgba(input) {\n let int32Color = normalizeColor(input);\n if (int32Color === null) return input;\n int32Color = int32Color || 0;\n let r = (int32Color & 0xff000000) >>> 24;\n let g = (int32Color & 0x00ff0000) >>> 16;\n let b = (int32Color & 0x0000ff00) >>> 8;\n let a = (int32Color & 0x000000ff) / 255;\n return `rgba(${r}, ${g}, ${b}, ${a})`;\n} // Problem: https://github.com/animatedjs/animated/pull/102\n// Solution: https://stackoverflow.com/questions/638565/parsing-scientific-notation-sensibly/658662\n\n\nconst stringShapeRegex = /[+\\-]?(?:0|[1-9]\\d*)(?:\\.\\d*)?(?:[eE][+\\-]?\\d+)?/g; // Covers rgb, rgba, hsl, hsla\n// Taken from https://gist.github.com/olmokramer/82ccce673f86db7cda5e\n\nconst colorRegex = /(#(?:[0-9a-f]{2}){2,4}|(#[0-9a-f]{3})|(rgb|hsl)a?\\((-?\\d+%?[,\\s]+){2,3}\\s*[\\d\\.]+%?\\))/gi; // Covers color names (transparent, blue, etc.)\n\nconst colorNamesRegex = new RegExp(`(${Object.keys(colors).join('|')})`, 'g');\n/**\n * Supports string shapes by extracting numbers so new values can be computed,\n * and recombines those values into new strings of the same shape. Supports\n * things like:\n *\n * rgba(123, 42, 99, 0.36) // colors\n * -45deg // values with units\n * 0 2px 2px 0px rgba(0, 0, 0, 0.12) // box shadows\n */\n\nconst createStringInterpolator = config => {\n // Replace colors with rgba\n const outputRange = config.output.map(rangeValue => rangeValue.replace(colorRegex, colorToRgba)).map(rangeValue => rangeValue.replace(colorNamesRegex, colorToRgba));\n const outputRanges = outputRange[0].match(stringShapeRegex).map(() => []);\n outputRange.forEach(value => {\n value.match(stringShapeRegex).forEach((number, i) => outputRanges[i].push(+number));\n });\n const interpolations = outputRange[0].match(stringShapeRegex).map((_value, i) => createInterpolator(_extends({}, config, {\n output: outputRanges[i]\n })));\n return input => {\n let i = 0;\n return outputRange[0] // 'rgba(0, 100, 200, 0)'\n // ->\n // 'rgba(${interpolations[0](input)}, ${interpolations[1](input)}, ...'\n .replace(stringShapeRegex, () => interpolations[i++](input)) // rgba requires that the r,g,b are integers.... so we want to round them, but we *dont* want to\n // round the opacity (4th column).\n .replace(/rgba\\(([0-9\\.-]+), ([0-9\\.-]+), ([0-9\\.-]+), ([0-9\\.-]+)\\)/gi, (_, p1, p2, p3, p4) => `rgba(${Math.round(p1)}, ${Math.round(p2)}, ${Math.round(p3)}, ${p4})`);\n };\n};\n\nlet isUnitlessNumber = {\n animationIterationCount: true,\n borderImageOutset: true,\n borderImageSlice: true,\n borderImageWidth: true,\n boxFlex: true,\n boxFlexGroup: true,\n boxOrdinalGroup: true,\n columnCount: true,\n columns: true,\n flex: true,\n flexGrow: true,\n flexPositive: true,\n flexShrink: true,\n flexNegative: true,\n flexOrder: true,\n gridRow: true,\n gridRowEnd: true,\n gridRowSpan: true,\n gridRowStart: true,\n gridColumn: true,\n gridColumnEnd: true,\n gridColumnSpan: true,\n gridColumnStart: true,\n fontWeight: true,\n lineClamp: true,\n lineHeight: true,\n opacity: true,\n order: true,\n orphans: true,\n tabSize: true,\n widows: true,\n zIndex: true,\n zoom: true,\n // SVG-related properties\n fillOpacity: true,\n floodOpacity: true,\n stopOpacity: true,\n strokeDasharray: true,\n strokeDashoffset: true,\n strokeMiterlimit: true,\n strokeOpacity: true,\n strokeWidth: true\n};\n\nconst prefixKey = (prefix, key) => prefix + key.charAt(0).toUpperCase() + key.substring(1);\n\nconst prefixes = ['Webkit', 'Ms', 'Moz', 'O'];\nisUnitlessNumber = Object.keys(isUnitlessNumber).reduce((acc, prop) => {\n prefixes.forEach(prefix => acc[prefixKey(prefix, prop)] = acc[prop]);\n return acc;\n}, isUnitlessNumber);\n\nfunction dangerousStyleValue(name, value, isCustomProperty) {\n if (value == null || typeof value === 'boolean' || value === '') return '';\n if (!isCustomProperty && typeof value === 'number' && value !== 0 && !(isUnitlessNumber.hasOwnProperty(name) && isUnitlessNumber[name])) return value + 'px'; // Presumes implicit 'px' suffix for unitless numbers\n\n return ('' + value).trim();\n}\n\nconst attributeCache = {};\ninjectCreateAnimatedStyle(style => new AnimatedStyle(style));\ninjectDefaultElement('div');\ninjectStringInterpolator(createStringInterpolator);\ninjectColorNames(colors);\ninjectApplyAnimatedValues((instance, props) => {\n if (instance.nodeType && instance.setAttribute !== undefined) {\n const style = props.style,\n children = props.children,\n scrollTop = props.scrollTop,\n scrollLeft = props.scrollLeft,\n attributes = _objectWithoutPropertiesLoose(props, [\"style\", \"children\", \"scrollTop\", \"scrollLeft\"]);\n\n const filter = instance.nodeName === 'filter' || instance.parentNode && instance.parentNode.nodeName === 'filter';\n if (scrollTop !== void 0) instance.scrollTop = scrollTop;\n if (scrollLeft !== void 0) instance.scrollLeft = scrollLeft; // Set textContent, if children is an animatable value\n\n if (children !== void 0) instance.textContent = children; // Set styles ...\n\n for (let styleName in style) {\n if (!style.hasOwnProperty(styleName)) continue;\n var isCustomProperty = styleName.indexOf('--') === 0;\n var styleValue = dangerousStyleValue(styleName, style[styleName], isCustomProperty);\n if (styleName === 'float') styleName = 'cssFloat';\n if (isCustomProperty) instance.style.setProperty(styleName, styleValue);else instance.style[styleName] = styleValue;\n } // Set attributes ...\n\n\n for (let name in attributes) {\n // Attributes are written in dash case\n const dashCase = filter ? name : attributeCache[name] || (attributeCache[name] = name.replace(/([A-Z])/g, n => '-' + n.toLowerCase()));\n if (typeof instance.getAttribute(dashCase) !== 'undefined') instance.setAttribute(dashCase, attributes[name]);\n }\n\n return;\n } else return false;\n}, style => style);\n\nconst domElements = ['a', 'abbr', 'address', 'area', 'article', 'aside', 'audio', 'b', 'base', 'bdi', 'bdo', 'big', 'blockquote', 'body', 'br', 'button', 'canvas', 'caption', 'cite', 'code', 'col', 'colgroup', 'data', 'datalist', 'dd', 'del', 'details', 'dfn', 'dialog', 'div', 'dl', 'dt', 'em', 'embed', 'fieldset', 'figcaption', 'figure', 'footer', 'form', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'head', 'header', 'hgroup', 'hr', 'html', 'i', 'iframe', 'img', 'input', 'ins', 'kbd', 'keygen', 'label', 'legend', 'li', 'link', 'main', 'map', 'mark', 'menu', 'menuitem', 'meta', 'meter', 'nav', 'noscript', 'object', 'ol', 'optgroup', 'option', 'output', 'p', 'param', 'picture', 'pre', 'progress', 'q', 'rp', 'rt', 'ruby', 's', 'samp', 'script', 'section', 'select', 'small', 'source', 'span', 'strong', 'style', 'sub', 'summary', 'sup', 'table', 'tbody', 'td', 'textarea', 'tfoot', 'th', 'thead', 'time', 'title', 'tr', 'track', 'u', 'ul', 'var', 'video', 'wbr', // SVG\n'circle', 'clipPath', 'defs', 'ellipse', 'foreignObject', 'g', 'image', 'line', 'linearGradient', 'mask', 'path', 'pattern', 'polygon', 'polyline', 'radialGradient', 'rect', 'stop', 'svg', 'text', 'tspan'];\n// Extend animated with all the available THREE elements\nconst apply = merge(createAnimatedComponent, false);\nconst extendedAnimated = apply(domElements);\n\nexport { apply, config, update, extendedAnimated as animated, extendedAnimated as a, interpolate$1 as interpolate, Globals, useSpring, useTrail, useTransition, useChain, useSprings };\n","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.deg = deg;\nexports.transform = transform;\nexports.isWithinRadius = isWithinRadius;\nexports.calcAnimationAngle = calcAnimationAngle;\n\nvar _constants = require(\"./constants\");\n\nconst cos = Math.cos,\n sin = Math.sin;\nconst pi = Math.PI;\nconst ANGLE_PER_INCREMENT = 360 / _constants.VISIBLE_NUMBERS_PER_CIRCLE;\n\nfunction rad(deg) {\n return deg / (180 / pi);\n}\n\nfunction deg(rad) {\n return rad * (180 / pi);\n} // translate number position\n\n\nfunction translateX(index, transform) {\n return sin(rad(index * -ANGLE_PER_INCREMENT - 180)) * (_constants.CLOCK_RADIUS - transform) + _constants.CLOCK_RADIUS - _constants.NUMBER_RADIUS_REGULAR / 2;\n}\n\nfunction translateY(index, transform) {\n return cos(rad(index * -ANGLE_PER_INCREMENT - 180)) * (_constants.CLOCK_RADIUS - transform) + _constants.CLOCK_RADIUS - _constants.NUMBER_RADIUS_REGULAR / 2;\n} // calculate number position for animation\n\n\nfunction transform(index, t) {\n const x = translateX(index, t);\n const y = translateY(index, t);\n return \"translate(\".concat(x, \"px, \").concat(y, \"px)\");\n}\n\nfunction isWithinRadius(x, y, radius) {\n return Math.sqrt(x * x + y * y) < radius;\n}\n\n// normalize any angles to 0-360 deg\nfunction normalize(angle) {\n return (angle % 360 + 360) % 360;\n}\n/*\n\tcalculates the shortest angle between the prev and next angle\n\tto animate to - positive spins clockwise, negative is ccw\n\n\t- prev is the previous angle - can literally be almost any value,\n\teg: 480 is valid, -480 is valid\n\t- next is the angle to rotate to - is always between 0-360\n\t- must return an angle relative to the previous, so once again\n\tthis value can be any negative or positive value (like prev)\n\n\tfunction normalizes each angle, creates an upper and lower bound\n\tbased on previous angle and figures out which direction is shorter\n\tfor next - then diff and add/subtract to previous angle\n*/\n\n\nfunction calcAnimationAngle(prev, next) {\n const p = normalize(prev);\n const n = normalize(next);\n let lower = p;\n let upper = p; // TODO - implement without while loops\n\n while (n < lower) {\n lower -= 360;\n }\n\n while (n >= upper) {\n upper += 360;\n }\n\n if (upper - n < n - lower) {\n return prev - (upper - n);\n } else {\n return prev + (n - lower);\n }\n}","function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n module.exports = _typeof = function _typeof(obj) {\n return typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n } else {\n module.exports = _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n\n module.exports[\"default\"] = module.exports, module.exports.__esModule = true;\n }\n\n return _typeof(obj);\n}\n\nmodule.exports = _typeof;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","module.exports = require('./dist/react-data-grid');","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Similar to invariant but only logs a warning if the condition is not met.\n * This can be used to log issues in development environments in critical\n * paths. Removing the logging code for production environments will keep the\n * same logic and follow the same code paths.\n */\n\nvar __DEV__ = process.env.NODE_ENV !== 'production';\n\nvar warning = function() {};\n\nif (__DEV__) {\n var printWarning = function printWarning(format, args) {\n var len = arguments.length;\n args = new Array(len > 1 ? len - 1 : 0);\n for (var key = 1; key < len; key++) {\n args[key - 1] = arguments[key];\n }\n var argIndex = 0;\n var message = 'Warning: ' +\n format.replace(/%s/g, function() {\n return args[argIndex++];\n });\n if (typeof console !== 'undefined') {\n console.error(message);\n }\n try {\n // --- Welcome to debugging React ---\n // This error was thrown as a convenience so that you can use this stack\n // to find the callsite that caused this warning to fire.\n throw new Error(message);\n } catch (x) {}\n }\n\n warning = function(condition, format, args) {\n var len = arguments.length;\n args = new Array(len > 2 ? len - 2 : 0);\n for (var key = 2; key < len; key++) {\n args[key - 2] = arguments[key];\n }\n if (format === undefined) {\n throw new Error(\n '`warning(condition, format, ...args)` requires a warning ' +\n 'message argument'\n );\n }\n if (!condition) {\n printWarning.apply(null, [format].concat(args));\n }\n };\n}\n\nmodule.exports = warning;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar invariant = function(condition, format, a, b, c, d, e, f) {\n if (process.env.NODE_ENV !== 'production') {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n }\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error(\n 'Minified exception occurred; use the non-minified dev environment ' +\n 'for the full error message and additional helpful warnings.'\n );\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(\n format.replace(/%s/g, function() { return args[argIndex++]; })\n );\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n};\n\nmodule.exports = invariant;\n","import memoize from '@emotion/memoize';\n\nvar reactPropsRegex = /^((children|dangerouslySetInnerHTML|key|ref|autoFocus|defaultValue|defaultChecked|innerHTML|suppressContentEditableWarning|suppressHydrationWarning|valueLink|accept|acceptCharset|accessKey|action|allow|allowUserMedia|allowPaymentRequest|allowFullScreen|allowTransparency|alt|async|autoComplete|autoPlay|capture|cellPadding|cellSpacing|challenge|charSet|checked|cite|classID|className|cols|colSpan|content|contentEditable|contextMenu|controls|controlsList|coords|crossOrigin|data|dateTime|decoding|default|defer|dir|disabled|disablePictureInPicture|download|draggable|encType|form|formAction|formEncType|formMethod|formNoValidate|formTarget|frameBorder|headers|height|hidden|high|href|hrefLang|htmlFor|httpEquiv|id|inputMode|integrity|is|keyParams|keyType|kind|label|lang|list|loading|loop|low|marginHeight|marginWidth|max|maxLength|media|mediaGroup|method|min|minLength|multiple|muted|name|nonce|noValidate|open|optimum|pattern|placeholder|playsInline|poster|preload|profile|radioGroup|readOnly|referrerPolicy|rel|required|reversed|role|rows|rowSpan|sandbox|scope|scoped|scrolling|seamless|selected|shape|size|sizes|slot|span|spellCheck|src|srcDoc|srcLang|srcSet|start|step|style|summary|tabIndex|target|title|type|useMap|value|width|wmode|wrap|about|datatype|inlist|prefix|property|resource|typeof|vocab|autoCapitalize|autoCorrect|autoSave|color|inert|itemProp|itemScope|itemType|itemID|itemRef|on|results|security|unselectable|accentHeight|accumulate|additive|alignmentBaseline|allowReorder|alphabetic|amplitude|arabicForm|ascent|attributeName|attributeType|autoReverse|azimuth|baseFrequency|baselineShift|baseProfile|bbox|begin|bias|by|calcMode|capHeight|clip|clipPathUnits|clipPath|clipRule|colorInterpolation|colorInterpolationFilters|colorProfile|colorRendering|contentScriptType|contentStyleType|cursor|cx|cy|d|decelerate|descent|diffuseConstant|direction|display|divisor|dominantBaseline|dur|dx|dy|edgeMode|elevation|enableBackground|end|exponent|externalResourcesRequired|fill|fillOpacity|fillRule|filter|filterRes|filterUnits|floodColor|floodOpacity|focusable|fontFamily|fontSize|fontSizeAdjust|fontStretch|fontStyle|fontVariant|fontWeight|format|from|fr|fx|fy|g1|g2|glyphName|glyphOrientationHorizontal|glyphOrientationVertical|glyphRef|gradientTransform|gradientUnits|hanging|horizAdvX|horizOriginX|ideographic|imageRendering|in|in2|intercept|k|k1|k2|k3|k4|kernelMatrix|kernelUnitLength|kerning|keyPoints|keySplines|keyTimes|lengthAdjust|letterSpacing|lightingColor|limitingConeAngle|local|markerEnd|markerMid|markerStart|markerHeight|markerUnits|markerWidth|mask|maskContentUnits|maskUnits|mathematical|mode|numOctaves|offset|opacity|operator|order|orient|orientation|origin|overflow|overlinePosition|overlineThickness|panose1|paintOrder|pathLength|patternContentUnits|patternTransform|patternUnits|pointerEvents|points|pointsAtX|pointsAtY|pointsAtZ|preserveAlpha|preserveAspectRatio|primitiveUnits|r|radius|refX|refY|renderingIntent|repeatCount|repeatDur|requiredExtensions|requiredFeatures|restart|result|rotate|rx|ry|scale|seed|shapeRendering|slope|spacing|specularConstant|specularExponent|speed|spreadMethod|startOffset|stdDeviation|stemh|stemv|stitchTiles|stopColor|stopOpacity|strikethroughPosition|strikethroughThickness|string|stroke|strokeDasharray|strokeDashoffset|strokeLinecap|strokeLinejoin|strokeMiterlimit|strokeOpacity|strokeWidth|surfaceScale|systemLanguage|tableValues|targetX|targetY|textAnchor|textDecoration|textRendering|textLength|to|transform|u1|u2|underlinePosition|underlineThickness|unicode|unicodeBidi|unicodeRange|unitsPerEm|vAlphabetic|vHanging|vIdeographic|vMathematical|values|vectorEffect|version|vertAdvY|vertOriginX|vertOriginY|viewBox|viewTarget|visibility|widths|wordSpacing|writingMode|x|xHeight|x1|x2|xChannelSelector|xlinkActuate|xlinkArcrole|xlinkHref|xlinkRole|xlinkShow|xlinkTitle|xlinkType|xmlBase|xmlns|xmlnsXlink|xmlLang|xmlSpace|y|y1|y2|yChannelSelector|z|zoomAndPan|for|class|autofocus)|(([Dd][Aa][Tt][Aa]|[Aa][Rr][Ii][Aa]|x)-.*))$/; // https://esbench.com/bench/5bfee68a4cd7e6009ef61d23\n\nvar index = memoize(function (prop) {\n return reactPropsRegex.test(prop) || prop.charCodeAt(0) === 111\n /* o */\n && prop.charCodeAt(1) === 110\n /* n */\n && prop.charCodeAt(2) < 91;\n}\n/* Z+1 */\n);\n\nexport default index;\n","'use strict';\n\nvar reactIs = require('react-is');\n\n/**\n * Copyright 2015, Yahoo! Inc.\n * Copyrights licensed under the New BSD License. See the accompanying LICENSE file for terms.\n */\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n '$$typeof': true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n '$$typeof': true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {};\nTYPE_STATICS[reactIs.ForwardRef] = FORWARD_REF_STATICS;\nTYPE_STATICS[reactIs.Memo] = MEMO_STATICS;\n\nfunction getStatics(component) {\n // React v16.11 and below\n if (reactIs.isMemo(component)) {\n return MEMO_STATICS;\n } // React v16.12 and above\n\n\n return TYPE_STATICS[component['$$typeof']] || REACT_STATICS;\n}\n\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent, blacklist) {\n if (typeof sourceComponent !== 'string') {\n // don't hoist over string (html) components\n if (objectPrototype) {\n var inheritedComponent = getPrototypeOf(sourceComponent);\n\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent, blacklist);\n }\n }\n\n var keys = getOwnPropertyNames(sourceComponent);\n\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n\n var targetStatics = getStatics(targetComponent);\n var sourceStatics = getStatics(sourceComponent);\n\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n\n if (!KNOWN_STATICS[key] && !(blacklist && blacklist[key]) && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n var descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n\n try {\n // Avoid failures from read-only properties\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {}\n }\n }\n }\n\n return targetComponent;\n}\n\nmodule.exports = hoistNonReactStatics;\n","export default function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") {\n _typeof = function _typeof(obj) {\n return typeof obj;\n };\n } else {\n _typeof = function _typeof(obj) {\n return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n };\n }\n\n return _typeof(obj);\n}","export default function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}","import defineProperty from \"./defineProperty.js\";\nexport default function _objectSpread(target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i] != null ? Object(arguments[i]) : {};\n var ownKeys = Object.keys(source);\n\n if (typeof Object.getOwnPropertySymbols === 'function') {\n ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {\n return Object.getOwnPropertyDescriptor(source, sym).enumerable;\n }));\n }\n\n ownKeys.forEach(function (key) {\n defineProperty(target, key, source[key]);\n });\n }\n\n return target;\n}","export default function _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}","import _typeof from \"@babel/runtime/helpers/typeof\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nexport default function _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n }\n\n return assertThisInitialized(self);\n}","export default function _getPrototypeOf(o) {\n _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n };\n return _getPrototypeOf(o);\n}","import setPrototypeOf from \"./setPrototypeOf.js\";\nexport default function _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}","import _typeof from '@babel/runtime/helpers/esm/typeof';\nimport _objectSpread from '@babel/runtime/helpers/esm/objectSpread';\nimport _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\nimport _possibleConstructorReturn from '@babel/runtime/helpers/esm/possibleConstructorReturn';\nimport _getPrototypeOf from '@babel/runtime/helpers/esm/getPrototypeOf';\nimport _assertThisInitialized from '@babel/runtime/helpers/esm/assertThisInitialized';\nimport _inherits from '@babel/runtime/helpers/esm/inherits';\n\nvar consoleLogger = {\n type: 'logger',\n log: function log(args) {\n this.output('log', args);\n },\n warn: function warn(args) {\n this.output('warn', args);\n },\n error: function error(args) {\n this.output('error', args);\n },\n output: function output(type, args) {\n if (console && console[type]) console[type].apply(console, args);\n }\n};\n\nvar Logger = function () {\n function Logger(concreteLogger) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Logger);\n\n this.init(concreteLogger, options);\n }\n\n _createClass(Logger, [{\n key: \"init\",\n value: function init(concreteLogger) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n this.prefix = options.prefix || 'i18next:';\n this.logger = concreteLogger || consoleLogger;\n this.options = options;\n this.debug = options.debug;\n }\n }, {\n key: \"setDebug\",\n value: function setDebug(bool) {\n this.debug = bool;\n }\n }, {\n key: \"log\",\n value: function log() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return this.forward(args, 'log', '', true);\n }\n }, {\n key: \"warn\",\n value: function warn() {\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return this.forward(args, 'warn', '', true);\n }\n }, {\n key: \"error\",\n value: function error() {\n for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {\n args[_key3] = arguments[_key3];\n }\n\n return this.forward(args, 'error', '');\n }\n }, {\n key: \"deprecate\",\n value: function deprecate() {\n for (var _len4 = arguments.length, args = new Array(_len4), _key4 = 0; _key4 < _len4; _key4++) {\n args[_key4] = arguments[_key4];\n }\n\n return this.forward(args, 'warn', 'WARNING DEPRECATED: ', true);\n }\n }, {\n key: \"forward\",\n value: function forward(args, lvl, prefix, debugOnly) {\n if (debugOnly && !this.debug) return null;\n if (typeof args[0] === 'string') args[0] = \"\".concat(prefix).concat(this.prefix, \" \").concat(args[0]);\n return this.logger[lvl](args);\n }\n }, {\n key: \"create\",\n value: function create(moduleName) {\n return new Logger(this.logger, _objectSpread({}, {\n prefix: \"\".concat(this.prefix, \":\").concat(moduleName, \":\")\n }, this.options));\n }\n }]);\n\n return Logger;\n}();\n\nvar baseLogger = new Logger();\n\nvar EventEmitter = function () {\n function EventEmitter() {\n _classCallCheck(this, EventEmitter);\n\n this.observers = {};\n }\n\n _createClass(EventEmitter, [{\n key: \"on\",\n value: function on(events, listener) {\n var _this = this;\n\n events.split(' ').forEach(function (event) {\n _this.observers[event] = _this.observers[event] || [];\n\n _this.observers[event].push(listener);\n });\n return this;\n }\n }, {\n key: \"off\",\n value: function off(event, listener) {\n if (!this.observers[event]) return;\n\n if (!listener) {\n delete this.observers[event];\n return;\n }\n\n this.observers[event] = this.observers[event].filter(function (l) {\n return l !== listener;\n });\n }\n }, {\n key: \"emit\",\n value: function emit(event) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n if (this.observers[event]) {\n var cloned = [].concat(this.observers[event]);\n cloned.forEach(function (observer) {\n observer.apply(void 0, args);\n });\n }\n\n if (this.observers['*']) {\n var _cloned = [].concat(this.observers['*']);\n\n _cloned.forEach(function (observer) {\n observer.apply(observer, [event].concat(args));\n });\n }\n }\n }]);\n\n return EventEmitter;\n}();\n\nfunction defer() {\n var res;\n var rej;\n var promise = new Promise(function (resolve, reject) {\n res = resolve;\n rej = reject;\n });\n promise.resolve = res;\n promise.reject = rej;\n return promise;\n}\nfunction makeString(object) {\n if (object == null) return '';\n return '' + object;\n}\nfunction copy(a, s, t) {\n a.forEach(function (m) {\n if (s[m]) t[m] = s[m];\n });\n}\n\nfunction getLastOfPath(object, path, Empty) {\n function cleanKey(key) {\n return key && key.indexOf('###') > -1 ? key.replace(/###/g, '.') : key;\n }\n\n function canNotTraverseDeeper() {\n return !object || typeof object === 'string';\n }\n\n var stack = typeof path !== 'string' ? [].concat(path) : path.split('.');\n\n while (stack.length > 1) {\n if (canNotTraverseDeeper()) return {};\n var key = cleanKey(stack.shift());\n if (!object[key] && Empty) object[key] = new Empty();\n\n if (Object.prototype.hasOwnProperty.call(object, key)) {\n object = object[key];\n } else {\n object = {};\n }\n }\n\n if (canNotTraverseDeeper()) return {};\n return {\n obj: object,\n k: cleanKey(stack.shift())\n };\n}\n\nfunction setPath(object, path, newValue) {\n var _getLastOfPath = getLastOfPath(object, path, Object),\n obj = _getLastOfPath.obj,\n k = _getLastOfPath.k;\n\n obj[k] = newValue;\n}\nfunction pushPath(object, path, newValue, concat) {\n var _getLastOfPath2 = getLastOfPath(object, path, Object),\n obj = _getLastOfPath2.obj,\n k = _getLastOfPath2.k;\n\n obj[k] = obj[k] || [];\n if (concat) obj[k] = obj[k].concat(newValue);\n if (!concat) obj[k].push(newValue);\n}\nfunction getPath(object, path) {\n var _getLastOfPath3 = getLastOfPath(object, path),\n obj = _getLastOfPath3.obj,\n k = _getLastOfPath3.k;\n\n if (!obj) return undefined;\n return obj[k];\n}\nfunction getPathWithDefaults(data, defaultData, key) {\n var value = getPath(data, key);\n\n if (value !== undefined) {\n return value;\n }\n\n return getPath(defaultData, key);\n}\nfunction deepExtend(target, source, overwrite) {\n for (var prop in source) {\n if (prop !== '__proto__' && prop !== 'constructor') {\n if (prop in target) {\n if (typeof target[prop] === 'string' || target[prop] instanceof String || typeof source[prop] === 'string' || source[prop] instanceof String) {\n if (overwrite) target[prop] = source[prop];\n } else {\n deepExtend(target[prop], source[prop], overwrite);\n }\n } else {\n target[prop] = source[prop];\n }\n }\n }\n\n return target;\n}\nfunction regexEscape(str) {\n return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n}\nvar _entityMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '/': '/'\n};\nfunction escape(data) {\n if (typeof data === 'string') {\n return data.replace(/[&<>\"'\\/]/g, function (s) {\n return _entityMap[s];\n });\n }\n\n return data;\n}\nvar isIE10 = typeof window !== 'undefined' && window.navigator && window.navigator.userAgent && window.navigator.userAgent.indexOf('MSIE') > -1;\n\nvar ResourceStore = function (_EventEmitter) {\n _inherits(ResourceStore, _EventEmitter);\n\n function ResourceStore(data) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n ns: ['translation'],\n defaultNS: 'translation'\n };\n\n _classCallCheck(this, ResourceStore);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(ResourceStore).call(this));\n\n if (isIE10) {\n EventEmitter.call(_assertThisInitialized(_this));\n }\n\n _this.data = data || {};\n _this.options = options;\n\n if (_this.options.keySeparator === undefined) {\n _this.options.keySeparator = '.';\n }\n\n return _this;\n }\n\n _createClass(ResourceStore, [{\n key: \"addNamespaces\",\n value: function addNamespaces(ns) {\n if (this.options.ns.indexOf(ns) < 0) {\n this.options.ns.push(ns);\n }\n }\n }, {\n key: \"removeNamespaces\",\n value: function removeNamespaces(ns) {\n var index = this.options.ns.indexOf(ns);\n\n if (index > -1) {\n this.options.ns.splice(index, 1);\n }\n }\n }, {\n key: \"getResource\",\n value: function getResource(lng, ns, key) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n var path = [lng, ns];\n if (key && typeof key !== 'string') path = path.concat(key);\n if (key && typeof key === 'string') path = path.concat(keySeparator ? key.split(keySeparator) : key);\n\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n }\n\n return getPath(this.data, path);\n }\n }, {\n key: \"addResource\",\n value: function addResource(lng, ns, key, value) {\n var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {\n silent: false\n };\n var keySeparator = this.options.keySeparator;\n if (keySeparator === undefined) keySeparator = '.';\n var path = [lng, ns];\n if (key) path = path.concat(keySeparator ? key.split(keySeparator) : key);\n\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n value = ns;\n ns = path[1];\n }\n\n this.addNamespaces(ns);\n setPath(this.data, path, value);\n if (!options.silent) this.emit('added', lng, ns, key, value);\n }\n }, {\n key: \"addResources\",\n value: function addResources(lng, ns, resources) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {\n silent: false\n };\n\n for (var m in resources) {\n if (typeof resources[m] === 'string' || Object.prototype.toString.apply(resources[m]) === '[object Array]') this.addResource(lng, ns, m, resources[m], {\n silent: true\n });\n }\n\n if (!options.silent) this.emit('added', lng, ns, resources);\n }\n }, {\n key: \"addResourceBundle\",\n value: function addResourceBundle(lng, ns, resources, deep, overwrite) {\n var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {\n silent: false\n };\n var path = [lng, ns];\n\n if (lng.indexOf('.') > -1) {\n path = lng.split('.');\n deep = resources;\n resources = ns;\n ns = path[1];\n }\n\n this.addNamespaces(ns);\n var pack = getPath(this.data, path) || {};\n\n if (deep) {\n deepExtend(pack, resources, overwrite);\n } else {\n pack = _objectSpread({}, pack, resources);\n }\n\n setPath(this.data, path, pack);\n if (!options.silent) this.emit('added', lng, ns, resources);\n }\n }, {\n key: \"removeResourceBundle\",\n value: function removeResourceBundle(lng, ns) {\n if (this.hasResourceBundle(lng, ns)) {\n delete this.data[lng][ns];\n }\n\n this.removeNamespaces(ns);\n this.emit('removed', lng, ns);\n }\n }, {\n key: \"hasResourceBundle\",\n value: function hasResourceBundle(lng, ns) {\n return this.getResource(lng, ns) !== undefined;\n }\n }, {\n key: \"getResourceBundle\",\n value: function getResourceBundle(lng, ns) {\n if (!ns) ns = this.options.defaultNS;\n if (this.options.compatibilityAPI === 'v1') return _objectSpread({}, {}, this.getResource(lng, ns));\n return this.getResource(lng, ns);\n }\n }, {\n key: \"getDataByLanguage\",\n value: function getDataByLanguage(lng) {\n return this.data[lng];\n }\n }, {\n key: \"toJSON\",\n value: function toJSON() {\n return this.data;\n }\n }]);\n\n return ResourceStore;\n}(EventEmitter);\n\nvar postProcessor = {\n processors: {},\n addPostProcessor: function addPostProcessor(module) {\n this.processors[module.name] = module;\n },\n handle: function handle(processors, value, key, options, translator) {\n var _this = this;\n\n processors.forEach(function (processor) {\n if (_this.processors[processor]) value = _this.processors[processor].process(value, key, options, translator);\n });\n return value;\n }\n};\n\nvar checkedLoadedFor = {};\n\nvar Translator = function (_EventEmitter) {\n _inherits(Translator, _EventEmitter);\n\n function Translator(services) {\n var _this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Translator);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Translator).call(this));\n\n if (isIE10) {\n EventEmitter.call(_assertThisInitialized(_this));\n }\n\n copy(['resourceStore', 'languageUtils', 'pluralResolver', 'interpolator', 'backendConnector', 'i18nFormat', 'utils'], services, _assertThisInitialized(_this));\n _this.options = options;\n\n if (_this.options.keySeparator === undefined) {\n _this.options.keySeparator = '.';\n }\n\n _this.logger = baseLogger.create('translator');\n return _this;\n }\n\n _createClass(Translator, [{\n key: \"changeLanguage\",\n value: function changeLanguage(lng) {\n if (lng) this.language = lng;\n }\n }, {\n key: \"exists\",\n value: function exists(key) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {\n interpolation: {}\n };\n var resolved = this.resolve(key, options);\n return resolved && resolved.res !== undefined;\n }\n }, {\n key: \"extractFromKey\",\n value: function extractFromKey(key, options) {\n var nsSeparator = options.nsSeparator !== undefined ? options.nsSeparator : this.options.nsSeparator;\n if (nsSeparator === undefined) nsSeparator = ':';\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n var namespaces = options.ns || this.options.defaultNS;\n\n if (nsSeparator && key.indexOf(nsSeparator) > -1) {\n var m = key.match(this.interpolator.nestingRegexp);\n\n if (m && m.length > 0) {\n return {\n key: key,\n namespaces: namespaces\n };\n }\n\n var parts = key.split(nsSeparator);\n if (nsSeparator !== keySeparator || nsSeparator === keySeparator && this.options.ns.indexOf(parts[0]) > -1) namespaces = parts.shift();\n key = parts.join(keySeparator);\n }\n\n if (typeof namespaces === 'string') namespaces = [namespaces];\n return {\n key: key,\n namespaces: namespaces\n };\n }\n }, {\n key: \"translate\",\n value: function translate(keys, options, lastKey) {\n var _this2 = this;\n\n if (_typeof(options) !== 'object' && this.options.overloadTranslationOptionHandler) {\n options = this.options.overloadTranslationOptionHandler(arguments);\n }\n\n if (!options) options = {};\n if (keys === undefined || keys === null) return '';\n if (!Array.isArray(keys)) keys = [String(keys)];\n var keySeparator = options.keySeparator !== undefined ? options.keySeparator : this.options.keySeparator;\n\n var _this$extractFromKey = this.extractFromKey(keys[keys.length - 1], options),\n key = _this$extractFromKey.key,\n namespaces = _this$extractFromKey.namespaces;\n\n var namespace = namespaces[namespaces.length - 1];\n var lng = options.lng || this.language;\n var appendNamespaceToCIMode = options.appendNamespaceToCIMode || this.options.appendNamespaceToCIMode;\n\n if (lng && lng.toLowerCase() === 'cimode') {\n if (appendNamespaceToCIMode) {\n var nsSeparator = options.nsSeparator || this.options.nsSeparator;\n return namespace + nsSeparator + key;\n }\n\n return key;\n }\n\n var resolved = this.resolve(keys, options);\n var res = resolved && resolved.res;\n var resUsedKey = resolved && resolved.usedKey || key;\n var resExactUsedKey = resolved && resolved.exactUsedKey || key;\n var resType = Object.prototype.toString.apply(res);\n var noObject = ['[object Number]', '[object Function]', '[object RegExp]'];\n var joinArrays = options.joinArrays !== undefined ? options.joinArrays : this.options.joinArrays;\n var handleAsObjectInI18nFormat = !this.i18nFormat || this.i18nFormat.handleAsObject;\n var handleAsObject = typeof res !== 'string' && typeof res !== 'boolean' && typeof res !== 'number';\n\n if (handleAsObjectInI18nFormat && res && handleAsObject && noObject.indexOf(resType) < 0 && !(typeof joinArrays === 'string' && resType === '[object Array]')) {\n if (!options.returnObjects && !this.options.returnObjects) {\n this.logger.warn('accessing an object - but returnObjects options is not enabled!');\n return this.options.returnedObjectHandler ? this.options.returnedObjectHandler(resUsedKey, res, options) : \"key '\".concat(key, \" (\").concat(this.language, \")' returned an object instead of string.\");\n }\n\n if (keySeparator) {\n var resTypeIsArray = resType === '[object Array]';\n var copy = resTypeIsArray ? [] : {};\n var newKeyToUse = resTypeIsArray ? resExactUsedKey : resUsedKey;\n\n for (var m in res) {\n if (Object.prototype.hasOwnProperty.call(res, m)) {\n var deepKey = \"\".concat(newKeyToUse).concat(keySeparator).concat(m);\n copy[m] = this.translate(deepKey, _objectSpread({}, options, {\n joinArrays: false,\n ns: namespaces\n }));\n if (copy[m] === deepKey) copy[m] = res[m];\n }\n }\n\n res = copy;\n }\n } else if (handleAsObjectInI18nFormat && typeof joinArrays === 'string' && resType === '[object Array]') {\n res = res.join(joinArrays);\n if (res) res = this.extendTranslation(res, keys, options, lastKey);\n } else {\n var usedDefault = false;\n var usedKey = false;\n var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';\n var hasDefaultValue = Translator.hasDefaultValue(options);\n var defaultValueSuffix = needsPluralHandling ? this.pluralResolver.getSuffix(lng, options.count) : '';\n var defaultValue = options[\"defaultValue\".concat(defaultValueSuffix)] || options.defaultValue;\n\n if (!this.isValidLookup(res) && hasDefaultValue) {\n usedDefault = true;\n res = defaultValue;\n }\n\n if (!this.isValidLookup(res)) {\n usedKey = true;\n res = key;\n }\n\n var updateMissing = hasDefaultValue && defaultValue !== res && this.options.updateMissing;\n\n if (usedKey || usedDefault || updateMissing) {\n this.logger.log(updateMissing ? 'updateKey' : 'missingKey', lng, namespace, key, updateMissing ? defaultValue : res);\n\n if (keySeparator) {\n var fk = this.resolve(key, _objectSpread({}, options, {\n keySeparator: false\n }));\n if (fk && fk.res) this.logger.warn('Seems the loaded translations were in flat JSON format instead of nested. Either set keySeparator: false on init or make sure your translations are published in nested format.');\n }\n\n var lngs = [];\n var fallbackLngs = this.languageUtils.getFallbackCodes(this.options.fallbackLng, options.lng || this.language);\n\n if (this.options.saveMissingTo === 'fallback' && fallbackLngs && fallbackLngs[0]) {\n for (var i = 0; i < fallbackLngs.length; i++) {\n lngs.push(fallbackLngs[i]);\n }\n } else if (this.options.saveMissingTo === 'all') {\n lngs = this.languageUtils.toResolveHierarchy(options.lng || this.language);\n } else {\n lngs.push(options.lng || this.language);\n }\n\n var send = function send(l, k, fallbackValue) {\n if (_this2.options.missingKeyHandler) {\n _this2.options.missingKeyHandler(l, namespace, k, updateMissing ? fallbackValue : res, updateMissing, options);\n } else if (_this2.backendConnector && _this2.backendConnector.saveMissing) {\n _this2.backendConnector.saveMissing(l, namespace, k, updateMissing ? fallbackValue : res, updateMissing, options);\n }\n\n _this2.emit('missingKey', l, namespace, k, res);\n };\n\n if (this.options.saveMissing) {\n if (this.options.saveMissingPlurals && needsPluralHandling) {\n lngs.forEach(function (language) {\n _this2.pluralResolver.getSuffixes(language).forEach(function (suffix) {\n send([language], key + suffix, options[\"defaultValue\".concat(suffix)] || defaultValue);\n });\n });\n } else {\n send(lngs, key, defaultValue);\n }\n }\n }\n\n res = this.extendTranslation(res, keys, options, resolved, lastKey);\n if (usedKey && res === key && this.options.appendNamespaceToMissingKey) res = \"\".concat(namespace, \":\").concat(key);\n if (usedKey && this.options.parseMissingKeyHandler) res = this.options.parseMissingKeyHandler(res);\n }\n\n return res;\n }\n }, {\n key: \"extendTranslation\",\n value: function extendTranslation(res, key, options, resolved, lastKey) {\n var _this3 = this;\n\n if (this.i18nFormat && this.i18nFormat.parse) {\n res = this.i18nFormat.parse(res, options, resolved.usedLng, resolved.usedNS, resolved.usedKey, {\n resolved: resolved\n });\n } else if (!options.skipInterpolation) {\n if (options.interpolation) this.interpolator.init(_objectSpread({}, options, {\n interpolation: _objectSpread({}, this.options.interpolation, options.interpolation)\n }));\n var skipOnVariables = options.interpolation && options.interpolation.skipOnVariables || this.options.interpolation.skipOnVariables;\n var nestBef;\n\n if (skipOnVariables) {\n var nb = res.match(this.interpolator.nestingRegexp);\n nestBef = nb && nb.length;\n }\n\n var data = options.replace && typeof options.replace !== 'string' ? options.replace : options;\n if (this.options.interpolation.defaultVariables) data = _objectSpread({}, this.options.interpolation.defaultVariables, data);\n res = this.interpolator.interpolate(res, data, options.lng || this.language, options);\n\n if (skipOnVariables) {\n var na = res.match(this.interpolator.nestingRegexp);\n var nestAft = na && na.length;\n if (nestBef < nestAft) options.nest = false;\n }\n\n if (options.nest !== false) res = this.interpolator.nest(res, function () {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n if (lastKey && lastKey[0] === args[0] && !options.context) {\n _this3.logger.warn(\"It seems you are nesting recursively key: \".concat(args[0], \" in key: \").concat(key[0]));\n\n return null;\n }\n\n return _this3.translate.apply(_this3, args.concat([key]));\n }, options);\n if (options.interpolation) this.interpolator.reset();\n }\n\n var postProcess = options.postProcess || this.options.postProcess;\n var postProcessorNames = typeof postProcess === 'string' ? [postProcess] : postProcess;\n\n if (res !== undefined && res !== null && postProcessorNames && postProcessorNames.length && options.applyPostProcessor !== false) {\n res = postProcessor.handle(postProcessorNames, res, key, this.options && this.options.postProcessPassResolved ? _objectSpread({\n i18nResolved: resolved\n }, options) : options, this);\n }\n\n return res;\n }\n }, {\n key: \"resolve\",\n value: function resolve(keys) {\n var _this4 = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var found;\n var usedKey;\n var exactUsedKey;\n var usedLng;\n var usedNS;\n if (typeof keys === 'string') keys = [keys];\n keys.forEach(function (k) {\n if (_this4.isValidLookup(found)) return;\n\n var extracted = _this4.extractFromKey(k, options);\n\n var key = extracted.key;\n usedKey = key;\n var namespaces = extracted.namespaces;\n if (_this4.options.fallbackNS) namespaces = namespaces.concat(_this4.options.fallbackNS);\n var needsPluralHandling = options.count !== undefined && typeof options.count !== 'string';\n var needsContextHandling = options.context !== undefined && typeof options.context === 'string' && options.context !== '';\n var codes = options.lngs ? options.lngs : _this4.languageUtils.toResolveHierarchy(options.lng || _this4.language, options.fallbackLng);\n namespaces.forEach(function (ns) {\n if (_this4.isValidLookup(found)) return;\n usedNS = ns;\n\n if (!checkedLoadedFor[\"\".concat(codes[0], \"-\").concat(ns)] && _this4.utils && _this4.utils.hasLoadedNamespace && !_this4.utils.hasLoadedNamespace(usedNS)) {\n checkedLoadedFor[\"\".concat(codes[0], \"-\").concat(ns)] = true;\n\n _this4.logger.warn(\"key \\\"\".concat(usedKey, \"\\\" for languages \\\"\").concat(codes.join(', '), \"\\\" won't get resolved as namespace \\\"\").concat(usedNS, \"\\\" was not yet loaded\"), 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');\n }\n\n codes.forEach(function (code) {\n if (_this4.isValidLookup(found)) return;\n usedLng = code;\n var finalKey = key;\n var finalKeys = [finalKey];\n\n if (_this4.i18nFormat && _this4.i18nFormat.addLookupKeys) {\n _this4.i18nFormat.addLookupKeys(finalKeys, key, code, ns, options);\n } else {\n var pluralSuffix;\n if (needsPluralHandling) pluralSuffix = _this4.pluralResolver.getSuffix(code, options.count);\n if (needsPluralHandling && needsContextHandling) finalKeys.push(finalKey + pluralSuffix);\n if (needsContextHandling) finalKeys.push(finalKey += \"\".concat(_this4.options.contextSeparator).concat(options.context));\n if (needsPluralHandling) finalKeys.push(finalKey += pluralSuffix);\n }\n\n var possibleKey;\n\n while (possibleKey = finalKeys.pop()) {\n if (!_this4.isValidLookup(found)) {\n exactUsedKey = possibleKey;\n found = _this4.getResource(code, ns, possibleKey, options);\n }\n }\n });\n });\n });\n return {\n res: found,\n usedKey: usedKey,\n exactUsedKey: exactUsedKey,\n usedLng: usedLng,\n usedNS: usedNS\n };\n }\n }, {\n key: \"isValidLookup\",\n value: function isValidLookup(res) {\n return res !== undefined && !(!this.options.returnNull && res === null) && !(!this.options.returnEmptyString && res === '');\n }\n }, {\n key: \"getResource\",\n value: function getResource(code, ns, key) {\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n if (this.i18nFormat && this.i18nFormat.getResource) return this.i18nFormat.getResource(code, ns, key, options);\n return this.resourceStore.getResource(code, ns, key, options);\n }\n }], [{\n key: \"hasDefaultValue\",\n value: function hasDefaultValue(options) {\n var prefix = 'defaultValue';\n\n for (var option in options) {\n if (Object.prototype.hasOwnProperty.call(options, option) && prefix === option.substring(0, prefix.length) && undefined !== options[option]) {\n return true;\n }\n }\n\n return false;\n }\n }]);\n\n return Translator;\n}(EventEmitter);\n\nfunction capitalize(string) {\n return string.charAt(0).toUpperCase() + string.slice(1);\n}\n\nvar LanguageUtil = function () {\n function LanguageUtil(options) {\n _classCallCheck(this, LanguageUtil);\n\n this.options = options;\n this.whitelist = this.options.supportedLngs || false;\n this.supportedLngs = this.options.supportedLngs || false;\n this.logger = baseLogger.create('languageUtils');\n }\n\n _createClass(LanguageUtil, [{\n key: \"getScriptPartFromCode\",\n value: function getScriptPartFromCode(code) {\n if (!code || code.indexOf('-') < 0) return null;\n var p = code.split('-');\n if (p.length === 2) return null;\n p.pop();\n if (p[p.length - 1].toLowerCase() === 'x') return null;\n return this.formatLanguageCode(p.join('-'));\n }\n }, {\n key: \"getLanguagePartFromCode\",\n value: function getLanguagePartFromCode(code) {\n if (!code || code.indexOf('-') < 0) return code;\n var p = code.split('-');\n return this.formatLanguageCode(p[0]);\n }\n }, {\n key: \"formatLanguageCode\",\n value: function formatLanguageCode(code) {\n if (typeof code === 'string' && code.indexOf('-') > -1) {\n var specialCases = ['hans', 'hant', 'latn', 'cyrl', 'cans', 'mong', 'arab'];\n var p = code.split('-');\n\n if (this.options.lowerCaseLng) {\n p = p.map(function (part) {\n return part.toLowerCase();\n });\n } else if (p.length === 2) {\n p[0] = p[0].toLowerCase();\n p[1] = p[1].toUpperCase();\n if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());\n } else if (p.length === 3) {\n p[0] = p[0].toLowerCase();\n if (p[1].length === 2) p[1] = p[1].toUpperCase();\n if (p[0] !== 'sgn' && p[2].length === 2) p[2] = p[2].toUpperCase();\n if (specialCases.indexOf(p[1].toLowerCase()) > -1) p[1] = capitalize(p[1].toLowerCase());\n if (specialCases.indexOf(p[2].toLowerCase()) > -1) p[2] = capitalize(p[2].toLowerCase());\n }\n\n return p.join('-');\n }\n\n return this.options.cleanCode || this.options.lowerCaseLng ? code.toLowerCase() : code;\n }\n }, {\n key: \"isWhitelisted\",\n value: function isWhitelisted(code) {\n this.logger.deprecate('languageUtils.isWhitelisted', 'function \"isWhitelisted\" will be renamed to \"isSupportedCode\" in the next major - please make sure to rename it\\'s usage asap.');\n return this.isSupportedCode(code);\n }\n }, {\n key: \"isSupportedCode\",\n value: function isSupportedCode(code) {\n if (this.options.load === 'languageOnly' || this.options.nonExplicitSupportedLngs) {\n code = this.getLanguagePartFromCode(code);\n }\n\n return !this.supportedLngs || !this.supportedLngs.length || this.supportedLngs.indexOf(code) > -1;\n }\n }, {\n key: \"getBestMatchFromCodes\",\n value: function getBestMatchFromCodes(codes) {\n var _this = this;\n\n if (!codes) return null;\n var found;\n codes.forEach(function (code) {\n if (found) return;\n\n var cleanedLng = _this.formatLanguageCode(code);\n\n if (!_this.options.supportedLngs || _this.isSupportedCode(cleanedLng)) found = cleanedLng;\n });\n\n if (!found && this.options.supportedLngs) {\n codes.forEach(function (code) {\n if (found) return;\n\n var lngOnly = _this.getLanguagePartFromCode(code);\n\n if (_this.isSupportedCode(lngOnly)) return found = lngOnly;\n found = _this.options.supportedLngs.find(function (supportedLng) {\n if (supportedLng.indexOf(lngOnly) === 0) return supportedLng;\n });\n });\n }\n\n if (!found) found = this.getFallbackCodes(this.options.fallbackLng)[0];\n return found;\n }\n }, {\n key: \"getFallbackCodes\",\n value: function getFallbackCodes(fallbacks, code) {\n if (!fallbacks) return [];\n if (typeof fallbacks === 'function') fallbacks = fallbacks(code);\n if (typeof fallbacks === 'string') fallbacks = [fallbacks];\n if (Object.prototype.toString.apply(fallbacks) === '[object Array]') return fallbacks;\n if (!code) return fallbacks[\"default\"] || [];\n var found = fallbacks[code];\n if (!found) found = fallbacks[this.getScriptPartFromCode(code)];\n if (!found) found = fallbacks[this.formatLanguageCode(code)];\n if (!found) found = fallbacks[this.getLanguagePartFromCode(code)];\n if (!found) found = fallbacks[\"default\"];\n return found || [];\n }\n }, {\n key: \"toResolveHierarchy\",\n value: function toResolveHierarchy(code, fallbackCode) {\n var _this2 = this;\n\n var fallbackCodes = this.getFallbackCodes(fallbackCode || this.options.fallbackLng || [], code);\n var codes = [];\n\n var addCode = function addCode(c) {\n if (!c) return;\n\n if (_this2.isSupportedCode(c)) {\n codes.push(c);\n } else {\n _this2.logger.warn(\"rejecting language code not found in supportedLngs: \".concat(c));\n }\n };\n\n if (typeof code === 'string' && code.indexOf('-') > -1) {\n if (this.options.load !== 'languageOnly') addCode(this.formatLanguageCode(code));\n if (this.options.load !== 'languageOnly' && this.options.load !== 'currentOnly') addCode(this.getScriptPartFromCode(code));\n if (this.options.load !== 'currentOnly') addCode(this.getLanguagePartFromCode(code));\n } else if (typeof code === 'string') {\n addCode(this.formatLanguageCode(code));\n }\n\n fallbackCodes.forEach(function (fc) {\n if (codes.indexOf(fc) < 0) addCode(_this2.formatLanguageCode(fc));\n });\n return codes;\n }\n }]);\n\n return LanguageUtil;\n}();\n\nvar sets = [{\n lngs: ['ach', 'ak', 'am', 'arn', 'br', 'fil', 'gun', 'ln', 'mfe', 'mg', 'mi', 'oc', 'pt', 'pt-BR', 'tg', 'tl', 'ti', 'tr', 'uz', 'wa'],\n nr: [1, 2],\n fc: 1\n}, {\n lngs: ['af', 'an', 'ast', 'az', 'bg', 'bn', 'ca', 'da', 'de', 'dev', 'el', 'en', 'eo', 'es', 'et', 'eu', 'fi', 'fo', 'fur', 'fy', 'gl', 'gu', 'ha', 'hi', 'hu', 'hy', 'ia', 'it', 'kn', 'ku', 'lb', 'mai', 'ml', 'mn', 'mr', 'nah', 'nap', 'nb', 'ne', 'nl', 'nn', 'no', 'nso', 'pa', 'pap', 'pms', 'ps', 'pt-PT', 'rm', 'sco', 'se', 'si', 'so', 'son', 'sq', 'sv', 'sw', 'ta', 'te', 'tk', 'ur', 'yo'],\n nr: [1, 2],\n fc: 2\n}, {\n lngs: ['ay', 'bo', 'cgg', 'fa', 'ht', 'id', 'ja', 'jbo', 'ka', 'kk', 'km', 'ko', 'ky', 'lo', 'ms', 'sah', 'su', 'th', 'tt', 'ug', 'vi', 'wo', 'zh'],\n nr: [1],\n fc: 3\n}, {\n lngs: ['be', 'bs', 'cnr', 'dz', 'hr', 'ru', 'sr', 'uk'],\n nr: [1, 2, 5],\n fc: 4\n}, {\n lngs: ['ar'],\n nr: [0, 1, 2, 3, 11, 100],\n fc: 5\n}, {\n lngs: ['cs', 'sk'],\n nr: [1, 2, 5],\n fc: 6\n}, {\n lngs: ['csb', 'pl'],\n nr: [1, 2, 5],\n fc: 7\n}, {\n lngs: ['cy'],\n nr: [1, 2, 3, 8],\n fc: 8\n}, {\n lngs: ['fr'],\n nr: [1, 2],\n fc: 9\n}, {\n lngs: ['ga'],\n nr: [1, 2, 3, 7, 11],\n fc: 10\n}, {\n lngs: ['gd'],\n nr: [1, 2, 3, 20],\n fc: 11\n}, {\n lngs: ['is'],\n nr: [1, 2],\n fc: 12\n}, {\n lngs: ['jv'],\n nr: [0, 1],\n fc: 13\n}, {\n lngs: ['kw'],\n nr: [1, 2, 3, 4],\n fc: 14\n}, {\n lngs: ['lt'],\n nr: [1, 2, 10],\n fc: 15\n}, {\n lngs: ['lv'],\n nr: [1, 2, 0],\n fc: 16\n}, {\n lngs: ['mk'],\n nr: [1, 2],\n fc: 17\n}, {\n lngs: ['mnk'],\n nr: [0, 1, 2],\n fc: 18\n}, {\n lngs: ['mt'],\n nr: [1, 2, 11, 20],\n fc: 19\n}, {\n lngs: ['or'],\n nr: [2, 1],\n fc: 2\n}, {\n lngs: ['ro'],\n nr: [1, 2, 20],\n fc: 20\n}, {\n lngs: ['sl'],\n nr: [5, 1, 2, 3],\n fc: 21\n}, {\n lngs: ['he', 'iw'],\n nr: [1, 2, 20, 21],\n fc: 22\n}];\nvar _rulesPluralsTypes = {\n 1: function _(n) {\n return Number(n > 1);\n },\n 2: function _(n) {\n return Number(n != 1);\n },\n 3: function _(n) {\n return 0;\n },\n 4: function _(n) {\n return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n },\n 5: function _(n) {\n return Number(n == 0 ? 0 : n == 1 ? 1 : n == 2 ? 2 : n % 100 >= 3 && n % 100 <= 10 ? 3 : n % 100 >= 11 ? 4 : 5);\n },\n 6: function _(n) {\n return Number(n == 1 ? 0 : n >= 2 && n <= 4 ? 1 : 2);\n },\n 7: function _(n) {\n return Number(n == 1 ? 0 : n % 10 >= 2 && n % 10 <= 4 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n },\n 8: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : n != 8 && n != 11 ? 2 : 3);\n },\n 9: function _(n) {\n return Number(n >= 2);\n },\n 10: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : n < 7 ? 2 : n < 11 ? 3 : 4);\n },\n 11: function _(n) {\n return Number(n == 1 || n == 11 ? 0 : n == 2 || n == 12 ? 1 : n > 2 && n < 20 ? 2 : 3);\n },\n 12: function _(n) {\n return Number(n % 10 != 1 || n % 100 == 11);\n },\n 13: function _(n) {\n return Number(n !== 0);\n },\n 14: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : n == 3 ? 2 : 3);\n },\n 15: function _(n) {\n return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n % 10 >= 2 && (n % 100 < 10 || n % 100 >= 20) ? 1 : 2);\n },\n 16: function _(n) {\n return Number(n % 10 == 1 && n % 100 != 11 ? 0 : n !== 0 ? 1 : 2);\n },\n 17: function _(n) {\n return Number(n == 1 || n % 10 == 1 && n % 100 != 11 ? 0 : 1);\n },\n 18: function _(n) {\n return Number(n == 0 ? 0 : n == 1 ? 1 : 2);\n },\n 19: function _(n) {\n return Number(n == 1 ? 0 : n == 0 || n % 100 > 1 && n % 100 < 11 ? 1 : n % 100 > 10 && n % 100 < 20 ? 2 : 3);\n },\n 20: function _(n) {\n return Number(n == 1 ? 0 : n == 0 || n % 100 > 0 && n % 100 < 20 ? 1 : 2);\n },\n 21: function _(n) {\n return Number(n % 100 == 1 ? 1 : n % 100 == 2 ? 2 : n % 100 == 3 || n % 100 == 4 ? 3 : 0);\n },\n 22: function _(n) {\n return Number(n == 1 ? 0 : n == 2 ? 1 : (n < 0 || n > 10) && n % 10 == 0 ? 2 : 3);\n }\n};\n\nfunction createRules() {\n var rules = {};\n sets.forEach(function (set) {\n set.lngs.forEach(function (l) {\n rules[l] = {\n numbers: set.nr,\n plurals: _rulesPluralsTypes[set.fc]\n };\n });\n });\n return rules;\n}\n\nvar PluralResolver = function () {\n function PluralResolver(languageUtils) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, PluralResolver);\n\n this.languageUtils = languageUtils;\n this.options = options;\n this.logger = baseLogger.create('pluralResolver');\n this.rules = createRules();\n }\n\n _createClass(PluralResolver, [{\n key: \"addRule\",\n value: function addRule(lng, obj) {\n this.rules[lng] = obj;\n }\n }, {\n key: \"getRule\",\n value: function getRule(code) {\n return this.rules[code] || this.rules[this.languageUtils.getLanguagePartFromCode(code)];\n }\n }, {\n key: \"needsPlural\",\n value: function needsPlural(code) {\n var rule = this.getRule(code);\n return rule && rule.numbers.length > 1;\n }\n }, {\n key: \"getPluralFormsOfKey\",\n value: function getPluralFormsOfKey(code, key) {\n return this.getSuffixes(code).map(function (suffix) {\n return key + suffix;\n });\n }\n }, {\n key: \"getSuffixes\",\n value: function getSuffixes(code) {\n var _this = this;\n\n var rule = this.getRule(code);\n\n if (!rule) {\n return [];\n }\n\n return rule.numbers.map(function (number) {\n return _this.getSuffix(code, number);\n });\n }\n }, {\n key: \"getSuffix\",\n value: function getSuffix(code, count) {\n var _this2 = this;\n\n var rule = this.getRule(code);\n\n if (rule) {\n var idx = rule.noAbs ? rule.plurals(count) : rule.plurals(Math.abs(count));\n var suffix = rule.numbers[idx];\n\n if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {\n if (suffix === 2) {\n suffix = 'plural';\n } else if (suffix === 1) {\n suffix = '';\n }\n }\n\n var returnSuffix = function returnSuffix() {\n return _this2.options.prepend && suffix.toString() ? _this2.options.prepend + suffix.toString() : suffix.toString();\n };\n\n if (this.options.compatibilityJSON === 'v1') {\n if (suffix === 1) return '';\n if (typeof suffix === 'number') return \"_plural_\".concat(suffix.toString());\n return returnSuffix();\n } else if (this.options.compatibilityJSON === 'v2') {\n return returnSuffix();\n } else if (this.options.simplifyPluralSuffix && rule.numbers.length === 2 && rule.numbers[0] === 1) {\n return returnSuffix();\n }\n\n return this.options.prepend && idx.toString() ? this.options.prepend + idx.toString() : idx.toString();\n }\n\n this.logger.warn(\"no plural rule found for: \".concat(code));\n return '';\n }\n }]);\n\n return PluralResolver;\n}();\n\nvar Interpolator = function () {\n function Interpolator() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Interpolator);\n\n this.logger = baseLogger.create('interpolator');\n this.options = options;\n\n this.format = options.interpolation && options.interpolation.format || function (value) {\n return value;\n };\n\n this.init(options);\n }\n\n _createClass(Interpolator, [{\n key: \"init\",\n value: function init() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n if (!options.interpolation) options.interpolation = {\n escapeValue: true\n };\n var iOpts = options.interpolation;\n this.escape = iOpts.escape !== undefined ? iOpts.escape : escape;\n this.escapeValue = iOpts.escapeValue !== undefined ? iOpts.escapeValue : true;\n this.useRawValueToEscape = iOpts.useRawValueToEscape !== undefined ? iOpts.useRawValueToEscape : false;\n this.prefix = iOpts.prefix ? regexEscape(iOpts.prefix) : iOpts.prefixEscaped || '{{';\n this.suffix = iOpts.suffix ? regexEscape(iOpts.suffix) : iOpts.suffixEscaped || '}}';\n this.formatSeparator = iOpts.formatSeparator ? iOpts.formatSeparator : iOpts.formatSeparator || ',';\n this.unescapePrefix = iOpts.unescapeSuffix ? '' : iOpts.unescapePrefix || '-';\n this.unescapeSuffix = this.unescapePrefix ? '' : iOpts.unescapeSuffix || '';\n this.nestingPrefix = iOpts.nestingPrefix ? regexEscape(iOpts.nestingPrefix) : iOpts.nestingPrefixEscaped || regexEscape('$t(');\n this.nestingSuffix = iOpts.nestingSuffix ? regexEscape(iOpts.nestingSuffix) : iOpts.nestingSuffixEscaped || regexEscape(')');\n this.nestingOptionsSeparator = iOpts.nestingOptionsSeparator ? iOpts.nestingOptionsSeparator : iOpts.nestingOptionsSeparator || ',';\n this.maxReplaces = iOpts.maxReplaces ? iOpts.maxReplaces : 1000;\n this.alwaysFormat = iOpts.alwaysFormat !== undefined ? iOpts.alwaysFormat : false;\n this.resetRegExp();\n }\n }, {\n key: \"reset\",\n value: function reset() {\n if (this.options) this.init(this.options);\n }\n }, {\n key: \"resetRegExp\",\n value: function resetRegExp() {\n var regexpStr = \"\".concat(this.prefix, \"(.+?)\").concat(this.suffix);\n this.regexp = new RegExp(regexpStr, 'g');\n var regexpUnescapeStr = \"\".concat(this.prefix).concat(this.unescapePrefix, \"(.+?)\").concat(this.unescapeSuffix).concat(this.suffix);\n this.regexpUnescape = new RegExp(regexpUnescapeStr, 'g');\n var nestingRegexpStr = \"\".concat(this.nestingPrefix, \"(.+?)\").concat(this.nestingSuffix);\n this.nestingRegexp = new RegExp(nestingRegexpStr, 'g');\n }\n }, {\n key: \"interpolate\",\n value: function interpolate(str, data, lng, options) {\n var _this = this;\n\n var match;\n var value;\n var replaces;\n var defaultData = this.options && this.options.interpolation && this.options.interpolation.defaultVariables || {};\n\n function regexSafe(val) {\n return val.replace(/\\$/g, '$$$$');\n }\n\n var handleFormat = function handleFormat(key) {\n if (key.indexOf(_this.formatSeparator) < 0) {\n var path = getPathWithDefaults(data, defaultData, key);\n return _this.alwaysFormat ? _this.format(path, undefined, lng) : path;\n }\n\n var p = key.split(_this.formatSeparator);\n var k = p.shift().trim();\n var f = p.join(_this.formatSeparator).trim();\n return _this.format(getPathWithDefaults(data, defaultData, k), f, lng, options);\n };\n\n this.resetRegExp();\n var missingInterpolationHandler = options && options.missingInterpolationHandler || this.options.missingInterpolationHandler;\n var skipOnVariables = options && options.interpolation && options.interpolation.skipOnVariables || this.options.interpolation.skipOnVariables;\n var todos = [{\n regex: this.regexpUnescape,\n safeValue: function safeValue(val) {\n return regexSafe(val);\n }\n }, {\n regex: this.regexp,\n safeValue: function safeValue(val) {\n return _this.escapeValue ? regexSafe(_this.escape(val)) : regexSafe(val);\n }\n }];\n todos.forEach(function (todo) {\n replaces = 0;\n\n while (match = todo.regex.exec(str)) {\n value = handleFormat(match[1].trim());\n\n if (value === undefined) {\n if (typeof missingInterpolationHandler === 'function') {\n var temp = missingInterpolationHandler(str, match, options);\n value = typeof temp === 'string' ? temp : '';\n } else if (skipOnVariables) {\n value = match[0];\n continue;\n } else {\n _this.logger.warn(\"missed to pass in variable \".concat(match[1], \" for interpolating \").concat(str));\n\n value = '';\n }\n } else if (typeof value !== 'string' && !_this.useRawValueToEscape) {\n value = makeString(value);\n }\n\n str = str.replace(match[0], todo.safeValue(value));\n todo.regex.lastIndex = 0;\n replaces++;\n\n if (replaces >= _this.maxReplaces) {\n break;\n }\n }\n });\n return str;\n }\n }, {\n key: \"nest\",\n value: function nest(str, fc) {\n var _this2 = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var match;\n var value;\n\n var clonedOptions = _objectSpread({}, options);\n\n clonedOptions.applyPostProcessor = false;\n delete clonedOptions.defaultValue;\n\n function handleHasOptions(key, inheritedOptions) {\n var sep = this.nestingOptionsSeparator;\n if (key.indexOf(sep) < 0) return key;\n var c = key.split(new RegExp(\"\".concat(sep, \"[ ]*{\")));\n var optionsString = \"{\".concat(c[1]);\n key = c[0];\n optionsString = this.interpolate(optionsString, clonedOptions);\n optionsString = optionsString.replace(/'/g, '\"');\n\n try {\n clonedOptions = JSON.parse(optionsString);\n if (inheritedOptions) clonedOptions = _objectSpread({}, inheritedOptions, clonedOptions);\n } catch (e) {\n this.logger.warn(\"failed parsing options string in nesting for key \".concat(key), e);\n return \"\".concat(key).concat(sep).concat(optionsString);\n }\n\n delete clonedOptions.defaultValue;\n return key;\n }\n\n while (match = this.nestingRegexp.exec(str)) {\n var formatters = [];\n var doReduce = false;\n\n if (match[0].includes(this.formatSeparator) && !/{.*}/.test(match[1])) {\n var r = match[1].split(this.formatSeparator).map(function (elem) {\n return elem.trim();\n });\n match[1] = r.shift();\n formatters = r;\n doReduce = true;\n }\n\n value = fc(handleHasOptions.call(this, match[1].trim(), clonedOptions), clonedOptions);\n if (value && match[0] === str && typeof value !== 'string') return value;\n if (typeof value !== 'string') value = makeString(value);\n\n if (!value) {\n this.logger.warn(\"missed to resolve \".concat(match[1], \" for nesting \").concat(str));\n value = '';\n }\n\n if (doReduce) {\n value = formatters.reduce(function (v, f) {\n return _this2.format(v, f, options.lng, options);\n }, value.trim());\n }\n\n str = str.replace(match[0], value);\n this.regexp.lastIndex = 0;\n }\n\n return str;\n }\n }]);\n\n return Interpolator;\n}();\n\nfunction remove(arr, what) {\n var found = arr.indexOf(what);\n\n while (found !== -1) {\n arr.splice(found, 1);\n found = arr.indexOf(what);\n }\n}\n\nvar Connector = function (_EventEmitter) {\n _inherits(Connector, _EventEmitter);\n\n function Connector(backend, store, services) {\n var _this;\n\n var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};\n\n _classCallCheck(this, Connector);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(Connector).call(this));\n\n if (isIE10) {\n EventEmitter.call(_assertThisInitialized(_this));\n }\n\n _this.backend = backend;\n _this.store = store;\n _this.services = services;\n _this.languageUtils = services.languageUtils;\n _this.options = options;\n _this.logger = baseLogger.create('backendConnector');\n _this.state = {};\n _this.queue = [];\n\n if (_this.backend && _this.backend.init) {\n _this.backend.init(services, options.backend, options);\n }\n\n return _this;\n }\n\n _createClass(Connector, [{\n key: \"queueLoad\",\n value: function queueLoad(languages, namespaces, options, callback) {\n var _this2 = this;\n\n var toLoad = [];\n var pending = [];\n var toLoadLanguages = [];\n var toLoadNamespaces = [];\n languages.forEach(function (lng) {\n var hasAllNamespaces = true;\n namespaces.forEach(function (ns) {\n var name = \"\".concat(lng, \"|\").concat(ns);\n\n if (!options.reload && _this2.store.hasResourceBundle(lng, ns)) {\n _this2.state[name] = 2;\n } else if (_this2.state[name] < 0) ; else if (_this2.state[name] === 1) {\n if (pending.indexOf(name) < 0) pending.push(name);\n } else {\n _this2.state[name] = 1;\n hasAllNamespaces = false;\n if (pending.indexOf(name) < 0) pending.push(name);\n if (toLoad.indexOf(name) < 0) toLoad.push(name);\n if (toLoadNamespaces.indexOf(ns) < 0) toLoadNamespaces.push(ns);\n }\n });\n if (!hasAllNamespaces) toLoadLanguages.push(lng);\n });\n\n if (toLoad.length || pending.length) {\n this.queue.push({\n pending: pending,\n loaded: {},\n errors: [],\n callback: callback\n });\n }\n\n return {\n toLoad: toLoad,\n pending: pending,\n toLoadLanguages: toLoadLanguages,\n toLoadNamespaces: toLoadNamespaces\n };\n }\n }, {\n key: \"loaded\",\n value: function loaded(name, err, data) {\n var s = name.split('|');\n var lng = s[0];\n var ns = s[1];\n if (err) this.emit('failedLoading', lng, ns, err);\n\n if (data) {\n this.store.addResourceBundle(lng, ns, data);\n }\n\n this.state[name] = err ? -1 : 2;\n var loaded = {};\n this.queue.forEach(function (q) {\n pushPath(q.loaded, [lng], ns);\n remove(q.pending, name);\n if (err) q.errors.push(err);\n\n if (q.pending.length === 0 && !q.done) {\n Object.keys(q.loaded).forEach(function (l) {\n if (!loaded[l]) loaded[l] = [];\n\n if (q.loaded[l].length) {\n q.loaded[l].forEach(function (ns) {\n if (loaded[l].indexOf(ns) < 0) loaded[l].push(ns);\n });\n }\n });\n q.done = true;\n\n if (q.errors.length) {\n q.callback(q.errors);\n } else {\n q.callback();\n }\n }\n });\n this.emit('loaded', loaded);\n this.queue = this.queue.filter(function (q) {\n return !q.done;\n });\n }\n }, {\n key: \"read\",\n value: function read(lng, ns, fcName) {\n var _this3 = this;\n\n var tried = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 0;\n var wait = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 350;\n var callback = arguments.length > 5 ? arguments[5] : undefined;\n if (!lng.length) return callback(null, {});\n return this.backend[fcName](lng, ns, function (err, data) {\n if (err && data && tried < 5) {\n setTimeout(function () {\n _this3.read.call(_this3, lng, ns, fcName, tried + 1, wait * 2, callback);\n }, wait);\n return;\n }\n\n callback(err, data);\n });\n }\n }, {\n key: \"prepareLoading\",\n value: function prepareLoading(languages, namespaces) {\n var _this4 = this;\n\n var options = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n var callback = arguments.length > 3 ? arguments[3] : undefined;\n\n if (!this.backend) {\n this.logger.warn('No backend was added via i18next.use. Will not load resources.');\n return callback && callback();\n }\n\n if (typeof languages === 'string') languages = this.languageUtils.toResolveHierarchy(languages);\n if (typeof namespaces === 'string') namespaces = [namespaces];\n var toLoad = this.queueLoad(languages, namespaces, options, callback);\n\n if (!toLoad.toLoad.length) {\n if (!toLoad.pending.length) callback();\n return null;\n }\n\n toLoad.toLoad.forEach(function (name) {\n _this4.loadOne(name);\n });\n }\n }, {\n key: \"load\",\n value: function load(languages, namespaces, callback) {\n this.prepareLoading(languages, namespaces, {}, callback);\n }\n }, {\n key: \"reload\",\n value: function reload(languages, namespaces, callback) {\n this.prepareLoading(languages, namespaces, {\n reload: true\n }, callback);\n }\n }, {\n key: \"loadOne\",\n value: function loadOne(name) {\n var _this5 = this;\n\n var prefix = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';\n var s = name.split('|');\n var lng = s[0];\n var ns = s[1];\n this.read(lng, ns, 'read', undefined, undefined, function (err, data) {\n if (err) _this5.logger.warn(\"\".concat(prefix, \"loading namespace \").concat(ns, \" for language \").concat(lng, \" failed\"), err);\n if (!err && data) _this5.logger.log(\"\".concat(prefix, \"loaded namespace \").concat(ns, \" for language \").concat(lng), data);\n\n _this5.loaded(name, err, data);\n });\n }\n }, {\n key: \"saveMissing\",\n value: function saveMissing(languages, namespace, key, fallbackValue, isUpdate) {\n var options = arguments.length > 5 && arguments[5] !== undefined ? arguments[5] : {};\n\n if (this.services.utils && this.services.utils.hasLoadedNamespace && !this.services.utils.hasLoadedNamespace(namespace)) {\n this.logger.warn(\"did not save key \\\"\".concat(key, \"\\\" as the namespace \\\"\").concat(namespace, \"\\\" was not yet loaded\"), 'This means something IS WRONG in your setup. You access the t function before i18next.init / i18next.loadNamespace / i18next.changeLanguage was done. Wait for the callback or Promise to resolve before accessing it!!!');\n return;\n }\n\n if (key === undefined || key === null || key === '') return;\n\n if (this.backend && this.backend.create) {\n this.backend.create(languages, namespace, key, fallbackValue, null, _objectSpread({}, options, {\n isUpdate: isUpdate\n }));\n }\n\n if (!languages || !languages[0]) return;\n this.store.addResource(languages[0], namespace, key, fallbackValue);\n }\n }]);\n\n return Connector;\n}(EventEmitter);\n\nfunction get() {\n return {\n debug: false,\n initImmediate: true,\n ns: ['translation'],\n defaultNS: ['translation'],\n fallbackLng: ['dev'],\n fallbackNS: false,\n whitelist: false,\n nonExplicitWhitelist: false,\n supportedLngs: false,\n nonExplicitSupportedLngs: false,\n load: 'all',\n preload: false,\n simplifyPluralSuffix: true,\n keySeparator: '.',\n nsSeparator: ':',\n pluralSeparator: '_',\n contextSeparator: '_',\n partialBundledLanguages: false,\n saveMissing: false,\n updateMissing: false,\n saveMissingTo: 'fallback',\n saveMissingPlurals: true,\n missingKeyHandler: false,\n missingInterpolationHandler: false,\n postProcess: false,\n postProcessPassResolved: false,\n returnNull: true,\n returnEmptyString: true,\n returnObjects: false,\n joinArrays: false,\n returnedObjectHandler: false,\n parseMissingKeyHandler: false,\n appendNamespaceToMissingKey: false,\n appendNamespaceToCIMode: false,\n overloadTranslationOptionHandler: function handle(args) {\n var ret = {};\n if (_typeof(args[1]) === 'object') ret = args[1];\n if (typeof args[1] === 'string') ret.defaultValue = args[1];\n if (typeof args[2] === 'string') ret.tDescription = args[2];\n\n if (_typeof(args[2]) === 'object' || _typeof(args[3]) === 'object') {\n var options = args[3] || args[2];\n Object.keys(options).forEach(function (key) {\n ret[key] = options[key];\n });\n }\n\n return ret;\n },\n interpolation: {\n escapeValue: true,\n format: function format(value, _format, lng, options) {\n return value;\n },\n prefix: '{{',\n suffix: '}}',\n formatSeparator: ',',\n unescapePrefix: '-',\n nestingPrefix: '$t(',\n nestingSuffix: ')',\n nestingOptionsSeparator: ',',\n maxReplaces: 1000,\n skipOnVariables: false\n }\n };\n}\nfunction transformOptions(options) {\n if (typeof options.ns === 'string') options.ns = [options.ns];\n if (typeof options.fallbackLng === 'string') options.fallbackLng = [options.fallbackLng];\n if (typeof options.fallbackNS === 'string') options.fallbackNS = [options.fallbackNS];\n\n if (options.whitelist) {\n if (options.whitelist && options.whitelist.indexOf('cimode') < 0) {\n options.whitelist = options.whitelist.concat(['cimode']);\n }\n\n options.supportedLngs = options.whitelist;\n }\n\n if (options.nonExplicitWhitelist) {\n options.nonExplicitSupportedLngs = options.nonExplicitWhitelist;\n }\n\n if (options.supportedLngs && options.supportedLngs.indexOf('cimode') < 0) {\n options.supportedLngs = options.supportedLngs.concat(['cimode']);\n }\n\n return options;\n}\n\nfunction noop() {}\n\nvar I18n = function (_EventEmitter) {\n _inherits(I18n, _EventEmitter);\n\n function I18n() {\n var _this;\n\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 ? arguments[1] : undefined;\n\n _classCallCheck(this, I18n);\n\n _this = _possibleConstructorReturn(this, _getPrototypeOf(I18n).call(this));\n\n if (isIE10) {\n EventEmitter.call(_assertThisInitialized(_this));\n }\n\n _this.options = transformOptions(options);\n _this.services = {};\n _this.logger = baseLogger;\n _this.modules = {\n external: []\n };\n\n if (callback && !_this.isInitialized && !options.isClone) {\n if (!_this.options.initImmediate) {\n _this.init(options, callback);\n\n return _possibleConstructorReturn(_this, _assertThisInitialized(_this));\n }\n\n setTimeout(function () {\n _this.init(options, callback);\n }, 0);\n }\n\n return _this;\n }\n\n _createClass(I18n, [{\n key: \"init\",\n value: function init() {\n var _this2 = this;\n\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 ? arguments[1] : undefined;\n\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n\n if (options.whitelist && !options.supportedLngs) {\n this.logger.deprecate('whitelist', 'option \"whitelist\" will be renamed to \"supportedLngs\" in the next major - please make sure to rename this option asap.');\n }\n\n if (options.nonExplicitWhitelist && !options.nonExplicitSupportedLngs) {\n this.logger.deprecate('whitelist', 'options \"nonExplicitWhitelist\" will be renamed to \"nonExplicitSupportedLngs\" in the next major - please make sure to rename this option asap.');\n }\n\n this.options = _objectSpread({}, get(), this.options, transformOptions(options));\n this.format = this.options.interpolation.format;\n if (!callback) callback = noop;\n\n function createClassOnDemand(ClassOrObject) {\n if (!ClassOrObject) return null;\n if (typeof ClassOrObject === 'function') return new ClassOrObject();\n return ClassOrObject;\n }\n\n if (!this.options.isClone) {\n if (this.modules.logger) {\n baseLogger.init(createClassOnDemand(this.modules.logger), this.options);\n } else {\n baseLogger.init(null, this.options);\n }\n\n var lu = new LanguageUtil(this.options);\n this.store = new ResourceStore(this.options.resources, this.options);\n var s = this.services;\n s.logger = baseLogger;\n s.resourceStore = this.store;\n s.languageUtils = lu;\n s.pluralResolver = new PluralResolver(lu, {\n prepend: this.options.pluralSeparator,\n compatibilityJSON: this.options.compatibilityJSON,\n simplifyPluralSuffix: this.options.simplifyPluralSuffix\n });\n s.interpolator = new Interpolator(this.options);\n s.utils = {\n hasLoadedNamespace: this.hasLoadedNamespace.bind(this)\n };\n s.backendConnector = new Connector(createClassOnDemand(this.modules.backend), s.resourceStore, s, this.options);\n s.backendConnector.on('*', function (event) {\n for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n args[_key - 1] = arguments[_key];\n }\n\n _this2.emit.apply(_this2, [event].concat(args));\n });\n\n if (this.modules.languageDetector) {\n s.languageDetector = createClassOnDemand(this.modules.languageDetector);\n s.languageDetector.init(s, this.options.detection, this.options);\n }\n\n if (this.modules.i18nFormat) {\n s.i18nFormat = createClassOnDemand(this.modules.i18nFormat);\n if (s.i18nFormat.init) s.i18nFormat.init(this);\n }\n\n this.translator = new Translator(this.services, this.options);\n this.translator.on('*', function (event) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n _this2.emit.apply(_this2, [event].concat(args));\n });\n this.modules.external.forEach(function (m) {\n if (m.init) m.init(_this2);\n });\n }\n\n if (this.options.fallbackLng && !this.services.languageDetector && !this.options.lng) {\n var codes = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);\n if (codes.length > 0 && codes[0] !== 'dev') this.options.lng = codes[0];\n }\n\n if (!this.services.languageDetector && !this.options.lng) {\n this.logger.warn('init: no languageDetector is used and no lng is defined');\n }\n\n var storeApi = ['getResource', 'hasResourceBundle', 'getResourceBundle', 'getDataByLanguage'];\n storeApi.forEach(function (fcName) {\n _this2[fcName] = function () {\n var _this2$store;\n\n return (_this2$store = _this2.store)[fcName].apply(_this2$store, arguments);\n };\n });\n var storeApiChained = ['addResource', 'addResources', 'addResourceBundle', 'removeResourceBundle'];\n storeApiChained.forEach(function (fcName) {\n _this2[fcName] = function () {\n var _this2$store2;\n\n (_this2$store2 = _this2.store)[fcName].apply(_this2$store2, arguments);\n\n return _this2;\n };\n });\n var deferred = defer();\n\n var load = function load() {\n var finish = function finish(err, t) {\n if (_this2.isInitialized) _this2.logger.warn('init: i18next is already initialized. You should call init just once!');\n _this2.isInitialized = true;\n if (!_this2.options.isClone) _this2.logger.log('initialized', _this2.options);\n\n _this2.emit('initialized', _this2.options);\n\n deferred.resolve(t);\n callback(err, t);\n };\n\n if (_this2.languages && _this2.options.compatibilityAPI !== 'v1' && !_this2.isInitialized) return finish(null, _this2.t.bind(_this2));\n\n _this2.changeLanguage(_this2.options.lng, finish);\n };\n\n if (this.options.resources || !this.options.initImmediate) {\n load();\n } else {\n setTimeout(load, 0);\n }\n\n return deferred;\n }\n }, {\n key: \"loadResources\",\n value: function loadResources(language) {\n var _this3 = this;\n\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n var usedCallback = callback;\n var usedLng = typeof language === 'string' ? language : this.language;\n if (typeof language === 'function') usedCallback = language;\n\n if (!this.options.resources || this.options.partialBundledLanguages) {\n if (usedLng && usedLng.toLowerCase() === 'cimode') return usedCallback();\n var toLoad = [];\n\n var append = function append(lng) {\n if (!lng) return;\n\n var lngs = _this3.services.languageUtils.toResolveHierarchy(lng);\n\n lngs.forEach(function (l) {\n if (toLoad.indexOf(l) < 0) toLoad.push(l);\n });\n };\n\n if (!usedLng) {\n var fallbacks = this.services.languageUtils.getFallbackCodes(this.options.fallbackLng);\n fallbacks.forEach(function (l) {\n return append(l);\n });\n } else {\n append(usedLng);\n }\n\n if (this.options.preload) {\n this.options.preload.forEach(function (l) {\n return append(l);\n });\n }\n\n this.services.backendConnector.load(toLoad, this.options.ns, usedCallback);\n } else {\n usedCallback(null);\n }\n }\n }, {\n key: \"reloadResources\",\n value: function reloadResources(lngs, ns, callback) {\n var deferred = defer();\n if (!lngs) lngs = this.languages;\n if (!ns) ns = this.options.ns;\n if (!callback) callback = noop;\n this.services.backendConnector.reload(lngs, ns, function (err) {\n deferred.resolve();\n callback(err);\n });\n return deferred;\n }\n }, {\n key: \"use\",\n value: function use(module) {\n if (!module) throw new Error('You are passing an undefined module! Please check the object you are passing to i18next.use()');\n if (!module.type) throw new Error('You are passing a wrong module! Please check the object you are passing to i18next.use()');\n\n if (module.type === 'backend') {\n this.modules.backend = module;\n }\n\n if (module.type === 'logger' || module.log && module.warn && module.error) {\n this.modules.logger = module;\n }\n\n if (module.type === 'languageDetector') {\n this.modules.languageDetector = module;\n }\n\n if (module.type === 'i18nFormat') {\n this.modules.i18nFormat = module;\n }\n\n if (module.type === 'postProcessor') {\n postProcessor.addPostProcessor(module);\n }\n\n if (module.type === '3rdParty') {\n this.modules.external.push(module);\n }\n\n return this;\n }\n }, {\n key: \"changeLanguage\",\n value: function changeLanguage(lng, callback) {\n var _this4 = this;\n\n this.isLanguageChangingTo = lng;\n var deferred = defer();\n this.emit('languageChanging', lng);\n\n var done = function done(err, l) {\n if (l) {\n _this4.language = l;\n _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);\n\n _this4.translator.changeLanguage(l);\n\n _this4.isLanguageChangingTo = undefined;\n\n _this4.emit('languageChanged', l);\n\n _this4.logger.log('languageChanged', l);\n } else {\n _this4.isLanguageChangingTo = undefined;\n }\n\n deferred.resolve(function () {\n return _this4.t.apply(_this4, arguments);\n });\n if (callback) callback(err, function () {\n return _this4.t.apply(_this4, arguments);\n });\n };\n\n var setLng = function setLng(lngs) {\n var l = typeof lngs === 'string' ? lngs : _this4.services.languageUtils.getBestMatchFromCodes(lngs);\n\n if (l) {\n if (!_this4.language) {\n _this4.language = l;\n _this4.languages = _this4.services.languageUtils.toResolveHierarchy(l);\n }\n\n if (!_this4.translator.language) _this4.translator.changeLanguage(l);\n if (_this4.services.languageDetector) _this4.services.languageDetector.cacheUserLanguage(l);\n }\n\n _this4.loadResources(l, function (err) {\n done(err, l);\n });\n };\n\n if (!lng && this.services.languageDetector && !this.services.languageDetector.async) {\n setLng(this.services.languageDetector.detect());\n } else if (!lng && this.services.languageDetector && this.services.languageDetector.async) {\n this.services.languageDetector.detect(setLng);\n } else {\n setLng(lng);\n }\n\n return deferred;\n }\n }, {\n key: \"getFixedT\",\n value: function getFixedT(lng, ns) {\n var _this5 = this;\n\n var fixedT = function fixedT(key, opts) {\n var options;\n\n if (_typeof(opts) !== 'object') {\n for (var _len3 = arguments.length, rest = new Array(_len3 > 2 ? _len3 - 2 : 0), _key3 = 2; _key3 < _len3; _key3++) {\n rest[_key3 - 2] = arguments[_key3];\n }\n\n options = _this5.options.overloadTranslationOptionHandler([key, opts].concat(rest));\n } else {\n options = _objectSpread({}, opts);\n }\n\n options.lng = options.lng || fixedT.lng;\n options.lngs = options.lngs || fixedT.lngs;\n options.ns = options.ns || fixedT.ns;\n return _this5.t(key, options);\n };\n\n if (typeof lng === 'string') {\n fixedT.lng = lng;\n } else {\n fixedT.lngs = lng;\n }\n\n fixedT.ns = ns;\n return fixedT;\n }\n }, {\n key: \"t\",\n value: function t() {\n var _this$translator;\n\n return this.translator && (_this$translator = this.translator).translate.apply(_this$translator, arguments);\n }\n }, {\n key: \"exists\",\n value: function exists() {\n var _this$translator2;\n\n return this.translator && (_this$translator2 = this.translator).exists.apply(_this$translator2, arguments);\n }\n }, {\n key: \"setDefaultNamespace\",\n value: function setDefaultNamespace(ns) {\n this.options.defaultNS = ns;\n }\n }, {\n key: \"hasLoadedNamespace\",\n value: function hasLoadedNamespace(ns) {\n var _this6 = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!this.isInitialized) {\n this.logger.warn('hasLoadedNamespace: i18next was not initialized', this.languages);\n return false;\n }\n\n if (!this.languages || !this.languages.length) {\n this.logger.warn('hasLoadedNamespace: i18n.languages were undefined or empty', this.languages);\n return false;\n }\n\n var lng = this.languages[0];\n var fallbackLng = this.options ? this.options.fallbackLng : false;\n var lastLng = this.languages[this.languages.length - 1];\n if (lng.toLowerCase() === 'cimode') return true;\n\n var loadNotPending = function loadNotPending(l, n) {\n var loadState = _this6.services.backendConnector.state[\"\".concat(l, \"|\").concat(n)];\n\n return loadState === -1 || loadState === 2;\n };\n\n if (options.precheck) {\n var preResult = options.precheck(this, loadNotPending);\n if (preResult !== undefined) return preResult;\n }\n\n if (this.hasResourceBundle(lng, ns)) return true;\n if (!this.services.backendConnector.backend) return true;\n if (loadNotPending(lng, ns) && (!fallbackLng || loadNotPending(lastLng, ns))) return true;\n return false;\n }\n }, {\n key: \"loadNamespaces\",\n value: function loadNamespaces(ns, callback) {\n var _this7 = this;\n\n var deferred = defer();\n\n if (!this.options.ns) {\n callback && callback();\n return Promise.resolve();\n }\n\n if (typeof ns === 'string') ns = [ns];\n ns.forEach(function (n) {\n if (_this7.options.ns.indexOf(n) < 0) _this7.options.ns.push(n);\n });\n this.loadResources(function (err) {\n deferred.resolve();\n if (callback) callback(err);\n });\n return deferred;\n }\n }, {\n key: \"loadLanguages\",\n value: function loadLanguages(lngs, callback) {\n var deferred = defer();\n if (typeof lngs === 'string') lngs = [lngs];\n var preloaded = this.options.preload || [];\n var newLngs = lngs.filter(function (lng) {\n return preloaded.indexOf(lng) < 0;\n });\n\n if (!newLngs.length) {\n if (callback) callback();\n return Promise.resolve();\n }\n\n this.options.preload = preloaded.concat(newLngs);\n this.loadResources(function (err) {\n deferred.resolve();\n if (callback) callback(err);\n });\n return deferred;\n }\n }, {\n key: \"dir\",\n value: function dir(lng) {\n if (!lng) lng = this.languages && this.languages.length > 0 ? this.languages[0] : this.language;\n if (!lng) return 'rtl';\n var rtlLngs = ['ar', 'shu', 'sqr', 'ssh', 'xaa', 'yhd', 'yud', 'aao', 'abh', 'abv', 'acm', 'acq', 'acw', 'acx', 'acy', 'adf', 'ads', 'aeb', 'aec', 'afb', 'ajp', 'apc', 'apd', 'arb', 'arq', 'ars', 'ary', 'arz', 'auz', 'avl', 'ayh', 'ayl', 'ayn', 'ayp', 'bbz', 'pga', 'he', 'iw', 'ps', 'pbt', 'pbu', 'pst', 'prp', 'prd', 'ug', 'ur', 'ydd', 'yds', 'yih', 'ji', 'yi', 'hbo', 'men', 'xmn', 'fa', 'jpr', 'peo', 'pes', 'prs', 'dv', 'sam'];\n return rtlLngs.indexOf(this.services.languageUtils.getLanguagePartFromCode(lng)) >= 0 ? 'rtl' : 'ltr';\n }\n }, {\n key: \"createInstance\",\n value: function createInstance() {\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 ? arguments[1] : undefined;\n return new I18n(options, callback);\n }\n }, {\n key: \"cloneInstance\",\n value: function cloneInstance() {\n var _this8 = this;\n\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var callback = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;\n\n var mergedOptions = _objectSpread({}, this.options, options, {\n isClone: true\n });\n\n var clone = new I18n(mergedOptions);\n var membersToCopy = ['store', 'services', 'language'];\n membersToCopy.forEach(function (m) {\n clone[m] = _this8[m];\n });\n clone.services = _objectSpread({}, this.services);\n clone.services.utils = {\n hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)\n };\n clone.translator = new Translator(clone.services, clone.options);\n clone.translator.on('*', function (event) {\n for (var _len4 = arguments.length, args = new Array(_len4 > 1 ? _len4 - 1 : 0), _key4 = 1; _key4 < _len4; _key4++) {\n args[_key4 - 1] = arguments[_key4];\n }\n\n clone.emit.apply(clone, [event].concat(args));\n });\n clone.init(mergedOptions, callback);\n clone.translator.options = clone.options;\n clone.translator.backendConnector.services.utils = {\n hasLoadedNamespace: clone.hasLoadedNamespace.bind(clone)\n };\n return clone;\n }\n }]);\n\n return I18n;\n}(EventEmitter);\n\nvar i18next = new I18n();\n\nexport default i18next;\n","'use strict'\n\nvar own = {}.hasOwnProperty\n\nmodule.exports = stringify\n\nfunction stringify(value) {\n // Nothing.\n if (!value || typeof value !== 'object') {\n return ''\n }\n\n // Node.\n if (own.call(value, 'position') || own.call(value, 'type')) {\n return position(value.position)\n }\n\n // Position.\n if (own.call(value, 'start') || own.call(value, 'end')) {\n return position(value)\n }\n\n // Point.\n if (own.call(value, 'line') || own.call(value, 'column')) {\n return point(value)\n }\n\n // ?\n return ''\n}\n\nfunction point(point) {\n if (!point || typeof point !== 'object') {\n point = {}\n }\n\n return index(point.line) + ':' + index(point.column)\n}\n\nfunction position(pos) {\n if (!pos || typeof pos !== 'object') {\n pos = {}\n }\n\n return point(pos.start) + '-' + point(pos.end)\n}\n\nfunction index(value) {\n return value && typeof value === 'number' ? value : 1\n}\n","'use strict'\n\nvar own = {}.hasOwnProperty\n\nmodule.exports = own\n","'use strict'\n\n// Counts tabs based on their expanded size, and CR+LF as one character.\n\nfunction sizeChunks(chunks) {\n var index = -1\n var size = 0\n\n while (++index < chunks.length) {\n size += typeof chunks[index] === 'string' ? chunks[index].length : 1\n }\n\n return size\n}\n\nmodule.exports = sizeChunks\n","'use strict'\n\nvar assign = require('../constant/assign.js')\nvar chunkedSplice = require('./chunked-splice.js')\nvar shallow = require('./shallow.js')\n\nfunction subtokenize(events) {\n var jumps = {}\n var index = -1\n var event\n var lineIndex\n var otherIndex\n var otherEvent\n var parameters\n var subevents\n var more\n\n while (++index < events.length) {\n while (index in jumps) {\n index = jumps[index]\n }\n\n event = events[index] // Add a hook for the GFM tasklist extension, which needs to know if text\n // is in the first content of a list item.\n\n if (\n index &&\n event[1].type === 'chunkFlow' &&\n events[index - 1][1].type === 'listItemPrefix'\n ) {\n subevents = event[1]._tokenizer.events\n otherIndex = 0\n\n if (\n otherIndex < subevents.length &&\n subevents[otherIndex][1].type === 'lineEndingBlank'\n ) {\n otherIndex += 2\n }\n\n if (\n otherIndex < subevents.length &&\n subevents[otherIndex][1].type === 'content'\n ) {\n while (++otherIndex < subevents.length) {\n if (subevents[otherIndex][1].type === 'content') {\n break\n }\n\n if (subevents[otherIndex][1].type === 'chunkText') {\n subevents[otherIndex][1].isInFirstContentOfListItem = true\n otherIndex++\n }\n }\n }\n } // Enter.\n\n if (event[0] === 'enter') {\n if (event[1].contentType) {\n assign(jumps, subcontent(events, index))\n index = jumps[index]\n more = true\n }\n } // Exit.\n else if (event[1]._container || event[1]._movePreviousLineEndings) {\n otherIndex = index\n lineIndex = undefined\n\n while (otherIndex--) {\n otherEvent = events[otherIndex]\n\n if (\n otherEvent[1].type === 'lineEnding' ||\n otherEvent[1].type === 'lineEndingBlank'\n ) {\n if (otherEvent[0] === 'enter') {\n if (lineIndex) {\n events[lineIndex][1].type = 'lineEndingBlank'\n }\n\n otherEvent[1].type = 'lineEnding'\n lineIndex = otherIndex\n }\n } else {\n break\n }\n }\n\n if (lineIndex) {\n // Fix position.\n event[1].end = shallow(events[lineIndex][1].start) // Switch container exit w/ line endings.\n\n parameters = events.slice(lineIndex, index)\n parameters.unshift(event)\n chunkedSplice(events, lineIndex, index - lineIndex + 1, parameters)\n }\n }\n }\n\n return !more\n}\n\nfunction subcontent(events, eventIndex) {\n var token = events[eventIndex][1]\n var context = events[eventIndex][2]\n var startPosition = eventIndex - 1\n var startPositions = []\n var tokenizer =\n token._tokenizer || context.parser[token.contentType](token.start)\n var childEvents = tokenizer.events\n var jumps = []\n var gaps = {}\n var stream\n var previous\n var index\n var entered\n var end\n var adjust // Loop forward through the linked tokens to pass them in order to the\n // subtokenizer.\n\n while (token) {\n // Find the position of the event for this token.\n while (events[++startPosition][1] !== token) {\n // Empty.\n }\n\n startPositions.push(startPosition)\n\n if (!token._tokenizer) {\n stream = context.sliceStream(token)\n\n if (!token.next) {\n stream.push(null)\n }\n\n if (previous) {\n tokenizer.defineSkip(token.start)\n }\n\n if (token.isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = true\n }\n\n tokenizer.write(stream)\n\n if (token.isInFirstContentOfListItem) {\n tokenizer._gfmTasklistFirstContentOfListItem = undefined\n }\n } // Unravel the next token.\n\n previous = token\n token = token.next\n } // Now, loop back through all events (and linked tokens), to figure out which\n // parts belong where.\n\n token = previous\n index = childEvents.length\n\n while (index--) {\n // Make sure we’ve at least seen something (final eol is part of the last\n // token).\n if (childEvents[index][0] === 'enter') {\n entered = true\n } else if (\n // Find a void token that includes a break.\n entered &&\n childEvents[index][1].type === childEvents[index - 1][1].type &&\n childEvents[index][1].start.line !== childEvents[index][1].end.line\n ) {\n add(childEvents.slice(index + 1, end))\n // Help GC.\n token._tokenizer = token.next = undefined\n token = token.previous\n end = index + 1\n }\n }\n\n // Help GC.\n tokenizer.events = token._tokenizer = token.next = undefined // Do head:\n\n add(childEvents.slice(0, end))\n index = -1\n adjust = 0\n\n while (++index < jumps.length) {\n gaps[adjust + jumps[index][0]] = adjust + jumps[index][1]\n adjust += jumps[index][1] - jumps[index][0] - 1\n }\n\n return gaps\n\n function add(slice) {\n var start = startPositions.pop()\n jumps.unshift([start, start + slice.length - 1])\n chunkedSplice(events, start, 2, slice)\n }\n}\n\nmodule.exports = subtokenize\n","'use strict'\n\nObject.defineProperty(exports, '__esModule', {value: true})\n\nvar assign = require('../constant/assign.js')\nvar shallow = require('../util/shallow.js')\n\nvar text = initializeFactory('text')\nvar string = initializeFactory('string')\nvar resolver = {\n resolveAll: createResolver()\n}\n\nfunction initializeFactory(field) {\n return {\n tokenize: initializeText,\n resolveAll: createResolver(\n field === 'text' ? resolveAllLineSuffixes : undefined\n )\n }\n\n function initializeText(effects) {\n var self = this\n var constructs = this.parser.constructs[field]\n var text = effects.attempt(constructs, start, notText)\n return start\n\n function start(code) {\n return atBreak(code) ? text(code) : notText(code)\n }\n\n function notText(code) {\n if (code === null) {\n effects.consume(code)\n return\n }\n\n effects.enter('data')\n effects.consume(code)\n return data\n }\n\n function data(code) {\n if (atBreak(code)) {\n effects.exit('data')\n return text(code)\n } // Data.\n\n effects.consume(code)\n return data\n }\n\n function atBreak(code) {\n var list = constructs[code]\n var index = -1\n\n if (code === null) {\n return true\n }\n\n if (list) {\n while (++index < list.length) {\n if (\n !list[index].previous ||\n list[index].previous.call(self, self.previous)\n ) {\n return true\n }\n }\n }\n }\n }\n}\n\nfunction createResolver(extraResolver) {\n return resolveAllText\n\n function resolveAllText(events, context) {\n var index = -1\n var enter // A rather boring computation (to merge adjacent `data` events) which\n // improves mm performance by 29%.\n\n while (++index <= events.length) {\n if (enter === undefined) {\n if (events[index] && events[index][1].type === 'data') {\n enter = index\n index++\n }\n } else if (!events[index] || events[index][1].type !== 'data') {\n // Don’t do anything if there is one data token.\n if (index !== enter + 2) {\n events[enter][1].end = events[index - 1][1].end\n events.splice(enter + 2, index - enter - 2)\n index = enter + 2\n }\n\n enter = undefined\n }\n }\n\n return extraResolver ? extraResolver(events, context) : events\n }\n} // A rather ugly set of instructions which again looks at chunks in the input\n// stream.\n// The reason to do this here is that it is *much* faster to parse in reverse.\n// And that we can’t hook into `null` to split the line suffix before an EOF.\n// To do: figure out if we can make this into a clean utility, or even in core.\n// As it will be useful for GFMs literal autolink extension (and maybe even\n// tables?)\n\nfunction resolveAllLineSuffixes(events, context) {\n var eventIndex = -1\n var chunks\n var data\n var chunk\n var index\n var bufferIndex\n var size\n var tabs\n var token\n\n while (++eventIndex <= events.length) {\n if (\n (eventIndex === events.length ||\n events[eventIndex][1].type === 'lineEnding') &&\n events[eventIndex - 1][1].type === 'data'\n ) {\n data = events[eventIndex - 1][1]\n chunks = context.sliceStream(data)\n index = chunks.length\n bufferIndex = -1\n size = 0\n tabs = undefined\n\n while (index--) {\n chunk = chunks[index]\n\n if (typeof chunk === 'string') {\n bufferIndex = chunk.length\n\n while (chunk.charCodeAt(bufferIndex - 1) === 32) {\n size++\n bufferIndex--\n }\n\n if (bufferIndex) break\n bufferIndex = -1\n } // Number\n else if (chunk === -2) {\n tabs = true\n size++\n } else if (chunk === -1);\n else {\n // Replacement character, exit.\n index++\n break\n }\n }\n\n if (size) {\n token = {\n type:\n eventIndex === events.length || tabs || size < 2\n ? 'lineSuffix'\n : 'hardBreakTrailing',\n start: {\n line: data.end.line,\n column: data.end.column - size,\n offset: data.end.offset - size,\n _index: data.start._index + index,\n _bufferIndex: index\n ? bufferIndex\n : data.start._bufferIndex + bufferIndex\n },\n end: shallow(data.end)\n }\n data.end = shallow(token.start)\n\n if (data.start.offset === data.end.offset) {\n assign(data, token)\n } else {\n events.splice(\n eventIndex,\n 0,\n ['enter', token, context],\n ['exit', token, context]\n )\n eventIndex += 2\n }\n }\n\n eventIndex++\n }\n }\n\n return events\n}\n\nexports.resolver = resolver\nexports.string = string\nexports.text = text\n","'use strict'\n\n// Note: EOF is seen as ASCII control here, because `null < 32 == true`.\nfunction asciiControl(code) {\n return (\n // Special whitespace codes (which have negative values), C0 and Control\n // character DEL\n code < 32 || code === 127\n )\n}\n\nmodule.exports = asciiControl\n","'use strict'\n\n/* eslint-env browser */\n\nvar el\n\nvar semicolon = 59 // ';'\n\nmodule.exports = decodeEntity\n\nfunction decodeEntity(characters) {\n var entity = '&' + characters + ';'\n var char\n\n el = el || document.createElement('i')\n el.innerHTML = entity\n char = el.textContent\n\n // Some entities do not require the closing semicolon (`¬` - for instance),\n // which leads to situations where parsing the assumed entity of ¬it; will\n // result in the string `¬it;`. When we encounter a trailing semicolon after\n // parsing and the entity to decode was not a semicolon (`;`), we can\n // assume that the matching was incomplete\n if (char.charCodeAt(char.length - 1) === semicolon && characters !== 'semi') {\n return false\n }\n\n // If the decoded string is equal to the input, the entity was not valid\n return char === entity ? false : char\n}\n","'use strict'\n\nvar regexCheck = require('../util/regex-check.js')\n\nvar asciiDigit = regexCheck(/\\d/)\n\nmodule.exports = asciiDigit\n","'use strict'\n\nvar asciiControl = require('../character/ascii-control.js')\nvar markdownLineEndingOrSpace = require('../character/markdown-line-ending-or-space.js')\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\n\n// eslint-disable-next-line max-params\nfunction destinationFactory(\n effects,\n ok,\n nok,\n type,\n literalType,\n literalMarkerType,\n rawType,\n stringType,\n max\n) {\n var limit = max || Infinity\n var balance = 0\n return start\n\n function start(code) {\n if (code === 60) {\n effects.enter(type)\n effects.enter(literalType)\n effects.enter(literalMarkerType)\n effects.consume(code)\n effects.exit(literalMarkerType)\n return destinationEnclosedBefore\n }\n\n if (asciiControl(code) || code === 41) {\n return nok(code)\n }\n\n effects.enter(type)\n effects.enter(rawType)\n effects.enter(stringType)\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return destinationRaw(code)\n }\n\n function destinationEnclosedBefore(code) {\n if (code === 62) {\n effects.enter(literalMarkerType)\n effects.consume(code)\n effects.exit(literalMarkerType)\n effects.exit(literalType)\n effects.exit(type)\n return ok\n }\n\n effects.enter(stringType)\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return destinationEnclosed(code)\n }\n\n function destinationEnclosed(code) {\n if (code === 62) {\n effects.exit('chunkString')\n effects.exit(stringType)\n return destinationEnclosedBefore(code)\n }\n\n if (code === null || code === 60 || markdownLineEnding(code)) {\n return nok(code)\n }\n\n effects.consume(code)\n return code === 92 ? destinationEnclosedEscape : destinationEnclosed\n }\n\n function destinationEnclosedEscape(code) {\n if (code === 60 || code === 62 || code === 92) {\n effects.consume(code)\n return destinationEnclosed\n }\n\n return destinationEnclosed(code)\n }\n\n function destinationRaw(code) {\n if (code === 40) {\n if (++balance > limit) return nok(code)\n effects.consume(code)\n return destinationRaw\n }\n\n if (code === 41) {\n if (!balance--) {\n effects.exit('chunkString')\n effects.exit(stringType)\n effects.exit(rawType)\n effects.exit(type)\n return ok(code)\n }\n\n effects.consume(code)\n return destinationRaw\n }\n\n if (code === null || markdownLineEndingOrSpace(code)) {\n if (balance) return nok(code)\n effects.exit('chunkString')\n effects.exit(stringType)\n effects.exit(rawType)\n effects.exit(type)\n return ok(code)\n }\n\n if (asciiControl(code)) return nok(code)\n effects.consume(code)\n return code === 92 ? destinationRawEscape : destinationRaw\n }\n\n function destinationRawEscape(code) {\n if (code === 40 || code === 41 || code === 92) {\n effects.consume(code)\n return destinationRaw\n }\n\n return destinationRaw(code)\n }\n}\n\nmodule.exports = destinationFactory\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar markdownSpace = require('../character/markdown-space.js')\n\n// eslint-disable-next-line max-params\nfunction labelFactory(effects, ok, nok, type, markerType, stringType) {\n var self = this\n var size = 0\n var data\n return start\n\n function start(code) {\n effects.enter(type)\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n effects.enter(stringType)\n return atBreak\n }\n\n function atBreak(code) {\n if (\n code === null ||\n code === 91 ||\n (code === 93 && !data) ||\n /* c8 ignore next */\n (code === 94 &&\n /* c8 ignore next */\n !size &&\n /* c8 ignore next */\n '_hiddenFootnoteSupport' in self.parser.constructs) ||\n size > 999\n ) {\n return nok(code)\n }\n\n if (code === 93) {\n effects.exit(stringType)\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n effects.exit(type)\n return ok\n }\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return atBreak\n }\n\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return label(code)\n }\n\n function label(code) {\n if (\n code === null ||\n code === 91 ||\n code === 93 ||\n markdownLineEnding(code) ||\n size++ > 999\n ) {\n effects.exit('chunkString')\n return atBreak(code)\n }\n\n effects.consume(code)\n data = data || !markdownSpace(code)\n return code === 92 ? labelEscape : label\n }\n\n function labelEscape(code) {\n if (code === 91 || code === 92 || code === 93) {\n effects.consume(code)\n size++\n return label\n }\n\n return label(code)\n }\n}\n\nmodule.exports = labelFactory\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar markdownSpace = require('../character/markdown-space.js')\nvar factorySpace = require('./factory-space.js')\n\nfunction whitespaceFactory(effects, ok) {\n var seen\n return start\n\n function start(code) {\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n seen = true\n return start\n }\n\n if (markdownSpace(code)) {\n return factorySpace(\n effects,\n start,\n seen ? 'linePrefix' : 'lineSuffix'\n )(code)\n }\n\n return ok(code)\n }\n}\n\nmodule.exports = whitespaceFactory\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar factorySpace = require('./factory-space.js')\n\nfunction titleFactory(effects, ok, nok, type, markerType, stringType) {\n var marker\n return start\n\n function start(code) {\n effects.enter(type)\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n marker = code === 40 ? 41 : code\n return atFirstTitleBreak\n }\n\n function atFirstTitleBreak(code) {\n if (code === marker) {\n effects.enter(markerType)\n effects.consume(code)\n effects.exit(markerType)\n effects.exit(type)\n return ok\n }\n\n effects.enter(stringType)\n return atTitleBreak(code)\n }\n\n function atTitleBreak(code) {\n if (code === marker) {\n effects.exit(stringType)\n return atFirstTitleBreak(marker)\n }\n\n if (code === null) {\n return nok(code)\n } // Note: blank lines can’t exist in content.\n\n if (markdownLineEnding(code)) {\n effects.enter('lineEnding')\n effects.consume(code)\n effects.exit('lineEnding')\n return factorySpace(effects, atTitleBreak, 'linePrefix')\n }\n\n effects.enter('chunkString', {\n contentType: 'string'\n })\n return title(code)\n }\n\n function title(code) {\n if (code === marker || code === null || markdownLineEnding(code)) {\n effects.exit('chunkString')\n return atTitleBreak(code)\n }\n\n effects.consume(code)\n return code === 92 ? titleEscape : title\n }\n\n function titleEscape(code) {\n if (code === marker || code === 92) {\n effects.consume(code)\n return title\n }\n\n return title(code)\n }\n}\n\nmodule.exports = titleFactory\n","'use strict'\n\nvar markdownLineEnding = require('../character/markdown-line-ending.js')\nvar markdownSpace = require('../character/markdown-space.js')\nvar factorySpace = require('./factory-space.js')\n\nvar thematicBreak = {\n name: 'thematicBreak',\n tokenize: tokenizeThematicBreak\n}\n\nfunction tokenizeThematicBreak(effects, ok, nok) {\n var size = 0\n var marker\n return start\n\n function start(code) {\n effects.enter('thematicBreak')\n marker = code\n return atBreak(code)\n }\n\n function atBreak(code) {\n if (code === marker) {\n effects.enter('thematicBreakSequence')\n return sequence(code)\n }\n\n if (markdownSpace(code)) {\n return factorySpace(effects, atBreak, 'whitespace')(code)\n }\n\n if (size < 3 || (code !== null && !markdownLineEnding(code))) {\n return nok(code)\n }\n\n effects.exit('thematicBreak')\n return ok(code)\n }\n\n function sequence(code) {\n if (code === marker) {\n effects.consume(code)\n size++\n return sequence\n }\n\n effects.exit('thematicBreakSequence')\n return atBreak(code)\n }\n}\n\nmodule.exports = thematicBreak\n","function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty;","function _taggedTemplateLiteral(strings, raw) {\n if (!raw) {\n raw = strings.slice(0);\n }\n\n return Object.freeze(Object.defineProperties(strings, {\n raw: {\n value: Object.freeze(raw)\n }\n }));\n}\n\nmodule.exports = _taggedTemplateLiteral;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getScrollBarWidth = getScrollBarWidth;\nexports.calcOffset = calcOffset;\n\nfunction getScrollBarWidth() {\n const scrollDiv = document.createElement('div');\n scrollDiv.className = 'react-timekeeper-scrollbar-measure';\n document.body.appendChild(scrollDiv);\n const width = scrollDiv.offsetWidth - scrollDiv.clientWidth;\n document.body.removeChild(scrollDiv);\n return width;\n}\n\nfunction calcOffset(el) {\n const style = window.getComputedStyle(el, null);\n return function (clientX, clientY) {\n const borderLeftWidth = parseInt(style.borderLeftWidth, 10) || 0;\n const borderTopWidth = parseInt(style.borderTopWidth, 10) || 0;\n const rect = el.getBoundingClientRect();\n return {\n offsetX: clientX - borderLeftWidth - rect.left,\n offsetY: clientY - borderTopWidth - rect.top\n };\n };\n}","\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.CLOCK_WRAPPER_BACKGROUND = void 0;\n// clock wrapper\nconst CLOCK_WRAPPER_BACKGROUND = '#f4f4f4';\nexports.CLOCK_WRAPPER_BACKGROUND = CLOCK_WRAPPER_BACKGROUND;","// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n","import _classCallCheck from '@babel/runtime/helpers/esm/classCallCheck';\nimport _createClass from '@babel/runtime/helpers/esm/createClass';\n\nvar arr = [];\nvar each = arr.forEach;\nvar slice = arr.slice;\nfunction defaults(obj) {\n each.call(slice.call(arguments, 1), function (source) {\n if (source) {\n for (var prop in source) {\n if (obj[prop] === undefined) obj[prop] = source[prop];\n }\n }\n });\n return obj;\n}\n\n// eslint-disable-next-line no-control-regex\nvar fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\nvar serializeCookie = function serializeCookie(name, val, options) {\n var opt = options || {};\n opt.path = opt.path || '/';\n var value = encodeURIComponent(val);\n var str = name + '=' + value;\n\n if (opt.maxAge > 0) {\n var maxAge = opt.maxAge - 0;\n if (isNaN(maxAge)) throw new Error('maxAge should be a Number');\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) {\n throw new TypeError('option domain is invalid');\n }\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) {\n throw new TypeError('option path is invalid');\n }\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) {\n if (typeof opt.expires.toUTCString !== 'function') {\n throw new TypeError('option expires is invalid');\n }\n\n str += '; Expires=' + opt.expires.toUTCString();\n }\n\n if (opt.httpOnly) str += '; HttpOnly';\n if (opt.secure) str += '; Secure';\n\n if (opt.sameSite) {\n var sameSite = typeof opt.sameSite === 'string' ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n str += '; SameSite=Strict';\n break;\n\n case 'lax':\n str += '; SameSite=Lax';\n break;\n\n case 'strict':\n str += '; SameSite=Strict';\n break;\n\n case 'none':\n str += '; SameSite=None';\n break;\n\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n};\n\nvar cookie = {\n create: function create(name, value, minutes, domain) {\n var cookieOptions = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {\n path: '/',\n sameSite: 'strict'\n };\n\n if (minutes) {\n cookieOptions.expires = new Date();\n cookieOptions.expires.setTime(cookieOptions.expires.getTime() + minutes * 60 * 1000);\n }\n\n if (domain) cookieOptions.domain = domain;\n document.cookie = serializeCookie(name, encodeURIComponent(value), cookieOptions);\n },\n read: function read(name) {\n var nameEQ = name + '=';\n var ca = document.cookie.split(';');\n\n for (var i = 0; i < ca.length; i++) {\n var c = ca[i];\n\n while (c.charAt(0) === ' ') {\n c = c.substring(1, c.length);\n }\n\n if (c.indexOf(nameEQ) === 0) return c.substring(nameEQ.length, c.length);\n }\n\n return null;\n },\n remove: function remove(name) {\n this.create(name, '', -1);\n }\n};\nvar cookie$1 = {\n name: 'cookie',\n lookup: function lookup(options) {\n var found;\n\n if (options.lookupCookie && typeof document !== 'undefined') {\n var c = cookie.read(options.lookupCookie);\n if (c) found = c;\n }\n\n return found;\n },\n cacheUserLanguage: function cacheUserLanguage(lng, options) {\n if (options.lookupCookie && typeof document !== 'undefined') {\n cookie.create(options.lookupCookie, lng, options.cookieMinutes, options.cookieDomain, options.cookieOptions);\n }\n }\n};\n\nvar querystring = {\n name: 'querystring',\n lookup: function lookup(options) {\n var found;\n\n if (typeof window !== 'undefined') {\n var query = window.location.search.substring(1);\n var params = query.split('&');\n\n for (var i = 0; i < params.length; i++) {\n var pos = params[i].indexOf('=');\n\n if (pos > 0) {\n var key = params[i].substring(0, pos);\n\n if (key === options.lookupQuerystring) {\n found = params[i].substring(pos + 1);\n }\n }\n }\n }\n\n return found;\n }\n};\n\nvar hasLocalStorageSupport = null;\n\nvar localStorageAvailable = function localStorageAvailable() {\n if (hasLocalStorageSupport !== null) return hasLocalStorageSupport;\n\n try {\n hasLocalStorageSupport = window !== 'undefined' && window.localStorage !== null;\n var testKey = 'i18next.translate.boo';\n window.localStorage.setItem(testKey, 'foo');\n window.localStorage.removeItem(testKey);\n } catch (e) {\n hasLocalStorageSupport = false;\n }\n\n return hasLocalStorageSupport;\n};\n\nvar localStorage = {\n name: 'localStorage',\n lookup: function lookup(options) {\n var found;\n\n if (options.lookupLocalStorage && localStorageAvailable()) {\n var lng = window.localStorage.getItem(options.lookupLocalStorage);\n if (lng) found = lng;\n }\n\n return found;\n },\n cacheUserLanguage: function cacheUserLanguage(lng, options) {\n if (options.lookupLocalStorage && localStorageAvailable()) {\n window.localStorage.setItem(options.lookupLocalStorage, lng);\n }\n }\n};\n\nvar hasSessionStorageSupport = null;\n\nvar sessionStorageAvailable = function sessionStorageAvailable() {\n if (hasSessionStorageSupport !== null) return hasSessionStorageSupport;\n\n try {\n hasSessionStorageSupport = window !== 'undefined' && window.sessionStorage !== null;\n var testKey = 'i18next.translate.boo';\n window.sessionStorage.setItem(testKey, 'foo');\n window.sessionStorage.removeItem(testKey);\n } catch (e) {\n hasSessionStorageSupport = false;\n }\n\n return hasSessionStorageSupport;\n};\n\nvar sessionStorage = {\n name: 'sessionStorage',\n lookup: function lookup(options) {\n var found;\n\n if (options.lookupSessionStorage && sessionStorageAvailable()) {\n var lng = window.sessionStorage.getItem(options.lookupSessionStorage);\n if (lng) found = lng;\n }\n\n return found;\n },\n cacheUserLanguage: function cacheUserLanguage(lng, options) {\n if (options.lookupSessionStorage && sessionStorageAvailable()) {\n window.sessionStorage.setItem(options.lookupSessionStorage, lng);\n }\n }\n};\n\nvar navigator$1 = {\n name: 'navigator',\n lookup: function lookup(options) {\n var found = [];\n\n if (typeof navigator !== 'undefined') {\n if (navigator.languages) {\n // chrome only; not an array, so can't use .push.apply instead of iterating\n for (var i = 0; i < navigator.languages.length; i++) {\n found.push(navigator.languages[i]);\n }\n }\n\n if (navigator.userLanguage) {\n found.push(navigator.userLanguage);\n }\n\n if (navigator.language) {\n found.push(navigator.language);\n }\n }\n\n return found.length > 0 ? found : undefined;\n }\n};\n\nvar htmlTag = {\n name: 'htmlTag',\n lookup: function lookup(options) {\n var found;\n var htmlTag = options.htmlTag || (typeof document !== 'undefined' ? document.documentElement : null);\n\n if (htmlTag && typeof htmlTag.getAttribute === 'function') {\n found = htmlTag.getAttribute('lang');\n }\n\n return found;\n }\n};\n\nvar path = {\n name: 'path',\n lookup: function lookup(options) {\n var found;\n\n if (typeof window !== 'undefined') {\n var language = window.location.pathname.match(/\\/([a-zA-Z-]*)/g);\n\n if (language instanceof Array) {\n if (typeof options.lookupFromPathIndex === 'number') {\n if (typeof language[options.lookupFromPathIndex] !== 'string') {\n return undefined;\n }\n\n found = language[options.lookupFromPathIndex].replace('/', '');\n } else {\n found = language[0].replace('/', '');\n }\n }\n }\n\n return found;\n }\n};\n\nvar subdomain = {\n name: 'subdomain',\n lookup: function lookup(options) {\n var found;\n\n if (typeof window !== 'undefined') {\n var language = window.location.href.match(/(?:http[s]*\\:\\/\\/)*(.*?)\\.(?=[^\\/]*\\..{2,5})/gi);\n\n if (language instanceof Array) {\n if (typeof options.lookupFromSubdomainIndex === 'number') {\n found = language[options.lookupFromSubdomainIndex].replace('http://', '').replace('https://', '').replace('.', '');\n } else {\n found = language[0].replace('http://', '').replace('https://', '').replace('.', '');\n }\n }\n }\n\n return found;\n }\n};\n\nfunction getDefaults() {\n return {\n order: ['querystring', 'cookie', 'localStorage', 'sessionStorage', 'navigator', 'htmlTag'],\n lookupQuerystring: 'lng',\n lookupCookie: 'i18next',\n lookupLocalStorage: 'i18nextLng',\n lookupSessionStorage: 'i18nextLng',\n // cache user language\n caches: ['localStorage'],\n excludeCacheFor: ['cimode'] //cookieMinutes: 10,\n //cookieDomain: 'myDomain'\n\n };\n}\n\nvar Browser =\n/*#__PURE__*/\nfunction () {\n function Browser(services) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n _classCallCheck(this, Browser);\n\n this.type = 'languageDetector';\n this.detectors = {};\n this.init(services, options);\n }\n\n _createClass(Browser, [{\n key: \"init\",\n value: function init(services) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var i18nOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n this.services = services;\n this.options = defaults(options, this.options || {}, getDefaults()); // backwards compatibility\n\n if (this.options.lookupFromUrlIndex) this.options.lookupFromPathIndex = this.options.lookupFromUrlIndex;\n this.i18nOptions = i18nOptions;\n this.addDetector(cookie$1);\n this.addDetector(querystring);\n this.addDetector(localStorage);\n this.addDetector(sessionStorage);\n this.addDetector(navigator$1);\n this.addDetector(htmlTag);\n this.addDetector(path);\n this.addDetector(subdomain);\n }\n }, {\n key: \"addDetector\",\n value: function addDetector(detector) {\n this.detectors[detector.name] = detector;\n }\n }, {\n key: \"detect\",\n value: function detect(detectionOrder) {\n var _this = this;\n\n if (!detectionOrder) detectionOrder = this.options.order;\n var detected = [];\n detectionOrder.forEach(function (detectorName) {\n if (_this.detectors[detectorName]) {\n var lookup = _this.detectors[detectorName].lookup(_this.options);\n\n if (lookup && typeof lookup === 'string') lookup = [lookup];\n if (lookup) detected = detected.concat(lookup);\n }\n });\n if (this.services.languageUtils.getBestMatchFromCodes) return detected; // new i18next v19.5.0\n\n return detected.length > 0 ? detected[0] : null; // a little backward compatibility\n }\n }, {\n key: \"cacheUserLanguage\",\n value: function cacheUserLanguage(lng, caches) {\n var _this2 = this;\n\n if (!caches) caches = this.options.caches;\n if (!caches) return;\n if (this.options.excludeCacheFor && this.options.excludeCacheFor.indexOf(lng) > -1) return;\n caches.forEach(function (cacheName) {\n if (_this2.detectors[cacheName]) _this2.detectors[cacheName].cacheUserLanguage(lng, _this2.options);\n });\n }\n }]);\n\n return Browser;\n}();\n\nBrowser.type = 'languageDetector';\n\nexport default Browser;\n","function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\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, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { defaults } from './utils.js';\nimport request from './request.js';\n\nvar getDefaults = function getDefaults() {\n return {\n loadPath: '/locales/{{lng}}/{{ns}}.json',\n addPath: '/locales/add/{{lng}}/{{ns}}',\n allowMultiLoading: false,\n parse: function parse(data) {\n return JSON.parse(data);\n },\n stringify: JSON.stringify,\n parsePayload: function parsePayload(namespace, key, fallbackValue) {\n return _defineProperty({}, key, fallbackValue || '');\n },\n request: request,\n reloadInterval: typeof window !== 'undefined' ? false : 60 * 60 * 1000,\n customHeaders: {},\n queryStringParams: {},\n crossDomain: false,\n withCredentials: false,\n overrideMimeType: false,\n requestOptions: {\n mode: 'cors',\n credentials: 'same-origin',\n cache: 'default'\n }\n };\n};\n\nvar Backend = function () {\n function Backend(services) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n\n _classCallCheck(this, Backend);\n\n this.services = services;\n this.options = options;\n this.allOptions = allOptions;\n this.type = 'backend';\n this.init(services, options, allOptions);\n }\n\n _createClass(Backend, [{\n key: \"init\",\n value: function init(services) {\n var _this = this;\n\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var allOptions = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};\n this.services = services;\n this.options = defaults(options, this.options || {}, getDefaults());\n this.allOptions = allOptions;\n\n if (this.services && this.options.reloadInterval) {\n setInterval(function () {\n return _this.reload();\n }, this.options.reloadInterval);\n }\n }\n }, {\n key: \"readMulti\",\n value: function readMulti(languages, namespaces, callback) {\n var loadPath = this.options.loadPath;\n\n if (typeof this.options.loadPath === 'function') {\n loadPath = this.options.loadPath(languages, namespaces);\n }\n\n var url = this.services.interpolator.interpolate(loadPath, {\n lng: languages.join('+'),\n ns: namespaces.join('+')\n });\n this.loadUrl(url, callback, languages, namespaces);\n }\n }, {\n key: \"read\",\n value: function read(language, namespace, callback) {\n var loadPath = this.options.loadPath;\n\n if (typeof this.options.loadPath === 'function') {\n loadPath = this.options.loadPath([language], [namespace]);\n }\n\n var url = this.services.interpolator.interpolate(loadPath, {\n lng: language,\n ns: namespace\n });\n this.loadUrl(url, callback, language, namespace);\n }\n }, {\n key: \"loadUrl\",\n value: function loadUrl(url, callback, languages, namespaces) {\n var _this2 = this;\n\n this.options.request(this.options, url, undefined, function (err, res) {\n if (res && (res.status >= 500 && res.status < 600 || !res.status)) return callback('failed loading ' + url + '; status code: ' + res.status, true);\n if (res && res.status >= 400 && res.status < 500) return callback('failed loading ' + url + '; status code: ' + res.status, false);\n if (!res && err && err.message && err.message.indexOf('Failed to fetch') > -1) return callback('failed loading ' + url + ': ' + err.message, true);\n if (err) return callback(err, false);\n var ret, parseErr;\n\n try {\n if (typeof res.data === 'string') {\n ret = _this2.options.parse(res.data, languages, namespaces);\n } else {\n ret = res.data;\n }\n } catch (e) {\n parseErr = 'failed parsing ' + url + ' to json';\n }\n\n if (parseErr) return callback(parseErr, false);\n callback(null, ret);\n });\n }\n }, {\n key: \"create\",\n value: function create(languages, namespace, key, fallbackValue, callback) {\n var _this3 = this;\n\n if (!this.options.addPath) return;\n if (typeof languages === 'string') languages = [languages];\n var payload = this.options.parsePayload(namespace, key, fallbackValue);\n var finished = 0;\n var dataArray = [];\n var resArray = [];\n languages.forEach(function (lng) {\n var addPath = _this3.options.addPath;\n\n if (typeof _this3.options.addPath === 'function') {\n addPath = _this3.options.addPath(lng, namespace);\n }\n\n var url = _this3.services.interpolator.interpolate(addPath, {\n lng: lng,\n ns: namespace\n });\n\n _this3.options.request(_this3.options, url, payload, function (data, res) {\n finished += 1;\n dataArray.push(data);\n resArray.push(res);\n\n if (finished === languages.length) {\n if (callback) callback(dataArray, resArray);\n }\n });\n });\n }\n }, {\n key: \"reload\",\n value: function reload() {\n var _this4 = this;\n\n var _this$services = this.services,\n backendConnector = _this$services.backendConnector,\n languageUtils = _this$services.languageUtils,\n logger = _this$services.logger;\n var currentLanguage = backendConnector.language;\n if (currentLanguage && currentLanguage.toLowerCase() === 'cimode') return;\n var toLoad = [];\n\n var append = function append(lng) {\n var lngs = languageUtils.toResolveHierarchy(lng);\n lngs.forEach(function (l) {\n if (toLoad.indexOf(l) < 0) toLoad.push(l);\n });\n };\n\n append(currentLanguage);\n if (this.allOptions.preload) this.allOptions.preload.forEach(function (l) {\n return append(l);\n });\n toLoad.forEach(function (lng) {\n _this4.allOptions.ns.forEach(function (ns) {\n backendConnector.read(lng, ns, 'read', null, null, function (err, data) {\n if (err) logger.warn(\"loading namespace \".concat(ns, \" for language \").concat(lng, \" failed\"), err);\n if (!err && data) logger.log(\"loaded namespace \".concat(ns, \" for language \").concat(lng), data);\n backendConnector.loaded(\"\".concat(lng, \"|\").concat(ns), err, data);\n });\n });\n });\n }\n }]);\n\n return Backend;\n}();\n\nBackend.type = 'backend';\nexport default Backend;","function _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nimport { defaults, hasXMLHttpRequest } from './utils.js';\nimport * as fetchNode from './getFetch.cjs';\nvar fetchApi;\n\nif (typeof fetch === 'function') {\n if (typeof global !== 'undefined' && global.fetch) {\n fetchApi = global.fetch;\n } else if (typeof window !== 'undefined' && window.fetch) {\n fetchApi = window.fetch;\n }\n}\n\nvar XmlHttpRequestApi;\n\nif (hasXMLHttpRequest) {\n if (typeof global !== 'undefined' && global.XMLHttpRequest) {\n XmlHttpRequestApi = global.XMLHttpRequest;\n } else if (typeof window !== 'undefined' && window.XMLHttpRequest) {\n XmlHttpRequestApi = window.XMLHttpRequest;\n }\n}\n\nvar ActiveXObjectApi;\n\nif (typeof ActiveXObject === 'function') {\n if (typeof global !== 'undefined' && global.ActiveXObject) {\n ActiveXObjectApi = global.ActiveXObject;\n } else if (typeof window !== 'undefined' && window.ActiveXObject) {\n ActiveXObjectApi = window.ActiveXObject;\n }\n}\n\nif (!fetchApi && fetchNode && !XmlHttpRequestApi && !ActiveXObjectApi) fetchApi = fetchNode.default || fetchNode;\nif (typeof fetchApi !== 'function') fetchApi = undefined;\n\nvar addQueryString = function addQueryString(url, params) {\n if (params && _typeof(params) === 'object') {\n var queryString = '';\n\n for (var paramName in params) {\n queryString += '&' + encodeURIComponent(paramName) + '=' + encodeURIComponent(params[paramName]);\n }\n\n if (!queryString) return url;\n url = url + (url.indexOf('?') !== -1 ? '&' : '?') + queryString.slice(1);\n }\n\n return url;\n};\n\nvar requestWithFetch = function requestWithFetch(options, url, payload, callback) {\n if (options.queryStringParams) {\n url = addQueryString(url, options.queryStringParams);\n }\n\n var headers = defaults({}, typeof options.customHeaders === 'function' ? options.customHeaders() : options.customHeaders);\n if (payload) headers['Content-Type'] = 'application/json';\n fetchApi(url, defaults({\n method: payload ? 'POST' : 'GET',\n body: payload ? options.stringify(payload) : undefined,\n headers: headers\n }, typeof options.requestOptions === 'function' ? options.requestOptions(payload) : options.requestOptions)).then(function (response) {\n if (!response.ok) return callback(response.statusText || 'Error', {\n status: response.status\n });\n response.text().then(function (data) {\n callback(null, {\n status: response.status,\n data: data\n });\n }).catch(callback);\n }).catch(callback);\n};\n\nvar requestWithXmlHttpRequest = function requestWithXmlHttpRequest(options, url, payload, callback) {\n if (payload && _typeof(payload) === 'object') {\n payload = addQueryString('', payload).slice(1);\n }\n\n if (options.queryStringParams) {\n url = addQueryString(url, options.queryStringParams);\n }\n\n try {\n var x;\n\n if (XmlHttpRequestApi) {\n x = new XmlHttpRequestApi();\n } else {\n x = new ActiveXObjectApi('MSXML2.XMLHTTP.3.0');\n }\n\n x.open(payload ? 'POST' : 'GET', url, 1);\n\n if (!options.crossDomain) {\n x.setRequestHeader('X-Requested-With', 'XMLHttpRequest');\n }\n\n x.withCredentials = !!options.withCredentials;\n\n if (payload) {\n x.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');\n }\n\n if (x.overrideMimeType) {\n x.overrideMimeType('application/json');\n }\n\n var h = options.customHeaders;\n h = typeof h === 'function' ? h() : h;\n\n if (h) {\n for (var i in h) {\n x.setRequestHeader(i, h[i]);\n }\n }\n\n x.onreadystatechange = function () {\n x.readyState > 3 && callback(x.status >= 400 ? x.statusText : null, {\n status: x.status,\n data: x.responseText\n });\n };\n\n x.send(payload);\n } catch (e) {\n console && console.log(e);\n }\n};\n\nvar request = function request(options, url, payload, callback) {\n if (typeof payload === 'function') {\n callback = payload;\n payload = undefined;\n }\n\n callback = callback || function () {};\n\n if (fetchApi) {\n return requestWithFetch(options, url, payload, callback);\n }\n\n if (hasXMLHttpRequest || typeof ActiveXObject === 'function') {\n return requestWithXmlHttpRequest(options, url, payload, callback);\n }\n};\n\nexport default request;","function _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n return Constructor;\n}\n\nmodule.exports = _createClass;\nmodule.exports[\"default\"] = module.exports, module.exports.__esModule = true;","export default (value: any): value is HTMLElement =>\n value instanceof HTMLElement;\n","import { ValidationMode } from './types';\n\nexport const EVENTS = {\n BLUR: 'blur',\n CHANGE: 'change',\n INPUT: 'input',\n};\n\nexport const VALIDATION_MODE: ValidationMode = {\n onBlur: 'onBlur',\n onChange: 'onChange',\n onSubmit: 'onSubmit',\n onTouched: 'onTouched',\n all: 'all',\n};\n\nexport const SELECT = 'select';\n\nexport const UNDEFINED = 'undefined';\n\nexport const INPUT_VALIDATION_RULES = {\n max: 'max',\n min: 'min',\n maxLength: 'maxLength',\n minLength: 'minLength',\n pattern: 'pattern',\n required: 'required',\n validate: 'validate',\n};\n","import isHTMLElement from '../utils/isHTMLElement';\nimport { EVENTS } from '../constants';\nimport { Field } from '../types';\n\nexport default function attachEventListeners(\n { ref }: Field,\n shouldAttachChangeEvent?: boolean,\n handleChange?: EventListenerOrEventListenerObject,\n): void {\n if (isHTMLElement(ref) && handleChange) {\n ref.addEventListener(\n shouldAttachChangeEvent ? EVENTS.CHANGE : EVENTS.INPUT,\n handleChange,\n );\n ref.addEventListener(EVENTS.BLUR, handleChange);\n }\n}\n","export default (value: unknown): value is null | undefined => value == null;\n","import isNullOrUndefined from './isNullOrUndefined';\n\nexport const isObjectType = (value: unknown) => typeof value === 'object';\n\nexport default (value: unknown): value is T =>\n !isNullOrUndefined(value) &&\n !Array.isArray(value) &&\n isObjectType(value) &&\n !(value instanceof Date);\n","export default (value: string) => /^\\w*$/.test(value);\n","export default (value: any[]) => value.filter(Boolean);\n","import compact from './compact';\n\nexport default (input: string): string[] =>\n compact(\n input\n .replace(/[\"|']/g, '')\n .replace(/\\[/g, '.')\n .replace(/\\]/g, '')\n .split('.'),\n );\n","import isObject from './isObject';\nimport isKey from './isKey';\nimport stringToPath from './stringToPath';\nimport { FieldValues } from '../types';\n\nexport default function set(\n object: FieldValues,\n path: string,\n value?: unknown,\n) {\n let index = -1;\n const tempPath = isKey(path) ? [path] : stringToPath(path);\n const length = tempPath.length;\n const lastIndex = length - 1;\n\n while (++index < length) {\n const key = tempPath[index];\n let newValue = value;\n\n if (index !== lastIndex) {\n const objValue = object[key];\n newValue =\n isObject(objValue) || Array.isArray(objValue)\n ? objValue\n : !isNaN(+tempPath[index + 1])\n ? []\n : {};\n }\n object[key] = newValue;\n object = object[key];\n }\n return object;\n}\n","import set from '../utils/set';\nimport isKey from '../utils/isKey';\nimport { FieldValues } from '../types';\n\nexport default (data: FieldValues, value: Record = {}): any => {\n for (const key in data) {\n !isKey(key) ? set(value, key, data[key]) : (value[key] = data[key]);\n }\n return value;\n};\n","export default (val: unknown): val is undefined => val === undefined;\n","import isUndefined from './isUndefined';\nimport isNullOrUndefined from './isNullOrUndefined';\nimport compact from './compact';\n\nexport default (obj: any = {}, path: string, defaultValue?: unknown) => {\n const result = compact(path.split(/[,[\\].]+?/)).reduce(\n (result, key) => (isNullOrUndefined(result) ? result : result[key]),\n obj,\n );\n\n return isUndefined(result) || result === obj\n ? isUndefined(obj[path])\n ? defaultValue\n : obj[path]\n : result;\n};\n","import get from '../utils/get';\nimport isUndefined from '../utils/isUndefined';\nimport { FieldErrors, FieldRefs } from '../types';\n\nexport default (\n fields: FieldRefs,\n fieldErrors: FieldErrors,\n) => {\n for (const key in fields) {\n if (get(fieldErrors, key)) {\n const field = fields[key];\n\n if (field) {\n if (field.ref.focus && isUndefined(field.ref.focus())) {\n break;\n } else if (field.options) {\n field.options[0].ref.focus();\n\n break;\n }\n }\n }\n }\n};\n","import isHTMLElement from '../utils/isHTMLElement';\nimport { EVENTS } from '../constants';\nimport { Ref } from '../types';\n\nexport default (\n ref: Ref,\n validateWithStateUpdate: EventListenerOrEventListenerObject,\n): void => {\n if (isHTMLElement(ref) && ref.removeEventListener) {\n ref.removeEventListener(EVENTS.INPUT, validateWithStateUpdate);\n ref.removeEventListener(EVENTS.CHANGE, validateWithStateUpdate);\n ref.removeEventListener(EVENTS.BLUR, validateWithStateUpdate);\n }\n};\n","import { RadioOrCheckboxOption } from '../types';\n\ntype RadioFieldResult = {\n isValid: boolean;\n value: number | string | null;\n};\n\nconst defaultReturn: RadioFieldResult = {\n isValid: false,\n value: null,\n};\n\nexport default (options?: RadioOrCheckboxOption[]): RadioFieldResult =>\n Array.isArray(options)\n ? options.reduce(\n (previous, option): RadioFieldResult =>\n option && option.ref.checked\n ? {\n isValid: true,\n value: option.ref.value,\n }\n : previous,\n defaultReturn,\n )\n : defaultReturn;\n","import { FieldElement } from '../types';\n\nexport default (element: FieldElement): element is HTMLInputElement =>\n element.type === 'radio';\n","import { FieldElement } from '../types';\n\nexport default (element: FieldElement): element is HTMLInputElement =>\n element.type === 'file';\n","import { FieldElement } from '../types';\n\nexport default (element: FieldElement): element is HTMLInputElement =>\n element.type === 'checkbox';\n","import { FieldElement } from '../types';\nimport { SELECT } from '../constants';\n\nexport default (element: FieldElement): element is HTMLSelectElement =>\n element.type === `${SELECT}-multiple`;\n","import isUndefined from '../utils/isUndefined';\nimport { RadioOrCheckboxOption } from '../types';\n\ntype CheckboxFieldResult = {\n isValid: boolean;\n value: string | string[] | boolean;\n};\n\nconst defaultResult: CheckboxFieldResult = {\n value: false,\n isValid: false,\n};\n\nconst validResult = { value: true, isValid: true };\n\nexport default (options?: RadioOrCheckboxOption[]): CheckboxFieldResult => {\n if (Array.isArray(options)) {\n if (options.length > 1) {\n const values = options\n .filter((option) => option && option.ref.checked)\n .map(({ ref: { value } }) => value);\n return { value: values, isValid: !!values.length };\n }\n\n const { checked, value, attributes } = options[0].ref;\n\n return checked\n ? attributes && !isUndefined((attributes as any).value)\n ? isUndefined(value) || value === ''\n ? validResult\n : { value: value, isValid: true }\n : validResult\n : defaultResult;\n }\n\n return defaultResult;\n};\n","import * as React from 'react';\nimport getRadioValue from './getRadioValue';\nimport getMultipleSelectValue from './getMultipleSelectValue';\nimport isRadioInput from '../utils/isRadioInput';\nimport get from '../utils/get';\nimport isFileInput from '../utils/isFileInput';\nimport isCheckBox from '../utils/isCheckBoxInput';\nimport isMultipleSelect from '../utils/isMultipleSelect';\nimport getCheckboxValue from './getCheckboxValue';\nimport { FieldRefs, FieldValues, InternalFieldName } from '../types';\n\nexport default function getFieldValue(\n fieldsRef: React.MutableRefObject>,\n name: InternalFieldName