diff --git a/dist/cjs/index.js b/dist/cjs/index.js index 0790981d..1431327e 100644 --- a/dist/cjs/index.js +++ b/dist/cjs/index.js @@ -2,11 +2,12 @@ Object.defineProperty(exports, '__esModule', { value: true }); +var dceCommonkit = require('dce-commonkit'); var React = require('react'); var freeSolidSvgIcons = require('@fortawesome/free-solid-svg-icons'); var reactFontawesome = require('@fortawesome/react-fontawesome'); +var ReactDOM = require('react-dom'); var freeRegularSvgIcons = require('@fortawesome/free-regular-svg-icons'); -var clone = require('nanoclone'); function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } @@ -30,7 +31,7 @@ function _interopNamespace(e) { var React__default = /*#__PURE__*/_interopDefaultLegacy(React); var React__namespace = /*#__PURE__*/_interopNamespace(React); -var clone__default = /*#__PURE__*/_interopDefaultLegacy(clone); +var ReactDOM__default = /*#__PURE__*/_interopDefaultLegacy(ReactDOM); /*! ***************************************************************************** Copyright (c) Microsoft Corporation. @@ -57,23 +58,6 @@ function __awaiter(thisArg, _arguments, P, generator) { }); } -// Highest error code = DRK37 -/** - * List of error codes built into the react kit - * @author Gabe Abrams - */ -var ReactKitErrorCode; -(function (ReactKitErrorCode) { - ReactKitErrorCode["NoResponse"] = "DRK1"; - ReactKitErrorCode["NoCode"] = "DRK2"; - ReactKitErrorCode["SessionExpired"] = "DRK3"; - ReactKitErrorCode["NoCACCLSendRequestFunction"] = "DRK7"; - ReactKitErrorCode["SimpleDateChooserInvalidDateRange"] = "DRK35"; - ReactKitErrorCode["SimpleDateChooserInvalidNumMonths"] = "DRK36"; - ReactKitErrorCode["ETTimestampInvalid"] = "DRK37"; -})(ReactKitErrorCode || (ReactKitErrorCode = {})); -var ReactKitErrorCode$1 = ReactKitErrorCode; - /** * Bootstrap variants * @author Gabe Abrams @@ -129,7 +113,7 @@ const ErrorBox = (props) => { } }, "code:", ' ', - String((_a = error.code) !== null && _a !== void 0 ? _a : ReactKitErrorCode$1.NoCode).toUpperCase()))); + String((_a = error.code) !== null && _a !== void 0 ? _a : dceCommonkit.CommonKitErrorCode.NoCode).toUpperCase()))); } // Main UI return (React__default["default"].createElement("div", { className: `alert alert-${variant} text-center`, style: { @@ -184,724 +168,6 @@ var ModalType; })(ModalType || (ModalType = {})); var ModalType$1 = ModalType; -/** - * Built-in metadata for logs - * @author Gabe Abrams - */ -const LogBuiltInMetadata = { - // Contexts - Context: { - Uncategorized: 'Uncategorized', - ServerRenderedErrorPage: 'ServerRenderedErrorPage', - ServerEndpointError: 'ServerEndpointError', - ClientFatalError: 'ClientFatalError', - }, - // Targets - Target: { - NoTarget: 'NoTarget', - }, -}; - -function getDefaultExportFromCjs (x) { - return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x; -} - -var reactDom = {exports: {}}; - -var reactDom_production = {}; - -/** - * @license React - * react-dom.production.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -var hasRequiredReactDom_production; - -function requireReactDom_production () { - if (hasRequiredReactDom_production) return reactDom_production; - hasRequiredReactDom_production = 1; - var React = React__default["default"]; - function formatProdErrorMessage(code) { - var url = "https://react.dev/errors/" + code; - if (1 < arguments.length) { - url += "?args[]=" + encodeURIComponent(arguments[1]); - for (var i = 2; i < arguments.length; i++) - url += "&args[]=" + encodeURIComponent(arguments[i]); - } - return ( - "Minified React error #" + - code + - "; visit " + - url + - " for the full message or use the non-minified dev environment for full errors and additional helpful warnings." - ); - } - function noop() {} - var Internals = { - d: { - f: noop, - r: function () { - throw Error(formatProdErrorMessage(522)); - }, - D: noop, - C: noop, - L: noop, - m: noop, - X: noop, - S: noop, - M: noop - }, - p: 0, - findDOMNode: null - }, - REACT_PORTAL_TYPE = Symbol.for("react.portal"); - function createPortal$1(children, containerInfo, implementation) { - var key = - 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; - return { - $$typeof: REACT_PORTAL_TYPE, - key: null == key ? null : "" + key, - children: children, - containerInfo: containerInfo, - implementation: implementation - }; - } - var ReactSharedInternals = - React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; - function getCrossOriginStringAs(as, input) { - if ("font" === as) return ""; - if ("string" === typeof input) - return "use-credentials" === input ? input : ""; - } - reactDom_production.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = - Internals; - reactDom_production.createPortal = function (children, container) { - var key = - 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null; - if ( - !container || - (1 !== container.nodeType && - 9 !== container.nodeType && - 11 !== container.nodeType) - ) - throw Error(formatProdErrorMessage(299)); - return createPortal$1(children, container, null, key); - }; - reactDom_production.flushSync = function (fn) { - var previousTransition = ReactSharedInternals.T, - previousUpdatePriority = Internals.p; - try { - if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn(); - } finally { - (ReactSharedInternals.T = previousTransition), - (Internals.p = previousUpdatePriority), - Internals.d.f(); - } - }; - reactDom_production.preconnect = function (href, options) { - "string" === typeof href && - (options - ? ((options = options.crossOrigin), - (options = - "string" === typeof options - ? "use-credentials" === options - ? options - : "" - : void 0)) - : (options = null), - Internals.d.C(href, options)); - }; - reactDom_production.prefetchDNS = function (href) { - "string" === typeof href && Internals.d.D(href); - }; - reactDom_production.preinit = function (href, options) { - if ("string" === typeof href && options && "string" === typeof options.as) { - var as = options.as, - crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), - integrity = - "string" === typeof options.integrity ? options.integrity : void 0, - fetchPriority = - "string" === typeof options.fetchPriority - ? options.fetchPriority - : void 0; - "style" === as - ? Internals.d.S( - href, - "string" === typeof options.precedence ? options.precedence : void 0, - { - crossOrigin: crossOrigin, - integrity: integrity, - fetchPriority: fetchPriority - } - ) - : "script" === as && - Internals.d.X(href, { - crossOrigin: crossOrigin, - integrity: integrity, - fetchPriority: fetchPriority, - nonce: "string" === typeof options.nonce ? options.nonce : void 0 - }); - } - }; - reactDom_production.preinitModule = function (href, options) { - if ("string" === typeof href) - if ("object" === typeof options && null !== options) { - if (null == options.as || "script" === options.as) { - var crossOrigin = getCrossOriginStringAs( - options.as, - options.crossOrigin - ); - Internals.d.M(href, { - crossOrigin: crossOrigin, - integrity: - "string" === typeof options.integrity ? options.integrity : void 0, - nonce: "string" === typeof options.nonce ? options.nonce : void 0 - }); - } - } else null == options && Internals.d.M(href); - }; - reactDom_production.preload = function (href, options) { - if ( - "string" === typeof href && - "object" === typeof options && - null !== options && - "string" === typeof options.as - ) { - var as = options.as, - crossOrigin = getCrossOriginStringAs(as, options.crossOrigin); - Internals.d.L(href, as, { - crossOrigin: crossOrigin, - integrity: - "string" === typeof options.integrity ? options.integrity : void 0, - nonce: "string" === typeof options.nonce ? options.nonce : void 0, - type: "string" === typeof options.type ? options.type : void 0, - fetchPriority: - "string" === typeof options.fetchPriority - ? options.fetchPriority - : void 0, - referrerPolicy: - "string" === typeof options.referrerPolicy - ? options.referrerPolicy - : void 0, - imageSrcSet: - "string" === typeof options.imageSrcSet ? options.imageSrcSet : void 0, - imageSizes: - "string" === typeof options.imageSizes ? options.imageSizes : void 0, - media: "string" === typeof options.media ? options.media : void 0 - }); - } - }; - reactDom_production.preloadModule = function (href, options) { - if ("string" === typeof href) - if (options) { - var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin); - Internals.d.m(href, { - as: - "string" === typeof options.as && "script" !== options.as - ? options.as - : void 0, - crossOrigin: crossOrigin, - integrity: - "string" === typeof options.integrity ? options.integrity : void 0 - }); - } else Internals.d.m(href); - }; - reactDom_production.requestFormReset = function (form) { - Internals.d.r(form); - }; - reactDom_production.unstable_batchedUpdates = function (fn, a) { - return fn(a); - }; - reactDom_production.useFormState = function (action, initialState, permalink) { - return ReactSharedInternals.H.useFormState(action, initialState, permalink); - }; - reactDom_production.useFormStatus = function () { - return ReactSharedInternals.H.useHostTransitionStatus(); - }; - reactDom_production.version = "19.0.0"; - return reactDom_production; -} - -var reactDom_development = {}; - -/** - * @license React - * react-dom.development.js - * - * Copyright (c) Meta Platforms, Inc. and affiliates. - * - * This source code is licensed under the MIT license found in the - * LICENSE file in the root directory of this source tree. - */ - -var hasRequiredReactDom_development; - -function requireReactDom_development () { - if (hasRequiredReactDom_development) return reactDom_development; - hasRequiredReactDom_development = 1; - "production" !== process.env.NODE_ENV && - (function () { - function noop() {} - function testStringCoercion(value) { - return "" + value; - } - function createPortal$1(children, containerInfo, implementation) { - var key = - 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null; - try { - testStringCoercion(key); - var JSCompiler_inline_result = !1; - } catch (e) { - JSCompiler_inline_result = !0; - } - JSCompiler_inline_result && - (console.error( - "The provided key is an unsupported type %s. This value must be coerced to a string before using it here.", - ("function" === typeof Symbol && - Symbol.toStringTag && - key[Symbol.toStringTag]) || - key.constructor.name || - "Object" - ), - testStringCoercion(key)); - return { - $$typeof: REACT_PORTAL_TYPE, - key: null == key ? null : "" + key, - children: children, - containerInfo: containerInfo, - implementation: implementation - }; - } - function getCrossOriginStringAs(as, input) { - if ("font" === as) return ""; - if ("string" === typeof input) - return "use-credentials" === input ? input : ""; - } - function getValueDescriptorExpectingObjectForWarning(thing) { - return null === thing - ? "`null`" - : void 0 === thing - ? "`undefined`" - : "" === thing - ? "an empty string" - : 'something with type "' + typeof thing + '"'; - } - function getValueDescriptorExpectingEnumForWarning(thing) { - return null === thing - ? "`null`" - : void 0 === thing - ? "`undefined`" - : "" === thing - ? "an empty string" - : "string" === typeof thing - ? JSON.stringify(thing) - : "number" === typeof thing - ? "`" + thing + "`" - : 'something with type "' + typeof thing + '"'; - } - function resolveDispatcher() { - var dispatcher = ReactSharedInternals.H; - null === dispatcher && - console.error( - "Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\n1. You might have mismatching versions of React and the renderer (such as React DOM)\n2. You might be breaking the Rules of Hooks\n3. You might have more than one copy of React in the same app\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem." - ); - return dispatcher; - } - "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && - "function" === - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart && - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()); - var React = React__default["default"], - Internals = { - d: { - f: noop, - r: function () { - throw Error( - "Invalid form element. requestFormReset must be passed a form that was rendered by React." - ); - }, - D: noop, - C: noop, - L: noop, - m: noop, - X: noop, - S: noop, - M: noop - }, - p: 0, - findDOMNode: null - }, - REACT_PORTAL_TYPE = Symbol.for("react.portal"), - ReactSharedInternals = - React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE; - ("function" === typeof Map && - null != Map.prototype && - "function" === typeof Map.prototype.forEach && - "function" === typeof Set && - null != Set.prototype && - "function" === typeof Set.prototype.clear && - "function" === typeof Set.prototype.forEach) || - console.error( - "React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills" - ); - reactDom_development.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = - Internals; - reactDom_development.createPortal = function (children, container) { - var key = - 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null; - if ( - !container || - (1 !== container.nodeType && - 9 !== container.nodeType && - 11 !== container.nodeType) - ) - throw Error("Target container is not a DOM element."); - return createPortal$1(children, container, null, key); - }; - reactDom_development.flushSync = function (fn) { - var previousTransition = ReactSharedInternals.T, - previousUpdatePriority = Internals.p; - try { - if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) - return fn(); - } finally { - (ReactSharedInternals.T = previousTransition), - (Internals.p = previousUpdatePriority), - Internals.d.f() && - console.error( - "flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task." - ); - } - }; - reactDom_development.preconnect = function (href, options) { - "string" === typeof href && href - ? null != options && "object" !== typeof options - ? console.error( - "ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.", - getValueDescriptorExpectingEnumForWarning(options) - ) - : null != options && - "string" !== typeof options.crossOrigin && - console.error( - "ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.", - getValueDescriptorExpectingObjectForWarning(options.crossOrigin) - ) - : console.error( - "ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", - getValueDescriptorExpectingObjectForWarning(href) - ); - "string" === typeof href && - (options - ? ((options = options.crossOrigin), - (options = - "string" === typeof options - ? "use-credentials" === options - ? options - : "" - : void 0)) - : (options = null), - Internals.d.C(href, options)); - }; - reactDom_development.prefetchDNS = function (href) { - if ("string" !== typeof href || !href) - console.error( - "ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", - getValueDescriptorExpectingObjectForWarning(href) - ); - else if (1 < arguments.length) { - var options = arguments[1]; - "object" === typeof options && options.hasOwnProperty("crossOrigin") - ? console.error( - "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", - getValueDescriptorExpectingEnumForWarning(options) - ) - : console.error( - "ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.", - getValueDescriptorExpectingEnumForWarning(options) - ); - } - "string" === typeof href && Internals.d.D(href); - }; - reactDom_development.preinit = function (href, options) { - "string" === typeof href && href - ? null == options || "object" !== typeof options - ? console.error( - "ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.", - getValueDescriptorExpectingEnumForWarning(options) - ) - : "style" !== options.as && - "script" !== options.as && - console.error( - 'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are "style" and "script".', - getValueDescriptorExpectingEnumForWarning(options.as) - ) - : console.error( - "ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.", - getValueDescriptorExpectingObjectForWarning(href) - ); - if ( - "string" === typeof href && - options && - "string" === typeof options.as - ) { - var as = options.as, - crossOrigin = getCrossOriginStringAs(as, options.crossOrigin), - integrity = - "string" === typeof options.integrity ? options.integrity : void 0, - fetchPriority = - "string" === typeof options.fetchPriority - ? options.fetchPriority - : void 0; - "style" === as - ? Internals.d.S( - href, - "string" === typeof options.precedence - ? options.precedence - : void 0, - { - crossOrigin: crossOrigin, - integrity: integrity, - fetchPriority: fetchPriority - } - ) - : "script" === as && - Internals.d.X(href, { - crossOrigin: crossOrigin, - integrity: integrity, - fetchPriority: fetchPriority, - nonce: "string" === typeof options.nonce ? options.nonce : void 0 - }); - } - }; - reactDom_development.preinitModule = function (href, options) { - var encountered = ""; - ("string" === typeof href && href) || - (encountered += - " The `href` argument encountered was " + - getValueDescriptorExpectingObjectForWarning(href) + - "."); - void 0 !== options && "object" !== typeof options - ? (encountered += - " The `options` argument encountered was " + - getValueDescriptorExpectingObjectForWarning(options) + - ".") - : options && - "as" in options && - "script" !== options.as && - (encountered += - " The `as` option encountered was " + - getValueDescriptorExpectingEnumForWarning(options.as) + - "."); - if (encountered) - console.error( - "ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s", - encountered - ); - else - switch ( - ((encountered = - options && "string" === typeof options.as ? options.as : "script"), - encountered) - ) { - case "script": - break; - default: - (encountered = - getValueDescriptorExpectingEnumForWarning(encountered)), - console.error( - 'ReactDOM.preinitModule(): Currently the only supported "as" type for this function is "script" but received "%s" instead. This warning was generated for `href` "%s". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)', - encountered, - href - ); - } - if ("string" === typeof href) - if ("object" === typeof options && null !== options) { - if (null == options.as || "script" === options.as) - (encountered = getCrossOriginStringAs( - options.as, - options.crossOrigin - )), - Internals.d.M(href, { - crossOrigin: encountered, - integrity: - "string" === typeof options.integrity - ? options.integrity - : void 0, - nonce: - "string" === typeof options.nonce ? options.nonce : void 0 - }); - } else null == options && Internals.d.M(href); - }; - reactDom_development.preload = function (href, options) { - var encountered = ""; - ("string" === typeof href && href) || - (encountered += - " The `href` argument encountered was " + - getValueDescriptorExpectingObjectForWarning(href) + - "."); - null == options || "object" !== typeof options - ? (encountered += - " The `options` argument encountered was " + - getValueDescriptorExpectingObjectForWarning(options) + - ".") - : ("string" === typeof options.as && options.as) || - (encountered += - " The `as` option encountered was " + - getValueDescriptorExpectingObjectForWarning(options.as) + - "."); - encountered && - console.error( - 'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `` tag.%s', - encountered - ); - if ( - "string" === typeof href && - "object" === typeof options && - null !== options && - "string" === typeof options.as - ) { - encountered = options.as; - var crossOrigin = getCrossOriginStringAs( - encountered, - options.crossOrigin - ); - Internals.d.L(href, encountered, { - crossOrigin: crossOrigin, - integrity: - "string" === typeof options.integrity ? options.integrity : void 0, - nonce: "string" === typeof options.nonce ? options.nonce : void 0, - type: "string" === typeof options.type ? options.type : void 0, - fetchPriority: - "string" === typeof options.fetchPriority - ? options.fetchPriority - : void 0, - referrerPolicy: - "string" === typeof options.referrerPolicy - ? options.referrerPolicy - : void 0, - imageSrcSet: - "string" === typeof options.imageSrcSet - ? options.imageSrcSet - : void 0, - imageSizes: - "string" === typeof options.imageSizes - ? options.imageSizes - : void 0, - media: "string" === typeof options.media ? options.media : void 0 - }); - } - }; - reactDom_development.preloadModule = function (href, options) { - var encountered = ""; - ("string" === typeof href && href) || - (encountered += - " The `href` argument encountered was " + - getValueDescriptorExpectingObjectForWarning(href) + - "."); - void 0 !== options && "object" !== typeof options - ? (encountered += - " The `options` argument encountered was " + - getValueDescriptorExpectingObjectForWarning(options) + - ".") - : options && - "as" in options && - "string" !== typeof options.as && - (encountered += - " The `as` option encountered was " + - getValueDescriptorExpectingObjectForWarning(options.as) + - "."); - encountered && - console.error( - 'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `` tag.%s', - encountered - ); - "string" === typeof href && - (options - ? ((encountered = getCrossOriginStringAs( - options.as, - options.crossOrigin - )), - Internals.d.m(href, { - as: - "string" === typeof options.as && "script" !== options.as - ? options.as - : void 0, - crossOrigin: encountered, - integrity: - "string" === typeof options.integrity - ? options.integrity - : void 0 - })) - : Internals.d.m(href)); - }; - reactDom_development.requestFormReset = function (form) { - Internals.d.r(form); - }; - reactDom_development.unstable_batchedUpdates = function (fn, a) { - return fn(a); - }; - reactDom_development.useFormState = function (action, initialState, permalink) { - return resolveDispatcher().useFormState(action, initialState, permalink); - }; - reactDom_development.useFormStatus = function () { - return resolveDispatcher().useHostTransitionStatus(); - }; - reactDom_development.version = "19.0.0"; - "undefined" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ && - "function" === - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop && - __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error()); - })(); - return reactDom_development; -} - -(function (module) { - - function checkDCE() { - /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ - if ( - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' || - typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function' - ) { - return; - } - if (process.env.NODE_ENV !== 'production') { - // This branch is unreachable because this function is only called - // in production, but the condition is true only in development. - // Therefore if the branch is still here, dead code elimination wasn't - // properly applied. - // Don't change the message. React DevTools relies on it. Also make sure - // this message doesn't occur elsewhere in this function, or it will cause - // a false positive. - throw new Error('^_^'); - } - try { - // Verify that the code above has been dead code eliminated (DCE'd). - __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE); - } catch (err) { - // DevTools shouldn't crash React, no matter what. - // We should still report in case we break this code. - console.error(err); - } - } - - if (process.env.NODE_ENV === 'production') { - // DCE check should happen before ReactDOM bundle executes so that - // DevTools can report bad minification during injection. - checkDCE(); - module.exports = requireReactDom_production(); - } else { - module.exports = requireReactDom_development(); - } -} (reactDom)); - -var ReactDOM = /*@__PURE__*/getDefaultExportFromCjs(reactDom.exports); - /** * Loading spinner/indicator * @author Gabe Abrams @@ -994,17 +260,6 @@ const LoadingSpinner = () => { React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faCircle, className: "LoadingSpinner-blip-4" }))); }; -/** - * Wait for a certain number of ms - * @author Gabe Abrams - * @param ms number of ms to wait - */ -const waitMs = (ms = 0) => __awaiter(void 0, void 0, void 0, function* () { - return new Promise((resolve) => { - setTimeout(resolve, ms); - }); -}); - /** * Modal sizes * @author Gabe Abrams @@ -1024,18 +279,6 @@ var ModalSize$1 = ModalSize; */ const NUM_MODAL_PORTALS = 50; -/** - * An error with a code - * @author Gabe Abrams - */ -class ErrorWithCode extends Error { - constructor(message, code) { - super(message); - this.name = 'ErrorWithCode'; - this.code = code; - } -} - /*----------------------------------------*/ /* ---- Static Variables and Getters ---- */ /*----------------------------------------*/ @@ -1064,9 +307,9 @@ const getSendRequest = () => __awaiter(void 0, void 0, void 0, function* () { // Show timeout error if too much time passes let successful = false; (() => __awaiter(void 0, void 0, void 0, function* () { - yield waitMs(5000); + yield dceCommonkit.waitMs(5000); if (!successful) { - showFatalError(new ErrorWithCode('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', ReactKitErrorCode$1.NoCACCLSendRequestFunction)); + showFatalError(new dceCommonkit.ErrorWithCode('Could not send a request because the request needed to be sent before dce-reactkit was properly initialized. Perhaps dce-reactkit was not initialized with initClient.', dceCommonkit.CommonKitErrorCode.NoCACCLSendRequestFunction)); } }))(); // Wait for initialization @@ -1352,14 +595,14 @@ const Modal = (props) => { setAnimatingIn(true); setAnimatingPop(false); // Wait for animation - yield waitMs(MS_TO_ANIMATE); + yield dceCommonkit.waitMs(MS_TO_ANIMATE); // Update to state after animated in if (mounted.current) { setAnimatingIn(false); } if (isLoading) { // wait before showing modal - yield waitMs(MS_TO_WAIT_BEFORE_SHOWING_LOADING_INDICATOR); + yield dceCommonkit.waitMs(MS_TO_WAIT_BEFORE_SHOWING_LOADING_INDICATOR); if (mounted.current) { setShowModal(true); } @@ -1460,7 +703,7 @@ const Modal = (props) => { if (!animatingPop) { setAnimatingPop(true); // Wait then stop pop animation - yield waitMs(MS_TO_ANIMATE); + yield dceCommonkit.waitMs(MS_TO_ANIMATE); setAnimatingPop(false); } return; @@ -1534,33 +777,9 @@ const Modal = (props) => { // Determine which portal to use const portalNumber = id.current % NUM_MODAL_PORTALS; // Render in a portal - return ReactDOM.createPortal(contentToRender, document.getElementById(`modal-portal-${portalNumber}`)); + return ReactDOM__default["default"].createPortal(contentToRender, document.getElementById(`modal-portal-${portalNumber}`)); }; -/** - * Path that all routes start with - * @author Gabe Abrams - */ -const ROUTE_PATH_PREFIX = '/dce-reactkit'; - -/** - * Path of the route for storing client-side logs - * @author Gabe Abrams - */ -const LOG_ROUTE_PATH = `${ROUTE_PATH_PREFIX}/log`; - -/** - * Allowed log levels - * @author Gabe Abrams - */ -var LogLevel; -(function (LogLevel) { - LogLevel["Warn"] = "Warn"; - LogLevel["Info"] = "Info"; - LogLevel["Debug"] = "Debug"; -})(LogLevel || (LogLevel = {})); -var LogLevel$1 = LogLevel; - /*------------------------------------------------------------------------*/ /* Stub Logic */ /*------------------------------------------------------------------------*/ @@ -1581,7 +800,7 @@ const _setStubResponse = (opts) => { const { path, body, } = opts; const method = ((_a = opts.method) !== null && _a !== void 0 ? _a : 'GET').toUpperCase(); const errorMessage = ((_b = opts.errorMessage) !== null && _b !== void 0 ? _b : 'An unknown error has occurred.'); - const errorCode = ((_c = opts.errorCode) !== null && _c !== void 0 ? _c : ReactKitErrorCode$1.NoCode); + const errorCode = ((_c = opts.errorCode) !== null && _c !== void 0 ? _c : dceCommonkit.CommonKitErrorCode.NoCode); // Store to stub responses if (!stubResponses[method]) { stubResponses[method] = {}; @@ -1628,7 +847,7 @@ const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function return stubResponse.body; } // Error - throw new ErrorWithCode(stubResponse.errorMessage, stubResponse.errorCode); + throw new dceCommonkit.ErrorWithCode(stubResponse.errorMessage, stubResponse.errorCode); } // Remove properties with undefined values let params; @@ -1659,11 +878,11 @@ const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function }); // Check for failure if (!response || !response.body) { - throw new ErrorWithCode('We didn\'t get a response from the server. Please check your internet connection.', ReactKitErrorCode$1.NoResponse); + throw new dceCommonkit.ErrorWithCode('We didn\'t get a response from the server. Please check your internet connection.', dceCommonkit.CommonKitErrorCode.NoResponse); } if (!response.body.success) { // Session expired - if (response.body.code === ReactKitErrorCode$1.SessionExpired) { + if (response.body.code === dceCommonkit.CommonKitErrorCode.SessionExpired) { showSessionExpiredMessage(); // Never return (don't continue execution) yield new Promise(() => { @@ -1671,9 +890,9 @@ const visitServerEndpoint = (opts) => __awaiter(void 0, void 0, void 0, function }); } // Other errors - throw new ErrorWithCode((response.body.message + throw new dceCommonkit.ErrorWithCode((response.body.message || 'An unknown error occurred. Please contact an admin.'), (response.body.code - || ReactKitErrorCode$1.NoCode)); + || dceCommonkit.CommonKitErrorCode.NoCode)); } // Success! Extract the body const { body } = response.body; @@ -1719,14 +938,14 @@ const logClientEvent = (opts) => __awaiter(void 0, void 0, void 0, function* () } // Send to server return visitServerEndpoint({ - path: LOG_ROUTE_PATH, + path: dceCommonkit.LOG_ROUTE_PATH, method: 'POST', params: { context: (typeof opts.context === 'string' ? opts.context - : ((_c = ((_b = opts.context) !== null && _b !== void 0 ? _b : {})._) !== null && _c !== void 0 ? _c : LogBuiltInMetadata.Context.Uncategorized)), - subcontext: ((_d = opts.subcontext) !== null && _d !== void 0 ? _d : LogBuiltInMetadata.Context.Uncategorized), - level: ((_e = opts.level) !== null && _e !== void 0 ? _e : LogLevel$1.Info), + : ((_c = ((_b = opts.context) !== null && _b !== void 0 ? _b : {})._) !== null && _c !== void 0 ? _c : dceCommonkit.LogBuiltInMetadata.Context.Uncategorized)), + subcontext: ((_d = opts.subcontext) !== null && _d !== void 0 ? _d : dceCommonkit.LogBuiltInMetadata.Context.Uncategorized), + level: ((_e = opts.level) !== null && _e !== void 0 ? _e : dceCommonkit.LogLevel.Info), tags: JSON.stringify((_f = opts.tags) !== null && _f !== void 0 ? _f : []), metadata: JSON.stringify(metadata), errorMessage: (opts.error @@ -1739,7 +958,7 @@ const logClientEvent = (opts) => __awaiter(void 0, void 0, void 0, function* () ? opts.error.stack : undefined), target: (opts.action - ? ((_g = opts.target) !== null && _g !== void 0 ? _g : LogBuiltInMetadata.Target.NoTarget) + ? ((_g = opts.target) !== null && _g !== void 0 ? _g : dceCommonkit.LogBuiltInMetadata.Target.NoTarget) : undefined), action: (opts.action ? opts.action @@ -1795,7 +1014,7 @@ const waitForHelper = (checkForHelper) => __awaiter(void 0, void 0, void 0, func return false; } // Wait a little while - yield waitMs(10); + yield dceCommonkit.waitMs(10); } // Helper exists return true; @@ -2022,8 +1241,8 @@ const showFatalError = (error, errorTitle = 'An Error Occurred') => __awaiter(vo ? error.trim() : String((_c = error.message) !== null && _c !== void 0 ? _c : 'An unknown error occurred.')); const code = (typeof error === 'string' - ? ReactKitErrorCode$1.NoCode - : String((_d = error.code) !== null && _d !== void 0 ? _d : ReactKitErrorCode$1.NoCode)); + ? dceCommonkit.CommonKitErrorCode.NoCode + : String((_d = error.code) !== null && _d !== void 0 ? _d : dceCommonkit.CommonKitErrorCode.NoCode)); // Call all fatal error listeners try { fatalErrorHandlers.forEach((handler) => { @@ -2035,7 +1254,7 @@ const showFatalError = (error, errorTitle = 'An Error Occurred') => __awaiter(vo } // Add log logClientEvent({ - context: LogBuiltInMetadata.Context.ClientFatalError, + context: dceCommonkit.LogBuiltInMetadata.Context.ClientFatalError, error: { message, code, @@ -2254,8 +1473,8 @@ const AppWrapper = (props) => { && (fatalErrorMessage || fatalErrorCode || sessionHasExpired)) { // Re-encapsulate in an error const error = (sessionHasExpired - ? new ErrorWithCode(getSessionExpiredMessage(), ReactKitErrorCode$1.SessionExpired) - : new ErrorWithCode((fatalErrorMessage !== null && fatalErrorMessage !== void 0 ? fatalErrorMessage : 'An unknown error has occurred. Please contact support.'), (fatalErrorCode !== null && fatalErrorCode !== void 0 ? fatalErrorCode : ReactKitErrorCode$1.NoCode))); + ? new dceCommonkit.ErrorWithCode(getSessionExpiredMessage(), dceCommonkit.CommonKitErrorCode.SessionExpired) + : new dceCommonkit.ErrorWithCode((fatalErrorMessage !== null && fatalErrorMessage !== void 0 ? fatalErrorMessage : 'An unknown error has occurred. Please contact support.'), (fatalErrorCode !== null && fatalErrorCode !== void 0 ? fatalErrorCode : dceCommonkit.CommonKitErrorCode.NoCode))); // Choose error box variant let errorBoxVariant = Variant$1.Danger; if (sessionHasExpired) { @@ -2552,111 +1771,6 @@ const ButtonInputGroup = (props) => { : children)))); }; -// Constants -const ORDINALS = ['th', 'st', 'nd', 'rd']; -/** - * Get a number's ordinal - * @author Gabe Abrams - * @param num the number being analyzed - * @returns ordinal - */ -const getOrdinal = (num) => { - var _a, _b; - return ((_b = (_a = ORDINALS[(num - 20) % 10]) !== null && _a !== void 0 ? _a : ORDINALS[num]) !== null && _b !== void 0 ? _b : ORDINALS[0]); -}; - -const monthNames = [ - { short: 'Jan', full: 'January' }, - { short: 'Feb', full: 'February' }, - { short: 'Mar', full: 'March' }, - { short: 'Apr', full: 'April' }, - { short: 'May', full: 'May' }, - { short: 'Jun', full: 'June' }, - { short: 'Jul', full: 'July' }, - { short: 'Aug', full: 'August' }, - { short: 'Sep', full: 'September' }, - { short: 'Oct', full: 'October' }, - { short: 'Nov', full: 'November' }, - { short: 'Dec', full: 'December' }, -]; -/** - * Get the name of a month given the month number (1 = January, etc.) - * If an invalid number is provided, we will treat it like January - * @author Gabe Abrams - * @param month the number of the month - * @returns object containing multiple month name formats: - * { short, full } where short will look like "Jan" and full will look like - * "January" - */ -const getMonthName = (month) => { - var _a; - return ((_a = monthNames[month - 1]) !== null && _a !== void 0 ? _a : monthNames[0]); -}; - -/** - * Get current time info in US Boston Eastern Time, independent of machine - * timezone - * @author Gabe Abrams - * @param [dateOrTimestamp=now] the date to get info on or a ms since epoch timestamp - * @returns object with timestamp (ms since epoch) and numbers - * corresponding to ET time values for year, month, day, hour, hour12, minute, second, isPM - * where hour is in 24hr time and hour12 is in 12hr time. - */ -const getTimeInfoInET = (dateOrTimestamp) => { - // Create a time string - let d; - if (!dateOrTimestamp) { - // Use now - d = new Date(); - } - else if (typeof dateOrTimestamp === 'number') { - // Convert to date - d = new Date(dateOrTimestamp); - } - else { - // Already a date - d = dateOrTimestamp; - } - const str = d.toLocaleString('en-US', // Using US encoding (it's the only one installed on containers) - { timeZone: 'America/New_York' }); - // Parse the string for the date/time info - const [dateStr, timeStr] = str.split(', '); // Format: MM/DD/YYYY, HH:MM:SS AM - const [monthStr, dayStr, yearStr] = dateStr.split('/'); // Format: MM/DD/YYYY - const [hourStr, minStr, ending] = timeStr.split(':'); // Format: HH:MM:SS AM - // Create all time numbers - const timestamp = d.getTime(); - const year = Number.parseInt(yearStr, 10); - const month = Number.parseInt(monthStr, 10); - const day = Number.parseInt(dayStr, 10); - const minute = Number.parseInt(minStr, 10); - const second = (ending.split(' ')[0] - ? Number.parseInt(ending.split(' ')[0], 10) - : 0); - const hour12 = Number.parseInt(hourStr, 10); - // Convert from am/pm to 24hr - const isAM = ending.toLowerCase().includes('am'); - const isPM = !isAM; - let hour = hour12; - if (isPM && hour12 !== 12) { - hour += 12; - } - else if (isAM && hour12 === 12) { - hour = 0; - } - // Return - return { - timestamp, - year, - month, - day, - hour, - hour12, - isPM, - minute, - second, - }; -}; - /** * A very simple, lightweight date chooser * @author Gabe Abrams @@ -2714,17 +1828,17 @@ const getChoices = (opts) => { // Destructure props const { dontAllowFuture, dontAllowPast, numMonthsToShow = 6, } = opts; // Determine the set of choices allowed - const today = getTimeInfoInET(); + const today = dceCommonkit.getTimeInfoInET(); const choices = []; let startYear = today.year; let startMonth = today.month; // Don't allow past or future dates if (dontAllowPast && dontAllowFuture) { - throw new ErrorWithCode('No past or future dates allowed', ReactKitErrorCode$1.SimpleDateChooserInvalidDateRange); + throw new dceCommonkit.ErrorWithCode('No past or future dates allowed', dceCommonkit.CommonKitErrorCode.SimpleDateChooserInvalidDateRange); } // Require numMonthsToShow to be positive if (numMonthsToShow <= 0) { - throw new ErrorWithCode('numMonthsToShow must be positive', ReactKitErrorCode$1.SimpleDateChooserInvalidNumMonths); + throw new dceCommonkit.ErrorWithCode('numMonthsToShow must be positive', dceCommonkit.CommonKitErrorCode.SimpleDateChooserInvalidNumMonths); } // Recalculate startMonth and startYear when allowing past dates if (!dontAllowPast) { @@ -2746,7 +1860,7 @@ const getChoices = (opts) => { while (month > 12) { month -= 12; } - const monthName = getMonthName(month).full; + const monthName = dceCommonkit.getMonthName(month).full; // Year is start year +1 for each 12 months let yearsToAdd = 0; let monthsOfYearsToAdd = unmoddedMonth; @@ -2857,7 +1971,7 @@ const SimpleDateChooser = (props) => { // Check if user confirmed if (confirmed) { // Update the date to today - const today = getTimeInfoInET(); + const today = dceCommonkit.getTimeInfoInET(); onChange(today.month, today.day, today.year); // Update state dispatch({ @@ -2888,7 +2002,7 @@ const SimpleDateChooser = (props) => { if (month === choice.month) { // Create day options choice.days.forEach((dayChoice) => { - const ordinal = getOrdinal(dayChoice); + const ordinal = dceCommonkit.getOrdinal(dayChoice); dayOptions.push(React__default["default"].createElement("option", { key: `${choice.year}-${choice.month}-${dayChoice}`, value: dayChoice, "aria-label": `choose date ${dayChoice}` }, dayChoice, ordinal)); @@ -2911,10 +2025,10 @@ const SimpleDateChooser = (props) => { if (view === View.InvalidDate) { body = (React__default["default"].createElement("div", { className: "SimpleDateChooser-inner-container d-inline-block" }, React__default["default"].createElement("button", { type: "button", className: "btn btn-light", onClick: askToEditInvalidDate, "aria-label": `edit date for ${ariaLabel}` }, - getMonthName(month).full, + dceCommonkit.getMonthName(month).full, ' ', day, - getOrdinal(day), + dceCommonkit.getOrdinal(day), ",", ' ', year), @@ -2926,24 +2040,6 @@ const SimpleDateChooser = (props) => { return (React__default["default"].createElement("span", { className: "SimpleDateChooser-outer-container" }, body)); }; -/** - * Pad a number with zeros on the left (e.g. 5 becomes 05 with 2 digit padding) - * @author Gabe Abrams - * @param num the number to pad - * @param numDigits the minimum number of digits before the decimal - * @returns padded number - */ -const padZerosLeft = (num, numDigits) => { - // Convert to string - let out = String(num); - // Add zeros - while (out.split('.')[0].length < numDigits) { - out = `0${out}`; - } - // Return - return out; -}; - /** * A very simple, lightweight time chooser * @author Gardenia Liu @@ -3011,7 +2107,7 @@ const SimpleTimeChooser = (props) => { hours %= 12; } // Pad with zeros - const paddedMinutes = padZerosLeft(minutes, 2); + const paddedMinutes = dceCommonkit.padZerosLeft(minutes, 2); // Assemble time string return `${hours}:${paddedMinutes} ${isAM ? 'AM' : 'PM'}`; }; @@ -3495,7 +2591,7 @@ const CopiableBox = (props) => { type: ActionType$9.IndicateRecentlyCopied, }); // Wait a moment - yield waitMs(4000); + yield dceCommonkit.waitMs(4000); // Hide copied notice dispatch({ type: ActionType$9.ClearRecentlyCopiedStatus, @@ -3776,211 +2872,6 @@ const ItemPicker = (props) => { React__default["default"].createElement(NestableItemList, { items: items, onChanged: onChanged })))); }; -// Import shared helpers -/** - * Get a human-readable description of a date (all in ET) - * @author Gabe Abrams - * @param [dateOrTimestamp=today] the date or timestamp for the date to describe - * @returns human-readable description of the date - */ -const getHumanReadableDate = (dateOrTimestamp) => { - // Get the date info - const { month, day, year, } = getTimeInfoInET(dateOrTimestamp); - const currYear = getTimeInfoInET().year; - // Get the short month description - const monthName = getMonthName(month).short; - // Create start of description - let description = `${monthName} ${day}${getOrdinal(day)}`; - // Add on year if it's different - if (year !== currYear) { - description += ` ${year}`; - } - // Return description - return description; -}; - -/** - * Path of the route for getting logs for log review - * @author Gabe Abrams - */ -const LOG_REVIEW_GET_LOGS_ROUTE = `/admin${ROUTE_PATH_PREFIX}/logs`; - -/** - * Source of a log event - * @author Gabe Abrams - */ -var LogSource; -(function (LogSource) { - // Client - LogSource["Client"] = "client"; - // Server - LogSource["Server"] = "server"; -})(LogSource || (LogSource = {})); -var LogSource$1 = LogSource; - -/** - * Type of a log event - * @author Gabe Abrams - */ -var LogType; -(function (LogType) { - // User action - LogType["Action"] = "action"; - // Error - LogType["Error"] = "error"; -})(LogType || (LogType = {})); -var LogType$1 = LogType; - -/** - * Types of actions - * @author Gabe Abrams - */ -var LogAction; -(function (LogAction) { - // Target was opened by the user (it was not on screen, but now it is) - LogAction["Open"] = "Open"; - // Target was closed by the user (it was on screen, but now it is not) - LogAction["Close"] = "Close"; - // Target was cancelled by the user (it was on closed without saving) - LogAction["Cancel"] = "Cancel"; - // Target was expanded by the user (it always remains on screen, but size was changed) - LogAction["Expand"] = "Expand"; - // Target was collapsed by the user (it always remains on screen, but size was changed) - LogAction["Collapse"] = "Collapse"; - // Target was viewed by the user (only for items that are not opened or closed, those must use Open/Close actions) - LogAction["View"] = "View"; - // Target interrupted the user (popup, dialog, validation message, etc. appeared without user prompting) - LogAction["Interrupt"] = "Interrupt"; - // Target was created by the user (it did not exist before) - LogAction["Create"] = "Create"; - // Target was modified by the user (it existed and was changed) - LogAction["Modify"] = "Modify"; - // Target was deleted by the user (it existed and now it doesn't) - LogAction["Delete"] = "Delete"; - // Target was added by the user (it already existed and was added to another place) - LogAction["Add"] = "Add"; - // Target was removed by the user (it was removed from something but still exists) - LogAction["Remove"] = "Remove"; - // Target was activated by the user (click, check, tap, keypress, etc.) - LogAction["Activate"] = "Activate"; - // Target was deactivated by the user (click away, uncheck, tap outside of, tab away, etc.) - LogAction["Deactivate"] = "Deactivate"; - // User showed interest in a target (hover, peek, etc.) - LogAction["Peek"] = "Peek"; - // Halt a process (pause, etc.) - LogAction["Halt"] = "Halt"; - // Resume a process (resume a halted process) - LogAction["Resume"] = "Resume"; - // Jump to/seek to/reveal/go to/navigate to a target - LogAction["Jump"] = "Jump"; - // Post a submission/message/etc. into the target - LogAction["Post"] = "Post"; - // Like something - LogAction["Like"] = "Like"; - // Dislike something - LogAction["Dislike"] = "Dislike"; - // Unknown action - LogAction["Unknown"] = "Unknown"; -})(LogAction || (LogAction = {})); -var LogAction$1 = LogAction; - -/** - * Server-side API param types - * @author Gabe Abrams - */ -var ParamType; -(function (ParamType) { - ParamType["Boolean"] = "Boolean"; - ParamType["BooleanOptional"] = "BooleanOptional"; - ParamType["Float"] = "Float"; - ParamType["FloatOptional"] = "FloatOptional"; - ParamType["Int"] = "Int"; - ParamType["IntOptional"] = "IntOptional"; - ParamType["JSON"] = "JSON"; - ParamType["JSONOptional"] = "JSONOptional"; - ParamType["String"] = "String"; - ParamType["StringOptional"] = "StringOptional"; -})(ParamType || (ParamType = {})); -var ParamType$1 = ParamType; - -/** - * Round a number to a certain number of decimals - * @author Gabe Abrams - * @param num the number to round - * @param numDecimals the number of decimals to round to - * @returns rounded number - */ -const roundToNumDecimals = (num, numDecimals) => { - const rounder = 10 ** numDecimals; - return (Math.round(num * rounder) / rounder); -}; - -/** - * Escape a CSV cell if needed - * @author Gabe Abrams - * @param text the cell contents - * @returns escaped cell text - */ -const escapeCellText = (text) => { - if (!String(text).includes(',') - && !String(text).includes('"')) { - // No need to escape - return String(text); - } - // Perform escape - return `"${String(text).replace(/"/g, '""')}"`; -}; -/** - * Generate a CSV file - * @author Gabe Abrams - * @param data list of row data in the form of json objects - * @param columns list of columns to include in the csv where each column is an object with: - * - title: the column title - * - param: the key in the data object to use for this column - * - textIfUndefined: optional text to use if the value is undefined (defaults to empty string) - * @returns multiline csv string - */ -const genCSV = (data, columns) => { - let csv = ''; - // Add header - csv += (columns - .map((column) => { - return escapeCellText(column.title); - }) - .join(',')); - // Add each row - data.forEach((datum) => { - csv += '\n'; - csv += (columns - .map((column) => { - var _a; - let contents; - const cell = datum[column.param]; - if (typeof cell === 'string' - || typeof cell === 'number' - || typeof cell === 'boolean') { - contents = String(cell); - } - else if (cell === null) { - contents = ''; - } - else if (typeof cell === 'undefined') { - contents = ((_a = column.textIfUndefined) !== null && _a !== void 0 ? _a : ''); - } - else if (typeof cell === 'object') { - contents = JSON.stringify(cell); - } - else { - contents = ''; - } - return escapeCellText(contents); - }) - .join(',')); - }); - // Return - return csv; -}; - /** * Button for downloading a csv file * @author Gabe Abrams @@ -4255,7 +3146,7 @@ const IntelliTable = (props) => { } // Sort differently based on the data type // > Boolean - if (paramType === ParamType$1.Boolean) { + if (paramType === dceCommonkit.ParamType.Boolean) { if (aVal && !bVal) { return (descending ? -1 : 1); } @@ -4265,14 +3156,14 @@ const IntelliTable = (props) => { return tiebreaker; } // > Number - if (paramType === ParamType$1.Int - || paramType === ParamType$1.Float) { + if (paramType === dceCommonkit.ParamType.Int + || paramType === dceCommonkit.ParamType.Float) { return (descending ? (bVal - aVal) : (aVal - bVal)); } // > String - if (paramType === ParamType$1.String) { + if (paramType === dceCommonkit.ParamType.String) { if (aVal < bVal) { return (descending ? 1 : -1); } @@ -4282,7 +3173,7 @@ const IntelliTable = (props) => { return tiebreaker; } // > JSON - if (paramType === ParamType$1.JSON) { + if (paramType === dceCommonkit.ParamType.JSON) { const aSize = (Array.isArray(aVal) ? aVal.length : Object.keys(aVal).length); @@ -4314,7 +3205,7 @@ const IntelliTable = (props) => { let fullValue; let visibleValue; let colTitle = ''; - if (column.type === ParamType$1.Boolean) { + if (column.type === dceCommonkit.ParamType.Boolean) { fullValue = !!(value); const noValue = (value === undefined || value === null); @@ -4326,7 +3217,7 @@ const IntelliTable = (props) => { colTitle = 'Empty Cell'; } } - else if (column.type === ParamType$1.Int) { + else if (column.type === dceCommonkit.ParamType.Int) { fullValue = Number.parseInt(value, 10); const noValue = Number.isNaN(fullValue); visibleValue = (noValue @@ -4337,18 +3228,18 @@ const IntelliTable = (props) => { colTitle = 'Empty Cell'; } } - else if (column.type === ParamType$1.Float) { + else if (column.type === dceCommonkit.ParamType.Float) { fullValue = Number.parseFloat(value); const noValue = Number.isNaN(fullValue); visibleValue = (noValue ? (React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faMinus })) - : roundToNumDecimals(fullValue, 2)); + : dceCommonkit.roundToNumDecimals(fullValue, 2)); colTitle = String(fullValue); if (noValue) { colTitle = 'Empty Cell'; } } - else if (column.type === ParamType$1.String) { + else if (column.type === dceCommonkit.ParamType.String) { fullValue = String(value).trim(); const noValue = (value === undefined || value === null @@ -4361,7 +3252,7 @@ const IntelliTable = (props) => { colTitle = 'Empty Cell'; } } - else if (column.type === ParamType$1.JSON) { + else if (column.type === dceCommonkit.ParamType.JSON) { fullValue = JSON.stringify(value); const noValue = (Array.isArray(value) ? (!value || value.length === 0) @@ -4392,7 +3283,7 @@ const IntelliTable = (props) => { }) .length); // Build CSV - const csv = genCSV(data, columns.filter((column) => { + const csv = dceCommonkit.genCSV(data, columns.filter((column) => { return columnVisibilityMap[column.param]; })); // Build main UI @@ -4476,14 +3367,6 @@ const Pagination = (props) => { React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faArrowRight })))))); }; -/** - * Deeply clones an object - * @author Yuen Ler Chow - * @param obj the object to clone - * @returns a deep clone of the object - */ -const cloneDeep = clone__default["default"]; - /** * Log reviewer panel that allows users (must be approved admins) to * review logs written by dce-reactkit @@ -4591,185 +3474,185 @@ const columns = [ { title: 'First Name', param: 'userFirstName', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, }, { title: 'Last Name', param: 'userLastName', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, }, { title: 'Email', param: 'userEmail', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, }, { title: 'Canvas Id', param: 'userId', - type: ParamType$1.Int, + type: dceCommonkit.ParamType.Int, }, { title: 'Student?', param: 'isLearner', - type: ParamType$1.Boolean, + type: dceCommonkit.ParamType.Boolean, }, { title: 'Teaching Staff?', param: 'isTTM', - type: ParamType$1.Boolean, + type: dceCommonkit.ParamType.Boolean, startsHidden: true, }, { title: 'Admin?', param: 'isAdmin', - type: ParamType$1.Boolean, + type: dceCommonkit.ParamType.Boolean, startsHidden: true, }, { title: 'Course Canvas Id', param: 'courseId', - type: ParamType$1.Int, + type: dceCommonkit.ParamType.Int, startsHidden: true, }, { title: 'Course Name', param: 'courseName', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, }, { title: 'Browser Name', param: 'browser.name', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, startsHidden: true, }, { title: 'Browser Version', param: 'browser.version', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, startsHidden: true, }, { title: 'OS', param: 'device.os', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, startsHidden: true, }, { title: 'Mobile?', param: 'device.isMobile', - type: ParamType$1.Boolean, + type: dceCommonkit.ParamType.Boolean, startsHidden: true, }, { title: 'Year', param: 'year', - type: ParamType$1.Int, + type: dceCommonkit.ParamType.Int, }, { title: 'Month', param: 'month', - type: ParamType$1.Int, + type: dceCommonkit.ParamType.Int, }, { title: 'Day', param: 'day', - type: ParamType$1.Int, + type: dceCommonkit.ParamType.Int, }, { title: 'Hour', param: 'hour', - type: ParamType$1.Int, + type: dceCommonkit.ParamType.Int, }, { title: 'Minute', param: 'minute', - type: ParamType$1.Int, + type: dceCommonkit.ParamType.Int, startsHidden: true, }, { title: 'Timestamp', param: 'timestamp', - type: ParamType$1.Int, + type: dceCommonkit.ParamType.Int, startsHidden: true, }, { title: 'Context', param: 'context', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, }, { title: 'Subcontext', param: 'subcontext', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, }, { title: 'Tags', param: 'tags', - type: ParamType$1.JSON, + type: dceCommonkit.ParamType.JSON, startsHidden: true, }, { title: 'Log Level', param: 'level', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, startsHidden: true, }, { title: 'Metadata', param: 'metadata', - type: ParamType$1.JSON, + type: dceCommonkit.ParamType.JSON, startsHidden: true, }, { title: 'Source', param: 'source', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, }, { title: 'Server Route Path', param: 'routePath', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, startsHidden: true, }, { title: 'Server Route Template', param: 'routeTemplate', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, startsHidden: true, }, { title: 'Type', param: 'type', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, }, { title: 'Error Message', param: 'errorMessage', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, startsHidden: true, }, { title: 'Error Code', param: 'errorCode', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, startsHidden: true, }, { title: 'Error Stack', param: 'errorStack', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, startsHidden: true, }, { title: 'Action Target', param: 'target', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, startsHidden: true, }, { title: 'Action Type', param: 'action', - type: ParamType$1.String, + type: dceCommonkit.ParamType.String, startsHidden: true, }, ]; @@ -4938,14 +3821,14 @@ const LogReviewer = (props) => { const contextMap = {}; [ ((_a = LogMetadata.Context) !== null && _a !== void 0 ? _a : {}), - LogBuiltInMetadata.Context, + dceCommonkit.LogBuiltInMetadata.Context, ].forEach((partialContextMap) => { Object.keys(partialContextMap).forEach((context) => { // Add context contextMap[context] = partialContextMap[context]; // If context has children, add an "uncategorized" subcontext if (typeof contextMap[context] !== 'string') { - contextMap[context][LogBuiltInMetadata.Context.Uncategorized] = (LogBuiltInMetadata.Context.Uncategorized); + contextMap[context][dceCommonkit.LogBuiltInMetadata.Context.Uncategorized] = (dceCommonkit.LogBuiltInMetadata.Context.Uncategorized); } }); }); @@ -4953,7 +3836,7 @@ const LogReviewer = (props) => { const targetMap = {}; [ ((_b = LogMetadata.Target) !== null && _b !== void 0 ? _b : {}), - LogBuiltInMetadata.Target, + dceCommonkit.LogBuiltInMetadata.Target, ].forEach((partialTargetMap) => { Object.keys(partialTargetMap).forEach((target) => { targetMap[target] = partialTargetMap[target]; @@ -4961,7 +3844,7 @@ const LogReviewer = (props) => { }); /* -------------- State ------------- */ // Create initial date filter state - const today = getTimeInfoInET(); + const today = dceCommonkit.getTimeInfoInET(); const initStartDate = { year: today.year, month: today.month, @@ -5029,7 +3912,7 @@ const LogReviewer = (props) => { Object.values(targetMap).forEach((target) => { initActionErrorFilterState.target[target] = true; }); - Object.values(LogAction$1).forEach((action) => { + Object.values(dceCommonkit.LogAction).forEach((action) => { initActionErrorFilterState.action[action] = true; }); // Initial state @@ -5081,7 +3964,7 @@ const LogReviewer = (props) => { let fetchedLogs = []; // Get logs from server const response = yield visitServerEndpoint({ - path: LOG_REVIEW_GET_LOGS_ROUTE, + path: dceCommonkit.LOG_REVIEW_GET_LOGS_ROUTE, method: 'GET', params: { pageNumber: pageNum, @@ -5208,7 +4091,7 @@ const LogReviewer = (props) => { // Save active filters // Deep clone the initial filter states to avoid any reference issues // if the filter states are modified later - activeFiltersRef.current = cloneDeep({ + activeFiltersRef.current = dceCommonkit.cloneDeep({ dateFilterState: initDateFilterState, contextFilterState: initContextFilterState, tagFilterState: initTagFilterState, @@ -5252,7 +4135,7 @@ const LogReviewer = (props) => { // Save active filters // Deep clone the pending filter states to avoid any reference issues // if the filter states are modified later - activeFiltersRef.current = cloneDeep({ + activeFiltersRef.current = dceCommonkit.cloneDeep({ dateFilterState: pendingDateFilterState, contextFilterState: pendingContextFilterState, tagFilterState: pendingTagFilterState, @@ -5326,7 +4209,7 @@ const LogReviewer = (props) => { checked: !!pendingContextFilterState[context], }; // Add built-in items to its own folder - const isBuiltIn = context in LogBuiltInMetadata.Context; + const isBuiltIn = context in dceCommonkit.LogBuiltInMetadata.Context; if (isBuiltIn) { // Add to built-in pickable item builtInPickableItem.children.push(item); @@ -5426,22 +4309,22 @@ const LogReviewer = (props) => { }); }, ariaLabel: "show logs of all types", selected: pendingActionErrorFilterState.type === undefined, unselectedVariant: Variant$1.Light }), React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-action-only", text: "Action Logs Only", onSelected: () => { - const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: LogType$1.Action }); + const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: dceCommonkit.LogType.Action }); dispatch({ type: ActionType$6.UpdateActionErrorFilterState, actionErrorFilterState: newActionErrorFilterState, }); - }, ariaLabel: "only show action logs", selected: pendingActionErrorFilterState.type === LogType$1.Action, unselectedVariant: Variant$1.Light }), + }, ariaLabel: "only show action logs", selected: pendingActionErrorFilterState.type === dceCommonkit.LogType.Action, unselectedVariant: Variant$1.Light }), React__default["default"].createElement(RadioButton, { id: "LogReviewer-type-error-only", text: "Action Error Only", onSelected: () => { - const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: LogType$1.Error }); + const newActionErrorFilterState = Object.assign(Object.assign({}, pendingActionErrorFilterState), { type: dceCommonkit.LogType.Error }); dispatch({ type: ActionType$6.UpdateActionErrorFilterState, actionErrorFilterState: newActionErrorFilterState, }); - }, ariaLabel: "only show error logs", selected: pendingActionErrorFilterState.type === LogType$1.Error, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light })), + }, ariaLabel: "only show error logs", selected: pendingActionErrorFilterState.type === dceCommonkit.LogType.Error, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light })), (pendingActionErrorFilterState.type === undefined - || pendingActionErrorFilterState.type === LogType$1.Action) && (React__default["default"].createElement(TabBox, { title: "Action Log Details" }, - React__default["default"].createElement(ButtonInputGroup, { label: "Action", className: "mb-2", wrapButtonsAndAddGaps: true }, Object.keys(LogAction$1) + || pendingActionErrorFilterState.type === dceCommonkit.LogType.Action) && (React__default["default"].createElement(TabBox, { title: "Action Log Details" }, + React__default["default"].createElement(ButtonInputGroup, { label: "Action", className: "mb-2", wrapButtonsAndAddGaps: true }, Object.keys(dceCommonkit.LogAction) .map((action) => { const description = genHumanReadableName(action); return (React__default["default"].createElement(CheckboxButton, { key: action, id: `LogReviewer-action-${action}-checkbox`, text: description, ariaLabel: `include logs with action type "${description}" in results`, noMarginOnRight: true, checked: pendingActionErrorFilterState.action[action], onChanged: (checked) => { @@ -5464,7 +4347,7 @@ const LogReviewer = (props) => { }, checkedVariant: Variant$1.Light, uncheckedVariant: Variant$1.Light })); })))), (pendingActionErrorFilterState.type === undefined - || pendingActionErrorFilterState.type === LogType$1.Error) && (React__default["default"].createElement(TabBox, { title: "Error Log Details" }, + || pendingActionErrorFilterState.type === dceCommonkit.LogType.Error) && (React__default["default"].createElement(TabBox, { title: "Error Log Details" }, React__default["default"].createElement("div", { className: "input-group mb-2" }, React__default["default"].createElement("span", { className: "input-group-text" }, "Error Message"), React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for error message", value: pendingActionErrorFilterState.errorMessage, placeholder: "e.g. undefined is not a function", onChange: (e) => { @@ -5610,21 +4493,21 @@ const LogReviewer = (props) => { advancedFilterState: newAdvancedFilterState, }); }, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }), - React__default["default"].createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: pendingAdvancedFilterState.source === LogSource$1.Client, onSelected: () => { - const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: LogSource$1.Client }); + React__default["default"].createElement(RadioButton, { text: "Client Only", ariaLabel: "show logs from client source", selected: pendingAdvancedFilterState.source === dceCommonkit.LogSource.Client, onSelected: () => { + const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: dceCommonkit.LogSource.Client }); dispatch({ type: ActionType$6.UpdateAdvancedFilterState, advancedFilterState: newAdvancedFilterState, }); }, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light }), - React__default["default"].createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: pendingAdvancedFilterState.source === LogSource$1.Server, onSelected: () => { - const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: LogSource$1.Server }); + React__default["default"].createElement(RadioButton, { text: "Server Only", ariaLabel: "show logs from server source", selected: pendingAdvancedFilterState.source === dceCommonkit.LogSource.Server, onSelected: () => { + const newAdvancedFilterState = Object.assign(Object.assign({}, pendingAdvancedFilterState), { source: dceCommonkit.LogSource.Server }); dispatch({ type: ActionType$6.UpdateAdvancedFilterState, advancedFilterState: newAdvancedFilterState, }); }, noMarginOnRight: true, selectedVariant: Variant$1.Light, unselectedVariant: Variant$1.Light })), - pendingAdvancedFilterState.source !== LogSource$1.Client && (React__default["default"].createElement("div", { className: "mt-2" }, + pendingAdvancedFilterState.source !== dceCommonkit.LogSource.Client && (React__default["default"].createElement("div", { className: "mt-2" }, React__default["default"].createElement("div", { className: "input-group mb-2" }, React__default["default"].createElement("span", { className: "input-group-text" }, "Server Route Path"), React__default["default"].createElement("input", { type: "text", className: "form-control", "aria-label": "query for server route path", value: pendingAdvancedFilterState.routePath, placeholder: "e.g. /api/ttm/courses/12345", onChange: (e) => { @@ -5660,7 +4543,7 @@ const LogReviewer = (props) => { React__default["default"].createElement("h4", { className: "m-1" }, "No Logs to Show"), React__default["default"].createElement("div", null, "Either your filters are too strict or no matching logs have been created yet."))), React__default["default"].createElement("div", { className: loading || logs.length === 0 ? 'd-none' : undefined }, - React__default["default"].createElement(IntelliTable, { title: "Matching Logs", csvName: `Logs from ${getHumanReadableDate()}`, id: "logs", data: logs, columns: columns })), + React__default["default"].createElement(IntelliTable, { title: "Matching Logs", csvName: `Logs from ${dceCommonkit.getHumanReadableDate()}`, id: "logs", data: logs, columns: columns })), !loading && logs.length > 0 && paginationControls)); /* ---------- Wrap in Modal --------- */ return (React__default["default"].createElement("div", { className: "LogReviewer-outer-container" }, @@ -10219,7 +9102,7 @@ var MenuPortal = function MenuPortal(props) { }), innerProps), children); return jsx(PortalPlacementContext.Provider, { value: portalPlacementContext - }, appendTo ? /*#__PURE__*/reactDom.exports.createPortal(menuWrapper, appendTo) : menuWrapper); + }, appendTo ? /*#__PURE__*/ReactDOM.createPortal(menuWrapper, appendTo) : menuWrapper); }; // ============================== @@ -14655,27 +13538,6 @@ const ToggleSwitch = (props) => { } }))); }; -/** - * Convert a string to hyphenated lowercase format with no space or - * non-alphanumeric characters - * @author Gabe Abrams - * @param str the string to convert - * @returns the idified string - */ -const idify = (str) => { - return (str - // Trim whitespace - .trim() - // Convert to lowercase - .toLowerCase() - // Replace non-alphanumeric characters with hyphens - .replace(/[^a-z0-9]+/g, '-') - // Change multiple hyphens in a row for a single hyphen - .replace(/-+/g, '-') - // Remove hyphens at the beginning and end of the string - .replace(/^-+|-+$/g, '')); -}; - /** * Container that automatically scrolls when new items are added, * lets the user scroll up to see old items, but resumes @@ -14915,8 +13777,8 @@ const AutoscrollToBottomContainer = (props) => { // Jump to Bottom button let jumpToBottomButton; if (jumpToBottomButtonVisible) { - jumpToBottomButton = (React__default["default"].createElement("div", { className: `AutoscrollToBottomContainer-jump-to-bottom-container AutoscrollToBottomContainer-for-${idify(itemsName !== null && itemsName !== void 0 ? itemsName : 'items')}` }, - React__default["default"].createElement("button", { type: "button", className: `AutoscrollToBottomContainer-jump-to-bottom-button AutoscrollToBottomContainer-jump-to-bottom-button-for-${idify(itemsName !== null && itemsName !== void 0 ? itemsName : 'items')} btn btn-sm btn-${jumpToBottomButtonVariant} pt-0 pb-0`, onClick: scrollToBottom, "aria-label": "scroll back to bottom and show new content" }, + jumpToBottomButton = (React__default["default"].createElement("div", { className: `AutoscrollToBottomContainer-jump-to-bottom-container AutoscrollToBottomContainer-for-${dceCommonkit.idify(itemsName !== null && itemsName !== void 0 ? itemsName : 'items')}` }, + React__default["default"].createElement("button", { type: "button", className: `AutoscrollToBottomContainer-jump-to-bottom-button AutoscrollToBottomContainer-jump-to-bottom-button-for-${dceCommonkit.idify(itemsName !== null && itemsName !== void 0 ? itemsName : 'items')} btn btn-sm btn-${jumpToBottomButtonVariant} pt-0 pb-0`, onClick: scrollToBottom, "aria-label": "scroll back to bottom and show new content" }, "New", ' ', itemsName !== null && itemsName !== void 0 ? itemsName : 'Content', React__default["default"].createElement(reactFontawesome.FontAwesomeIcon, { icon: freeSolidSvgIcons.faChevronDown, className: "ms-1" })))); @@ -15139,7 +14001,7 @@ const MultiSwitch = (props) => { return (React__default["default"].createElement("button", { type: "button", key: option.id, className: combineClassNames([ 'MultiSwitch-option-button', (isHovered ? 'MultiSwitch-option-button-hovered' : ''), - `MultiSwitch-option-button-with-id-${idify(option.id)}`, + `MultiSwitch-option-button-with-id-${dceCommonkit.idify(option.id)}`, `MultiSwitch-option-button-is${isSelected ? '' : '-not'}-selected`, ]), "aria-label": (isSelected ? `option "${option.label}", currently selected` @@ -15549,45 +14411,8 @@ const ProgressBar = (props) => { "\u00A0")))); }; -/** - * One minute in ms - * @author Gabe Abrams - */ -const MINUTE_IN_MS = 60000; - -/** - * One hour in ms - * @author Gabe Abrams - */ -const HOUR_IN_MS = 3600000; - -/** - * One day in ms - * @author Gabe Abrams - */ -const DAY_IN_MS = 86400000; - -/** - * Path of the route for storing client-side logs - * @author Gabe Abrams - */ -const LOG_REVIEW_ROUTE_PATH_PREFIX = `/admin${ROUTE_PATH_PREFIX}/logs`; - -/** - * Route for checking the status of the current user's - * access to log review - * @author Gabe Abrams - */ -const LOG_REVIEW_STATUS_ROUTE = `${ROUTE_PATH_PREFIX}/logs/access_allowed`; - -/** - * Route for checking if the current user is a select admin - * @author Gabe Abrams - */ -const SELECT_ADMIN_CHECK_ROUTE = '/api/admin/select/is-select-admin'; - // True if user is on mobile or tablet -let cachedResult = undefined; +let cachedResult; /** * Check if the user is on a mobile device or tablet * from https://stackoverflow.com/questions/11381673/detecting-a-mobile-browser @@ -15600,6 +14425,7 @@ const isMobileOrTablet = () => { } try { let check = false; + // eslint-disable-next-line max-len, no-useless-escape ((a) => { if (/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(a) || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(a.substr(0, 4))) check = true; })((navigator !== null && navigator !== void 0 ? navigator : {}).userAgent || (navigator !== null && navigator !== void 0 ? navigator : {}).vendor || ((_a = window) !== null && _a !== void 0 ? _a : {}).opera); cachedResult = check; @@ -15640,119 +14466,6 @@ const DynamicWord = { : 'Computer'), }; -/** - * Shorten text so it fits into a certain number of chars - * @author Gabe Abrams - * @param text the text to abbreviate - * @param maxChars the maximum number of chars to include - * @returns abbreviated text with length no greater than maxChars - * (including ellipses if applicable) - */ -const abbreviate = (text, maxChars) => { - // Check if already short enough - if (text.trim().length < maxChars) { - return text.trim(); - } - // Abbreviate - const shortenedText = (text - .trim() - .substring(0, maxChars - 3) - .trim()); - return `${shortenedText}...`; -}; - -/** - * Sum the numbers in an array - * @author Gabe Abrams - * @param nums the numbers to sum - * @returns the sum of the numbers - */ -const sum = (nums) => { - return nums.reduce((a, b) => { - return (a + b); - }, 0); -}; - -/** - * Get the average of a set of numbers - * @author Gabe Abrams - * @param nums the numbers to average - * @returns average value or 0 if no numbers - */ -const avg = (nums) => { - // Handle empty array case - if (nums.length === 0) { - return 0; - } - // Get the total value - const total = sum(nums); - // Get average - return (total / nums.length); -}; - -/** - * Round a number (ceiling) to a certain number of decimals - * @author Gabe Abrams - * @param num the number to round - * @param numDecimals the number of decimals to round to - * @returns rounded number - */ -const ceilToNumDecimals = (num, numDecimals) => { - const rounder = 10 ** numDecimals; - return (Math.ceil(num * rounder) / rounder); -}; - -/** - * Round a number (floor) to a certain number of decimals - * @author Gabe Abrams - * @param num the number to round - * @param numDecimals the number of decimals to round to - * @returns rounded number - */ -const floorToNumDecimals = (num, numDecimals) => { - const rounder = 10 ** numDecimals; - return (Math.floor(num * rounder) / rounder); -}; - -/** - * Force a number to stay within specific bounds - * @author Gabe Abrams - * @param num the number to move into the bounds - * @param min the minimum number in the bound - * @param max the maximum number in the bound - * @returns bounded number - */ -const forceNumIntoBounds = (num, min, max) => { - return Math.max(min, Math.min(max, num)); -}; - -/** - * Pad a number's decimal with zeros on the right - * (e.g. 5.2 becomes 5.20 with 2 digit padding) - * @author Gabe Abrams - * @param num the number to pad - * @param numDigits the minimum number of digits after the decimal - * @returns padded number - */ -const padDecimalZeros = (num, numDigits) => { - // Skip if nothing to do - if (numDigits < 1) { - return String(num); - } - // Convert to string - let out = String(num); - // Add a decimal point if there isn't one - if (!out.includes('.')) { - out += '.'; - } - // Add zeros - while (out.split('.')[1].length < numDigits) { - out = `${out}0`; - } - // Return - return out; -}; - /** * Stub a server endpoint response * @author Gabe Abrams @@ -15765,146 +14478,6 @@ const padDecimalZeros = (num, numDigits) => { */ const stubServerEndpoint = _setStubResponse; -/** - * Start a dynamic wait, call the function once the operation has completed and - * the dynamic wait will continue waiting for the rest of the minimum time - * @author Gabe Abrams - * @param minWaitMs the minimum number of ms to wait - * @returns async function to call to finish the wait - */ -const startMinWait = (minWaitMs) => { - const startTimestamp = Date.now(); - /** - * Finish the remaining time to wait - * @author Gabe Abrams - */ - return () => __awaiter(void 0, void 0, void 0, function* () { - const endTimestamp = Date.now(); - // Calculate remaining time to wait - const elapsedTimeMs = (endTimestamp - startTimestamp); - const remainingTimeToWaitMs = minWaitMs - elapsedTimeMs; - if (remainingTimeToWaitMs <= 0) { - return; - } - // Perform wait - yield waitMs(remainingTimeToWaitMs); - }); -}; - -/** - * Get the current part of day (morning, evening, etc.) - * @author Gabe Abrams - * @returns the part of day (morning, evening, etc.) - */ -const getPartOfDay = () => { - // Setup the post-it time of day - let partOfDay = 'day'; - const hours = new Date().getHours(); - if (hours < 12) { - partOfDay = 'morning'; - } - else if (hours >= 12 && hours <= 16) { - partOfDay = 'afternoon'; - } - else if (hours > 16 && hours <= 24) { - partOfDay = 'evening'; - } - return partOfDay; -}; - -/** - * Create a human readable list from an array of strings. - * For example, ['apple', 'orange'] becomes "apple and orange" - * and ['apple', 'orange', 'mango'] becomes "apple, orange, and mango" - * @author Gabe Abrams - * @param items list of items in the list - * @returns human-readable list - */ -const stringsToHumanReadableList = (items) => { - // Handle 0-item case - if (items.length === 0) { - return ''; - } - // Handle 1-item case - if (items.length === 1) { - return items[0]; - } - // Handle 2-item case - if (items.length === 2) { - return `${items[0]} and ${items[1]}`; - } - // Handle 3+ item case - let list = ''; - items.forEach((item, i) => { - if (i === items.length - 1) { - // Last item - list += `, and ${item}`; - } - // Previous items - list += `, ${item}`; - }); - return list; -}; - -/** - * Given a string, only keep the letters inside it - * @author Gabe Abrams - * @param str the string to parse - * @returns only the letters inside of the string - */ -const onlyKeepLetters = (str) => { - return str.replace(/[^a-zA-Z]+/g, ''); -}; - -/** - * Run tasks in parallel with a limit on how many tasks can execute at once. - * No guarantees are made about the order of task execution - * @author Gabe Abrams - * @param taskFunctions functions that start asynchronous tasks and optionally - * resolve with values - * @param [limit=no limit] maximum number of asynchronous tasks to permit to run at - * once - * @returns array of resolved values in the same order as the task functions - */ -const parallelLimit = (taskFunctions, limit) => __awaiter(void 0, void 0, void 0, function* () { - const results = []; - // Wait until finished with all tasks - yield new Promise((resolve) => { - /* ------------- Helpers ------------ */ - let nextTaskIndex = 0; - let numFinishedTasks = 0; - /** - * Start the next task - * @author Gabe Abrams - */ - const startTask = () => __awaiter(void 0, void 0, void 0, function* () { - const taskIndex = nextTaskIndex++; - // Get the task - const taskFunction = taskFunctions[taskIndex]; - if (!taskFunction) { - return; - } - // Execute task - const result = yield taskFunction(); - // Add results - results[taskIndex] = result; - // Tally and finish - if (++numFinishedTasks === taskFunctions.length) { - return resolve(); - } - // Not finished! Start another task - startTask(); - }); - /* ----------- Start Tasks ---------- */ - // If no limit, start all tasks. At least start 1 task - const numTasks = Math.max((limit || taskFunctions.length), 1); - for (let i = 0; i < numTasks; i++) { - startTask(); - } - }); - return results; -}); - /*------------------------------------------------------------------------*/ /* -------------------------------- Cache ------------------------------- */ /*------------------------------------------------------------------------*/ @@ -15926,7 +14499,7 @@ const canReviewLogs = () => __awaiter(void 0, void 0, void 0, function* () { // Ask on server try { canReview = !!(yield visitServerEndpoint({ - path: LOG_REVIEW_STATUS_ROUTE, + path: dceCommonkit.LOG_REVIEW_STATUS_ROUTE, method: 'GET', })); } @@ -15936,355 +14509,6 @@ const canReviewLogs = () => __awaiter(void 0, void 0, void 0, function* () { return canReview; }); -/** - * For every element in an array, extract the value of a prop - * (e.g. for all user objects, extract their ages and put that into a new - * ages array) - * @author Gabe Abrams - * @param arr the array of objects to operate on - * @param prop the property to extract from each object - * @returns new array containing the corresponding values, in order, of each - * object in the original array - */ -const extractProp = (arr, prop) => { - return arr.map((item) => { - return item[prop]; - }); -}; - -/** - * Compare two arrays of objects by only comparing the values in a specific - * property (e.g. compare user arrays by comparing their user.id values) - * @author Gabe Abrams - * @param a the first array - * @param b the second array - * @param prop the property to compare with, or an array of props to compare - * with (if array, all values associated with those props must match) - * @returns true if the arrays contain the same objects as determined by - * the values associated with each object's prop - */ -const compareArraysByProp = (a, b, prop) => { - // Immediately return if size of arrays is different - if (a.length !== b.length) { - return false; - } - // Get all props - const props = (Array.isArray(prop) ? prop : [prop]); - // Clone second array so we can work on it - const bCloned = [...b]; - // Remove elements from b as we find them in a - for (let i = 0; i < a.length; i++) { - // Find matching element in b - const matchingIndex = bCloned.findIndex((bItem) => { - // Compare based on all props - return props.every((propToCompareBy) => { - var _a; - const aVal = ((_a = a[i]) !== null && _a !== void 0 ? _a : {})[propToCompareBy]; - const bVal = (bItem !== null && bItem !== void 0 ? bItem : {})[propToCompareBy]; - return aVal === bVal; - }); - }); - // Check if no match - const noMatch = (matchingIndex < 0); - // If no match, there's no corresponding element in b - if (noMatch) { - return false; - } - // Remove the matching element - bCloned.splice(matchingIndex, 1); - } - // If we made it here, all elements in a have a corresponding element in b - return true; -}; - -/** - * Get current time info in local time - * @author Gabe Abrams - * @param [dateOrTimestamp=now] the date to get info on or a ms since epoch timestamp - * @returns object with timestamp (ms since epoch) and numbers - * corresponding to time values for year, month, day, hour, hour12, minute, isPM - * where hour is in 24hr time and hour12 is in 12hr time. - */ -const getLocalTimeInfo = (dateOrTimestamp) => { - // Create a time string - let d; - if (!dateOrTimestamp) { - // Use now - d = new Date(); - } - else if (typeof dateOrTimestamp === 'number') { - // Convert to date - d = new Date(dateOrTimestamp); - } - else { - // Already a date - d = dateOrTimestamp; - } - // Create all time numbers - const timestamp = d.getTime(); - const year = d.getFullYear(); - const month = d.getMonth() + 1; - const day = d.getDate(); - const hour = d.getHours(); - const isPM = hour >= 12; - let hour12 = hour % 12; - if (hour12 === 0) { - hour12 = 12; - } - const minute = d.getMinutes(); - // Return - return { - timestamp, - year, - month, - day, - hour, - hour12, - isPM, - minute, - }; -}; - -/** - * Given an array of strings, create a single comma-separated string that includes - * 'and' as well as an oxford comma. - * Ex: ['apples'] => 'apples' - * Ex: ['apples', 'bananas'] => 'apples and bananas' - * Ex: ['apples', 'bananas', 'grapes'] => 'apples, bananas, and grapes' - * @author Austen Money - * @param list an array of elements to be made into a single comma-separated string. - * @returns a comma-separated string. - */ -const genCommaList = (list) => { - const { length } = list; - return (length < 2 - ? list.join('') - : `${list.slice(0, length - 1).join(', ')}${length < 3 ? ' and ' : ', and '}${list[length - 1]}`); -}; - -/*------------------------------------------------------------------------*/ -/* ------------------------------ Constants ----------------------------- */ -/*------------------------------------------------------------------------*/ -const INVALID_REGEX_ERROR = 'input does not follow the requested format'; -const INVALID_EMAIL_ERROR = 'Please provide a valid email address.'; -const INVALID_PHONE_ERROR = 'Please provide a valid phone number.'; -const INVALID_STRING_ERRORS = { - MIN_LEN: (minLen) => { - return `input must not be under ${minLen} character(s)`; - }, - MAX_LEN: (maxLen) => { - return `input must not be over ${maxLen} character(s)`; - }, - LETTERS_ONLY: 'input must only contain letters', - NUMBERS_ONLY: 'input must only contain numbers', - MESSAGE_INTRO: 'The following error(s) occurred: ', -}; - -// Import constants -/** - * Determines whether a given input string is considered valid based on - * the provided regex. - * @author Austen Money - * @param opts object containing all args - * @param opts.input user-provided input to validate - * @param opts.regex regular expression to check against input - * @param [opts.regexDescription] description of what regexString is checking - * for, used to customize error message - * @returns the unchanged input if valid, or a customized error message if - * invalid - */ -const validateRegex = (opts) => { - // customize error message in case of invalid input - const errorMessage = `${INVALID_REGEX_ERROR}${opts.regexDescription - ? ': ' - : ''}${opts.regexDescription}`; - // return error message if test is invalid, or input string if valid - return (opts.regex.test(opts.input) - ? { - isValid: true, - cleanedValue: opts.input, - } - : { - isValid: false, - errorMessage, - }); -}; - -// Import helpers -/** - * Determines whether a given email address is valid. - * @author Austen Money - * @param email email address to validate - * @returns whether email fulfills proper formatting requirements, includes a - * cleaned version of the address without leading or trailing - * whitespace if valid or an error message if invalid. - */ -const validateEmail = (email) => { - // validation regex, sourced from HTML living standard: http://www.whatwg.org/specs/web-apps/current-work/multipage/forms.html#e-mail-state-(type=email) - // eslint-disable-next-line max-len - const emailRegex = /^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/; - // remove leading and trailing whitespace - const cleanedValue = email.replace(/^\s+|\s+$/g, ''); - // validate email with regex, and return error if not valid - return (validateRegex({ - input: cleanedValue, - regex: emailRegex, - }).isValid - ? { - isValid: true, - cleanedValue, - } - : { - isValid: false, - errorMessage: INVALID_EMAIL_ERROR, - }); -}; - -// Import helpers -/** - * Determines whether a given phone number is valid. - * @author Austen Money - * @param phoneNumber phone number to validate - * @returns whether phone number is considered valid - if valid, also returns - * a cleaned version of the number without any formatting. If invalid, - * returns an error message. - */ -const validatePhoneNumber = (phoneNumber) => { - // regex to validate phone number - const validationRegex = /^\s*(?:\+?(\d{1,3}))?[-. (]*(\d{3})[-. )]*(\d{3})[-. ]*(\d{4})(?: *x(\d+))?\s*$/; - // validate phone number with regex - const validationResponse = validateRegex({ - input: phoneNumber, - regex: validationRegex, - }); - // remove all non-digits from number - const cleanedValue = phoneNumber.replace(/\D/g, ''); - // return cleaned value if valid, or error message if invalid - return (validationResponse.isValid - ? { - isValid: true, - cleanedValue, - } - : { - isValid: false, - errorMessage: INVALID_PHONE_ERROR, - }); -}; - -// Import helpers -/*------------------------------------------------------------------------*/ -/* ------------------------------ Constants ----------------------------- */ -/*------------------------------------------------------------------------*/ -// define minimum and maximum range for lowercase ASCII chars -const LOWERCASE_MIN = 65; -const LOWERCASE_MAX = 90; -// define minimum and maximum range for uppercase ASCII chars -const UPPERCASE_MIN = 97; -const UPPERCASE_MAX = 122; -// define minimum and maximum range for ASCII digits -const DIGIT_MIN = 48; -const DIGIT_MAX = 57; -/*------------------------------------------------------------------------*/ -/* ---------------------------- Main Function --------------------------- */ -/*------------------------------------------------------------------------*/ -/** - * Determines whether a given input string is considered valid based on - * the provided requirements. - * @author Austen Money - * @param input input string - * @param opts options for validation - * @returns whether input is considered valid according to reqs - if - * valid, returns a cleaned version of input; if invalid, returns - * a string containing error messages describing which requirements - * were not met. - */ -const validateString = (input, opts) => { - // stores all invalid input errors - const errorMessages = []; - // contains version of input that will be returned - let cleanedValue = input; - // remove whitespace if required - if (opts.ignoreWhitespace) { - cleanedValue = input.replace(/\s+/g, ''); - } - // apply max char requirement - if (opts.minLen) { - if (cleanedValue.length < opts.minLen) { - errorMessages.push(INVALID_STRING_ERRORS.MIN_LEN(opts.minLen)); - } - } - // apply max char requirement - if (opts.maxLen) { - if (cleanedValue.length > opts.maxLen) { - errorMessages.push(INVALID_STRING_ERRORS.MAX_LEN(opts.maxLen)); - } - } - // apply alphabetical requirement - if (opts.lettersOnly) { - // remove diacritics - cleanedValue = cleanedValue.normalize('NFD').replace(/[\u0300-\u036f]/g, ''); - const containsNonLetters = (cleanedValue - // split into characters - .split('') - // convert into character codes - .map((curr) => { - return curr.charCodeAt(0); - }) - // check for non-letters - .some((currCode) => { - return (!(currCode >= LOWERCASE_MIN && currCode <= LOWERCASE_MAX) - && !(currCode >= UPPERCASE_MIN && currCode <= UPPERCASE_MAX)); - })); - if (containsNonLetters) { - errorMessages.push(INVALID_STRING_ERRORS.LETTERS_ONLY); - } - } - // apply numerical requirement - if (opts.numbersOnly) { - const containsNonNumbers = (cleanedValue - // split into characters - .split('') - // convert into character codes - .map((curr) => { - return curr.charCodeAt(0); - }) - // check for non-numbers - .some((currCode) => { - return (!(currCode >= DIGIT_MIN && currCode <= DIGIT_MAX)); - })); - if (containsNonNumbers) { - errorMessages.push(INVALID_STRING_ERRORS.NUMBERS_ONLY); - } - } - // apply regex requirement - if (opts.regexTest) { - const regex = opts.regexTest; - // validate and create customized error message if description is provided - const result = validateRegex({ - input: cleanedValue, - regex, - regexDescription: opts.regexDescription, - }); - // if string did not pass regex validation, add error message - if (result.isValid === false) { - errorMessages.push(result.errorMessage); - } - } - // combine all error messages into one string to return - const errorMessage = `${INVALID_STRING_ERRORS.MESSAGE_INTRO}${genCommaList(errorMessages)}.`; - return ( - // if no error messages, string is valid; if not, it is invalid - errorMessages.length === 0 - ? { - isValid: true, - cleanedValue, - } - : { - isValid: false, - errorMessage, - }); -}; - // Import React // Regular express that matches urls const urlRegex = /(https?:\/\/)?([a-z0-9-]+\.)+[a-z0-9]{2,6}(:[0-9]{1,5})?(\/\S*)?/g; @@ -16344,30 +14568,6 @@ const makeLinksClickable = (text, opts) => { return elements; }; -// Constants -const VOWELS = ['a', 'e', 'i', 'o', 'u']; -/** - * Prefix a word or name with "a" or "an" depending on whether it starts with a - * vowel or not - * @author Gabe Abrams - * @param text the text to prefix - * @param capitalize whether to capitalize the "A" or "An" - * @returns the text prefixed with "a" or "an" - */ -const prefixWithAOrAn = (text, capitalize = false) => { - // Get the first letter - const firstLetter = text.charAt(0).toLowerCase(); - // Check if starts with vowel - const startsWithVowel = VOWELS.includes(firstLetter); - // Determine prefix - let prefix = startsWithVowel ? 'an' : 'a'; - if (capitalize) { - prefix = prefix.charAt(0).toUpperCase() + prefix.substring(1); - } - // Return the text prefixed with "a" or "an" - return `${prefix} ${text}`; -}; - /* -------- State Definition -------- */ /* ------------- Reducer ------------ */ /** @@ -16402,336 +14602,6 @@ const useForceRender = (useReducer) => { }; }; -/** - * Run the operator function on each item in the array, returning true if - * the operator function returns true for every item in the array - * @author Gabe Abrams - * @param operatorFunction the operator function to apply. If it returns true - * for every item, this function will return true - * @returns true if the operator function returns true for every item in the array - */ -const everyAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () { - // Create break logic - let done = false; - /** - * Break the loop (checking stops here) - * @author Gabe Abrams - */ - const breakNow = () => { - done = true; - }; - // Loop through each item, checking - for (let i = 0; i < array.length && !done; i++) { - const passed = yield operatorFunction(array[i], i, { - breakNow, - array, - }); - // Check if this one failed or if loop was broken - if (!passed || done) { - return false; - } - } - // Return true because none returned false - return true; -}); - -/** - * Run the operator function on each item in the array, returning a new array - * that only contains the items that pass the filter - * @author Gabe Abrams - * @param operatorFunction the operator function to apply. If it returns true - * for an item, the item will be included in the returned array - * @returns the filtered array - */ -const filterAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () { - // Create break logic - let done = false; - /** - * Break the loop (filtering stops here) - * @author Gabe Abrams - */ - const breakNow = () => { - done = true; - }; - // Loop through each item, filtering - const output = []; - for (let i = 0; i < array.length && !done; i++) { - const included = yield operatorFunction(array[i], i, { - breakNow, - array, - }); - if (included && !done) { - output.push(array[i]); - } - } - // Return results - return output; -}); - -/** - * Run the operator function on each item in the array - * @author Gabe Abrams - * @param operatorFunction the operator function to apply - */ -const forEachAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () { - // Create break logic - let done = false; - /** - * Break the loop - * @author Gabe Abrams - */ - const breakNow = () => { - done = true; - }; - // Loop through each item - for (let i = 0; i < array.length && !done; i++) { - yield operatorFunction(array[i], i, { - breakNow, - array, - }); - } -}); - -/** - * Run the operator function on each item in the array, collecting all results - * @author Gabe Abrams - * @param operatorFunction the operator function to apply - * @returns the array of results - */ -const mapAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () { - // Create break logic - let done = false; - /** - * Break the loop - * @author Gabe Abrams - */ - const breakNow = () => { - done = true; - }; - // Loop through each item, collecting results - const results = []; - for (let i = 0; i < array.length && !done; i++) { - const result = yield operatorFunction(array[i], i, { - breakNow, - array, - }); - results.push(result); - } - // Return results - return results; -}); - -/** - * Run the operator function on each item in the array, returning true if - * the operator function returns true for any item in the array - * @author Gabe Abrams - * @param operatorFunction the operator function to apply. If it returns true - * for any item, this function will return true - * @returns true if the operator function returns true for any item in the array - */ -const someAsync = (array, operatorFunction) => __awaiter(void 0, void 0, void 0, function* () { - // Create break logic - let done = false; - /** - * Break the loop (checking stops here) - * @author Gabe Abrams - */ - const breakNow = () => { - done = true; - }; - // Loop through each item, checking - for (let i = 0; i < array.length && !done; i++) { - const passed = yield operatorFunction(array[i], i, { - breakNow, - array, - }); - if (passed && !done) { - return true; - } - } - // Return false because none returned true - return false; -}); - -/** - * Capitalize every word in a string (just the first letter) - * @param str string to capitalize - * @returns string with every word capitalized - */ -const capitalize = (str) => { - return (str - // Split into words - .split(' ') - // Capitalize first letter of each word - .map((word) => { - return word.charAt(0).toUpperCase() + word.substring(1); - }) - // Join back together - .join(' ')); -}; - -/** - * Shuffle a given array - * @author Austen Money - * @param arr the array to shuffle - * @returns the shuffled array - */ -const shuffleArray = (arr) => { - const newArr = [...arr]; - // Shuffle using Durstenfeld algorithm - for (let i = arr.length - 1; i > 0; i--) { - const j = Math.floor(Math.random() * (i + 1)); - [newArr[i], newArr[j]] = [newArr[j], newArr[i]]; - } - return newArr; -}; - -const punctuationRegex = /[!@#$%^&*(),.?\/;:'"\-\[\]]/g; -/** - * Get number of words in string - * @author Gardenia Liu - * @author Allison Zhang - * @author Gabe Abrams - * @param text the string to check - * @returns number of words in the string - */ -const getWordCount = (text) => { - const trimmedTextWithoutPunctuation = (text - // Remove leading and trailing whitespace - .trim() - // Remove punctuation - .replace(punctuationRegex, '')); - if (trimmedTextWithoutPunctuation.length === 0) { - return 0; - } - return trimmedTextWithoutPunctuation.split(/\s+/g).length; -}; - -// Import shared types -/*----------------------------------------*/ -/* --------------- Helpers -------------- */ -/*----------------------------------------*/ -/** - * Check if a timestamp is valid - * @author Gabe Abrams - * @author Gardenia Liu - * @param opts object containing all arguments - * @param opts.timestamp Timestamp in milliseconds since epoch - * @param opts.expectedYear Expected year - * @param opts.expectedMonth Expected month - * @param opts.expectedDay Expected day - * @param opts.expectedHour Expected hour - * @param opts.expectedMinute Expected minute - * @returns 1 if the timestamp needs to be increased, -1 if it needs to be decreased, 0 if it is valid - */ -const checkTimestamp = (opts) => { - const { timestamp, expectedYear, expectedMonth, expectedDay, expectedHour, expectedMinute, } = opts; - const timeInfoInET = getTimeInfoInET(timestamp); - if (timeInfoInET.year < expectedYear) { - return 1; - } - if (timeInfoInET.year > expectedYear) { - return -1; - } - if (timeInfoInET.month < expectedMonth) { - return 1; - } - if (timeInfoInET.month > expectedMonth) { - return -1; - } - if (timeInfoInET.day < expectedDay) { - return 1; - } - if (timeInfoInET.day > expectedDay) { - return -1; - } - if (timeInfoInET.hour < expectedHour) { - return 1; - } - if (timeInfoInET.hour > expectedHour) { - return -1; - } - if (timeInfoInET.minute < expectedMinute) { - return 1; - } - if (timeInfoInET.minute > expectedMinute) { - return -1; - } - return 0; -}; -/*----------------------------------------*/ -/* ---------------- Main ---------------- */ -/*----------------------------------------*/ -/** - * Get a timestamp (ms since epoch) from time info (year, month, day, hour, minute, etc.) in Eastern Time (ET) - * @author Gardenia Liu - * @author Gabe Abrams - * @param opts object containing all arguments - * @param opts.year Year (e.g. 2023) - * @param opts.month Month (1-12) - * @param opts.day Day of the month (1-31) - * @param opts.hour Hour (0-23) - * @param opts.minute Minute (0-59) - * @returns Timestamp in milliseconds since epoch - */ -const getTimestampFromTimeInfoInET = (opts) => { - // Destructure opts - const { year, month, day, hour, minute, } = opts; - // Determine if the date is in DST in Eastern Time - const tempDate = new Date(year, month - 1, day); - const janOffset = new Date(year, 0, 1).getTimezoneOffset(); - const isDST = tempDate.getTimezoneOffset() < janOffset; - const etOffset = isDST ? '-04:00' : '-05:00'; - // Format with leading zeroes - const mm = padZerosLeft(month, 2); - const dd = padZerosLeft(day, 2); - const hh = padZerosLeft(hour, 2); - const min = padZerosLeft(minute, 2); - // Build ET ISO string and convert to UTC timestamp - const etISOString = `${year}-${mm}-${dd}T${hh}:${min}:00${etOffset}`; - const baseTimestamp = (new Date(etISOString)).getTime(); - let timestamp = baseTimestamp; - // Heat seek to get the right timestamp - const maxOffset = 24 * 60; // 24 hours in minutes - let currentOffset = 0; // minutes - const offsetIncrement = 15; // minutes - const offsetDirection = checkTimestamp({ - timestamp, - expectedYear: year, - expectedMonth: month, - expectedDay: day, - expectedHour: hour, - expectedMinute: minute, - }); - if (offsetDirection === 0) { - // Valid! Return the timestamp - return timestamp; - } - // Heat seek - while (Math.abs(currentOffset) < maxOffset) { - // Update offset - currentOffset += (offsetDirection * offsetIncrement); - // Update timestamp - const offsetMs = currentOffset * 60 * 1000; - timestamp = baseTimestamp + offsetMs; - // Check timestamp again - const newDirection = checkTimestamp({ - timestamp, - expectedYear: year, - expectedMonth: month, - expectedDay: day, - expectedHour: hour, - expectedMinute: minute, - }); - if (newDirection === 0) { - // Valid! Return the timestamp - return timestamp; - } - // Invalid. Keep looping. - } - throw new ErrorWithCode(`Timestamp mismatch: expected ${year}-${mm}-${dd} ${hh}:${min}, seeked to offset ${currentOffset} minutes but could not find a valid timestamp.`, ReactKitErrorCode$1.ETTimestampInvalid); -}; - /*------------------------------------------------------------------------*/ /* ------------------------------- Caching ------------------------------ */ /*------------------------------------------------------------------------*/ @@ -16753,7 +14623,7 @@ const isSelectAdmin = () => __awaiter(void 0, void 0, void 0, function* () { // Check if the user is a select admin try { const userIsSelectAdmin = yield visitServerEndpoint({ - path: SELECT_ADMIN_CHECK_ROUTE, + path: dceCommonkit.SELECT_ADMIN_CHECK_ROUTE, method: 'GET', }); // Cache the result @@ -16768,127 +14638,279 @@ const isSelectAdmin = () => __awaiter(void 0, void 0, void 0, function* () { } }); -/** - * Days of the week - * @author Gabe Abrams - */ -var DayOfWeek; -(function (DayOfWeek) { - DayOfWeek["Monday"] = "m"; - DayOfWeek["Tuesday"] = "t"; - DayOfWeek["Wednesday"] = "w"; - DayOfWeek["Thursday"] = "r"; - DayOfWeek["Friday"] = "f"; - DayOfWeek["Saturday"] = "s"; - DayOfWeek["Sunday"] = "u"; -})(DayOfWeek || (DayOfWeek = {})); -var DayOfWeek$1 = DayOfWeek; - +Object.defineProperty(exports, 'CommonKitErrorCode', { + enumerable: true, + get: function () { return dceCommonkit.CommonKitErrorCode; } +}); +Object.defineProperty(exports, 'DAY_IN_MS', { + enumerable: true, + get: function () { return dceCommonkit.DAY_IN_MS; } +}); +Object.defineProperty(exports, 'DayOfWeek', { + enumerable: true, + get: function () { return dceCommonkit.DayOfWeek; } +}); +Object.defineProperty(exports, 'ErrorWithCode', { + enumerable: true, + get: function () { return dceCommonkit.ErrorWithCode; } +}); +Object.defineProperty(exports, 'HOUR_IN_MS', { + enumerable: true, + get: function () { return dceCommonkit.HOUR_IN_MS; } +}); +Object.defineProperty(exports, 'LOG_REVIEW_GET_LOGS_ROUTE', { + enumerable: true, + get: function () { return dceCommonkit.LOG_REVIEW_GET_LOGS_ROUTE; } +}); +Object.defineProperty(exports, 'LOG_REVIEW_ROUTE_PATH_PREFIX', { + enumerable: true, + get: function () { return dceCommonkit.LOG_REVIEW_ROUTE_PATH_PREFIX; } +}); +Object.defineProperty(exports, 'LOG_REVIEW_STATUS_ROUTE', { + enumerable: true, + get: function () { return dceCommonkit.LOG_REVIEW_STATUS_ROUTE; } +}); +Object.defineProperty(exports, 'LOG_ROUTE_PATH', { + enumerable: true, + get: function () { return dceCommonkit.LOG_ROUTE_PATH; } +}); +Object.defineProperty(exports, 'LogAction', { + enumerable: true, + get: function () { return dceCommonkit.LogAction; } +}); +Object.defineProperty(exports, 'LogBuiltInMetadata', { + enumerable: true, + get: function () { return dceCommonkit.LogBuiltInMetadata; } +}); +Object.defineProperty(exports, 'LogLevel', { + enumerable: true, + get: function () { return dceCommonkit.LogLevel; } +}); +Object.defineProperty(exports, 'LogSource', { + enumerable: true, + get: function () { return dceCommonkit.LogSource; } +}); +Object.defineProperty(exports, 'LogType', { + enumerable: true, + get: function () { return dceCommonkit.LogType; } +}); +Object.defineProperty(exports, 'MINUTE_IN_MS', { + enumerable: true, + get: function () { return dceCommonkit.MINUTE_IN_MS; } +}); +Object.defineProperty(exports, 'ParamType', { + enumerable: true, + get: function () { return dceCommonkit.ParamType; } +}); +Object.defineProperty(exports, 'SELECT_ADMIN_CHECK_ROUTE', { + enumerable: true, + get: function () { return dceCommonkit.SELECT_ADMIN_CHECK_ROUTE; } +}); +Object.defineProperty(exports, 'abbreviate', { + enumerable: true, + get: function () { return dceCommonkit.abbreviate; } +}); +Object.defineProperty(exports, 'avg', { + enumerable: true, + get: function () { return dceCommonkit.avg; } +}); +Object.defineProperty(exports, 'capitalize', { + enumerable: true, + get: function () { return dceCommonkit.capitalize; } +}); +Object.defineProperty(exports, 'ceilToNumDecimals', { + enumerable: true, + get: function () { return dceCommonkit.ceilToNumDecimals; } +}); +Object.defineProperty(exports, 'cloneDeep', { + enumerable: true, + get: function () { return dceCommonkit.cloneDeep; } +}); +Object.defineProperty(exports, 'compareArraysByProp', { + enumerable: true, + get: function () { return dceCommonkit.compareArraysByProp; } +}); +Object.defineProperty(exports, 'everyAsync', { + enumerable: true, + get: function () { return dceCommonkit.everyAsync; } +}); +Object.defineProperty(exports, 'extractProp', { + enumerable: true, + get: function () { return dceCommonkit.extractProp; } +}); +Object.defineProperty(exports, 'filterAsync', { + enumerable: true, + get: function () { return dceCommonkit.filterAsync; } +}); +Object.defineProperty(exports, 'floorToNumDecimals', { + enumerable: true, + get: function () { return dceCommonkit.floorToNumDecimals; } +}); +Object.defineProperty(exports, 'forEachAsync', { + enumerable: true, + get: function () { return dceCommonkit.forEachAsync; } +}); +Object.defineProperty(exports, 'forceNumIntoBounds', { + enumerable: true, + get: function () { return dceCommonkit.forceNumIntoBounds; } +}); +Object.defineProperty(exports, 'genCSV', { + enumerable: true, + get: function () { return dceCommonkit.genCSV; } +}); +Object.defineProperty(exports, 'genCommaList', { + enumerable: true, + get: function () { return dceCommonkit.genCommaList; } +}); +Object.defineProperty(exports, 'getHumanReadableDate', { + enumerable: true, + get: function () { return dceCommonkit.getHumanReadableDate; } +}); +Object.defineProperty(exports, 'getLocalTimeInfo', { + enumerable: true, + get: function () { return dceCommonkit.getLocalTimeInfo; } +}); +Object.defineProperty(exports, 'getMonthName', { + enumerable: true, + get: function () { return dceCommonkit.getMonthName; } +}); +Object.defineProperty(exports, 'getOrdinal', { + enumerable: true, + get: function () { return dceCommonkit.getOrdinal; } +}); +Object.defineProperty(exports, 'getPartOfDay', { + enumerable: true, + get: function () { return dceCommonkit.getPartOfDay; } +}); +Object.defineProperty(exports, 'getTimeInfoInET', { + enumerable: true, + get: function () { return dceCommonkit.getTimeInfoInET; } +}); +Object.defineProperty(exports, 'getTimestampFromTimeInfoInET', { + enumerable: true, + get: function () { return dceCommonkit.getTimestampFromTimeInfoInET; } +}); +Object.defineProperty(exports, 'getWordCount', { + enumerable: true, + get: function () { return dceCommonkit.getWordCount; } +}); +Object.defineProperty(exports, 'idify', { + enumerable: true, + get: function () { return dceCommonkit.idify; } +}); +Object.defineProperty(exports, 'mapAsync', { + enumerable: true, + get: function () { return dceCommonkit.mapAsync; } +}); +Object.defineProperty(exports, 'onlyKeepLetters', { + enumerable: true, + get: function () { return dceCommonkit.onlyKeepLetters; } +}); +Object.defineProperty(exports, 'padDecimalZeros', { + enumerable: true, + get: function () { return dceCommonkit.padDecimalZeros; } +}); +Object.defineProperty(exports, 'padZerosLeft', { + enumerable: true, + get: function () { return dceCommonkit.padZerosLeft; } +}); +Object.defineProperty(exports, 'parallelLimit', { + enumerable: true, + get: function () { return dceCommonkit.parallelLimit; } +}); +Object.defineProperty(exports, 'prefixWithAOrAn', { + enumerable: true, + get: function () { return dceCommonkit.prefixWithAOrAn; } +}); +Object.defineProperty(exports, 'roundToNumDecimals', { + enumerable: true, + get: function () { return dceCommonkit.roundToNumDecimals; } +}); +Object.defineProperty(exports, 'shuffleArray', { + enumerable: true, + get: function () { return dceCommonkit.shuffleArray; } +}); +Object.defineProperty(exports, 'someAsync', { + enumerable: true, + get: function () { return dceCommonkit.someAsync; } +}); +Object.defineProperty(exports, 'startMinWait', { + enumerable: true, + get: function () { return dceCommonkit.startMinWait; } +}); +Object.defineProperty(exports, 'stringsToHumanReadableList', { + enumerable: true, + get: function () { return dceCommonkit.stringsToHumanReadableList; } +}); +Object.defineProperty(exports, 'sum', { + enumerable: true, + get: function () { return dceCommonkit.sum; } +}); +Object.defineProperty(exports, 'validateEmail', { + enumerable: true, + get: function () { return dceCommonkit.validateEmail; } +}); +Object.defineProperty(exports, 'validatePhoneNumber', { + enumerable: true, + get: function () { return dceCommonkit.validatePhoneNumber; } +}); +Object.defineProperty(exports, 'validateString', { + enumerable: true, + get: function () { return dceCommonkit.validateString; } +}); +Object.defineProperty(exports, 'waitMs', { + enumerable: true, + get: function () { return dceCommonkit.waitMs; } +}); exports.AppWrapper = AppWrapper; exports.AutoscrollToBottomContainer = AutoscrollToBottomContainer; exports.ButtonInputGroup = ButtonInputGroup; exports.CSVDownloadButton = CSVDownloadButton; exports.CheckboxButton = CheckboxButton; exports.CopiableBox = CopiableBox; -exports.DAY_IN_MS = DAY_IN_MS; exports.DBEntryFieldType = DBEntryFieldType$1; exports.DBEntryManagerPanel = DBEntryManagerPanel; -exports.DayOfWeek = DayOfWeek$1; exports.Drawer = Drawer; exports.Dropdown = Dropdown; exports.DropdownItemType = DropdownItemType$1; exports.DynamicWord = DynamicWord; exports.ErrorBox = ErrorBox; -exports.ErrorWithCode = ErrorWithCode; -exports.HOUR_IN_MS = HOUR_IN_MS; exports.IntelliTable = IntelliTable; exports.ItemPicker = ItemPicker; -exports.LOG_REVIEW_GET_LOGS_ROUTE = LOG_REVIEW_GET_LOGS_ROUTE; -exports.LOG_REVIEW_ROUTE_PATH_PREFIX = LOG_REVIEW_ROUTE_PATH_PREFIX; -exports.LOG_REVIEW_STATUS_ROUTE = LOG_REVIEW_STATUS_ROUTE; -exports.LOG_ROUTE_PATH = LOG_ROUTE_PATH; exports.LoadingSpinner = LoadingSpinner; -exports.LogAction = LogAction$1; -exports.LogBuiltInMetadata = LogBuiltInMetadata; -exports.LogLevel = LogLevel$1; exports.LogReviewer = LogReviewer; -exports.LogSource = LogSource$1; -exports.LogType = LogType$1; -exports.MINUTE_IN_MS = MINUTE_IN_MS; exports.Modal = Modal; exports.ModalButtonType = ModalButtonType$1; exports.ModalSize = ModalSize$1; exports.ModalType = ModalType$1; exports.MultiSwitch = MultiSwitch; -exports.ParamType = ParamType$1; exports.PopFailureMark = PopFailureMark; exports.PopPendingMark = PopPendingMark; exports.PopSuccessMark = PopSuccessMark; exports.ProgressBar = ProgressBar; exports.ProgressBarSize = ProgressBarSize$1; exports.RadioButton = RadioButton; -exports.ReactKitErrorCode = ReactKitErrorCode$1; -exports.SELECT_ADMIN_CHECK_ROUTE = SELECT_ADMIN_CHECK_ROUTE; exports.SimpleDateChooser = SimpleDateChooser; exports.SimpleTimeChooser = SimpleTimeChooser; exports.TabBox = TabBox; exports.ToggleSwitch = ToggleSwitch; exports.Tooltip = Tooltip; exports.Variant = Variant$1; -exports.abbreviate = abbreviate; exports.addFatalErrorHandler = addFatalErrorHandler; exports.alert = alert; -exports.avg = avg; exports.canReviewLogs = canReviewLogs; -exports.capitalize = capitalize; -exports.ceilToNumDecimals = ceilToNumDecimals; -exports.cloneDeep = cloneDeep; exports.combineClassNames = combineClassNames; -exports.compareArraysByProp = compareArraysByProp; exports.confirm = confirm; -exports.everyAsync = everyAsync; -exports.extractProp = extractProp; -exports.filterAsync = filterAsync; -exports.floorToNumDecimals = floorToNumDecimals; -exports.forEachAsync = forEachAsync; -exports.forceNumIntoBounds = forceNumIntoBounds; -exports.genCSV = genCSV; -exports.genCommaList = genCommaList; -exports.getHumanReadableDate = getHumanReadableDate; -exports.getLocalTimeInfo = getLocalTimeInfo; -exports.getMonthName = getMonthName; -exports.getOrdinal = getOrdinal; -exports.getPartOfDay = getPartOfDay; -exports.getTimeInfoInET = getTimeInfoInET; -exports.getTimestampFromTimeInfoInET = getTimestampFromTimeInfoInET; -exports.getWordCount = getWordCount; -exports.idify = idify; exports.initClient = initClient; exports.isMobileOrTablet = isMobileOrTablet; exports.isSelectAdmin = isSelectAdmin; exports.leaveToURL = leaveToURL; exports.logClientEvent = logClientEvent; exports.makeLinksClickable = makeLinksClickable; -exports.mapAsync = mapAsync; -exports.onlyKeepLetters = onlyKeepLetters; -exports.padDecimalZeros = padDecimalZeros; -exports.padZerosLeft = padZerosLeft; -exports.parallelLimit = parallelLimit; -exports.prefixWithAOrAn = prefixWithAOrAn; exports.prompt = prompt; -exports.roundToNumDecimals = roundToNumDecimals; exports.setClientEventMetadataPopulator = setClientEventMetadataPopulator; exports.showFatalError = showFatalError; -exports.shuffleArray = shuffleArray; -exports.someAsync = someAsync; -exports.startMinWait = startMinWait; -exports.stringsToHumanReadableList = stringsToHumanReadableList; exports.stubServerEndpoint = stubServerEndpoint; -exports.sum = sum; exports.useForceRender = useForceRender; -exports.validateEmail = validateEmail; -exports.validatePhoneNumber = validatePhoneNumber; -exports.validateString = validateString; exports.visitServerEndpoint = visitServerEndpoint; -exports.waitMs = waitMs; //# sourceMappingURL=index.js.map diff --git a/dist/cjs/index.js.map b/dist/cjs/index.js.map index 852b6740..e7647c19 100644 --- a/dist/cjs/index.js.map +++ b/dist/cjs/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sources":["../../node_modules/tslib/tslib.es6.js","../../src/types/ReactKitErrorCode.tsx","../../src/types/Variant.tsx","../../src/components/ErrorBox.tsx","../../src/types/ModalButtonType.ts","../../src/types/ModalType.ts","../../src/types/LogBuiltInMetadata.ts","../../node_modules/react-dom/cjs/react-dom.production.js","../../node_modules/react-dom/cjs/react-dom.development.js","../../node_modules/react-dom/index.js","../../src/components/LoadingSpinner.tsx","../../src/helpers/waitMs.tsx","../../src/types/ModalSize.ts","../../src/constants/NUM_MODAL_PORTALS.ts","../../src/errors/ErrorWithCode.tsx","../../src/helpers/initClient.tsx","../../src/components/Modal/index.tsx","../../src/constants/ROUTE_PATH_PREFIX.ts","../../src/constants/LOG_ROUTE_PATH.ts","../../src/types/LogLevel.ts","../../src/helpers/visitServerEndpoint.tsx","../../src/helpers/logClientEvent.tsx","../../src/stylesheets/shared.css.ts","../../src/components/AppWrapper.tsx","../../src/components/TabBox.tsx","../../src/components/RadioButton.tsx","../../src/components/CheckboxButton.tsx","../../src/components/ButtonInputGroup.tsx","../../src/helpers/getOrdinal.ts","../../src/helpers/getMonthName.ts","../../src/helpers/getTimeInfoInET.ts","../../src/components/SimpleDateChooser.tsx","../../src/helpers/padZerosLeft.tsx","../../src/components/SimpleTimeChooser.tsx","../../src/components/Drawer.tsx","../../src/components/PopSuccessMark.tsx","../../src/components/PopFailureMark.tsx","../../src/components/PopPendingMark.tsx","../../src/components/CopiableBox.tsx","../../src/components/ItemPicker/NestableItemList.tsx","../../src/components/ItemPicker/index.tsx","../../src/helpers/getHumanReadableDate.ts","../../src/constants/LOG_REVIEW_GET_LOGS_ROUTE.ts","../../src/types/LogSource.ts","../../src/types/LogType.ts","../../src/types/LogAction.ts","../../src/types/ParamType.ts","../../src/helpers/roundToNumDecimals.tsx","../../src/helpers/genCSV.ts","../../src/components/CSVDownloadButton.tsx","../../src/components/IntelliTable.tsx","../../src/components/Pagination.tsx","../../src/helpers/cloneDeep.ts","../../src/components/LogReviewer.tsx","../../src/components/DBEntryManagerPanel/types/DBEntryFieldType.ts","../../node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/@babel/runtime/helpers/esm/typeof.js","../../node_modules/@babel/runtime/helpers/esm/toPrimitive.js","../../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js","../../node_modules/@babel/runtime/helpers/esm/defineProperty.js","../../node_modules/@babel/runtime/helpers/esm/objectSpread2.js","../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../../node_modules/@babel/runtime/helpers/esm/createClass.js","../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../node_modules/@babel/runtime/helpers/esm/inherits.js","../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../../node_modules/@babel/runtime/helpers/esm/createSuper.js","../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../../node_modules/@emotion/sheet/dist/emotion-sheet.esm.js","../../node_modules/stylis/src/Enum.js","../../node_modules/stylis/src/Utility.js","../../node_modules/stylis/src/Tokenizer.js","../../node_modules/stylis/src/Parser.js","../../node_modules/stylis/src/Serializer.js","../../node_modules/stylis/src/Middleware.js","../../node_modules/@emotion/weak-memoize/dist/emotion-weak-memoize.esm.js","../../node_modules/@emotion/memoize/dist/emotion-memoize.esm.js","../../node_modules/@emotion/cache/dist/emotion-cache.esm.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.production.min.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/cjs/react-is.development.js","../../node_modules/hoist-non-react-statics/node_modules/react-is/index.js","../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../node_modules/@emotion/utils/dist/emotion-utils.esm.js","../../node_modules/@emotion/hash/dist/emotion-hash.esm.js","../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../../node_modules/@emotion/serialize/dist/emotion-serialize.esm.js","../../node_modules/@emotion/use-insertion-effect-with-fallbacks/dist/emotion-use-insertion-effect-with-fallbacks.esm.js","../../node_modules/@emotion/react/dist/emotion-element-d59e098f.esm.js","../../node_modules/@emotion/react/dist/emotion-react.esm.js","../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js","../../node_modules/@babel/runtime/helpers/esm/taggedTemplateLiteral.js","../../node_modules/@floating-ui/utils/dist/floating-ui.utils.mjs","../../node_modules/@floating-ui/core/dist/floating-ui.core.mjs","../../node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.mjs","../../node_modules/@floating-ui/dom/dist/floating-ui.dom.mjs","../../node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.esm.js","../../node_modules/memoize-one/dist/memoize-one.esm.js","../../node_modules/react-select/dist/useStateManager-7e1e8489.esm.js","../../node_modules/react-select/dist/useCreatable-84008237.esm.js","../../node_modules/react-select/creatable/dist/react-select-creatable.esm.js","../../src/components/DBEntryManagerPanel/AddOrEditDBEntry/CreatableMultiselect.tsx","../../src/components/DBEntryManagerPanel/AddOrEditDBEntry/index.tsx","../../src/components/DBEntryManagerPanel/helpers/generateEndpointPath.ts","../../src/components/DBEntryManagerPanel/index.tsx","../../src/components/Tooltip.tsx","../../src/components/ToggleSwitch.tsx","../../src/helpers/idify.ts","../../src/components/AutoscrollToBottomContainer.tsx","../../src/helpers/combineClassNames.ts","../../src/components/MultiSwitch.tsx","../../src/types/DropdownItemType.ts","../../src/components/Dropdown.tsx","../../src/types/ProgressBarSize.ts","../../src/components/ProgressBar.tsx","../../src/constants/MINUTE_IN_MS.ts","../../src/constants/HOUR_IN_MS.ts","../../src/constants/DAY_IN_MS.ts","../../src/constants/LOG_REVIEW_ROUTE_PATH_PREFIX.ts","../../src/constants/LOG_REVIEW_STATUS_ROUTE.ts","../../src/constants/SELECT_ADMIN_CHECK_ROUTE.ts","../../src/helpers/isMobileOrTablet.tsx","../../src/dynamicConstants/DynamicWord.tsx","../../src/helpers/abbreviate.ts","../../src/helpers/sum.tsx","../../src/helpers/avg.ts","../../src/helpers/ceilToNumDecimals.ts","../../src/helpers/floorToNumDecimals.ts","../../src/helpers/forceNumIntoBounds.ts","../../src/helpers/padDecimalZeros.tsx","../../src/helpers/stubServerEndpoint.tsx","../../src/helpers/startMinWait.ts","../../src/helpers/getPartOfDay.ts","../../src/helpers/stringsToHumanReadableList.ts","../../src/helpers/onlyKeepLetters.ts","../../src/helpers/parallelLimit.ts","../../src/helpers/canReviewLogs.ts","../../src/helpers/extractProp.ts","../../src/helpers/compareArraysByProp.ts","../../src/helpers/getLocalTimeInfo.ts","../../src/helpers/genCommaList.ts","../../src/helpers/validators/shared/constants/ERROR_MESSAGES.ts","../../src/helpers/validators/shared/helpers/validateRegex.ts","../../src/helpers/validators/validateEmail.ts","../../src/helpers/validators/validatePhoneNumber.ts","../../src/helpers/validators/validateString.ts","../../src/helpers/makeLinksClickable.tsx","../../src/helpers/prefixWithAOrAn.ts","../../src/helpers/useForceRender.tsx","../../src/helpers/asyncArrayFunctions/everyAsync.ts","../../src/helpers/asyncArrayFunctions/filterAsync.ts","../../src/helpers/asyncArrayFunctions/forEachAsync.ts","../../src/helpers/asyncArrayFunctions/mapAsync.ts","../../src/helpers/asyncArrayFunctions/someAsync.ts","../../src/helpers/capitalize.ts","../../src/helpers/shuffleArray.ts","../../src/helpers/getWordCount.ts","../../src/helpers/getTimestampFromTimeInfoInET.ts","../../src/helpers/isSelectAdmin.ts","../../src/types/DayOfWeek.ts"],"sourcesContent":["/*! *****************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nexport var __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nexport function __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nexport function __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nexport function __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nexport function __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nexport function __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nexport function __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nexport function __createBinding(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n}\r\n\r\nexport function __exportStar(m, exports) {\r\n for (var p in m) if (p !== \"default\" && !exports.hasOwnProperty(p)) exports[p] = m[p];\r\n}\r\n\r\nexport function __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nexport function __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\nexport function __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\nexport function __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n};\r\n\r\nexport function __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nexport function __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nexport function __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nexport function __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nexport function __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nexport function __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];\r\n result.default = mod;\r\n return result;\r\n}\r\n\r\nexport function __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nexport function __classPrivateFieldGet(receiver, privateMap) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to get private field on non-instance\");\r\n }\r\n return privateMap.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, privateMap, value) {\r\n if (!privateMap.has(receiver)) {\r\n throw new TypeError(\"attempted to set private field on non-instance\");\r\n }\r\n privateMap.set(receiver, value);\r\n return value;\r\n}\r\n",null,null,null,null,null,null,"/**\n * @license React\n * react-dom.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\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\";\nvar React = require(\"react\");\nfunction formatProdErrorMessage(code) {\n var url = \"https://react.dev/errors/\" + code;\n if (1 < arguments.length) {\n url += \"?args[]=\" + encodeURIComponent(arguments[1]);\n for (var i = 2; i < arguments.length; i++)\n url += \"&args[]=\" + encodeURIComponent(arguments[i]);\n }\n return (\n \"Minified React error #\" +\n code +\n \"; visit \" +\n url +\n \" for the full message or use the non-minified dev environment for full errors and additional helpful warnings.\"\n );\n}\nfunction noop() {}\nvar Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(formatProdErrorMessage(522));\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\");\nfunction createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key: null == key ? null : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n}\nvar ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\nfunction getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n}\nexports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\nexports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(formatProdErrorMessage(299));\n return createPortal$1(children, container, null, key);\n};\nexports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn)) return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f();\n }\n};\nexports.preconnect = function (href, options) {\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n};\nexports.prefetchDNS = function (href) {\n \"string\" === typeof href && Internals.d.D(href);\n};\nexports.preinit = function (href, options) {\n if (\"string\" === typeof href && options && \"string\" === typeof options.as) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence ? options.precedence : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n};\nexports.preinitModule = function (href, options) {\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as) {\n var crossOrigin = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n );\n Internals.d.M(href, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n } else null == options && Internals.d.M(href);\n};\nexports.preload = function (href, options) {\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin);\n Internals.d.L(href, as, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet ? options.imageSrcSet : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes ? options.imageSizes : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n};\nexports.preloadModule = function (href, options) {\n if (\"string\" === typeof href)\n if (options) {\n var crossOrigin = getCrossOriginStringAs(options.as, options.crossOrigin);\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0\n });\n } else Internals.d.m(href);\n};\nexports.requestFormReset = function (form) {\n Internals.d.r(form);\n};\nexports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n};\nexports.useFormState = function (action, initialState, permalink) {\n return ReactSharedInternals.H.useFormState(action, initialState, permalink);\n};\nexports.useFormStatus = function () {\n return ReactSharedInternals.H.useHostTransitionStatus();\n};\nexports.version = \"19.0.0\";\n","/**\n * @license React\n * react-dom.development.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\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\"production\" !== process.env.NODE_ENV &&\n (function () {\n function noop() {}\n function testStringCoercion(value) {\n return \"\" + value;\n }\n function createPortal$1(children, containerInfo, implementation) {\n var key =\n 3 < arguments.length && void 0 !== arguments[3] ? arguments[3] : null;\n try {\n testStringCoercion(key);\n var JSCompiler_inline_result = !1;\n } catch (e) {\n JSCompiler_inline_result = !0;\n }\n JSCompiler_inline_result &&\n (console.error(\n \"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.\",\n (\"function\" === typeof Symbol &&\n Symbol.toStringTag &&\n key[Symbol.toStringTag]) ||\n key.constructor.name ||\n \"Object\"\n ),\n testStringCoercion(key));\n return {\n $$typeof: REACT_PORTAL_TYPE,\n key: null == key ? null : \"\" + key,\n children: children,\n containerInfo: containerInfo,\n implementation: implementation\n };\n }\n function getCrossOriginStringAs(as, input) {\n if (\"font\" === as) return \"\";\n if (\"string\" === typeof input)\n return \"use-credentials\" === input ? input : \"\";\n }\n function getValueDescriptorExpectingObjectForWarning(thing) {\n return null === thing\n ? \"`null`\"\n : void 0 === thing\n ? \"`undefined`\"\n : \"\" === thing\n ? \"an empty string\"\n : 'something with type \"' + typeof thing + '\"';\n }\n function getValueDescriptorExpectingEnumForWarning(thing) {\n return null === thing\n ? \"`null`\"\n : void 0 === thing\n ? \"`undefined`\"\n : \"\" === thing\n ? \"an empty string\"\n : \"string\" === typeof thing\n ? JSON.stringify(thing)\n : \"number\" === typeof thing\n ? \"`\" + thing + \"`\"\n : 'something with type \"' + typeof thing + '\"';\n }\n function resolveDispatcher() {\n var dispatcher = ReactSharedInternals.H;\n null === dispatcher &&\n console.error(\n \"Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:\\n1. You might have mismatching versions of React and the renderer (such as React DOM)\\n2. You might be breaking the Rules of Hooks\\n3. You might have more than one copy of React in the same app\\nSee https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.\"\n );\n return dispatcher;\n }\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());\n var React = require(\"react\"),\n Internals = {\n d: {\n f: noop,\n r: function () {\n throw Error(\n \"Invalid form element. requestFormReset must be passed a form that was rendered by React.\"\n );\n },\n D: noop,\n C: noop,\n L: noop,\n m: noop,\n X: noop,\n S: noop,\n M: noop\n },\n p: 0,\n findDOMNode: null\n },\n REACT_PORTAL_TYPE = Symbol.for(\"react.portal\"),\n ReactSharedInternals =\n React.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;\n (\"function\" === typeof Map &&\n null != Map.prototype &&\n \"function\" === typeof Map.prototype.forEach &&\n \"function\" === typeof Set &&\n null != Set.prototype &&\n \"function\" === typeof Set.prototype.clear &&\n \"function\" === typeof Set.prototype.forEach) ||\n console.error(\n \"React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://reactjs.org/link/react-polyfills\"\n );\n exports.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE =\n Internals;\n exports.createPortal = function (children, container) {\n var key =\n 2 < arguments.length && void 0 !== arguments[2] ? arguments[2] : null;\n if (\n !container ||\n (1 !== container.nodeType &&\n 9 !== container.nodeType &&\n 11 !== container.nodeType)\n )\n throw Error(\"Target container is not a DOM element.\");\n return createPortal$1(children, container, null, key);\n };\n exports.flushSync = function (fn) {\n var previousTransition = ReactSharedInternals.T,\n previousUpdatePriority = Internals.p;\n try {\n if (((ReactSharedInternals.T = null), (Internals.p = 2), fn))\n return fn();\n } finally {\n (ReactSharedInternals.T = previousTransition),\n (Internals.p = previousUpdatePriority),\n Internals.d.f() &&\n console.error(\n \"flushSync was called from inside a lifecycle method. React cannot flush when React is already rendering. Consider moving this call to a scheduler task or micro task.\"\n );\n }\n };\n exports.preconnect = function (href, options) {\n \"string\" === typeof href && href\n ? null != options && \"object\" !== typeof options\n ? console.error(\n \"ReactDOM.preconnect(): Expected the `options` argument (second) to be an object but encountered %s instead. The only supported option at this time is `crossOrigin` which accepts a string.\",\n getValueDescriptorExpectingEnumForWarning(options)\n )\n : null != options &&\n \"string\" !== typeof options.crossOrigin &&\n console.error(\n \"ReactDOM.preconnect(): Expected the `crossOrigin` option (second argument) to be a string but encountered %s instead. Try removing this option or passing a string value instead.\",\n getValueDescriptorExpectingObjectForWarning(options.crossOrigin)\n )\n : console.error(\n \"ReactDOM.preconnect(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.\",\n getValueDescriptorExpectingObjectForWarning(href)\n );\n \"string\" === typeof href &&\n (options\n ? ((options = options.crossOrigin),\n (options =\n \"string\" === typeof options\n ? \"use-credentials\" === options\n ? options\n : \"\"\n : void 0))\n : (options = null),\n Internals.d.C(href, options));\n };\n exports.prefetchDNS = function (href) {\n if (\"string\" !== typeof href || !href)\n console.error(\n \"ReactDOM.prefetchDNS(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.\",\n getValueDescriptorExpectingObjectForWarning(href)\n );\n else if (1 < arguments.length) {\n var options = arguments[1];\n \"object\" === typeof options && options.hasOwnProperty(\"crossOrigin\")\n ? console.error(\n \"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. It looks like the you are attempting to set a crossOrigin property for this DNS lookup hint. Browsers do not perform DNS queries using CORS and setting this attribute on the resource hint has no effect. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.\",\n getValueDescriptorExpectingEnumForWarning(options)\n )\n : console.error(\n \"ReactDOM.prefetchDNS(): Expected only one argument, `href`, but encountered %s as a second argument instead. This argument is reserved for future options and is currently disallowed. Try calling ReactDOM.prefetchDNS() with just a single string argument, `href`.\",\n getValueDescriptorExpectingEnumForWarning(options)\n );\n }\n \"string\" === typeof href && Internals.d.D(href);\n };\n exports.preinit = function (href, options) {\n \"string\" === typeof href && href\n ? null == options || \"object\" !== typeof options\n ? console.error(\n \"ReactDOM.preinit(): Expected the `options` argument (second) to be an object with an `as` property describing the type of resource to be preinitialized but encountered %s instead.\",\n getValueDescriptorExpectingEnumForWarning(options)\n )\n : \"style\" !== options.as &&\n \"script\" !== options.as &&\n console.error(\n 'ReactDOM.preinit(): Expected the `as` property in the `options` argument (second) to contain a valid value describing the type of resource to be preinitialized but encountered %s instead. Valid values for `as` are \"style\" and \"script\".',\n getValueDescriptorExpectingEnumForWarning(options.as)\n )\n : console.error(\n \"ReactDOM.preinit(): Expected the `href` argument (first) to be a non-empty string but encountered %s instead.\",\n getValueDescriptorExpectingObjectForWarning(href)\n );\n if (\n \"string\" === typeof href &&\n options &&\n \"string\" === typeof options.as\n ) {\n var as = options.as,\n crossOrigin = getCrossOriginStringAs(as, options.crossOrigin),\n integrity =\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n fetchPriority =\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0;\n \"style\" === as\n ? Internals.d.S(\n href,\n \"string\" === typeof options.precedence\n ? options.precedence\n : void 0,\n {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority\n }\n )\n : \"script\" === as &&\n Internals.d.X(href, {\n crossOrigin: crossOrigin,\n integrity: integrity,\n fetchPriority: fetchPriority,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n }\n };\n exports.preinitModule = function (href, options) {\n var encountered = \"\";\n (\"string\" === typeof href && href) ||\n (encountered +=\n \" The `href` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(href) +\n \".\");\n void 0 !== options && \"object\" !== typeof options\n ? (encountered +=\n \" The `options` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options) +\n \".\")\n : options &&\n \"as\" in options &&\n \"script\" !== options.as &&\n (encountered +=\n \" The `as` option encountered was \" +\n getValueDescriptorExpectingEnumForWarning(options.as) +\n \".\");\n if (encountered)\n console.error(\n \"ReactDOM.preinitModule(): Expected up to two arguments, a non-empty `href` string and, optionally, an `options` object with a valid `as` property.%s\",\n encountered\n );\n else\n switch (\n ((encountered =\n options && \"string\" === typeof options.as ? options.as : \"script\"),\n encountered)\n ) {\n case \"script\":\n break;\n default:\n (encountered =\n getValueDescriptorExpectingEnumForWarning(encountered)),\n console.error(\n 'ReactDOM.preinitModule(): Currently the only supported \"as\" type for this function is \"script\" but received \"%s\" instead. This warning was generated for `href` \"%s\". In the future other module types will be supported, aligning with the import-attributes proposal. Learn more here: (https://github.com/tc39/proposal-import-attributes)',\n encountered,\n href\n );\n }\n if (\"string\" === typeof href)\n if (\"object\" === typeof options && null !== options) {\n if (null == options.as || \"script\" === options.as)\n (encountered = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n )),\n Internals.d.M(href, {\n crossOrigin: encountered,\n integrity:\n \"string\" === typeof options.integrity\n ? options.integrity\n : void 0,\n nonce:\n \"string\" === typeof options.nonce ? options.nonce : void 0\n });\n } else null == options && Internals.d.M(href);\n };\n exports.preload = function (href, options) {\n var encountered = \"\";\n (\"string\" === typeof href && href) ||\n (encountered +=\n \" The `href` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(href) +\n \".\");\n null == options || \"object\" !== typeof options\n ? (encountered +=\n \" The `options` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options) +\n \".\")\n : (\"string\" === typeof options.as && options.as) ||\n (encountered +=\n \" The `as` option encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options.as) +\n \".\");\n encountered &&\n console.error(\n 'ReactDOM.preload(): Expected two arguments, a non-empty `href` string and an `options` object with an `as` property valid for a `` tag.%s',\n encountered\n );\n if (\n \"string\" === typeof href &&\n \"object\" === typeof options &&\n null !== options &&\n \"string\" === typeof options.as\n ) {\n encountered = options.as;\n var crossOrigin = getCrossOriginStringAs(\n encountered,\n options.crossOrigin\n );\n Internals.d.L(href, encountered, {\n crossOrigin: crossOrigin,\n integrity:\n \"string\" === typeof options.integrity ? options.integrity : void 0,\n nonce: \"string\" === typeof options.nonce ? options.nonce : void 0,\n type: \"string\" === typeof options.type ? options.type : void 0,\n fetchPriority:\n \"string\" === typeof options.fetchPriority\n ? options.fetchPriority\n : void 0,\n referrerPolicy:\n \"string\" === typeof options.referrerPolicy\n ? options.referrerPolicy\n : void 0,\n imageSrcSet:\n \"string\" === typeof options.imageSrcSet\n ? options.imageSrcSet\n : void 0,\n imageSizes:\n \"string\" === typeof options.imageSizes\n ? options.imageSizes\n : void 0,\n media: \"string\" === typeof options.media ? options.media : void 0\n });\n }\n };\n exports.preloadModule = function (href, options) {\n var encountered = \"\";\n (\"string\" === typeof href && href) ||\n (encountered +=\n \" The `href` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(href) +\n \".\");\n void 0 !== options && \"object\" !== typeof options\n ? (encountered +=\n \" The `options` argument encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options) +\n \".\")\n : options &&\n \"as\" in options &&\n \"string\" !== typeof options.as &&\n (encountered +=\n \" The `as` option encountered was \" +\n getValueDescriptorExpectingObjectForWarning(options.as) +\n \".\");\n encountered &&\n console.error(\n 'ReactDOM.preloadModule(): Expected two arguments, a non-empty `href` string and, optionally, an `options` object with an `as` property valid for a `` tag.%s',\n encountered\n );\n \"string\" === typeof href &&\n (options\n ? ((encountered = getCrossOriginStringAs(\n options.as,\n options.crossOrigin\n )),\n Internals.d.m(href, {\n as:\n \"string\" === typeof options.as && \"script\" !== options.as\n ? options.as\n : void 0,\n crossOrigin: encountered,\n integrity:\n \"string\" === typeof options.integrity\n ? options.integrity\n : void 0\n }))\n : Internals.d.m(href));\n };\n exports.requestFormReset = function (form) {\n Internals.d.r(form);\n };\n exports.unstable_batchedUpdates = function (fn, a) {\n return fn(a);\n };\n exports.useFormState = function (action, initialState, permalink) {\n return resolveDispatcher().useFormState(action, initialState, permalink);\n };\n exports.useFormStatus = function () {\n return resolveDispatcher().useHostTransitionStatus();\n };\n exports.version = \"19.0.0\";\n \"undefined\" !== typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ &&\n \"function\" ===\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop &&\n __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error());\n })();\n","'use strict';\n\nfunction checkDCE() {\n /* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */\n if (\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined' ||\n typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE !== 'function'\n ) {\n return;\n }\n if (process.env.NODE_ENV !== 'production') {\n // This branch is unreachable because this function is only called\n // in production, but the condition is true only in development.\n // Therefore if the branch is still here, dead code elimination wasn't\n // properly applied.\n // Don't change the message. React DevTools relies on it. Also make sure\n // this message doesn't occur elsewhere in this function, or it will cause\n // a false positive.\n throw new Error('^_^');\n }\n try {\n // Verify that the code above has been dead code eliminated (DCE'd).\n __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(checkDCE);\n } catch (err) {\n // DevTools shouldn't crash React, no matter what.\n // We should still report in case we break this code.\n console.error(err);\n }\n}\n\nif (process.env.NODE_ENV === 'production') {\n // DCE check should happen before ReactDOM bundle executes so that\n // DevTools can report bad minification during injection.\n checkDCE();\n module.exports = require('./cjs/react-dom.production.js');\n} else {\n module.exports = require('./cjs/react-dom.development.js');\n}\n",null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,"function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, _typeof(o);\n}\nexport { _typeof as default };","import _typeof from \"./typeof.js\";\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nexport { toPrimitive as default };","import _typeof from \"./typeof.js\";\nimport toPrimitive from \"./toPrimitive.js\";\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : i + \"\";\n}\nexport { toPropertyKey as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperty(e, r, t) {\n return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {\n value: t,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }) : e[r] = t, e;\n}\nexport { _defineProperty as default };","import defineProperty from \"./defineProperty.js\";\nfunction ownKeys(e, r) {\n var t = Object.keys(e);\n if (Object.getOwnPropertySymbols) {\n var o = Object.getOwnPropertySymbols(e);\n r && (o = o.filter(function (r) {\n return Object.getOwnPropertyDescriptor(e, r).enumerable;\n })), t.push.apply(t, o);\n }\n return t;\n}\nfunction _objectSpread2(e) {\n for (var r = 1; r < arguments.length; r++) {\n var t = null != arguments[r] ? arguments[r] : {};\n r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {\n defineProperty(e, r, t[r]);\n }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {\n Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));\n });\n }\n return e;\n}\nexport { _objectSpread2 as default };","function _classCallCheck(a, n) {\n if (!(a instanceof n)) throw new TypeError(\"Cannot call a class as a function\");\n}\nexport { _classCallCheck as default };","import toPropertyKey from \"./toPropertyKey.js\";\nfunction _defineProperties(e, r) {\n for (var t = 0; t < r.length; t++) {\n var o = r[t];\n o.enumerable = o.enumerable || !1, o.configurable = !0, \"value\" in o && (o.writable = !0), Object.defineProperty(e, toPropertyKey(o.key), o);\n }\n}\nfunction _createClass(e, r, t) {\n return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, \"prototype\", {\n writable: !1\n }), e;\n}\nexport { _createClass as default };","function _setPrototypeOf(t, e) {\n return _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function (t, e) {\n return t.__proto__ = e, t;\n }, _setPrototypeOf(t, e);\n}\nexport { _setPrototypeOf as default };","import setPrototypeOf from \"./setPrototypeOf.js\";\nfunction _inherits(t, e) {\n if (\"function\" != typeof e && null !== e) throw new TypeError(\"Super expression must either be null or a function\");\n t.prototype = Object.create(e && e.prototype, {\n constructor: {\n value: t,\n writable: !0,\n configurable: !0\n }\n }), Object.defineProperty(t, \"prototype\", {\n writable: !1\n }), e && setPrototypeOf(t, e);\n}\nexport { _inherits as default };","function _getPrototypeOf(t) {\n return _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function (t) {\n return t.__proto__ || Object.getPrototypeOf(t);\n }, _getPrototypeOf(t);\n}\nexport { _getPrototypeOf as default };","function _isNativeReflectConstruct() {\n try {\n var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {}));\n } catch (t) {}\n return (_isNativeReflectConstruct = function _isNativeReflectConstruct() {\n return !!t;\n })();\n}\nexport { _isNativeReflectConstruct as default };","function _assertThisInitialized(e) {\n if (void 0 === e) throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n return e;\n}\nexport { _assertThisInitialized as default };","import _typeof from \"./typeof.js\";\nimport assertThisInitialized from \"./assertThisInitialized.js\";\nfunction _possibleConstructorReturn(t, e) {\n if (e && (\"object\" == _typeof(e) || \"function\" == typeof e)) return e;\n if (void 0 !== e) throw new TypeError(\"Derived constructors may only return object or undefined\");\n return assertThisInitialized(t);\n}\nexport { _possibleConstructorReturn as default };","import getPrototypeOf from \"./getPrototypeOf.js\";\nimport isNativeReflectConstruct from \"./isNativeReflectConstruct.js\";\nimport possibleConstructorReturn from \"./possibleConstructorReturn.js\";\nfunction _createSuper(t) {\n var r = isNativeReflectConstruct();\n return function () {\n var e,\n o = getPrototypeOf(t);\n if (r) {\n var s = getPrototypeOf(this).constructor;\n e = Reflect.construct(o, arguments, s);\n } else e = o.apply(this, arguments);\n return possibleConstructorReturn(this, e);\n };\n}\nexport { _createSuper as default };","function _arrayLikeToArray(r, a) {\n (null == a || a > r.length) && (a = r.length);\n for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];\n return n;\n}\nexport { _arrayLikeToArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _arrayWithoutHoles(r) {\n if (Array.isArray(r)) return arrayLikeToArray(r);\n}\nexport { _arrayWithoutHoles as default };","function _iterableToArray(r) {\n if (\"undefined\" != typeof Symbol && null != r[Symbol.iterator] || null != r[\"@@iterator\"]) return Array.from(r);\n}\nexport { _iterableToArray as default };","import arrayLikeToArray from \"./arrayLikeToArray.js\";\nfunction _unsupportedIterableToArray(r, a) {\n if (r) {\n if (\"string\" == typeof r) return arrayLikeToArray(r, a);\n var t = {}.toString.call(r).slice(8, -1);\n return \"Object\" === t && r.constructor && (t = r.constructor.name), \"Map\" === t || \"Set\" === t ? Array.from(r) : \"Arguments\" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? arrayLikeToArray(r, a) : void 0;\n }\n}\nexport { _unsupportedIterableToArray as default };","function _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableSpread as default };","import arrayWithoutHoles from \"./arrayWithoutHoles.js\";\nimport iterableToArray from \"./iterableToArray.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableSpread from \"./nonIterableSpread.js\";\nfunction _toConsumableArray(r) {\n return arrayWithoutHoles(r) || iterableToArray(r) || unsupportedIterableToArray(r) || nonIterableSpread();\n}\nexport { _toConsumableArray as default };","var isDevelopment = false;\n\n/*\n\nBased off glamor's StyleSheet, thanks Sunil ❤️\n\nhigh performance StyleSheet for css-in-js systems\n\n- uses multiple style tags behind the scenes for millions of rules\n- uses `insertRule` for appending in production for *much* faster performance\n\n// usage\n\nimport { StyleSheet } from '@emotion/sheet'\n\nlet styleSheet = new StyleSheet({ key: '', container: document.head })\n\nstyleSheet.insert('#box { border: 1px solid red; }')\n- appends a css rule into the stylesheet\n\nstyleSheet.flush()\n- empties the stylesheet of all its contents\n\n*/\n\nfunction sheetForTag(tag) {\n if (tag.sheet) {\n return tag.sheet;\n } // this weirdness brought to you by firefox\n\n /* istanbul ignore next */\n\n\n for (var i = 0; i < document.styleSheets.length; i++) {\n if (document.styleSheets[i].ownerNode === tag) {\n return document.styleSheets[i];\n }\n } // this function should always return with a value\n // TS can't understand it though so we make it stop complaining here\n\n\n return undefined;\n}\n\nfunction createStyleElement(options) {\n var tag = document.createElement('style');\n tag.setAttribute('data-emotion', options.key);\n\n if (options.nonce !== undefined) {\n tag.setAttribute('nonce', options.nonce);\n }\n\n tag.appendChild(document.createTextNode(''));\n tag.setAttribute('data-s', '');\n return tag;\n}\n\nvar StyleSheet = /*#__PURE__*/function () {\n // Using Node instead of HTMLElement since container may be a ShadowRoot\n function StyleSheet(options) {\n var _this = this;\n\n this._insertTag = function (tag) {\n var before;\n\n if (_this.tags.length === 0) {\n if (_this.insertionPoint) {\n before = _this.insertionPoint.nextSibling;\n } else if (_this.prepend) {\n before = _this.container.firstChild;\n } else {\n before = _this.before;\n }\n } else {\n before = _this.tags[_this.tags.length - 1].nextSibling;\n }\n\n _this.container.insertBefore(tag, before);\n\n _this.tags.push(tag);\n };\n\n this.isSpeedy = options.speedy === undefined ? !isDevelopment : options.speedy;\n this.tags = [];\n this.ctr = 0;\n this.nonce = options.nonce; // key is the value of the data-emotion attribute, it's used to identify different sheets\n\n this.key = options.key;\n this.container = options.container;\n this.prepend = options.prepend;\n this.insertionPoint = options.insertionPoint;\n this.before = null;\n }\n\n var _proto = StyleSheet.prototype;\n\n _proto.hydrate = function hydrate(nodes) {\n nodes.forEach(this._insertTag);\n };\n\n _proto.insert = function insert(rule) {\n // the max length is how many rules we have per style tag, it's 65000 in speedy mode\n // it's 1 in dev because we insert source maps that map a single rule to a location\n // and you can only have one source map per style tag\n if (this.ctr % (this.isSpeedy ? 65000 : 1) === 0) {\n this._insertTag(createStyleElement(this));\n }\n\n var tag = this.tags[this.tags.length - 1];\n\n if (this.isSpeedy) {\n var sheet = sheetForTag(tag);\n\n try {\n // this is the ultrafast version, works across browsers\n // the big drawback is that the css won't be editable in devtools\n sheet.insertRule(rule, sheet.cssRules.length);\n } catch (e) {\n }\n } else {\n tag.appendChild(document.createTextNode(rule));\n }\n\n this.ctr++;\n };\n\n _proto.flush = function flush() {\n this.tags.forEach(function (tag) {\n var _tag$parentNode;\n\n return (_tag$parentNode = tag.parentNode) == null ? void 0 : _tag$parentNode.removeChild(tag);\n });\n this.tags = [];\n this.ctr = 0;\n };\n\n return StyleSheet;\n}();\n\nexport { StyleSheet };\n","export var MS = '-ms-'\nexport var MOZ = '-moz-'\nexport var WEBKIT = '-webkit-'\n\nexport var COMMENT = 'comm'\nexport var RULESET = 'rule'\nexport var DECLARATION = 'decl'\n\nexport var PAGE = '@page'\nexport var MEDIA = '@media'\nexport var IMPORT = '@import'\nexport var CHARSET = '@charset'\nexport var VIEWPORT = '@viewport'\nexport var SUPPORTS = '@supports'\nexport var DOCUMENT = '@document'\nexport var NAMESPACE = '@namespace'\nexport var KEYFRAMES = '@keyframes'\nexport var FONT_FACE = '@font-face'\nexport var COUNTER_STYLE = '@counter-style'\nexport var FONT_FEATURE_VALUES = '@font-feature-values'\nexport var LAYER = '@layer'\n","/**\n * @param {number}\n * @return {number}\n */\nexport var abs = Math.abs\n\n/**\n * @param {number}\n * @return {string}\n */\nexport var from = String.fromCharCode\n\n/**\n * @param {object}\n * @return {object}\n */\nexport var assign = Object.assign\n\n/**\n * @param {string} value\n * @param {number} length\n * @return {number}\n */\nexport function hash (value, length) {\n\treturn charat(value, 0) ^ 45 ? (((((((length << 2) ^ charat(value, 0)) << 2) ^ charat(value, 1)) << 2) ^ charat(value, 2)) << 2) ^ charat(value, 3) : 0\n}\n\n/**\n * @param {string} value\n * @return {string}\n */\nexport function trim (value) {\n\treturn value.trim()\n}\n\n/**\n * @param {string} value\n * @param {RegExp} pattern\n * @return {string?}\n */\nexport function match (value, pattern) {\n\treturn (value = pattern.exec(value)) ? value[0] : value\n}\n\n/**\n * @param {string} value\n * @param {(string|RegExp)} pattern\n * @param {string} replacement\n * @return {string}\n */\nexport function replace (value, pattern, replacement) {\n\treturn value.replace(pattern, replacement)\n}\n\n/**\n * @param {string} value\n * @param {string} search\n * @return {number}\n */\nexport function indexof (value, search) {\n\treturn value.indexOf(search)\n}\n\n/**\n * @param {string} value\n * @param {number} index\n * @return {number}\n */\nexport function charat (value, index) {\n\treturn value.charCodeAt(index) | 0\n}\n\n/**\n * @param {string} value\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function substr (value, begin, end) {\n\treturn value.slice(begin, end)\n}\n\n/**\n * @param {string} value\n * @return {number}\n */\nexport function strlen (value) {\n\treturn value.length\n}\n\n/**\n * @param {any[]} value\n * @return {number}\n */\nexport function sizeof (value) {\n\treturn value.length\n}\n\n/**\n * @param {any} value\n * @param {any[]} array\n * @return {any}\n */\nexport function append (value, array) {\n\treturn array.push(value), value\n}\n\n/**\n * @param {string[]} array\n * @param {function} callback\n * @return {string}\n */\nexport function combine (array, callback) {\n\treturn array.map(callback).join('')\n}\n","import {from, trim, charat, strlen, substr, append, assign} from './Utility.js'\n\nexport var line = 1\nexport var column = 1\nexport var length = 0\nexport var position = 0\nexport var character = 0\nexport var characters = ''\n\n/**\n * @param {string} value\n * @param {object | null} root\n * @param {object | null} parent\n * @param {string} type\n * @param {string[] | string} props\n * @param {object[] | string} children\n * @param {number} length\n */\nexport function node (value, root, parent, type, props, children, length) {\n\treturn {value: value, root: root, parent: parent, type: type, props: props, children: children, line: line, column: column, length: length, return: ''}\n}\n\n/**\n * @param {object} root\n * @param {object} props\n * @return {object}\n */\nexport function copy (root, props) {\n\treturn assign(node('', null, null, '', null, null, 0), root, {length: -root.length}, props)\n}\n\n/**\n * @return {number}\n */\nexport function char () {\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function prev () {\n\tcharacter = position > 0 ? charat(characters, --position) : 0\n\n\tif (column--, character === 10)\n\t\tcolumn = 1, line--\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function next () {\n\tcharacter = position < length ? charat(characters, position++) : 0\n\n\tif (column++, character === 10)\n\t\tcolumn = 1, line++\n\n\treturn character\n}\n\n/**\n * @return {number}\n */\nexport function peek () {\n\treturn charat(characters, position)\n}\n\n/**\n * @return {number}\n */\nexport function caret () {\n\treturn position\n}\n\n/**\n * @param {number} begin\n * @param {number} end\n * @return {string}\n */\nexport function slice (begin, end) {\n\treturn substr(characters, begin, end)\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function token (type) {\n\tswitch (type) {\n\t\t// \\0 \\t \\n \\r \\s whitespace token\n\t\tcase 0: case 9: case 10: case 13: case 32:\n\t\t\treturn 5\n\t\t// ! + , / > @ ~ isolate token\n\t\tcase 33: case 43: case 44: case 47: case 62: case 64: case 126:\n\t\t// ; { } breakpoint token\n\t\tcase 59: case 123: case 125:\n\t\t\treturn 4\n\t\t// : accompanied token\n\t\tcase 58:\n\t\t\treturn 3\n\t\t// \" ' ( [ opening delimit token\n\t\tcase 34: case 39: case 40: case 91:\n\t\t\treturn 2\n\t\t// ) ] closing delimit token\n\t\tcase 41: case 93:\n\t\t\treturn 1\n\t}\n\n\treturn 0\n}\n\n/**\n * @param {string} value\n * @return {any[]}\n */\nexport function alloc (value) {\n\treturn line = column = 1, length = strlen(characters = value), position = 0, []\n}\n\n/**\n * @param {any} value\n * @return {any}\n */\nexport function dealloc (value) {\n\treturn characters = '', value\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function delimit (type) {\n\treturn trim(slice(position - 1, delimiter(type === 91 ? type + 2 : type === 40 ? type + 1 : type)))\n}\n\n/**\n * @param {string} value\n * @return {string[]}\n */\nexport function tokenize (value) {\n\treturn dealloc(tokenizer(alloc(value)))\n}\n\n/**\n * @param {number} type\n * @return {string}\n */\nexport function whitespace (type) {\n\twhile (character = peek())\n\t\tif (character < 33)\n\t\t\tnext()\n\t\telse\n\t\t\tbreak\n\n\treturn token(type) > 2 || token(character) > 3 ? '' : ' '\n}\n\n/**\n * @param {string[]} children\n * @return {string[]}\n */\nexport function tokenizer (children) {\n\twhile (next())\n\t\tswitch (token(character)) {\n\t\t\tcase 0: append(identifier(position - 1), children)\n\t\t\t\tbreak\n\t\t\tcase 2: append(delimit(character), children)\n\t\t\t\tbreak\n\t\t\tdefault: append(from(character), children)\n\t\t}\n\n\treturn children\n}\n\n/**\n * @param {number} index\n * @param {number} count\n * @return {string}\n */\nexport function escaping (index, count) {\n\twhile (--count && next())\n\t\t// not 0-9 A-F a-f\n\t\tif (character < 48 || character > 102 || (character > 57 && character < 65) || (character > 70 && character < 97))\n\t\t\tbreak\n\n\treturn slice(index, caret() + (count < 6 && peek() == 32 && next() == 32))\n}\n\n/**\n * @param {number} type\n * @return {number}\n */\nexport function delimiter (type) {\n\twhile (next())\n\t\tswitch (character) {\n\t\t\t// ] ) \" '\n\t\t\tcase type:\n\t\t\t\treturn position\n\t\t\t// \" '\n\t\t\tcase 34: case 39:\n\t\t\t\tif (type !== 34 && type !== 39)\n\t\t\t\t\tdelimiter(character)\n\t\t\t\tbreak\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (type === 41)\n\t\t\t\t\tdelimiter(type)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tnext()\n\t\t\t\tbreak\n\t\t}\n\n\treturn position\n}\n\n/**\n * @param {number} type\n * @param {number} index\n * @return {number}\n */\nexport function commenter (type, index) {\n\twhile (next())\n\t\t// //\n\t\tif (type + character === 47 + 10)\n\t\t\tbreak\n\t\t// /*\n\t\telse if (type + character === 42 + 42 && peek() === 47)\n\t\t\tbreak\n\n\treturn '/*' + slice(index, position - 1) + '*' + from(type === 47 ? type : next())\n}\n\n/**\n * @param {number} index\n * @return {string}\n */\nexport function identifier (index) {\n\twhile (!token(peek()))\n\t\tnext()\n\n\treturn slice(index, position)\n}\n","import {COMMENT, RULESET, DECLARATION} from './Enum.js'\nimport {abs, charat, trim, from, sizeof, strlen, substr, append, replace, indexof} from './Utility.js'\nimport {node, char, prev, next, peek, caret, alloc, dealloc, delimit, whitespace, escaping, identifier, commenter} from './Tokenizer.js'\n\n/**\n * @param {string} value\n * @return {object[]}\n */\nexport function compile (value) {\n\treturn dealloc(parse('', null, null, null, [''], value = alloc(value), 0, [0], value))\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {string[]} rule\n * @param {string[]} rules\n * @param {string[]} rulesets\n * @param {number[]} pseudo\n * @param {number[]} points\n * @param {string[]} declarations\n * @return {object}\n */\nexport function parse (value, root, parent, rule, rules, rulesets, pseudo, points, declarations) {\n\tvar index = 0\n\tvar offset = 0\n\tvar length = pseudo\n\tvar atrule = 0\n\tvar property = 0\n\tvar previous = 0\n\tvar variable = 1\n\tvar scanning = 1\n\tvar ampersand = 1\n\tvar character = 0\n\tvar type = ''\n\tvar props = rules\n\tvar children = rulesets\n\tvar reference = rule\n\tvar characters = type\n\n\twhile (scanning)\n\t\tswitch (previous = character, character = next()) {\n\t\t\t// (\n\t\t\tcase 40:\n\t\t\t\tif (previous != 108 && charat(characters, length - 1) == 58) {\n\t\t\t\t\tif (indexof(characters += replace(delimit(character), '&', '&\\f'), '&\\f') != -1)\n\t\t\t\t\t\tampersand = -1\n\t\t\t\t\tbreak\n\t\t\t\t}\n\t\t\t// \" ' [\n\t\t\tcase 34: case 39: case 91:\n\t\t\t\tcharacters += delimit(character)\n\t\t\t\tbreak\n\t\t\t// \\t \\n \\r \\s\n\t\t\tcase 9: case 10: case 13: case 32:\n\t\t\t\tcharacters += whitespace(previous)\n\t\t\t\tbreak\n\t\t\t// \\\n\t\t\tcase 92:\n\t\t\t\tcharacters += escaping(caret() - 1, 7)\n\t\t\t\tcontinue\n\t\t\t// /\n\t\t\tcase 47:\n\t\t\t\tswitch (peek()) {\n\t\t\t\t\tcase 42: case 47:\n\t\t\t\t\t\tappend(comment(commenter(next(), caret()), root, parent), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tcharacters += '/'\n\t\t\t\t}\n\t\t\t\tbreak\n\t\t\t// {\n\t\t\tcase 123 * variable:\n\t\t\t\tpoints[index++] = strlen(characters) * ampersand\n\t\t\t// } ; \\0\n\t\t\tcase 125 * variable: case 59: case 0:\n\t\t\t\tswitch (character) {\n\t\t\t\t\t// \\0 }\n\t\t\t\t\tcase 0: case 125: scanning = 0\n\t\t\t\t\t// ;\n\t\t\t\t\tcase 59 + offset: if (ampersand == -1) characters = replace(characters, /\\f/g, '')\n\t\t\t\t\t\tif (property > 0 && (strlen(characters) - length))\n\t\t\t\t\t\t\tappend(property > 32 ? declaration(characters + ';', rule, parent, length - 1) : declaration(replace(characters, ' ', '') + ';', rule, parent, length - 2), declarations)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @ ;\n\t\t\t\t\tcase 59: characters += ';'\n\t\t\t\t\t// { rule/at-rule\n\t\t\t\t\tdefault:\n\t\t\t\t\t\tappend(reference = ruleset(characters, root, parent, index, offset, rules, points, type, props = [], children = [], length), rulesets)\n\n\t\t\t\t\t\tif (character === 123)\n\t\t\t\t\t\t\tif (offset === 0)\n\t\t\t\t\t\t\t\tparse(characters, root, reference, reference, props, rulesets, length, points, children)\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tswitch (atrule === 99 && charat(characters, 3) === 110 ? 100 : atrule) {\n\t\t\t\t\t\t\t\t\t// d l m s\n\t\t\t\t\t\t\t\t\tcase 100: case 108: case 109: case 115:\n\t\t\t\t\t\t\t\t\t\tparse(value, reference, reference, rule && append(ruleset(value, reference, reference, 0, 0, rules, points, type, rules, props = [], length), children), rules, children, length, points, rule ? props : children)\n\t\t\t\t\t\t\t\t\t\tbreak\n\t\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\t\tparse(characters, reference, reference, reference, [''], children, 0, points, children)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tindex = offset = property = 0, variable = ampersand = 1, type = characters = '', length = pseudo\n\t\t\t\tbreak\n\t\t\t// :\n\t\t\tcase 58:\n\t\t\t\tlength = 1 + strlen(characters), property = previous\n\t\t\tdefault:\n\t\t\t\tif (variable < 1)\n\t\t\t\t\tif (character == 123)\n\t\t\t\t\t\t--variable\n\t\t\t\t\telse if (character == 125 && variable++ == 0 && prev() == 125)\n\t\t\t\t\t\tcontinue\n\n\t\t\t\tswitch (characters += from(character), character * variable) {\n\t\t\t\t\t// &\n\t\t\t\t\tcase 38:\n\t\t\t\t\t\tampersand = offset > 0 ? 1 : (characters += '\\f', -1)\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// ,\n\t\t\t\t\tcase 44:\n\t\t\t\t\t\tpoints[index++] = (strlen(characters) - 1) * ampersand, ampersand = 1\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// @\n\t\t\t\t\tcase 64:\n\t\t\t\t\t\t// -\n\t\t\t\t\t\tif (peek() === 45)\n\t\t\t\t\t\t\tcharacters += delimit(next())\n\n\t\t\t\t\t\tatrule = peek(), offset = length = strlen(type = characters += identifier(caret())), character++\n\t\t\t\t\t\tbreak\n\t\t\t\t\t// -\n\t\t\t\t\tcase 45:\n\t\t\t\t\t\tif (previous === 45 && strlen(characters) == 2)\n\t\t\t\t\t\t\tvariable = 0\n\t\t\t\t}\n\t\t}\n\n\treturn rulesets\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} index\n * @param {number} offset\n * @param {string[]} rules\n * @param {number[]} points\n * @param {string} type\n * @param {string[]} props\n * @param {string[]} children\n * @param {number} length\n * @return {object}\n */\nexport function ruleset (value, root, parent, index, offset, rules, points, type, props, children, length) {\n\tvar post = offset - 1\n\tvar rule = offset === 0 ? rules : ['']\n\tvar size = sizeof(rule)\n\n\tfor (var i = 0, j = 0, k = 0; i < index; ++i)\n\t\tfor (var x = 0, y = substr(value, post + 1, post = abs(j = points[i])), z = value; x < size; ++x)\n\t\t\tif (z = trim(j > 0 ? rule[x] + ' ' + y : replace(y, /&\\f/g, rule[x])))\n\t\t\t\tprops[k++] = z\n\n\treturn node(value, root, parent, offset === 0 ? RULESET : type, props, children, length)\n}\n\n/**\n * @param {number} value\n * @param {object} root\n * @param {object?} parent\n * @return {object}\n */\nexport function comment (value, root, parent) {\n\treturn node(value, root, parent, COMMENT, from(char()), substr(value, 2, -2), 0)\n}\n\n/**\n * @param {string} value\n * @param {object} root\n * @param {object?} parent\n * @param {number} length\n * @return {object}\n */\nexport function declaration (value, root, parent, length) {\n\treturn node(value, root, parent, DECLARATION, substr(value, 0, length), substr(value, length + 1, -1), length)\n}\n","import {IMPORT, LAYER, COMMENT, RULESET, DECLARATION, KEYFRAMES} from './Enum.js'\nimport {strlen, sizeof} from './Utility.js'\n\n/**\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function serialize (children, callback) {\n\tvar output = ''\n\tvar length = sizeof(children)\n\n\tfor (var i = 0; i < length; i++)\n\t\toutput += callback(children[i], i, children, callback) || ''\n\n\treturn output\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n * @return {string}\n */\nexport function stringify (element, index, children, callback) {\n\tswitch (element.type) {\n\t\tcase LAYER: if (element.children.length) break\n\t\tcase IMPORT: case DECLARATION: return element.return = element.return || element.value\n\t\tcase COMMENT: return ''\n\t\tcase KEYFRAMES: return element.return = element.value + '{' + serialize(element.children, callback) + '}'\n\t\tcase RULESET: element.value = element.props.join(',')\n\t}\n\n\treturn strlen(children = serialize(element.children, callback)) ? element.return = element.value + '{' + children + '}' : ''\n}\n","import {MS, MOZ, WEBKIT, RULESET, KEYFRAMES, DECLARATION} from './Enum.js'\nimport {match, charat, substr, strlen, sizeof, replace, combine} from './Utility.js'\nimport {copy, tokenize} from './Tokenizer.js'\nimport {serialize} from './Serializer.js'\nimport {prefix} from './Prefixer.js'\n\n/**\n * @param {function[]} collection\n * @return {function}\n */\nexport function middleware (collection) {\n\tvar length = sizeof(collection)\n\n\treturn function (element, index, children, callback) {\n\t\tvar output = ''\n\n\t\tfor (var i = 0; i < length; i++)\n\t\t\toutput += collection[i](element, index, children, callback) || ''\n\n\t\treturn output\n\t}\n}\n\n/**\n * @param {function} callback\n * @return {function}\n */\nexport function rulesheet (callback) {\n\treturn function (element) {\n\t\tif (!element.root)\n\t\t\tif (element = element.return)\n\t\t\t\tcallback(element)\n\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n * @param {function} callback\n */\nexport function prefixer (element, index, children, callback) {\n\tif (element.length > -1)\n\t\tif (!element.return)\n\t\t\tswitch (element.type) {\n\t\t\t\tcase DECLARATION: element.return = prefix(element.value, element.length, children)\n\t\t\t\t\treturn\n\t\t\t\tcase KEYFRAMES:\n\t\t\t\t\treturn serialize([copy(element, {value: replace(element.value, '@', '@' + WEBKIT)})], callback)\n\t\t\t\tcase RULESET:\n\t\t\t\t\tif (element.length)\n\t\t\t\t\t\treturn combine(element.props, function (value) {\n\t\t\t\t\t\t\tswitch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n\t\t\t\t\t\t\t\t// :read-(only|write)\n\t\t\t\t\t\t\t\tcase ':read-only': case ':read-write':\n\t\t\t\t\t\t\t\t\treturn serialize([copy(element, {props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]})], callback)\n\t\t\t\t\t\t\t\t// :placeholder\n\t\t\t\t\t\t\t\tcase '::placeholder':\n\t\t\t\t\t\t\t\t\treturn serialize([\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]}),\n\t\t\t\t\t\t\t\t\t\tcopy(element, {props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]})\n\t\t\t\t\t\t\t\t\t], callback)\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\treturn ''\n\t\t\t\t\t\t})\n\t\t\t}\n}\n\n/**\n * @param {object} element\n * @param {number} index\n * @param {object[]} children\n */\nexport function namespace (element) {\n\tswitch (element.type) {\n\t\tcase RULESET:\n\t\t\telement.props = element.props.map(function (value) {\n\t\t\t\treturn combine(tokenize(value), function (value, index, children) {\n\t\t\t\t\tswitch (charat(value, 0)) {\n\t\t\t\t\t\t// \\f\n\t\t\t\t\t\tcase 12:\n\t\t\t\t\t\t\treturn substr(value, 1, strlen(value))\n\t\t\t\t\t\t// \\0 ( + > ~\n\t\t\t\t\t\tcase 0: case 40: case 43: case 62: case 126:\n\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t// :\n\t\t\t\t\t\tcase 58:\n\t\t\t\t\t\t\tif (children[++index] === 'global')\n\t\t\t\t\t\t\t\tchildren[index] = '', children[++index] = '\\f' + substr(children[index], index = 1, -1)\n\t\t\t\t\t\t// \\s\n\t\t\t\t\t\tcase 32:\n\t\t\t\t\t\t\treturn index === 1 ? '' : value\n\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\tswitch (index) {\n\t\t\t\t\t\t\t\tcase 0: element = value\n\t\t\t\t\t\t\t\t\treturn sizeof(children) > 1 ? '' : value\n\t\t\t\t\t\t\t\tcase index = sizeof(children) - 1: case 2:\n\t\t\t\t\t\t\t\t\treturn index === 2 ? value + element + element : value + element\n\t\t\t\t\t\t\t\tdefault:\n\t\t\t\t\t\t\t\t\treturn value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t}\n}\n","var weakMemoize = function weakMemoize(func) {\n var cache = new WeakMap();\n return function (arg) {\n if (cache.has(arg)) {\n // Use non-null assertion because we just checked that the cache `has` it\n // This allows us to remove `undefined` from the return value\n return cache.get(arg);\n }\n\n var ret = func(arg);\n cache.set(arg, ret);\n return ret;\n };\n};\n\nexport { weakMemoize as default };\n","function memoize(fn) {\n var cache = Object.create(null);\n return function (arg) {\n if (cache[arg] === undefined) cache[arg] = fn(arg);\n return cache[arg];\n };\n}\n\nexport { memoize as default };\n","import { StyleSheet } from '@emotion/sheet';\nimport { dealloc, alloc, next, token, from, peek, delimit, slice, position, RULESET, combine, match, serialize, copy, replace, WEBKIT, MOZ, MS, KEYFRAMES, DECLARATION, hash, charat, strlen, indexof, stringify, rulesheet, middleware, compile } from 'stylis';\nimport weakMemoize from '@emotion/weak-memoize';\nimport memoize from '@emotion/memoize';\n\nvar isBrowser = typeof document !== 'undefined';\n\nvar identifierWithPointTracking = function identifierWithPointTracking(begin, points, index) {\n var previous = 0;\n var character = 0;\n\n while (true) {\n previous = character;\n character = peek(); // &\\f\n\n if (previous === 38 && character === 12) {\n points[index] = 1;\n }\n\n if (token(character)) {\n break;\n }\n\n next();\n }\n\n return slice(begin, position);\n};\n\nvar toRules = function toRules(parsed, points) {\n // pretend we've started with a comma\n var index = -1;\n var character = 44;\n\n do {\n switch (token(character)) {\n case 0:\n // &\\f\n if (character === 38 && peek() === 12) {\n // this is not 100% correct, we don't account for literal sequences here - like for example quoted strings\n // stylis inserts \\f after & to know when & where it should replace this sequence with the context selector\n // and when it should just concatenate the outer and inner selectors\n // it's very unlikely for this sequence to actually appear in a different context, so we just leverage this fact here\n points[index] = 1;\n }\n\n parsed[index] += identifierWithPointTracking(position - 1, points, index);\n break;\n\n case 2:\n parsed[index] += delimit(character);\n break;\n\n case 4:\n // comma\n if (character === 44) {\n // colon\n parsed[++index] = peek() === 58 ? '&\\f' : '';\n points[index] = parsed[index].length;\n break;\n }\n\n // fallthrough\n\n default:\n parsed[index] += from(character);\n }\n } while (character = next());\n\n return parsed;\n};\n\nvar getRules = function getRules(value, points) {\n return dealloc(toRules(alloc(value), points));\n}; // WeakSet would be more appropriate, but only WeakMap is supported in IE11\n\n\nvar fixedElements = /* #__PURE__ */new WeakMap();\nvar compat = function compat(element) {\n if (element.type !== 'rule' || !element.parent || // positive .length indicates that this rule contains pseudo\n // negative .length indicates that this rule has been already prefixed\n element.length < 1) {\n return;\n }\n\n var value = element.value;\n var parent = element.parent;\n var isImplicitRule = element.column === parent.column && element.line === parent.line;\n\n while (parent.type !== 'rule') {\n parent = parent.parent;\n if (!parent) return;\n } // short-circuit for the simplest case\n\n\n if (element.props.length === 1 && value.charCodeAt(0) !== 58\n /* colon */\n && !fixedElements.get(parent)) {\n return;\n } // if this is an implicitly inserted rule (the one eagerly inserted at the each new nested level)\n // then the props has already been manipulated beforehand as they that array is shared between it and its \"rule parent\"\n\n\n if (isImplicitRule) {\n return;\n }\n\n fixedElements.set(element, true);\n var points = [];\n var rules = getRules(value, points);\n var parentRules = parent.props;\n\n for (var i = 0, k = 0; i < rules.length; i++) {\n for (var j = 0; j < parentRules.length; j++, k++) {\n element.props[k] = points[i] ? rules[i].replace(/&\\f/g, parentRules[j]) : parentRules[j] + \" \" + rules[i];\n }\n }\n};\nvar removeLabel = function removeLabel(element) {\n if (element.type === 'decl') {\n var value = element.value;\n\n if ( // charcode for l\n value.charCodeAt(0) === 108 && // charcode for b\n value.charCodeAt(2) === 98) {\n // this ignores label\n element[\"return\"] = '';\n element.value = '';\n }\n }\n};\n\n/* eslint-disable no-fallthrough */\n\nfunction prefix(value, length) {\n switch (hash(value, length)) {\n // color-adjust\n case 5103:\n return WEBKIT + 'print-' + value + value;\n // animation, animation-(delay|direction|duration|fill-mode|iteration-count|name|play-state|timing-function)\n\n case 5737:\n case 4201:\n case 3177:\n case 3433:\n case 1641:\n case 4457:\n case 2921: // text-decoration, filter, clip-path, backface-visibility, column, box-decoration-break\n\n case 5572:\n case 6356:\n case 5844:\n case 3191:\n case 6645:\n case 3005: // mask, mask-image, mask-(mode|clip|size), mask-(repeat|origin), mask-position, mask-composite,\n\n case 6391:\n case 5879:\n case 5623:\n case 6135:\n case 4599:\n case 4855: // background-clip, columns, column-(count|fill|gap|rule|rule-color|rule-style|rule-width|span|width)\n\n case 4215:\n case 6389:\n case 5109:\n case 5365:\n case 5621:\n case 3829:\n return WEBKIT + value + value;\n // appearance, user-select, transform, hyphens, text-size-adjust\n\n case 5349:\n case 4246:\n case 4810:\n case 6968:\n case 2756:\n return WEBKIT + value + MOZ + value + MS + value + value;\n // flex, flex-direction\n\n case 6828:\n case 4268:\n return WEBKIT + value + MS + value + value;\n // order\n\n case 6165:\n return WEBKIT + value + MS + 'flex-' + value + value;\n // align-items\n\n case 5187:\n return WEBKIT + value + replace(value, /(\\w+).+(:[^]+)/, WEBKIT + 'box-$1$2' + MS + 'flex-$1$2') + value;\n // align-self\n\n case 5443:\n return WEBKIT + value + MS + 'flex-item-' + replace(value, /flex-|-self/, '') + value;\n // align-content\n\n case 4675:\n return WEBKIT + value + MS + 'flex-line-pack' + replace(value, /align-content|flex-|-self/, '') + value;\n // flex-shrink\n\n case 5548:\n return WEBKIT + value + MS + replace(value, 'shrink', 'negative') + value;\n // flex-basis\n\n case 5292:\n return WEBKIT + value + MS + replace(value, 'basis', 'preferred-size') + value;\n // flex-grow\n\n case 6060:\n return WEBKIT + 'box-' + replace(value, '-grow', '') + WEBKIT + value + MS + replace(value, 'grow', 'positive') + value;\n // transition\n\n case 4554:\n return WEBKIT + replace(value, /([^-])(transform)/g, '$1' + WEBKIT + '$2') + value;\n // cursor\n\n case 6187:\n return replace(replace(replace(value, /(zoom-|grab)/, WEBKIT + '$1'), /(image-set)/, WEBKIT + '$1'), value, '') + value;\n // background, background-image\n\n case 5495:\n case 3959:\n return replace(value, /(image-set\\([^]*)/, WEBKIT + '$1' + '$`$1');\n // justify-content\n\n case 4968:\n return replace(replace(value, /(.+:)(flex-)?(.*)/, WEBKIT + 'box-pack:$3' + MS + 'flex-pack:$3'), /s.+-b[^;]+/, 'justify') + WEBKIT + value + value;\n // (margin|padding)-inline-(start|end)\n\n case 4095:\n case 3583:\n case 4068:\n case 2532:\n return replace(value, /(.+)-inline(.+)/, WEBKIT + '$1$2') + value;\n // (min|max)?(width|height|inline-size|block-size)\n\n case 8116:\n case 7059:\n case 5753:\n case 5535:\n case 5445:\n case 5701:\n case 4933:\n case 4677:\n case 5533:\n case 5789:\n case 5021:\n case 4765:\n // stretch, max-content, min-content, fill-available\n if (strlen(value) - 1 - length > 6) switch (charat(value, length + 1)) {\n // (m)ax-content, (m)in-content\n case 109:\n // -\n if (charat(value, length + 4) !== 45) break;\n // (f)ill-available, (f)it-content\n\n case 102:\n return replace(value, /(.+:)(.+)-([^]+)/, '$1' + WEBKIT + '$2-$3' + '$1' + MOZ + (charat(value, length + 3) == 108 ? '$3' : '$2-$3')) + value;\n // (s)tretch\n\n case 115:\n return ~indexof(value, 'stretch') ? prefix(replace(value, 'stretch', 'fill-available'), length) + value : value;\n }\n break;\n // position: sticky\n\n case 4949:\n // (s)ticky?\n if (charat(value, length + 1) !== 115) break;\n // display: (flex|inline-flex)\n\n case 6444:\n switch (charat(value, strlen(value) - 3 - (~indexof(value, '!important') && 10))) {\n // stic(k)y\n case 107:\n return replace(value, ':', ':' + WEBKIT) + value;\n // (inline-)?fl(e)x\n\n case 101:\n return replace(value, /(.+:)([^;!]+)(;|!.+)?/, '$1' + WEBKIT + (charat(value, 14) === 45 ? 'inline-' : '') + 'box$3' + '$1' + WEBKIT + '$2$3' + '$1' + MS + '$2box$3') + value;\n }\n\n break;\n // writing-mode\n\n case 5936:\n switch (charat(value, length + 11)) {\n // vertical-l(r)\n case 114:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb') + value;\n // vertical-r(l)\n\n case 108:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'tb-rl') + value;\n // horizontal(-)tb\n\n case 45:\n return WEBKIT + value + MS + replace(value, /[svh]\\w+-[tblr]{2}/, 'lr') + value;\n }\n\n return WEBKIT + value + MS + value + value;\n }\n\n return value;\n}\n\nvar prefixer = function prefixer(element, index, children, callback) {\n if (element.length > -1) if (!element[\"return\"]) switch (element.type) {\n case DECLARATION:\n element[\"return\"] = prefix(element.value, element.length);\n break;\n\n case KEYFRAMES:\n return serialize([copy(element, {\n value: replace(element.value, '@', '@' + WEBKIT)\n })], callback);\n\n case RULESET:\n if (element.length) return combine(element.props, function (value) {\n switch (match(value, /(::plac\\w+|:read-\\w+)/)) {\n // :read-(only|write)\n case ':read-only':\n case ':read-write':\n return serialize([copy(element, {\n props: [replace(value, /:(read-\\w+)/, ':' + MOZ + '$1')]\n })], callback);\n // :placeholder\n\n case '::placeholder':\n return serialize([copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + WEBKIT + 'input-$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, ':' + MOZ + '$1')]\n }), copy(element, {\n props: [replace(value, /:(plac\\w+)/, MS + 'input-$1')]\n })], callback);\n }\n\n return '';\n });\n }\n};\n\nvar getServerStylisCache = isBrowser ? undefined : weakMemoize(function () {\n return memoize(function () {\n return {};\n });\n});\nvar defaultStylisPlugins = [prefixer];\n\nvar createCache = function createCache(options) {\n var key = options.key;\n\n if (isBrowser && key === 'css') {\n var ssrStyles = document.querySelectorAll(\"style[data-emotion]:not([data-s])\"); // get SSRed styles out of the way of React's hydration\n // document.head is a safe place to move them to(though note document.head is not necessarily the last place they will be)\n // note this very very intentionally targets all style elements regardless of the key to ensure\n // that creating a cache works inside of render of a React component\n\n Array.prototype.forEach.call(ssrStyles, function (node) {\n // we want to only move elements which have a space in the data-emotion attribute value\n // because that indicates that it is an Emotion 11 server-side rendered style elements\n // while we will already ignore Emotion 11 client-side inserted styles because of the :not([data-s]) part in the selector\n // Emotion 10 client-side inserted styles did not have data-s (but importantly did not have a space in their data-emotion attributes)\n // so checking for the space ensures that loading Emotion 11 after Emotion 10 has inserted some styles\n // will not result in the Emotion 10 styles being destroyed\n var dataEmotionAttribute = node.getAttribute('data-emotion');\n\n if (dataEmotionAttribute.indexOf(' ') === -1) {\n return;\n }\n\n document.head.appendChild(node);\n node.setAttribute('data-s', '');\n });\n }\n\n var stylisPlugins = options.stylisPlugins || defaultStylisPlugins;\n\n var inserted = {};\n var container;\n var nodesToHydrate = [];\n\n if (isBrowser) {\n container = options.container || document.head;\n Array.prototype.forEach.call( // this means we will ignore elements which don't have a space in them which\n // means that the style elements we're looking at are only Emotion 11 server-rendered style elements\n document.querySelectorAll(\"style[data-emotion^=\\\"\" + key + \" \\\"]\"), function (node) {\n var attrib = node.getAttribute(\"data-emotion\").split(' ');\n\n for (var i = 1; i < attrib.length; i++) {\n inserted[attrib[i]] = true;\n }\n\n nodesToHydrate.push(node);\n });\n }\n\n var _insert;\n\n var omnipresentPlugins = [compat, removeLabel];\n\n if (!getServerStylisCache) {\n var currentSheet;\n var finalizingPlugins = [stringify, rulesheet(function (rule) {\n currentSheet.insert(rule);\n })];\n var serializer = middleware(omnipresentPlugins.concat(stylisPlugins, finalizingPlugins));\n\n var stylis = function stylis(styles) {\n return serialize(compile(styles), serializer);\n };\n\n _insert = function insert(selector, serialized, sheet, shouldCache) {\n currentSheet = sheet;\n\n stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n\n if (shouldCache) {\n cache.inserted[serialized.name] = true;\n }\n };\n } else {\n var _finalizingPlugins = [stringify];\n\n var _serializer = middleware(omnipresentPlugins.concat(stylisPlugins, _finalizingPlugins));\n\n var _stylis = function _stylis(styles) {\n return serialize(compile(styles), _serializer);\n };\n\n var serverStylisCache = getServerStylisCache(stylisPlugins)(key);\n\n var getRules = function getRules(selector, serialized) {\n var name = serialized.name;\n\n if (serverStylisCache[name] === undefined) {\n serverStylisCache[name] = _stylis(selector ? selector + \"{\" + serialized.styles + \"}\" : serialized.styles);\n }\n\n return serverStylisCache[name];\n };\n\n _insert = function _insert(selector, serialized, sheet, shouldCache) {\n var name = serialized.name;\n var rules = getRules(selector, serialized);\n\n if (cache.compat === undefined) {\n // in regular mode, we don't set the styles on the inserted cache\n // since we don't need to and that would be wasting memory\n // we return them so that they are rendered in a style tag\n if (shouldCache) {\n cache.inserted[name] = true;\n }\n\n return rules;\n } else {\n // in compat mode, we put the styles on the inserted cache so\n // that emotion-server can pull out the styles\n // except when we don't want to cache it which was in Global but now\n // is nowhere but we don't want to do a major right now\n // and just in case we're going to leave the case here\n // it's also not affecting client side bundle size\n // so it's really not a big deal\n if (shouldCache) {\n cache.inserted[name] = rules;\n } else {\n return rules;\n }\n }\n };\n }\n\n var cache = {\n key: key,\n sheet: new StyleSheet({\n key: key,\n container: container,\n nonce: options.nonce,\n speedy: options.speedy,\n prepend: options.prepend,\n insertionPoint: options.insertionPoint\n }),\n nonce: options.nonce,\n inserted: inserted,\n registered: {},\n insert: _insert\n };\n cache.sheet.hydrate(nodesToHydrate);\n return cache;\n};\n\nexport { createCache as default };\n","/** @license React v16.13.1\n * react-is.production.min.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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';var b=\"function\"===typeof Symbol&&Symbol.for,c=b?Symbol.for(\"react.element\"):60103,d=b?Symbol.for(\"react.portal\"):60106,e=b?Symbol.for(\"react.fragment\"):60107,f=b?Symbol.for(\"react.strict_mode\"):60108,g=b?Symbol.for(\"react.profiler\"):60114,h=b?Symbol.for(\"react.provider\"):60109,k=b?Symbol.for(\"react.context\"):60110,l=b?Symbol.for(\"react.async_mode\"):60111,m=b?Symbol.for(\"react.concurrent_mode\"):60111,n=b?Symbol.for(\"react.forward_ref\"):60112,p=b?Symbol.for(\"react.suspense\"):60113,q=b?\nSymbol.for(\"react.suspense_list\"):60120,r=b?Symbol.for(\"react.memo\"):60115,t=b?Symbol.for(\"react.lazy\"):60116,v=b?Symbol.for(\"react.block\"):60121,w=b?Symbol.for(\"react.fundamental\"):60117,x=b?Symbol.for(\"react.responder\"):60118,y=b?Symbol.for(\"react.scope\"):60119;\nfunction z(a){if(\"object\"===typeof a&&null!==a){var u=a.$$typeof;switch(u){case c:switch(a=a.type,a){case l:case m:case e:case g:case f:case p:return a;default:switch(a=a&&a.$$typeof,a){case k:case n:case t:case r:case h:return a;default:return u}}case d:return u}}}function A(a){return z(a)===m}exports.AsyncMode=l;exports.ConcurrentMode=m;exports.ContextConsumer=k;exports.ContextProvider=h;exports.Element=c;exports.ForwardRef=n;exports.Fragment=e;exports.Lazy=t;exports.Memo=r;exports.Portal=d;\nexports.Profiler=g;exports.StrictMode=f;exports.Suspense=p;exports.isAsyncMode=function(a){return A(a)||z(a)===l};exports.isConcurrentMode=A;exports.isContextConsumer=function(a){return z(a)===k};exports.isContextProvider=function(a){return z(a)===h};exports.isElement=function(a){return\"object\"===typeof a&&null!==a&&a.$$typeof===c};exports.isForwardRef=function(a){return z(a)===n};exports.isFragment=function(a){return z(a)===e};exports.isLazy=function(a){return z(a)===t};\nexports.isMemo=function(a){return z(a)===r};exports.isPortal=function(a){return z(a)===d};exports.isProfiler=function(a){return z(a)===g};exports.isStrictMode=function(a){return z(a)===f};exports.isSuspense=function(a){return z(a)===p};\nexports.isValidElementType=function(a){return\"string\"===typeof a||\"function\"===typeof a||a===e||a===m||a===g||a===f||a===p||a===q||\"object\"===typeof a&&null!==a&&(a.$$typeof===t||a.$$typeof===r||a.$$typeof===h||a.$$typeof===k||a.$$typeof===n||a.$$typeof===w||a.$$typeof===x||a.$$typeof===y||a.$$typeof===v)};exports.typeOf=z;\n","/** @license React v16.13.1\n * react-is.development.js\n *\n * Copyright (c) Facebook, Inc. and its affiliates.\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\nif (process.env.NODE_ENV !== \"production\") {\n (function() {\n'use strict';\n\n// The Symbol used to tag the ReactElement-like types. If there is no native Symbol\n// nor polyfill, then a plain number is used for performance.\nvar hasSymbol = typeof Symbol === 'function' && Symbol.for;\nvar REACT_ELEMENT_TYPE = hasSymbol ? Symbol.for('react.element') : 0xeac7;\nvar REACT_PORTAL_TYPE = hasSymbol ? Symbol.for('react.portal') : 0xeaca;\nvar REACT_FRAGMENT_TYPE = hasSymbol ? Symbol.for('react.fragment') : 0xeacb;\nvar REACT_STRICT_MODE_TYPE = hasSymbol ? Symbol.for('react.strict_mode') : 0xeacc;\nvar REACT_PROFILER_TYPE = hasSymbol ? Symbol.for('react.profiler') : 0xead2;\nvar REACT_PROVIDER_TYPE = hasSymbol ? Symbol.for('react.provider') : 0xeacd;\nvar REACT_CONTEXT_TYPE = hasSymbol ? Symbol.for('react.context') : 0xeace; // TODO: We don't use AsyncMode or ConcurrentMode anymore. They were temporary\n// (unstable) APIs that have been removed. Can we remove the symbols?\n\nvar REACT_ASYNC_MODE_TYPE = hasSymbol ? Symbol.for('react.async_mode') : 0xeacf;\nvar REACT_CONCURRENT_MODE_TYPE = hasSymbol ? Symbol.for('react.concurrent_mode') : 0xeacf;\nvar REACT_FORWARD_REF_TYPE = hasSymbol ? Symbol.for('react.forward_ref') : 0xead0;\nvar REACT_SUSPENSE_TYPE = hasSymbol ? Symbol.for('react.suspense') : 0xead1;\nvar REACT_SUSPENSE_LIST_TYPE = hasSymbol ? Symbol.for('react.suspense_list') : 0xead8;\nvar REACT_MEMO_TYPE = hasSymbol ? Symbol.for('react.memo') : 0xead3;\nvar REACT_LAZY_TYPE = hasSymbol ? Symbol.for('react.lazy') : 0xead4;\nvar REACT_BLOCK_TYPE = hasSymbol ? Symbol.for('react.block') : 0xead9;\nvar REACT_FUNDAMENTAL_TYPE = hasSymbol ? Symbol.for('react.fundamental') : 0xead5;\nvar REACT_RESPONDER_TYPE = hasSymbol ? Symbol.for('react.responder') : 0xead6;\nvar REACT_SCOPE_TYPE = hasSymbol ? Symbol.for('react.scope') : 0xead7;\n\nfunction isValidElementType(type) {\n return typeof type === 'string' || typeof type === 'function' || // Note: its typeof might be other than 'symbol' or 'number' if it's a polyfill.\n type === REACT_FRAGMENT_TYPE || type === REACT_CONCURRENT_MODE_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || typeof type === 'object' && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_FUNDAMENTAL_TYPE || type.$$typeof === REACT_RESPONDER_TYPE || type.$$typeof === REACT_SCOPE_TYPE || type.$$typeof === REACT_BLOCK_TYPE);\n}\n\nfunction typeOf(object) {\n if (typeof object === 'object' && object !== null) {\n var $$typeof = object.$$typeof;\n\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n var type = object.type;\n\n switch (type) {\n case REACT_ASYNC_MODE_TYPE:\n case REACT_CONCURRENT_MODE_TYPE:\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n return type;\n\n default:\n var $$typeofType = type && type.$$typeof;\n\n switch ($$typeofType) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n case REACT_PROVIDER_TYPE:\n return $$typeofType;\n\n default:\n return $$typeof;\n }\n\n }\n\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n\n return undefined;\n} // AsyncMode is deprecated along with isAsyncMode\n\nvar AsyncMode = REACT_ASYNC_MODE_TYPE;\nvar ConcurrentMode = REACT_CONCURRENT_MODE_TYPE;\nvar ContextConsumer = REACT_CONTEXT_TYPE;\nvar ContextProvider = REACT_PROVIDER_TYPE;\nvar Element = REACT_ELEMENT_TYPE;\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Fragment = REACT_FRAGMENT_TYPE;\nvar Lazy = REACT_LAZY_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nvar Portal = REACT_PORTAL_TYPE;\nvar Profiler = REACT_PROFILER_TYPE;\nvar StrictMode = REACT_STRICT_MODE_TYPE;\nvar Suspense = REACT_SUSPENSE_TYPE;\nvar hasWarnedAboutDeprecatedIsAsyncMode = false; // AsyncMode should be deprecated\n\nfunction isAsyncMode(object) {\n {\n if (!hasWarnedAboutDeprecatedIsAsyncMode) {\n hasWarnedAboutDeprecatedIsAsyncMode = true; // Using console['warn'] to evade Babel and ESLint\n\n console['warn']('The ReactIs.isAsyncMode() alias has been deprecated, ' + 'and will be removed in React 17+. Update your code to use ' + 'ReactIs.isConcurrentMode() instead. It has the exact same API.');\n }\n }\n\n return isConcurrentMode(object) || typeOf(object) === REACT_ASYNC_MODE_TYPE;\n}\nfunction isConcurrentMode(object) {\n return typeOf(object) === REACT_CONCURRENT_MODE_TYPE;\n}\nfunction isContextConsumer(object) {\n return typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isContextProvider(object) {\n return typeOf(object) === REACT_PROVIDER_TYPE;\n}\nfunction isElement(object) {\n return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;\n}\nfunction isForwardRef(object) {\n return typeOf(object) === REACT_FORWARD_REF_TYPE;\n}\nfunction isFragment(object) {\n return typeOf(object) === REACT_FRAGMENT_TYPE;\n}\nfunction isLazy(object) {\n return typeOf(object) === REACT_LAZY_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\nfunction isPortal(object) {\n return typeOf(object) === REACT_PORTAL_TYPE;\n}\nfunction isProfiler(object) {\n return typeOf(object) === REACT_PROFILER_TYPE;\n}\nfunction isStrictMode(object) {\n return typeOf(object) === REACT_STRICT_MODE_TYPE;\n}\nfunction isSuspense(object) {\n return typeOf(object) === REACT_SUSPENSE_TYPE;\n}\n\nexports.AsyncMode = AsyncMode;\nexports.ConcurrentMode = ConcurrentMode;\nexports.ContextConsumer = ContextConsumer;\nexports.ContextProvider = ContextProvider;\nexports.Element = Element;\nexports.ForwardRef = ForwardRef;\nexports.Fragment = Fragment;\nexports.Lazy = Lazy;\nexports.Memo = Memo;\nexports.Portal = Portal;\nexports.Profiler = Profiler;\nexports.StrictMode = StrictMode;\nexports.Suspense = Suspense;\nexports.isAsyncMode = isAsyncMode;\nexports.isConcurrentMode = isConcurrentMode;\nexports.isContextConsumer = isContextConsumer;\nexports.isContextProvider = isContextProvider;\nexports.isElement = isElement;\nexports.isForwardRef = isForwardRef;\nexports.isFragment = isFragment;\nexports.isLazy = isLazy;\nexports.isMemo = isMemo;\nexports.isPortal = isPortal;\nexports.isProfiler = isProfiler;\nexports.isStrictMode = isStrictMode;\nexports.isSuspense = isSuspense;\nexports.isValidElementType = isValidElementType;\nexports.typeOf = typeOf;\n })();\n}\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/react-is.production.min.js');\n} else {\n module.exports = require('./cjs/react-is.development.js');\n}\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","var isBrowser = typeof document !== 'undefined';\n\nfunction getRegisteredStyles(registered, registeredStyles, classNames) {\n var rawClassName = '';\n classNames.split(' ').forEach(function (className) {\n if (registered[className] !== undefined) {\n registeredStyles.push(registered[className] + \";\");\n } else if (className) {\n rawClassName += className + \" \";\n }\n });\n return rawClassName;\n}\nvar registerStyles = function registerStyles(cache, serialized, isStringTag) {\n var className = cache.key + \"-\" + serialized.name;\n\n if ( // we only need to add the styles to the registered cache if the\n // class name could be used further down\n // the tree but if it's a string tag, we know it won't\n // so we don't have to add it to registered cache.\n // this improves memory usage since we can avoid storing the whole style string\n (isStringTag === false || // we need to always store it if we're in compat mode and\n // in node since emotion-server relies on whether a style is in\n // the registered cache to know whether a style is global or not\n // also, note that this check will be dead code eliminated in the browser\n isBrowser === false && cache.compat !== undefined) && cache.registered[className] === undefined) {\n cache.registered[className] = serialized.styles;\n }\n};\nvar insertStyles = function insertStyles(cache, serialized, isStringTag) {\n registerStyles(cache, serialized, isStringTag);\n var className = cache.key + \"-\" + serialized.name;\n\n if (cache.inserted[serialized.name] === undefined) {\n var stylesForSSR = '';\n var current = serialized;\n\n do {\n var maybeStyles = cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n if (!isBrowser && maybeStyles !== undefined) {\n stylesForSSR += maybeStyles;\n }\n\n current = current.next;\n } while (current !== undefined);\n\n if (!isBrowser && stylesForSSR.length !== 0) {\n return stylesForSSR;\n }\n }\n};\n\nexport { getRegisteredStyles, insertStyles, registerStyles };\n","/* eslint-disable */\n// Inspired by https://github.com/garycourt/murmurhash-js\n// Ported from https://github.com/aappleby/smhasher/blob/61a0530f28277f2e850bfc39600ce61d02b518de/src/MurmurHash2.cpp#L37-L86\nfunction murmur2(str) {\n // 'm' and 'r' are mixing constants generated offline.\n // They're not really 'magic', they just happen to work well.\n // const m = 0x5bd1e995;\n // const r = 24;\n // Initialize the hash\n var h = 0; // Mix 4 bytes at a time into the hash\n\n var k,\n i = 0,\n len = str.length;\n\n for (; len >= 4; ++i, len -= 4) {\n k = str.charCodeAt(i) & 0xff | (str.charCodeAt(++i) & 0xff) << 8 | (str.charCodeAt(++i) & 0xff) << 16 | (str.charCodeAt(++i) & 0xff) << 24;\n k =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16);\n k ^=\n /* k >>> r: */\n k >>> 24;\n h =\n /* Math.imul(k, m): */\n (k & 0xffff) * 0x5bd1e995 + ((k >>> 16) * 0xe995 << 16) ^\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Handle the last few bytes of the input array\n\n\n switch (len) {\n case 3:\n h ^= (str.charCodeAt(i + 2) & 0xff) << 16;\n\n case 2:\n h ^= (str.charCodeAt(i + 1) & 0xff) << 8;\n\n case 1:\n h ^= str.charCodeAt(i) & 0xff;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n } // Do a few final mixes of the hash to ensure the last few\n // bytes are well-incorporated.\n\n\n h ^= h >>> 13;\n h =\n /* Math.imul(h, m): */\n (h & 0xffff) * 0x5bd1e995 + ((h >>> 16) * 0xe995 << 16);\n return ((h ^ h >>> 15) >>> 0).toString(36);\n}\n\nexport { murmur2 as default };\n","var unitlessKeys = {\n animationIterationCount: 1,\n aspectRatio: 1,\n borderImageOutset: 1,\n borderImageSlice: 1,\n borderImageWidth: 1,\n boxFlex: 1,\n boxFlexGroup: 1,\n boxOrdinalGroup: 1,\n columnCount: 1,\n columns: 1,\n flex: 1,\n flexGrow: 1,\n flexPositive: 1,\n flexShrink: 1,\n flexNegative: 1,\n flexOrder: 1,\n gridRow: 1,\n gridRowEnd: 1,\n gridRowSpan: 1,\n gridRowStart: 1,\n gridColumn: 1,\n gridColumnEnd: 1,\n gridColumnSpan: 1,\n gridColumnStart: 1,\n msGridRow: 1,\n msGridRowSpan: 1,\n msGridColumn: 1,\n msGridColumnSpan: 1,\n fontWeight: 1,\n lineHeight: 1,\n opacity: 1,\n order: 1,\n orphans: 1,\n scale: 1,\n tabSize: 1,\n widows: 1,\n zIndex: 1,\n zoom: 1,\n WebkitLineClamp: 1,\n // SVG-related properties\n fillOpacity: 1,\n floodOpacity: 1,\n stopOpacity: 1,\n strokeDasharray: 1,\n strokeDashoffset: 1,\n strokeMiterlimit: 1,\n strokeOpacity: 1,\n strokeWidth: 1\n};\n\nexport { unitlessKeys as default };\n","import hashString from '@emotion/hash';\nimport unitless from '@emotion/unitless';\nimport memoize from '@emotion/memoize';\n\nvar isDevelopment = false;\n\nvar hyphenateRegex = /[A-Z]|^ms/g;\nvar animationRegex = /_EMO_([^_]+?)_([^]*?)_EMO_/g;\n\nvar isCustomProperty = function isCustomProperty(property) {\n return property.charCodeAt(1) === 45;\n};\n\nvar isProcessableValue = function isProcessableValue(value) {\n return value != null && typeof value !== 'boolean';\n};\n\nvar processStyleName = /* #__PURE__ */memoize(function (styleName) {\n return isCustomProperty(styleName) ? styleName : styleName.replace(hyphenateRegex, '-$&').toLowerCase();\n});\n\nvar processStyleValue = function processStyleValue(key, value) {\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n if (typeof value === 'string') {\n return value.replace(animationRegex, function (match, p1, p2) {\n cursor = {\n name: p1,\n styles: p2,\n next: cursor\n };\n return p1;\n });\n }\n }\n }\n\n if (unitless[key] !== 1 && !isCustomProperty(key) && typeof value === 'number' && value !== 0) {\n return value + 'px';\n }\n\n return value;\n};\n\nvar noComponentSelectorMessage = 'Component selectors can only be used in conjunction with ' + '@emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware ' + 'compiler transform.';\n\nfunction handleInterpolation(mergedProps, registered, interpolation) {\n if (interpolation == null) {\n return '';\n }\n\n var componentSelector = interpolation;\n\n if (componentSelector.__emotion_styles !== undefined) {\n\n return componentSelector;\n }\n\n switch (typeof interpolation) {\n case 'boolean':\n {\n return '';\n }\n\n case 'object':\n {\n var keyframes = interpolation;\n\n if (keyframes.anim === 1) {\n cursor = {\n name: keyframes.name,\n styles: keyframes.styles,\n next: cursor\n };\n return keyframes.name;\n }\n\n var serializedStyles = interpolation;\n\n if (serializedStyles.styles !== undefined) {\n var next = serializedStyles.next;\n\n if (next !== undefined) {\n // not the most efficient thing ever but this is a pretty rare case\n // and there will be very few iterations of this generally\n while (next !== undefined) {\n cursor = {\n name: next.name,\n styles: next.styles,\n next: cursor\n };\n next = next.next;\n }\n }\n\n var styles = serializedStyles.styles + \";\";\n return styles;\n }\n\n return createStringFromObject(mergedProps, registered, interpolation);\n }\n\n case 'function':\n {\n if (mergedProps !== undefined) {\n var previousCursor = cursor;\n var result = interpolation(mergedProps);\n cursor = previousCursor;\n return handleInterpolation(mergedProps, registered, result);\n }\n\n break;\n }\n } // finalize string values (regular strings and functions interpolated into css calls)\n\n\n var asString = interpolation;\n\n if (registered == null) {\n return asString;\n }\n\n var cached = registered[asString];\n return cached !== undefined ? cached : asString;\n}\n\nfunction createStringFromObject(mergedProps, registered, obj) {\n var string = '';\n\n if (Array.isArray(obj)) {\n for (var i = 0; i < obj.length; i++) {\n string += handleInterpolation(mergedProps, registered, obj[i]) + \";\";\n }\n } else {\n for (var key in obj) {\n var value = obj[key];\n\n if (typeof value !== 'object') {\n var asString = value;\n\n if (registered != null && registered[asString] !== undefined) {\n string += key + \"{\" + registered[asString] + \"}\";\n } else if (isProcessableValue(asString)) {\n string += processStyleName(key) + \":\" + processStyleValue(key, asString) + \";\";\n }\n } else {\n if (key === 'NO_COMPONENT_SELECTOR' && isDevelopment) {\n throw new Error(noComponentSelectorMessage);\n }\n\n if (Array.isArray(value) && typeof value[0] === 'string' && (registered == null || registered[value[0]] === undefined)) {\n for (var _i = 0; _i < value.length; _i++) {\n if (isProcessableValue(value[_i])) {\n string += processStyleName(key) + \":\" + processStyleValue(key, value[_i]) + \";\";\n }\n }\n } else {\n var interpolated = handleInterpolation(mergedProps, registered, value);\n\n switch (key) {\n case 'animation':\n case 'animationName':\n {\n string += processStyleName(key) + \":\" + interpolated + \";\";\n break;\n }\n\n default:\n {\n\n string += key + \"{\" + interpolated + \"}\";\n }\n }\n }\n }\n }\n }\n\n return string;\n}\n\nvar labelPattern = /label:\\s*([^\\s;{]+)\\s*(;|$)/g; // this is the cursor for keyframes\n// keyframes are stored on the SerializedStyles object as a linked list\n\nvar cursor;\nfunction serializeStyles(args, registered, mergedProps) {\n if (args.length === 1 && typeof args[0] === 'object' && args[0] !== null && args[0].styles !== undefined) {\n return args[0];\n }\n\n var stringMode = true;\n var styles = '';\n cursor = undefined;\n var strings = args[0];\n\n if (strings == null || strings.raw === undefined) {\n stringMode = false;\n styles += handleInterpolation(mergedProps, registered, strings);\n } else {\n var asTemplateStringsArr = strings;\n\n styles += asTemplateStringsArr[0];\n } // we start at 1 since we've already handled the first arg\n\n\n for (var i = 1; i < args.length; i++) {\n styles += handleInterpolation(mergedProps, registered, args[i]);\n\n if (stringMode) {\n var templateStringsArr = strings;\n\n styles += templateStringsArr[i];\n }\n } // using a global regex with .exec is stateful so lastIndex has to be reset each time\n\n\n labelPattern.lastIndex = 0;\n var identifierName = '';\n var match; // https://esbench.com/bench/5b809c2cf2949800a0f61fb5\n\n while ((match = labelPattern.exec(styles)) !== null) {\n identifierName += '-' + match[1];\n }\n\n var name = hashString(styles) + identifierName;\n\n return {\n name: name,\n styles: styles,\n next: cursor\n };\n}\n\nexport { serializeStyles };\n","import * as React from 'react';\n\nvar isBrowser = typeof document !== 'undefined';\n\nvar syncFallback = function syncFallback(create) {\n return create();\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = !isBrowser ? syncFallback : useInsertionEffect || syncFallback;\nvar useInsertionEffectWithLayoutFallback = useInsertionEffect || React.useLayoutEffect;\n\nexport { useInsertionEffectAlwaysWithSyncFallback, useInsertionEffectWithLayoutFallback };\n","import * as React from 'react';\nimport { useContext, forwardRef } from 'react';\nimport createCache from '@emotion/cache';\nimport _extends from '@babel/runtime/helpers/esm/extends';\nimport weakMemoize from '@emotion/weak-memoize';\nimport hoistNonReactStatics from '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js';\nimport { getRegisteredStyles, registerStyles, insertStyles } from '@emotion/utils';\nimport { serializeStyles } from '@emotion/serialize';\nimport { useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\n\nvar isDevelopment = false;\n\nvar isBrowser = typeof document !== 'undefined';\n\nvar EmotionCacheContext = /* #__PURE__ */React.createContext( // we're doing this to avoid preconstruct's dead code elimination in this one case\n// because this module is primarily intended for the browser and node\n// but it's also required in react native and similar environments sometimes\n// and we could have a special build just for that\n// but this is much easier and the native packages\n// might use a different theme context in the future anyway\ntypeof HTMLElement !== 'undefined' ? /* #__PURE__ */createCache({\n key: 'css'\n}) : null);\n\nvar CacheProvider = EmotionCacheContext.Provider;\nvar __unsafe_useEmotionCache = function useEmotionCache() {\n return useContext(EmotionCacheContext);\n};\n\nvar withEmotionCache = function withEmotionCache(func) {\n return /*#__PURE__*/forwardRef(function (props, ref) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\n });\n};\n\nif (!isBrowser) {\n withEmotionCache = function withEmotionCache(func) {\n return function (props) {\n var cache = useContext(EmotionCacheContext);\n\n if (cache === null) {\n // yes, we're potentially creating this on every render\n // it doesn't actually matter though since it's only on the server\n // so there will only every be a single render\n // that could change in the future because of suspense and etc. but for now,\n // this works and i don't want to optimise for a future thing that we aren't sure about\n cache = createCache({\n key: 'css'\n });\n return /*#__PURE__*/React.createElement(EmotionCacheContext.Provider, {\n value: cache\n }, func(props, cache));\n } else {\n return func(props, cache);\n }\n };\n };\n}\n\nvar ThemeContext = /* #__PURE__ */React.createContext({});\n\nvar useTheme = function useTheme() {\n return React.useContext(ThemeContext);\n};\n\nvar getTheme = function getTheme(outerTheme, theme) {\n if (typeof theme === 'function') {\n var mergedTheme = theme(outerTheme);\n\n return mergedTheme;\n }\n\n return _extends({}, outerTheme, theme);\n};\n\nvar createCacheWithTheme = /* #__PURE__ */weakMemoize(function (outerTheme) {\n return weakMemoize(function (theme) {\n return getTheme(outerTheme, theme);\n });\n});\nvar ThemeProvider = function ThemeProvider(props) {\n var theme = React.useContext(ThemeContext);\n\n if (props.theme !== theme) {\n theme = createCacheWithTheme(theme)(props.theme);\n }\n\n return /*#__PURE__*/React.createElement(ThemeContext.Provider, {\n value: theme\n }, props.children);\n};\nfunction withTheme(Component) {\n var componentName = Component.displayName || Component.name || 'Component';\n var WithTheme = /*#__PURE__*/React.forwardRef(function render(props, ref) {\n var theme = React.useContext(ThemeContext);\n return /*#__PURE__*/React.createElement(Component, _extends({\n theme: theme,\n ref: ref\n }, props));\n });\n WithTheme.displayName = \"WithTheme(\" + componentName + \")\";\n return hoistNonReactStatics(WithTheme, Component);\n}\n\nvar hasOwn = {}.hasOwnProperty;\n\nvar typePropName = '__EMOTION_TYPE_PLEASE_DO_NOT_USE__';\nvar createEmotionProps = function createEmotionProps(type, props) {\n\n var newProps = {};\n\n for (var _key in props) {\n if (hasOwn.call(props, _key)) {\n newProps[_key] = props[_key];\n }\n }\n\n newProps[typePropName] = type; // Runtime labeling is an opt-in feature because:\n\n return newProps;\n};\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serialized = _ref.serialized,\n isStringTag = _ref.isStringTag;\n registerStyles(cache, serialized, isStringTag);\n var rules = useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n if (!isBrowser && rules !== undefined) {\n var _ref2;\n\n var serializedNames = serialized.name;\n var next = serialized.next;\n\n while (next !== undefined) {\n serializedNames += ' ' + next.name;\n next = next.next;\n }\n\n return /*#__PURE__*/React.createElement(\"style\", (_ref2 = {}, _ref2[\"data-emotion\"] = cache.key + \" \" + serializedNames, _ref2.dangerouslySetInnerHTML = {\n __html: rules\n }, _ref2.nonce = cache.sheet.nonce, _ref2));\n }\n\n return null;\n};\n\nvar Emotion = /* #__PURE__ */withEmotionCache(function (props, cache, ref) {\n var cssProp = props.css; // so that using `css` from `emotion` and passing the result to the css prop works\n // not passing the registered cache to serializeStyles because it would\n // make certain babel optimisations not possible\n\n if (typeof cssProp === 'string' && cache.registered[cssProp] !== undefined) {\n cssProp = cache.registered[cssProp];\n }\n\n var WrappedComponent = props[typePropName];\n var registeredStyles = [cssProp];\n var className = '';\n\n if (typeof props.className === 'string') {\n className = getRegisteredStyles(cache.registered, registeredStyles, props.className);\n } else if (props.className != null) {\n className = props.className + \" \";\n }\n\n var serialized = serializeStyles(registeredStyles, undefined, React.useContext(ThemeContext));\n\n className += cache.key + \"-\" + serialized.name;\n var newProps = {};\n\n for (var _key2 in props) {\n if (hasOwn.call(props, _key2) && _key2 !== 'css' && _key2 !== typePropName && (!isDevelopment )) {\n newProps[_key2] = props[_key2];\n }\n }\n\n newProps.className = className;\n\n if (ref) {\n newProps.ref = ref;\n }\n\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serialized: serialized,\n isStringTag: typeof WrappedComponent === 'string'\n }), /*#__PURE__*/React.createElement(WrappedComponent, newProps));\n});\n\nvar Emotion$1 = Emotion;\n\nexport { CacheProvider as C, Emotion$1 as E, ThemeContext as T, __unsafe_useEmotionCache as _, isDevelopment as a, ThemeProvider as b, createEmotionProps as c, withTheme as d, hasOwn as h, isBrowser as i, useTheme as u, withEmotionCache as w };\n","import { h as hasOwn, E as Emotion, c as createEmotionProps, w as withEmotionCache, T as ThemeContext, i as isBrowser, a as isDevelopment } from './emotion-element-d59e098f.esm.js';\nexport { C as CacheProvider, T as ThemeContext, b as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, d as withTheme } from './emotion-element-d59e098f.esm.js';\nimport * as React from 'react';\nimport { insertStyles, registerStyles, getRegisteredStyles } from '@emotion/utils';\nimport { useInsertionEffectWithLayoutFallback, useInsertionEffectAlwaysWithSyncFallback } from '@emotion/use-insertion-effect-with-fallbacks';\nimport { serializeStyles } from '@emotion/serialize';\nimport '@emotion/cache';\nimport '@babel/runtime/helpers/extends';\nimport '@emotion/weak-memoize';\nimport '../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.esm.js';\nimport 'hoist-non-react-statics';\n\nvar jsx = function jsx(type, props) {\n // eslint-disable-next-line prefer-rest-params\n var args = arguments;\n\n if (props == null || !hasOwn.call(props, 'css')) {\n return React.createElement.apply(undefined, args);\n }\n\n var argsLength = args.length;\n var createElementArgArray = new Array(argsLength);\n createElementArgArray[0] = Emotion;\n createElementArgArray[1] = createEmotionProps(type, props);\n\n for (var i = 2; i < argsLength; i++) {\n createElementArgArray[i] = args[i];\n }\n\n return React.createElement.apply(null, createElementArgArray);\n};\n\n(function (_jsx) {\n var JSX;\n\n (function (_JSX) {})(JSX || (JSX = _jsx.JSX || (_jsx.JSX = {})));\n})(jsx || (jsx = {}));\n\n// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild\n// initial client-side render from SSR, use place of hydrating tag\n\nvar Global = /* #__PURE__ */withEmotionCache(function (props, cache) {\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext));\n\n if (!isBrowser) {\n var _ref;\n\n var serializedNames = serialized.name;\n var serializedStyles = serialized.styles;\n var next = serialized.next;\n\n while (next !== undefined) {\n serializedNames += ' ' + next.name;\n serializedStyles += next.styles;\n next = next.next;\n }\n\n var shouldCache = cache.compat === true;\n var rules = cache.insert(\"\", {\n name: serializedNames,\n styles: serializedStyles\n }, cache.sheet, shouldCache);\n\n if (shouldCache) {\n return null;\n }\n\n return /*#__PURE__*/React.createElement(\"style\", (_ref = {}, _ref[\"data-emotion\"] = cache.key + \"-global \" + serializedNames, _ref.dangerouslySetInnerHTML = {\n __html: rules\n }, _ref.nonce = cache.sheet.nonce, _ref));\n } // yes, i know these hooks are used conditionally\n // but it is based on a constant that will never change at runtime\n // it's effectively like having two implementations and switching them out\n // so it's not actually breaking anything\n\n\n var sheetRef = React.useRef();\n useInsertionEffectWithLayoutFallback(function () {\n var key = cache.key + \"-global\"; // use case of https://github.com/emotion-js/emotion/issues/2675\n\n var sheet = new cache.sheet.constructor({\n key: key,\n nonce: cache.sheet.nonce,\n container: cache.sheet.container,\n speedy: cache.sheet.isSpeedy\n });\n var rehydrating = false;\n var node = document.querySelector(\"style[data-emotion=\\\"\" + key + \" \" + serialized.name + \"\\\"]\");\n\n if (cache.sheet.tags.length) {\n sheet.before = cache.sheet.tags[0];\n }\n\n if (node !== null) {\n rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other s\n\n node.setAttribute('data-emotion', key);\n sheet.hydrate([node]);\n }\n\n sheetRef.current = [sheet, rehydrating];\n return function () {\n sheet.flush();\n };\n }, [cache]);\n useInsertionEffectWithLayoutFallback(function () {\n var sheetRefCurrent = sheetRef.current;\n var sheet = sheetRefCurrent[0],\n rehydrating = sheetRefCurrent[1];\n\n if (rehydrating) {\n sheetRefCurrent[1] = false;\n return;\n }\n\n if (serialized.next !== undefined) {\n // insert keyframes\n insertStyles(cache, serialized.next, true);\n }\n\n if (sheet.tags.length) {\n // if this doesn't exist then it will be null so the style element will be appended\n var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;\n sheet.before = element;\n sheet.flush();\n }\n\n cache.insert(\"\", serialized, sheet, false);\n }, [cache, serialized.name]);\n return null;\n});\n\nfunction css() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n return serializeStyles(args);\n}\n\nfunction keyframes() {\n var insertable = css.apply(void 0, arguments);\n var name = \"animation-\" + insertable.name;\n return {\n name: name,\n styles: \"@keyframes \" + name + \"{\" + insertable.styles + \"}\",\n anim: 1,\n toString: function toString() {\n return \"_EMO_\" + this.name + \"_\" + this.styles + \"_EMO_\";\n }\n };\n}\n\nvar classnames = function classnames(args) {\n var len = args.length;\n var i = 0;\n var cls = '';\n\n for (; i < len; i++) {\n var arg = args[i];\n if (arg == null) continue;\n var toAdd = void 0;\n\n switch (typeof arg) {\n case 'boolean':\n break;\n\n case 'object':\n {\n if (Array.isArray(arg)) {\n toAdd = classnames(arg);\n } else {\n\n toAdd = '';\n\n for (var k in arg) {\n if (arg[k] && k) {\n toAdd && (toAdd += ' ');\n toAdd += k;\n }\n }\n }\n\n break;\n }\n\n default:\n {\n toAdd = arg;\n }\n }\n\n if (toAdd) {\n cls && (cls += ' ');\n cls += toAdd;\n }\n }\n\n return cls;\n};\n\nfunction merge(registered, css, className) {\n var registeredStyles = [];\n var rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n\n if (registeredStyles.length < 2) {\n return className;\n }\n\n return rawClassName + css(registeredStyles);\n}\n\nvar Insertion = function Insertion(_ref) {\n var cache = _ref.cache,\n serializedArr = _ref.serializedArr;\n var rules = useInsertionEffectAlwaysWithSyncFallback(function () {\n var rules = '';\n\n for (var i = 0; i < serializedArr.length; i++) {\n var res = insertStyles(cache, serializedArr[i], false);\n\n if (!isBrowser && res !== undefined) {\n rules += res;\n }\n }\n\n if (!isBrowser) {\n return rules;\n }\n });\n\n if (!isBrowser && rules.length !== 0) {\n var _ref2;\n\n return /*#__PURE__*/React.createElement(\"style\", (_ref2 = {}, _ref2[\"data-emotion\"] = cache.key + \" \" + serializedArr.map(function (serialized) {\n return serialized.name;\n }).join(' '), _ref2.dangerouslySetInnerHTML = {\n __html: rules\n }, _ref2.nonce = cache.sheet.nonce, _ref2));\n }\n\n return null;\n};\n\nvar ClassNames = /* #__PURE__ */withEmotionCache(function (props, cache) {\n var hasRendered = false;\n var serializedArr = [];\n\n var css = function css() {\n if (hasRendered && isDevelopment) {\n throw new Error('css can only be used during render');\n }\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n var serialized = serializeStyles(args, cache.registered);\n serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`\n\n registerStyles(cache, serialized, false);\n return cache.key + \"-\" + serialized.name;\n };\n\n var cx = function cx() {\n if (hasRendered && isDevelopment) {\n throw new Error('cx can only be used during render');\n }\n\n for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {\n args[_key2] = arguments[_key2];\n }\n\n return merge(cache.registered, css, classnames(args));\n };\n\n var content = {\n css: css,\n cx: cx,\n theme: React.useContext(ThemeContext)\n };\n var ele = props.children(content);\n hasRendered = true;\n return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Insertion, {\n cache: cache,\n serializedArr: serializedArr\n }), ele);\n});\n\nexport { ClassNames, Global, jsx as createElement, css, jsx, keyframes };\n","function _arrayWithHoles(r) {\n if (Array.isArray(r)) return r;\n}\nexport { _arrayWithHoles as default };","function _iterableToArrayLimit(r, l) {\n var t = null == r ? null : \"undefined\" != typeof Symbol && r[Symbol.iterator] || r[\"@@iterator\"];\n if (null != t) {\n var e,\n n,\n i,\n u,\n a = [],\n f = !0,\n o = !1;\n try {\n if (i = (t = t.call(r)).next, 0 === l) {\n if (Object(t) !== t) return;\n f = !1;\n } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0);\n } catch (r) {\n o = !0, n = r;\n } finally {\n try {\n if (!f && null != t[\"return\"] && (u = t[\"return\"](), Object(u) !== u)) return;\n } finally {\n if (o) throw n;\n }\n }\n return a;\n }\n}\nexport { _iterableToArrayLimit as default };","function _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nexport { _nonIterableRest as default };","import arrayWithHoles from \"./arrayWithHoles.js\";\nimport iterableToArrayLimit from \"./iterableToArrayLimit.js\";\nimport unsupportedIterableToArray from \"./unsupportedIterableToArray.js\";\nimport nonIterableRest from \"./nonIterableRest.js\";\nfunction _slicedToArray(r, e) {\n return arrayWithHoles(r) || iterableToArrayLimit(r, e) || unsupportedIterableToArray(r, e) || nonIterableRest();\n}\nexport { _slicedToArray as default };","function _objectWithoutPropertiesLoose(r, e) {\n if (null == r) return {};\n var t = {};\n for (var n in r) if ({}.hasOwnProperty.call(r, n)) {\n if (-1 !== e.indexOf(n)) continue;\n t[n] = r[n];\n }\n return t;\n}\nexport { _objectWithoutPropertiesLoose as default };","import objectWithoutPropertiesLoose from \"./objectWithoutPropertiesLoose.js\";\nfunction _objectWithoutProperties(e, t) {\n if (null == e) return {};\n var o,\n r,\n i = objectWithoutPropertiesLoose(e, t);\n if (Object.getOwnPropertySymbols) {\n var n = Object.getOwnPropertySymbols(e);\n for (r = 0; r < n.length; r++) o = n[r], -1 === t.indexOf(o) && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);\n }\n return i;\n}\nexport { _objectWithoutProperties as default };","function _taggedTemplateLiteral(e, t) {\n return t || (t = e.slice(0)), Object.freeze(Object.defineProperties(e, {\n raw: {\n value: Object.freeze(t)\n }\n }));\n}\nexport { _taggedTemplateLiteral as default };","/**\n * Custom positioning reference element.\n * @see https://floating-ui.com/docs/virtual-elements\n */\n\nconst sides = ['top', 'right', 'bottom', 'left'];\nconst alignments = ['start', 'end'];\nconst placements = /*#__PURE__*/sides.reduce((acc, side) => acc.concat(side, side + \"-\" + alignments[0], side + \"-\" + alignments[1]), []);\nconst min = Math.min;\nconst max = Math.max;\nconst round = Math.round;\nconst floor = Math.floor;\nconst createCoords = v => ({\n x: v,\n y: v\n});\nconst oppositeSideMap = {\n left: 'right',\n right: 'left',\n bottom: 'top',\n top: 'bottom'\n};\nconst oppositeAlignmentMap = {\n start: 'end',\n end: 'start'\n};\nfunction clamp(start, value, end) {\n return max(start, min(value, end));\n}\nfunction evaluate(value, param) {\n return typeof value === 'function' ? value(param) : value;\n}\nfunction getSide(placement) {\n return placement.split('-')[0];\n}\nfunction getAlignment(placement) {\n return placement.split('-')[1];\n}\nfunction getOppositeAxis(axis) {\n return axis === 'x' ? 'y' : 'x';\n}\nfunction getAxisLength(axis) {\n return axis === 'y' ? 'height' : 'width';\n}\nfunction getSideAxis(placement) {\n return ['top', 'bottom'].includes(getSide(placement)) ? 'y' : 'x';\n}\nfunction getAlignmentAxis(placement) {\n return getOppositeAxis(getSideAxis(placement));\n}\nfunction getAlignmentSides(placement, rects, rtl) {\n if (rtl === void 0) {\n rtl = false;\n }\n const alignment = getAlignment(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const length = getAxisLength(alignmentAxis);\n let mainAlignmentSide = alignmentAxis === 'x' ? alignment === (rtl ? 'end' : 'start') ? 'right' : 'left' : alignment === 'start' ? 'bottom' : 'top';\n if (rects.reference[length] > rects.floating[length]) {\n mainAlignmentSide = getOppositePlacement(mainAlignmentSide);\n }\n return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];\n}\nfunction getExpandedPlacements(placement) {\n const oppositePlacement = getOppositePlacement(placement);\n return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];\n}\nfunction getOppositeAlignmentPlacement(placement) {\n return placement.replace(/start|end/g, alignment => oppositeAlignmentMap[alignment]);\n}\nfunction getSideList(side, isStart, rtl) {\n const lr = ['left', 'right'];\n const rl = ['right', 'left'];\n const tb = ['top', 'bottom'];\n const bt = ['bottom', 'top'];\n switch (side) {\n case 'top':\n case 'bottom':\n if (rtl) return isStart ? rl : lr;\n return isStart ? lr : rl;\n case 'left':\n case 'right':\n return isStart ? tb : bt;\n default:\n return [];\n }\n}\nfunction getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {\n const alignment = getAlignment(placement);\n let list = getSideList(getSide(placement), direction === 'start', rtl);\n if (alignment) {\n list = list.map(side => side + \"-\" + alignment);\n if (flipAlignment) {\n list = list.concat(list.map(getOppositeAlignmentPlacement));\n }\n }\n return list;\n}\nfunction getOppositePlacement(placement) {\n return placement.replace(/left|right|bottom|top/g, side => oppositeSideMap[side]);\n}\nfunction expandPaddingObject(padding) {\n return {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0,\n ...padding\n };\n}\nfunction getPaddingObject(padding) {\n return typeof padding !== 'number' ? expandPaddingObject(padding) : {\n top: padding,\n right: padding,\n bottom: padding,\n left: padding\n };\n}\nfunction rectToClientRect(rect) {\n const {\n x,\n y,\n width,\n height\n } = rect;\n return {\n width,\n height,\n top: y,\n left: x,\n right: x + width,\n bottom: y + height,\n x,\n y\n };\n}\n\nexport { alignments, clamp, createCoords, evaluate, expandPaddingObject, floor, getAlignment, getAlignmentAxis, getAlignmentSides, getAxisLength, getExpandedPlacements, getOppositeAlignmentPlacement, getOppositeAxis, getOppositeAxisPlacements, getOppositePlacement, getPaddingObject, getSide, getSideAxis, max, min, placements, rectToClientRect, round, sides };\n","import { getSideAxis, getAlignmentAxis, getAxisLength, getSide, getAlignment, evaluate, getPaddingObject, rectToClientRect, min, clamp, placements, getAlignmentSides, getOppositeAlignmentPlacement, getOppositePlacement, getExpandedPlacements, getOppositeAxisPlacements, sides, max, getOppositeAxis } from '@floating-ui/utils';\nexport { rectToClientRect } from '@floating-ui/utils';\n\nfunction computeCoordsFromPlacement(_ref, placement, rtl) {\n let {\n reference,\n floating\n } = _ref;\n const sideAxis = getSideAxis(placement);\n const alignmentAxis = getAlignmentAxis(placement);\n const alignLength = getAxisLength(alignmentAxis);\n const side = getSide(placement);\n const isVertical = sideAxis === 'y';\n const commonX = reference.x + reference.width / 2 - floating.width / 2;\n const commonY = reference.y + reference.height / 2 - floating.height / 2;\n const commonAlign = reference[alignLength] / 2 - floating[alignLength] / 2;\n let coords;\n switch (side) {\n case 'top':\n coords = {\n x: commonX,\n y: reference.y - floating.height\n };\n break;\n case 'bottom':\n coords = {\n x: commonX,\n y: reference.y + reference.height\n };\n break;\n case 'right':\n coords = {\n x: reference.x + reference.width,\n y: commonY\n };\n break;\n case 'left':\n coords = {\n x: reference.x - floating.width,\n y: commonY\n };\n break;\n default:\n coords = {\n x: reference.x,\n y: reference.y\n };\n }\n switch (getAlignment(placement)) {\n case 'start':\n coords[alignmentAxis] -= commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n case 'end':\n coords[alignmentAxis] += commonAlign * (rtl && isVertical ? -1 : 1);\n break;\n }\n return coords;\n}\n\n/**\n * Computes the `x` and `y` coordinates that will place the floating element\n * next to a given reference element.\n *\n * This export does not have any `platform` interface logic. You will need to\n * write one for the platform you are using Floating UI with.\n */\nconst computePosition = async (reference, floating, config) => {\n const {\n placement = 'bottom',\n strategy = 'absolute',\n middleware = [],\n platform\n } = config;\n const validMiddleware = middleware.filter(Boolean);\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(floating));\n let rects = await platform.getElementRects({\n reference,\n floating,\n strategy\n });\n let {\n x,\n y\n } = computeCoordsFromPlacement(rects, placement, rtl);\n let statefulPlacement = placement;\n let middlewareData = {};\n let resetCount = 0;\n for (let i = 0; i < validMiddleware.length; i++) {\n const {\n name,\n fn\n } = validMiddleware[i];\n const {\n x: nextX,\n y: nextY,\n data,\n reset\n } = await fn({\n x,\n y,\n initialPlacement: placement,\n placement: statefulPlacement,\n strategy,\n middlewareData,\n rects,\n platform,\n elements: {\n reference,\n floating\n }\n });\n x = nextX != null ? nextX : x;\n y = nextY != null ? nextY : y;\n middlewareData = {\n ...middlewareData,\n [name]: {\n ...middlewareData[name],\n ...data\n }\n };\n if (reset && resetCount <= 50) {\n resetCount++;\n if (typeof reset === 'object') {\n if (reset.placement) {\n statefulPlacement = reset.placement;\n }\n if (reset.rects) {\n rects = reset.rects === true ? await platform.getElementRects({\n reference,\n floating,\n strategy\n }) : reset.rects;\n }\n ({\n x,\n y\n } = computeCoordsFromPlacement(rects, statefulPlacement, rtl));\n }\n i = -1;\n }\n }\n return {\n x,\n y,\n placement: statefulPlacement,\n strategy,\n middlewareData\n };\n};\n\n/**\n * Resolves with an object of overflow side offsets that determine how much the\n * element is overflowing a given clipping boundary on each side.\n * - positive = overflowing the boundary by that number of pixels\n * - negative = how many pixels left before it will overflow\n * - 0 = lies flush with the boundary\n * @see https://floating-ui.com/docs/detectOverflow\n */\nasync function detectOverflow(state, options) {\n var _await$platform$isEle;\n if (options === void 0) {\n options = {};\n }\n const {\n x,\n y,\n platform,\n rects,\n elements,\n strategy\n } = state;\n const {\n boundary = 'clippingAncestors',\n rootBoundary = 'viewport',\n elementContext = 'floating',\n altBoundary = false,\n padding = 0\n } = evaluate(options, state);\n const paddingObject = getPaddingObject(padding);\n const altContext = elementContext === 'floating' ? 'reference' : 'floating';\n const element = elements[altBoundary ? altContext : elementContext];\n const clippingClientRect = rectToClientRect(await platform.getClippingRect({\n element: ((_await$platform$isEle = await (platform.isElement == null ? void 0 : platform.isElement(element))) != null ? _await$platform$isEle : true) ? element : element.contextElement || (await (platform.getDocumentElement == null ? void 0 : platform.getDocumentElement(elements.floating))),\n boundary,\n rootBoundary,\n strategy\n }));\n const rect = elementContext === 'floating' ? {\n x,\n y,\n width: rects.floating.width,\n height: rects.floating.height\n } : rects.reference;\n const offsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(elements.floating));\n const offsetScale = (await (platform.isElement == null ? void 0 : platform.isElement(offsetParent))) ? (await (platform.getScale == null ? void 0 : platform.getScale(offsetParent))) || {\n x: 1,\n y: 1\n } : {\n x: 1,\n y: 1\n };\n const elementClientRect = rectToClientRect(platform.convertOffsetParentRelativeRectToViewportRelativeRect ? await platform.convertOffsetParentRelativeRectToViewportRelativeRect({\n elements,\n rect,\n offsetParent,\n strategy\n }) : rect);\n return {\n top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,\n bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,\n left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,\n right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x\n };\n}\n\n/**\n * Provides data to position an inner element of the floating element so that it\n * appears centered to the reference element.\n * @see https://floating-ui.com/docs/arrow\n */\nconst arrow = options => ({\n name: 'arrow',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n platform,\n elements,\n middlewareData\n } = state;\n // Since `element` is required, we don't Partial<> the type.\n const {\n element,\n padding = 0\n } = evaluate(options, state) || {};\n if (element == null) {\n return {};\n }\n const paddingObject = getPaddingObject(padding);\n const coords = {\n x,\n y\n };\n const axis = getAlignmentAxis(placement);\n const length = getAxisLength(axis);\n const arrowDimensions = await platform.getDimensions(element);\n const isYAxis = axis === 'y';\n const minProp = isYAxis ? 'top' : 'left';\n const maxProp = isYAxis ? 'bottom' : 'right';\n const clientProp = isYAxis ? 'clientHeight' : 'clientWidth';\n const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];\n const startDiff = coords[axis] - rects.reference[axis];\n const arrowOffsetParent = await (platform.getOffsetParent == null ? void 0 : platform.getOffsetParent(element));\n let clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;\n\n // DOM platform can return `window` as the `offsetParent`.\n if (!clientSize || !(await (platform.isElement == null ? void 0 : platform.isElement(arrowOffsetParent)))) {\n clientSize = elements.floating[clientProp] || rects.floating[length];\n }\n const centerToReference = endDiff / 2 - startDiff / 2;\n\n // If the padding is large enough that it causes the arrow to no longer be\n // centered, modify the padding so that it is centered.\n const largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;\n const minPadding = min(paddingObject[minProp], largestPossiblePadding);\n const maxPadding = min(paddingObject[maxProp], largestPossiblePadding);\n\n // Make sure the arrow doesn't overflow the floating element if the center\n // point is outside the floating element's bounds.\n const min$1 = minPadding;\n const max = clientSize - arrowDimensions[length] - maxPadding;\n const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;\n const offset = clamp(min$1, center, max);\n\n // If the reference is small enough that the arrow's padding causes it to\n // to point to nothing for an aligned placement, adjust the offset of the\n // floating element itself. To ensure `shift()` continues to take action,\n // a single reset is performed when this is true.\n const shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;\n const alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max : 0;\n return {\n [axis]: coords[axis] + alignmentOffset,\n data: {\n [axis]: offset,\n centerOffset: center - offset - alignmentOffset,\n ...(shouldAddOffset && {\n alignmentOffset\n })\n },\n reset: shouldAddOffset\n };\n }\n});\n\nfunction getPlacementList(alignment, autoAlignment, allowedPlacements) {\n const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter(placement => getAlignment(placement) === alignment), ...allowedPlacements.filter(placement => getAlignment(placement) !== alignment)] : allowedPlacements.filter(placement => getSide(placement) === placement);\n return allowedPlacementsSortedByAlignment.filter(placement => {\n if (alignment) {\n return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);\n }\n return true;\n });\n}\n/**\n * Optimizes the visibility of the floating element by choosing the placement\n * that has the most space available automatically, without needing to specify a\n * preferred placement. Alternative to `flip`.\n * @see https://floating-ui.com/docs/autoPlacement\n */\nconst autoPlacement = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'autoPlacement',\n options,\n async fn(state) {\n var _middlewareData$autoP, _middlewareData$autoP2, _placementsThatFitOnE;\n const {\n rects,\n middlewareData,\n placement,\n platform,\n elements\n } = state;\n const {\n crossAxis = false,\n alignment,\n allowedPlacements = placements,\n autoAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n const placements$1 = alignment !== undefined || allowedPlacements === placements ? getPlacementList(alignment || null, autoAlignment, allowedPlacements) : allowedPlacements;\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const currentIndex = ((_middlewareData$autoP = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP.index) || 0;\n const currentPlacement = placements$1[currentIndex];\n if (currentPlacement == null) {\n return {};\n }\n const alignmentSides = getAlignmentSides(currentPlacement, rects, await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating)));\n\n // Make `computeCoords` start from the right place.\n if (placement !== currentPlacement) {\n return {\n reset: {\n placement: placements$1[0]\n }\n };\n }\n const currentOverflows = [overflow[getSide(currentPlacement)], overflow[alignmentSides[0]], overflow[alignmentSides[1]]];\n const allOverflows = [...(((_middlewareData$autoP2 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP2.overflows) || []), {\n placement: currentPlacement,\n overflows: currentOverflows\n }];\n const nextPlacement = placements$1[currentIndex + 1];\n\n // There are more placements to check.\n if (nextPlacement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n const placementsSortedByMostSpace = allOverflows.map(d => {\n const alignment = getAlignment(d.placement);\n return [d.placement, alignment && crossAxis ?\n // Check along the mainAxis and main crossAxis side.\n d.overflows.slice(0, 2).reduce((acc, v) => acc + v, 0) :\n // Check only the mainAxis.\n d.overflows[0], d.overflows];\n }).sort((a, b) => a[1] - b[1]);\n const placementsThatFitOnEachSide = placementsSortedByMostSpace.filter(d => d[2].slice(0,\n // Aligned placements should not check their opposite crossAxis\n // side.\n getAlignment(d[0]) ? 2 : 3).every(v => v <= 0));\n const resetPlacement = ((_placementsThatFitOnE = placementsThatFitOnEachSide[0]) == null ? void 0 : _placementsThatFitOnE[0]) || placementsSortedByMostSpace[0][0];\n if (resetPlacement !== placement) {\n return {\n data: {\n index: currentIndex + 1,\n overflows: allOverflows\n },\n reset: {\n placement: resetPlacement\n }\n };\n }\n return {};\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by flipping the `placement`\n * in order to keep it in view when the preferred placement(s) will overflow the\n * clipping boundary. Alternative to `autoPlacement`.\n * @see https://floating-ui.com/docs/flip\n */\nconst flip = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'flip',\n options,\n async fn(state) {\n var _middlewareData$arrow, _middlewareData$flip;\n const {\n placement,\n middlewareData,\n rects,\n initialPlacement,\n platform,\n elements\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true,\n fallbackPlacements: specifiedFallbackPlacements,\n fallbackStrategy = 'bestFit',\n fallbackAxisSideDirection = 'none',\n flipAlignment = true,\n ...detectOverflowOptions\n } = evaluate(options, state);\n\n // If a reset by the arrow was caused due to an alignment offset being\n // added, we should skip any logic now since `flip()` has already done its\n // work.\n // https://github.com/floating-ui/floating-ui/issues/2549#issuecomment-1719601643\n if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n const side = getSide(placement);\n const initialSideAxis = getSideAxis(initialPlacement);\n const isBasePlacement = getSide(initialPlacement) === initialPlacement;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));\n const hasFallbackAxisSideDirection = fallbackAxisSideDirection !== 'none';\n if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {\n fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));\n }\n const placements = [initialPlacement, ...fallbackPlacements];\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const overflows = [];\n let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];\n if (checkMainAxis) {\n overflows.push(overflow[side]);\n }\n if (checkCrossAxis) {\n const sides = getAlignmentSides(placement, rects, rtl);\n overflows.push(overflow[sides[0]], overflow[sides[1]]);\n }\n overflowsData = [...overflowsData, {\n placement,\n overflows\n }];\n\n // One or more sides is overflowing.\n if (!overflows.every(side => side <= 0)) {\n var _middlewareData$flip2, _overflowsData$filter;\n const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;\n const nextPlacement = placements[nextIndex];\n if (nextPlacement) {\n // Try next placement and re-run the lifecycle.\n return {\n data: {\n index: nextIndex,\n overflows: overflowsData\n },\n reset: {\n placement: nextPlacement\n }\n };\n }\n\n // First, find the candidates that fit on the mainAxis side of overflow,\n // then find the placement that fits the best on the main crossAxis side.\n let resetPlacement = (_overflowsData$filter = overflowsData.filter(d => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;\n\n // Otherwise fallback.\n if (!resetPlacement) {\n switch (fallbackStrategy) {\n case 'bestFit':\n {\n var _overflowsData$filter2;\n const placement = (_overflowsData$filter2 = overflowsData.filter(d => {\n if (hasFallbackAxisSideDirection) {\n const currentSideAxis = getSideAxis(d.placement);\n return currentSideAxis === initialSideAxis ||\n // Create a bias to the `y` side axis due to horizontal\n // reading directions favoring greater width.\n currentSideAxis === 'y';\n }\n return true;\n }).map(d => [d.placement, d.overflows.filter(overflow => overflow > 0).reduce((acc, overflow) => acc + overflow, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$filter2[0];\n if (placement) {\n resetPlacement = placement;\n }\n break;\n }\n case 'initialPlacement':\n resetPlacement = initialPlacement;\n break;\n }\n }\n if (placement !== resetPlacement) {\n return {\n reset: {\n placement: resetPlacement\n }\n };\n }\n }\n return {};\n }\n };\n};\n\nfunction getSideOffsets(overflow, rect) {\n return {\n top: overflow.top - rect.height,\n right: overflow.right - rect.width,\n bottom: overflow.bottom - rect.height,\n left: overflow.left - rect.width\n };\n}\nfunction isAnySideFullyClipped(overflow) {\n return sides.some(side => overflow[side] >= 0);\n}\n/**\n * Provides data to hide the floating element in applicable situations, such as\n * when it is not in the same clipping context as the reference element.\n * @see https://floating-ui.com/docs/hide\n */\nconst hide = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'hide',\n options,\n async fn(state) {\n const {\n rects\n } = state;\n const {\n strategy = 'referenceHidden',\n ...detectOverflowOptions\n } = evaluate(options, state);\n switch (strategy) {\n case 'referenceHidden':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n elementContext: 'reference'\n });\n const offsets = getSideOffsets(overflow, rects.reference);\n return {\n data: {\n referenceHiddenOffsets: offsets,\n referenceHidden: isAnySideFullyClipped(offsets)\n }\n };\n }\n case 'escaped':\n {\n const overflow = await detectOverflow(state, {\n ...detectOverflowOptions,\n altBoundary: true\n });\n const offsets = getSideOffsets(overflow, rects.floating);\n return {\n data: {\n escapedOffsets: offsets,\n escaped: isAnySideFullyClipped(offsets)\n }\n };\n }\n default:\n {\n return {};\n }\n }\n }\n };\n};\n\nfunction getBoundingRect(rects) {\n const minX = min(...rects.map(rect => rect.left));\n const minY = min(...rects.map(rect => rect.top));\n const maxX = max(...rects.map(rect => rect.right));\n const maxY = max(...rects.map(rect => rect.bottom));\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY\n };\n}\nfunction getRectsByLine(rects) {\n const sortedRects = rects.slice().sort((a, b) => a.y - b.y);\n const groups = [];\n let prevRect = null;\n for (let i = 0; i < sortedRects.length; i++) {\n const rect = sortedRects[i];\n if (!prevRect || rect.y - prevRect.y > prevRect.height / 2) {\n groups.push([rect]);\n } else {\n groups[groups.length - 1].push(rect);\n }\n prevRect = rect;\n }\n return groups.map(rect => rectToClientRect(getBoundingRect(rect)));\n}\n/**\n * Provides improved positioning for inline reference elements that can span\n * over multiple lines, such as hyperlinks or range selections.\n * @see https://floating-ui.com/docs/inline\n */\nconst inline = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'inline',\n options,\n async fn(state) {\n const {\n placement,\n elements,\n rects,\n platform,\n strategy\n } = state;\n // A MouseEvent's client{X,Y} coords can be up to 2 pixels off a\n // ClientRect's bounds, despite the event listener being triggered. A\n // padding of 2 seems to handle this issue.\n const {\n padding = 2,\n x,\n y\n } = evaluate(options, state);\n const nativeClientRects = Array.from((await (platform.getClientRects == null ? void 0 : platform.getClientRects(elements.reference))) || []);\n const clientRects = getRectsByLine(nativeClientRects);\n const fallback = rectToClientRect(getBoundingRect(nativeClientRects));\n const paddingObject = getPaddingObject(padding);\n function getBoundingClientRect() {\n // There are two rects and they are disjoined.\n if (clientRects.length === 2 && clientRects[0].left > clientRects[1].right && x != null && y != null) {\n // Find the first rect in which the point is fully inside.\n return clientRects.find(rect => x > rect.left - paddingObject.left && x < rect.right + paddingObject.right && y > rect.top - paddingObject.top && y < rect.bottom + paddingObject.bottom) || fallback;\n }\n\n // There are 2 or more connected rects.\n if (clientRects.length >= 2) {\n if (getSideAxis(placement) === 'y') {\n const firstRect = clientRects[0];\n const lastRect = clientRects[clientRects.length - 1];\n const isTop = getSide(placement) === 'top';\n const top = firstRect.top;\n const bottom = lastRect.bottom;\n const left = isTop ? firstRect.left : lastRect.left;\n const right = isTop ? firstRect.right : lastRect.right;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n const isLeftSide = getSide(placement) === 'left';\n const maxRight = max(...clientRects.map(rect => rect.right));\n const minLeft = min(...clientRects.map(rect => rect.left));\n const measureRects = clientRects.filter(rect => isLeftSide ? rect.left === minLeft : rect.right === maxRight);\n const top = measureRects[0].top;\n const bottom = measureRects[measureRects.length - 1].bottom;\n const left = minLeft;\n const right = maxRight;\n const width = right - left;\n const height = bottom - top;\n return {\n top,\n bottom,\n left,\n right,\n width,\n height,\n x: left,\n y: top\n };\n }\n return fallback;\n }\n const resetRects = await platform.getElementRects({\n reference: {\n getBoundingClientRect\n },\n floating: elements.floating,\n strategy\n });\n if (rects.reference.x !== resetRects.reference.x || rects.reference.y !== resetRects.reference.y || rects.reference.width !== resetRects.reference.width || rects.reference.height !== resetRects.reference.height) {\n return {\n reset: {\n rects: resetRects\n }\n };\n }\n return {};\n }\n };\n};\n\n// For type backwards-compatibility, the `OffsetOptions` type was also\n// Derivable.\n\nasync function convertValueToCoords(state, options) {\n const {\n placement,\n platform,\n elements\n } = state;\n const rtl = await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating));\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isVertical = getSideAxis(placement) === 'y';\n const mainAxisMulti = ['left', 'top'].includes(side) ? -1 : 1;\n const crossAxisMulti = rtl && isVertical ? -1 : 1;\n const rawValue = evaluate(options, state);\n\n // eslint-disable-next-line prefer-const\n let {\n mainAxis,\n crossAxis,\n alignmentAxis\n } = typeof rawValue === 'number' ? {\n mainAxis: rawValue,\n crossAxis: 0,\n alignmentAxis: null\n } : {\n mainAxis: rawValue.mainAxis || 0,\n crossAxis: rawValue.crossAxis || 0,\n alignmentAxis: rawValue.alignmentAxis\n };\n if (alignment && typeof alignmentAxis === 'number') {\n crossAxis = alignment === 'end' ? alignmentAxis * -1 : alignmentAxis;\n }\n return isVertical ? {\n x: crossAxis * crossAxisMulti,\n y: mainAxis * mainAxisMulti\n } : {\n x: mainAxis * mainAxisMulti,\n y: crossAxis * crossAxisMulti\n };\n}\n\n/**\n * Modifies the placement by translating the floating element along the\n * specified axes.\n * A number (shorthand for `mainAxis` or distance), or an axes configuration\n * object may be passed.\n * @see https://floating-ui.com/docs/offset\n */\nconst offset = function (options) {\n if (options === void 0) {\n options = 0;\n }\n return {\n name: 'offset',\n options,\n async fn(state) {\n var _middlewareData$offse, _middlewareData$arrow;\n const {\n x,\n y,\n placement,\n middlewareData\n } = state;\n const diffCoords = await convertValueToCoords(state, options);\n\n // If the placement is the same and the arrow caused an alignment offset\n // then we don't need to change the positioning coordinates.\n if (placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {\n return {};\n }\n return {\n x: x + diffCoords.x,\n y: y + diffCoords.y,\n data: {\n ...diffCoords,\n placement\n }\n };\n }\n };\n};\n\n/**\n * Optimizes the visibility of the floating element by shifting it in order to\n * keep it in view when it will overflow the clipping boundary.\n * @see https://floating-ui.com/docs/shift\n */\nconst shift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'shift',\n options,\n async fn(state) {\n const {\n x,\n y,\n placement\n } = state;\n const {\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = false,\n limiter = {\n fn: _ref => {\n let {\n x,\n y\n } = _ref;\n return {\n x,\n y\n };\n }\n },\n ...detectOverflowOptions\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const crossAxis = getSideAxis(getSide(placement));\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n if (checkMainAxis) {\n const minSide = mainAxis === 'y' ? 'top' : 'left';\n const maxSide = mainAxis === 'y' ? 'bottom' : 'right';\n const min = mainAxisCoord + overflow[minSide];\n const max = mainAxisCoord - overflow[maxSide];\n mainAxisCoord = clamp(min, mainAxisCoord, max);\n }\n if (checkCrossAxis) {\n const minSide = crossAxis === 'y' ? 'top' : 'left';\n const maxSide = crossAxis === 'y' ? 'bottom' : 'right';\n const min = crossAxisCoord + overflow[minSide];\n const max = crossAxisCoord - overflow[maxSide];\n crossAxisCoord = clamp(min, crossAxisCoord, max);\n }\n const limitedCoords = limiter.fn({\n ...state,\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n });\n return {\n ...limitedCoords,\n data: {\n x: limitedCoords.x - x,\n y: limitedCoords.y - y,\n enabled: {\n [mainAxis]: checkMainAxis,\n [crossAxis]: checkCrossAxis\n }\n }\n };\n }\n };\n};\n/**\n * Built-in `limiter` that will stop `shift()` at a certain point.\n */\nconst limitShift = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n options,\n fn(state) {\n const {\n x,\n y,\n placement,\n rects,\n middlewareData\n } = state;\n const {\n offset = 0,\n mainAxis: checkMainAxis = true,\n crossAxis: checkCrossAxis = true\n } = evaluate(options, state);\n const coords = {\n x,\n y\n };\n const crossAxis = getSideAxis(placement);\n const mainAxis = getOppositeAxis(crossAxis);\n let mainAxisCoord = coords[mainAxis];\n let crossAxisCoord = coords[crossAxis];\n const rawOffset = evaluate(offset, state);\n const computedOffset = typeof rawOffset === 'number' ? {\n mainAxis: rawOffset,\n crossAxis: 0\n } : {\n mainAxis: 0,\n crossAxis: 0,\n ...rawOffset\n };\n if (checkMainAxis) {\n const len = mainAxis === 'y' ? 'height' : 'width';\n const limitMin = rects.reference[mainAxis] - rects.floating[len] + computedOffset.mainAxis;\n const limitMax = rects.reference[mainAxis] + rects.reference[len] - computedOffset.mainAxis;\n if (mainAxisCoord < limitMin) {\n mainAxisCoord = limitMin;\n } else if (mainAxisCoord > limitMax) {\n mainAxisCoord = limitMax;\n }\n }\n if (checkCrossAxis) {\n var _middlewareData$offse, _middlewareData$offse2;\n const len = mainAxis === 'y' ? 'width' : 'height';\n const isOriginSide = ['top', 'left'].includes(getSide(placement));\n const limitMin = rects.reference[crossAxis] - rects.floating[len] + (isOriginSide ? ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse[crossAxis]) || 0 : 0) + (isOriginSide ? 0 : computedOffset.crossAxis);\n const limitMax = rects.reference[crossAxis] + rects.reference[len] + (isOriginSide ? 0 : ((_middlewareData$offse2 = middlewareData.offset) == null ? void 0 : _middlewareData$offse2[crossAxis]) || 0) - (isOriginSide ? computedOffset.crossAxis : 0);\n if (crossAxisCoord < limitMin) {\n crossAxisCoord = limitMin;\n } else if (crossAxisCoord > limitMax) {\n crossAxisCoord = limitMax;\n }\n }\n return {\n [mainAxis]: mainAxisCoord,\n [crossAxis]: crossAxisCoord\n };\n }\n };\n};\n\n/**\n * Provides data that allows you to change the size of the floating element —\n * for instance, prevent it from overflowing the clipping boundary or match the\n * width of the reference element.\n * @see https://floating-ui.com/docs/size\n */\nconst size = function (options) {\n if (options === void 0) {\n options = {};\n }\n return {\n name: 'size',\n options,\n async fn(state) {\n var _state$middlewareData, _state$middlewareData2;\n const {\n placement,\n rects,\n platform,\n elements\n } = state;\n const {\n apply = () => {},\n ...detectOverflowOptions\n } = evaluate(options, state);\n const overflow = await detectOverflow(state, detectOverflowOptions);\n const side = getSide(placement);\n const alignment = getAlignment(placement);\n const isYAxis = getSideAxis(placement) === 'y';\n const {\n width,\n height\n } = rects.floating;\n let heightSide;\n let widthSide;\n if (side === 'top' || side === 'bottom') {\n heightSide = side;\n widthSide = alignment === ((await (platform.isRTL == null ? void 0 : platform.isRTL(elements.floating))) ? 'start' : 'end') ? 'left' : 'right';\n } else {\n widthSide = side;\n heightSide = alignment === 'end' ? 'top' : 'bottom';\n }\n const maximumClippingHeight = height - overflow.top - overflow.bottom;\n const maximumClippingWidth = width - overflow.left - overflow.right;\n const overflowAvailableHeight = min(height - overflow[heightSide], maximumClippingHeight);\n const overflowAvailableWidth = min(width - overflow[widthSide], maximumClippingWidth);\n const noShift = !state.middlewareData.shift;\n let availableHeight = overflowAvailableHeight;\n let availableWidth = overflowAvailableWidth;\n if ((_state$middlewareData = state.middlewareData.shift) != null && _state$middlewareData.enabled.x) {\n availableWidth = maximumClippingWidth;\n }\n if ((_state$middlewareData2 = state.middlewareData.shift) != null && _state$middlewareData2.enabled.y) {\n availableHeight = maximumClippingHeight;\n }\n if (noShift && !alignment) {\n const xMin = max(overflow.left, 0);\n const xMax = max(overflow.right, 0);\n const yMin = max(overflow.top, 0);\n const yMax = max(overflow.bottom, 0);\n if (isYAxis) {\n availableWidth = width - 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max(overflow.left, overflow.right));\n } else {\n availableHeight = height - 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max(overflow.top, overflow.bottom));\n }\n }\n await apply({\n ...state,\n availableWidth,\n availableHeight\n });\n const nextDimensions = await platform.getDimensions(elements.floating);\n if (width !== nextDimensions.width || height !== nextDimensions.height) {\n return {\n reset: {\n rects: true\n }\n };\n }\n return {};\n }\n };\n};\n\nexport { arrow, autoPlacement, computePosition, detectOverflow, flip, hide, inline, limitShift, offset, shift, size };\n","function hasWindow() {\n return typeof window !== 'undefined';\n}\nfunction getNodeName(node) {\n if (isNode(node)) {\n return (node.nodeName || '').toLowerCase();\n }\n // Mocked nodes in testing environments may not be instances of Node. By\n // returning `#document` an infinite loop won't occur.\n // https://github.com/floating-ui/floating-ui/issues/2317\n return '#document';\n}\nfunction getWindow(node) {\n var _node$ownerDocument;\n return (node == null || (_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.defaultView) || window;\n}\nfunction getDocumentElement(node) {\n var _ref;\n return (_ref = (isNode(node) ? node.ownerDocument : node.document) || window.document) == null ? void 0 : _ref.documentElement;\n}\nfunction isNode(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Node || value instanceof getWindow(value).Node;\n}\nfunction isElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof Element || value instanceof getWindow(value).Element;\n}\nfunction isHTMLElement(value) {\n if (!hasWindow()) {\n return false;\n }\n return value instanceof HTMLElement || value instanceof getWindow(value).HTMLElement;\n}\nfunction isShadowRoot(value) {\n if (!hasWindow() || typeof ShadowRoot === 'undefined') {\n return false;\n }\n return value instanceof ShadowRoot || value instanceof getWindow(value).ShadowRoot;\n}\nfunction isOverflowElement(element) {\n const {\n overflow,\n overflowX,\n overflowY,\n display\n } = getComputedStyle(element);\n return /auto|scroll|overlay|hidden|clip/.test(overflow + overflowY + overflowX) && !['inline', 'contents'].includes(display);\n}\nfunction isTableElement(element) {\n return ['table', 'td', 'th'].includes(getNodeName(element));\n}\nfunction isTopLayer(element) {\n return [':popover-open', ':modal'].some(selector => {\n try {\n return element.matches(selector);\n } catch (e) {\n return false;\n }\n });\n}\nfunction isContainingBlock(elementOrCss) {\n const webkit = isWebKit();\n const css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n // https://drafts.csswg.org/css-transforms-2/#individual-transforms\n return ['transform', 'translate', 'scale', 'rotate', 'perspective'].some(value => css[value] ? css[value] !== 'none' : false) || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', 'translate', 'scale', 'rotate', 'perspective', 'filter'].some(value => (css.willChange || '').includes(value)) || ['paint', 'layout', 'strict', 'content'].some(value => (css.contain || '').includes(value));\n}\nfunction getContainingBlock(element) {\n let currentNode = getParentNode(element);\n while (isHTMLElement(currentNode) && !isLastTraversableNode(currentNode)) {\n if (isContainingBlock(currentNode)) {\n return currentNode;\n } else if (isTopLayer(currentNode)) {\n return null;\n }\n currentNode = getParentNode(currentNode);\n }\n return null;\n}\nfunction isWebKit() {\n if (typeof CSS === 'undefined' || !CSS.supports) return false;\n return CSS.supports('-webkit-backdrop-filter', 'none');\n}\nfunction isLastTraversableNode(node) {\n return ['html', 'body', '#document'].includes(getNodeName(node));\n}\nfunction getComputedStyle(element) {\n return getWindow(element).getComputedStyle(element);\n}\nfunction getNodeScroll(element) {\n if (isElement(element)) {\n return {\n scrollLeft: element.scrollLeft,\n scrollTop: element.scrollTop\n };\n }\n return {\n scrollLeft: element.scrollX,\n scrollTop: element.scrollY\n };\n}\nfunction getParentNode(node) {\n if (getNodeName(node) === 'html') {\n return node;\n }\n const result =\n // Step into the shadow DOM of the parent of a slotted node.\n node.assignedSlot ||\n // DOM Element detected.\n node.parentNode ||\n // ShadowRoot detected.\n isShadowRoot(node) && node.host ||\n // Fallback.\n getDocumentElement(node);\n return isShadowRoot(result) ? result.host : result;\n}\nfunction getNearestOverflowAncestor(node) {\n const parentNode = getParentNode(node);\n if (isLastTraversableNode(parentNode)) {\n return node.ownerDocument ? node.ownerDocument.body : node.body;\n }\n if (isHTMLElement(parentNode) && isOverflowElement(parentNode)) {\n return parentNode;\n }\n return getNearestOverflowAncestor(parentNode);\n}\nfunction getOverflowAncestors(node, list, traverseIframes) {\n var _node$ownerDocument2;\n if (list === void 0) {\n list = [];\n }\n if (traverseIframes === void 0) {\n traverseIframes = true;\n }\n const scrollableAncestor = getNearestOverflowAncestor(node);\n const isBody = scrollableAncestor === ((_node$ownerDocument2 = node.ownerDocument) == null ? void 0 : _node$ownerDocument2.body);\n const win = getWindow(scrollableAncestor);\n if (isBody) {\n const frameElement = getFrameElement(win);\n return list.concat(win, win.visualViewport || [], isOverflowElement(scrollableAncestor) ? scrollableAncestor : [], frameElement && traverseIframes ? getOverflowAncestors(frameElement) : []);\n }\n return list.concat(scrollableAncestor, getOverflowAncestors(scrollableAncestor, [], traverseIframes));\n}\nfunction getFrameElement(win) {\n return win.parent && Object.getPrototypeOf(win.parent) ? win.frameElement : null;\n}\n\nexport { getComputedStyle, getContainingBlock, getDocumentElement, getFrameElement, getNearestOverflowAncestor, getNodeName, getNodeScroll, getOverflowAncestors, getParentNode, getWindow, isContainingBlock, isElement, isHTMLElement, isLastTraversableNode, isNode, isOverflowElement, isShadowRoot, isTableElement, isTopLayer, isWebKit };\n","import { rectToClientRect, detectOverflow as detectOverflow$1, offset as offset$1, autoPlacement as autoPlacement$1, shift as shift$1, flip as flip$1, size as size$1, hide as hide$1, arrow as arrow$1, inline as inline$1, limitShift as limitShift$1, computePosition as computePosition$1 } from '@floating-ui/core';\nimport { round, createCoords, max, min, floor } from '@floating-ui/utils';\nimport { getComputedStyle, isHTMLElement, isElement, getWindow, isWebKit, getFrameElement, getNodeScroll, getDocumentElement, isTopLayer, getNodeName, isOverflowElement, getOverflowAncestors, getParentNode, isLastTraversableNode, isContainingBlock, isTableElement, getContainingBlock } from '@floating-ui/utils/dom';\nexport { getOverflowAncestors } from '@floating-ui/utils/dom';\n\nfunction getCssDimensions(element) {\n const css = getComputedStyle(element);\n // In testing environments, the `width` and `height` properties are empty\n // strings for SVG elements, returning NaN. Fallback to `0` in this case.\n let width = parseFloat(css.width) || 0;\n let height = parseFloat(css.height) || 0;\n const hasOffset = isHTMLElement(element);\n const offsetWidth = hasOffset ? element.offsetWidth : width;\n const offsetHeight = hasOffset ? element.offsetHeight : height;\n const shouldFallback = round(width) !== offsetWidth || round(height) !== offsetHeight;\n if (shouldFallback) {\n width = offsetWidth;\n height = offsetHeight;\n }\n return {\n width,\n height,\n $: shouldFallback\n };\n}\n\nfunction unwrapElement(element) {\n return !isElement(element) ? element.contextElement : element;\n}\n\nfunction getScale(element) {\n const domElement = unwrapElement(element);\n if (!isHTMLElement(domElement)) {\n return createCoords(1);\n }\n const rect = domElement.getBoundingClientRect();\n const {\n width,\n height,\n $\n } = getCssDimensions(domElement);\n let x = ($ ? round(rect.width) : rect.width) / width;\n let y = ($ ? round(rect.height) : rect.height) / height;\n\n // 0, NaN, or Infinity should always fallback to 1.\n\n if (!x || !Number.isFinite(x)) {\n x = 1;\n }\n if (!y || !Number.isFinite(y)) {\n y = 1;\n }\n return {\n x,\n y\n };\n}\n\nconst noOffsets = /*#__PURE__*/createCoords(0);\nfunction getVisualOffsets(element) {\n const win = getWindow(element);\n if (!isWebKit() || !win.visualViewport) {\n return noOffsets;\n }\n return {\n x: win.visualViewport.offsetLeft,\n y: win.visualViewport.offsetTop\n };\n}\nfunction shouldAddVisualOffsets(element, isFixed, floatingOffsetParent) {\n if (isFixed === void 0) {\n isFixed = false;\n }\n if (!floatingOffsetParent || isFixed && floatingOffsetParent !== getWindow(element)) {\n return false;\n }\n return isFixed;\n}\n\nfunction getBoundingClientRect(element, includeScale, isFixedStrategy, offsetParent) {\n if (includeScale === void 0) {\n includeScale = false;\n }\n if (isFixedStrategy === void 0) {\n isFixedStrategy = false;\n }\n const clientRect = element.getBoundingClientRect();\n const domElement = unwrapElement(element);\n let scale = createCoords(1);\n if (includeScale) {\n if (offsetParent) {\n if (isElement(offsetParent)) {\n scale = getScale(offsetParent);\n }\n } else {\n scale = getScale(element);\n }\n }\n const visualOffsets = shouldAddVisualOffsets(domElement, isFixedStrategy, offsetParent) ? getVisualOffsets(domElement) : createCoords(0);\n let x = (clientRect.left + visualOffsets.x) / scale.x;\n let y = (clientRect.top + visualOffsets.y) / scale.y;\n let width = clientRect.width / scale.x;\n let height = clientRect.height / scale.y;\n if (domElement) {\n const win = getWindow(domElement);\n const offsetWin = offsetParent && isElement(offsetParent) ? getWindow(offsetParent) : offsetParent;\n let currentWin = win;\n let currentIFrame = getFrameElement(currentWin);\n while (currentIFrame && offsetParent && offsetWin !== currentWin) {\n const iframeScale = getScale(currentIFrame);\n const iframeRect = currentIFrame.getBoundingClientRect();\n const css = getComputedStyle(currentIFrame);\n const left = iframeRect.left + (currentIFrame.clientLeft + parseFloat(css.paddingLeft)) * iframeScale.x;\n const top = iframeRect.top + (currentIFrame.clientTop + parseFloat(css.paddingTop)) * iframeScale.y;\n x *= iframeScale.x;\n y *= iframeScale.y;\n width *= iframeScale.x;\n height *= iframeScale.y;\n x += left;\n y += top;\n currentWin = getWindow(currentIFrame);\n currentIFrame = getFrameElement(currentWin);\n }\n }\n return rectToClientRect({\n width,\n height,\n x,\n y\n });\n}\n\n// If has a CSS width greater than the viewport, then this will be\n// incorrect for RTL.\nfunction getWindowScrollBarX(element, rect) {\n const leftScroll = getNodeScroll(element).scrollLeft;\n if (!rect) {\n return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;\n }\n return rect.left + leftScroll;\n}\n\nfunction getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {\n if (ignoreScrollbarX === void 0) {\n ignoreScrollbarX = false;\n }\n const htmlRect = documentElement.getBoundingClientRect();\n const x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 :\n // RTL scrollbar.\n getWindowScrollBarX(documentElement, htmlRect));\n const y = htmlRect.top + scroll.scrollTop;\n return {\n x,\n y\n };\n}\n\nfunction convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {\n let {\n elements,\n rect,\n offsetParent,\n strategy\n } = _ref;\n const isFixed = strategy === 'fixed';\n const documentElement = getDocumentElement(offsetParent);\n const topLayer = elements ? isTopLayer(elements.floating) : false;\n if (offsetParent === documentElement || topLayer && isFixed) {\n return rect;\n }\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n let scale = createCoords(1);\n const offsets = createCoords(0);\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isHTMLElement(offsetParent)) {\n const offsetRect = getBoundingClientRect(offsetParent);\n scale = getScale(offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);\n return {\n width: rect.width * scale.x,\n height: rect.height * scale.y,\n x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,\n y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y\n };\n}\n\nfunction getClientRects(element) {\n return Array.from(element.getClientRects());\n}\n\n// Gets the entire size of the scrollable document area, even extending outside\n// of the `` and `` rect bounds if horizontally scrollable.\nfunction getDocumentRect(element) {\n const html = getDocumentElement(element);\n const scroll = getNodeScroll(element);\n const body = element.ownerDocument.body;\n const width = max(html.scrollWidth, html.clientWidth, body.scrollWidth, body.clientWidth);\n const height = max(html.scrollHeight, html.clientHeight, body.scrollHeight, body.clientHeight);\n let x = -scroll.scrollLeft + getWindowScrollBarX(element);\n const y = -scroll.scrollTop;\n if (getComputedStyle(body).direction === 'rtl') {\n x += max(html.clientWidth, body.clientWidth) - width;\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\nfunction getViewportRect(element, strategy) {\n const win = getWindow(element);\n const html = getDocumentElement(element);\n const visualViewport = win.visualViewport;\n let width = html.clientWidth;\n let height = html.clientHeight;\n let x = 0;\n let y = 0;\n if (visualViewport) {\n width = visualViewport.width;\n height = visualViewport.height;\n const visualViewportBased = isWebKit();\n if (!visualViewportBased || visualViewportBased && strategy === 'fixed') {\n x = visualViewport.offsetLeft;\n y = visualViewport.offsetTop;\n }\n }\n return {\n width,\n height,\n x,\n y\n };\n}\n\n// Returns the inner client rect, subtracting scrollbars if present.\nfunction getInnerBoundingClientRect(element, strategy) {\n const clientRect = getBoundingClientRect(element, true, strategy === 'fixed');\n const top = clientRect.top + element.clientTop;\n const left = clientRect.left + element.clientLeft;\n const scale = isHTMLElement(element) ? getScale(element) : createCoords(1);\n const width = element.clientWidth * scale.x;\n const height = element.clientHeight * scale.y;\n const x = left * scale.x;\n const y = top * scale.y;\n return {\n width,\n height,\n x,\n y\n };\n}\nfunction getClientRectFromClippingAncestor(element, clippingAncestor, strategy) {\n let rect;\n if (clippingAncestor === 'viewport') {\n rect = getViewportRect(element, strategy);\n } else if (clippingAncestor === 'document') {\n rect = getDocumentRect(getDocumentElement(element));\n } else if (isElement(clippingAncestor)) {\n rect = getInnerBoundingClientRect(clippingAncestor, strategy);\n } else {\n const visualOffsets = getVisualOffsets(element);\n rect = {\n x: clippingAncestor.x - visualOffsets.x,\n y: clippingAncestor.y - visualOffsets.y,\n width: clippingAncestor.width,\n height: clippingAncestor.height\n };\n }\n return rectToClientRect(rect);\n}\nfunction hasFixedPositionAncestor(element, stopNode) {\n const parentNode = getParentNode(element);\n if (parentNode === stopNode || !isElement(parentNode) || isLastTraversableNode(parentNode)) {\n return false;\n }\n return getComputedStyle(parentNode).position === 'fixed' || hasFixedPositionAncestor(parentNode, stopNode);\n}\n\n// A \"clipping ancestor\" is an `overflow` element with the characteristic of\n// clipping (or hiding) child elements. This returns all clipping ancestors\n// of the given element up the tree.\nfunction getClippingElementAncestors(element, cache) {\n const cachedResult = cache.get(element);\n if (cachedResult) {\n return cachedResult;\n }\n let result = getOverflowAncestors(element, [], false).filter(el => isElement(el) && getNodeName(el) !== 'body');\n let currentContainingBlockComputedStyle = null;\n const elementIsFixed = getComputedStyle(element).position === 'fixed';\n let currentNode = elementIsFixed ? getParentNode(element) : element;\n\n // https://developer.mozilla.org/en-US/docs/Web/CSS/Containing_block#identifying_the_containing_block\n while (isElement(currentNode) && !isLastTraversableNode(currentNode)) {\n const computedStyle = getComputedStyle(currentNode);\n const currentNodeIsContaining = isContainingBlock(currentNode);\n if (!currentNodeIsContaining && computedStyle.position === 'fixed') {\n currentContainingBlockComputedStyle = null;\n }\n const shouldDropCurrentNode = elementIsFixed ? !currentNodeIsContaining && !currentContainingBlockComputedStyle : !currentNodeIsContaining && computedStyle.position === 'static' && !!currentContainingBlockComputedStyle && ['absolute', 'fixed'].includes(currentContainingBlockComputedStyle.position) || isOverflowElement(currentNode) && !currentNodeIsContaining && hasFixedPositionAncestor(element, currentNode);\n if (shouldDropCurrentNode) {\n // Drop non-containing blocks.\n result = result.filter(ancestor => ancestor !== currentNode);\n } else {\n // Record last containing block for next iteration.\n currentContainingBlockComputedStyle = computedStyle;\n }\n currentNode = getParentNode(currentNode);\n }\n cache.set(element, result);\n return result;\n}\n\n// Gets the maximum area that the element is visible in due to any number of\n// clipping ancestors.\nfunction getClippingRect(_ref) {\n let {\n element,\n boundary,\n rootBoundary,\n strategy\n } = _ref;\n const elementClippingAncestors = boundary === 'clippingAncestors' ? isTopLayer(element) ? [] : getClippingElementAncestors(element, this._c) : [].concat(boundary);\n const clippingAncestors = [...elementClippingAncestors, rootBoundary];\n const firstClippingAncestor = clippingAncestors[0];\n const clippingRect = clippingAncestors.reduce((accRect, clippingAncestor) => {\n const rect = getClientRectFromClippingAncestor(element, clippingAncestor, strategy);\n accRect.top = max(rect.top, accRect.top);\n accRect.right = min(rect.right, accRect.right);\n accRect.bottom = min(rect.bottom, accRect.bottom);\n accRect.left = max(rect.left, accRect.left);\n return accRect;\n }, getClientRectFromClippingAncestor(element, firstClippingAncestor, strategy));\n return {\n width: clippingRect.right - clippingRect.left,\n height: clippingRect.bottom - clippingRect.top,\n x: clippingRect.left,\n y: clippingRect.top\n };\n}\n\nfunction getDimensions(element) {\n const {\n width,\n height\n } = getCssDimensions(element);\n return {\n width,\n height\n };\n}\n\nfunction getRectRelativeToOffsetParent(element, offsetParent, strategy) {\n const isOffsetParentAnElement = isHTMLElement(offsetParent);\n const documentElement = getDocumentElement(offsetParent);\n const isFixed = strategy === 'fixed';\n const rect = getBoundingClientRect(element, true, isFixed, offsetParent);\n let scroll = {\n scrollLeft: 0,\n scrollTop: 0\n };\n const offsets = createCoords(0);\n if (isOffsetParentAnElement || !isOffsetParentAnElement && !isFixed) {\n if (getNodeName(offsetParent) !== 'body' || isOverflowElement(documentElement)) {\n scroll = getNodeScroll(offsetParent);\n }\n if (isOffsetParentAnElement) {\n const offsetRect = getBoundingClientRect(offsetParent, true, isFixed, offsetParent);\n offsets.x = offsetRect.x + offsetParent.clientLeft;\n offsets.y = offsetRect.y + offsetParent.clientTop;\n } else if (documentElement) {\n // If the scrollbar appears on the left (e.g. RTL systems). Use\n // Firefox with layout.scrollbar.side = 3 in about:config to test this.\n offsets.x = getWindowScrollBarX(documentElement);\n }\n }\n const htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);\n const x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;\n const y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;\n return {\n x,\n y,\n width: rect.width,\n height: rect.height\n };\n}\n\nfunction isStaticPositioned(element) {\n return getComputedStyle(element).position === 'static';\n}\n\nfunction getTrueOffsetParent(element, polyfill) {\n if (!isHTMLElement(element) || getComputedStyle(element).position === 'fixed') {\n return null;\n }\n if (polyfill) {\n return polyfill(element);\n }\n let rawOffsetParent = element.offsetParent;\n\n // Firefox returns the element as the offsetParent if it's non-static,\n // while Chrome and Safari return the element. The element must\n // be used to perform the correct calculations even if the element is\n // non-static.\n if (getDocumentElement(element) === rawOffsetParent) {\n rawOffsetParent = rawOffsetParent.ownerDocument.body;\n }\n return rawOffsetParent;\n}\n\n// Gets the closest ancestor positioned element. Handles some edge cases,\n// such as table ancestors and cross browser bugs.\nfunction getOffsetParent(element, polyfill) {\n const win = getWindow(element);\n if (isTopLayer(element)) {\n return win;\n }\n if (!isHTMLElement(element)) {\n let svgOffsetParent = getParentNode(element);\n while (svgOffsetParent && !isLastTraversableNode(svgOffsetParent)) {\n if (isElement(svgOffsetParent) && !isStaticPositioned(svgOffsetParent)) {\n return svgOffsetParent;\n }\n svgOffsetParent = getParentNode(svgOffsetParent);\n }\n return win;\n }\n let offsetParent = getTrueOffsetParent(element, polyfill);\n while (offsetParent && isTableElement(offsetParent) && isStaticPositioned(offsetParent)) {\n offsetParent = getTrueOffsetParent(offsetParent, polyfill);\n }\n if (offsetParent && isLastTraversableNode(offsetParent) && isStaticPositioned(offsetParent) && !isContainingBlock(offsetParent)) {\n return win;\n }\n return offsetParent || getContainingBlock(element) || win;\n}\n\nconst getElementRects = async function (data) {\n const getOffsetParentFn = this.getOffsetParent || getOffsetParent;\n const getDimensionsFn = this.getDimensions;\n const floatingDimensions = await getDimensionsFn(data.floating);\n return {\n reference: getRectRelativeToOffsetParent(data.reference, await getOffsetParentFn(data.floating), data.strategy),\n floating: {\n x: 0,\n y: 0,\n width: floatingDimensions.width,\n height: floatingDimensions.height\n }\n };\n};\n\nfunction isRTL(element) {\n return getComputedStyle(element).direction === 'rtl';\n}\n\nconst platform = {\n convertOffsetParentRelativeRectToViewportRelativeRect,\n getDocumentElement,\n getClippingRect,\n getOffsetParent,\n getElementRects,\n getClientRects,\n getDimensions,\n getScale,\n isElement,\n isRTL\n};\n\nfunction rectsAreEqual(a, b) {\n return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;\n}\n\n// https://samthor.au/2021/observing-dom/\nfunction observeMove(element, onMove) {\n let io = null;\n let timeoutId;\n const root = getDocumentElement(element);\n function cleanup() {\n var _io;\n clearTimeout(timeoutId);\n (_io = io) == null || _io.disconnect();\n io = null;\n }\n function refresh(skip, threshold) {\n if (skip === void 0) {\n skip = false;\n }\n if (threshold === void 0) {\n threshold = 1;\n }\n cleanup();\n const elementRectForRootMargin = element.getBoundingClientRect();\n const {\n left,\n top,\n width,\n height\n } = elementRectForRootMargin;\n if (!skip) {\n onMove();\n }\n if (!width || !height) {\n return;\n }\n const insetTop = floor(top);\n const insetRight = floor(root.clientWidth - (left + width));\n const insetBottom = floor(root.clientHeight - (top + height));\n const insetLeft = floor(left);\n const rootMargin = -insetTop + \"px \" + -insetRight + \"px \" + -insetBottom + \"px \" + -insetLeft + \"px\";\n const options = {\n rootMargin,\n threshold: max(0, min(1, threshold)) || 1\n };\n let isFirstUpdate = true;\n function handleObserve(entries) {\n const ratio = entries[0].intersectionRatio;\n if (ratio !== threshold) {\n if (!isFirstUpdate) {\n return refresh();\n }\n if (!ratio) {\n // If the reference is clipped, the ratio is 0. Throttle the refresh\n // to prevent an infinite loop of updates.\n timeoutId = setTimeout(() => {\n refresh(false, 1e-7);\n }, 1000);\n } else {\n refresh(false, ratio);\n }\n }\n if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {\n // It's possible that even though the ratio is reported as 1, the\n // element is not actually fully within the IntersectionObserver's root\n // area anymore. This can happen under performance constraints. This may\n // be a bug in the browser's IntersectionObserver implementation. To\n // work around this, we compare the element's bounding rect now with\n // what it was at the time we created the IntersectionObserver. If they\n // are not equal then the element moved, so we refresh.\n refresh();\n }\n isFirstUpdate = false;\n }\n\n // Older browsers don't support a `document` as the root and will throw an\n // error.\n try {\n io = new IntersectionObserver(handleObserve, {\n ...options,\n // Handle