{"version":3,"file":"vendor.react-58eea2f0.js","sources":["../../../../node_modules/react/cjs/react.production.min.js","../../../../node_modules/react/index.js","../../../../node_modules/react/cjs/react-jsx-runtime.production.min.js","../../../../node_modules/react/jsx-runtime.js","../../../../node_modules/scheduler/cjs/scheduler.production.min.js","../../../../node_modules/scheduler/index.js","../../../../node_modules/react-dom/cjs/react-dom.production.min.js","../../../../node_modules/react-dom/index.js","../../../../node_modules/react-dom/client.js","../../../../node_modules/@sentry/utils/esm/is.js","../../../../node_modules/@sentry/utils/esm/string.js","../../../../node_modules/@sentry/utils/esm/aggregate-errors.js","../../../../node_modules/@sentry/utils/esm/worldwide.js","../../../../node_modules/@sentry/utils/esm/browser.js","../../../../node_modules/@sentry/utils/esm/debug-build.js","../../../../node_modules/@sentry/utils/esm/logger.js","../../../../node_modules/@sentry/utils/esm/dsn.js","../../../../node_modules/@sentry/utils/esm/error.js","../../../../node_modules/@sentry/utils/esm/object.js","../../../../node_modules/@sentry/utils/esm/stacktrace.js","../../../../node_modules/@sentry/utils/esm/instrument/_handlers.js","../../../../node_modules/@sentry/utils/esm/instrument/console.js","../../../../node_modules/@sentry/utils/esm/misc.js","../../../../node_modules/@sentry/utils/esm/instrument/dom.js","../../../../node_modules/@sentry/utils/esm/supports.js","../../../../node_modules/@sentry/utils/esm/instrument/fetch.js","../../../../node_modules/@sentry/utils/esm/instrument/globalError.js","../../../../node_modules/@sentry/utils/esm/instrument/globalUnhandledRejection.js","../../../../node_modules/@sentry/utils/esm/vendor/supportsHistory.js","../../../../node_modules/@sentry/utils/esm/instrument/history.js","../../../../node_modules/@sentry/utils/esm/instrument/xhr.js","../../../../node_modules/@sentry/utils/esm/env.js","../../../../node_modules/@sentry/utils/esm/node.js","../../../../node_modules/@sentry/utils/esm/isBrowser.js","../../../../node_modules/@sentry/utils/esm/memo.js","../../../../node_modules/@sentry/utils/esm/normalize.js","../../../../node_modules/@sentry/utils/esm/syncpromise.js","../../../../node_modules/@sentry/utils/esm/promisebuffer.js","../../../../node_modules/@sentry/utils/esm/url.js","../../../../node_modules/@sentry/utils/esm/severity.js","../../../../node_modules/@sentry/utils/esm/time.js","../../../../node_modules/@sentry/utils/esm/envelope.js","../../../../node_modules/@sentry/utils/esm/clientreport.js","../../../../node_modules/@sentry/utils/esm/ratelimit.js","../../../../node_modules/@sentry/utils/esm/buildPolyfills/_nullishCoalesce.js","../../../../node_modules/@sentry/utils/esm/buildPolyfills/_optionalChain.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/debug-build.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/constants.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/eventProcessors.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/session.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/utils/spanUtils.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/utils/prepareEvent.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/exports.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/utils/getRootSpan.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/scope.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/version.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/hub.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/envelope.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/api.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/integration.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/metrics/utils.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/metrics/envelope.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/baseclient.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/sdk.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/transports/base.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/utils/sdkMetadata.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/integrations/inboundfilters.js","../../../../node_modules/@sentry/react/node_modules/@sentry/core/esm/integrations/functiontostring.js","../../../../node_modules/@sentry-internal/tracing/esm/common/debug-build.js","../../../../node_modules/@sentry-internal/tracing/esm/browser/types.js","../../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/bindReporter.js","../../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/generateUniqueID.js","../../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/getNavigationEntry.js","../../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/getActivationStart.js","../../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/initMetric.js","../../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/observe.js","../../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/onHidden.js","../../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/lib/getVisibilityWatcher.js","../../../../node_modules/@sentry-internal/tracing/esm/browser/web-vitals/getLCP.js","../../../../node_modules/@sentry-internal/tracing/esm/browser/instrument.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/helpers.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/debug-build.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/eventbuilder.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/userfeedback.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/client.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/transports/utils.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/transports/fetch.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/transports/xhr.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/stack-parsers.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/integrations/breadcrumbs.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/integrations/dedupe.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/integrations/globalhandlers.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/integrations/httpcontext.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/integrations/linkederrors.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/integrations/trycatch.js","../../../../node_modules/@sentry/react/node_modules/@sentry/browser/esm/sdk.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/debug-build.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/constants.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/eventProcessors.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/session.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/utils/spanUtils.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/utils/prepareEvent.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/exports.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/utils/getRootSpan.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/tracing/dynamicSamplingContext.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/utils/applyScopeDataToEvent.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/scope.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/version.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/hub.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/semanticAttributes.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/baseclient.js","../../../../node_modules/@sentry/replay/node_modules/@sentry/core/esm/utils/isSentryRequestUrl.js","../../../../node_modules/@sentry/replay/esm/index.js","../../../../node_modules/@sentry/react/esm/sdk.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/index.js","../../../../node_modules/hoist-non-react-statics/dist/hoist-non-react-statics.cjs.js","../../../../node_modules/@sentry/react/esm/debug-build.js","../../../../node_modules/@sentry/react/esm/errorboundary.js","../../../../node_modules/redux/dist/redux.mjs","../../../../node_modules/immer/dist/immer.mjs","../../../../node_modules/reselect/dist/reselect.mjs","../../../../node_modules/redux-thunk/dist/redux-thunk.mjs","../../../../node_modules/@reduxjs/toolkit/dist/redux-toolkit.modern.mjs","../../../../node_modules/@reduxjs/toolkit/dist/query/rtk-query.modern.mjs","../../../../node_modules/react-redux/node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js","../../../../node_modules/react-redux/node_modules/use-sync-external-store/with-selector.js","../../../../node_modules/react-redux/dist/react-redux.mjs","../../../../node_modules/@reduxjs/toolkit/dist/query/react/rtk-query-react.modern.mjs","../../../../node_modules/@aws-amplify/auth/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-amplify/auth/lib-esm/types/Auth.js","../../../../node_modules/@aws-amplify/core/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-amplify/core/lib-esm/Util/Constants.js","../../../../node_modules/@aws-amplify/core/lib-esm/Logger/ConsoleLogger.js","../../../../node_modules/@aws-amplify/core/lib-esm/Amplify.js","../../../../node_modules/@aws-amplify/core/lib-esm/Platform/version.js","../../../../node_modules/@aws-amplify/core/lib-esm/Platform/index.js","../../../../node_modules/@aws-amplify/core/lib-esm/Hub.js","../../../../node_modules/@aws-amplify/core/lib-esm/I18n/I18n.js","../../../../node_modules/@aws-amplify/core/lib-esm/I18n/index.js","../../../../node_modules/@aws-amplify/core/lib-esm/JS.js","../../../../node_modules/@aws-amplify/core/lib-esm/Util/Retry.js","../../../../node_modules/@aws-amplify/core/lib-esm/Util/StringUtils.js","../../../../node_modules/@aws-crypto/sha256-js/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-crypto/sha256-js/build/constants.js","../../../../node_modules/@aws-crypto/sha256-js/build/RawSha256.js","../../../../node_modules/@aws-crypto/sha256-js/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js","../../../../node_modules/@aws-crypto/sha256-js/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js","../../../../node_modules/@aws-crypto/sha256-js/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js","../../../../node_modules/@aws-crypto/sha256-js/node_modules/@aws-crypto/util/build/convertToBuffer.js","../../../../node_modules/@aws-crypto/sha256-js/node_modules/@aws-crypto/util/build/isEmptyData.js","../../../../node_modules/@aws-crypto/sha256-js/node_modules/@aws-crypto/util/build/numToUint8.js","../../../../node_modules/@aws-crypto/sha256-js/node_modules/@aws-crypto/util/build/uint32ArrayFrom.js","../../../../node_modules/@aws-crypto/sha256-js/node_modules/@aws-crypto/util/build/index.js","../../../../node_modules/@aws-crypto/sha256-js/build/jsSha256.js","../../../../node_modules/@aws-crypto/sha256-js/build/index.js","../../../../node_modules/@aws-sdk/util-hex-encoding/dist/es/index.js","../../../../node_modules/@aws-amplify/core/lib-esm/parseAWSExports.js","../../../../node_modules/tslib/tslib.es6.mjs","../../../../node_modules/@aws-sdk/util-utf8-browser/dist/es/pureJs.js","../../../../node_modules/@aws-sdk/util-utf8-browser/dist/es/whatwgEncodingApi.js","../../../../node_modules/@aws-sdk/util-utf8-browser/dist/es/index.js","../../../../node_modules/@aws-sdk/util-locate-window/dist-es/index.js","../../../../node_modules/@aws-crypto/ie11-detection/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-crypto/ie11-detection/build/CryptoOperation.js","../../../../node_modules/@aws-crypto/ie11-detection/build/Key.js","../../../../node_modules/@aws-crypto/ie11-detection/build/KeyOperation.js","../../../../node_modules/@aws-crypto/ie11-detection/build/MsSubtleCrypto.js","../../../../node_modules/@aws-crypto/ie11-detection/build/MsWindow.js","../../../../node_modules/@aws-crypto/ie11-detection/build/index.js","../../../../node_modules/@aws-sdk/fetch-http-handler/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/protocol-http/dist/es/httpResponse.js","../../../../node_modules/@aws-sdk/protocol-http/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/protocol-http/dist/es/httpRequest.js","../../../../node_modules/@aws-sdk/querystring-builder/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/querystring-builder/node_modules/@aws-sdk/util-uri-escape/dist/es/escape-uri.js","../../../../node_modules/@aws-sdk/querystring-builder/dist/es/index.js","../../../../node_modules/@aws-sdk/fetch-http-handler/dist/es/request-timeout.js","../../../../node_modules/@aws-sdk/fetch-http-handler/dist/es/fetch-http-handler.js","../../../../node_modules/@aws-sdk/util-base64-browser/dist/es/index.js","../../../../node_modules/@aws-sdk/fetch-http-handler/dist/es/stream-collector.js","../../../../node_modules/@aws-sdk/invalid-dependency/dist/es/invalidProvider.js","../../../../node_modules/@aws-sdk/middleware-retry/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/middleware-retry/dist/es/retryMiddleware.js","../../../../node_modules/@aws-sdk/middleware-retry/dist/es/constants.js","../../../../node_modules/@aws-sdk/service-error-classification/dist/es/constants.js","../../../../node_modules/@aws-sdk/service-error-classification/dist/es/index.js","../../../../node_modules/@aws-sdk/middleware-retry/node_modules/uuid/lib/rng-browser.js","../../../../node_modules/@aws-sdk/middleware-retry/node_modules/uuid/lib/bytesToUuid.js","../../../../node_modules/@aws-sdk/middleware-retry/node_modules/uuid/v1.js","../../../../node_modules/@aws-sdk/middleware-retry/node_modules/uuid/v4.js","../../../../node_modules/@aws-sdk/middleware-retry/node_modules/uuid/index.js","../../../../node_modules/@aws-sdk/middleware-retry/dist/es/defaultRetryQuota.js","../../../../node_modules/@aws-sdk/middleware-retry/dist/es/delayDecider.js","../../../../node_modules/@aws-sdk/middleware-retry/dist/es/retryDecider.js","../../../../node_modules/@aws-sdk/middleware-retry/dist/es/defaultStrategy.js","../../../../node_modules/@aws-sdk/middleware-retry/dist/es/configurations.js","../../../../node_modules/@aws-sdk/util-body-length-browser/dist/es/index.js","../../../../node_modules/@aws-sdk/util-user-agent-browser/node_modules/tslib/tslib.es6.js","../../../../node_modules/bowser/src/constants.js","../../../../node_modules/bowser/src/utils.js","../../../../node_modules/bowser/src/parser-browsers.js","../../../../node_modules/bowser/src/parser-os.js","../../../../node_modules/bowser/src/parser-platforms.js","../../../../node_modules/bowser/src/parser-engines.js","../../../../node_modules/bowser/src/parser.js","../../../../node_modules/bowser/src/bowser.js","../../../../node_modules/@aws-sdk/util-user-agent-browser/dist/es/index.js","../../../../node_modules/@aws-sdk/querystring-parser/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/querystring-parser/dist/es/index.js","../../../../node_modules/@aws-sdk/url-parser/dist/es/index.js","../../../../node_modules/@aws-sdk/config-resolver/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/config-resolver/dist/es/EndpointsConfig.js","../../../../node_modules/@aws-sdk/config-resolver/dist/es/RegionConfig.js","../../../../node_modules/@aws-sdk/middleware-content-length/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/middleware-content-length/dist/es/index.js","../../../../node_modules/@aws-sdk/middleware-host-header/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/middleware-host-header/dist/es/index.js","../../../../node_modules/@aws-sdk/middleware-logger/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/middleware-logger/dist/es/loggerMiddleware.js","../../../../node_modules/@aws-sdk/middleware-signing/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/signature-v4/dist/es/constants.js","../../../../node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/signature-v4/dist/es/credentialDerivation.js","../../../../node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/signature-v4/dist/es/getCanonicalHeaders.js","../../../../node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/util-uri-escape/dist/es/escape-uri.js","../../../../node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/signature-v4/dist/es/getCanonicalQuery.js","../../../../node_modules/@aws-sdk/is-array-buffer/dist/es/index.js","../../../../node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/signature-v4/dist/es/getPayloadHash.js","../../../../node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/signature-v4/dist/es/hasHeader.js","../../../../node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/signature-v4/dist/es/cloneRequest.js","../../../../node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/signature-v4/dist/es/moveHeadersToQuery.js","../../../../node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/signature-v4/dist/es/prepareRequest.js","../../../../node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/signature-v4/dist/es/utilDate.js","../../../../node_modules/@aws-sdk/middleware-signing/node_modules/@aws-sdk/signature-v4/dist/es/SignatureV4.js","../../../../node_modules/@aws-sdk/middleware-signing/dist/es/configurations.js","../../../../node_modules/@aws-sdk/middleware-user-agent/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/middleware-user-agent/dist/es/configurations.js","../../../../node_modules/@aws-sdk/middleware-user-agent/dist/es/constants.js","../../../../node_modules/@aws-sdk/middleware-user-agent/dist/es/user-agent-middleware.js","../../../../node_modules/@aws-sdk/middleware-stack/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/middleware-stack/dist/es/MiddlewareStack.js","../../../../node_modules/@aws-sdk/smithy-client/dist/es/client.js","../../../../node_modules/@aws-sdk/smithy-client/dist/es/command.js","../../../../node_modules/@aws-sdk/smithy-client/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/smithy-client/dist/es/lazy-json.js","../../../../node_modules/@aws-sdk/middleware-serde/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/middleware-serde/dist/es/deserializerMiddleware.js","../../../../node_modules/@aws-sdk/middleware-serde/dist/es/serializerMiddleware.js","../../../../node_modules/@aws-sdk/middleware-serde/dist/es/serdePlugin.js","../../../../node_modules/@aws-amplify/core/lib-esm/OAuthHelper/GoogleOAuth.js","../../../../node_modules/@aws-amplify/core/lib-esm/OAuthHelper/FacebookOAuth.js","../../../../node_modules/@aws-amplify/core/lib-esm/OAuthHelper/index.js","../../../../node_modules/@aws-amplify/core/lib-esm/StorageHelper/index.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/build/isEmptyData.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/build/constants.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/build/ie11Sha256.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/node_modules/@aws-sdk/util-utf8-browser/dist-es/pureJs.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/node_modules/@aws-sdk/util-utf8-browser/dist-es/whatwgEncodingApi.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/node_modules/@aws-sdk/util-utf8-browser/dist-es/index.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/build/convertToBuffer.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/build/isEmptyData.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/build/numToUint8.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/build/uint32ArrayFrom.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/util/build/index.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/build/webCryptoSha256.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/supports-web-crypto/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/supports-web-crypto/build/supportsWebCrypto.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/supports-web-crypto/build/index.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/build/crossPlatformSha256.js","../../../../node_modules/@aws-sdk/client-cognito-identity/node_modules/@aws-crypto/sha256-browser/build/index.js","../../../../node_modules/@aws-sdk/client-cognito-identity/dist/es/endpoints.js","../../../../node_modules/@aws-sdk/client-cognito-identity/dist/es/runtimeConfig.shared.js","../../../../node_modules/@aws-sdk/client-cognito-identity/dist/es/runtimeConfig.browser.js","../../../../node_modules/@aws-sdk/client-cognito-identity/dist/es/CognitoIdentityClient.js","../../../../node_modules/@aws-sdk/client-cognito-identity/dist/es/models/models_0.js","../../../../node_modules/@aws-sdk/client-cognito-identity/dist/es/protocols/Aws_json1_1.js","../../../../node_modules/@aws-sdk/client-cognito-identity/dist/es/commands/GetCredentialsForIdentityCommand.js","../../../../node_modules/@aws-sdk/client-cognito-identity/dist/es/commands/GetIdCommand.js","../../../../node_modules/@aws-amplify/core/node_modules/@aws-sdk/property-provider/dist/es/ProviderError.js","../../../../node_modules/@aws-amplify/core/node_modules/@aws-sdk/credential-provider-cognito-identity/dist/es/resolveLogins.js","../../../../node_modules/@aws-amplify/core/node_modules/@aws-sdk/credential-provider-cognito-identity/dist/es/fromCognitoIdentity.js","../../../../node_modules/@aws-amplify/core/node_modules/@aws-sdk/credential-provider-cognito-identity/dist/es/IndexedDbStorage.js","../../../../node_modules/@aws-amplify/core/node_modules/@aws-sdk/credential-provider-cognito-identity/dist/es/InMemoryStorage.js","../../../../node_modules/@aws-amplify/core/node_modules/@aws-sdk/credential-provider-cognito-identity/dist/es/localStorage.js","../../../../node_modules/@aws-amplify/core/node_modules/@aws-sdk/credential-provider-cognito-identity/dist/es/fromCognitoIdentityPool.js","../../../../node_modules/@aws-amplify/core/lib-esm/Util/CognitoIdentityClient.js","../../../../node_modules/@aws-amplify/core/lib-esm/Credentials.js","../../../../node_modules/cookie/index.js","../../../../node_modules/universal-cookie/es6/utils.js","../../../../node_modules/universal-cookie/es6/Cookies.js","../../../../node_modules/@aws-amplify/core/lib-esm/UniversalStorage/index.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/AuthenticationDetails.js","../../../../node_modules/base64-js/index.js","../../../../node_modules/ieee754/index.js","../../../../node_modules/@aws-amplify/auth/node_modules/isarray/index.js","../../../../node_modules/@aws-amplify/auth/node_modules/buffer/index.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/utils/cryptoSecureRandomInt.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/utils/WordArray.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/BigInteger.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/AuthenticationHelper.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/CognitoJwtToken.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/CognitoAccessToken.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/CognitoIdToken.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/CognitoRefreshToken.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/Platform/version.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/Platform/index.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/CognitoUserSession.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/DateHelper.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/CognitoUserAttribute.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/StorageHelper.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/CognitoUser.js","../../../../node_modules/unfetch/dist/unfetch.module.js","../../../../node_modules/isomorphic-unfetch/browser.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/UserAgent.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/Client.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/CognitoUserPool.js","../../../../node_modules/js-cookie/src/js.cookie.js","../../../../node_modules/@aws-amplify/auth/node_modules/amazon-cognito-identity-js/es/CookieStorage.js","../../../../node_modules/url/node_modules/punycode/punycode.js","../../../../node_modules/es-errors/index.js","../../../../node_modules/es-errors/eval.js","../../../../node_modules/es-errors/range.js","../../../../node_modules/es-errors/ref.js","../../../../node_modules/es-errors/syntax.js","../../../../node_modules/es-errors/type.js","../../../../node_modules/es-errors/uri.js","../../../../node_modules/has-symbols/shams.js","../../../../node_modules/has-symbols/index.js","../../../../node_modules/has-proto/index.js","../../../../node_modules/function-bind/implementation.js","../../../../node_modules/function-bind/index.js","../../../../node_modules/hasown/index.js","../../../../node_modules/get-intrinsic/index.js","../../../../node_modules/es-define-property/index.js","../../../../node_modules/gopd/index.js","../../../../node_modules/define-data-property/index.js","../../../../node_modules/has-property-descriptors/index.js","../../../../node_modules/set-function-length/index.js","../../../../node_modules/call-bind/index.js","../../../../node_modules/call-bind/callBound.js","../../__vite-browser-external","../../../../node_modules/object-inspect/index.js","../../../../node_modules/side-channel/index.js","../../../../node_modules/qs/lib/formats.js","../../../../node_modules/qs/lib/utils.js","../../../../node_modules/qs/lib/stringify.js","../../../../node_modules/qs/lib/parse.js","../../../../node_modules/qs/lib/index.js","../../../../node_modules/url/url.js","../../../../node_modules/@aws-amplify/auth/lib-esm/OAuth/urlOpener.js","../../../../node_modules/@aws-amplify/auth/lib-esm/OAuth/oauthStorage.js","../../../../node_modules/@aws-amplify/auth/lib-esm/OAuth/OAuth.js","../../../../node_modules/@aws-amplify/auth/lib-esm/urlListener.js","../../../../node_modules/@aws-amplify/auth/lib-esm/common/AuthErrorStrings.js","../../../../node_modules/@aws-amplify/auth/lib-esm/Errors.js","../../../../node_modules/@aws-amplify/auth/lib-esm/Auth.js","../../../../node_modules/lodash/_isPrototype.js","../../../../node_modules/lodash/_overArg.js","../../../../node_modules/lodash/_nativeKeys.js","../../../../node_modules/lodash/_baseKeys.js","../../../../node_modules/lodash/_freeGlobal.js","../../../../node_modules/lodash/_root.js","../../../../node_modules/lodash/_Symbol.js","../../../../node_modules/lodash/_getRawTag.js","../../../../node_modules/lodash/_objectToString.js","../../../../node_modules/lodash/_baseGetTag.js","../../../../node_modules/lodash/isObject.js","../../../../node_modules/lodash/isFunction.js","../../../../node_modules/lodash/_coreJsData.js","../../../../node_modules/lodash/_isMasked.js","../../../../node_modules/lodash/_toSource.js","../../../../node_modules/lodash/_baseIsNative.js","../../../../node_modules/lodash/_getValue.js","../../../../node_modules/lodash/_getNative.js","../../../../node_modules/lodash/_DataView.js","../../../../node_modules/lodash/_Map.js","../../../../node_modules/lodash/_Promise.js","../../../../node_modules/lodash/_Set.js","../../../../node_modules/lodash/_WeakMap.js","../../../../node_modules/lodash/_getTag.js","../../../../node_modules/lodash/isObjectLike.js","../../../../node_modules/lodash/_baseIsArguments.js","../../../../node_modules/lodash/isArguments.js","../../../../node_modules/lodash/isArray.js","../../../../node_modules/lodash/isLength.js","../../../../node_modules/lodash/isArrayLike.js","../../../../node_modules/lodash/stubFalse.js","../../../../node_modules/lodash/isBuffer.js","../../../../node_modules/lodash/_baseIsTypedArray.js","../../../../node_modules/lodash/_baseUnary.js","../../../../node_modules/lodash/_nodeUtil.js","../../../../node_modules/lodash/isTypedArray.js","../../../../node_modules/lodash/_listCacheClear.js","../../../../node_modules/lodash/eq.js","../../../../node_modules/lodash/_assocIndexOf.js","../../../../node_modules/lodash/_listCacheDelete.js","../../../../node_modules/lodash/_listCacheGet.js","../../../../node_modules/lodash/_listCacheHas.js","../../../../node_modules/lodash/_listCacheSet.js","../../../../node_modules/lodash/_ListCache.js","../../../../node_modules/lodash/_stackClear.js","../../../../node_modules/lodash/_stackDelete.js","../../../../node_modules/lodash/_stackGet.js","../../../../node_modules/lodash/_stackHas.js","../../../../node_modules/lodash/_nativeCreate.js","../../../../node_modules/lodash/_hashClear.js","../../../../node_modules/lodash/_hashDelete.js","../../../../node_modules/lodash/_hashGet.js","../../../../node_modules/lodash/_hashHas.js","../../../../node_modules/lodash/_hashSet.js","../../../../node_modules/lodash/_Hash.js","../../../../node_modules/lodash/_mapCacheClear.js","../../../../node_modules/lodash/_isKeyable.js","../../../../node_modules/lodash/_getMapData.js","../../../../node_modules/lodash/_mapCacheDelete.js","../../../../node_modules/lodash/_mapCacheGet.js","../../../../node_modules/lodash/_mapCacheHas.js","../../../../node_modules/lodash/_mapCacheSet.js","../../../../node_modules/lodash/_MapCache.js","../../../../node_modules/lodash/_stackSet.js","../../../../node_modules/lodash/_Stack.js","../../../../node_modules/lodash/_setCacheAdd.js","../../../../node_modules/lodash/_setCacheHas.js","../../../../node_modules/lodash/_SetCache.js","../../../../node_modules/lodash/_arraySome.js","../../../../node_modules/lodash/_cacheHas.js","../../../../node_modules/lodash/_equalArrays.js","../../../../node_modules/lodash/_Uint8Array.js","../../../../node_modules/lodash/_mapToArray.js","../../../../node_modules/lodash/_setToArray.js","../../../../node_modules/lodash/_equalByTag.js","../../../../node_modules/lodash/_arrayPush.js","../../../../node_modules/lodash/_baseGetAllKeys.js","../../../../node_modules/lodash/_arrayFilter.js","../../../../node_modules/lodash/stubArray.js","../../../../node_modules/lodash/_getSymbols.js","../../../../node_modules/lodash/_baseTimes.js","../../../../node_modules/lodash/_isIndex.js","../../../../node_modules/lodash/_arrayLikeKeys.js","../../../../node_modules/lodash/keys.js","../../../../node_modules/lodash/_getAllKeys.js","../../../../node_modules/lodash/_equalObjects.js","../../../../node_modules/lodash/_baseIsEqualDeep.js","../../../../node_modules/lodash/_baseIsEqual.js","../../../../node_modules/lodash/isEqual.js","../../../../node_modules/lodash/isSymbol.js","../../../../node_modules/lodash/_isKey.js","../../../../node_modules/lodash/memoize.js","../../../../node_modules/lodash/_memoizeCapped.js","../../../../node_modules/lodash/_stringToPath.js","../../../../node_modules/lodash/_arrayMap.js","../../../../node_modules/lodash/_baseToString.js","../../../../node_modules/lodash/toString.js","../../../../node_modules/lodash/_castPath.js","../../../../node_modules/lodash/_toKey.js","../../../../node_modules/lodash/_baseGet.js","../../../../node_modules/lodash/get.js","../../../../node_modules/lodash/_isFlattenable.js","../../../../node_modules/lodash/_baseFlatten.js","../../../../node_modules/lodash/flatten.js","../../../../node_modules/dayjs/dayjs.min.js","../../../../node_modules/axios/lib/helpers/bind.js","../../../../node_modules/axios/lib/utils.js","../../../../node_modules/axios/lib/core/AxiosError.js","../../../../node_modules/axios/lib/helpers/null.js","../../../../node_modules/axios/lib/helpers/toFormData.js","../../../../node_modules/axios/lib/helpers/AxiosURLSearchParams.js","../../../../node_modules/axios/lib/helpers/buildURL.js","../../../../node_modules/axios/lib/core/InterceptorManager.js","../../../../node_modules/axios/lib/defaults/transitional.js","../../../../node_modules/axios/lib/platform/browser/classes/URLSearchParams.js","../../../../node_modules/axios/lib/platform/browser/classes/FormData.js","../../../../node_modules/axios/lib/platform/browser/classes/Blob.js","../../../../node_modules/axios/lib/platform/browser/index.js","../../../../node_modules/axios/lib/platform/common/utils.js","../../../../node_modules/axios/lib/platform/index.js","../../../../node_modules/axios/lib/helpers/toURLEncodedForm.js","../../../../node_modules/axios/lib/helpers/formDataToJSON.js","../../../../node_modules/axios/lib/defaults/index.js","../../../../node_modules/axios/lib/helpers/parseHeaders.js","../../../../node_modules/axios/lib/core/AxiosHeaders.js","../../../../node_modules/axios/lib/core/transformData.js","../../../../node_modules/axios/lib/cancel/isCancel.js","../../../../node_modules/axios/lib/cancel/CanceledError.js","../../../../node_modules/axios/lib/core/settle.js","../../../../node_modules/axios/lib/helpers/parseProtocol.js","../../../../node_modules/axios/lib/helpers/speedometer.js","../../../../node_modules/axios/lib/helpers/throttle.js","../../../../node_modules/axios/lib/helpers/progressEventReducer.js","../../../../node_modules/axios/lib/helpers/isURLSameOrigin.js","../../../../node_modules/axios/lib/helpers/cookies.js","../../../../node_modules/axios/lib/helpers/isAbsoluteURL.js","../../../../node_modules/axios/lib/helpers/combineURLs.js","../../../../node_modules/axios/lib/core/buildFullPath.js","../../../../node_modules/axios/lib/core/mergeConfig.js","../../../../node_modules/axios/lib/helpers/resolveConfig.js","../../../../node_modules/axios/lib/adapters/xhr.js","../../../../node_modules/axios/lib/helpers/composeSignals.js","../../../../node_modules/axios/lib/helpers/trackStream.js","../../../../node_modules/axios/lib/adapters/fetch.js","../../../../node_modules/axios/lib/adapters/adapters.js","../../../../node_modules/axios/lib/core/dispatchRequest.js","../../../../node_modules/axios/lib/env/data.js","../../../../node_modules/axios/lib/helpers/validator.js","../../../../node_modules/axios/lib/core/Axios.js","../../../../node_modules/axios/lib/cancel/CancelToken.js","../../../../node_modules/axios/lib/helpers/spread.js","../../../../node_modules/axios/lib/helpers/isAxiosError.js","../../../../node_modules/axios/lib/helpers/HttpStatusCode.js","../../../../node_modules/axios/lib/axios.js","../../../../node_modules/@formatjs/fast-memoize/lib/index.js","../../../../node_modules/@formatjs/ecma402-abstract/lib/utils.js","../../../../node_modules/@formatjs/icu-messageformat-parser/lib/error.js","../../../../node_modules/@formatjs/icu-messageformat-parser/lib/types.js","../../../../node_modules/@formatjs/icu-messageformat-parser/lib/regex.generated.js","../../../../node_modules/@formatjs/icu-skeleton-parser/lib/date-time.js","../../../../node_modules/@formatjs/icu-skeleton-parser/lib/regex.generated.js","../../../../node_modules/@formatjs/icu-skeleton-parser/lib/number.js","../../../../node_modules/@formatjs/icu-messageformat-parser/lib/time-data.generated.js","../../../../node_modules/@formatjs/icu-messageformat-parser/lib/date-time-pattern-generator.js","../../../../node_modules/@formatjs/icu-messageformat-parser/lib/parser.js","../../../../node_modules/@formatjs/icu-messageformat-parser/lib/index.js","../../../../node_modules/intl-messageformat/lib/src/error.js","../../../../node_modules/intl-messageformat/lib/src/formatters.js","../../../../node_modules/intl-messageformat/lib/src/core.js","../../../../node_modules/@formatjs/intl/lib/src/error.js","../../../../node_modules/@formatjs/intl/lib/src/utils.js","../../../../node_modules/@formatjs/intl/lib/src/message.js","../../../../node_modules/@formatjs/intl/lib/src/dateTime.js","../../../../node_modules/@formatjs/intl/lib/src/displayName.js","../../../../node_modules/@formatjs/intl/lib/src/list.js","../../../../node_modules/@formatjs/intl/lib/src/plural.js","../../../../node_modules/@formatjs/intl/lib/src/relativeTime.js","../../../../node_modules/@formatjs/intl/lib/src/number.js","../../../../node_modules/@formatjs/intl/lib/src/create-intl.js","../../../../node_modules/react-intl/lib/src/utils.js","../../../../node_modules/react-intl/lib/src/components/injectIntl.js","../../../../node_modules/react-intl/lib/src/components/useIntl.js","../../../../node_modules/react-intl/lib/src/components/createFormattedComponent.js","../../../../node_modules/react-intl/lib/src/components/createIntl.js","../../../../node_modules/react-intl/lib/src/components/provider.js","../../../../node_modules/react-intl/lib/index.js","../../../../node_modules/@aws-amplify/ui-react/node_modules/tslib/tslib.es6.js","../../../../node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator/actor.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/types/authenticator/user.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/types/authenticator/attributes.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/types/primitives/componentClassName.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator/context.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator/facade.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/country-dial-codes.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/de.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/en.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/es.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/fr.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/it.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/ja.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/kr.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/nb.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/nl.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/pl.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/pt.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/zh.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/sv.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/id.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/tr.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/ru.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/he.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/ua.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/authenticator/defaultTexts.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/dictionaries/index.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/i18n/translations.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator/constants.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator/form.mjs","../../../../node_modules/@aws-amplify/ui/node_modules/tslib/tslib.es6.js","../../../../node_modules/xstate/lib/_virtual/_tslib.js","../../../../node_modules/xstate/lib/waitFor.js","../../../../node_modules/@aws-amplify/ui/dist/esm/utils/index.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator/utils.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator/formFields/defaults.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator/formFields/util.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator/formFields/formFields.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/helpers/authenticator/textUtil.mjs","../../../../node_modules/xstate/es/_virtual/_tslib.js","../../../../node_modules/xstate/es/types.js","../../../../node_modules/xstate/es/actionTypes.js","../../../../node_modules/xstate/es/constants.js","../../../../node_modules/xstate/es/utils.js","../../../../node_modules/xstate/es/actions.js","../../../../node_modules/xstate/es/serviceScope.js","../../../../node_modules/xstate/es/Actor.js","../../../../node_modules/xstate/es/stateUtils.js","../../../../node_modules/xstate/es/State.js","../../../../node_modules/xstate/es/scheduler.js","../../../../node_modules/xstate/es/registry.js","../../../../node_modules/xstate/es/devTools.js","../../../../node_modules/xstate/es/behaviors.js","../../../../node_modules/xstate/es/interpreter.js","../../../../node_modules/xstate/es/invokeUtils.js","../../../../node_modules/xstate/es/StateNode.js","../../../../node_modules/xstate/es/Machine.js","../../../../node_modules/xstate/es/index.js","../../../../node_modules/@aws-amplify/ui/dist/esm/machines/authenticator/actions.mjs","../../../../node_modules/lodash/_defineProperty.js","../../../../node_modules/lodash/_baseAssignValue.js","../../../../node_modules/lodash/_assignMergeValue.js","../../../../node_modules/lodash/_createBaseFor.js","../../../../node_modules/lodash/_baseFor.js","../../../../node_modules/lodash/_cloneBuffer.js","../../../../node_modules/lodash/_cloneArrayBuffer.js","../../../../node_modules/lodash/_cloneTypedArray.js","../../../../node_modules/lodash/_copyArray.js","../../../../node_modules/lodash/_baseCreate.js","../../../../node_modules/lodash/_getPrototype.js","../../../../node_modules/lodash/_initCloneObject.js","../../../../node_modules/lodash/isArrayLikeObject.js","../../../../node_modules/lodash/isPlainObject.js","../../../../node_modules/lodash/_safeGet.js","../../../../node_modules/lodash/_assignValue.js","../../../../node_modules/lodash/_copyObject.js","../../../../node_modules/lodash/_nativeKeysIn.js","../../../../node_modules/lodash/_baseKeysIn.js","../../../../node_modules/lodash/keysIn.js","../../../../node_modules/lodash/toPlainObject.js","../../../../node_modules/lodash/_baseMergeDeep.js","../../../../node_modules/lodash/_baseMerge.js","../../../../node_modules/lodash/identity.js","../../../../node_modules/lodash/_apply.js","../../../../node_modules/lodash/_overRest.js","../../../../node_modules/lodash/constant.js","../../../../node_modules/lodash/_baseSetToString.js","../../../../node_modules/lodash/_shortOut.js","../../../../node_modules/lodash/_setToString.js","../../../../node_modules/lodash/_baseRest.js","../../../../node_modules/lodash/_isIterateeCall.js","../../../../node_modules/lodash/_createAssigner.js","../../../../node_modules/lodash/merge.js","../../../../node_modules/@aws-amplify/ui/dist/esm/validators/index.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/machines/authenticator/defaultServices.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/machines/authenticator/actors/signIn.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/machines/authenticator/actors/signOut.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/machines/authenticator/actors/resetPassword.mjs","../../../../node_modules/lodash/_baseIsMatch.js","../../../../node_modules/lodash/_isStrictComparable.js","../../../../node_modules/lodash/_getMatchData.js","../../../../node_modules/lodash/_matchesStrictComparable.js","../../../../node_modules/lodash/_baseMatches.js","../../../../node_modules/lodash/_baseHasIn.js","../../../../node_modules/lodash/_hasPath.js","../../../../node_modules/lodash/hasIn.js","../../../../node_modules/lodash/_baseMatchesProperty.js","../../../../node_modules/lodash/_baseProperty.js","../../../../node_modules/lodash/_basePropertyDeep.js","../../../../node_modules/lodash/property.js","../../../../node_modules/lodash/_baseIteratee.js","../../../../node_modules/lodash/_baseSet.js","../../../../node_modules/lodash/_basePickBy.js","../../../../node_modules/lodash/_getSymbolsIn.js","../../../../node_modules/lodash/_getAllKeysIn.js","../../../../node_modules/lodash/pickBy.js","../../../../node_modules/@aws-amplify/ui/dist/esm/machines/authenticator/signUp.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/machines/authenticator/index.mjs","../../../../node_modules/lower-case/dist.es2015/index.js","../../../../node_modules/no-case/dist.es2015/index.js","../../../../node_modules/pascal-case/dist.es2015/index.js","../../../../node_modules/camel-case/dist.es2015/index.js","../../../../node_modules/upper-case-first/dist.es2015/index.js","../../../../node_modules/capital-case/dist.es2015/index.js","../../../../node_modules/upper-case/dist.es2015/index.js","../../../../node_modules/constant-case/dist.es2015/index.js","../../../../node_modules/dot-case/dist.es2015/index.js","../../../../node_modules/header-case/dist.es2015/index.js","../../../../node_modules/param-case/dist.es2015/index.js","../../../../node_modules/path-case/dist.es2015/index.js","../../../../node_modules/sentence-case/dist.es2015/index.js","../../../../node_modules/snake-case/dist.es2015/index.js","../../../../node_modules/style-dictionary/lib/utils/es6_.js","../../../../node_modules/style-dictionary/lib/utils/deepExtend.js","../../../../node_modules/style-dictionary/lib/utils/flattenProperties.js","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/borderWidths.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/colors.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/alert.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/autocomplete.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/authenticator.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/badge.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/button.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/card.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/checkbox.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/checkboxField.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/collection.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/copy.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/dialCodeSelect.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/divider.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/expander.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/field.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/fieldControl.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/fieldGroup.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/fieldMessages.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/fileUploader.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/flex.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/heading.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/highlightMatch.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/icon.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/image.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/inAppMessaging.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/link.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/liveness.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/loader.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/menu.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/pagination.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/passwordField.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/phoneNumberField.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/placeholder.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/radio.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/radioGroup.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/rating.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/searchField.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/select.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/selectField.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/sliderField.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/stepperField.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/storagemanager.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/switchField.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/table.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/tabs.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/text.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/textAreaField.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/textField.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/toggleButton.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/toggleButtonGroup.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/components/index.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/fonts.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/fontSizes.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/fontWeights.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/lineHeights.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/opacities.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/outlineOffsets.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/outlineWidths.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/radii.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/shadows.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/space.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/time.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/transforms.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/tokens/index.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/breakpoints.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/defaultTheme.mjs","../../../../node_modules/lodash/_arrayReduce.js","../../../../node_modules/lodash/_basePropertyOf.js","../../../../node_modules/lodash/_deburrLetter.js","../../../../node_modules/lodash/deburr.js","../../../../node_modules/lodash/_asciiWords.js","../../../../node_modules/lodash/_hasUnicodeWord.js","../../../../node_modules/lodash/_unicodeWords.js","../../../../node_modules/lodash/words.js","../../../../node_modules/lodash/_createCompounder.js","../../../../node_modules/lodash/kebabCase.js","../../../../node_modules/style-dictionary/lib/utils/references/defaults.js","../../../../node_modules/style-dictionary/lib/utils/references/createReferenceRegex.js","../../../../node_modules/style-dictionary/lib/utils/references/usesReference.js","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/utils.mjs","../../../../node_modules/@aws-amplify/ui/dist/esm/theme/createTheme.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/ThemeProvider/AmplifyContext.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/shared/constants.mjs","../../../../node_modules/classnames/index.js","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/types/style.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/types/theme.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/shared/utils.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/shared/responsive/utils.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/shared/responsive/getMediaQueries.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/shared/responsive/useBreakpoint.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/hooks/useTheme.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/shared/getStyleValue.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/shared/styleUtils.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/View/View.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Icon/icons/IconCheckCircle.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Icon/icons/IconError.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Icon/icons/IconInfo.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Icon/icons/IconWarning.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Alert/AlertIcon.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Flex/Flex.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Loader/Loader.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Button/Button.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Icon/icons/IconClose.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Text/Text.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Field/FieldDescription.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Field/FieldErrorMessage.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Label/Label.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Alert/Alert.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/utils/useLayoutEffect.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/utils/useStableId.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/utils/getTestId.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/FieldGroup/FieldGroup.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Input/Input.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/utils/splitPrimitiveProps.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/TextField/TextField.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/VisuallyHidden/VisuallyHidden.mjs","../../../../node_modules/lodash/_trimmedEndIndex.js","../../../../node_modules/lodash/_baseTrim.js","../../../../node_modules/lodash/toNumber.js","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Divider/Divider.mjs","../../../../node_modules/@babel/runtime/helpers/esm/extends.js","../../../../node_modules/@radix-ui/react-context/dist/index.module.js","../../../../node_modules/@radix-ui/react-compose-refs/dist/index.module.js","../../../../node_modules/@radix-ui/react-slot/dist/index.module.js","../../../../node_modules/@radix-ui/react-collection/dist/index.module.js","../../../../node_modules/@radix-ui/primitive/dist/index.module.js","../../../../node_modules/@radix-ui/react-use-callback-ref/dist/index.module.js","../../../../node_modules/@radix-ui/react-use-controllable-state/dist/index.module.js","../../../../node_modules/@radix-ui/react-primitive/dist/index.module.js","../../../../node_modules/@radix-ui/react-use-layout-effect/dist/index.module.js","../../../../node_modules/@radix-ui/react-presence/dist/index.module.js","../../../../node_modules/@radix-ui/react-id/dist/index.module.js","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Icon/icons/IconExpandMore.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Heading/Heading.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Icon/Icon.mjs","../../../../node_modules/@radix-ui/react-direction/dist/index.module.js","../../../../node_modules/@radix-ui/react-roving-focus/dist/index.module.js","../../../../node_modules/react-remove-scroll-bar/dist/es2015/constants.js","../../../../node_modules/use-callback-ref/dist/es2015/assignRef.js","../../../../node_modules/use-callback-ref/dist/es2015/useRef.js","../../../../node_modules/use-callback-ref/dist/es2015/useMergeRef.js","../../../../node_modules/use-sidecar/dist/es2015/medium.js","../../../../node_modules/use-sidecar/dist/es2015/exports.js","../../../../node_modules/get-nonce/dist/es2015/index.js","../../../../node_modules/react-style-singleton/dist/es2015/singleton.js","../../../../node_modules/react-style-singleton/dist/es2015/hook.js","../../../../node_modules/react-style-singleton/dist/es2015/component.js","../../../../node_modules/react-remove-scroll-bar/dist/es2015/utils.js","../../../../node_modules/react-remove-scroll-bar/dist/es2015/component.js","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Icon/icons/IconVisibilityOff.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Icon/icons/IconVisibility.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/PasswordField/ShowPasswordButton.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/PasswordField/PasswordField.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Select/Select.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/SelectField/SelectField.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/PhoneNumberField/CountryCodeSelect.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/PhoneNumberField/PhoneNumberField.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/RadioGroupField/context.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Radio/Radio.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/RadioGroupField/RadioGroupField.mjs","../../../../node_modules/@radix-ui/number/dist/index.module.js","../../../../node_modules/@radix-ui/react-tabs/dist/index.module.js","../../../../node_modules/@aws-amplify/ui-react/dist/esm/primitives/Tabs/Tabs.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/shared/ValidationErrors.mjs","../../../../node_modules/@aws-amplify/ui-react-core/dist/esm/node_modules/tslib/tslib.es6.mjs","../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim.production.min.js","../../../../node_modules/use-sync-external-store/shim/index.js","../../../../node_modules/use-sync-external-store/cjs/use-sync-external-store-shim/with-selector.production.min.js","../../../../node_modules/use-sync-external-store/shim/with-selector.js","../../../../node_modules/use-isomorphic-layout-effect/dist/use-isomorphic-layout-effect.browser.esm.js","../../../../node_modules/@aws-amplify/ui-react-core/node_modules/@xstate/react/es/useConstant.js","../../../../node_modules/@aws-amplify/ui-react-core/node_modules/@xstate/react/es/useInterpret.js","../../../../node_modules/@aws-amplify/ui-react-core/node_modules/@xstate/react/es/useActor.js","../../../../node_modules/@aws-amplify/ui-react-core/node_modules/@xstate/react/es/utils.js","../../../../node_modules/@aws-amplify/ui-react-core/node_modules/@xstate/react/es/useSelector.js","../../../../node_modules/@aws-amplify/ui-react-core/dist/esm/Authenticator/context/AuthenticatorContext.mjs","../../../../node_modules/@aws-amplify/ui-react-core/dist/esm/Authenticator/context/AuthenticatorProvider.mjs","../../../../node_modules/@aws-amplify/ui-react-core/dist/esm/Authenticator/hooks/useAuthenticator/constants.mjs","../../../../node_modules/@aws-amplify/ui-react-core/dist/esm/Authenticator/hooks/constants.mjs","../../../../node_modules/@aws-amplify/ui-react-core/dist/esm/Authenticator/hooks/utils.mjs","../../../../node_modules/@aws-amplify/ui-react-core/dist/esm/Authenticator/hooks/useAuthenticator/utils.mjs","../../../../node_modules/@aws-amplify/ui-react-core/dist/esm/Authenticator/hooks/useAuthenticator/useAuthenticator.mjs","../../../../node_modules/@aws-amplify/ui-react-core/dist/esm/Authenticator/hooks/useAuthenticatorInitMachine/useAuthenticatorInitMachine.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/hooks/useCustomComponents/index.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/helpers/utils.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/hooks/useFormHandlers/useFormHandlers.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/shared/RemoteErrorMessage.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/shared/FormField.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/shared/FormFields.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/RouteContainer/RouteContainer.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/ConfirmSignUp/ConfirmSignUp.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/ForceNewPassword/ForceNewPassword.mjs","../../../../node_modules/qrcode/lib/can-promise.js","../../../../node_modules/qrcode/lib/core/utils.js","../../../../node_modules/qrcode/lib/core/error-correction-level.js","../../../../node_modules/qrcode/lib/core/bit-buffer.js","../../../../node_modules/qrcode/lib/core/bit-matrix.js","../../../../node_modules/qrcode/lib/core/alignment-pattern.js","../../../../node_modules/qrcode/lib/core/finder-pattern.js","../../../../node_modules/qrcode/lib/core/mask-pattern.js","../../../../node_modules/qrcode/lib/core/error-correction-code.js","../../../../node_modules/qrcode/lib/core/galois-field.js","../../../../node_modules/qrcode/lib/core/polynomial.js","../../../../node_modules/qrcode/lib/core/reed-solomon-encoder.js","../../../../node_modules/qrcode/lib/core/version-check.js","../../../../node_modules/qrcode/lib/core/regex.js","../../../../node_modules/qrcode/lib/core/mode.js","../../../../node_modules/qrcode/lib/core/version.js","../../../../node_modules/qrcode/lib/core/format-info.js","../../../../node_modules/qrcode/lib/core/numeric-data.js","../../../../node_modules/qrcode/lib/core/alphanumeric-data.js","../../../../node_modules/encode-utf8/index.js","../../../../node_modules/qrcode/lib/core/byte-data.js","../../../../node_modules/qrcode/lib/core/kanji-data.js","../../../../node_modules/dijkstrajs/dijkstra.js","../../../../node_modules/qrcode/lib/core/segments.js","../../../../node_modules/qrcode/lib/core/qrcode.js","../../../../node_modules/qrcode/lib/renderer/utils.js","../../../../node_modules/qrcode/lib/renderer/canvas.js","../../../../node_modules/qrcode/lib/renderer/svg-tag.js","../../../../node_modules/qrcode/lib/browser.js","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/shared/ConfirmSignInFooter.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/SetupTOTP/SetupTOTP.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/FederatedSignIn/FederatedSignInButtons/FederatedSignInButton.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/FederatedSignIn/FederatedSignIn.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/SignIn/SignIn.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/SignUp/SignUp.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/shared/SignInSignUpTabs.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/shared/TwoButtonSubmitFooter.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/VerifyUser/ConfirmVerifyUser.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/VerifyUser/VerifyUser.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/ConfirmSignIn/ConfirmSignIn.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/ResetPassword/ConfirmResetPassword.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/ResetPassword/ResetPassword.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/utils.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/Router/Router.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/hooks/useCustomComponents/defaultComponents.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/version.mjs","../../../../node_modules/@aws-amplify/ui-react/dist/esm/components/Authenticator/Authenticator.mjs","../../../../node_modules/debounce/index.js","../../../../node_modules/react-remove-scroll/dist/es2015/medium.js","../../../../node_modules/react-remove-scroll/dist/es2015/UI.js","../../../../node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js","../../../../node_modules/react-remove-scroll/dist/es2015/handleScroll.js","../../../../node_modules/react-remove-scroll/dist/es2015/SideEffect.js","../../../../node_modules/react-remove-scroll/dist/es2015/sidecar.js","../../../../node_modules/react-remove-scroll/dist/es2015/Combination.js","../../../../node_modules/@mantine/utils/esm/find-element-ancestor/find-element-ancestor.js","../../../../node_modules/@mantine/utils/esm/create-scoped-keydown-handler/create-scoped-keydown-handler.js","../../../../node_modules/@mantine/utils/esm/get-context-item-index/get-context-item-index.js","../../../../node_modules/@mantine/utils/esm/create-safe-context/create-safe-context.js","../../../../node_modules/@mantine/utils/esm/pack-sx/pack-sx.js","../../../../node_modules/@mantine/utils/esm/get-safe-id/get-safe-id.js","../../../../node_modules/@mantine/utils/esm/noop/noop.js","../../../../node_modules/@mantine/utils/esm/close-on-escape/close-on-escape.js","../../../../node_modules/@mantine/utils/esm/create-event-handler/create-event-handler.js","../../../../node_modules/@mantine/utils/esm/use-hovered/use-hovered.js","../../../../node_modules/@mantine/utils/esm/group-options/group-options.js","../../../../node_modules/@mantine/utils/esm/create-use-external-events/create-use-external-events.js","../../../../node_modules/@mantine/utils/esm/is-element/is-element.js","../../../../node_modules/@mantine/styles/node_modules/clsx/dist/clsx.m.js","../../../../node_modules/@mantine/styles/esm/theme/default-colors.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/font-styles/font-styles.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/focus-styles/focus-styles.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/primary-shade/primary-shade.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/theme-color/theme-color.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/gradient/get-gradient-color-stops/get-gradient-color-stops.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/gradient/gradient.js","../../../../node_modules/@mantine/styles/esm/theme/utils/rem/rem.js","../../../../node_modules/@mantine/styles/esm/theme/utils/get-size/get-size.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/breakpoints/breakpoints.js","../../../../node_modules/@mantine/styles/esm/theme/utils/to-rgba/to-rgba.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/rgba/rgba.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/cover/cover.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/darken/darken.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/lighten/lighten.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/radius/radius.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/variant/variant.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/primary-color/primary-color.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/hover/hover.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/placeholder-styles/placeholder-styles.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/dimmed/dimmed.js","../../../../node_modules/@mantine/styles/esm/theme/functions/fns/index.js","../../../../node_modules/@mantine/styles/esm/theme/functions/attach-functions.js","../../../../node_modules/@mantine/styles/esm/theme/default-theme.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.browser.esm.js","../../../../node_modules/@emotion/utils/dist/emotion-utils.browser.esm.js","../../../../node_modules/@emotion/hash/dist/emotion-hash.esm.js","../../../../node_modules/@emotion/serialize/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.browser.esm.js","../../../../node_modules/@emotion/react/dist/emotion-element-5486c51c.browser.esm.js","../../../../node_modules/@emotion/react/dist/emotion-react.browser.esm.js","../../../../node_modules/@mantine/styles/esm/theme/GlobalStyles.js","../../../../node_modules/@mantine/styles/esm/theme/MantineCssVariables.js","../../../../node_modules/@mantine/styles/esm/theme/utils/merge-theme/merge-theme.js","../../../../node_modules/@mantine/styles/esm/theme/utils/filter-props/filter-props.js","../../../../node_modules/@mantine/styles/esm/theme/NormalizeCSS.js","../../../../node_modules/@mantine/styles/esm/theme/MantineProvider.js","../../../../node_modules/@mantine/styles/esm/theme/utils/get-default-z-index/get-default-z-index.js","../../../../node_modules/@mantine/styles/esm/tss/utils/use-guaranteed-memo/use-guaranteed-memo.js","../../../../node_modules/@mantine/styles/esm/tss/default-emotion-cache.js","../../../../node_modules/@mantine/styles/esm/tss/use-emotion-cache.js","../../../../node_modules/@mantine/styles/esm/tss/use-css.js","../../../../node_modules/@mantine/styles/esm/tss/utils/merge-class-names/merge-class-names.js","../../../../node_modules/@mantine/styles/esm/tss/create-styles.js","../../../../node_modules/@mantine/styles/esm/tss/get-styles-ref.js","../../../../node_modules/@mantine/styles/esm/tss/Global.js","../../../../node_modules/@mantine/core/esm/Transition/transitions.js","../../../../node_modules/@mantine/hooks/esm/use-click-outside/use-click-outside.js","../../../../node_modules/@mantine/hooks/esm/use-clipboard/use-clipboard.js","../../../../node_modules/@mantine/hooks/esm/use-media-query/use-media-query.js","../../../../node_modules/@mantine/hooks/esm/utils/clamp/clamp.js","../../../../node_modules/@mantine/hooks/esm/use-isomorphic-effect/use-isomorphic-effect.js","../../../../node_modules/@mantine/hooks/esm/use-did-update/use-did-update.js","../../../../node_modules/@mantine/hooks/esm/use-focus-return/use-focus-return.js","../../../../node_modules/@mantine/hooks/esm/use-focus-trap/tabbable.js","../../../../node_modules/@mantine/hooks/esm/use-focus-trap/scope-tab.js","../../../../node_modules/@mantine/hooks/esm/utils/random-id/random-id.js","../../../../node_modules/@mantine/hooks/esm/use-focus-trap/create-aria-hider.js","../../../../node_modules/@mantine/hooks/esm/use-focus-trap/use-focus-trap.js","../../../../node_modules/@mantine/hooks/esm/use-force-update/use-force-update.js","../../../../node_modules/@mantine/hooks/esm/use-id/use-react-id.js","../../../../node_modules/@mantine/hooks/esm/use-id/use-id.js","../../../../node_modules/@mantine/hooks/esm/use-window-event/use-window-event.js","../../../../node_modules/@mantine/hooks/esm/utils/assign-ref/assign-ref.js","../../../../node_modules/@mantine/hooks/esm/use-merged-ref/use-merged-ref.js","../../../../node_modules/@mantine/hooks/esm/use-move/use-move.js","../../../../node_modules/@mantine/hooks/esm/use-uncontrolled/use-uncontrolled.js","../../../../node_modules/@mantine/hooks/esm/use-queue/use-queue.js","../../../../node_modules/@mantine/hooks/esm/use-reduced-motion/use-reduced-motion.js","../../../../node_modules/@mantine/hooks/esm/use-scroll-into-view/utils/ease-in-out-quad.js","../../../../node_modules/@mantine/hooks/esm/use-scroll-into-view/utils/get-relative-position.js","../../../../node_modules/@mantine/hooks/esm/use-scroll-into-view/utils/get-scroll-start.js","../../../../node_modules/@mantine/hooks/esm/use-scroll-into-view/utils/set-scroll-param.js","../../../../node_modules/@mantine/hooks/esm/use-scroll-into-view/use-scroll-into-view.js","../../../../node_modules/@mantine/hooks/esm/use-os/use-os.js","../../../../node_modules/@mantine/hooks/esm/use-disclosure/use-disclosure.js","../../../../node_modules/@mantine/core/esm/Box/style-system-props/extract-system-styles/extract-system-styles.js","../../../../node_modules/@mantine/core/esm/Box/style-system-props/get-responsive-value/get-responsive-value.js","../../../../node_modules/@mantine/core/esm/Box/style-system-props/value-getters/get-color-value.js","../../../../node_modules/@mantine/core/esm/Box/style-system-props/value-getters/get-default-value.js","../../../../node_modules/@mantine/core/esm/Box/style-system-props/value-getters/get-font-size-value.js","../../../../node_modules/@mantine/core/esm/Box/style-system-props/value-getters/get-spacing-value.js","../../../../node_modules/@mantine/core/esm/Box/style-system-props/value-getters/value-getters.js","../../../../node_modules/@mantine/core/esm/Box/style-system-props/system-props/system-props.js","../../../../node_modules/@mantine/core/esm/Box/style-system-props/get-system-styles/get-system-styles.js","../../../../node_modules/@mantine/core/esm/Box/use-sx/use-sx.js","../../../../node_modules/@mantine/core/esm/Box/Box.js","../../../../node_modules/@mantine/core/esm/UnstyledButton/UnstyledButton.styles.js","../../../../node_modules/@mantine/core/esm/UnstyledButton/UnstyledButton.js","../../../../node_modules/@mantine/core/esm/Collapse/use-collapse.js","../../../../node_modules/@mantine/core/esm/Collapse/Collapse.js","../../../../node_modules/@mantine/core/esm/Accordion/ChevronIcon.js","../../../../node_modules/@mantine/core/esm/ActionIcon/ActionIcon.styles.js","../../../../node_modules/@mantine/core/esm/Loader/loaders/Bars.js","../../../../node_modules/@mantine/core/esm/Loader/loaders/Oval.js","../../../../node_modules/@mantine/core/esm/Loader/loaders/Dots.js","../../../../node_modules/@mantine/core/esm/Loader/Loader.js","../../../../node_modules/@mantine/core/esm/ActionIcon/ActionIcon.js","../../../../node_modules/@mantine/core/esm/Portal/Portal.js","../../../../node_modules/@mantine/core/esm/Portal/OptionalPortal.js","../../../../node_modules/@mantine/core/esm/CloseButton/CloseIcon.js","../../../../node_modules/@mantine/core/esm/CloseButton/CloseButton.js","../../../../node_modules/@mantine/core/esm/Text/Text.styles.js","../../../../node_modules/@mantine/core/esm/Text/Text.js","../../../../node_modules/@mantine/core/esm/AppShell/AppShell.context.js","../../../../node_modules/@mantine/core/esm/AppShell/HorizontalSection/get-sorted-breakpoints/get-sorted-breakpoints.js","../../../../node_modules/@mantine/core/esm/AppShell/HorizontalSection/HorizontalSection.styles.js","../../../../node_modules/@mantine/core/esm/AppShell/HorizontalSection/HorizontalSection.js","../../../../node_modules/@mantine/core/esm/AppShell/HorizontalSection/Section/Section.js","../../../../node_modules/@mantine/core/esm/AppShell/Navbar/Navbar.js","../../../../node_modules/@mantine/core/esm/AppShell/VerticalSection/VerticalSection.styles.js","../../../../node_modules/@mantine/core/esm/AppShell/VerticalSection/VerticalSection.js","../../../../node_modules/@mantine/core/esm/AppShell/Header/Header.js","../../../../node_modules/@mantine/core/esm/AppShell/AppShell.styles.js","../../../../node_modules/@mantine/core/esm/AppShell/AppShell.js","../../../../node_modules/@mantine/core/esm/Divider/Divider.styles.js","../../../../node_modules/@mantine/core/esm/Divider/Divider.js","../../../../node_modules/@mantine/core/esm/Select/SelectItems/SelectItems.styles.js","../../../../node_modules/@mantine/core/esm/Select/SelectItems/SelectItems.js","../../../../node_modules/@mantine/core/esm/Select/DefaultItem/DefaultItem.js","../../../../node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-slot/dist/index.module.js","../../../../node_modules/@radix-ui/react-scroll-area/node_modules/@radix-ui/react-primitive/dist/index.module.js","../../../../node_modules/@radix-ui/react-scroll-area/dist/index.module.js","../../../../node_modules/@mantine/core/esm/ScrollArea/ScrollArea.styles.js","../../../../node_modules/@mantine/core/esm/ScrollArea/ScrollArea.js","../../../../node_modules/@mantine/core/esm/Select/SelectScrollArea/SelectScrollArea.js","../../../../node_modules/@mantine/core/esm/Select/SelectPopover/SelectPopover.styles.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/@floating-ui/react-dom/dist/floating-ui.react-dom.esm.js","../../../../node_modules/@floating-ui/react/dist/floating-ui.react.esm.js","../../../../node_modules/@mantine/core/esm/Floating/use-floating-auto-update.js","../../../../node_modules/@mantine/core/esm/Popover/use-popover.js","../../../../node_modules/@mantine/core/esm/Popover/Popover.errors.js","../../../../node_modules/@mantine/core/esm/Popover/Popover.context.js","../../../../node_modules/@mantine/core/esm/Popover/PopoverTarget/PopoverTarget.js","../../../../node_modules/@mantine/core/esm/Popover/PopoverDropdown/PopoverDropdown.styles.js","../../../../node_modules/@mantine/core/esm/Transition/get-transition-styles/get-transition-styles.js","../../../../node_modules/@mantine/core/esm/Transition/use-transition.js","../../../../node_modules/@mantine/core/esm/Transition/Transition.js","../../../../node_modules/@mantine/core/esm/FocusTrap/FocusTrap.js","../../../../node_modules/@mantine/core/esm/Floating/FloatingArrow/get-arrow-position-styles.js","../../../../node_modules/@mantine/core/esm/Floating/FloatingArrow/FloatingArrow.js","../../../../node_modules/@mantine/core/esm/Popover/PopoverDropdown/PopoverDropdown.js","../../../../node_modules/@mantine/core/esm/Floating/get-floating-position/get-floating-position.js","../../../../node_modules/@mantine/core/esm/Popover/Popover.js","../../../../node_modules/@mantine/core/esm/Select/SelectPopover/SelectPopover.js","../../../../node_modules/@mantine/core/esm/Input/use-input-props.js","../../../../node_modules/@mantine/core/esm/Input/InputLabel/InputLabel.styles.js","../../../../node_modules/@mantine/core/esm/Input/InputLabel/InputLabel.js","../../../../node_modules/@mantine/core/esm/Input/InputError/InputError.styles.js","../../../../node_modules/@mantine/core/esm/Input/InputError/InputError.js","../../../../node_modules/@mantine/core/esm/Input/InputDescription/InputDescription.styles.js","../../../../node_modules/@mantine/core/esm/Input/InputDescription/InputDescription.js","../../../../node_modules/@mantine/core/esm/Input/InputWrapper.context.js","../../../../node_modules/@mantine/core/esm/Input/InputWrapper/get-input-offsets.js","../../../../node_modules/@mantine/core/esm/Input/InputWrapper/InputWrapper.styles.js","../../../../node_modules/@mantine/core/esm/Input/InputWrapper/InputWrapper.js","../../../../node_modules/@mantine/core/esm/Input/InputPlaceholder/InputPlaceholder.js","../../../../node_modules/@mantine/core/esm/Input/Input.styles.js","../../../../node_modules/@mantine/core/esm/Input/Input.js","../../../../node_modules/@mantine/core/esm/Burger/Burger.styles.js","../../../../node_modules/@mantine/core/esm/Burger/Burger.js","../../../../node_modules/@mantine/core/esm/Button/ButtonGroup/ButtonGroup.styles.js","../../../../node_modules/@mantine/core/esm/Button/ButtonGroup/ButtonGroup.js","../../../../node_modules/@mantine/core/esm/Button/Button.styles.js","../../../../node_modules/@mantine/core/esm/Button/Button.js","../../../../node_modules/@mantine/core/esm/Paper/Paper.styles.js","../../../../node_modules/@mantine/core/esm/Paper/Paper.js","../../../../node_modules/@mantine/core/esm/Card/Card.context.js","../../../../node_modules/@mantine/core/esm/Card/CardSection/CardSection.styles.js","../../../../node_modules/@mantine/core/esm/Card/CardSection/CardSection.js","../../../../node_modules/@mantine/core/esm/Card/Card.styles.js","../../../../node_modules/@mantine/core/esm/Card/Card.js","../../../../node_modules/@mantine/core/esm/Center/Center.styles.js","../../../../node_modules/@mantine/core/esm/Center/Center.js","../../../../node_modules/@mantine/core/esm/Checkbox/CheckboxGroup.context.js","../../../../node_modules/@mantine/core/esm/Checkbox/CheckboxGroup/CheckboxGroup.js","../../../../node_modules/@mantine/core/esm/Checkbox/CheckboxIcon.js","../../../../node_modules/@mantine/core/esm/Checkbox/Checkbox.styles.js","../../../../node_modules/@mantine/core/esm/InlineInput/InlineInput.styles.js","../../../../node_modules/@mantine/core/esm/InlineInput/InlineInput.js","../../../../node_modules/@mantine/core/esm/Checkbox/Checkbox.js","../../../../node_modules/@mantine/core/esm/Chip/ChipGroup.context.js","../../../../node_modules/@mantine/core/esm/Chip/ChipGroup/ChipGroup.js","../../../../node_modules/@mantine/core/esm/Chip/Chip.styles.js","../../../../node_modules/@mantine/core/esm/Chip/Chip.js","../../../../node_modules/@mantine/core/esm/CopyButton/CopyButton.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBase.context.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBaseCloseButton/ModalBaseCloseButton.styles.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBaseCloseButton/ModalBaseCloseButton.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBaseOverlay/ModalBaseOverlay.styles.js","../../../../node_modules/@mantine/core/esm/Overlay/Overlay.styles.js","../../../../node_modules/@mantine/core/esm/Overlay/Overlay.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBaseOverlay/ModalBaseOverlay.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBaseContent/ModalBaseContent.styles.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBaseContent/ModalBaseContent.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBaseHeader/ModalBaseHeader.styles.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBaseHeader/ModalBaseHeader.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBaseTitle/ModalBaseTitle.styles.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBaseTitle/ModalBaseTitle.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBaseBody/ModalBaseBody.styles.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBaseBody/ModalBaseBody.js","../../../../node_modules/@mantine/core/esm/ModalBase/NativeScrollArea/NativeScrollArea.js","../../../../node_modules/@mantine/core/esm/ModalBase/use-lock-scroll.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBase.styles.js","../../../../node_modules/@mantine/core/esm/ModalBase/ModalBase.js","../../../../node_modules/@mantine/core/esm/FileButton/FileButton.js","../../../../node_modules/@mantine/core/esm/FileInput/FileInput.styles.js","../../../../node_modules/@mantine/core/esm/FileInput/FileInput.js","../../../../node_modules/@mantine/core/esm/Grid/Grid.context.js","../../../../node_modules/@mantine/core/esm/Grid/Col/Col.styles.js","../../../../node_modules/@mantine/core/esm/Grid/Col/Col.js","../../../../node_modules/@mantine/core/esm/Grid/Grid.styles.js","../../../../node_modules/@mantine/core/esm/Grid/Grid.js","../../../../node_modules/@mantine/core/esm/Group/filter-falsy-children/filter-falsy-children.js","../../../../node_modules/@mantine/core/esm/Group/Group.styles.js","../../../../node_modules/@mantine/core/esm/Group/Group.js","../../../../node_modules/@mantine/core/esm/Floating/use-delayed-hover.js","../../../../node_modules/@mantine/core/esm/Indicator/Indicator.styles.js","../../../../node_modules/@mantine/core/esm/Indicator/Indicator.js","../../../../node_modules/@babel/runtime/helpers/esm/objectWithoutPropertiesLoose.js","../../../../node_modules/use-latest/dist/use-latest.esm.js","../../../../node_modules/use-composed-ref/dist/use-composed-ref.esm.js","../../../../node_modules/react-textarea-autosize/dist/react-textarea-autosize.browser.esm.js","../../../../node_modules/@mantine/core/esm/Textarea/Textarea.styles.js","../../../../node_modules/@mantine/core/esm/Textarea/Textarea.js","../../../../node_modules/@mantine/core/esm/LoadingOverlay/LoadingOverlay.styles.js","../../../../node_modules/@mantine/core/esm/LoadingOverlay/LoadingOverlay.js","../../../../node_modules/@mantine/core/esm/MediaQuery/MediaQuery.styles.js","../../../../node_modules/@mantine/core/esm/MediaQuery/MediaQuery.js","../../../../node_modules/@mantine/core/esm/Menu/Menu.errors.js","../../../../node_modules/@mantine/core/esm/Menu/Menu.context.js","../../../../node_modules/@mantine/core/esm/Menu/MenuDivider/MenuDivider.styles.js","../../../../node_modules/@mantine/core/esm/Menu/MenuDivider/MenuDivider.js","../../../../node_modules/@mantine/core/esm/Menu/MenuDropdown/MenuDropdown.js","../../../../node_modules/@mantine/core/esm/Menu/MenuItem/MenuItem.styles.js","../../../../node_modules/@mantine/core/esm/Menu/MenuItem/MenuItem.js","../../../../node_modules/@mantine/core/esm/Menu/MenuLabel/MenuLabel.styles.js","../../../../node_modules/@mantine/core/esm/Menu/MenuLabel/MenuLabel.js","../../../../node_modules/@mantine/core/esm/Menu/MenuTarget/MenuTarget.js","../../../../node_modules/@mantine/core/esm/Menu/Menu.styles.js","../../../../node_modules/@mantine/core/esm/Menu/Menu.js","../../../../node_modules/@mantine/core/esm/Modal/Modal.context.js","../../../../node_modules/@mantine/core/esm/Modal/ModalRoot/ModalRoot.styles.js","../../../../node_modules/@mantine/core/esm/Modal/ModalRoot/ModalRoot.js","../../../../node_modules/@mantine/core/esm/Modal/ModalContent/ModalContent.js","../../../../node_modules/@mantine/core/esm/Modal/Modal.js","../../../../node_modules/@mantine/core/esm/MultiSelect/DefaultValue/DefaultValue.styles.js","../../../../node_modules/@mantine/core/esm/MultiSelect/DefaultValue/DefaultValue.js","../../../../node_modules/@mantine/core/esm/MultiSelect/filter-data/filter-data.js","../../../../node_modules/@mantine/core/esm/Select/SelectRightSection/ChevronIcon.js","../../../../node_modules/@mantine/core/esm/Select/SelectRightSection/SelectRightSection.js","../../../../node_modules/@mantine/core/esm/Select/SelectRightSection/get-select-right-section-props.js","../../../../node_modules/@mantine/core/esm/MultiSelect/MultiSelect.styles.js","../../../../node_modules/@mantine/core/esm/MultiSelect/MultiSelect.js","../../../../node_modules/@mantine/core/esm/Notification/Notification.styles.js","../../../../node_modules/@mantine/core/esm/Notification/Notification.js","../../../../node_modules/@mantine/core/esm/NumberInput/get-input-mode/get-input-mode.js","../../../../node_modules/@mantine/core/esm/NumberInput/Chevron.js","../../../../node_modules/@mantine/core/esm/NumberInput/NumberInput.styles.js","../../../../node_modules/@mantine/core/esm/TextInput/TextInput.js","../../../../node_modules/@mantine/core/esm/NumberInput/NumberInput.js","../../../../node_modules/@mantine/core/esm/PasswordInput/PasswordToggleIcon.js","../../../../node_modules/@mantine/core/esm/PasswordInput/PasswordInput.styles.js","../../../../node_modules/@mantine/core/esm/PasswordInput/PasswordInput.js","../../../../node_modules/@mantine/core/esm/Radio/RadioIcon.js","../../../../node_modules/@mantine/core/esm/Radio/RadioGroup.context.js","../../../../node_modules/@mantine/core/esm/Radio/RadioGroup/RadioGroup.js","../../../../node_modules/@mantine/core/esm/Radio/Radio.styles.js","../../../../node_modules/@mantine/core/esm/Radio/Radio.js","../../../../node_modules/@mantine/core/esm/Select/filter-data/filter-data.js","../../../../node_modules/@mantine/core/esm/Select/Select.styles.js","../../../../node_modules/@mantine/core/esm/Select/Select.js","../../../../node_modules/@mantine/core/esm/SimpleGrid/get-sorted-breakpoints/get-sorted-breakpoints.js","../../../../node_modules/@mantine/core/esm/SimpleGrid/SimpleGrid.styles.js","../../../../node_modules/@mantine/core/esm/SimpleGrid/SimpleGrid.js","../../../../node_modules/@mantine/core/esm/Slider/utils/get-position/get-position.js","../../../../node_modules/@mantine/core/esm/Slider/utils/get-change-value/get-change-value.js","../../../../node_modules/@mantine/core/esm/Slider/SliderRoot/SliderRoot.styles.js","../../../../node_modules/@mantine/core/esm/Slider/Thumb/Thumb.styles.js","../../../../node_modules/@mantine/core/esm/Slider/Thumb/Thumb.js","../../../../node_modules/@mantine/core/esm/Slider/Marks/is-mark-filled.js","../../../../node_modules/@mantine/core/esm/Slider/Marks/Marks.styles.js","../../../../node_modules/@mantine/core/esm/Slider/Marks/Marks.js","../../../../node_modules/@mantine/core/esm/Slider/Track/Track.styles.js","../../../../node_modules/@mantine/core/esm/Slider/Track/Track.js","../../../../node_modules/@mantine/core/esm/Slider/SliderRoot/SliderRoot.js","../../../../node_modules/@mantine/core/esm/Slider/get-floating-value.js","../../../../node_modules/@mantine/core/esm/Slider/get-precision.js","../../../../node_modules/@mantine/core/esm/Slider/Slider/Slider.js","../../../../node_modules/@mantine/core/esm/Slider/utils/get-client-position/get-client-position.js","../../../../node_modules/@mantine/core/esm/Slider/RangeSlider/RangeSlider.js","../../../../node_modules/@mantine/core/esm/Space/Space.js","../../../../node_modules/@mantine/core/esm/Stack/Stack.styles.js","../../../../node_modules/@mantine/core/esm/Stack/Stack.js","../../../../node_modules/@mantine/core/esm/Stepper/Step/Step.styles.js","../../../../node_modules/@mantine/core/esm/Stepper/Step/Step.js","../../../../node_modules/@mantine/core/esm/Stepper/StepCompleted/StepCompleted.js","../../../../node_modules/@mantine/core/esm/Stepper/Stepper.styles.js","../../../../node_modules/@mantine/core/esm/Stepper/Stepper.js","../../../../node_modules/@mantine/core/esm/Switch/SwitchGroup.context.js","../../../../node_modules/@mantine/core/esm/Switch/SwitchGroup/SwitchGroup.js","../../../../node_modules/@mantine/core/esm/Switch/Switch.styles.js","../../../../node_modules/@mantine/core/esm/Switch/Switch.js","../../../../node_modules/@mantine/core/esm/Tabs/Tabs.errors.js","../../../../node_modules/@mantine/core/esm/Tabs/Tabs.context.js","../../../../node_modules/@mantine/core/esm/Tabs/TabsList/TabsList.styles.js","../../../../node_modules/@mantine/core/esm/Tabs/TabsList/TabsList.js","../../../../node_modules/@mantine/core/esm/Tabs/TabsPanel/TabsPanel.styles.js","../../../../node_modules/@mantine/core/esm/Tabs/TabsPanel/TabsPanel.js","../../../../node_modules/@mantine/core/esm/Tabs/Tab/Tab.styles.js","../../../../node_modules/@mantine/core/esm/Tabs/Tab/Tab.js","../../../../node_modules/@mantine/core/esm/Tabs/TabsProvider.js","../../../../node_modules/@mantine/core/esm/Tabs/Tabs.styles.js","../../../../node_modules/@mantine/core/esm/Tabs/Tabs.js","../../../../node_modules/@babel/runtime/helpers/esm/setPrototypeOf.js","../../../../node_modules/@babel/runtime/helpers/esm/inheritsLoose.js","../../../../node_modules/prop-types/lib/ReactPropTypesSecret.js","../../../../node_modules/prop-types/factoryWithThrowingShims.js","../../../../node_modules/prop-types/index.js","../../../../node_modules/dom-helpers/esm/hasClass.js","../../../../node_modules/dom-helpers/esm/addClass.js","../../../../node_modules/dom-helpers/esm/removeClass.js","../../../../node_modules/react-transition-group/esm/config.js","../../../../node_modules/react-transition-group/esm/TransitionGroupContext.js","../../../../node_modules/react-transition-group/esm/Transition.js","../../../../node_modules/@babel/runtime/helpers/esm/assertThisInitialized.js","../../../../node_modules/react-transition-group/esm/utils/ChildMapping.js","../../../../node_modules/react-transition-group/esm/TransitionGroup.js","../../../../node_modules/@mantine/notifications/esm/events.js","../../../../node_modules/@mantine/notifications/esm/Notifications/get-position-styles/get-position-styles.js","../../../../node_modules/@mantine/notifications/esm/Notifications/get-notification-state-styles/get-notification-state-styles.js","../../../../node_modules/@mantine/notifications/esm/NotificationContainer/get-auto-close/get-auto-close.js","../../../../node_modules/@mantine/notifications/esm/NotificationContainer/NotificationContainer.js","../../../../node_modules/@mantine/notifications/esm/Notifications/Notifications.styles.js","../../../../node_modules/@mantine/notifications/esm/Notifications/use-notifications-state/use-notifications-state.js","../../../../node_modules/@mantine/notifications/esm/Notifications/Notifications.js","../../../../node_modules/nanoclone/src/index.js","../../../../node_modules/yup/es/util/printValue.js","../../../../node_modules/yup/es/locale.js","../../../../node_modules/lodash/_baseHas.js","../../../../node_modules/lodash/has.js","../../../../node_modules/yup/es/util/isSchema.js","../../../../node_modules/yup/es/Condition.js","../../../../node_modules/yup/es/util/toArray.js","../../../../node_modules/yup/es/ValidationError.js","../../../../node_modules/yup/es/util/runTests.js","../../../../node_modules/lodash/_baseForOwn.js","../../../../node_modules/lodash/mapValues.js","../../../../node_modules/property-expr/index.js","../../../../node_modules/yup/es/Reference.js","../../../../node_modules/yup/es/util/createValidation.js","../../../../node_modules/yup/es/util/reach.js","../../../../node_modules/yup/es/util/ReferenceSet.js","../../../../node_modules/yup/es/schema.js","../../../../node_modules/yup/es/mixed.js","../../../../node_modules/yup/es/util/isAbsent.js","../../../../node_modules/yup/es/boolean.js","../../../../node_modules/yup/es/string.js","../../../../node_modules/yup/es/number.js","../../../../node_modules/yup/es/util/isodate.js","../../../../node_modules/yup/es/date.js","../../../../node_modules/lodash/snakeCase.js","../../../../node_modules/lodash/_baseSlice.js","../../../../node_modules/lodash/_castSlice.js","../../../../node_modules/lodash/_hasUnicode.js","../../../../node_modules/lodash/_asciiToArray.js","../../../../node_modules/lodash/_unicodeToArray.js","../../../../node_modules/lodash/_stringToArray.js","../../../../node_modules/lodash/_createCaseFirst.js","../../../../node_modules/lodash/upperFirst.js","../../../../node_modules/lodash/capitalize.js","../../../../node_modules/lodash/camelCase.js","../../../../node_modules/lodash/mapKeys.js","../../../../node_modules/toposort/index.js","../../../../node_modules/yup/es/util/sortFields.js","../../../../node_modules/yup/es/util/sortByKeyOrder.js","../../../../node_modules/yup/es/object.js","../../../../node_modules/yup/es/array.js","../../../../node_modules/styled-components/node_modules/tslib/tslib.es6.mjs","../../../../node_modules/styled-components/node_modules/stylis/src/Enum.js","../../../../node_modules/styled-components/node_modules/stylis/src/Utility.js","../../../../node_modules/styled-components/node_modules/stylis/src/Tokenizer.js","../../../../node_modules/styled-components/node_modules/stylis/src/Parser.js","../../../../node_modules/styled-components/node_modules/stylis/src/Prefixer.js","../../../../node_modules/styled-components/node_modules/stylis/src/Serializer.js","../../../../node_modules/styled-components/node_modules/stylis/src/Middleware.js","../../../../node_modules/@emotion/unitless/dist/emotion-unitless.esm.js","../../../../node_modules/styled-components/dist/styled-components.browser.esm.js","../../../../node_modules/react-icons/lib/esm/iconContext.js","../../../../node_modules/react-icons/lib/esm/iconBase.js","../../../../node_modules/react-icons/ai/index.esm.js","../../../../node_modules/react-icons/ri/index.esm.js","../../../../node_modules/react-icons/bs/index.esm.js","../../../../node_modules/react-icons/fa6/index.esm.js","../../../../node_modules/react-icons/fc/index.esm.js","../../../../node_modules/react-icons/io/index.esm.js","../../../../node_modules/react-icons/io5/index.esm.js","../../../../node_modules/react-icons/md/index.esm.js","../../../../node_modules/react-icons/im/index.esm.js","../../../../node_modules/react-icons/bi/index.esm.js","../../../../node_modules/react-icons/tb/index.esm.js","../../../../node_modules/dayjs/plugin/relativeTime.js","../../../../node_modules/dayjs/plugin/utc.js","../../../../node_modules/dayjs/plugin/duration.js","../../../../node_modules/dayjs/plugin/isoWeek.js","../../../../node_modules/dayjs/locale/cs.js","../../../../node_modules/dayjs/locale/en-gb.js","../../../../node_modules/dayjs/locale/sk.js","../../../../node_modules/@remix-run/router/dist/router.js","../../../../node_modules/react-router/dist/index.js","../../../../node_modules/react-router-dom/dist/index.js","../../../../node_modules/@mantine/modals/esm/context.js","../../../../node_modules/@mantine/modals/esm/use-modals/use-modals.js","../../../../node_modules/@mantine/modals/esm/ConfirmModal.js","../../../../node_modules/@mantine/modals/esm/reducer.js","../../../../node_modules/@mantine/modals/esm/events.js","../../../../node_modules/@mantine/modals/esm/ModalsProvider.js","../../../../node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs","../../../../node_modules/framer-motion/dist/es/context/MotionContext/index.mjs","../../../../node_modules/framer-motion/dist/es/context/PresenceContext.mjs","../../../../node_modules/framer-motion/dist/es/utils/is-browser.mjs","../../../../node_modules/framer-motion/dist/es/utils/use-isomorphic-effect.mjs","../../../../node_modules/framer-motion/dist/es/context/LazyContext.mjs","../../../../node_modules/framer-motion/dist/es/motion/utils/use-visual-element.mjs","../../../../node_modules/framer-motion/dist/es/utils/is-ref-object.mjs","../../../../node_modules/framer-motion/dist/es/motion/utils/use-motion-ref.mjs","../../../../node_modules/framer-motion/dist/es/render/utils/is-variant-label.mjs","../../../../node_modules/framer-motion/dist/es/animation/utils/is-animation-controls.mjs","../../../../node_modules/framer-motion/dist/es/render/utils/variant-props.mjs","../../../../node_modules/framer-motion/dist/es/render/utils/is-controlling-variants.mjs","../../../../node_modules/framer-motion/dist/es/context/MotionContext/utils.mjs","../../../../node_modules/framer-motion/dist/es/context/MotionContext/create.mjs","../../../../node_modules/framer-motion/dist/es/motion/features/definitions.mjs","../../../../node_modules/framer-motion/dist/es/motion/features/load-features.mjs","../../../../node_modules/framer-motion/dist/es/utils/use-constant.mjs","../../../../node_modules/framer-motion/dist/es/projection/node/state.mjs","../../../../node_modules/framer-motion/dist/es/projection/node/id.mjs","../../../../node_modules/framer-motion/dist/es/context/LayoutGroupContext.mjs","../../../../node_modules/framer-motion/dist/es/context/SwitchLayoutGroupContext.mjs","../../../../node_modules/framer-motion/dist/es/motion/utils/symbol.mjs","../../../../node_modules/framer-motion/dist/es/motion/index.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/motion-proxy.mjs","../../../../node_modules/framer-motion/dist/es/render/svg/lowercase-elements.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/utils/is-svg-component.mjs","../../../../node_modules/framer-motion/dist/es/projection/styles/scale-correction.mjs","../../../../node_modules/framer-motion/dist/es/render/html/utils/transform.mjs","../../../../node_modules/framer-motion/dist/es/motion/utils/is-forced-motion-value.mjs","../../../../node_modules/framer-motion/dist/es/value/utils/is-motion-value.mjs","../../../../node_modules/framer-motion/dist/es/render/html/utils/build-transform.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/utils/is-css-variable.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/value-types/get-as-type.mjs","../../../../node_modules/framer-motion/dist/es/utils/clamp.mjs","../../../../node_modules/framer-motion/dist/es/value/types/numbers/index.mjs","../../../../node_modules/framer-motion/dist/es/value/types/utils.mjs","../../../../node_modules/framer-motion/dist/es/value/types/numbers/units.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/value-types/type-int.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/value-types/number.mjs","../../../../node_modules/framer-motion/dist/es/render/html/utils/build-styles.mjs","../../../../node_modules/framer-motion/dist/es/render/html/utils/create-render-state.mjs","../../../../node_modules/framer-motion/dist/es/render/html/use-props.mjs","../../../../node_modules/framer-motion/dist/es/motion/utils/valid-prop.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/utils/filter-props.mjs","../../../../node_modules/framer-motion/dist/es/render/svg/utils/transform-origin.mjs","../../../../node_modules/framer-motion/dist/es/render/svg/utils/path.mjs","../../../../node_modules/framer-motion/dist/es/render/svg/utils/build-attrs.mjs","../../../../node_modules/framer-motion/dist/es/render/svg/utils/create-render-state.mjs","../../../../node_modules/framer-motion/dist/es/render/svg/utils/is-svg-tag.mjs","../../../../node_modules/framer-motion/dist/es/render/svg/use-props.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/use-render.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/utils/camel-to-dash.mjs","../../../../node_modules/framer-motion/dist/es/render/html/utils/render.mjs","../../../../node_modules/framer-motion/dist/es/render/svg/utils/camel-case-attrs.mjs","../../../../node_modules/framer-motion/dist/es/render/svg/utils/render.mjs","../../../../node_modules/framer-motion/dist/es/render/html/utils/scrape-motion-values.mjs","../../../../node_modules/framer-motion/dist/es/render/svg/utils/scrape-motion-values.mjs","../../../../node_modules/framer-motion/dist/es/render/utils/resolve-variants.mjs","../../../../node_modules/framer-motion/dist/es/animation/utils/is-keyframes-target.mjs","../../../../node_modules/framer-motion/dist/es/utils/resolve-value.mjs","../../../../node_modules/framer-motion/dist/es/value/utils/resolve-motion-value.mjs","../../../../node_modules/framer-motion/dist/es/motion/utils/use-visual-state.mjs","../../../../node_modules/framer-motion/dist/es/render/svg/config-motion.mjs","../../../../node_modules/framer-motion/dist/es/render/html/config-motion.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/utils/create-config.mjs","../../../../node_modules/framer-motion/dist/es/events/add-dom-event.mjs","../../../../node_modules/framer-motion/dist/es/events/utils/is-primary-pointer.mjs","../../../../node_modules/framer-motion/dist/es/events/event-info.mjs","../../../../node_modules/framer-motion/dist/es/events/add-pointer-event.mjs","../../../../node_modules/framer-motion/dist/es/utils/pipe.mjs","../../../../node_modules/framer-motion/dist/es/gestures/drag/utils/lock.mjs","../../../../node_modules/framer-motion/dist/es/motion/features/Feature.mjs","../../../../node_modules/framer-motion/dist/es/gestures/hover.mjs","../../../../node_modules/framer-motion/dist/es/gestures/focus.mjs","../../../../node_modules/framer-motion/dist/es/gestures/utils/is-node-or-child.mjs","../../../../node_modules/framer-motion/dist/es/utils/noop.mjs","../../../../node_modules/framer-motion/dist/es/gestures/press.mjs","../../../../node_modules/framer-motion/dist/es/motion/features/viewport/observers.mjs","../../../../node_modules/framer-motion/dist/es/motion/features/viewport/index.mjs","../../../../node_modules/framer-motion/dist/es/motion/features/gestures.mjs","../../../../node_modules/framer-motion/dist/es/utils/shallow-compare.mjs","../../../../node_modules/framer-motion/dist/es/utils/is-numerical-string.mjs","../../../../node_modules/framer-motion/dist/es/utils/is-zero-value-string.mjs","../../../../node_modules/framer-motion/dist/es/frameloop/data.mjs","../../../../node_modules/framer-motion/dist/es/frameloop/on-next-frame.mjs","../../../../node_modules/framer-motion/dist/es/frameloop/create-render-step.mjs","../../../../node_modules/framer-motion/dist/es/frameloop/index.mjs","../../../../node_modules/framer-motion/dist/es/utils/array.mjs","../../../../node_modules/framer-motion/dist/es/utils/subscription-manager.mjs","../../../../node_modules/framer-motion/dist/es/utils/velocity-per-second.mjs","../../../../node_modules/framer-motion/dist/es/value/index.mjs","../../../../node_modules/framer-motion/dist/es/value/types/color/utils.mjs","../../../../node_modules/framer-motion/dist/es/value/types/color/rgba.mjs","../../../../node_modules/framer-motion/dist/es/value/types/color/hex.mjs","../../../../node_modules/framer-motion/dist/es/value/types/color/hsla.mjs","../../../../node_modules/framer-motion/dist/es/value/types/color/index.mjs","../../../../node_modules/framer-motion/dist/es/value/types/complex/index.mjs","../../../../node_modules/framer-motion/dist/es/value/types/complex/filter.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/value-types/defaults.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/value-types/animatable-none.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/value-types/test.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/value-types/type-auto.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/value-types/dimensions.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/value-types/find.mjs","../../../../node_modules/framer-motion/dist/es/render/utils/resolve-dynamic-variants.mjs","../../../../node_modules/framer-motion/dist/es/render/utils/setters.mjs","../../../../node_modules/framer-motion/dist/es/value/use-will-change/is.mjs","../../../../node_modules/framer-motion/dist/es/animation/optimized-appear/data-id.mjs","../../../../node_modules/framer-motion/dist/es/utils/errors.mjs","../../../../node_modules/framer-motion/dist/es/utils/time-conversion.mjs","../../../../node_modules/framer-motion/dist/es/utils/use-instant-transition-state.mjs","../../../../node_modules/framer-motion/dist/es/easing/modifiers/mirror.mjs","../../../../node_modules/framer-motion/dist/es/easing/modifiers/reverse.mjs","../../../../node_modules/framer-motion/dist/es/easing/ease.mjs","../../../../node_modules/framer-motion/dist/es/utils/mix.mjs","../../../../node_modules/framer-motion/dist/es/utils/hsla-to-rgba.mjs","../../../../node_modules/framer-motion/dist/es/utils/mix-color.mjs","../../../../node_modules/framer-motion/dist/es/utils/mix-complex.mjs","../../../../node_modules/framer-motion/dist/es/utils/progress.mjs","../../../../node_modules/framer-motion/dist/es/utils/interpolate.mjs","../../../../node_modules/framer-motion/dist/es/utils/offsets/fill.mjs","../../../../node_modules/framer-motion/dist/es/utils/offsets/default.mjs","../../../../node_modules/framer-motion/dist/es/utils/offsets/time.mjs","../../../../node_modules/framer-motion/dist/es/easing/cubic-bezier.mjs","../../../../node_modules/framer-motion/dist/es/easing/circ.mjs","../../../../node_modules/framer-motion/dist/es/easing/back.mjs","../../../../node_modules/framer-motion/dist/es/easing/anticipate.mjs","../../../../node_modules/framer-motion/dist/es/animation/utils/easing.mjs","../../../../node_modules/framer-motion/dist/es/animation/legacy-popmotion/keyframes.mjs","../../../../node_modules/framer-motion/dist/es/animation/legacy-popmotion/find-spring.mjs","../../../../node_modules/framer-motion/dist/es/animation/legacy-popmotion/spring.mjs","../../../../node_modules/framer-motion/dist/es/animation/legacy-popmotion/decay.mjs","../../../../node_modules/framer-motion/dist/es/animation/legacy-popmotion/index.mjs","../../../../node_modules/framer-motion/dist/es/animation/waapi/easing.mjs","../../../../node_modules/framer-motion/dist/es/animation/waapi/index.mjs","../../../../node_modules/framer-motion/dist/es/animation/waapi/supports.mjs","../../../../node_modules/framer-motion/dist/es/animation/waapi/utils/get-final-keyframe.mjs","../../../../node_modules/framer-motion/dist/es/animation/waapi/create-accelerated-animation.mjs","../../../../node_modules/framer-motion/dist/es/utils/delay.mjs","../../../../node_modules/framer-motion/dist/es/animation/create-instant-animation.mjs","../../../../node_modules/framer-motion/dist/es/animation/legacy-popmotion/inertia.mjs","../../../../node_modules/framer-motion/dist/es/animation/utils/default-transitions.mjs","../../../../node_modules/framer-motion/dist/es/animation/utils/is-animatable.mjs","../../../../node_modules/framer-motion/dist/es/animation/utils/transitions.mjs","../../../../node_modules/framer-motion/dist/es/animation/utils/keyframes.mjs","../../../../node_modules/framer-motion/dist/es/animation/index.mjs","../../../../node_modules/framer-motion/dist/es/render/utils/animation.mjs","../../../../node_modules/framer-motion/dist/es/render/utils/animation-state.mjs","../../../../node_modules/framer-motion/dist/es/motion/features/animation/index.mjs","../../../../node_modules/framer-motion/dist/es/motion/features/animation/exit.mjs","../../../../node_modules/framer-motion/dist/es/motion/features/animations.mjs","../../../../node_modules/framer-motion/dist/es/utils/distance.mjs","../../../../node_modules/framer-motion/dist/es/gestures/pan/PanSession.mjs","../../../../node_modules/framer-motion/dist/es/projection/geometry/delta-calc.mjs","../../../../node_modules/framer-motion/dist/es/gestures/drag/utils/constraints.mjs","../../../../node_modules/framer-motion/dist/es/projection/geometry/models.mjs","../../../../node_modules/framer-motion/dist/es/projection/utils/each-axis.mjs","../../../../node_modules/framer-motion/dist/es/projection/geometry/conversion.mjs","../../../../node_modules/framer-motion/dist/es/projection/utils/has-transform.mjs","../../../../node_modules/framer-motion/dist/es/projection/geometry/delta-apply.mjs","../../../../node_modules/framer-motion/dist/es/projection/utils/measure.mjs","../../../../node_modules/framer-motion/dist/es/gestures/drag/VisualElementDragControls.mjs","../../../../node_modules/framer-motion/dist/es/gestures/drag/index.mjs","../../../../node_modules/framer-motion/dist/es/gestures/pan/index.mjs","../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/use-presence.mjs","../../../../node_modules/framer-motion/dist/es/projection/styles/scale-border-radius.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/utils/css-variables-conversion.mjs","../../../../node_modules/framer-motion/dist/es/projection/styles/scale-box-shadow.mjs","../../../../node_modules/framer-motion/dist/es/motion/features/layout/MeasureLayout.mjs","../../../../node_modules/framer-motion/dist/es/animation/animate.mjs","../../../../node_modules/framer-motion/dist/es/projection/animation/mix-values.mjs","../../../../node_modules/framer-motion/dist/es/projection/geometry/copy.mjs","../../../../node_modules/framer-motion/dist/es/projection/geometry/delta-remove.mjs","../../../../node_modules/framer-motion/dist/es/projection/geometry/utils.mjs","../../../../node_modules/framer-motion/dist/es/projection/shared/stack.mjs","../../../../node_modules/framer-motion/dist/es/projection/styles/transform.mjs","../../../../node_modules/framer-motion/dist/es/render/utils/compare-by-depth.mjs","../../../../node_modules/framer-motion/dist/es/render/utils/flat-tree.mjs","../../../../node_modules/framer-motion/dist/es/debug/record.mjs","../../../../node_modules/framer-motion/dist/es/projection/node/create-projection-node.mjs","../../../../node_modules/framer-motion/dist/es/projection/node/DocumentProjectionNode.mjs","../../../../node_modules/framer-motion/dist/es/projection/node/HTMLProjectionNode.mjs","../../../../node_modules/framer-motion/dist/es/motion/features/drag.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/utils/unit-conversion.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/utils/parse-dom-variant.mjs","../../../../node_modules/framer-motion/dist/es/utils/reduced-motion/state.mjs","../../../../node_modules/framer-motion/dist/es/utils/reduced-motion/index.mjs","../../../../node_modules/framer-motion/dist/es/render/utils/motion-values.mjs","../../../../node_modules/framer-motion/dist/es/render/VisualElement.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/DOMVisualElement.mjs","../../../../node_modules/framer-motion/dist/es/render/html/HTMLVisualElement.mjs","../../../../node_modules/framer-motion/dist/es/render/svg/SVGVisualElement.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/create-visual-element.mjs","../../../../node_modules/framer-motion/dist/es/motion/features/layout.mjs","../../../../node_modules/framer-motion/dist/es/render/dom/motion.mjs","../../../../node_modules/framer-motion/dist/es/utils/use-is-mounted.mjs","../../../../node_modules/framer-motion/dist/es/utils/use-force-update.mjs","../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs","../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs","../../../../node_modules/framer-motion/dist/es/utils/use-unmount-effect.mjs","../../../../node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs","../../../../node_modules/react-icons/fa/index.esm.js","../../../../node_modules/react-icons/gi/index.esm.js","../../../../node_modules/react-icons/fi/index.esm.js","../../../../node_modules/react-hook-form/dist/index.esm.mjs","../../../../node_modules/ua-parser-js/dist/ua-parser.min.js","../../../../node_modules/react-device-detect/dist/lib.js","../../../../node_modules/@mantine/dates/esm/components/CalendarHeader/Chevron.js","../../../../node_modules/@mantine/dates/esm/components/Day/Day.styles.js","../../../../node_modules/@mantine/dates/esm/components/CalendarHeader/CalendarHeader.styles.js","../../../../node_modules/@mantine/dates/esm/components/CalendarHeader/CalendarHeader.js","../../../../node_modules/@mantine/dates/esm/components/Calendar/clamp-level/clamp-level.js","../../../../node_modules/@mantine/dates/esm/components/Calendar/Calendar.styles.js","../../../../node_modules/@mantine/dates/esm/components/MonthLevelGroup/MonthLevelGroup.styles.js","../../../../node_modules/@mantine/dates/esm/components/MonthLevel/MonthLevel.styles.js","../../../../node_modules/@mantine/dates/esm/components/DatesProvider/DatesProvider.js","../../../../node_modules/@mantine/dates/esm/components/DatesProvider/use-dates-context.js","../../../../node_modules/@mantine/dates/esm/components/Month/get-start-of-week/get-start-of-week.js","../../../../node_modules/@mantine/dates/esm/components/Month/get-end-of-week/get-end-of-week.js","../../../../node_modules/@mantine/dates/esm/components/Month/get-month-days/get-month-days.js","../../../../node_modules/@mantine/dates/esm/components/Month/is-same-month/is-same-month.js","../../../../node_modules/@mantine/dates/esm/components/Month/is-before-max-date/is-before-max-date.js","../../../../node_modules/@mantine/dates/esm/components/Month/is-after-min-date/is-after-min-date.js","../../../../node_modules/@mantine/dates/esm/components/Month/Month.styles.js","../../../../node_modules/@mantine/dates/esm/components/Month/get-date-in-tab-order/get-date-in-tab-order.js","../../../../node_modules/@mantine/dates/esm/components/Day/Day.js","../../../../node_modules/@mantine/dates/esm/components/WeekdaysRow/get-weekdays-names/get-weekdays-names.js","../../../../node_modules/@mantine/dates/esm/components/WeekdaysRow/WeekdaysRow.styles.js","../../../../node_modules/@mantine/dates/esm/components/WeekdaysRow/WeekdaysRow.js","../../../../node_modules/@mantine/dates/esm/components/Month/Month.js","../../../../node_modules/@mantine/dates/esm/components/MonthLevel/MonthLevel.js","../../../../node_modules/@mantine/dates/esm/utils/handle-control-key-down.js","../../../../node_modules/@mantine/dates/esm/components/MonthLevelGroup/MonthLevelGroup.js","../../../../node_modules/@mantine/dates/esm/components/YearLevelGroup/YearLevelGroup.styles.js","../../../../node_modules/@mantine/dates/esm/components/YearLevel/YearLevel.styles.js","../../../../node_modules/@mantine/dates/esm/components/MonthsList/get-months-data/get-months-data.js","../../../../node_modules/@mantine/dates/esm/components/MonthsList/is-month-disabled/is-month-disabled.js","../../../../node_modules/@mantine/dates/esm/components/MonthsList/MonthsList.styles.js","../../../../node_modules/@mantine/dates/esm/components/MonthsList/get-month-in-tab-order/get-month-in-tab-order.js","../../../../node_modules/@mantine/dates/esm/components/PickerControl/PickerControl.styles.js","../../../../node_modules/@mantine/dates/esm/components/PickerControl/PickerControl.js","../../../../node_modules/@mantine/dates/esm/components/MonthsList/MonthsList.js","../../../../node_modules/@mantine/dates/esm/components/YearLevel/YearLevel.js","../../../../node_modules/@mantine/dates/esm/components/YearLevelGroup/YearLevelGroup.js","../../../../node_modules/@mantine/dates/esm/components/DecadeLevelGroup/DecadeLevelGroup.styles.js","../../../../node_modules/@mantine/dates/esm/components/YearsList/get-years-data/get-years-data.js","../../../../node_modules/@mantine/dates/esm/components/DecadeLevel/get-decade-range/get-decade-range.js","../../../../node_modules/@mantine/dates/esm/components/DecadeLevel/DecadeLevel.styles.js","../../../../node_modules/@mantine/dates/esm/components/YearsList/is-year-disabled/is-year-disabled.js","../../../../node_modules/@mantine/dates/esm/components/YearsList/YearsList.styles.js","../../../../node_modules/@mantine/dates/esm/components/YearsList/get-year-in-tab-order/get-year-in-tab-order.js","../../../../node_modules/@mantine/dates/esm/components/YearsList/YearsList.js","../../../../node_modules/@mantine/dates/esm/components/DecadeLevel/DecadeLevel.js","../../../../node_modules/@mantine/dates/esm/components/DecadeLevelGroup/DecadeLevelGroup.js","../../../../node_modules/@mantine/dates/esm/components/Calendar/Calendar.js","../../../../node_modules/@mantine/dates/esm/components/Calendar/pick-calendar-levels-props/pick-calendar-levels-props.js","../../../../node_modules/@mantine/dates/esm/components/HiddenDatesInput/HiddenDatesInput.js","../../../../node_modules/@mantine/dates/esm/utils/assign-time/assign-time.js","../../../../node_modules/@mantine/dates/esm/hooks/use-uncontrolled-dates/use-uncontrolled-dates.js","../../../../node_modules/@mantine/dates/esm/hooks/use-dates-state/is-in-range/is-in-range.js","../../../../node_modules/@mantine/dates/esm/hooks/use-dates-state/use-dates-state.js","../../../../node_modules/@mantine/dates/esm/components/DatePicker/DatePicker.js","../../../../node_modules/@mantine/dates/esm/utils/get-formatted-date.js","../../../../node_modules/@mantine/dates/esm/hooks/use-dates-input/use-dates-input.js","../../../../node_modules/@mantine/dates/esm/utils/get-default-clamped-date.js","../../../../node_modules/@mantine/dates/esm/components/PickerInputBase/PickerInputBase.styles.js","../../../../node_modules/@mantine/dates/esm/components/PickerInputBase/PickerInputBase.js","../../../../node_modules/@mantine/dates/esm/components/DatePickerInput/DatePickerInput.js","../../../../node_modules/@mantine/dates/esm/components/DateTimePicker/DateTimePicker.styles.js","../../../../node_modules/@mantine/dates/esm/components/TimeInput/TimeInput.styles.js","../../../../node_modules/@mantine/dates/esm/components/TimeInput/TimeInput.js","../../../../node_modules/@mantine/dates/esm/components/DateTimePicker/DateTimePicker.js","../../../../node_modules/react-image-crop/dist/index.js","../../../../node_modules/pure-color/parse/hex.js","../../../../node_modules/pure-color/convert/rgb2hsv.js","../../../../node_modules/pure-color/util/clamp.js","../../../../node_modules/pure-color/convert/rgb2hex.js","../../../../node_modules/pure-color/convert/hsv2rgb.js","../../../../node_modules/is-buffer/index.js","../../../../node_modules/deep-rename-keys/node_modules/kind-of/index.js","../../../../node_modules/rename-keys/index.js","../../../../node_modules/deep-rename-keys/index.js","../../../../node_modules/eventemitter3/index.js","../../../../node_modules/xml-lexer/dist/lexer.js","../../../../node_modules/xml-reader/dist/reader.js","../../../../node_modules/svgson/dist/svgson.esm.js","../../../../node_modules/@dicebear/avatars/dist/index.es.js","../../../../node_modules/@dicebear/pixel-art/dist/index.es.js","../../../../node_modules/@react-google-maps/api/dist/esm.js","../../../../node_modules/@hookform/resolvers/dist/resolvers.mjs","../../../../node_modules/@hookform/resolvers/yup/dist/yup.mjs","../../../../node_modules/react-share/node_modules/classnames/index.js","../../../../node_modules/jsonp/node_modules/ms/index.js","../../../../node_modules/jsonp/node_modules/debug/src/debug.js","../../../../node_modules/jsonp/node_modules/debug/src/browser.js","../../../../node_modules/jsonp/index.js","../../../../node_modules/react-share/dist/index.js","../../../../node_modules/lodash.isequal/index.js","../../../../node_modules/qrcode-generator/qrcode.js","../../../../node_modules/react-qrcode-logo/dist/index.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/objectWithoutProperties.js","../../../../node_modules/@babel/runtime/helpers/esm/classCallCheck.js","../../../../node_modules/@babel/runtime/helpers/esm/createClass.js","../../../../node_modules/@babel/runtime/helpers/esm/getPrototypeOf.js","../../../../node_modules/@babel/runtime/helpers/esm/isNativeReflectConstruct.js","../../../../node_modules/@babel/runtime/helpers/esm/possibleConstructorReturn.js","../../../../node_modules/@babel/runtime/helpers/esm/callSuper.js","../../../../node_modules/@babel/runtime/helpers/esm/inherits.js","../../../../node_modules/@babel/runtime/helpers/esm/arrayWithHoles.js","../../../../node_modules/@babel/runtime/helpers/esm/iterableToArrayLimit.js","../../../../node_modules/@babel/runtime/helpers/esm/arrayLikeToArray.js","../../../../node_modules/@babel/runtime/helpers/esm/unsupportedIterableToArray.js","../../../../node_modules/@babel/runtime/helpers/esm/nonIterableRest.js","../../../../node_modules/@babel/runtime/helpers/esm/slicedToArray.js","../../../../node_modules/clsx/dist/clsx.m.js","../../../../node_modules/invariant/browser.js","../../../../node_modules/uncontrollable/lib/esm/utils.js","../../../../node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js","../../../../node_modules/uncontrollable/lib/esm/uncontrollable.js","../../../../node_modules/date-arithmetic/index.js","../../../../node_modules/@babel/runtime/helpers/esm/arrayWithoutHoles.js","../../../../node_modules/@babel/runtime/helpers/esm/iterableToArray.js","../../../../node_modules/@babel/runtime/helpers/esm/nonIterableSpread.js","../../../../node_modules/@babel/runtime/helpers/esm/toConsumableArray.js","../../../../node_modules/lodash/toFinite.js","../../../../node_modules/lodash/toInteger.js","../../../../node_modules/lodash/chunk.js","../../../../node_modules/dom-helpers/esm/ownerDocument.js","../../../../node_modules/dom-helpers/esm/ownerWindow.js","../../../../node_modules/dom-helpers/esm/getComputedStyle.js","../../../../node_modules/dom-helpers/esm/hyphenate.js","../../../../node_modules/dom-helpers/esm/hyphenateStyle.js","../../../../node_modules/dom-helpers/esm/isTransform.js","../../../../node_modules/dom-helpers/esm/css.js","../../../../node_modules/dom-helpers/esm/contains.js","../../../../node_modules/dom-helpers/esm/isDocument.js","../../../../node_modules/dom-helpers/esm/isWindow.js","../../../../node_modules/dom-helpers/esm/getScrollAccessor.js","../../../../node_modules/dom-helpers/esm/scrollLeft.js","../../../../node_modules/dom-helpers/esm/scrollTop.js","../../../../node_modules/dom-helpers/esm/offset.js","../../../../node_modules/dom-helpers/esm/offsetParent.js","../../../../node_modules/dom-helpers/esm/position.js","../../../../node_modules/dom-helpers/esm/canUseDOM.js","../../../../node_modules/dom-helpers/esm/animationFrame.js","../../../../node_modules/dom-helpers/esm/matches.js","../../../../node_modules/dom-helpers/esm/querySelectorAll.js","../../../../node_modules/dom-helpers/esm/addEventListener.js","../../../../node_modules/@restart/hooks/esm/useCommittedRef.js","../../../../node_modules/@restart/hooks/esm/useEventCallback.js","../../../../node_modules/@restart/hooks/esm/useCallbackRef.js","../../../../node_modules/@restart/hooks/esm/useMounted.js","../../../../node_modules/@restart/hooks/esm/useSafeState.js","../../../../node_modules/@popperjs/core/lib/enums.js","../../../../node_modules/@popperjs/core/lib/utils/getBasePlacement.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getWindow.js","../../../../node_modules/@popperjs/core/lib/dom-utils/instanceOf.js","../../../../node_modules/@popperjs/core/lib/utils/math.js","../../../../node_modules/@popperjs/core/lib/utils/userAgent.js","../../../../node_modules/@popperjs/core/lib/dom-utils/isLayoutViewport.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getBoundingClientRect.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getLayoutRect.js","../../../../node_modules/@popperjs/core/lib/dom-utils/contains.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getNodeName.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getComputedStyle.js","../../../../node_modules/@popperjs/core/lib/dom-utils/isTableElement.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentElement.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getParentNode.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getOffsetParent.js","../../../../node_modules/@popperjs/core/lib/utils/getMainAxisFromPlacement.js","../../../../node_modules/@popperjs/core/lib/utils/within.js","../../../../node_modules/@popperjs/core/lib/utils/getFreshSideObject.js","../../../../node_modules/@popperjs/core/lib/utils/mergePaddingObject.js","../../../../node_modules/@popperjs/core/lib/utils/expandToHashMap.js","../../../../node_modules/@popperjs/core/lib/modifiers/arrow.js","../../../../node_modules/@popperjs/core/lib/utils/getVariation.js","../../../../node_modules/@popperjs/core/lib/modifiers/computeStyles.js","../../../../node_modules/@popperjs/core/lib/modifiers/eventListeners.js","../../../../node_modules/@popperjs/core/lib/utils/getOppositePlacement.js","../../../../node_modules/@popperjs/core/lib/utils/getOppositeVariationPlacement.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScroll.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getWindowScrollBarX.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getViewportRect.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getDocumentRect.js","../../../../node_modules/@popperjs/core/lib/dom-utils/isScrollParent.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getScrollParent.js","../../../../node_modules/@popperjs/core/lib/dom-utils/listScrollParents.js","../../../../node_modules/@popperjs/core/lib/utils/rectToClientRect.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getClippingRect.js","../../../../node_modules/@popperjs/core/lib/utils/computeOffsets.js","../../../../node_modules/@popperjs/core/lib/utils/detectOverflow.js","../../../../node_modules/@popperjs/core/lib/utils/computeAutoPlacement.js","../../../../node_modules/@popperjs/core/lib/modifiers/flip.js","../../../../node_modules/@popperjs/core/lib/modifiers/hide.js","../../../../node_modules/@popperjs/core/lib/modifiers/offset.js","../../../../node_modules/@popperjs/core/lib/modifiers/popperOffsets.js","../../../../node_modules/@popperjs/core/lib/utils/getAltAxis.js","../../../../node_modules/@popperjs/core/lib/modifiers/preventOverflow.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getHTMLElementScroll.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getNodeScroll.js","../../../../node_modules/@popperjs/core/lib/dom-utils/getCompositeRect.js","../../../../node_modules/@popperjs/core/lib/utils/orderModifiers.js","../../../../node_modules/@popperjs/core/lib/utils/debounce.js","../../../../node_modules/@popperjs/core/lib/utils/mergeByName.js","../../../../node_modules/@popperjs/core/lib/createPopper.js","../../../../node_modules/react-overlays/esm/popper.js","../../../../node_modules/react-overlays/esm/usePopper.js","../../../../node_modules/dom-helpers/esm/removeEventListener.js","../../../../node_modules/dom-helpers/esm/listen.js","../../../../node_modules/warning/warning.js","../../../../node_modules/react-overlays/esm/safeFindDOMNode.js","../../../../node_modules/react-overlays/esm/ownerDocument.js","../../../../node_modules/react-overlays/esm/useRootClose.js","../../../../node_modules/react-overlays/esm/mergeOptionsWithPopperConfig.js","../../../../node_modules/dom-helpers/esm/scrollbarSize.js","../../../../node_modules/react-overlays/esm/useWaitForDOMRef.js","../../../../node_modules/@restart/hooks/esm/useMergedRefs.js","../../../../node_modules/react-overlays/esm/Overlay.js","../../../../node_modules/dom-helpers/esm/height.js","../../../../node_modules/dom-helpers/esm/closest.js","../../../../node_modules/lodash/_baseFindIndex.js","../../../../node_modules/lodash/findIndex.js","../../../../node_modules/lodash/_baseRange.js","../../../../node_modules/lodash/_createRange.js","../../../../node_modules/lodash/range.js","../../../../node_modules/memoize-one/dist/memoize-one.esm.js","../../../../node_modules/dom-helpers/esm/width.js","../../../../node_modules/lodash/_createBaseEach.js","../../../../node_modules/lodash/_baseEach.js","../../../../node_modules/lodash/_baseMap.js","../../../../node_modules/lodash/_baseSortBy.js","../../../../node_modules/lodash/_compareAscending.js","../../../../node_modules/lodash/_compareMultiple.js","../../../../node_modules/lodash/_baseOrderBy.js","../../../../node_modules/lodash/sortBy.js","../../../../node_modules/@babel/runtime/helpers/esm/toArray.js","../../../../node_modules/lodash/defaults.js","../../../../node_modules/lodash/_arrayEach.js","../../../../node_modules/lodash/_baseAssign.js","../../../../node_modules/lodash/_baseAssignIn.js","../../../../node_modules/lodash/_copySymbols.js","../../../../node_modules/lodash/_copySymbolsIn.js","../../../../node_modules/lodash/_initCloneArray.js","../../../../node_modules/lodash/_cloneDataView.js","../../../../node_modules/lodash/_cloneRegExp.js","../../../../node_modules/lodash/_cloneSymbol.js","../../../../node_modules/lodash/_initCloneByTag.js","../../../../node_modules/lodash/_baseIsMap.js","../../../../node_modules/lodash/isMap.js","../../../../node_modules/lodash/_baseIsSet.js","../../../../node_modules/lodash/isSet.js","../../../../node_modules/lodash/_baseClone.js","../../../../node_modules/lodash/last.js","../../../../node_modules/lodash/_parent.js","../../../../node_modules/lodash/_baseUnset.js","../../../../node_modules/lodash/_customOmitClone.js","../../../../node_modules/lodash/_flatRest.js","../../../../node_modules/lodash/omit.js","../../../../node_modules/lodash/transform.js","../../../../node_modules/dayjs/plugin/isBetween.js","../../../../node_modules/dayjs/plugin/isSameOrAfter.js","../../../../node_modules/dayjs/plugin/isSameOrBefore.js","../../../../node_modules/dayjs/plugin/localeData.js","../../../../node_modules/dayjs/plugin/localizedFormat.js","../../../../node_modules/dayjs/plugin/minMax.js","../../../../node_modules/dayjs/locale/en.js","../../../../node_modules/@firebase/util/dist/index.esm2017.js","../../../../node_modules/@firebase/component/dist/esm/index.esm2017.js","../../../../node_modules/@firebase/logger/dist/esm/index.esm2017.js","../../../../node_modules/@firebase/app/node_modules/idb/build/wrap-idb-value.js","../../../../node_modules/@firebase/app/node_modules/idb/build/index.js","../../../../node_modules/@firebase/app/dist/esm/index.esm2017.js","../../../../node_modules/idb/build/wrap-idb-value.js","../../../../node_modules/idb/build/index.js","../../../../node_modules/@firebase/installations/dist/esm/index.esm2017.js","../../../../node_modules/@firebase/messaging/dist/esm/index.esm2017.js","../../../../node_modules/firebase/app/dist/esm/index.esm.js","../../../../node_modules/@aws-amplify/auth/lib/types/Auth.js","../../../../node_modules/@aws-amplify/auth/lib/types/index.js","../../../../node_modules/react-use-measure/dist/web.js"],"sourcesContent":["/**\n * @license React\n * react.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'use strict';var l=Symbol.for(\"react.element\"),n=Symbol.for(\"react.portal\"),p=Symbol.for(\"react.fragment\"),q=Symbol.for(\"react.strict_mode\"),r=Symbol.for(\"react.profiler\"),t=Symbol.for(\"react.provider\"),u=Symbol.for(\"react.context\"),v=Symbol.for(\"react.forward_ref\"),w=Symbol.for(\"react.suspense\"),x=Symbol.for(\"react.memo\"),y=Symbol.for(\"react.lazy\"),z=Symbol.iterator;function A(a){if(null===a||\"object\"!==typeof a)return null;a=z&&a[z]||a[\"@@iterator\"];return\"function\"===typeof a?a:null}\nvar B={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,D={};function E(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}E.prototype.isReactComponent={};\nE.prototype.setState=function(a,b){if(\"object\"!==typeof a&&\"function\"!==typeof a&&null!=a)throw Error(\"setState(...): takes an object of state variables to update or a function which returns an object of state variables.\");this.updater.enqueueSetState(this,a,b,\"setState\")};E.prototype.forceUpdate=function(a){this.updater.enqueueForceUpdate(this,a,\"forceUpdate\")};function F(){}F.prototype=E.prototype;function G(a,b,e){this.props=a;this.context=b;this.refs=D;this.updater=e||B}var H=G.prototype=new F;\nH.constructor=G;C(H,E.prototype);H.isPureReactComponent=!0;var I=Array.isArray,J=Object.prototype.hasOwnProperty,K={current:null},L={key:!0,ref:!0,__self:!0,__source:!0};\nfunction M(a,b,e){var d,c={},k=null,h=null;if(null!=b)for(d in void 0!==b.ref&&(h=b.ref),void 0!==b.key&&(k=\"\"+b.key),b)J.call(b,d)&&!L.hasOwnProperty(d)&&(c[d]=b[d]);var g=arguments.length-2;if(1===g)c.children=e;else if(1>>1,e=a[d];if(0>>1;dg(C,c))ng(x,C)?(a[d]=x,a[n]=c,d=n):(a[d]=C,a[m]=c,d=m);else if(ng(x,c))a[d]=x,a[n]=c,d=n;else break a}}return b}\nfunction g(a,b){var c=a.sortIndex-b.sortIndex;return 0!==c?c:a.id-b.id}if(\"object\"===typeof performance&&\"function\"===typeof performance.now){var l=performance;exports.unstable_now=function(){return l.now()}}else{var p=Date,q=p.now();exports.unstable_now=function(){return p.now()-q}}var r=[],t=[],u=1,v=null,y=3,z=!1,A=!1,B=!1,D=\"function\"===typeof setTimeout?setTimeout:null,E=\"function\"===typeof clearTimeout?clearTimeout:null,F=\"undefined\"!==typeof setImmediate?setImmediate:null;\n\"undefined\"!==typeof navigator&&void 0!==navigator.scheduling&&void 0!==navigator.scheduling.isInputPending&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function G(a){for(var b=h(t);null!==b;){if(null===b.callback)k(t);else if(b.startTime<=a)k(t),b.sortIndex=b.expirationTime,f(r,b);else break;b=h(t)}}function H(a){B=!1;G(a);if(!A)if(null!==h(r))A=!0,I(J);else{var b=h(t);null!==b&&K(H,b.startTime-a)}}\nfunction J(a,b){A=!1;B&&(B=!1,E(L),L=-1);z=!0;var c=y;try{G(b);for(v=h(r);null!==v&&(!(v.expirationTime>b)||a&&!M());){var d=v.callback;if(\"function\"===typeof d){v.callback=null;y=v.priorityLevel;var e=d(v.expirationTime<=b);b=exports.unstable_now();\"function\"===typeof e?v.callback=e:v===h(r)&&k(r);G(b)}else k(r);v=h(r)}if(null!==v)var w=!0;else{var m=h(t);null!==m&&K(H,m.startTime-b);w=!1}return w}finally{v=null,y=c,z=!1}}var N=!1,O=null,L=-1,P=5,Q=-1;\nfunction M(){return exports.unstable_now()-Qa||125d?(a.sortIndex=c,f(t,a),null===h(r)&&a===h(t)&&(B?(E(L),L=-1):B=!0,K(H,c-d))):(a.sortIndex=e,f(r,a),A||z||(A=!0,I(J)));return a};\nexports.unstable_shouldYield=M;exports.unstable_wrapCallback=function(a){var b=y;return function(){var c=y;y=b;try{return a.apply(this,arguments)}finally{y=c}}};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/scheduler.production.min.js');\n} else {\n module.exports = require('./cjs/scheduler.development.js');\n}\n","/**\n * @license React\n * react-dom.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 Modernizr 3.0.0pre (Custom Build) | MIT\n*/\n'use strict';var aa=require(\"react\"),ca=require(\"scheduler\");function p(a){for(var b=\"https://reactjs.org/docs/error-decoder.html?invariant=\"+a,c=1;cb}return!1}function v(a,b,c,d,e,f,g){this.acceptsBooleans=2===b||3===b||4===b;this.attributeName=d;this.attributeNamespace=e;this.mustUseProperty=c;this.propertyName=a;this.type=b;this.sanitizeURL=f;this.removeEmptyString=g}var z={};\n\"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style\".split(\" \").forEach(function(a){z[a]=new v(a,0,!1,a,null,!1,!1)});[[\"acceptCharset\",\"accept-charset\"],[\"className\",\"class\"],[\"htmlFor\",\"for\"],[\"httpEquiv\",\"http-equiv\"]].forEach(function(a){var b=a[0];z[b]=new v(b,1,!1,a[1],null,!1,!1)});[\"contentEditable\",\"draggable\",\"spellCheck\",\"value\"].forEach(function(a){z[a]=new v(a,2,!1,a.toLowerCase(),null,!1,!1)});\n[\"autoReverse\",\"externalResourcesRequired\",\"focusable\",\"preserveAlpha\"].forEach(function(a){z[a]=new v(a,2,!1,a,null,!1,!1)});\"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope\".split(\" \").forEach(function(a){z[a]=new v(a,3,!1,a.toLowerCase(),null,!1,!1)});\n[\"checked\",\"multiple\",\"muted\",\"selected\"].forEach(function(a){z[a]=new v(a,3,!0,a,null,!1,!1)});[\"capture\",\"download\"].forEach(function(a){z[a]=new v(a,4,!1,a,null,!1,!1)});[\"cols\",\"rows\",\"size\",\"span\"].forEach(function(a){z[a]=new v(a,6,!1,a,null,!1,!1)});[\"rowSpan\",\"start\"].forEach(function(a){z[a]=new v(a,5,!1,a.toLowerCase(),null,!1,!1)});var ra=/[\\-:]([a-z])/g;function sa(a){return a[1].toUpperCase()}\n\"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height\".split(\" \").forEach(function(a){var b=a.replace(ra,\nsa);z[b]=new v(b,1,!1,a,null,!1,!1)});\"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type\".split(\" \").forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/1999/xlink\",!1,!1)});[\"xml:base\",\"xml:lang\",\"xml:space\"].forEach(function(a){var b=a.replace(ra,sa);z[b]=new v(b,1,!1,a,\"http://www.w3.org/XML/1998/namespace\",!1,!1)});[\"tabIndex\",\"crossOrigin\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!1,!1)});\nz.xlinkHref=new v(\"xlinkHref\",1,!1,\"xlink:href\",\"http://www.w3.org/1999/xlink\",!0,!1);[\"src\",\"href\",\"action\",\"formAction\"].forEach(function(a){z[a]=new v(a,1,!1,a.toLowerCase(),null,!0,!0)});\nfunction ta(a,b,c,d){var e=z.hasOwnProperty(b)?z[b]:null;if(null!==e?0!==e.type:d||!(2h||e[g]!==f[h]){var k=\"\\n\"+e[g].replace(\" at new \",\" at \");a.displayName&&k.includes(\"\")&&(k=k.replace(\"\",a.displayName));return k}while(1<=g&&0<=h)}break}}}finally{Na=!1,Error.prepareStackTrace=c}return(a=a?a.displayName||a.name:\"\")?Ma(a):\"\"}\nfunction Pa(a){switch(a.tag){case 5:return Ma(a.type);case 16:return Ma(\"Lazy\");case 13:return Ma(\"Suspense\");case 19:return Ma(\"SuspenseList\");case 0:case 2:case 15:return a=Oa(a.type,!1),a;case 11:return a=Oa(a.type.render,!1),a;case 1:return a=Oa(a.type,!0),a;default:return\"\"}}\nfunction Qa(a){if(null==a)return null;if(\"function\"===typeof a)return a.displayName||a.name||null;if(\"string\"===typeof a)return a;switch(a){case ya:return\"Fragment\";case wa:return\"Portal\";case Aa:return\"Profiler\";case za:return\"StrictMode\";case Ea:return\"Suspense\";case Fa:return\"SuspenseList\"}if(\"object\"===typeof a)switch(a.$$typeof){case Ca:return(a.displayName||\"Context\")+\".Consumer\";case Ba:return(a._context.displayName||\"Context\")+\".Provider\";case Da:var b=a.render;a=a.displayName;a||(a=b.displayName||\nb.name||\"\",a=\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");return a;case Ga:return b=a.displayName||null,null!==b?b:Qa(a.type)||\"Memo\";case Ha:b=a._payload;a=a._init;try{return Qa(a(b))}catch(c){}}return null}\nfunction Ra(a){var b=a.type;switch(a.tag){case 24:return\"Cache\";case 9:return(b.displayName||\"Context\")+\".Consumer\";case 10:return(b._context.displayName||\"Context\")+\".Provider\";case 18:return\"DehydratedFragment\";case 11:return a=b.render,a=a.displayName||a.name||\"\",b.displayName||(\"\"!==a?\"ForwardRef(\"+a+\")\":\"ForwardRef\");case 7:return\"Fragment\";case 5:return b;case 4:return\"Portal\";case 3:return\"Root\";case 6:return\"Text\";case 16:return Qa(b);case 8:return b===za?\"StrictMode\":\"Mode\";case 22:return\"Offscreen\";\ncase 12:return\"Profiler\";case 21:return\"Scope\";case 13:return\"Suspense\";case 19:return\"SuspenseList\";case 25:return\"TracingMarker\";case 1:case 0:case 17:case 2:case 14:case 15:if(\"function\"===typeof b)return b.displayName||b.name||null;if(\"string\"===typeof b)return b}return null}function Sa(a){switch(typeof a){case \"boolean\":case \"number\":case \"string\":case \"undefined\":return a;case \"object\":return a;default:return\"\"}}\nfunction Ta(a){var b=a.type;return(a=a.nodeName)&&\"input\"===a.toLowerCase()&&(\"checkbox\"===b||\"radio\"===b)}\nfunction Ua(a){var b=Ta(a)?\"checked\":\"value\",c=Object.getOwnPropertyDescriptor(a.constructor.prototype,b),d=\"\"+a[b];if(!a.hasOwnProperty(b)&&\"undefined\"!==typeof c&&\"function\"===typeof c.get&&\"function\"===typeof c.set){var e=c.get,f=c.set;Object.defineProperty(a,b,{configurable:!0,get:function(){return e.call(this)},set:function(a){d=\"\"+a;f.call(this,a)}});Object.defineProperty(a,b,{enumerable:c.enumerable});return{getValue:function(){return d},setValue:function(a){d=\"\"+a},stopTracking:function(){a._valueTracker=\nnull;delete a[b]}}}}function Va(a){a._valueTracker||(a._valueTracker=Ua(a))}function Wa(a){if(!a)return!1;var b=a._valueTracker;if(!b)return!0;var c=b.getValue();var d=\"\";a&&(d=Ta(a)?a.checked?\"true\":\"false\":a.value);a=d;return a!==c?(b.setValue(a),!0):!1}function Xa(a){a=a||(\"undefined\"!==typeof document?document:void 0);if(\"undefined\"===typeof a)return null;try{return a.activeElement||a.body}catch(b){return a.body}}\nfunction Ya(a,b){var c=b.checked;return A({},b,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:null!=c?c:a._wrapperState.initialChecked})}function Za(a,b){var c=null==b.defaultValue?\"\":b.defaultValue,d=null!=b.checked?b.checked:b.defaultChecked;c=Sa(null!=b.value?b.value:c);a._wrapperState={initialChecked:d,initialValue:c,controlled:\"checkbox\"===b.type||\"radio\"===b.type?null!=b.checked:null!=b.value}}function ab(a,b){b=b.checked;null!=b&&ta(a,\"checked\",b,!1)}\nfunction bb(a,b){ab(a,b);var c=Sa(b.value),d=b.type;if(null!=c)if(\"number\"===d){if(0===c&&\"\"===a.value||a.value!=c)a.value=\"\"+c}else a.value!==\"\"+c&&(a.value=\"\"+c);else if(\"submit\"===d||\"reset\"===d){a.removeAttribute(\"value\");return}b.hasOwnProperty(\"value\")?cb(a,b.type,c):b.hasOwnProperty(\"defaultValue\")&&cb(a,b.type,Sa(b.defaultValue));null==b.checked&&null!=b.defaultChecked&&(a.defaultChecked=!!b.defaultChecked)}\nfunction db(a,b,c){if(b.hasOwnProperty(\"value\")||b.hasOwnProperty(\"defaultValue\")){var d=b.type;if(!(\"submit\"!==d&&\"reset\"!==d||void 0!==b.value&&null!==b.value))return;b=\"\"+a._wrapperState.initialValue;c||b===a.value||(a.value=b);a.defaultValue=b}c=a.name;\"\"!==c&&(a.name=\"\");a.defaultChecked=!!a._wrapperState.initialChecked;\"\"!==c&&(a.name=c)}\nfunction cb(a,b,c){if(\"number\"!==b||Xa(a.ownerDocument)!==a)null==c?a.defaultValue=\"\"+a._wrapperState.initialValue:a.defaultValue!==\"\"+c&&(a.defaultValue=\"\"+c)}var eb=Array.isArray;\nfunction fb(a,b,c,d){a=a.options;if(b){b={};for(var e=0;e\"+b.valueOf().toString()+\"\";for(b=mb.firstChild;a.firstChild;)a.removeChild(a.firstChild);for(;b.firstChild;)a.appendChild(b.firstChild)}});\nfunction ob(a,b){if(b){var c=a.firstChild;if(c&&c===a.lastChild&&3===c.nodeType){c.nodeValue=b;return}}a.textContent=b}\nvar pb={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,\nzoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},qb=[\"Webkit\",\"ms\",\"Moz\",\"O\"];Object.keys(pb).forEach(function(a){qb.forEach(function(b){b=b+a.charAt(0).toUpperCase()+a.substring(1);pb[b]=pb[a]})});function rb(a,b,c){return null==b||\"boolean\"===typeof b||\"\"===b?\"\":c||\"number\"!==typeof b||0===b||pb.hasOwnProperty(a)&&pb[a]?(\"\"+b).trim():b+\"px\"}\nfunction sb(a,b){a=a.style;for(var c in b)if(b.hasOwnProperty(c)){var d=0===c.indexOf(\"--\"),e=rb(c,b[c],d);\"float\"===c&&(c=\"cssFloat\");d?a.setProperty(c,e):a[c]=e}}var tb=A({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});\nfunction ub(a,b){if(b){if(tb[a]&&(null!=b.children||null!=b.dangerouslySetInnerHTML))throw Error(p(137,a));if(null!=b.dangerouslySetInnerHTML){if(null!=b.children)throw Error(p(60));if(\"object\"!==typeof b.dangerouslySetInnerHTML||!(\"__html\"in b.dangerouslySetInnerHTML))throw Error(p(61));}if(null!=b.style&&\"object\"!==typeof b.style)throw Error(p(62));}}\nfunction vb(a,b){if(-1===a.indexOf(\"-\"))return\"string\"===typeof b.is;switch(a){case \"annotation-xml\":case \"color-profile\":case \"font-face\":case \"font-face-src\":case \"font-face-uri\":case \"font-face-format\":case \"font-face-name\":case \"missing-glyph\":return!1;default:return!0}}var wb=null;function xb(a){a=a.target||a.srcElement||window;a.correspondingUseElement&&(a=a.correspondingUseElement);return 3===a.nodeType?a.parentNode:a}var yb=null,zb=null,Ab=null;\nfunction Bb(a){if(a=Cb(a)){if(\"function\"!==typeof yb)throw Error(p(280));var b=a.stateNode;b&&(b=Db(b),yb(a.stateNode,a.type,b))}}function Eb(a){zb?Ab?Ab.push(a):Ab=[a]:zb=a}function Fb(){if(zb){var a=zb,b=Ab;Ab=zb=null;Bb(a);if(b)for(a=0;a>>=0;return 0===a?32:31-(pc(a)/qc|0)|0}var rc=64,sc=4194304;\nfunction tc(a){switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return a&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return a&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;\ndefault:return a}}function uc(a,b){var c=a.pendingLanes;if(0===c)return 0;var d=0,e=a.suspendedLanes,f=a.pingedLanes,g=c&268435455;if(0!==g){var h=g&~e;0!==h?d=tc(h):(f&=g,0!==f&&(d=tc(f)))}else g=c&~e,0!==g?d=tc(g):0!==f&&(d=tc(f));if(0===d)return 0;if(0!==b&&b!==d&&0===(b&e)&&(e=d&-d,f=b&-b,e>=f||16===e&&0!==(f&4194240)))return b;0!==(d&4)&&(d|=c&16);b=a.entangledLanes;if(0!==b)for(a=a.entanglements,b&=d;0c;c++)b.push(a);return b}\nfunction Ac(a,b,c){a.pendingLanes|=b;536870912!==b&&(a.suspendedLanes=0,a.pingedLanes=0);a=a.eventTimes;b=31-oc(b);a[b]=c}function Bc(a,b){var c=a.pendingLanes&~b;a.pendingLanes=b;a.suspendedLanes=0;a.pingedLanes=0;a.expiredLanes&=b;a.mutableReadLanes&=b;a.entangledLanes&=b;b=a.entanglements;var d=a.eventTimes;for(a=a.expirationTimes;0=be),ee=String.fromCharCode(32),fe=!1;\nfunction ge(a,b){switch(a){case \"keyup\":return-1!==$d.indexOf(b.keyCode);case \"keydown\":return 229!==b.keyCode;case \"keypress\":case \"mousedown\":case \"focusout\":return!0;default:return!1}}function he(a){a=a.detail;return\"object\"===typeof a&&\"data\"in a?a.data:null}var ie=!1;function je(a,b){switch(a){case \"compositionend\":return he(b);case \"keypress\":if(32!==b.which)return null;fe=!0;return ee;case \"textInput\":return a=b.data,a===ee&&fe?null:a;default:return null}}\nfunction ke(a,b){if(ie)return\"compositionend\"===a||!ae&&ge(a,b)?(a=nd(),md=ld=kd=null,ie=!1,a):null;switch(a){case \"paste\":return null;case \"keypress\":if(!(b.ctrlKey||b.altKey||b.metaKey)||b.ctrlKey&&b.altKey){if(b.char&&1=b)return{node:c,offset:b-a};a=d}a:{for(;c;){if(c.nextSibling){c=c.nextSibling;break a}c=c.parentNode}c=void 0}c=Je(c)}}function Le(a,b){return a&&b?a===b?!0:a&&3===a.nodeType?!1:b&&3===b.nodeType?Le(a,b.parentNode):\"contains\"in a?a.contains(b):a.compareDocumentPosition?!!(a.compareDocumentPosition(b)&16):!1:!1}\nfunction Me(){for(var a=window,b=Xa();b instanceof a.HTMLIFrameElement;){try{var c=\"string\"===typeof b.contentWindow.location.href}catch(d){c=!1}if(c)a=b.contentWindow;else break;b=Xa(a.document)}return b}function Ne(a){var b=a&&a.nodeName&&a.nodeName.toLowerCase();return b&&(\"input\"===b&&(\"text\"===a.type||\"search\"===a.type||\"tel\"===a.type||\"url\"===a.type||\"password\"===a.type)||\"textarea\"===b||\"true\"===a.contentEditable)}\nfunction Oe(a){var b=Me(),c=a.focusedElem,d=a.selectionRange;if(b!==c&&c&&c.ownerDocument&&Le(c.ownerDocument.documentElement,c)){if(null!==d&&Ne(c))if(b=d.start,a=d.end,void 0===a&&(a=b),\"selectionStart\"in c)c.selectionStart=b,c.selectionEnd=Math.min(a,c.value.length);else if(a=(b=c.ownerDocument||document)&&b.defaultView||window,a.getSelection){a=a.getSelection();var e=c.textContent.length,f=Math.min(d.start,e);d=void 0===d.end?f:Math.min(d.end,e);!a.extend&&f>d&&(e=d,d=f,f=e);e=Ke(c,f);var g=Ke(c,\nd);e&&g&&(1!==a.rangeCount||a.anchorNode!==e.node||a.anchorOffset!==e.offset||a.focusNode!==g.node||a.focusOffset!==g.offset)&&(b=b.createRange(),b.setStart(e.node,e.offset),a.removeAllRanges(),f>d?(a.addRange(b),a.extend(g.node,g.offset)):(b.setEnd(g.node,g.offset),a.addRange(b)))}b=[];for(a=c;a=a.parentNode;)1===a.nodeType&&b.push({element:a,left:a.scrollLeft,top:a.scrollTop});\"function\"===typeof c.focus&&c.focus();for(c=0;c=document.documentMode,Qe=null,Re=null,Se=null,Te=!1;\nfunction Ue(a,b,c){var d=c.window===c?c.document:9===c.nodeType?c:c.ownerDocument;Te||null==Qe||Qe!==Xa(d)||(d=Qe,\"selectionStart\"in d&&Ne(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Se&&Ie(Se,d)||(Se=d,d=oe(Re,\"onSelect\"),0Tf||(a.current=Sf[Tf],Sf[Tf]=null,Tf--)}function G(a,b){Tf++;Sf[Tf]=a.current;a.current=b}var Vf={},H=Uf(Vf),Wf=Uf(!1),Xf=Vf;function Yf(a,b){var c=a.type.contextTypes;if(!c)return Vf;var d=a.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===b)return d.__reactInternalMemoizedMaskedChildContext;var e={},f;for(f in c)e[f]=b[f];d&&(a=a.stateNode,a.__reactInternalMemoizedUnmaskedChildContext=b,a.__reactInternalMemoizedMaskedChildContext=e);return e}\nfunction Zf(a){a=a.childContextTypes;return null!==a&&void 0!==a}function $f(){E(Wf);E(H)}function ag(a,b,c){if(H.current!==Vf)throw Error(p(168));G(H,b);G(Wf,c)}function bg(a,b,c){var d=a.stateNode;b=b.childContextTypes;if(\"function\"!==typeof d.getChildContext)return c;d=d.getChildContext();for(var e in d)if(!(e in b))throw Error(p(108,Ra(a)||\"Unknown\",e));return A({},c,d)}\nfunction cg(a){a=(a=a.stateNode)&&a.__reactInternalMemoizedMergedChildContext||Vf;Xf=H.current;G(H,a);G(Wf,Wf.current);return!0}function dg(a,b,c){var d=a.stateNode;if(!d)throw Error(p(169));c?(a=bg(a,b,Xf),d.__reactInternalMemoizedMergedChildContext=a,E(Wf),E(H),G(H,a)):E(Wf);G(Wf,c)}var eg=null,fg=!1,gg=!1;function hg(a){null===eg?eg=[a]:eg.push(a)}function ig(a){fg=!0;hg(a)}\nfunction jg(){if(!gg&&null!==eg){gg=!0;var a=0,b=C;try{var c=eg;for(C=1;a>=g;e-=g;rg=1<<32-oc(b)+e|c<w?(x=u,u=null):x=u.sibling;var n=r(e,u,h[w],k);if(null===n){null===u&&(u=x);break}a&&u&&null===n.alternate&&b(e,u);g=f(n,g,w);null===m?l=n:m.sibling=n;m=n;u=x}if(w===h.length)return c(e,u),I&&tg(e,w),l;if(null===u){for(;ww?(x=m,m=null):x=m.sibling;var t=r(e,m,n.value,k);if(null===t){null===m&&(m=x);break}a&&m&&null===t.alternate&&b(e,m);g=f(t,g,w);null===u?l=t:u.sibling=t;u=t;m=x}if(n.done)return c(e,\nm),I&&tg(e,w),l;if(null===m){for(;!n.done;w++,n=h.next())n=q(e,n.value,k),null!==n&&(g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);I&&tg(e,w);return l}for(m=d(e,m);!n.done;w++,n=h.next())n=y(m,e,w,n.value,k),null!==n&&(a&&null!==n.alternate&&m.delete(null===n.key?w:n.key),g=f(n,g,w),null===u?l=n:u.sibling=n,u=n);a&&m.forEach(function(a){return b(e,a)});I&&tg(e,w);return l}function J(a,d,f,h){\"object\"===typeof f&&null!==f&&f.type===ya&&null===f.key&&(f=f.props.children);if(\"object\"===typeof f&&null!==f){switch(f.$$typeof){case va:a:{for(var k=\nf.key,l=d;null!==l;){if(l.key===k){k=f.type;if(k===ya){if(7===l.tag){c(a,l.sibling);d=e(l,f.props.children);d.return=a;a=d;break a}}else if(l.elementType===k||\"object\"===typeof k&&null!==k&&k.$$typeof===Ha&&Ng(k)===l.type){c(a,l.sibling);d=e(l,f.props);d.ref=Lg(a,l,f);d.return=a;a=d;break a}c(a,l);break}else b(a,l);l=l.sibling}f.type===ya?(d=Tg(f.props.children,a.mode,h,f.key),d.return=a,a=d):(h=Rg(f.type,f.key,f.props,null,a.mode,h),h.ref=Lg(a,d,f),h.return=a,a=h)}return g(a);case wa:a:{for(l=f.key;null!==\nd;){if(d.key===l)if(4===d.tag&&d.stateNode.containerInfo===f.containerInfo&&d.stateNode.implementation===f.implementation){c(a,d.sibling);d=e(d,f.children||[]);d.return=a;a=d;break a}else{c(a,d);break}else b(a,d);d=d.sibling}d=Sg(f,a.mode,h);d.return=a;a=d}return g(a);case Ha:return l=f._init,J(a,d,l(f._payload),h)}if(eb(f))return n(a,d,f,h);if(Ka(f))return t(a,d,f,h);Mg(a,f)}return\"string\"===typeof f&&\"\"!==f||\"number\"===typeof f?(f=\"\"+f,null!==d&&6===d.tag?(c(a,d.sibling),d=e(d,f),d.return=a,a=d):\n(c(a,d),d=Qg(f,a.mode,h),d.return=a,a=d),g(a)):c(a,d)}return J}var Ug=Og(!0),Vg=Og(!1),Wg=Uf(null),Xg=null,Yg=null,Zg=null;function $g(){Zg=Yg=Xg=null}function ah(a){var b=Wg.current;E(Wg);a._currentValue=b}function bh(a,b,c){for(;null!==a;){var d=a.alternate;(a.childLanes&b)!==b?(a.childLanes|=b,null!==d&&(d.childLanes|=b)):null!==d&&(d.childLanes&b)!==b&&(d.childLanes|=b);if(a===c)break;a=a.return}}\nfunction ch(a,b){Xg=a;Zg=Yg=null;a=a.dependencies;null!==a&&null!==a.firstContext&&(0!==(a.lanes&b)&&(dh=!0),a.firstContext=null)}function eh(a){var b=a._currentValue;if(Zg!==a)if(a={context:a,memoizedValue:b,next:null},null===Yg){if(null===Xg)throw Error(p(308));Yg=a;Xg.dependencies={lanes:0,firstContext:a}}else Yg=Yg.next=a;return b}var fh=null;function gh(a){null===fh?fh=[a]:fh.push(a)}\nfunction hh(a,b,c,d){var e=b.interleaved;null===e?(c.next=c,gh(b)):(c.next=e.next,e.next=c);b.interleaved=c;return ih(a,d)}function ih(a,b){a.lanes|=b;var c=a.alternate;null!==c&&(c.lanes|=b);c=a;for(a=a.return;null!==a;)a.childLanes|=b,c=a.alternate,null!==c&&(c.childLanes|=b),c=a,a=a.return;return 3===c.tag?c.stateNode:null}var jh=!1;function kh(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}\nfunction lh(a,b){a=a.updateQueue;b.updateQueue===a&&(b.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,effects:a.effects})}function mh(a,b){return{eventTime:a,lane:b,tag:0,payload:null,callback:null,next:null}}\nfunction nh(a,b,c){var d=a.updateQueue;if(null===d)return null;d=d.shared;if(0!==(K&2)){var e=d.pending;null===e?b.next=b:(b.next=e.next,e.next=b);d.pending=b;return ih(a,c)}e=d.interleaved;null===e?(b.next=b,gh(d)):(b.next=e.next,e.next=b);d.interleaved=b;return ih(a,c)}function oh(a,b,c){b=b.updateQueue;if(null!==b&&(b=b.shared,0!==(c&4194240))){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nfunction ph(a,b){var c=a.updateQueue,d=a.alternate;if(null!==d&&(d=d.updateQueue,c===d)){var e=null,f=null;c=c.firstBaseUpdate;if(null!==c){do{var g={eventTime:c.eventTime,lane:c.lane,tag:c.tag,payload:c.payload,callback:c.callback,next:null};null===f?e=f=g:f=f.next=g;c=c.next}while(null!==c);null===f?e=f=b:f=f.next=b}else e=f=b;c={baseState:d.baseState,firstBaseUpdate:e,lastBaseUpdate:f,shared:d.shared,effects:d.effects};a.updateQueue=c;return}a=c.lastBaseUpdate;null===a?c.firstBaseUpdate=b:a.next=\nb;c.lastBaseUpdate=b}\nfunction qh(a,b,c,d){var e=a.updateQueue;jh=!1;var f=e.firstBaseUpdate,g=e.lastBaseUpdate,h=e.shared.pending;if(null!==h){e.shared.pending=null;var k=h,l=k.next;k.next=null;null===g?f=l:g.next=l;g=k;var m=a.alternate;null!==m&&(m=m.updateQueue,h=m.lastBaseUpdate,h!==g&&(null===h?m.firstBaseUpdate=l:h.next=l,m.lastBaseUpdate=k))}if(null!==f){var q=e.baseState;g=0;m=l=k=null;h=f;do{var r=h.lane,y=h.eventTime;if((d&r)===r){null!==m&&(m=m.next={eventTime:y,lane:0,tag:h.tag,payload:h.payload,callback:h.callback,\nnext:null});a:{var n=a,t=h;r=b;y=c;switch(t.tag){case 1:n=t.payload;if(\"function\"===typeof n){q=n.call(y,q,r);break a}q=n;break a;case 3:n.flags=n.flags&-65537|128;case 0:n=t.payload;r=\"function\"===typeof n?n.call(y,q,r):n;if(null===r||void 0===r)break a;q=A({},q,r);break a;case 2:jh=!0}}null!==h.callback&&0!==h.lane&&(a.flags|=64,r=e.effects,null===r?e.effects=[h]:r.push(h))}else y={eventTime:y,lane:r,tag:h.tag,payload:h.payload,callback:h.callback,next:null},null===m?(l=m=y,k=q):m=m.next=y,g|=r;\nh=h.next;if(null===h)if(h=e.shared.pending,null===h)break;else r=h,h=r.next,r.next=null,e.lastBaseUpdate=r,e.shared.pending=null}while(1);null===m&&(k=q);e.baseState=k;e.firstBaseUpdate=l;e.lastBaseUpdate=m;b=e.shared.interleaved;if(null!==b){e=b;do g|=e.lane,e=e.next;while(e!==b)}else null===f&&(e.shared.lanes=0);rh|=g;a.lanes=g;a.memoizedState=q}}\nfunction sh(a,b,c){a=b.effects;b.effects=null;if(null!==a)for(b=0;bc?c:4;a(!0);var d=Gh.transition;Gh.transition={};try{a(!1),b()}finally{C=c,Gh.transition=d}}function wi(){return Uh().memoizedState}\nfunction xi(a,b,c){var d=yi(a);c={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(zi(a))Ai(b,c);else if(c=hh(a,b,c,d),null!==c){var e=R();gi(c,a,d,e);Bi(c,b,d)}}\nfunction ii(a,b,c){var d=yi(a),e={lane:d,action:c,hasEagerState:!1,eagerState:null,next:null};if(zi(a))Ai(b,e);else{var f=a.alternate;if(0===a.lanes&&(null===f||0===f.lanes)&&(f=b.lastRenderedReducer,null!==f))try{var g=b.lastRenderedState,h=f(g,c);e.hasEagerState=!0;e.eagerState=h;if(He(h,g)){var k=b.interleaved;null===k?(e.next=e,gh(b)):(e.next=k.next,k.next=e);b.interleaved=e;return}}catch(l){}finally{}c=hh(a,b,e,d);null!==c&&(e=R(),gi(c,a,d,e),Bi(c,b,d))}}\nfunction zi(a){var b=a.alternate;return a===M||null!==b&&b===M}function Ai(a,b){Jh=Ih=!0;var c=a.pending;null===c?b.next=b:(b.next=c.next,c.next=b);a.pending=b}function Bi(a,b,c){if(0!==(c&4194240)){var d=b.lanes;d&=a.pendingLanes;c|=d;b.lanes=c;Cc(a,c)}}\nvar Rh={readContext:eh,useCallback:P,useContext:P,useEffect:P,useImperativeHandle:P,useInsertionEffect:P,useLayoutEffect:P,useMemo:P,useReducer:P,useRef:P,useState:P,useDebugValue:P,useDeferredValue:P,useTransition:P,useMutableSource:P,useSyncExternalStore:P,useId:P,unstable_isNewReconciler:!1},Oh={readContext:eh,useCallback:function(a,b){Th().memoizedState=[a,void 0===b?null:b];return a},useContext:eh,useEffect:mi,useImperativeHandle:function(a,b,c){c=null!==c&&void 0!==c?c.concat([a]):null;return ki(4194308,\n4,pi.bind(null,b,a),c)},useLayoutEffect:function(a,b){return ki(4194308,4,a,b)},useInsertionEffect:function(a,b){return ki(4,2,a,b)},useMemo:function(a,b){var c=Th();b=void 0===b?null:b;a=a();c.memoizedState=[a,b];return a},useReducer:function(a,b,c){var d=Th();b=void 0!==c?c(b):b;d.memoizedState=d.baseState=b;a={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:b};d.queue=a;a=a.dispatch=xi.bind(null,M,a);return[d.memoizedState,a]},useRef:function(a){var b=\nTh();a={current:a};return b.memoizedState=a},useState:hi,useDebugValue:ri,useDeferredValue:function(a){return Th().memoizedState=a},useTransition:function(){var a=hi(!1),b=a[0];a=vi.bind(null,a[1]);Th().memoizedState=a;return[b,a]},useMutableSource:function(){},useSyncExternalStore:function(a,b,c){var d=M,e=Th();if(I){if(void 0===c)throw Error(p(407));c=c()}else{c=b();if(null===Q)throw Error(p(349));0!==(Hh&30)||di(d,b,c)}e.memoizedState=c;var f={value:c,getSnapshot:b};e.queue=f;mi(ai.bind(null,d,\nf,a),[a]);d.flags|=2048;bi(9,ci.bind(null,d,f,c,b),void 0,null);return c},useId:function(){var a=Th(),b=Q.identifierPrefix;if(I){var c=sg;var d=rg;c=(d&~(1<<32-oc(d)-1)).toString(32)+c;b=\":\"+b+\"R\"+c;c=Kh++;0\\x3c/script>\",a=a.removeChild(a.firstChild)):\n\"string\"===typeof d.is?a=g.createElement(c,{is:d.is}):(a=g.createElement(c),\"select\"===c&&(g=a,d.multiple?g.multiple=!0:d.size&&(g.size=d.size))):a=g.createElementNS(a,c);a[Of]=b;a[Pf]=d;zj(a,b,!1,!1);b.stateNode=a;a:{g=vb(c,d);switch(c){case \"dialog\":D(\"cancel\",a);D(\"close\",a);e=d;break;case \"iframe\":case \"object\":case \"embed\":D(\"load\",a);e=d;break;case \"video\":case \"audio\":for(e=0;eGj&&(b.flags|=128,d=!0,Dj(f,!1),b.lanes=4194304)}else{if(!d)if(a=Ch(g),null!==a){if(b.flags|=128,d=!0,c=a.updateQueue,null!==c&&(b.updateQueue=c,b.flags|=4),Dj(f,!0),null===f.tail&&\"hidden\"===f.tailMode&&!g.alternate&&!I)return S(b),null}else 2*B()-f.renderingStartTime>Gj&&1073741824!==c&&(b.flags|=128,d=!0,Dj(f,!1),b.lanes=4194304);f.isBackwards?(g.sibling=b.child,b.child=g):(c=f.last,null!==c?c.sibling=g:b.child=g,f.last=g)}if(null!==f.tail)return b=f.tail,f.rendering=\nb,f.tail=b.sibling,f.renderingStartTime=B(),b.sibling=null,c=L.current,G(L,d?c&1|2:c&1),b;S(b);return null;case 22:case 23:return Hj(),d=null!==b.memoizedState,null!==a&&null!==a.memoizedState!==d&&(b.flags|=8192),d&&0!==(b.mode&1)?0!==(fj&1073741824)&&(S(b),b.subtreeFlags&6&&(b.flags|=8192)):S(b),null;case 24:return null;case 25:return null}throw Error(p(156,b.tag));}\nfunction Ij(a,b){wg(b);switch(b.tag){case 1:return Zf(b.type)&&$f(),a=b.flags,a&65536?(b.flags=a&-65537|128,b):null;case 3:return zh(),E(Wf),E(H),Eh(),a=b.flags,0!==(a&65536)&&0===(a&128)?(b.flags=a&-65537|128,b):null;case 5:return Bh(b),null;case 13:E(L);a=b.memoizedState;if(null!==a&&null!==a.dehydrated){if(null===b.alternate)throw Error(p(340));Ig()}a=b.flags;return a&65536?(b.flags=a&-65537|128,b):null;case 19:return E(L),null;case 4:return zh(),null;case 10:return ah(b.type._context),null;case 22:case 23:return Hj(),\nnull;case 24:return null;default:return null}}var Jj=!1,U=!1,Kj=\"function\"===typeof WeakSet?WeakSet:Set,V=null;function Lj(a,b){var c=a.ref;if(null!==c)if(\"function\"===typeof c)try{c(null)}catch(d){W(a,b,d)}else c.current=null}function Mj(a,b,c){try{c()}catch(d){W(a,b,d)}}var Nj=!1;\nfunction Oj(a,b){Cf=dd;a=Me();if(Ne(a)){if(\"selectionStart\"in a)var c={start:a.selectionStart,end:a.selectionEnd};else a:{c=(c=a.ownerDocument)&&c.defaultView||window;var d=c.getSelection&&c.getSelection();if(d&&0!==d.rangeCount){c=d.anchorNode;var e=d.anchorOffset,f=d.focusNode;d=d.focusOffset;try{c.nodeType,f.nodeType}catch(F){c=null;break a}var g=0,h=-1,k=-1,l=0,m=0,q=a,r=null;b:for(;;){for(var y;;){q!==c||0!==e&&3!==q.nodeType||(h=g+e);q!==f||0!==d&&3!==q.nodeType||(k=g+d);3===q.nodeType&&(g+=\nq.nodeValue.length);if(null===(y=q.firstChild))break;r=q;q=y}for(;;){if(q===a)break b;r===c&&++l===e&&(h=g);r===f&&++m===d&&(k=g);if(null!==(y=q.nextSibling))break;q=r;r=q.parentNode}q=y}c=-1===h||-1===k?null:{start:h,end:k}}else c=null}c=c||{start:0,end:0}}else c=null;Df={focusedElem:a,selectionRange:c};dd=!1;for(V=b;null!==V;)if(b=V,a=b.child,0!==(b.subtreeFlags&1028)&&null!==a)a.return=b,V=a;else for(;null!==V;){b=V;try{var n=b.alternate;if(0!==(b.flags&1024))switch(b.tag){case 0:case 11:case 15:break;\ncase 1:if(null!==n){var t=n.memoizedProps,J=n.memoizedState,x=b.stateNode,w=x.getSnapshotBeforeUpdate(b.elementType===b.type?t:Ci(b.type,t),J);x.__reactInternalSnapshotBeforeUpdate=w}break;case 3:var u=b.stateNode.containerInfo;1===u.nodeType?u.textContent=\"\":9===u.nodeType&&u.documentElement&&u.removeChild(u.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(p(163));}}catch(F){W(b,b.return,F)}a=b.sibling;if(null!==a){a.return=b.return;V=a;break}V=b.return}n=Nj;Nj=!1;return n}\nfunction Pj(a,b,c){var d=b.updateQueue;d=null!==d?d.lastEffect:null;if(null!==d){var e=d=d.next;do{if((e.tag&a)===a){var f=e.destroy;e.destroy=void 0;void 0!==f&&Mj(b,c,f)}e=e.next}while(e!==d)}}function Qj(a,b){b=b.updateQueue;b=null!==b?b.lastEffect:null;if(null!==b){var c=b=b.next;do{if((c.tag&a)===a){var d=c.create;c.destroy=d()}c=c.next}while(c!==b)}}function Rj(a){var b=a.ref;if(null!==b){var c=a.stateNode;switch(a.tag){case 5:a=c;break;default:a=c}\"function\"===typeof b?b(a):b.current=a}}\nfunction Sj(a){var b=a.alternate;null!==b&&(a.alternate=null,Sj(b));a.child=null;a.deletions=null;a.sibling=null;5===a.tag&&(b=a.stateNode,null!==b&&(delete b[Of],delete b[Pf],delete b[of],delete b[Qf],delete b[Rf]));a.stateNode=null;a.return=null;a.dependencies=null;a.memoizedProps=null;a.memoizedState=null;a.pendingProps=null;a.stateNode=null;a.updateQueue=null}function Tj(a){return 5===a.tag||3===a.tag||4===a.tag}\nfunction Uj(a){a:for(;;){for(;null===a.sibling;){if(null===a.return||Tj(a.return))return null;a=a.return}a.sibling.return=a.return;for(a=a.sibling;5!==a.tag&&6!==a.tag&&18!==a.tag;){if(a.flags&2)continue a;if(null===a.child||4===a.tag)continue a;else a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}\nfunction Vj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?8===c.nodeType?c.parentNode.insertBefore(a,b):c.insertBefore(a,b):(8===c.nodeType?(b=c.parentNode,b.insertBefore(a,c)):(b=c,b.appendChild(a)),c=c._reactRootContainer,null!==c&&void 0!==c||null!==b.onclick||(b.onclick=Bf));else if(4!==d&&(a=a.child,null!==a))for(Vj(a,b,c),a=a.sibling;null!==a;)Vj(a,b,c),a=a.sibling}\nfunction Wj(a,b,c){var d=a.tag;if(5===d||6===d)a=a.stateNode,b?c.insertBefore(a,b):c.appendChild(a);else if(4!==d&&(a=a.child,null!==a))for(Wj(a,b,c),a=a.sibling;null!==a;)Wj(a,b,c),a=a.sibling}var X=null,Xj=!1;function Yj(a,b,c){for(c=c.child;null!==c;)Zj(a,b,c),c=c.sibling}\nfunction Zj(a,b,c){if(lc&&\"function\"===typeof lc.onCommitFiberUnmount)try{lc.onCommitFiberUnmount(kc,c)}catch(h){}switch(c.tag){case 5:U||Lj(c,b);case 6:var d=X,e=Xj;X=null;Yj(a,b,c);X=d;Xj=e;null!==X&&(Xj?(a=X,c=c.stateNode,8===a.nodeType?a.parentNode.removeChild(c):a.removeChild(c)):X.removeChild(c.stateNode));break;case 18:null!==X&&(Xj?(a=X,c=c.stateNode,8===a.nodeType?Kf(a.parentNode,c):1===a.nodeType&&Kf(a,c),bd(a)):Kf(X,c.stateNode));break;case 4:d=X;e=Xj;X=c.stateNode.containerInfo;Xj=!0;\nYj(a,b,c);X=d;Xj=e;break;case 0:case 11:case 14:case 15:if(!U&&(d=c.updateQueue,null!==d&&(d=d.lastEffect,null!==d))){e=d=d.next;do{var f=e,g=f.destroy;f=f.tag;void 0!==g&&(0!==(f&2)?Mj(c,b,g):0!==(f&4)&&Mj(c,b,g));e=e.next}while(e!==d)}Yj(a,b,c);break;case 1:if(!U&&(Lj(c,b),d=c.stateNode,\"function\"===typeof d.componentWillUnmount))try{d.props=c.memoizedProps,d.state=c.memoizedState,d.componentWillUnmount()}catch(h){W(c,b,h)}Yj(a,b,c);break;case 21:Yj(a,b,c);break;case 22:c.mode&1?(U=(d=U)||null!==\nc.memoizedState,Yj(a,b,c),U=d):Yj(a,b,c);break;default:Yj(a,b,c)}}function ak(a){var b=a.updateQueue;if(null!==b){a.updateQueue=null;var c=a.stateNode;null===c&&(c=a.stateNode=new Kj);b.forEach(function(b){var d=bk.bind(null,a,b);c.has(b)||(c.add(b),b.then(d,d))})}}\nfunction ck(a,b){var c=b.deletions;if(null!==c)for(var d=0;de&&(e=g);d&=~f}d=e;d=B()-d;d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3E3>d?3E3:4320>d?4320:1960*lk(d/1960))-d;if(10a?16:a;if(null===wk)var d=!1;else{a=wk;wk=null;xk=0;if(0!==(K&6))throw Error(p(331));var e=K;K|=4;for(V=a.current;null!==V;){var f=V,g=f.child;if(0!==(V.flags&16)){var h=f.deletions;if(null!==h){for(var k=0;kB()-fk?Kk(a,0):rk|=c);Dk(a,b)}function Yk(a,b){0===b&&(0===(a.mode&1)?b=1:(b=sc,sc<<=1,0===(sc&130023424)&&(sc=4194304)));var c=R();a=ih(a,b);null!==a&&(Ac(a,b,c),Dk(a,c))}function uj(a){var b=a.memoizedState,c=0;null!==b&&(c=b.retryLane);Yk(a,c)}\nfunction bk(a,b){var c=0;switch(a.tag){case 13:var d=a.stateNode;var e=a.memoizedState;null!==e&&(c=e.retryLane);break;case 19:d=a.stateNode;break;default:throw Error(p(314));}null!==d&&d.delete(b);Yk(a,c)}var Vk;\nVk=function(a,b,c){if(null!==a)if(a.memoizedProps!==b.pendingProps||Wf.current)dh=!0;else{if(0===(a.lanes&c)&&0===(b.flags&128))return dh=!1,yj(a,b,c);dh=0!==(a.flags&131072)?!0:!1}else dh=!1,I&&0!==(b.flags&1048576)&&ug(b,ng,b.index);b.lanes=0;switch(b.tag){case 2:var d=b.type;ij(a,b);a=b.pendingProps;var e=Yf(b,H.current);ch(b,c);e=Nh(null,b,d,a,e,c);var f=Sh();b.flags|=1;\"object\"===typeof e&&null!==e&&\"function\"===typeof e.render&&void 0===e.$$typeof?(b.tag=1,b.memoizedState=null,b.updateQueue=\nnull,Zf(d)?(f=!0,cg(b)):f=!1,b.memoizedState=null!==e.state&&void 0!==e.state?e.state:null,kh(b),e.updater=Ei,b.stateNode=e,e._reactInternals=b,Ii(b,d,a,c),b=jj(null,b,d,!0,f,c)):(b.tag=0,I&&f&&vg(b),Xi(null,b,e,c),b=b.child);return b;case 16:d=b.elementType;a:{ij(a,b);a=b.pendingProps;e=d._init;d=e(d._payload);b.type=d;e=b.tag=Zk(d);a=Ci(d,a);switch(e){case 0:b=cj(null,b,d,a,c);break a;case 1:b=hj(null,b,d,a,c);break a;case 11:b=Yi(null,b,d,a,c);break a;case 14:b=$i(null,b,d,Ci(d.type,a),c);break a}throw Error(p(306,\nd,\"\"));}return b;case 0:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),cj(a,b,d,e,c);case 1:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),hj(a,b,d,e,c);case 3:a:{kj(b);if(null===a)throw Error(p(387));d=b.pendingProps;f=b.memoizedState;e=f.element;lh(a,b);qh(b,d,null,c);var g=b.memoizedState;d=g.element;if(f.isDehydrated)if(f={element:d,isDehydrated:!1,cache:g.cache,pendingSuspenseBoundaries:g.pendingSuspenseBoundaries,transitions:g.transitions},b.updateQueue.baseState=\nf,b.memoizedState=f,b.flags&256){e=Ji(Error(p(423)),b);b=lj(a,b,d,c,e);break a}else if(d!==e){e=Ji(Error(p(424)),b);b=lj(a,b,d,c,e);break a}else for(yg=Lf(b.stateNode.containerInfo.firstChild),xg=b,I=!0,zg=null,c=Vg(b,null,d,c),b.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling;else{Ig();if(d===e){b=Zi(a,b,c);break a}Xi(a,b,d,c)}b=b.child}return b;case 5:return Ah(b),null===a&&Eg(b),d=b.type,e=b.pendingProps,f=null!==a?a.memoizedProps:null,g=e.children,Ef(d,e)?g=null:null!==f&&Ef(d,f)&&(b.flags|=32),\ngj(a,b),Xi(a,b,g,c),b.child;case 6:return null===a&&Eg(b),null;case 13:return oj(a,b,c);case 4:return yh(b,b.stateNode.containerInfo),d=b.pendingProps,null===a?b.child=Ug(b,null,d,c):Xi(a,b,d,c),b.child;case 11:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),Yi(a,b,d,e,c);case 7:return Xi(a,b,b.pendingProps,c),b.child;case 8:return Xi(a,b,b.pendingProps.children,c),b.child;case 12:return Xi(a,b,b.pendingProps.children,c),b.child;case 10:a:{d=b.type._context;e=b.pendingProps;f=b.memoizedProps;\ng=e.value;G(Wg,d._currentValue);d._currentValue=g;if(null!==f)if(He(f.value,g)){if(f.children===e.children&&!Wf.current){b=Zi(a,b,c);break a}}else for(f=b.child,null!==f&&(f.return=b);null!==f;){var h=f.dependencies;if(null!==h){g=f.child;for(var k=h.firstContext;null!==k;){if(k.context===d){if(1===f.tag){k=mh(-1,c&-c);k.tag=2;var l=f.updateQueue;if(null!==l){l=l.shared;var m=l.pending;null===m?k.next=k:(k.next=m.next,m.next=k);l.pending=k}}f.lanes|=c;k=f.alternate;null!==k&&(k.lanes|=c);bh(f.return,\nc,b);h.lanes|=c;break}k=k.next}}else if(10===f.tag)g=f.type===b.type?null:f.child;else if(18===f.tag){g=f.return;if(null===g)throw Error(p(341));g.lanes|=c;h=g.alternate;null!==h&&(h.lanes|=c);bh(g,c,b);g=f.sibling}else g=f.child;if(null!==g)g.return=f;else for(g=f;null!==g;){if(g===b){g=null;break}f=g.sibling;if(null!==f){f.return=g.return;g=f;break}g=g.return}f=g}Xi(a,b,e.children,c);b=b.child}return b;case 9:return e=b.type,d=b.pendingProps.children,ch(b,c),e=eh(e),d=d(e),b.flags|=1,Xi(a,b,d,c),\nb.child;case 14:return d=b.type,e=Ci(d,b.pendingProps),e=Ci(d.type,e),$i(a,b,d,e,c);case 15:return bj(a,b,b.type,b.pendingProps,c);case 17:return d=b.type,e=b.pendingProps,e=b.elementType===d?e:Ci(d,e),ij(a,b),b.tag=1,Zf(d)?(a=!0,cg(b)):a=!1,ch(b,c),Gi(b,d,e),Ii(b,d,e,c),jj(null,b,d,!0,a,c);case 19:return xj(a,b,c);case 22:return dj(a,b,c)}throw Error(p(156,b.tag));};function Fk(a,b){return ac(a,b)}\nfunction $k(a,b,c,d){this.tag=a;this.key=c;this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null;this.index=0;this.ref=null;this.pendingProps=b;this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null;this.mode=d;this.subtreeFlags=this.flags=0;this.deletions=null;this.childLanes=this.lanes=0;this.alternate=null}function Bg(a,b,c,d){return new $k(a,b,c,d)}function aj(a){a=a.prototype;return!(!a||!a.isReactComponent)}\nfunction Zk(a){if(\"function\"===typeof a)return aj(a)?1:0;if(void 0!==a&&null!==a){a=a.$$typeof;if(a===Da)return 11;if(a===Ga)return 14}return 2}\nfunction Pg(a,b){var c=a.alternate;null===c?(c=Bg(a.tag,b,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=b,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null);c.flags=a.flags&14680064;c.childLanes=a.childLanes;c.lanes=a.lanes;c.child=a.child;c.memoizedProps=a.memoizedProps;c.memoizedState=a.memoizedState;c.updateQueue=a.updateQueue;b=a.dependencies;c.dependencies=null===b?null:{lanes:b.lanes,firstContext:b.firstContext};\nc.sibling=a.sibling;c.index=a.index;c.ref=a.ref;return c}\nfunction Rg(a,b,c,d,e,f){var g=2;d=a;if(\"function\"===typeof a)aj(a)&&(g=1);else if(\"string\"===typeof a)g=5;else a:switch(a){case ya:return Tg(c.children,e,f,b);case za:g=8;e|=8;break;case Aa:return a=Bg(12,c,b,e|2),a.elementType=Aa,a.lanes=f,a;case Ea:return a=Bg(13,c,b,e),a.elementType=Ea,a.lanes=f,a;case Fa:return a=Bg(19,c,b,e),a.elementType=Fa,a.lanes=f,a;case Ia:return pj(c,e,f,b);default:if(\"object\"===typeof a&&null!==a)switch(a.$$typeof){case Ba:g=10;break a;case Ca:g=9;break a;case Da:g=11;\nbreak a;case Ga:g=14;break a;case Ha:g=16;d=null;break a}throw Error(p(130,null==a?a:typeof a,\"\"));}b=Bg(g,c,b,e);b.elementType=a;b.type=d;b.lanes=f;return b}function Tg(a,b,c,d){a=Bg(7,a,d,b);a.lanes=c;return a}function pj(a,b,c,d){a=Bg(22,a,d,b);a.elementType=Ia;a.lanes=c;a.stateNode={isHidden:!1};return a}function Qg(a,b,c){a=Bg(6,a,null,b);a.lanes=c;return a}\nfunction Sg(a,b,c){b=Bg(4,null!==a.children?a.children:[],a.key,b);b.lanes=c;b.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation};return b}\nfunction al(a,b,c,d,e){this.tag=b;this.containerInfo=a;this.finishedWork=this.pingCache=this.current=this.pendingChildren=null;this.timeoutHandle=-1;this.callbackNode=this.pendingContext=this.context=null;this.callbackPriority=0;this.eventTimes=zc(0);this.expirationTimes=zc(-1);this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0;this.entanglements=zc(0);this.identifierPrefix=d;this.onRecoverableError=e;this.mutableSourceEagerHydrationData=\nnull}function bl(a,b,c,d,e,f,g,h,k){a=new al(a,b,c,h,k);1===b?(b=1,!0===f&&(b|=8)):b=0;f=Bg(3,null,null,b);a.current=f;f.stateNode=a;f.memoizedState={element:d,isDehydrated:c,cache:null,transitions:null,pendingSuspenseBoundaries:null};kh(f);return a}function cl(a,b,c){var d=3 lineLength) {\n // eslint-disable-next-line no-param-reassign\n colno = lineLength;\n }\n\n let start = Math.max(colno - 60, 0);\n if (start < 5) {\n start = 0;\n }\n\n let end = Math.min(start + 140, lineLength);\n if (end > lineLength - 5) {\n end = lineLength;\n }\n if (end === lineLength) {\n start = Math.max(end - 140, 0);\n }\n\n newLine = newLine.slice(start, end);\n if (start > 0) {\n newLine = `'{snip} ${newLine}`;\n }\n if (end < lineLength) {\n newLine += ' {snip}';\n }\n\n return newLine;\n}\n\n/**\n * Join values in array\n * @param input array of values to be joined together\n * @param delimiter string to be placed in-between values\n * @returns Joined values\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction safeJoin(input, delimiter) {\n if (!Array.isArray(input)) {\n return '';\n }\n\n const output = [];\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < input.length; i++) {\n const value = input[i];\n try {\n // This is a hack to fix a Vue3-specific bug that causes an infinite loop of\n // console warnings. This happens when a Vue template is rendered with\n // an undeclared variable, which we try to stringify, ultimately causing\n // Vue to issue another warning which repeats indefinitely.\n // see: https://github.com/getsentry/sentry-javascript/pull/8981\n if (isVueViewModel(value)) {\n output.push('[VueViewModel]');\n } else {\n output.push(String(value));\n }\n } catch (e) {\n output.push('[value cannot be serialized]');\n }\n }\n\n return output.join(delimiter);\n}\n\n/**\n * Checks if the given value matches a regex or string\n *\n * @param value The string to test\n * @param pattern Either a regex or a string against which `value` will be matched\n * @param requireExactStringMatch If true, `value` must match `pattern` exactly. If false, `value` will match\n * `pattern` if it contains `pattern`. Only applies to string-type patterns.\n */\nfunction isMatchingPattern(\n value,\n pattern,\n requireExactStringMatch = false,\n) {\n if (!isString(value)) {\n return false;\n }\n\n if (isRegExp(pattern)) {\n return pattern.test(value);\n }\n if (isString(pattern)) {\n return requireExactStringMatch ? value === pattern : value.includes(pattern);\n }\n\n return false;\n}\n\n/**\n * Test the given string against an array of strings and regexes. By default, string matching is done on a\n * substring-inclusion basis rather than a strict equality basis\n *\n * @param testString The string to test\n * @param patterns The patterns against which to test the string\n * @param requireExactStringMatch If true, `testString` must match one of the given string patterns exactly in order to\n * count. If false, `testString` will match a string pattern if it contains that pattern.\n * @returns\n */\nfunction stringMatchesSomePattern(\n testString,\n patterns = [],\n requireExactStringMatch = false,\n) {\n return patterns.some(pattern => isMatchingPattern(testString, pattern, requireExactStringMatch));\n}\n\nexport { isMatchingPattern, safeJoin, snipLine, stringMatchesSomePattern, truncate };\n//# sourceMappingURL=string.js.map\n","import { isInstanceOf } from './is.js';\nimport { truncate } from './string.js';\n\n/**\n * Creates exceptions inside `event.exception.values` for errors that are nested on properties based on the `key` parameter.\n */\nfunction applyAggregateErrorsToEvent(\n exceptionFromErrorImplementation,\n parser,\n maxValueLimit = 250,\n key,\n limit,\n event,\n hint,\n) {\n if (!event.exception || !event.exception.values || !hint || !isInstanceOf(hint.originalException, Error)) {\n return;\n }\n\n // Generally speaking the last item in `event.exception.values` is the exception originating from the original Error\n const originalException =\n event.exception.values.length > 0 ? event.exception.values[event.exception.values.length - 1] : undefined;\n\n // We only create exception grouping if there is an exception in the event.\n if (originalException) {\n event.exception.values = truncateAggregateExceptions(\n aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n hint.originalException ,\n key,\n event.exception.values,\n originalException,\n 0,\n ),\n maxValueLimit,\n );\n }\n}\n\nfunction aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n error,\n key,\n prevExceptions,\n exception,\n exceptionId,\n) {\n if (prevExceptions.length >= limit + 1) {\n return prevExceptions;\n }\n\n let newExceptions = [...prevExceptions];\n\n // Recursively call this function in order to walk down a chain of errors\n if (isInstanceOf(error[key], Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId);\n const newException = exceptionFromErrorImplementation(parser, error[key]);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, key, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n error[key],\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n\n // This will create exception grouping for AggregateErrors\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/AggregateError\n if (Array.isArray(error.errors)) {\n error.errors.forEach((childError, i) => {\n if (isInstanceOf(childError, Error)) {\n applyExceptionGroupFieldsForParentException(exception, exceptionId);\n const newException = exceptionFromErrorImplementation(parser, childError);\n const newExceptionId = newExceptions.length;\n applyExceptionGroupFieldsForChildException(newException, `errors[${i}]`, newExceptionId, exceptionId);\n newExceptions = aggregateExceptionsFromError(\n exceptionFromErrorImplementation,\n parser,\n limit,\n childError,\n key,\n [newException, ...newExceptions],\n newException,\n newExceptionId,\n );\n }\n });\n }\n\n return newExceptions;\n}\n\nfunction applyExceptionGroupFieldsForParentException(exception, exceptionId) {\n // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n exception.mechanism = {\n ...exception.mechanism,\n ...(exception.type === 'AggregateError' && { is_exception_group: true }),\n exception_id: exceptionId,\n };\n}\n\nfunction applyExceptionGroupFieldsForChildException(\n exception,\n source,\n exceptionId,\n parentId,\n) {\n // Don't know if this default makes sense. The protocol requires us to set these values so we pick *some* default.\n exception.mechanism = exception.mechanism || { type: 'generic', handled: true };\n\n exception.mechanism = {\n ...exception.mechanism,\n type: 'chained',\n source,\n exception_id: exceptionId,\n parent_id: parentId,\n };\n}\n\n/**\n * Truncate the message (exception.value) of all exceptions in the event.\n * Because this event processor is ran after `applyClientOptions`,\n * we need to truncate the message of the added exceptions here.\n */\nfunction truncateAggregateExceptions(exceptions, maxValueLength) {\n return exceptions.map(exception => {\n if (exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n return exception;\n });\n}\n\nexport { applyAggregateErrorsToEvent };\n//# sourceMappingURL=aggregate-errors.js.map\n","/** Internal global with common properties and Sentry extensions */\n\n// The code below for 'isGlobalObj' and 'GLOBAL_OBJ' was copied from core-js before modification\n// https://github.com/zloirock/core-js/blob/1b944df55282cdc99c90db5f49eb0b6eda2cc0a3/packages/core-js/internals/global.js\n// core-js has the following licence:\n//\n// Copyright (c) 2014-2022 Denis Pushkarev\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in\n// all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n// THE SOFTWARE.\n\n/** Returns 'obj' if it's the global object, otherwise returns undefined */\nfunction isGlobalObj(obj) {\n return obj && obj.Math == Math ? obj : undefined;\n}\n\n/** Get's the global object for the current JavaScript runtime */\nconst GLOBAL_OBJ =\n (typeof globalThis == 'object' && isGlobalObj(globalThis)) ||\n // eslint-disable-next-line no-restricted-globals\n (typeof window == 'object' && isGlobalObj(window)) ||\n (typeof self == 'object' && isGlobalObj(self)) ||\n (typeof global == 'object' && isGlobalObj(global)) ||\n (function () {\n return this;\n })() ||\n {};\n\n/**\n * @deprecated Use GLOBAL_OBJ instead or WINDOW from @sentry/browser. This will be removed in v8\n */\nfunction getGlobalObject() {\n return GLOBAL_OBJ ;\n}\n\n/**\n * Returns a global singleton contained in the global `__SENTRY__` object.\n *\n * If the singleton doesn't already exist in `__SENTRY__`, it will be created using the given factory\n * function and added to the `__SENTRY__` object.\n *\n * @param name name of the global singleton on __SENTRY__\n * @param creator creator Factory function to create the singleton if it doesn't already exist on `__SENTRY__`\n * @param obj (Optional) The global object on which to look for `__SENTRY__`, if not `GLOBAL_OBJ`'s return value\n * @returns the singleton\n */\nfunction getGlobalSingleton(name, creator, obj) {\n const gbl = (obj || GLOBAL_OBJ) ;\n const __SENTRY__ = (gbl.__SENTRY__ = gbl.__SENTRY__ || {});\n const singleton = __SENTRY__[name] || (__SENTRY__[name] = creator());\n return singleton;\n}\n\nexport { GLOBAL_OBJ, getGlobalObject, getGlobalSingleton };\n//# sourceMappingURL=worldwide.js.map\n","import { isString } from './is.js';\nimport { getGlobalObject } from './worldwide.js';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject();\n\nconst DEFAULT_MAX_STRING_LENGTH = 80;\n\n/**\n * Given a child DOM element, returns a query-selector statement describing that\n * and its ancestors\n * e.g. [HTMLElement] => body > div > input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction htmlTreeAsString(\n elem,\n options = {},\n) {\n if (!elem) {\n return '';\n }\n\n // try/catch both:\n // - accessing event.target (see getsentry/raven-js#838, #768)\n // - `htmlTreeAsString` because it's complex, and just accessing the DOM incorrectly\n // - can throw an exception in some circumstances.\n try {\n let currentElem = elem ;\n const MAX_TRAVERSE_HEIGHT = 5;\n const out = [];\n let height = 0;\n let len = 0;\n const separator = ' > ';\n const sepLength = separator.length;\n let nextStr;\n const keyAttrs = Array.isArray(options) ? options : options.keyAttrs;\n const maxStringLength = (!Array.isArray(options) && options.maxStringLength) || DEFAULT_MAX_STRING_LENGTH;\n\n while (currentElem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = _htmlElementAsString(currentElem, keyAttrs);\n // bail out if\n // - nextStr is the 'html' element\n // - the length of the string that would be created exceeds maxStringLength\n // (ignore this limit if we are on the first iteration)\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= maxStringLength)) {\n break;\n }\n\n out.push(nextStr);\n\n len += nextStr.length;\n currentElem = currentElem.parentNode;\n }\n\n return out.reverse().join(separator);\n } catch (_oO) {\n return '';\n }\n}\n\n/**\n * Returns a simple, query-selector representation of a DOM element\n * e.g. [HTMLElement] => input#foo.btn[name=baz]\n * @returns generated DOM path\n */\nfunction _htmlElementAsString(el, keyAttrs) {\n const elem = el\n\n;\n\n const out = [];\n let className;\n let classes;\n let key;\n let attr;\n let i;\n\n if (!elem || !elem.tagName) {\n return '';\n }\n\n // @ts-expect-error WINDOW has HTMLElement\n if (WINDOW.HTMLElement) {\n // If using the component name annotation plugin, this value may be available on the DOM node\n if (elem instanceof HTMLElement && elem.dataset && elem.dataset['sentryComponent']) {\n return elem.dataset['sentryComponent'];\n }\n }\n\n out.push(elem.tagName.toLowerCase());\n\n // Pairs of attribute keys defined in `serializeAttribute` and their values on element.\n const keyAttrPairs =\n keyAttrs && keyAttrs.length\n ? keyAttrs.filter(keyAttr => elem.getAttribute(keyAttr)).map(keyAttr => [keyAttr, elem.getAttribute(keyAttr)])\n : null;\n\n if (keyAttrPairs && keyAttrPairs.length) {\n keyAttrPairs.forEach(keyAttrPair => {\n out.push(`[${keyAttrPair[0]}=\"${keyAttrPair[1]}\"]`);\n });\n } else {\n if (elem.id) {\n out.push(`#${elem.id}`);\n }\n\n // eslint-disable-next-line prefer-const\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push(`.${classes[i]}`);\n }\n }\n }\n const allowedAttrs = ['aria-label', 'type', 'name', 'title', 'alt'];\n for (i = 0; i < allowedAttrs.length; i++) {\n key = allowedAttrs[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push(`[${key}=\"${attr}\"]`);\n }\n }\n return out.join('');\n}\n\n/**\n * A safe form of location.href\n */\nfunction getLocationHref() {\n try {\n return WINDOW.document.location.href;\n } catch (oO) {\n return '';\n }\n}\n\n/**\n * Gets a DOM element by using document.querySelector.\n *\n * This wrapper will first check for the existance of the function before\n * actually calling it so that we don't have to take care of this check,\n * every time we want to access the DOM.\n *\n * Reason: DOM/querySelector is not available in all environments.\n *\n * We have to cast to any because utils can be consumed by a variety of environments,\n * and we don't want to break TS users. If you know what element will be selected by\n * `document.querySelector`, specify it as part of the generic call. For example,\n * `const element = getDomElement('selector');`\n *\n * @param selector the selector string passed on to document.querySelector\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction getDomElement(selector) {\n if (WINDOW.document && WINDOW.document.querySelector) {\n return WINDOW.document.querySelector(selector) ;\n }\n return null;\n}\n\n/**\n * Given a DOM element, traverses up the tree until it finds the first ancestor node\n * that has the `data-sentry-component` attribute. This attribute is added at build-time\n * by projects that have the component name annotation plugin installed.\n *\n * @returns a string representation of the component for the provided DOM element, or `null` if not found\n */\nfunction getComponentName(elem) {\n // @ts-expect-error WINDOW has HTMLElement\n if (!WINDOW.HTMLElement) {\n return null;\n }\n\n let currentElem = elem ;\n const MAX_TRAVERSE_HEIGHT = 5;\n for (let i = 0; i < MAX_TRAVERSE_HEIGHT; i++) {\n if (!currentElem) {\n return null;\n }\n\n if (currentElem instanceof HTMLElement && currentElem.dataset['sentryComponent']) {\n return currentElem.dataset['sentryComponent'];\n }\n\n currentElem = currentElem.parentNode;\n }\n\n return null;\n}\n\nexport { getComponentName, getDomElement, getLocationHref, htmlTreeAsString };\n//# sourceMappingURL=browser.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/** Prefix for logging strings */\nconst PREFIX = 'Sentry Logger ';\n\nconst CONSOLE_LEVELS = [\n 'debug',\n 'info',\n 'warn',\n 'error',\n 'log',\n 'assert',\n 'trace',\n] ;\n\n/** This may be mutated by the console instrumentation. */\nconst originalConsoleMethods\n\n = {};\n\n/** JSDoc */\n\n/**\n * Temporarily disable sentry console instrumentations.\n *\n * @param callback The function to run against the original `console` messages\n * @returns The results of the callback\n */\nfunction consoleSandbox(callback) {\n if (!('console' in GLOBAL_OBJ)) {\n return callback();\n }\n\n const console = GLOBAL_OBJ.console ;\n const wrappedFuncs = {};\n\n const wrappedLevels = Object.keys(originalConsoleMethods) ;\n\n // Restore all wrapped console methods\n wrappedLevels.forEach(level => {\n const originalConsoleMethod = originalConsoleMethods[level] ;\n wrappedFuncs[level] = console[level] ;\n console[level] = originalConsoleMethod;\n });\n\n try {\n return callback();\n } finally {\n // Revert restoration to wrapped state\n wrappedLevels.forEach(level => {\n console[level] = wrappedFuncs[level] ;\n });\n }\n}\n\nfunction makeLogger() {\n let enabled = false;\n const logger = {\n enable: () => {\n enabled = true;\n },\n disable: () => {\n enabled = false;\n },\n isEnabled: () => enabled,\n };\n\n if (DEBUG_BUILD) {\n CONSOLE_LEVELS.forEach(name => {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n logger[name] = (...args) => {\n if (enabled) {\n consoleSandbox(() => {\n GLOBAL_OBJ.console[name](`${PREFIX}[${name}]:`, ...args);\n });\n }\n };\n });\n } else {\n CONSOLE_LEVELS.forEach(name => {\n logger[name] = () => undefined;\n });\n }\n\n return logger ;\n}\n\nconst logger = makeLogger();\n\nexport { CONSOLE_LEVELS, consoleSandbox, logger, originalConsoleMethods };\n//# sourceMappingURL=logger.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { consoleSandbox, logger } from './logger.js';\n\n/** Regular expression used to parse a Dsn. */\nconst DSN_REGEX = /^(?:(\\w+):)\\/\\/(?:(\\w+)(?::(\\w+)?)?@)([\\w.-]+)(?::(\\d+))?\\/(.+)/;\n\nfunction isValidProtocol(protocol) {\n return protocol === 'http' || protocol === 'https';\n}\n\n/**\n * Renders the string representation of this Dsn.\n *\n * By default, this will render the public representation without the password\n * component. To get the deprecated private representation, set `withPassword`\n * to true.\n *\n * @param withPassword When set to true, the password will be included.\n */\nfunction dsnToString(dsn, withPassword = false) {\n const { host, path, pass, port, projectId, protocol, publicKey } = dsn;\n return (\n `${protocol}://${publicKey}${withPassword && pass ? `:${pass}` : ''}` +\n `@${host}${port ? `:${port}` : ''}/${path ? `${path}/` : path}${projectId}`\n );\n}\n\n/**\n * Parses a Dsn from a given string.\n *\n * @param str A Dsn as string\n * @returns Dsn as DsnComponents or undefined if @param str is not a valid DSN string\n */\nfunction dsnFromString(str) {\n const match = DSN_REGEX.exec(str);\n\n if (!match) {\n // This should be logged to the console\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.error(`Invalid Sentry Dsn: ${str}`);\n });\n return undefined;\n }\n\n const [protocol, publicKey, pass = '', host, port = '', lastPath] = match.slice(1);\n let path = '';\n let projectId = lastPath;\n\n const split = projectId.split('/');\n if (split.length > 1) {\n path = split.slice(0, -1).join('/');\n projectId = split.pop() ;\n }\n\n if (projectId) {\n const projectMatch = projectId.match(/^\\d+/);\n if (projectMatch) {\n projectId = projectMatch[0];\n }\n }\n\n return dsnFromComponents({ host, pass, path, projectId, port, protocol: protocol , publicKey });\n}\n\nfunction dsnFromComponents(components) {\n return {\n protocol: components.protocol,\n publicKey: components.publicKey || '',\n pass: components.pass || '',\n host: components.host,\n port: components.port || '',\n path: components.path || '',\n projectId: components.projectId,\n };\n}\n\nfunction validateDsn(dsn) {\n if (!DEBUG_BUILD) {\n return true;\n }\n\n const { port, projectId, protocol } = dsn;\n\n const requiredComponents = ['protocol', 'publicKey', 'host', 'projectId'];\n const hasMissingRequiredComponent = requiredComponents.find(component => {\n if (!dsn[component]) {\n logger.error(`Invalid Sentry Dsn: ${component} missing`);\n return true;\n }\n return false;\n });\n\n if (hasMissingRequiredComponent) {\n return false;\n }\n\n if (!projectId.match(/^\\d+$/)) {\n logger.error(`Invalid Sentry Dsn: Invalid projectId ${projectId}`);\n return false;\n }\n\n if (!isValidProtocol(protocol)) {\n logger.error(`Invalid Sentry Dsn: Invalid protocol ${protocol}`);\n return false;\n }\n\n if (port && isNaN(parseInt(port, 10))) {\n logger.error(`Invalid Sentry Dsn: Invalid port ${port}`);\n return false;\n }\n\n return true;\n}\n\n/**\n * Creates a valid Sentry Dsn object, identifying a Sentry instance and project.\n * @returns a valid DsnComponents object or `undefined` if @param from is an invalid DSN source\n */\nfunction makeDsn(from) {\n const components = typeof from === 'string' ? dsnFromString(from) : dsnFromComponents(from);\n if (!components || !validateDsn(components)) {\n return undefined;\n }\n return components;\n}\n\nexport { dsnFromString, dsnToString, makeDsn };\n//# sourceMappingURL=dsn.js.map\n","/** An error emitted by Sentry SDKs and related utilities. */\nclass SentryError extends Error {\n /** Display name of this error instance. */\n\n constructor( message, logLevel = 'warn') {\n super(message);this.message = message;\n this.name = new.target.prototype.constructor.name;\n // This sets the prototype to be `Error`, not `SentryError`. It's unclear why we do this, but commenting this line\n // out causes various (seemingly totally unrelated) playwright tests consistently time out. FYI, this makes\n // instances of `SentryError` fail `obj instanceof SentryError` checks.\n Object.setPrototypeOf(this, new.target.prototype);\n this.logLevel = logLevel;\n }\n}\n\nexport { SentryError };\n//# sourceMappingURL=error.js.map\n","import { htmlTreeAsString } from './browser.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { isError, isEvent, isInstanceOf, isElement, isPlainObject, isPrimitive } from './is.js';\nimport { logger } from './logger.js';\nimport { truncate } from './string.js';\n\n/**\n * Replace a method in an object with a wrapped version of itself.\n *\n * @param source An object that contains a method to be wrapped.\n * @param name The name of the method to be wrapped.\n * @param replacementFactory A higher-order function that takes the original version of the given method and returns a\n * wrapped version. Note: The function returned by `replacementFactory` needs to be a non-arrow function, in order to\n * preserve the correct value of `this`, and the original method must be called using `origMethod.call(this, )` or `origMethod.apply(this, [])` (rather than being called directly), again to preserve `this`.\n * @returns void\n */\nfunction fill(source, name, replacementFactory) {\n if (!(name in source)) {\n return;\n }\n\n const original = source[name] ;\n const wrapped = replacementFactory(original) ;\n\n // Make sure it's a function first, as we need to attach an empty prototype for `defineProperties` to work\n // otherwise it'll throw \"TypeError: Object.defineProperties called on non-object\"\n if (typeof wrapped === 'function') {\n markFunctionWrapped(wrapped, original);\n }\n\n source[name] = wrapped;\n}\n\n/**\n * Defines a non-enumerable property on the given object.\n *\n * @param obj The object on which to set the property\n * @param name The name of the property to be set\n * @param value The value to which to set the property\n */\nfunction addNonEnumerableProperty(obj, name, value) {\n try {\n Object.defineProperty(obj, name, {\n // enumerable: false, // the default, so we can save on bundle size by not explicitly setting it\n value: value,\n writable: true,\n configurable: true,\n });\n } catch (o_O) {\n DEBUG_BUILD && logger.log(`Failed to add non-enumerable property \"${name}\" to object`, obj);\n }\n}\n\n/**\n * Remembers the original function on the wrapped function and\n * patches up the prototype.\n *\n * @param wrapped the wrapper function\n * @param original the original function that gets wrapped\n */\nfunction markFunctionWrapped(wrapped, original) {\n try {\n const proto = original.prototype || {};\n wrapped.prototype = original.prototype = proto;\n addNonEnumerableProperty(wrapped, '__sentry_original__', original);\n } catch (o_O) {} // eslint-disable-line no-empty\n}\n\n/**\n * This extracts the original function if available. See\n * `markFunctionWrapped` for more information.\n *\n * @param func the function to unwrap\n * @returns the unwrapped version of the function if available.\n */\nfunction getOriginalFunction(func) {\n return func.__sentry_original__;\n}\n\n/**\n * Encodes given object into url-friendly format\n *\n * @param object An object that contains serializable values\n * @returns string Encoded\n */\nfunction urlEncode(object) {\n return Object.keys(object)\n .map(key => `${encodeURIComponent(key)}=${encodeURIComponent(object[key])}`)\n .join('&');\n}\n\n/**\n * Transforms any `Error` or `Event` into a plain object with all of their enumerable properties, and some of their\n * non-enumerable properties attached.\n *\n * @param value Initial source that we have to transform in order for it to be usable by the serializer\n * @returns An Event or Error turned into an object - or the value argurment itself, when value is neither an Event nor\n * an Error.\n */\nfunction convertToPlainObject(\n value,\n)\n\n {\n if (isError(value)) {\n return {\n message: value.message,\n name: value.name,\n stack: value.stack,\n ...getOwnProperties(value),\n };\n } else if (isEvent(value)) {\n const newObj\n\n = {\n type: value.type,\n target: serializeEventTarget(value.target),\n currentTarget: serializeEventTarget(value.currentTarget),\n ...getOwnProperties(value),\n };\n\n if (typeof CustomEvent !== 'undefined' && isInstanceOf(value, CustomEvent)) {\n newObj.detail = value.detail;\n }\n\n return newObj;\n } else {\n return value;\n }\n}\n\n/** Creates a string representation of the target of an `Event` object */\nfunction serializeEventTarget(target) {\n try {\n return isElement(target) ? htmlTreeAsString(target) : Object.prototype.toString.call(target);\n } catch (_oO) {\n return '';\n }\n}\n\n/** Filters out all but an object's own properties */\nfunction getOwnProperties(obj) {\n if (typeof obj === 'object' && obj !== null) {\n const extractedProps = {};\n for (const property in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, property)) {\n extractedProps[property] = (obj )[property];\n }\n }\n return extractedProps;\n } else {\n return {};\n }\n}\n\n/**\n * Given any captured exception, extract its keys and create a sorted\n * and truncated list that will be used inside the event message.\n * eg. `Non-error exception captured with keys: foo, bar, baz`\n */\nfunction extractExceptionKeysForMessage(exception, maxLength = 40) {\n const keys = Object.keys(convertToPlainObject(exception));\n keys.sort();\n\n if (!keys.length) {\n return '[object has no keys]';\n }\n\n if (keys[0].length >= maxLength) {\n return truncate(keys[0], maxLength);\n }\n\n for (let includedKeys = keys.length; includedKeys > 0; includedKeys--) {\n const serialized = keys.slice(0, includedKeys).join(', ');\n if (serialized.length > maxLength) {\n continue;\n }\n if (includedKeys === keys.length) {\n return serialized;\n }\n return truncate(serialized, maxLength);\n }\n\n return '';\n}\n\n/**\n * Given any object, return a new object having removed all fields whose value was `undefined`.\n * Works recursively on objects and arrays.\n *\n * Attention: This function keeps circular references in the returned object.\n */\nfunction dropUndefinedKeys(inputValue) {\n // This map keeps track of what already visited nodes map to.\n // Our Set - based memoBuilder doesn't work here because we want to the output object to have the same circular\n // references as the input object.\n const memoizationMap = new Map();\n\n // This function just proxies `_dropUndefinedKeys` to keep the `memoBuilder` out of this function's API\n return _dropUndefinedKeys(inputValue, memoizationMap);\n}\n\nfunction _dropUndefinedKeys(inputValue, memoizationMap) {\n if (isPojo(inputValue)) {\n // If this node has already been visited due to a circular reference, return the object it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal ;\n }\n\n const returnValue = {};\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n for (const key of Object.keys(inputValue)) {\n if (typeof inputValue[key] !== 'undefined') {\n returnValue[key] = _dropUndefinedKeys(inputValue[key], memoizationMap);\n }\n }\n\n return returnValue ;\n }\n\n if (Array.isArray(inputValue)) {\n // If this node has already been visited due to a circular reference, return the array it was mapped to in the new object\n const memoVal = memoizationMap.get(inputValue);\n if (memoVal !== undefined) {\n return memoVal ;\n }\n\n const returnValue = [];\n // Store the mapping of this value in case we visit it again, in case of circular data\n memoizationMap.set(inputValue, returnValue);\n\n inputValue.forEach((item) => {\n returnValue.push(_dropUndefinedKeys(item, memoizationMap));\n });\n\n return returnValue ;\n }\n\n return inputValue;\n}\n\nfunction isPojo(input) {\n if (!isPlainObject(input)) {\n return false;\n }\n\n try {\n const name = (Object.getPrototypeOf(input) ).constructor.name;\n return !name || name === 'Object';\n } catch (e) {\n return true;\n }\n}\n\n/**\n * Ensure that something is an object.\n *\n * Turns `undefined` and `null` into `String`s and all other primitives into instances of their respective wrapper\n * classes (String, Boolean, Number, etc.). Acts as the identity function on non-primitives.\n *\n * @param wat The subject of the objectification\n * @returns A version of `wat` which can safely be used with `Object` class methods\n */\nfunction objectify(wat) {\n let objectified;\n switch (true) {\n case wat === undefined || wat === null:\n objectified = new String(wat);\n break;\n\n // Though symbols and bigints do have wrapper classes (`Symbol` and `BigInt`, respectively), for whatever reason\n // those classes don't have constructors which can be used with the `new` keyword. We therefore need to cast each as\n // an object in order to wrap it.\n case typeof wat === 'symbol' || typeof wat === 'bigint':\n objectified = Object(wat);\n break;\n\n // this will catch the remaining primitives: `String`, `Number`, and `Boolean`\n case isPrimitive(wat):\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n objectified = new (wat ).constructor(wat);\n break;\n\n // by process of elimination, at this point we know that `wat` must already be an object\n default:\n objectified = wat;\n break;\n }\n return objectified;\n}\n\nexport { addNonEnumerableProperty, convertToPlainObject, dropUndefinedKeys, extractExceptionKeysForMessage, fill, getOriginalFunction, markFunctionWrapped, objectify, urlEncode };\n//# sourceMappingURL=object.js.map\n","import { node } from './node-stack-trace.js';\nexport { filenameIsInApp } from './node-stack-trace.js';\n\nconst STACKTRACE_FRAME_LIMIT = 50;\n// Used to sanitize webpack (error: *) wrapped stack errors\nconst WEBPACK_ERROR_REGEXP = /\\(error: (.*)\\)/;\nconst STRIP_FRAME_REGEXP = /captureMessage|captureException/;\n\n/**\n * Creates a stack parser with the supplied line parsers\n *\n * StackFrames are returned in the correct order for Sentry Exception\n * frames and with Sentry SDK internal frames removed from the top and bottom\n *\n */\nfunction createStackParser(...parsers) {\n const sortedParsers = parsers.sort((a, b) => a[0] - b[0]).map(p => p[1]);\n\n return (stack, skipFirst = 0) => {\n const frames = [];\n const lines = stack.split('\\n');\n\n for (let i = skipFirst; i < lines.length; i++) {\n const line = lines[i];\n // Ignore lines over 1kb as they are unlikely to be stack frames.\n // Many of the regular expressions use backtracking which results in run time that increases exponentially with\n // input size. Huge strings can result in hangs/Denial of Service:\n // https://github.com/getsentry/sentry-javascript/issues/2286\n if (line.length > 1024) {\n continue;\n }\n\n // https://github.com/getsentry/sentry-javascript/issues/5459\n // Remove webpack (error: *) wrappers\n const cleanedLine = WEBPACK_ERROR_REGEXP.test(line) ? line.replace(WEBPACK_ERROR_REGEXP, '$1') : line;\n\n // https://github.com/getsentry/sentry-javascript/issues/7813\n // Skip Error: lines\n if (cleanedLine.match(/\\S*Error: /)) {\n continue;\n }\n\n for (const parser of sortedParsers) {\n const frame = parser(cleanedLine);\n\n if (frame) {\n frames.push(frame);\n break;\n }\n }\n\n if (frames.length >= STACKTRACE_FRAME_LIMIT) {\n break;\n }\n }\n\n return stripSentryFramesAndReverse(frames);\n };\n}\n\n/**\n * Gets a stack parser implementation from Options.stackParser\n * @see Options\n *\n * If options contains an array of line parsers, it is converted into a parser\n */\nfunction stackParserFromStackParserOptions(stackParser) {\n if (Array.isArray(stackParser)) {\n return createStackParser(...stackParser);\n }\n return stackParser;\n}\n\n/**\n * Removes Sentry frames from the top and bottom of the stack if present and enforces a limit of max number of frames.\n * Assumes stack input is ordered from top to bottom and returns the reverse representation so call site of the\n * function that caused the crash is the last frame in the array.\n * @hidden\n */\nfunction stripSentryFramesAndReverse(stack) {\n if (!stack.length) {\n return [];\n }\n\n const localStack = Array.from(stack);\n\n // If stack starts with one of our API calls, remove it (starts, meaning it's the top of the stack - aka last call)\n if (/sentryWrapped/.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n }\n\n // Reversing in the middle of the procedure allows us to just pop the values off the stack\n localStack.reverse();\n\n // If stack ends with one of our internal API calls, remove it (ends, meaning it's the bottom of the stack - aka top-most call)\n if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n\n // When using synthetic events, we will have a 2 levels deep stack, as `new Error('Sentry syntheticException')`\n // is produced within the hub itself, making it:\n //\n // Sentry.captureException()\n // getCurrentHub().captureException()\n //\n // instead of just the top `Sentry` call itself.\n // This forces us to possibly strip an additional frame in the exact same was as above.\n if (STRIP_FRAME_REGEXP.test(localStack[localStack.length - 1].function || '')) {\n localStack.pop();\n }\n }\n\n return localStack.slice(0, STACKTRACE_FRAME_LIMIT).map(frame => ({\n ...frame,\n filename: frame.filename || localStack[localStack.length - 1].filename,\n function: frame.function || '?',\n }));\n}\n\nconst defaultFunctionName = '';\n\n/**\n * Safely extract function name from itself\n */\nfunction getFunctionName(fn) {\n try {\n if (!fn || typeof fn !== 'function') {\n return defaultFunctionName;\n }\n return fn.name || defaultFunctionName;\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n return defaultFunctionName;\n }\n}\n\n/**\n * Node.js stack line parser\n *\n * This is in @sentry/utils so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.\n * This allows it to be used without referencing or importing any node specific code which causes bundlers to complain\n */\nfunction nodeStackLineParser(getModule) {\n return [90, node(getModule)];\n}\n\nexport { createStackParser, getFunctionName, nodeStackLineParser, stackParserFromStackParserOptions, stripSentryFramesAndReverse };\n//# sourceMappingURL=stacktrace.js.map\n","import { DEBUG_BUILD } from '../debug-build.js';\nimport { logger } from '../logger.js';\nimport { getFunctionName } from '../stacktrace.js';\n\n// We keep the handlers globally\nconst handlers = {};\nconst instrumented = {};\n\n/** Add a handler function. */\nfunction addHandler(type, handler) {\n handlers[type] = handlers[type] || [];\n (handlers[type] ).push(handler);\n}\n\n/**\n * Reset all instrumentation handlers.\n * This can be used by tests to ensure we have a clean slate of instrumentation handlers.\n */\nfunction resetInstrumentationHandlers() {\n Object.keys(handlers).forEach(key => {\n handlers[key ] = undefined;\n });\n}\n\n/** Maybe run an instrumentation function, unless it was already called. */\nfunction maybeInstrument(type, instrumentFn) {\n if (!instrumented[type]) {\n instrumentFn();\n instrumented[type] = true;\n }\n}\n\n/** Trigger handlers for a given instrumentation type. */\nfunction triggerHandlers(type, data) {\n const typeHandlers = type && handlers[type];\n if (!typeHandlers) {\n return;\n }\n\n for (const handler of typeHandlers) {\n try {\n handler(data);\n } catch (e) {\n DEBUG_BUILD &&\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n e,\n );\n }\n }\n}\n\nexport { addHandler, maybeInstrument, resetInstrumentationHandlers, triggerHandlers };\n//# sourceMappingURL=_handlers.js.map\n","import { CONSOLE_LEVELS, originalConsoleMethods } from '../logger.js';\nimport { fill } from '../object.js';\nimport { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\n/**\n * Add an instrumentation handler for when a console.xxx method is called.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addConsoleInstrumentationHandler(handler) {\n const type = 'console';\n addHandler(type, handler);\n maybeInstrument(type, instrumentConsole);\n}\n\nfunction instrumentConsole() {\n if (!('console' in GLOBAL_OBJ)) {\n return;\n }\n\n CONSOLE_LEVELS.forEach(function (level) {\n if (!(level in GLOBAL_OBJ.console)) {\n return;\n }\n\n fill(GLOBAL_OBJ.console, level, function (originalConsoleMethod) {\n originalConsoleMethods[level] = originalConsoleMethod;\n\n return function (...args) {\n const handlerData = { args, level };\n triggerHandlers('console', handlerData);\n\n const log = originalConsoleMethods[level];\n log && log.apply(GLOBAL_OBJ.console, args);\n };\n });\n });\n}\n\nexport { addConsoleInstrumentationHandler };\n//# sourceMappingURL=console.js.map\n","import { addNonEnumerableProperty } from './object.js';\nimport { snipLine } from './string.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/**\n * UUID4 generator\n *\n * @returns string Generated UUID4.\n */\nfunction uuid4() {\n const gbl = GLOBAL_OBJ ;\n const crypto = gbl.crypto || gbl.msCrypto;\n\n let getRandomByte = () => Math.random() * 16;\n try {\n if (crypto && crypto.randomUUID) {\n return crypto.randomUUID().replace(/-/g, '');\n }\n if (crypto && crypto.getRandomValues) {\n getRandomByte = () => {\n // crypto.getRandomValues might return undefined instead of the typed array\n // in old Chromium versions (e.g. 23.0.1235.0 (151422))\n // However, `typedArray` is still filled in-place.\n // @see https://developer.mozilla.org/en-US/docs/Web/API/Crypto/getRandomValues#typedarray\n const typedArray = new Uint8Array(1);\n crypto.getRandomValues(typedArray);\n return typedArray[0];\n };\n }\n } catch (_) {\n // some runtimes can crash invoking crypto\n // https://github.com/getsentry/sentry-javascript/issues/8935\n }\n\n // http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript/2117523#2117523\n // Concatenating the following numbers as strings results in '10000000100040008000100000000000'\n return (([1e7] ) + 1e3 + 4e3 + 8e3 + 1e11).replace(/[018]/g, c =>\n // eslint-disable-next-line no-bitwise\n ((c ) ^ ((getRandomByte() & 15) >> ((c ) / 4))).toString(16),\n );\n}\n\nfunction getFirstException(event) {\n return event.exception && event.exception.values ? event.exception.values[0] : undefined;\n}\n\n/**\n * Extracts either message or type+value from an event that can be used for user-facing logs\n * @returns event's description\n */\nfunction getEventDescription(event) {\n const { message, event_id: eventId } = event;\n if (message) {\n return message;\n }\n\n const firstException = getFirstException(event);\n if (firstException) {\n if (firstException.type && firstException.value) {\n return `${firstException.type}: ${firstException.value}`;\n }\n return firstException.type || firstException.value || eventId || '';\n }\n return eventId || '';\n}\n\n/**\n * Adds exception values, type and value to an synthetic Exception.\n * @param event The event to modify.\n * @param value Value of the exception.\n * @param type Type of the exception.\n * @hidden\n */\nfunction addExceptionTypeValue(event, value, type) {\n const exception = (event.exception = event.exception || {});\n const values = (exception.values = exception.values || []);\n const firstException = (values[0] = values[0] || {});\n if (!firstException.value) {\n firstException.value = value || '';\n }\n if (!firstException.type) {\n firstException.type = type || 'Error';\n }\n}\n\n/**\n * Adds exception mechanism data to a given event. Uses defaults if the second parameter is not passed.\n *\n * @param event The event to modify.\n * @param newMechanism Mechanism data to add to the event.\n * @hidden\n */\nfunction addExceptionMechanism(event, newMechanism) {\n const firstException = getFirstException(event);\n if (!firstException) {\n return;\n }\n\n const defaultMechanism = { type: 'generic', handled: true };\n const currentMechanism = firstException.mechanism;\n firstException.mechanism = { ...defaultMechanism, ...currentMechanism, ...newMechanism };\n\n if (newMechanism && 'data' in newMechanism) {\n const mergedData = { ...(currentMechanism && currentMechanism.data), ...newMechanism.data };\n firstException.mechanism.data = mergedData;\n }\n}\n\n// https://semver.org/#is-there-a-suggested-regular-expression-regex-to-check-a-semver-string\nconst SEMVER_REGEXP =\n /^(0|[1-9]\\d*)\\.(0|[1-9]\\d*)\\.(0|[1-9]\\d*)(?:-((?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\\.(?:0|[1-9]\\d*|\\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\\+([0-9a-zA-Z-]+(?:\\.[0-9a-zA-Z-]+)*))?$/;\n\n/**\n * Represents Semantic Versioning object\n */\n\n/**\n * Parses input into a SemVer interface\n * @param input string representation of a semver version\n */\nfunction parseSemver(input) {\n const match = input.match(SEMVER_REGEXP) || [];\n const major = parseInt(match[1], 10);\n const minor = parseInt(match[2], 10);\n const patch = parseInt(match[3], 10);\n return {\n buildmetadata: match[5],\n major: isNaN(major) ? undefined : major,\n minor: isNaN(minor) ? undefined : minor,\n patch: isNaN(patch) ? undefined : patch,\n prerelease: match[4],\n };\n}\n\n/**\n * This function adds context (pre/post/line) lines to the provided frame\n *\n * @param lines string[] containing all lines\n * @param frame StackFrame that will be mutated\n * @param linesOfContext number of context lines we want to add pre/post\n */\nfunction addContextToFrame(lines, frame, linesOfContext = 5) {\n // When there is no line number in the frame, attaching context is nonsensical and will even break grouping\n if (frame.lineno === undefined) {\n return;\n }\n\n const maxLines = lines.length;\n const sourceLine = Math.max(Math.min(maxLines - 1, frame.lineno - 1), 0);\n\n frame.pre_context = lines\n .slice(Math.max(0, sourceLine - linesOfContext), sourceLine)\n .map((line) => snipLine(line, 0));\n\n frame.context_line = snipLine(lines[Math.min(maxLines - 1, sourceLine)], frame.colno || 0);\n\n frame.post_context = lines\n .slice(Math.min(sourceLine + 1, maxLines), sourceLine + 1 + linesOfContext)\n .map((line) => snipLine(line, 0));\n}\n\n/**\n * Checks whether or not we've already captured the given exception (note: not an identical exception - the very object\n * in question), and marks it captured if not.\n *\n * This is useful because it's possible for an error to get captured by more than one mechanism. After we intercept and\n * record an error, we rethrow it (assuming we've intercepted it before it's reached the top-level global handlers), so\n * that we don't interfere with whatever effects the error might have had were the SDK not there. At that point, because\n * the error has been rethrown, it's possible for it to bubble up to some other code we've instrumented. If it's not\n * caught after that, it will bubble all the way up to the global handlers (which of course we also instrument). This\n * function helps us ensure that even if we encounter the same error more than once, we only record it the first time we\n * see it.\n *\n * Note: It will ignore primitives (always return `false` and not mark them as seen), as properties can't be set on\n * them. {@link: Object.objectify} can be used on exceptions to convert any that are primitives into their equivalent\n * object wrapper forms so that this check will always work. However, because we need to flag the exact object which\n * will get rethrown, and because that rethrowing happens outside of the event processing pipeline, the objectification\n * must be done before the exception captured.\n *\n * @param A thrown exception to check or flag as having been seen\n * @returns `true` if the exception has already been captured, `false` if not (with the side effect of marking it seen)\n */\nfunction checkOrSetAlreadyCaught(exception) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (exception && (exception ).__sentry_captured__) {\n return true;\n }\n\n try {\n // set it this way rather than by assignment so that it's not ennumerable and therefore isn't recorded by the\n // `ExtraErrorData` integration\n addNonEnumerableProperty(exception , '__sentry_captured__', true);\n } catch (err) {\n // `exception` is a primitive, so we can't mark it seen\n }\n\n return false;\n}\n\n/**\n * Checks whether the given input is already an array, and if it isn't, wraps it in one.\n *\n * @param maybeArray Input to turn into an array, if necessary\n * @returns The input, if already an array, or an array with the input as the only element, if not\n */\nfunction arrayify(maybeArray) {\n return Array.isArray(maybeArray) ? maybeArray : [maybeArray];\n}\n\nexport { addContextToFrame, addExceptionMechanism, addExceptionTypeValue, arrayify, checkOrSetAlreadyCaught, getEventDescription, parseSemver, uuid4 };\n//# sourceMappingURL=misc.js.map\n","import { uuid4 } from '../misc.js';\nimport { fill, addNonEnumerableProperty } from '../object.js';\nimport { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\nconst WINDOW = GLOBAL_OBJ ;\nconst DEBOUNCE_DURATION = 1000;\n\nlet debounceTimerID;\nlet lastCapturedEventType;\nlet lastCapturedEventTargetId;\n\n/**\n * Add an instrumentation handler for when a click or a keypress happens.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addClickKeypressInstrumentationHandler(handler) {\n const type = 'dom';\n addHandler(type, handler);\n maybeInstrument(type, instrumentDOM);\n}\n\n/** Exported for tests only. */\nfunction instrumentDOM() {\n if (!WINDOW.document) {\n return;\n }\n\n // Make it so that any click or keypress that is unhandled / bubbled up all the way to the document triggers our dom\n // handlers. (Normally we have only one, which captures a breadcrumb for each click or keypress.) Do this before\n // we instrument `addEventListener` so that we don't end up attaching this handler twice.\n const triggerDOMHandler = triggerHandlers.bind(null, 'dom');\n const globalDOMEventHandler = makeDOMEventHandler(triggerDOMHandler, true);\n WINDOW.document.addEventListener('click', globalDOMEventHandler, false);\n WINDOW.document.addEventListener('keypress', globalDOMEventHandler, false);\n\n // After hooking into click and keypress events bubbled up to `document`, we also hook into user-handled\n // clicks & keypresses, by adding an event listener of our own to any element to which they add a listener. That\n // way, whenever one of their handlers is triggered, ours will be, too. (This is needed because their handler\n // could potentially prevent the event from bubbling up to our global listeners. This way, our handler are still\n // guaranteed to fire at least once.)\n ['EventTarget', 'Node'].forEach((target) => {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const proto = (WINDOW )[target] && (WINDOW )[target].prototype;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (originalAddEventListener) {\n return function (\n\n type,\n listener,\n options,\n ) {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this ;\n const handlers = (el.__sentry_instrumentation_handlers__ = el.__sentry_instrumentation_handlers__ || {});\n const handlerForType = (handlers[type] = handlers[type] || { refCount: 0 });\n\n if (!handlerForType.handler) {\n const handler = makeDOMEventHandler(triggerDOMHandler);\n handlerForType.handler = handler;\n originalAddEventListener.call(this, type, handler, options);\n }\n\n handlerForType.refCount++;\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalAddEventListener.call(this, type, listener, options);\n };\n });\n\n fill(\n proto,\n 'removeEventListener',\n function (originalRemoveEventListener) {\n return function (\n\n type,\n listener,\n options,\n ) {\n if (type === 'click' || type == 'keypress') {\n try {\n const el = this ;\n const handlers = el.__sentry_instrumentation_handlers__ || {};\n const handlerForType = handlers[type];\n\n if (handlerForType) {\n handlerForType.refCount--;\n // If there are no longer any custom handlers of the current type on this element, we can remove ours, too.\n if (handlerForType.refCount <= 0) {\n originalRemoveEventListener.call(this, type, handlerForType.handler, options);\n handlerForType.handler = undefined;\n delete handlers[type]; // eslint-disable-line @typescript-eslint/no-dynamic-delete\n }\n\n // If there are no longer any custom handlers of any type on this element, cleanup everything.\n if (Object.keys(handlers).length === 0) {\n delete el.__sentry_instrumentation_handlers__;\n }\n }\n } catch (e) {\n // Accessing dom properties is always fragile.\n // Also allows us to skip `addEventListenrs` calls with no proper `this` context.\n }\n }\n\n return originalRemoveEventListener.call(this, type, listener, options);\n };\n },\n );\n });\n}\n\n/**\n * Check whether the event is similar to the last captured one. For example, two click events on the same button.\n */\nfunction isSimilarToLastCapturedEvent(event) {\n // If both events have different type, then user definitely performed two separate actions. e.g. click + keypress.\n if (event.type !== lastCapturedEventType) {\n return false;\n }\n\n try {\n // If both events have the same type, it's still possible that actions were performed on different targets.\n // e.g. 2 clicks on different buttons.\n if (!event.target || (event.target )._sentryId !== lastCapturedEventTargetId) {\n return false;\n }\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n }\n\n // If both events have the same type _and_ same `target` (an element which triggered an event, _not necessarily_\n // to which an event listener was attached), we treat them as the same action, as we want to capture\n // only one breadcrumb. e.g. multiple clicks on the same button, or typing inside a user input box.\n return true;\n}\n\n/**\n * Decide whether an event should be captured.\n * @param event event to be captured\n */\nfunction shouldSkipDOMEvent(eventType, target) {\n // We are only interested in filtering `keypress` events for now.\n if (eventType !== 'keypress') {\n return false;\n }\n\n if (!target || !target.tagName) {\n return true;\n }\n\n // Only consider keypress events on actual input elements. This will disregard keypresses targeting body\n // e.g.tabbing through elements, hotkeys, etc.\n if (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Wraps addEventListener to capture UI breadcrumbs\n */\nfunction makeDOMEventHandler(\n handler,\n globalListener = false,\n) {\n return (event) => {\n // It's possible this handler might trigger multiple times for the same\n // event (e.g. event propagation through node ancestors).\n // Ignore if we've already captured that event.\n if (!event || event['_sentryCaptured']) {\n return;\n }\n\n const target = getEventTarget(event);\n\n // We always want to skip _some_ events.\n if (shouldSkipDOMEvent(event.type, target)) {\n return;\n }\n\n // Mark event as \"seen\"\n addNonEnumerableProperty(event, '_sentryCaptured', true);\n\n if (target && !target._sentryId) {\n // Add UUID to event target so we can identify if\n addNonEnumerableProperty(target, '_sentryId', uuid4());\n }\n\n const name = event.type === 'keypress' ? 'input' : event.type;\n\n // If there is no last captured event, it means that we can safely capture the new event and store it for future comparisons.\n // If there is a last captured event, see if the new event is different enough to treat it as a unique one.\n // If that's the case, emit the previous event and store locally the newly-captured DOM event.\n if (!isSimilarToLastCapturedEvent(event)) {\n const handlerData = { event, name, global: globalListener };\n handler(handlerData);\n lastCapturedEventType = event.type;\n lastCapturedEventTargetId = target ? target._sentryId : undefined;\n }\n\n // Start a new debounce timer that will prevent us from capturing multiple events that should be grouped together.\n clearTimeout(debounceTimerID);\n debounceTimerID = WINDOW.setTimeout(() => {\n lastCapturedEventTargetId = undefined;\n lastCapturedEventType = undefined;\n }, DEBOUNCE_DURATION);\n };\n}\n\nfunction getEventTarget(event) {\n try {\n return event.target ;\n } catch (e) {\n // just accessing `target` property can throw an exception in some rare circumstances\n // see: https://github.com/getsentry/sentry-javascript/issues/838\n return null;\n }\n}\n\nexport { addClickKeypressInstrumentationHandler, instrumentDOM };\n//# sourceMappingURL=dom.js.map\n","import { DEBUG_BUILD } from './debug-build.js';\nimport { logger } from './logger.js';\nimport { getGlobalObject } from './worldwide.js';\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject();\n\n/**\n * Tells whether current environment supports ErrorEvent objects\n * {@link supportsErrorEvent}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsErrorEvent() {\n try {\n new ErrorEvent('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMError objects\n * {@link supportsDOMError}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsDOMError() {\n try {\n // Chrome: VM89:1 Uncaught TypeError: Failed to construct 'DOMError':\n // 1 argument required, but only 0 present.\n // @ts-expect-error It really needs 1 argument, not 0.\n new DOMError('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports DOMException objects\n * {@link supportsDOMException}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsDOMException() {\n try {\n new DOMException('');\n return true;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Tells whether current environment supports Fetch API\n * {@link supportsFetch}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsFetch() {\n if (!('fetch' in WINDOW)) {\n return false;\n }\n\n try {\n new Headers();\n new Request('http://www.example.com');\n new Response();\n return true;\n } catch (e) {\n return false;\n }\n}\n/**\n * isNativeFetch checks if the given function is a native implementation of fetch()\n */\n// eslint-disable-next-line @typescript-eslint/ban-types\nfunction isNativeFetch(func) {\n return func && /^function fetch\\(\\)\\s+\\{\\s+\\[native code\\]\\s+\\}$/.test(func.toString());\n}\n\n/**\n * Tells whether current environment supports Fetch API natively\n * {@link supportsNativeFetch}.\n *\n * @returns true if `window.fetch` is natively implemented, false otherwise\n */\nfunction supportsNativeFetch() {\n if (typeof EdgeRuntime === 'string') {\n return true;\n }\n\n if (!supportsFetch()) {\n return false;\n }\n\n // Fast path to avoid DOM I/O\n // eslint-disable-next-line @typescript-eslint/unbound-method\n if (isNativeFetch(WINDOW.fetch)) {\n return true;\n }\n\n // window.fetch is implemented, but is polyfilled or already wrapped (e.g: by a chrome extension)\n // so create a \"pure\" iframe to see if that has native fetch\n let result = false;\n const doc = WINDOW.document;\n // eslint-disable-next-line deprecation/deprecation\n if (doc && typeof (doc.createElement ) === 'function') {\n try {\n const sandbox = doc.createElement('iframe');\n sandbox.hidden = true;\n doc.head.appendChild(sandbox);\n if (sandbox.contentWindow && sandbox.contentWindow.fetch) {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n result = isNativeFetch(sandbox.contentWindow.fetch);\n }\n doc.head.removeChild(sandbox);\n } catch (err) {\n DEBUG_BUILD &&\n logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', err);\n }\n }\n\n return result;\n}\n\n/**\n * Tells whether current environment supports ReportingObserver API\n * {@link supportsReportingObserver}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsReportingObserver() {\n return 'ReportingObserver' in WINDOW;\n}\n\n/**\n * Tells whether current environment supports Referrer Policy API\n * {@link supportsReferrerPolicy}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsReferrerPolicy() {\n // Despite all stars in the sky saying that Edge supports old draft syntax, aka 'never', 'always', 'origin' and 'default'\n // (see https://caniuse.com/#feat=referrer-policy),\n // it doesn't. And it throws an exception instead of ignoring this parameter...\n // REF: https://github.com/getsentry/raven-js/issues/1233\n\n if (!supportsFetch()) {\n return false;\n }\n\n try {\n new Request('_', {\n referrerPolicy: 'origin' ,\n });\n return true;\n } catch (e) {\n return false;\n }\n}\n\nexport { isNativeFetch, supportsDOMError, supportsDOMException, supportsErrorEvent, supportsFetch, supportsNativeFetch, supportsReferrerPolicy, supportsReportingObserver };\n//# sourceMappingURL=supports.js.map\n","import { fill } from '../object.js';\nimport { supportsNativeFetch } from '../supports.js';\nimport { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\n/**\n * Add an instrumentation handler for when a fetch request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addFetchInstrumentationHandler(handler) {\n const type = 'fetch';\n addHandler(type, handler);\n maybeInstrument(type, instrumentFetch);\n}\n\nfunction instrumentFetch() {\n if (!supportsNativeFetch()) {\n return;\n }\n\n fill(GLOBAL_OBJ, 'fetch', function (originalFetch) {\n return function (...args) {\n const { method, url } = parseFetchArgs(args);\n\n const handlerData = {\n args,\n fetchData: {\n method,\n url,\n },\n startTimestamp: Date.now(),\n };\n\n triggerHandlers('fetch', {\n ...handlerData,\n });\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return originalFetch.apply(GLOBAL_OBJ, args).then(\n (response) => {\n const finishedHandlerData = {\n ...handlerData,\n endTimestamp: Date.now(),\n response,\n };\n\n triggerHandlers('fetch', finishedHandlerData);\n return response;\n },\n (error) => {\n const erroredHandlerData = {\n ...handlerData,\n endTimestamp: Date.now(),\n error,\n };\n\n triggerHandlers('fetch', erroredHandlerData);\n // NOTE: If you are a Sentry user, and you are seeing this stack frame,\n // it means the sentry.javascript SDK caught an error invoking your application code.\n // This is expected behavior and NOT indicative of a bug with sentry.javascript.\n throw error;\n },\n );\n };\n });\n}\n\nfunction hasProp(obj, prop) {\n return !!obj && typeof obj === 'object' && !!(obj )[prop];\n}\n\nfunction getUrlFromResource(resource) {\n if (typeof resource === 'string') {\n return resource;\n }\n\n if (!resource) {\n return '';\n }\n\n if (hasProp(resource, 'url')) {\n return resource.url;\n }\n\n if (resource.toString) {\n return resource.toString();\n }\n\n return '';\n}\n\n/**\n * Parses the fetch arguments to find the used Http method and the url of the request.\n * Exported for tests only.\n */\nfunction parseFetchArgs(fetchArgs) {\n if (fetchArgs.length === 0) {\n return { method: 'GET', url: '' };\n }\n\n if (fetchArgs.length === 2) {\n const [url, options] = fetchArgs ;\n\n return {\n url: getUrlFromResource(url),\n method: hasProp(options, 'method') ? String(options.method).toUpperCase() : 'GET',\n };\n }\n\n const arg = fetchArgs[0];\n return {\n url: getUrlFromResource(arg ),\n method: hasProp(arg, 'method') ? String(arg.method).toUpperCase() : 'GET',\n };\n}\n\nexport { addFetchInstrumentationHandler, parseFetchArgs };\n//# sourceMappingURL=fetch.js.map\n","import { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\nlet _oldOnErrorHandler = null;\n\n/**\n * Add an instrumentation handler for when an error is captured by the global error handler.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addGlobalErrorInstrumentationHandler(handler) {\n const type = 'error';\n addHandler(type, handler);\n maybeInstrument(type, instrumentError);\n}\n\nfunction instrumentError() {\n _oldOnErrorHandler = GLOBAL_OBJ.onerror;\n\n GLOBAL_OBJ.onerror = function (\n msg,\n url,\n line,\n column,\n error,\n ) {\n const handlerData = {\n column,\n error,\n line,\n msg,\n url,\n };\n triggerHandlers('error', handlerData);\n\n if (_oldOnErrorHandler && !_oldOnErrorHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnErrorHandler.apply(this, arguments);\n }\n\n return false;\n };\n\n GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__ = true;\n}\n\nexport { addGlobalErrorInstrumentationHandler };\n//# sourceMappingURL=globalError.js.map\n","import { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\nlet _oldOnUnhandledRejectionHandler = null;\n\n/**\n * Add an instrumentation handler for when an unhandled promise rejection is captured.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addGlobalUnhandledRejectionInstrumentationHandler(\n handler,\n) {\n const type = 'unhandledrejection';\n addHandler(type, handler);\n maybeInstrument(type, instrumentUnhandledRejection);\n}\n\nfunction instrumentUnhandledRejection() {\n _oldOnUnhandledRejectionHandler = GLOBAL_OBJ.onunhandledrejection;\n\n GLOBAL_OBJ.onunhandledrejection = function (e) {\n const handlerData = e;\n triggerHandlers('unhandledrejection', handlerData);\n\n if (_oldOnUnhandledRejectionHandler && !_oldOnUnhandledRejectionHandler.__SENTRY_LOADER__) {\n // eslint-disable-next-line prefer-rest-params\n return _oldOnUnhandledRejectionHandler.apply(this, arguments);\n }\n\n return true;\n };\n\n GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__ = true;\n}\n\nexport { addGlobalUnhandledRejectionInstrumentationHandler };\n//# sourceMappingURL=globalUnhandledRejection.js.map\n","import { getGlobalObject } from '../worldwide.js';\n\n// Based on https://github.com/angular/angular.js/pull/13945/files\n\n// eslint-disable-next-line deprecation/deprecation\nconst WINDOW = getGlobalObject();\n\n/**\n * Tells whether current environment supports History API\n * {@link supportsHistory}.\n *\n * @returns Answer to the given question.\n */\nfunction supportsHistory() {\n // NOTE: in Chrome App environment, touching history.pushState, *even inside\n // a try/catch block*, will cause Chrome to output an error to console.error\n // borrowed from: https://github.com/angular/angular.js/pull/13945/files\n /* eslint-disable @typescript-eslint/no-unsafe-member-access */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const chromeVar = (WINDOW ).chrome;\n const isChromePackagedApp = chromeVar && chromeVar.app && chromeVar.app.runtime;\n /* eslint-enable @typescript-eslint/no-unsafe-member-access */\n const hasHistoryApi = 'history' in WINDOW && !!WINDOW.history.pushState && !!WINDOW.history.replaceState;\n\n return !isChromePackagedApp && hasHistoryApi;\n}\n\nexport { supportsHistory };\n//# sourceMappingURL=supportsHistory.js.map\n","import { fill } from '../object.js';\nimport '../debug-build.js';\nimport '../logger.js';\nimport { GLOBAL_OBJ } from '../worldwide.js';\nimport { supportsHistory } from '../vendor/supportsHistory.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\nconst WINDOW = GLOBAL_OBJ ;\n\nlet lastHref;\n\n/**\n * Add an instrumentation handler for when a fetch request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addHistoryInstrumentationHandler(handler) {\n const type = 'history';\n addHandler(type, handler);\n maybeInstrument(type, instrumentHistory);\n}\n\nfunction instrumentHistory() {\n if (!supportsHistory()) {\n return;\n }\n\n const oldOnPopState = WINDOW.onpopstate;\n WINDOW.onpopstate = function ( ...args) {\n const to = WINDOW.location.href;\n // keep track of the current URL state, as we always receive only the updated state\n const from = lastHref;\n lastHref = to;\n const handlerData = { from, to };\n triggerHandlers('history', handlerData);\n if (oldOnPopState) {\n // Apparently this can throw in Firefox when incorrectly implemented plugin is installed.\n // https://github.com/getsentry/sentry-javascript/issues/3344\n // https://github.com/bugsnag/bugsnag-js/issues/469\n try {\n return oldOnPopState.apply(this, args);\n } catch (_oO) {\n // no-empty\n }\n }\n };\n\n function historyReplacementFunction(originalHistoryFunction) {\n return function ( ...args) {\n const url = args.length > 2 ? args[2] : undefined;\n if (url) {\n // coerce to string (this is what pushState does)\n const from = lastHref;\n const to = String(url);\n // keep track of the current URL state, as we always receive only the updated state\n lastHref = to;\n const handlerData = { from, to };\n triggerHandlers('history', handlerData);\n }\n return originalHistoryFunction.apply(this, args);\n };\n }\n\n fill(WINDOW.history, 'pushState', historyReplacementFunction);\n fill(WINDOW.history, 'replaceState', historyReplacementFunction);\n}\n\nexport { addHistoryInstrumentationHandler };\n//# sourceMappingURL=history.js.map\n","import { isString } from '../is.js';\nimport { fill } from '../object.js';\nimport { GLOBAL_OBJ } from '../worldwide.js';\nimport { addHandler, maybeInstrument, triggerHandlers } from './_handlers.js';\n\nconst WINDOW = GLOBAL_OBJ ;\n\nconst SENTRY_XHR_DATA_KEY = '__sentry_xhr_v3__';\n\n/**\n * Add an instrumentation handler for when an XHR request happens.\n * The handler function is called once when the request starts and once when it ends,\n * which can be identified by checking if it has an `endTimestamp`.\n *\n * Use at your own risk, this might break without changelog notice, only used internally.\n * @hidden\n */\nfunction addXhrInstrumentationHandler(handler) {\n const type = 'xhr';\n addHandler(type, handler);\n maybeInstrument(type, instrumentXHR);\n}\n\n/** Exported only for tests. */\nfunction instrumentXHR() {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n if (!(WINDOW ).XMLHttpRequest) {\n return;\n }\n\n const xhrproto = XMLHttpRequest.prototype;\n\n fill(xhrproto, 'open', function (originalOpen) {\n return function ( ...args) {\n const startTimestamp = Date.now();\n\n // open() should always be called with two or more arguments\n // But to be on the safe side, we actually validate this and bail out if we don't have a method & url\n const method = isString(args[0]) ? args[0].toUpperCase() : undefined;\n const url = parseUrl(args[1]);\n\n if (!method || !url) {\n return originalOpen.apply(this, args);\n }\n\n this[SENTRY_XHR_DATA_KEY] = {\n method,\n url,\n request_headers: {},\n };\n\n // if Sentry key appears in URL, don't capture it as a request\n if (method === 'POST' && url.match(/sentry_key/)) {\n this.__sentry_own_request__ = true;\n }\n\n const onreadystatechangeHandler = () => {\n // For whatever reason, this is not the same instance here as from the outer method\n const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n if (!xhrInfo) {\n return;\n }\n\n if (this.readyState === 4) {\n try {\n // touching statusCode in some platforms throws\n // an exception\n xhrInfo.status_code = this.status;\n } catch (e) {\n /* do nothing */\n }\n\n const handlerData = {\n args: [method, url],\n endTimestamp: Date.now(),\n startTimestamp,\n xhr: this,\n };\n triggerHandlers('xhr', handlerData);\n }\n };\n\n if ('onreadystatechange' in this && typeof this.onreadystatechange === 'function') {\n fill(this, 'onreadystatechange', function (original) {\n return function ( ...readyStateArgs) {\n onreadystatechangeHandler();\n return original.apply(this, readyStateArgs);\n };\n });\n } else {\n this.addEventListener('readystatechange', onreadystatechangeHandler);\n }\n\n // Intercepting `setRequestHeader` to access the request headers of XHR instance.\n // This will only work for user/library defined headers, not for the default/browser-assigned headers.\n // Request cookies are also unavailable for XHR, as `Cookie` header can't be defined by `setRequestHeader`.\n fill(this, 'setRequestHeader', function (original) {\n return function ( ...setRequestHeaderArgs) {\n const [header, value] = setRequestHeaderArgs;\n\n const xhrInfo = this[SENTRY_XHR_DATA_KEY];\n\n if (xhrInfo && isString(header) && isString(value)) {\n xhrInfo.request_headers[header.toLowerCase()] = value;\n }\n\n return original.apply(this, setRequestHeaderArgs);\n };\n });\n\n return originalOpen.apply(this, args);\n };\n });\n\n fill(xhrproto, 'send', function (originalSend) {\n return function ( ...args) {\n const sentryXhrData = this[SENTRY_XHR_DATA_KEY];\n\n if (!sentryXhrData) {\n return originalSend.apply(this, args);\n }\n\n if (args[0] !== undefined) {\n sentryXhrData.body = args[0];\n }\n\n const handlerData = {\n args: [sentryXhrData.method, sentryXhrData.url],\n startTimestamp: Date.now(),\n xhr: this,\n };\n triggerHandlers('xhr', handlerData);\n\n return originalSend.apply(this, args);\n };\n });\n}\n\nfunction parseUrl(url) {\n if (isString(url)) {\n return url;\n }\n\n try {\n // url can be a string or URL\n // but since URL is not available in IE11, we do not check for it,\n // but simply assume it is an URL and return `toString()` from it (which returns the full URL)\n // If that fails, we just return undefined\n return (url ).toString();\n } catch (e2) {} // eslint-disable-line no-empty\n\n return undefined;\n}\n\nexport { SENTRY_XHR_DATA_KEY, addXhrInstrumentationHandler, instrumentXHR };\n//# sourceMappingURL=xhr.js.map\n","/*\n * This module exists for optimizations in the build process through rollup and terser. We define some global\n * constants, which can be overridden during build. By guarding certain pieces of code with functions that return these\n * constants, we can control whether or not they appear in the final bundle. (Any code guarded by a false condition will\n * never run, and will hence be dropped during treeshaking.) The two primary uses for this are stripping out calls to\n * `logger` and preventing node-related code from appearing in browser bundles.\n *\n * Attention:\n * This file should not be used to define constants/flags that are intended to be used for tree-shaking conducted by\n * users. These flags should live in their respective packages, as we identified user tooling (specifically webpack)\n * having issues tree-shaking these constants across package boundaries.\n * An example for this is the __SENTRY_DEBUG__ constant. It is declared in each package individually because we want\n * users to be able to shake away expressions that it guards.\n */\n\n/**\n * Figures out if we're building a browser bundle.\n *\n * @returns true if this is a browser bundle build.\n */\nfunction isBrowserBundle() {\n return typeof __SENTRY_BROWSER_BUNDLE__ !== 'undefined' && !!__SENTRY_BROWSER_BUNDLE__;\n}\n\n/**\n * Get source of SDK.\n */\nfunction getSDKSource() {\n // @ts-expect-error \"npm\" is injected by rollup during build process\n return \"npm\";\n}\n\nexport { getSDKSource, isBrowserBundle };\n//# sourceMappingURL=env.js.map\n","import { isBrowserBundle } from './env.js';\n\n/**\n * NOTE: In order to avoid circular dependencies, if you add a function to this module and it needs to print something,\n * you must either a) use `console.log` rather than the logger, or b) put your function elsewhere.\n */\n\n/**\n * Checks whether we're in the Node.js or Browser environment\n *\n * @returns Answer to given question\n */\nfunction isNodeEnv() {\n // explicitly check for browser bundles as those can be optimized statically\n // by terser/rollup.\n return (\n !isBrowserBundle() &&\n Object.prototype.toString.call(typeof process !== 'undefined' ? process : 0) === '[object process]'\n );\n}\n\n/**\n * Requires a module which is protected against bundler minification.\n *\n * @param request The module path to resolve\n */\n// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any\nfunction dynamicRequire(mod, request) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return mod.require(request);\n}\n\n/**\n * Helper for dynamically loading module that should work with linked dependencies.\n * The problem is that we _should_ be using `require(require.resolve(moduleName, { paths: [cwd()] }))`\n * However it's _not possible_ to do that with Webpack, as it has to know all the dependencies during\n * build time. `require.resolve` is also not available in any other way, so we cannot create,\n * a fake helper like we do with `dynamicRequire`.\n *\n * We always prefer to use local package, thus the value is not returned early from each `try/catch` block.\n * That is to mimic the behavior of `require.resolve` exactly.\n *\n * @param moduleName module name to require\n * @returns possibly required module\n */\nfunction loadModule(moduleName) {\n let mod;\n\n try {\n mod = dynamicRequire(module, moduleName);\n } catch (e) {\n // no-empty\n }\n\n try {\n const { cwd } = dynamicRequire(module, 'process');\n mod = dynamicRequire(module, `${cwd()}/node_modules/${moduleName}`) ;\n } catch (e) {\n // no-empty\n }\n\n return mod;\n}\n\nexport { dynamicRequire, isNodeEnv, loadModule };\n//# sourceMappingURL=node.js.map\n","import { isNodeEnv } from './node.js';\nimport { GLOBAL_OBJ } from './worldwide.js';\n\n/**\n * Returns true if we are in the browser.\n */\nfunction isBrowser() {\n // eslint-disable-next-line no-restricted-globals\n return typeof window !== 'undefined' && (!isNodeEnv() || isElectronNodeRenderer());\n}\n\n// Electron renderers with nodeIntegration enabled are detected as Node.js so we specifically test for them\nfunction isElectronNodeRenderer() {\n return (\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-explicit-any\n (GLOBAL_OBJ ).process !== undefined && ((GLOBAL_OBJ ).process ).type === 'renderer'\n );\n}\n\nexport { isBrowser };\n//# sourceMappingURL=isBrowser.js.map\n","/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n/* eslint-disable @typescript-eslint/no-explicit-any */\n\n/**\n * Helper to decycle json objects\n */\nfunction memoBuilder() {\n const hasWeakSet = typeof WeakSet === 'function';\n const inner = hasWeakSet ? new WeakSet() : [];\n function memoize(obj) {\n if (hasWeakSet) {\n if (inner.has(obj)) {\n return true;\n }\n inner.add(obj);\n return false;\n }\n // eslint-disable-next-line @typescript-eslint/prefer-for-of\n for (let i = 0; i < inner.length; i++) {\n const value = inner[i];\n if (value === obj) {\n return true;\n }\n }\n inner.push(obj);\n return false;\n }\n\n function unmemoize(obj) {\n if (hasWeakSet) {\n inner.delete(obj);\n } else {\n for (let i = 0; i < inner.length; i++) {\n if (inner[i] === obj) {\n inner.splice(i, 1);\n break;\n }\n }\n }\n }\n return [memoize, unmemoize];\n}\n\nexport { memoBuilder };\n//# sourceMappingURL=memo.js.map\n","import { isNaN, isVueViewModel, isSyntheticEvent } from './is.js';\nimport { memoBuilder } from './memo.js';\nimport { convertToPlainObject } from './object.js';\nimport { getFunctionName } from './stacktrace.js';\n\n/**\n * Recursively normalizes the given object.\n *\n * - Creates a copy to prevent original input mutation\n * - Skips non-enumerable properties\n * - When stringifying, calls `toJSON` if implemented\n * - Removes circular references\n * - Translates non-serializable values (`undefined`/`NaN`/functions) to serializable format\n * - Translates known global objects/classes to a string representations\n * - Takes care of `Error` object serialization\n * - Optionally limits depth of final output\n * - Optionally limits number of properties/elements included in any single object/array\n *\n * @param input The object to be normalized.\n * @param depth The max depth to which to normalize the object. (Anything deeper stringified whole.)\n * @param maxProperties The max number of elements or properties to be included in any single array or\n * object in the normallized output.\n * @returns A normalized version of the object, or `\"**non-serializable**\"` if any errors are thrown during normalization.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction normalize(input, depth = 100, maxProperties = +Infinity) {\n try {\n // since we're at the outermost level, we don't provide a key\n return visit('', input, depth, maxProperties);\n } catch (err) {\n return { ERROR: `**non-serializable** (${err})` };\n }\n}\n\n/** JSDoc */\nfunction normalizeToSize(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n object,\n // Default Node.js REPL depth\n depth = 3,\n // 100kB, as 200kB is max payload size, so half sounds reasonable\n maxSize = 100 * 1024,\n) {\n const normalized = normalize(object, depth);\n\n if (jsonSize(normalized) > maxSize) {\n return normalizeToSize(object, depth - 1, maxSize);\n }\n\n return normalized ;\n}\n\n/**\n * Visits a node to perform normalization on it\n *\n * @param key The key corresponding to the given node\n * @param value The node to be visited\n * @param depth Optional number indicating the maximum recursion depth\n * @param maxProperties Optional maximum number of properties/elements included in any single object/array\n * @param memo Optional Memo class handling decycling\n */\nfunction visit(\n key,\n value,\n depth = +Infinity,\n maxProperties = +Infinity,\n memo = memoBuilder(),\n) {\n const [memoize, unmemoize] = memo;\n\n // Get the simple cases out of the way first\n if (\n value == null || // this matches null and undefined -> eqeq not eqeqeq\n (['number', 'boolean', 'string'].includes(typeof value) && !isNaN(value))\n ) {\n return value ;\n }\n\n const stringified = stringifyValue(key, value);\n\n // Anything we could potentially dig into more (objects or arrays) will have come back as `\"[object XXXX]\"`.\n // Everything else will have already been serialized, so if we don't see that pattern, we're done.\n if (!stringified.startsWith('[object ')) {\n return stringified;\n }\n\n // From here on, we can assert that `value` is either an object or an array.\n\n // Do not normalize objects that we know have already been normalized. As a general rule, the\n // \"__sentry_skip_normalization__\" property should only be used sparingly and only should only be set on objects that\n // have already been normalized.\n if ((value )['__sentry_skip_normalization__']) {\n return value ;\n }\n\n // We can set `__sentry_override_normalization_depth__` on an object to ensure that from there\n // We keep a certain amount of depth.\n // This should be used sparingly, e.g. we use it for the redux integration to ensure we get a certain amount of state.\n const remainingDepth =\n typeof (value )['__sentry_override_normalization_depth__'] === 'number'\n ? ((value )['__sentry_override_normalization_depth__'] )\n : depth;\n\n // We're also done if we've reached the max depth\n if (remainingDepth === 0) {\n // At this point we know `serialized` is a string of the form `\"[object XXXX]\"`. Clean it up so it's just `\"[XXXX]\"`.\n return stringified.replace('object ', '');\n }\n\n // If we've already visited this branch, bail out, as it's circular reference. If not, note that we're seeing it now.\n if (memoize(value)) {\n return '[Circular ~]';\n }\n\n // If the value has a `toJSON` method, we call it to extract more information\n const valueWithToJSON = value ;\n if (valueWithToJSON && typeof valueWithToJSON.toJSON === 'function') {\n try {\n const jsonValue = valueWithToJSON.toJSON();\n // We need to normalize the return value of `.toJSON()` in case it has circular references\n return visit('', jsonValue, remainingDepth - 1, maxProperties, memo);\n } catch (err) {\n // pass (The built-in `toJSON` failed, but we can still try to do it ourselves)\n }\n }\n\n // At this point we know we either have an object or an array, we haven't seen it before, and we're going to recurse\n // because we haven't yet reached the max depth. Create an accumulator to hold the results of visiting each\n // property/entry, and keep track of the number of items we add to it.\n const normalized = (Array.isArray(value) ? [] : {}) ;\n let numAdded = 0;\n\n // Before we begin, convert`Error` and`Event` instances into plain objects, since some of each of their relevant\n // properties are non-enumerable and otherwise would get missed.\n const visitable = convertToPlainObject(value );\n\n for (const visitKey in visitable) {\n // Avoid iterating over fields in the prototype if they've somehow been exposed to enumeration.\n if (!Object.prototype.hasOwnProperty.call(visitable, visitKey)) {\n continue;\n }\n\n if (numAdded >= maxProperties) {\n normalized[visitKey] = '[MaxProperties ~]';\n break;\n }\n\n // Recursively visit all the child nodes\n const visitValue = visitable[visitKey];\n normalized[visitKey] = visit(visitKey, visitValue, remainingDepth - 1, maxProperties, memo);\n\n numAdded++;\n }\n\n // Once we've visited all the branches, remove the parent from memo storage\n unmemoize(value);\n\n // Return accumulated values\n return normalized;\n}\n\n/* eslint-disable complexity */\n/**\n * Stringify the given value. Handles various known special values and types.\n *\n * Not meant to be used on simple primitives which already have a string representation, as it will, for example, turn\n * the number 1231 into \"[Object Number]\", nor on `null`, as it will throw.\n *\n * @param value The value to stringify\n * @returns A stringified representation of the given value\n */\nfunction stringifyValue(\n key,\n // this type is a tiny bit of a cheat, since this function does handle NaN (which is technically a number), but for\n // our internal use, it'll do\n value,\n) {\n try {\n if (key === 'domain' && value && typeof value === 'object' && (value )._events) {\n return '[Domain]';\n }\n\n if (key === 'domainEmitter') {\n return '[DomainEmitter]';\n }\n\n // It's safe to use `global`, `window`, and `document` here in this manner, as we are asserting using `typeof` first\n // which won't throw if they are not present.\n\n if (typeof global !== 'undefined' && value === global) {\n return '[Global]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof window !== 'undefined' && value === window) {\n return '[Window]';\n }\n\n // eslint-disable-next-line no-restricted-globals\n if (typeof document !== 'undefined' && value === document) {\n return '[Document]';\n }\n\n if (isVueViewModel(value)) {\n return '[VueViewModel]';\n }\n\n // React's SyntheticEvent thingy\n if (isSyntheticEvent(value)) {\n return '[SyntheticEvent]';\n }\n\n if (typeof value === 'number' && value !== value) {\n return '[NaN]';\n }\n\n if (typeof value === 'function') {\n return `[Function: ${getFunctionName(value)}]`;\n }\n\n if (typeof value === 'symbol') {\n return `[${String(value)}]`;\n }\n\n // stringified BigInts are indistinguishable from regular numbers, so we need to label them to avoid confusion\n if (typeof value === 'bigint') {\n return `[BigInt: ${String(value)}]`;\n }\n\n // Now that we've knocked out all the special cases and the primitives, all we have left are objects. Simply casting\n // them to strings means that instances of classes which haven't defined their `toStringTag` will just come out as\n // `\"[object Object]\"`. If we instead look at the constructor's name (which is the same as the name of the class),\n // we can make sure that only plain objects come out that way.\n const objName = getConstructorName(value);\n\n // Handle HTML Elements\n if (/^HTML(\\w*)Element$/.test(objName)) {\n return `[HTMLElement: ${objName}]`;\n }\n\n return `[object ${objName}]`;\n } catch (err) {\n return `**non-serializable** (${err})`;\n }\n}\n/* eslint-enable complexity */\n\nfunction getConstructorName(value) {\n const prototype = Object.getPrototypeOf(value);\n\n return prototype ? prototype.constructor.name : 'null prototype';\n}\n\n/** Calculates bytes size of input string */\nfunction utf8Length(value) {\n // eslint-disable-next-line no-bitwise\n return ~-encodeURI(value).split(/%..|./).length;\n}\n\n/** Calculates bytes size of input object */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction jsonSize(value) {\n return utf8Length(JSON.stringify(value));\n}\n\n/**\n * Normalizes URLs in exceptions and stacktraces to a base path so Sentry can fingerprint\n * across platforms and working directory.\n *\n * @param url The URL to be normalized.\n * @param basePath The application base path.\n * @returns The normalized URL.\n */\nfunction normalizeUrlToBase(url, basePath) {\n const escapedBase = basePath\n // Backslash to forward\n .replace(/\\\\/g, '/')\n // Escape RegExp special characters\n .replace(/[|\\\\{}()[\\]^$+*?.]/g, '\\\\$&');\n\n let newUrl = url;\n try {\n newUrl = decodeURI(url);\n } catch (_Oo) {\n // Sometime this breaks\n }\n return (\n newUrl\n .replace(/\\\\/g, '/')\n .replace(/webpack:\\/?/g, '') // Remove intermediate base path\n // eslint-disable-next-line @sentry-internal/sdk/no-regexp-constructor\n .replace(new RegExp(`(file://)?/*${escapedBase}/*`, 'ig'), 'app:///')\n );\n}\n\nexport { normalize, normalizeToSize, normalizeUrlToBase, visit as walk };\n//# sourceMappingURL=normalize.js.map\n","import { isThenable } from './is.js';\n\n/* eslint-disable @typescript-eslint/explicit-function-return-type */\n\n/** SyncPromise internal states */\nvar States; (function (States) {\n /** Pending */\n const PENDING = 0; States[States[\"PENDING\"] = PENDING] = \"PENDING\";\n /** Resolved / OK */\n const RESOLVED = 1; States[States[\"RESOLVED\"] = RESOLVED] = \"RESOLVED\";\n /** Rejected / Error */\n const REJECTED = 2; States[States[\"REJECTED\"] = REJECTED] = \"REJECTED\";\n})(States || (States = {}));\n\n// Overloads so we can call resolvedSyncPromise without arguments and generic argument\n\n/**\n * Creates a resolved sync promise.\n *\n * @param value the value to resolve the promise with\n * @returns the resolved sync promise\n */\nfunction resolvedSyncPromise(value) {\n return new SyncPromise(resolve => {\n resolve(value);\n });\n}\n\n/**\n * Creates a rejected sync promise.\n *\n * @param value the value to reject the promise with\n * @returns the rejected sync promise\n */\nfunction rejectedSyncPromise(reason) {\n return new SyncPromise((_, reject) => {\n reject(reason);\n });\n}\n\n/**\n * Thenable class that behaves like a Promise and follows it's interface\n * but is not async internally\n */\nclass SyncPromise {\n\n constructor(\n executor,\n ) {SyncPromise.prototype.__init.call(this);SyncPromise.prototype.__init2.call(this);SyncPromise.prototype.__init3.call(this);SyncPromise.prototype.__init4.call(this);\n this._state = States.PENDING;\n this._handlers = [];\n\n try {\n executor(this._resolve, this._reject);\n } catch (e) {\n this._reject(e);\n }\n }\n\n /** JSDoc */\n then(\n onfulfilled,\n onrejected,\n ) {\n return new SyncPromise((resolve, reject) => {\n this._handlers.push([\n false,\n result => {\n if (!onfulfilled) {\n // TODO: ¯\\_(ツ)_/¯\n // TODO: FIXME\n resolve(result );\n } else {\n try {\n resolve(onfulfilled(result));\n } catch (e) {\n reject(e);\n }\n }\n },\n reason => {\n if (!onrejected) {\n reject(reason);\n } else {\n try {\n resolve(onrejected(reason));\n } catch (e) {\n reject(e);\n }\n }\n },\n ]);\n this._executeHandlers();\n });\n }\n\n /** JSDoc */\n catch(\n onrejected,\n ) {\n return this.then(val => val, onrejected);\n }\n\n /** JSDoc */\n finally(onfinally) {\n return new SyncPromise((resolve, reject) => {\n let val;\n let isRejected;\n\n return this.then(\n value => {\n isRejected = false;\n val = value;\n if (onfinally) {\n onfinally();\n }\n },\n reason => {\n isRejected = true;\n val = reason;\n if (onfinally) {\n onfinally();\n }\n },\n ).then(() => {\n if (isRejected) {\n reject(val);\n return;\n }\n\n resolve(val );\n });\n });\n }\n\n /** JSDoc */\n __init() {this._resolve = (value) => {\n this._setResult(States.RESOLVED, value);\n };}\n\n /** JSDoc */\n __init2() {this._reject = (reason) => {\n this._setResult(States.REJECTED, reason);\n };}\n\n /** JSDoc */\n __init3() {this._setResult = (state, value) => {\n if (this._state !== States.PENDING) {\n return;\n }\n\n if (isThenable(value)) {\n void (value ).then(this._resolve, this._reject);\n return;\n }\n\n this._state = state;\n this._value = value;\n\n this._executeHandlers();\n };}\n\n /** JSDoc */\n __init4() {this._executeHandlers = () => {\n if (this._state === States.PENDING) {\n return;\n }\n\n const cachedHandlers = this._handlers.slice();\n this._handlers = [];\n\n cachedHandlers.forEach(handler => {\n if (handler[0]) {\n return;\n }\n\n if (this._state === States.RESOLVED) {\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n handler[1](this._value );\n }\n\n if (this._state === States.REJECTED) {\n handler[2](this._value);\n }\n\n handler[0] = true;\n });\n };}\n}\n\nexport { SyncPromise, rejectedSyncPromise, resolvedSyncPromise };\n//# sourceMappingURL=syncpromise.js.map\n","import { SentryError } from './error.js';\nimport { rejectedSyncPromise, SyncPromise, resolvedSyncPromise } from './syncpromise.js';\n\n/**\n * Creates an new PromiseBuffer object with the specified limit\n * @param limit max number of promises that can be stored in the buffer\n */\nfunction makePromiseBuffer(limit) {\n const buffer = [];\n\n function isReady() {\n return limit === undefined || buffer.length < limit;\n }\n\n /**\n * Remove a promise from the queue.\n *\n * @param task Can be any PromiseLike\n * @returns Removed promise.\n */\n function remove(task) {\n return buffer.splice(buffer.indexOf(task), 1)[0];\n }\n\n /**\n * Add a promise (representing an in-flight action) to the queue, and set it to remove itself on fulfillment.\n *\n * @param taskProducer A function producing any PromiseLike; In previous versions this used to be `task:\n * PromiseLike`, but under that model, Promises were instantly created on the call-site and their executor\n * functions therefore ran immediately. Thus, even if the buffer was full, the action still happened. By\n * requiring the promise to be wrapped in a function, we can defer promise creation until after the buffer\n * limit check.\n * @returns The original promise.\n */\n function add(taskProducer) {\n if (!isReady()) {\n return rejectedSyncPromise(new SentryError('Not adding Promise because buffer limit was reached.'));\n }\n\n // start the task and add its promise to the queue\n const task = taskProducer();\n if (buffer.indexOf(task) === -1) {\n buffer.push(task);\n }\n void task\n .then(() => remove(task))\n // Use `then(null, rejectionHandler)` rather than `catch(rejectionHandler)` so that we can use `PromiseLike`\n // rather than `Promise`. `PromiseLike` doesn't have a `.catch` method, making its polyfill smaller. (ES5 didn't\n // have promises, so TS has to polyfill when down-compiling.)\n .then(null, () =>\n remove(task).then(null, () => {\n // We have to add another catch here because `remove()` starts a new promise chain.\n }),\n );\n return task;\n }\n\n /**\n * Wait for all promises in the queue to resolve or for timeout to expire, whichever comes first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the queue is still non-empty. Passing `0` (or\n * not passing anything) will make the promise wait as long as it takes for the queue to drain before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if the queue is already empty or drains before the timeout, and\n * `false` otherwise\n */\n function drain(timeout) {\n return new SyncPromise((resolve, reject) => {\n let counter = buffer.length;\n\n if (!counter) {\n return resolve(true);\n }\n\n // wait for `timeout` ms and then resolve to `false` (if not cancelled first)\n const capturedSetTimeout = setTimeout(() => {\n if (timeout && timeout > 0) {\n resolve(false);\n }\n }, timeout);\n\n // if all promises resolve in time, cancel the timer and resolve to `true`\n buffer.forEach(item => {\n void resolvedSyncPromise(item).then(() => {\n if (!--counter) {\n clearTimeout(capturedSetTimeout);\n resolve(true);\n }\n }, reject);\n });\n });\n }\n\n return {\n $: buffer,\n add,\n drain,\n };\n}\n\nexport { makePromiseBuffer };\n//# sourceMappingURL=promisebuffer.js.map\n","/**\n * Parses string form of URL into an object\n * // borrowed from https://tools.ietf.org/html/rfc3986#appendix-B\n * // intentionally using regex and not href parsing trick because React Native and other\n * // environments where DOM might not be available\n * @returns parsed URL object\n */\nfunction parseUrl(url) {\n if (!url) {\n return {};\n }\n\n const match = url.match(/^(([^:/?#]+):)?(\\/\\/([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?$/);\n\n if (!match) {\n return {};\n }\n\n // coerce to undefined values to empty string so we don't get 'undefined'\n const query = match[6] || '';\n const fragment = match[8] || '';\n return {\n host: match[4],\n path: match[5],\n protocol: match[2],\n search: query,\n hash: fragment,\n relative: match[5] + query + fragment, // everything minus origin\n };\n}\n\n/**\n * Strip the query string and fragment off of a given URL or path (if present)\n *\n * @param urlPath Full URL or path, including possible query string and/or fragment\n * @returns URL or path without query string or fragment\n */\nfunction stripUrlQueryAndFragment(urlPath) {\n // eslint-disable-next-line no-useless-escape\n return urlPath.split(/[\\?#]/, 1)[0];\n}\n\n/**\n * Returns number of URL segments of a passed string URL.\n */\nfunction getNumberOfUrlSegments(url) {\n // split at '/' or at '\\/' to split regex urls correctly\n return url.split(/\\\\?\\//).filter(s => s.length > 0 && s !== ',').length;\n}\n\n/**\n * Takes a URL object and returns a sanitized string which is safe to use as span description\n * see: https://develop.sentry.dev/sdk/data-handling/#structuring-data\n */\nfunction getSanitizedUrlString(url) {\n const { protocol, host, path } = url;\n\n const filteredHost =\n (host &&\n host\n // Always filter out authority\n .replace(/^.*@/, '[filtered]:[filtered]@')\n // Don't show standard :80 (http) and :443 (https) ports to reduce the noise\n // TODO: Use new URL global if it exists\n .replace(/(:80)$/, '')\n .replace(/(:443)$/, '')) ||\n '';\n\n return `${protocol ? `${protocol}://` : ''}${filteredHost}${path}`;\n}\n\nexport { getNumberOfUrlSegments, getSanitizedUrlString, parseUrl, stripUrlQueryAndFragment };\n//# sourceMappingURL=url.js.map\n","// Note: Ideally the `SeverityLevel` type would be derived from `validSeverityLevels`, but that would mean either\n//\n// a) moving `validSeverityLevels` to `@sentry/types`,\n// b) moving the`SeverityLevel` type here, or\n// c) importing `validSeverityLevels` from here into `@sentry/types`.\n//\n// Option A would make `@sentry/types` a runtime dependency of `@sentry/utils` (not good), and options B and C would\n// create a circular dependency between `@sentry/types` and `@sentry/utils` (also not good). So a TODO accompanying the\n// type, reminding anyone who changes it to change this list also, will have to do.\n\nconst validSeverityLevels = ['fatal', 'error', 'warning', 'log', 'info', 'debug'];\n\n/**\n * Converts a string-based level into a member of the deprecated {@link Severity} enum.\n *\n * @deprecated `severityFromString` is deprecated. Please use `severityLevelFromString` instead.\n *\n * @param level String representation of Severity\n * @returns Severity\n */\nfunction severityFromString(level) {\n return severityLevelFromString(level) ;\n}\n\n/**\n * Converts a string-based level into a `SeverityLevel`, normalizing it along the way.\n *\n * @param level String representation of desired `SeverityLevel`.\n * @returns The `SeverityLevel` corresponding to the given string, or 'log' if the string isn't a valid level.\n */\nfunction severityLevelFromString(level) {\n return (level === 'warn' ? 'warning' : validSeverityLevels.includes(level) ? level : 'log') ;\n}\n\nexport { severityFromString, severityLevelFromString, validSeverityLevels };\n//# sourceMappingURL=severity.js.map\n","import { GLOBAL_OBJ } from './worldwide.js';\n\nconst ONE_SECOND_IN_MS = 1000;\n\n/**\n * A partial definition of the [Performance Web API]{@link https://developer.mozilla.org/en-US/docs/Web/API/Performance}\n * for accessing a high-resolution monotonic clock.\n */\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using the Date API.\n *\n * TODO(v8): Return type should be rounded.\n */\nfunction dateTimestampInSeconds() {\n return Date.now() / ONE_SECOND_IN_MS;\n}\n\n/**\n * Returns a wrapper around the native Performance API browser implementation, or undefined for browsers that do not\n * support the API.\n *\n * Wrapping the native API works around differences in behavior from different browsers.\n */\nfunction createUnixTimestampInSecondsFunc() {\n const { performance } = GLOBAL_OBJ ;\n if (!performance || !performance.now) {\n return dateTimestampInSeconds;\n }\n\n // Some browser and environments don't have a timeOrigin, so we fallback to\n // using Date.now() to compute the starting time.\n const approxStartingTimeOrigin = Date.now() - performance.now();\n const timeOrigin = performance.timeOrigin == undefined ? approxStartingTimeOrigin : performance.timeOrigin;\n\n // performance.now() is a monotonic clock, which means it starts at 0 when the process begins. To get the current\n // wall clock time (actual UNIX timestamp), we need to add the starting time origin and the current time elapsed.\n //\n // TODO: This does not account for the case where the monotonic clock that powers performance.now() drifts from the\n // wall clock time, which causes the returned timestamp to be inaccurate. We should investigate how to detect and\n // correct for this.\n // See: https://github.com/getsentry/sentry-javascript/issues/2590\n // See: https://github.com/mdn/content/issues/4713\n // See: https://dev.to/noamr/when-a-millisecond-is-not-a-millisecond-3h6\n return () => {\n return (timeOrigin + performance.now()) / ONE_SECOND_IN_MS;\n };\n}\n\n/**\n * Returns a timestamp in seconds since the UNIX epoch using either the Performance or Date APIs, depending on the\n * availability of the Performance API.\n *\n * BUG: Note that because of how browsers implement the Performance API, the clock might stop when the computer is\n * asleep. This creates a skew between `dateTimestampInSeconds` and `timestampInSeconds`. The\n * skew can grow to arbitrary amounts like days, weeks or months.\n * See https://github.com/getsentry/sentry-javascript/issues/2590.\n */\nconst timestampInSeconds = createUnixTimestampInSecondsFunc();\n\n/**\n * Re-exported with an old name for backwards-compatibility.\n * TODO (v8): Remove this\n *\n * @deprecated Use `timestampInSeconds` instead.\n */\nconst timestampWithMs = timestampInSeconds;\n\n/**\n * Internal helper to store what is the source of browserPerformanceTimeOrigin below. For debugging only.\n */\nlet _browserPerformanceTimeOriginMode;\n\n/**\n * The number of milliseconds since the UNIX epoch. This value is only usable in a browser, and only when the\n * performance API is available.\n */\nconst browserPerformanceTimeOrigin = (() => {\n // Unfortunately browsers may report an inaccurate time origin data, through either performance.timeOrigin or\n // performance.timing.navigationStart, which results in poor results in performance data. We only treat time origin\n // data as reliable if they are within a reasonable threshold of the current time.\n\n const { performance } = GLOBAL_OBJ ;\n if (!performance || !performance.now) {\n _browserPerformanceTimeOriginMode = 'none';\n return undefined;\n }\n\n const threshold = 3600 * 1000;\n const performanceNow = performance.now();\n const dateNow = Date.now();\n\n // if timeOrigin isn't available set delta to threshold so it isn't used\n const timeOriginDelta = performance.timeOrigin\n ? Math.abs(performance.timeOrigin + performanceNow - dateNow)\n : threshold;\n const timeOriginIsReliable = timeOriginDelta < threshold;\n\n // While performance.timing.navigationStart is deprecated in favor of performance.timeOrigin, performance.timeOrigin\n // is not as widely supported. Namely, performance.timeOrigin is undefined in Safari as of writing.\n // Also as of writing, performance.timing is not available in Web Workers in mainstream browsers, so it is not always\n // a valid fallback. In the absence of an initial time provided by the browser, fallback to the current time from the\n // Date API.\n // eslint-disable-next-line deprecation/deprecation\n const navigationStart = performance.timing && performance.timing.navigationStart;\n const hasNavigationStart = typeof navigationStart === 'number';\n // if navigationStart isn't available set delta to threshold so it isn't used\n const navigationStartDelta = hasNavigationStart ? Math.abs(navigationStart + performanceNow - dateNow) : threshold;\n const navigationStartIsReliable = navigationStartDelta < threshold;\n\n if (timeOriginIsReliable || navigationStartIsReliable) {\n // Use the more reliable time origin\n if (timeOriginDelta <= navigationStartDelta) {\n _browserPerformanceTimeOriginMode = 'timeOrigin';\n return performance.timeOrigin;\n } else {\n _browserPerformanceTimeOriginMode = 'navigationStart';\n return navigationStart;\n }\n }\n\n // Either both timeOrigin and navigationStart are skewed or neither is available, fallback to Date.\n _browserPerformanceTimeOriginMode = 'dateNow';\n return dateNow;\n})();\n\nexport { _browserPerformanceTimeOriginMode, browserPerformanceTimeOrigin, dateTimestampInSeconds, timestampInSeconds, timestampWithMs };\n//# sourceMappingURL=time.js.map\n","import { dsnToString } from './dsn.js';\nimport { normalize } from './normalize.js';\nimport { dropUndefinedKeys } from './object.js';\n\n/**\n * Creates an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nfunction createEnvelope(headers, items = []) {\n return [headers, items] ;\n}\n\n/**\n * Add an item to an envelope.\n * Make sure to always explicitly provide the generic to this function\n * so that the envelope types resolve correctly.\n */\nfunction addItemToEnvelope(envelope, newItem) {\n const [headers, items] = envelope;\n return [headers, [...items, newItem]] ;\n}\n\n/**\n * Convenience function to loop through the items and item types of an envelope.\n * (This function was mostly created because working with envelope types is painful at the moment)\n *\n * If the callback returns true, the rest of the items will be skipped.\n */\nfunction forEachEnvelopeItem(\n envelope,\n callback,\n) {\n const envelopeItems = envelope[1];\n\n for (const envelopeItem of envelopeItems) {\n const envelopeItemType = envelopeItem[0].type;\n const result = callback(envelopeItem, envelopeItemType);\n\n if (result) {\n return true;\n }\n }\n\n return false;\n}\n\n/**\n * Returns true if the envelope contains any of the given envelope item types\n */\nfunction envelopeContainsItemType(envelope, types) {\n return forEachEnvelopeItem(envelope, (_, type) => types.includes(type));\n}\n\n/**\n * Encode a string to UTF8.\n */\nfunction encodeUTF8(input, textEncoder) {\n const utf8 = textEncoder || new TextEncoder();\n return utf8.encode(input);\n}\n\n/**\n * Serializes an envelope.\n */\nfunction serializeEnvelope(envelope, textEncoder) {\n const [envHeaders, items] = envelope;\n\n // Initially we construct our envelope as a string and only convert to binary chunks if we encounter binary data\n let parts = JSON.stringify(envHeaders);\n\n function append(next) {\n if (typeof parts === 'string') {\n parts = typeof next === 'string' ? parts + next : [encodeUTF8(parts, textEncoder), next];\n } else {\n parts.push(typeof next === 'string' ? encodeUTF8(next, textEncoder) : next);\n }\n }\n\n for (const item of items) {\n const [itemHeaders, payload] = item;\n\n append(`\\n${JSON.stringify(itemHeaders)}\\n`);\n\n if (typeof payload === 'string' || payload instanceof Uint8Array) {\n append(payload);\n } else {\n let stringifiedPayload;\n try {\n stringifiedPayload = JSON.stringify(payload);\n } catch (e) {\n // In case, despite all our efforts to keep `payload` circular-dependency-free, `JSON.strinify()` still\n // fails, we try again after normalizing it again with infinite normalization depth. This of course has a\n // performance impact but in this case a performance hit is better than throwing.\n stringifiedPayload = JSON.stringify(normalize(payload));\n }\n append(stringifiedPayload);\n }\n }\n\n return typeof parts === 'string' ? parts : concatBuffers(parts);\n}\n\nfunction concatBuffers(buffers) {\n const totalLength = buffers.reduce((acc, buf) => acc + buf.length, 0);\n\n const merged = new Uint8Array(totalLength);\n let offset = 0;\n for (const buffer of buffers) {\n merged.set(buffer, offset);\n offset += buffer.length;\n }\n\n return merged;\n}\n\n/**\n * Parses an envelope\n */\nfunction parseEnvelope(\n env,\n textEncoder,\n textDecoder,\n) {\n let buffer = typeof env === 'string' ? textEncoder.encode(env) : env;\n\n function readBinary(length) {\n const bin = buffer.subarray(0, length);\n // Replace the buffer with the remaining data excluding trailing newline\n buffer = buffer.subarray(length + 1);\n return bin;\n }\n\n function readJson() {\n let i = buffer.indexOf(0xa);\n // If we couldn't find a newline, we must have found the end of the buffer\n if (i < 0) {\n i = buffer.length;\n }\n\n return JSON.parse(textDecoder.decode(readBinary(i))) ;\n }\n\n const envelopeHeader = readJson();\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const items = [];\n\n while (buffer.length) {\n const itemHeader = readJson();\n const binaryLength = typeof itemHeader.length === 'number' ? itemHeader.length : undefined;\n\n items.push([itemHeader, binaryLength ? readBinary(binaryLength) : readJson()]);\n }\n\n return [envelopeHeader, items];\n}\n\n/**\n * Creates attachment envelope items\n */\nfunction createAttachmentEnvelopeItem(\n attachment,\n textEncoder,\n) {\n const buffer = typeof attachment.data === 'string' ? encodeUTF8(attachment.data, textEncoder) : attachment.data;\n\n return [\n dropUndefinedKeys({\n type: 'attachment',\n length: buffer.length,\n filename: attachment.filename,\n content_type: attachment.contentType,\n attachment_type: attachment.attachmentType,\n }),\n buffer,\n ];\n}\n\nconst ITEM_TYPE_TO_DATA_CATEGORY_MAP = {\n session: 'session',\n sessions: 'session',\n attachment: 'attachment',\n transaction: 'transaction',\n event: 'error',\n client_report: 'internal',\n user_report: 'default',\n profile: 'profile',\n replay_event: 'replay',\n replay_recording: 'replay',\n check_in: 'monitor',\n feedback: 'feedback',\n span: 'span',\n statsd: 'metric_bucket',\n};\n\n/**\n * Maps the type of an envelope item to a data category.\n */\nfunction envelopeItemTypeToDataCategory(type) {\n return ITEM_TYPE_TO_DATA_CATEGORY_MAP[type];\n}\n\n/** Extracts the minimal SDK info from the metadata or an events */\nfunction getSdkMetadataForEnvelopeHeader(metadataOrEvent) {\n if (!metadataOrEvent || !metadataOrEvent.sdk) {\n return;\n }\n const { name, version } = metadataOrEvent.sdk;\n return { name, version };\n}\n\n/**\n * Creates event envelope headers, based on event, sdk info and tunnel\n * Note: This function was extracted from the core package to make it available in Replay\n */\nfunction createEventEnvelopeHeaders(\n event,\n sdkInfo,\n tunnel,\n dsn,\n) {\n const dynamicSamplingContext = event.sdkProcessingMetadata && event.sdkProcessingMetadata.dynamicSamplingContext;\n return {\n event_id: event.event_id ,\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n ...(dynamicSamplingContext && {\n trace: dropUndefinedKeys({ ...dynamicSamplingContext }),\n }),\n };\n}\n\nexport { addItemToEnvelope, createAttachmentEnvelopeItem, createEnvelope, createEventEnvelopeHeaders, envelopeContainsItemType, envelopeItemTypeToDataCategory, forEachEnvelopeItem, getSdkMetadataForEnvelopeHeader, parseEnvelope, serializeEnvelope };\n//# sourceMappingURL=envelope.js.map\n","import { createEnvelope } from './envelope.js';\nimport { dateTimestampInSeconds } from './time.js';\n\n/**\n * Creates client report envelope\n * @param discarded_events An array of discard events\n * @param dsn A DSN that can be set on the header. Optional.\n */\nfunction createClientReportEnvelope(\n discarded_events,\n dsn,\n timestamp,\n) {\n const clientReportItem = [\n { type: 'client_report' },\n {\n timestamp: timestamp || dateTimestampInSeconds(),\n discarded_events,\n },\n ];\n return createEnvelope(dsn ? { dsn } : {}, [clientReportItem]);\n}\n\nexport { createClientReportEnvelope };\n//# sourceMappingURL=clientreport.js.map\n","// Intentionally keeping the key broad, as we don't know for sure what rate limit headers get returned from backend\n\nconst DEFAULT_RETRY_AFTER = 60 * 1000; // 60 seconds\n\n/**\n * Extracts Retry-After value from the request header or returns default value\n * @param header string representation of 'Retry-After' header\n * @param now current unix timestamp\n *\n */\nfunction parseRetryAfterHeader(header, now = Date.now()) {\n const headerDelay = parseInt(`${header}`, 10);\n if (!isNaN(headerDelay)) {\n return headerDelay * 1000;\n }\n\n const headerDate = Date.parse(`${header}`);\n if (!isNaN(headerDate)) {\n return headerDate - now;\n }\n\n return DEFAULT_RETRY_AFTER;\n}\n\n/**\n * Gets the time that the given category is disabled until for rate limiting.\n * In case no category-specific limit is set but a general rate limit across all categories is active,\n * that time is returned.\n *\n * @return the time in ms that the category is disabled until or 0 if there's no active rate limit.\n */\nfunction disabledUntil(limits, dataCategory) {\n return limits[dataCategory] || limits.all || 0;\n}\n\n/**\n * Checks if a category is rate limited\n */\nfunction isRateLimited(limits, dataCategory, now = Date.now()) {\n return disabledUntil(limits, dataCategory) > now;\n}\n\n/**\n * Update ratelimits from incoming headers.\n *\n * @return the updated RateLimits object.\n */\nfunction updateRateLimits(\n limits,\n { statusCode, headers },\n now = Date.now(),\n) {\n const updatedRateLimits = {\n ...limits,\n };\n\n // \"The name is case-insensitive.\"\n // https://developer.mozilla.org/en-US/docs/Web/API/Headers/get\n const rateLimitHeader = headers && headers['x-sentry-rate-limits'];\n const retryAfterHeader = headers && headers['retry-after'];\n\n if (rateLimitHeader) {\n /**\n * rate limit headers are of the form\n *
,
,..\n * where each
is of the form\n * : : : : \n * where\n * is a delay in seconds\n * is the event type(s) (error, transaction, etc) being rate limited and is of the form\n * ;;...\n * is what's being limited (org, project, or key) - ignored by SDK\n * is an arbitrary string like \"org_quota\" - ignored by SDK\n * Semicolon-separated list of metric namespace identifiers. Defines which namespace(s) will be affected.\n * Only present if rate limit applies to the metric_bucket data category.\n */\n for (const limit of rateLimitHeader.trim().split(',')) {\n const [retryAfter, categories, , , namespaces] = limit.split(':', 5);\n const headerDelay = parseInt(retryAfter, 10);\n const delay = (!isNaN(headerDelay) ? headerDelay : 60) * 1000; // 60sec default\n if (!categories) {\n updatedRateLimits.all = now + delay;\n } else {\n for (const category of categories.split(';')) {\n if (category === 'metric_bucket') {\n // namespaces will be present when category === 'metric_bucket'\n if (!namespaces || namespaces.split(';').includes('custom')) {\n updatedRateLimits[category] = now + delay;\n }\n } else {\n updatedRateLimits[category] = now + delay;\n }\n }\n }\n }\n } else if (retryAfterHeader) {\n updatedRateLimits.all = now + parseRetryAfterHeader(retryAfterHeader, now);\n } else if (statusCode === 429) {\n updatedRateLimits.all = now + 60 * 1000;\n }\n\n return updatedRateLimits;\n}\n\nexport { DEFAULT_RETRY_AFTER, disabledUntil, isRateLimited, parseRetryAfterHeader, updateRateLimits };\n//# sourceMappingURL=ratelimit.js.map\n","// https://github.com/alangpierce/sucrase/tree/265887868966917f3b924ce38dfad01fbab1329f\n//\n// The MIT License (MIT)\n//\n// Copyright (c) 2012-2018 various contributors (see AUTHORS)\n//\n// Permission is hereby granted, free of charge, to any person obtaining a copy\n// of this software and associated documentation files (the \"Software\"), to deal\n// in the Software without restriction, including without limitation the rights\n// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n// copies of the Software, and to permit persons to whom the Software is\n// furnished to do so, subject to the following conditions:\n//\n// The above copyright notice and this permission notice shall be included in all\n// copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n// SOFTWARE.\n\n/**\n * Polyfill for the nullish coalescing operator (`??`).\n *\n * Note that the RHS is wrapped in a function so that if it's a computed value, that evaluation won't happen unless the\n * LHS evaluates to a nullish value, to mimic the operator's short-circuiting behavior.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n *\n * @param lhs The value of the expression to the left of the `??`\n * @param rhsFn A function returning the value of the expression to the right of the `??`\n * @returns The LHS value, unless it's `null` or `undefined`, in which case, the RHS value\n */\nfunction _nullishCoalesce(lhs, rhsFn) {\n // by checking for loose equality to `null`, we catch both `null` and `undefined`\n return lhs != null ? lhs : rhsFn();\n}\n\n// Sucrase version:\n// function _nullishCoalesce(lhs, rhsFn) {\n// if (lhs != null) {\n// return lhs;\n// } else {\n// return rhsFn();\n// }\n// }\n\nexport { _nullishCoalesce };\n//# sourceMappingURL=_nullishCoalesce.js.map\n","/**\n * Polyfill for the optional chain operator, `?.`, given previous conversion of the expression into an array of values,\n * descriptors, and functions.\n *\n * Adapted from Sucrase (https://github.com/alangpierce/sucrase)\n * See https://github.com/alangpierce/sucrase/blob/265887868966917f3b924ce38dfad01fbab1329f/src/transformers/OptionalChainingNullishTransformer.ts#L15\n *\n * @param ops Array result of expression conversion\n * @returns The value of the expression\n */\nfunction _optionalChain(ops) {\n let lastAccessLHS = undefined;\n let value = ops[0];\n let i = 1;\n while (i < ops.length) {\n const op = ops[i] ;\n const fn = ops[i + 1] ;\n i += 2;\n // by checking for loose equality to `null`, we catch both `null` and `undefined`\n if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n // really we're meaning to return `undefined` as an actual value here, but it saves bytes not to write it\n return;\n }\n if (op === 'access' || op === 'optionalAccess') {\n lastAccessLHS = value;\n value = fn(value);\n } else if (op === 'call' || op === 'optionalCall') {\n value = fn((...args) => (value ).call(lastAccessLHS, ...args));\n lastAccessLHS = undefined;\n }\n }\n return value;\n}\n\n// Sucrase version\n// function _optionalChain(ops) {\n// let lastAccessLHS = undefined;\n// let value = ops[0];\n// let i = 1;\n// while (i < ops.length) {\n// const op = ops[i];\n// const fn = ops[i + 1];\n// i += 2;\n// if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) {\n// return undefined;\n// }\n// if (op === 'access' || op === 'optionalAccess') {\n// lastAccessLHS = value;\n// value = fn(value);\n// } else if (op === 'call' || op === 'optionalCall') {\n// value = fn((...args) => value.call(lastAccessLHS, ...args));\n// lastAccessLHS = undefined;\n// }\n// }\n// return value;\n// }\n\nexport { _optionalChain };\n//# sourceMappingURL=_optionalChain.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","const DEFAULT_ENVIRONMENT = 'production';\n\nexport { DEFAULT_ENVIRONMENT };\n//# sourceMappingURL=constants.js.map\n","import { SyncPromise, logger, isThenable, getGlobalSingleton } from '@sentry/utils';\nimport { DEBUG_BUILD } from './debug-build.js';\n\n/**\n * Returns the global event processors.\n * @deprecated Global event processors will be removed in v8.\n */\nfunction getGlobalEventProcessors() {\n return getGlobalSingleton('globalEventProcessors', () => []);\n}\n\n/**\n * Add a EventProcessor to be kept globally.\n * @deprecated Use `addEventProcessor` instead. Global event processors will be removed in v8.\n */\nfunction addGlobalEventProcessor(callback) {\n // eslint-disable-next-line deprecation/deprecation\n getGlobalEventProcessors().push(callback);\n}\n\n/**\n * Process an array of event processors, returning the processed event (or `null` if the event was dropped).\n */\nfunction notifyEventProcessors(\n processors,\n event,\n hint,\n index = 0,\n) {\n return new SyncPromise((resolve, reject) => {\n const processor = processors[index];\n if (event === null || typeof processor !== 'function') {\n resolve(event);\n } else {\n const result = processor({ ...event }, hint) ;\n\n DEBUG_BUILD && processor.id && result === null && logger.log(`Event processor \"${processor.id}\" dropped event`);\n\n if (isThenable(result)) {\n void result\n .then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n .then(null, reject);\n } else {\n void notifyEventProcessors(processors, result, hint, index + 1)\n .then(resolve)\n .then(null, reject);\n }\n }\n });\n}\n\nexport { addGlobalEventProcessor, getGlobalEventProcessors, notifyEventProcessors };\n//# sourceMappingURL=eventProcessors.js.map\n","import { timestampInSeconds, uuid4, dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nfunction makeSession(context) {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\n const session = {\n sid: uuid4(),\n init: true,\n timestamp: startingTime,\n started: startingTime,\n duration: 0,\n status: 'ok',\n errors: 0,\n ignoreDuration: false,\n toJSON: () => sessionToJSON(session),\n };\n\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nfunction updateSession(session, context = {}) {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\n */\nfunction closeSession(session, status) {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session) {\n return dropUndefinedKeys({\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n duration: session.duration,\n abnormal_mechanism: session.abnormal_mechanism,\n attrs: {\n release: session.release,\n environment: session.environment,\n ip_address: session.ipAddress,\n user_agent: session.userAgent,\n },\n });\n}\n\nexport { closeSession, makeSession, updateSession };\n//# sourceMappingURL=session.js.map\n","import { dropUndefinedKeys, generateSentryTraceHeader, timestampInSeconds } from '@sentry/utils';\n\n// These are aligned with OpenTelemetry trace flags\nconst TRACE_FLAG_NONE = 0x0;\nconst TRACE_FLAG_SAMPLED = 0x1;\n\n/**\n * Convert a span to a trace context, which can be sent as the `trace` context in an event.\n */\nfunction spanToTraceContext(span) {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n const { data, op, parent_span_id, status, tags, origin } = spanToJSON(span);\n\n return dropUndefinedKeys({\n data,\n op,\n parent_span_id,\n span_id,\n status,\n tags,\n trace_id,\n origin,\n });\n}\n\n/**\n * Convert a Span to a Sentry trace header.\n */\nfunction spanToTraceHeader(span) {\n const { traceId, spanId } = span.spanContext();\n const sampled = spanIsSampled(span);\n return generateSentryTraceHeader(traceId, spanId, sampled);\n}\n\n/**\n * Convert a span time input intp a timestamp in seconds.\n */\nfunction spanTimeInputToSeconds(input) {\n if (typeof input === 'number') {\n return ensureTimestampInSeconds(input);\n }\n\n if (Array.isArray(input)) {\n // See {@link HrTime} for the array-based time format\n return input[0] + input[1] / 1e9;\n }\n\n if (input instanceof Date) {\n return ensureTimestampInSeconds(input.getTime());\n }\n\n return timestampInSeconds();\n}\n\n/**\n * Converts a timestamp to second, if it was in milliseconds, or keeps it as second.\n */\nfunction ensureTimestampInSeconds(timestamp) {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp / 1000 : timestamp;\n}\n\n/**\n * Convert a span to a JSON representation.\n * Note that all fields returned here are optional and need to be guarded against.\n *\n * Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json).\n * This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility.\n * And `spanToJSON` needs the Span class from `span.ts` to check here.\n * TODO v8: When we remove the deprecated stuff from `span.ts`, we can remove the circular dependency again.\n */\nfunction spanToJSON(span) {\n if (spanIsSpanClass(span)) {\n return span.getSpanJSON();\n }\n\n // Fallback: We also check for `.toJSON()` here...\n // eslint-disable-next-line deprecation/deprecation\n if (typeof span.toJSON === 'function') {\n // eslint-disable-next-line deprecation/deprecation\n return span.toJSON();\n }\n\n return {};\n}\n\n/**\n * Sadly, due to circular dependency checks we cannot actually import the Span class here and check for instanceof.\n * :( So instead we approximate this by checking if it has the `getSpanJSON` method.\n */\nfunction spanIsSpanClass(span) {\n return typeof (span ).getSpanJSON === 'function';\n}\n\n/**\n * Returns true if a span is sampled.\n * In most cases, you should just use `span.isRecording()` instead.\n * However, this has a slightly different semantic, as it also returns false if the span is finished.\n * So in the case where this distinction is important, use this method.\n */\nfunction spanIsSampled(span) {\n // We align our trace flags with the ones OpenTelemetry use\n // So we also check for sampled the same way they do.\n const { traceFlags } = span.spanContext();\n // eslint-disable-next-line no-bitwise\n return Boolean(traceFlags & TRACE_FLAG_SAMPLED);\n}\n\nexport { TRACE_FLAG_NONE, TRACE_FLAG_SAMPLED, spanIsSampled, spanTimeInputToSeconds, spanToJSON, spanToTraceContext, spanToTraceHeader };\n//# sourceMappingURL=spanUtils.js.map\n","import { uuid4, dateTimestampInSeconds, addExceptionMechanism, truncate, GLOBAL_OBJ, normalize } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getGlobalEventProcessors, notifyEventProcessors } from '../eventProcessors.js';\nimport { getGlobalScope, Scope } from '../scope.js';\nimport { mergeScopeData, applyScopeDataToEvent } from './applyScopeDataToEvent.js';\nimport { spanToJSON } from './spanUtils.js';\n\n/**\n * This type makes sure that we get either a CaptureContext, OR an EventHint.\n * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:\n * { user: { id: '123' }, mechanism: { handled: false } }\n */\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nfunction prepareEvent(\n options,\n event,\n hint,\n scope,\n client,\n isolationScope,\n) {\n const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options;\n const prepared = {\n ...event,\n event_id: event.event_id || hint.event_id || uuid4(),\n timestamp: event.timestamp || dateTimestampInSeconds(),\n };\n const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n applyClientOptions(prepared, options);\n applyIntegrationsMetadata(prepared, integrations);\n\n // Only put debug IDs onto frames for error events.\n if (event.type === undefined) {\n applyDebugIds(prepared, options.stackParser);\n }\n\n // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n const finalScope = getFinalScope(scope, hint.captureContext);\n\n if (hint.mechanism) {\n addExceptionMechanism(prepared, hint.mechanism);\n }\n\n const clientEventProcessors = client && client.getEventProcessors ? client.getEventProcessors() : [];\n\n // This should be the last thing called, since we want that\n // {@link Hub.addEventProcessor} gets the finished prepared event.\n // Merge scope data together\n const data = getGlobalScope().getScopeData();\n\n if (isolationScope) {\n const isolationData = isolationScope.getScopeData();\n mergeScopeData(data, isolationData);\n }\n\n if (finalScope) {\n const finalScopeData = finalScope.getScopeData();\n mergeScopeData(data, finalScopeData);\n }\n\n const attachments = [...(hint.attachments || []), ...data.attachments];\n if (attachments.length) {\n hint.attachments = attachments;\n }\n\n applyScopeDataToEvent(prepared, data);\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors = [\n ...clientEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n // Run scope event processors _after_ all other processors\n ...data.eventProcessors,\n ];\n\n const result = notifyEventProcessors(eventProcessors, prepared, hint);\n\n return result.then(evt => {\n if (evt) {\n // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified\n // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.\n // This should not cause any PII issues, since we're only moving data that is already on the event and not adding\n // any new data\n applyDebugMeta(evt);\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n }\n return evt;\n });\n}\n\n/**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event, options) {\n const { environment, release, dist, maxValueLength = 250 } = options;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n const exception = event.exception && event.exception.values && event.exception.values[0];\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n const request = event.request;\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n}\n\nconst debugIdStackParserCache = new WeakMap();\n\n/**\n * Puts debug IDs into the stack frames of an error event.\n */\nfunction applyDebugIds(event, stackParser) {\n const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n if (!debugIdMap) {\n return;\n }\n\n let debugIdStackFramesCache;\n const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n if (cachedDebugIdStackFrameCache) {\n debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n } else {\n debugIdStackFramesCache = new Map();\n debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n }\n\n // Build a map of filename -> debug_id\n const filenameDebugIdMap = Object.keys(debugIdMap).reduce((acc, debugIdStackTrace) => {\n let parsedStack;\n const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n if (cachedParsedStack) {\n parsedStack = cachedParsedStack;\n } else {\n parsedStack = stackParser(debugIdStackTrace);\n debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n }\n\n for (let i = parsedStack.length - 1; i >= 0; i--) {\n const stackFrame = parsedStack[i];\n if (stackFrame.filename) {\n acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];\n break;\n }\n }\n return acc;\n }, {});\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.filename) {\n frame.debug_id = filenameDebugIdMap[frame.filename];\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n}\n\n/**\n * Moves debug IDs from the stack frames of an error event into the debug_meta field.\n */\nfunction applyDebugMeta(event) {\n // Extract debug IDs and filenames from the stack frames on the event.\n const filenameDebugIdMap = {};\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.debug_id) {\n if (frame.abs_path) {\n filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n } else if (frame.filename) {\n filenameDebugIdMap[frame.filename] = frame.debug_id;\n }\n delete frame.debug_id;\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n\n if (Object.keys(filenameDebugIdMap).length === 0) {\n return;\n }\n\n // Fill debug_meta information\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n const images = event.debug_meta.images;\n Object.keys(filenameDebugIdMap).forEach(filename => {\n images.push({\n type: 'sourcemap',\n code_file: filename,\n debug_id: filenameDebugIdMap[filename],\n });\n });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event, integrationNames) {\n if (integrationNames.length > 0) {\n event.sdk = event.sdk || {};\n event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event, depth, maxBreadth) {\n if (!event) {\n return null;\n }\n\n const normalized = {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth, maxBreadth),\n }),\n })),\n }),\n ...(event.user && {\n user: normalize(event.user, depth, maxBreadth),\n }),\n ...(event.contexts && {\n contexts: normalize(event.contexts, depth, maxBreadth),\n }),\n ...(event.extra && {\n extra: normalize(event.extra, depth, maxBreadth),\n }),\n };\n\n // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n if (event.contexts && event.contexts.trace && normalized.contexts) {\n normalized.contexts.trace = event.contexts.trace;\n\n // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n if (event.contexts.trace.data) {\n normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n }\n }\n\n // event.spans[].data may contain circular/dangerous data so we need to normalize it\n if (event.spans) {\n normalized.spans = event.spans.map(span => {\n const data = spanToJSON(span).data;\n\n if (data) {\n // This is a bit weird, as we generally have `Span` instances here, but to be safe we do not assume so\n // eslint-disable-next-line deprecation/deprecation\n span.data = normalize(data, depth, maxBreadth);\n }\n\n return span;\n });\n }\n\n return normalized;\n}\n\nfunction getFinalScope(scope, captureContext) {\n if (!captureContext) {\n return scope;\n }\n\n const finalScope = scope ? scope.clone() : new Scope();\n finalScope.update(captureContext);\n return finalScope;\n}\n\n/**\n * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.\n * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.\n */\nfunction parseEventHintOrCaptureContext(\n hint,\n) {\n if (!hint) {\n return undefined;\n }\n\n // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext\n if (hintIsScopeOrFunction(hint)) {\n return { captureContext: hint };\n }\n\n if (hintIsScopeContext(hint)) {\n return {\n captureContext: hint,\n };\n }\n\n return hint;\n}\n\nfunction hintIsScopeOrFunction(\n hint,\n) {\n return hint instanceof Scope || typeof hint === 'function';\n}\n\nconst captureContextKeys = [\n 'user',\n 'level',\n 'extra',\n 'contexts',\n 'tags',\n 'fingerprint',\n 'requestSession',\n 'propagationContext',\n] ;\n\nfunction hintIsScopeContext(hint) {\n return Object.keys(hint).some(key => captureContextKeys.includes(key ));\n}\n\nexport { applyDebugIds, applyDebugMeta, parseEventHintOrCaptureContext, prepareEvent };\n//# sourceMappingURL=prepareEvent.js.map\n","import { logger, uuid4, timestampInSeconds, isThenable, GLOBAL_OBJ } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from './constants.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { getCurrentHub, runWithAsyncContext, getIsolationScope } from './hub.js';\nimport { makeSession, updateSession, closeSession } from './session.js';\nimport { parseEventHintOrCaptureContext } from './utils/prepareEvent.js';\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\nfunction captureException(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n exception,\n hint,\n) {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureException(exception, parseEventHintOrCaptureContext(hint));\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param captureContext Define the level of the message or pass in additional data to attach to the message.\n * @returns the id of the captured message.\n */\nfunction captureMessage(\n message,\n // eslint-disable-next-line deprecation/deprecation\n captureContext,\n) {\n // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n const level = typeof captureContext === 'string' ? captureContext : undefined;\n const context = typeof captureContext !== 'string' ? { captureContext } : undefined;\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureMessage(message, level, context);\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param exception The event to send to Sentry.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\nfunction captureEvent(event, hint) {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureEvent(event, hint);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n *\n * @deprecated Use getCurrentScope() directly.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction configureScope(callback) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().configureScope(callback);\n}\n\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction addBreadcrumb(breadcrumb, hint) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().addBreadcrumb(breadcrumb, hint);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, deprecation/deprecation\nfunction setContext(name, context) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setContext(name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setExtras(extras) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setExtras(extras);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setExtra(key, extra) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setExtra(key, extra);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setTags(tags) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setTags(tags);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setTag(key, value) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setTag(key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setUser(user) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setUser(user);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n */\n\n/**\n * Either creates a new active scope, or sets the given scope as active scope in the given callback.\n */\nfunction withScope(\n ...rest\n) {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n\n // If a scope is defined, we want to make this the active scope instead of the default one\n if (rest.length === 2) {\n const [scope, callback] = rest;\n if (!scope) {\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(callback);\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(() => {\n // eslint-disable-next-line deprecation/deprecation\n hub.getStackTop().scope = scope ;\n return callback(scope );\n });\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(rest[0]);\n}\n\n/**\n * Attempts to fork the current isolation scope and the current scope based on the current async context strategy. If no\n * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the\n * case, for example, in the browser).\n *\n * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour.\n *\n * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in \"normal\"\n * applications directly because it comes with pitfalls. Use at your own risk!\n *\n * @param callback The callback in which the passed isolation scope is active. (Note: In environments without async\n * context strategy, the currently active isolation scope may change within execution of the callback.)\n * @returns The same value that `callback` returns.\n */\nfunction withIsolationScope(callback) {\n return runWithAsyncContext(() => {\n return callback(getIsolationScope());\n });\n}\n\n/**\n * Forks the current scope and sets the provided span as active span in the context of the provided callback.\n *\n * @param span Spans started in the context of the provided callback will be children of this span.\n * @param callback Execution context in which the provided span will be active. Is passed the newly forked scope.\n * @returns the value returned from the provided callback function.\n */\nfunction withActiveSpan(span, callback) {\n return withScope(scope => {\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(span);\n return callback(scope);\n });\n}\n\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.end()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call\n * `startTransaction` directly on the hub.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\nfunction startTransaction(\n context,\n customSamplingContext,\n // eslint-disable-next-line deprecation/deprecation\n) {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().startTransaction({ ...context }, customSamplingContext);\n}\n\n/**\n * Create a cron monitor check in and send it to Sentry.\n *\n * @param checkIn An object that describes a check in.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nfunction captureCheckIn(checkIn, upsertMonitorConfig) {\n const scope = getCurrentScope();\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. No client defined.');\n } else if (!client.captureCheckIn) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. Client does not support sending check-ins.');\n } else {\n return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);\n }\n\n return uuid4();\n}\n\n/**\n * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes.\n *\n * @param monitorSlug The distinct slug of the monitor.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nfunction withMonitor(\n monitorSlug,\n callback,\n upsertMonitorConfig,\n) {\n const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig);\n const now = timestampInSeconds();\n\n function finishCheckIn(status) {\n captureCheckIn({ monitorSlug, status, checkInId, duration: timestampInSeconds() - now });\n }\n\n let maybePromiseResult;\n try {\n maybePromiseResult = callback();\n } catch (e) {\n finishCheckIn('error');\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n Promise.resolve(maybePromiseResult).then(\n () => {\n finishCheckIn('ok');\n },\n () => {\n finishCheckIn('error');\n },\n );\n } else {\n finishCheckIn('ok');\n }\n\n return maybePromiseResult;\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nasync function flush(timeout) {\n const client = getClient();\n if (client) {\n return client.flush(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nasync function close(timeout) {\n const client = getClient();\n if (client) {\n return client.close(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events and disable SDK. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\nfunction lastEventId() {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().lastEventId();\n}\n\n/**\n * Get the currently active client.\n */\nfunction getClient() {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getClient();\n}\n\n/**\n * Returns true if Sentry has been properly initialized.\n */\nfunction isInitialized() {\n return !!getClient();\n}\n\n/**\n * Get the currently active scope.\n */\nfunction getCurrentScope() {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getScope();\n}\n\n/**\n * Start a session on the current isolation scope.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns the new active session\n */\nfunction startSession(context) {\n const client = getClient();\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n release,\n environment,\n user: currentScope.getUser() || isolationScope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = isolationScope.getSession();\n if (currentSession && currentSession.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n\n endSession();\n\n // Afterwards we set the new session on the scope\n isolationScope.setSession(session);\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession(session);\n\n return session;\n}\n\n/**\n * End the session on the current isolation scope.\n */\nfunction endSession() {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session) {\n closeSession(session);\n }\n _sendSessionUpdate();\n\n // the session is over; take it off of the scope\n isolationScope.setSession();\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession();\n}\n\n/**\n * Sends the current Session on the scope\n */\nfunction _sendSessionUpdate() {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n const client = getClient();\n // TODO (v8): Remove currentScope and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session && client && client.captureSession) {\n client.captureSession(session);\n }\n}\n\n/**\n * Sends the current session on the scope to Sentry\n *\n * @param end If set the session will be marked as exited and removed from the scope.\n * Defaults to `false`.\n */\nfunction captureSession(end = false) {\n // both send the update and pull the session from the scope\n if (end) {\n endSession();\n return;\n }\n\n // only send the update\n _sendSessionUpdate();\n}\n\nexport { addBreadcrumb, captureCheckIn, captureEvent, captureException, captureMessage, captureSession, close, configureScope, endSession, flush, getClient, getCurrentScope, isInitialized, lastEventId, setContext, setExtra, setExtras, setTag, setTags, setUser, startSession, startTransaction, withActiveSpan, withIsolationScope, withMonitor, withScope };\n//# sourceMappingURL=exports.js.map\n","/**\n * Returns the root span of a given span.\n *\n * As long as we use `Transaction`s internally, the returned root span\n * will be a `Transaction` but be aware that this might change in the future.\n *\n * If the given span has no root span or transaction, `undefined` is returned.\n */\nfunction getRootSpan(span) {\n // TODO (v8): Remove this check and just return span\n // eslint-disable-next-line deprecation/deprecation\n return span.transaction;\n}\n\nexport { getRootSpan };\n//# sourceMappingURL=getRootSpan.js.map\n","import { dropUndefinedKeys } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getClient, getCurrentScope } from '../exports.js';\nimport { getRootSpan } from '../utils/getRootSpan.js';\nimport { spanToJSON, spanIsSampled } from '../utils/spanUtils.js';\n\n/**\n * Creates a dynamic sampling context from a client.\n *\n * Dispatches the `createDsc` lifecycle hook as a side effect.\n */\nfunction getDynamicSamplingContextFromClient(\n trace_id,\n client,\n scope,\n) {\n const options = client.getOptions();\n\n const { publicKey: public_key } = client.getDsn() || {};\n // TODO(v8): Remove segment from User\n // eslint-disable-next-line deprecation/deprecation\n const { segment: user_segment } = (scope && scope.getUser()) || {};\n\n const dsc = dropUndefinedKeys({\n environment: options.environment || DEFAULT_ENVIRONMENT,\n release: options.release,\n user_segment,\n public_key,\n trace_id,\n }) ;\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\n/**\n * A Span with a frozen dynamic sampling context.\n */\n\n/**\n * Creates a dynamic sampling context from a span (and client and scope)\n *\n * @param span the span from which a few values like the root span name and sample rate are extracted.\n *\n * @returns a dynamic sampling context\n */\nfunction getDynamicSamplingContextFromSpan(span) {\n const client = getClient();\n if (!client) {\n return {};\n }\n\n // passing emit=false here to only emit later once the DSC is actually populated\n const dsc = getDynamicSamplingContextFromClient(spanToJSON(span).trace_id || '', client, getCurrentScope());\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n const txn = getRootSpan(span) ;\n if (!txn) {\n return dsc;\n }\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n // For now we need to avoid breaking users who directly created a txn with a DSC, where this field is still set.\n // @see Transaction class constructor\n const v7FrozenDsc = txn && txn._frozenDynamicSamplingContext;\n if (v7FrozenDsc) {\n return v7FrozenDsc;\n }\n\n // TODO (v8): Replace txn.metadata with txn.attributes[]\n // We can't do this yet because attributes aren't always set yet.\n // eslint-disable-next-line deprecation/deprecation\n const { sampleRate: maybeSampleRate, source } = txn.metadata;\n if (maybeSampleRate != null) {\n dsc.sample_rate = `${maybeSampleRate}`;\n }\n\n // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n const jsonSpan = spanToJSON(txn);\n\n // after JSON conversion, txn.name becomes jsonSpan.description\n if (source && source !== 'url') {\n dsc.transaction = jsonSpan.description;\n }\n\n dsc.sampled = String(spanIsSampled(txn));\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\nexport { getDynamicSamplingContextFromClient, getDynamicSamplingContextFromSpan };\n//# sourceMappingURL=dynamicSamplingContext.js.map\n","import { dropUndefinedKeys, arrayify } from '@sentry/utils';\nimport { getDynamicSamplingContextFromSpan } from '../tracing/dynamicSamplingContext.js';\nimport { getRootSpan } from './getRootSpan.js';\nimport { spanToTraceContext, spanToJSON } from './spanUtils.js';\n\n/**\n * Applies data from the scope to the event and runs all event processors on it.\n */\nfunction applyScopeDataToEvent(event, data) {\n const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data;\n\n // Apply general data\n applyDataToEvent(event, data);\n\n // We want to set the trace context for normal events only if there isn't already\n // a trace context on the event. There is a product feature in place where we link\n // errors with transaction and it relies on that.\n if (span) {\n applySpanToEvent(event, span);\n }\n\n applyFingerprintToEvent(event, fingerprint);\n applyBreadcrumbsToEvent(event, breadcrumbs);\n applySdkMetadataToEvent(event, sdkProcessingMetadata);\n}\n\n/** Merge data of two scopes together. */\nfunction mergeScopeData(data, mergeData) {\n const {\n extra,\n tags,\n user,\n contexts,\n level,\n sdkProcessingMetadata,\n breadcrumbs,\n fingerprint,\n eventProcessors,\n attachments,\n propagationContext,\n // eslint-disable-next-line deprecation/deprecation\n transactionName,\n span,\n } = mergeData;\n\n mergeAndOverwriteScopeData(data, 'extra', extra);\n mergeAndOverwriteScopeData(data, 'tags', tags);\n mergeAndOverwriteScopeData(data, 'user', user);\n mergeAndOverwriteScopeData(data, 'contexts', contexts);\n mergeAndOverwriteScopeData(data, 'sdkProcessingMetadata', sdkProcessingMetadata);\n\n if (level) {\n data.level = level;\n }\n\n if (transactionName) {\n // eslint-disable-next-line deprecation/deprecation\n data.transactionName = transactionName;\n }\n\n if (span) {\n data.span = span;\n }\n\n if (breadcrumbs.length) {\n data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs];\n }\n\n if (fingerprint.length) {\n data.fingerprint = [...data.fingerprint, ...fingerprint];\n }\n\n if (eventProcessors.length) {\n data.eventProcessors = [...data.eventProcessors, ...eventProcessors];\n }\n\n if (attachments.length) {\n data.attachments = [...data.attachments, ...attachments];\n }\n\n data.propagationContext = { ...data.propagationContext, ...propagationContext };\n}\n\n/**\n * Merges certain scope data. Undefined values will overwrite any existing values.\n * Exported only for tests.\n */\nfunction mergeAndOverwriteScopeData\n\n(data, prop, mergeVal) {\n if (mergeVal && Object.keys(mergeVal).length) {\n // Clone object\n data[prop] = { ...data[prop] };\n for (const key in mergeVal) {\n if (Object.prototype.hasOwnProperty.call(mergeVal, key)) {\n data[prop][key] = mergeVal[key];\n }\n }\n }\n}\n\nfunction applyDataToEvent(event, data) {\n const {\n extra,\n tags,\n user,\n contexts,\n level,\n // eslint-disable-next-line deprecation/deprecation\n transactionName,\n } = data;\n\n const cleanedExtra = dropUndefinedKeys(extra);\n if (cleanedExtra && Object.keys(cleanedExtra).length) {\n event.extra = { ...cleanedExtra, ...event.extra };\n }\n\n const cleanedTags = dropUndefinedKeys(tags);\n if (cleanedTags && Object.keys(cleanedTags).length) {\n event.tags = { ...cleanedTags, ...event.tags };\n }\n\n const cleanedUser = dropUndefinedKeys(user);\n if (cleanedUser && Object.keys(cleanedUser).length) {\n event.user = { ...cleanedUser, ...event.user };\n }\n\n const cleanedContexts = dropUndefinedKeys(contexts);\n if (cleanedContexts && Object.keys(cleanedContexts).length) {\n event.contexts = { ...cleanedContexts, ...event.contexts };\n }\n\n if (level) {\n event.level = level;\n }\n\n if (transactionName) {\n event.transaction = transactionName;\n }\n}\n\nfunction applyBreadcrumbsToEvent(event, breadcrumbs) {\n const mergedBreadcrumbs = [...(event.breadcrumbs || []), ...breadcrumbs];\n event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : undefined;\n}\n\nfunction applySdkMetadataToEvent(event, sdkProcessingMetadata) {\n event.sdkProcessingMetadata = {\n ...event.sdkProcessingMetadata,\n ...sdkProcessingMetadata,\n };\n}\n\nfunction applySpanToEvent(event, span) {\n event.contexts = { trace: spanToTraceContext(span), ...event.contexts };\n const rootSpan = getRootSpan(span);\n if (rootSpan) {\n event.sdkProcessingMetadata = {\n dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),\n ...event.sdkProcessingMetadata,\n };\n const transactionName = spanToJSON(rootSpan).description;\n if (transactionName) {\n event.tags = { transaction: transactionName, ...event.tags };\n }\n }\n}\n\n/**\n * Applies fingerprint from the scope to the event if there's one,\n * uses message if there's one instead or get rid of empty fingerprint\n */\nfunction applyFingerprintToEvent(event, fingerprint) {\n // Make sure it's an array first and we actually have something in place\n event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : [];\n\n // If we have something on the scope, then merge it with event\n if (fingerprint) {\n event.fingerprint = event.fingerprint.concat(fingerprint);\n }\n\n // If we have no data at all, remove empty array default\n if (event.fingerprint && !event.fingerprint.length) {\n delete event.fingerprint;\n }\n}\n\nexport { applyScopeDataToEvent, mergeAndOverwriteScopeData, mergeScopeData };\n//# sourceMappingURL=applyScopeDataToEvent.js.map\n","import { isPlainObject, dateTimestampInSeconds, uuid4, logger } from '@sentry/utils';\nimport { getGlobalEventProcessors, notifyEventProcessors } from './eventProcessors.js';\nimport { updateSession } from './session.js';\nimport { applyScopeDataToEvent } from './utils/applyScopeDataToEvent.js';\n\n/**\n * Default value for maximum number of breadcrumbs added to an event.\n */\nconst DEFAULT_MAX_BREADCRUMBS = 100;\n\n/**\n * The global scope is kept in this module.\n * When accessing this via `getGlobalScope()` we'll make sure to set one if none is currently present.\n */\nlet globalScope;\n\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\nclass Scope {\n /** Flag if notifying is happening. */\n\n /** Callback for client to receive scope changes. */\n\n /** Callback list that will be called after {@link applyToEvent}. */\n\n /** Array of breadcrumbs. */\n\n /** User */\n\n /** Tags */\n\n /** Extra */\n\n /** Contexts */\n\n /** Attachments */\n\n /** Propagation Context for distributed tracing */\n\n /**\n * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n * sent to Sentry\n */\n\n /** Fingerprint */\n\n /** Severity */\n // eslint-disable-next-line deprecation/deprecation\n\n /**\n * Transaction Name\n */\n\n /** Span */\n\n /** Session */\n\n /** Request Mode Session Status */\n\n /** The client on this scope */\n\n // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.\n\n constructor() {\n this._notifyingListeners = false;\n this._scopeListeners = [];\n this._eventProcessors = [];\n this._breadcrumbs = [];\n this._attachments = [];\n this._user = {};\n this._tags = {};\n this._extra = {};\n this._contexts = {};\n this._sdkProcessingMetadata = {};\n this._propagationContext = generatePropagationContext();\n }\n\n /**\n * Inherit values from the parent scope.\n * @deprecated Use `scope.clone()` and `new Scope()` instead.\n */\n static clone(scope) {\n return scope ? scope.clone() : new Scope();\n }\n\n /**\n * Clone this scope instance.\n */\n clone() {\n const newScope = new Scope();\n newScope._breadcrumbs = [...this._breadcrumbs];\n newScope._tags = { ...this._tags };\n newScope._extra = { ...this._extra };\n newScope._contexts = { ...this._contexts };\n newScope._user = this._user;\n newScope._level = this._level;\n newScope._span = this._span;\n newScope._session = this._session;\n newScope._transactionName = this._transactionName;\n newScope._fingerprint = this._fingerprint;\n newScope._eventProcessors = [...this._eventProcessors];\n newScope._requestSession = this._requestSession;\n newScope._attachments = [...this._attachments];\n newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };\n newScope._propagationContext = { ...this._propagationContext };\n newScope._client = this._client;\n\n return newScope;\n }\n\n /** Update the client on the scope. */\n setClient(client) {\n this._client = client;\n }\n\n /**\n * Get the client assigned to this scope.\n *\n * It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing.\n */\n getClient() {\n return this._client;\n }\n\n /**\n * Add internal on change listener. Used for sub SDKs that need to store the scope.\n * @hidden\n */\n addScopeListener(callback) {\n this._scopeListeners.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n addEventProcessor(callback) {\n this._eventProcessors.push(callback);\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setUser(user) {\n // If null is passed we want to unset everything, but still define keys,\n // so that later down in the pipeline any existing values are cleared.\n this._user = user || {\n email: undefined,\n id: undefined,\n ip_address: undefined,\n segment: undefined,\n username: undefined,\n };\n\n if (this._session) {\n updateSession(this._session, { user });\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getUser() {\n return this._user;\n }\n\n /**\n * @inheritDoc\n */\n getRequestSession() {\n return this._requestSession;\n }\n\n /**\n * @inheritDoc\n */\n setRequestSession(requestSession) {\n this._requestSession = requestSession;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setTags(tags) {\n this._tags = {\n ...this._tags,\n ...tags,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setTag(key, value) {\n this._tags = { ...this._tags, [key]: value };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setExtras(extras) {\n this._extra = {\n ...this._extra,\n ...extras,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setExtra(key, extra) {\n this._extra = { ...this._extra, [key]: extra };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setFingerprint(fingerprint) {\n this._fingerprint = fingerprint;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setLevel(\n // eslint-disable-next-line deprecation/deprecation\n level,\n ) {\n this._level = level;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the transaction name on the scope for future events.\n */\n setTransactionName(name) {\n this._transactionName = name;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setContext(key, context) {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts[key] = context;\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the Span on the scope.\n * @param span Span\n * @deprecated Instead of setting a span on a scope, use `startSpan()`/`startSpanManual()` instead.\n */\n setSpan(span) {\n this._span = span;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Returns the `Span` if there is one.\n * @deprecated Use `getActiveSpan()` instead.\n */\n getSpan() {\n return this._span;\n }\n\n /**\n * Returns the `Transaction` attached to the scope (if there is one).\n * @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.\n */\n getTransaction() {\n // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will\n // have a pointer to the currently-active transaction.\n const span = this._span;\n // Cannot replace with getRootSpan because getRootSpan returns a span, not a transaction\n // Also, this method will be removed anyway.\n // eslint-disable-next-line deprecation/deprecation\n return span && span.transaction;\n }\n\n /**\n * @inheritDoc\n */\n setSession(session) {\n if (!session) {\n delete this._session;\n } else {\n this._session = session;\n }\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getSession() {\n return this._session;\n }\n\n /**\n * @inheritDoc\n */\n update(captureContext) {\n if (!captureContext) {\n return this;\n }\n\n const scopeToMerge = typeof captureContext === 'function' ? captureContext(this) : captureContext;\n\n if (scopeToMerge instanceof Scope) {\n const scopeData = scopeToMerge.getScopeData();\n\n this._tags = { ...this._tags, ...scopeData.tags };\n this._extra = { ...this._extra, ...scopeData.extra };\n this._contexts = { ...this._contexts, ...scopeData.contexts };\n if (scopeData.user && Object.keys(scopeData.user).length) {\n this._user = scopeData.user;\n }\n if (scopeData.level) {\n this._level = scopeData.level;\n }\n if (scopeData.fingerprint.length) {\n this._fingerprint = scopeData.fingerprint;\n }\n if (scopeToMerge.getRequestSession()) {\n this._requestSession = scopeToMerge.getRequestSession();\n }\n if (scopeData.propagationContext) {\n this._propagationContext = scopeData.propagationContext;\n }\n } else if (isPlainObject(scopeToMerge)) {\n const scopeContext = captureContext ;\n this._tags = { ...this._tags, ...scopeContext.tags };\n this._extra = { ...this._extra, ...scopeContext.extra };\n this._contexts = { ...this._contexts, ...scopeContext.contexts };\n if (scopeContext.user) {\n this._user = scopeContext.user;\n }\n if (scopeContext.level) {\n this._level = scopeContext.level;\n }\n if (scopeContext.fingerprint) {\n this._fingerprint = scopeContext.fingerprint;\n }\n if (scopeContext.requestSession) {\n this._requestSession = scopeContext.requestSession;\n }\n if (scopeContext.propagationContext) {\n this._propagationContext = scopeContext.propagationContext;\n }\n }\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n clear() {\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._contexts = {};\n this._level = undefined;\n this._transactionName = undefined;\n this._fingerprint = undefined;\n this._requestSession = undefined;\n this._span = undefined;\n this._session = undefined;\n this._notifyScopeListeners();\n this._attachments = [];\n this._propagationContext = generatePropagationContext();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n addBreadcrumb(breadcrumb, maxBreadcrumbs) {\n const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;\n\n // No data has been changed, so don't notify scope listeners\n if (maxCrumbs <= 0) {\n return this;\n }\n\n const mergedBreadcrumb = {\n timestamp: dateTimestampInSeconds(),\n ...breadcrumb,\n };\n\n const breadcrumbs = this._breadcrumbs;\n breadcrumbs.push(mergedBreadcrumb);\n this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs;\n\n this._notifyScopeListeners();\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getLastBreadcrumb() {\n return this._breadcrumbs[this._breadcrumbs.length - 1];\n }\n\n /**\n * @inheritDoc\n */\n clearBreadcrumbs() {\n this._breadcrumbs = [];\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n addAttachment(attachment) {\n this._attachments.push(attachment);\n return this;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `getScopeData()` instead.\n */\n getAttachments() {\n const data = this.getScopeData();\n\n return data.attachments;\n }\n\n /**\n * @inheritDoc\n */\n clearAttachments() {\n this._attachments = [];\n return this;\n }\n\n /** @inheritDoc */\n getScopeData() {\n const {\n _breadcrumbs,\n _attachments,\n _contexts,\n _tags,\n _extra,\n _user,\n _level,\n _fingerprint,\n _eventProcessors,\n _propagationContext,\n _sdkProcessingMetadata,\n _transactionName,\n _span,\n } = this;\n\n return {\n breadcrumbs: _breadcrumbs,\n attachments: _attachments,\n contexts: _contexts,\n tags: _tags,\n extra: _extra,\n user: _user,\n level: _level,\n fingerprint: _fingerprint || [],\n eventProcessors: _eventProcessors,\n propagationContext: _propagationContext,\n sdkProcessingMetadata: _sdkProcessingMetadata,\n transactionName: _transactionName,\n span: _span,\n };\n }\n\n /**\n * Applies data from the scope to the event and runs all event processors on it.\n *\n * @param event Event\n * @param hint Object containing additional information about the original exception, for use by the event processors.\n * @hidden\n * @deprecated Use `applyScopeDataToEvent()` directly\n */\n applyToEvent(\n event,\n hint = {},\n additionalEventProcessors = [],\n ) {\n applyScopeDataToEvent(event, this.getScopeData());\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors = [\n ...additionalEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n ...this._eventProcessors,\n ];\n\n return notifyEventProcessors(eventProcessors, event, hint);\n }\n\n /**\n * Add data which will be accessible during event processing but won't get sent to Sentry\n */\n setSDKProcessingMetadata(newData) {\n this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setPropagationContext(context) {\n this._propagationContext = context;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getPropagationContext() {\n return this._propagationContext;\n }\n\n /**\n * Capture an exception for this scope.\n *\n * @param exception The exception to capture.\n * @param hint Optinal additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\n captureException(exception, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture exception!');\n return eventId;\n }\n\n const syntheticException = new Error('Sentry syntheticException');\n\n this._client.captureException(\n exception,\n {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Capture a message for this scope.\n *\n * @param message The message to capture.\n * @param level An optional severity level to report the message with.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured message.\n */\n captureMessage(message, level, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture message!');\n return eventId;\n }\n\n const syntheticException = new Error(message);\n\n this._client.captureMessage(\n message,\n level,\n {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Captures a manually created event for this scope and sends it to Sentry.\n *\n * @param exception The event to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\n captureEvent(event, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture event!');\n return eventId;\n }\n\n this._client.captureEvent(event, { ...hint, event_id: eventId }, this);\n\n return eventId;\n }\n\n /**\n * This will be called on every set call.\n */\n _notifyScopeListeners() {\n // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n this._scopeListeners.forEach(callback => {\n callback(this);\n });\n this._notifyingListeners = false;\n }\n }\n}\n\n/**\n * Get the global scope.\n * This scope is applied to _all_ events.\n */\nfunction getGlobalScope() {\n if (!globalScope) {\n globalScope = new Scope();\n }\n\n return globalScope;\n}\n\n/**\n * This is mainly needed for tests.\n * DO NOT USE this, as this is an internal API and subject to change.\n * @hidden\n */\nfunction setGlobalScope(scope) {\n globalScope = scope;\n}\n\nfunction generatePropagationContext() {\n return {\n traceId: uuid4(),\n spanId: uuid4().substring(16),\n };\n}\n\nexport { Scope, getGlobalScope, setGlobalScope };\n//# sourceMappingURL=scope.js.map\n","const SDK_VERSION = '7.120.0';\n\nexport { SDK_VERSION };\n//# sourceMappingURL=version.js.map\n","import { isThenable, uuid4, dateTimestampInSeconds, consoleSandbox, logger, GLOBAL_OBJ, getGlobalSingleton } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from './constants.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { Scope } from './scope.js';\nimport { closeSession, makeSession, updateSession } from './session.js';\nimport { SDK_VERSION } from './version.js';\n\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\nconst API_VERSION = parseFloat(SDK_VERSION);\n\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\nconst DEFAULT_BREADCRUMBS = 100;\n\n/**\n * @deprecated The `Hub` class will be removed in version 8 of the SDK in favour of `Scope` and `Client` objects.\n *\n * If you previously used the `Hub` class directly, replace it with `Scope` and `Client` objects. More information:\n * - [Multiple Sentry Instances](https://docs.sentry.io/platforms/javascript/best-practices/multiple-sentry-instances/)\n * - [Browser Extensions](https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/)\n *\n * Some of our APIs are typed with the Hub class instead of the interface (e.g. `getCurrentHub`). Most of them are deprecated\n * themselves and will also be removed in version 8. More information:\n * - [Migration Guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub)\n */\n// eslint-disable-next-line deprecation/deprecation\nclass Hub {\n /** Is a {@link Layer}[] containing the client and scope */\n\n /** Contains the last event id of a captured event. */\n\n /**\n * Creates a new instance of the hub, will push one {@link Layer} into the\n * internal stack on creation.\n *\n * @param client bound to the hub.\n * @param scope bound to the hub.\n * @param version number, higher number means higher priority.\n *\n * @deprecated Instantiation of Hub objects is deprecated and the constructor will be removed in version 8 of the SDK.\n *\n * If you are currently using the Hub for multi-client use like so:\n *\n * ```\n * // OLD\n * const hub = new Hub();\n * hub.bindClient(client);\n * makeMain(hub)\n * ```\n *\n * instead initialize the client as follows:\n *\n * ```\n * // NEW\n * Sentry.withIsolationScope(() => {\n * Sentry.setCurrentClient(client);\n * client.init();\n * });\n * ```\n *\n * If you are using the Hub to capture events like so:\n *\n * ```\n * // OLD\n * const client = new Client();\n * const hub = new Hub(client);\n * hub.captureException()\n * ```\n *\n * instead capture isolated events as follows:\n *\n * ```\n * // NEW\n * const client = new Client();\n * const scope = new Scope();\n * scope.setClient(client);\n * scope.captureException();\n * ```\n */\n constructor(\n client,\n scope,\n isolationScope,\n _version = API_VERSION,\n ) {this._version = _version;\n let assignedScope;\n if (!scope) {\n assignedScope = new Scope();\n assignedScope.setClient(client);\n } else {\n assignedScope = scope;\n }\n\n let assignedIsolationScope;\n if (!isolationScope) {\n assignedIsolationScope = new Scope();\n assignedIsolationScope.setClient(client);\n } else {\n assignedIsolationScope = isolationScope;\n }\n\n this._stack = [{ scope: assignedScope }];\n\n if (client) {\n // eslint-disable-next-line deprecation/deprecation\n this.bindClient(client);\n }\n\n this._isolationScope = assignedIsolationScope;\n }\n\n /**\n * Checks if this hub's version is older than the given version.\n *\n * @param version A version number to compare to.\n * @return True if the given version is newer; otherwise false.\n *\n * @deprecated This will be removed in v8.\n */\n isOlderThan(version) {\n return this._version < version;\n }\n\n /**\n * This binds the given client to the current scope.\n * @param client An SDK client (client) instance.\n *\n * @deprecated Use `initAndBind()` directly, or `setCurrentClient()` and/or `client.init()` instead.\n */\n bindClient(client) {\n // eslint-disable-next-line deprecation/deprecation\n const top = this.getStackTop();\n top.client = client;\n top.scope.setClient(client);\n // eslint-disable-next-line deprecation/deprecation\n if (client && client.setupIntegrations) {\n // eslint-disable-next-line deprecation/deprecation\n client.setupIntegrations();\n }\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `withScope` instead.\n */\n pushScope() {\n // We want to clone the content of prev scope\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.getScope().clone();\n // eslint-disable-next-line deprecation/deprecation\n this.getStack().push({\n // eslint-disable-next-line deprecation/deprecation\n client: this.getClient(),\n scope,\n });\n return scope;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `withScope` instead.\n */\n popScope() {\n // eslint-disable-next-line deprecation/deprecation\n if (this.getStack().length <= 1) return false;\n // eslint-disable-next-line deprecation/deprecation\n return !!this.getStack().pop();\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.withScope()` instead.\n */\n withScope(callback) {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.pushScope();\n\n let maybePromiseResult;\n try {\n maybePromiseResult = callback(scope);\n } catch (e) {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n // @ts-expect-error - isThenable returns the wrong type\n return maybePromiseResult.then(\n res => {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n return res;\n },\n e => {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n throw e;\n },\n );\n }\n\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n return maybePromiseResult;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.getClient()` instead.\n */\n getClient() {\n // eslint-disable-next-line deprecation/deprecation\n return this.getStackTop().client ;\n }\n\n /**\n * Returns the scope of the top stack.\n *\n * @deprecated Use `Sentry.getCurrentScope()` instead.\n */\n getScope() {\n // eslint-disable-next-line deprecation/deprecation\n return this.getStackTop().scope;\n }\n\n /**\n * @deprecated Use `Sentry.getIsolationScope()` instead.\n */\n getIsolationScope() {\n return this._isolationScope;\n }\n\n /**\n * Returns the scope stack for domains or the process.\n * @deprecated This will be removed in v8.\n */\n getStack() {\n return this._stack;\n }\n\n /**\n * Returns the topmost scope layer in the order domain > local > process.\n * @deprecated This will be removed in v8.\n */\n getStackTop() {\n return this._stack[this._stack.length - 1];\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureException()` instead.\n */\n captureException(exception, hint) {\n const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n const syntheticException = new Error('Sentry syntheticException');\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureException(exception, {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureMessage()` instead.\n */\n captureMessage(\n message,\n // eslint-disable-next-line deprecation/deprecation\n level,\n hint,\n ) {\n const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n const syntheticException = new Error(message);\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureMessage(message, level, {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureEvent()` instead.\n */\n captureEvent(event, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n if (!event.type) {\n this._lastEventId = eventId;\n }\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureEvent(event, { ...hint, event_id: eventId });\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated This will be removed in v8.\n */\n lastEventId() {\n return this._lastEventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.addBreadcrumb()` instead.\n */\n addBreadcrumb(breadcrumb, hint) {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n\n if (!client) return;\n\n const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =\n (client.getOptions && client.getOptions()) || {};\n\n if (maxBreadcrumbs <= 0) return;\n\n const timestamp = dateTimestampInSeconds();\n const mergedBreadcrumb = { timestamp, ...breadcrumb };\n const finalBreadcrumb = beforeBreadcrumb\n ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) )\n : mergedBreadcrumb;\n\n if (finalBreadcrumb === null) return;\n\n if (client.emit) {\n client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint);\n }\n\n // TODO(v8): I know this comment doesn't make much sense because the hub will be deprecated but I still wanted to\n // write it down. In theory, we would have to add the breadcrumbs to the isolation scope here, however, that would\n // duplicate all of the breadcrumbs. There was the possibility of adding breadcrumbs to both, the isolation scope\n // and the normal scope, and deduplicating it down the line in the event processing pipeline. However, that would\n // have been very fragile, because the breadcrumb objects would have needed to keep their identity all throughout\n // the event processing pipeline.\n // In the new implementation, the top level `Sentry.addBreadcrumb()` should ONLY write to the isolation scope.\n\n scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setUser()` instead.\n */\n setUser(user) {\n // TODO(v8): The top level `Sentry.setUser()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setUser(user);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setUser(user);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setTags()` instead.\n */\n setTags(tags) {\n // TODO(v8): The top level `Sentry.setTags()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setTags(tags);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setTags(tags);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setExtras()` instead.\n */\n setExtras(extras) {\n // TODO(v8): The top level `Sentry.setExtras()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setExtras(extras);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setExtras(extras);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setTag()` instead.\n */\n setTag(key, value) {\n // TODO(v8): The top level `Sentry.setTag()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setTag(key, value);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setTag(key, value);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setExtra()` instead.\n */\n setExtra(key, extra) {\n // TODO(v8): The top level `Sentry.setExtra()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setExtra(key, extra);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setExtra(key, extra);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setContext()` instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setContext(name, context) {\n // TODO(v8): The top level `Sentry.setContext()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setContext(name, context);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setContext(name, context);\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `getScope()` directly.\n */\n configureScope(callback) {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n if (client) {\n callback(scope);\n }\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n run(callback) {\n // eslint-disable-next-line deprecation/deprecation\n const oldHub = makeMain(this);\n try {\n callback(this);\n } finally {\n // eslint-disable-next-line deprecation/deprecation\n makeMain(oldHub);\n }\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.getClient().getIntegrationByName()` instead.\n */\n getIntegration(integration) {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n if (!client) return null;\n try {\n // eslint-disable-next-line deprecation/deprecation\n return client.getIntegration(integration);\n } catch (_oO) {\n DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);\n return null;\n }\n }\n\n /**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.end()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\n startTransaction(context, customSamplingContext) {\n const result = this._callExtensionMethod('startTransaction', context, customSamplingContext);\n\n if (DEBUG_BUILD && !result) {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n if (!client) {\n logger.warn(\n \"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'\",\n );\n } else {\n logger.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n`);\n }\n }\n\n return result;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `spanToTraceHeader()` instead.\n */\n traceHeaders() {\n return this._callExtensionMethod('traceHeaders');\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use top level `captureSession` instead.\n */\n captureSession(endSession = false) {\n // both send the update and pull the session from the scope\n if (endSession) {\n // eslint-disable-next-line deprecation/deprecation\n return this.endSession();\n }\n\n // only send the update\n this._sendSessionUpdate();\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top level `endSession` instead.\n */\n endSession() {\n // eslint-disable-next-line deprecation/deprecation\n const layer = this.getStackTop();\n const scope = layer.scope;\n const session = scope.getSession();\n if (session) {\n closeSession(session);\n }\n this._sendSessionUpdate();\n\n // the session is over; take it off of the scope\n scope.setSession();\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top level `startSession` instead.\n */\n startSession(context) {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n release,\n environment,\n user: scope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = scope.getSession && scope.getSession();\n if (currentSession && currentSession.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n // eslint-disable-next-line deprecation/deprecation\n this.endSession();\n\n // Afterwards we set the new session on the scope\n scope.setSession(session);\n\n return session;\n }\n\n /**\n * Returns if default PII should be sent to Sentry and propagated in ourgoing requests\n * when Tracing is used.\n *\n * @deprecated Use top-level `getClient().getOptions().sendDefaultPii` instead. This function\n * only unnecessarily increased API surface but only wrapped accessing the option.\n */\n shouldSendDefaultPii() {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n const options = client && client.getOptions();\n return Boolean(options && options.sendDefaultPii);\n }\n\n /**\n * Sends the current Session on the scope\n */\n _sendSessionUpdate() {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n\n const session = scope.getSession();\n if (session && client && client.captureSession) {\n client.captureSession(session);\n }\n }\n\n /**\n * Calls global extension method and binding current instance to the function call\n */\n // @ts-expect-error Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _callExtensionMethod(method, ...args) {\n const carrier = getMainCarrier();\n const sentry = carrier.__SENTRY__;\n if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n return sentry.extensions[method].apply(this, args);\n }\n DEBUG_BUILD && logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);\n }\n}\n\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\nfunction getMainCarrier() {\n GLOBAL_OBJ.__SENTRY__ = GLOBAL_OBJ.__SENTRY__ || {\n extensions: {},\n hub: undefined,\n };\n return GLOBAL_OBJ;\n}\n\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n *\n * @deprecated Use `setCurrentClient()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction makeMain(hub) {\n const registry = getMainCarrier();\n const oldHub = getHubFromCarrier(registry);\n setHubOnCarrier(registry, hub);\n return oldHub;\n}\n\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n *\n * @deprecated Use the respective replacement method directly instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction getCurrentHub() {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n\n if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n const hub = registry.__SENTRY__.acs.getCurrentHub();\n\n if (hub) {\n return hub;\n }\n }\n\n // Return hub that lives on a global object\n return getGlobalHub(registry);\n}\n\n/**\n * Get the currently active isolation scope.\n * The isolation scope is active for the current exection context,\n * meaning that it will remain stable for the same Hub.\n */\nfunction getIsolationScope() {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getIsolationScope();\n}\n\n// eslint-disable-next-line deprecation/deprecation\nfunction getGlobalHub(registry = getMainCarrier()) {\n // If there's no hub, or its an old API, assign a new one\n\n if (\n !hasHubOnCarrier(registry) ||\n // eslint-disable-next-line deprecation/deprecation\n getHubFromCarrier(registry).isOlderThan(API_VERSION)\n ) {\n // eslint-disable-next-line deprecation/deprecation\n setHubOnCarrier(registry, new Hub());\n }\n\n // Return hub that lives on a global object\n return getHubFromCarrier(registry);\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * If the carrier does not contain a hub, a new hub is created with the global hub client and scope.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction ensureHubOnCarrier(carrier, parent = getGlobalHub()) {\n // If there's no hub on current domain, or it's an old API, assign a new one\n if (\n !hasHubOnCarrier(carrier) ||\n // eslint-disable-next-line deprecation/deprecation\n getHubFromCarrier(carrier).isOlderThan(API_VERSION)\n ) {\n // eslint-disable-next-line deprecation/deprecation\n const client = parent.getClient();\n // eslint-disable-next-line deprecation/deprecation\n const scope = parent.getScope();\n // eslint-disable-next-line deprecation/deprecation\n const isolationScope = parent.getIsolationScope();\n // eslint-disable-next-line deprecation/deprecation\n setHubOnCarrier(carrier, new Hub(client, scope.clone(), isolationScope.clone()));\n }\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nfunction setAsyncContextStrategy(strategy) {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n registry.__SENTRY__ = registry.__SENTRY__ || {};\n registry.__SENTRY__.acs = strategy;\n}\n\n/**\n * Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.\n *\n * @param callback The callback to run in its own async context\n * @param options Options to pass to the async context strategy\n * @returns The result of the callback\n */\nfunction runWithAsyncContext(callback, options = {}) {\n const registry = getMainCarrier();\n\n if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n return registry.__SENTRY__.acs.runWithAsyncContext(callback, options);\n }\n\n // if there was no strategy, fallback to just calling the callback\n return callback();\n}\n\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\nfunction hasHubOnCarrier(carrier) {\n return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction getHubFromCarrier(carrier) {\n // eslint-disable-next-line deprecation/deprecation\n return getGlobalSingleton('hub', () => new Hub(), carrier);\n}\n\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n * @returns A boolean indicating success or failure\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setHubOnCarrier(carrier, hub) {\n if (!carrier) return false;\n const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});\n __SENTRY__.hub = hub;\n return true;\n}\n\nexport { API_VERSION, Hub, ensureHubOnCarrier, getCurrentHub, getHubFromCarrier, getIsolationScope, getMainCarrier, makeMain, runWithAsyncContext, setAsyncContextStrategy, setHubOnCarrier };\n//# sourceMappingURL=hub.js.map\n","import { getSdkMetadataForEnvelopeHeader, dsnToString, createEnvelope, createEventEnvelopeHeaders } from '@sentry/utils';\n\n/**\n * Apply SdkInfo (name, version, packages, integrations) to the corresponding event key.\n * Merge with existing data if any.\n **/\nfunction enhanceEventWithSdkInfo(event, sdkInfo) {\n if (!sdkInfo) {\n return event;\n }\n event.sdk = event.sdk || {};\n event.sdk.name = event.sdk.name || sdkInfo.name;\n event.sdk.version = event.sdk.version || sdkInfo.version;\n event.sdk.integrations = [...(event.sdk.integrations || []), ...(sdkInfo.integrations || [])];\n event.sdk.packages = [...(event.sdk.packages || []), ...(sdkInfo.packages || [])];\n return event;\n}\n\n/** Creates an envelope from a Session */\nfunction createSessionEnvelope(\n session,\n dsn,\n metadata,\n tunnel,\n) {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n const envelopeHeaders = {\n sent_at: new Date().toISOString(),\n ...(sdkInfo && { sdk: sdkInfo }),\n ...(!!tunnel && dsn && { dsn: dsnToString(dsn) }),\n };\n\n const envelopeItem =\n 'aggregates' in session ? [{ type: 'sessions' }, session] : [{ type: 'session' }, session.toJSON()];\n\n return createEnvelope(envelopeHeaders, [envelopeItem]);\n}\n\n/**\n * Create an Envelope from an event.\n */\nfunction createEventEnvelope(\n event,\n dsn,\n metadata,\n tunnel,\n) {\n const sdkInfo = getSdkMetadataForEnvelopeHeader(metadata);\n\n /*\n Note: Due to TS, event.type may be `replay_event`, theoretically.\n In practice, we never call `createEventEnvelope` with `replay_event` type,\n and we'd have to adjut a looot of types to make this work properly.\n We want to avoid casting this around, as that could lead to bugs (e.g. when we add another type)\n So the safe choice is to really guard against the replay_event type here.\n */\n const eventType = event.type && event.type !== 'replay_event' ? event.type : 'event';\n\n enhanceEventWithSdkInfo(event, metadata && metadata.sdk);\n\n const envelopeHeaders = createEventEnvelopeHeaders(event, sdkInfo, tunnel, dsn);\n\n // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to\n // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may\n // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid\n // of this `delete`, lest we miss putting it back in the next time the property is in use.)\n delete event.sdkProcessingMetadata;\n\n const eventItem = [{ type: eventType }, event];\n return createEnvelope(envelopeHeaders, [eventItem]);\n}\n\nexport { createEventEnvelope, createSessionEnvelope };\n//# sourceMappingURL=envelope.js.map\n","import { makeDsn, dsnToString, urlEncode } from '@sentry/utils';\n\nconst SENTRY_API_VERSION = '7';\n\n/** Returns the prefix to construct Sentry ingestion API endpoints. */\nfunction getBaseApiEndpoint(dsn) {\n const protocol = dsn.protocol ? `${dsn.protocol}:` : '';\n const port = dsn.port ? `:${dsn.port}` : '';\n return `${protocol}//${dsn.host}${port}${dsn.path ? `/${dsn.path}` : ''}/api/`;\n}\n\n/** Returns the ingest API endpoint for target. */\nfunction _getIngestEndpoint(dsn) {\n return `${getBaseApiEndpoint(dsn)}${dsn.projectId}/envelope/`;\n}\n\n/** Returns a URL-encoded string with auth config suitable for a query string. */\nfunction _encodedAuth(dsn, sdkInfo) {\n return urlEncode({\n // We send only the minimum set of required information. See\n // https://github.com/getsentry/sentry-javascript/issues/2572.\n sentry_key: dsn.publicKey,\n sentry_version: SENTRY_API_VERSION,\n ...(sdkInfo && { sentry_client: `${sdkInfo.name}/${sdkInfo.version}` }),\n });\n}\n\n/**\n * Returns the envelope endpoint URL with auth in the query string.\n *\n * Sending auth as part of the query string and not as custom HTTP headers avoids CORS preflight requests.\n */\nfunction getEnvelopeEndpointWithUrlEncodedAuth(\n dsn,\n // TODO (v8): Remove `tunnelOrOptions` in favor of `options`, and use the substitute code below\n // options: ClientOptions = {} as ClientOptions,\n tunnelOrOptions = {} ,\n) {\n // TODO (v8): Use this code instead\n // const { tunnel, _metadata = {} } = options;\n // return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, _metadata.sdk)}`;\n\n const tunnel = typeof tunnelOrOptions === 'string' ? tunnelOrOptions : tunnelOrOptions.tunnel;\n const sdkInfo =\n typeof tunnelOrOptions === 'string' || !tunnelOrOptions._metadata ? undefined : tunnelOrOptions._metadata.sdk;\n\n return tunnel ? tunnel : `${_getIngestEndpoint(dsn)}?${_encodedAuth(dsn, sdkInfo)}`;\n}\n\n/** Returns the url to the report dialog endpoint. */\nfunction getReportDialogEndpoint(\n dsnLike,\n dialogOptions\n\n,\n) {\n const dsn = makeDsn(dsnLike);\n if (!dsn) {\n return '';\n }\n\n const endpoint = `${getBaseApiEndpoint(dsn)}embed/error-page/`;\n\n let encodedOptions = `dsn=${dsnToString(dsn)}`;\n for (const key in dialogOptions) {\n if (key === 'dsn') {\n continue;\n }\n\n if (key === 'onClose') {\n continue;\n }\n\n if (key === 'user') {\n const user = dialogOptions.user;\n if (!user) {\n continue;\n }\n if (user.name) {\n encodedOptions += `&name=${encodeURIComponent(user.name)}`;\n }\n if (user.email) {\n encodedOptions += `&email=${encodeURIComponent(user.email)}`;\n }\n } else {\n encodedOptions += `&${encodeURIComponent(key)}=${encodeURIComponent(dialogOptions[key] )}`;\n }\n }\n\n return `${endpoint}?${encodedOptions}`;\n}\n\nexport { getEnvelopeEndpointWithUrlEncodedAuth, getReportDialogEndpoint };\n//# sourceMappingURL=api.js.map\n","import { arrayify, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { addGlobalEventProcessor } from './eventProcessors.js';\nimport { getClient } from './exports.js';\nimport { getCurrentHub } from './hub.js';\n\nconst installedIntegrations = [];\n\n/** Map of integrations assigned to a client */\n\n/**\n * Remove duplicates from the given array, preferring the last instance of any duplicate. Not guaranteed to\n * preseve the order of integrations in the array.\n *\n * @private\n */\nfunction filterDuplicates(integrations) {\n const integrationsByName = {};\n\n integrations.forEach(currentInstance => {\n const { name } = currentInstance;\n\n const existingInstance = integrationsByName[name];\n\n // We want integrations later in the array to overwrite earlier ones of the same type, except that we never want a\n // default instance to overwrite an existing user instance\n if (existingInstance && !existingInstance.isDefaultInstance && currentInstance.isDefaultInstance) {\n return;\n }\n\n integrationsByName[name] = currentInstance;\n });\n\n return Object.keys(integrationsByName).map(k => integrationsByName[k]);\n}\n\n/** Gets integrations to install */\nfunction getIntegrationsToSetup(options) {\n const defaultIntegrations = options.defaultIntegrations || [];\n const userIntegrations = options.integrations;\n\n // We flag default instances, so that later we can tell them apart from any user-created instances of the same class\n defaultIntegrations.forEach(integration => {\n integration.isDefaultInstance = true;\n });\n\n let integrations;\n\n if (Array.isArray(userIntegrations)) {\n integrations = [...defaultIntegrations, ...userIntegrations];\n } else if (typeof userIntegrations === 'function') {\n integrations = arrayify(userIntegrations(defaultIntegrations));\n } else {\n integrations = defaultIntegrations;\n }\n\n const finalIntegrations = filterDuplicates(integrations);\n\n // The `Debug` integration prints copies of the `event` and `hint` which will be passed to `beforeSend` or\n // `beforeSendTransaction`. It therefore has to run after all other integrations, so that the changes of all event\n // processors will be reflected in the printed values. For lack of a more elegant way to guarantee that, we therefore\n // locate it and, assuming it exists, pop it out of its current spot and shove it onto the end of the array.\n const debugIndex = findIndex(finalIntegrations, integration => integration.name === 'Debug');\n if (debugIndex !== -1) {\n const [debugInstance] = finalIntegrations.splice(debugIndex, 1);\n finalIntegrations.push(debugInstance);\n }\n\n return finalIntegrations;\n}\n\n/**\n * Given a list of integration instances this installs them all. When `withDefaults` is set to `true` then all default\n * integrations are added unless they were already provided before.\n * @param integrations array of integration instances\n * @param withDefault should enable default integrations\n */\nfunction setupIntegrations(client, integrations) {\n const integrationIndex = {};\n\n integrations.forEach(integration => {\n // guard against empty provided integrations\n if (integration) {\n setupIntegration(client, integration, integrationIndex);\n }\n });\n\n return integrationIndex;\n}\n\n/**\n * Execute the `afterAllSetup` hooks of the given integrations.\n */\nfunction afterSetupIntegrations(client, integrations) {\n for (const integration of integrations) {\n // guard against empty provided integrations\n if (integration && integration.afterAllSetup) {\n integration.afterAllSetup(client);\n }\n }\n}\n\n/** Setup a single integration. */\nfunction setupIntegration(client, integration, integrationIndex) {\n if (integrationIndex[integration.name]) {\n DEBUG_BUILD && logger.log(`Integration skipped because it was already installed: ${integration.name}`);\n return;\n }\n integrationIndex[integration.name] = integration;\n\n // `setupOnce` is only called the first time\n if (installedIntegrations.indexOf(integration.name) === -1) {\n // eslint-disable-next-line deprecation/deprecation\n integration.setupOnce(addGlobalEventProcessor, getCurrentHub);\n installedIntegrations.push(integration.name);\n }\n\n // `setup` is run for each client\n if (integration.setup && typeof integration.setup === 'function') {\n integration.setup(client);\n }\n\n if (client.on && typeof integration.preprocessEvent === 'function') {\n const callback = integration.preprocessEvent.bind(integration) ;\n client.on('preprocessEvent', (event, hint) => callback(event, hint, client));\n }\n\n if (client.addEventProcessor && typeof integration.processEvent === 'function') {\n const callback = integration.processEvent.bind(integration) ;\n\n const processor = Object.assign((event, hint) => callback(event, hint, client), {\n id: integration.name,\n });\n\n client.addEventProcessor(processor);\n }\n\n DEBUG_BUILD && logger.log(`Integration installed: ${integration.name}`);\n}\n\n/** Add an integration to the current hub's client. */\nfunction addIntegration(integration) {\n const client = getClient();\n\n if (!client || !client.addIntegration) {\n DEBUG_BUILD && logger.warn(`Cannot add integration \"${integration.name}\" because no SDK Client is available.`);\n return;\n }\n\n client.addIntegration(integration);\n}\n\n// Polyfill for Array.findIndex(), which is not supported in ES5\nfunction findIndex(arr, callback) {\n for (let i = 0; i < arr.length; i++) {\n if (callback(arr[i]) === true) {\n return i;\n }\n }\n\n return -1;\n}\n\n/**\n * Convert a new integration function to the legacy class syntax.\n * In v8, we can remove this and instead export the integration functions directly.\n *\n * @deprecated This will be removed in v8!\n */\nfunction convertIntegrationFnToClass(\n name,\n fn,\n) {\n return Object.assign(\n function ConvertedIntegration(...args) {\n return fn(...args);\n },\n { id: name },\n ) ;\n}\n\n/**\n * Define an integration function that can be used to create an integration instance.\n * Note that this by design hides the implementation details of the integration, as they are considered internal.\n */\nfunction defineIntegration(fn) {\n return fn;\n}\n\nexport { addIntegration, afterSetupIntegrations, convertIntegrationFnToClass, defineIntegration, getIntegrationsToSetup, installedIntegrations, setupIntegration, setupIntegrations };\n//# sourceMappingURL=integration.js.map\n","import { dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Generate bucket key from metric properties.\n */\nfunction getBucketKey(\n metricType,\n name,\n unit,\n tags,\n) {\n const stringifiedTags = Object.entries(dropUndefinedKeys(tags)).sort((a, b) => a[0].localeCompare(b[0]));\n return `${metricType}${name}${unit}${stringifiedTags}`;\n}\n\n/* eslint-disable no-bitwise */\n/**\n * Simple hash function for strings.\n */\nfunction simpleHash(s) {\n let rv = 0;\n for (let i = 0; i < s.length; i++) {\n const c = s.charCodeAt(i);\n rv = (rv << 5) - rv + c;\n rv &= rv;\n }\n return rv >>> 0;\n}\n/* eslint-enable no-bitwise */\n\n/**\n * Serialize metrics buckets into a string based on statsd format.\n *\n * Example of format:\n * metric.name@second:1:1.2|d|#a:value,b:anothervalue|T12345677\n * Segments:\n * name: metric.name\n * unit: second\n * value: [1, 1.2]\n * type of metric: d (distribution)\n * tags: { a: value, b: anothervalue }\n * timestamp: 12345677\n */\nfunction serializeMetricBuckets(metricBucketItems) {\n let out = '';\n for (const item of metricBucketItems) {\n const tagEntries = Object.entries(item.tags);\n const maybeTags = tagEntries.length > 0 ? `|#${tagEntries.map(([key, value]) => `${key}:${value}`).join(',')}` : '';\n out += `${item.name}@${item.unit}:${item.metric}|${item.metricType}${maybeTags}|T${item.timestamp}\\n`;\n }\n return out;\n}\n\n/** Sanitizes units */\nfunction sanitizeUnit(unit) {\n return unit.replace(/[^\\w]+/gi, '_');\n}\n\n/** Sanitizes metric keys */\nfunction sanitizeMetricKey(key) {\n return key.replace(/[^\\w\\-.]+/gi, '_');\n}\n\nfunction sanitizeTagKey(key) {\n return key.replace(/[^\\w\\-./]+/gi, '');\n}\n\nconst tagValueReplacements = [\n ['\\n', '\\\\n'],\n ['\\r', '\\\\r'],\n ['\\t', '\\\\t'],\n ['\\\\', '\\\\\\\\'],\n ['|', '\\\\u{7c}'],\n [',', '\\\\u{2c}'],\n];\n\nfunction getCharOrReplacement(input) {\n for (const [search, replacement] of tagValueReplacements) {\n if (input === search) {\n return replacement;\n }\n }\n\n return input;\n}\n\nfunction sanitizeTagValue(value) {\n return [...value].reduce((acc, char) => acc + getCharOrReplacement(char), '');\n}\n\n/**\n * Sanitizes tags.\n */\nfunction sanitizeTags(unsanitizedTags) {\n const tags = {};\n for (const key in unsanitizedTags) {\n if (Object.prototype.hasOwnProperty.call(unsanitizedTags, key)) {\n const sanitizedKey = sanitizeTagKey(key);\n tags[sanitizedKey] = sanitizeTagValue(String(unsanitizedTags[key]));\n }\n }\n return tags;\n}\n\nexport { getBucketKey, sanitizeMetricKey, sanitizeTags, sanitizeUnit, serializeMetricBuckets, simpleHash };\n//# sourceMappingURL=utils.js.map\n","import { dsnToString, createEnvelope } from '@sentry/utils';\nimport { serializeMetricBuckets } from './utils.js';\n\n/**\n * Create envelope from a metric aggregate.\n */\nfunction createMetricEnvelope(\n metricBucketItems,\n dsn,\n metadata,\n tunnel,\n) {\n const headers = {\n sent_at: new Date().toISOString(),\n };\n\n if (metadata && metadata.sdk) {\n headers.sdk = {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n };\n }\n\n if (!!tunnel && dsn) {\n headers.dsn = dsnToString(dsn);\n }\n\n const item = createMetricEnvelopeItem(metricBucketItems);\n return createEnvelope(headers, [item]);\n}\n\nfunction createMetricEnvelopeItem(metricBucketItems) {\n const payload = serializeMetricBuckets(metricBucketItems);\n const metricHeaders = {\n type: 'statsd',\n length: payload.length,\n };\n return [metricHeaders, payload];\n}\n\nexport { createMetricEnvelope };\n//# sourceMappingURL=envelope.js.map\n","import { makeDsn, logger, checkOrSetAlreadyCaught, isParameterizedString, isPrimitive, resolvedSyncPromise, addItemToEnvelope, createAttachmentEnvelopeItem, SyncPromise, rejectedSyncPromise, SentryError, isThenable, isPlainObject } from '@sentry/utils';\nimport { getEnvelopeEndpointWithUrlEncodedAuth } from './api.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { createEventEnvelope, createSessionEnvelope } from './envelope.js';\nimport { getClient } from './exports.js';\nimport { getIsolationScope } from './hub.js';\nimport { setupIntegration, afterSetupIntegrations, setupIntegrations } from './integration.js';\nimport { createMetricEnvelope } from './metrics/envelope.js';\nimport { updateSession } from './session.js';\nimport { getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext.js';\nimport { prepareEvent } from './utils/prepareEvent.js';\n\nconst ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient {\n * public constructor(options: NodeOptions) {\n * super(options);\n * }\n *\n * // ...\n * }\n */\nclass BaseClient {\n /**\n * A reference to a metrics aggregator\n *\n * @experimental Note this is alpha API. It may experience breaking changes in the future.\n */\n\n /** Options passed to the SDK. */\n\n /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n\n /** Array of set up integrations. */\n\n /** Indicates whether this client's integrations have been set up. */\n\n /** Number of calls being processed */\n\n /** Holds flushable */\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n\n /**\n * Initializes this client instance.\n *\n * @param options Options for the client.\n */\n constructor(options) {\n this._options = options;\n this._integrations = {};\n this._integrationsInitialized = false;\n this._numProcessing = 0;\n this._outcomes = {};\n this._hooks = {};\n this._eventProcessors = [];\n\n if (options.dsn) {\n this._dsn = makeDsn(options.dsn);\n } else {\n DEBUG_BUILD && logger.warn('No DSN provided, client will not send events.');\n }\n\n if (this._dsn) {\n const url = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);\n this._transport = options.transport({\n tunnel: this._options.tunnel,\n recordDroppedEvent: this.recordDroppedEvent.bind(this),\n ...options.transportOptions,\n url,\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n captureException(exception, hint, scope) {\n // ensure we haven't captured this very object before\n if (checkOrSetAlreadyCaught(exception)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n let eventId = hint && hint.event_id;\n\n this._process(\n this.eventFromException(exception, hint)\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n captureMessage(\n message,\n // eslint-disable-next-line deprecation/deprecation\n level,\n hint,\n scope,\n ) {\n let eventId = hint && hint.event_id;\n\n const eventMessage = isParameterizedString(message) ? message : String(message);\n\n const promisedEvent = isPrimitive(message)\n ? this.eventFromMessage(eventMessage, level, hint)\n : this.eventFromException(message, hint);\n\n this._process(\n promisedEvent\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n captureEvent(event, hint, scope) {\n // ensure we haven't captured this very object before\n if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n let eventId = hint && hint.event_id;\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope;\n\n this._process(\n this._captureEvent(event, hint, capturedSpanScope || scope).then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n captureSession(session) {\n if (!(typeof session.release === 'string')) {\n DEBUG_BUILD && logger.warn('Discarded session because of missing or non-string release');\n } else {\n this.sendSession(session);\n // After sending, we set init false to indicate it's not the first occurrence\n updateSession(session, { init: false });\n }\n }\n\n /**\n * @inheritDoc\n */\n getDsn() {\n return this._dsn;\n }\n\n /**\n * @inheritDoc\n */\n getOptions() {\n return this._options;\n }\n\n /**\n * @see SdkMetadata in @sentry/types\n *\n * @return The metadata of the SDK\n */\n getSdkMetadata() {\n return this._options._metadata;\n }\n\n /**\n * @inheritDoc\n */\n getTransport() {\n return this._transport;\n }\n\n /**\n * @inheritDoc\n */\n flush(timeout) {\n const transport = this._transport;\n if (transport) {\n if (this.metricsAggregator) {\n this.metricsAggregator.flush();\n }\n return this._isClientDoneProcessing(timeout).then(clientFinished => {\n return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed);\n });\n } else {\n return resolvedSyncPromise(true);\n }\n }\n\n /**\n * @inheritDoc\n */\n close(timeout) {\n return this.flush(timeout).then(result => {\n this.getOptions().enabled = false;\n if (this.metricsAggregator) {\n this.metricsAggregator.close();\n }\n return result;\n });\n }\n\n /** Get all installed event processors. */\n getEventProcessors() {\n return this._eventProcessors;\n }\n\n /** @inheritDoc */\n addEventProcessor(eventProcessor) {\n this._eventProcessors.push(eventProcessor);\n }\n\n /**\n * This is an internal function to setup all integrations that should run on the client.\n * @deprecated Use `client.init()` instead.\n */\n setupIntegrations(forceInitialize) {\n if ((forceInitialize && !this._integrationsInitialized) || (this._isEnabled() && !this._integrationsInitialized)) {\n this._setupIntegrations();\n }\n }\n\n /** @inheritdoc */\n init() {\n if (this._isEnabled()) {\n this._setupIntegrations();\n }\n }\n\n /**\n * Gets an installed integration by its `id`.\n *\n * @returns The installed integration or `undefined` if no integration with that `id` was installed.\n * @deprecated Use `getIntegrationByName()` instead.\n */\n getIntegrationById(integrationId) {\n return this.getIntegrationByName(integrationId);\n }\n\n /**\n * Gets an installed integration by its name.\n *\n * @returns The installed integration or `undefined` if no integration with that `name` was installed.\n */\n getIntegrationByName(integrationName) {\n return this._integrations[integrationName] ;\n }\n\n /**\n * Returns the client's instance of the given integration class, it any.\n * @deprecated Use `getIntegrationByName()` instead.\n */\n getIntegration(integration) {\n try {\n return (this._integrations[integration.id] ) || null;\n } catch (_oO) {\n DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);\n return null;\n }\n }\n\n /**\n * @inheritDoc\n */\n addIntegration(integration) {\n const isAlreadyInstalled = this._integrations[integration.name];\n\n // This hook takes care of only installing if not already installed\n setupIntegration(this, integration, this._integrations);\n // Here we need to check manually to make sure to not run this multiple times\n if (!isAlreadyInstalled) {\n afterSetupIntegrations(this, [integration]);\n }\n }\n\n /**\n * @inheritDoc\n */\n sendEvent(event, hint = {}) {\n this.emit('beforeSendEvent', event, hint);\n\n let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);\n\n for (const attachment of hint.attachments || []) {\n env = addItemToEnvelope(\n env,\n createAttachmentEnvelopeItem(\n attachment,\n this._options.transportOptions && this._options.transportOptions.textEncoder,\n ),\n );\n }\n\n const promise = this._sendEnvelope(env);\n if (promise) {\n promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null);\n }\n }\n\n /**\n * @inheritDoc\n */\n sendSession(session) {\n const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(env);\n }\n\n /**\n * @inheritDoc\n */\n recordDroppedEvent(reason, category, eventOrCount) {\n if (this._options.sendClientReports) {\n // TODO v9: We do not need the `event` passed as third argument anymore, and can possibly remove this overload\n // If event is passed as third argument, we assume this is a count of 1\n const count = typeof eventOrCount === 'number' ? eventOrCount : 1;\n\n // We want to track each category (error, transaction, session, replay_event) separately\n // but still keep the distinction between different type of outcomes.\n // We could use nested maps, but it's much easier to read and type this way.\n // A correct type for map-based implementation if we want to go that route\n // would be `Partial>>>`\n // With typescript 4.1 we could even use template literal types\n const key = `${reason}:${category}`;\n DEBUG_BUILD && logger.log(`Recording outcome: \"${key}\"${count > 1 ? ` (${count} times)` : ''}`);\n this._outcomes[key] = (this._outcomes[key] || 0) + count;\n }\n }\n\n /**\n * @inheritDoc\n */\n captureAggregateMetrics(metricBucketItems) {\n DEBUG_BUILD && logger.log(`Flushing aggregated metrics, number of metrics: ${metricBucketItems.length}`);\n const metricsEnvelope = createMetricEnvelope(\n metricBucketItems,\n this._dsn,\n this._options._metadata,\n this._options.tunnel,\n );\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(metricsEnvelope);\n }\n\n // Keep on() & emit() signatures in sync with types' client.ts interface\n /* eslint-disable @typescript-eslint/unified-signatures */\n\n /** @inheritdoc */\n\n /** @inheritdoc */\n on(hook, callback) {\n if (!this._hooks[hook]) {\n this._hooks[hook] = [];\n }\n\n // @ts-expect-error We assue the types are correct\n this._hooks[hook].push(callback);\n }\n\n /** @inheritdoc */\n\n /** @inheritdoc */\n emit(hook, ...rest) {\n if (this._hooks[hook]) {\n this._hooks[hook].forEach(callback => callback(...rest));\n }\n }\n\n /* eslint-enable @typescript-eslint/unified-signatures */\n\n /** Setup integrations for this client. */\n _setupIntegrations() {\n const { integrations } = this._options;\n this._integrations = setupIntegrations(this, integrations);\n afterSetupIntegrations(this, integrations);\n\n // TODO v8: We don't need this flag anymore\n this._integrationsInitialized = true;\n }\n\n /** Updates existing session based on the provided event */\n _updateSessionFromEvent(session, event) {\n let crashed = false;\n let errored = false;\n const exceptions = event.exception && event.exception.values;\n\n if (exceptions) {\n errored = true;\n\n for (const ex of exceptions) {\n const mechanism = ex.mechanism;\n if (mechanism && mechanism.handled === false) {\n crashed = true;\n break;\n }\n }\n }\n\n // A session is updated and that session update is sent in only one of the two following scenarios:\n // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update\n // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update\n const sessionNonTerminal = session.status === 'ok';\n const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);\n\n if (shouldUpdateAndSend) {\n updateSession(session, {\n ...(crashed && { status: 'crashed' }),\n errors: session.errors || Number(errored || crashed),\n });\n this.captureSession(session);\n }\n }\n\n /**\n * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying\n * \"no\" (resolving to `false`) in order to give the client a chance to potentially finish first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not\n * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and\n * `false` otherwise\n */\n _isClientDoneProcessing(timeout) {\n return new SyncPromise(resolve => {\n let ticked = 0;\n const tick = 1;\n\n const interval = setInterval(() => {\n if (this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n }\n\n /** Determines whether this SDK is enabled and a transport is present. */\n _isEnabled() {\n return this.getOptions().enabled !== false && this._transport !== undefined;\n }\n\n /**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n */\n _prepareEvent(\n event,\n hint,\n scope,\n isolationScope = getIsolationScope(),\n ) {\n const options = this.getOptions();\n const integrations = Object.keys(this._integrations);\n if (!hint.integrations && integrations.length > 0) {\n hint.integrations = integrations;\n }\n\n this.emit('preprocessEvent', event, hint);\n\n return prepareEvent(options, event, hint, scope, this, isolationScope).then(evt => {\n if (evt === null) {\n return evt;\n }\n\n const propagationContext = {\n ...isolationScope.getPropagationContext(),\n ...(scope ? scope.getPropagationContext() : undefined),\n };\n\n const trace = evt.contexts && evt.contexts.trace;\n if (!trace && propagationContext) {\n const { traceId: trace_id, spanId, parentSpanId, dsc } = propagationContext;\n evt.contexts = {\n trace: {\n trace_id,\n span_id: spanId,\n parent_span_id: parentSpanId,\n },\n ...evt.contexts,\n };\n\n const dynamicSamplingContext = dsc ? dsc : getDynamicSamplingContextFromClient(trace_id, this, scope);\n\n evt.sdkProcessingMetadata = {\n dynamicSamplingContext,\n ...evt.sdkProcessingMetadata,\n };\n }\n return evt;\n });\n }\n\n /**\n * Processes the event and logs an error in case of rejection\n * @param event\n * @param hint\n * @param scope\n */\n _captureEvent(event, hint = {}, scope) {\n return this._processEvent(event, hint, scope).then(\n finalEvent => {\n return finalEvent.event_id;\n },\n reason => {\n if (DEBUG_BUILD) {\n // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for\n // control flow, log just the message (no stack) as a log-level log.\n const sentryError = reason ;\n if (sentryError.logLevel === 'log') {\n logger.log(sentryError.message);\n } else {\n logger.warn(sentryError);\n }\n }\n return undefined;\n },\n );\n }\n\n /**\n * Processes an event (either error or message) and sends it to Sentry.\n *\n * This also adds breadcrumbs and context information to the event. However,\n * platform specific meta data (such as the User's IP address) must be added\n * by the SDK implementor.\n *\n *\n * @param event The event to send to Sentry.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n */\n _processEvent(event, hint, scope) {\n const options = this.getOptions();\n const { sampleRate } = options;\n\n const isTransaction = isTransactionEvent(event);\n const isError = isErrorEvent(event);\n const eventType = event.type || 'error';\n const beforeSendLabel = `before send for type \\`${eventType}\\``;\n\n // 1.0 === 100% events are sent\n // 0.0 === 0% events are sent\n // Sampling for transaction happens somewhere else\n if (isError && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n this.recordDroppedEvent('sample_rate', 'error', event);\n return rejectedSyncPromise(\n new SentryError(\n `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,\n 'log',\n ),\n );\n }\n\n const dataCategory = eventType === 'replay_event' ? 'replay' : eventType;\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope;\n\n return this._prepareEvent(event, hint, scope, capturedSpanIsolationScope)\n .then(prepared => {\n if (prepared === null) {\n this.recordDroppedEvent('event_processor', dataCategory, event);\n throw new SentryError('An event processor returned `null`, will not send event.', 'log');\n }\n\n const isInternalException = hint.data && (hint.data ).__sentry__ === true;\n if (isInternalException) {\n return prepared;\n }\n\n const result = processBeforeSend(options, prepared, hint);\n return _validateBeforeSendResult(result, beforeSendLabel);\n })\n .then(processedEvent => {\n if (processedEvent === null) {\n this.recordDroppedEvent('before_send', dataCategory, event);\n if (isTransaction) {\n const spans = event.spans || [];\n // the transaction itself counts as one span, plus all the child spans that are added\n const spanCount = 1 + spans.length;\n this.recordDroppedEvent('before_send', 'span', spanCount);\n }\n throw new SentryError(`${beforeSendLabel} returned \\`null\\`, will not send event.`, 'log');\n }\n\n const session = scope && scope.getSession();\n if (!isTransaction && session) {\n this._updateSessionFromEvent(session, processedEvent);\n }\n\n if (isTransaction) {\n const spanCountBefore =\n (processedEvent.sdkProcessingMetadata && processedEvent.sdkProcessingMetadata.spanCountBeforeProcessing) ||\n 0;\n const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0;\n\n const droppedSpanCount = spanCountBefore - spanCountAfter;\n if (droppedSpanCount > 0) {\n this.recordDroppedEvent('before_send', 'span', droppedSpanCount);\n }\n }\n\n // None of the Sentry built event processor will update transaction name,\n // so if the transaction name has been changed by an event processor, we know\n // it has to come from custom event processor added by a user\n const transactionInfo = processedEvent.transaction_info;\n if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {\n const source = 'custom';\n processedEvent.transaction_info = {\n ...transactionInfo,\n source,\n };\n }\n\n this.sendEvent(processedEvent, hint);\n return processedEvent;\n })\n .then(null, reason => {\n if (reason instanceof SentryError) {\n throw reason;\n }\n\n this.captureException(reason, {\n data: {\n __sentry__: true,\n },\n originalException: reason,\n });\n throw new SentryError(\n `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n );\n });\n }\n\n /**\n * Occupies the client with processing and event\n */\n _process(promise) {\n this._numProcessing++;\n void promise.then(\n value => {\n this._numProcessing--;\n return value;\n },\n reason => {\n this._numProcessing--;\n return reason;\n },\n );\n }\n\n /**\n * @inheritdoc\n */\n _sendEnvelope(envelope) {\n this.emit('beforeEnvelope', envelope);\n\n if (this._isEnabled() && this._transport) {\n return this._transport.send(envelope).then(null, reason => {\n DEBUG_BUILD && logger.error('Error while sending event:', reason);\n });\n } else {\n DEBUG_BUILD && logger.error('Transport disabled');\n }\n }\n\n /**\n * Clears outcomes on this client and returns them.\n */\n _clearOutcomes() {\n const outcomes = this._outcomes;\n this._outcomes = {};\n return Object.keys(outcomes).map(key => {\n const [reason, category] = key.split(':') ;\n return {\n reason,\n category,\n quantity: outcomes[key],\n };\n });\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n}\n\n/**\n * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so.\n */\nfunction _validateBeforeSendResult(\n beforeSendResult,\n beforeSendLabel,\n) {\n const invalidValueError = `${beforeSendLabel} must return \\`null\\` or a valid event.`;\n if (isThenable(beforeSendResult)) {\n return beforeSendResult.then(\n event => {\n if (!isPlainObject(event) && event !== null) {\n throw new SentryError(invalidValueError);\n }\n return event;\n },\n e => {\n throw new SentryError(`${beforeSendLabel} rejected with ${e}`);\n },\n );\n } else if (!isPlainObject(beforeSendResult) && beforeSendResult !== null) {\n throw new SentryError(invalidValueError);\n }\n return beforeSendResult;\n}\n\n/**\n * Process the matching `beforeSendXXX` callback.\n */\nfunction processBeforeSend(\n options,\n event,\n hint,\n) {\n const { beforeSend, beforeSendTransaction } = options;\n\n if (isErrorEvent(event) && beforeSend) {\n return beforeSend(event, hint);\n }\n\n if (isTransactionEvent(event) && beforeSendTransaction) {\n if (event.spans) {\n // We store the # of spans before processing in SDK metadata,\n // so we can compare it afterwards to determine how many spans were dropped\n const spanCountBefore = event.spans.length;\n event.sdkProcessingMetadata = {\n ...event.sdkProcessingMetadata,\n spanCountBeforeProcessing: spanCountBefore,\n };\n }\n return beforeSendTransaction(event, hint);\n }\n\n return event;\n}\n\nfunction isErrorEvent(event) {\n return event.type === undefined;\n}\n\nfunction isTransactionEvent(event) {\n return event.type === 'transaction';\n}\n\n/**\n * Add an event processor to the current client.\n * This event processor will run for all events processed by this client.\n */\nfunction addEventProcessor(callback) {\n const client = getClient();\n\n if (!client || !client.addEventProcessor) {\n return;\n }\n\n client.addEventProcessor(callback);\n}\n\nexport { BaseClient, addEventProcessor };\n//# sourceMappingURL=baseclient.js.map\n","import { logger, consoleSandbox } from '@sentry/utils';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { getCurrentScope } from './exports.js';\nimport { getCurrentHub } from './hub.js';\n\n/** A class object that can instantiate Client objects. */\n\n/**\n * Internal function to create a new SDK client instance. The client is\n * installed and then bound to the current scope.\n *\n * @param clientClass The client class to instantiate.\n * @param options Options to pass to the client.\n */\nfunction initAndBind(\n clientClass,\n options,\n) {\n if (options.debug === true) {\n if (DEBUG_BUILD) {\n logger.enable();\n } else {\n // use `console.warn` rather than `logger.warn` since by non-debug bundles have all `logger.x` statements stripped\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.');\n });\n }\n }\n const scope = getCurrentScope();\n scope.update(options.initialScope);\n\n const client = new clientClass(options);\n setCurrentClient(client);\n initializeClient(client);\n}\n\n/**\n * Make the given client the current client.\n */\nfunction setCurrentClient(client) {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n // eslint-disable-next-line deprecation/deprecation\n const top = hub.getStackTop();\n top.client = client;\n top.scope.setClient(client);\n}\n\n/**\n * Initialize the client for the current scope.\n * Make sure to call this after `setCurrentClient()`.\n */\nfunction initializeClient(client) {\n if (client.init) {\n client.init();\n // TODO v8: Remove this fallback\n // eslint-disable-next-line deprecation/deprecation\n } else if (client.setupIntegrations) {\n // eslint-disable-next-line deprecation/deprecation\n client.setupIntegrations();\n }\n}\n\nexport { initAndBind, setCurrentClient };\n//# sourceMappingURL=sdk.js.map\n","import { makePromiseBuffer, forEachEnvelopeItem, envelopeItemTypeToDataCategory, isRateLimited, resolvedSyncPromise, createEnvelope, SentryError, logger, serializeEnvelope, updateRateLimits } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\n\nconst DEFAULT_TRANSPORT_BUFFER_SIZE = 30;\n\n/**\n * Creates an instance of a Sentry `Transport`\n *\n * @param options\n * @param makeRequest\n */\nfunction createTransport(\n options,\n makeRequest,\n buffer = makePromiseBuffer(\n options.bufferSize || DEFAULT_TRANSPORT_BUFFER_SIZE,\n ),\n) {\n let rateLimits = {};\n const flush = (timeout) => buffer.drain(timeout);\n\n function send(envelope) {\n const filteredEnvelopeItems = [];\n\n // Drop rate limited items from envelope\n forEachEnvelopeItem(envelope, (item, type) => {\n const dataCategory = envelopeItemTypeToDataCategory(type);\n if (isRateLimited(rateLimits, dataCategory)) {\n const event = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent('ratelimit_backoff', dataCategory, event);\n } else {\n filteredEnvelopeItems.push(item);\n }\n });\n\n // Skip sending if envelope is empty after filtering out rate limited events\n if (filteredEnvelopeItems.length === 0) {\n return resolvedSyncPromise();\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const filteredEnvelope = createEnvelope(envelope[0], filteredEnvelopeItems );\n\n // Creates client report for each item in an envelope\n const recordEnvelopeLoss = (reason) => {\n forEachEnvelopeItem(filteredEnvelope, (item, type) => {\n const event = getEventForEnvelopeItem(item, type);\n options.recordDroppedEvent(reason, envelopeItemTypeToDataCategory(type), event);\n });\n };\n\n const requestTask = () =>\n makeRequest({ body: serializeEnvelope(filteredEnvelope, options.textEncoder) }).then(\n response => {\n // We don't want to throw on NOK responses, but we want to at least log them\n if (response.statusCode !== undefined && (response.statusCode < 200 || response.statusCode >= 300)) {\n DEBUG_BUILD && logger.warn(`Sentry responded with status code ${response.statusCode} to sent event.`);\n }\n\n rateLimits = updateRateLimits(rateLimits, response);\n return response;\n },\n error => {\n recordEnvelopeLoss('network_error');\n throw error;\n },\n );\n\n return buffer.add(requestTask).then(\n result => result,\n error => {\n if (error instanceof SentryError) {\n DEBUG_BUILD && logger.error('Skipped sending event because buffer is full.');\n recordEnvelopeLoss('queue_overflow');\n return resolvedSyncPromise();\n } else {\n throw error;\n }\n },\n );\n }\n\n // We use this to identifify if the transport is the base transport\n // TODO (v8): Remove this again as we'll no longer need it\n send.__sentry__baseTransport__ = true;\n\n return {\n send,\n flush,\n };\n}\n\nfunction getEventForEnvelopeItem(item, type) {\n if (type !== 'event' && type !== 'transaction') {\n return undefined;\n }\n\n return Array.isArray(item) ? (item )[1] : undefined;\n}\n\nexport { DEFAULT_TRANSPORT_BUFFER_SIZE, createTransport };\n//# sourceMappingURL=base.js.map\n","import { SDK_VERSION } from '../version.js';\n\n/**\n * A builder for the SDK metadata in the options for the SDK initialization.\n *\n * Note: This function is identical to `buildMetadata` in Remix and NextJS and SvelteKit.\n * We don't extract it for bundle size reasons.\n * @see https://github.com/getsentry/sentry-javascript/pull/7404\n * @see https://github.com/getsentry/sentry-javascript/pull/4196\n *\n * If you make changes to this function consider updating the others as well.\n *\n * @param options SDK options object that gets mutated\n * @param names list of package names\n */\nfunction applySdkMetadata(options, name, names = [name], source = 'npm') {\n const metadata = options._metadata || {};\n\n if (!metadata.sdk) {\n metadata.sdk = {\n name: `sentry.javascript.${name}`,\n packages: names.map(name => ({\n name: `${source}:@sentry/${name}`,\n version: SDK_VERSION,\n })),\n version: SDK_VERSION,\n };\n }\n\n options._metadata = metadata;\n}\n\nexport { applySdkMetadata };\n//# sourceMappingURL=sdkMetadata.js.map\n","import { logger, getEventDescription, stringMatchesSomePattern } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { convertIntegrationFnToClass, defineIntegration } from '../integration.js';\n\n// \"Script error.\" is hard coded into browsers for errors that it can't read.\n// this is the result of a script being pulled in from an external domain and CORS.\nconst DEFAULT_IGNORE_ERRORS = [\n /^Script error\\.?$/,\n /^Javascript error: Script error\\.? on line 0$/,\n /^ResizeObserver loop completed with undelivered notifications.$/,\n /^Cannot redefine property: googletag$/,\n];\n\nconst DEFAULT_IGNORE_TRANSACTIONS = [\n /^.*\\/healthcheck$/,\n /^.*\\/healthy$/,\n /^.*\\/live$/,\n /^.*\\/ready$/,\n /^.*\\/heartbeat$/,\n /^.*\\/health$/,\n /^.*\\/healthz$/,\n];\n\n/** Options for the InboundFilters integration */\n\nconst INTEGRATION_NAME = 'InboundFilters';\nconst _inboundFiltersIntegration = ((options = {}) => {\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(event, _hint, client) {\n const clientOptions = client.getOptions();\n const mergedOptions = _mergeOptions(options, clientOptions);\n return _shouldDropEvent(event, mergedOptions) ? null : event;\n },\n };\n}) ;\n\nconst inboundFiltersIntegration = defineIntegration(_inboundFiltersIntegration);\n\n/**\n * Inbound filters configurable by the user.\n * @deprecated Use `inboundFiltersIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst InboundFilters = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n inboundFiltersIntegration,\n)\n\n;\n\nfunction _mergeOptions(\n internalOptions = {},\n clientOptions = {},\n) {\n return {\n allowUrls: [...(internalOptions.allowUrls || []), ...(clientOptions.allowUrls || [])],\n denyUrls: [...(internalOptions.denyUrls || []), ...(clientOptions.denyUrls || [])],\n ignoreErrors: [\n ...(internalOptions.ignoreErrors || []),\n ...(clientOptions.ignoreErrors || []),\n ...(internalOptions.disableErrorDefaults ? [] : DEFAULT_IGNORE_ERRORS),\n ],\n ignoreTransactions: [\n ...(internalOptions.ignoreTransactions || []),\n ...(clientOptions.ignoreTransactions || []),\n ...(internalOptions.disableTransactionDefaults ? [] : DEFAULT_IGNORE_TRANSACTIONS),\n ],\n ignoreInternal: internalOptions.ignoreInternal !== undefined ? internalOptions.ignoreInternal : true,\n };\n}\n\nfunction _shouldDropEvent(event, options) {\n if (options.ignoreInternal && _isSentryError(event)) {\n DEBUG_BUILD &&\n logger.warn(`Event dropped due to being internal Sentry Error.\\nEvent: ${getEventDescription(event)}`);\n return true;\n }\n if (_isIgnoredError(event, options.ignoreErrors)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`ignoreErrors\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (_isIgnoredTransaction(event, options.ignoreTransactions)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`ignoreTransactions\\` option.\\nEvent: ${getEventDescription(event)}`,\n );\n return true;\n }\n if (_isDeniedUrl(event, options.denyUrls)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to being matched by \\`denyUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n );\n return true;\n }\n if (!_isAllowedUrl(event, options.allowUrls)) {\n DEBUG_BUILD &&\n logger.warn(\n `Event dropped due to not being matched by \\`allowUrls\\` option.\\nEvent: ${getEventDescription(\n event,\n )}.\\nUrl: ${_getEventFilterUrl(event)}`,\n );\n return true;\n }\n return false;\n}\n\nfunction _isIgnoredError(event, ignoreErrors) {\n // If event.type, this is not an error\n if (event.type || !ignoreErrors || !ignoreErrors.length) {\n return false;\n }\n\n return _getPossibleEventMessages(event).some(message => stringMatchesSomePattern(message, ignoreErrors));\n}\n\nfunction _isIgnoredTransaction(event, ignoreTransactions) {\n if (event.type !== 'transaction' || !ignoreTransactions || !ignoreTransactions.length) {\n return false;\n }\n\n const name = event.transaction;\n return name ? stringMatchesSomePattern(name, ignoreTransactions) : false;\n}\n\nfunction _isDeniedUrl(event, denyUrls) {\n // TODO: Use Glob instead?\n if (!denyUrls || !denyUrls.length) {\n return false;\n }\n const url = _getEventFilterUrl(event);\n return !url ? false : stringMatchesSomePattern(url, denyUrls);\n}\n\nfunction _isAllowedUrl(event, allowUrls) {\n // TODO: Use Glob instead?\n if (!allowUrls || !allowUrls.length) {\n return true;\n }\n const url = _getEventFilterUrl(event);\n return !url ? true : stringMatchesSomePattern(url, allowUrls);\n}\n\nfunction _getPossibleEventMessages(event) {\n const possibleMessages = [];\n\n if (event.message) {\n possibleMessages.push(event.message);\n }\n\n let lastException;\n try {\n // @ts-expect-error Try catching to save bundle size\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n lastException = event.exception.values[event.exception.values.length - 1];\n } catch (e) {\n // try catching to save bundle size checking existence of variables\n }\n\n if (lastException) {\n if (lastException.value) {\n possibleMessages.push(lastException.value);\n if (lastException.type) {\n possibleMessages.push(`${lastException.type}: ${lastException.value}`);\n }\n }\n }\n\n if (DEBUG_BUILD && possibleMessages.length === 0) {\n logger.error(`Could not extract message for event ${getEventDescription(event)}`);\n }\n\n return possibleMessages;\n}\n\nfunction _isSentryError(event) {\n try {\n // @ts-expect-error can't be a sentry error if undefined\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return event.exception.values[0].type === 'SentryError';\n } catch (e) {\n // ignore\n }\n return false;\n}\n\nfunction _getLastValidUrl(frames = []) {\n for (let i = frames.length - 1; i >= 0; i--) {\n const frame = frames[i];\n\n if (frame && frame.filename !== '' && frame.filename !== '[native code]') {\n return frame.filename || null;\n }\n }\n\n return null;\n}\n\nfunction _getEventFilterUrl(event) {\n try {\n let frames;\n try {\n // @ts-expect-error we only care about frames if the whole thing here is defined\n frames = event.exception.values[0].stacktrace.frames;\n } catch (e) {\n // ignore\n }\n return frames ? _getLastValidUrl(frames) : null;\n } catch (oO) {\n DEBUG_BUILD && logger.error(`Cannot extract url for event ${getEventDescription(event)}`);\n return null;\n }\n}\n\nexport { InboundFilters, inboundFiltersIntegration };\n//# sourceMappingURL=inboundfilters.js.map\n","import { getOriginalFunction } from '@sentry/utils';\nimport { getClient } from '../exports.js';\nimport { convertIntegrationFnToClass, defineIntegration } from '../integration.js';\n\nlet originalFunctionToString;\n\nconst INTEGRATION_NAME = 'FunctionToString';\n\nconst SETUP_CLIENTS = new WeakMap();\n\nconst _functionToStringIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n // eslint-disable-next-line @typescript-eslint/unbound-method\n originalFunctionToString = Function.prototype.toString;\n\n // intrinsics (like Function.prototype) might be immutable in some environments\n // e.g. Node with --frozen-intrinsics, XS (an embedded JavaScript engine) or SES (a JavaScript proposal)\n try {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n Function.prototype.toString = function ( ...args) {\n const originalFunction = getOriginalFunction(this);\n const context =\n SETUP_CLIENTS.has(getClient() ) && originalFunction !== undefined ? originalFunction : this;\n return originalFunctionToString.apply(context, args);\n };\n } catch (e) {\n // ignore errors here, just don't patch this\n }\n },\n setup(client) {\n SETUP_CLIENTS.set(client, true);\n },\n };\n}) ;\n\n/**\n * Patch toString calls to return proper name for wrapped functions.\n *\n * ```js\n * Sentry.init({\n * integrations: [\n * functionToStringIntegration(),\n * ],\n * });\n * ```\n */\nconst functionToStringIntegration = defineIntegration(_functionToStringIntegration);\n\n/**\n * Patch toString calls to return proper name for wrapped functions.\n *\n * @deprecated Use `functionToStringIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst FunctionToString = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n functionToStringIntegration,\n) ;\n\n// eslint-disable-next-line deprecation/deprecation\n\nexport { FunctionToString, functionToStringIntegration };\n//# sourceMappingURL=functiontostring.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { GLOBAL_OBJ } from '@sentry/utils';\n\nconst WINDOW = GLOBAL_OBJ\n\n;\n\nexport { WINDOW };\n//# sourceMappingURL=types.js.map\n","const bindReporter = (\n callback,\n metric,\n reportAllChanges,\n) => {\n let prevValue;\n let delta;\n return (forceReport) => {\n if (metric.value >= 0) {\n if (forceReport || reportAllChanges) {\n delta = metric.value - (prevValue || 0);\n\n // Report the metric if there's a non-zero delta or if no previous\n // value exists (which can happen in the case of the document becoming\n // hidden when the metric value is 0).\n // See: https://github.com/GoogleChrome/web-vitals/issues/14\n if (delta || prevValue === undefined) {\n prevValue = metric.value;\n metric.delta = delta;\n callback(metric);\n }\n }\n }\n };\n};\n\nexport { bindReporter };\n//# sourceMappingURL=bindReporter.js.map\n","/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Performantly generate a unique, 30-char string by combining a version\n * number, the current timestamp with a 13-digit number integer.\n * @return {string}\n */\nconst generateUniqueID = () => {\n return `v3-${Date.now()}-${Math.floor(Math.random() * (9e12 - 1)) + 1e12}`;\n};\n\nexport { generateUniqueID };\n//# sourceMappingURL=generateUniqueID.js.map\n","import { WINDOW } from '../../types.js';\n\n/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst getNavigationEntryFromPerformanceTiming = () => {\n // eslint-disable-next-line deprecation/deprecation\n const timing = WINDOW.performance.timing;\n // eslint-disable-next-line deprecation/deprecation\n const type = WINDOW.performance.navigation.type;\n\n const navigationEntry = {\n entryType: 'navigation',\n startTime: 0,\n type: type == 2 ? 'back_forward' : type === 1 ? 'reload' : 'navigate',\n };\n\n for (const key in timing) {\n if (key !== 'navigationStart' && key !== 'toJSON') {\n // eslint-disable-next-line deprecation/deprecation\n navigationEntry[key] = Math.max((timing[key ] ) - timing.navigationStart, 0);\n }\n }\n return navigationEntry ;\n};\n\nconst getNavigationEntry = () => {\n if (WINDOW.__WEB_VITALS_POLYFILL__) {\n return (\n WINDOW.performance &&\n ((performance.getEntriesByType && performance.getEntriesByType('navigation')[0]) ||\n getNavigationEntryFromPerformanceTiming())\n );\n } else {\n return WINDOW.performance && performance.getEntriesByType && performance.getEntriesByType('navigation')[0];\n }\n};\n\nexport { getNavigationEntry };\n//# sourceMappingURL=getNavigationEntry.js.map\n","import { getNavigationEntry } from './getNavigationEntry.js';\n\n/*\n * Copyright 2022 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst getActivationStart = () => {\n const navEntry = getNavigationEntry();\n return (navEntry && navEntry.activationStart) || 0;\n};\n\nexport { getActivationStart };\n//# sourceMappingURL=getActivationStart.js.map\n","import { WINDOW } from '../../types.js';\nimport { generateUniqueID } from './generateUniqueID.js';\nimport { getActivationStart } from './getActivationStart.js';\nimport { getNavigationEntry } from './getNavigationEntry.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst initMetric = (name, value) => {\n const navEntry = getNavigationEntry();\n let navigationType = 'navigate';\n\n if (navEntry) {\n if ((WINDOW.document && WINDOW.document.prerendering) || getActivationStart() > 0) {\n navigationType = 'prerender';\n } else {\n navigationType = navEntry.type.replace(/_/g, '-') ;\n }\n }\n\n return {\n name,\n value: typeof value === 'undefined' ? -1 : value,\n rating: 'good', // Will be updated if the value changes.\n delta: 0,\n entries: [],\n id: generateUniqueID(),\n navigationType,\n };\n};\n\nexport { initMetric };\n//# sourceMappingURL=initMetric.js.map\n","/**\n * Takes a performance entry type and a callback function, and creates a\n * `PerformanceObserver` instance that will observe the specified entry type\n * with buffering enabled and call the callback _for each entry_.\n *\n * This function also feature-detects entry support and wraps the logic in a\n * try/catch to avoid errors in unsupporting browsers.\n */\nconst observe = (\n type,\n callback,\n opts,\n) => {\n try {\n if (PerformanceObserver.supportedEntryTypes.includes(type)) {\n const po = new PerformanceObserver(list => {\n callback(list.getEntries() );\n });\n po.observe(\n Object.assign(\n {\n type,\n buffered: true,\n },\n opts || {},\n ) ,\n );\n return po;\n }\n } catch (e) {\n // Do nothing.\n }\n return;\n};\n\nexport { observe };\n//# sourceMappingURL=observe.js.map\n","import { WINDOW } from '../../types.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst onHidden = (cb, once) => {\n const onHiddenOrPageHide = (event) => {\n if (event.type === 'pagehide' || WINDOW.document.visibilityState === 'hidden') {\n cb(event);\n if (once) {\n removeEventListener('visibilitychange', onHiddenOrPageHide, true);\n removeEventListener('pagehide', onHiddenOrPageHide, true);\n }\n }\n };\n\n if (WINDOW.document) {\n addEventListener('visibilitychange', onHiddenOrPageHide, true);\n // Some browsers have buggy implementations of visibilitychange,\n // so we use pagehide in addition, just to be safe.\n addEventListener('pagehide', onHiddenOrPageHide, true);\n }\n};\n\nexport { onHidden };\n//# sourceMappingURL=onHidden.js.map\n","import { WINDOW } from '../../types.js';\nimport { onHidden } from './onHidden.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nlet firstHiddenTime = -1;\n\nconst initHiddenTime = () => {\n // If the document is hidden and not prerendering, assume it was always\n // hidden and the page was loaded in the background.\n if (WINDOW.document && WINDOW.document.visibilityState) {\n firstHiddenTime = WINDOW.document.visibilityState === 'hidden' && !WINDOW.document.prerendering ? 0 : Infinity;\n }\n};\n\nconst trackChanges = () => {\n // Update the time if/when the document becomes hidden.\n onHidden(({ timeStamp }) => {\n firstHiddenTime = timeStamp;\n }, true);\n};\n\nconst getVisibilityWatcher = (\n\n) => {\n if (firstHiddenTime < 0) {\n // If the document is hidden when this code runs, assume it was hidden\n // since navigation start. This isn't a perfect heuristic, but it's the\n // best we can do until an API is available to support querying past\n // visibilityState.\n initHiddenTime();\n trackChanges();\n }\n return {\n get firstHiddenTime() {\n return firstHiddenTime;\n },\n };\n};\n\nexport { getVisibilityWatcher };\n//# sourceMappingURL=getVisibilityWatcher.js.map\n","import { WINDOW } from '../types.js';\nimport { bindReporter } from './lib/bindReporter.js';\nimport { getActivationStart } from './lib/getActivationStart.js';\nimport { getVisibilityWatcher } from './lib/getVisibilityWatcher.js';\nimport { initMetric } from './lib/initMetric.js';\nimport { observe } from './lib/observe.js';\nimport { onHidden } from './lib/onHidden.js';\n\n/*\n * Copyright 2020 Google LLC\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nconst reportedMetricIDs = {};\n\n/**\n * Calculates the [LCP](https://web.dev/lcp/) value for the current page and\n * calls the `callback` function once the value is ready (along with the\n * relevant `largest-contentful-paint` performance entry used to determine the\n * value). The reported value is a `DOMHighResTimeStamp`.\n */\nconst onLCP = (onReport) => {\n const visibilityWatcher = getVisibilityWatcher();\n const metric = initMetric('LCP');\n let report;\n\n const handleEntries = (entries) => {\n const lastEntry = entries[entries.length - 1] ;\n if (lastEntry) {\n // The startTime attribute returns the value of the renderTime if it is\n // not 0, and the value of the loadTime otherwise. The activationStart\n // reference is used because LCP should be relative to page activation\n // rather than navigation start if the page was prerendered.\n const value = Math.max(lastEntry.startTime - getActivationStart(), 0);\n\n // Only report if the page wasn't hidden prior to LCP.\n if (value < visibilityWatcher.firstHiddenTime) {\n metric.value = value;\n metric.entries = [lastEntry];\n report();\n }\n }\n };\n\n const po = observe('largest-contentful-paint', handleEntries);\n\n if (po) {\n report = bindReporter(onReport, metric);\n\n const stopListening = () => {\n if (!reportedMetricIDs[metric.id]) {\n handleEntries(po.takeRecords() );\n po.disconnect();\n reportedMetricIDs[metric.id] = true;\n report(true);\n }\n };\n\n // Stop listening after input. Note: while scrolling is an input that\n // stop LCP observation, it's unreliable since it can be programmatically\n // generated. See: https://github.com/GoogleChrome/web-vitals/issues/75\n ['keydown', 'click'].forEach(type => {\n if (WINDOW.document) {\n addEventListener(type, stopListening, { once: true, capture: true });\n }\n });\n\n onHidden(stopListening, true);\n\n return stopListening;\n }\n\n return;\n};\n\nexport { onLCP };\n//# sourceMappingURL=getLCP.js.map\n","import { logger, getFunctionName } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../common/debug-build.js';\nimport { onCLS } from './web-vitals/getCLS.js';\nimport { onFID } from './web-vitals/getFID.js';\nimport { onINP } from './web-vitals/getINP.js';\nimport { onLCP } from './web-vitals/getLCP.js';\nimport { observe } from './web-vitals/lib/observe.js';\nimport { onTTFB } from './web-vitals/onTTFB.js';\n\nconst handlers = {};\nconst instrumented = {};\n\nlet _previousCls;\nlet _previousFid;\nlet _previousLcp;\nlet _previousTtfb;\nlet _previousInp;\n\n/**\n * Add a callback that will be triggered when a CLS metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n *\n * Pass `stopOnCallback = true` to stop listening for CLS when the cleanup callback is called.\n * This will lead to the CLS being finalized and frozen.\n */\nfunction addClsInstrumentationHandler(\n callback,\n stopOnCallback = false,\n) {\n return addMetricObserver('cls', callback, instrumentCls, _previousCls, stopOnCallback);\n}\n\n/**\n * Add a callback that will be triggered when a LCP metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n *\n * Pass `stopOnCallback = true` to stop listening for LCP when the cleanup callback is called.\n * This will lead to the LCP being finalized and frozen.\n */\nfunction addLcpInstrumentationHandler(\n callback,\n stopOnCallback = false,\n) {\n return addMetricObserver('lcp', callback, instrumentLcp, _previousLcp, stopOnCallback);\n}\n\n/**\n * Add a callback that will be triggered when a FID metric is available.\n */\nfunction addTtfbInstrumentationHandler(callback) {\n return addMetricObserver('ttfb', callback, instrumentTtfb, _previousTtfb);\n}\n\n/**\n * Add a callback that will be triggered when a FID metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nfunction addFidInstrumentationHandler(callback) {\n return addMetricObserver('fid', callback, instrumentFid, _previousFid);\n}\n\n/**\n * Add a callback that will be triggered when a INP metric is available.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nfunction addInpInstrumentationHandler(\n callback,\n) {\n return addMetricObserver('inp', callback, instrumentInp, _previousInp);\n}\n\n/**\n * Add a callback that will be triggered when a performance observer is triggered,\n * and receives the entries of the observer.\n * Returns a cleanup callback which can be called to remove the instrumentation handler.\n */\nfunction addPerformanceInstrumentationHandler(\n type,\n callback,\n) {\n addHandler(type, callback);\n\n if (!instrumented[type]) {\n instrumentPerformanceObserver(type);\n instrumented[type] = true;\n }\n\n return getCleanupCallback(type, callback);\n}\n\n/** Trigger all handlers of a given type. */\nfunction triggerHandlers(type, data) {\n const typeHandlers = handlers[type];\n\n if (!typeHandlers || !typeHandlers.length) {\n return;\n }\n\n for (const handler of typeHandlers) {\n try {\n handler(data);\n } catch (e) {\n DEBUG_BUILD &&\n logger.error(\n `Error while triggering instrumentation handler.\\nType: ${type}\\nName: ${getFunctionName(handler)}\\nError:`,\n e,\n );\n }\n }\n}\n\nfunction instrumentCls() {\n return onCLS(\n metric => {\n triggerHandlers('cls', {\n metric,\n });\n _previousCls = metric;\n },\n { reportAllChanges: true },\n );\n}\n\nfunction instrumentFid() {\n return onFID(metric => {\n triggerHandlers('fid', {\n metric,\n });\n _previousFid = metric;\n });\n}\n\nfunction instrumentLcp() {\n return onLCP(metric => {\n triggerHandlers('lcp', {\n metric,\n });\n _previousLcp = metric;\n });\n}\n\nfunction instrumentTtfb() {\n return onTTFB(metric => {\n triggerHandlers('ttfb', {\n metric,\n });\n _previousTtfb = metric;\n });\n}\n\nfunction instrumentInp() {\n return onINP(metric => {\n triggerHandlers('inp', {\n metric,\n });\n _previousInp = metric;\n });\n}\n\nfunction addMetricObserver(\n type,\n callback,\n instrumentFn,\n previousValue,\n stopOnCallback = false,\n) {\n addHandler(type, callback);\n\n let stopListening;\n\n if (!instrumented[type]) {\n stopListening = instrumentFn();\n instrumented[type] = true;\n }\n\n if (previousValue) {\n callback({ metric: previousValue });\n }\n\n return getCleanupCallback(type, callback, stopOnCallback ? stopListening : undefined);\n}\n\nfunction instrumentPerformanceObserver(type) {\n const options = {};\n\n // Special per-type options we want to use\n if (type === 'event') {\n options.durationThreshold = 0;\n }\n\n observe(\n type,\n entries => {\n triggerHandlers(type, { entries });\n },\n options,\n );\n}\n\nfunction addHandler(type, handler) {\n handlers[type] = handlers[type] || [];\n (handlers[type] ).push(handler);\n}\n\n// Get a callback which can be called to remove the instrumentation handler\nfunction getCleanupCallback(\n type,\n callback,\n stopListening,\n) {\n return () => {\n if (stopListening) {\n stopListening();\n }\n\n const typeHandlers = handlers[type];\n\n if (!typeHandlers) {\n return;\n }\n\n const index = typeHandlers.indexOf(callback);\n if (index !== -1) {\n typeHandlers.splice(index, 1);\n }\n };\n}\n\nexport { addClsInstrumentationHandler, addFidInstrumentationHandler, addInpInstrumentationHandler, addLcpInstrumentationHandler, addPerformanceInstrumentationHandler, addTtfbInstrumentationHandler };\n//# sourceMappingURL=instrument.js.map\n","import '@sentry-internal/tracing';\nimport { withScope, captureException } from '@sentry/core';\nimport { GLOBAL_OBJ, getOriginalFunction, markFunctionWrapped, addNonEnumerableProperty, addExceptionTypeValue, addExceptionMechanism } from '@sentry/utils';\n\nconst WINDOW = GLOBAL_OBJ ;\n\nlet ignoreOnError = 0;\n\n/**\n * @hidden\n */\nfunction shouldIgnoreOnError() {\n return ignoreOnError > 0;\n}\n\n/**\n * @hidden\n */\nfunction ignoreNextOnError() {\n // onerror should trigger before setTimeout\n ignoreOnError++;\n setTimeout(() => {\n ignoreOnError--;\n });\n}\n\n/**\n * Instruments the given function and sends an event to Sentry every time the\n * function throws an exception.\n *\n * @param fn A function to wrap. It is generally safe to pass an unbound function, because the returned wrapper always\n * has a correct `this` context.\n * @returns The wrapped function.\n * @hidden\n */\nfunction wrap(\n fn,\n options\n\n = {},\n before,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n) {\n // for future readers what this does is wrap a function and then create\n // a bi-directional wrapping between them.\n //\n // example: wrapped = wrap(original);\n // original.__sentry_wrapped__ -> wrapped\n // wrapped.__sentry_original__ -> original\n\n if (typeof fn !== 'function') {\n return fn;\n }\n\n try {\n // if we're dealing with a function that was previously wrapped, return\n // the original wrapper.\n const wrapper = fn.__sentry_wrapped__;\n if (wrapper) {\n if (typeof wrapper === 'function') {\n return wrapper;\n } else {\n // If we find that the `__sentry_wrapped__` function is not a function at the time of accessing it, it means\n // that something messed with it. In that case we want to return the originally passed function.\n return fn;\n }\n }\n\n // We don't wanna wrap it twice\n if (getOriginalFunction(fn)) {\n return fn;\n }\n } catch (e) {\n // Just accessing custom props in some Selenium environments\n // can cause a \"Permission denied\" exception (see raven-js#495).\n // Bail on wrapping and return the function as-is (defers to window.onerror).\n return fn;\n }\n\n /* eslint-disable prefer-rest-params */\n // It is important that `sentryWrapped` is not an arrow function to preserve the context of `this`\n const sentryWrapped = function () {\n const args = Array.prototype.slice.call(arguments);\n\n try {\n if (before && typeof before === 'function') {\n before.apply(this, arguments);\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/no-unsafe-member-access\n const wrappedArguments = args.map((arg) => wrap(arg, options));\n\n // Attempt to invoke user-land function\n // NOTE: If you are a Sentry user, and you are seeing this stack frame, it\n // means the sentry.javascript SDK caught an error invoking your application code. This\n // is expected behavior and NOT indicative of a bug with sentry.javascript.\n return fn.apply(this, wrappedArguments);\n } catch (ex) {\n ignoreNextOnError();\n\n withScope(scope => {\n scope.addEventProcessor(event => {\n if (options.mechanism) {\n addExceptionTypeValue(event, undefined, undefined);\n addExceptionMechanism(event, options.mechanism);\n }\n\n event.extra = {\n ...event.extra,\n arguments: args,\n };\n\n return event;\n });\n\n captureException(ex);\n });\n\n throw ex;\n }\n };\n /* eslint-enable prefer-rest-params */\n\n // Accessing some objects may throw\n // ref: https://github.com/getsentry/sentry-javascript/issues/1168\n try {\n for (const property in fn) {\n if (Object.prototype.hasOwnProperty.call(fn, property)) {\n sentryWrapped[property] = fn[property];\n }\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n // Signal that this function has been wrapped/filled already\n // for both debugging and to prevent it to being wrapped/filled twice\n markFunctionWrapped(sentryWrapped, fn);\n\n addNonEnumerableProperty(fn, '__sentry_wrapped__', sentryWrapped);\n\n // Restore original function name (not all browsers allow that)\n try {\n const descriptor = Object.getOwnPropertyDescriptor(sentryWrapped, 'name') ;\n if (descriptor.configurable) {\n Object.defineProperty(sentryWrapped, 'name', {\n get() {\n return fn.name;\n },\n });\n }\n // eslint-disable-next-line no-empty\n } catch (_oO) {}\n\n return sentryWrapped;\n}\n\nexport { WINDOW, ignoreNextOnError, shouldIgnoreOnError, wrap };\n//# sourceMappingURL=helpers.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { getClient } from '@sentry/core';\nimport { addExceptionMechanism, resolvedSyncPromise, isErrorEvent, isDOMError, isDOMException, addExceptionTypeValue, isError, isPlainObject, isEvent, isParameterizedString, normalizeToSize, extractExceptionKeysForMessage } from '@sentry/utils';\n\n/**\n * This function creates an exception from a JavaScript Error\n */\nfunction exceptionFromError(stackParser, ex) {\n // Get the frames first since Opera can lose the stack if we touch anything else first\n const frames = parseStackFrames(stackParser, ex);\n\n const exception = {\n type: ex && ex.name,\n value: extractMessage(ex),\n };\n\n if (frames.length) {\n exception.stacktrace = { frames };\n }\n\n if (exception.type === undefined && exception.value === '') {\n exception.value = 'Unrecoverable error caught';\n }\n\n return exception;\n}\n\n/**\n * @hidden\n */\nfunction eventFromPlainObject(\n stackParser,\n exception,\n syntheticException,\n isUnhandledRejection,\n) {\n const client = getClient();\n const normalizeDepth = client && client.getOptions().normalizeDepth;\n\n const event = {\n exception: {\n values: [\n {\n type: isEvent(exception) ? exception.constructor.name : isUnhandledRejection ? 'UnhandledRejection' : 'Error',\n value: getNonErrorObjectExceptionValue(exception, { isUnhandledRejection }),\n },\n ],\n },\n extra: {\n __serialized__: normalizeToSize(exception, normalizeDepth),\n },\n };\n\n if (syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n // event.exception.values[0] has been set above\n (event.exception ).values[0].stacktrace = { frames };\n }\n }\n\n return event;\n}\n\n/**\n * @hidden\n */\nfunction eventFromError(stackParser, ex) {\n return {\n exception: {\n values: [exceptionFromError(stackParser, ex)],\n },\n };\n}\n\n/** Parses stack frames from an error */\nfunction parseStackFrames(\n stackParser,\n ex,\n) {\n // Access and store the stacktrace property before doing ANYTHING\n // else to it because Opera is not very good at providing it\n // reliably in other circumstances.\n const stacktrace = ex.stacktrace || ex.stack || '';\n\n const popSize = getPopSize(ex);\n\n try {\n return stackParser(stacktrace, popSize);\n } catch (e) {\n // no-empty\n }\n\n return [];\n}\n\n// Based on our own mapping pattern - https://github.com/getsentry/sentry/blob/9f08305e09866c8bd6d0c24f5b0aabdd7dd6c59c/src/sentry/lang/javascript/errormapping.py#L83-L108\nconst reactMinifiedRegexp = /Minified React error #\\d+;/i;\n\nfunction getPopSize(ex) {\n if (ex) {\n if (typeof ex.framesToPop === 'number') {\n return ex.framesToPop;\n }\n\n if (reactMinifiedRegexp.test(ex.message)) {\n return 1;\n }\n }\n\n return 0;\n}\n\n/**\n * There are cases where stacktrace.message is an Event object\n * https://github.com/getsentry/sentry-javascript/issues/1949\n * In this specific case we try to extract stacktrace.message.error.message\n */\nfunction extractMessage(ex) {\n const message = ex && ex.message;\n if (!message) {\n return 'No error message';\n }\n if (message.error && typeof message.error.message === 'string') {\n return message.error.message;\n }\n return message;\n}\n\n/**\n * Creates an {@link Event} from all inputs to `captureException` and non-primitive inputs to `captureMessage`.\n * @hidden\n */\nfunction eventFromException(\n stackParser,\n exception,\n hint,\n attachStacktrace,\n) {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromUnknownInput(stackParser, exception, syntheticException, attachStacktrace);\n addExceptionMechanism(event); // defaults to { type: 'generic', handled: true }\n event.level = 'error';\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * Builds and Event from a Message\n * @hidden\n */\nfunction eventFromMessage(\n stackParser,\n message,\n // eslint-disable-next-line deprecation/deprecation\n level = 'info',\n hint,\n attachStacktrace,\n) {\n const syntheticException = (hint && hint.syntheticException) || undefined;\n const event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n event.level = level;\n if (hint && hint.event_id) {\n event.event_id = hint.event_id;\n }\n return resolvedSyncPromise(event);\n}\n\n/**\n * @hidden\n */\nfunction eventFromUnknownInput(\n stackParser,\n exception,\n syntheticException,\n attachStacktrace,\n isUnhandledRejection,\n) {\n let event;\n\n if (isErrorEvent(exception ) && (exception ).error) {\n // If it is an ErrorEvent with `error` property, extract it to get actual Error\n const errorEvent = exception ;\n return eventFromError(stackParser, errorEvent.error );\n }\n\n // If it is a `DOMError` (which is a legacy API, but still supported in some browsers) then we just extract the name\n // and message, as it doesn't provide anything else. According to the spec, all `DOMExceptions` should also be\n // `Error`s, but that's not the case in IE11, so in that case we treat it the same as we do a `DOMError`.\n //\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMError\n // https://developer.mozilla.org/en-US/docs/Web/API/DOMException\n // https://webidl.spec.whatwg.org/#es-DOMException-specialness\n if (isDOMError(exception) || isDOMException(exception )) {\n const domException = exception ;\n\n if ('stack' in (exception )) {\n event = eventFromError(stackParser, exception );\n } else {\n const name = domException.name || (isDOMError(domException) ? 'DOMError' : 'DOMException');\n const message = domException.message ? `${name}: ${domException.message}` : name;\n event = eventFromString(stackParser, message, syntheticException, attachStacktrace);\n addExceptionTypeValue(event, message);\n }\n if ('code' in domException) {\n // eslint-disable-next-line deprecation/deprecation\n event.tags = { ...event.tags, 'DOMException.code': `${domException.code}` };\n }\n\n return event;\n }\n if (isError(exception)) {\n // we have a real Error object, do nothing\n return eventFromError(stackParser, exception);\n }\n if (isPlainObject(exception) || isEvent(exception)) {\n // If it's a plain object or an instance of `Event` (the built-in JS kind, not this SDK's `Event` type), serialize\n // it manually. This will allow us to group events based on top-level keys which is much better than creating a new\n // group on any key/value change.\n const objectException = exception ;\n event = eventFromPlainObject(stackParser, objectException, syntheticException, isUnhandledRejection);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n return event;\n }\n\n // If none of previous checks were valid, then it means that it's not:\n // - an instance of DOMError\n // - an instance of DOMException\n // - an instance of Event\n // - an instance of Error\n // - a valid ErrorEvent (one with an error property)\n // - a plain Object\n //\n // So bail out and capture it as a simple message:\n event = eventFromString(stackParser, exception , syntheticException, attachStacktrace);\n addExceptionTypeValue(event, `${exception}`, undefined);\n addExceptionMechanism(event, {\n synthetic: true,\n });\n\n return event;\n}\n\n/**\n * @hidden\n */\nfunction eventFromString(\n stackParser,\n message,\n syntheticException,\n attachStacktrace,\n) {\n const event = {};\n\n if (attachStacktrace && syntheticException) {\n const frames = parseStackFrames(stackParser, syntheticException);\n if (frames.length) {\n event.exception = {\n values: [{ value: message, stacktrace: { frames } }],\n };\n }\n }\n\n if (isParameterizedString(message)) {\n const { __sentry_template_string__, __sentry_template_values__ } = message;\n\n event.logentry = {\n message: __sentry_template_string__,\n params: __sentry_template_values__,\n };\n return event;\n }\n\n event.message = message;\n return event;\n}\n\nfunction getNonErrorObjectExceptionValue(\n exception,\n { isUnhandledRejection },\n) {\n const keys = extractExceptionKeysForMessage(exception);\n const captureType = isUnhandledRejection ? 'promise rejection' : 'exception';\n\n // Some ErrorEvent instances do not have an `error` property, which is why they are not handled before\n // We still want to try to get a decent message for these cases\n if (isErrorEvent(exception)) {\n return `Event \\`ErrorEvent\\` captured as ${captureType} with message \\`${exception.message}\\``;\n }\n\n if (isEvent(exception)) {\n const className = getObjectClassName(exception);\n return `Event \\`${className}\\` (type=${exception.type}) captured as ${captureType}`;\n }\n\n return `Object captured as ${captureType} with keys: ${keys}`;\n}\n\nfunction getObjectClassName(obj) {\n try {\n const prototype = Object.getPrototypeOf(obj);\n return prototype ? prototype.constructor.name : undefined;\n } catch (e) {\n // ignore errors here\n }\n}\n\nexport { eventFromError, eventFromException, eventFromMessage, eventFromPlainObject, eventFromString, eventFromUnknownInput, exceptionFromError, parseStackFrames };\n//# sourceMappingURL=eventbuilder.js.map\n","import { dsnToString, createEnvelope } from '@sentry/utils';\n\n/**\n * Creates an envelope from a user feedback.\n */\nfunction createUserFeedbackEnvelope(\n feedback,\n {\n metadata,\n tunnel,\n dsn,\n }\n\n,\n) {\n const headers = {\n event_id: feedback.event_id,\n sent_at: new Date().toISOString(),\n ...(metadata &&\n metadata.sdk && {\n sdk: {\n name: metadata.sdk.name,\n version: metadata.sdk.version,\n },\n }),\n ...(!!tunnel && !!dsn && { dsn: dsnToString(dsn) }),\n };\n const item = createUserFeedbackEnvelopeItem(feedback);\n\n return createEnvelope(headers, [item]);\n}\n\nfunction createUserFeedbackEnvelopeItem(feedback) {\n const feedbackHeaders = {\n type: 'user_report',\n };\n return [feedbackHeaders, feedback];\n}\n\nexport { createUserFeedbackEnvelope };\n//# sourceMappingURL=userfeedback.js.map\n","import { BaseClient, applySdkMetadata } from '@sentry/core';\nimport { getSDKSource, logger, createClientReportEnvelope, dsnToString } from '@sentry/utils';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { eventFromException, eventFromMessage } from './eventbuilder.js';\nimport { WINDOW } from './helpers.js';\nimport { createUserFeedbackEnvelope } from './userfeedback.js';\n\n/**\n * Configuration options for the Sentry Browser SDK.\n * @see @sentry/types Options for more information.\n */\n\n/**\n * The Sentry Browser SDK Client.\n *\n * @see BrowserOptions for documentation on configuration options.\n * @see SentryClient for usage documentation.\n */\nclass BrowserClient extends BaseClient {\n /**\n * Creates a new Browser SDK instance.\n *\n * @param options Configuration options for this SDK.\n */\n constructor(options) {\n const sdkSource = WINDOW.SENTRY_SDK_SOURCE || getSDKSource();\n applySdkMetadata(options, 'browser', ['browser'], sdkSource);\n\n super(options);\n\n if (options.sendClientReports && WINDOW.document) {\n WINDOW.document.addEventListener('visibilitychange', () => {\n if (WINDOW.document.visibilityState === 'hidden') {\n this._flushOutcomes();\n }\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n eventFromException(exception, hint) {\n return eventFromException(this._options.stackParser, exception, hint, this._options.attachStacktrace);\n }\n\n /**\n * @inheritDoc\n */\n eventFromMessage(\n message,\n // eslint-disable-next-line deprecation/deprecation\n level = 'info',\n hint,\n ) {\n return eventFromMessage(this._options.stackParser, message, level, hint, this._options.attachStacktrace);\n }\n\n /**\n * Sends user feedback to Sentry.\n */\n captureUserFeedback(feedback) {\n if (!this._isEnabled()) {\n DEBUG_BUILD && logger.warn('SDK not enabled, will not capture user feedback.');\n return;\n }\n\n const envelope = createUserFeedbackEnvelope(feedback, {\n metadata: this.getSdkMetadata(),\n dsn: this.getDsn(),\n tunnel: this.getOptions().tunnel,\n });\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(envelope);\n }\n\n /**\n * @inheritDoc\n */\n _prepareEvent(event, hint, scope) {\n event.platform = event.platform || 'javascript';\n return super._prepareEvent(event, hint, scope);\n }\n\n /**\n * Sends client reports as an envelope.\n */\n _flushOutcomes() {\n const outcomes = this._clearOutcomes();\n\n if (outcomes.length === 0) {\n DEBUG_BUILD && logger.log('No outcomes to send');\n return;\n }\n\n // This is really the only place where we want to check for a DSN and only send outcomes then\n if (!this._dsn) {\n DEBUG_BUILD && logger.log('No dsn provided, will not send outcomes');\n return;\n }\n\n DEBUG_BUILD && logger.log('Sending outcomes:', outcomes);\n\n const envelope = createClientReportEnvelope(outcomes, this._options.tunnel && dsnToString(this._dsn));\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(envelope);\n }\n}\n\nexport { BrowserClient };\n//# sourceMappingURL=client.js.map\n","import { isNativeFetch, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { WINDOW } from '../helpers.js';\n\nlet cachedFetchImpl = undefined;\n\n/**\n * A special usecase for incorrectly wrapped Fetch APIs in conjunction with ad-blockers.\n * Whenever someone wraps the Fetch API and returns the wrong promise chain,\n * this chain becomes orphaned and there is no possible way to capture it's rejections\n * other than allowing it bubble up to this very handler. eg.\n *\n * const f = window.fetch;\n * window.fetch = function () {\n * const p = f.apply(this, arguments);\n *\n * p.then(function() {\n * console.log('hi.');\n * });\n *\n * return p;\n * }\n *\n * `p.then(function () { ... })` is producing a completely separate promise chain,\n * however, what's returned is `p` - the result of original `fetch` call.\n *\n * This mean, that whenever we use the Fetch API to send our own requests, _and_\n * some ad-blocker blocks it, this orphaned chain will _always_ reject,\n * effectively causing another event to be captured.\n * This makes a whole process become an infinite loop, which we need to somehow\n * deal with, and break it in one way or another.\n *\n * To deal with this issue, we are making sure that we _always_ use the real\n * browser Fetch API, instead of relying on what `window.fetch` exposes.\n * The only downside to this would be missing our own requests as breadcrumbs,\n * but because we are already not doing this, it should be just fine.\n *\n * Possible failed fetch error messages per-browser:\n *\n * Chrome: Failed to fetch\n * Edge: Failed to Fetch\n * Firefox: NetworkError when attempting to fetch resource\n * Safari: resource blocked by content blocker\n */\nfunction getNativeFetchImplementation() {\n if (cachedFetchImpl) {\n return cachedFetchImpl;\n }\n\n /* eslint-disable @typescript-eslint/unbound-method */\n\n // Fast path to avoid DOM I/O\n if (isNativeFetch(WINDOW.fetch)) {\n return (cachedFetchImpl = WINDOW.fetch.bind(WINDOW));\n }\n\n const document = WINDOW.document;\n let fetchImpl = WINDOW.fetch;\n // eslint-disable-next-line deprecation/deprecation\n if (document && typeof document.createElement === 'function') {\n try {\n const sandbox = document.createElement('iframe');\n sandbox.hidden = true;\n document.head.appendChild(sandbox);\n const contentWindow = sandbox.contentWindow;\n if (contentWindow && contentWindow.fetch) {\n fetchImpl = contentWindow.fetch;\n }\n document.head.removeChild(sandbox);\n } catch (e) {\n DEBUG_BUILD && logger.warn('Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ', e);\n }\n }\n\n return (cachedFetchImpl = fetchImpl.bind(WINDOW));\n /* eslint-enable @typescript-eslint/unbound-method */\n}\n\n/** Clears cached fetch impl */\nfunction clearCachedFetchImplementation() {\n cachedFetchImpl = undefined;\n}\n\nexport { clearCachedFetchImplementation, getNativeFetchImplementation };\n//# sourceMappingURL=utils.js.map\n","import { createTransport } from '@sentry/core';\nimport { rejectedSyncPromise } from '@sentry/utils';\nimport { getNativeFetchImplementation, clearCachedFetchImplementation } from './utils.js';\n\n/**\n * Creates a Transport that uses the Fetch API to send events to Sentry.\n */\nfunction makeFetchTransport(\n options,\n nativeFetch = getNativeFetchImplementation(),\n) {\n let pendingBodySize = 0;\n let pendingCount = 0;\n\n function makeRequest(request) {\n const requestSize = request.body.length;\n pendingBodySize += requestSize;\n pendingCount++;\n\n const requestOptions = {\n body: request.body,\n method: 'POST',\n referrerPolicy: 'origin',\n headers: options.headers,\n // Outgoing requests are usually cancelled when navigating to a different page, causing a \"TypeError: Failed to\n // fetch\" error and sending a \"network_error\" client-outcome - in Chrome, the request status shows \"(cancelled)\".\n // The `keepalive` flag keeps outgoing requests alive, even when switching pages. We want this since we're\n // frequently sending events right before the user is switching pages (eg. whenfinishing navigation transactions).\n // Gotchas:\n // - `keepalive` isn't supported by Firefox\n // - As per spec (https://fetch.spec.whatwg.org/#http-network-or-cache-fetch):\n // If the sum of contentLength and inflightKeepaliveBytes is greater than 64 kibibytes, then return a network error.\n // We will therefore only activate the flag when we're below that limit.\n // There is also a limit of requests that can be open at the same time, so we also limit this to 15\n // See https://github.com/getsentry/sentry-javascript/pull/7553 for details\n keepalive: pendingBodySize <= 60000 && pendingCount < 15,\n ...options.fetchOptions,\n };\n\n try {\n return nativeFetch(options.url, requestOptions).then(response => {\n pendingBodySize -= requestSize;\n pendingCount--;\n return {\n statusCode: response.status,\n headers: {\n 'x-sentry-rate-limits': response.headers.get('X-Sentry-Rate-Limits'),\n 'retry-after': response.headers.get('Retry-After'),\n },\n };\n });\n } catch (e) {\n clearCachedFetchImplementation();\n pendingBodySize -= requestSize;\n pendingCount--;\n return rejectedSyncPromise(e);\n }\n }\n\n return createTransport(options, makeRequest);\n}\n\nexport { makeFetchTransport };\n//# sourceMappingURL=fetch.js.map\n","import { createTransport } from '@sentry/core';\nimport { SyncPromise } from '@sentry/utils';\n\n/**\n * The DONE ready state for XmlHttpRequest\n *\n * Defining it here as a constant b/c XMLHttpRequest.DONE is not always defined\n * (e.g. during testing, it is `undefined`)\n *\n * @see {@link https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/readyState}\n */\nconst XHR_READYSTATE_DONE = 4;\n\n/**\n * Creates a Transport that uses the XMLHttpRequest API to send events to Sentry.\n */\nfunction makeXHRTransport(options) {\n function makeRequest(request) {\n return new SyncPromise((resolve, reject) => {\n const xhr = new XMLHttpRequest();\n\n xhr.onerror = reject;\n\n xhr.onreadystatechange = () => {\n if (xhr.readyState === XHR_READYSTATE_DONE) {\n resolve({\n statusCode: xhr.status,\n headers: {\n 'x-sentry-rate-limits': xhr.getResponseHeader('X-Sentry-Rate-Limits'),\n 'retry-after': xhr.getResponseHeader('Retry-After'),\n },\n });\n }\n };\n\n xhr.open('POST', options.url);\n\n for (const header in options.headers) {\n if (Object.prototype.hasOwnProperty.call(options.headers, header)) {\n xhr.setRequestHeader(header, options.headers[header]);\n }\n }\n\n xhr.send(request.body);\n });\n }\n\n return createTransport(options, makeRequest);\n}\n\nexport { makeXHRTransport };\n//# sourceMappingURL=xhr.js.map\n","import { createStackParser } from '@sentry/utils';\n\n// global reference to slice\nconst UNKNOWN_FUNCTION = '?';\n\nconst OPERA10_PRIORITY = 10;\nconst OPERA11_PRIORITY = 20;\nconst CHROME_PRIORITY = 30;\nconst WINJS_PRIORITY = 40;\nconst GECKO_PRIORITY = 50;\n\nfunction createFrame(filename, func, lineno, colno) {\n const frame = {\n filename,\n function: func,\n in_app: true, // All browser frames are considered in_app\n };\n\n if (lineno !== undefined) {\n frame.lineno = lineno;\n }\n\n if (colno !== undefined) {\n frame.colno = colno;\n }\n\n return frame;\n}\n\n// Chromium based browsers: Chrome, Brave, new Opera, new Edge\nconst chromeRegex =\n /^\\s*at (?:(.+?\\)(?: \\[.+\\])?|.*?) ?\\((?:address at )?)?(?:async )?((?:|[-a-z]+:|.*bundle|\\/)?.*?)(?::(\\d+))?(?::(\\d+))?\\)?\\s*$/i;\nconst chromeEvalRegex = /\\((\\S*)(?::(\\d+))(?::(\\d+))\\)/;\n\n// We cannot call this variable `chrome` because it can conflict with global `chrome` variable in certain environments\n// See: https://github.com/getsentry/sentry-javascript/issues/6880\nconst chromeStackParserFn = line => {\n const parts = chromeRegex.exec(line);\n\n if (parts) {\n const isEval = parts[2] && parts[2].indexOf('eval') === 0; // start of line\n\n if (isEval) {\n const subMatch = chromeEvalRegex.exec(parts[2]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line/column number\n parts[2] = subMatch[1]; // url\n parts[3] = subMatch[2]; // line\n parts[4] = subMatch[3]; // column\n }\n }\n\n // Kamil: One more hack won't hurt us right? Understanding and adding more rules on top of these regexps right now\n // would be way too time consuming. (TODO: Rewrite whole RegExp to be more readable)\n const [func, filename] = extractSafariExtensionDetails(parts[1] || UNKNOWN_FUNCTION, parts[2]);\n\n return createFrame(filename, func, parts[3] ? +parts[3] : undefined, parts[4] ? +parts[4] : undefined);\n }\n\n return;\n};\n\nconst chromeStackLineParser = [CHROME_PRIORITY, chromeStackParserFn];\n\n// gecko regex: `(?:bundle|\\d+\\.js)`: `bundle` is for react native, `\\d+\\.js` also but specifically for ram bundles because it\n// generates filenames without a prefix like `file://` the filenames in the stacktrace are just 42.js\n// We need this specific case for now because we want no other regex to match.\nconst geckoREgex =\n /^\\s*(.*?)(?:\\((.*?)\\))?(?:^|@)?((?:[-a-z]+)?:\\/.*?|\\[native code\\]|[^@]*(?:bundle|\\d+\\.js)|\\/[\\w\\-. /=]+)(?::(\\d+))?(?::(\\d+))?\\s*$/i;\nconst geckoEvalRegex = /(\\S+) line (\\d+)(?: > eval line \\d+)* > eval/i;\n\nconst gecko = line => {\n const parts = geckoREgex.exec(line);\n\n if (parts) {\n const isEval = parts[3] && parts[3].indexOf(' > eval') > -1;\n if (isEval) {\n const subMatch = geckoEvalRegex.exec(parts[3]);\n\n if (subMatch) {\n // throw out eval line/column and use top-most line number\n parts[1] = parts[1] || 'eval';\n parts[3] = subMatch[1];\n parts[4] = subMatch[2];\n parts[5] = ''; // no column when eval\n }\n }\n\n let filename = parts[3];\n let func = parts[1] || UNKNOWN_FUNCTION;\n [func, filename] = extractSafariExtensionDetails(func, filename);\n\n return createFrame(filename, func, parts[4] ? +parts[4] : undefined, parts[5] ? +parts[5] : undefined);\n }\n\n return;\n};\n\nconst geckoStackLineParser = [GECKO_PRIORITY, gecko];\n\nconst winjsRegex = /^\\s*at (?:((?:\\[object object\\])?.+) )?\\(?((?:[-a-z]+):.*?):(\\d+)(?::(\\d+))?\\)?\\s*$/i;\n\nconst winjs = line => {\n const parts = winjsRegex.exec(line);\n\n return parts\n ? createFrame(parts[2], parts[1] || UNKNOWN_FUNCTION, +parts[3], parts[4] ? +parts[4] : undefined)\n : undefined;\n};\n\nconst winjsStackLineParser = [WINJS_PRIORITY, winjs];\n\nconst opera10Regex = / line (\\d+).*script (?:in )?(\\S+)(?:: in function (\\S+))?$/i;\n\nconst opera10 = line => {\n const parts = opera10Regex.exec(line);\n return parts ? createFrame(parts[2], parts[3] || UNKNOWN_FUNCTION, +parts[1]) : undefined;\n};\n\nconst opera10StackLineParser = [OPERA10_PRIORITY, opera10];\n\nconst opera11Regex =\n / line (\\d+), column (\\d+)\\s*(?:in (?:]+)>|([^)]+))\\(.*\\))? in (.*):\\s*$/i;\n\nconst opera11 = line => {\n const parts = opera11Regex.exec(line);\n return parts ? createFrame(parts[5], parts[3] || parts[4] || UNKNOWN_FUNCTION, +parts[1], +parts[2]) : undefined;\n};\n\nconst opera11StackLineParser = [OPERA11_PRIORITY, opera11];\n\nconst defaultStackLineParsers = [chromeStackLineParser, geckoStackLineParser, winjsStackLineParser];\n\nconst defaultStackParser = createStackParser(...defaultStackLineParsers);\n\n/**\n * Safari web extensions, starting version unknown, can produce \"frames-only\" stacktraces.\n * What it means, is that instead of format like:\n *\n * Error: wat\n * at function@url:row:col\n * at function@url:row:col\n * at function@url:row:col\n *\n * it produces something like:\n *\n * function@url:row:col\n * function@url:row:col\n * function@url:row:col\n *\n * Because of that, it won't be captured by `chrome` RegExp and will fall into `Gecko` branch.\n * This function is extracted so that we can use it in both places without duplicating the logic.\n * Unfortunately \"just\" changing RegExp is too complicated now and making it pass all tests\n * and fix this case seems like an impossible, or at least way too time-consuming task.\n */\nconst extractSafariExtensionDetails = (func, filename) => {\n const isSafariExtension = func.indexOf('safari-extension') !== -1;\n const isSafariWebExtension = func.indexOf('safari-web-extension') !== -1;\n\n return isSafariExtension || isSafariWebExtension\n ? [\n func.indexOf('@') !== -1 ? func.split('@')[0] : UNKNOWN_FUNCTION,\n isSafariExtension ? `safari-extension:${filename}` : `safari-web-extension:${filename}`,\n ]\n : [func, filename];\n};\n\nexport { chromeStackLineParser, defaultStackLineParsers, defaultStackParser, geckoStackLineParser, opera10StackLineParser, opera11StackLineParser, winjsStackLineParser };\n//# sourceMappingURL=stack-parsers.js.map\n","import { defineIntegration, convertIntegrationFnToClass, getClient, addBreadcrumb } from '@sentry/core';\nimport { addConsoleInstrumentationHandler, addClickKeypressInstrumentationHandler, addXhrInstrumentationHandler, addFetchInstrumentationHandler, addHistoryInstrumentationHandler, getEventDescription, logger, htmlTreeAsString, getComponentName, severityLevelFromString, safeJoin, SENTRY_XHR_DATA_KEY, parseUrl } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { WINDOW } from '../helpers.js';\n\n/* eslint-disable max-lines */\n\n/** maxStringLength gets capped to prevent 100 breadcrumbs exceeding 1MB event payload size */\nconst MAX_ALLOWED_STRING_LENGTH = 1024;\n\nconst INTEGRATION_NAME = 'Breadcrumbs';\n\nconst _breadcrumbsIntegration = ((options = {}) => {\n const _options = {\n console: true,\n dom: true,\n fetch: true,\n history: true,\n sentry: true,\n xhr: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n setup(client) {\n if (_options.console) {\n addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(client));\n }\n if (_options.dom) {\n addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(client, _options.dom));\n }\n if (_options.xhr) {\n addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(client));\n }\n if (_options.fetch) {\n addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(client));\n }\n if (_options.history) {\n addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(client));\n }\n if (_options.sentry && client.on) {\n client.on('beforeSendEvent', _getSentryBreadcrumbHandler(client));\n }\n },\n };\n}) ;\n\nconst breadcrumbsIntegration = defineIntegration(_breadcrumbsIntegration);\n\n/**\n * Default Breadcrumbs instrumentations\n *\n * @deprecated Use `breadcrumbsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Breadcrumbs = convertIntegrationFnToClass(INTEGRATION_NAME, breadcrumbsIntegration)\n\n;\n\n/**\n * Adds a breadcrumb for Sentry events or transactions if this option is enabled.\n */\nfunction _getSentryBreadcrumbHandler(client) {\n return function addSentryBreadcrumb(event) {\n if (getClient() !== client) {\n return;\n }\n\n addBreadcrumb(\n {\n category: `sentry.${event.type === 'transaction' ? 'transaction' : 'event'}`,\n event_id: event.event_id,\n level: event.level,\n message: getEventDescription(event),\n },\n {\n event,\n },\n );\n };\n}\n\n/**\n * A HOC that creaes a function that creates breadcrumbs from DOM API calls.\n * This is a HOC so that we get access to dom options in the closure.\n */\nfunction _getDomBreadcrumbHandler(\n client,\n dom,\n) {\n return function _innerDomBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n let target;\n let componentName;\n let keyAttrs = typeof dom === 'object' ? dom.serializeAttribute : undefined;\n\n let maxStringLength =\n typeof dom === 'object' && typeof dom.maxStringLength === 'number' ? dom.maxStringLength : undefined;\n if (maxStringLength && maxStringLength > MAX_ALLOWED_STRING_LENGTH) {\n DEBUG_BUILD &&\n logger.warn(\n `\\`dom.maxStringLength\\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${maxStringLength} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`,\n );\n maxStringLength = MAX_ALLOWED_STRING_LENGTH;\n }\n\n if (typeof keyAttrs === 'string') {\n keyAttrs = [keyAttrs];\n }\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n const event = handlerData.event ;\n const element = _isEvent(event) ? event.target : event;\n\n target = htmlTreeAsString(element, { keyAttrs, maxStringLength });\n componentName = getComponentName(element);\n } catch (e) {\n target = '';\n }\n\n if (target.length === 0) {\n return;\n }\n\n const breadcrumb = {\n category: `ui.${handlerData.name}`,\n message: target,\n };\n\n if (componentName) {\n breadcrumb.data = { 'ui.component_name': componentName };\n }\n\n addBreadcrumb(breadcrumb, {\n event: handlerData.event,\n name: handlerData.name,\n global: handlerData.global,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from console API calls\n */\nfunction _getConsoleBreadcrumbHandler(client) {\n return function _consoleBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n const breadcrumb = {\n category: 'console',\n data: {\n arguments: handlerData.args,\n logger: 'console',\n },\n level: severityLevelFromString(handlerData.level),\n message: safeJoin(handlerData.args, ' '),\n };\n\n if (handlerData.level === 'assert') {\n if (handlerData.args[0] === false) {\n breadcrumb.message = `Assertion failed: ${safeJoin(handlerData.args.slice(1), ' ') || 'console.assert'}`;\n breadcrumb.data.arguments = handlerData.args.slice(1);\n } else {\n // Don't capture a breadcrumb for passed assertions\n return;\n }\n }\n\n addBreadcrumb(breadcrumb, {\n input: handlerData.args,\n level: handlerData.level,\n });\n };\n}\n\n/**\n * Creates breadcrumbs from XHR API calls\n */\nfunction _getXhrBreadcrumbHandler(client) {\n return function _xhrBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n const sentryXhrData = handlerData.xhr[SENTRY_XHR_DATA_KEY];\n\n // We only capture complete, non-sentry requests\n if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n return;\n }\n\n const { method, url, status_code, body } = sentryXhrData;\n\n const data = {\n method,\n url,\n status_code,\n };\n\n const hint = {\n xhr: handlerData.xhr,\n input: body,\n startTimestamp,\n endTimestamp,\n };\n\n addBreadcrumb(\n {\n category: 'xhr',\n data,\n type: 'http',\n },\n hint,\n );\n };\n}\n\n/**\n * Creates breadcrumbs from fetch API calls\n */\nfunction _getFetchBreadcrumbHandler(client) {\n return function _fetchBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n const { startTimestamp, endTimestamp } = handlerData;\n\n // We only capture complete fetch requests\n if (!endTimestamp) {\n return;\n }\n\n if (handlerData.fetchData.url.match(/sentry_key/) && handlerData.fetchData.method === 'POST') {\n // We will not create breadcrumbs for fetch requests that contain `sentry_key` (internal sentry requests)\n return;\n }\n\n if (handlerData.error) {\n const data = handlerData.fetchData;\n const hint = {\n data: handlerData.error,\n input: handlerData.args,\n startTimestamp,\n endTimestamp,\n };\n\n addBreadcrumb(\n {\n category: 'fetch',\n data,\n level: 'error',\n type: 'http',\n },\n hint,\n );\n } else {\n const response = handlerData.response ;\n const data = {\n ...handlerData.fetchData,\n status_code: response && response.status,\n };\n const hint = {\n input: handlerData.args,\n response,\n startTimestamp,\n endTimestamp,\n };\n addBreadcrumb(\n {\n category: 'fetch',\n data,\n type: 'http',\n },\n hint,\n );\n }\n };\n}\n\n/**\n * Creates breadcrumbs from history API calls\n */\nfunction _getHistoryBreadcrumbHandler(client) {\n return function _historyBreadcrumb(handlerData) {\n if (getClient() !== client) {\n return;\n }\n\n let from = handlerData.from;\n let to = handlerData.to;\n const parsedLoc = parseUrl(WINDOW.location.href);\n let parsedFrom = from ? parseUrl(from) : undefined;\n const parsedTo = parseUrl(to);\n\n // Initial pushState doesn't provide `from` information\n if (!parsedFrom || !parsedFrom.path) {\n parsedFrom = parsedLoc;\n }\n\n // Use only the path component of the URL if the URL matches the current\n // document (almost all the time when using pushState)\n if (parsedLoc.protocol === parsedTo.protocol && parsedLoc.host === parsedTo.host) {\n to = parsedTo.relative;\n }\n if (parsedLoc.protocol === parsedFrom.protocol && parsedLoc.host === parsedFrom.host) {\n from = parsedFrom.relative;\n }\n\n addBreadcrumb({\n category: 'navigation',\n data: {\n from,\n to,\n },\n });\n };\n}\n\nfunction _isEvent(event) {\n return !!event && !!(event ).target;\n}\n\nexport { Breadcrumbs, breadcrumbsIntegration };\n//# sourceMappingURL=breadcrumbs.js.map\n","import { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\n\nconst INTEGRATION_NAME = 'Dedupe';\n\nconst _dedupeIntegration = (() => {\n let previousEvent;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n processEvent(currentEvent) {\n // We want to ignore any non-error type events, e.g. transactions or replays\n // These should never be deduped, and also not be compared against as _previousEvent.\n if (currentEvent.type) {\n return currentEvent;\n }\n\n // Juuust in case something goes wrong\n try {\n if (_shouldDropEvent(currentEvent, previousEvent)) {\n DEBUG_BUILD && logger.warn('Event dropped due to being a duplicate of previously captured event.');\n return null;\n }\n } catch (_oO) {} // eslint-disable-line no-empty\n\n return (previousEvent = currentEvent);\n },\n };\n}) ;\n\nconst dedupeIntegration = defineIntegration(_dedupeIntegration);\n\n/**\n * Deduplication filter.\n * @deprecated Use `dedupeIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst Dedupe = convertIntegrationFnToClass(INTEGRATION_NAME, dedupeIntegration)\n\n;\n\nfunction _shouldDropEvent(currentEvent, previousEvent) {\n if (!previousEvent) {\n return false;\n }\n\n if (_isSameMessageEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n if (_isSameExceptionEvent(currentEvent, previousEvent)) {\n return true;\n }\n\n return false;\n}\n\nfunction _isSameMessageEvent(currentEvent, previousEvent) {\n const currentMessage = currentEvent.message;\n const previousMessage = previousEvent.message;\n\n // If neither event has a message property, they were both exceptions, so bail out\n if (!currentMessage && !previousMessage) {\n return false;\n }\n\n // If only one event has a stacktrace, but not the other one, they are not the same\n if ((currentMessage && !previousMessage) || (!currentMessage && previousMessage)) {\n return false;\n }\n\n if (currentMessage !== previousMessage) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n\nfunction _isSameExceptionEvent(currentEvent, previousEvent) {\n const previousException = _getExceptionFromEvent(previousEvent);\n const currentException = _getExceptionFromEvent(currentEvent);\n\n if (!previousException || !currentException) {\n return false;\n }\n\n if (previousException.type !== currentException.type || previousException.value !== currentException.value) {\n return false;\n }\n\n if (!_isSameFingerprint(currentEvent, previousEvent)) {\n return false;\n }\n\n if (!_isSameStacktrace(currentEvent, previousEvent)) {\n return false;\n }\n\n return true;\n}\n\nfunction _isSameStacktrace(currentEvent, previousEvent) {\n let currentFrames = _getFramesFromEvent(currentEvent);\n let previousFrames = _getFramesFromEvent(previousEvent);\n\n // If neither event has a stacktrace, they are assumed to be the same\n if (!currentFrames && !previousFrames) {\n return true;\n }\n\n // If only one event has a stacktrace, but not the other one, they are not the same\n if ((currentFrames && !previousFrames) || (!currentFrames && previousFrames)) {\n return false;\n }\n\n currentFrames = currentFrames ;\n previousFrames = previousFrames ;\n\n // If number of frames differ, they are not the same\n if (previousFrames.length !== currentFrames.length) {\n return false;\n }\n\n // Otherwise, compare the two\n for (let i = 0; i < previousFrames.length; i++) {\n const frameA = previousFrames[i];\n const frameB = currentFrames[i];\n\n if (\n frameA.filename !== frameB.filename ||\n frameA.lineno !== frameB.lineno ||\n frameA.colno !== frameB.colno ||\n frameA.function !== frameB.function\n ) {\n return false;\n }\n }\n\n return true;\n}\n\nfunction _isSameFingerprint(currentEvent, previousEvent) {\n let currentFingerprint = currentEvent.fingerprint;\n let previousFingerprint = previousEvent.fingerprint;\n\n // If neither event has a fingerprint, they are assumed to be the same\n if (!currentFingerprint && !previousFingerprint) {\n return true;\n }\n\n // If only one event has a fingerprint, but not the other one, they are not the same\n if ((currentFingerprint && !previousFingerprint) || (!currentFingerprint && previousFingerprint)) {\n return false;\n }\n\n currentFingerprint = currentFingerprint ;\n previousFingerprint = previousFingerprint ;\n\n // Otherwise, compare the two\n try {\n return !!(currentFingerprint.join('') === previousFingerprint.join(''));\n } catch (_oO) {\n return false;\n }\n}\n\nfunction _getExceptionFromEvent(event) {\n return event.exception && event.exception.values && event.exception.values[0];\n}\n\nfunction _getFramesFromEvent(event) {\n const exception = event.exception;\n\n if (exception) {\n try {\n // @ts-expect-error Object could be undefined\n return exception.values[0].stacktrace.frames;\n } catch (_oO) {\n return undefined;\n }\n }\n return undefined;\n}\n\nexport { Dedupe, dedupeIntegration };\n//# sourceMappingURL=dedupe.js.map\n","import { defineIntegration, convertIntegrationFnToClass, getClient, captureEvent } from '@sentry/core';\nimport { addGlobalErrorInstrumentationHandler, isString, addGlobalUnhandledRejectionInstrumentationHandler, isPrimitive, isErrorEvent, getLocationHref, logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../debug-build.js';\nimport { eventFromUnknownInput } from '../eventbuilder.js';\nimport { shouldIgnoreOnError } from '../helpers.js';\n\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\n\nconst INTEGRATION_NAME = 'GlobalHandlers';\n\nconst _globalHandlersIntegration = ((options = {}) => {\n const _options = {\n onerror: true,\n onunhandledrejection: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n setupOnce() {\n Error.stackTraceLimit = 50;\n },\n setup(client) {\n if (_options.onerror) {\n _installGlobalOnErrorHandler(client);\n globalHandlerLog('onerror');\n }\n if (_options.onunhandledrejection) {\n _installGlobalOnUnhandledRejectionHandler(client);\n globalHandlerLog('onunhandledrejection');\n }\n },\n };\n}) ;\n\nconst globalHandlersIntegration = defineIntegration(_globalHandlersIntegration);\n\n/**\n * Global handlers.\n * @deprecated Use `globalHandlersIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst GlobalHandlers = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n globalHandlersIntegration,\n)\n\n;\n\nfunction _installGlobalOnErrorHandler(client) {\n addGlobalErrorInstrumentationHandler(data => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const { msg, url, line, column, error } = data;\n\n const event =\n error === undefined && isString(msg)\n ? _eventFromIncompleteOnError(msg, url, line, column)\n : _enhanceEventWithInitialFrame(\n eventFromUnknownInput(stackParser, error || msg, undefined, attachStacktrace, false),\n url,\n line,\n column,\n );\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'onerror',\n },\n });\n });\n}\n\nfunction _installGlobalOnUnhandledRejectionHandler(client) {\n addGlobalUnhandledRejectionInstrumentationHandler(e => {\n const { stackParser, attachStacktrace } = getOptions();\n\n if (getClient() !== client || shouldIgnoreOnError()) {\n return;\n }\n\n const error = _getUnhandledRejectionError(e );\n\n const event = isPrimitive(error)\n ? _eventFromRejectionWithPrimitive(error)\n : eventFromUnknownInput(stackParser, error, undefined, attachStacktrace, true);\n\n event.level = 'error';\n\n captureEvent(event, {\n originalException: error,\n mechanism: {\n handled: false,\n type: 'onunhandledrejection',\n },\n });\n });\n}\n\nfunction _getUnhandledRejectionError(error) {\n if (isPrimitive(error)) {\n return error;\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const e = error ;\n\n // dig the object of the rejection out of known event types\n try {\n // PromiseRejectionEvents store the object of the rejection under 'reason'\n // see https://developer.mozilla.org/en-US/docs/Web/API/PromiseRejectionEvent\n if ('reason' in e) {\n return e.reason;\n }\n\n // something, somewhere, (likely a browser extension) effectively casts PromiseRejectionEvents\n // to CustomEvents, moving the `promise` and `reason` attributes of the PRE into\n // the CustomEvent's `detail` attribute, since they're not part of CustomEvent's spec\n // see https://developer.mozilla.org/en-US/docs/Web/API/CustomEvent and\n // https://github.com/getsentry/sentry-javascript/issues/2380\n else if ('detail' in e && 'reason' in e.detail) {\n return e.detail.reason;\n }\n } catch (e2) {} // eslint-disable-line no-empty\n\n return error;\n}\n\n/**\n * Create an event from a promise rejection where the `reason` is a primitive.\n *\n * @param reason: The `reason` property of the promise rejection\n * @returns An Event object with an appropriate `exception` value\n */\nfunction _eventFromRejectionWithPrimitive(reason) {\n return {\n exception: {\n values: [\n {\n type: 'UnhandledRejection',\n // String() is needed because the Primitive type includes symbols (which can't be automatically stringified)\n value: `Non-Error promise rejection captured with value: ${String(reason)}`,\n },\n ],\n },\n };\n}\n\n/**\n * This function creates a stack from an old, error-less onerror handler.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _eventFromIncompleteOnError(msg, url, line, column) {\n const ERROR_TYPES_RE =\n /^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;\n\n // If 'message' is ErrorEvent, get real message from inside\n let message = isErrorEvent(msg) ? msg.message : msg;\n let name = 'Error';\n\n const groups = message.match(ERROR_TYPES_RE);\n if (groups) {\n name = groups[1];\n message = groups[2];\n }\n\n const event = {\n exception: {\n values: [\n {\n type: name,\n value: message,\n },\n ],\n },\n };\n\n return _enhanceEventWithInitialFrame(event, url, line, column);\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _enhanceEventWithInitialFrame(event, url, line, column) {\n // event.exception\n const e = (event.exception = event.exception || {});\n // event.exception.values\n const ev = (e.values = e.values || []);\n // event.exception.values[0]\n const ev0 = (ev[0] = ev[0] || {});\n // event.exception.values[0].stacktrace\n const ev0s = (ev0.stacktrace = ev0.stacktrace || {});\n // event.exception.values[0].stacktrace.frames\n const ev0sf = (ev0s.frames = ev0s.frames || []);\n\n const colno = isNaN(parseInt(column, 10)) ? undefined : column;\n const lineno = isNaN(parseInt(line, 10)) ? undefined : line;\n const filename = isString(url) && url.length > 0 ? url : getLocationHref();\n\n // event.exception.values[0].stacktrace.frames\n if (ev0sf.length === 0) {\n ev0sf.push({\n colno,\n filename,\n function: '?',\n in_app: true,\n lineno,\n });\n }\n\n return event;\n}\n\nfunction globalHandlerLog(type) {\n DEBUG_BUILD && logger.log(`Global Handler attached: ${type}`);\n}\n\nfunction getOptions() {\n const client = getClient();\n const options = (client && client.getOptions()) || {\n stackParser: () => [],\n attachStacktrace: false,\n };\n return options;\n}\n\nexport { GlobalHandlers, globalHandlersIntegration };\n//# sourceMappingURL=globalhandlers.js.map\n","import { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { WINDOW } from '../helpers.js';\n\nconst INTEGRATION_NAME = 'HttpContext';\n\nconst _httpContextIntegration = (() => {\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n preprocessEvent(event) {\n // if none of the information we want exists, don't bother\n if (!WINDOW.navigator && !WINDOW.location && !WINDOW.document) {\n return;\n }\n\n // grab as much info as exists and add it to the event\n const url = (event.request && event.request.url) || (WINDOW.location && WINDOW.location.href);\n const { referrer } = WINDOW.document || {};\n const { userAgent } = WINDOW.navigator || {};\n\n const headers = {\n ...(event.request && event.request.headers),\n ...(referrer && { Referer: referrer }),\n ...(userAgent && { 'User-Agent': userAgent }),\n };\n const request = { ...event.request, ...(url && { url }), headers };\n\n event.request = request;\n },\n };\n}) ;\n\nconst httpContextIntegration = defineIntegration(_httpContextIntegration);\n\n/**\n * HttpContext integration collects information about HTTP request headers.\n * @deprecated Use `httpContextIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst HttpContext = convertIntegrationFnToClass(INTEGRATION_NAME, httpContextIntegration)\n\n;\n\nexport { HttpContext, httpContextIntegration };\n//# sourceMappingURL=httpcontext.js.map\n","import { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { applyAggregateErrorsToEvent } from '@sentry/utils';\nimport { exceptionFromError } from '../eventbuilder.js';\n\nconst DEFAULT_KEY = 'cause';\nconst DEFAULT_LIMIT = 5;\n\nconst INTEGRATION_NAME = 'LinkedErrors';\n\nconst _linkedErrorsIntegration = ((options = {}) => {\n const limit = options.limit || DEFAULT_LIMIT;\n const key = options.key || DEFAULT_KEY;\n\n return {\n name: INTEGRATION_NAME,\n // TODO v8: Remove this\n setupOnce() {}, // eslint-disable-line @typescript-eslint/no-empty-function\n preprocessEvent(event, hint, client) {\n const options = client.getOptions();\n\n applyAggregateErrorsToEvent(\n // This differs from the LinkedErrors integration in core by using a different exceptionFromError function\n exceptionFromError,\n options.stackParser,\n options.maxValueLength,\n key,\n limit,\n event,\n hint,\n );\n },\n };\n}) ;\n\nconst linkedErrorsIntegration = defineIntegration(_linkedErrorsIntegration);\n\n/**\n * Aggregrate linked errors in an event.\n * @deprecated Use `linkedErrorsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst LinkedErrors = convertIntegrationFnToClass(INTEGRATION_NAME, linkedErrorsIntegration)\n\n;\n\nexport { LinkedErrors, linkedErrorsIntegration };\n//# sourceMappingURL=linkederrors.js.map\n","import { defineIntegration, convertIntegrationFnToClass } from '@sentry/core';\nimport { fill, getFunctionName, getOriginalFunction } from '@sentry/utils';\nimport { WINDOW, wrap } from '../helpers.js';\n\nconst DEFAULT_EVENT_TARGET = [\n 'EventTarget',\n 'Window',\n 'Node',\n 'ApplicationCache',\n 'AudioTrackList',\n 'BroadcastChannel',\n 'ChannelMergerNode',\n 'CryptoOperation',\n 'EventSource',\n 'FileReader',\n 'HTMLUnknownElement',\n 'IDBDatabase',\n 'IDBRequest',\n 'IDBTransaction',\n 'KeyOperation',\n 'MediaController',\n 'MessagePort',\n 'ModalWindow',\n 'Notification',\n 'SVGElementInstance',\n 'Screen',\n 'SharedWorker',\n 'TextTrack',\n 'TextTrackCue',\n 'TextTrackList',\n 'WebSocket',\n 'WebSocketWorker',\n 'Worker',\n 'XMLHttpRequest',\n 'XMLHttpRequestEventTarget',\n 'XMLHttpRequestUpload',\n];\n\nconst INTEGRATION_NAME = 'TryCatch';\n\nconst _browserApiErrorsIntegration = ((options = {}) => {\n const _options = {\n XMLHttpRequest: true,\n eventTarget: true,\n requestAnimationFrame: true,\n setInterval: true,\n setTimeout: true,\n ...options,\n };\n\n return {\n name: INTEGRATION_NAME,\n // TODO: This currently only works for the first client this is setup\n // We may want to adjust this to check for client etc.\n setupOnce() {\n if (_options.setTimeout) {\n fill(WINDOW, 'setTimeout', _wrapTimeFunction);\n }\n\n if (_options.setInterval) {\n fill(WINDOW, 'setInterval', _wrapTimeFunction);\n }\n\n if (_options.requestAnimationFrame) {\n fill(WINDOW, 'requestAnimationFrame', _wrapRAF);\n }\n\n if (_options.XMLHttpRequest && 'XMLHttpRequest' in WINDOW) {\n fill(XMLHttpRequest.prototype, 'send', _wrapXHR);\n }\n\n const eventTargetOption = _options.eventTarget;\n if (eventTargetOption) {\n const eventTarget = Array.isArray(eventTargetOption) ? eventTargetOption : DEFAULT_EVENT_TARGET;\n eventTarget.forEach(_wrapEventTarget);\n }\n },\n };\n}) ;\n\nconst browserApiErrorsIntegration = defineIntegration(_browserApiErrorsIntegration);\n\n/**\n * Wrap timer functions and event targets to catch errors and provide better meta data.\n * @deprecated Use `browserApiErrorsIntegration()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nconst TryCatch = convertIntegrationFnToClass(\n INTEGRATION_NAME,\n browserApiErrorsIntegration,\n)\n\n;\n\nfunction _wrapTimeFunction(original) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function ( ...args) {\n const originalCallback = args[0];\n args[0] = wrap(originalCallback, {\n mechanism: {\n data: { function: getFunctionName(original) },\n handled: false,\n type: 'instrument',\n },\n });\n return original.apply(this, args);\n };\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction _wrapRAF(original) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function ( callback) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n return original.apply(this, [\n wrap(callback, {\n mechanism: {\n data: {\n function: 'requestAnimationFrame',\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'instrument',\n },\n }),\n ]);\n };\n}\n\nfunction _wrapXHR(originalSend) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n return function ( ...args) {\n // eslint-disable-next-line @typescript-eslint/no-this-alias\n const xhr = this;\n const xmlHttpRequestProps = ['onload', 'onerror', 'onprogress', 'onreadystatechange'];\n\n xmlHttpRequestProps.forEach(prop => {\n if (prop in xhr && typeof xhr[prop] === 'function') {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n fill(xhr, prop, function (original) {\n const wrapOptions = {\n mechanism: {\n data: {\n function: prop,\n handler: getFunctionName(original),\n },\n handled: false,\n type: 'instrument',\n },\n };\n\n // If Instrument integration has been called before TryCatch, get the name of original function\n const originalFunction = getOriginalFunction(original);\n if (originalFunction) {\n wrapOptions.mechanism.data.handler = getFunctionName(originalFunction);\n }\n\n // Otherwise wrap directly\n return wrap(original, wrapOptions);\n });\n }\n });\n\n return originalSend.apply(this, args);\n };\n}\n\nfunction _wrapEventTarget(target) {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const globalObject = WINDOW ;\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const proto = globalObject[target] && globalObject[target].prototype;\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, no-prototype-builtins\n if (!proto || !proto.hasOwnProperty || !proto.hasOwnProperty('addEventListener')) {\n return;\n }\n\n fill(proto, 'addEventListener', function (original,)\n\n {\n return function (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n eventName,\n fn,\n options,\n ) {\n try {\n if (typeof fn.handleEvent === 'function') {\n // ESlint disable explanation:\n // First, it is generally safe to call `wrap` with an unbound function. Furthermore, using `.bind()` would\n // introduce a bug here, because bind returns a new function that doesn't have our\n // flags(like __sentry_original__) attached. `wrap` checks for those flags to avoid unnecessary wrapping.\n // Without those flags, every call to addEventListener wraps the function again, causing a memory leak.\n // eslint-disable-next-line @typescript-eslint/unbound-method\n fn.handleEvent = wrap(fn.handleEvent, {\n mechanism: {\n data: {\n function: 'handleEvent',\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'instrument',\n },\n });\n }\n } catch (err) {\n // can sometimes get 'Permission denied to access property \"handle Event'\n }\n\n return original.apply(this, [\n eventName,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n wrap(fn , {\n mechanism: {\n data: {\n function: 'addEventListener',\n handler: getFunctionName(fn),\n target,\n },\n handled: false,\n type: 'instrument',\n },\n }),\n options,\n ]);\n };\n });\n\n fill(\n proto,\n 'removeEventListener',\n function (\n originalRemoveEventListener,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n ) {\n return function (\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n\n eventName,\n fn,\n options,\n ) {\n /**\n * There are 2 possible scenarios here:\n *\n * 1. Someone passes a callback, which was attached prior to Sentry initialization, or by using unmodified\n * method, eg. `document.addEventListener.call(el, name, handler). In this case, we treat this function\n * as a pass-through, and call original `removeEventListener` with it.\n *\n * 2. Someone passes a callback, which was attached after Sentry was initialized, which means that it was using\n * our wrapped version of `addEventListener`, which internally calls `wrap` helper.\n * This helper \"wraps\" whole callback inside a try/catch statement, and attached appropriate metadata to it,\n * in order for us to make a distinction between wrapped/non-wrapped functions possible.\n * If a function was wrapped, it has additional property of `__sentry_wrapped__`, holding the handler.\n *\n * When someone adds a handler prior to initialization, and then do it again, but after,\n * then we have to detach both of them. Otherwise, if we'd detach only wrapped one, it'd be impossible\n * to get rid of the initial handler and it'd stick there forever.\n */\n const wrappedEventHandler = fn ;\n try {\n const originalEventHandler = wrappedEventHandler && wrappedEventHandler.__sentry_wrapped__;\n if (originalEventHandler) {\n originalRemoveEventListener.call(this, eventName, originalEventHandler, options);\n }\n } catch (e) {\n // ignore, accessing __sentry_wrapped__ will throw in some Selenium environments\n }\n return originalRemoveEventListener.call(this, eventName, wrappedEventHandler, options);\n };\n },\n );\n}\n\nexport { TryCatch, browserApiErrorsIntegration };\n//# sourceMappingURL=trycatch.js.map\n","import { inboundFiltersIntegration, functionToStringIntegration, getIntegrationsToSetup, initAndBind, getReportDialogEndpoint, getCurrentHub, startSession, captureSession, getClient } from '@sentry/core';\nimport { stackParserFromStackParserOptions, supportsFetch, logger, addHistoryInstrumentationHandler } from '@sentry/utils';\nimport { BrowserClient } from './client.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { WINDOW, wrap as wrap$1 } from './helpers.js';\nimport { breadcrumbsIntegration } from './integrations/breadcrumbs.js';\nimport { dedupeIntegration } from './integrations/dedupe.js';\nimport { globalHandlersIntegration } from './integrations/globalhandlers.js';\nimport { httpContextIntegration } from './integrations/httpcontext.js';\nimport { linkedErrorsIntegration } from './integrations/linkederrors.js';\nimport { browserApiErrorsIntegration } from './integrations/trycatch.js';\nimport { defaultStackParser } from './stack-parsers.js';\nimport { makeFetchTransport } from './transports/fetch.js';\nimport { makeXHRTransport } from './transports/xhr.js';\n\n/** @deprecated Use `getDefaultIntegrations(options)` instead. */\nconst defaultIntegrations = [\n inboundFiltersIntegration(),\n functionToStringIntegration(),\n browserApiErrorsIntegration(),\n breadcrumbsIntegration(),\n globalHandlersIntegration(),\n linkedErrorsIntegration(),\n dedupeIntegration(),\n httpContextIntegration(),\n];\n\n/** Get the default integrations for the browser SDK. */\nfunction getDefaultIntegrations(_options) {\n // We return a copy of the defaultIntegrations here to avoid mutating this\n return [\n // eslint-disable-next-line deprecation/deprecation\n ...defaultIntegrations,\n ];\n}\n\n/**\n * A magic string that build tooling can leverage in order to inject a release value into the SDK.\n */\n\n/**\n * The Sentry Browser SDK Client.\n *\n * To use this SDK, call the {@link init} function as early as possible when\n * loading the web page. To set context information or send manual events, use\n * the provided methods.\n *\n * @example\n *\n * ```\n *\n * import { init } from '@sentry/browser';\n *\n * init({\n * dsn: '__DSN__',\n * // ...\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { configureScope } from '@sentry/browser';\n * configureScope((scope: Scope) => {\n * scope.setExtra({ battery: 0.7 });\n * scope.setTag({ user_mode: 'admin' });\n * scope.setUser({ id: '4711' });\n * });\n * ```\n *\n * @example\n * ```\n *\n * import { addBreadcrumb } from '@sentry/browser';\n * addBreadcrumb({\n * message: 'My Breadcrumb',\n * // ...\n * });\n * ```\n *\n * @example\n *\n * ```\n *\n * import * as Sentry from '@sentry/browser';\n * Sentry.captureMessage('Hello, world!');\n * Sentry.captureException(new Error('Good bye'));\n * Sentry.captureEvent({\n * message: 'Manual',\n * stacktrace: [\n * // ...\n * ],\n * });\n * ```\n *\n * @see {@link BrowserOptions} for documentation on configuration options.\n */\nfunction init(options = {}) {\n if (options.defaultIntegrations === undefined) {\n options.defaultIntegrations = getDefaultIntegrations();\n }\n if (options.release === undefined) {\n // This allows build tooling to find-and-replace __SENTRY_RELEASE__ to inject a release value\n if (typeof __SENTRY_RELEASE__ === 'string') {\n options.release = __SENTRY_RELEASE__;\n }\n\n // This supports the variable that sentry-webpack-plugin injects\n if (WINDOW.SENTRY_RELEASE && WINDOW.SENTRY_RELEASE.id) {\n options.release = WINDOW.SENTRY_RELEASE.id;\n }\n }\n if (options.autoSessionTracking === undefined) {\n options.autoSessionTracking = true;\n }\n if (options.sendClientReports === undefined) {\n options.sendClientReports = true;\n }\n\n const clientOptions = {\n ...options,\n stackParser: stackParserFromStackParserOptions(options.stackParser || defaultStackParser),\n integrations: getIntegrationsToSetup(options),\n transport: options.transport || (supportsFetch() ? makeFetchTransport : makeXHRTransport),\n };\n\n initAndBind(BrowserClient, clientOptions);\n\n if (options.autoSessionTracking) {\n startSessionTracking();\n }\n}\n\nconst showReportDialog = (\n // eslint-disable-next-line deprecation/deprecation\n options = {},\n // eslint-disable-next-line deprecation/deprecation\n hub = getCurrentHub(),\n) => {\n // doesn't work without a document (React Native)\n if (!WINDOW.document) {\n DEBUG_BUILD && logger.error('Global document not defined in showReportDialog call');\n return;\n }\n\n // eslint-disable-next-line deprecation/deprecation\n const { client, scope } = hub.getStackTop();\n const dsn = options.dsn || (client && client.getDsn());\n if (!dsn) {\n DEBUG_BUILD && logger.error('DSN not configured for showReportDialog call');\n return;\n }\n\n if (scope) {\n options.user = {\n ...scope.getUser(),\n ...options.user,\n };\n }\n\n if (!options.eventId) {\n // eslint-disable-next-line deprecation/deprecation\n options.eventId = hub.lastEventId();\n }\n\n const script = WINDOW.document.createElement('script');\n script.async = true;\n script.crossOrigin = 'anonymous';\n script.src = getReportDialogEndpoint(dsn, options);\n\n if (options.onLoad) {\n script.onload = options.onLoad;\n }\n\n const { onClose } = options;\n if (onClose) {\n const reportDialogClosedMessageHandler = (event) => {\n if (event.data === '__sentry_reportdialog_closed__') {\n try {\n onClose();\n } finally {\n WINDOW.removeEventListener('message', reportDialogClosedMessageHandler);\n }\n }\n };\n WINDOW.addEventListener('message', reportDialogClosedMessageHandler);\n }\n\n const injectionPoint = WINDOW.document.head || WINDOW.document.body;\n if (injectionPoint) {\n injectionPoint.appendChild(script);\n } else {\n DEBUG_BUILD && logger.error('Not injecting report dialog. No injection point found in HTML');\n }\n};\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nfunction forceLoad() {\n // Noop\n}\n\n/**\n * This function is here to be API compatible with the loader.\n * @hidden\n */\nfunction onLoad(callback) {\n callback();\n}\n\n/**\n * Wrap code within a try/catch block so the SDK is able to capture errors.\n *\n * @deprecated This function will be removed in v8.\n * It is not part of Sentry's official API and it's easily replaceable by using a try/catch block\n * and calling Sentry.captureException.\n *\n * @param fn A function to wrap.\n *\n * @returns The result of wrapped function call.\n */\n// TODO(v8): Remove this function\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction wrap(fn) {\n return wrap$1(fn)();\n}\n\n/**\n * Enable automatic Session Tracking for the initial page load.\n */\nfunction startSessionTracking() {\n if (typeof WINDOW.document === 'undefined') {\n DEBUG_BUILD && logger.warn('Session tracking in non-browser environment with @sentry/browser is not supported.');\n return;\n }\n\n // The session duration for browser sessions does not track a meaningful\n // concept that can be used as a metric.\n // Automatically captured sessions are akin to page views, and thus we\n // discard their duration.\n startSession({ ignoreDuration: true });\n captureSession();\n\n // We want to create a session for every navigation as well\n addHistoryInstrumentationHandler(({ from, to }) => {\n // Don't create an additional session for the initial route or if the location did not change\n if (from !== undefined && from !== to) {\n startSession({ ignoreDuration: true });\n captureSession();\n }\n });\n}\n\n/**\n * Captures user feedback and sends it to Sentry.\n */\nfunction captureUserFeedback(feedback) {\n const client = getClient();\n if (client) {\n client.captureUserFeedback(feedback);\n }\n}\n\nexport { captureUserFeedback, defaultIntegrations, forceLoad, getDefaultIntegrations, init, onLoad, showReportDialog, wrap };\n//# sourceMappingURL=sdk.js.map\n","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","const DEFAULT_ENVIRONMENT = 'production';\n\nexport { DEFAULT_ENVIRONMENT };\n//# sourceMappingURL=constants.js.map\n","import { SyncPromise, logger, isThenable, getGlobalSingleton } from '@sentry/utils';\nimport { DEBUG_BUILD } from './debug-build.js';\n\n/**\n * Returns the global event processors.\n * @deprecated Global event processors will be removed in v8.\n */\nfunction getGlobalEventProcessors() {\n return getGlobalSingleton('globalEventProcessors', () => []);\n}\n\n/**\n * Add a EventProcessor to be kept globally.\n * @deprecated Use `addEventProcessor` instead. Global event processors will be removed in v8.\n */\nfunction addGlobalEventProcessor(callback) {\n // eslint-disable-next-line deprecation/deprecation\n getGlobalEventProcessors().push(callback);\n}\n\n/**\n * Process an array of event processors, returning the processed event (or `null` if the event was dropped).\n */\nfunction notifyEventProcessors(\n processors,\n event,\n hint,\n index = 0,\n) {\n return new SyncPromise((resolve, reject) => {\n const processor = processors[index];\n if (event === null || typeof processor !== 'function') {\n resolve(event);\n } else {\n const result = processor({ ...event }, hint) ;\n\n DEBUG_BUILD && processor.id && result === null && logger.log(`Event processor \"${processor.id}\" dropped event`);\n\n if (isThenable(result)) {\n void result\n .then(final => notifyEventProcessors(processors, final, hint, index + 1).then(resolve))\n .then(null, reject);\n } else {\n void notifyEventProcessors(processors, result, hint, index + 1)\n .then(resolve)\n .then(null, reject);\n }\n }\n });\n}\n\nexport { addGlobalEventProcessor, getGlobalEventProcessors, notifyEventProcessors };\n//# sourceMappingURL=eventProcessors.js.map\n","import { timestampInSeconds, uuid4, dropUndefinedKeys } from '@sentry/utils';\n\n/**\n * Creates a new `Session` object by setting certain default parameters. If optional @param context\n * is passed, the passed properties are applied to the session object.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns a new `Session` object\n */\nfunction makeSession(context) {\n // Both timestamp and started are in seconds since the UNIX epoch.\n const startingTime = timestampInSeconds();\n\n const session = {\n sid: uuid4(),\n init: true,\n timestamp: startingTime,\n started: startingTime,\n duration: 0,\n status: 'ok',\n errors: 0,\n ignoreDuration: false,\n toJSON: () => sessionToJSON(session),\n };\n\n if (context) {\n updateSession(session, context);\n }\n\n return session;\n}\n\n/**\n * Updates a session object with the properties passed in the context.\n *\n * Note that this function mutates the passed object and returns void.\n * (Had to do this instead of returning a new and updated session because closing and sending a session\n * makes an update to the session after it was passed to the sending logic.\n * @see BaseClient.captureSession )\n *\n * @param session the `Session` to update\n * @param context the `SessionContext` holding the properties that should be updated in @param session\n */\n// eslint-disable-next-line complexity\nfunction updateSession(session, context = {}) {\n if (context.user) {\n if (!session.ipAddress && context.user.ip_address) {\n session.ipAddress = context.user.ip_address;\n }\n\n if (!session.did && !context.did) {\n session.did = context.user.id || context.user.email || context.user.username;\n }\n }\n\n session.timestamp = context.timestamp || timestampInSeconds();\n\n if (context.abnormal_mechanism) {\n session.abnormal_mechanism = context.abnormal_mechanism;\n }\n\n if (context.ignoreDuration) {\n session.ignoreDuration = context.ignoreDuration;\n }\n if (context.sid) {\n // Good enough uuid validation. — Kamil\n session.sid = context.sid.length === 32 ? context.sid : uuid4();\n }\n if (context.init !== undefined) {\n session.init = context.init;\n }\n if (!session.did && context.did) {\n session.did = `${context.did}`;\n }\n if (typeof context.started === 'number') {\n session.started = context.started;\n }\n if (session.ignoreDuration) {\n session.duration = undefined;\n } else if (typeof context.duration === 'number') {\n session.duration = context.duration;\n } else {\n const duration = session.timestamp - session.started;\n session.duration = duration >= 0 ? duration : 0;\n }\n if (context.release) {\n session.release = context.release;\n }\n if (context.environment) {\n session.environment = context.environment;\n }\n if (!session.ipAddress && context.ipAddress) {\n session.ipAddress = context.ipAddress;\n }\n if (!session.userAgent && context.userAgent) {\n session.userAgent = context.userAgent;\n }\n if (typeof context.errors === 'number') {\n session.errors = context.errors;\n }\n if (context.status) {\n session.status = context.status;\n }\n}\n\n/**\n * Closes a session by setting its status and updating the session object with it.\n * Internally calls `updateSession` to update the passed session object.\n *\n * Note that this function mutates the passed session (@see updateSession for explanation).\n *\n * @param session the `Session` object to be closed\n * @param status the `SessionStatus` with which the session was closed. If you don't pass a status,\n * this function will keep the previously set status, unless it was `'ok'` in which case\n * it is changed to `'exited'`.\n */\nfunction closeSession(session, status) {\n let context = {};\n if (status) {\n context = { status };\n } else if (session.status === 'ok') {\n context = { status: 'exited' };\n }\n\n updateSession(session, context);\n}\n\n/**\n * Serializes a passed session object to a JSON object with a slightly different structure.\n * This is necessary because the Sentry backend requires a slightly different schema of a session\n * than the one the JS SDKs use internally.\n *\n * @param session the session to be converted\n *\n * @returns a JSON object of the passed session\n */\nfunction sessionToJSON(session) {\n return dropUndefinedKeys({\n sid: `${session.sid}`,\n init: session.init,\n // Make sure that sec is converted to ms for date constructor\n started: new Date(session.started * 1000).toISOString(),\n timestamp: new Date(session.timestamp * 1000).toISOString(),\n status: session.status,\n errors: session.errors,\n did: typeof session.did === 'number' || typeof session.did === 'string' ? `${session.did}` : undefined,\n duration: session.duration,\n abnormal_mechanism: session.abnormal_mechanism,\n attrs: {\n release: session.release,\n environment: session.environment,\n ip_address: session.ipAddress,\n user_agent: session.userAgent,\n },\n });\n}\n\nexport { closeSession, makeSession, updateSession };\n//# sourceMappingURL=session.js.map\n","import { dropUndefinedKeys, generateSentryTraceHeader, timestampInSeconds } from '@sentry/utils';\n\n// These are aligned with OpenTelemetry trace flags\nconst TRACE_FLAG_NONE = 0x0;\nconst TRACE_FLAG_SAMPLED = 0x1;\n\n/**\n * Convert a span to a trace context, which can be sent as the `trace` context in an event.\n */\nfunction spanToTraceContext(span) {\n const { spanId: span_id, traceId: trace_id } = span.spanContext();\n const { data, op, parent_span_id, status, tags, origin } = spanToJSON(span);\n\n return dropUndefinedKeys({\n data,\n op,\n parent_span_id,\n span_id,\n status,\n tags,\n trace_id,\n origin,\n });\n}\n\n/**\n * Convert a Span to a Sentry trace header.\n */\nfunction spanToTraceHeader(span) {\n const { traceId, spanId } = span.spanContext();\n const sampled = spanIsSampled(span);\n return generateSentryTraceHeader(traceId, spanId, sampled);\n}\n\n/**\n * Convert a span time input intp a timestamp in seconds.\n */\nfunction spanTimeInputToSeconds(input) {\n if (typeof input === 'number') {\n return ensureTimestampInSeconds(input);\n }\n\n if (Array.isArray(input)) {\n // See {@link HrTime} for the array-based time format\n return input[0] + input[1] / 1e9;\n }\n\n if (input instanceof Date) {\n return ensureTimestampInSeconds(input.getTime());\n }\n\n return timestampInSeconds();\n}\n\n/**\n * Converts a timestamp to second, if it was in milliseconds, or keeps it as second.\n */\nfunction ensureTimestampInSeconds(timestamp) {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp / 1000 : timestamp;\n}\n\n/**\n * Convert a span to a JSON representation.\n * Note that all fields returned here are optional and need to be guarded against.\n *\n * Note: Because of this, we currently have a circular type dependency (which we opted out of in package.json).\n * This is not avoidable as we need `spanToJSON` in `spanUtils.ts`, which in turn is needed by `span.ts` for backwards compatibility.\n * And `spanToJSON` needs the Span class from `span.ts` to check here.\n * TODO v8: When we remove the deprecated stuff from `span.ts`, we can remove the circular dependency again.\n */\nfunction spanToJSON(span) {\n if (spanIsSpanClass(span)) {\n return span.getSpanJSON();\n }\n\n // Fallback: We also check for `.toJSON()` here...\n // eslint-disable-next-line deprecation/deprecation\n if (typeof span.toJSON === 'function') {\n // eslint-disable-next-line deprecation/deprecation\n return span.toJSON();\n }\n\n return {};\n}\n\n/**\n * Sadly, due to circular dependency checks we cannot actually import the Span class here and check for instanceof.\n * :( So instead we approximate this by checking if it has the `getSpanJSON` method.\n */\nfunction spanIsSpanClass(span) {\n return typeof (span ).getSpanJSON === 'function';\n}\n\n/**\n * Returns true if a span is sampled.\n * In most cases, you should just use `span.isRecording()` instead.\n * However, this has a slightly different semantic, as it also returns false if the span is finished.\n * So in the case where this distinction is important, use this method.\n */\nfunction spanIsSampled(span) {\n // We align our trace flags with the ones OpenTelemetry use\n // So we also check for sampled the same way they do.\n const { traceFlags } = span.spanContext();\n // eslint-disable-next-line no-bitwise\n return Boolean(traceFlags & TRACE_FLAG_SAMPLED);\n}\n\nexport { TRACE_FLAG_NONE, TRACE_FLAG_SAMPLED, spanIsSampled, spanTimeInputToSeconds, spanToJSON, spanToTraceContext, spanToTraceHeader };\n//# sourceMappingURL=spanUtils.js.map\n","import { uuid4, dateTimestampInSeconds, addExceptionMechanism, truncate, GLOBAL_OBJ, normalize } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getGlobalEventProcessors, notifyEventProcessors } from '../eventProcessors.js';\nimport { getGlobalScope, Scope } from '../scope.js';\nimport { mergeScopeData, applyScopeDataToEvent } from './applyScopeDataToEvent.js';\nimport { spanToJSON } from './spanUtils.js';\n\n/**\n * This type makes sure that we get either a CaptureContext, OR an EventHint.\n * It does not allow mixing them, which could lead to unexpected outcomes, e.g. this is disallowed:\n * { user: { id: '123' }, mechanism: { handled: false } }\n */\n\n/**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * Note: This also triggers callbacks for `addGlobalEventProcessor`, but not `beforeSend`.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n * @hidden\n */\nfunction prepareEvent(\n options,\n event,\n hint,\n scope,\n client,\n isolationScope,\n) {\n const { normalizeDepth = 3, normalizeMaxBreadth = 1000 } = options;\n const prepared = {\n ...event,\n event_id: event.event_id || hint.event_id || uuid4(),\n timestamp: event.timestamp || dateTimestampInSeconds(),\n };\n const integrations = hint.integrations || options.integrations.map(i => i.name);\n\n applyClientOptions(prepared, options);\n applyIntegrationsMetadata(prepared, integrations);\n\n // Only put debug IDs onto frames for error events.\n if (event.type === undefined) {\n applyDebugIds(prepared, options.stackParser);\n }\n\n // If we have scope given to us, use it as the base for further modifications.\n // This allows us to prevent unnecessary copying of data if `captureContext` is not provided.\n const finalScope = getFinalScope(scope, hint.captureContext);\n\n if (hint.mechanism) {\n addExceptionMechanism(prepared, hint.mechanism);\n }\n\n const clientEventProcessors = client && client.getEventProcessors ? client.getEventProcessors() : [];\n\n // This should be the last thing called, since we want that\n // {@link Hub.addEventProcessor} gets the finished prepared event.\n // Merge scope data together\n const data = getGlobalScope().getScopeData();\n\n if (isolationScope) {\n const isolationData = isolationScope.getScopeData();\n mergeScopeData(data, isolationData);\n }\n\n if (finalScope) {\n const finalScopeData = finalScope.getScopeData();\n mergeScopeData(data, finalScopeData);\n }\n\n const attachments = [...(hint.attachments || []), ...data.attachments];\n if (attachments.length) {\n hint.attachments = attachments;\n }\n\n applyScopeDataToEvent(prepared, data);\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors = [\n ...clientEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n // Run scope event processors _after_ all other processors\n ...data.eventProcessors,\n ];\n\n const result = notifyEventProcessors(eventProcessors, prepared, hint);\n\n return result.then(evt => {\n if (evt) {\n // We apply the debug_meta field only after all event processors have ran, so that if any event processors modified\n // file names (e.g.the RewriteFrames integration) the filename -> debug ID relationship isn't destroyed.\n // This should not cause any PII issues, since we're only moving data that is already on the event and not adding\n // any new data\n applyDebugMeta(evt);\n }\n\n if (typeof normalizeDepth === 'number' && normalizeDepth > 0) {\n return normalizeEvent(evt, normalizeDepth, normalizeMaxBreadth);\n }\n return evt;\n });\n}\n\n/**\n * Enhances event using the client configuration.\n * It takes care of all \"static\" values like environment, release and `dist`,\n * as well as truncating overly long values.\n * @param event event instance to be enhanced\n */\nfunction applyClientOptions(event, options) {\n const { environment, release, dist, maxValueLength = 250 } = options;\n\n if (!('environment' in event)) {\n event.environment = 'environment' in options ? environment : DEFAULT_ENVIRONMENT;\n }\n\n if (event.release === undefined && release !== undefined) {\n event.release = release;\n }\n\n if (event.dist === undefined && dist !== undefined) {\n event.dist = dist;\n }\n\n if (event.message) {\n event.message = truncate(event.message, maxValueLength);\n }\n\n const exception = event.exception && event.exception.values && event.exception.values[0];\n if (exception && exception.value) {\n exception.value = truncate(exception.value, maxValueLength);\n }\n\n const request = event.request;\n if (request && request.url) {\n request.url = truncate(request.url, maxValueLength);\n }\n}\n\nconst debugIdStackParserCache = new WeakMap();\n\n/**\n * Puts debug IDs into the stack frames of an error event.\n */\nfunction applyDebugIds(event, stackParser) {\n const debugIdMap = GLOBAL_OBJ._sentryDebugIds;\n\n if (!debugIdMap) {\n return;\n }\n\n let debugIdStackFramesCache;\n const cachedDebugIdStackFrameCache = debugIdStackParserCache.get(stackParser);\n if (cachedDebugIdStackFrameCache) {\n debugIdStackFramesCache = cachedDebugIdStackFrameCache;\n } else {\n debugIdStackFramesCache = new Map();\n debugIdStackParserCache.set(stackParser, debugIdStackFramesCache);\n }\n\n // Build a map of filename -> debug_id\n const filenameDebugIdMap = Object.keys(debugIdMap).reduce((acc, debugIdStackTrace) => {\n let parsedStack;\n const cachedParsedStack = debugIdStackFramesCache.get(debugIdStackTrace);\n if (cachedParsedStack) {\n parsedStack = cachedParsedStack;\n } else {\n parsedStack = stackParser(debugIdStackTrace);\n debugIdStackFramesCache.set(debugIdStackTrace, parsedStack);\n }\n\n for (let i = parsedStack.length - 1; i >= 0; i--) {\n const stackFrame = parsedStack[i];\n if (stackFrame.filename) {\n acc[stackFrame.filename] = debugIdMap[debugIdStackTrace];\n break;\n }\n }\n return acc;\n }, {});\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.filename) {\n frame.debug_id = filenameDebugIdMap[frame.filename];\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n}\n\n/**\n * Moves debug IDs from the stack frames of an error event into the debug_meta field.\n */\nfunction applyDebugMeta(event) {\n // Extract debug IDs and filenames from the stack frames on the event.\n const filenameDebugIdMap = {};\n try {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n event.exception.values.forEach(exception => {\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n exception.stacktrace.frames.forEach(frame => {\n if (frame.debug_id) {\n if (frame.abs_path) {\n filenameDebugIdMap[frame.abs_path] = frame.debug_id;\n } else if (frame.filename) {\n filenameDebugIdMap[frame.filename] = frame.debug_id;\n }\n delete frame.debug_id;\n }\n });\n });\n } catch (e) {\n // To save bundle size we're just try catching here instead of checking for the existence of all the different objects.\n }\n\n if (Object.keys(filenameDebugIdMap).length === 0) {\n return;\n }\n\n // Fill debug_meta information\n event.debug_meta = event.debug_meta || {};\n event.debug_meta.images = event.debug_meta.images || [];\n const images = event.debug_meta.images;\n Object.keys(filenameDebugIdMap).forEach(filename => {\n images.push({\n type: 'sourcemap',\n code_file: filename,\n debug_id: filenameDebugIdMap[filename],\n });\n });\n}\n\n/**\n * This function adds all used integrations to the SDK info in the event.\n * @param event The event that will be filled with all integrations.\n */\nfunction applyIntegrationsMetadata(event, integrationNames) {\n if (integrationNames.length > 0) {\n event.sdk = event.sdk || {};\n event.sdk.integrations = [...(event.sdk.integrations || []), ...integrationNames];\n }\n}\n\n/**\n * Applies `normalize` function on necessary `Event` attributes to make them safe for serialization.\n * Normalized keys:\n * - `breadcrumbs.data`\n * - `user`\n * - `contexts`\n * - `extra`\n * @param event Event\n * @returns Normalized event\n */\nfunction normalizeEvent(event, depth, maxBreadth) {\n if (!event) {\n return null;\n }\n\n const normalized = {\n ...event,\n ...(event.breadcrumbs && {\n breadcrumbs: event.breadcrumbs.map(b => ({\n ...b,\n ...(b.data && {\n data: normalize(b.data, depth, maxBreadth),\n }),\n })),\n }),\n ...(event.user && {\n user: normalize(event.user, depth, maxBreadth),\n }),\n ...(event.contexts && {\n contexts: normalize(event.contexts, depth, maxBreadth),\n }),\n ...(event.extra && {\n extra: normalize(event.extra, depth, maxBreadth),\n }),\n };\n\n // event.contexts.trace stores information about a Transaction. Similarly,\n // event.spans[] stores information about child Spans. Given that a\n // Transaction is conceptually a Span, normalization should apply to both\n // Transactions and Spans consistently.\n // For now the decision is to skip normalization of Transactions and Spans,\n // so this block overwrites the normalized event to add back the original\n // Transaction information prior to normalization.\n if (event.contexts && event.contexts.trace && normalized.contexts) {\n normalized.contexts.trace = event.contexts.trace;\n\n // event.contexts.trace.data may contain circular/dangerous data so we need to normalize it\n if (event.contexts.trace.data) {\n normalized.contexts.trace.data = normalize(event.contexts.trace.data, depth, maxBreadth);\n }\n }\n\n // event.spans[].data may contain circular/dangerous data so we need to normalize it\n if (event.spans) {\n normalized.spans = event.spans.map(span => {\n const data = spanToJSON(span).data;\n\n if (data) {\n // This is a bit weird, as we generally have `Span` instances here, but to be safe we do not assume so\n // eslint-disable-next-line deprecation/deprecation\n span.data = normalize(data, depth, maxBreadth);\n }\n\n return span;\n });\n }\n\n return normalized;\n}\n\nfunction getFinalScope(scope, captureContext) {\n if (!captureContext) {\n return scope;\n }\n\n const finalScope = scope ? scope.clone() : new Scope();\n finalScope.update(captureContext);\n return finalScope;\n}\n\n/**\n * Parse either an `EventHint` directly, or convert a `CaptureContext` to an `EventHint`.\n * This is used to allow to update method signatures that used to accept a `CaptureContext` but should now accept an `EventHint`.\n */\nfunction parseEventHintOrCaptureContext(\n hint,\n) {\n if (!hint) {\n return undefined;\n }\n\n // If you pass a Scope or `() => Scope` as CaptureContext, we just return this as captureContext\n if (hintIsScopeOrFunction(hint)) {\n return { captureContext: hint };\n }\n\n if (hintIsScopeContext(hint)) {\n return {\n captureContext: hint,\n };\n }\n\n return hint;\n}\n\nfunction hintIsScopeOrFunction(\n hint,\n) {\n return hint instanceof Scope || typeof hint === 'function';\n}\n\nconst captureContextKeys = [\n 'user',\n 'level',\n 'extra',\n 'contexts',\n 'tags',\n 'fingerprint',\n 'requestSession',\n 'propagationContext',\n] ;\n\nfunction hintIsScopeContext(hint) {\n return Object.keys(hint).some(key => captureContextKeys.includes(key ));\n}\n\nexport { applyDebugIds, applyDebugMeta, parseEventHintOrCaptureContext, prepareEvent };\n//# sourceMappingURL=prepareEvent.js.map\n","import { logger, uuid4, timestampInSeconds, isThenable, GLOBAL_OBJ } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from './constants.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { getCurrentHub, runWithAsyncContext, getIsolationScope } from './hub.js';\nimport { makeSession, updateSession, closeSession } from './session.js';\nimport { parseEventHintOrCaptureContext } from './utils/prepareEvent.js';\n\n/**\n * Captures an exception event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\nfunction captureException(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n exception,\n hint,\n) {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureException(exception, parseEventHintOrCaptureContext(hint));\n}\n\n/**\n * Captures a message event and sends it to Sentry.\n *\n * @param exception The exception to capture.\n * @param captureContext Define the level of the message or pass in additional data to attach to the message.\n * @returns the id of the captured message.\n */\nfunction captureMessage(\n message,\n // eslint-disable-next-line deprecation/deprecation\n captureContext,\n) {\n // This is necessary to provide explicit scopes upgrade, without changing the original\n // arity of the `captureMessage(message, level)` method.\n const level = typeof captureContext === 'string' ? captureContext : undefined;\n const context = typeof captureContext !== 'string' ? { captureContext } : undefined;\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureMessage(message, level, context);\n}\n\n/**\n * Captures a manually created event and sends it to Sentry.\n *\n * @param exception The event to send to Sentry.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\nfunction captureEvent(event, hint) {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().captureEvent(event, hint);\n}\n\n/**\n * Callback to set context information onto the scope.\n * @param callback Callback function that receives Scope.\n *\n * @deprecated Use getCurrentScope() directly.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction configureScope(callback) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().configureScope(callback);\n}\n\n/**\n * Records a new breadcrumb which will be attached to future events.\n *\n * Breadcrumbs will be added to subsequent events to provide more context on\n * user's actions prior to an error or crash.\n *\n * @param breadcrumb The breadcrumb to record.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction addBreadcrumb(breadcrumb, hint) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().addBreadcrumb(breadcrumb, hint);\n}\n\n/**\n * Sets context data with the given name.\n * @param name of the context\n * @param context Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any, deprecation/deprecation\nfunction setContext(name, context) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setContext(name, context);\n}\n\n/**\n * Set an object that will be merged sent as extra data with the event.\n * @param extras Extras object to merge into current context.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setExtras(extras) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setExtras(extras);\n}\n\n/**\n * Set key:value that will be sent as extra data with the event.\n * @param key String of extra\n * @param extra Any kind of data. This data will be normalized.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setExtra(key, extra) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setExtra(key, extra);\n}\n\n/**\n * Set an object that will be merged sent as tags data with the event.\n * @param tags Tags context object to merge into current context.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setTags(tags) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setTags(tags);\n}\n\n/**\n * Set key:value that will be sent as tags data with the event.\n *\n * Can also be used to unset a tag, by passing `undefined`.\n *\n * @param key String key of tag\n * @param value Value of tag\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setTag(key, value) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setTag(key, value);\n}\n\n/**\n * Updates user context information for future events.\n *\n * @param user User context object to be set in the current context. Pass `null` to unset the user.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setUser(user) {\n // eslint-disable-next-line deprecation/deprecation\n getCurrentHub().setUser(user);\n}\n\n/**\n * Creates a new scope with and executes the given operation within.\n * The scope is automatically removed once the operation\n * finishes or throws.\n *\n * This is essentially a convenience function for:\n *\n * pushScope();\n * callback();\n * popScope();\n */\n\n/**\n * Either creates a new active scope, or sets the given scope as active scope in the given callback.\n */\nfunction withScope(\n ...rest\n) {\n // eslint-disable-next-line deprecation/deprecation\n const hub = getCurrentHub();\n\n // If a scope is defined, we want to make this the active scope instead of the default one\n if (rest.length === 2) {\n const [scope, callback] = rest;\n if (!scope) {\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(callback);\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(() => {\n // eslint-disable-next-line deprecation/deprecation\n hub.getStackTop().scope = scope ;\n return callback(scope );\n });\n }\n\n // eslint-disable-next-line deprecation/deprecation\n return hub.withScope(rest[0]);\n}\n\n/**\n * Attempts to fork the current isolation scope and the current scope based on the current async context strategy. If no\n * async context strategy is set, the isolation scope and the current scope will not be forked (this is currently the\n * case, for example, in the browser).\n *\n * Usage of this function in environments without async context strategy is discouraged and may lead to unexpected behaviour.\n *\n * This function is intended for Sentry SDK and SDK integration development. It is not recommended to be used in \"normal\"\n * applications directly because it comes with pitfalls. Use at your own risk!\n *\n * @param callback The callback in which the passed isolation scope is active. (Note: In environments without async\n * context strategy, the currently active isolation scope may change within execution of the callback.)\n * @returns The same value that `callback` returns.\n */\nfunction withIsolationScope(callback) {\n return runWithAsyncContext(() => {\n return callback(getIsolationScope());\n });\n}\n\n/**\n * Forks the current scope and sets the provided span as active span in the context of the provided callback.\n *\n * @param span Spans started in the context of the provided callback will be children of this span.\n * @param callback Execution context in which the provided span will be active. Is passed the newly forked scope.\n * @returns the value returned from the provided callback function.\n */\nfunction withActiveSpan(span, callback) {\n return withScope(scope => {\n // eslint-disable-next-line deprecation/deprecation\n scope.setSpan(span);\n return callback(scope);\n });\n}\n\n/**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.end()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * NOTE: This function should only be used for *manual* instrumentation. Auto-instrumentation should call\n * `startTransaction` directly on the hub.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\nfunction startTransaction(\n context,\n customSamplingContext,\n // eslint-disable-next-line deprecation/deprecation\n) {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().startTransaction({ ...context }, customSamplingContext);\n}\n\n/**\n * Create a cron monitor check in and send it to Sentry.\n *\n * @param checkIn An object that describes a check in.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nfunction captureCheckIn(checkIn, upsertMonitorConfig) {\n const scope = getCurrentScope();\n const client = getClient();\n if (!client) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. No client defined.');\n } else if (!client.captureCheckIn) {\n DEBUG_BUILD && logger.warn('Cannot capture check-in. Client does not support sending check-ins.');\n } else {\n return client.captureCheckIn(checkIn, upsertMonitorConfig, scope);\n }\n\n return uuid4();\n}\n\n/**\n * Wraps a callback with a cron monitor check in. The check in will be sent to Sentry when the callback finishes.\n *\n * @param monitorSlug The distinct slug of the monitor.\n * @param upsertMonitorConfig An optional object that describes a monitor config. Use this if you want\n * to create a monitor automatically when sending a check in.\n */\nfunction withMonitor(\n monitorSlug,\n callback,\n upsertMonitorConfig,\n) {\n const checkInId = captureCheckIn({ monitorSlug, status: 'in_progress' }, upsertMonitorConfig);\n const now = timestampInSeconds();\n\n function finishCheckIn(status) {\n captureCheckIn({ monitorSlug, status, checkInId, duration: timestampInSeconds() - now });\n }\n\n let maybePromiseResult;\n try {\n maybePromiseResult = callback();\n } catch (e) {\n finishCheckIn('error');\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n Promise.resolve(maybePromiseResult).then(\n () => {\n finishCheckIn('ok');\n },\n () => {\n finishCheckIn('error');\n },\n );\n } else {\n finishCheckIn('ok');\n }\n\n return maybePromiseResult;\n}\n\n/**\n * Call `flush()` on the current client, if there is one. See {@link Client.flush}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue. Omitting this parameter will cause\n * the client to wait until all events are sent before resolving the promise.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nasync function flush(timeout) {\n const client = getClient();\n if (client) {\n return client.flush(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * Call `close()` on the current client, if there is one. See {@link Client.close}.\n *\n * @param timeout Maximum time in ms the client should wait to flush its event queue before shutting down. Omitting this\n * parameter will cause the client to wait until all events are sent before disabling itself.\n * @returns A promise which resolves to `true` if the queue successfully drains before the timeout, or `false` if it\n * doesn't (or if there's no client defined).\n */\nasync function close(timeout) {\n const client = getClient();\n if (client) {\n return client.close(timeout);\n }\n DEBUG_BUILD && logger.warn('Cannot flush events and disable SDK. No client defined.');\n return Promise.resolve(false);\n}\n\n/**\n * This is the getter for lastEventId.\n *\n * @returns The last event id of a captured event.\n */\nfunction lastEventId() {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().lastEventId();\n}\n\n/**\n * Get the currently active client.\n */\nfunction getClient() {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getClient();\n}\n\n/**\n * Returns true if Sentry has been properly initialized.\n */\nfunction isInitialized() {\n return !!getClient();\n}\n\n/**\n * Get the currently active scope.\n */\nfunction getCurrentScope() {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getScope();\n}\n\n/**\n * Start a session on the current isolation scope.\n *\n * @param context (optional) additional properties to be applied to the returned session object\n *\n * @returns the new active session\n */\nfunction startSession(context) {\n const client = getClient();\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n release,\n environment,\n user: currentScope.getUser() || isolationScope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = isolationScope.getSession();\n if (currentSession && currentSession.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n\n endSession();\n\n // Afterwards we set the new session on the scope\n isolationScope.setSession(session);\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession(session);\n\n return session;\n}\n\n/**\n * End the session on the current isolation scope.\n */\nfunction endSession() {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session) {\n closeSession(session);\n }\n _sendSessionUpdate();\n\n // the session is over; take it off of the scope\n isolationScope.setSession();\n\n // TODO (v8): Remove this and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n currentScope.setSession();\n}\n\n/**\n * Sends the current Session on the scope\n */\nfunction _sendSessionUpdate() {\n const isolationScope = getIsolationScope();\n const currentScope = getCurrentScope();\n const client = getClient();\n // TODO (v8): Remove currentScope and only use the isolation scope(?).\n // For v7 though, we can't \"soft-break\" people using getCurrentHub().getScope().setSession()\n const session = currentScope.getSession() || isolationScope.getSession();\n if (session && client && client.captureSession) {\n client.captureSession(session);\n }\n}\n\n/**\n * Sends the current session on the scope to Sentry\n *\n * @param end If set the session will be marked as exited and removed from the scope.\n * Defaults to `false`.\n */\nfunction captureSession(end = false) {\n // both send the update and pull the session from the scope\n if (end) {\n endSession();\n return;\n }\n\n // only send the update\n _sendSessionUpdate();\n}\n\nexport { addBreadcrumb, captureCheckIn, captureEvent, captureException, captureMessage, captureSession, close, configureScope, endSession, flush, getClient, getCurrentScope, isInitialized, lastEventId, setContext, setExtra, setExtras, setTag, setTags, setUser, startSession, startTransaction, withActiveSpan, withIsolationScope, withMonitor, withScope };\n//# sourceMappingURL=exports.js.map\n","/**\n * Returns the root span of a given span.\n *\n * As long as we use `Transaction`s internally, the returned root span\n * will be a `Transaction` but be aware that this might change in the future.\n *\n * If the given span has no root span or transaction, `undefined` is returned.\n */\nfunction getRootSpan(span) {\n // TODO (v8): Remove this check and just return span\n // eslint-disable-next-line deprecation/deprecation\n return span.transaction;\n}\n\nexport { getRootSpan };\n//# sourceMappingURL=getRootSpan.js.map\n","import { dropUndefinedKeys } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from '../constants.js';\nimport { getClient, getCurrentScope } from '../exports.js';\nimport { getRootSpan } from '../utils/getRootSpan.js';\nimport { spanToJSON, spanIsSampled } from '../utils/spanUtils.js';\n\n/**\n * Creates a dynamic sampling context from a client.\n *\n * Dispatches the `createDsc` lifecycle hook as a side effect.\n */\nfunction getDynamicSamplingContextFromClient(\n trace_id,\n client,\n scope,\n) {\n const options = client.getOptions();\n\n const { publicKey: public_key } = client.getDsn() || {};\n // TODO(v8): Remove segment from User\n // eslint-disable-next-line deprecation/deprecation\n const { segment: user_segment } = (scope && scope.getUser()) || {};\n\n const dsc = dropUndefinedKeys({\n environment: options.environment || DEFAULT_ENVIRONMENT,\n release: options.release,\n user_segment,\n public_key,\n trace_id,\n }) ;\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\n/**\n * A Span with a frozen dynamic sampling context.\n */\n\n/**\n * Creates a dynamic sampling context from a span (and client and scope)\n *\n * @param span the span from which a few values like the root span name and sample rate are extracted.\n *\n * @returns a dynamic sampling context\n */\nfunction getDynamicSamplingContextFromSpan(span) {\n const client = getClient();\n if (!client) {\n return {};\n }\n\n // passing emit=false here to only emit later once the DSC is actually populated\n const dsc = getDynamicSamplingContextFromClient(spanToJSON(span).trace_id || '', client, getCurrentScope());\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n const txn = getRootSpan(span) ;\n if (!txn) {\n return dsc;\n }\n\n // TODO (v8): Remove v7FrozenDsc as a Transaction will no longer have _frozenDynamicSamplingContext\n // For now we need to avoid breaking users who directly created a txn with a DSC, where this field is still set.\n // @see Transaction class constructor\n const v7FrozenDsc = txn && txn._frozenDynamicSamplingContext;\n if (v7FrozenDsc) {\n return v7FrozenDsc;\n }\n\n // TODO (v8): Replace txn.metadata with txn.attributes[]\n // We can't do this yet because attributes aren't always set yet.\n // eslint-disable-next-line deprecation/deprecation\n const { sampleRate: maybeSampleRate, source } = txn.metadata;\n if (maybeSampleRate != null) {\n dsc.sample_rate = `${maybeSampleRate}`;\n }\n\n // We don't want to have a transaction name in the DSC if the source is \"url\" because URLs might contain PII\n const jsonSpan = spanToJSON(txn);\n\n // after JSON conversion, txn.name becomes jsonSpan.description\n if (source && source !== 'url') {\n dsc.transaction = jsonSpan.description;\n }\n\n dsc.sampled = String(spanIsSampled(txn));\n\n client.emit && client.emit('createDsc', dsc);\n\n return dsc;\n}\n\nexport { getDynamicSamplingContextFromClient, getDynamicSamplingContextFromSpan };\n//# sourceMappingURL=dynamicSamplingContext.js.map\n","import { dropUndefinedKeys, arrayify } from '@sentry/utils';\nimport { getDynamicSamplingContextFromSpan } from '../tracing/dynamicSamplingContext.js';\nimport { getRootSpan } from './getRootSpan.js';\nimport { spanToTraceContext, spanToJSON } from './spanUtils.js';\n\n/**\n * Applies data from the scope to the event and runs all event processors on it.\n */\nfunction applyScopeDataToEvent(event, data) {\n const { fingerprint, span, breadcrumbs, sdkProcessingMetadata } = data;\n\n // Apply general data\n applyDataToEvent(event, data);\n\n // We want to set the trace context for normal events only if there isn't already\n // a trace context on the event. There is a product feature in place where we link\n // errors with transaction and it relies on that.\n if (span) {\n applySpanToEvent(event, span);\n }\n\n applyFingerprintToEvent(event, fingerprint);\n applyBreadcrumbsToEvent(event, breadcrumbs);\n applySdkMetadataToEvent(event, sdkProcessingMetadata);\n}\n\n/** Merge data of two scopes together. */\nfunction mergeScopeData(data, mergeData) {\n const {\n extra,\n tags,\n user,\n contexts,\n level,\n sdkProcessingMetadata,\n breadcrumbs,\n fingerprint,\n eventProcessors,\n attachments,\n propagationContext,\n // eslint-disable-next-line deprecation/deprecation\n transactionName,\n span,\n } = mergeData;\n\n mergeAndOverwriteScopeData(data, 'extra', extra);\n mergeAndOverwriteScopeData(data, 'tags', tags);\n mergeAndOverwriteScopeData(data, 'user', user);\n mergeAndOverwriteScopeData(data, 'contexts', contexts);\n mergeAndOverwriteScopeData(data, 'sdkProcessingMetadata', sdkProcessingMetadata);\n\n if (level) {\n data.level = level;\n }\n\n if (transactionName) {\n // eslint-disable-next-line deprecation/deprecation\n data.transactionName = transactionName;\n }\n\n if (span) {\n data.span = span;\n }\n\n if (breadcrumbs.length) {\n data.breadcrumbs = [...data.breadcrumbs, ...breadcrumbs];\n }\n\n if (fingerprint.length) {\n data.fingerprint = [...data.fingerprint, ...fingerprint];\n }\n\n if (eventProcessors.length) {\n data.eventProcessors = [...data.eventProcessors, ...eventProcessors];\n }\n\n if (attachments.length) {\n data.attachments = [...data.attachments, ...attachments];\n }\n\n data.propagationContext = { ...data.propagationContext, ...propagationContext };\n}\n\n/**\n * Merges certain scope data. Undefined values will overwrite any existing values.\n * Exported only for tests.\n */\nfunction mergeAndOverwriteScopeData\n\n(data, prop, mergeVal) {\n if (mergeVal && Object.keys(mergeVal).length) {\n // Clone object\n data[prop] = { ...data[prop] };\n for (const key in mergeVal) {\n if (Object.prototype.hasOwnProperty.call(mergeVal, key)) {\n data[prop][key] = mergeVal[key];\n }\n }\n }\n}\n\nfunction applyDataToEvent(event, data) {\n const {\n extra,\n tags,\n user,\n contexts,\n level,\n // eslint-disable-next-line deprecation/deprecation\n transactionName,\n } = data;\n\n const cleanedExtra = dropUndefinedKeys(extra);\n if (cleanedExtra && Object.keys(cleanedExtra).length) {\n event.extra = { ...cleanedExtra, ...event.extra };\n }\n\n const cleanedTags = dropUndefinedKeys(tags);\n if (cleanedTags && Object.keys(cleanedTags).length) {\n event.tags = { ...cleanedTags, ...event.tags };\n }\n\n const cleanedUser = dropUndefinedKeys(user);\n if (cleanedUser && Object.keys(cleanedUser).length) {\n event.user = { ...cleanedUser, ...event.user };\n }\n\n const cleanedContexts = dropUndefinedKeys(contexts);\n if (cleanedContexts && Object.keys(cleanedContexts).length) {\n event.contexts = { ...cleanedContexts, ...event.contexts };\n }\n\n if (level) {\n event.level = level;\n }\n\n if (transactionName) {\n event.transaction = transactionName;\n }\n}\n\nfunction applyBreadcrumbsToEvent(event, breadcrumbs) {\n const mergedBreadcrumbs = [...(event.breadcrumbs || []), ...breadcrumbs];\n event.breadcrumbs = mergedBreadcrumbs.length ? mergedBreadcrumbs : undefined;\n}\n\nfunction applySdkMetadataToEvent(event, sdkProcessingMetadata) {\n event.sdkProcessingMetadata = {\n ...event.sdkProcessingMetadata,\n ...sdkProcessingMetadata,\n };\n}\n\nfunction applySpanToEvent(event, span) {\n event.contexts = { trace: spanToTraceContext(span), ...event.contexts };\n const rootSpan = getRootSpan(span);\n if (rootSpan) {\n event.sdkProcessingMetadata = {\n dynamicSamplingContext: getDynamicSamplingContextFromSpan(span),\n ...event.sdkProcessingMetadata,\n };\n const transactionName = spanToJSON(rootSpan).description;\n if (transactionName) {\n event.tags = { transaction: transactionName, ...event.tags };\n }\n }\n}\n\n/**\n * Applies fingerprint from the scope to the event if there's one,\n * uses message if there's one instead or get rid of empty fingerprint\n */\nfunction applyFingerprintToEvent(event, fingerprint) {\n // Make sure it's an array first and we actually have something in place\n event.fingerprint = event.fingerprint ? arrayify(event.fingerprint) : [];\n\n // If we have something on the scope, then merge it with event\n if (fingerprint) {\n event.fingerprint = event.fingerprint.concat(fingerprint);\n }\n\n // If we have no data at all, remove empty array default\n if (event.fingerprint && !event.fingerprint.length) {\n delete event.fingerprint;\n }\n}\n\nexport { applyScopeDataToEvent, mergeAndOverwriteScopeData, mergeScopeData };\n//# sourceMappingURL=applyScopeDataToEvent.js.map\n","import { isPlainObject, dateTimestampInSeconds, uuid4, logger } from '@sentry/utils';\nimport { getGlobalEventProcessors, notifyEventProcessors } from './eventProcessors.js';\nimport { updateSession } from './session.js';\nimport { applyScopeDataToEvent } from './utils/applyScopeDataToEvent.js';\n\n/**\n * Default value for maximum number of breadcrumbs added to an event.\n */\nconst DEFAULT_MAX_BREADCRUMBS = 100;\n\n/**\n * The global scope is kept in this module.\n * When accessing this via `getGlobalScope()` we'll make sure to set one if none is currently present.\n */\nlet globalScope;\n\n/**\n * Holds additional event information. {@link Scope.applyToEvent} will be\n * called by the client before an event will be sent.\n */\nclass Scope {\n /** Flag if notifying is happening. */\n\n /** Callback for client to receive scope changes. */\n\n /** Callback list that will be called after {@link applyToEvent}. */\n\n /** Array of breadcrumbs. */\n\n /** User */\n\n /** Tags */\n\n /** Extra */\n\n /** Contexts */\n\n /** Attachments */\n\n /** Propagation Context for distributed tracing */\n\n /**\n * A place to stash data which is needed at some point in the SDK's event processing pipeline but which shouldn't get\n * sent to Sentry\n */\n\n /** Fingerprint */\n\n /** Severity */\n // eslint-disable-next-line deprecation/deprecation\n\n /**\n * Transaction Name\n */\n\n /** Span */\n\n /** Session */\n\n /** Request Mode Session Status */\n\n /** The client on this scope */\n\n // NOTE: Any field which gets added here should get added not only to the constructor but also to the `clone` method.\n\n constructor() {\n this._notifyingListeners = false;\n this._scopeListeners = [];\n this._eventProcessors = [];\n this._breadcrumbs = [];\n this._attachments = [];\n this._user = {};\n this._tags = {};\n this._extra = {};\n this._contexts = {};\n this._sdkProcessingMetadata = {};\n this._propagationContext = generatePropagationContext();\n }\n\n /**\n * Inherit values from the parent scope.\n * @deprecated Use `scope.clone()` and `new Scope()` instead.\n */\n static clone(scope) {\n return scope ? scope.clone() : new Scope();\n }\n\n /**\n * Clone this scope instance.\n */\n clone() {\n const newScope = new Scope();\n newScope._breadcrumbs = [...this._breadcrumbs];\n newScope._tags = { ...this._tags };\n newScope._extra = { ...this._extra };\n newScope._contexts = { ...this._contexts };\n newScope._user = this._user;\n newScope._level = this._level;\n newScope._span = this._span;\n newScope._session = this._session;\n newScope._transactionName = this._transactionName;\n newScope._fingerprint = this._fingerprint;\n newScope._eventProcessors = [...this._eventProcessors];\n newScope._requestSession = this._requestSession;\n newScope._attachments = [...this._attachments];\n newScope._sdkProcessingMetadata = { ...this._sdkProcessingMetadata };\n newScope._propagationContext = { ...this._propagationContext };\n newScope._client = this._client;\n\n return newScope;\n }\n\n /** Update the client on the scope. */\n setClient(client) {\n this._client = client;\n }\n\n /**\n * Get the client assigned to this scope.\n *\n * It is generally recommended to use the global function `Sentry.getClient()` instead, unless you know what you are doing.\n */\n getClient() {\n return this._client;\n }\n\n /**\n * Add internal on change listener. Used for sub SDKs that need to store the scope.\n * @hidden\n */\n addScopeListener(callback) {\n this._scopeListeners.push(callback);\n }\n\n /**\n * @inheritDoc\n */\n addEventProcessor(callback) {\n this._eventProcessors.push(callback);\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setUser(user) {\n // If null is passed we want to unset everything, but still define keys,\n // so that later down in the pipeline any existing values are cleared.\n this._user = user || {\n email: undefined,\n id: undefined,\n ip_address: undefined,\n segment: undefined,\n username: undefined,\n };\n\n if (this._session) {\n updateSession(this._session, { user });\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getUser() {\n return this._user;\n }\n\n /**\n * @inheritDoc\n */\n getRequestSession() {\n return this._requestSession;\n }\n\n /**\n * @inheritDoc\n */\n setRequestSession(requestSession) {\n this._requestSession = requestSession;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setTags(tags) {\n this._tags = {\n ...this._tags,\n ...tags,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setTag(key, value) {\n this._tags = { ...this._tags, [key]: value };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setExtras(extras) {\n this._extra = {\n ...this._extra,\n ...extras,\n };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setExtra(key, extra) {\n this._extra = { ...this._extra, [key]: extra };\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setFingerprint(fingerprint) {\n this._fingerprint = fingerprint;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setLevel(\n // eslint-disable-next-line deprecation/deprecation\n level,\n ) {\n this._level = level;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the transaction name on the scope for future events.\n */\n setTransactionName(name) {\n this._transactionName = name;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setContext(key, context) {\n if (context === null) {\n // eslint-disable-next-line @typescript-eslint/no-dynamic-delete\n delete this._contexts[key];\n } else {\n this._contexts[key] = context;\n }\n\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Sets the Span on the scope.\n * @param span Span\n * @deprecated Instead of setting a span on a scope, use `startSpan()`/`startSpanManual()` instead.\n */\n setSpan(span) {\n this._span = span;\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * Returns the `Span` if there is one.\n * @deprecated Use `getActiveSpan()` instead.\n */\n getSpan() {\n return this._span;\n }\n\n /**\n * Returns the `Transaction` attached to the scope (if there is one).\n * @deprecated You should not rely on the transaction, but just use `startSpan()` APIs instead.\n */\n getTransaction() {\n // Often, this span (if it exists at all) will be a transaction, but it's not guaranteed to be. Regardless, it will\n // have a pointer to the currently-active transaction.\n const span = this._span;\n // Cannot replace with getRootSpan because getRootSpan returns a span, not a transaction\n // Also, this method will be removed anyway.\n // eslint-disable-next-line deprecation/deprecation\n return span && span.transaction;\n }\n\n /**\n * @inheritDoc\n */\n setSession(session) {\n if (!session) {\n delete this._session;\n } else {\n this._session = session;\n }\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getSession() {\n return this._session;\n }\n\n /**\n * @inheritDoc\n */\n update(captureContext) {\n if (!captureContext) {\n return this;\n }\n\n const scopeToMerge = typeof captureContext === 'function' ? captureContext(this) : captureContext;\n\n if (scopeToMerge instanceof Scope) {\n const scopeData = scopeToMerge.getScopeData();\n\n this._tags = { ...this._tags, ...scopeData.tags };\n this._extra = { ...this._extra, ...scopeData.extra };\n this._contexts = { ...this._contexts, ...scopeData.contexts };\n if (scopeData.user && Object.keys(scopeData.user).length) {\n this._user = scopeData.user;\n }\n if (scopeData.level) {\n this._level = scopeData.level;\n }\n if (scopeData.fingerprint.length) {\n this._fingerprint = scopeData.fingerprint;\n }\n if (scopeToMerge.getRequestSession()) {\n this._requestSession = scopeToMerge.getRequestSession();\n }\n if (scopeData.propagationContext) {\n this._propagationContext = scopeData.propagationContext;\n }\n } else if (isPlainObject(scopeToMerge)) {\n const scopeContext = captureContext ;\n this._tags = { ...this._tags, ...scopeContext.tags };\n this._extra = { ...this._extra, ...scopeContext.extra };\n this._contexts = { ...this._contexts, ...scopeContext.contexts };\n if (scopeContext.user) {\n this._user = scopeContext.user;\n }\n if (scopeContext.level) {\n this._level = scopeContext.level;\n }\n if (scopeContext.fingerprint) {\n this._fingerprint = scopeContext.fingerprint;\n }\n if (scopeContext.requestSession) {\n this._requestSession = scopeContext.requestSession;\n }\n if (scopeContext.propagationContext) {\n this._propagationContext = scopeContext.propagationContext;\n }\n }\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n clear() {\n this._breadcrumbs = [];\n this._tags = {};\n this._extra = {};\n this._user = {};\n this._contexts = {};\n this._level = undefined;\n this._transactionName = undefined;\n this._fingerprint = undefined;\n this._requestSession = undefined;\n this._span = undefined;\n this._session = undefined;\n this._notifyScopeListeners();\n this._attachments = [];\n this._propagationContext = generatePropagationContext();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n addBreadcrumb(breadcrumb, maxBreadcrumbs) {\n const maxCrumbs = typeof maxBreadcrumbs === 'number' ? maxBreadcrumbs : DEFAULT_MAX_BREADCRUMBS;\n\n // No data has been changed, so don't notify scope listeners\n if (maxCrumbs <= 0) {\n return this;\n }\n\n const mergedBreadcrumb = {\n timestamp: dateTimestampInSeconds(),\n ...breadcrumb,\n };\n\n const breadcrumbs = this._breadcrumbs;\n breadcrumbs.push(mergedBreadcrumb);\n this._breadcrumbs = breadcrumbs.length > maxCrumbs ? breadcrumbs.slice(-maxCrumbs) : breadcrumbs;\n\n this._notifyScopeListeners();\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getLastBreadcrumb() {\n return this._breadcrumbs[this._breadcrumbs.length - 1];\n }\n\n /**\n * @inheritDoc\n */\n clearBreadcrumbs() {\n this._breadcrumbs = [];\n this._notifyScopeListeners();\n return this;\n }\n\n /**\n * @inheritDoc\n */\n addAttachment(attachment) {\n this._attachments.push(attachment);\n return this;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `getScopeData()` instead.\n */\n getAttachments() {\n const data = this.getScopeData();\n\n return data.attachments;\n }\n\n /**\n * @inheritDoc\n */\n clearAttachments() {\n this._attachments = [];\n return this;\n }\n\n /** @inheritDoc */\n getScopeData() {\n const {\n _breadcrumbs,\n _attachments,\n _contexts,\n _tags,\n _extra,\n _user,\n _level,\n _fingerprint,\n _eventProcessors,\n _propagationContext,\n _sdkProcessingMetadata,\n _transactionName,\n _span,\n } = this;\n\n return {\n breadcrumbs: _breadcrumbs,\n attachments: _attachments,\n contexts: _contexts,\n tags: _tags,\n extra: _extra,\n user: _user,\n level: _level,\n fingerprint: _fingerprint || [],\n eventProcessors: _eventProcessors,\n propagationContext: _propagationContext,\n sdkProcessingMetadata: _sdkProcessingMetadata,\n transactionName: _transactionName,\n span: _span,\n };\n }\n\n /**\n * Applies data from the scope to the event and runs all event processors on it.\n *\n * @param event Event\n * @param hint Object containing additional information about the original exception, for use by the event processors.\n * @hidden\n * @deprecated Use `applyScopeDataToEvent()` directly\n */\n applyToEvent(\n event,\n hint = {},\n additionalEventProcessors = [],\n ) {\n applyScopeDataToEvent(event, this.getScopeData());\n\n // TODO (v8): Update this order to be: Global > Client > Scope\n const eventProcessors = [\n ...additionalEventProcessors,\n // eslint-disable-next-line deprecation/deprecation\n ...getGlobalEventProcessors(),\n ...this._eventProcessors,\n ];\n\n return notifyEventProcessors(eventProcessors, event, hint);\n }\n\n /**\n * Add data which will be accessible during event processing but won't get sent to Sentry\n */\n setSDKProcessingMetadata(newData) {\n this._sdkProcessingMetadata = { ...this._sdkProcessingMetadata, ...newData };\n\n return this;\n }\n\n /**\n * @inheritDoc\n */\n setPropagationContext(context) {\n this._propagationContext = context;\n return this;\n }\n\n /**\n * @inheritDoc\n */\n getPropagationContext() {\n return this._propagationContext;\n }\n\n /**\n * Capture an exception for this scope.\n *\n * @param exception The exception to capture.\n * @param hint Optinal additional data to attach to the Sentry event.\n * @returns the id of the captured Sentry event.\n */\n captureException(exception, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture exception!');\n return eventId;\n }\n\n const syntheticException = new Error('Sentry syntheticException');\n\n this._client.captureException(\n exception,\n {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Capture a message for this scope.\n *\n * @param message The message to capture.\n * @param level An optional severity level to report the message with.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured message.\n */\n captureMessage(message, level, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture message!');\n return eventId;\n }\n\n const syntheticException = new Error(message);\n\n this._client.captureMessage(\n message,\n level,\n {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n },\n this,\n );\n\n return eventId;\n }\n\n /**\n * Captures a manually created event for this scope and sends it to Sentry.\n *\n * @param exception The event to capture.\n * @param hint Optional additional data to attach to the Sentry event.\n * @returns the id of the captured event.\n */\n captureEvent(event, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n\n if (!this._client) {\n logger.warn('No client configured on scope - will not capture event!');\n return eventId;\n }\n\n this._client.captureEvent(event, { ...hint, event_id: eventId }, this);\n\n return eventId;\n }\n\n /**\n * This will be called on every set call.\n */\n _notifyScopeListeners() {\n // We need this check for this._notifyingListeners to be able to work on scope during updates\n // If this check is not here we'll produce endless recursion when something is done with the scope\n // during the callback.\n if (!this._notifyingListeners) {\n this._notifyingListeners = true;\n this._scopeListeners.forEach(callback => {\n callback(this);\n });\n this._notifyingListeners = false;\n }\n }\n}\n\n/**\n * Get the global scope.\n * This scope is applied to _all_ events.\n */\nfunction getGlobalScope() {\n if (!globalScope) {\n globalScope = new Scope();\n }\n\n return globalScope;\n}\n\n/**\n * This is mainly needed for tests.\n * DO NOT USE this, as this is an internal API and subject to change.\n * @hidden\n */\nfunction setGlobalScope(scope) {\n globalScope = scope;\n}\n\nfunction generatePropagationContext() {\n return {\n traceId: uuid4(),\n spanId: uuid4().substring(16),\n };\n}\n\nexport { Scope, getGlobalScope, setGlobalScope };\n//# sourceMappingURL=scope.js.map\n","const SDK_VERSION = '7.120.0';\n\nexport { SDK_VERSION };\n//# sourceMappingURL=version.js.map\n","import { isThenable, uuid4, dateTimestampInSeconds, consoleSandbox, logger, GLOBAL_OBJ, getGlobalSingleton } from '@sentry/utils';\nimport { DEFAULT_ENVIRONMENT } from './constants.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { Scope } from './scope.js';\nimport { closeSession, makeSession, updateSession } from './session.js';\nimport { SDK_VERSION } from './version.js';\n\n/**\n * API compatibility version of this hub.\n *\n * WARNING: This number should only be increased when the global interface\n * changes and new methods are introduced.\n *\n * @hidden\n */\nconst API_VERSION = parseFloat(SDK_VERSION);\n\n/**\n * Default maximum number of breadcrumbs added to an event. Can be overwritten\n * with {@link Options.maxBreadcrumbs}.\n */\nconst DEFAULT_BREADCRUMBS = 100;\n\n/**\n * @deprecated The `Hub` class will be removed in version 8 of the SDK in favour of `Scope` and `Client` objects.\n *\n * If you previously used the `Hub` class directly, replace it with `Scope` and `Client` objects. More information:\n * - [Multiple Sentry Instances](https://docs.sentry.io/platforms/javascript/best-practices/multiple-sentry-instances/)\n * - [Browser Extensions](https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/)\n *\n * Some of our APIs are typed with the Hub class instead of the interface (e.g. `getCurrentHub`). Most of them are deprecated\n * themselves and will also be removed in version 8. More information:\n * - [Migration Guide](https://github.com/getsentry/sentry-javascript/blob/develop/MIGRATION.md#deprecate-hub)\n */\n// eslint-disable-next-line deprecation/deprecation\nclass Hub {\n /** Is a {@link Layer}[] containing the client and scope */\n\n /** Contains the last event id of a captured event. */\n\n /**\n * Creates a new instance of the hub, will push one {@link Layer} into the\n * internal stack on creation.\n *\n * @param client bound to the hub.\n * @param scope bound to the hub.\n * @param version number, higher number means higher priority.\n *\n * @deprecated Instantiation of Hub objects is deprecated and the constructor will be removed in version 8 of the SDK.\n *\n * If you are currently using the Hub for multi-client use like so:\n *\n * ```\n * // OLD\n * const hub = new Hub();\n * hub.bindClient(client);\n * makeMain(hub)\n * ```\n *\n * instead initialize the client as follows:\n *\n * ```\n * // NEW\n * Sentry.withIsolationScope(() => {\n * Sentry.setCurrentClient(client);\n * client.init();\n * });\n * ```\n *\n * If you are using the Hub to capture events like so:\n *\n * ```\n * // OLD\n * const client = new Client();\n * const hub = new Hub(client);\n * hub.captureException()\n * ```\n *\n * instead capture isolated events as follows:\n *\n * ```\n * // NEW\n * const client = new Client();\n * const scope = new Scope();\n * scope.setClient(client);\n * scope.captureException();\n * ```\n */\n constructor(\n client,\n scope,\n isolationScope,\n _version = API_VERSION,\n ) {this._version = _version;\n let assignedScope;\n if (!scope) {\n assignedScope = new Scope();\n assignedScope.setClient(client);\n } else {\n assignedScope = scope;\n }\n\n let assignedIsolationScope;\n if (!isolationScope) {\n assignedIsolationScope = new Scope();\n assignedIsolationScope.setClient(client);\n } else {\n assignedIsolationScope = isolationScope;\n }\n\n this._stack = [{ scope: assignedScope }];\n\n if (client) {\n // eslint-disable-next-line deprecation/deprecation\n this.bindClient(client);\n }\n\n this._isolationScope = assignedIsolationScope;\n }\n\n /**\n * Checks if this hub's version is older than the given version.\n *\n * @param version A version number to compare to.\n * @return True if the given version is newer; otherwise false.\n *\n * @deprecated This will be removed in v8.\n */\n isOlderThan(version) {\n return this._version < version;\n }\n\n /**\n * This binds the given client to the current scope.\n * @param client An SDK client (client) instance.\n *\n * @deprecated Use `initAndBind()` directly, or `setCurrentClient()` and/or `client.init()` instead.\n */\n bindClient(client) {\n // eslint-disable-next-line deprecation/deprecation\n const top = this.getStackTop();\n top.client = client;\n top.scope.setClient(client);\n // eslint-disable-next-line deprecation/deprecation\n if (client && client.setupIntegrations) {\n // eslint-disable-next-line deprecation/deprecation\n client.setupIntegrations();\n }\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `withScope` instead.\n */\n pushScope() {\n // We want to clone the content of prev scope\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.getScope().clone();\n // eslint-disable-next-line deprecation/deprecation\n this.getStack().push({\n // eslint-disable-next-line deprecation/deprecation\n client: this.getClient(),\n scope,\n });\n return scope;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `withScope` instead.\n */\n popScope() {\n // eslint-disable-next-line deprecation/deprecation\n if (this.getStack().length <= 1) return false;\n // eslint-disable-next-line deprecation/deprecation\n return !!this.getStack().pop();\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.withScope()` instead.\n */\n withScope(callback) {\n // eslint-disable-next-line deprecation/deprecation\n const scope = this.pushScope();\n\n let maybePromiseResult;\n try {\n maybePromiseResult = callback(scope);\n } catch (e) {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n throw e;\n }\n\n if (isThenable(maybePromiseResult)) {\n // @ts-expect-error - isThenable returns the wrong type\n return maybePromiseResult.then(\n res => {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n return res;\n },\n e => {\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n throw e;\n },\n );\n }\n\n // eslint-disable-next-line deprecation/deprecation\n this.popScope();\n return maybePromiseResult;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.getClient()` instead.\n */\n getClient() {\n // eslint-disable-next-line deprecation/deprecation\n return this.getStackTop().client ;\n }\n\n /**\n * Returns the scope of the top stack.\n *\n * @deprecated Use `Sentry.getCurrentScope()` instead.\n */\n getScope() {\n // eslint-disable-next-line deprecation/deprecation\n return this.getStackTop().scope;\n }\n\n /**\n * @deprecated Use `Sentry.getIsolationScope()` instead.\n */\n getIsolationScope() {\n return this._isolationScope;\n }\n\n /**\n * Returns the scope stack for domains or the process.\n * @deprecated This will be removed in v8.\n */\n getStack() {\n return this._stack;\n }\n\n /**\n * Returns the topmost scope layer in the order domain > local > process.\n * @deprecated This will be removed in v8.\n */\n getStackTop() {\n return this._stack[this._stack.length - 1];\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureException()` instead.\n */\n captureException(exception, hint) {\n const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n const syntheticException = new Error('Sentry syntheticException');\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureException(exception, {\n originalException: exception,\n syntheticException,\n ...hint,\n event_id: eventId,\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureMessage()` instead.\n */\n captureMessage(\n message,\n // eslint-disable-next-line deprecation/deprecation\n level,\n hint,\n ) {\n const eventId = (this._lastEventId = hint && hint.event_id ? hint.event_id : uuid4());\n const syntheticException = new Error(message);\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureMessage(message, level, {\n originalException: message,\n syntheticException,\n ...hint,\n event_id: eventId,\n });\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.captureEvent()` instead.\n */\n captureEvent(event, hint) {\n const eventId = hint && hint.event_id ? hint.event_id : uuid4();\n if (!event.type) {\n this._lastEventId = eventId;\n }\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().captureEvent(event, { ...hint, event_id: eventId });\n return eventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated This will be removed in v8.\n */\n lastEventId() {\n return this._lastEventId;\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `Sentry.addBreadcrumb()` instead.\n */\n addBreadcrumb(breadcrumb, hint) {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n\n if (!client) return;\n\n const { beforeBreadcrumb = null, maxBreadcrumbs = DEFAULT_BREADCRUMBS } =\n (client.getOptions && client.getOptions()) || {};\n\n if (maxBreadcrumbs <= 0) return;\n\n const timestamp = dateTimestampInSeconds();\n const mergedBreadcrumb = { timestamp, ...breadcrumb };\n const finalBreadcrumb = beforeBreadcrumb\n ? (consoleSandbox(() => beforeBreadcrumb(mergedBreadcrumb, hint)) )\n : mergedBreadcrumb;\n\n if (finalBreadcrumb === null) return;\n\n if (client.emit) {\n client.emit('beforeAddBreadcrumb', finalBreadcrumb, hint);\n }\n\n // TODO(v8): I know this comment doesn't make much sense because the hub will be deprecated but I still wanted to\n // write it down. In theory, we would have to add the breadcrumbs to the isolation scope here, however, that would\n // duplicate all of the breadcrumbs. There was the possibility of adding breadcrumbs to both, the isolation scope\n // and the normal scope, and deduplicating it down the line in the event processing pipeline. However, that would\n // have been very fragile, because the breadcrumb objects would have needed to keep their identity all throughout\n // the event processing pipeline.\n // In the new implementation, the top level `Sentry.addBreadcrumb()` should ONLY write to the isolation scope.\n\n scope.addBreadcrumb(finalBreadcrumb, maxBreadcrumbs);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setUser()` instead.\n */\n setUser(user) {\n // TODO(v8): The top level `Sentry.setUser()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setUser(user);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setUser(user);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setTags()` instead.\n */\n setTags(tags) {\n // TODO(v8): The top level `Sentry.setTags()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setTags(tags);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setTags(tags);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setExtras()` instead.\n */\n setExtras(extras) {\n // TODO(v8): The top level `Sentry.setExtras()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setExtras(extras);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setExtras(extras);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setTag()` instead.\n */\n setTag(key, value) {\n // TODO(v8): The top level `Sentry.setTag()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setTag(key, value);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setTag(key, value);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setExtra()` instead.\n */\n setExtra(key, extra) {\n // TODO(v8): The top level `Sentry.setExtra()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setExtra(key, extra);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setExtra(key, extra);\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.setContext()` instead.\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n setContext(name, context) {\n // TODO(v8): The top level `Sentry.setContext()` function should write ONLY to the isolation scope.\n // eslint-disable-next-line deprecation/deprecation\n this.getScope().setContext(name, context);\n // eslint-disable-next-line deprecation/deprecation\n this.getIsolationScope().setContext(name, context);\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use `getScope()` directly.\n */\n configureScope(callback) {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n if (client) {\n callback(scope);\n }\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line deprecation/deprecation\n run(callback) {\n // eslint-disable-next-line deprecation/deprecation\n const oldHub = makeMain(this);\n try {\n callback(this);\n } finally {\n // eslint-disable-next-line deprecation/deprecation\n makeMain(oldHub);\n }\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `Sentry.getClient().getIntegrationByName()` instead.\n */\n getIntegration(integration) {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n if (!client) return null;\n try {\n // eslint-disable-next-line deprecation/deprecation\n return client.getIntegration(integration);\n } catch (_oO) {\n DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Hub`);\n return null;\n }\n }\n\n /**\n * Starts a new `Transaction` and returns it. This is the entry point to manual tracing instrumentation.\n *\n * A tree structure can be built by adding child spans to the transaction, and child spans to other spans. To start a\n * new child span within the transaction or any span, call the respective `.startChild()` method.\n *\n * Every child span must be finished before the transaction is finished, otherwise the unfinished spans are discarded.\n *\n * The transaction must be finished with a call to its `.end()` method, at which point the transaction with all its\n * finished child spans will be sent to Sentry.\n *\n * @param context Properties of the new `Transaction`.\n * @param customSamplingContext Information given to the transaction sampling function (along with context-dependent\n * default values). See {@link Options.tracesSampler}.\n *\n * @returns The transaction which was just started\n *\n * @deprecated Use `startSpan()`, `startSpanManual()` or `startInactiveSpan()` instead.\n */\n startTransaction(context, customSamplingContext) {\n const result = this._callExtensionMethod('startTransaction', context, customSamplingContext);\n\n if (DEBUG_BUILD && !result) {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n if (!client) {\n logger.warn(\n \"Tracing extension 'startTransaction' is missing. You should 'init' the SDK before calling 'startTransaction'\",\n );\n } else {\n logger.warn(`Tracing extension 'startTransaction' has not been added. Call 'addTracingExtensions' before calling 'init':\nSentry.addTracingExtensions();\nSentry.init({...});\n`);\n }\n }\n\n return result;\n }\n\n /**\n * @inheritDoc\n * @deprecated Use `spanToTraceHeader()` instead.\n */\n traceHeaders() {\n return this._callExtensionMethod('traceHeaders');\n }\n\n /**\n * @inheritDoc\n *\n * @deprecated Use top level `captureSession` instead.\n */\n captureSession(endSession = false) {\n // both send the update and pull the session from the scope\n if (endSession) {\n // eslint-disable-next-line deprecation/deprecation\n return this.endSession();\n }\n\n // only send the update\n this._sendSessionUpdate();\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top level `endSession` instead.\n */\n endSession() {\n // eslint-disable-next-line deprecation/deprecation\n const layer = this.getStackTop();\n const scope = layer.scope;\n const session = scope.getSession();\n if (session) {\n closeSession(session);\n }\n this._sendSessionUpdate();\n\n // the session is over; take it off of the scope\n scope.setSession();\n }\n\n /**\n * @inheritDoc\n * @deprecated Use top level `startSession` instead.\n */\n startSession(context) {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n const { release, environment = DEFAULT_ENVIRONMENT } = (client && client.getOptions()) || {};\n\n // Will fetch userAgent if called from browser sdk\n const { userAgent } = GLOBAL_OBJ.navigator || {};\n\n const session = makeSession({\n release,\n environment,\n user: scope.getUser(),\n ...(userAgent && { userAgent }),\n ...context,\n });\n\n // End existing session if there's one\n const currentSession = scope.getSession && scope.getSession();\n if (currentSession && currentSession.status === 'ok') {\n updateSession(currentSession, { status: 'exited' });\n }\n // eslint-disable-next-line deprecation/deprecation\n this.endSession();\n\n // Afterwards we set the new session on the scope\n scope.setSession(session);\n\n return session;\n }\n\n /**\n * Returns if default PII should be sent to Sentry and propagated in ourgoing requests\n * when Tracing is used.\n *\n * @deprecated Use top-level `getClient().getOptions().sendDefaultPii` instead. This function\n * only unnecessarily increased API surface but only wrapped accessing the option.\n */\n shouldSendDefaultPii() {\n // eslint-disable-next-line deprecation/deprecation\n const client = this.getClient();\n const options = client && client.getOptions();\n return Boolean(options && options.sendDefaultPii);\n }\n\n /**\n * Sends the current Session on the scope\n */\n _sendSessionUpdate() {\n // eslint-disable-next-line deprecation/deprecation\n const { scope, client } = this.getStackTop();\n\n const session = scope.getSession();\n if (session && client && client.captureSession) {\n client.captureSession(session);\n }\n }\n\n /**\n * Calls global extension method and binding current instance to the function call\n */\n // @ts-expect-error Function lacks ending return statement and return type does not include 'undefined'. ts(2366)\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n _callExtensionMethod(method, ...args) {\n const carrier = getMainCarrier();\n const sentry = carrier.__SENTRY__;\n if (sentry && sentry.extensions && typeof sentry.extensions[method] === 'function') {\n return sentry.extensions[method].apply(this, args);\n }\n DEBUG_BUILD && logger.warn(`Extension method ${method} couldn't be found, doing nothing.`);\n }\n}\n\n/**\n * Returns the global shim registry.\n *\n * FIXME: This function is problematic, because despite always returning a valid Carrier,\n * it has an optional `__SENTRY__` property, which then in turn requires us to always perform an unnecessary check\n * at the call-site. We always access the carrier through this function, so we can guarantee that `__SENTRY__` is there.\n **/\nfunction getMainCarrier() {\n GLOBAL_OBJ.__SENTRY__ = GLOBAL_OBJ.__SENTRY__ || {\n extensions: {},\n hub: undefined,\n };\n return GLOBAL_OBJ;\n}\n\n/**\n * Replaces the current main hub with the passed one on the global object\n *\n * @returns The old replaced hub\n *\n * @deprecated Use `setCurrentClient()` instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction makeMain(hub) {\n const registry = getMainCarrier();\n const oldHub = getHubFromCarrier(registry);\n setHubOnCarrier(registry, hub);\n return oldHub;\n}\n\n/**\n * Returns the default hub instance.\n *\n * If a hub is already registered in the global carrier but this module\n * contains a more recent version, it replaces the registered version.\n * Otherwise, the currently registered hub will be returned.\n *\n * @deprecated Use the respective replacement method directly instead.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction getCurrentHub() {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n\n if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n const hub = registry.__SENTRY__.acs.getCurrentHub();\n\n if (hub) {\n return hub;\n }\n }\n\n // Return hub that lives on a global object\n return getGlobalHub(registry);\n}\n\n/**\n * Get the currently active isolation scope.\n * The isolation scope is active for the current exection context,\n * meaning that it will remain stable for the same Hub.\n */\nfunction getIsolationScope() {\n // eslint-disable-next-line deprecation/deprecation\n return getCurrentHub().getIsolationScope();\n}\n\n// eslint-disable-next-line deprecation/deprecation\nfunction getGlobalHub(registry = getMainCarrier()) {\n // If there's no hub, or its an old API, assign a new one\n\n if (\n !hasHubOnCarrier(registry) ||\n // eslint-disable-next-line deprecation/deprecation\n getHubFromCarrier(registry).isOlderThan(API_VERSION)\n ) {\n // eslint-disable-next-line deprecation/deprecation\n setHubOnCarrier(registry, new Hub());\n }\n\n // Return hub that lives on a global object\n return getHubFromCarrier(registry);\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * If the carrier does not contain a hub, a new hub is created with the global hub client and scope.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction ensureHubOnCarrier(carrier, parent = getGlobalHub()) {\n // If there's no hub on current domain, or it's an old API, assign a new one\n if (\n !hasHubOnCarrier(carrier) ||\n // eslint-disable-next-line deprecation/deprecation\n getHubFromCarrier(carrier).isOlderThan(API_VERSION)\n ) {\n // eslint-disable-next-line deprecation/deprecation\n const client = parent.getClient();\n // eslint-disable-next-line deprecation/deprecation\n const scope = parent.getScope();\n // eslint-disable-next-line deprecation/deprecation\n const isolationScope = parent.getIsolationScope();\n // eslint-disable-next-line deprecation/deprecation\n setHubOnCarrier(carrier, new Hub(client, scope.clone(), isolationScope.clone()));\n }\n}\n\n/**\n * @private Private API with no semver guarantees!\n *\n * Sets the global async context strategy\n */\nfunction setAsyncContextStrategy(strategy) {\n // Get main carrier (global for every environment)\n const registry = getMainCarrier();\n registry.__SENTRY__ = registry.__SENTRY__ || {};\n registry.__SENTRY__.acs = strategy;\n}\n\n/**\n * Runs the supplied callback in its own async context. Async Context strategies are defined per SDK.\n *\n * @param callback The callback to run in its own async context\n * @param options Options to pass to the async context strategy\n * @returns The result of the callback\n */\nfunction runWithAsyncContext(callback, options = {}) {\n const registry = getMainCarrier();\n\n if (registry.__SENTRY__ && registry.__SENTRY__.acs) {\n return registry.__SENTRY__.acs.runWithAsyncContext(callback, options);\n }\n\n // if there was no strategy, fallback to just calling the callback\n return callback();\n}\n\n/**\n * This will tell whether a carrier has a hub on it or not\n * @param carrier object\n */\nfunction hasHubOnCarrier(carrier) {\n return !!(carrier && carrier.__SENTRY__ && carrier.__SENTRY__.hub);\n}\n\n/**\n * This will create a new {@link Hub} and add to the passed object on\n * __SENTRY__.hub.\n * @param carrier object\n * @hidden\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction getHubFromCarrier(carrier) {\n // eslint-disable-next-line deprecation/deprecation\n return getGlobalSingleton('hub', () => new Hub(), carrier);\n}\n\n/**\n * This will set passed {@link Hub} on the passed object's __SENTRY__.hub attribute\n * @param carrier object\n * @param hub Hub\n * @returns A boolean indicating success or failure\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction setHubOnCarrier(carrier, hub) {\n if (!carrier) return false;\n const __SENTRY__ = (carrier.__SENTRY__ = carrier.__SENTRY__ || {});\n __SENTRY__.hub = hub;\n return true;\n}\n\nexport { API_VERSION, Hub, ensureHubOnCarrier, getCurrentHub, getHubFromCarrier, getIsolationScope, getMainCarrier, makeMain, runWithAsyncContext, setAsyncContextStrategy, setHubOnCarrier };\n//# sourceMappingURL=hub.js.map\n","/**\n * Use this attribute to represent the source of a span.\n * Should be one of: custom, url, route, view, component, task, unknown\n *\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_SOURCE = 'sentry.source';\n\n/**\n * Use this attribute to represent the sample rate used for a span.\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE = 'sentry.sample_rate';\n\n/**\n * Use this attribute to represent the operation of a span.\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_OP = 'sentry.op';\n\n/**\n * Use this attribute to represent the origin of a span.\n */\nconst SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN = 'sentry.origin';\n\n/**\n * The id of the profile that this span occured in.\n */\nconst SEMANTIC_ATTRIBUTE_PROFILE_ID = 'profile_id';\n\nexport { SEMANTIC_ATTRIBUTE_PROFILE_ID, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE };\n//# sourceMappingURL=semanticAttributes.js.map\n","import { makeDsn, logger, checkOrSetAlreadyCaught, isParameterizedString, isPrimitive, resolvedSyncPromise, addItemToEnvelope, createAttachmentEnvelopeItem, SyncPromise, rejectedSyncPromise, SentryError, isThenable, isPlainObject } from '@sentry/utils';\nimport { getEnvelopeEndpointWithUrlEncodedAuth } from './api.js';\nimport { DEBUG_BUILD } from './debug-build.js';\nimport { createEventEnvelope, createSessionEnvelope } from './envelope.js';\nimport { getClient } from './exports.js';\nimport { getIsolationScope } from './hub.js';\nimport { setupIntegration, afterSetupIntegrations, setupIntegrations } from './integration.js';\nimport { createMetricEnvelope } from './metrics/envelope.js';\nimport { updateSession } from './session.js';\nimport { getDynamicSamplingContextFromClient } from './tracing/dynamicSamplingContext.js';\nimport { prepareEvent } from './utils/prepareEvent.js';\n\nconst ALREADY_SEEN_ERROR = \"Not capturing exception because it's already been captured.\";\n\n/**\n * Base implementation for all JavaScript SDK clients.\n *\n * Call the constructor with the corresponding options\n * specific to the client subclass. To access these options later, use\n * {@link Client.getOptions}.\n *\n * If a Dsn is specified in the options, it will be parsed and stored. Use\n * {@link Client.getDsn} to retrieve the Dsn at any moment. In case the Dsn is\n * invalid, the constructor will throw a {@link SentryException}. Note that\n * without a valid Dsn, the SDK will not send any events to Sentry.\n *\n * Before sending an event, it is passed through\n * {@link BaseClient._prepareEvent} to add SDK information and scope data\n * (breadcrumbs and context). To add more custom information, override this\n * method and extend the resulting prepared event.\n *\n * To issue automatically created events (e.g. via instrumentation), use\n * {@link Client.captureEvent}. It will prepare the event and pass it through\n * the callback lifecycle. To issue auto-breadcrumbs, use\n * {@link Client.addBreadcrumb}.\n *\n * @example\n * class NodeClient extends BaseClient {\n * public constructor(options: NodeOptions) {\n * super(options);\n * }\n *\n * // ...\n * }\n */\nclass BaseClient {\n /**\n * A reference to a metrics aggregator\n *\n * @experimental Note this is alpha API. It may experience breaking changes in the future.\n */\n\n /** Options passed to the SDK. */\n\n /** The client Dsn, if specified in options. Without this Dsn, the SDK will be disabled. */\n\n /** Array of set up integrations. */\n\n /** Indicates whether this client's integrations have been set up. */\n\n /** Number of calls being processed */\n\n /** Holds flushable */\n\n // eslint-disable-next-line @typescript-eslint/ban-types\n\n /**\n * Initializes this client instance.\n *\n * @param options Options for the client.\n */\n constructor(options) {\n this._options = options;\n this._integrations = {};\n this._integrationsInitialized = false;\n this._numProcessing = 0;\n this._outcomes = {};\n this._hooks = {};\n this._eventProcessors = [];\n\n if (options.dsn) {\n this._dsn = makeDsn(options.dsn);\n } else {\n DEBUG_BUILD && logger.warn('No DSN provided, client will not send events.');\n }\n\n if (this._dsn) {\n const url = getEnvelopeEndpointWithUrlEncodedAuth(this._dsn, options);\n this._transport = options.transport({\n tunnel: this._options.tunnel,\n recordDroppedEvent: this.recordDroppedEvent.bind(this),\n ...options.transportOptions,\n url,\n });\n }\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n captureException(exception, hint, scope) {\n // ensure we haven't captured this very object before\n if (checkOrSetAlreadyCaught(exception)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n let eventId = hint && hint.event_id;\n\n this._process(\n this.eventFromException(exception, hint)\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n captureMessage(\n message,\n // eslint-disable-next-line deprecation/deprecation\n level,\n hint,\n scope,\n ) {\n let eventId = hint && hint.event_id;\n\n const eventMessage = isParameterizedString(message) ? message : String(message);\n\n const promisedEvent = isPrimitive(message)\n ? this.eventFromMessage(eventMessage, level, hint)\n : this.eventFromException(message, hint);\n\n this._process(\n promisedEvent\n .then(event => this._captureEvent(event, hint, scope))\n .then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n captureEvent(event, hint, scope) {\n // ensure we haven't captured this very object before\n if (hint && hint.originalException && checkOrSetAlreadyCaught(hint.originalException)) {\n DEBUG_BUILD && logger.log(ALREADY_SEEN_ERROR);\n return;\n }\n\n let eventId = hint && hint.event_id;\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanScope = sdkProcessingMetadata.capturedSpanScope;\n\n this._process(\n this._captureEvent(event, hint, capturedSpanScope || scope).then(result => {\n eventId = result;\n }),\n );\n\n return eventId;\n }\n\n /**\n * @inheritDoc\n */\n captureSession(session) {\n if (!(typeof session.release === 'string')) {\n DEBUG_BUILD && logger.warn('Discarded session because of missing or non-string release');\n } else {\n this.sendSession(session);\n // After sending, we set init false to indicate it's not the first occurrence\n updateSession(session, { init: false });\n }\n }\n\n /**\n * @inheritDoc\n */\n getDsn() {\n return this._dsn;\n }\n\n /**\n * @inheritDoc\n */\n getOptions() {\n return this._options;\n }\n\n /**\n * @see SdkMetadata in @sentry/types\n *\n * @return The metadata of the SDK\n */\n getSdkMetadata() {\n return this._options._metadata;\n }\n\n /**\n * @inheritDoc\n */\n getTransport() {\n return this._transport;\n }\n\n /**\n * @inheritDoc\n */\n flush(timeout) {\n const transport = this._transport;\n if (transport) {\n if (this.metricsAggregator) {\n this.metricsAggregator.flush();\n }\n return this._isClientDoneProcessing(timeout).then(clientFinished => {\n return transport.flush(timeout).then(transportFlushed => clientFinished && transportFlushed);\n });\n } else {\n return resolvedSyncPromise(true);\n }\n }\n\n /**\n * @inheritDoc\n */\n close(timeout) {\n return this.flush(timeout).then(result => {\n this.getOptions().enabled = false;\n if (this.metricsAggregator) {\n this.metricsAggregator.close();\n }\n return result;\n });\n }\n\n /** Get all installed event processors. */\n getEventProcessors() {\n return this._eventProcessors;\n }\n\n /** @inheritDoc */\n addEventProcessor(eventProcessor) {\n this._eventProcessors.push(eventProcessor);\n }\n\n /**\n * This is an internal function to setup all integrations that should run on the client.\n * @deprecated Use `client.init()` instead.\n */\n setupIntegrations(forceInitialize) {\n if ((forceInitialize && !this._integrationsInitialized) || (this._isEnabled() && !this._integrationsInitialized)) {\n this._setupIntegrations();\n }\n }\n\n /** @inheritdoc */\n init() {\n if (this._isEnabled()) {\n this._setupIntegrations();\n }\n }\n\n /**\n * Gets an installed integration by its `id`.\n *\n * @returns The installed integration or `undefined` if no integration with that `id` was installed.\n * @deprecated Use `getIntegrationByName()` instead.\n */\n getIntegrationById(integrationId) {\n return this.getIntegrationByName(integrationId);\n }\n\n /**\n * Gets an installed integration by its name.\n *\n * @returns The installed integration or `undefined` if no integration with that `name` was installed.\n */\n getIntegrationByName(integrationName) {\n return this._integrations[integrationName] ;\n }\n\n /**\n * Returns the client's instance of the given integration class, it any.\n * @deprecated Use `getIntegrationByName()` instead.\n */\n getIntegration(integration) {\n try {\n return (this._integrations[integration.id] ) || null;\n } catch (_oO) {\n DEBUG_BUILD && logger.warn(`Cannot retrieve integration ${integration.id} from the current Client`);\n return null;\n }\n }\n\n /**\n * @inheritDoc\n */\n addIntegration(integration) {\n const isAlreadyInstalled = this._integrations[integration.name];\n\n // This hook takes care of only installing if not already installed\n setupIntegration(this, integration, this._integrations);\n // Here we need to check manually to make sure to not run this multiple times\n if (!isAlreadyInstalled) {\n afterSetupIntegrations(this, [integration]);\n }\n }\n\n /**\n * @inheritDoc\n */\n sendEvent(event, hint = {}) {\n this.emit('beforeSendEvent', event, hint);\n\n let env = createEventEnvelope(event, this._dsn, this._options._metadata, this._options.tunnel);\n\n for (const attachment of hint.attachments || []) {\n env = addItemToEnvelope(\n env,\n createAttachmentEnvelopeItem(\n attachment,\n this._options.transportOptions && this._options.transportOptions.textEncoder,\n ),\n );\n }\n\n const promise = this._sendEnvelope(env);\n if (promise) {\n promise.then(sendResponse => this.emit('afterSendEvent', event, sendResponse), null);\n }\n }\n\n /**\n * @inheritDoc\n */\n sendSession(session) {\n const env = createSessionEnvelope(session, this._dsn, this._options._metadata, this._options.tunnel);\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(env);\n }\n\n /**\n * @inheritDoc\n */\n recordDroppedEvent(reason, category, eventOrCount) {\n if (this._options.sendClientReports) {\n // TODO v9: We do not need the `event` passed as third argument anymore, and can possibly remove this overload\n // If event is passed as third argument, we assume this is a count of 1\n const count = typeof eventOrCount === 'number' ? eventOrCount : 1;\n\n // We want to track each category (error, transaction, session, replay_event) separately\n // but still keep the distinction between different type of outcomes.\n // We could use nested maps, but it's much easier to read and type this way.\n // A correct type for map-based implementation if we want to go that route\n // would be `Partial>>>`\n // With typescript 4.1 we could even use template literal types\n const key = `${reason}:${category}`;\n DEBUG_BUILD && logger.log(`Recording outcome: \"${key}\"${count > 1 ? ` (${count} times)` : ''}`);\n this._outcomes[key] = (this._outcomes[key] || 0) + count;\n }\n }\n\n /**\n * @inheritDoc\n */\n captureAggregateMetrics(metricBucketItems) {\n DEBUG_BUILD && logger.log(`Flushing aggregated metrics, number of metrics: ${metricBucketItems.length}`);\n const metricsEnvelope = createMetricEnvelope(\n metricBucketItems,\n this._dsn,\n this._options._metadata,\n this._options.tunnel,\n );\n\n // _sendEnvelope should not throw\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._sendEnvelope(metricsEnvelope);\n }\n\n // Keep on() & emit() signatures in sync with types' client.ts interface\n /* eslint-disable @typescript-eslint/unified-signatures */\n\n /** @inheritdoc */\n\n /** @inheritdoc */\n on(hook, callback) {\n if (!this._hooks[hook]) {\n this._hooks[hook] = [];\n }\n\n // @ts-expect-error We assue the types are correct\n this._hooks[hook].push(callback);\n }\n\n /** @inheritdoc */\n\n /** @inheritdoc */\n emit(hook, ...rest) {\n if (this._hooks[hook]) {\n this._hooks[hook].forEach(callback => callback(...rest));\n }\n }\n\n /* eslint-enable @typescript-eslint/unified-signatures */\n\n /** Setup integrations for this client. */\n _setupIntegrations() {\n const { integrations } = this._options;\n this._integrations = setupIntegrations(this, integrations);\n afterSetupIntegrations(this, integrations);\n\n // TODO v8: We don't need this flag anymore\n this._integrationsInitialized = true;\n }\n\n /** Updates existing session based on the provided event */\n _updateSessionFromEvent(session, event) {\n let crashed = false;\n let errored = false;\n const exceptions = event.exception && event.exception.values;\n\n if (exceptions) {\n errored = true;\n\n for (const ex of exceptions) {\n const mechanism = ex.mechanism;\n if (mechanism && mechanism.handled === false) {\n crashed = true;\n break;\n }\n }\n }\n\n // A session is updated and that session update is sent in only one of the two following scenarios:\n // 1. Session with non terminal status and 0 errors + an error occurred -> Will set error count to 1 and send update\n // 2. Session with non terminal status and 1 error + a crash occurred -> Will set status crashed and send update\n const sessionNonTerminal = session.status === 'ok';\n const shouldUpdateAndSend = (sessionNonTerminal && session.errors === 0) || (sessionNonTerminal && crashed);\n\n if (shouldUpdateAndSend) {\n updateSession(session, {\n ...(crashed && { status: 'crashed' }),\n errors: session.errors || Number(errored || crashed),\n });\n this.captureSession(session);\n }\n }\n\n /**\n * Determine if the client is finished processing. Returns a promise because it will wait `timeout` ms before saying\n * \"no\" (resolving to `false`) in order to give the client a chance to potentially finish first.\n *\n * @param timeout The time, in ms, after which to resolve to `false` if the client is still busy. Passing `0` (or not\n * passing anything) will make the promise wait as long as it takes for processing to finish before resolving to\n * `true`.\n * @returns A promise which will resolve to `true` if processing is already done or finishes before the timeout, and\n * `false` otherwise\n */\n _isClientDoneProcessing(timeout) {\n return new SyncPromise(resolve => {\n let ticked = 0;\n const tick = 1;\n\n const interval = setInterval(() => {\n if (this._numProcessing == 0) {\n clearInterval(interval);\n resolve(true);\n } else {\n ticked += tick;\n if (timeout && ticked >= timeout) {\n clearInterval(interval);\n resolve(false);\n }\n }\n }, tick);\n });\n }\n\n /** Determines whether this SDK is enabled and a transport is present. */\n _isEnabled() {\n return this.getOptions().enabled !== false && this._transport !== undefined;\n }\n\n /**\n * Adds common information to events.\n *\n * The information includes release and environment from `options`,\n * breadcrumbs and context (extra, tags and user) from the scope.\n *\n * Information that is already present in the event is never overwritten. For\n * nested objects, such as the context, keys are merged.\n *\n * @param event The original event.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A new event with more information.\n */\n _prepareEvent(\n event,\n hint,\n scope,\n isolationScope = getIsolationScope(),\n ) {\n const options = this.getOptions();\n const integrations = Object.keys(this._integrations);\n if (!hint.integrations && integrations.length > 0) {\n hint.integrations = integrations;\n }\n\n this.emit('preprocessEvent', event, hint);\n\n return prepareEvent(options, event, hint, scope, this, isolationScope).then(evt => {\n if (evt === null) {\n return evt;\n }\n\n const propagationContext = {\n ...isolationScope.getPropagationContext(),\n ...(scope ? scope.getPropagationContext() : undefined),\n };\n\n const trace = evt.contexts && evt.contexts.trace;\n if (!trace && propagationContext) {\n const { traceId: trace_id, spanId, parentSpanId, dsc } = propagationContext;\n evt.contexts = {\n trace: {\n trace_id,\n span_id: spanId,\n parent_span_id: parentSpanId,\n },\n ...evt.contexts,\n };\n\n const dynamicSamplingContext = dsc ? dsc : getDynamicSamplingContextFromClient(trace_id, this, scope);\n\n evt.sdkProcessingMetadata = {\n dynamicSamplingContext,\n ...evt.sdkProcessingMetadata,\n };\n }\n return evt;\n });\n }\n\n /**\n * Processes the event and logs an error in case of rejection\n * @param event\n * @param hint\n * @param scope\n */\n _captureEvent(event, hint = {}, scope) {\n return this._processEvent(event, hint, scope).then(\n finalEvent => {\n return finalEvent.event_id;\n },\n reason => {\n if (DEBUG_BUILD) {\n // If something's gone wrong, log the error as a warning. If it's just us having used a `SentryError` for\n // control flow, log just the message (no stack) as a log-level log.\n const sentryError = reason ;\n if (sentryError.logLevel === 'log') {\n logger.log(sentryError.message);\n } else {\n logger.warn(sentryError);\n }\n }\n return undefined;\n },\n );\n }\n\n /**\n * Processes an event (either error or message) and sends it to Sentry.\n *\n * This also adds breadcrumbs and context information to the event. However,\n * platform specific meta data (such as the User's IP address) must be added\n * by the SDK implementor.\n *\n *\n * @param event The event to send to Sentry.\n * @param hint May contain additional information about the original exception.\n * @param scope A scope containing event metadata.\n * @returns A SyncPromise that resolves with the event or rejects in case event was/will not be send.\n */\n _processEvent(event, hint, scope) {\n const options = this.getOptions();\n const { sampleRate } = options;\n\n const isTransaction = isTransactionEvent(event);\n const isError = isErrorEvent(event);\n const eventType = event.type || 'error';\n const beforeSendLabel = `before send for type \\`${eventType}\\``;\n\n // 1.0 === 100% events are sent\n // 0.0 === 0% events are sent\n // Sampling for transaction happens somewhere else\n if (isError && typeof sampleRate === 'number' && Math.random() > sampleRate) {\n this.recordDroppedEvent('sample_rate', 'error', event);\n return rejectedSyncPromise(\n new SentryError(\n `Discarding event because it's not included in the random sample (sampling rate = ${sampleRate})`,\n 'log',\n ),\n );\n }\n\n const dataCategory = eventType === 'replay_event' ? 'replay' : eventType;\n\n const sdkProcessingMetadata = event.sdkProcessingMetadata || {};\n const capturedSpanIsolationScope = sdkProcessingMetadata.capturedSpanIsolationScope;\n\n return this._prepareEvent(event, hint, scope, capturedSpanIsolationScope)\n .then(prepared => {\n if (prepared === null) {\n this.recordDroppedEvent('event_processor', dataCategory, event);\n throw new SentryError('An event processor returned `null`, will not send event.', 'log');\n }\n\n const isInternalException = hint.data && (hint.data ).__sentry__ === true;\n if (isInternalException) {\n return prepared;\n }\n\n const result = processBeforeSend(options, prepared, hint);\n return _validateBeforeSendResult(result, beforeSendLabel);\n })\n .then(processedEvent => {\n if (processedEvent === null) {\n this.recordDroppedEvent('before_send', dataCategory, event);\n if (isTransaction) {\n const spans = event.spans || [];\n // the transaction itself counts as one span, plus all the child spans that are added\n const spanCount = 1 + spans.length;\n this.recordDroppedEvent('before_send', 'span', spanCount);\n }\n throw new SentryError(`${beforeSendLabel} returned \\`null\\`, will not send event.`, 'log');\n }\n\n const session = scope && scope.getSession();\n if (!isTransaction && session) {\n this._updateSessionFromEvent(session, processedEvent);\n }\n\n if (isTransaction) {\n const spanCountBefore =\n (processedEvent.sdkProcessingMetadata && processedEvent.sdkProcessingMetadata.spanCountBeforeProcessing) ||\n 0;\n const spanCountAfter = processedEvent.spans ? processedEvent.spans.length : 0;\n\n const droppedSpanCount = spanCountBefore - spanCountAfter;\n if (droppedSpanCount > 0) {\n this.recordDroppedEvent('before_send', 'span', droppedSpanCount);\n }\n }\n\n // None of the Sentry built event processor will update transaction name,\n // so if the transaction name has been changed by an event processor, we know\n // it has to come from custom event processor added by a user\n const transactionInfo = processedEvent.transaction_info;\n if (isTransaction && transactionInfo && processedEvent.transaction !== event.transaction) {\n const source = 'custom';\n processedEvent.transaction_info = {\n ...transactionInfo,\n source,\n };\n }\n\n this.sendEvent(processedEvent, hint);\n return processedEvent;\n })\n .then(null, reason => {\n if (reason instanceof SentryError) {\n throw reason;\n }\n\n this.captureException(reason, {\n data: {\n __sentry__: true,\n },\n originalException: reason,\n });\n throw new SentryError(\n `Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\\nReason: ${reason}`,\n );\n });\n }\n\n /**\n * Occupies the client with processing and event\n */\n _process(promise) {\n this._numProcessing++;\n void promise.then(\n value => {\n this._numProcessing--;\n return value;\n },\n reason => {\n this._numProcessing--;\n return reason;\n },\n );\n }\n\n /**\n * @inheritdoc\n */\n _sendEnvelope(envelope) {\n this.emit('beforeEnvelope', envelope);\n\n if (this._isEnabled() && this._transport) {\n return this._transport.send(envelope).then(null, reason => {\n DEBUG_BUILD && logger.error('Error while sending event:', reason);\n });\n } else {\n DEBUG_BUILD && logger.error('Transport disabled');\n }\n }\n\n /**\n * Clears outcomes on this client and returns them.\n */\n _clearOutcomes() {\n const outcomes = this._outcomes;\n this._outcomes = {};\n return Object.keys(outcomes).map(key => {\n const [reason, category] = key.split(':') ;\n return {\n reason,\n category,\n quantity: outcomes[key],\n };\n });\n }\n\n /**\n * @inheritDoc\n */\n // eslint-disable-next-line @typescript-eslint/no-explicit-any, @typescript-eslint/explicit-module-boundary-types\n\n}\n\n/**\n * Verifies that return value of configured `beforeSend` or `beforeSendTransaction` is of expected type, and returns the value if so.\n */\nfunction _validateBeforeSendResult(\n beforeSendResult,\n beforeSendLabel,\n) {\n const invalidValueError = `${beforeSendLabel} must return \\`null\\` or a valid event.`;\n if (isThenable(beforeSendResult)) {\n return beforeSendResult.then(\n event => {\n if (!isPlainObject(event) && event !== null) {\n throw new SentryError(invalidValueError);\n }\n return event;\n },\n e => {\n throw new SentryError(`${beforeSendLabel} rejected with ${e}`);\n },\n );\n } else if (!isPlainObject(beforeSendResult) && beforeSendResult !== null) {\n throw new SentryError(invalidValueError);\n }\n return beforeSendResult;\n}\n\n/**\n * Process the matching `beforeSendXXX` callback.\n */\nfunction processBeforeSend(\n options,\n event,\n hint,\n) {\n const { beforeSend, beforeSendTransaction } = options;\n\n if (isErrorEvent(event) && beforeSend) {\n return beforeSend(event, hint);\n }\n\n if (isTransactionEvent(event) && beforeSendTransaction) {\n if (event.spans) {\n // We store the # of spans before processing in SDK metadata,\n // so we can compare it afterwards to determine how many spans were dropped\n const spanCountBefore = event.spans.length;\n event.sdkProcessingMetadata = {\n ...event.sdkProcessingMetadata,\n spanCountBeforeProcessing: spanCountBefore,\n };\n }\n return beforeSendTransaction(event, hint);\n }\n\n return event;\n}\n\nfunction isErrorEvent(event) {\n return event.type === undefined;\n}\n\nfunction isTransactionEvent(event) {\n return event.type === 'transaction';\n}\n\n/**\n * Add an event processor to the current client.\n * This event processor will run for all events processed by this client.\n */\nfunction addEventProcessor(callback) {\n const client = getClient();\n\n if (!client || !client.addEventProcessor) {\n return;\n }\n\n client.addEventProcessor(callback);\n}\n\nexport { BaseClient, addEventProcessor };\n//# sourceMappingURL=baseclient.js.map\n","/**\n * Checks whether given url points to Sentry server\n * @param url url to verify\n *\n * TODO(v8): Remove Hub fallback type\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction isSentryRequestUrl(url, hubOrClient) {\n const client =\n hubOrClient && isHub(hubOrClient)\n ? // eslint-disable-next-line deprecation/deprecation\n hubOrClient.getClient()\n : hubOrClient;\n const dsn = client && client.getDsn();\n const tunnel = client && client.getOptions().tunnel;\n\n return checkDsn(url, dsn) || checkTunnel(url, tunnel);\n}\n\nfunction checkTunnel(url, tunnel) {\n if (!tunnel) {\n return false;\n }\n\n return removeTrailingSlash(url) === removeTrailingSlash(tunnel);\n}\n\nfunction checkDsn(url, dsn) {\n return dsn ? url.includes(dsn.host) : false;\n}\n\nfunction removeTrailingSlash(str) {\n return str[str.length - 1] === '/' ? str.slice(0, -1) : str;\n}\n\n// eslint-disable-next-line deprecation/deprecation\nfunction isHub(hubOrClient) {\n // eslint-disable-next-line deprecation/deprecation\n return (hubOrClient ).getClient !== undefined;\n}\n\nexport { isSentryRequestUrl };\n//# sourceMappingURL=isSentryRequestUrl.js.map\n","import { _nullishCoalesce, _optionalChain } from '@sentry/utils';\nimport { addBreadcrumb, getClient, isSentryRequestUrl, getCurrentScope, addEventProcessor, prepareEvent, getIsolationScope, setContext, captureException, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE } from '@sentry/core';\nimport { GLOBAL_OBJ, normalize, fill, htmlTreeAsString, browserPerformanceTimeOrigin, logger, uuid4, SENTRY_XHR_DATA_KEY, dropUndefinedKeys, stringMatchesSomePattern, addFetchInstrumentationHandler, addXhrInstrumentationHandler, addClickKeypressInstrumentationHandler, addHistoryInstrumentationHandler, createEnvelope, createEventEnvelopeHeaders, getSdkMetadataForEnvelopeHeader, updateRateLimits, isRateLimited, consoleSandbox, isBrowser } from '@sentry/utils';\nimport { addPerformanceInstrumentationHandler, addLcpInstrumentationHandler } from '@sentry-internal/tracing';\n\n// exporting a separate copy of `WINDOW` rather than exporting the one from `@sentry/browser`\n// prevents the browser package from being bundled in the CDN bundle, and avoids a\n// circular dependency between the browser and replay packages should `@sentry/browser` import\n// from `@sentry/replay` in the future\nconst WINDOW = GLOBAL_OBJ ;\n\nconst REPLAY_SESSION_KEY = 'sentryReplaySession';\nconst REPLAY_EVENT_NAME = 'replay_event';\nconst UNABLE_TO_SEND_REPLAY = 'Unable to send Replay';\n\n// The idle limit for a session after which recording is paused.\nconst SESSION_IDLE_PAUSE_DURATION = 300000; // 5 minutes in ms\n\n// The idle limit for a session after which the session expires.\nconst SESSION_IDLE_EXPIRE_DURATION = 900000; // 15 minutes in ms\n\n/** Default flush delays */\nconst DEFAULT_FLUSH_MIN_DELAY = 5000;\n// XXX: Temp fix for our debounce logic where `maxWait` would never occur if it\n// was the same as `wait`\nconst DEFAULT_FLUSH_MAX_DELAY = 5500;\n\n/* How long to wait for error checkouts */\nconst BUFFER_CHECKOUT_TIME = 60000;\n\nconst RETRY_BASE_INTERVAL = 5000;\nconst RETRY_MAX_COUNT = 3;\n\n/* The max (uncompressed) size in bytes of a network body. Any body larger than this will be truncated. */\nconst NETWORK_BODY_MAX_SIZE = 150000;\n\n/* The max size of a single console arg that is captured. Any arg larger than this will be truncated. */\nconst CONSOLE_ARG_MAX_SIZE = 5000;\n\n/* Min. time to wait before we consider something a slow click. */\nconst SLOW_CLICK_THRESHOLD = 3000;\n/* For scroll actions after a click, we only look for a very short time period to detect programmatic scrolling. */\nconst SLOW_CLICK_SCROLL_TIMEOUT = 300;\n\n/** When encountering a total segment size exceeding this size, stop the replay (as we cannot properly ingest it). */\nconst REPLAY_MAX_EVENT_BUFFER_SIZE = 20000000; // ~20MB\n\n/** Replays must be min. 5s long before we send them. */\nconst MIN_REPLAY_DURATION = 4999;\n/* The max. allowed value that the minReplayDuration can be set to. */\nconst MIN_REPLAY_DURATION_LIMIT = 15000;\n\n/** The max. length of a replay. */\nconst MAX_REPLAY_DURATION = 3600000; // 60 minutes in ms;\n\nfunction _nullishCoalesce$1(lhs, rhsFn) { if (lhs != null) { return lhs; } else { return rhsFn(); } }function _optionalChain$5(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }var NodeType$1;\n(function (NodeType) {\n NodeType[NodeType[\"Document\"] = 0] = \"Document\";\n NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\n NodeType[NodeType[\"Element\"] = 2] = \"Element\";\n NodeType[NodeType[\"Text\"] = 3] = \"Text\";\n NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\n NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\n})(NodeType$1 || (NodeType$1 = {}));\n\nfunction isElement$1(n) {\n return n.nodeType === n.ELEMENT_NODE;\n}\nfunction isShadowRoot(n) {\n const host = _optionalChain$5([n, 'optionalAccess', _ => _.host]);\n return Boolean(_optionalChain$5([host, 'optionalAccess', _2 => _2.shadowRoot]) === n);\n}\nfunction isNativeShadowDom(shadowRoot) {\n return Object.prototype.toString.call(shadowRoot) === '[object ShadowRoot]';\n}\nfunction fixBrowserCompatibilityIssuesInCSS(cssText) {\n if (cssText.includes(' background-clip: text;') &&\n !cssText.includes(' -webkit-background-clip: text;')) {\n cssText = cssText.replace(' background-clip: text;', ' -webkit-background-clip: text; background-clip: text;');\n }\n return cssText;\n}\nfunction escapeImportStatement(rule) {\n const { cssText } = rule;\n if (cssText.split('\"').length < 3)\n return cssText;\n const statement = ['@import', `url(${JSON.stringify(rule.href)})`];\n if (rule.layerName === '') {\n statement.push(`layer`);\n }\n else if (rule.layerName) {\n statement.push(`layer(${rule.layerName})`);\n }\n if (rule.supportsText) {\n statement.push(`supports(${rule.supportsText})`);\n }\n if (rule.media.length) {\n statement.push(rule.media.mediaText);\n }\n return statement.join(' ') + ';';\n}\nfunction stringifyStylesheet(s) {\n try {\n const rules = s.rules || s.cssRules;\n return rules\n ? fixBrowserCompatibilityIssuesInCSS(Array.from(rules, stringifyRule).join(''))\n : null;\n }\n catch (error) {\n return null;\n }\n}\nfunction stringifyRule(rule) {\n let importStringified;\n if (isCSSImportRule(rule)) {\n try {\n importStringified =\n stringifyStylesheet(rule.styleSheet) ||\n escapeImportStatement(rule);\n }\n catch (error) {\n }\n }\n else if (isCSSStyleRule(rule) && rule.selectorText.includes(':')) {\n return fixSafariColons(rule.cssText);\n }\n return importStringified || rule.cssText;\n}\nfunction fixSafariColons(cssStringified) {\n const regex = /(\\[(?:[\\w-]+)[^\\\\])(:(?:[\\w-]+)\\])/gm;\n return cssStringified.replace(regex, '$1\\\\$2');\n}\nfunction isCSSImportRule(rule) {\n return 'styleSheet' in rule;\n}\nfunction isCSSStyleRule(rule) {\n return 'selectorText' in rule;\n}\nclass Mirror {\n constructor() {\n this.idNodeMap = new Map();\n this.nodeMetaMap = new WeakMap();\n }\n getId(n) {\n if (!n)\n return -1;\n const id = _optionalChain$5([this, 'access', _3 => _3.getMeta, 'call', _4 => _4(n), 'optionalAccess', _5 => _5.id]);\n return _nullishCoalesce$1(id, () => ( -1));\n }\n getNode(id) {\n return this.idNodeMap.get(id) || null;\n }\n getIds() {\n return Array.from(this.idNodeMap.keys());\n }\n getMeta(n) {\n return this.nodeMetaMap.get(n) || null;\n }\n removeNodeFromMap(n) {\n const id = this.getId(n);\n this.idNodeMap.delete(id);\n if (n.childNodes) {\n n.childNodes.forEach((childNode) => this.removeNodeFromMap(childNode));\n }\n }\n has(id) {\n return this.idNodeMap.has(id);\n }\n hasNode(node) {\n return this.nodeMetaMap.has(node);\n }\n add(n, meta) {\n const id = meta.id;\n this.idNodeMap.set(id, n);\n this.nodeMetaMap.set(n, meta);\n }\n replace(id, n) {\n const oldNode = this.getNode(id);\n if (oldNode) {\n const meta = this.nodeMetaMap.get(oldNode);\n if (meta)\n this.nodeMetaMap.set(n, meta);\n }\n this.idNodeMap.set(id, n);\n }\n reset() {\n this.idNodeMap = new Map();\n this.nodeMetaMap = new WeakMap();\n }\n}\nfunction createMirror() {\n return new Mirror();\n}\nfunction shouldMaskInput({ maskInputOptions, tagName, type, }) {\n if (tagName === 'OPTION') {\n tagName = 'SELECT';\n }\n return Boolean(maskInputOptions[tagName.toLowerCase()] ||\n (type && maskInputOptions[type]) ||\n type === 'password' ||\n (tagName === 'INPUT' && !type && maskInputOptions['text']));\n}\nfunction maskInputValue({ isMasked, element, value, maskInputFn, }) {\n let text = value || '';\n if (!isMasked) {\n return text;\n }\n if (maskInputFn) {\n text = maskInputFn(text, element);\n }\n return '*'.repeat(text.length);\n}\nfunction toLowerCase(str) {\n return str.toLowerCase();\n}\nfunction toUpperCase(str) {\n return str.toUpperCase();\n}\nconst ORIGINAL_ATTRIBUTE_NAME = '__rrweb_original__';\nfunction is2DCanvasBlank(canvas) {\n const ctx = canvas.getContext('2d');\n if (!ctx)\n return true;\n const chunkSize = 50;\n for (let x = 0; x < canvas.width; x += chunkSize) {\n for (let y = 0; y < canvas.height; y += chunkSize) {\n const getImageData = ctx.getImageData;\n const originalGetImageData = ORIGINAL_ATTRIBUTE_NAME in getImageData\n ? getImageData[ORIGINAL_ATTRIBUTE_NAME]\n : getImageData;\n const pixelBuffer = new Uint32Array(originalGetImageData.call(ctx, x, y, Math.min(chunkSize, canvas.width - x), Math.min(chunkSize, canvas.height - y)).data.buffer);\n if (pixelBuffer.some((pixel) => pixel !== 0))\n return false;\n }\n }\n return true;\n}\nfunction getInputType(element) {\n const type = element.type;\n return element.hasAttribute('data-rr-is-password')\n ? 'password'\n : type\n ?\n toLowerCase(type)\n : null;\n}\nfunction getInputValue(el, tagName, type) {\n if (tagName === 'INPUT' && (type === 'radio' || type === 'checkbox')) {\n return el.getAttribute('value') || '';\n }\n return el.value;\n}\n\nlet _id = 1;\nconst tagNameRegex = new RegExp('[^a-z0-9-_:]');\nconst IGNORED_NODE = -2;\nfunction genId() {\n return _id++;\n}\nfunction getValidTagName(element) {\n if (element instanceof HTMLFormElement) {\n return 'form';\n }\n const processedTagName = toLowerCase(element.tagName);\n if (tagNameRegex.test(processedTagName)) {\n return 'div';\n }\n return processedTagName;\n}\nfunction extractOrigin(url) {\n let origin = '';\n if (url.indexOf('//') > -1) {\n origin = url.split('/').slice(0, 3).join('/');\n }\n else {\n origin = url.split('/')[0];\n }\n origin = origin.split('?')[0];\n return origin;\n}\nlet canvasService;\nlet canvasCtx;\nconst URL_IN_CSS_REF = /url\\((?:(')([^']*)'|(\")(.*?)\"|([^)]*))\\)/gm;\nconst URL_PROTOCOL_MATCH = /^(?:[a-z+]+:)?\\/\\//i;\nconst URL_WWW_MATCH = /^www\\..*/i;\nconst DATA_URI = /^(data:)([^,]*),(.*)/i;\nfunction absoluteToStylesheet(cssText, href) {\n return (cssText || '').replace(URL_IN_CSS_REF, (origin, quote1, path1, quote2, path2, path3) => {\n const filePath = path1 || path2 || path3;\n const maybeQuote = quote1 || quote2 || '';\n if (!filePath) {\n return origin;\n }\n if (URL_PROTOCOL_MATCH.test(filePath) || URL_WWW_MATCH.test(filePath)) {\n return `url(${maybeQuote}${filePath}${maybeQuote})`;\n }\n if (DATA_URI.test(filePath)) {\n return `url(${maybeQuote}${filePath}${maybeQuote})`;\n }\n if (filePath[0] === '/') {\n return `url(${maybeQuote}${extractOrigin(href) + filePath}${maybeQuote})`;\n }\n const stack = href.split('/');\n const parts = filePath.split('/');\n stack.pop();\n for (const part of parts) {\n if (part === '.') {\n continue;\n }\n else if (part === '..') {\n stack.pop();\n }\n else {\n stack.push(part);\n }\n }\n return `url(${maybeQuote}${stack.join('/')}${maybeQuote})`;\n });\n}\nconst SRCSET_NOT_SPACES = /^[^ \\t\\n\\r\\u000c]+/;\nconst SRCSET_COMMAS_OR_SPACES = /^[, \\t\\n\\r\\u000c]+/;\nfunction getAbsoluteSrcsetString(doc, attributeValue) {\n if (attributeValue.trim() === '') {\n return attributeValue;\n }\n let pos = 0;\n function collectCharacters(regEx) {\n let chars;\n const match = regEx.exec(attributeValue.substring(pos));\n if (match) {\n chars = match[0];\n pos += chars.length;\n return chars;\n }\n return '';\n }\n const output = [];\n while (true) {\n collectCharacters(SRCSET_COMMAS_OR_SPACES);\n if (pos >= attributeValue.length) {\n break;\n }\n let url = collectCharacters(SRCSET_NOT_SPACES);\n if (url.slice(-1) === ',') {\n url = absoluteToDoc(doc, url.substring(0, url.length - 1));\n output.push(url);\n }\n else {\n let descriptorsStr = '';\n url = absoluteToDoc(doc, url);\n let inParens = false;\n while (true) {\n const c = attributeValue.charAt(pos);\n if (c === '') {\n output.push((url + descriptorsStr).trim());\n break;\n }\n else if (!inParens) {\n if (c === ',') {\n pos += 1;\n output.push((url + descriptorsStr).trim());\n break;\n }\n else if (c === '(') {\n inParens = true;\n }\n }\n else {\n if (c === ')') {\n inParens = false;\n }\n }\n descriptorsStr += c;\n pos += 1;\n }\n }\n }\n return output.join(', ');\n}\nfunction absoluteToDoc(doc, attributeValue) {\n if (!attributeValue || attributeValue.trim() === '') {\n return attributeValue;\n }\n const a = doc.createElement('a');\n a.href = attributeValue;\n return a.href;\n}\nfunction isSVGElement(el) {\n return Boolean(el.tagName === 'svg' || el.ownerSVGElement);\n}\nfunction getHref() {\n const a = document.createElement('a');\n a.href = '';\n return a.href;\n}\nfunction transformAttribute(doc, tagName, name, value, element, maskAttributeFn) {\n if (!value) {\n return value;\n }\n if (name === 'src' ||\n (name === 'href' && !(tagName === 'use' && value[0] === '#'))) {\n return absoluteToDoc(doc, value);\n }\n else if (name === 'xlink:href' && value[0] !== '#') {\n return absoluteToDoc(doc, value);\n }\n else if (name === 'background' &&\n (tagName === 'table' || tagName === 'td' || tagName === 'th')) {\n return absoluteToDoc(doc, value);\n }\n else if (name === 'srcset') {\n return getAbsoluteSrcsetString(doc, value);\n }\n else if (name === 'style') {\n return absoluteToStylesheet(value, getHref());\n }\n else if (tagName === 'object' && name === 'data') {\n return absoluteToDoc(doc, value);\n }\n if (typeof maskAttributeFn === 'function') {\n return maskAttributeFn(name, value, element);\n }\n return value;\n}\nfunction ignoreAttribute(tagName, name, _value) {\n return (tagName === 'video' || tagName === 'audio') && name === 'autoplay';\n}\nfunction _isBlockedElement(element, blockClass, blockSelector, unblockSelector) {\n try {\n if (unblockSelector && element.matches(unblockSelector)) {\n return false;\n }\n if (typeof blockClass === 'string') {\n if (element.classList.contains(blockClass)) {\n return true;\n }\n }\n else {\n for (let eIndex = element.classList.length; eIndex--;) {\n const className = element.classList[eIndex];\n if (blockClass.test(className)) {\n return true;\n }\n }\n }\n if (blockSelector) {\n return element.matches(blockSelector);\n }\n }\n catch (e) {\n }\n return false;\n}\nfunction elementClassMatchesRegex(el, regex) {\n for (let eIndex = el.classList.length; eIndex--;) {\n const className = el.classList[eIndex];\n if (regex.test(className)) {\n return true;\n }\n }\n return false;\n}\nfunction distanceToMatch(node, matchPredicate, limit = Infinity, distance = 0) {\n if (!node)\n return -1;\n if (node.nodeType !== node.ELEMENT_NODE)\n return -1;\n if (distance > limit)\n return -1;\n if (matchPredicate(node))\n return distance;\n return distanceToMatch(node.parentNode, matchPredicate, limit, distance + 1);\n}\nfunction createMatchPredicate(className, selector) {\n return (node) => {\n const el = node;\n if (el === null)\n return false;\n try {\n if (className) {\n if (typeof className === 'string') {\n if (el.matches(`.${className}`))\n return true;\n }\n else if (elementClassMatchesRegex(el, className)) {\n return true;\n }\n }\n if (selector && el.matches(selector))\n return true;\n return false;\n }\n catch (e2) {\n return false;\n }\n };\n}\nfunction needMaskingText(node, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText) {\n try {\n const el = node.nodeType === node.ELEMENT_NODE\n ? node\n : node.parentElement;\n if (el === null)\n return false;\n if (el.tagName === 'INPUT') {\n const autocomplete = el.getAttribute('autocomplete');\n const disallowedAutocompleteValues = [\n 'current-password',\n 'new-password',\n 'cc-number',\n 'cc-exp',\n 'cc-exp-month',\n 'cc-exp-year',\n 'cc-csc',\n ];\n if (disallowedAutocompleteValues.includes(autocomplete)) {\n return true;\n }\n }\n let maskDistance = -1;\n let unmaskDistance = -1;\n if (maskAllText) {\n unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector));\n if (unmaskDistance < 0) {\n return true;\n }\n maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector), unmaskDistance >= 0 ? unmaskDistance : Infinity);\n }\n else {\n maskDistance = distanceToMatch(el, createMatchPredicate(maskTextClass, maskTextSelector));\n if (maskDistance < 0) {\n return false;\n }\n unmaskDistance = distanceToMatch(el, createMatchPredicate(unmaskTextClass, unmaskTextSelector), maskDistance >= 0 ? maskDistance : Infinity);\n }\n return maskDistance >= 0\n ? unmaskDistance >= 0\n ? maskDistance <= unmaskDistance\n : true\n : unmaskDistance >= 0\n ? false\n : !!maskAllText;\n }\n catch (e) {\n }\n return !!maskAllText;\n}\nfunction onceIframeLoaded(iframeEl, listener, iframeLoadTimeout) {\n const win = iframeEl.contentWindow;\n if (!win) {\n return;\n }\n let fired = false;\n let readyState;\n try {\n readyState = win.document.readyState;\n }\n catch (error) {\n return;\n }\n if (readyState !== 'complete') {\n const timer = setTimeout(() => {\n if (!fired) {\n listener();\n fired = true;\n }\n }, iframeLoadTimeout);\n iframeEl.addEventListener('load', () => {\n clearTimeout(timer);\n fired = true;\n listener();\n });\n return;\n }\n const blankUrl = 'about:blank';\n if (win.location.href !== blankUrl ||\n iframeEl.src === blankUrl ||\n iframeEl.src === '') {\n setTimeout(listener, 0);\n return iframeEl.addEventListener('load', listener);\n }\n iframeEl.addEventListener('load', listener);\n}\nfunction onceStylesheetLoaded(link, listener, styleSheetLoadTimeout) {\n let fired = false;\n let styleSheetLoaded;\n try {\n styleSheetLoaded = link.sheet;\n }\n catch (error) {\n return;\n }\n if (styleSheetLoaded)\n return;\n const timer = setTimeout(() => {\n if (!fired) {\n listener();\n fired = true;\n }\n }, styleSheetLoadTimeout);\n link.addEventListener('load', () => {\n clearTimeout(timer);\n fired = true;\n listener();\n });\n}\nfunction serializeNode(n, options) {\n const { doc, mirror, blockClass, blockSelector, unblockSelector, maskAllText, maskAttributeFn, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, inlineStylesheet, maskInputOptions = {}, maskTextFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, } = options;\n const rootId = getRootId(doc, mirror);\n switch (n.nodeType) {\n case n.DOCUMENT_NODE:\n if (n.compatMode !== 'CSS1Compat') {\n return {\n type: NodeType$1.Document,\n childNodes: [],\n compatMode: n.compatMode,\n };\n }\n else {\n return {\n type: NodeType$1.Document,\n childNodes: [],\n };\n }\n case n.DOCUMENT_TYPE_NODE:\n return {\n type: NodeType$1.DocumentType,\n name: n.name,\n publicId: n.publicId,\n systemId: n.systemId,\n rootId,\n };\n case n.ELEMENT_NODE:\n return serializeElementNode(n, {\n doc,\n blockClass,\n blockSelector,\n unblockSelector,\n inlineStylesheet,\n maskAttributeFn,\n maskInputOptions,\n maskInputFn,\n dataURLOptions,\n inlineImages,\n recordCanvas,\n keepIframeSrcFn,\n newlyAddedElement,\n rootId,\n maskAllText,\n maskTextClass,\n unmaskTextClass,\n maskTextSelector,\n unmaskTextSelector,\n });\n case n.TEXT_NODE:\n return serializeTextNode(n, {\n maskAllText,\n maskTextClass,\n unmaskTextClass,\n maskTextSelector,\n unmaskTextSelector,\n maskTextFn,\n maskInputOptions,\n maskInputFn,\n rootId,\n });\n case n.CDATA_SECTION_NODE:\n return {\n type: NodeType$1.CDATA,\n textContent: '',\n rootId,\n };\n case n.COMMENT_NODE:\n return {\n type: NodeType$1.Comment,\n textContent: n.textContent || '',\n rootId,\n };\n default:\n return false;\n }\n}\nfunction getRootId(doc, mirror) {\n if (!mirror.hasNode(doc))\n return undefined;\n const docId = mirror.getId(doc);\n return docId === 1 ? undefined : docId;\n}\nfunction serializeTextNode(n, options) {\n const { maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, maskTextFn, maskInputOptions, maskInputFn, rootId, } = options;\n const parentTagName = n.parentNode && n.parentNode.tagName;\n let textContent = n.textContent;\n const isStyle = parentTagName === 'STYLE' ? true : undefined;\n const isScript = parentTagName === 'SCRIPT' ? true : undefined;\n const isTextarea = parentTagName === 'TEXTAREA' ? true : undefined;\n if (isStyle && textContent) {\n try {\n if (n.nextSibling || n.previousSibling) {\n }\n else if (_optionalChain$5([n, 'access', _6 => _6.parentNode, 'access', _7 => _7.sheet, 'optionalAccess', _8 => _8.cssRules])) {\n textContent = stringifyStylesheet(n.parentNode.sheet);\n }\n }\n catch (err) {\n console.warn(`Cannot get CSS styles from text's parentNode. Error: ${err}`, n);\n }\n textContent = absoluteToStylesheet(textContent, getHref());\n }\n if (isScript) {\n textContent = 'SCRIPT_PLACEHOLDER';\n }\n const forceMask = needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, maskAllText);\n if (!isStyle && !isScript && !isTextarea && textContent && forceMask) {\n textContent = maskTextFn\n ? maskTextFn(textContent, n.parentElement)\n : textContent.replace(/[\\S]/g, '*');\n }\n if (isTextarea && textContent && (maskInputOptions.textarea || forceMask)) {\n textContent = maskInputFn\n ? maskInputFn(textContent, n.parentNode)\n : textContent.replace(/[\\S]/g, '*');\n }\n if (parentTagName === 'OPTION' && textContent) {\n const isInputMasked = shouldMaskInput({\n type: null,\n tagName: parentTagName,\n maskInputOptions,\n });\n textContent = maskInputValue({\n isMasked: needMaskingText(n, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked),\n element: n,\n value: textContent,\n maskInputFn,\n });\n }\n return {\n type: NodeType$1.Text,\n textContent: textContent || '',\n isStyle,\n rootId,\n };\n}\nfunction serializeElementNode(n, options) {\n const { doc, blockClass, blockSelector, unblockSelector, inlineStylesheet, maskInputOptions = {}, maskAttributeFn, maskInputFn, dataURLOptions = {}, inlineImages, recordCanvas, keepIframeSrcFn, newlyAddedElement = false, rootId, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, } = options;\n const needBlock = _isBlockedElement(n, blockClass, blockSelector, unblockSelector);\n const tagName = getValidTagName(n);\n let attributes = {};\n const len = n.attributes.length;\n for (let i = 0; i < len; i++) {\n const attr = n.attributes[i];\n if (attr.name && !ignoreAttribute(tagName, attr.name, attr.value)) {\n attributes[attr.name] = transformAttribute(doc, tagName, toLowerCase(attr.name), attr.value, n, maskAttributeFn);\n }\n }\n if (tagName === 'link' && inlineStylesheet) {\n const stylesheet = Array.from(doc.styleSheets).find((s) => {\n return s.href === n.href;\n });\n let cssText = null;\n if (stylesheet) {\n cssText = stringifyStylesheet(stylesheet);\n }\n if (cssText) {\n delete attributes.rel;\n delete attributes.href;\n attributes._cssText = absoluteToStylesheet(cssText, stylesheet.href);\n }\n }\n if (tagName === 'style' &&\n n.sheet &&\n !(n.innerText || n.textContent || '').trim().length) {\n const cssText = stringifyStylesheet(n.sheet);\n if (cssText) {\n attributes._cssText = absoluteToStylesheet(cssText, getHref());\n }\n }\n if (tagName === 'input' ||\n tagName === 'textarea' ||\n tagName === 'select' ||\n tagName === 'option') {\n const el = n;\n const type = getInputType(el);\n const value = getInputValue(el, toUpperCase(tagName), type);\n const checked = el.checked;\n if (type !== 'submit' && type !== 'button' && value) {\n const forceMask = needMaskingText(el, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, shouldMaskInput({\n type,\n tagName: toUpperCase(tagName),\n maskInputOptions,\n }));\n attributes.value = maskInputValue({\n isMasked: forceMask,\n element: el,\n value,\n maskInputFn,\n });\n }\n if (checked) {\n attributes.checked = checked;\n }\n }\n if (tagName === 'option') {\n if (n.selected && !maskInputOptions['select']) {\n attributes.selected = true;\n }\n else {\n delete attributes.selected;\n }\n }\n if (tagName === 'canvas' && recordCanvas) {\n if (n.__context === '2d') {\n if (!is2DCanvasBlank(n)) {\n attributes.rr_dataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n }\n }\n else if (!('__context' in n)) {\n const canvasDataURL = n.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n const blankCanvas = document.createElement('canvas');\n blankCanvas.width = n.width;\n blankCanvas.height = n.height;\n const blankCanvasDataURL = blankCanvas.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n if (canvasDataURL !== blankCanvasDataURL) {\n attributes.rr_dataURL = canvasDataURL;\n }\n }\n }\n if (tagName === 'img' && inlineImages) {\n if (!canvasService) {\n canvasService = doc.createElement('canvas');\n canvasCtx = canvasService.getContext('2d');\n }\n const image = n;\n const oldValue = image.crossOrigin;\n image.crossOrigin = 'anonymous';\n const recordInlineImage = () => {\n image.removeEventListener('load', recordInlineImage);\n try {\n canvasService.width = image.naturalWidth;\n canvasService.height = image.naturalHeight;\n canvasCtx.drawImage(image, 0, 0);\n attributes.rr_dataURL = canvasService.toDataURL(dataURLOptions.type, dataURLOptions.quality);\n }\n catch (err) {\n console.warn(`Cannot inline img src=${image.currentSrc}! Error: ${err}`);\n }\n oldValue\n ? (attributes.crossOrigin = oldValue)\n : image.removeAttribute('crossorigin');\n };\n if (image.complete && image.naturalWidth !== 0)\n recordInlineImage();\n else\n image.addEventListener('load', recordInlineImage);\n }\n if (tagName === 'audio' || tagName === 'video') {\n attributes.rr_mediaState = n.paused\n ? 'paused'\n : 'played';\n attributes.rr_mediaCurrentTime = n.currentTime;\n }\n if (!newlyAddedElement) {\n if (n.scrollLeft) {\n attributes.rr_scrollLeft = n.scrollLeft;\n }\n if (n.scrollTop) {\n attributes.rr_scrollTop = n.scrollTop;\n }\n }\n if (needBlock) {\n const { width, height } = n.getBoundingClientRect();\n attributes = {\n class: attributes.class,\n rr_width: `${width}px`,\n rr_height: `${height}px`,\n };\n }\n if (tagName === 'iframe' && !keepIframeSrcFn(attributes.src)) {\n if (!n.contentDocument) {\n attributes.rr_src = attributes.src;\n }\n delete attributes.src;\n }\n let isCustomElement;\n try {\n if (customElements.get(tagName))\n isCustomElement = true;\n }\n catch (e) {\n }\n return {\n type: NodeType$1.Element,\n tagName,\n attributes,\n childNodes: [],\n isSVG: isSVGElement(n) || undefined,\n needBlock,\n rootId,\n isCustom: isCustomElement,\n };\n}\nfunction lowerIfExists(maybeAttr) {\n if (maybeAttr === undefined || maybeAttr === null) {\n return '';\n }\n else {\n return maybeAttr.toLowerCase();\n }\n}\nfunction slimDOMExcluded(sn, slimDOMOptions) {\n if (slimDOMOptions.comment && sn.type === NodeType$1.Comment) {\n return true;\n }\n else if (sn.type === NodeType$1.Element) {\n if (slimDOMOptions.script &&\n (sn.tagName === 'script' ||\n (sn.tagName === 'link' &&\n (sn.attributes.rel === 'preload' ||\n sn.attributes.rel === 'modulepreload') &&\n sn.attributes.as === 'script') ||\n (sn.tagName === 'link' &&\n sn.attributes.rel === 'prefetch' &&\n typeof sn.attributes.href === 'string' &&\n sn.attributes.href.endsWith('.js')))) {\n return true;\n }\n else if (slimDOMOptions.headFavicon &&\n ((sn.tagName === 'link' && sn.attributes.rel === 'shortcut icon') ||\n (sn.tagName === 'meta' &&\n (lowerIfExists(sn.attributes.name).match(/^msapplication-tile(image|color)$/) ||\n lowerIfExists(sn.attributes.name) === 'application-name' ||\n lowerIfExists(sn.attributes.rel) === 'icon' ||\n lowerIfExists(sn.attributes.rel) === 'apple-touch-icon' ||\n lowerIfExists(sn.attributes.rel) === 'shortcut icon')))) {\n return true;\n }\n else if (sn.tagName === 'meta') {\n if (slimDOMOptions.headMetaDescKeywords &&\n lowerIfExists(sn.attributes.name).match(/^description|keywords$/)) {\n return true;\n }\n else if (slimDOMOptions.headMetaSocial &&\n (lowerIfExists(sn.attributes.property).match(/^(og|twitter|fb):/) ||\n lowerIfExists(sn.attributes.name).match(/^(og|twitter):/) ||\n lowerIfExists(sn.attributes.name) === 'pinterest')) {\n return true;\n }\n else if (slimDOMOptions.headMetaRobots &&\n (lowerIfExists(sn.attributes.name) === 'robots' ||\n lowerIfExists(sn.attributes.name) === 'googlebot' ||\n lowerIfExists(sn.attributes.name) === 'bingbot')) {\n return true;\n }\n else if (slimDOMOptions.headMetaHttpEquiv &&\n sn.attributes['http-equiv'] !== undefined) {\n return true;\n }\n else if (slimDOMOptions.headMetaAuthorship &&\n (lowerIfExists(sn.attributes.name) === 'author' ||\n lowerIfExists(sn.attributes.name) === 'generator' ||\n lowerIfExists(sn.attributes.name) === 'framework' ||\n lowerIfExists(sn.attributes.name) === 'publisher' ||\n lowerIfExists(sn.attributes.name) === 'progid' ||\n lowerIfExists(sn.attributes.property).match(/^article:/) ||\n lowerIfExists(sn.attributes.property).match(/^product:/))) {\n return true;\n }\n else if (slimDOMOptions.headMetaVerification &&\n (lowerIfExists(sn.attributes.name) === 'google-site-verification' ||\n lowerIfExists(sn.attributes.name) === 'yandex-verification' ||\n lowerIfExists(sn.attributes.name) === 'csrf-token' ||\n lowerIfExists(sn.attributes.name) === 'p:domain_verify' ||\n lowerIfExists(sn.attributes.name) === 'verify-v1' ||\n lowerIfExists(sn.attributes.name) === 'verification' ||\n lowerIfExists(sn.attributes.name) === 'shopify-checkout-api-token')) {\n return true;\n }\n }\n }\n return false;\n}\nfunction serializeNodeWithId(n, options) {\n const { doc, mirror, blockClass, blockSelector, unblockSelector, maskAllText, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, skipChild = false, inlineStylesheet = true, maskInputOptions = {}, maskAttributeFn, maskTextFn, maskInputFn, slimDOMOptions, dataURLOptions = {}, inlineImages = false, recordCanvas = false, onSerialize, onIframeLoad, iframeLoadTimeout = 5000, onStylesheetLoad, stylesheetLoadTimeout = 5000, keepIframeSrcFn = () => false, newlyAddedElement = false, } = options;\n let { preserveWhiteSpace = true } = options;\n const _serializedNode = serializeNode(n, {\n doc,\n mirror,\n blockClass,\n blockSelector,\n maskAllText,\n unblockSelector,\n maskTextClass,\n unmaskTextClass,\n maskTextSelector,\n unmaskTextSelector,\n inlineStylesheet,\n maskInputOptions,\n maskAttributeFn,\n maskTextFn,\n maskInputFn,\n dataURLOptions,\n inlineImages,\n recordCanvas,\n keepIframeSrcFn,\n newlyAddedElement,\n });\n if (!_serializedNode) {\n console.warn(n, 'not serialized');\n return null;\n }\n let id;\n if (mirror.hasNode(n)) {\n id = mirror.getId(n);\n }\n else if (slimDOMExcluded(_serializedNode, slimDOMOptions) ||\n (!preserveWhiteSpace &&\n _serializedNode.type === NodeType$1.Text &&\n !_serializedNode.isStyle &&\n !_serializedNode.textContent.replace(/^\\s+|\\s+$/gm, '').length)) {\n id = IGNORED_NODE;\n }\n else {\n id = genId();\n }\n const serializedNode = Object.assign(_serializedNode, { id });\n mirror.add(n, serializedNode);\n if (id === IGNORED_NODE) {\n return null;\n }\n if (onSerialize) {\n onSerialize(n);\n }\n let recordChild = !skipChild;\n if (serializedNode.type === NodeType$1.Element) {\n recordChild = recordChild && !serializedNode.needBlock;\n delete serializedNode.needBlock;\n const shadowRoot = n.shadowRoot;\n if (shadowRoot && isNativeShadowDom(shadowRoot))\n serializedNode.isShadowHost = true;\n }\n if ((serializedNode.type === NodeType$1.Document ||\n serializedNode.type === NodeType$1.Element) &&\n recordChild) {\n if (slimDOMOptions.headWhitespace &&\n serializedNode.type === NodeType$1.Element &&\n serializedNode.tagName === 'head') {\n preserveWhiteSpace = false;\n }\n const bypassOptions = {\n doc,\n mirror,\n blockClass,\n blockSelector,\n maskAllText,\n unblockSelector,\n maskTextClass,\n unmaskTextClass,\n maskTextSelector,\n unmaskTextSelector,\n skipChild,\n inlineStylesheet,\n maskInputOptions,\n maskAttributeFn,\n maskTextFn,\n maskInputFn,\n slimDOMOptions,\n dataURLOptions,\n inlineImages,\n recordCanvas,\n preserveWhiteSpace,\n onSerialize,\n onIframeLoad,\n iframeLoadTimeout,\n onStylesheetLoad,\n stylesheetLoadTimeout,\n keepIframeSrcFn,\n };\n for (const childN of Array.from(n.childNodes)) {\n const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n if (serializedChildNode) {\n serializedNode.childNodes.push(serializedChildNode);\n }\n }\n if (isElement$1(n) && n.shadowRoot) {\n for (const childN of Array.from(n.shadowRoot.childNodes)) {\n const serializedChildNode = serializeNodeWithId(childN, bypassOptions);\n if (serializedChildNode) {\n isNativeShadowDom(n.shadowRoot) &&\n (serializedChildNode.isShadow = true);\n serializedNode.childNodes.push(serializedChildNode);\n }\n }\n }\n }\n if (n.parentNode &&\n isShadowRoot(n.parentNode) &&\n isNativeShadowDom(n.parentNode)) {\n serializedNode.isShadow = true;\n }\n if (serializedNode.type === NodeType$1.Element &&\n serializedNode.tagName === 'iframe') {\n onceIframeLoaded(n, () => {\n const iframeDoc = n.contentDocument;\n if (iframeDoc && onIframeLoad) {\n const serializedIframeNode = serializeNodeWithId(iframeDoc, {\n doc: iframeDoc,\n mirror,\n blockClass,\n blockSelector,\n unblockSelector,\n maskAllText,\n maskTextClass,\n unmaskTextClass,\n maskTextSelector,\n unmaskTextSelector,\n skipChild: false,\n inlineStylesheet,\n maskInputOptions,\n maskAttributeFn,\n maskTextFn,\n maskInputFn,\n slimDOMOptions,\n dataURLOptions,\n inlineImages,\n recordCanvas,\n preserveWhiteSpace,\n onSerialize,\n onIframeLoad,\n iframeLoadTimeout,\n onStylesheetLoad,\n stylesheetLoadTimeout,\n keepIframeSrcFn,\n });\n if (serializedIframeNode) {\n onIframeLoad(n, serializedIframeNode);\n }\n }\n }, iframeLoadTimeout);\n }\n if (serializedNode.type === NodeType$1.Element &&\n serializedNode.tagName === 'link' &&\n serializedNode.attributes.rel === 'stylesheet') {\n onceStylesheetLoaded(n, () => {\n if (onStylesheetLoad) {\n const serializedLinkNode = serializeNodeWithId(n, {\n doc,\n mirror,\n blockClass,\n blockSelector,\n unblockSelector,\n maskAllText,\n maskTextClass,\n unmaskTextClass,\n maskTextSelector,\n unmaskTextSelector,\n skipChild: false,\n inlineStylesheet,\n maskInputOptions,\n maskAttributeFn,\n maskTextFn,\n maskInputFn,\n slimDOMOptions,\n dataURLOptions,\n inlineImages,\n recordCanvas,\n preserveWhiteSpace,\n onSerialize,\n onIframeLoad,\n iframeLoadTimeout,\n onStylesheetLoad,\n stylesheetLoadTimeout,\n keepIframeSrcFn,\n });\n if (serializedLinkNode) {\n onStylesheetLoad(n, serializedLinkNode);\n }\n }\n }, stylesheetLoadTimeout);\n }\n return serializedNode;\n}\nfunction snapshot(n, options) {\n const { mirror = new Mirror(), blockClass = 'rr-block', blockSelector = null, unblockSelector = null, maskAllText = false, maskTextClass = 'rr-mask', unmaskTextClass = null, maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, inlineImages = false, recordCanvas = false, maskAllInputs = false, maskAttributeFn, maskTextFn, maskInputFn, slimDOM = false, dataURLOptions, preserveWhiteSpace, onSerialize, onIframeLoad, iframeLoadTimeout, onStylesheetLoad, stylesheetLoadTimeout, keepIframeSrcFn = () => false, } = options || {};\n const maskInputOptions = maskAllInputs === true\n ? {\n color: true,\n date: true,\n 'datetime-local': true,\n email: true,\n month: true,\n number: true,\n range: true,\n search: true,\n tel: true,\n text: true,\n time: true,\n url: true,\n week: true,\n textarea: true,\n select: true,\n }\n : maskAllInputs === false\n ? {}\n : maskAllInputs;\n const slimDOMOptions = slimDOM === true || slimDOM === 'all'\n ?\n {\n script: true,\n comment: true,\n headFavicon: true,\n headWhitespace: true,\n headMetaDescKeywords: slimDOM === 'all',\n headMetaSocial: true,\n headMetaRobots: true,\n headMetaHttpEquiv: true,\n headMetaAuthorship: true,\n headMetaVerification: true,\n }\n : slimDOM === false\n ? {}\n : slimDOM;\n return serializeNodeWithId(n, {\n doc: n,\n mirror,\n blockClass,\n blockSelector,\n unblockSelector,\n maskAllText,\n maskTextClass,\n unmaskTextClass,\n maskTextSelector,\n unmaskTextSelector,\n skipChild: false,\n inlineStylesheet,\n maskInputOptions,\n maskAttributeFn,\n maskTextFn,\n maskInputFn,\n slimDOMOptions,\n dataURLOptions,\n inlineImages,\n recordCanvas,\n preserveWhiteSpace,\n onSerialize,\n onIframeLoad,\n iframeLoadTimeout,\n onStylesheetLoad,\n stylesheetLoadTimeout,\n keepIframeSrcFn,\n newlyAddedElement: false,\n });\n}\n\nfunction _optionalChain$4(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }\nfunction on(type, fn, target = document) {\n const options = { capture: true, passive: true };\n target.addEventListener(type, fn, options);\n return () => target.removeEventListener(type, fn, options);\n}\nconst DEPARTED_MIRROR_ACCESS_WARNING = 'Please stop import mirror directly. Instead of that,' +\n '\\r\\n' +\n 'now you can use replayer.getMirror() to access the mirror instance of a replayer,' +\n '\\r\\n' +\n 'or you can use record.mirror to access the mirror instance during recording.';\nlet _mirror = {\n map: {},\n getId() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n return -1;\n },\n getNode() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n return null;\n },\n removeNodeFromMap() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n },\n has() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n return false;\n },\n reset() {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n },\n};\nif (typeof window !== 'undefined' && window.Proxy && window.Reflect) {\n _mirror = new Proxy(_mirror, {\n get(target, prop, receiver) {\n if (prop === 'map') {\n console.error(DEPARTED_MIRROR_ACCESS_WARNING);\n }\n return Reflect.get(target, prop, receiver);\n },\n });\n}\nfunction throttle$1(func, wait, options = {}) {\n let timeout = null;\n let previous = 0;\n return function (...args) {\n const now = Date.now();\n if (!previous && options.leading === false) {\n previous = now;\n }\n const remaining = wait - (now - previous);\n const context = this;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout$1(timeout);\n timeout = null;\n }\n previous = now;\n func.apply(context, args);\n }\n else if (!timeout && options.trailing !== false) {\n timeout = setTimeout$1(() => {\n previous = options.leading === false ? 0 : Date.now();\n timeout = null;\n func.apply(context, args);\n }, remaining);\n }\n };\n}\nfunction hookSetter(target, key, d, isRevoked, win = window) {\n const original = win.Object.getOwnPropertyDescriptor(target, key);\n win.Object.defineProperty(target, key, isRevoked\n ? d\n : {\n set(value) {\n setTimeout$1(() => {\n d.set.call(this, value);\n }, 0);\n if (original && original.set) {\n original.set.call(this, value);\n }\n },\n });\n return () => hookSetter(target, key, original || {}, true);\n}\nfunction patch(source, name, replacement) {\n try {\n if (!(name in source)) {\n return () => {\n };\n }\n const original = source[name];\n const wrapped = replacement(original);\n if (typeof wrapped === 'function') {\n wrapped.prototype = wrapped.prototype || {};\n Object.defineProperties(wrapped, {\n __rrweb_original__: {\n enumerable: false,\n value: original,\n },\n });\n }\n source[name] = wrapped;\n return () => {\n source[name] = original;\n };\n }\n catch (e2) {\n return () => {\n };\n }\n}\nlet nowTimestamp = Date.now;\nif (!(/[1-9][0-9]{12}/.test(Date.now().toString()))) {\n nowTimestamp = () => new Date().getTime();\n}\nfunction getWindowScroll(win) {\n const doc = win.document;\n return {\n left: doc.scrollingElement\n ? doc.scrollingElement.scrollLeft\n : win.pageXOffset !== undefined\n ? win.pageXOffset\n : _optionalChain$4([doc, 'optionalAccess', _ => _.documentElement, 'access', _2 => _2.scrollLeft]) ||\n _optionalChain$4([doc, 'optionalAccess', _3 => _3.body, 'optionalAccess', _4 => _4.parentElement, 'optionalAccess', _5 => _5.scrollLeft]) ||\n _optionalChain$4([doc, 'optionalAccess', _6 => _6.body, 'optionalAccess', _7 => _7.scrollLeft]) ||\n 0,\n top: doc.scrollingElement\n ? doc.scrollingElement.scrollTop\n : win.pageYOffset !== undefined\n ? win.pageYOffset\n : _optionalChain$4([doc, 'optionalAccess', _8 => _8.documentElement, 'access', _9 => _9.scrollTop]) ||\n _optionalChain$4([doc, 'optionalAccess', _10 => _10.body, 'optionalAccess', _11 => _11.parentElement, 'optionalAccess', _12 => _12.scrollTop]) ||\n _optionalChain$4([doc, 'optionalAccess', _13 => _13.body, 'optionalAccess', _14 => _14.scrollTop]) ||\n 0,\n };\n}\nfunction getWindowHeight() {\n return (window.innerHeight ||\n (document.documentElement && document.documentElement.clientHeight) ||\n (document.body && document.body.clientHeight));\n}\nfunction getWindowWidth() {\n return (window.innerWidth ||\n (document.documentElement && document.documentElement.clientWidth) ||\n (document.body && document.body.clientWidth));\n}\nfunction closestElementOfNode(node) {\n if (!node) {\n return null;\n }\n const el = node.nodeType === node.ELEMENT_NODE\n ? node\n : node.parentElement;\n return el;\n}\nfunction isBlocked(node, blockClass, blockSelector, unblockSelector, checkAncestors) {\n if (!node) {\n return false;\n }\n const el = closestElementOfNode(node);\n if (!el) {\n return false;\n }\n const blockedPredicate = createMatchPredicate(blockClass, blockSelector);\n if (!checkAncestors) {\n const isUnblocked = unblockSelector && el.matches(unblockSelector);\n return blockedPredicate(el) && !isUnblocked;\n }\n const blockDistance = distanceToMatch(el, blockedPredicate);\n let unblockDistance = -1;\n if (blockDistance < 0) {\n return false;\n }\n if (unblockSelector) {\n unblockDistance = distanceToMatch(el, createMatchPredicate(null, unblockSelector));\n }\n if (blockDistance > -1 && unblockDistance < 0) {\n return true;\n }\n return blockDistance < unblockDistance;\n}\nfunction isSerialized(n, mirror) {\n return mirror.getId(n) !== -1;\n}\nfunction isIgnored(n, mirror) {\n return mirror.getId(n) === IGNORED_NODE;\n}\nfunction isAncestorRemoved(target, mirror) {\n if (isShadowRoot(target)) {\n return false;\n }\n const id = mirror.getId(target);\n if (!mirror.has(id)) {\n return true;\n }\n if (target.parentNode &&\n target.parentNode.nodeType === target.DOCUMENT_NODE) {\n return false;\n }\n if (!target.parentNode) {\n return true;\n }\n return isAncestorRemoved(target.parentNode, mirror);\n}\nfunction legacy_isTouchEvent(event) {\n return Boolean(event.changedTouches);\n}\nfunction polyfill(win = window) {\n if ('NodeList' in win && !win.NodeList.prototype.forEach) {\n win.NodeList.prototype.forEach = Array.prototype\n .forEach;\n }\n if ('DOMTokenList' in win && !win.DOMTokenList.prototype.forEach) {\n win.DOMTokenList.prototype.forEach = Array.prototype\n .forEach;\n }\n if (!Node.prototype.contains) {\n Node.prototype.contains = (...args) => {\n let node = args[0];\n if (!(0 in args)) {\n throw new TypeError('1 argument is required');\n }\n do {\n if (this === node) {\n return true;\n }\n } while ((node = node && node.parentNode));\n return false;\n };\n }\n}\nfunction isSerializedIframe(n, mirror) {\n return Boolean(n.nodeName === 'IFRAME' && mirror.getMeta(n));\n}\nfunction isSerializedStylesheet(n, mirror) {\n return Boolean(n.nodeName === 'LINK' &&\n n.nodeType === n.ELEMENT_NODE &&\n n.getAttribute &&\n n.getAttribute('rel') === 'stylesheet' &&\n mirror.getMeta(n));\n}\nfunction hasShadowRoot(n) {\n return Boolean(_optionalChain$4([n, 'optionalAccess', _18 => _18.shadowRoot]));\n}\nclass StyleSheetMirror {\n constructor() {\n this.id = 1;\n this.styleIDMap = new WeakMap();\n this.idStyleMap = new Map();\n }\n getId(stylesheet) {\n return _nullishCoalesce(this.styleIDMap.get(stylesheet), () => ( -1));\n }\n has(stylesheet) {\n return this.styleIDMap.has(stylesheet);\n }\n add(stylesheet, id) {\n if (this.has(stylesheet))\n return this.getId(stylesheet);\n let newId;\n if (id === undefined) {\n newId = this.id++;\n }\n else\n newId = id;\n this.styleIDMap.set(stylesheet, newId);\n this.idStyleMap.set(newId, stylesheet);\n return newId;\n }\n getStyle(id) {\n return this.idStyleMap.get(id) || null;\n }\n reset() {\n this.styleIDMap = new WeakMap();\n this.idStyleMap = new Map();\n this.id = 1;\n }\n generateId() {\n return this.id++;\n }\n}\nfunction getShadowHost(n) {\n let shadowHost = null;\n if (_optionalChain$4([n, 'access', _19 => _19.getRootNode, 'optionalCall', _20 => _20(), 'optionalAccess', _21 => _21.nodeType]) === Node.DOCUMENT_FRAGMENT_NODE &&\n n.getRootNode().host)\n shadowHost = n.getRootNode().host;\n return shadowHost;\n}\nfunction getRootShadowHost(n) {\n let rootShadowHost = n;\n let shadowHost;\n while ((shadowHost = getShadowHost(rootShadowHost)))\n rootShadowHost = shadowHost;\n return rootShadowHost;\n}\nfunction shadowHostInDom(n) {\n const doc = n.ownerDocument;\n if (!doc)\n return false;\n const shadowHost = getRootShadowHost(n);\n return doc.contains(shadowHost);\n}\nfunction inDom(n) {\n const doc = n.ownerDocument;\n if (!doc)\n return false;\n return doc.contains(n) || shadowHostInDom(n);\n}\nconst cachedImplementations = {};\nfunction getImplementation(name) {\n const cached = cachedImplementations[name];\n if (cached) {\n return cached;\n }\n const document = window.document;\n let impl = window[name];\n if (document && typeof document.createElement === 'function') {\n try {\n const sandbox = document.createElement('iframe');\n sandbox.hidden = true;\n document.head.appendChild(sandbox);\n const contentWindow = sandbox.contentWindow;\n if (contentWindow && contentWindow[name]) {\n impl =\n contentWindow[name];\n }\n document.head.removeChild(sandbox);\n }\n catch (e) {\n }\n }\n return (cachedImplementations[name] = impl.bind(window));\n}\nfunction onRequestAnimationFrame(...rest) {\n return getImplementation('requestAnimationFrame')(...rest);\n}\nfunction setTimeout$1(...rest) {\n return getImplementation('setTimeout')(...rest);\n}\nfunction clearTimeout$1(...rest) {\n return getImplementation('clearTimeout')(...rest);\n}\n\nvar EventType = /* @__PURE__ */ ((EventType2) => {\n EventType2[EventType2[\"DomContentLoaded\"] = 0] = \"DomContentLoaded\";\n EventType2[EventType2[\"Load\"] = 1] = \"Load\";\n EventType2[EventType2[\"FullSnapshot\"] = 2] = \"FullSnapshot\";\n EventType2[EventType2[\"IncrementalSnapshot\"] = 3] = \"IncrementalSnapshot\";\n EventType2[EventType2[\"Meta\"] = 4] = \"Meta\";\n EventType2[EventType2[\"Custom\"] = 5] = \"Custom\";\n EventType2[EventType2[\"Plugin\"] = 6] = \"Plugin\";\n return EventType2;\n})(EventType || {});\nvar IncrementalSource = /* @__PURE__ */ ((IncrementalSource2) => {\n IncrementalSource2[IncrementalSource2[\"Mutation\"] = 0] = \"Mutation\";\n IncrementalSource2[IncrementalSource2[\"MouseMove\"] = 1] = \"MouseMove\";\n IncrementalSource2[IncrementalSource2[\"MouseInteraction\"] = 2] = \"MouseInteraction\";\n IncrementalSource2[IncrementalSource2[\"Scroll\"] = 3] = \"Scroll\";\n IncrementalSource2[IncrementalSource2[\"ViewportResize\"] = 4] = \"ViewportResize\";\n IncrementalSource2[IncrementalSource2[\"Input\"] = 5] = \"Input\";\n IncrementalSource2[IncrementalSource2[\"TouchMove\"] = 6] = \"TouchMove\";\n IncrementalSource2[IncrementalSource2[\"MediaInteraction\"] = 7] = \"MediaInteraction\";\n IncrementalSource2[IncrementalSource2[\"StyleSheetRule\"] = 8] = \"StyleSheetRule\";\n IncrementalSource2[IncrementalSource2[\"CanvasMutation\"] = 9] = \"CanvasMutation\";\n IncrementalSource2[IncrementalSource2[\"Font\"] = 10] = \"Font\";\n IncrementalSource2[IncrementalSource2[\"Log\"] = 11] = \"Log\";\n IncrementalSource2[IncrementalSource2[\"Drag\"] = 12] = \"Drag\";\n IncrementalSource2[IncrementalSource2[\"StyleDeclaration\"] = 13] = \"StyleDeclaration\";\n IncrementalSource2[IncrementalSource2[\"Selection\"] = 14] = \"Selection\";\n IncrementalSource2[IncrementalSource2[\"AdoptedStyleSheet\"] = 15] = \"AdoptedStyleSheet\";\n IncrementalSource2[IncrementalSource2[\"CustomElement\"] = 16] = \"CustomElement\";\n return IncrementalSource2;\n})(IncrementalSource || {});\nvar MouseInteractions = /* @__PURE__ */ ((MouseInteractions2) => {\n MouseInteractions2[MouseInteractions2[\"MouseUp\"] = 0] = \"MouseUp\";\n MouseInteractions2[MouseInteractions2[\"MouseDown\"] = 1] = \"MouseDown\";\n MouseInteractions2[MouseInteractions2[\"Click\"] = 2] = \"Click\";\n MouseInteractions2[MouseInteractions2[\"ContextMenu\"] = 3] = \"ContextMenu\";\n MouseInteractions2[MouseInteractions2[\"DblClick\"] = 4] = \"DblClick\";\n MouseInteractions2[MouseInteractions2[\"Focus\"] = 5] = \"Focus\";\n MouseInteractions2[MouseInteractions2[\"Blur\"] = 6] = \"Blur\";\n MouseInteractions2[MouseInteractions2[\"TouchStart\"] = 7] = \"TouchStart\";\n MouseInteractions2[MouseInteractions2[\"TouchMove_Departed\"] = 8] = \"TouchMove_Departed\";\n MouseInteractions2[MouseInteractions2[\"TouchEnd\"] = 9] = \"TouchEnd\";\n MouseInteractions2[MouseInteractions2[\"TouchCancel\"] = 10] = \"TouchCancel\";\n return MouseInteractions2;\n})(MouseInteractions || {});\nvar PointerTypes = /* @__PURE__ */ ((PointerTypes2) => {\n PointerTypes2[PointerTypes2[\"Mouse\"] = 0] = \"Mouse\";\n PointerTypes2[PointerTypes2[\"Pen\"] = 1] = \"Pen\";\n PointerTypes2[PointerTypes2[\"Touch\"] = 2] = \"Touch\";\n return PointerTypes2;\n})(PointerTypes || {});\n\nfunction _optionalChain$3(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }\nfunction isNodeInLinkedList(n) {\n return '__ln' in n;\n}\nclass DoubleLinkedList {\n constructor() {\n this.length = 0;\n this.head = null;\n this.tail = null;\n }\n get(position) {\n if (position >= this.length) {\n throw new Error('Position outside of list range');\n }\n let current = this.head;\n for (let index = 0; index < position; index++) {\n current = _optionalChain$3([current, 'optionalAccess', _ => _.next]) || null;\n }\n return current;\n }\n addNode(n) {\n const node = {\n value: n,\n previous: null,\n next: null,\n };\n n.__ln = node;\n if (n.previousSibling && isNodeInLinkedList(n.previousSibling)) {\n const current = n.previousSibling.__ln.next;\n node.next = current;\n node.previous = n.previousSibling.__ln;\n n.previousSibling.__ln.next = node;\n if (current) {\n current.previous = node;\n }\n }\n else if (n.nextSibling &&\n isNodeInLinkedList(n.nextSibling) &&\n n.nextSibling.__ln.previous) {\n const current = n.nextSibling.__ln.previous;\n node.previous = current;\n node.next = n.nextSibling.__ln;\n n.nextSibling.__ln.previous = node;\n if (current) {\n current.next = node;\n }\n }\n else {\n if (this.head) {\n this.head.previous = node;\n }\n node.next = this.head;\n this.head = node;\n }\n if (node.next === null) {\n this.tail = node;\n }\n this.length++;\n }\n removeNode(n) {\n const current = n.__ln;\n if (!this.head) {\n return;\n }\n if (!current.previous) {\n this.head = current.next;\n if (this.head) {\n this.head.previous = null;\n }\n else {\n this.tail = null;\n }\n }\n else {\n current.previous.next = current.next;\n if (current.next) {\n current.next.previous = current.previous;\n }\n else {\n this.tail = current.previous;\n }\n }\n if (n.__ln) {\n delete n.__ln;\n }\n this.length--;\n }\n}\nconst moveKey = (id, parentId) => `${id}@${parentId}`;\nclass MutationBuffer {\n constructor() {\n this.frozen = false;\n this.locked = false;\n this.texts = [];\n this.attributes = [];\n this.attributeMap = new WeakMap();\n this.removes = [];\n this.mapRemoves = [];\n this.movedMap = {};\n this.addedSet = new Set();\n this.movedSet = new Set();\n this.droppedSet = new Set();\n this.processMutations = (mutations) => {\n mutations.forEach(this.processMutation);\n this.emit();\n };\n this.emit = () => {\n if (this.frozen || this.locked) {\n return;\n }\n const adds = [];\n const addedIds = new Set();\n const addList = new DoubleLinkedList();\n const getNextId = (n) => {\n let ns = n;\n let nextId = IGNORED_NODE;\n while (nextId === IGNORED_NODE) {\n ns = ns && ns.nextSibling;\n nextId = ns && this.mirror.getId(ns);\n }\n return nextId;\n };\n const pushAdd = (n) => {\n if (!n.parentNode || !inDom(n)) {\n return;\n }\n const parentId = isShadowRoot(n.parentNode)\n ? this.mirror.getId(getShadowHost(n))\n : this.mirror.getId(n.parentNode);\n const nextId = getNextId(n);\n if (parentId === -1 || nextId === -1) {\n return addList.addNode(n);\n }\n const sn = serializeNodeWithId(n, {\n doc: this.doc,\n mirror: this.mirror,\n blockClass: this.blockClass,\n blockSelector: this.blockSelector,\n maskAllText: this.maskAllText,\n unblockSelector: this.unblockSelector,\n maskTextClass: this.maskTextClass,\n unmaskTextClass: this.unmaskTextClass,\n maskTextSelector: this.maskTextSelector,\n unmaskTextSelector: this.unmaskTextSelector,\n skipChild: true,\n newlyAddedElement: true,\n inlineStylesheet: this.inlineStylesheet,\n maskInputOptions: this.maskInputOptions,\n maskAttributeFn: this.maskAttributeFn,\n maskTextFn: this.maskTextFn,\n maskInputFn: this.maskInputFn,\n slimDOMOptions: this.slimDOMOptions,\n dataURLOptions: this.dataURLOptions,\n recordCanvas: this.recordCanvas,\n inlineImages: this.inlineImages,\n onSerialize: (currentN) => {\n if (isSerializedIframe(currentN, this.mirror)) {\n this.iframeManager.addIframe(currentN);\n }\n if (isSerializedStylesheet(currentN, this.mirror)) {\n this.stylesheetManager.trackLinkElement(currentN);\n }\n if (hasShadowRoot(n)) {\n this.shadowDomManager.addShadowRoot(n.shadowRoot, this.doc);\n }\n },\n onIframeLoad: (iframe, childSn) => {\n this.iframeManager.attachIframe(iframe, childSn);\n this.shadowDomManager.observeAttachShadow(iframe);\n },\n onStylesheetLoad: (link, childSn) => {\n this.stylesheetManager.attachLinkElement(link, childSn);\n },\n });\n if (sn) {\n adds.push({\n parentId,\n nextId,\n node: sn,\n });\n addedIds.add(sn.id);\n }\n };\n while (this.mapRemoves.length) {\n this.mirror.removeNodeFromMap(this.mapRemoves.shift());\n }\n for (const n of this.movedSet) {\n if (isParentRemoved(this.removes, n, this.mirror) &&\n !this.movedSet.has(n.parentNode)) {\n continue;\n }\n pushAdd(n);\n }\n for (const n of this.addedSet) {\n if (!isAncestorInSet(this.droppedSet, n) &&\n !isParentRemoved(this.removes, n, this.mirror)) {\n pushAdd(n);\n }\n else if (isAncestorInSet(this.movedSet, n)) {\n pushAdd(n);\n }\n else {\n this.droppedSet.add(n);\n }\n }\n let candidate = null;\n while (addList.length) {\n let node = null;\n if (candidate) {\n const parentId = this.mirror.getId(candidate.value.parentNode);\n const nextId = getNextId(candidate.value);\n if (parentId !== -1 && nextId !== -1) {\n node = candidate;\n }\n }\n if (!node) {\n let tailNode = addList.tail;\n while (tailNode) {\n const _node = tailNode;\n tailNode = tailNode.previous;\n if (_node) {\n const parentId = this.mirror.getId(_node.value.parentNode);\n const nextId = getNextId(_node.value);\n if (nextId === -1)\n continue;\n else if (parentId !== -1) {\n node = _node;\n break;\n }\n else {\n const unhandledNode = _node.value;\n if (unhandledNode.parentNode &&\n unhandledNode.parentNode.nodeType ===\n Node.DOCUMENT_FRAGMENT_NODE) {\n const shadowHost = unhandledNode.parentNode\n .host;\n const parentId = this.mirror.getId(shadowHost);\n if (parentId !== -1) {\n node = _node;\n break;\n }\n }\n }\n }\n }\n }\n if (!node) {\n while (addList.head) {\n addList.removeNode(addList.head.value);\n }\n break;\n }\n candidate = node.previous;\n addList.removeNode(node.value);\n pushAdd(node.value);\n }\n const payload = {\n texts: this.texts\n .map((text) => ({\n id: this.mirror.getId(text.node),\n value: text.value,\n }))\n .filter((text) => !addedIds.has(text.id))\n .filter((text) => this.mirror.has(text.id)),\n attributes: this.attributes\n .map((attribute) => {\n const { attributes } = attribute;\n if (typeof attributes.style === 'string') {\n const diffAsStr = JSON.stringify(attribute.styleDiff);\n const unchangedAsStr = JSON.stringify(attribute._unchangedStyles);\n if (diffAsStr.length < attributes.style.length) {\n if ((diffAsStr + unchangedAsStr).split('var(').length ===\n attributes.style.split('var(').length) {\n attributes.style = attribute.styleDiff;\n }\n }\n }\n return {\n id: this.mirror.getId(attribute.node),\n attributes: attributes,\n };\n })\n .filter((attribute) => !addedIds.has(attribute.id))\n .filter((attribute) => this.mirror.has(attribute.id)),\n removes: this.removes,\n adds,\n };\n if (!payload.texts.length &&\n !payload.attributes.length &&\n !payload.removes.length &&\n !payload.adds.length) {\n return;\n }\n this.texts = [];\n this.attributes = [];\n this.attributeMap = new WeakMap();\n this.removes = [];\n this.addedSet = new Set();\n this.movedSet = new Set();\n this.droppedSet = new Set();\n this.movedMap = {};\n this.mutationCb(payload);\n };\n this.processMutation = (m) => {\n if (isIgnored(m.target, this.mirror)) {\n return;\n }\n switch (m.type) {\n case 'characterData': {\n const value = m.target.textContent;\n if (!isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, false) &&\n value !== m.oldValue) {\n this.texts.push({\n value: needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextClass, this.unmaskTextSelector, this.maskAllText) && value\n ? this.maskTextFn\n ? this.maskTextFn(value, closestElementOfNode(m.target))\n : value.replace(/[\\S]/g, '*')\n : value,\n node: m.target,\n });\n }\n break;\n }\n case 'attributes': {\n const target = m.target;\n let attributeName = m.attributeName;\n let value = m.target.getAttribute(attributeName);\n if (attributeName === 'value') {\n const type = getInputType(target);\n const tagName = target.tagName;\n value = getInputValue(target, tagName, type);\n const isInputMasked = shouldMaskInput({\n maskInputOptions: this.maskInputOptions,\n tagName,\n type,\n });\n const forceMask = needMaskingText(m.target, this.maskTextClass, this.maskTextSelector, this.unmaskTextClass, this.unmaskTextSelector, isInputMasked);\n value = maskInputValue({\n isMasked: forceMask,\n element: target,\n value,\n maskInputFn: this.maskInputFn,\n });\n }\n if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, false) ||\n value === m.oldValue) {\n return;\n }\n let item = this.attributeMap.get(m.target);\n if (target.tagName === 'IFRAME' &&\n attributeName === 'src' &&\n !this.keepIframeSrcFn(value)) {\n if (!target.contentDocument) {\n attributeName = 'rr_src';\n }\n else {\n return;\n }\n }\n if (!item) {\n item = {\n node: m.target,\n attributes: {},\n styleDiff: {},\n _unchangedStyles: {},\n };\n this.attributes.push(item);\n this.attributeMap.set(m.target, item);\n }\n if (attributeName === 'type' &&\n target.tagName === 'INPUT' &&\n (m.oldValue || '').toLowerCase() === 'password') {\n target.setAttribute('data-rr-is-password', 'true');\n }\n if (!ignoreAttribute(target.tagName, attributeName)) {\n item.attributes[attributeName] = transformAttribute(this.doc, toLowerCase(target.tagName), toLowerCase(attributeName), value, target, this.maskAttributeFn);\n if (attributeName === 'style') {\n if (!this.unattachedDoc) {\n try {\n this.unattachedDoc =\n document.implementation.createHTMLDocument();\n }\n catch (e) {\n this.unattachedDoc = this.doc;\n }\n }\n const old = this.unattachedDoc.createElement('span');\n if (m.oldValue) {\n old.setAttribute('style', m.oldValue);\n }\n for (const pname of Array.from(target.style)) {\n const newValue = target.style.getPropertyValue(pname);\n const newPriority = target.style.getPropertyPriority(pname);\n if (newValue !== old.style.getPropertyValue(pname) ||\n newPriority !== old.style.getPropertyPriority(pname)) {\n if (newPriority === '') {\n item.styleDiff[pname] = newValue;\n }\n else {\n item.styleDiff[pname] = [newValue, newPriority];\n }\n }\n else {\n item._unchangedStyles[pname] = [newValue, newPriority];\n }\n }\n for (const pname of Array.from(old.style)) {\n if (target.style.getPropertyValue(pname) === '') {\n item.styleDiff[pname] = false;\n }\n }\n }\n }\n break;\n }\n case 'childList': {\n if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, true)) {\n return;\n }\n m.addedNodes.forEach((n) => this.genAdds(n, m.target));\n m.removedNodes.forEach((n) => {\n const nodeId = this.mirror.getId(n);\n const parentId = isShadowRoot(m.target)\n ? this.mirror.getId(m.target.host)\n : this.mirror.getId(m.target);\n if (isBlocked(m.target, this.blockClass, this.blockSelector, this.unblockSelector, false) ||\n isIgnored(n, this.mirror) ||\n !isSerialized(n, this.mirror)) {\n return;\n }\n if (this.addedSet.has(n)) {\n deepDelete(this.addedSet, n);\n this.droppedSet.add(n);\n }\n else if (this.addedSet.has(m.target) && nodeId === -1) ;\n else if (isAncestorRemoved(m.target, this.mirror)) ;\n else if (this.movedSet.has(n) &&\n this.movedMap[moveKey(nodeId, parentId)]) {\n deepDelete(this.movedSet, n);\n }\n else {\n this.removes.push({\n parentId,\n id: nodeId,\n isShadow: isShadowRoot(m.target) && isNativeShadowDom(m.target)\n ? true\n : undefined,\n });\n }\n this.mapRemoves.push(n);\n });\n break;\n }\n }\n };\n this.genAdds = (n, target) => {\n if (this.processedNodeManager.inOtherBuffer(n, this))\n return;\n if (this.addedSet.has(n) || this.movedSet.has(n))\n return;\n if (this.mirror.hasNode(n)) {\n if (isIgnored(n, this.mirror)) {\n return;\n }\n this.movedSet.add(n);\n let targetId = null;\n if (target && this.mirror.hasNode(target)) {\n targetId = this.mirror.getId(target);\n }\n if (targetId && targetId !== -1) {\n this.movedMap[moveKey(this.mirror.getId(n), targetId)] = true;\n }\n }\n else {\n this.addedSet.add(n);\n this.droppedSet.delete(n);\n }\n if (!isBlocked(n, this.blockClass, this.blockSelector, this.unblockSelector, false)) {\n n.childNodes.forEach((childN) => this.genAdds(childN));\n if (hasShadowRoot(n)) {\n n.shadowRoot.childNodes.forEach((childN) => {\n this.processedNodeManager.add(childN, this);\n this.genAdds(childN, n);\n });\n }\n }\n };\n }\n init(options) {\n [\n 'mutationCb',\n 'blockClass',\n 'blockSelector',\n 'unblockSelector',\n 'maskAllText',\n 'maskTextClass',\n 'unmaskTextClass',\n 'maskTextSelector',\n 'unmaskTextSelector',\n 'inlineStylesheet',\n 'maskInputOptions',\n 'maskAttributeFn',\n 'maskTextFn',\n 'maskInputFn',\n 'keepIframeSrcFn',\n 'recordCanvas',\n 'inlineImages',\n 'slimDOMOptions',\n 'dataURLOptions',\n 'doc',\n 'mirror',\n 'iframeManager',\n 'stylesheetManager',\n 'shadowDomManager',\n 'canvasManager',\n 'processedNodeManager',\n ].forEach((key) => {\n this[key] = options[key];\n });\n }\n freeze() {\n this.frozen = true;\n this.canvasManager.freeze();\n }\n unfreeze() {\n this.frozen = false;\n this.canvasManager.unfreeze();\n this.emit();\n }\n isFrozen() {\n return this.frozen;\n }\n lock() {\n this.locked = true;\n this.canvasManager.lock();\n }\n unlock() {\n this.locked = false;\n this.canvasManager.unlock();\n this.emit();\n }\n reset() {\n this.shadowDomManager.reset();\n this.canvasManager.reset();\n }\n}\nfunction deepDelete(addsSet, n) {\n addsSet.delete(n);\n n.childNodes.forEach((childN) => deepDelete(addsSet, childN));\n}\nfunction isParentRemoved(removes, n, mirror) {\n if (removes.length === 0)\n return false;\n return _isParentRemoved(removes, n, mirror);\n}\nfunction _isParentRemoved(removes, n, mirror) {\n const { parentNode } = n;\n if (!parentNode) {\n return false;\n }\n const parentId = mirror.getId(parentNode);\n if (removes.some((r) => r.id === parentId)) {\n return true;\n }\n return _isParentRemoved(removes, parentNode, mirror);\n}\nfunction isAncestorInSet(set, n) {\n if (set.size === 0)\n return false;\n return _isAncestorInSet(set, n);\n}\nfunction _isAncestorInSet(set, n) {\n const { parentNode } = n;\n if (!parentNode) {\n return false;\n }\n if (set.has(parentNode)) {\n return true;\n }\n return _isAncestorInSet(set, parentNode);\n}\n\nlet errorHandler;\nfunction registerErrorHandler(handler) {\n errorHandler = handler;\n}\nfunction unregisterErrorHandler() {\n errorHandler = undefined;\n}\nconst callbackWrapper = (cb) => {\n if (!errorHandler) {\n return cb;\n }\n const rrwebWrapped = ((...rest) => {\n try {\n return cb(...rest);\n }\n catch (error) {\n if (errorHandler && errorHandler(error) === true) {\n return () => {\n };\n }\n throw error;\n }\n });\n return rrwebWrapped;\n};\n\nfunction _optionalChain$2(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }\nconst mutationBuffers = [];\nfunction getEventTarget(event) {\n try {\n if ('composedPath' in event) {\n const path = event.composedPath();\n if (path.length) {\n return path[0];\n }\n }\n else if ('path' in event && event.path.length) {\n return event.path[0];\n }\n }\n catch (e2) {\n }\n return event && event.target;\n}\nfunction initMutationObserver(options, rootEl) {\n const mutationBuffer = new MutationBuffer();\n mutationBuffers.push(mutationBuffer);\n mutationBuffer.init(options);\n let mutationObserverCtor = window.MutationObserver ||\n window.__rrMutationObserver;\n const angularZoneSymbol = _optionalChain$2([window, 'optionalAccess', _ => _.Zone, 'optionalAccess', _2 => _2.__symbol__, 'optionalCall', _3 => _3('MutationObserver')]);\n if (angularZoneSymbol &&\n window[angularZoneSymbol]) {\n mutationObserverCtor = window[angularZoneSymbol];\n }\n const observer = new mutationObserverCtor(callbackWrapper((mutations) => {\n if (options.onMutation && options.onMutation(mutations) === false) {\n return;\n }\n mutationBuffer.processMutations.bind(mutationBuffer)(mutations);\n }));\n observer.observe(rootEl, {\n attributes: true,\n attributeOldValue: true,\n characterData: true,\n characterDataOldValue: true,\n childList: true,\n subtree: true,\n });\n return observer;\n}\nfunction initMoveObserver({ mousemoveCb, sampling, doc, mirror, }) {\n if (sampling.mousemove === false) {\n return () => {\n };\n }\n const threshold = typeof sampling.mousemove === 'number' ? sampling.mousemove : 50;\n const callbackThreshold = typeof sampling.mousemoveCallback === 'number'\n ? sampling.mousemoveCallback\n : 500;\n let positions = [];\n let timeBaseline;\n const wrappedCb = throttle$1(callbackWrapper((source) => {\n const totalOffset = Date.now() - timeBaseline;\n mousemoveCb(positions.map((p) => {\n p.timeOffset -= totalOffset;\n return p;\n }), source);\n positions = [];\n timeBaseline = null;\n }), callbackThreshold);\n const updatePosition = callbackWrapper(throttle$1(callbackWrapper((evt) => {\n const target = getEventTarget(evt);\n const { clientX, clientY } = legacy_isTouchEvent(evt)\n ? evt.changedTouches[0]\n : evt;\n if (!timeBaseline) {\n timeBaseline = nowTimestamp();\n }\n positions.push({\n x: clientX,\n y: clientY,\n id: mirror.getId(target),\n timeOffset: nowTimestamp() - timeBaseline,\n });\n wrappedCb(typeof DragEvent !== 'undefined' && evt instanceof DragEvent\n ? IncrementalSource.Drag\n : evt instanceof MouseEvent\n ? IncrementalSource.MouseMove\n : IncrementalSource.TouchMove);\n }), threshold, {\n trailing: false,\n }));\n const handlers = [\n on('mousemove', updatePosition, doc),\n on('touchmove', updatePosition, doc),\n on('drag', updatePosition, doc),\n ];\n return callbackWrapper(() => {\n handlers.forEach((h) => h());\n });\n}\nfunction initMouseInteractionObserver({ mouseInteractionCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {\n if (sampling.mouseInteraction === false) {\n return () => {\n };\n }\n const disableMap = sampling.mouseInteraction === true ||\n sampling.mouseInteraction === undefined\n ? {}\n : sampling.mouseInteraction;\n const handlers = [];\n let currentPointerType = null;\n const getHandler = (eventKey) => {\n return (event) => {\n const target = getEventTarget(event);\n if (isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\n return;\n }\n let pointerType = null;\n let thisEventKey = eventKey;\n if ('pointerType' in event) {\n switch (event.pointerType) {\n case 'mouse':\n pointerType = PointerTypes.Mouse;\n break;\n case 'touch':\n pointerType = PointerTypes.Touch;\n break;\n case 'pen':\n pointerType = PointerTypes.Pen;\n break;\n }\n if (pointerType === PointerTypes.Touch) {\n if (MouseInteractions[eventKey] === MouseInteractions.MouseDown) {\n thisEventKey = 'TouchStart';\n }\n else if (MouseInteractions[eventKey] === MouseInteractions.MouseUp) {\n thisEventKey = 'TouchEnd';\n }\n }\n else if (pointerType === PointerTypes.Pen) ;\n }\n else if (legacy_isTouchEvent(event)) {\n pointerType = PointerTypes.Touch;\n }\n if (pointerType !== null) {\n currentPointerType = pointerType;\n if ((thisEventKey.startsWith('Touch') &&\n pointerType === PointerTypes.Touch) ||\n (thisEventKey.startsWith('Mouse') &&\n pointerType === PointerTypes.Mouse)) {\n pointerType = null;\n }\n }\n else if (MouseInteractions[eventKey] === MouseInteractions.Click) {\n pointerType = currentPointerType;\n currentPointerType = null;\n }\n const e = legacy_isTouchEvent(event) ? event.changedTouches[0] : event;\n if (!e) {\n return;\n }\n const id = mirror.getId(target);\n const { clientX, clientY } = e;\n callbackWrapper(mouseInteractionCb)({\n type: MouseInteractions[thisEventKey],\n id,\n x: clientX,\n y: clientY,\n ...(pointerType !== null && { pointerType }),\n });\n };\n };\n Object.keys(MouseInteractions)\n .filter((key) => Number.isNaN(Number(key)) &&\n !key.endsWith('_Departed') &&\n disableMap[key] !== false)\n .forEach((eventKey) => {\n let eventName = toLowerCase(eventKey);\n const handler = getHandler(eventKey);\n if (window.PointerEvent) {\n switch (MouseInteractions[eventKey]) {\n case MouseInteractions.MouseDown:\n case MouseInteractions.MouseUp:\n eventName = eventName.replace('mouse', 'pointer');\n break;\n case MouseInteractions.TouchStart:\n case MouseInteractions.TouchEnd:\n return;\n }\n }\n handlers.push(on(eventName, handler, doc));\n });\n return callbackWrapper(() => {\n handlers.forEach((h) => h());\n });\n}\nfunction initScrollObserver({ scrollCb, doc, mirror, blockClass, blockSelector, unblockSelector, sampling, }) {\n const updatePosition = callbackWrapper(throttle$1(callbackWrapper((evt) => {\n const target = getEventTarget(evt);\n if (!target ||\n isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\n return;\n }\n const id = mirror.getId(target);\n if (target === doc && doc.defaultView) {\n const scrollLeftTop = getWindowScroll(doc.defaultView);\n scrollCb({\n id,\n x: scrollLeftTop.left,\n y: scrollLeftTop.top,\n });\n }\n else {\n scrollCb({\n id,\n x: target.scrollLeft,\n y: target.scrollTop,\n });\n }\n }), sampling.scroll || 100));\n return on('scroll', updatePosition, doc);\n}\nfunction initViewportResizeObserver({ viewportResizeCb }, { win }) {\n let lastH = -1;\n let lastW = -1;\n const updateDimension = callbackWrapper(throttle$1(callbackWrapper(() => {\n const height = getWindowHeight();\n const width = getWindowWidth();\n if (lastH !== height || lastW !== width) {\n viewportResizeCb({\n width: Number(width),\n height: Number(height),\n });\n lastH = height;\n lastW = width;\n }\n }), 200));\n return on('resize', updateDimension, win);\n}\nconst INPUT_TAGS = ['INPUT', 'TEXTAREA', 'SELECT'];\nconst lastInputValueMap = new WeakMap();\nfunction initInputObserver({ inputCb, doc, mirror, blockClass, blockSelector, unblockSelector, ignoreClass, ignoreSelector, maskInputOptions, maskInputFn, sampling, userTriggeredOnInput, maskTextClass, unmaskTextClass, maskTextSelector, unmaskTextSelector, }) {\n function eventHandler(event) {\n let target = getEventTarget(event);\n const userTriggered = event.isTrusted;\n const tagName = target && toUpperCase(target.tagName);\n if (tagName === 'OPTION')\n target = target.parentElement;\n if (!target ||\n !tagName ||\n INPUT_TAGS.indexOf(tagName) < 0 ||\n isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\n return;\n }\n const el = target;\n if (el.classList.contains(ignoreClass) ||\n (ignoreSelector && el.matches(ignoreSelector))) {\n return;\n }\n const type = getInputType(target);\n let text = getInputValue(el, tagName, type);\n let isChecked = false;\n const isInputMasked = shouldMaskInput({\n maskInputOptions,\n tagName,\n type,\n });\n const forceMask = needMaskingText(target, maskTextClass, maskTextSelector, unmaskTextClass, unmaskTextSelector, isInputMasked);\n if (type === 'radio' || type === 'checkbox') {\n isChecked = target.checked;\n }\n text = maskInputValue({\n isMasked: forceMask,\n element: target,\n value: text,\n maskInputFn,\n });\n cbWithDedup(target, userTriggeredOnInput\n ? { text, isChecked, userTriggered }\n : { text, isChecked });\n const name = target.name;\n if (type === 'radio' && name && isChecked) {\n doc\n .querySelectorAll(`input[type=\"radio\"][name=\"${name}\"]`)\n .forEach((el) => {\n if (el !== target) {\n const text = maskInputValue({\n isMasked: forceMask,\n element: el,\n value: getInputValue(el, tagName, type),\n maskInputFn,\n });\n cbWithDedup(el, userTriggeredOnInput\n ? { text, isChecked: !isChecked, userTriggered: false }\n : { text, isChecked: !isChecked });\n }\n });\n }\n }\n function cbWithDedup(target, v) {\n const lastInputValue = lastInputValueMap.get(target);\n if (!lastInputValue ||\n lastInputValue.text !== v.text ||\n lastInputValue.isChecked !== v.isChecked) {\n lastInputValueMap.set(target, v);\n const id = mirror.getId(target);\n callbackWrapper(inputCb)({\n ...v,\n id,\n });\n }\n }\n const events = sampling.input === 'last' ? ['change'] : ['input', 'change'];\n const handlers = events.map((eventName) => on(eventName, callbackWrapper(eventHandler), doc));\n const currentWindow = doc.defaultView;\n if (!currentWindow) {\n return () => {\n handlers.forEach((h) => h());\n };\n }\n const propertyDescriptor = currentWindow.Object.getOwnPropertyDescriptor(currentWindow.HTMLInputElement.prototype, 'value');\n const hookProperties = [\n [currentWindow.HTMLInputElement.prototype, 'value'],\n [currentWindow.HTMLInputElement.prototype, 'checked'],\n [currentWindow.HTMLSelectElement.prototype, 'value'],\n [currentWindow.HTMLTextAreaElement.prototype, 'value'],\n [currentWindow.HTMLSelectElement.prototype, 'selectedIndex'],\n [currentWindow.HTMLOptionElement.prototype, 'selected'],\n ];\n if (propertyDescriptor && propertyDescriptor.set) {\n handlers.push(...hookProperties.map((p) => hookSetter(p[0], p[1], {\n set() {\n callbackWrapper(eventHandler)({\n target: this,\n isTrusted: false,\n });\n },\n }, false, currentWindow)));\n }\n return callbackWrapper(() => {\n handlers.forEach((h) => h());\n });\n}\nfunction getNestedCSSRulePositions(rule) {\n const positions = [];\n function recurse(childRule, pos) {\n if ((hasNestedCSSRule('CSSGroupingRule') &&\n childRule.parentRule instanceof CSSGroupingRule) ||\n (hasNestedCSSRule('CSSMediaRule') &&\n childRule.parentRule instanceof CSSMediaRule) ||\n (hasNestedCSSRule('CSSSupportsRule') &&\n childRule.parentRule instanceof CSSSupportsRule) ||\n (hasNestedCSSRule('CSSConditionRule') &&\n childRule.parentRule instanceof CSSConditionRule)) {\n const rules = Array.from(childRule.parentRule.cssRules);\n const index = rules.indexOf(childRule);\n pos.unshift(index);\n }\n else if (childRule.parentStyleSheet) {\n const rules = Array.from(childRule.parentStyleSheet.cssRules);\n const index = rules.indexOf(childRule);\n pos.unshift(index);\n }\n return pos;\n }\n return recurse(rule, positions);\n}\nfunction getIdAndStyleId(sheet, mirror, styleMirror) {\n let id, styleId;\n if (!sheet)\n return {};\n if (sheet.ownerNode)\n id = mirror.getId(sheet.ownerNode);\n else\n styleId = styleMirror.getId(sheet);\n return {\n styleId,\n id,\n };\n}\nfunction initStyleSheetObserver({ styleSheetRuleCb, mirror, stylesheetManager }, { win }) {\n if (!win.CSSStyleSheet || !win.CSSStyleSheet.prototype) {\n return () => {\n };\n }\n const insertRule = win.CSSStyleSheet.prototype.insertRule;\n win.CSSStyleSheet.prototype.insertRule = new Proxy(insertRule, {\n apply: callbackWrapper((target, thisArg, argumentsList) => {\n const [rule, index] = argumentsList;\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\n styleSheetRuleCb({\n id,\n styleId,\n adds: [{ rule, index }],\n });\n }\n return target.apply(thisArg, argumentsList);\n }),\n });\n const deleteRule = win.CSSStyleSheet.prototype.deleteRule;\n win.CSSStyleSheet.prototype.deleteRule = new Proxy(deleteRule, {\n apply: callbackWrapper((target, thisArg, argumentsList) => {\n const [index] = argumentsList;\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\n styleSheetRuleCb({\n id,\n styleId,\n removes: [{ index }],\n });\n }\n return target.apply(thisArg, argumentsList);\n }),\n });\n let replace;\n if (win.CSSStyleSheet.prototype.replace) {\n replace = win.CSSStyleSheet.prototype.replace;\n win.CSSStyleSheet.prototype.replace = new Proxy(replace, {\n apply: callbackWrapper((target, thisArg, argumentsList) => {\n const [text] = argumentsList;\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\n styleSheetRuleCb({\n id,\n styleId,\n replace: text,\n });\n }\n return target.apply(thisArg, argumentsList);\n }),\n });\n }\n let replaceSync;\n if (win.CSSStyleSheet.prototype.replaceSync) {\n replaceSync = win.CSSStyleSheet.prototype.replaceSync;\n win.CSSStyleSheet.prototype.replaceSync = new Proxy(replaceSync, {\n apply: callbackWrapper((target, thisArg, argumentsList) => {\n const [text] = argumentsList;\n const { id, styleId } = getIdAndStyleId(thisArg, mirror, stylesheetManager.styleMirror);\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\n styleSheetRuleCb({\n id,\n styleId,\n replaceSync: text,\n });\n }\n return target.apply(thisArg, argumentsList);\n }),\n });\n }\n const supportedNestedCSSRuleTypes = {};\n if (canMonkeyPatchNestedCSSRule('CSSGroupingRule')) {\n supportedNestedCSSRuleTypes.CSSGroupingRule = win.CSSGroupingRule;\n }\n else {\n if (canMonkeyPatchNestedCSSRule('CSSMediaRule')) {\n supportedNestedCSSRuleTypes.CSSMediaRule = win.CSSMediaRule;\n }\n if (canMonkeyPatchNestedCSSRule('CSSConditionRule')) {\n supportedNestedCSSRuleTypes.CSSConditionRule = win.CSSConditionRule;\n }\n if (canMonkeyPatchNestedCSSRule('CSSSupportsRule')) {\n supportedNestedCSSRuleTypes.CSSSupportsRule = win.CSSSupportsRule;\n }\n }\n const unmodifiedFunctions = {};\n Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\n unmodifiedFunctions[typeKey] = {\n insertRule: type.prototype.insertRule,\n deleteRule: type.prototype.deleteRule,\n };\n type.prototype.insertRule = new Proxy(unmodifiedFunctions[typeKey].insertRule, {\n apply: callbackWrapper((target, thisArg, argumentsList) => {\n const [rule, index] = argumentsList;\n const { id, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror);\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\n styleSheetRuleCb({\n id,\n styleId,\n adds: [\n {\n rule,\n index: [\n ...getNestedCSSRulePositions(thisArg),\n index || 0,\n ],\n },\n ],\n });\n }\n return target.apply(thisArg, argumentsList);\n }),\n });\n type.prototype.deleteRule = new Proxy(unmodifiedFunctions[typeKey].deleteRule, {\n apply: callbackWrapper((target, thisArg, argumentsList) => {\n const [index] = argumentsList;\n const { id, styleId } = getIdAndStyleId(thisArg.parentStyleSheet, mirror, stylesheetManager.styleMirror);\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\n styleSheetRuleCb({\n id,\n styleId,\n removes: [\n { index: [...getNestedCSSRulePositions(thisArg), index] },\n ],\n });\n }\n return target.apply(thisArg, argumentsList);\n }),\n });\n });\n return callbackWrapper(() => {\n win.CSSStyleSheet.prototype.insertRule = insertRule;\n win.CSSStyleSheet.prototype.deleteRule = deleteRule;\n replace && (win.CSSStyleSheet.prototype.replace = replace);\n replaceSync && (win.CSSStyleSheet.prototype.replaceSync = replaceSync);\n Object.entries(supportedNestedCSSRuleTypes).forEach(([typeKey, type]) => {\n type.prototype.insertRule = unmodifiedFunctions[typeKey].insertRule;\n type.prototype.deleteRule = unmodifiedFunctions[typeKey].deleteRule;\n });\n });\n}\nfunction initAdoptedStyleSheetObserver({ mirror, stylesheetManager, }, host) {\n let hostId = null;\n if (host.nodeName === '#document')\n hostId = mirror.getId(host);\n else\n hostId = mirror.getId(host.host);\n const patchTarget = host.nodeName === '#document'\n ? _optionalChain$2([host, 'access', _4 => _4.defaultView, 'optionalAccess', _5 => _5.Document])\n : _optionalChain$2([host, 'access', _6 => _6.ownerDocument, 'optionalAccess', _7 => _7.defaultView, 'optionalAccess', _8 => _8.ShadowRoot]);\n const originalPropertyDescriptor = _optionalChain$2([patchTarget, 'optionalAccess', _9 => _9.prototype])\n ? Object.getOwnPropertyDescriptor(_optionalChain$2([patchTarget, 'optionalAccess', _10 => _10.prototype]), 'adoptedStyleSheets')\n : undefined;\n if (hostId === null ||\n hostId === -1 ||\n !patchTarget ||\n !originalPropertyDescriptor)\n return () => {\n };\n Object.defineProperty(host, 'adoptedStyleSheets', {\n configurable: originalPropertyDescriptor.configurable,\n enumerable: originalPropertyDescriptor.enumerable,\n get() {\n return _optionalChain$2([originalPropertyDescriptor, 'access', _11 => _11.get, 'optionalAccess', _12 => _12.call, 'call', _13 => _13(this)]);\n },\n set(sheets) {\n const result = _optionalChain$2([originalPropertyDescriptor, 'access', _14 => _14.set, 'optionalAccess', _15 => _15.call, 'call', _16 => _16(this, sheets)]);\n if (hostId !== null && hostId !== -1) {\n try {\n stylesheetManager.adoptStyleSheets(sheets, hostId);\n }\n catch (e) {\n }\n }\n return result;\n },\n });\n return callbackWrapper(() => {\n Object.defineProperty(host, 'adoptedStyleSheets', {\n configurable: originalPropertyDescriptor.configurable,\n enumerable: originalPropertyDescriptor.enumerable,\n get: originalPropertyDescriptor.get,\n set: originalPropertyDescriptor.set,\n });\n });\n}\nfunction initStyleDeclarationObserver({ styleDeclarationCb, mirror, ignoreCSSAttributes, stylesheetManager, }, { win }) {\n const setProperty = win.CSSStyleDeclaration.prototype.setProperty;\n win.CSSStyleDeclaration.prototype.setProperty = new Proxy(setProperty, {\n apply: callbackWrapper((target, thisArg, argumentsList) => {\n const [property, value, priority] = argumentsList;\n if (ignoreCSSAttributes.has(property)) {\n return setProperty.apply(thisArg, [property, value, priority]);\n }\n const { id, styleId } = getIdAndStyleId(_optionalChain$2([thisArg, 'access', _17 => _17.parentRule, 'optionalAccess', _18 => _18.parentStyleSheet]), mirror, stylesheetManager.styleMirror);\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\n styleDeclarationCb({\n id,\n styleId,\n set: {\n property,\n value,\n priority,\n },\n index: getNestedCSSRulePositions(thisArg.parentRule),\n });\n }\n return target.apply(thisArg, argumentsList);\n }),\n });\n const removeProperty = win.CSSStyleDeclaration.prototype.removeProperty;\n win.CSSStyleDeclaration.prototype.removeProperty = new Proxy(removeProperty, {\n apply: callbackWrapper((target, thisArg, argumentsList) => {\n const [property] = argumentsList;\n if (ignoreCSSAttributes.has(property)) {\n return removeProperty.apply(thisArg, [property]);\n }\n const { id, styleId } = getIdAndStyleId(_optionalChain$2([thisArg, 'access', _19 => _19.parentRule, 'optionalAccess', _20 => _20.parentStyleSheet]), mirror, stylesheetManager.styleMirror);\n if ((id && id !== -1) || (styleId && styleId !== -1)) {\n styleDeclarationCb({\n id,\n styleId,\n remove: {\n property,\n },\n index: getNestedCSSRulePositions(thisArg.parentRule),\n });\n }\n return target.apply(thisArg, argumentsList);\n }),\n });\n return callbackWrapper(() => {\n win.CSSStyleDeclaration.prototype.setProperty = setProperty;\n win.CSSStyleDeclaration.prototype.removeProperty = removeProperty;\n });\n}\nfunction initMediaInteractionObserver({ mediaInteractionCb, blockClass, blockSelector, unblockSelector, mirror, sampling, doc, }) {\n const handler = callbackWrapper((type) => throttle$1(callbackWrapper((event) => {\n const target = getEventTarget(event);\n if (!target ||\n isBlocked(target, blockClass, blockSelector, unblockSelector, true)) {\n return;\n }\n const { currentTime, volume, muted, playbackRate } = target;\n mediaInteractionCb({\n type,\n id: mirror.getId(target),\n currentTime,\n volume,\n muted,\n playbackRate,\n });\n }), sampling.media || 500));\n const handlers = [\n on('play', handler(0), doc),\n on('pause', handler(1), doc),\n on('seeked', handler(2), doc),\n on('volumechange', handler(3), doc),\n on('ratechange', handler(4), doc),\n ];\n return callbackWrapper(() => {\n handlers.forEach((h) => h());\n });\n}\nfunction initFontObserver({ fontCb, doc }) {\n const win = doc.defaultView;\n if (!win) {\n return () => {\n };\n }\n const handlers = [];\n const fontMap = new WeakMap();\n const originalFontFace = win.FontFace;\n win.FontFace = function FontFace(family, source, descriptors) {\n const fontFace = new originalFontFace(family, source, descriptors);\n fontMap.set(fontFace, {\n family,\n buffer: typeof source !== 'string',\n descriptors,\n fontSource: typeof source === 'string'\n ? source\n : JSON.stringify(Array.from(new Uint8Array(source))),\n });\n return fontFace;\n };\n const restoreHandler = patch(doc.fonts, 'add', function (original) {\n return function (fontFace) {\n setTimeout$1(callbackWrapper(() => {\n const p = fontMap.get(fontFace);\n if (p) {\n fontCb(p);\n fontMap.delete(fontFace);\n }\n }), 0);\n return original.apply(this, [fontFace]);\n };\n });\n handlers.push(() => {\n win.FontFace = originalFontFace;\n });\n handlers.push(restoreHandler);\n return callbackWrapper(() => {\n handlers.forEach((h) => h());\n });\n}\nfunction initSelectionObserver(param) {\n const { doc, mirror, blockClass, blockSelector, unblockSelector, selectionCb, } = param;\n let collapsed = true;\n const updateSelection = callbackWrapper(() => {\n const selection = doc.getSelection();\n if (!selection || (collapsed && _optionalChain$2([selection, 'optionalAccess', _21 => _21.isCollapsed])))\n return;\n collapsed = selection.isCollapsed || false;\n const ranges = [];\n const count = selection.rangeCount || 0;\n for (let i = 0; i < count; i++) {\n const range = selection.getRangeAt(i);\n const { startContainer, startOffset, endContainer, endOffset } = range;\n const blocked = isBlocked(startContainer, blockClass, blockSelector, unblockSelector, true) ||\n isBlocked(endContainer, blockClass, blockSelector, unblockSelector, true);\n if (blocked)\n continue;\n ranges.push({\n start: mirror.getId(startContainer),\n startOffset,\n end: mirror.getId(endContainer),\n endOffset,\n });\n }\n selectionCb({ ranges });\n });\n updateSelection();\n return on('selectionchange', updateSelection);\n}\nfunction initCustomElementObserver({ doc, customElementCb, }) {\n const win = doc.defaultView;\n if (!win || !win.customElements)\n return () => { };\n const restoreHandler = patch(win.customElements, 'define', function (original) {\n return function (name, constructor, options) {\n try {\n customElementCb({\n define: {\n name,\n },\n });\n }\n catch (e) {\n }\n return original.apply(this, [name, constructor, options]);\n };\n });\n return restoreHandler;\n}\nfunction initObservers(o, _hooks = {}) {\n const currentWindow = o.doc.defaultView;\n if (!currentWindow) {\n return () => {\n };\n }\n const mutationObserver = initMutationObserver(o, o.doc);\n const mousemoveHandler = initMoveObserver(o);\n const mouseInteractionHandler = initMouseInteractionObserver(o);\n const scrollHandler = initScrollObserver(o);\n const viewportResizeHandler = initViewportResizeObserver(o, {\n win: currentWindow,\n });\n const inputHandler = initInputObserver(o);\n const mediaInteractionHandler = initMediaInteractionObserver(o);\n const styleSheetObserver = initStyleSheetObserver(o, { win: currentWindow });\n const adoptedStyleSheetObserver = initAdoptedStyleSheetObserver(o, o.doc);\n const styleDeclarationObserver = initStyleDeclarationObserver(o, {\n win: currentWindow,\n });\n const fontObserver = o.collectFonts\n ? initFontObserver(o)\n : () => {\n };\n const selectionObserver = initSelectionObserver(o);\n const customElementObserver = initCustomElementObserver(o);\n const pluginHandlers = [];\n for (const plugin of o.plugins) {\n pluginHandlers.push(plugin.observer(plugin.callback, currentWindow, plugin.options));\n }\n return callbackWrapper(() => {\n mutationBuffers.forEach((b) => b.reset());\n mutationObserver.disconnect();\n mousemoveHandler();\n mouseInteractionHandler();\n scrollHandler();\n viewportResizeHandler();\n inputHandler();\n mediaInteractionHandler();\n styleSheetObserver();\n adoptedStyleSheetObserver();\n styleDeclarationObserver();\n fontObserver();\n selectionObserver();\n customElementObserver();\n pluginHandlers.forEach((h) => h());\n });\n}\nfunction hasNestedCSSRule(prop) {\n return typeof window[prop] !== 'undefined';\n}\nfunction canMonkeyPatchNestedCSSRule(prop) {\n return Boolean(typeof window[prop] !== 'undefined' &&\n window[prop].prototype &&\n 'insertRule' in window[prop].prototype &&\n 'deleteRule' in window[prop].prototype);\n}\n\nclass CrossOriginIframeMirror {\n constructor(generateIdFn) {\n this.generateIdFn = generateIdFn;\n this.iframeIdToRemoteIdMap = new WeakMap();\n this.iframeRemoteIdToIdMap = new WeakMap();\n }\n getId(iframe, remoteId, idToRemoteMap, remoteToIdMap) {\n const idToRemoteIdMap = idToRemoteMap || this.getIdToRemoteIdMap(iframe);\n const remoteIdToIdMap = remoteToIdMap || this.getRemoteIdToIdMap(iframe);\n let id = idToRemoteIdMap.get(remoteId);\n if (!id) {\n id = this.generateIdFn();\n idToRemoteIdMap.set(remoteId, id);\n remoteIdToIdMap.set(id, remoteId);\n }\n return id;\n }\n getIds(iframe, remoteId) {\n const idToRemoteIdMap = this.getIdToRemoteIdMap(iframe);\n const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\n return remoteId.map((id) => this.getId(iframe, id, idToRemoteIdMap, remoteIdToIdMap));\n }\n getRemoteId(iframe, id, map) {\n const remoteIdToIdMap = map || this.getRemoteIdToIdMap(iframe);\n if (typeof id !== 'number')\n return id;\n const remoteId = remoteIdToIdMap.get(id);\n if (!remoteId)\n return -1;\n return remoteId;\n }\n getRemoteIds(iframe, ids) {\n const remoteIdToIdMap = this.getRemoteIdToIdMap(iframe);\n return ids.map((id) => this.getRemoteId(iframe, id, remoteIdToIdMap));\n }\n reset(iframe) {\n if (!iframe) {\n this.iframeIdToRemoteIdMap = new WeakMap();\n this.iframeRemoteIdToIdMap = new WeakMap();\n return;\n }\n this.iframeIdToRemoteIdMap.delete(iframe);\n this.iframeRemoteIdToIdMap.delete(iframe);\n }\n getIdToRemoteIdMap(iframe) {\n let idToRemoteIdMap = this.iframeIdToRemoteIdMap.get(iframe);\n if (!idToRemoteIdMap) {\n idToRemoteIdMap = new Map();\n this.iframeIdToRemoteIdMap.set(iframe, idToRemoteIdMap);\n }\n return idToRemoteIdMap;\n }\n getRemoteIdToIdMap(iframe) {\n let remoteIdToIdMap = this.iframeRemoteIdToIdMap.get(iframe);\n if (!remoteIdToIdMap) {\n remoteIdToIdMap = new Map();\n this.iframeRemoteIdToIdMap.set(iframe, remoteIdToIdMap);\n }\n return remoteIdToIdMap;\n }\n}\n\nfunction _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }\nclass IframeManagerNoop {\n constructor() {\n this.crossOriginIframeMirror = new CrossOriginIframeMirror(genId);\n this.crossOriginIframeRootIdMap = new WeakMap();\n }\n addIframe() {\n }\n addLoadListener() {\n }\n attachIframe() {\n }\n}\nclass IframeManager {\n constructor(options) {\n this.iframes = new WeakMap();\n this.crossOriginIframeMap = new WeakMap();\n this.crossOriginIframeMirror = new CrossOriginIframeMirror(genId);\n this.crossOriginIframeRootIdMap = new WeakMap();\n this.mutationCb = options.mutationCb;\n this.wrappedEmit = options.wrappedEmit;\n this.stylesheetManager = options.stylesheetManager;\n this.recordCrossOriginIframes = options.recordCrossOriginIframes;\n this.crossOriginIframeStyleMirror = new CrossOriginIframeMirror(this.stylesheetManager.styleMirror.generateId.bind(this.stylesheetManager.styleMirror));\n this.mirror = options.mirror;\n if (this.recordCrossOriginIframes) {\n window.addEventListener('message', this.handleMessage.bind(this));\n }\n }\n addIframe(iframeEl) {\n this.iframes.set(iframeEl, true);\n if (iframeEl.contentWindow)\n this.crossOriginIframeMap.set(iframeEl.contentWindow, iframeEl);\n }\n addLoadListener(cb) {\n this.loadListener = cb;\n }\n attachIframe(iframeEl, childSn) {\n this.mutationCb({\n adds: [\n {\n parentId: this.mirror.getId(iframeEl),\n nextId: null,\n node: childSn,\n },\n ],\n removes: [],\n texts: [],\n attributes: [],\n isAttachIframe: true,\n });\n _optionalChain$1([this, 'access', _ => _.loadListener, 'optionalCall', _2 => _2(iframeEl)]);\n if (iframeEl.contentDocument &&\n iframeEl.contentDocument.adoptedStyleSheets &&\n iframeEl.contentDocument.adoptedStyleSheets.length > 0)\n this.stylesheetManager.adoptStyleSheets(iframeEl.contentDocument.adoptedStyleSheets, this.mirror.getId(iframeEl.contentDocument));\n }\n handleMessage(message) {\n const crossOriginMessageEvent = message;\n if (crossOriginMessageEvent.data.type !== 'rrweb' ||\n crossOriginMessageEvent.origin !== crossOriginMessageEvent.data.origin)\n return;\n const iframeSourceWindow = message.source;\n if (!iframeSourceWindow)\n return;\n const iframeEl = this.crossOriginIframeMap.get(message.source);\n if (!iframeEl)\n return;\n const transformedEvent = this.transformCrossOriginEvent(iframeEl, crossOriginMessageEvent.data.event);\n if (transformedEvent)\n this.wrappedEmit(transformedEvent, crossOriginMessageEvent.data.isCheckout);\n }\n transformCrossOriginEvent(iframeEl, e) {\n switch (e.type) {\n case EventType.FullSnapshot: {\n this.crossOriginIframeMirror.reset(iframeEl);\n this.crossOriginIframeStyleMirror.reset(iframeEl);\n this.replaceIdOnNode(e.data.node, iframeEl);\n const rootId = e.data.node.id;\n this.crossOriginIframeRootIdMap.set(iframeEl, rootId);\n this.patchRootIdOnNode(e.data.node, rootId);\n return {\n timestamp: e.timestamp,\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.Mutation,\n adds: [\n {\n parentId: this.mirror.getId(iframeEl),\n nextId: null,\n node: e.data.node,\n },\n ],\n removes: [],\n texts: [],\n attributes: [],\n isAttachIframe: true,\n },\n };\n }\n case EventType.Meta:\n case EventType.Load:\n case EventType.DomContentLoaded: {\n return false;\n }\n case EventType.Plugin: {\n return e;\n }\n case EventType.Custom: {\n this.replaceIds(e.data.payload, iframeEl, ['id', 'parentId', 'previousId', 'nextId']);\n return e;\n }\n case EventType.IncrementalSnapshot: {\n switch (e.data.source) {\n case IncrementalSource.Mutation: {\n e.data.adds.forEach((n) => {\n this.replaceIds(n, iframeEl, [\n 'parentId',\n 'nextId',\n 'previousId',\n ]);\n this.replaceIdOnNode(n.node, iframeEl);\n const rootId = this.crossOriginIframeRootIdMap.get(iframeEl);\n rootId && this.patchRootIdOnNode(n.node, rootId);\n });\n e.data.removes.forEach((n) => {\n this.replaceIds(n, iframeEl, ['parentId', 'id']);\n });\n e.data.attributes.forEach((n) => {\n this.replaceIds(n, iframeEl, ['id']);\n });\n e.data.texts.forEach((n) => {\n this.replaceIds(n, iframeEl, ['id']);\n });\n return e;\n }\n case IncrementalSource.Drag:\n case IncrementalSource.TouchMove:\n case IncrementalSource.MouseMove: {\n e.data.positions.forEach((p) => {\n this.replaceIds(p, iframeEl, ['id']);\n });\n return e;\n }\n case IncrementalSource.ViewportResize: {\n return false;\n }\n case IncrementalSource.MediaInteraction:\n case IncrementalSource.MouseInteraction:\n case IncrementalSource.Scroll:\n case IncrementalSource.CanvasMutation:\n case IncrementalSource.Input: {\n this.replaceIds(e.data, iframeEl, ['id']);\n return e;\n }\n case IncrementalSource.StyleSheetRule:\n case IncrementalSource.StyleDeclaration: {\n this.replaceIds(e.data, iframeEl, ['id']);\n this.replaceStyleIds(e.data, iframeEl, ['styleId']);\n return e;\n }\n case IncrementalSource.Font: {\n return e;\n }\n case IncrementalSource.Selection: {\n e.data.ranges.forEach((range) => {\n this.replaceIds(range, iframeEl, ['start', 'end']);\n });\n return e;\n }\n case IncrementalSource.AdoptedStyleSheet: {\n this.replaceIds(e.data, iframeEl, ['id']);\n this.replaceStyleIds(e.data, iframeEl, ['styleIds']);\n _optionalChain$1([e, 'access', _3 => _3.data, 'access', _4 => _4.styles, 'optionalAccess', _5 => _5.forEach, 'call', _6 => _6((style) => {\n this.replaceStyleIds(style, iframeEl, ['styleId']);\n })]);\n return e;\n }\n }\n }\n }\n return false;\n }\n replace(iframeMirror, obj, iframeEl, keys) {\n for (const key of keys) {\n if (!Array.isArray(obj[key]) && typeof obj[key] !== 'number')\n continue;\n if (Array.isArray(obj[key])) {\n obj[key] = iframeMirror.getIds(iframeEl, obj[key]);\n }\n else {\n obj[key] = iframeMirror.getId(iframeEl, obj[key]);\n }\n }\n return obj;\n }\n replaceIds(obj, iframeEl, keys) {\n return this.replace(this.crossOriginIframeMirror, obj, iframeEl, keys);\n }\n replaceStyleIds(obj, iframeEl, keys) {\n return this.replace(this.crossOriginIframeStyleMirror, obj, iframeEl, keys);\n }\n replaceIdOnNode(node, iframeEl) {\n this.replaceIds(node, iframeEl, ['id', 'rootId']);\n if ('childNodes' in node) {\n node.childNodes.forEach((child) => {\n this.replaceIdOnNode(child, iframeEl);\n });\n }\n }\n patchRootIdOnNode(node, rootId) {\n if (node.type !== NodeType$1.Document && !node.rootId)\n node.rootId = rootId;\n if ('childNodes' in node) {\n node.childNodes.forEach((child) => {\n this.patchRootIdOnNode(child, rootId);\n });\n }\n }\n}\n\nclass ShadowDomManagerNoop {\n init() {\n }\n addShadowRoot() {\n }\n observeAttachShadow() {\n }\n reset() {\n }\n}\nclass ShadowDomManager {\n constructor(options) {\n this.shadowDoms = new WeakSet();\n this.restoreHandlers = [];\n this.mutationCb = options.mutationCb;\n this.scrollCb = options.scrollCb;\n this.bypassOptions = options.bypassOptions;\n this.mirror = options.mirror;\n this.init();\n }\n init() {\n this.reset();\n this.patchAttachShadow(Element, document);\n }\n addShadowRoot(shadowRoot, doc) {\n if (!isNativeShadowDom(shadowRoot))\n return;\n if (this.shadowDoms.has(shadowRoot))\n return;\n this.shadowDoms.add(shadowRoot);\n const observer = initMutationObserver({\n ...this.bypassOptions,\n doc,\n mutationCb: this.mutationCb,\n mirror: this.mirror,\n shadowDomManager: this,\n }, shadowRoot);\n this.restoreHandlers.push(() => observer.disconnect());\n this.restoreHandlers.push(initScrollObserver({\n ...this.bypassOptions,\n scrollCb: this.scrollCb,\n doc: shadowRoot,\n mirror: this.mirror,\n }));\n setTimeout$1(() => {\n if (shadowRoot.adoptedStyleSheets &&\n shadowRoot.adoptedStyleSheets.length > 0)\n this.bypassOptions.stylesheetManager.adoptStyleSheets(shadowRoot.adoptedStyleSheets, this.mirror.getId(shadowRoot.host));\n this.restoreHandlers.push(initAdoptedStyleSheetObserver({\n mirror: this.mirror,\n stylesheetManager: this.bypassOptions.stylesheetManager,\n }, shadowRoot));\n }, 0);\n }\n observeAttachShadow(iframeElement) {\n if (!iframeElement.contentWindow || !iframeElement.contentDocument)\n return;\n this.patchAttachShadow(iframeElement.contentWindow.Element, iframeElement.contentDocument);\n }\n patchAttachShadow(element, doc) {\n const manager = this;\n this.restoreHandlers.push(patch(element.prototype, 'attachShadow', function (original) {\n return function (option) {\n const shadowRoot = original.call(this, option);\n if (this.shadowRoot && inDom(this))\n manager.addShadowRoot(this.shadowRoot, doc);\n return shadowRoot;\n };\n }));\n }\n reset() {\n this.restoreHandlers.forEach((handler) => {\n try {\n handler();\n }\n catch (e) {\n }\n });\n this.restoreHandlers = [];\n this.shadowDoms = new WeakSet();\n }\n}\n\nclass CanvasManagerNoop {\n reset() {\n }\n freeze() {\n }\n unfreeze() {\n }\n lock() {\n }\n unlock() {\n }\n snapshot() {\n }\n}\n\nclass StylesheetManager {\n constructor(options) {\n this.trackedLinkElements = new WeakSet();\n this.styleMirror = new StyleSheetMirror();\n this.mutationCb = options.mutationCb;\n this.adoptedStyleSheetCb = options.adoptedStyleSheetCb;\n }\n attachLinkElement(linkEl, childSn) {\n if ('_cssText' in childSn.attributes)\n this.mutationCb({\n adds: [],\n removes: [],\n texts: [],\n attributes: [\n {\n id: childSn.id,\n attributes: childSn\n .attributes,\n },\n ],\n });\n this.trackLinkElement(linkEl);\n }\n trackLinkElement(linkEl) {\n if (this.trackedLinkElements.has(linkEl))\n return;\n this.trackedLinkElements.add(linkEl);\n this.trackStylesheetInLinkElement(linkEl);\n }\n adoptStyleSheets(sheets, hostId) {\n if (sheets.length === 0)\n return;\n const adoptedStyleSheetData = {\n id: hostId,\n styleIds: [],\n };\n const styles = [];\n for (const sheet of sheets) {\n let styleId;\n if (!this.styleMirror.has(sheet)) {\n styleId = this.styleMirror.add(sheet);\n styles.push({\n styleId,\n rules: Array.from(sheet.rules || CSSRule, (r, index) => ({\n rule: stringifyRule(r),\n index,\n })),\n });\n }\n else\n styleId = this.styleMirror.getId(sheet);\n adoptedStyleSheetData.styleIds.push(styleId);\n }\n if (styles.length > 0)\n adoptedStyleSheetData.styles = styles;\n this.adoptedStyleSheetCb(adoptedStyleSheetData);\n }\n reset() {\n this.styleMirror.reset();\n this.trackedLinkElements = new WeakSet();\n }\n trackStylesheetInLinkElement(linkEl) {\n }\n}\n\nclass ProcessedNodeManager {\n constructor() {\n this.nodeMap = new WeakMap();\n this.loop = true;\n this.periodicallyClear();\n }\n periodicallyClear() {\n onRequestAnimationFrame(() => {\n this.clear();\n if (this.loop)\n this.periodicallyClear();\n });\n }\n inOtherBuffer(node, thisBuffer) {\n const buffers = this.nodeMap.get(node);\n return (buffers && Array.from(buffers).some((buffer) => buffer !== thisBuffer));\n }\n add(node, buffer) {\n this.nodeMap.set(node, (this.nodeMap.get(node) || new Set()).add(buffer));\n }\n clear() {\n this.nodeMap = new WeakMap();\n }\n destroy() {\n this.loop = false;\n }\n}\n\nlet wrappedEmit;\nlet _takeFullSnapshot;\nconst mirror = createMirror();\nfunction record(options = {}) {\n const { emit, checkoutEveryNms, checkoutEveryNth, blockClass = 'rr-block', blockSelector = null, unblockSelector = null, ignoreClass = 'rr-ignore', ignoreSelector = null, maskAllText = false, maskTextClass = 'rr-mask', unmaskTextClass = null, maskTextSelector = null, unmaskTextSelector = null, inlineStylesheet = true, maskAllInputs, maskInputOptions: _maskInputOptions, slimDOMOptions: _slimDOMOptions, maskAttributeFn, maskInputFn, maskTextFn, maxCanvasSize = null, packFn, sampling = {}, dataURLOptions = {}, mousemoveWait, recordCanvas = false, recordCrossOriginIframes = false, recordAfter = options.recordAfter === 'DOMContentLoaded'\n ? options.recordAfter\n : 'load', userTriggeredOnInput = false, collectFonts = false, inlineImages = false, plugins, keepIframeSrcFn = () => false, ignoreCSSAttributes = new Set([]), errorHandler, onMutation, getCanvasManager, } = options;\n registerErrorHandler(errorHandler);\n const inEmittingFrame = recordCrossOriginIframes\n ? window.parent === window\n : true;\n let passEmitsToParent = false;\n if (!inEmittingFrame) {\n try {\n if (window.parent.document) {\n passEmitsToParent = false;\n }\n }\n catch (e) {\n passEmitsToParent = true;\n }\n }\n if (inEmittingFrame && !emit) {\n throw new Error('emit function is required');\n }\n if (mousemoveWait !== undefined && sampling.mousemove === undefined) {\n sampling.mousemove = mousemoveWait;\n }\n mirror.reset();\n const maskInputOptions = maskAllInputs === true\n ? {\n color: true,\n date: true,\n 'datetime-local': true,\n email: true,\n month: true,\n number: true,\n range: true,\n search: true,\n tel: true,\n text: true,\n time: true,\n url: true,\n week: true,\n textarea: true,\n select: true,\n radio: true,\n checkbox: true,\n }\n : _maskInputOptions !== undefined\n ? _maskInputOptions\n : {};\n const slimDOMOptions = _slimDOMOptions === true || _slimDOMOptions === 'all'\n ? {\n script: true,\n comment: true,\n headFavicon: true,\n headWhitespace: true,\n headMetaSocial: true,\n headMetaRobots: true,\n headMetaHttpEquiv: true,\n headMetaVerification: true,\n headMetaAuthorship: _slimDOMOptions === 'all',\n headMetaDescKeywords: _slimDOMOptions === 'all',\n }\n : _slimDOMOptions\n ? _slimDOMOptions\n : {};\n polyfill();\n let lastFullSnapshotEvent;\n let incrementalSnapshotCount = 0;\n const eventProcessor = (e) => {\n for (const plugin of plugins || []) {\n if (plugin.eventProcessor) {\n e = plugin.eventProcessor(e);\n }\n }\n if (packFn &&\n !passEmitsToParent) {\n e = packFn(e);\n }\n return e;\n };\n wrappedEmit = (r, isCheckout) => {\n const e = r;\n e.timestamp = nowTimestamp();\n if (_optionalChain([mutationBuffers, 'access', _ => _[0], 'optionalAccess', _2 => _2.isFrozen, 'call', _3 => _3()]) &&\n e.type !== EventType.FullSnapshot &&\n !(e.type === EventType.IncrementalSnapshot &&\n e.data.source === IncrementalSource.Mutation)) {\n mutationBuffers.forEach((buf) => buf.unfreeze());\n }\n if (inEmittingFrame) {\n _optionalChain([emit, 'optionalCall', _4 => _4(eventProcessor(e), isCheckout)]);\n }\n else if (passEmitsToParent) {\n const message = {\n type: 'rrweb',\n event: eventProcessor(e),\n origin: window.location.origin,\n isCheckout,\n };\n window.parent.postMessage(message, '*');\n }\n if (e.type === EventType.FullSnapshot) {\n lastFullSnapshotEvent = e;\n incrementalSnapshotCount = 0;\n }\n else if (e.type === EventType.IncrementalSnapshot) {\n if (e.data.source === IncrementalSource.Mutation &&\n e.data.isAttachIframe) {\n return;\n }\n incrementalSnapshotCount++;\n const exceedCount = checkoutEveryNth && incrementalSnapshotCount >= checkoutEveryNth;\n const exceedTime = checkoutEveryNms &&\n lastFullSnapshotEvent &&\n e.timestamp - lastFullSnapshotEvent.timestamp > checkoutEveryNms;\n if (exceedCount || exceedTime) {\n takeFullSnapshot(true);\n }\n }\n };\n const wrappedMutationEmit = (m) => {\n wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.Mutation,\n ...m,\n },\n });\n };\n const wrappedScrollEmit = (p) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.Scroll,\n ...p,\n },\n });\n const wrappedCanvasMutationEmit = (p) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.CanvasMutation,\n ...p,\n },\n });\n const wrappedAdoptedStyleSheetEmit = (a) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.AdoptedStyleSheet,\n ...a,\n },\n });\n const stylesheetManager = new StylesheetManager({\n mutationCb: wrappedMutationEmit,\n adoptedStyleSheetCb: wrappedAdoptedStyleSheetEmit,\n });\n const iframeManager = typeof __RRWEB_EXCLUDE_IFRAME__ === 'boolean' && __RRWEB_EXCLUDE_IFRAME__\n ? new IframeManagerNoop()\n : new IframeManager({\n mirror,\n mutationCb: wrappedMutationEmit,\n stylesheetManager: stylesheetManager,\n recordCrossOriginIframes,\n wrappedEmit,\n });\n for (const plugin of plugins || []) {\n if (plugin.getMirror)\n plugin.getMirror({\n nodeMirror: mirror,\n crossOriginIframeMirror: iframeManager.crossOriginIframeMirror,\n crossOriginIframeStyleMirror: iframeManager.crossOriginIframeStyleMirror,\n });\n }\n const processedNodeManager = new ProcessedNodeManager();\n const canvasManager = _getCanvasManager(getCanvasManager, {\n mirror,\n win: window,\n mutationCb: (p) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.CanvasMutation,\n ...p,\n },\n }),\n recordCanvas,\n blockClass,\n blockSelector,\n unblockSelector,\n maxCanvasSize,\n sampling: sampling['canvas'],\n dataURLOptions,\n errorHandler,\n });\n const shadowDomManager = typeof __RRWEB_EXCLUDE_SHADOW_DOM__ === 'boolean' &&\n __RRWEB_EXCLUDE_SHADOW_DOM__\n ? new ShadowDomManagerNoop()\n : new ShadowDomManager({\n mutationCb: wrappedMutationEmit,\n scrollCb: wrappedScrollEmit,\n bypassOptions: {\n onMutation,\n blockClass,\n blockSelector,\n unblockSelector,\n maskAllText,\n maskTextClass,\n unmaskTextClass,\n maskTextSelector,\n unmaskTextSelector,\n inlineStylesheet,\n maskInputOptions,\n dataURLOptions,\n maskAttributeFn,\n maskTextFn,\n maskInputFn,\n recordCanvas,\n inlineImages,\n sampling,\n slimDOMOptions,\n iframeManager,\n stylesheetManager,\n canvasManager,\n keepIframeSrcFn,\n processedNodeManager,\n },\n mirror,\n });\n const takeFullSnapshot = (isCheckout = false) => {\n wrappedEmit({\n type: EventType.Meta,\n data: {\n href: window.location.href,\n width: getWindowWidth(),\n height: getWindowHeight(),\n },\n }, isCheckout);\n stylesheetManager.reset();\n shadowDomManager.init();\n mutationBuffers.forEach((buf) => buf.lock());\n const node = snapshot(document, {\n mirror,\n blockClass,\n blockSelector,\n unblockSelector,\n maskAllText,\n maskTextClass,\n unmaskTextClass,\n maskTextSelector,\n unmaskTextSelector,\n inlineStylesheet,\n maskAllInputs: maskInputOptions,\n maskAttributeFn,\n maskInputFn,\n maskTextFn,\n slimDOM: slimDOMOptions,\n dataURLOptions,\n recordCanvas,\n inlineImages,\n onSerialize: (n) => {\n if (isSerializedIframe(n, mirror)) {\n iframeManager.addIframe(n);\n }\n if (isSerializedStylesheet(n, mirror)) {\n stylesheetManager.trackLinkElement(n);\n }\n if (hasShadowRoot(n)) {\n shadowDomManager.addShadowRoot(n.shadowRoot, document);\n }\n },\n onIframeLoad: (iframe, childSn) => {\n iframeManager.attachIframe(iframe, childSn);\n shadowDomManager.observeAttachShadow(iframe);\n },\n onStylesheetLoad: (linkEl, childSn) => {\n stylesheetManager.attachLinkElement(linkEl, childSn);\n },\n keepIframeSrcFn,\n });\n if (!node) {\n return console.warn('Failed to snapshot the document');\n }\n wrappedEmit({\n type: EventType.FullSnapshot,\n data: {\n node,\n initialOffset: getWindowScroll(window),\n },\n });\n mutationBuffers.forEach((buf) => buf.unlock());\n if (document.adoptedStyleSheets && document.adoptedStyleSheets.length > 0)\n stylesheetManager.adoptStyleSheets(document.adoptedStyleSheets, mirror.getId(document));\n };\n _takeFullSnapshot = takeFullSnapshot;\n try {\n const handlers = [];\n const observe = (doc) => {\n return callbackWrapper(initObservers)({\n onMutation,\n mutationCb: wrappedMutationEmit,\n mousemoveCb: (positions, source) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source,\n positions,\n },\n }),\n mouseInteractionCb: (d) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.MouseInteraction,\n ...d,\n },\n }),\n scrollCb: wrappedScrollEmit,\n viewportResizeCb: (d) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.ViewportResize,\n ...d,\n },\n }),\n inputCb: (v) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.Input,\n ...v,\n },\n }),\n mediaInteractionCb: (p) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.MediaInteraction,\n ...p,\n },\n }),\n styleSheetRuleCb: (r) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.StyleSheetRule,\n ...r,\n },\n }),\n styleDeclarationCb: (r) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.StyleDeclaration,\n ...r,\n },\n }),\n canvasMutationCb: wrappedCanvasMutationEmit,\n fontCb: (p) => wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.Font,\n ...p,\n },\n }),\n selectionCb: (p) => {\n wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.Selection,\n ...p,\n },\n });\n },\n customElementCb: (c) => {\n wrappedEmit({\n type: EventType.IncrementalSnapshot,\n data: {\n source: IncrementalSource.CustomElement,\n ...c,\n },\n });\n },\n blockClass,\n ignoreClass,\n ignoreSelector,\n maskAllText,\n maskTextClass,\n unmaskTextClass,\n maskTextSelector,\n unmaskTextSelector,\n maskInputOptions,\n inlineStylesheet,\n sampling,\n recordCanvas,\n inlineImages,\n userTriggeredOnInput,\n collectFonts,\n doc,\n maskAttributeFn,\n maskInputFn,\n maskTextFn,\n keepIframeSrcFn,\n blockSelector,\n unblockSelector,\n slimDOMOptions,\n dataURLOptions,\n mirror,\n iframeManager,\n stylesheetManager,\n shadowDomManager,\n processedNodeManager,\n canvasManager,\n ignoreCSSAttributes,\n plugins: _optionalChain([plugins\n, 'optionalAccess', _5 => _5.filter, 'call', _6 => _6((p) => p.observer)\n, 'optionalAccess', _7 => _7.map, 'call', _8 => _8((p) => ({\n observer: p.observer,\n options: p.options,\n callback: (payload) => wrappedEmit({\n type: EventType.Plugin,\n data: {\n plugin: p.name,\n payload,\n },\n }),\n }))]) || [],\n }, {});\n };\n iframeManager.addLoadListener((iframeEl) => {\n try {\n handlers.push(observe(iframeEl.contentDocument));\n }\n catch (error) {\n console.warn(error);\n }\n });\n const init = () => {\n takeFullSnapshot();\n handlers.push(observe(document));\n };\n if (document.readyState === 'interactive' ||\n document.readyState === 'complete') {\n init();\n }\n else {\n handlers.push(on('DOMContentLoaded', () => {\n wrappedEmit({\n type: EventType.DomContentLoaded,\n data: {},\n });\n if (recordAfter === 'DOMContentLoaded')\n init();\n }));\n handlers.push(on('load', () => {\n wrappedEmit({\n type: EventType.Load,\n data: {},\n });\n if (recordAfter === 'load')\n init();\n }, window));\n }\n return () => {\n handlers.forEach((h) => h());\n processedNodeManager.destroy();\n _takeFullSnapshot = undefined;\n unregisterErrorHandler();\n };\n }\n catch (error) {\n console.warn(error);\n }\n}\nfunction takeFullSnapshot(isCheckout) {\n if (!_takeFullSnapshot) {\n throw new Error('please take full snapshot after start recording');\n }\n _takeFullSnapshot(isCheckout);\n}\nrecord.mirror = mirror;\nrecord.takeFullSnapshot = takeFullSnapshot;\nfunction _getCanvasManager(getCanvasManagerFn, options) {\n try {\n return getCanvasManagerFn\n ? getCanvasManagerFn(options)\n : new CanvasManagerNoop();\n }\n catch (e2) {\n console.warn('Unable to initialize CanvasManager');\n return new CanvasManagerNoop();\n }\n}\n\nconst ReplayEventTypeIncrementalSnapshot = 3;\nconst ReplayEventTypeCustom = 5;\n\n/**\n * Converts a timestamp to ms, if it was in s, or keeps it as ms.\n */\nfunction timestampToMs(timestamp) {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp : timestamp * 1000;\n}\n\n/**\n * Converts a timestamp to s, if it was in ms, or keeps it as s.\n */\nfunction timestampToS(timestamp) {\n const isMs = timestamp > 9999999999;\n return isMs ? timestamp / 1000 : timestamp;\n}\n\n/**\n * Add a breadcrumb event to replay.\n */\nfunction addBreadcrumbEvent(replay, breadcrumb) {\n if (breadcrumb.category === 'sentry.transaction') {\n return;\n }\n\n if (['ui.click', 'ui.input'].includes(breadcrumb.category )) {\n replay.triggerUserActivity();\n } else {\n replay.checkAndHandleExpiredSession();\n }\n\n replay.addUpdate(() => {\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n replay.throttledAddEvent({\n type: EventType.Custom,\n // TODO: We were converting from ms to seconds for breadcrumbs, spans,\n // but maybe we should just keep them as milliseconds\n timestamp: (breadcrumb.timestamp || 0) * 1000,\n data: {\n tag: 'breadcrumb',\n // normalize to max. 10 depth and 1_000 properties per object\n payload: normalize(breadcrumb, 10, 1000),\n },\n });\n\n // Do not flush after console log messages\n return breadcrumb.category === 'console';\n });\n}\n\nconst INTERACTIVE_SELECTOR = 'button,a';\n\n/** Get the closest interactive parent element, or else return the given element. */\nfunction getClosestInteractive(element) {\n const closestInteractive = element.closest(INTERACTIVE_SELECTOR);\n return closestInteractive || element;\n}\n\n/**\n * For clicks, we check if the target is inside of a button or link\n * If so, we use this as the target instead\n * This is useful because if you click on the image in ,\n * The target will be the image, not the button, which we don't want here\n */\nfunction getClickTargetNode(event) {\n const target = getTargetNode(event);\n\n if (!target || !(target instanceof Element)) {\n return target;\n }\n\n return getClosestInteractive(target);\n}\n\n/** Get the event target node. */\nfunction getTargetNode(event) {\n if (isEventWithTarget(event)) {\n return event.target ;\n }\n\n return event;\n}\n\nfunction isEventWithTarget(event) {\n return typeof event === 'object' && !!event && 'target' in event;\n}\n\nlet handlers;\n\n/**\n * Register a handler to be called when `window.open()` is called.\n * Returns a cleanup function.\n */\nfunction onWindowOpen(cb) {\n // Ensure to only register this once\n if (!handlers) {\n handlers = [];\n monkeyPatchWindowOpen();\n }\n\n handlers.push(cb);\n\n return () => {\n const pos = handlers ? handlers.indexOf(cb) : -1;\n if (pos > -1) {\n (handlers ).splice(pos, 1);\n }\n };\n}\n\nfunction monkeyPatchWindowOpen() {\n fill(WINDOW, 'open', function (originalWindowOpen) {\n return function (...args) {\n if (handlers) {\n try {\n handlers.forEach(handler => handler());\n } catch (e) {\n // ignore errors in here\n }\n }\n\n return originalWindowOpen.apply(WINDOW, args);\n };\n });\n}\n\n/** Handle a click. */\nfunction handleClick(clickDetector, clickBreadcrumb, node) {\n clickDetector.handleClick(clickBreadcrumb, node);\n}\n\n/** A click detector class that can be used to detect slow or rage clicks on elements. */\nclass ClickDetector {\n // protected for testing\n\n constructor(\n replay,\n slowClickConfig,\n // Just for easier testing\n _addBreadcrumbEvent = addBreadcrumbEvent,\n ) {\n this._lastMutation = 0;\n this._lastScroll = 0;\n this._clicks = [];\n\n // We want everything in s, but options are in ms\n this._timeout = slowClickConfig.timeout / 1000;\n this._threshold = slowClickConfig.threshold / 1000;\n this._scollTimeout = slowClickConfig.scrollTimeout / 1000;\n this._replay = replay;\n this._ignoreSelector = slowClickConfig.ignoreSelector;\n this._addBreadcrumbEvent = _addBreadcrumbEvent;\n }\n\n /** Register click detection handlers on mutation or scroll. */\n addListeners() {\n const cleanupWindowOpen = onWindowOpen(() => {\n // Treat window.open as mutation\n this._lastMutation = nowInSeconds();\n });\n\n this._teardown = () => {\n cleanupWindowOpen();\n\n this._clicks = [];\n this._lastMutation = 0;\n this._lastScroll = 0;\n };\n }\n\n /** Clean up listeners. */\n removeListeners() {\n if (this._teardown) {\n this._teardown();\n }\n\n if (this._checkClickTimeout) {\n clearTimeout(this._checkClickTimeout);\n }\n }\n\n /** @inheritDoc */\n handleClick(breadcrumb, node) {\n if (ignoreElement(node, this._ignoreSelector) || !isClickBreadcrumb(breadcrumb)) {\n return;\n }\n\n const newClick = {\n timestamp: timestampToS(breadcrumb.timestamp),\n clickBreadcrumb: breadcrumb,\n // Set this to 0 so we know it originates from the click breadcrumb\n clickCount: 0,\n node,\n };\n\n // If there was a click in the last 1s on the same element, ignore it - only keep a single reference per second\n if (\n this._clicks.some(click => click.node === newClick.node && Math.abs(click.timestamp - newClick.timestamp) < 1)\n ) {\n return;\n }\n\n this._clicks.push(newClick);\n\n // If this is the first new click, set a timeout to check for multi clicks\n if (this._clicks.length === 1) {\n this._scheduleCheckClicks();\n }\n }\n\n /** @inheritDoc */\n registerMutation(timestamp = Date.now()) {\n this._lastMutation = timestampToS(timestamp);\n }\n\n /** @inheritDoc */\n registerScroll(timestamp = Date.now()) {\n this._lastScroll = timestampToS(timestamp);\n }\n\n /** @inheritDoc */\n registerClick(element) {\n const node = getClosestInteractive(element);\n this._handleMultiClick(node );\n }\n\n /** Count multiple clicks on elements. */\n _handleMultiClick(node) {\n this._getClicks(node).forEach(click => {\n click.clickCount++;\n });\n }\n\n /** Get all pending clicks for a given node. */\n _getClicks(node) {\n return this._clicks.filter(click => click.node === node);\n }\n\n /** Check the clicks that happened. */\n _checkClicks() {\n const timedOutClicks = [];\n\n const now = nowInSeconds();\n\n this._clicks.forEach(click => {\n if (!click.mutationAfter && this._lastMutation) {\n click.mutationAfter = click.timestamp <= this._lastMutation ? this._lastMutation - click.timestamp : undefined;\n }\n if (!click.scrollAfter && this._lastScroll) {\n click.scrollAfter = click.timestamp <= this._lastScroll ? this._lastScroll - click.timestamp : undefined;\n }\n\n // All of these are in seconds!\n if (click.timestamp + this._timeout <= now) {\n timedOutClicks.push(click);\n }\n });\n\n // Remove \"old\" clicks\n for (const click of timedOutClicks) {\n const pos = this._clicks.indexOf(click);\n\n if (pos > -1) {\n this._generateBreadcrumbs(click);\n this._clicks.splice(pos, 1);\n }\n }\n\n // Trigger new check, unless no clicks left\n if (this._clicks.length) {\n this._scheduleCheckClicks();\n }\n }\n\n /** Generate matching breadcrumb(s) for the click. */\n _generateBreadcrumbs(click) {\n const replay = this._replay;\n const hadScroll = click.scrollAfter && click.scrollAfter <= this._scollTimeout;\n const hadMutation = click.mutationAfter && click.mutationAfter <= this._threshold;\n\n const isSlowClick = !hadScroll && !hadMutation;\n const { clickCount, clickBreadcrumb } = click;\n\n // Slow click\n if (isSlowClick) {\n // If `mutationAfter` is set, it means a mutation happened after the threshold, but before the timeout\n // If not, it means we just timed out without scroll & mutation\n const timeAfterClickMs = Math.min(click.mutationAfter || this._timeout, this._timeout) * 1000;\n const endReason = timeAfterClickMs < this._timeout * 1000 ? 'mutation' : 'timeout';\n\n const breadcrumb = {\n type: 'default',\n message: clickBreadcrumb.message,\n timestamp: clickBreadcrumb.timestamp,\n category: 'ui.slowClickDetected',\n data: {\n ...clickBreadcrumb.data,\n url: WINDOW.location.href,\n route: replay.getCurrentRoute(),\n timeAfterClickMs,\n endReason,\n // If clickCount === 0, it means multiClick was not correctly captured here\n // - we still want to send 1 in this case\n clickCount: clickCount || 1,\n },\n };\n\n this._addBreadcrumbEvent(replay, breadcrumb);\n return;\n }\n\n // Multi click\n if (clickCount > 1) {\n const breadcrumb = {\n type: 'default',\n message: clickBreadcrumb.message,\n timestamp: clickBreadcrumb.timestamp,\n category: 'ui.multiClick',\n data: {\n ...clickBreadcrumb.data,\n url: WINDOW.location.href,\n route: replay.getCurrentRoute(),\n clickCount,\n metric: true,\n },\n };\n\n this._addBreadcrumbEvent(replay, breadcrumb);\n }\n }\n\n /** Schedule to check current clicks. */\n _scheduleCheckClicks() {\n if (this._checkClickTimeout) {\n clearTimeout(this._checkClickTimeout);\n }\n\n this._checkClickTimeout = setTimeout(() => this._checkClicks(), 1000);\n }\n}\n\nconst SLOW_CLICK_TAGS = ['A', 'BUTTON', 'INPUT'];\n\n/** exported for tests only */\nfunction ignoreElement(node, ignoreSelector) {\n if (!SLOW_CLICK_TAGS.includes(node.tagName)) {\n return true;\n }\n\n // If tag, we only want to consider input[type='submit'] & input[type='button']\n if (node.tagName === 'INPUT' && !['submit', 'button'].includes(node.getAttribute('type') || '')) {\n return true;\n }\n\n // If tag, detect special variants that may not lead to an action\n // If target !== _self, we may open the link somewhere else, which would lead to no action\n // Also, when downloading a file, we may not leave the page, but still not trigger an action\n if (\n node.tagName === 'A' &&\n (node.hasAttribute('download') || (node.hasAttribute('target') && node.getAttribute('target') !== '_self'))\n ) {\n return true;\n }\n\n if (ignoreSelector && node.matches(ignoreSelector)) {\n return true;\n }\n\n return false;\n}\n\nfunction isClickBreadcrumb(breadcrumb) {\n return !!(breadcrumb.data && typeof breadcrumb.data.nodeId === 'number' && breadcrumb.timestamp);\n}\n\n// This is good enough for us, and is easier to test/mock than `timestampInSeconds`\nfunction nowInSeconds() {\n return Date.now() / 1000;\n}\n\n/** Update the click detector based on a recording event of rrweb. */\nfunction updateClickDetectorForRecordingEvent(clickDetector, event) {\n try {\n // note: We only consider incremental snapshots here\n // This means that any full snapshot is ignored for mutation detection - the reason is that we simply cannot know if a mutation happened here.\n // E.g. think that we are buffering, an error happens and we take a full snapshot because we switched to session mode -\n // in this scenario, we would not know if a dead click happened because of the error, which is a key dead click scenario.\n // Instead, by ignoring full snapshots, we have the risk that we generate a false positive\n // (if a mutation _did_ happen but was \"swallowed\" by the full snapshot)\n // But this should be more unlikely as we'd generally capture the incremental snapshot right away\n\n if (!isIncrementalEvent(event)) {\n return;\n }\n\n const { source } = event.data;\n if (source === IncrementalSource.Mutation) {\n clickDetector.registerMutation(event.timestamp);\n }\n\n if (source === IncrementalSource.Scroll) {\n clickDetector.registerScroll(event.timestamp);\n }\n\n if (isIncrementalMouseInteraction(event)) {\n const { type, id } = event.data;\n const node = record.mirror.getNode(id);\n\n if (node instanceof HTMLElement && type === MouseInteractions.Click) {\n clickDetector.registerClick(node);\n }\n }\n } catch (e) {\n // ignore errors here, e.g. if accessing something that does not exist\n }\n}\n\nfunction isIncrementalEvent(event) {\n return event.type === ReplayEventTypeIncrementalSnapshot;\n}\n\nfunction isIncrementalMouseInteraction(\n event,\n) {\n return event.data.source === IncrementalSource.MouseInteraction;\n}\n\n/**\n * Create a breadcrumb for a replay.\n */\nfunction createBreadcrumb(\n breadcrumb,\n) {\n return {\n timestamp: Date.now() / 1000,\n type: 'default',\n ...breadcrumb,\n };\n}\n\nvar NodeType;\n(function (NodeType) {\n NodeType[NodeType[\"Document\"] = 0] = \"Document\";\n NodeType[NodeType[\"DocumentType\"] = 1] = \"DocumentType\";\n NodeType[NodeType[\"Element\"] = 2] = \"Element\";\n NodeType[NodeType[\"Text\"] = 3] = \"Text\";\n NodeType[NodeType[\"CDATA\"] = 4] = \"CDATA\";\n NodeType[NodeType[\"Comment\"] = 5] = \"Comment\";\n})(NodeType || (NodeType = {}));\n\n// Note that these are the serialized attributes and not attributes directly on\n// the DOM Node. Attributes we are interested in:\nconst ATTRIBUTES_TO_RECORD = new Set([\n 'id',\n 'class',\n 'aria-label',\n 'role',\n 'name',\n 'alt',\n 'title',\n 'data-test-id',\n 'data-testid',\n 'disabled',\n 'aria-disabled',\n 'data-sentry-component',\n]);\n\n/**\n * Inclusion list of attributes that we want to record from the DOM element\n */\nfunction getAttributesToRecord(attributes) {\n const obj = {};\n for (const key in attributes) {\n if (ATTRIBUTES_TO_RECORD.has(key)) {\n let normalizedKey = key;\n\n if (key === 'data-testid' || key === 'data-test-id') {\n normalizedKey = 'testId';\n }\n\n obj[normalizedKey] = attributes[key];\n }\n }\n\n return obj;\n}\n\nconst handleDomListener = (\n replay,\n) => {\n return (handlerData) => {\n if (!replay.isEnabled()) {\n return;\n }\n\n const result = handleDom(handlerData);\n\n if (!result) {\n return;\n }\n\n const isClick = handlerData.name === 'click';\n const event = isClick ? (handlerData.event ) : undefined;\n // Ignore clicks if ctrl/alt/meta/shift keys are held down as they alter behavior of clicks (e.g. open in new tab)\n if (\n isClick &&\n replay.clickDetector &&\n event &&\n event.target &&\n !event.altKey &&\n !event.metaKey &&\n !event.ctrlKey &&\n !event.shiftKey\n ) {\n handleClick(\n replay.clickDetector,\n result ,\n getClickTargetNode(handlerData.event ) ,\n );\n }\n\n addBreadcrumbEvent(replay, result);\n };\n};\n\n/** Get the base DOM breadcrumb. */\nfunction getBaseDomBreadcrumb(target, message) {\n const nodeId = record.mirror.getId(target);\n const node = nodeId && record.mirror.getNode(nodeId);\n const meta = node && record.mirror.getMeta(node);\n const element = meta && isElement(meta) ? meta : null;\n\n return {\n message,\n data: element\n ? {\n nodeId,\n node: {\n id: nodeId,\n tagName: element.tagName,\n textContent: Array.from(element.childNodes)\n .map((node) => node.type === NodeType.Text && node.textContent)\n .filter(Boolean) // filter out empty values\n .map(text => (text ).trim())\n .join(''),\n attributes: getAttributesToRecord(element.attributes),\n },\n }\n : {},\n };\n}\n\n/**\n * An event handler to react to DOM events.\n * Exported for tests.\n */\nfunction handleDom(handlerData) {\n const { target, message } = getDomTarget(handlerData);\n\n return createBreadcrumb({\n category: `ui.${handlerData.name}`,\n ...getBaseDomBreadcrumb(target, message),\n });\n}\n\nfunction getDomTarget(handlerData) {\n const isClick = handlerData.name === 'click';\n\n let message;\n let target = null;\n\n // Accessing event.target can throw (see getsentry/raven-js#838, #768)\n try {\n target = isClick ? getClickTargetNode(handlerData.event ) : getTargetNode(handlerData.event );\n message = htmlTreeAsString(target, { maxStringLength: 200 }) || '';\n } catch (e) {\n message = '';\n }\n\n return { target, message };\n}\n\nfunction isElement(node) {\n return node.type === NodeType.Element;\n}\n\n/** Handle keyboard events & create breadcrumbs. */\nfunction handleKeyboardEvent(replay, event) {\n if (!replay.isEnabled()) {\n return;\n }\n\n // Update user activity, but do not restart recording as it can create\n // noisy/low-value replays (e.g. user comes back from idle, hits alt-tab, new\n // session with a single \"keydown\" breadcrumb is created)\n replay.updateUserActivity();\n\n const breadcrumb = getKeyboardBreadcrumb(event);\n\n if (!breadcrumb) {\n return;\n }\n\n addBreadcrumbEvent(replay, breadcrumb);\n}\n\n/** exported only for tests */\nfunction getKeyboardBreadcrumb(event) {\n const { metaKey, shiftKey, ctrlKey, altKey, key, target } = event;\n\n // never capture for input fields\n if (!target || isInputElement(target ) || !key) {\n return null;\n }\n\n // Note: We do not consider shift here, as that means \"uppercase\"\n const hasModifierKey = metaKey || ctrlKey || altKey;\n const isCharacterKey = key.length === 1; // other keys like Escape, Tab, etc have a longer length\n\n // Do not capture breadcrumb if only a word key is pressed\n // This could leak e.g. user input\n if (!hasModifierKey && isCharacterKey) {\n return null;\n }\n\n const message = htmlTreeAsString(target, { maxStringLength: 200 }) || '';\n const baseBreadcrumb = getBaseDomBreadcrumb(target , message);\n\n return createBreadcrumb({\n category: 'ui.keyDown',\n message,\n data: {\n ...baseBreadcrumb.data,\n metaKey,\n shiftKey,\n ctrlKey,\n altKey,\n key,\n },\n });\n}\n\nfunction isInputElement(target) {\n return target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable;\n}\n\n// Map entryType -> function to normalize data for event\nconst ENTRY_TYPES\n\n = {\n // @ts-expect-error TODO: entry type does not fit the create* functions entry type\n resource: createResourceEntry,\n paint: createPaintEntry,\n // @ts-expect-error TODO: entry type does not fit the create* functions entry type\n navigation: createNavigationEntry,\n};\n\n/**\n * Create replay performance entries from the browser performance entries.\n */\nfunction createPerformanceEntries(\n entries,\n) {\n return entries.map(createPerformanceEntry).filter(Boolean) ;\n}\n\nfunction createPerformanceEntry(entry) {\n if (!ENTRY_TYPES[entry.entryType]) {\n return null;\n }\n\n return ENTRY_TYPES[entry.entryType](entry);\n}\n\nfunction getAbsoluteTime(time) {\n // browserPerformanceTimeOrigin can be undefined if `performance` or\n // `performance.now` doesn't exist, but this is already checked by this integration\n return ((browserPerformanceTimeOrigin || WINDOW.performance.timeOrigin) + time) / 1000;\n}\n\nfunction createPaintEntry(entry) {\n const { duration, entryType, name, startTime } = entry;\n\n const start = getAbsoluteTime(startTime);\n return {\n type: entryType,\n name,\n start,\n end: start + duration,\n data: undefined,\n };\n}\n\nfunction createNavigationEntry(entry) {\n const {\n entryType,\n name,\n decodedBodySize,\n duration,\n domComplete,\n encodedBodySize,\n domContentLoadedEventStart,\n domContentLoadedEventEnd,\n domInteractive,\n loadEventStart,\n loadEventEnd,\n redirectCount,\n startTime,\n transferSize,\n type,\n } = entry;\n\n // Ignore entries with no duration, they do not seem to be useful and cause dupes\n if (duration === 0) {\n return null;\n }\n\n return {\n type: `${entryType}.${type}`,\n start: getAbsoluteTime(startTime),\n end: getAbsoluteTime(domComplete),\n name,\n data: {\n size: transferSize,\n decodedBodySize,\n encodedBodySize,\n duration,\n domInteractive,\n domContentLoadedEventStart,\n domContentLoadedEventEnd,\n loadEventStart,\n loadEventEnd,\n domComplete,\n redirectCount,\n },\n };\n}\n\nfunction createResourceEntry(\n entry,\n) {\n const {\n entryType,\n initiatorType,\n name,\n responseEnd,\n startTime,\n decodedBodySize,\n encodedBodySize,\n responseStatus,\n transferSize,\n } = entry;\n\n // Core SDK handles these\n if (['fetch', 'xmlhttprequest'].includes(initiatorType)) {\n return null;\n }\n\n return {\n type: `${entryType}.${initiatorType}`,\n start: getAbsoluteTime(startTime),\n end: getAbsoluteTime(responseEnd),\n name,\n data: {\n size: transferSize,\n statusCode: responseStatus,\n decodedBodySize,\n encodedBodySize,\n },\n };\n}\n\n/**\n * Add a LCP event to the replay based on an LCP metric.\n */\nfunction getLargestContentfulPaint(metric\n\n) {\n const entries = metric.entries;\n const lastEntry = entries[entries.length - 1] ;\n const element = lastEntry ? lastEntry.element : undefined;\n\n const value = metric.value;\n\n const end = getAbsoluteTime(value);\n\n const data = {\n type: 'largest-contentful-paint',\n name: 'largest-contentful-paint',\n start: end,\n end,\n data: {\n value,\n size: value,\n nodeId: element ? record.mirror.getId(element) : undefined,\n },\n };\n\n return data;\n}\n\n/**\n * Sets up a PerformanceObserver to listen to all performance entry types.\n * Returns a callback to stop observing.\n */\nfunction setupPerformanceObserver(replay) {\n function addPerformanceEntry(entry) {\n // It is possible for entries to come up multiple times\n if (!replay.performanceEntries.includes(entry)) {\n replay.performanceEntries.push(entry);\n }\n }\n\n function onEntries({ entries }) {\n entries.forEach(addPerformanceEntry);\n }\n\n const clearCallbacks = [];\n\n (['navigation', 'paint', 'resource'] ).forEach(type => {\n clearCallbacks.push(addPerformanceInstrumentationHandler(type, onEntries));\n });\n\n clearCallbacks.push(\n addLcpInstrumentationHandler(({ metric }) => {\n replay.replayPerformanceEntries.push(getLargestContentfulPaint(metric));\n }),\n );\n\n // A callback to cleanup all handlers\n return () => {\n clearCallbacks.forEach(clearCallback => clearCallback());\n };\n}\n\n/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nconst r = `var t=Uint8Array,n=Uint16Array,r=Int32Array,e=new t([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0,0,0,0]),i=new t([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13,0,0]),a=new t([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),s=function(t,e){for(var i=new n(31),a=0;a<31;++a)i[a]=e+=1<>1|(21845&c)<<1;v=(61680&(v=(52428&v)>>2|(13107&v)<<2))>>4|(3855&v)<<4,u[c]=((65280&v)>>8|(255&v)<<8)>>1}var d=function(t,r,e){for(var i=t.length,a=0,s=new n(r);a>h]=l}else for(o=new n(i),a=0;a>15-t[a]);return o},g=new t(288);for(c=0;c<144;++c)g[c]=8;for(c=144;c<256;++c)g[c]=9;for(c=256;c<280;++c)g[c]=7;for(c=280;c<288;++c)g[c]=8;var w=new t(32);for(c=0;c<32;++c)w[c]=5;var p=d(g,9,0),y=d(w,5,0),m=function(t){return(t+7)/8|0},b=function(n,r,e){return(null==r||r<0)&&(r=0),(null==e||e>n.length)&&(e=n.length),new t(n.subarray(r,e))},M=[\"unexpected EOF\",\"invalid block type\",\"invalid length/literal\",\"invalid distance\",\"stream finished\",\"no stream handler\",,\"no callback\",\"invalid UTF-8 data\",\"extra field too long\",\"date not in range 1980-2099\",\"filename too long\",\"stream finishing\",\"invalid zip data\"],E=function(t,n,r){var e=new Error(n||M[t]);if(e.code=t,Error.captureStackTrace&&Error.captureStackTrace(e,E),!r)throw e;return e},z=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8},A=function(t,n,r){r<<=7&n;var e=n/8|0;t[e]|=r,t[e+1]|=r>>8,t[e+2]|=r>>16},_=function(r,e){for(var i=[],a=0;ad&&(d=o[a].s);var g=new n(d+1),w=x(i[c-1],g,0);if(w>e){a=0;var p=0,y=w-e,m=1<e))break;p+=m-(1<>=y;p>0;){var M=o[a].s;g[M]=0&&p;--a){var E=o[a].s;g[E]==e&&(--g[E],++p)}w=e}return{t:new t(g),l:w}},x=function(t,n,r){return-1==t.s?Math.max(x(t.l,n,r+1),x(t.r,n,r+1)):n[t.s]=r},D=function(t){for(var r=t.length;r&&!t[--r];);for(var e=new n(++r),i=0,a=t[0],s=1,o=function(t){e[i++]=t},f=1;f<=r;++f)if(t[f]==a&&f!=r)++s;else{if(!a&&s>2){for(;s>138;s-=138)o(32754);s>2&&(o(s>10?s-11<<5|28690:s-3<<5|12305),s=0)}else if(s>3){for(o(a),--s;s>6;s-=6)o(8304);s>2&&(o(s-3<<5|8208),s=0)}for(;s--;)o(a);s=1,a=t[f]}return{c:e.subarray(0,i),n:r}},T=function(t,n){for(var r=0,e=0;e>8,t[i+2]=255^t[i],t[i+3]=255^t[i+1];for(var a=0;a4&&!H[a[K-1]];--K);var N,P,Q,R,V=v+5<<3,W=T(f,g)+T(h,w)+l,X=T(f,M)+T(h,C)+l+14+3*K+T(q,H)+2*q[16]+3*q[17]+7*q[18];if(c>=0&&V<=W&&V<=X)return k(r,m,t.subarray(c,c+v));if(z(r,m,1+(X15&&(z(r,m,tt[B]>>5&127),m+=tt[B]>>12)}}}else N=p,P=g,Q=y,R=w;for(B=0;B255){A(r,m,N[(nt=rt>>18&31)+257]),m+=P[nt+257],nt>7&&(z(r,m,rt>>23&31),m+=e[nt]);var et=31&rt;A(r,m,Q[et]),m+=R[et],et>3&&(A(r,m,rt>>5&8191),m+=i[et])}else A(r,m,N[rt]),m+=P[rt]}return A(r,m,N[256]),m+P[256]},U=new r([65540,131080,131088,131104,262176,1048704,1048832,2114560,2117632]),F=new t(0),I=function(){for(var t=new Int32Array(256),n=0;n<256;++n){for(var r=n,e=9;--e;)r=(1&r&&-306674912)^r>>>1;t[n]=r}return t}(),S=function(){var t=1,n=0;return{p:function(r){for(var e=t,i=n,a=0|r.length,s=0;s!=a;){for(var o=Math.min(s+2655,a);s>16),i=(65535&i)+15*(i>>16)}t=e,n=i},d:function(){return(255&(t%=65521))<<24|(65280&t)<<8|(255&(n%=65521))<<8|n>>8}}},L=function(a,s,o,f,u){if(!u&&(u={l:1},s.dictionary)){var c=s.dictionary.subarray(-32768),v=new t(c.length+a.length);v.set(c),v.set(a,c.length),a=v,u.w=c.length}return function(a,s,o,f,u,c){var v=c.z||a.length,d=new t(f+v+5*(1+Math.ceil(v/7e3))+u),g=d.subarray(f,d.length-u),w=c.l,p=7&(c.r||0);if(s){p&&(g[0]=c.r>>3);for(var y=U[s-1],M=y>>13,E=8191&y,z=(1<7e3||q>24576)&&(N>423||!w)){p=C(a,g,0,F,I,S,O,q,G,j-G,p),q=L=O=0,G=j;for(var P=0;P<286;++P)I[P]=0;for(P=0;P<30;++P)S[P]=0}var Q=2,R=0,V=E,W=J-K&32767;if(N>2&&H==T(j-W))for(var X=Math.min(M,N)-1,Y=Math.min(32767,j),Z=Math.min(258,N);W<=Y&&--V&&J!=K;){if(a[j+Q]==a[j+Q-W]){for(var $=0;$Q){if(Q=$,R=W,$>X)break;var tt=Math.min(W,$-2),nt=0;for(P=0;Pnt&&(nt=et,K=rt)}}}W+=(J=K)-(K=A[J])&32767}if(R){F[q++]=268435456|h[Q]<<18|l[R];var it=31&h[Q],at=31&l[R];O+=e[it]+i[at],++I[257+it],++S[at],B=j+Q,++L}else F[q++]=a[j],++I[a[j]]}}for(j=Math.max(j,B);j=v&&(g[p/8|0]=w,st=v),p=k(g,p+1,a.subarray(j,st))}c.i=v}return b(d,0,f+m(p)+u)}(a,null==s.level?6:s.level,null==s.mem?Math.ceil(1.5*Math.max(8,Math.min(13,Math.log(a.length)))):12+s.mem,o,f,u)},O=function(t,n,r){for(;r;++n)t[n]=r,r>>>=8},j=function(){function n(n,r){if(\"function\"==typeof n&&(r=n,n={}),this.ondata=r,this.o=n||{},this.s={l:0,i:32768,w:32768,z:32768},this.b=new t(98304),this.o.dictionary){var e=this.o.dictionary.subarray(-32768);this.b.set(e,32768-e.length),this.s.i=32768-e.length}}return n.prototype.p=function(t,n){this.ondata(L(t,this.o,0,0,this.s),n)},n.prototype.push=function(n,r){this.ondata||E(5),this.s.l&&E(4);var e=n.length+this.s.z;if(e>this.b.length){if(e>2*this.b.length-32768){var i=new t(-32768&e);i.set(this.b.subarray(0,this.s.z)),this.b=i}var a=this.b.length-this.s.z;a&&(this.b.set(n.subarray(0,a),this.s.z),this.s.z=this.b.length,this.p(this.b,!1)),this.b.set(this.b.subarray(-32768)),this.b.set(n.subarray(a),32768),this.s.z=n.length-a+32768,this.s.i=32766,this.s.w=32768}else this.b.set(n,this.s.z),this.s.z+=n.length;this.s.l=1&r,(this.s.z>this.s.w+8191||r)&&(this.p(this.b,r||!1),this.s.w=this.s.i,this.s.i-=2)},n}();function q(t,n){n||(n={});var r=function(){var t=-1;return{p:function(n){for(var r=t,e=0;e>>8;t=r},d:function(){return~t}}}(),e=t.length;r.p(t);var i,a=L(t,n,10+((i=n).filename?i.filename.length+1:0),8),s=a.length;return function(t,n){var r=n.filename;if(t[0]=31,t[1]=139,t[2]=8,t[8]=n.level<2?4:9==n.level?2:0,t[9]=3,0!=n.mtime&&O(t,4,Math.floor(new Date(n.mtime||Date.now())/1e3)),r){t[3]=8;for(var e=0;e<=r.length;++e)t[e+10]=r.charCodeAt(e)}}(a,n),O(a,s-8,r.d()),O(a,s-4,e),a}var B=function(){function t(t,n){this.c=S(),this.v=1,j.call(this,t,n)}return t.prototype.push=function(t,n){this.c.p(t),j.prototype.push.call(this,t,n)},t.prototype.p=function(t,n){var r=L(t,this.o,this.v&&(this.o.dictionary?6:2),n&&4,this.s);this.v&&(function(t,n){var r=n.level,e=0==r?0:r<6?1:9==r?3:2;if(t[0]=120,t[1]=e<<6|(n.dictionary&&32),t[1]|=31-(t[0]<<8|t[1])%31,n.dictionary){var i=S();i.p(n.dictionary),O(t,2,i.d())}}(r,this.o),this.v=0),n&&O(r,r.length-4,this.c.d()),this.ondata(r,n)},t}(),G=\"undefined\"!=typeof TextEncoder&&new TextEncoder,H=\"undefined\"!=typeof TextDecoder&&new TextDecoder;try{H.decode(F,{stream:!0})}catch(t){}var J=function(){function t(t){this.ondata=t}return t.prototype.push=function(t,n){this.ondata||E(5),this.d&&E(4),this.ondata(K(t),this.d=n||!1)},t}();function K(n,r){if(r){for(var e=new t(n.length),i=0;i>1)),o=0,f=function(t){s[o++]=t};for(i=0;is.length){var h=new t(o+8+(a-i<<1));h.set(s),s=h}var l=n.charCodeAt(i);l<128||r?f(l):l<2048?(f(192|l>>6),f(128|63&l)):l>55295&&l<57344?(f(240|(l=65536+(1047552&l)|1023&n.charCodeAt(++i))>>18),f(128|l>>12&63),f(128|l>>6&63),f(128|63&l)):(f(224|l>>12),f(128|l>>6&63),f(128|63&l))}return b(s,0,o)}const N=new class{constructor(){this._init()}clear(){this._init()}addEvent(t){if(!t)throw new Error(\"Adding invalid event\");const n=this._hasEvents?\",\":\"\";this.stream.push(n+t),this._hasEvents=!0}finish(){this.stream.push(\"]\",!0);const t=function(t){let n=0;for(let r=0,e=t.length;r{this._deflatedData.push(t)},this.stream=new J(((t,n)=>{this.deflate.push(t,n)})),this.stream.push(\"[\")}},P={clear:()=>{N.clear()},addEvent:t=>N.addEvent(t),finish:()=>N.finish(),compress:t=>function(t){return q(K(t))}(t)};addEventListener(\"message\",(function(t){const n=t.data.method,r=t.data.id,e=t.data.arg;if(n in P&&\"function\"==typeof P[n])try{const t=P[n](e);postMessage({id:r,method:n,success:!0,response:t})}catch(t){postMessage({id:r,method:n,success:!1,response:t.message}),console.error(t)}})),postMessage({id:void 0,method:\"init\",success:!0,response:void 0});`;\n\nfunction e(){const e=new Blob([r]);return URL.createObjectURL(e)}\n\n/**\n * Log a message in debug mode, and add a breadcrumb when _experiment.traceInternals is enabled.\n */\nfunction logInfo(message, shouldAddBreadcrumb) {\n if (!DEBUG_BUILD) {\n return;\n }\n\n logger.info(message);\n\n if (shouldAddBreadcrumb) {\n addLogBreadcrumb(message);\n }\n}\n\n/**\n * Log a message, and add a breadcrumb in the next tick.\n * This is necessary when the breadcrumb may be added before the replay is initialized.\n */\nfunction logInfoNextTick(message, shouldAddBreadcrumb) {\n if (!DEBUG_BUILD) {\n return;\n }\n\n logger.info(message);\n\n if (shouldAddBreadcrumb) {\n // Wait a tick here to avoid race conditions for some initial logs\n // which may be added before replay is initialized\n setTimeout(() => {\n addLogBreadcrumb(message);\n }, 0);\n }\n}\n\nfunction addLogBreadcrumb(message) {\n addBreadcrumb(\n {\n category: 'console',\n data: {\n logger: 'replay',\n },\n level: 'info',\n message,\n },\n { level: 'info' },\n );\n}\n\n/** This error indicates that the event buffer size exceeded the limit.. */\nclass EventBufferSizeExceededError extends Error {\n constructor() {\n super(`Event buffer exceeded maximum size of ${REPLAY_MAX_EVENT_BUFFER_SIZE}.`);\n }\n}\n\n/**\n * A basic event buffer that does not do any compression.\n * Used as fallback if the compression worker cannot be loaded or is disabled.\n */\nclass EventBufferArray {\n /** All the events that are buffered to be sent. */\n\n /** @inheritdoc */\n\n constructor() {\n this.events = [];\n this._totalSize = 0;\n this.hasCheckout = false;\n }\n\n /** @inheritdoc */\n get hasEvents() {\n return this.events.length > 0;\n }\n\n /** @inheritdoc */\n get type() {\n return 'sync';\n }\n\n /** @inheritdoc */\n destroy() {\n this.events = [];\n }\n\n /** @inheritdoc */\n async addEvent(event) {\n const eventSize = JSON.stringify(event).length;\n this._totalSize += eventSize;\n if (this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE) {\n throw new EventBufferSizeExceededError();\n }\n\n this.events.push(event);\n }\n\n /** @inheritdoc */\n finish() {\n return new Promise(resolve => {\n // Make a copy of the events array reference and immediately clear the\n // events member so that we do not lose new events while uploading\n // attachment.\n const eventsRet = this.events;\n this.clear();\n resolve(JSON.stringify(eventsRet));\n });\n }\n\n /** @inheritdoc */\n clear() {\n this.events = [];\n this._totalSize = 0;\n this.hasCheckout = false;\n }\n\n /** @inheritdoc */\n getEarliestTimestamp() {\n const timestamp = this.events.map(event => event.timestamp).sort()[0];\n\n if (!timestamp) {\n return null;\n }\n\n return timestampToMs(timestamp);\n }\n}\n\n/**\n * Event buffer that uses a web worker to compress events.\n * Exported only for testing.\n */\nclass WorkerHandler {\n\n constructor(worker) {\n this._worker = worker;\n this._id = 0;\n }\n\n /**\n * Ensure the worker is ready (or not).\n * This will either resolve when the worker is ready, or reject if an error occured.\n */\n ensureReady() {\n // Ensure we only check once\n if (this._ensureReadyPromise) {\n return this._ensureReadyPromise;\n }\n\n this._ensureReadyPromise = new Promise((resolve, reject) => {\n this._worker.addEventListener(\n 'message',\n ({ data }) => {\n if ((data ).success) {\n resolve();\n } else {\n reject();\n }\n },\n { once: true },\n );\n\n this._worker.addEventListener(\n 'error',\n error => {\n reject(error);\n },\n { once: true },\n );\n });\n\n return this._ensureReadyPromise;\n }\n\n /**\n * Destroy the worker.\n */\n destroy() {\n logInfo('[Replay] Destroying compression worker');\n this._worker.terminate();\n }\n\n /**\n * Post message to worker and wait for response before resolving promise.\n */\n postMessage(method, arg) {\n const id = this._getAndIncrementId();\n\n return new Promise((resolve, reject) => {\n const listener = ({ data }) => {\n const response = data ;\n if (response.method !== method) {\n return;\n }\n\n // There can be multiple listeners for a single method, the id ensures\n // that the response matches the caller.\n if (response.id !== id) {\n return;\n }\n\n // At this point, we'll always want to remove listener regardless of result status\n this._worker.removeEventListener('message', listener);\n\n if (!response.success) {\n // TODO: Do some error handling, not sure what\n DEBUG_BUILD && logger.error('[Replay]', response.response);\n\n reject(new Error('Error in compression worker'));\n return;\n }\n\n resolve(response.response );\n };\n\n // Note: we can't use `once` option because it's possible it needs to\n // listen to multiple messages\n this._worker.addEventListener('message', listener);\n this._worker.postMessage({ id, method, arg });\n });\n }\n\n /** Get the current ID and increment it for the next call. */\n _getAndIncrementId() {\n return this._id++;\n }\n}\n\n/**\n * Event buffer that uses a web worker to compress events.\n * Exported only for testing.\n */\nclass EventBufferCompressionWorker {\n /** @inheritdoc */\n\n constructor(worker) {\n this._worker = new WorkerHandler(worker);\n this._earliestTimestamp = null;\n this._totalSize = 0;\n this.hasCheckout = false;\n }\n\n /** @inheritdoc */\n get hasEvents() {\n return !!this._earliestTimestamp;\n }\n\n /** @inheritdoc */\n get type() {\n return 'worker';\n }\n\n /**\n * Ensure the worker is ready (or not).\n * This will either resolve when the worker is ready, or reject if an error occured.\n */\n ensureReady() {\n return this._worker.ensureReady();\n }\n\n /**\n * Destroy the event buffer.\n */\n destroy() {\n this._worker.destroy();\n }\n\n /**\n * Add an event to the event buffer.\n *\n * Returns true if event was successfuly received and processed by worker.\n */\n addEvent(event) {\n const timestamp = timestampToMs(event.timestamp);\n if (!this._earliestTimestamp || timestamp < this._earliestTimestamp) {\n this._earliestTimestamp = timestamp;\n }\n\n const data = JSON.stringify(event);\n this._totalSize += data.length;\n\n if (this._totalSize > REPLAY_MAX_EVENT_BUFFER_SIZE) {\n return Promise.reject(new EventBufferSizeExceededError());\n }\n\n return this._sendEventToWorker(data);\n }\n\n /**\n * Finish the event buffer and return the compressed data.\n */\n finish() {\n return this._finishRequest();\n }\n\n /** @inheritdoc */\n clear() {\n this._earliestTimestamp = null;\n this._totalSize = 0;\n this.hasCheckout = false;\n\n // We do not wait on this, as we assume the order of messages is consistent for the worker\n this._worker.postMessage('clear').then(null, e => {\n DEBUG_BUILD && logger.warn('[Replay] Sending \"clear\" message to worker failed', e);\n });\n }\n\n /** @inheritdoc */\n getEarliestTimestamp() {\n return this._earliestTimestamp;\n }\n\n /**\n * Send the event to the worker.\n */\n _sendEventToWorker(data) {\n return this._worker.postMessage('addEvent', data);\n }\n\n /**\n * Finish the request and return the compressed data from the worker.\n */\n async _finishRequest() {\n const response = await this._worker.postMessage('finish');\n\n this._earliestTimestamp = null;\n this._totalSize = 0;\n\n return response;\n }\n}\n\n/**\n * This proxy will try to use the compression worker, and fall back to use the simple buffer if an error occurs there.\n * This can happen e.g. if the worker cannot be loaded.\n * Exported only for testing.\n */\nclass EventBufferProxy {\n\n constructor(worker) {\n this._fallback = new EventBufferArray();\n this._compression = new EventBufferCompressionWorker(worker);\n this._used = this._fallback;\n\n this._ensureWorkerIsLoadedPromise = this._ensureWorkerIsLoaded();\n }\n\n /** @inheritdoc */\n get type() {\n return this._used.type;\n }\n\n /** @inheritDoc */\n get hasEvents() {\n return this._used.hasEvents;\n }\n\n /** @inheritdoc */\n get hasCheckout() {\n return this._used.hasCheckout;\n }\n /** @inheritdoc */\n set hasCheckout(value) {\n this._used.hasCheckout = value;\n }\n\n /** @inheritDoc */\n destroy() {\n this._fallback.destroy();\n this._compression.destroy();\n }\n\n /** @inheritdoc */\n clear() {\n return this._used.clear();\n }\n\n /** @inheritdoc */\n getEarliestTimestamp() {\n return this._used.getEarliestTimestamp();\n }\n\n /**\n * Add an event to the event buffer.\n *\n * Returns true if event was successfully added.\n */\n addEvent(event) {\n return this._used.addEvent(event);\n }\n\n /** @inheritDoc */\n async finish() {\n // Ensure the worker is loaded, so the sent event is compressed\n await this.ensureWorkerIsLoaded();\n\n return this._used.finish();\n }\n\n /** Ensure the worker has loaded. */\n ensureWorkerIsLoaded() {\n return this._ensureWorkerIsLoadedPromise;\n }\n\n /** Actually check if the worker has been loaded. */\n async _ensureWorkerIsLoaded() {\n try {\n await this._compression.ensureReady();\n } catch (error) {\n // If the worker fails to load, we fall back to the simple buffer.\n // Nothing more to do from our side here\n logInfo('[Replay] Failed to load the compression worker, falling back to simple buffer');\n return;\n }\n\n // Now we need to switch over the array buffer to the compression worker\n await this._switchToCompressionWorker();\n }\n\n /** Switch the used buffer to the compression worker. */\n async _switchToCompressionWorker() {\n const { events, hasCheckout } = this._fallback;\n\n const addEventPromises = [];\n for (const event of events) {\n addEventPromises.push(this._compression.addEvent(event));\n }\n\n this._compression.hasCheckout = hasCheckout;\n\n // We switch over to the new buffer immediately - any further events will be added\n // after the previously buffered ones\n this._used = this._compression;\n\n // Wait for original events to be re-added before resolving\n try {\n await Promise.all(addEventPromises);\n } catch (error) {\n DEBUG_BUILD && logger.warn('[Replay] Failed to add events when switching buffers.', error);\n }\n }\n}\n\n/**\n * Create an event buffer for replays.\n */\nfunction createEventBuffer({\n useCompression,\n workerUrl: customWorkerUrl,\n}) {\n if (\n useCompression &&\n // eslint-disable-next-line no-restricted-globals\n window.Worker\n ) {\n const worker = _loadWorker(customWorkerUrl);\n\n if (worker) {\n return worker;\n }\n }\n\n logInfo('[Replay] Using simple buffer');\n return new EventBufferArray();\n}\n\nfunction _loadWorker(customWorkerUrl) {\n try {\n const workerUrl = customWorkerUrl || _getWorkerUrl();\n\n if (!workerUrl) {\n return;\n }\n\n logInfo(`[Replay] Using compression worker${customWorkerUrl ? ` from ${customWorkerUrl}` : ''}`);\n const worker = new Worker(workerUrl);\n return new EventBufferProxy(worker);\n } catch (error) {\n logInfo('[Replay] Failed to create compression worker');\n // Fall back to use simple event buffer array\n }\n}\n\nfunction _getWorkerUrl() {\n if (typeof __SENTRY_EXCLUDE_REPLAY_WORKER__ === 'undefined' || !__SENTRY_EXCLUDE_REPLAY_WORKER__) {\n return e();\n }\n\n return '';\n}\n\n/** If sessionStorage is available. */\nfunction hasSessionStorage() {\n try {\n // This can throw, e.g. when being accessed in a sandboxed iframe\n return 'sessionStorage' in WINDOW && !!WINDOW.sessionStorage;\n } catch (e) {\n return false;\n }\n}\n\n/**\n * Removes the session from Session Storage and unsets session in replay instance\n */\nfunction clearSession(replay) {\n deleteSession();\n replay.session = undefined;\n}\n\n/**\n * Deletes a session from storage\n */\nfunction deleteSession() {\n if (!hasSessionStorage()) {\n return;\n }\n\n try {\n WINDOW.sessionStorage.removeItem(REPLAY_SESSION_KEY);\n } catch (e) {\n // Ignore potential SecurityError exceptions\n }\n}\n\n/**\n * Given a sample rate, returns true if replay should be sampled.\n *\n * 1.0 = 100% sampling\n * 0.0 = 0% sampling\n */\nfunction isSampled(sampleRate) {\n if (sampleRate === undefined) {\n return false;\n }\n\n // Math.random() returns a number in range of 0 to 1 (inclusive of 0, but not 1)\n return Math.random() < sampleRate;\n}\n\n/**\n * Get a session with defaults & applied sampling.\n */\nfunction makeSession(session) {\n const now = Date.now();\n const id = session.id || uuid4();\n // Note that this means we cannot set a started/lastActivity of `0`, but this should not be relevant outside of tests.\n const started = session.started || now;\n const lastActivity = session.lastActivity || now;\n const segmentId = session.segmentId || 0;\n const sampled = session.sampled;\n const previousSessionId = session.previousSessionId;\n\n return {\n id,\n started,\n lastActivity,\n segmentId,\n sampled,\n previousSessionId,\n };\n}\n\n/**\n * Save a session to session storage.\n */\nfunction saveSession(session) {\n if (!hasSessionStorage()) {\n return;\n }\n\n try {\n WINDOW.sessionStorage.setItem(REPLAY_SESSION_KEY, JSON.stringify(session));\n } catch (e) {\n // Ignore potential SecurityError exceptions\n }\n}\n\n/**\n * Get the sampled status for a session based on sample rates & current sampled status.\n */\nfunction getSessionSampleType(sessionSampleRate, allowBuffering) {\n return isSampled(sessionSampleRate) ? 'session' : allowBuffering ? 'buffer' : false;\n}\n\n/**\n * Create a new session, which in its current implementation is a Sentry event\n * that all replays will be saved to as attachments. Currently, we only expect\n * one of these Sentry events per \"replay session\".\n */\nfunction createSession(\n { sessionSampleRate, allowBuffering, stickySession = false },\n { previousSessionId } = {},\n) {\n const sampled = getSessionSampleType(sessionSampleRate, allowBuffering);\n const session = makeSession({\n sampled,\n previousSessionId,\n });\n\n if (stickySession) {\n saveSession(session);\n }\n\n return session;\n}\n\n/**\n * Fetches a session from storage\n */\nfunction fetchSession(traceInternals) {\n if (!hasSessionStorage()) {\n return null;\n }\n\n try {\n // This can throw if cookies are disabled\n const sessionStringFromStorage = WINDOW.sessionStorage.getItem(REPLAY_SESSION_KEY);\n\n if (!sessionStringFromStorage) {\n return null;\n }\n\n const sessionObj = JSON.parse(sessionStringFromStorage) ;\n\n logInfoNextTick('[Replay] Loading existing session', traceInternals);\n\n return makeSession(sessionObj);\n } catch (e) {\n return null;\n }\n}\n\n/**\n * Given an initial timestamp and an expiry duration, checks to see if current\n * time should be considered as expired.\n */\nfunction isExpired(\n initialTime,\n expiry,\n targetTime = +new Date(),\n) {\n // Always expired if < 0\n if (initialTime === null || expiry === undefined || expiry < 0) {\n return true;\n }\n\n // Never expires if == 0\n if (expiry === 0) {\n return false;\n }\n\n return initialTime + expiry <= targetTime;\n}\n\n/**\n * Checks to see if session is expired\n */\nfunction isSessionExpired(\n session,\n {\n maxReplayDuration,\n sessionIdleExpire,\n targetTime = Date.now(),\n },\n) {\n return (\n // First, check that maximum session length has not been exceeded\n isExpired(session.started, maxReplayDuration, targetTime) ||\n // check that the idle timeout has not been exceeded (i.e. user has\n // performed an action within the last `sessionIdleExpire` ms)\n isExpired(session.lastActivity, sessionIdleExpire, targetTime)\n );\n}\n\n/** If the session should be refreshed or not. */\nfunction shouldRefreshSession(\n session,\n { sessionIdleExpire, maxReplayDuration },\n) {\n // If not expired, all good, just keep the session\n if (!isSessionExpired(session, { sessionIdleExpire, maxReplayDuration })) {\n return false;\n }\n\n // If we are buffering & haven't ever flushed yet, always continue\n if (session.sampled === 'buffer' && session.segmentId === 0) {\n return false;\n }\n\n return true;\n}\n\n/**\n * Get or create a session, when initializing the replay.\n * Returns a session that may be unsampled.\n */\nfunction loadOrCreateSession(\n {\n traceInternals,\n sessionIdleExpire,\n maxReplayDuration,\n previousSessionId,\n }\n\n,\n sessionOptions,\n) {\n const existingSession = sessionOptions.stickySession && fetchSession(traceInternals);\n\n // No session exists yet, just create a new one\n if (!existingSession) {\n logInfoNextTick('[Replay] Creating new session', traceInternals);\n return createSession(sessionOptions, { previousSessionId });\n }\n\n if (!shouldRefreshSession(existingSession, { sessionIdleExpire, maxReplayDuration })) {\n return existingSession;\n }\n\n logInfoNextTick('[Replay] Session in sessionStorage is expired, creating new one...');\n return createSession(sessionOptions, { previousSessionId: existingSession.id });\n}\n\nfunction isCustomEvent(event) {\n return event.type === EventType.Custom;\n}\n\n/**\n * Add an event to the event buffer.\n * In contrast to `addEvent`, this does not return a promise & does not wait for the adding of the event to succeed/fail.\n * Instead this returns `true` if we tried to add the event, else false.\n * It returns `false` e.g. if we are paused, disabled, or out of the max replay duration.\n *\n * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.\n */\nfunction addEventSync(replay, event, isCheckout) {\n if (!shouldAddEvent(replay, event)) {\n return false;\n }\n\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n _addEvent(replay, event, isCheckout);\n\n return true;\n}\n\n/**\n * Add an event to the event buffer.\n * Resolves to `null` if no event was added, else to `void`.\n *\n * `isCheckout` is true if this is either the very first event, or an event triggered by `checkoutEveryNms`.\n */\nfunction addEvent(\n replay,\n event,\n isCheckout,\n) {\n if (!shouldAddEvent(replay, event)) {\n return Promise.resolve(null);\n }\n\n return _addEvent(replay, event, isCheckout);\n}\n\nasync function _addEvent(\n replay,\n event,\n isCheckout,\n) {\n if (!replay.eventBuffer) {\n return null;\n }\n\n try {\n if (isCheckout && replay.recordingMode === 'buffer') {\n replay.eventBuffer.clear();\n }\n\n if (isCheckout) {\n replay.eventBuffer.hasCheckout = true;\n }\n\n const replayOptions = replay.getOptions();\n\n const eventAfterPossibleCallback = maybeApplyCallback(event, replayOptions.beforeAddRecordingEvent);\n\n if (!eventAfterPossibleCallback) {\n return;\n }\n\n return await replay.eventBuffer.addEvent(eventAfterPossibleCallback);\n } catch (error) {\n const reason = error && error instanceof EventBufferSizeExceededError ? 'addEventSizeExceeded' : 'addEvent';\n\n DEBUG_BUILD && logger.error(error);\n await replay.stop({ reason });\n\n const client = getClient();\n\n if (client) {\n client.recordDroppedEvent('internal_sdk_error', 'replay');\n }\n }\n}\n\n/** Exported only for tests. */\nfunction shouldAddEvent(replay, event) {\n if (!replay.eventBuffer || replay.isPaused() || !replay.isEnabled()) {\n return false;\n }\n\n const timestampInMs = timestampToMs(event.timestamp);\n\n // Throw out events that happen more than 5 minutes ago. This can happen if\n // page has been left open and idle for a long period of time and user\n // comes back to trigger a new session. The performance entries rely on\n // `performance.timeOrigin`, which is when the page first opened.\n if (timestampInMs + replay.timeouts.sessionIdlePause < Date.now()) {\n return false;\n }\n\n // Throw out events that are +60min from the initial timestamp\n if (timestampInMs > replay.getContext().initialTimestamp + replay.getOptions().maxReplayDuration) {\n logInfo(\n `[Replay] Skipping event with timestamp ${timestampInMs} because it is after maxReplayDuration`,\n replay.getOptions()._experiments.traceInternals,\n );\n return false;\n }\n\n return true;\n}\n\nfunction maybeApplyCallback(\n event,\n callback,\n) {\n try {\n if (typeof callback === 'function' && isCustomEvent(event)) {\n return callback(event);\n }\n } catch (error) {\n DEBUG_BUILD &&\n logger.error('[Replay] An error occured in the `beforeAddRecordingEvent` callback, skipping the event...', error);\n return null;\n }\n\n return event;\n}\n\n/** If the event is an error event */\nfunction isErrorEvent(event) {\n return !event.type;\n}\n\n/** If the event is a transaction event */\nfunction isTransactionEvent(event) {\n return event.type === 'transaction';\n}\n\n/** If the event is an replay event */\nfunction isReplayEvent(event) {\n return event.type === 'replay_event';\n}\n\n/** If the event is a feedback event */\nfunction isFeedbackEvent(event) {\n return event.type === 'feedback';\n}\n\n/**\n * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.\n */\nfunction handleAfterSendEvent(replay) {\n // Custom transports may still be returning `Promise`, which means we cannot expect the status code to be available there\n // TODO (v8): remove this check as it will no longer be necessary\n const enforceStatusCode = isBaseTransportSend();\n\n return (event, sendResponse) => {\n if (!replay.isEnabled() || (!isErrorEvent(event) && !isTransactionEvent(event))) {\n return;\n }\n\n const statusCode = sendResponse && sendResponse.statusCode;\n\n // We only want to do stuff on successful error sending, otherwise you get error replays without errors attached\n // If not using the base transport, we allow `undefined` response (as a custom transport may not implement this correctly yet)\n // If we do use the base transport, we skip if we encountered an non-OK status code\n if (enforceStatusCode && (!statusCode || statusCode < 200 || statusCode >= 300)) {\n return;\n }\n\n if (isTransactionEvent(event)) {\n handleTransactionEvent(replay, event);\n return;\n }\n\n handleErrorEvent(replay, event);\n };\n}\n\nfunction handleTransactionEvent(replay, event) {\n const replayContext = replay.getContext();\n\n // Collect traceIds in _context regardless of `recordingMode`\n // In error mode, _context gets cleared on every checkout\n // We limit to max. 100 transactions linked\n if (event.contexts && event.contexts.trace && event.contexts.trace.trace_id && replayContext.traceIds.size < 100) {\n replayContext.traceIds.add(event.contexts.trace.trace_id );\n }\n}\n\nfunction handleErrorEvent(replay, event) {\n const replayContext = replay.getContext();\n\n // Add error to list of errorIds of replay. This is ok to do even if not\n // sampled because context will get reset at next checkout.\n // XXX: There is also a race condition where it's possible to capture an\n // error to Sentry before Replay SDK has loaded, but response returns after\n // it was loaded, and this gets called.\n // We limit to max. 100 errors linked\n if (event.event_id && replayContext.errorIds.size < 100) {\n replayContext.errorIds.add(event.event_id);\n }\n\n // If error event is tagged with replay id it means it was sampled (when in buffer mode)\n // Need to be very careful that this does not cause an infinite loop\n if (replay.recordingMode !== 'buffer' || !event.tags || !event.tags.replayId) {\n return;\n }\n\n const { beforeErrorSampling } = replay.getOptions();\n if (typeof beforeErrorSampling === 'function' && !beforeErrorSampling(event)) {\n return;\n }\n\n setTimeout(() => {\n // Capture current event buffer as new replay\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n replay.sendBufferedReplayOrFlush();\n });\n}\n\nfunction isBaseTransportSend() {\n const client = getClient();\n if (!client) {\n return false;\n }\n\n const transport = client.getTransport();\n if (!transport) {\n return false;\n }\n\n return (\n (transport.send ).__sentry__baseTransport__ || false\n );\n}\n\n/**\n * Returns a listener to be added to `client.on('afterSendErrorEvent, listener)`.\n */\nfunction handleBeforeSendEvent(replay) {\n return (event) => {\n if (!replay.isEnabled() || !isErrorEvent(event)) {\n return;\n }\n\n handleHydrationError(replay, event);\n };\n}\n\nfunction handleHydrationError(replay, event) {\n const exceptionValue = event.exception && event.exception.values && event.exception.values[0].value;\n if (typeof exceptionValue !== 'string') {\n return;\n }\n\n if (\n // Only matches errors in production builds of react-dom\n // Example https://reactjs.org/docs/error-decoder.html?invariant=423\n exceptionValue.match(/reactjs\\.org\\/docs\\/error-decoder\\.html\\?invariant=(418|419|422|423|425)/) ||\n // Development builds of react-dom\n // Error 1: Hydration failed because the initial UI does not match what was rendered on the server.\n // Error 2: Text content does not match server-rendered HTML. Warning: Text content did not match.\n exceptionValue.match(/(does not match server-rendered HTML|Hydration failed because)/i)\n ) {\n const breadcrumb = createBreadcrumb({\n category: 'replay.hydrate-error',\n });\n addBreadcrumbEvent(replay, breadcrumb);\n }\n}\n\n/**\n * Returns true if we think the given event is an error originating inside of rrweb.\n */\nfunction isRrwebError(event, hint) {\n if (event.type || !event.exception || !event.exception.values || !event.exception.values.length) {\n return false;\n }\n\n // @ts-expect-error this may be set by rrweb when it finds errors\n if (hint.originalException && hint.originalException.__rrweb__) {\n return true;\n }\n\n return false;\n}\n\n/**\n * Add a feedback breadcrumb event to replay.\n */\nfunction addFeedbackBreadcrumb(replay, event) {\n replay.triggerUserActivity();\n replay.addUpdate(() => {\n if (!event.timestamp) {\n // Ignore events that don't have timestamps (this shouldn't happen, more of a typing issue)\n // Return true here so that we don't flush\n return true;\n }\n\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n replay.throttledAddEvent({\n type: EventType.Custom,\n timestamp: event.timestamp * 1000,\n data: {\n tag: 'breadcrumb',\n payload: {\n timestamp: event.timestamp,\n type: 'default',\n category: 'sentry.feedback',\n data: {\n feedbackId: event.event_id,\n },\n },\n },\n } );\n\n return false;\n });\n}\n\n/**\n * Determine if event should be sampled (only applies in buffer mode).\n * When an event is captured by `hanldleGlobalEvent`, when in buffer mode\n * we determine if we want to sample the error or not.\n */\nfunction shouldSampleForBufferEvent(replay, event) {\n if (replay.recordingMode !== 'buffer') {\n return false;\n }\n\n // ignore this error because otherwise we could loop indefinitely with\n // trying to capture replay and failing\n if (event.message === UNABLE_TO_SEND_REPLAY) {\n return false;\n }\n\n // Require the event to be an error event & to have an exception\n if (!event.exception || event.type) {\n return false;\n }\n\n return isSampled(replay.getOptions().errorSampleRate);\n}\n\n/**\n * Returns a listener to be added to `addEventProcessor(listener)`.\n */\nfunction handleGlobalEventListener(\n replay,\n includeAfterSendEventHandling = false,\n) {\n const afterSendHandler = includeAfterSendEventHandling ? handleAfterSendEvent(replay) : undefined;\n\n return Object.assign(\n (event, hint) => {\n // Do nothing if replay has been disabled\n if (!replay.isEnabled()) {\n return event;\n }\n\n if (isReplayEvent(event)) {\n // Replays have separate set of breadcrumbs, do not include breadcrumbs\n // from core SDK\n delete event.breadcrumbs;\n return event;\n }\n\n // We only want to handle errors, transactions, and feedbacks, nothing else\n if (!isErrorEvent(event) && !isTransactionEvent(event) && !isFeedbackEvent(event)) {\n return event;\n }\n\n // Ensure we do not add replay_id if the session is expired\n const isSessionActive = replay.checkAndHandleExpiredSession();\n if (!isSessionActive) {\n return event;\n }\n\n if (isFeedbackEvent(event)) {\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n replay.flush();\n event.contexts.feedback.replay_id = replay.getSessionId();\n // Add a replay breadcrumb for this piece of feedback\n addFeedbackBreadcrumb(replay, event);\n return event;\n }\n\n // Unless `captureExceptions` is enabled, we want to ignore errors coming from rrweb\n // As there can be a bunch of stuff going wrong in internals there, that we don't want to bubble up to users\n if (isRrwebError(event, hint) && !replay.getOptions()._experiments.captureExceptions) {\n DEBUG_BUILD && logger.log('[Replay] Ignoring error from rrweb internals', event);\n return null;\n }\n\n // When in buffer mode, we decide to sample here.\n // Later, in `handleAfterSendEvent`, if the replayId is set, we know that we sampled\n // And convert the buffer session to a full session\n const isErrorEventSampled = shouldSampleForBufferEvent(replay, event);\n\n // Tag errors if it has been sampled in buffer mode, or if it is session mode\n // Only tag transactions if in session mode\n const shouldTagReplayId = isErrorEventSampled || replay.recordingMode === 'session';\n\n if (shouldTagReplayId) {\n event.tags = { ...event.tags, replayId: replay.getSessionId() };\n }\n\n // In cases where a custom client is used that does not support the new hooks (yet),\n // we manually call this hook method here\n if (afterSendHandler) {\n // Pretend the error had a 200 response so we always capture it\n afterSendHandler(event, { statusCode: 200 });\n }\n\n return event;\n },\n { id: 'Replay' },\n );\n}\n\n/**\n * Create a \"span\" for each performance entry.\n */\nfunction createPerformanceSpans(\n replay,\n entries,\n) {\n return entries.map(({ type, start, end, name, data }) => {\n const response = replay.throttledAddEvent({\n type: EventType.Custom,\n timestamp: start,\n data: {\n tag: 'performanceSpan',\n payload: {\n op: type,\n description: name,\n startTimestamp: start,\n endTimestamp: end,\n data,\n },\n },\n });\n\n // If response is a string, it means its either THROTTLED or SKIPPED\n return typeof response === 'string' ? Promise.resolve(null) : response;\n });\n}\n\nfunction handleHistory(handlerData) {\n const { from, to } = handlerData;\n\n const now = Date.now() / 1000;\n\n return {\n type: 'navigation.push',\n start: now,\n end: now,\n name: to,\n data: {\n previous: from,\n },\n };\n}\n\n/**\n * Returns a listener to be added to `addHistoryInstrumentationHandler(listener)`.\n */\nfunction handleHistorySpanListener(replay) {\n return (handlerData) => {\n if (!replay.isEnabled()) {\n return;\n }\n\n const result = handleHistory(handlerData);\n\n if (result === null) {\n return;\n }\n\n // Need to collect visited URLs\n replay.getContext().urls.push(result.name);\n replay.triggerUserActivity();\n\n replay.addUpdate(() => {\n createPerformanceSpans(replay, [result]);\n // Returning false to flush\n return false;\n });\n };\n}\n\n/**\n * Check whether a given request URL should be filtered out. This is so we\n * don't log Sentry ingest requests.\n */\nfunction shouldFilterRequest(replay, url) {\n // If we enabled the `traceInternals` experiment, we want to trace everything\n if (DEBUG_BUILD && replay.getOptions()._experiments.traceInternals) {\n return false;\n }\n\n return isSentryRequestUrl(url, getClient());\n}\n\n/** Add a performance entry breadcrumb */\nfunction addNetworkBreadcrumb(\n replay,\n result,\n) {\n if (!replay.isEnabled()) {\n return;\n }\n\n if (result === null) {\n return;\n }\n\n if (shouldFilterRequest(replay, result.name)) {\n return;\n }\n\n replay.addUpdate(() => {\n createPerformanceSpans(replay, [result]);\n // Returning true will cause `addUpdate` to not flush\n // We do not want network requests to cause a flush. This will prevent\n // recurring/polling requests from keeping the replay session alive.\n return true;\n });\n}\n\n/** only exported for tests */\nfunction handleFetch(handlerData) {\n const { startTimestamp, endTimestamp, fetchData, response } = handlerData;\n\n if (!endTimestamp) {\n return null;\n }\n\n // This is only used as a fallback, so we know the body sizes are never set here\n const { method, url } = fetchData;\n\n return {\n type: 'resource.fetch',\n start: startTimestamp / 1000,\n end: endTimestamp / 1000,\n name: url,\n data: {\n method,\n statusCode: response ? (response ).status : undefined,\n },\n };\n}\n\n/**\n * Returns a listener to be added to `addFetchInstrumentationHandler(listener)`.\n */\nfunction handleFetchSpanListener(replay) {\n return (handlerData) => {\n if (!replay.isEnabled()) {\n return;\n }\n\n const result = handleFetch(handlerData);\n\n addNetworkBreadcrumb(replay, result);\n };\n}\n\n/** only exported for tests */\nfunction handleXhr(handlerData) {\n const { startTimestamp, endTimestamp, xhr } = handlerData;\n\n const sentryXhrData = xhr[SENTRY_XHR_DATA_KEY];\n\n if (!startTimestamp || !endTimestamp || !sentryXhrData) {\n return null;\n }\n\n // This is only used as a fallback, so we know the body sizes are never set here\n const { method, url, status_code: statusCode } = sentryXhrData;\n\n if (url === undefined) {\n return null;\n }\n\n return {\n type: 'resource.xhr',\n name: url,\n start: startTimestamp / 1000,\n end: endTimestamp / 1000,\n data: {\n method,\n statusCode,\n },\n };\n}\n\n/**\n * Returns a listener to be added to `addXhrInstrumentationHandler(listener)`.\n */\nfunction handleXhrSpanListener(replay) {\n return (handlerData) => {\n if (!replay.isEnabled()) {\n return;\n }\n\n const result = handleXhr(handlerData);\n\n addNetworkBreadcrumb(replay, result);\n };\n}\n\n/** Get the size of a body. */\nfunction getBodySize(\n body,\n textEncoder,\n) {\n if (!body) {\n return undefined;\n }\n\n try {\n if (typeof body === 'string') {\n return textEncoder.encode(body).length;\n }\n\n if (body instanceof URLSearchParams) {\n return textEncoder.encode(body.toString()).length;\n }\n\n if (body instanceof FormData) {\n const formDataStr = _serializeFormData(body);\n return textEncoder.encode(formDataStr).length;\n }\n\n if (body instanceof Blob) {\n return body.size;\n }\n\n if (body instanceof ArrayBuffer) {\n return body.byteLength;\n }\n\n // Currently unhandled types: ArrayBufferView, ReadableStream\n } catch (e) {\n // just return undefined\n }\n\n return undefined;\n}\n\n/** Convert a Content-Length header to number/undefined. */\nfunction parseContentLengthHeader(header) {\n if (!header) {\n return undefined;\n }\n\n const size = parseInt(header, 10);\n return isNaN(size) ? undefined : size;\n}\n\n/** Get the string representation of a body. */\nfunction getBodyString(body) {\n try {\n if (typeof body === 'string') {\n return [body];\n }\n\n if (body instanceof URLSearchParams) {\n return [body.toString()];\n }\n\n if (body instanceof FormData) {\n return [_serializeFormData(body)];\n }\n\n if (!body) {\n return [undefined];\n }\n } catch (e2) {\n DEBUG_BUILD && logger.warn('[Replay] Failed to serialize body', body);\n return [undefined, 'BODY_PARSE_ERROR'];\n }\n\n DEBUG_BUILD && logger.info('[Replay] Skipping network body because of body type', body);\n\n return [undefined, 'UNPARSEABLE_BODY_TYPE'];\n}\n\n/** Merge a warning into an existing network request/response. */\nfunction mergeWarning(\n info,\n warning,\n) {\n if (!info) {\n return {\n headers: {},\n size: undefined,\n _meta: {\n warnings: [warning],\n },\n };\n }\n\n const newMeta = { ...info._meta };\n const existingWarnings = newMeta.warnings || [];\n newMeta.warnings = [...existingWarnings, warning];\n\n info._meta = newMeta;\n return info;\n}\n\n/** Convert ReplayNetworkRequestData to a PerformanceEntry. */\nfunction makeNetworkReplayBreadcrumb(\n type,\n data,\n) {\n if (!data) {\n return null;\n }\n\n const { startTimestamp, endTimestamp, url, method, statusCode, request, response } = data;\n\n const result = {\n type,\n start: startTimestamp / 1000,\n end: endTimestamp / 1000,\n name: url,\n data: dropUndefinedKeys({\n method,\n statusCode,\n request,\n response,\n }),\n };\n\n return result;\n}\n\n/** Build the request or response part of a replay network breadcrumb that was skipped. */\nfunction buildSkippedNetworkRequestOrResponse(bodySize) {\n return {\n headers: {},\n size: bodySize,\n _meta: {\n warnings: ['URL_SKIPPED'],\n },\n };\n}\n\n/** Build the request or response part of a replay network breadcrumb. */\nfunction buildNetworkRequestOrResponse(\n headers,\n bodySize,\n body,\n) {\n if (!bodySize && Object.keys(headers).length === 0) {\n return undefined;\n }\n\n if (!bodySize) {\n return {\n headers,\n };\n }\n\n if (!body) {\n return {\n headers,\n size: bodySize,\n };\n }\n\n const info = {\n headers,\n size: bodySize,\n };\n\n const { body: normalizedBody, warnings } = normalizeNetworkBody(body);\n info.body = normalizedBody;\n if (warnings && warnings.length > 0) {\n info._meta = {\n warnings,\n };\n }\n\n return info;\n}\n\n/** Filter a set of headers */\nfunction getAllowedHeaders(headers, allowedHeaders) {\n return Object.keys(headers).reduce((filteredHeaders, key) => {\n const normalizedKey = key.toLowerCase();\n // Avoid putting empty strings into the headers\n if (allowedHeaders.includes(normalizedKey) && headers[key]) {\n filteredHeaders[normalizedKey] = headers[key];\n }\n return filteredHeaders;\n }, {});\n}\n\nfunction _serializeFormData(formData) {\n // This is a bit simplified, but gives us a decent estimate\n // This converts e.g. { name: 'Anne Smith', age: 13 } to 'name=Anne+Smith&age=13'\n // @ts-expect-error passing FormData to URLSearchParams actually works\n return new URLSearchParams(formData).toString();\n}\n\nfunction normalizeNetworkBody(body)\n\n {\n if (!body || typeof body !== 'string') {\n return {\n body,\n };\n }\n\n const exceedsSizeLimit = body.length > NETWORK_BODY_MAX_SIZE;\n const isProbablyJson = _strIsProbablyJson(body);\n\n if (exceedsSizeLimit) {\n const truncatedBody = body.slice(0, NETWORK_BODY_MAX_SIZE);\n\n if (isProbablyJson) {\n return {\n body: truncatedBody,\n warnings: ['MAYBE_JSON_TRUNCATED'],\n };\n }\n\n return {\n body: `${truncatedBody}…`,\n warnings: ['TEXT_TRUNCATED'],\n };\n }\n\n if (isProbablyJson) {\n try {\n const jsonBody = JSON.parse(body);\n return {\n body: jsonBody,\n };\n } catch (e3) {\n // fall back to just send the body as string\n }\n }\n\n return {\n body,\n };\n}\n\nfunction _strIsProbablyJson(str) {\n const first = str[0];\n const last = str[str.length - 1];\n\n // Simple check: If this does not start & end with {} or [], it's not JSON\n return (first === '[' && last === ']') || (first === '{' && last === '}');\n}\n\n/** Match an URL against a list of strings/Regex. */\nfunction urlMatches(url, urls) {\n const fullUrl = getFullUrl(url);\n\n return stringMatchesSomePattern(fullUrl, urls);\n}\n\n/** exported for tests */\nfunction getFullUrl(url, baseURI = WINDOW.document.baseURI) {\n // Short circuit for common cases:\n if (url.startsWith('http://') || url.startsWith('https://') || url.startsWith(WINDOW.location.origin)) {\n return url;\n }\n const fixedUrl = new URL(url, baseURI);\n\n // If these do not match, we are not dealing with a relative URL, so just return it\n if (fixedUrl.origin !== new URL(baseURI).origin) {\n return url;\n }\n\n const fullUrl = fixedUrl.href;\n\n // Remove trailing slashes, if they don't match the original URL\n if (!url.endsWith('/') && fullUrl.endsWith('/')) {\n return fullUrl.slice(0, -1);\n }\n\n return fullUrl;\n}\n\n/**\n * Capture a fetch breadcrumb to a replay.\n * This adds additional data (where approriate).\n */\nasync function captureFetchBreadcrumbToReplay(\n breadcrumb,\n hint,\n options\n\n,\n) {\n try {\n const data = await _prepareFetchData(breadcrumb, hint, options);\n\n // Create a replay performance entry from this breadcrumb\n const result = makeNetworkReplayBreadcrumb('resource.fetch', data);\n addNetworkBreadcrumb(options.replay, result);\n } catch (error) {\n DEBUG_BUILD && logger.error('[Replay] Failed to capture fetch breadcrumb', error);\n }\n}\n\n/**\n * Enrich a breadcrumb with additional data.\n * This has to be sync & mutate the given breadcrumb,\n * as the breadcrumb is afterwards consumed by other handlers.\n */\nfunction enrichFetchBreadcrumb(\n breadcrumb,\n hint,\n options,\n) {\n const { input, response } = hint;\n\n const body = input ? _getFetchRequestArgBody(input) : undefined;\n const reqSize = getBodySize(body, options.textEncoder);\n\n const resSize = response ? parseContentLengthHeader(response.headers.get('content-length')) : undefined;\n\n if (reqSize !== undefined) {\n breadcrumb.data.request_body_size = reqSize;\n }\n if (resSize !== undefined) {\n breadcrumb.data.response_body_size = resSize;\n }\n}\n\nasync function _prepareFetchData(\n breadcrumb,\n hint,\n options\n\n,\n) {\n const now = Date.now();\n const { startTimestamp = now, endTimestamp = now } = hint;\n\n const {\n url,\n method,\n status_code: statusCode = 0,\n request_body_size: requestBodySize,\n response_body_size: responseBodySize,\n } = breadcrumb.data;\n\n const captureDetails =\n urlMatches(url, options.networkDetailAllowUrls) && !urlMatches(url, options.networkDetailDenyUrls);\n\n const request = captureDetails\n ? _getRequestInfo(options, hint.input, requestBodySize)\n : buildSkippedNetworkRequestOrResponse(requestBodySize);\n const response = await _getResponseInfo(captureDetails, options, hint.response, responseBodySize);\n\n return {\n startTimestamp,\n endTimestamp,\n url,\n method,\n statusCode,\n request,\n response,\n };\n}\n\nfunction _getRequestInfo(\n { networkCaptureBodies, networkRequestHeaders },\n input,\n requestBodySize,\n) {\n const headers = input ? getRequestHeaders(input, networkRequestHeaders) : {};\n\n if (!networkCaptureBodies) {\n return buildNetworkRequestOrResponse(headers, requestBodySize, undefined);\n }\n\n // We only want to transmit string or string-like bodies\n const requestBody = _getFetchRequestArgBody(input);\n const [bodyStr, warning] = getBodyString(requestBody);\n const data = buildNetworkRequestOrResponse(headers, requestBodySize, bodyStr);\n\n if (warning) {\n return mergeWarning(data, warning);\n }\n\n return data;\n}\n\n/** Exported only for tests. */\nasync function _getResponseInfo(\n captureDetails,\n {\n networkCaptureBodies,\n textEncoder,\n networkResponseHeaders,\n }\n\n,\n response,\n responseBodySize,\n) {\n if (!captureDetails && responseBodySize !== undefined) {\n return buildSkippedNetworkRequestOrResponse(responseBodySize);\n }\n\n const headers = response ? getAllHeaders(response.headers, networkResponseHeaders) : {};\n\n if (!response || (!networkCaptureBodies && responseBodySize !== undefined)) {\n return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);\n }\n\n const [bodyText, warning] = await _parseFetchResponseBody(response);\n const result = getResponseData(bodyText, {\n networkCaptureBodies,\n textEncoder,\n responseBodySize,\n captureDetails,\n headers,\n });\n\n if (warning) {\n return mergeWarning(result, warning);\n }\n\n return result;\n}\n\nfunction getResponseData(\n bodyText,\n {\n networkCaptureBodies,\n textEncoder,\n responseBodySize,\n captureDetails,\n headers,\n }\n\n,\n) {\n try {\n const size =\n bodyText && bodyText.length && responseBodySize === undefined\n ? getBodySize(bodyText, textEncoder)\n : responseBodySize;\n\n if (!captureDetails) {\n return buildSkippedNetworkRequestOrResponse(size);\n }\n\n if (networkCaptureBodies) {\n return buildNetworkRequestOrResponse(headers, size, bodyText);\n }\n\n return buildNetworkRequestOrResponse(headers, size, undefined);\n } catch (error) {\n DEBUG_BUILD && logger.warn('[Replay] Failed to serialize response body', error);\n // fallback\n return buildNetworkRequestOrResponse(headers, responseBodySize, undefined);\n }\n}\n\nasync function _parseFetchResponseBody(response) {\n const res = _tryCloneResponse(response);\n\n if (!res) {\n return [undefined, 'BODY_PARSE_ERROR'];\n }\n\n try {\n const text = await _tryGetResponseText(res);\n return [text];\n } catch (error) {\n DEBUG_BUILD && logger.warn('[Replay] Failed to get text body from response', error);\n return [undefined, 'BODY_PARSE_ERROR'];\n }\n}\n\nfunction _getFetchRequestArgBody(fetchArgs = []) {\n // We only support getting the body from the fetch options\n if (fetchArgs.length !== 2 || typeof fetchArgs[1] !== 'object') {\n return undefined;\n }\n\n return (fetchArgs[1] ).body;\n}\n\nfunction getAllHeaders(headers, allowedHeaders) {\n const allHeaders = {};\n\n allowedHeaders.forEach(header => {\n if (headers.get(header)) {\n allHeaders[header] = headers.get(header) ;\n }\n });\n\n return allHeaders;\n}\n\nfunction getRequestHeaders(fetchArgs, allowedHeaders) {\n if (fetchArgs.length === 1 && typeof fetchArgs[0] !== 'string') {\n return getHeadersFromOptions(fetchArgs[0] , allowedHeaders);\n }\n\n if (fetchArgs.length === 2) {\n return getHeadersFromOptions(fetchArgs[1] , allowedHeaders);\n }\n\n return {};\n}\n\nfunction getHeadersFromOptions(\n input,\n allowedHeaders,\n) {\n if (!input) {\n return {};\n }\n\n const headers = input.headers;\n\n if (!headers) {\n return {};\n }\n\n if (headers instanceof Headers) {\n return getAllHeaders(headers, allowedHeaders);\n }\n\n // We do not support this, as it is not really documented (anymore?)\n if (Array.isArray(headers)) {\n return {};\n }\n\n return getAllowedHeaders(headers, allowedHeaders);\n}\n\nfunction _tryCloneResponse(response) {\n try {\n // We have to clone this, as the body can only be read once\n return response.clone();\n } catch (error) {\n // this can throw if the response was already consumed before\n DEBUG_BUILD && logger.warn('[Replay] Failed to clone response body', error);\n }\n}\n\n/**\n * Get the response body of a fetch request, or timeout after 500ms.\n * Fetch can return a streaming body, that may not resolve (or not for a long time).\n * If that happens, we rather abort after a short time than keep waiting for this.\n */\nfunction _tryGetResponseText(response) {\n return new Promise((resolve, reject) => {\n const timeout = setTimeout(() => reject(new Error('Timeout while trying to read response body')), 500);\n\n _getResponseText(response)\n .then(\n txt => resolve(txt),\n reason => reject(reason),\n )\n .finally(() => clearTimeout(timeout));\n });\n}\n\nasync function _getResponseText(response) {\n // Force this to be a promise, just to be safe\n // eslint-disable-next-line no-return-await\n return await response.text();\n}\n\n/**\n * Capture an XHR breadcrumb to a replay.\n * This adds additional data (where approriate).\n */\nasync function captureXhrBreadcrumbToReplay(\n breadcrumb,\n hint,\n options,\n) {\n try {\n const data = _prepareXhrData(breadcrumb, hint, options);\n\n // Create a replay performance entry from this breadcrumb\n const result = makeNetworkReplayBreadcrumb('resource.xhr', data);\n addNetworkBreadcrumb(options.replay, result);\n } catch (error) {\n DEBUG_BUILD && logger.error('[Replay] Failed to capture xhr breadcrumb', error);\n }\n}\n\n/**\n * Enrich a breadcrumb with additional data.\n * This has to be sync & mutate the given breadcrumb,\n * as the breadcrumb is afterwards consumed by other handlers.\n */\nfunction enrichXhrBreadcrumb(\n breadcrumb,\n hint,\n options,\n) {\n const { xhr, input } = hint;\n\n if (!xhr) {\n return;\n }\n\n const reqSize = getBodySize(input, options.textEncoder);\n const resSize = xhr.getResponseHeader('content-length')\n ? parseContentLengthHeader(xhr.getResponseHeader('content-length'))\n : _getBodySize(xhr.response, xhr.responseType, options.textEncoder);\n\n if (reqSize !== undefined) {\n breadcrumb.data.request_body_size = reqSize;\n }\n if (resSize !== undefined) {\n breadcrumb.data.response_body_size = resSize;\n }\n}\n\nfunction _prepareXhrData(\n breadcrumb,\n hint,\n options,\n) {\n const now = Date.now();\n const { startTimestamp = now, endTimestamp = now, input, xhr } = hint;\n\n const {\n url,\n method,\n status_code: statusCode = 0,\n request_body_size: requestBodySize,\n response_body_size: responseBodySize,\n } = breadcrumb.data;\n\n if (!url) {\n return null;\n }\n\n if (!xhr || !urlMatches(url, options.networkDetailAllowUrls) || urlMatches(url, options.networkDetailDenyUrls)) {\n const request = buildSkippedNetworkRequestOrResponse(requestBodySize);\n const response = buildSkippedNetworkRequestOrResponse(responseBodySize);\n return {\n startTimestamp,\n endTimestamp,\n url,\n method,\n statusCode,\n request,\n response,\n };\n }\n\n const xhrInfo = xhr[SENTRY_XHR_DATA_KEY];\n const networkRequestHeaders = xhrInfo\n ? getAllowedHeaders(xhrInfo.request_headers, options.networkRequestHeaders)\n : {};\n const networkResponseHeaders = getAllowedHeaders(getResponseHeaders(xhr), options.networkResponseHeaders);\n\n const [requestBody, requestWarning] = options.networkCaptureBodies ? getBodyString(input) : [undefined];\n const [responseBody, responseWarning] = options.networkCaptureBodies ? _getXhrResponseBody(xhr) : [undefined];\n\n const request = buildNetworkRequestOrResponse(networkRequestHeaders, requestBodySize, requestBody);\n const response = buildNetworkRequestOrResponse(networkResponseHeaders, responseBodySize, responseBody);\n\n return {\n startTimestamp,\n endTimestamp,\n url,\n method,\n statusCode,\n request: requestWarning ? mergeWarning(request, requestWarning) : request,\n response: responseWarning ? mergeWarning(response, responseWarning) : response,\n };\n}\n\nfunction getResponseHeaders(xhr) {\n const headers = xhr.getAllResponseHeaders();\n\n if (!headers) {\n return {};\n }\n\n return headers.split('\\r\\n').reduce((acc, line) => {\n const [key, value] = line.split(': ');\n acc[key.toLowerCase()] = value;\n return acc;\n }, {});\n}\n\nfunction _getXhrResponseBody(xhr) {\n // We collect errors that happen, but only log them if we can't get any response body\n const errors = [];\n\n try {\n return [xhr.responseText];\n } catch (e) {\n errors.push(e);\n }\n\n // Try to manually parse the response body, if responseText fails\n try {\n return _parseXhrResponse(xhr.response, xhr.responseType);\n } catch (e) {\n errors.push(e);\n }\n\n DEBUG_BUILD && logger.warn('[Replay] Failed to get xhr response body', ...errors);\n\n return [undefined];\n}\n\n/**\n * Get the string representation of the XHR response.\n * Based on MDN, these are the possible types of the response:\n * string\n * ArrayBuffer\n * Blob\n * Document\n * POJO\n *\n * Exported only for tests.\n */\nfunction _parseXhrResponse(\n body,\n responseType,\n) {\n try {\n if (typeof body === 'string') {\n return [body];\n }\n\n if (body instanceof Document) {\n return [body.body.outerHTML];\n }\n\n if (responseType === 'json' && body && typeof body === 'object') {\n return [JSON.stringify(body)];\n }\n\n if (!body) {\n return [undefined];\n }\n } catch (e2) {\n DEBUG_BUILD && logger.warn('[Replay] Failed to serialize body', body);\n return [undefined, 'BODY_PARSE_ERROR'];\n }\n\n DEBUG_BUILD && logger.info('[Replay] Skipping network body because of body type', body);\n\n return [undefined, 'UNPARSEABLE_BODY_TYPE'];\n}\n\nfunction _getBodySize(\n body,\n responseType,\n textEncoder,\n) {\n try {\n const bodyStr = responseType === 'json' && body && typeof body === 'object' ? JSON.stringify(body) : body;\n return getBodySize(bodyStr, textEncoder);\n } catch (e3) {\n return undefined;\n }\n}\n\n/**\n * This method does two things:\n * - It enriches the regular XHR/fetch breadcrumbs with request/response size data\n * - It captures the XHR/fetch breadcrumbs to the replay\n * (enriching it with further data that is _not_ added to the regular breadcrumbs)\n */\nfunction handleNetworkBreadcrumbs(replay) {\n const client = getClient();\n\n try {\n const textEncoder = new TextEncoder();\n\n const {\n networkDetailAllowUrls,\n networkDetailDenyUrls,\n networkCaptureBodies,\n networkRequestHeaders,\n networkResponseHeaders,\n } = replay.getOptions();\n\n const options = {\n replay,\n textEncoder,\n networkDetailAllowUrls,\n networkDetailDenyUrls,\n networkCaptureBodies,\n networkRequestHeaders,\n networkResponseHeaders,\n };\n\n if (client && client.on) {\n client.on('beforeAddBreadcrumb', (breadcrumb, hint) => beforeAddNetworkBreadcrumb(options, breadcrumb, hint));\n } else {\n // Fallback behavior\n addFetchInstrumentationHandler(handleFetchSpanListener(replay));\n addXhrInstrumentationHandler(handleXhrSpanListener(replay));\n }\n } catch (e2) {\n // Do nothing\n }\n}\n\n/** just exported for tests */\nfunction beforeAddNetworkBreadcrumb(\n options,\n breadcrumb,\n hint,\n) {\n if (!breadcrumb.data) {\n return;\n }\n\n try {\n if (_isXhrBreadcrumb(breadcrumb) && _isXhrHint(hint)) {\n // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick\n // Because the hook runs synchronously, and the breadcrumb is afterwards passed on\n // So any async mutations to it will not be reflected in the final breadcrumb\n enrichXhrBreadcrumb(breadcrumb, hint, options);\n\n // This call should not reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n captureXhrBreadcrumbToReplay(breadcrumb, hint, options);\n }\n\n if (_isFetchBreadcrumb(breadcrumb) && _isFetchHint(hint)) {\n // This has to be sync, as we need to ensure the breadcrumb is enriched in the same tick\n // Because the hook runs synchronously, and the breadcrumb is afterwards passed on\n // So any async mutations to it will not be reflected in the final breadcrumb\n enrichFetchBreadcrumb(breadcrumb, hint, options);\n\n // This call should not reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n captureFetchBreadcrumbToReplay(breadcrumb, hint, options);\n }\n } catch (e) {\n DEBUG_BUILD && logger.warn('Error when enriching network breadcrumb');\n }\n}\n\nfunction _isXhrBreadcrumb(breadcrumb) {\n return breadcrumb.category === 'xhr';\n}\n\nfunction _isFetchBreadcrumb(breadcrumb) {\n return breadcrumb.category === 'fetch';\n}\n\nfunction _isXhrHint(hint) {\n return hint && hint.xhr;\n}\n\nfunction _isFetchHint(hint) {\n return hint && hint.response;\n}\n\nlet _LAST_BREADCRUMB = null;\n\nfunction isBreadcrumbWithCategory(breadcrumb) {\n return !!breadcrumb.category;\n}\n\nconst handleScopeListener =\n (replay) =>\n (scope) => {\n if (!replay.isEnabled()) {\n return;\n }\n\n const result = handleScope(scope);\n\n if (!result) {\n return;\n }\n\n addBreadcrumbEvent(replay, result);\n };\n\n/**\n * An event handler to handle scope changes.\n */\nfunction handleScope(scope) {\n // TODO (v8): Remove this guard. This was put in place because we introduced\n // Scope.getLastBreadcrumb mid-v7 which caused incompatibilities with older SDKs.\n // For now, we'll just return null if the method doesn't exist but we should eventually\n // get rid of this guard.\n const newBreadcrumb = scope.getLastBreadcrumb && scope.getLastBreadcrumb();\n\n // Listener can be called when breadcrumbs have not changed, so we store the\n // reference to the last crumb and only return a crumb if it has changed\n if (_LAST_BREADCRUMB === newBreadcrumb || !newBreadcrumb) {\n return null;\n }\n\n _LAST_BREADCRUMB = newBreadcrumb;\n\n if (\n !isBreadcrumbWithCategory(newBreadcrumb) ||\n ['fetch', 'xhr', 'sentry.event', 'sentry.transaction'].includes(newBreadcrumb.category) ||\n newBreadcrumb.category.startsWith('ui.')\n ) {\n return null;\n }\n\n if (newBreadcrumb.category === 'console') {\n return normalizeConsoleBreadcrumb(newBreadcrumb);\n }\n\n return createBreadcrumb(newBreadcrumb);\n}\n\n/** exported for tests only */\nfunction normalizeConsoleBreadcrumb(\n breadcrumb,\n) {\n const args = breadcrumb.data && breadcrumb.data.arguments;\n\n if (!Array.isArray(args) || args.length === 0) {\n return createBreadcrumb(breadcrumb);\n }\n\n let isTruncated = false;\n\n // Avoid giant args captures\n const normalizedArgs = args.map(arg => {\n if (!arg) {\n return arg;\n }\n if (typeof arg === 'string') {\n if (arg.length > CONSOLE_ARG_MAX_SIZE) {\n isTruncated = true;\n return `${arg.slice(0, CONSOLE_ARG_MAX_SIZE)}…`;\n }\n\n return arg;\n }\n if (typeof arg === 'object') {\n try {\n const normalizedArg = normalize(arg, 7);\n const stringified = JSON.stringify(normalizedArg);\n if (stringified.length > CONSOLE_ARG_MAX_SIZE) {\n isTruncated = true;\n // We use the pretty printed JSON string here as a base\n return `${JSON.stringify(normalizedArg, null, 2).slice(0, CONSOLE_ARG_MAX_SIZE)}…`;\n }\n return normalizedArg;\n } catch (e) {\n // fall back to default\n }\n }\n\n return arg;\n });\n\n return createBreadcrumb({\n ...breadcrumb,\n data: {\n ...breadcrumb.data,\n arguments: normalizedArgs,\n ...(isTruncated ? { _meta: { warnings: ['CONSOLE_ARG_TRUNCATED'] } } : {}),\n },\n });\n}\n\n/**\n * Add global listeners that cannot be removed.\n */\nfunction addGlobalListeners(replay) {\n // Listeners from core SDK //\n const scope = getCurrentScope();\n const client = getClient();\n\n scope.addScopeListener(handleScopeListener(replay));\n addClickKeypressInstrumentationHandler(handleDomListener(replay));\n addHistoryInstrumentationHandler(handleHistorySpanListener(replay));\n handleNetworkBreadcrumbs(replay);\n\n // Tag all (non replay) events that get sent to Sentry with the current\n // replay ID so that we can reference them later in the UI\n const eventProcessor = handleGlobalEventListener(replay, !hasHooks(client));\n if (client && client.addEventProcessor) {\n client.addEventProcessor(eventProcessor);\n } else {\n addEventProcessor(eventProcessor);\n }\n\n // If a custom client has no hooks yet, we continue to use the \"old\" implementation\n if (hasHooks(client)) {\n client.on('beforeSendEvent', handleBeforeSendEvent(replay));\n client.on('afterSendEvent', handleAfterSendEvent(replay));\n client.on('createDsc', (dsc) => {\n const replayId = replay.getSessionId();\n // We do not want to set the DSC when in buffer mode, as that means the replay has not been sent (yet)\n if (replayId && replay.isEnabled() && replay.recordingMode === 'session') {\n // Ensure to check that the session is still active - it could have expired in the meanwhile\n const isSessionActive = replay.checkAndHandleExpiredSession();\n if (isSessionActive) {\n dsc.replay_id = replayId;\n }\n }\n });\n\n client.on('startTransaction', transaction => {\n replay.lastTransaction = transaction;\n });\n\n // We may be missing the initial startTransaction due to timing issues,\n // so we capture it on finish again.\n client.on('finishTransaction', transaction => {\n replay.lastTransaction = transaction;\n });\n\n // We want to flush replay\n client.on('beforeSendFeedback', (feedbackEvent, options) => {\n const replayId = replay.getSessionId();\n if (options && options.includeReplay && replay.isEnabled() && replayId) {\n // This should never reject\n if (feedbackEvent.contexts && feedbackEvent.contexts.feedback) {\n feedbackEvent.contexts.feedback.replay_id = replayId;\n }\n }\n });\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction hasHooks(client) {\n return !!(client && client.on);\n}\n\n/**\n * Create a \"span\" for the total amount of memory being used by JS objects\n * (including v8 internal objects).\n */\nasync function addMemoryEntry(replay) {\n // window.performance.memory is a non-standard API and doesn't work on all browsers, so we try-catch this\n try {\n return Promise.all(\n createPerformanceSpans(replay, [\n // @ts-expect-error memory doesn't exist on type Performance as the API is non-standard (we check that it exists above)\n createMemoryEntry(WINDOW.performance.memory),\n ]),\n );\n } catch (error) {\n // Do nothing\n return [];\n }\n}\n\nfunction createMemoryEntry(memoryEntry) {\n const { jsHeapSizeLimit, totalJSHeapSize, usedJSHeapSize } = memoryEntry;\n // we don't want to use `getAbsoluteTime` because it adds the event time to the\n // time origin, so we get the current timestamp instead\n const time = Date.now() / 1000;\n return {\n type: 'memory',\n name: 'memory',\n start: time,\n end: time,\n data: {\n memory: {\n jsHeapSizeLimit,\n totalJSHeapSize,\n usedJSHeapSize,\n },\n },\n };\n}\n\n/**\n * Heavily simplified debounce function based on lodash.debounce.\n *\n * This function takes a callback function (@param fun) and delays its invocation\n * by @param wait milliseconds. Optionally, a maxWait can be specified in @param options,\n * which ensures that the callback is invoked at least once after the specified max. wait time.\n *\n * @param func the function whose invocation is to be debounced\n * @param wait the minimum time until the function is invoked after it was called once\n * @param options the options object, which can contain the `maxWait` property\n *\n * @returns the debounced version of the function, which needs to be called at least once to start the\n * debouncing process. Subsequent calls will reset the debouncing timer and, in case @paramfunc\n * was already invoked in the meantime, return @param func's return value.\n * The debounced function has two additional properties:\n * - `flush`: Invokes the debounced function immediately and returns its return value\n * - `cancel`: Cancels the debouncing process and resets the debouncing timer\n */\nfunction debounce(func, wait, options) {\n let callbackReturnValue;\n\n let timerId;\n let maxTimerId;\n\n const maxWait = options && options.maxWait ? Math.max(options.maxWait, wait) : 0;\n\n function invokeFunc() {\n cancelTimers();\n callbackReturnValue = func();\n return callbackReturnValue;\n }\n\n function cancelTimers() {\n timerId !== undefined && clearTimeout(timerId);\n maxTimerId !== undefined && clearTimeout(maxTimerId);\n timerId = maxTimerId = undefined;\n }\n\n function flush() {\n if (timerId !== undefined || maxTimerId !== undefined) {\n return invokeFunc();\n }\n return callbackReturnValue;\n }\n\n function debounced() {\n if (timerId) {\n clearTimeout(timerId);\n }\n timerId = setTimeout(invokeFunc, wait);\n\n if (maxWait && maxTimerId === undefined) {\n maxTimerId = setTimeout(invokeFunc, maxWait);\n }\n\n return callbackReturnValue;\n }\n\n debounced.cancel = cancelTimers;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Handler for recording events.\n *\n * Adds to event buffer, and has varying flushing behaviors if the event was a checkout.\n */\nfunction getHandleRecordingEmit(replay) {\n let hadFirstEvent = false;\n\n return (event, _isCheckout) => {\n // If this is false, it means session is expired, create and a new session and wait for checkout\n if (!replay.checkAndHandleExpiredSession()) {\n DEBUG_BUILD && logger.warn('[Replay] Received replay event after session expired.');\n\n return;\n }\n\n // `_isCheckout` is only set when the checkout is due to `checkoutEveryNms`\n // We also want to treat the first event as a checkout, so we handle this specifically here\n const isCheckout = _isCheckout || !hadFirstEvent;\n hadFirstEvent = true;\n\n if (replay.clickDetector) {\n updateClickDetectorForRecordingEvent(replay.clickDetector, event);\n }\n\n // The handler returns `true` if we do not want to trigger debounced flush, `false` if we want to debounce flush.\n replay.addUpdate(() => {\n // The session is always started immediately on pageload/init, but for\n // error-only replays, it should reflect the most recent checkout\n // when an error occurs. Clear any state that happens before this current\n // checkout. This needs to happen before `addEvent()` which updates state\n // dependent on this reset.\n if (replay.recordingMode === 'buffer' && isCheckout) {\n replay.setInitialState();\n }\n\n // If the event is not added (e.g. due to being paused, disabled, or out of the max replay duration),\n // Skip all further steps\n if (!addEventSync(replay, event, isCheckout)) {\n // Return true to skip scheduling a debounced flush\n return true;\n }\n\n // Different behavior for full snapshots (type=2), ignore other event types\n // See https://github.com/rrweb-io/rrweb/blob/d8f9290ca496712aa1e7d472549480c4e7876594/packages/rrweb/src/types.ts#L16\n if (!isCheckout) {\n return false;\n }\n\n // Additionally, create a meta event that will capture certain SDK settings.\n // In order to handle buffer mode, this needs to either be done when we\n // receive checkout events or at flush time.\n //\n // `isCheckout` is always true, but want to be explicit that it should\n // only be added for checkouts\n addSettingsEvent(replay, isCheckout);\n\n // If there is a previousSessionId after a full snapshot occurs, then\n // the replay session was started due to session expiration. The new session\n // is started before triggering a new checkout and contains the id\n // of the previous session. Do not immediately flush in this case\n // to avoid capturing only the checkout and instead the replay will\n // be captured if they perform any follow-up actions.\n if (replay.session && replay.session.previousSessionId) {\n return true;\n }\n\n // When in buffer mode, make sure we adjust the session started date to the current earliest event of the buffer\n // this should usually be the timestamp of the checkout event, but to be safe...\n if (replay.recordingMode === 'buffer' && replay.session && replay.eventBuffer) {\n const earliestEvent = replay.eventBuffer.getEarliestTimestamp();\n if (earliestEvent) {\n logInfo(\n `[Replay] Updating session start time to earliest event in buffer to ${new Date(earliestEvent)}`,\n replay.getOptions()._experiments.traceInternals,\n );\n\n replay.session.started = earliestEvent;\n\n if (replay.getOptions().stickySession) {\n saveSession(replay.session);\n }\n }\n }\n\n if (replay.recordingMode === 'session') {\n // If the full snapshot is due to an initial load, we will not have\n // a previous session ID. In this case, we want to buffer events\n // for a set amount of time before flushing. This can help avoid\n // capturing replays of users that immediately close the window.\n\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n void replay.flush();\n }\n\n return true;\n });\n };\n}\n\n/**\n * Exported for tests\n */\nfunction createOptionsEvent(replay) {\n const options = replay.getOptions();\n return {\n type: EventType.Custom,\n timestamp: Date.now(),\n data: {\n tag: 'options',\n payload: {\n shouldRecordCanvas: replay.isRecordingCanvas(),\n sessionSampleRate: options.sessionSampleRate,\n errorSampleRate: options.errorSampleRate,\n useCompressionOption: options.useCompression,\n blockAllMedia: options.blockAllMedia,\n maskAllText: options.maskAllText,\n maskAllInputs: options.maskAllInputs,\n useCompression: replay.eventBuffer ? replay.eventBuffer.type === 'worker' : false,\n networkDetailHasUrls: options.networkDetailAllowUrls.length > 0,\n networkCaptureBodies: options.networkCaptureBodies,\n networkRequestHasHeaders: options.networkRequestHeaders.length > 0,\n networkResponseHasHeaders: options.networkResponseHeaders.length > 0,\n },\n },\n };\n}\n\n/**\n * Add a \"meta\" event that contains a simplified view on current configuration\n * options. This should only be included on the first segment of a recording.\n */\nfunction addSettingsEvent(replay, isCheckout) {\n // Only need to add this event when sending the first segment\n if (!isCheckout || !replay.session || replay.session.segmentId !== 0) {\n return;\n }\n\n addEventSync(replay, createOptionsEvent(replay), false);\n}\n\n/**\n * Create a replay envelope ready to be sent.\n * This includes both the replay event, as well as the recording data.\n */\nfunction createReplayEnvelope(\n replayEvent,\n recordingData,\n dsn,\n tunnel,\n) {\n return createEnvelope(\n createEventEnvelopeHeaders(replayEvent, getSdkMetadataForEnvelopeHeader(replayEvent), tunnel, dsn),\n [\n [{ type: 'replay_event' }, replayEvent],\n [\n {\n type: 'replay_recording',\n // If string then we need to encode to UTF8, otherwise will have\n // wrong size. TextEncoder has similar browser support to\n // MutationObserver, although it does not accept IE11.\n length:\n typeof recordingData === 'string' ? new TextEncoder().encode(recordingData).length : recordingData.length,\n },\n recordingData,\n ],\n ],\n );\n}\n\n/**\n * Prepare the recording data ready to be sent.\n */\nfunction prepareRecordingData({\n recordingData,\n headers,\n}\n\n) {\n let payloadWithSequence;\n\n // XXX: newline is needed to separate sequence id from events\n const replayHeaders = `${JSON.stringify(headers)}\n`;\n\n if (typeof recordingData === 'string') {\n payloadWithSequence = `${replayHeaders}${recordingData}`;\n } else {\n const enc = new TextEncoder();\n // XXX: newline is needed to separate sequence id from events\n const sequence = enc.encode(replayHeaders);\n // Merge the two Uint8Arrays\n payloadWithSequence = new Uint8Array(sequence.length + recordingData.length);\n payloadWithSequence.set(sequence);\n payloadWithSequence.set(recordingData, sequence.length);\n }\n\n return payloadWithSequence;\n}\n\n/**\n * Prepare a replay event & enrich it with the SDK metadata.\n */\nasync function prepareReplayEvent({\n client,\n scope,\n replayId: event_id,\n event,\n}\n\n) {\n const integrations =\n typeof client._integrations === 'object' && client._integrations !== null && !Array.isArray(client._integrations)\n ? Object.keys(client._integrations)\n : undefined;\n\n const eventHint = { event_id, integrations };\n\n if (client.emit) {\n client.emit('preprocessEvent', event, eventHint);\n }\n\n const preparedEvent = (await prepareEvent(\n client.getOptions(),\n event,\n eventHint,\n scope,\n client,\n getIsolationScope(),\n )) ;\n\n // If e.g. a global event processor returned null\n if (!preparedEvent) {\n return null;\n }\n\n // This normally happens in browser client \"_prepareEvent\"\n // but since we do not use this private method from the client, but rather the plain import\n // we need to do this manually.\n preparedEvent.platform = preparedEvent.platform || 'javascript';\n\n // extract the SDK name because `client._prepareEvent` doesn't add it to the event\n const metadata = client.getSdkMetadata && client.getSdkMetadata();\n const { name, version } = (metadata && metadata.sdk) || {};\n\n preparedEvent.sdk = {\n ...preparedEvent.sdk,\n name: name || 'sentry.javascript.unknown',\n version: version || '0.0.0',\n };\n\n return preparedEvent;\n}\n\n/**\n * Send replay attachment using `fetch()`\n */\nasync function sendReplayRequest({\n recordingData,\n replayId,\n segmentId: segment_id,\n eventContext,\n timestamp,\n session,\n}) {\n const preparedRecordingData = prepareRecordingData({\n recordingData,\n headers: {\n segment_id,\n },\n });\n\n const { urls, errorIds, traceIds, initialTimestamp } = eventContext;\n\n const client = getClient();\n const scope = getCurrentScope();\n const transport = client && client.getTransport();\n const dsn = client && client.getDsn();\n\n if (!client || !transport || !dsn || !session.sampled) {\n return;\n }\n\n const baseEvent = {\n type: REPLAY_EVENT_NAME,\n replay_start_timestamp: initialTimestamp / 1000,\n timestamp: timestamp / 1000,\n error_ids: errorIds,\n trace_ids: traceIds,\n urls,\n replay_id: replayId,\n segment_id,\n replay_type: session.sampled,\n };\n\n const replayEvent = await prepareReplayEvent({ scope, client, replayId, event: baseEvent });\n\n if (!replayEvent) {\n // Taken from baseclient's `_processEvent` method, where this is handled for errors/transactions\n client.recordDroppedEvent('event_processor', 'replay', baseEvent);\n logInfo('An event processor returned `null`, will not send event.');\n return;\n }\n\n /*\n For reference, the fully built event looks something like this:\n {\n \"type\": \"replay_event\",\n \"timestamp\": 1670837008.634,\n \"error_ids\": [\n \"errorId\"\n ],\n \"trace_ids\": [\n \"traceId\"\n ],\n \"urls\": [\n \"https://example.com\"\n ],\n \"replay_id\": \"eventId\",\n \"segment_id\": 3,\n \"replay_type\": \"error\",\n \"platform\": \"javascript\",\n \"event_id\": \"eventId\",\n \"environment\": \"production\",\n \"sdk\": {\n \"integrations\": [\n \"BrowserTracing\",\n \"Replay\"\n ],\n \"name\": \"sentry.javascript.browser\",\n \"version\": \"7.25.0\"\n },\n \"sdkProcessingMetadata\": {},\n \"contexts\": {\n },\n }\n */\n\n // Prevent this data (which, if it exists, was used in earlier steps in the processing pipeline) from being sent to\n // sentry. (Note: Our use of this property comes and goes with whatever we might be debugging, whatever hacks we may\n // have temporarily added, etc. Even if we don't happen to be using it at some point in the future, let's not get rid\n // of this `delete`, lest we miss putting it back in the next time the property is in use.)\n delete replayEvent.sdkProcessingMetadata;\n\n const envelope = createReplayEnvelope(replayEvent, preparedRecordingData, dsn, client.getOptions().tunnel);\n\n let response;\n\n try {\n response = await transport.send(envelope);\n } catch (err) {\n const error = new Error(UNABLE_TO_SEND_REPLAY);\n\n try {\n // In case browsers don't allow this property to be writable\n // @ts-expect-error This needs lib es2022 and newer\n error.cause = err;\n } catch (e) {\n // nothing to do\n }\n throw error;\n }\n\n // TODO (v8): we can remove this guard once transport.send's type signature doesn't include void anymore\n if (!response) {\n return response;\n }\n\n // If the status code is invalid, we want to immediately stop & not retry\n if (typeof response.statusCode === 'number' && (response.statusCode < 200 || response.statusCode >= 300)) {\n throw new TransportStatusCodeError(response.statusCode);\n }\n\n const rateLimits = updateRateLimits({}, response);\n if (isRateLimited(rateLimits, 'replay')) {\n throw new RateLimitError(rateLimits);\n }\n\n return response;\n}\n\n/**\n * This error indicates that the transport returned an invalid status code.\n */\nclass TransportStatusCodeError extends Error {\n constructor(statusCode) {\n super(`Transport returned status code ${statusCode}`);\n }\n}\n\n/**\n * This error indicates that we hit a rate limit API error.\n */\nclass RateLimitError extends Error {\n\n constructor(rateLimits) {\n super('Rate limit hit');\n this.rateLimits = rateLimits;\n }\n}\n\n/**\n * Finalize and send the current replay event to Sentry\n */\nasync function sendReplay(\n replayData,\n retryConfig = {\n count: 0,\n interval: RETRY_BASE_INTERVAL,\n },\n) {\n const { recordingData, options } = replayData;\n\n // short circuit if there's no events to upload (this shouldn't happen as _runFlush makes this check)\n if (!recordingData.length) {\n return;\n }\n\n try {\n await sendReplayRequest(replayData);\n return true;\n } catch (err) {\n if (err instanceof TransportStatusCodeError || err instanceof RateLimitError) {\n throw err;\n }\n\n // Capture error for every failed replay\n setContext('Replays', {\n _retryCount: retryConfig.count,\n });\n\n if (DEBUG_BUILD && options._experiments && options._experiments.captureExceptions) {\n captureException(err);\n }\n\n // If an error happened here, it's likely that uploading the attachment\n // failed, we'll can retry with the same events payload\n if (retryConfig.count >= RETRY_MAX_COUNT) {\n const error = new Error(`${UNABLE_TO_SEND_REPLAY} - max retries exceeded`);\n\n try {\n // In case browsers don't allow this property to be writable\n // @ts-expect-error This needs lib es2022 and newer\n error.cause = err;\n } catch (e) {\n // nothing to do\n }\n\n throw error;\n }\n\n // will retry in intervals of 5, 10, 30\n retryConfig.interval *= ++retryConfig.count;\n\n return new Promise((resolve, reject) => {\n setTimeout(async () => {\n try {\n await sendReplay(replayData, retryConfig);\n resolve(true);\n } catch (err) {\n reject(err);\n }\n }, retryConfig.interval);\n });\n }\n}\n\nconst THROTTLED = '__THROTTLED';\nconst SKIPPED = '__SKIPPED';\n\n/**\n * Create a throttled function off a given function.\n * When calling the throttled function, it will call the original function only\n * if it hasn't been called more than `maxCount` times in the last `durationSeconds`.\n *\n * Returns `THROTTLED` if throttled for the first time, after that `SKIPPED`,\n * or else the return value of the original function.\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction throttle(\n fn,\n maxCount,\n durationSeconds,\n) {\n const counter = new Map();\n\n const _cleanup = (now) => {\n const threshold = now - durationSeconds;\n counter.forEach((_value, key) => {\n if (key < threshold) {\n counter.delete(key);\n }\n });\n };\n\n const _getTotalCount = () => {\n return [...counter.values()].reduce((a, b) => a + b, 0);\n };\n\n let isThrottled = false;\n\n return (...rest) => {\n // Date in second-precision, which we use as basis for the throttling\n const now = Math.floor(Date.now() / 1000);\n\n // First, make sure to delete any old entries\n _cleanup(now);\n\n // If already over limit, do nothing\n if (_getTotalCount() >= maxCount) {\n const wasThrottled = isThrottled;\n isThrottled = true;\n return wasThrottled ? SKIPPED : THROTTLED;\n }\n\n isThrottled = false;\n const count = counter.get(now) || 0;\n counter.set(now, count + 1);\n\n return fn(...rest);\n };\n}\n\n/* eslint-disable max-lines */ // TODO: We might want to split this file up\n\n/**\n * The main replay container class, which holds all the state and methods for recording and sending replays.\n */\nclass ReplayContainer {\n\n /**\n * Recording can happen in one of three modes:\n * - session: Record the whole session, sending it continuously\n * - buffer: Always keep the last 60s of recording, requires:\n * - having replaysOnErrorSampleRate > 0 to capture replay when an error occurs\n * - or calling `flush()` to send the replay\n */\n\n /**\n * The current or last active transcation.\n * This is only available when performance is enabled.\n */\n\n /**\n * These are here so we can overwrite them in tests etc.\n * @hidden\n */\n\n /**\n * Options to pass to `rrweb.record()`\n */\n\n /**\n * Timestamp of the last user activity. This lives across sessions.\n */\n\n /**\n * Is the integration currently active?\n */\n\n /**\n * Paused is a state where:\n * - DOM Recording is not listening at all\n * - Nothing will be added to event buffer (e.g. core SDK events)\n */\n\n /**\n * Have we attached listeners to the core SDK?\n * Note we have to track this as there is no way to remove instrumentation handlers.\n */\n\n /**\n * Function to stop recording\n */\n\n /**\n * Internal use for canvas recording options\n */\n\n constructor({\n options,\n recordingOptions,\n }\n\n) {ReplayContainer.prototype.__init.call(this);ReplayContainer.prototype.__init2.call(this);ReplayContainer.prototype.__init3.call(this);ReplayContainer.prototype.__init4.call(this);ReplayContainer.prototype.__init5.call(this);ReplayContainer.prototype.__init6.call(this);\n this.eventBuffer = null;\n this.performanceEntries = [];\n this.replayPerformanceEntries = [];\n this.recordingMode = 'session';\n this.timeouts = {\n sessionIdlePause: SESSION_IDLE_PAUSE_DURATION,\n sessionIdleExpire: SESSION_IDLE_EXPIRE_DURATION,\n } ;\n this._lastActivity = Date.now();\n this._isEnabled = false;\n this._isPaused = false;\n this._hasInitializedCoreListeners = false;\n this._context = {\n errorIds: new Set(),\n traceIds: new Set(),\n urls: [],\n initialTimestamp: Date.now(),\n initialUrl: '',\n };\n\n this._recordingOptions = recordingOptions;\n this._options = options;\n\n this._debouncedFlush = debounce(() => this._flush(), this._options.flushMinDelay, {\n maxWait: this._options.flushMaxDelay,\n });\n\n this._throttledAddEvent = throttle(\n (event, isCheckout) => addEvent(this, event, isCheckout),\n // Max 300 events...\n 300,\n // ... per 5s\n 5,\n );\n\n const { slowClickTimeout, slowClickIgnoreSelectors } = this.getOptions();\n\n const slowClickConfig = slowClickTimeout\n ? {\n threshold: Math.min(SLOW_CLICK_THRESHOLD, slowClickTimeout),\n timeout: slowClickTimeout,\n scrollTimeout: SLOW_CLICK_SCROLL_TIMEOUT,\n ignoreSelector: slowClickIgnoreSelectors ? slowClickIgnoreSelectors.join(',') : '',\n }\n : undefined;\n\n if (slowClickConfig) {\n this.clickDetector = new ClickDetector(this, slowClickConfig);\n }\n }\n\n /** Get the event context. */\n getContext() {\n return this._context;\n }\n\n /** If recording is currently enabled. */\n isEnabled() {\n return this._isEnabled;\n }\n\n /** If recording is currently paused. */\n isPaused() {\n return this._isPaused;\n }\n\n /**\n * Determine if canvas recording is enabled\n */\n isRecordingCanvas() {\n return Boolean(this._canvas);\n }\n\n /** Get the replay integration options. */\n getOptions() {\n return this._options;\n }\n\n /**\n * Initializes the plugin based on sampling configuration. Should not be\n * called outside of constructor.\n */\n initializeSampling(previousSessionId) {\n const { errorSampleRate, sessionSampleRate } = this._options;\n\n // If neither sample rate is > 0, then do nothing - user will need to call one of\n // `start()` or `startBuffering` themselves.\n if (errorSampleRate <= 0 && sessionSampleRate <= 0) {\n return;\n }\n\n // Otherwise if there is _any_ sample rate set, try to load an existing\n // session, or create a new one.\n this._initializeSessionForSampling(previousSessionId);\n\n if (!this.session) {\n // This should not happen, something wrong has occurred\n this._handleException(new Error('Unable to initialize and create session'));\n return;\n }\n\n if (this.session.sampled === false) {\n // This should only occur if `errorSampleRate` is 0 and was unsampled for\n // session-based replay. In this case there is nothing to do.\n return;\n }\n\n // If segmentId > 0, it means we've previously already captured this session\n // In this case, we still want to continue in `session` recording mode\n this.recordingMode = this.session.sampled === 'buffer' && this.session.segmentId === 0 ? 'buffer' : 'session';\n\n logInfoNextTick(\n `[Replay] Starting replay in ${this.recordingMode} mode`,\n this._options._experiments.traceInternals,\n );\n\n this._initializeRecording();\n }\n\n /**\n * Start a replay regardless of sampling rate. Calling this will always\n * create a new session. Will throw an error if replay is already in progress.\n *\n * Creates or loads a session, attaches listeners to varying events (DOM,\n * _performanceObserver, Recording, Sentry SDK, etc)\n */\n start() {\n if (this._isEnabled && this.recordingMode === 'session') {\n throw new Error('Replay recording is already in progress');\n }\n\n if (this._isEnabled && this.recordingMode === 'buffer') {\n throw new Error('Replay buffering is in progress, call `flush()` to save the replay');\n }\n\n logInfoNextTick('[Replay] Starting replay in session mode', this._options._experiments.traceInternals);\n\n // Required as user activity is initially set in\n // constructor, so if `start()` is called after\n // session idle expiration, a replay will not be\n // created due to an idle timeout.\n this._updateUserActivity();\n\n const session = loadOrCreateSession(\n {\n maxReplayDuration: this._options.maxReplayDuration,\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n traceInternals: this._options._experiments.traceInternals,\n },\n {\n stickySession: this._options.stickySession,\n // This is intentional: create a new session-based replay when calling `start()`\n sessionSampleRate: 1,\n allowBuffering: false,\n },\n );\n\n this.session = session;\n\n this._initializeRecording();\n }\n\n /**\n * Start replay buffering. Buffers until `flush()` is called or, if\n * `replaysOnErrorSampleRate` > 0, an error occurs.\n */\n startBuffering() {\n if (this._isEnabled) {\n throw new Error('Replay recording is already in progress');\n }\n\n logInfoNextTick('[Replay] Starting replay in buffer mode', this._options._experiments.traceInternals);\n\n const session = loadOrCreateSession(\n {\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n maxReplayDuration: this._options.maxReplayDuration,\n traceInternals: this._options._experiments.traceInternals,\n },\n {\n stickySession: this._options.stickySession,\n sessionSampleRate: 0,\n allowBuffering: true,\n },\n );\n\n this.session = session;\n\n this.recordingMode = 'buffer';\n this._initializeRecording();\n }\n\n /**\n * Start recording.\n *\n * Note that this will cause a new DOM checkout\n */\n startRecording() {\n try {\n const canvasOptions = this._canvas;\n\n this._stopRecording = record({\n ...this._recordingOptions,\n // When running in error sampling mode, we need to overwrite `checkoutEveryNms`\n // Without this, it would record forever, until an error happens, which we don't want\n // instead, we'll always keep the last 60 seconds of replay before an error happened\n ...(this.recordingMode === 'buffer' && { checkoutEveryNms: BUFFER_CHECKOUT_TIME }),\n emit: getHandleRecordingEmit(this),\n onMutation: this._onMutationHandler,\n ...(canvasOptions\n ? {\n recordCanvas: canvasOptions.recordCanvas,\n getCanvasManager: canvasOptions.getCanvasManager,\n sampling: canvasOptions.sampling,\n dataURLOptions: canvasOptions.dataURLOptions,\n }\n : {}),\n });\n } catch (err) {\n this._handleException(err);\n }\n }\n\n /**\n * Stops the recording, if it was running.\n *\n * Returns true if it was previously stopped, or is now stopped,\n * otherwise false.\n */\n stopRecording() {\n try {\n if (this._stopRecording) {\n this._stopRecording();\n this._stopRecording = undefined;\n }\n\n return true;\n } catch (err) {\n this._handleException(err);\n return false;\n }\n }\n\n /**\n * Currently, this needs to be manually called (e.g. for tests). Sentry SDK\n * does not support a teardown\n */\n async stop({ forceFlush = false, reason } = {}) {\n if (!this._isEnabled) {\n return;\n }\n\n // We can't move `_isEnabled` after awaiting a flush, otherwise we can\n // enter into an infinite loop when `stop()` is called while flushing.\n this._isEnabled = false;\n\n try {\n logInfo(\n `[Replay] Stopping Replay${reason ? ` triggered by ${reason}` : ''}`,\n this._options._experiments.traceInternals,\n );\n\n this._removeListeners();\n this.stopRecording();\n\n this._debouncedFlush.cancel();\n // See comment above re: `_isEnabled`, we \"force\" a flush, ignoring the\n // `_isEnabled` state of the plugin since it was disabled above.\n if (forceFlush) {\n await this._flush({ force: true });\n }\n\n // After flush, destroy event buffer\n this.eventBuffer && this.eventBuffer.destroy();\n this.eventBuffer = null;\n\n // Clear session from session storage, note this means if a new session\n // is started after, it will not have `previousSessionId`\n clearSession(this);\n } catch (err) {\n this._handleException(err);\n }\n }\n\n /**\n * Pause some replay functionality. See comments for `_isPaused`.\n * This differs from stop as this only stops DOM recording, it is\n * not as thorough of a shutdown as `stop()`.\n */\n pause() {\n if (this._isPaused) {\n return;\n }\n\n this._isPaused = true;\n this.stopRecording();\n\n logInfo('[Replay] Pausing replay', this._options._experiments.traceInternals);\n }\n\n /**\n * Resumes recording, see notes for `pause().\n *\n * Note that calling `startRecording()` here will cause a\n * new DOM checkout.`\n */\n resume() {\n if (!this._isPaused || !this._checkSession()) {\n return;\n }\n\n this._isPaused = false;\n this.startRecording();\n\n logInfo('[Replay] Resuming replay', this._options._experiments.traceInternals);\n }\n\n /**\n * If not in \"session\" recording mode, flush event buffer which will create a new replay.\n * Unless `continueRecording` is false, the replay will continue to record and\n * behave as a \"session\"-based replay.\n *\n * Otherwise, queue up a flush.\n */\n async sendBufferedReplayOrFlush({ continueRecording = true } = {}) {\n if (this.recordingMode === 'session') {\n return this.flushImmediate();\n }\n\n const activityTime = Date.now();\n\n logInfo('[Replay] Converting buffer to session', this._options._experiments.traceInternals);\n\n // Allow flush to complete before resuming as a session recording, otherwise\n // the checkout from `startRecording` may be included in the payload.\n // Prefer to keep the error replay as a separate (and smaller) segment\n // than the session replay.\n await this.flushImmediate();\n\n const hasStoppedRecording = this.stopRecording();\n\n if (!continueRecording || !hasStoppedRecording) {\n return;\n }\n\n // To avoid race conditions where this is called multiple times, we check here again that we are still buffering\n if ((this.recordingMode ) === 'session') {\n return;\n }\n\n // Re-start recording in session-mode\n this.recordingMode = 'session';\n\n // Once this session ends, we do not want to refresh it\n if (this.session) {\n this._updateUserActivity(activityTime);\n this._updateSessionActivity(activityTime);\n this._maybeSaveSession();\n }\n\n this.startRecording();\n }\n\n /**\n * We want to batch uploads of replay events. Save events only if\n * `` milliseconds have elapsed since the last event\n * *OR* if `` milliseconds have elapsed.\n *\n * Accepts a callback to perform side-effects and returns true to stop batch\n * processing and hand back control to caller.\n */\n addUpdate(cb) {\n // We need to always run `cb` (e.g. in the case of `this.recordingMode == 'buffer'`)\n const cbResult = cb();\n\n // If this option is turned on then we will only want to call `flush`\n // explicitly\n if (this.recordingMode === 'buffer') {\n return;\n }\n\n // If callback is true, we do not want to continue with flushing -- the\n // caller will need to handle it.\n if (cbResult === true) {\n return;\n }\n\n // addUpdate is called quite frequently - use _debouncedFlush so that it\n // respects the flush delays and does not flush immediately\n this._debouncedFlush();\n }\n\n /**\n * Updates the user activity timestamp and resumes recording. This should be\n * called in an event handler for a user action that we consider as the user\n * being \"active\" (e.g. a mouse click).\n */\n triggerUserActivity() {\n this._updateUserActivity();\n\n // This case means that recording was once stopped due to inactivity.\n // Ensure that recording is resumed.\n if (!this._stopRecording) {\n // Create a new session, otherwise when the user action is flushed, it\n // will get rejected due to an expired session.\n if (!this._checkSession()) {\n return;\n }\n\n // Note: This will cause a new DOM checkout\n this.resume();\n return;\n }\n\n // Otherwise... recording was never suspended, continue as normalish\n this.checkAndHandleExpiredSession();\n\n this._updateSessionActivity();\n }\n\n /**\n * Updates the user activity timestamp *without* resuming\n * recording. Some user events (e.g. keydown) can be create\n * low-value replays that only contain the keypress as a\n * breadcrumb. Instead this would require other events to\n * create a new replay after a session has expired.\n */\n updateUserActivity() {\n this._updateUserActivity();\n this._updateSessionActivity();\n }\n\n /**\n * Only flush if `this.recordingMode === 'session'`\n */\n conditionalFlush() {\n if (this.recordingMode === 'buffer') {\n return Promise.resolve();\n }\n\n return this.flushImmediate();\n }\n\n /**\n * Flush using debounce flush\n */\n flush() {\n return this._debouncedFlush() ;\n }\n\n /**\n * Always flush via `_debouncedFlush` so that we do not have flushes triggered\n * from calling both `flush` and `_debouncedFlush`. Otherwise, there could be\n * cases of mulitple flushes happening closely together.\n */\n flushImmediate() {\n this._debouncedFlush();\n // `.flush` is provided by the debounced function, analogously to lodash.debounce\n return this._debouncedFlush.flush() ;\n }\n\n /**\n * Cancels queued up flushes.\n */\n cancelFlush() {\n this._debouncedFlush.cancel();\n }\n\n /** Get the current sesion (=replay) ID */\n getSessionId() {\n return this.session && this.session.id;\n }\n\n /**\n * Checks if recording should be stopped due to user inactivity. Otherwise\n * check if session is expired and create a new session if so. Triggers a new\n * full snapshot on new session.\n *\n * Returns true if session is not expired, false otherwise.\n * @hidden\n */\n checkAndHandleExpiredSession() {\n // Prevent starting a new session if the last user activity is older than\n // SESSION_IDLE_PAUSE_DURATION. Otherwise non-user activity can trigger a new\n // session+recording. This creates noisy replays that do not have much\n // content in them.\n if (\n this._lastActivity &&\n isExpired(this._lastActivity, this.timeouts.sessionIdlePause) &&\n this.session &&\n this.session.sampled === 'session'\n ) {\n // Pause recording only for session-based replays. Otherwise, resuming\n // will create a new replay and will conflict with users who only choose\n // to record error-based replays only. (e.g. the resumed replay will not\n // contain a reference to an error)\n this.pause();\n return;\n }\n\n // --- There is recent user activity --- //\n // This will create a new session if expired, based on expiry length\n if (!this._checkSession()) {\n // Check session handles the refreshing itself\n return false;\n }\n\n return true;\n }\n\n /**\n * Capture some initial state that can change throughout the lifespan of the\n * replay. This is required because otherwise they would be captured at the\n * first flush.\n */\n setInitialState() {\n const urlPath = `${WINDOW.location.pathname}${WINDOW.location.hash}${WINDOW.location.search}`;\n const url = `${WINDOW.location.origin}${urlPath}`;\n\n this.performanceEntries = [];\n this.replayPerformanceEntries = [];\n\n // Reset _context as well\n this._clearContext();\n\n this._context.initialUrl = url;\n this._context.initialTimestamp = Date.now();\n this._context.urls.push(url);\n }\n\n /**\n * Add a breadcrumb event, that may be throttled.\n * If it was throttled, we add a custom breadcrumb to indicate that.\n */\n throttledAddEvent(\n event,\n isCheckout,\n ) {\n const res = this._throttledAddEvent(event, isCheckout);\n\n // If this is THROTTLED, it means we have throttled the event for the first time\n // In this case, we want to add a breadcrumb indicating that something was skipped\n if (res === THROTTLED) {\n const breadcrumb = createBreadcrumb({\n category: 'replay.throttled',\n });\n\n this.addUpdate(() => {\n // Return `false` if the event _was_ added, as that means we schedule a flush\n return !addEventSync(this, {\n type: ReplayEventTypeCustom,\n timestamp: breadcrumb.timestamp || 0,\n data: {\n tag: 'breadcrumb',\n payload: breadcrumb,\n metric: true,\n },\n });\n });\n }\n\n return res;\n }\n\n /**\n * This will get the parametrized route name of the current page.\n * This is only available if performance is enabled, and if an instrumented router is used.\n */\n getCurrentRoute() {\n // eslint-disable-next-line deprecation/deprecation\n const lastTransaction = this.lastTransaction || getCurrentScope().getTransaction();\n\n const attributes = (lastTransaction && spanToJSON(lastTransaction).data) || {};\n const source = attributes[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE];\n if (!lastTransaction || !source || !['route', 'custom'].includes(source)) {\n return undefined;\n }\n\n return spanToJSON(lastTransaction).description;\n }\n\n /**\n * Initialize and start all listeners to varying events (DOM,\n * Performance Observer, Recording, Sentry SDK, etc)\n */\n _initializeRecording() {\n this.setInitialState();\n\n // this method is generally called on page load or manually - in both cases\n // we should treat it as an activity\n this._updateSessionActivity();\n\n this.eventBuffer = createEventBuffer({\n useCompression: this._options.useCompression,\n workerUrl: this._options.workerUrl,\n });\n\n this._removeListeners();\n this._addListeners();\n\n // Need to set as enabled before we start recording, as `record()` can trigger a flush with a new checkout\n this._isEnabled = true;\n this._isPaused = false;\n\n this.startRecording();\n }\n\n /** A wrapper to conditionally capture exceptions. */\n _handleException(error) {\n DEBUG_BUILD && logger.error('[Replay]', error);\n\n if (DEBUG_BUILD && this._options._experiments && this._options._experiments.captureExceptions) {\n captureException(error);\n }\n }\n\n /**\n * Loads (or refreshes) the current session.\n */\n _initializeSessionForSampling(previousSessionId) {\n // Whenever there is _any_ error sample rate, we always allow buffering\n // Because we decide on sampling when an error occurs, we need to buffer at all times if sampling for errors\n const allowBuffering = this._options.errorSampleRate > 0;\n\n const session = loadOrCreateSession(\n {\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n maxReplayDuration: this._options.maxReplayDuration,\n traceInternals: this._options._experiments.traceInternals,\n previousSessionId,\n },\n {\n stickySession: this._options.stickySession,\n sessionSampleRate: this._options.sessionSampleRate,\n allowBuffering,\n },\n );\n\n this.session = session;\n }\n\n /**\n * Checks and potentially refreshes the current session.\n * Returns false if session is not recorded.\n */\n _checkSession() {\n // If there is no session yet, we do not want to refresh anything\n // This should generally not happen, but to be safe....\n if (!this.session) {\n return false;\n }\n\n const currentSession = this.session;\n\n if (\n shouldRefreshSession(currentSession, {\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n maxReplayDuration: this._options.maxReplayDuration,\n })\n ) {\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this._refreshSession(currentSession);\n return false;\n }\n\n return true;\n }\n\n /**\n * Refresh a session with a new one.\n * This stops the current session (without forcing a flush, as that would never work since we are expired),\n * and then does a new sampling based on the refreshed session.\n */\n async _refreshSession(session) {\n if (!this._isEnabled) {\n return;\n }\n await this.stop({ reason: 'refresh session' });\n this.initializeSampling(session.id);\n }\n\n /**\n * Adds listeners to record events for the replay\n */\n _addListeners() {\n try {\n WINDOW.document.addEventListener('visibilitychange', this._handleVisibilityChange);\n WINDOW.addEventListener('blur', this._handleWindowBlur);\n WINDOW.addEventListener('focus', this._handleWindowFocus);\n WINDOW.addEventListener('keydown', this._handleKeyboardEvent);\n\n if (this.clickDetector) {\n this.clickDetector.addListeners();\n }\n\n // There is no way to remove these listeners, so ensure they are only added once\n if (!this._hasInitializedCoreListeners) {\n addGlobalListeners(this);\n\n this._hasInitializedCoreListeners = true;\n }\n } catch (err) {\n this._handleException(err);\n }\n\n this._performanceCleanupCallback = setupPerformanceObserver(this);\n }\n\n /**\n * Cleans up listeners that were created in `_addListeners`\n */\n _removeListeners() {\n try {\n WINDOW.document.removeEventListener('visibilitychange', this._handleVisibilityChange);\n\n WINDOW.removeEventListener('blur', this._handleWindowBlur);\n WINDOW.removeEventListener('focus', this._handleWindowFocus);\n WINDOW.removeEventListener('keydown', this._handleKeyboardEvent);\n\n if (this.clickDetector) {\n this.clickDetector.removeListeners();\n }\n\n if (this._performanceCleanupCallback) {\n this._performanceCleanupCallback();\n }\n } catch (err) {\n this._handleException(err);\n }\n }\n\n /**\n * Handle when visibility of the page content changes. Opening a new tab will\n * cause the state to change to hidden because of content of current page will\n * be hidden. Likewise, moving a different window to cover the contents of the\n * page will also trigger a change to a hidden state.\n */\n __init() {this._handleVisibilityChange = () => {\n if (WINDOW.document.visibilityState === 'visible') {\n this._doChangeToForegroundTasks();\n } else {\n this._doChangeToBackgroundTasks();\n }\n };}\n\n /**\n * Handle when page is blurred\n */\n __init2() {this._handleWindowBlur = () => {\n const breadcrumb = createBreadcrumb({\n category: 'ui.blur',\n });\n\n // Do not count blur as a user action -- it's part of the process of them\n // leaving the page\n this._doChangeToBackgroundTasks(breadcrumb);\n };}\n\n /**\n * Handle when page is focused\n */\n __init3() {this._handleWindowFocus = () => {\n const breadcrumb = createBreadcrumb({\n category: 'ui.focus',\n });\n\n // Do not count focus as a user action -- instead wait until they focus and\n // interactive with page\n this._doChangeToForegroundTasks(breadcrumb);\n };}\n\n /** Ensure page remains active when a key is pressed. */\n __init4() {this._handleKeyboardEvent = (event) => {\n handleKeyboardEvent(this, event);\n };}\n\n /**\n * Tasks to run when we consider a page to be hidden (via blurring and/or visibility)\n */\n _doChangeToBackgroundTasks(breadcrumb) {\n if (!this.session) {\n return;\n }\n\n const expired = isSessionExpired(this.session, {\n maxReplayDuration: this._options.maxReplayDuration,\n sessionIdleExpire: this.timeouts.sessionIdleExpire,\n });\n\n if (expired) {\n return;\n }\n\n if (breadcrumb) {\n this._createCustomBreadcrumb(breadcrumb);\n }\n\n // Send replay when the page/tab becomes hidden. There is no reason to send\n // replay if it becomes visible, since no actions we care about were done\n // while it was hidden\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n void this.conditionalFlush();\n }\n\n /**\n * Tasks to run when we consider a page to be visible (via focus and/or visibility)\n */\n _doChangeToForegroundTasks(breadcrumb) {\n if (!this.session) {\n return;\n }\n\n const isSessionActive = this.checkAndHandleExpiredSession();\n\n if (!isSessionActive) {\n // If the user has come back to the page within SESSION_IDLE_PAUSE_DURATION\n // ms, we will re-use the existing session, otherwise create a new\n // session\n logInfo('[Replay] Document has become active, but session has expired');\n return;\n }\n\n if (breadcrumb) {\n this._createCustomBreadcrumb(breadcrumb);\n }\n }\n\n /**\n * Update user activity (across session lifespans)\n */\n _updateUserActivity(_lastActivity = Date.now()) {\n this._lastActivity = _lastActivity;\n }\n\n /**\n * Updates the session's last activity timestamp\n */\n _updateSessionActivity(_lastActivity = Date.now()) {\n if (this.session) {\n this.session.lastActivity = _lastActivity;\n this._maybeSaveSession();\n }\n }\n\n /**\n * Helper to create (and buffer) a replay breadcrumb from a core SDK breadcrumb\n */\n _createCustomBreadcrumb(breadcrumb) {\n this.addUpdate(() => {\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.throttledAddEvent({\n type: EventType.Custom,\n timestamp: breadcrumb.timestamp || 0,\n data: {\n tag: 'breadcrumb',\n payload: breadcrumb,\n },\n });\n });\n }\n\n /**\n * Observed performance events are added to `this.performanceEntries`. These\n * are included in the replay event before it is finished and sent to Sentry.\n */\n _addPerformanceEntries() {\n const performanceEntries = createPerformanceEntries(this.performanceEntries).concat(this.replayPerformanceEntries);\n\n this.performanceEntries = [];\n this.replayPerformanceEntries = [];\n\n return Promise.all(createPerformanceSpans(this, performanceEntries));\n }\n\n /**\n * Clear _context\n */\n _clearContext() {\n // XXX: `initialTimestamp` and `initialUrl` do not get cleared\n this._context.errorIds.clear();\n this._context.traceIds.clear();\n this._context.urls = [];\n }\n\n /** Update the initial timestamp based on the buffer content. */\n _updateInitialTimestampFromEventBuffer() {\n const { session, eventBuffer } = this;\n if (!session || !eventBuffer) {\n return;\n }\n\n // we only ever update this on the initial segment\n if (session.segmentId) {\n return;\n }\n\n const earliestEvent = eventBuffer.getEarliestTimestamp();\n if (earliestEvent && earliestEvent < this._context.initialTimestamp) {\n this._context.initialTimestamp = earliestEvent;\n }\n }\n\n /**\n * Return and clear _context\n */\n _popEventContext() {\n const _context = {\n initialTimestamp: this._context.initialTimestamp,\n initialUrl: this._context.initialUrl,\n errorIds: Array.from(this._context.errorIds),\n traceIds: Array.from(this._context.traceIds),\n urls: this._context.urls,\n };\n\n this._clearContext();\n\n return _context;\n }\n\n /**\n * Flushes replay event buffer to Sentry.\n *\n * Performance events are only added right before flushing - this is\n * due to the buffered performance observer events.\n *\n * Should never be called directly, only by `flush`\n */\n async _runFlush() {\n const replayId = this.getSessionId();\n\n if (!this.session || !this.eventBuffer || !replayId) {\n DEBUG_BUILD && logger.error('[Replay] No session or eventBuffer found to flush.');\n return;\n }\n\n await this._addPerformanceEntries();\n\n // Check eventBuffer again, as it could have been stopped in the meanwhile\n if (!this.eventBuffer || !this.eventBuffer.hasEvents) {\n return;\n }\n\n // Only attach memory event if eventBuffer is not empty\n await addMemoryEntry(this);\n\n // Check eventBuffer again, as it could have been stopped in the meanwhile\n if (!this.eventBuffer) {\n return;\n }\n\n // if this changed in the meanwhile, e.g. because the session was refreshed or similar, we abort here\n if (replayId !== this.getSessionId()) {\n return;\n }\n\n try {\n // This uses the data from the eventBuffer, so we need to call this before `finish()\n this._updateInitialTimestampFromEventBuffer();\n\n const timestamp = Date.now();\n\n // Check total duration again, to avoid sending outdated stuff\n // We leave 30s wiggle room to accomodate late flushing etc.\n // This _could_ happen when the browser is suspended during flushing, in which case we just want to stop\n if (timestamp - this._context.initialTimestamp > this._options.maxReplayDuration + 30000) {\n throw new Error('Session is too long, not sending replay');\n }\n\n const eventContext = this._popEventContext();\n // Always increment segmentId regardless of outcome of sending replay\n const segmentId = this.session.segmentId++;\n this._maybeSaveSession();\n\n // Note this empties the event buffer regardless of outcome of sending replay\n const recordingData = await this.eventBuffer.finish();\n\n await sendReplay({\n replayId,\n recordingData,\n segmentId,\n eventContext,\n session: this.session,\n options: this.getOptions(),\n timestamp,\n });\n } catch (err) {\n this._handleException(err);\n\n // This means we retried 3 times and all of them failed,\n // or we ran into a problem we don't want to retry, like rate limiting.\n // In this case, we want to completely stop the replay - otherwise, we may get inconsistent segments\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.stop({ reason: 'sendReplay' });\n\n const client = getClient();\n\n if (client) {\n client.recordDroppedEvent('send_error', 'replay');\n }\n }\n }\n\n /**\n * Flush recording data to Sentry. Creates a lock so that only a single flush\n * can be active at a time. Do not call this directly.\n */\n __init5() {this._flush = async ({\n force = false,\n }\n\n = {}) => {\n if (!this._isEnabled && !force) {\n // This can happen if e.g. the replay was stopped because of exceeding the retry limit\n return;\n }\n\n if (!this.checkAndHandleExpiredSession()) {\n DEBUG_BUILD && logger.error('[Replay] Attempting to finish replay event after session expired.');\n return;\n }\n\n if (!this.session) {\n // should never happen, as we would have bailed out before\n return;\n }\n\n const start = this.session.started;\n const now = Date.now();\n const duration = now - start;\n\n // A flush is about to happen, cancel any queued flushes\n this._debouncedFlush.cancel();\n\n // If session is too short, or too long (allow some wiggle room over maxReplayDuration), do not send it\n // This _should_ not happen, but it may happen if flush is triggered due to a page activity change or similar\n const tooShort = duration < this._options.minReplayDuration;\n const tooLong = duration > this._options.maxReplayDuration + 5000;\n if (tooShort || tooLong) {\n logInfo(\n `[Replay] Session duration (${Math.floor(duration / 1000)}s) is too ${\n tooShort ? 'short' : 'long'\n }, not sending replay.`,\n this._options._experiments.traceInternals,\n );\n\n if (tooShort) {\n this._debouncedFlush();\n }\n return;\n }\n\n const eventBuffer = this.eventBuffer;\n if (eventBuffer && this.session.segmentId === 0 && !eventBuffer.hasCheckout) {\n logInfo('[Replay] Flushing initial segment without checkout.', this._options._experiments.traceInternals);\n // TODO FN: Evaluate if we want to stop here, or remove this again?\n }\n\n // this._flushLock acts as a lock so that future calls to `_flush()`\n // will be blocked until this promise resolves\n if (!this._flushLock) {\n this._flushLock = this._runFlush();\n await this._flushLock;\n this._flushLock = undefined;\n return;\n }\n\n // Wait for previous flush to finish, then call the debounced `_flush()`.\n // It's possible there are other flush requests queued and waiting for it\n // to resolve. We want to reduce all outstanding requests (as well as any\n // new flush requests that occur within a second of the locked flush\n // completing) into a single flush.\n\n try {\n await this._flushLock;\n } catch (err) {\n DEBUG_BUILD && logger.error(err);\n } finally {\n this._debouncedFlush();\n }\n };}\n\n /** Save the session, if it is sticky */\n _maybeSaveSession() {\n if (this.session && this._options.stickySession) {\n saveSession(this.session);\n }\n }\n\n /** Handler for rrweb.record.onMutation */\n __init6() {this._onMutationHandler = (mutations) => {\n const count = mutations.length;\n\n const mutationLimit = this._options.mutationLimit;\n const mutationBreadcrumbLimit = this._options.mutationBreadcrumbLimit;\n const overMutationLimit = mutationLimit && count > mutationLimit;\n\n // Create a breadcrumb if a lot of mutations happen at the same time\n // We can show this in the UI as an information with potential performance improvements\n if (count > mutationBreadcrumbLimit || overMutationLimit) {\n const breadcrumb = createBreadcrumb({\n category: 'replay.mutations',\n data: {\n count,\n limit: overMutationLimit,\n },\n });\n this._createCustomBreadcrumb(breadcrumb);\n }\n\n // Stop replay if over the mutation limit\n if (overMutationLimit) {\n // This should never reject\n // eslint-disable-next-line @typescript-eslint/no-floating-promises\n this.stop({ reason: 'mutationLimit', forceFlush: this.recordingMode === 'session' });\n return false;\n }\n\n // `true` means we use the regular mutation handling by rrweb\n return true;\n };}\n}\n\nfunction getOption(\n selectors,\n defaultSelectors,\n deprecatedClassOption,\n deprecatedSelectorOption,\n) {\n const deprecatedSelectors = typeof deprecatedSelectorOption === 'string' ? deprecatedSelectorOption.split(',') : [];\n\n const allSelectors = [\n ...selectors,\n // @deprecated\n ...deprecatedSelectors,\n\n // sentry defaults\n ...defaultSelectors,\n ];\n\n // @deprecated\n if (typeof deprecatedClassOption !== 'undefined') {\n // NOTE: No support for RegExp\n if (typeof deprecatedClassOption === 'string') {\n allSelectors.push(`.${deprecatedClassOption}`);\n }\n\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n '[Replay] You are using a deprecated configuration item for privacy. Read the documentation on how to use the new privacy configuration.',\n );\n });\n }\n\n return allSelectors.join(',');\n}\n\n/**\n * Returns privacy related configuration for use in rrweb\n */\nfunction getPrivacyOptions({\n mask,\n unmask,\n block,\n unblock,\n ignore,\n\n // eslint-disable-next-line deprecation/deprecation\n blockClass,\n // eslint-disable-next-line deprecation/deprecation\n blockSelector,\n // eslint-disable-next-line deprecation/deprecation\n maskTextClass,\n // eslint-disable-next-line deprecation/deprecation\n maskTextSelector,\n // eslint-disable-next-line deprecation/deprecation\n ignoreClass,\n}) {\n const defaultBlockedElements = ['base[href=\"/\"]'];\n\n const maskSelector = getOption(mask, ['.sentry-mask', '[data-sentry-mask]'], maskTextClass, maskTextSelector);\n const unmaskSelector = getOption(unmask, ['.sentry-unmask', '[data-sentry-unmask]']);\n\n const options = {\n // We are making the decision to make text and input selectors the same\n maskTextSelector: maskSelector,\n unmaskTextSelector: unmaskSelector,\n\n blockSelector: getOption(\n block,\n ['.sentry-block', '[data-sentry-block]', ...defaultBlockedElements],\n blockClass,\n blockSelector,\n ),\n unblockSelector: getOption(unblock, ['.sentry-unblock', '[data-sentry-unblock]']),\n ignoreSelector: getOption(ignore, ['.sentry-ignore', '[data-sentry-ignore]', 'input[type=\"file\"]'], ignoreClass),\n };\n\n if (blockClass instanceof RegExp) {\n options.blockClass = blockClass;\n }\n\n if (maskTextClass instanceof RegExp) {\n options.maskTextClass = maskTextClass;\n }\n\n return options;\n}\n\n/**\n * Masks an attribute if necessary, otherwise return attribute value as-is.\n */\nfunction maskAttribute({\n el,\n key,\n maskAttributes,\n maskAllText,\n privacyOptions,\n value,\n}) {\n // We only mask attributes if `maskAllText` is true\n if (!maskAllText) {\n return value;\n }\n\n // unmaskTextSelector takes precendence\n if (privacyOptions.unmaskTextSelector && el.matches(privacyOptions.unmaskTextSelector)) {\n return value;\n }\n\n if (\n maskAttributes.includes(key) ||\n // Need to mask `value` attribute for `` if it's a button-like\n // type\n (key === 'value' && el.tagName === 'INPUT' && ['submit', 'button'].includes(el.getAttribute('type') || ''))\n ) {\n return value.replace(/[\\S]/g, '*');\n }\n\n return value;\n}\n\nconst MEDIA_SELECTORS =\n 'img,image,svg,video,object,picture,embed,map,audio,link[rel=\"icon\"],link[rel=\"apple-touch-icon\"]';\n\nconst DEFAULT_NETWORK_HEADERS = ['content-length', 'content-type', 'accept'];\n\nlet _initialized = false;\n\nconst replayIntegration$1 = ((options) => {\n // eslint-disable-next-line deprecation/deprecation\n return new Replay$1(options);\n}) ;\n\n/**\n * The main replay integration class, to be passed to `init({ integrations: [] })`.\n * @deprecated Use `replayIntegration()` instead.\n */\nclass Replay$1 {\n /**\n * @inheritDoc\n */\n static __initStatic() {this.id = 'Replay';}\n\n /**\n * @inheritDoc\n */\n\n /**\n * Options to pass to `rrweb.record()`\n */\n\n /**\n * Initial options passed to the replay integration, merged with default values.\n * Note: `sessionSampleRate` and `errorSampleRate` are not required here, as they\n * can only be finally set when setupOnce() is called.\n *\n * @private\n */\n\n constructor({\n flushMinDelay = DEFAULT_FLUSH_MIN_DELAY,\n flushMaxDelay = DEFAULT_FLUSH_MAX_DELAY,\n minReplayDuration = MIN_REPLAY_DURATION,\n maxReplayDuration = MAX_REPLAY_DURATION,\n stickySession = true,\n useCompression = true,\n workerUrl,\n _experiments = {},\n sessionSampleRate,\n errorSampleRate,\n maskAllText = true,\n maskAllInputs = true,\n blockAllMedia = true,\n\n mutationBreadcrumbLimit = 750,\n mutationLimit = 10000,\n\n slowClickTimeout = 7000,\n slowClickIgnoreSelectors = [],\n\n networkDetailAllowUrls = [],\n networkDetailDenyUrls = [],\n networkCaptureBodies = true,\n networkRequestHeaders = [],\n networkResponseHeaders = [],\n\n mask = [],\n maskAttributes = ['title', 'placeholder'],\n unmask = [],\n block = [],\n unblock = [],\n ignore = [],\n maskFn,\n\n beforeAddRecordingEvent,\n beforeErrorSampling,\n\n // eslint-disable-next-line deprecation/deprecation\n blockClass,\n // eslint-disable-next-line deprecation/deprecation\n blockSelector,\n // eslint-disable-next-line deprecation/deprecation\n maskInputOptions,\n // eslint-disable-next-line deprecation/deprecation\n maskTextClass,\n // eslint-disable-next-line deprecation/deprecation\n maskTextSelector,\n // eslint-disable-next-line deprecation/deprecation\n ignoreClass,\n } = {}) {\n // eslint-disable-next-line deprecation/deprecation\n this.name = Replay$1.id;\n\n const privacyOptions = getPrivacyOptions({\n mask,\n unmask,\n block,\n unblock,\n ignore,\n blockClass,\n blockSelector,\n maskTextClass,\n maskTextSelector,\n ignoreClass,\n });\n\n this._recordingOptions = {\n maskAllInputs,\n maskAllText,\n maskInputOptions: { ...(maskInputOptions || {}), password: true },\n maskTextFn: maskFn,\n maskInputFn: maskFn,\n maskAttributeFn: (key, value, el) =>\n maskAttribute({\n maskAttributes,\n maskAllText,\n privacyOptions,\n key,\n value,\n el,\n }),\n\n ...privacyOptions,\n\n // Our defaults\n slimDOMOptions: 'all',\n inlineStylesheet: true,\n // Disable inline images as it will increase segment/replay size\n inlineImages: false,\n // collect fonts, but be aware that `sentry.io` needs to be an allowed\n // origin for playback\n collectFonts: true,\n errorHandler: (err) => {\n try {\n err.__rrweb__ = true;\n } catch (error) {\n // ignore errors here\n // this can happen if the error is frozen or does not allow mutation for other reasons\n }\n },\n };\n\n this._initialOptions = {\n flushMinDelay,\n flushMaxDelay,\n minReplayDuration: Math.min(minReplayDuration, MIN_REPLAY_DURATION_LIMIT),\n maxReplayDuration: Math.min(maxReplayDuration, MAX_REPLAY_DURATION),\n stickySession,\n sessionSampleRate,\n errorSampleRate,\n useCompression,\n workerUrl,\n blockAllMedia,\n maskAllInputs,\n maskAllText,\n mutationBreadcrumbLimit,\n mutationLimit,\n slowClickTimeout,\n slowClickIgnoreSelectors,\n networkDetailAllowUrls,\n networkDetailDenyUrls,\n networkCaptureBodies,\n networkRequestHeaders: _getMergedNetworkHeaders(networkRequestHeaders),\n networkResponseHeaders: _getMergedNetworkHeaders(networkResponseHeaders),\n beforeAddRecordingEvent,\n beforeErrorSampling,\n\n _experiments,\n };\n\n if (typeof sessionSampleRate === 'number') {\n // eslint-disable-next-line\n console.warn(\n `[Replay] You are passing \\`sessionSampleRate\\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \\`replaysSessionSampleRate\\` directly in the SDK init options, e.g.:\nSentry.init({ replaysSessionSampleRate: ${sessionSampleRate} })`,\n );\n\n this._initialOptions.sessionSampleRate = sessionSampleRate;\n }\n\n if (typeof errorSampleRate === 'number') {\n // eslint-disable-next-line\n console.warn(\n `[Replay] You are passing \\`errorSampleRate\\` to the Replay integration.\nThis option is deprecated and will be removed soon.\nInstead, configure \\`replaysOnErrorSampleRate\\` directly in the SDK init options, e.g.:\nSentry.init({ replaysOnErrorSampleRate: ${errorSampleRate} })`,\n );\n\n this._initialOptions.errorSampleRate = errorSampleRate;\n }\n\n if (this._initialOptions.blockAllMedia) {\n // `blockAllMedia` is a more user friendly option to configure blocking\n // embedded media elements\n this._recordingOptions.blockSelector = !this._recordingOptions.blockSelector\n ? MEDIA_SELECTORS\n : `${this._recordingOptions.blockSelector},${MEDIA_SELECTORS}`;\n }\n\n if (this._isInitialized && isBrowser()) {\n throw new Error('Multiple Sentry Session Replay instances are not supported');\n }\n\n this._isInitialized = true;\n }\n\n /** If replay has already been initialized */\n get _isInitialized() {\n return _initialized;\n }\n\n /** Update _isInitialized */\n set _isInitialized(value) {\n _initialized = value;\n }\n\n /**\n * Setup and initialize replay container\n */\n setupOnce() {\n if (!isBrowser()) {\n return;\n }\n\n this._setup();\n\n // Once upon a time, we tried to create a transaction in `setupOnce` and it would\n // potentially create a transaction before some native SDK integrations have run\n // and applied their own global event processor. An example is:\n // https://github.com/getsentry/sentry-javascript/blob/b47ceafbdac7f8b99093ce6023726ad4687edc48/packages/browser/src/integrations/useragent.ts\n //\n // So we call `this._initialize()` in next event loop as a workaround to wait for other\n // global event processors to finish. This is no longer needed, but keeping it\n // here to avoid any future issues.\n setTimeout(() => this._initialize());\n }\n\n /**\n * Start a replay regardless of sampling rate. Calling this will always\n * create a new session. Will throw an error if replay is already in progress.\n *\n * Creates or loads a session, attaches listeners to varying events (DOM,\n * PerformanceObserver, Recording, Sentry SDK, etc)\n */\n start() {\n if (!this._replay) {\n return;\n }\n\n this._replay.start();\n }\n\n /**\n * Start replay buffering. Buffers until `flush()` is called or, if\n * `replaysOnErrorSampleRate` > 0, until an error occurs.\n */\n startBuffering() {\n if (!this._replay) {\n return;\n }\n\n this._replay.startBuffering();\n }\n\n /**\n * Currently, this needs to be manually called (e.g. for tests). Sentry SDK\n * does not support a teardown\n */\n stop() {\n if (!this._replay) {\n return Promise.resolve();\n }\n\n return this._replay.stop({ forceFlush: this._replay.recordingMode === 'session' });\n }\n\n /**\n * If not in \"session\" recording mode, flush event buffer which will create a new replay.\n * Unless `continueRecording` is false, the replay will continue to record and\n * behave as a \"session\"-based replay.\n *\n * Otherwise, queue up a flush.\n */\n flush(options) {\n if (!this._replay || !this._replay.isEnabled()) {\n return Promise.resolve();\n }\n\n return this._replay.sendBufferedReplayOrFlush(options);\n }\n\n /**\n * Get the current session ID.\n */\n getReplayId() {\n if (!this._replay || !this._replay.isEnabled()) {\n return;\n }\n\n return this._replay.getSessionId();\n }\n\n /**\n * Initializes replay.\n */\n _initialize() {\n if (!this._replay) {\n return;\n }\n\n // We have to run this in _initialize, because this runs in setTimeout\n // So when this runs all integrations have been added\n // Before this, we cannot access integrations on the client,\n // so we need to mutate the options here\n this._maybeLoadFromReplayCanvasIntegration();\n\n this._replay.initializeSampling();\n }\n\n /** Setup the integration. */\n _setup() {\n // Client is not available in constructor, so we need to wait until setupOnce\n const finalOptions = loadReplayOptionsFromClient(this._initialOptions);\n\n this._replay = new ReplayContainer({\n options: finalOptions,\n recordingOptions: this._recordingOptions,\n });\n }\n\n /** Get canvas options from ReplayCanvas integration, if it is also added. */\n _maybeLoadFromReplayCanvasIntegration() {\n // To save bundle size, we skip checking for stuff here\n // and instead just try-catch everything - as generally this should all be defined\n /* eslint-disable @typescript-eslint/no-non-null-assertion */\n try {\n const client = getClient();\n const canvasIntegration = client.getIntegrationByName('ReplayCanvas')\n\n;\n if (!canvasIntegration) {\n return;\n }\n\n this._replay['_canvas'] = canvasIntegration.getOptions();\n } catch (e) {\n // ignore errors here\n }\n /* eslint-enable @typescript-eslint/no-non-null-assertion */\n }\n}Replay$1.__initStatic();\n\n/** Parse Replay-related options from SDK options */\nfunction loadReplayOptionsFromClient(initialOptions) {\n const client = getClient();\n const opt = client && (client.getOptions() );\n\n const finalOptions = { sessionSampleRate: 0, errorSampleRate: 0, ...dropUndefinedKeys(initialOptions) };\n\n if (!opt) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn('SDK client is not available.');\n });\n return finalOptions;\n }\n\n if (\n initialOptions.sessionSampleRate == null && // TODO remove once deprecated rates are removed\n initialOptions.errorSampleRate == null && // TODO remove once deprecated rates are removed\n opt.replaysSessionSampleRate == null &&\n opt.replaysOnErrorSampleRate == null\n ) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n 'Replay is disabled because neither `replaysSessionSampleRate` nor `replaysOnErrorSampleRate` are set.',\n );\n });\n }\n\n if (typeof opt.replaysSessionSampleRate === 'number') {\n finalOptions.sessionSampleRate = opt.replaysSessionSampleRate;\n }\n\n if (typeof opt.replaysOnErrorSampleRate === 'number') {\n finalOptions.errorSampleRate = opt.replaysOnErrorSampleRate;\n }\n\n return finalOptions;\n}\n\nfunction _getMergedNetworkHeaders(headers) {\n return [...DEFAULT_NETWORK_HEADERS, ...headers.map(header => header.toLowerCase())];\n}\n\n/**\n * This is a small utility to get a type-safe instance of the Replay integration.\n */\n// eslint-disable-next-line deprecation/deprecation\nfunction getReplay$1() {\n const client = getClient();\n return (\n client && client.getIntegrationByName && client.getIntegrationByName('Replay')\n );\n}\n\n// eslint-disable-next-line deprecation/deprecation\n\n/** @deprecated Use the export from `@sentry/replay` or from framework-specific SDKs like `@sentry/react` or `@sentry/vue` */\nconst getReplay = getReplay$1;\n\n/** @deprecated Use the export from `@sentry/replay` or from framework-specific SDKs like `@sentry/react` or `@sentry/vue` */\nconst replayIntegration = replayIntegration$1;\n\n/** @deprecated Use the export from `@sentry/replay` or from framework-specific SDKs like `@sentry/react` or `@sentry/vue` */\n// eslint-disable-next-line deprecation/deprecation\nclass Replay extends Replay$1 {}\n\nexport { Replay$1 as InternalReplay, Replay, getReplay, getReplay$1 as internalGetReplay, replayIntegration$1 as internalReplayIntegration, replayIntegration };\n//# sourceMappingURL=index.js.map\n","import { init as init$1 } from '@sentry/browser';\nimport { applySdkMetadata } from '@sentry/core';\n\n/**\n * Inits the React SDK\n */\nfunction init(options) {\n const opts = {\n ...options,\n };\n\n applySdkMetadata(opts, 'react');\n\n init$1(opts);\n}\n\nexport { init };\n//# sourceMappingURL=sdk.js.map\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","'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","/**\n * This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.\n *\n * ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.\n */\nconst DEBUG_BUILD = (typeof __SENTRY_DEBUG__ === 'undefined' || __SENTRY_DEBUG__);\n\nexport { DEBUG_BUILD };\n//# sourceMappingURL=debug-build.js.map\n","import { getClient, showReportDialog, withScope, captureException } from '@sentry/browser';\nimport { isError, logger } from '@sentry/utils';\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { DEBUG_BUILD } from './debug-build.js';\n\nconst _jsxFileName = \"/home/runner/work/sentry-javascript/sentry-javascript/packages/react/src/errorboundary.tsx\";\n\nfunction isAtLeastReact17(version) {\n const major = version.match(/^([^.]+)/);\n return major !== null && parseInt(major[0]) >= 17;\n}\n\nconst UNKNOWN_COMPONENT = 'unknown';\n\nconst INITIAL_STATE = {\n componentStack: null,\n error: null,\n eventId: null,\n};\n\nfunction setCause(error, cause) {\n const seenErrors = new WeakMap();\n\n function recurse(error, cause) {\n // If we've already seen the error, there is a recursive loop somewhere in the error's\n // cause chain. Let's just bail out then to prevent a stack overflow.\n if (seenErrors.has(error)) {\n return;\n }\n if (error.cause) {\n seenErrors.set(error, true);\n return recurse(error.cause, cause);\n }\n error.cause = cause;\n }\n\n recurse(error, cause);\n}\n\n/**\n * A ErrorBoundary component that logs errors to Sentry. Requires React >= 16.\n * NOTE: If you are a Sentry user, and you are seeing this stack frame, it means the\n * Sentry React SDK ErrorBoundary caught an error invoking your application code. This\n * is expected behavior and NOT indicative of a bug with the Sentry React SDK.\n */\nclass ErrorBoundary extends React.Component {\n\n constructor(props) {\n super(props);ErrorBoundary.prototype.__init.call(this);\n this.state = INITIAL_STATE;\n this._openFallbackReportDialog = true;\n\n const client = getClient();\n if (client && client.on && props.showDialog) {\n this._openFallbackReportDialog = false;\n client.on('afterSendEvent', event => {\n if (!event.type && event.event_id === this._lastEventId) {\n // eslint-disable-next-line deprecation/deprecation\n showReportDialog({ ...props.dialogOptions, eventId: this._lastEventId });\n }\n });\n }\n }\n\n componentDidCatch(error, { componentStack }) {\n const { beforeCapture, onError, showDialog, dialogOptions } = this.props;\n withScope(scope => {\n // If on React version >= 17, create stack trace from componentStack param and links\n // to to the original error using `error.cause` otherwise relies on error param for stacktrace.\n // Linking errors requires the `LinkedErrors` integration be enabled.\n // See: https://reactjs.org/blog/2020/08/10/react-v17-rc.html#native-component-stacks\n //\n // Although `componentDidCatch` is typed to accept an `Error` object, it can also be invoked\n // with non-error objects. This is why we need to check if the error is an error-like object.\n // See: https://github.com/getsentry/sentry-javascript/issues/6167\n if (isAtLeastReact17(React.version) && isError(error)) {\n const errorBoundaryError = new Error(error.message);\n errorBoundaryError.name = `React ErrorBoundary ${error.name}`;\n errorBoundaryError.stack = componentStack;\n\n // Using the `LinkedErrors` integration to link the errors together.\n setCause(error, errorBoundaryError);\n }\n\n if (beforeCapture) {\n beforeCapture(scope, error, componentStack);\n }\n\n const eventId = captureException(error, {\n captureContext: {\n contexts: { react: { componentStack } },\n },\n // If users provide a fallback component we can assume they are handling the error.\n // Therefore, we set the mechanism depending on the presence of the fallback prop.\n mechanism: { handled: !!this.props.fallback },\n });\n\n if (onError) {\n onError(error, componentStack, eventId);\n }\n if (showDialog) {\n this._lastEventId = eventId;\n if (this._openFallbackReportDialog) {\n showReportDialog({ ...dialogOptions, eventId });\n }\n }\n\n // componentDidCatch is used over getDerivedStateFromError\n // so that componentStack is accessible through state.\n this.setState({ error, componentStack, eventId });\n });\n }\n\n componentDidMount() {\n const { onMount } = this.props;\n if (onMount) {\n onMount();\n }\n }\n\n componentWillUnmount() {\n const { error, componentStack, eventId } = this.state;\n const { onUnmount } = this.props;\n if (onUnmount) {\n onUnmount(error, componentStack, eventId);\n }\n }\n\n __init() {this.resetErrorBoundary = () => {\n const { onReset } = this.props;\n const { error, componentStack, eventId } = this.state;\n if (onReset) {\n onReset(error, componentStack, eventId);\n }\n this.setState(INITIAL_STATE);\n };}\n\n render() {\n const { fallback, children } = this.props;\n const state = this.state;\n\n if (state.error) {\n let element = undefined;\n if (typeof fallback === 'function') {\n element = fallback({\n error: state.error,\n componentStack: state.componentStack,\n resetError: this.resetErrorBoundary,\n eventId: state.eventId,\n });\n } else {\n element = fallback;\n }\n\n if (React.isValidElement(element)) {\n return element;\n }\n\n if (fallback) {\n DEBUG_BUILD && logger.warn('fallback did not produce a valid ReactElement');\n }\n\n // Fail gracefully if no fallback provided or is not valid\n return null;\n }\n\n if (typeof children === 'function') {\n return (children )();\n }\n return children;\n }\n}\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nfunction withErrorBoundary(\n WrappedComponent,\n errorBoundaryOptions,\n) {\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n const componentDisplayName = WrappedComponent.displayName || WrappedComponent.name || UNKNOWN_COMPONENT;\n\n const Wrapped = (props) => (\n React.createElement(ErrorBoundary, { ...errorBoundaryOptions, __self: this, __source: {fileName: _jsxFileName, lineNumber: 240}}\n , React.createElement(WrappedComponent, { ...props, __self: this, __source: {fileName: _jsxFileName, lineNumber: 241}} )\n )\n );\n\n // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access\n Wrapped.displayName = `errorBoundary(${componentDisplayName})`;\n\n // Copy over static methods from Wrapped component to Profiler HOC\n // See: https://reactjs.org/docs/higher-order-components.html#static-methods-must-be-copied-over\n hoistNonReactStatics(Wrapped, WrappedComponent);\n return Wrapped;\n}\n\nexport { ErrorBoundary, UNKNOWN_COMPONENT, isAtLeastReact17, withErrorBoundary };\n//# sourceMappingURL=errorboundary.js.map\n","// src/utils/formatProdErrorMessage.ts\nfunction formatProdErrorMessage(code) {\n return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;\n}\n\n// src/utils/symbol-observable.ts\nvar $$observable = /* @__PURE__ */ (() => typeof Symbol === \"function\" && Symbol.observable || \"@@observable\")();\nvar symbol_observable_default = $$observable;\n\n// src/utils/actionTypes.ts\nvar randomString = () => Math.random().toString(36).substring(7).split(\"\").join(\".\");\nvar ActionTypes = {\n INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,\n REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,\n PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`\n};\nvar actionTypes_default = ActionTypes;\n\n// src/utils/isPlainObject.ts\nfunction isPlainObject(obj) {\n if (typeof obj !== \"object\" || obj === null)\n return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;\n}\n\n// src/utils/kindOf.ts\nfunction miniKindOf(val) {\n if (val === void 0)\n return \"undefined\";\n if (val === null)\n return \"null\";\n const type = typeof val;\n switch (type) {\n case \"boolean\":\n case \"string\":\n case \"number\":\n case \"symbol\":\n case \"function\": {\n return type;\n }\n }\n if (Array.isArray(val))\n return \"array\";\n if (isDate(val))\n return \"date\";\n if (isError(val))\n return \"error\";\n const constructorName = ctorName(val);\n switch (constructorName) {\n case \"Symbol\":\n case \"Promise\":\n case \"WeakMap\":\n case \"WeakSet\":\n case \"Map\":\n case \"Set\":\n return constructorName;\n }\n return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\\s/g, \"\");\n}\nfunction ctorName(val) {\n return typeof val.constructor === \"function\" ? val.constructor.name : null;\n}\nfunction isError(val) {\n return val instanceof Error || typeof val.message === \"string\" && val.constructor && typeof val.constructor.stackTraceLimit === \"number\";\n}\nfunction isDate(val) {\n if (val instanceof Date)\n return true;\n return typeof val.toDateString === \"function\" && typeof val.getDate === \"function\" && typeof val.setDate === \"function\";\n}\nfunction kindOf(val) {\n let typeOfVal = typeof val;\n if (process.env.NODE_ENV !== \"production\") {\n typeOfVal = miniKindOf(val);\n }\n return typeOfVal;\n}\n\n// src/createStore.ts\nfunction createStore(reducer, preloadedState, enhancer) {\n if (typeof reducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`);\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"function\" || typeof enhancer === \"function\" && typeof arguments[3] === \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : \"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.\");\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"undefined\") {\n enhancer = preloadedState;\n preloadedState = void 0;\n }\n if (typeof enhancer !== \"undefined\") {\n if (typeof enhancer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`);\n }\n return enhancer(createStore)(reducer, preloadedState);\n }\n let currentReducer = reducer;\n let currentState = preloadedState;\n let currentListeners = /* @__PURE__ */ new Map();\n let nextListeners = currentListeners;\n let listenerIdCounter = 0;\n let isDispatching = false;\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = /* @__PURE__ */ new Map();\n currentListeners.forEach((listener, key) => {\n nextListeners.set(key, listener);\n });\n }\n }\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : \"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.\");\n }\n return currentState;\n }\n function subscribe(listener) {\n if (typeof listener !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : \"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n let isSubscribed = true;\n ensureCanMutateNextListeners();\n const listenerId = listenerIdCounter++;\n nextListeners.set(listenerId, listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : \"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n isSubscribed = false;\n ensureCanMutateNextListeners();\n nextListeners.delete(listenerId);\n currentListeners = null;\n };\n }\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : `Actions must be plain objects. Instead, the actual type was: '${kindOf(action)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);\n }\n if (typeof action.type === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n if (typeof action.type !== \"string\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(17) : `Action \"type\" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : \"Reducers may not dispatch actions.\");\n }\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n const listeners = currentListeners = nextListeners;\n listeners.forEach((listener) => {\n listener();\n });\n return action;\n }\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`);\n }\n currentReducer = nextReducer;\n dispatch({\n type: actionTypes_default.REPLACE\n });\n }\n function observable() {\n const outerSubscribe = subscribe;\n return {\n /**\n * The minimal observable subscription method.\n * @param observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe(observer) {\n if (typeof observer !== \"object\" || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`);\n }\n function observeState() {\n const observerAsObserver = observer;\n if (observerAsObserver.next) {\n observerAsObserver.next(getState());\n }\n }\n observeState();\n const unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe\n };\n },\n [symbol_observable_default]() {\n return this;\n }\n };\n }\n dispatch({\n type: actionTypes_default.INIT\n });\n const store = {\n dispatch,\n subscribe,\n getState,\n replaceReducer,\n [symbol_observable_default]: observable\n };\n return store;\n}\nfunction legacy_createStore(reducer, preloadedState, enhancer) {\n return createStore(reducer, preloadedState, enhancer);\n}\n\n// src/utils/warning.ts\nfunction warning(message) {\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(message);\n }\n try {\n throw new Error(message);\n } catch (e) {\n }\n}\n\n// src/combineReducers.ts\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n const reducerKeys = Object.keys(reducers);\n const argumentName = action && action.type === actionTypes_default.INIT ? \"preloadedState argument passed to createStore\" : \"previous state received by the reducer\";\n if (reducerKeys.length === 0) {\n return \"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.\";\n }\n if (!isPlainObject(inputState)) {\n return `The ${argumentName} has unexpected type of \"${kindOf(inputState)}\". Expected argument to be an object with the following keys: \"${reducerKeys.join('\", \"')}\"`;\n }\n const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);\n unexpectedKeys.forEach((key) => {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === actionTypes_default.REPLACE)\n return;\n if (unexpectedKeys.length > 0) {\n return `Unexpected ${unexpectedKeys.length > 1 ? \"keys\" : \"key\"} \"${unexpectedKeys.join('\", \"')}\" found in ${argumentName}. Expected to find one of the known reducer keys instead: \"${reducerKeys.join('\", \"')}\". Unexpected keys will be ignored.`;\n }\n}\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach((key) => {\n const reducer = reducers[key];\n const initialState = reducer(void 0, {\n type: actionTypes_default.INIT\n });\n if (typeof initialState === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : `The slice reducer for key \"${key}\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);\n }\n if (typeof reducer(void 0, {\n type: actionTypes_default.PROBE_UNKNOWN_ACTION()\n }) === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : `The slice reducer for key \"${key}\" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in \"redux/*\" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);\n }\n });\n}\nfunction combineReducers(reducers) {\n const reducerKeys = Object.keys(reducers);\n const finalReducers = {};\n for (let i = 0; i < reducerKeys.length; i++) {\n const key = reducerKeys[i];\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof reducers[key] === \"undefined\") {\n warning(`No reducer provided for key \"${key}\"`);\n }\n }\n if (typeof reducers[key] === \"function\") {\n finalReducers[key] = reducers[key];\n }\n }\n const finalReducerKeys = Object.keys(finalReducers);\n let unexpectedKeyCache;\n if (process.env.NODE_ENV !== \"production\") {\n unexpectedKeyCache = {};\n }\n let shapeAssertionError;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n return function combination(state = {}, action) {\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n if (process.env.NODE_ENV !== \"production\") {\n const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n let hasChanged = false;\n const nextState = {};\n for (let i = 0; i < finalReducerKeys.length; i++) {\n const key = finalReducerKeys[i];\n const reducer = finalReducers[key];\n const previousStateForKey = state[key];\n const nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === \"undefined\") {\n const actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : `When called with an action of type ${actionType ? `\"${String(actionType)}\"` : \"(unknown type)\"}, the slice reducer for key \"${key}\" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);\n }\n nextState[key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\n// src/bindActionCreators.ts\nfunction bindActionCreator(actionCreator, dispatch) {\n return function(...args) {\n return dispatch(actionCreator.apply(this, args));\n };\n}\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === \"function\") {\n return bindActionCreator(actionCreators, dispatch);\n }\n if (typeof actionCreators !== \"object\" || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : `bindActionCreators expected an object or a function, but instead received: '${kindOf(actionCreators)}'. Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?`);\n }\n const boundActionCreators = {};\n for (const key in actionCreators) {\n const actionCreator = actionCreators[key];\n if (typeof actionCreator === \"function\") {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}\n\n// src/compose.ts\nfunction compose(...funcs) {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n if (funcs.length === 1) {\n return funcs[0];\n }\n return funcs.reduce((a, b) => (...args) => a(b(...args)));\n}\n\n// src/applyMiddleware.ts\nfunction applyMiddleware(...middlewares) {\n return (createStore2) => (reducer, preloadedState) => {\n const store = createStore2(reducer, preloadedState);\n let dispatch = () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : \"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.\");\n };\n const middlewareAPI = {\n getState: store.getState,\n dispatch: (action, ...args) => dispatch(action, ...args)\n };\n const chain = middlewares.map((middleware) => middleware(middlewareAPI));\n dispatch = compose(...chain)(store.dispatch);\n return {\n ...store,\n dispatch\n };\n };\n}\n\n// src/utils/isAction.ts\nfunction isAction(action) {\n return isPlainObject(action) && \"type\" in action && typeof action.type === \"string\";\n}\nexport {\n actionTypes_default as __DO_NOT_USE__ActionTypes,\n applyMiddleware,\n bindActionCreators,\n combineReducers,\n compose,\n createStore,\n isAction,\n isPlainObject,\n legacy_createStore\n};\n//# sourceMappingURL=redux.mjs.map","// src/utils/env.ts\nvar NOTHING = Symbol.for(\"immer-nothing\");\nvar DRAFTABLE = Symbol.for(\"immer-draftable\");\nvar DRAFT_STATE = Symbol.for(\"immer-state\");\n\n// src/utils/errors.ts\nvar errors = process.env.NODE_ENV !== \"production\" ? [\n // All error codes, starting by 0:\n function(plugin) {\n return `The plugin for '${plugin}' has not been loaded into Immer. To enable the plugin, import and call \\`enable${plugin}()\\` when initializing your application.`;\n },\n function(thing) {\n return `produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${thing}'`;\n },\n \"This object has been frozen and should not be mutated\",\n function(data) {\n return \"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? \" + data;\n },\n \"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.\",\n \"Immer forbids circular references\",\n \"The first or second argument to `produce` must be a function\",\n \"The third argument to `produce` must be a function or undefined\",\n \"First argument to `createDraft` must be a plain object, an array, or an immerable object\",\n \"First argument to `finishDraft` must be a draft returned by `createDraft`\",\n function(thing) {\n return `'current' expects a draft, got: ${thing}`;\n },\n \"Object.defineProperty() cannot be used on an Immer draft\",\n \"Object.setPrototypeOf() cannot be used on an Immer draft\",\n \"Immer only supports deleting array indices\",\n \"Immer only supports setting array indices and the 'length' property\",\n function(thing) {\n return `'original' expects a draft, got: ${thing}`;\n }\n // Note: if more errors are added, the errorOffset in Patches.ts should be increased\n // See Patches.ts for additional errors\n] : [];\nfunction die(error, ...args) {\n if (process.env.NODE_ENV !== \"production\") {\n const e = errors[error];\n const msg = typeof e === \"function\" ? e.apply(null, args) : e;\n throw new Error(`[Immer] ${msg}`);\n }\n throw new Error(\n `[Immer] minified error nr: ${error}. Full error at: https://bit.ly/3cXEKWf`\n );\n}\n\n// src/utils/common.ts\nvar getPrototypeOf = Object.getPrototypeOf;\nfunction isDraft(value) {\n return !!value && !!value[DRAFT_STATE];\n}\nfunction isDraftable(value) {\n if (!value)\n return false;\n return isPlainObject(value) || Array.isArray(value) || !!value[DRAFTABLE] || !!value.constructor?.[DRAFTABLE] || isMap(value) || isSet(value);\n}\nvar objectCtorString = Object.prototype.constructor.toString();\nfunction isPlainObject(value) {\n if (!value || typeof value !== \"object\")\n return false;\n const proto = getPrototypeOf(value);\n if (proto === null) {\n return true;\n }\n const Ctor = Object.hasOwnProperty.call(proto, \"constructor\") && proto.constructor;\n if (Ctor === Object)\n return true;\n return typeof Ctor == \"function\" && Function.toString.call(Ctor) === objectCtorString;\n}\nfunction original(value) {\n if (!isDraft(value))\n die(15, value);\n return value[DRAFT_STATE].base_;\n}\nfunction each(obj, iter) {\n if (getArchtype(obj) === 0 /* Object */) {\n Reflect.ownKeys(obj).forEach((key) => {\n iter(key, obj[key], obj);\n });\n } else {\n obj.forEach((entry, index) => iter(index, entry, obj));\n }\n}\nfunction getArchtype(thing) {\n const state = thing[DRAFT_STATE];\n return state ? state.type_ : Array.isArray(thing) ? 1 /* Array */ : isMap(thing) ? 2 /* Map */ : isSet(thing) ? 3 /* Set */ : 0 /* Object */;\n}\nfunction has(thing, prop) {\n return getArchtype(thing) === 2 /* Map */ ? thing.has(prop) : Object.prototype.hasOwnProperty.call(thing, prop);\n}\nfunction get(thing, prop) {\n return getArchtype(thing) === 2 /* Map */ ? thing.get(prop) : thing[prop];\n}\nfunction set(thing, propOrOldValue, value) {\n const t = getArchtype(thing);\n if (t === 2 /* Map */)\n thing.set(propOrOldValue, value);\n else if (t === 3 /* Set */) {\n thing.add(value);\n } else\n thing[propOrOldValue] = value;\n}\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\nfunction isMap(target) {\n return target instanceof Map;\n}\nfunction isSet(target) {\n return target instanceof Set;\n}\nfunction latest(state) {\n return state.copy_ || state.base_;\n}\nfunction shallowCopy(base, strict) {\n if (isMap(base)) {\n return new Map(base);\n }\n if (isSet(base)) {\n return new Set(base);\n }\n if (Array.isArray(base))\n return Array.prototype.slice.call(base);\n const isPlain = isPlainObject(base);\n if (strict === true || strict === \"class_only\" && !isPlain) {\n const descriptors = Object.getOwnPropertyDescriptors(base);\n delete descriptors[DRAFT_STATE];\n let keys = Reflect.ownKeys(descriptors);\n for (let i = 0; i < keys.length; i++) {\n const key = keys[i];\n const desc = descriptors[key];\n if (desc.writable === false) {\n desc.writable = true;\n desc.configurable = true;\n }\n if (desc.get || desc.set)\n descriptors[key] = {\n configurable: true,\n writable: true,\n // could live with !!desc.set as well here...\n enumerable: desc.enumerable,\n value: base[key]\n };\n }\n return Object.create(getPrototypeOf(base), descriptors);\n } else {\n const proto = getPrototypeOf(base);\n if (proto !== null && isPlain) {\n return { ...base };\n }\n const obj = Object.create(proto);\n return Object.assign(obj, base);\n }\n}\nfunction freeze(obj, deep = false) {\n if (isFrozen(obj) || isDraft(obj) || !isDraftable(obj))\n return obj;\n if (getArchtype(obj) > 1) {\n obj.set = obj.add = obj.clear = obj.delete = dontMutateFrozenCollections;\n }\n Object.freeze(obj);\n if (deep)\n Object.entries(obj).forEach(([key, value]) => freeze(value, true));\n return obj;\n}\nfunction dontMutateFrozenCollections() {\n die(2);\n}\nfunction isFrozen(obj) {\n return Object.isFrozen(obj);\n}\n\n// src/utils/plugins.ts\nvar plugins = {};\nfunction getPlugin(pluginKey) {\n const plugin = plugins[pluginKey];\n if (!plugin) {\n die(0, pluginKey);\n }\n return plugin;\n}\nfunction loadPlugin(pluginKey, implementation) {\n if (!plugins[pluginKey])\n plugins[pluginKey] = implementation;\n}\n\n// src/core/scope.ts\nvar currentScope;\nfunction getCurrentScope() {\n return currentScope;\n}\nfunction createScope(parent_, immer_) {\n return {\n drafts_: [],\n parent_,\n immer_,\n // Whenever the modified draft contains a draft from another scope, we\n // need to prevent auto-freezing so the unowned draft can be finalized.\n canAutoFreeze_: true,\n unfinalizedDrafts_: 0\n };\n}\nfunction usePatchesInScope(scope, patchListener) {\n if (patchListener) {\n getPlugin(\"Patches\");\n scope.patches_ = [];\n scope.inversePatches_ = [];\n scope.patchListener_ = patchListener;\n }\n}\nfunction revokeScope(scope) {\n leaveScope(scope);\n scope.drafts_.forEach(revokeDraft);\n scope.drafts_ = null;\n}\nfunction leaveScope(scope) {\n if (scope === currentScope) {\n currentScope = scope.parent_;\n }\n}\nfunction enterScope(immer2) {\n return currentScope = createScope(currentScope, immer2);\n}\nfunction revokeDraft(draft) {\n const state = draft[DRAFT_STATE];\n if (state.type_ === 0 /* Object */ || state.type_ === 1 /* Array */)\n state.revoke_();\n else\n state.revoked_ = true;\n}\n\n// src/core/finalize.ts\nfunction processResult(result, scope) {\n scope.unfinalizedDrafts_ = scope.drafts_.length;\n const baseDraft = scope.drafts_[0];\n const isReplaced = result !== void 0 && result !== baseDraft;\n if (isReplaced) {\n if (baseDraft[DRAFT_STATE].modified_) {\n revokeScope(scope);\n die(4);\n }\n if (isDraftable(result)) {\n result = finalize(scope, result);\n if (!scope.parent_)\n maybeFreeze(scope, result);\n }\n if (scope.patches_) {\n getPlugin(\"Patches\").generateReplacementPatches_(\n baseDraft[DRAFT_STATE].base_,\n result,\n scope.patches_,\n scope.inversePatches_\n );\n }\n } else {\n result = finalize(scope, baseDraft, []);\n }\n revokeScope(scope);\n if (scope.patches_) {\n scope.patchListener_(scope.patches_, scope.inversePatches_);\n }\n return result !== NOTHING ? result : void 0;\n}\nfunction finalize(rootScope, value, path) {\n if (isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n if (!state) {\n each(\n value,\n (key, childValue) => finalizeProperty(rootScope, state, value, key, childValue, path)\n );\n return value;\n }\n if (state.scope_ !== rootScope)\n return value;\n if (!state.modified_) {\n maybeFreeze(rootScope, state.base_, true);\n return state.base_;\n }\n if (!state.finalized_) {\n state.finalized_ = true;\n state.scope_.unfinalizedDrafts_--;\n const result = state.copy_;\n let resultEach = result;\n let isSet2 = false;\n if (state.type_ === 3 /* Set */) {\n resultEach = new Set(result);\n result.clear();\n isSet2 = true;\n }\n each(\n resultEach,\n (key, childValue) => finalizeProperty(rootScope, state, result, key, childValue, path, isSet2)\n );\n maybeFreeze(rootScope, result, false);\n if (path && rootScope.patches_) {\n getPlugin(\"Patches\").generatePatches_(\n state,\n path,\n rootScope.patches_,\n rootScope.inversePatches_\n );\n }\n }\n return state.copy_;\n}\nfunction finalizeProperty(rootScope, parentState, targetObject, prop, childValue, rootPath, targetIsSet) {\n if (process.env.NODE_ENV !== \"production\" && childValue === targetObject)\n die(5);\n if (isDraft(childValue)) {\n const path = rootPath && parentState && parentState.type_ !== 3 /* Set */ && // Set objects are atomic since they have no keys.\n !has(parentState.assigned_, prop) ? rootPath.concat(prop) : void 0;\n const res = finalize(rootScope, childValue, path);\n set(targetObject, prop, res);\n if (isDraft(res)) {\n rootScope.canAutoFreeze_ = false;\n } else\n return;\n } else if (targetIsSet) {\n targetObject.add(childValue);\n }\n if (isDraftable(childValue) && !isFrozen(childValue)) {\n if (!rootScope.immer_.autoFreeze_ && rootScope.unfinalizedDrafts_ < 1) {\n return;\n }\n finalize(rootScope, childValue);\n if ((!parentState || !parentState.scope_.parent_) && typeof prop !== \"symbol\" && Object.prototype.propertyIsEnumerable.call(targetObject, prop))\n maybeFreeze(rootScope, childValue);\n }\n}\nfunction maybeFreeze(scope, value, deep = false) {\n if (!scope.parent_ && scope.immer_.autoFreeze_ && scope.canAutoFreeze_) {\n freeze(value, deep);\n }\n}\n\n// src/core/proxy.ts\nfunction createProxyProxy(base, parent) {\n const isArray = Array.isArray(base);\n const state = {\n type_: isArray ? 1 /* Array */ : 0 /* Object */,\n // Track which produce call this is associated with.\n scope_: parent ? parent.scope_ : getCurrentScope(),\n // True for both shallow and deep changes.\n modified_: false,\n // Used during finalization.\n finalized_: false,\n // Track which properties have been assigned (true) or deleted (false).\n assigned_: {},\n // The parent draft state.\n parent_: parent,\n // The base state.\n base_: base,\n // The base proxy.\n draft_: null,\n // set below\n // The base copy with any updated values.\n copy_: null,\n // Called by the `produce` function.\n revoke_: null,\n isManual_: false\n };\n let target = state;\n let traps = objectTraps;\n if (isArray) {\n target = [state];\n traps = arrayTraps;\n }\n const { revoke, proxy } = Proxy.revocable(target, traps);\n state.draft_ = proxy;\n state.revoke_ = revoke;\n return proxy;\n}\nvar objectTraps = {\n get(state, prop) {\n if (prop === DRAFT_STATE)\n return state;\n const source = latest(state);\n if (!has(source, prop)) {\n return readPropFromProto(state, source, prop);\n }\n const value = source[prop];\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (value === peek(state.base_, prop)) {\n prepareCopy(state);\n return state.copy_[prop] = createProxy(value, state);\n }\n return value;\n },\n has(state, prop) {\n return prop in latest(state);\n },\n ownKeys(state) {\n return Reflect.ownKeys(latest(state));\n },\n set(state, prop, value) {\n const desc = getDescriptorFromProto(latest(state), prop);\n if (desc?.set) {\n desc.set.call(state.draft_, value);\n return true;\n }\n if (!state.modified_) {\n const current2 = peek(latest(state), prop);\n const currentState = current2?.[DRAFT_STATE];\n if (currentState && currentState.base_ === value) {\n state.copy_[prop] = value;\n state.assigned_[prop] = false;\n return true;\n }\n if (is(value, current2) && (value !== void 0 || has(state.base_, prop)))\n return true;\n prepareCopy(state);\n markChanged(state);\n }\n if (state.copy_[prop] === value && // special case: handle new props with value 'undefined'\n (value !== void 0 || prop in state.copy_) || // special case: NaN\n Number.isNaN(value) && Number.isNaN(state.copy_[prop]))\n return true;\n state.copy_[prop] = value;\n state.assigned_[prop] = true;\n return true;\n },\n deleteProperty(state, prop) {\n if (peek(state.base_, prop) !== void 0 || prop in state.base_) {\n state.assigned_[prop] = false;\n prepareCopy(state);\n markChanged(state);\n } else {\n delete state.assigned_[prop];\n }\n if (state.copy_) {\n delete state.copy_[prop];\n }\n return true;\n },\n // Note: We never coerce `desc.value` into an Immer draft, because we can't make\n // the same guarantee in ES5 mode.\n getOwnPropertyDescriptor(state, prop) {\n const owner = latest(state);\n const desc = Reflect.getOwnPropertyDescriptor(owner, prop);\n if (!desc)\n return desc;\n return {\n writable: true,\n configurable: state.type_ !== 1 /* Array */ || prop !== \"length\",\n enumerable: desc.enumerable,\n value: owner[prop]\n };\n },\n defineProperty() {\n die(11);\n },\n getPrototypeOf(state) {\n return getPrototypeOf(state.base_);\n },\n setPrototypeOf() {\n die(12);\n }\n};\nvar arrayTraps = {};\neach(objectTraps, (key, fn) => {\n arrayTraps[key] = function() {\n arguments[0] = arguments[0][0];\n return fn.apply(this, arguments);\n };\n});\narrayTraps.deleteProperty = function(state, prop) {\n if (process.env.NODE_ENV !== \"production\" && isNaN(parseInt(prop)))\n die(13);\n return arrayTraps.set.call(this, state, prop, void 0);\n};\narrayTraps.set = function(state, prop, value) {\n if (process.env.NODE_ENV !== \"production\" && prop !== \"length\" && isNaN(parseInt(prop)))\n die(14);\n return objectTraps.set.call(this, state[0], prop, value, state[0]);\n};\nfunction peek(draft, prop) {\n const state = draft[DRAFT_STATE];\n const source = state ? latest(state) : draft;\n return source[prop];\n}\nfunction readPropFromProto(state, source, prop) {\n const desc = getDescriptorFromProto(source, prop);\n return desc ? `value` in desc ? desc.value : (\n // This is a very special case, if the prop is a getter defined by the\n // prototype, we should invoke it with the draft as context!\n desc.get?.call(state.draft_)\n ) : void 0;\n}\nfunction getDescriptorFromProto(source, prop) {\n if (!(prop in source))\n return void 0;\n let proto = getPrototypeOf(source);\n while (proto) {\n const desc = Object.getOwnPropertyDescriptor(proto, prop);\n if (desc)\n return desc;\n proto = getPrototypeOf(proto);\n }\n return void 0;\n}\nfunction markChanged(state) {\n if (!state.modified_) {\n state.modified_ = true;\n if (state.parent_) {\n markChanged(state.parent_);\n }\n }\n}\nfunction prepareCopy(state) {\n if (!state.copy_) {\n state.copy_ = shallowCopy(\n state.base_,\n state.scope_.immer_.useStrictShallowCopy_\n );\n }\n}\n\n// src/core/immerClass.ts\nvar Immer2 = class {\n constructor(config) {\n this.autoFreeze_ = true;\n this.useStrictShallowCopy_ = false;\n /**\n * The `produce` function takes a value and a \"recipe function\" (whose\n * return value often depends on the base state). The recipe function is\n * free to mutate its first argument however it wants. All mutations are\n * only ever applied to a __copy__ of the base state.\n *\n * Pass only a function to create a \"curried producer\" which relieves you\n * from passing the recipe function every time.\n *\n * Only plain objects and arrays are made mutable. All other objects are\n * considered uncopyable.\n *\n * Note: This function is __bound__ to its `Immer` instance.\n *\n * @param {any} base - the initial state\n * @param {Function} recipe - function that receives a proxy of the base state as first argument and which can be freely modified\n * @param {Function} patchListener - optional function that will be called with all the patches produced here\n * @returns {any} a new state, or the initial state if nothing was modified\n */\n this.produce = (base, recipe, patchListener) => {\n if (typeof base === \"function\" && typeof recipe !== \"function\") {\n const defaultBase = recipe;\n recipe = base;\n const self = this;\n return function curriedProduce(base2 = defaultBase, ...args) {\n return self.produce(base2, (draft) => recipe.call(this, draft, ...args));\n };\n }\n if (typeof recipe !== \"function\")\n die(6);\n if (patchListener !== void 0 && typeof patchListener !== \"function\")\n die(7);\n let result;\n if (isDraftable(base)) {\n const scope = enterScope(this);\n const proxy = createProxy(base, void 0);\n let hasError = true;\n try {\n result = recipe(proxy);\n hasError = false;\n } finally {\n if (hasError)\n revokeScope(scope);\n else\n leaveScope(scope);\n }\n usePatchesInScope(scope, patchListener);\n return processResult(result, scope);\n } else if (!base || typeof base !== \"object\") {\n result = recipe(base);\n if (result === void 0)\n result = base;\n if (result === NOTHING)\n result = void 0;\n if (this.autoFreeze_)\n freeze(result, true);\n if (patchListener) {\n const p = [];\n const ip = [];\n getPlugin(\"Patches\").generateReplacementPatches_(base, result, p, ip);\n patchListener(p, ip);\n }\n return result;\n } else\n die(1, base);\n };\n this.produceWithPatches = (base, recipe) => {\n if (typeof base === \"function\") {\n return (state, ...args) => this.produceWithPatches(state, (draft) => base(draft, ...args));\n }\n let patches, inversePatches;\n const result = this.produce(base, recipe, (p, ip) => {\n patches = p;\n inversePatches = ip;\n });\n return [result, patches, inversePatches];\n };\n if (typeof config?.autoFreeze === \"boolean\")\n this.setAutoFreeze(config.autoFreeze);\n if (typeof config?.useStrictShallowCopy === \"boolean\")\n this.setUseStrictShallowCopy(config.useStrictShallowCopy);\n }\n createDraft(base) {\n if (!isDraftable(base))\n die(8);\n if (isDraft(base))\n base = current(base);\n const scope = enterScope(this);\n const proxy = createProxy(base, void 0);\n proxy[DRAFT_STATE].isManual_ = true;\n leaveScope(scope);\n return proxy;\n }\n finishDraft(draft, patchListener) {\n const state = draft && draft[DRAFT_STATE];\n if (!state || !state.isManual_)\n die(9);\n const { scope_: scope } = state;\n usePatchesInScope(scope, patchListener);\n return processResult(void 0, scope);\n }\n /**\n * Pass true to automatically freeze all copies created by Immer.\n *\n * By default, auto-freezing is enabled.\n */\n setAutoFreeze(value) {\n this.autoFreeze_ = value;\n }\n /**\n * Pass true to enable strict shallow copy.\n *\n * By default, immer does not copy the object descriptors such as getter, setter and non-enumrable properties.\n */\n setUseStrictShallowCopy(value) {\n this.useStrictShallowCopy_ = value;\n }\n applyPatches(base, patches) {\n let i;\n for (i = patches.length - 1; i >= 0; i--) {\n const patch = patches[i];\n if (patch.path.length === 0 && patch.op === \"replace\") {\n base = patch.value;\n break;\n }\n }\n if (i > -1) {\n patches = patches.slice(i + 1);\n }\n const applyPatchesImpl = getPlugin(\"Patches\").applyPatches_;\n if (isDraft(base)) {\n return applyPatchesImpl(base, patches);\n }\n return this.produce(\n base,\n (draft) => applyPatchesImpl(draft, patches)\n );\n }\n};\nfunction createProxy(value, parent) {\n const draft = isMap(value) ? getPlugin(\"MapSet\").proxyMap_(value, parent) : isSet(value) ? getPlugin(\"MapSet\").proxySet_(value, parent) : createProxyProxy(value, parent);\n const scope = parent ? parent.scope_ : getCurrentScope();\n scope.drafts_.push(draft);\n return draft;\n}\n\n// src/core/current.ts\nfunction current(value) {\n if (!isDraft(value))\n die(10, value);\n return currentImpl(value);\n}\nfunction currentImpl(value) {\n if (!isDraftable(value) || isFrozen(value))\n return value;\n const state = value[DRAFT_STATE];\n let copy;\n if (state) {\n if (!state.modified_)\n return state.base_;\n state.finalized_ = true;\n copy = shallowCopy(value, state.scope_.immer_.useStrictShallowCopy_);\n } else {\n copy = shallowCopy(value, true);\n }\n each(copy, (key, childValue) => {\n set(copy, key, currentImpl(childValue));\n });\n if (state) {\n state.finalized_ = false;\n }\n return copy;\n}\n\n// src/plugins/patches.ts\nfunction enablePatches() {\n const errorOffset = 16;\n if (process.env.NODE_ENV !== \"production\") {\n errors.push(\n 'Sets cannot have \"replace\" patches.',\n function(op) {\n return \"Unsupported patch operation: \" + op;\n },\n function(path) {\n return \"Cannot apply patch, path doesn't resolve: \" + path;\n },\n \"Patching reserved attributes like __proto__, prototype and constructor is not allowed\"\n );\n }\n const REPLACE = \"replace\";\n const ADD = \"add\";\n const REMOVE = \"remove\";\n function generatePatches_(state, basePath, patches, inversePatches) {\n switch (state.type_) {\n case 0 /* Object */:\n case 2 /* Map */:\n return generatePatchesFromAssigned(\n state,\n basePath,\n patches,\n inversePatches\n );\n case 1 /* Array */:\n return generateArrayPatches(state, basePath, patches, inversePatches);\n case 3 /* Set */:\n return generateSetPatches(\n state,\n basePath,\n patches,\n inversePatches\n );\n }\n }\n function generateArrayPatches(state, basePath, patches, inversePatches) {\n let { base_, assigned_ } = state;\n let copy_ = state.copy_;\n if (copy_.length < base_.length) {\n ;\n [base_, copy_] = [copy_, base_];\n [patches, inversePatches] = [inversePatches, patches];\n }\n for (let i = 0; i < base_.length; i++) {\n if (assigned_[i] && copy_[i] !== base_[i]) {\n const path = basePath.concat([i]);\n patches.push({\n op: REPLACE,\n path,\n // Need to maybe clone it, as it can in fact be the original value\n // due to the base/copy inversion at the start of this function\n value: clonePatchValueIfNeeded(copy_[i])\n });\n inversePatches.push({\n op: REPLACE,\n path,\n value: clonePatchValueIfNeeded(base_[i])\n });\n }\n }\n for (let i = base_.length; i < copy_.length; i++) {\n const path = basePath.concat([i]);\n patches.push({\n op: ADD,\n path,\n // Need to maybe clone it, as it can in fact be the original value\n // due to the base/copy inversion at the start of this function\n value: clonePatchValueIfNeeded(copy_[i])\n });\n }\n for (let i = copy_.length - 1; base_.length <= i; --i) {\n const path = basePath.concat([i]);\n inversePatches.push({\n op: REMOVE,\n path\n });\n }\n }\n function generatePatchesFromAssigned(state, basePath, patches, inversePatches) {\n const { base_, copy_ } = state;\n each(state.assigned_, (key, assignedValue) => {\n const origValue = get(base_, key);\n const value = get(copy_, key);\n const op = !assignedValue ? REMOVE : has(base_, key) ? REPLACE : ADD;\n if (origValue === value && op === REPLACE)\n return;\n const path = basePath.concat(key);\n patches.push(op === REMOVE ? { op, path } : { op, path, value });\n inversePatches.push(\n op === ADD ? { op: REMOVE, path } : op === REMOVE ? { op: ADD, path, value: clonePatchValueIfNeeded(origValue) } : { op: REPLACE, path, value: clonePatchValueIfNeeded(origValue) }\n );\n });\n }\n function generateSetPatches(state, basePath, patches, inversePatches) {\n let { base_, copy_ } = state;\n let i = 0;\n base_.forEach((value) => {\n if (!copy_.has(value)) {\n const path = basePath.concat([i]);\n patches.push({\n op: REMOVE,\n path,\n value\n });\n inversePatches.unshift({\n op: ADD,\n path,\n value\n });\n }\n i++;\n });\n i = 0;\n copy_.forEach((value) => {\n if (!base_.has(value)) {\n const path = basePath.concat([i]);\n patches.push({\n op: ADD,\n path,\n value\n });\n inversePatches.unshift({\n op: REMOVE,\n path,\n value\n });\n }\n i++;\n });\n }\n function generateReplacementPatches_(baseValue, replacement, patches, inversePatches) {\n patches.push({\n op: REPLACE,\n path: [],\n value: replacement === NOTHING ? void 0 : replacement\n });\n inversePatches.push({\n op: REPLACE,\n path: [],\n value: baseValue\n });\n }\n function applyPatches_(draft, patches) {\n patches.forEach((patch) => {\n const { path, op } = patch;\n let base = draft;\n for (let i = 0; i < path.length - 1; i++) {\n const parentType = getArchtype(base);\n let p = path[i];\n if (typeof p !== \"string\" && typeof p !== \"number\") {\n p = \"\" + p;\n }\n if ((parentType === 0 /* Object */ || parentType === 1 /* Array */) && (p === \"__proto__\" || p === \"constructor\"))\n die(errorOffset + 3);\n if (typeof base === \"function\" && p === \"prototype\")\n die(errorOffset + 3);\n base = get(base, p);\n if (typeof base !== \"object\")\n die(errorOffset + 2, path.join(\"/\"));\n }\n const type = getArchtype(base);\n const value = deepClonePatchValue(patch.value);\n const key = path[path.length - 1];\n switch (op) {\n case REPLACE:\n switch (type) {\n case 2 /* Map */:\n return base.set(key, value);\n case 3 /* Set */:\n die(errorOffset);\n default:\n return base[key] = value;\n }\n case ADD:\n switch (type) {\n case 1 /* Array */:\n return key === \"-\" ? base.push(value) : base.splice(key, 0, value);\n case 2 /* Map */:\n return base.set(key, value);\n case 3 /* Set */:\n return base.add(value);\n default:\n return base[key] = value;\n }\n case REMOVE:\n switch (type) {\n case 1 /* Array */:\n return base.splice(key, 1);\n case 2 /* Map */:\n return base.delete(key);\n case 3 /* Set */:\n return base.delete(patch.value);\n default:\n return delete base[key];\n }\n default:\n die(errorOffset + 1, op);\n }\n });\n return draft;\n }\n function deepClonePatchValue(obj) {\n if (!isDraftable(obj))\n return obj;\n if (Array.isArray(obj))\n return obj.map(deepClonePatchValue);\n if (isMap(obj))\n return new Map(\n Array.from(obj.entries()).map(([k, v]) => [k, deepClonePatchValue(v)])\n );\n if (isSet(obj))\n return new Set(Array.from(obj).map(deepClonePatchValue));\n const cloned = Object.create(getPrototypeOf(obj));\n for (const key in obj)\n cloned[key] = deepClonePatchValue(obj[key]);\n if (has(obj, DRAFTABLE))\n cloned[DRAFTABLE] = obj[DRAFTABLE];\n return cloned;\n }\n function clonePatchValueIfNeeded(obj) {\n if (isDraft(obj)) {\n return deepClonePatchValue(obj);\n } else\n return obj;\n }\n loadPlugin(\"Patches\", {\n applyPatches_,\n generatePatches_,\n generateReplacementPatches_\n });\n}\n\n// src/plugins/mapset.ts\nfunction enableMapSet() {\n class DraftMap extends Map {\n constructor(target, parent) {\n super();\n this[DRAFT_STATE] = {\n type_: 2 /* Map */,\n parent_: parent,\n scope_: parent ? parent.scope_ : getCurrentScope(),\n modified_: false,\n finalized_: false,\n copy_: void 0,\n assigned_: void 0,\n base_: target,\n draft_: this,\n isManual_: false,\n revoked_: false\n };\n }\n get size() {\n return latest(this[DRAFT_STATE]).size;\n }\n has(key) {\n return latest(this[DRAFT_STATE]).has(key);\n }\n set(key, value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!latest(state).has(key) || latest(state).get(key) !== value) {\n prepareMapCopy(state);\n markChanged(state);\n state.assigned_.set(key, true);\n state.copy_.set(key, value);\n state.assigned_.set(key, true);\n }\n return this;\n }\n delete(key) {\n if (!this.has(key)) {\n return false;\n }\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareMapCopy(state);\n markChanged(state);\n if (state.base_.has(key)) {\n state.assigned_.set(key, false);\n } else {\n state.assigned_.delete(key);\n }\n state.copy_.delete(key);\n return true;\n }\n clear() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (latest(state).size) {\n prepareMapCopy(state);\n markChanged(state);\n state.assigned_ = /* @__PURE__ */ new Map();\n each(state.base_, (key) => {\n state.assigned_.set(key, false);\n });\n state.copy_.clear();\n }\n }\n forEach(cb, thisArg) {\n const state = this[DRAFT_STATE];\n latest(state).forEach((_value, key, _map) => {\n cb.call(thisArg, this.get(key), key, this);\n });\n }\n get(key) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n const value = latest(state).get(key);\n if (state.finalized_ || !isDraftable(value)) {\n return value;\n }\n if (value !== state.base_.get(key)) {\n return value;\n }\n const draft = createProxy(value, state);\n prepareMapCopy(state);\n state.copy_.set(key, draft);\n return draft;\n }\n keys() {\n return latest(this[DRAFT_STATE]).keys();\n }\n values() {\n const iterator = this.keys();\n return {\n [Symbol.iterator]: () => this.values(),\n next: () => {\n const r = iterator.next();\n if (r.done)\n return r;\n const value = this.get(r.value);\n return {\n done: false,\n value\n };\n }\n };\n }\n entries() {\n const iterator = this.keys();\n return {\n [Symbol.iterator]: () => this.entries(),\n next: () => {\n const r = iterator.next();\n if (r.done)\n return r;\n const value = this.get(r.value);\n return {\n done: false,\n value: [r.value, value]\n };\n }\n };\n }\n [(DRAFT_STATE, Symbol.iterator)]() {\n return this.entries();\n }\n }\n function proxyMap_(target, parent) {\n return new DraftMap(target, parent);\n }\n function prepareMapCopy(state) {\n if (!state.copy_) {\n state.assigned_ = /* @__PURE__ */ new Map();\n state.copy_ = new Map(state.base_);\n }\n }\n class DraftSet extends Set {\n constructor(target, parent) {\n super();\n this[DRAFT_STATE] = {\n type_: 3 /* Set */,\n parent_: parent,\n scope_: parent ? parent.scope_ : getCurrentScope(),\n modified_: false,\n finalized_: false,\n copy_: void 0,\n base_: target,\n draft_: this,\n drafts_: /* @__PURE__ */ new Map(),\n revoked_: false,\n isManual_: false\n };\n }\n get size() {\n return latest(this[DRAFT_STATE]).size;\n }\n has(value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!state.copy_) {\n return state.base_.has(value);\n }\n if (state.copy_.has(value))\n return true;\n if (state.drafts_.has(value) && state.copy_.has(state.drafts_.get(value)))\n return true;\n return false;\n }\n add(value) {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (!this.has(value)) {\n prepareSetCopy(state);\n markChanged(state);\n state.copy_.add(value);\n }\n return this;\n }\n delete(value) {\n if (!this.has(value)) {\n return false;\n }\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n markChanged(state);\n return state.copy_.delete(value) || (state.drafts_.has(value) ? state.copy_.delete(state.drafts_.get(value)) : (\n /* istanbul ignore next */\n false\n ));\n }\n clear() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n if (latest(state).size) {\n prepareSetCopy(state);\n markChanged(state);\n state.copy_.clear();\n }\n }\n values() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n return state.copy_.values();\n }\n entries() {\n const state = this[DRAFT_STATE];\n assertUnrevoked(state);\n prepareSetCopy(state);\n return state.copy_.entries();\n }\n keys() {\n return this.values();\n }\n [(DRAFT_STATE, Symbol.iterator)]() {\n return this.values();\n }\n forEach(cb, thisArg) {\n const iterator = this.values();\n let result = iterator.next();\n while (!result.done) {\n cb.call(thisArg, result.value, result.value, this);\n result = iterator.next();\n }\n }\n }\n function proxySet_(target, parent) {\n return new DraftSet(target, parent);\n }\n function prepareSetCopy(state) {\n if (!state.copy_) {\n state.copy_ = /* @__PURE__ */ new Set();\n state.base_.forEach((value) => {\n if (isDraftable(value)) {\n const draft = createProxy(value, state);\n state.drafts_.set(value, draft);\n state.copy_.add(draft);\n } else {\n state.copy_.add(value);\n }\n });\n }\n }\n function assertUnrevoked(state) {\n if (state.revoked_)\n die(3, JSON.stringify(latest(state)));\n }\n loadPlugin(\"MapSet\", { proxyMap_, proxySet_ });\n}\n\n// src/immer.ts\nvar immer = new Immer2();\nvar produce = immer.produce;\nvar produceWithPatches = immer.produceWithPatches.bind(\n immer\n);\nvar setAutoFreeze = immer.setAutoFreeze.bind(immer);\nvar setUseStrictShallowCopy = immer.setUseStrictShallowCopy.bind(immer);\nvar applyPatches = immer.applyPatches.bind(immer);\nvar createDraft = immer.createDraft.bind(immer);\nvar finishDraft = immer.finishDraft.bind(immer);\nfunction castDraft(value) {\n return value;\n}\nfunction castImmutable(value) {\n return value;\n}\nexport {\n Immer2 as Immer,\n applyPatches,\n castDraft,\n castImmutable,\n createDraft,\n current,\n enableMapSet,\n enablePatches,\n finishDraft,\n freeze,\n DRAFTABLE as immerable,\n isDraft,\n isDraftable,\n NOTHING as nothing,\n original,\n produce,\n produceWithPatches,\n setAutoFreeze,\n setUseStrictShallowCopy\n};\n//# sourceMappingURL=immer.mjs.map","// src/devModeChecks/identityFunctionCheck.ts\nvar runIdentityFunctionCheck = (resultFunc, inputSelectorsResults, outputSelectorResult) => {\n if (inputSelectorsResults.length === 1 && inputSelectorsResults[0] === outputSelectorResult) {\n let isInputSameAsOutput = false;\n try {\n const emptyObject = {};\n if (resultFunc(emptyObject) === emptyObject)\n isInputSameAsOutput = true;\n } catch {\n }\n if (isInputSameAsOutput) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"The result function returned its own inputs without modification. e.g\\n`createSelector([state => state.todos], todos => todos)`\\nThis could lead to inefficient memoization and unnecessary re-renders.\\nEnsure transformation logic is in the result function, and extraction logic is in the input selectors.\",\n { stack }\n );\n }\n }\n};\n\n// src/devModeChecks/inputStabilityCheck.ts\nvar runInputStabilityCheck = (inputSelectorResultsObject, options, inputSelectorArgs) => {\n const { memoize, memoizeOptions } = options;\n const { inputSelectorResults, inputSelectorResultsCopy } = inputSelectorResultsObject;\n const createAnEmptyObject = memoize(() => ({}), ...memoizeOptions);\n const areInputSelectorResultsEqual = createAnEmptyObject.apply(null, inputSelectorResults) === createAnEmptyObject.apply(null, inputSelectorResultsCopy);\n if (!areInputSelectorResultsEqual) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"An input selector returned a different result when passed same arguments.\\nThis means your output selector will likely run more frequently than intended.\\nAvoid returning a new reference inside your input selector, e.g.\\n`createSelector([state => state.todos.map(todo => todo.id)], todoIds => todoIds.length)`\",\n {\n arguments: inputSelectorArgs,\n firstInputs: inputSelectorResults,\n secondInputs: inputSelectorResultsCopy,\n stack\n }\n );\n }\n};\n\n// src/devModeChecks/setGlobalDevModeChecks.ts\nvar globalDevModeChecks = {\n inputStabilityCheck: \"once\",\n identityFunctionCheck: \"once\"\n};\nvar setGlobalDevModeChecks = (devModeChecks) => {\n Object.assign(globalDevModeChecks, devModeChecks);\n};\n\n// src/utils.ts\nvar NOT_FOUND = /* @__PURE__ */ Symbol(\"NOT_FOUND\");\nfunction assertIsFunction(func, errorMessage = `expected a function, instead received ${typeof func}`) {\n if (typeof func !== \"function\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsObject(object, errorMessage = `expected an object, instead received ${typeof object}`) {\n if (typeof object !== \"object\") {\n throw new TypeError(errorMessage);\n }\n}\nfunction assertIsArrayOfFunctions(array, errorMessage = `expected all items to be functions, instead received the following types: `) {\n if (!array.every((item) => typeof item === \"function\")) {\n const itemTypes = array.map(\n (item) => typeof item === \"function\" ? `function ${item.name || \"unnamed\"}()` : typeof item\n ).join(\", \");\n throw new TypeError(`${errorMessage}[${itemTypes}]`);\n }\n}\nvar ensureIsArray = (item) => {\n return Array.isArray(item) ? item : [item];\n};\nfunction getDependencies(createSelectorArgs) {\n const dependencies = Array.isArray(createSelectorArgs[0]) ? createSelectorArgs[0] : createSelectorArgs;\n assertIsArrayOfFunctions(\n dependencies,\n `createSelector expects all input-selectors to be functions, but received the following types: `\n );\n return dependencies;\n}\nfunction collectInputSelectorResults(dependencies, inputSelectorArgs) {\n const inputSelectorResults = [];\n const { length } = dependencies;\n for (let i = 0; i < length; i++) {\n inputSelectorResults.push(dependencies[i].apply(null, inputSelectorArgs));\n }\n return inputSelectorResults;\n}\nvar getDevModeChecksExecutionInfo = (firstRun, devModeChecks) => {\n const { identityFunctionCheck, inputStabilityCheck } = {\n ...globalDevModeChecks,\n ...devModeChecks\n };\n return {\n identityFunctionCheck: {\n shouldRun: identityFunctionCheck === \"always\" || identityFunctionCheck === \"once\" && firstRun,\n run: runIdentityFunctionCheck\n },\n inputStabilityCheck: {\n shouldRun: inputStabilityCheck === \"always\" || inputStabilityCheck === \"once\" && firstRun,\n run: runInputStabilityCheck\n }\n };\n};\n\n// src/autotrackMemoize/autotracking.ts\nvar $REVISION = 0;\nvar CURRENT_TRACKER = null;\nvar Cell = class {\n revision = $REVISION;\n _value;\n _lastValue;\n _isEqual = tripleEq;\n constructor(initialValue, isEqual = tripleEq) {\n this._value = this._lastValue = initialValue;\n this._isEqual = isEqual;\n }\n // Whenever a storage value is read, it'll add itself to the current tracker if\n // one exists, entangling its state with that cache.\n get value() {\n CURRENT_TRACKER?.add(this);\n return this._value;\n }\n // Whenever a storage value is updated, we bump the global revision clock,\n // assign the revision for this storage to the new value, _and_ we schedule a\n // rerender. This is important, and it's what makes autotracking _pull_\n // based. We don't actively tell the caches which depend on the storage that\n // anything has happened. Instead, we recompute the caches when needed.\n set value(newValue) {\n if (this.value === newValue)\n return;\n this._value = newValue;\n this.revision = ++$REVISION;\n }\n};\nfunction tripleEq(a, b) {\n return a === b;\n}\nvar TrackingCache = class {\n _cachedValue;\n _cachedRevision = -1;\n _deps = [];\n hits = 0;\n fn;\n constructor(fn) {\n this.fn = fn;\n }\n clear() {\n this._cachedValue = void 0;\n this._cachedRevision = -1;\n this._deps = [];\n this.hits = 0;\n }\n get value() {\n if (this.revision > this._cachedRevision) {\n const { fn } = this;\n const currentTracker = /* @__PURE__ */ new Set();\n const prevTracker = CURRENT_TRACKER;\n CURRENT_TRACKER = currentTracker;\n this._cachedValue = fn();\n CURRENT_TRACKER = prevTracker;\n this.hits++;\n this._deps = Array.from(currentTracker);\n this._cachedRevision = this.revision;\n }\n CURRENT_TRACKER?.add(this);\n return this._cachedValue;\n }\n get revision() {\n return Math.max(...this._deps.map((d) => d.revision), 0);\n }\n};\nfunction getValue(cell) {\n if (!(cell instanceof Cell)) {\n console.warn(\"Not a valid cell! \", cell);\n }\n return cell.value;\n}\nfunction setValue(storage, value) {\n if (!(storage instanceof Cell)) {\n throw new TypeError(\n \"setValue must be passed a tracked store created with `createStorage`.\"\n );\n }\n storage.value = storage._lastValue = value;\n}\nfunction createCell(initialValue, isEqual = tripleEq) {\n return new Cell(initialValue, isEqual);\n}\nfunction createCache(fn) {\n assertIsFunction(\n fn,\n \"the first parameter to `createCache` must be a function\"\n );\n return new TrackingCache(fn);\n}\n\n// src/autotrackMemoize/tracking.ts\nvar neverEq = (a, b) => false;\nfunction createTag() {\n return createCell(null, neverEq);\n}\nfunction dirtyTag(tag, value) {\n setValue(tag, value);\n}\nvar consumeCollection = (node) => {\n let tag = node.collectionTag;\n if (tag === null) {\n tag = node.collectionTag = createTag();\n }\n getValue(tag);\n};\nvar dirtyCollection = (node) => {\n const tag = node.collectionTag;\n if (tag !== null) {\n dirtyTag(tag, null);\n }\n};\n\n// src/autotrackMemoize/proxy.ts\nvar REDUX_PROXY_LABEL = Symbol();\nvar nextId = 0;\nvar proto = Object.getPrototypeOf({});\nvar ObjectTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy(this, objectProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar objectProxyHandler = {\n get(node, key) {\n function calculateResult() {\n const { value } = node;\n const childValue = Reflect.get(value, key);\n if (typeof key === \"symbol\") {\n return childValue;\n }\n if (key in proto) {\n return childValue;\n }\n if (typeof childValue === \"object\" && childValue !== null) {\n let childNode = node.children[key];\n if (childNode === void 0) {\n childNode = node.children[key] = createNode(childValue);\n }\n if (childNode.tag) {\n getValue(childNode.tag);\n }\n return childNode.proxy;\n } else {\n let tag = node.tags[key];\n if (tag === void 0) {\n tag = node.tags[key] = createTag();\n tag.value = childValue;\n }\n getValue(tag);\n return childValue;\n }\n }\n const res = calculateResult();\n return res;\n },\n ownKeys(node) {\n consumeCollection(node);\n return Reflect.ownKeys(node.value);\n },\n getOwnPropertyDescriptor(node, prop) {\n return Reflect.getOwnPropertyDescriptor(node.value, prop);\n },\n has(node, prop) {\n return Reflect.has(node.value, prop);\n }\n};\nvar ArrayTreeNode = class {\n constructor(value) {\n this.value = value;\n this.value = value;\n this.tag.value = value;\n }\n proxy = new Proxy([this], arrayProxyHandler);\n tag = createTag();\n tags = {};\n children = {};\n collectionTag = null;\n id = nextId++;\n};\nvar arrayProxyHandler = {\n get([node], key) {\n if (key === \"length\") {\n consumeCollection(node);\n }\n return objectProxyHandler.get(node, key);\n },\n ownKeys([node]) {\n return objectProxyHandler.ownKeys(node);\n },\n getOwnPropertyDescriptor([node], prop) {\n return objectProxyHandler.getOwnPropertyDescriptor(node, prop);\n },\n has([node], prop) {\n return objectProxyHandler.has(node, prop);\n }\n};\nfunction createNode(value) {\n if (Array.isArray(value)) {\n return new ArrayTreeNode(value);\n }\n return new ObjectTreeNode(value);\n}\nfunction updateNode(node, newValue) {\n const { value, tags, children } = node;\n node.value = newValue;\n if (Array.isArray(value) && Array.isArray(newValue) && value.length !== newValue.length) {\n dirtyCollection(node);\n } else {\n if (value !== newValue) {\n let oldKeysSize = 0;\n let newKeysSize = 0;\n let anyKeysAdded = false;\n for (const _key in value) {\n oldKeysSize++;\n }\n for (const key in newValue) {\n newKeysSize++;\n if (!(key in value)) {\n anyKeysAdded = true;\n break;\n }\n }\n const isDifferent = anyKeysAdded || oldKeysSize !== newKeysSize;\n if (isDifferent) {\n dirtyCollection(node);\n }\n }\n }\n for (const key in tags) {\n const childValue = value[key];\n const newChildValue = newValue[key];\n if (childValue !== newChildValue) {\n dirtyCollection(node);\n dirtyTag(tags[key], newChildValue);\n }\n if (typeof newChildValue === \"object\" && newChildValue !== null) {\n delete tags[key];\n }\n }\n for (const key in children) {\n const childNode = children[key];\n const newChildValue = newValue[key];\n const childValue = childNode.value;\n if (childValue === newChildValue) {\n continue;\n } else if (typeof newChildValue === \"object\" && newChildValue !== null) {\n updateNode(childNode, newChildValue);\n } else {\n deleteNode(childNode);\n delete children[key];\n }\n }\n}\nfunction deleteNode(node) {\n if (node.tag) {\n dirtyTag(node.tag, null);\n }\n dirtyCollection(node);\n for (const key in node.tags) {\n dirtyTag(node.tags[key], null);\n }\n for (const key in node.children) {\n deleteNode(node.children[key]);\n }\n}\n\n// src/lruMemoize.ts\nfunction createSingletonCache(equals) {\n let entry;\n return {\n get(key) {\n if (entry && equals(entry.key, key)) {\n return entry.value;\n }\n return NOT_FOUND;\n },\n put(key, value) {\n entry = { key, value };\n },\n getEntries() {\n return entry ? [entry] : [];\n },\n clear() {\n entry = void 0;\n }\n };\n}\nfunction createLruCache(maxSize, equals) {\n let entries = [];\n function get(key) {\n const cacheIndex = entries.findIndex((entry) => equals(key, entry.key));\n if (cacheIndex > -1) {\n const entry = entries[cacheIndex];\n if (cacheIndex > 0) {\n entries.splice(cacheIndex, 1);\n entries.unshift(entry);\n }\n return entry.value;\n }\n return NOT_FOUND;\n }\n function put(key, value) {\n if (get(key) === NOT_FOUND) {\n entries.unshift({ key, value });\n if (entries.length > maxSize) {\n entries.pop();\n }\n }\n }\n function getEntries() {\n return entries;\n }\n function clear() {\n entries = [];\n }\n return { get, put, getEntries, clear };\n}\nvar referenceEqualityCheck = (a, b) => a === b;\nfunction createCacheKeyComparator(equalityCheck) {\n return function areArgumentsShallowlyEqual(prev, next) {\n if (prev === null || next === null || prev.length !== next.length) {\n return false;\n }\n const { length } = prev;\n for (let i = 0; i < length; i++) {\n if (!equalityCheck(prev[i], next[i])) {\n return false;\n }\n }\n return true;\n };\n}\nfunction lruMemoize(func, equalityCheckOrOptions) {\n const providedOptions = typeof equalityCheckOrOptions === \"object\" ? equalityCheckOrOptions : { equalityCheck: equalityCheckOrOptions };\n const {\n equalityCheck = referenceEqualityCheck,\n maxSize = 1,\n resultEqualityCheck\n } = providedOptions;\n const comparator = createCacheKeyComparator(equalityCheck);\n let resultsCount = 0;\n const cache = maxSize <= 1 ? createSingletonCache(comparator) : createLruCache(maxSize, comparator);\n function memoized() {\n let value = cache.get(arguments);\n if (value === NOT_FOUND) {\n value = func.apply(null, arguments);\n resultsCount++;\n if (resultEqualityCheck) {\n const entries = cache.getEntries();\n const matchingEntry = entries.find(\n (entry) => resultEqualityCheck(entry.value, value)\n );\n if (matchingEntry) {\n value = matchingEntry.value;\n resultsCount !== 0 && resultsCount--;\n }\n }\n cache.put(arguments, value);\n }\n return value;\n }\n memoized.clearCache = () => {\n cache.clear();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/autotrackMemoize/autotrackMemoize.ts\nfunction autotrackMemoize(func) {\n const node = createNode(\n []\n );\n let lastArgs = null;\n const shallowEqual = createCacheKeyComparator(referenceEqualityCheck);\n const cache = createCache(() => {\n const res = func.apply(null, node.proxy);\n return res;\n });\n function memoized() {\n if (!shallowEqual(lastArgs, arguments)) {\n updateNode(node, arguments);\n lastArgs = arguments;\n }\n return cache.value;\n }\n memoized.clearCache = () => {\n return cache.clear();\n };\n return memoized;\n}\n\n// src/weakMapMemoize.ts\nvar StrongRef = class {\n constructor(value) {\n this.value = value;\n }\n deref() {\n return this.value;\n }\n};\nvar Ref = typeof WeakRef !== \"undefined\" ? WeakRef : StrongRef;\nvar UNTERMINATED = 0;\nvar TERMINATED = 1;\nfunction createCacheNode() {\n return {\n s: UNTERMINATED,\n v: void 0,\n o: null,\n p: null\n };\n}\nfunction weakMapMemoize(func, options = {}) {\n let fnNode = createCacheNode();\n const { resultEqualityCheck } = options;\n let lastResult;\n let resultsCount = 0;\n function memoized() {\n let cacheNode = fnNode;\n const { length } = arguments;\n for (let i = 0, l = length; i < l; i++) {\n const arg = arguments[i];\n if (typeof arg === \"function\" || typeof arg === \"object\" && arg !== null) {\n let objectCache = cacheNode.o;\n if (objectCache === null) {\n cacheNode.o = objectCache = /* @__PURE__ */ new WeakMap();\n }\n const objectNode = objectCache.get(arg);\n if (objectNode === void 0) {\n cacheNode = createCacheNode();\n objectCache.set(arg, cacheNode);\n } else {\n cacheNode = objectNode;\n }\n } else {\n let primitiveCache = cacheNode.p;\n if (primitiveCache === null) {\n cacheNode.p = primitiveCache = /* @__PURE__ */ new Map();\n }\n const primitiveNode = primitiveCache.get(arg);\n if (primitiveNode === void 0) {\n cacheNode = createCacheNode();\n primitiveCache.set(arg, cacheNode);\n } else {\n cacheNode = primitiveNode;\n }\n }\n }\n const terminatedNode = cacheNode;\n let result;\n if (cacheNode.s === TERMINATED) {\n result = cacheNode.v;\n } else {\n result = func.apply(null, arguments);\n resultsCount++;\n if (resultEqualityCheck) {\n const lastResultValue = lastResult?.deref?.() ?? lastResult;\n if (lastResultValue != null && resultEqualityCheck(lastResultValue, result)) {\n result = lastResultValue;\n resultsCount !== 0 && resultsCount--;\n }\n const needsWeakRef = typeof result === \"object\" && result !== null || typeof result === \"function\";\n lastResult = needsWeakRef ? new Ref(result) : result;\n }\n }\n terminatedNode.s = TERMINATED;\n terminatedNode.v = result;\n return result;\n }\n memoized.clearCache = () => {\n fnNode = createCacheNode();\n memoized.resetResultsCount();\n };\n memoized.resultsCount = () => resultsCount;\n memoized.resetResultsCount = () => {\n resultsCount = 0;\n };\n return memoized;\n}\n\n// src/createSelectorCreator.ts\nfunction createSelectorCreator(memoizeOrOptions, ...memoizeOptionsFromArgs) {\n const createSelectorCreatorOptions = typeof memoizeOrOptions === \"function\" ? {\n memoize: memoizeOrOptions,\n memoizeOptions: memoizeOptionsFromArgs\n } : memoizeOrOptions;\n const createSelector2 = (...createSelectorArgs) => {\n let recomputations = 0;\n let dependencyRecomputations = 0;\n let lastResult;\n let directlyPassedOptions = {};\n let resultFunc = createSelectorArgs.pop();\n if (typeof resultFunc === \"object\") {\n directlyPassedOptions = resultFunc;\n resultFunc = createSelectorArgs.pop();\n }\n assertIsFunction(\n resultFunc,\n `createSelector expects an output function after the inputs, but received: [${typeof resultFunc}]`\n );\n const combinedOptions = {\n ...createSelectorCreatorOptions,\n ...directlyPassedOptions\n };\n const {\n memoize,\n memoizeOptions = [],\n argsMemoize = weakMapMemoize,\n argsMemoizeOptions = [],\n devModeChecks = {}\n } = combinedOptions;\n const finalMemoizeOptions = ensureIsArray(memoizeOptions);\n const finalArgsMemoizeOptions = ensureIsArray(argsMemoizeOptions);\n const dependencies = getDependencies(createSelectorArgs);\n const memoizedResultFunc = memoize(function recomputationWrapper() {\n recomputations++;\n return resultFunc.apply(\n null,\n arguments\n );\n }, ...finalMemoizeOptions);\n let firstRun = true;\n const selector = argsMemoize(function dependenciesChecker() {\n dependencyRecomputations++;\n const inputSelectorResults = collectInputSelectorResults(\n dependencies,\n arguments\n );\n lastResult = memoizedResultFunc.apply(null, inputSelectorResults);\n if (process.env.NODE_ENV !== \"production\") {\n const { identityFunctionCheck, inputStabilityCheck } = getDevModeChecksExecutionInfo(firstRun, devModeChecks);\n if (identityFunctionCheck.shouldRun) {\n identityFunctionCheck.run(\n resultFunc,\n inputSelectorResults,\n lastResult\n );\n }\n if (inputStabilityCheck.shouldRun) {\n const inputSelectorResultsCopy = collectInputSelectorResults(\n dependencies,\n arguments\n );\n inputStabilityCheck.run(\n { inputSelectorResults, inputSelectorResultsCopy },\n { memoize, memoizeOptions: finalMemoizeOptions },\n arguments\n );\n }\n if (firstRun)\n firstRun = false;\n }\n return lastResult;\n }, ...finalArgsMemoizeOptions);\n return Object.assign(selector, {\n resultFunc,\n memoizedResultFunc,\n dependencies,\n dependencyRecomputations: () => dependencyRecomputations,\n resetDependencyRecomputations: () => {\n dependencyRecomputations = 0;\n },\n lastResult: () => lastResult,\n recomputations: () => recomputations,\n resetRecomputations: () => {\n recomputations = 0;\n },\n memoize,\n argsMemoize\n });\n };\n Object.assign(createSelector2, {\n withTypes: () => createSelector2\n });\n return createSelector2;\n}\nvar createSelector = /* @__PURE__ */ createSelectorCreator(weakMapMemoize);\n\n// src/createStructuredSelector.ts\nvar createStructuredSelector = Object.assign(\n (inputSelectorsObject, selectorCreator = createSelector) => {\n assertIsObject(\n inputSelectorsObject,\n `createStructuredSelector expects first argument to be an object where each property is a selector, instead received a ${typeof inputSelectorsObject}`\n );\n const inputSelectorKeys = Object.keys(inputSelectorsObject);\n const dependencies = inputSelectorKeys.map(\n (key) => inputSelectorsObject[key]\n );\n const structuredSelector = selectorCreator(\n dependencies,\n (...inputSelectorResults) => {\n return inputSelectorResults.reduce((composition, value, index) => {\n composition[inputSelectorKeys[index]] = value;\n return composition;\n }, {});\n }\n );\n return structuredSelector;\n },\n { withTypes: () => createStructuredSelector }\n);\nexport {\n createSelector,\n createSelectorCreator,\n createStructuredSelector,\n lruMemoize,\n referenceEqualityCheck,\n setGlobalDevModeChecks,\n autotrackMemoize as unstable_autotrackMemoize,\n weakMapMemoize\n};\n//# sourceMappingURL=reselect.mjs.map","// src/index.ts\nfunction createThunkMiddleware(extraArgument) {\n const middleware = ({ dispatch, getState }) => (next) => (action) => {\n if (typeof action === \"function\") {\n return action(dispatch, getState, extraArgument);\n }\n return next(action);\n };\n return middleware;\n}\nvar thunk = createThunkMiddleware();\nvar withExtraArgument = createThunkMiddleware;\nexport {\n thunk,\n withExtraArgument\n};\n","// src/index.ts\nexport * from \"redux\";\nimport { produce, current as current3, freeze, original as original2, isDraft as isDraft5 } from \"immer\";\nimport { createSelector, createSelectorCreator as createSelectorCreator2, lruMemoize, weakMapMemoize as weakMapMemoize2 } from \"reselect\";\n\n// src/createDraftSafeSelector.ts\nimport { current, isDraft } from \"immer\";\nimport { createSelectorCreator, weakMapMemoize } from \"reselect\";\nvar createDraftSafeSelectorCreator = (...args) => {\n const createSelector2 = createSelectorCreator(...args);\n const createDraftSafeSelector2 = Object.assign((...args2) => {\n const selector = createSelector2(...args2);\n const wrappedSelector = (value, ...rest) => selector(isDraft(value) ? current(value) : value, ...rest);\n Object.assign(wrappedSelector, selector);\n return wrappedSelector;\n }, {\n withTypes: () => createDraftSafeSelector2\n });\n return createDraftSafeSelector2;\n};\nvar createDraftSafeSelector = /* @__PURE__ */ createDraftSafeSelectorCreator(weakMapMemoize);\n\n// src/configureStore.ts\nimport { applyMiddleware, createStore, compose as compose2, combineReducers, isPlainObject as isPlainObject2 } from \"redux\";\n\n// src/devtoolsExtension.ts\nimport { compose } from \"redux\";\nvar composeWithDevTools = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ : function() {\n if (arguments.length === 0) return void 0;\n if (typeof arguments[0] === \"object\") return compose;\n return compose.apply(null, arguments);\n};\nvar devToolsEnhancer = typeof window !== \"undefined\" && window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__ : function() {\n return function(noop3) {\n return noop3;\n };\n};\n\n// src/getDefaultMiddleware.ts\nimport { thunk as thunkMiddleware, withExtraArgument } from \"redux-thunk\";\n\n// src/createAction.ts\nimport { isAction } from \"redux\";\n\n// src/tsHelpers.ts\nvar hasMatchFunction = (v) => {\n return v && typeof v.match === \"function\";\n};\n\n// src/createAction.ts\nfunction createAction(type, prepareAction) {\n function actionCreator(...args) {\n if (prepareAction) {\n let prepared = prepareAction(...args);\n if (!prepared) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : \"prepareAction did not return an object\");\n }\n return {\n type,\n payload: prepared.payload,\n ...\"meta\" in prepared && {\n meta: prepared.meta\n },\n ...\"error\" in prepared && {\n error: prepared.error\n }\n };\n }\n return {\n type,\n payload: args[0]\n };\n }\n actionCreator.toString = () => `${type}`;\n actionCreator.type = type;\n actionCreator.match = (action) => isAction(action) && action.type === type;\n return actionCreator;\n}\nfunction isActionCreator(action) {\n return typeof action === \"function\" && \"type\" in action && // hasMatchFunction only wants Matchers but I don't see the point in rewriting it\n hasMatchFunction(action);\n}\nfunction isFSA(action) {\n return isAction(action) && Object.keys(action).every(isValidKey);\n}\nfunction isValidKey(key) {\n return [\"type\", \"payload\", \"error\", \"meta\"].indexOf(key) > -1;\n}\n\n// src/actionCreatorInvariantMiddleware.ts\nfunction getMessage(type) {\n const splitType = type ? `${type}`.split(\"/\") : [];\n const actionName = splitType[splitType.length - 1] || \"actionCreator\";\n return `Detected an action creator with type \"${type || \"unknown\"}\" being dispatched. \nMake sure you're calling the action creator before dispatching, i.e. \\`dispatch(${actionName}())\\` instead of \\`dispatch(${actionName})\\`. This is necessary even if the action has no payload.`;\n}\nfunction createActionCreatorInvariantMiddleware(options = {}) {\n if (process.env.NODE_ENV === \"production\") {\n return () => (next) => (action) => next(action);\n }\n const {\n isActionCreator: isActionCreator2 = isActionCreator\n } = options;\n return () => (next) => (action) => {\n if (isActionCreator2(action)) {\n console.warn(getMessage(action.type));\n }\n return next(action);\n };\n}\n\n// src/utils.ts\nimport { produce as createNextState, isDraftable } from \"immer\";\nfunction getTimeMeasureUtils(maxDelay, fnName) {\n let elapsed = 0;\n return {\n measureTime(fn) {\n const started = Date.now();\n try {\n return fn();\n } finally {\n const finished = Date.now();\n elapsed += finished - started;\n }\n },\n warnIfExceeded() {\n if (elapsed > maxDelay) {\n console.warn(`${fnName} took ${elapsed}ms, which is more than the warning threshold of ${maxDelay}ms. \nIf your state or actions are very large, you may want to disable the middleware as it might cause too much of a slowdown in development mode. See https://redux-toolkit.js.org/api/getDefaultMiddleware for instructions.\nIt is disabled in production builds, so you don't need to worry about that.`);\n }\n }\n };\n}\nvar Tuple = class _Tuple extends Array {\n constructor(...items) {\n super(...items);\n Object.setPrototypeOf(this, _Tuple.prototype);\n }\n static get [Symbol.species]() {\n return _Tuple;\n }\n concat(...arr) {\n return super.concat.apply(this, arr);\n }\n prepend(...arr) {\n if (arr.length === 1 && Array.isArray(arr[0])) {\n return new _Tuple(...arr[0].concat(this));\n }\n return new _Tuple(...arr.concat(this));\n }\n};\nfunction freezeDraftable(val) {\n return isDraftable(val) ? createNextState(val, () => {\n }) : val;\n}\nfunction getOrInsertComputed(map, key, compute) {\n if (map.has(key)) return map.get(key);\n return map.set(key, compute(key)).get(key);\n}\n\n// src/immutableStateInvariantMiddleware.ts\nfunction isImmutableDefault(value) {\n return typeof value !== \"object\" || value == null || Object.isFrozen(value);\n}\nfunction trackForMutations(isImmutable, ignorePaths, obj) {\n const trackedProperties = trackProperties(isImmutable, ignorePaths, obj);\n return {\n detectMutations() {\n return detectMutations(isImmutable, ignorePaths, trackedProperties, obj);\n }\n };\n}\nfunction trackProperties(isImmutable, ignorePaths = [], obj, path = \"\", checkedObjects = /* @__PURE__ */ new Set()) {\n const tracked = {\n value: obj\n };\n if (!isImmutable(obj) && !checkedObjects.has(obj)) {\n checkedObjects.add(obj);\n tracked.children = {};\n for (const key in obj) {\n const childPath = path ? path + \".\" + key : key;\n if (ignorePaths.length && ignorePaths.indexOf(childPath) !== -1) {\n continue;\n }\n tracked.children[key] = trackProperties(isImmutable, ignorePaths, obj[key], childPath);\n }\n }\n return tracked;\n}\nfunction detectMutations(isImmutable, ignoredPaths = [], trackedProperty, obj, sameParentRef = false, path = \"\") {\n const prevObj = trackedProperty ? trackedProperty.value : void 0;\n const sameRef = prevObj === obj;\n if (sameParentRef && !sameRef && !Number.isNaN(obj)) {\n return {\n wasMutated: true,\n path\n };\n }\n if (isImmutable(prevObj) || isImmutable(obj)) {\n return {\n wasMutated: false\n };\n }\n const keysToDetect = {};\n for (let key in trackedProperty.children) {\n keysToDetect[key] = true;\n }\n for (let key in obj) {\n keysToDetect[key] = true;\n }\n const hasIgnoredPaths = ignoredPaths.length > 0;\n for (let key in keysToDetect) {\n const nestedPath = path ? path + \".\" + key : key;\n if (hasIgnoredPaths) {\n const hasMatches = ignoredPaths.some((ignored) => {\n if (ignored instanceof RegExp) {\n return ignored.test(nestedPath);\n }\n return nestedPath === ignored;\n });\n if (hasMatches) {\n continue;\n }\n }\n const result = detectMutations(isImmutable, ignoredPaths, trackedProperty.children[key], obj[key], sameRef, nestedPath);\n if (result.wasMutated) {\n return result;\n }\n }\n return {\n wasMutated: false\n };\n}\nfunction createImmutableStateInvariantMiddleware(options = {}) {\n if (process.env.NODE_ENV === \"production\") {\n return () => (next) => (action) => next(action);\n } else {\n let stringify2 = function(obj, serializer, indent, decycler) {\n return JSON.stringify(obj, getSerialize2(serializer, decycler), indent);\n }, getSerialize2 = function(serializer, decycler) {\n let stack = [], keys = [];\n if (!decycler) decycler = function(_, value) {\n if (stack[0] === value) return \"[Circular ~]\";\n return \"[Circular ~.\" + keys.slice(0, stack.indexOf(value)).join(\".\") + \"]\";\n };\n return function(key, value) {\n if (stack.length > 0) {\n var thisPos = stack.indexOf(this);\n ~thisPos ? stack.splice(thisPos + 1) : stack.push(this);\n ~thisPos ? keys.splice(thisPos, Infinity, key) : keys.push(key);\n if (~stack.indexOf(value)) value = decycler.call(this, key, value);\n } else stack.push(value);\n return serializer == null ? value : serializer.call(this, key, value);\n };\n };\n var stringify = stringify2, getSerialize = getSerialize2;\n let {\n isImmutable = isImmutableDefault,\n ignoredPaths,\n warnAfter = 32\n } = options;\n const track = trackForMutations.bind(null, isImmutable, ignoredPaths);\n return ({\n getState\n }) => {\n let state = getState();\n let tracker = track(state);\n let result;\n return (next) => (action) => {\n const measureUtils = getTimeMeasureUtils(warnAfter, \"ImmutableStateInvariantMiddleware\");\n measureUtils.measureTime(() => {\n state = getState();\n result = tracker.detectMutations();\n tracker = track(state);\n if (result.wasMutated) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(19) : `A state mutation was detected between dispatches, in the path '${result.path || \"\"}'. This may cause incorrect behavior. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`);\n }\n });\n const dispatchedAction = next(action);\n measureUtils.measureTime(() => {\n state = getState();\n result = tracker.detectMutations();\n tracker = track(state);\n if (result.wasMutated) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(20) : `A state mutation was detected inside a dispatch, in the path: ${result.path || \"\"}. Take a look at the reducer(s) handling the action ${stringify2(action)}. (https://redux.js.org/style-guide/style-guide#do-not-mutate-state)`);\n }\n });\n measureUtils.warnIfExceeded();\n return dispatchedAction;\n };\n };\n }\n}\n\n// src/serializableStateInvariantMiddleware.ts\nimport { isAction as isAction2, isPlainObject } from \"redux\";\nfunction isPlain(val) {\n const type = typeof val;\n return val == null || type === \"string\" || type === \"boolean\" || type === \"number\" || Array.isArray(val) || isPlainObject(val);\n}\nfunction findNonSerializableValue(value, path = \"\", isSerializable = isPlain, getEntries, ignoredPaths = [], cache) {\n let foundNestedSerializable;\n if (!isSerializable(value)) {\n return {\n keyPath: path || \"\",\n value\n };\n }\n if (typeof value !== \"object\" || value === null) {\n return false;\n }\n if (cache?.has(value)) return false;\n const entries = getEntries != null ? getEntries(value) : Object.entries(value);\n const hasIgnoredPaths = ignoredPaths.length > 0;\n for (const [key, nestedValue] of entries) {\n const nestedPath = path ? path + \".\" + key : key;\n if (hasIgnoredPaths) {\n const hasMatches = ignoredPaths.some((ignored) => {\n if (ignored instanceof RegExp) {\n return ignored.test(nestedPath);\n }\n return nestedPath === ignored;\n });\n if (hasMatches) {\n continue;\n }\n }\n if (!isSerializable(nestedValue)) {\n return {\n keyPath: nestedPath,\n value: nestedValue\n };\n }\n if (typeof nestedValue === \"object\") {\n foundNestedSerializable = findNonSerializableValue(nestedValue, nestedPath, isSerializable, getEntries, ignoredPaths, cache);\n if (foundNestedSerializable) {\n return foundNestedSerializable;\n }\n }\n }\n if (cache && isNestedFrozen(value)) cache.add(value);\n return false;\n}\nfunction isNestedFrozen(value) {\n if (!Object.isFrozen(value)) return false;\n for (const nestedValue of Object.values(value)) {\n if (typeof nestedValue !== \"object\" || nestedValue === null) continue;\n if (!isNestedFrozen(nestedValue)) return false;\n }\n return true;\n}\nfunction createSerializableStateInvariantMiddleware(options = {}) {\n if (process.env.NODE_ENV === \"production\") {\n return () => (next) => (action) => next(action);\n } else {\n const {\n isSerializable = isPlain,\n getEntries,\n ignoredActions = [],\n ignoredActionPaths = [\"meta.arg\", \"meta.baseQueryMeta\"],\n ignoredPaths = [],\n warnAfter = 32,\n ignoreState = false,\n ignoreActions = false,\n disableCache = false\n } = options;\n const cache = !disableCache && WeakSet ? /* @__PURE__ */ new WeakSet() : void 0;\n return (storeAPI) => (next) => (action) => {\n if (!isAction2(action)) {\n return next(action);\n }\n const result = next(action);\n const measureUtils = getTimeMeasureUtils(warnAfter, \"SerializableStateInvariantMiddleware\");\n if (!ignoreActions && !(ignoredActions.length && ignoredActions.indexOf(action.type) !== -1)) {\n measureUtils.measureTime(() => {\n const foundActionNonSerializableValue = findNonSerializableValue(action, \"\", isSerializable, getEntries, ignoredActionPaths, cache);\n if (foundActionNonSerializableValue) {\n const {\n keyPath,\n value\n } = foundActionNonSerializableValue;\n console.error(`A non-serializable value was detected in an action, in the path: \\`${keyPath}\\`. Value:`, value, \"\\nTake a look at the logic that dispatched this action: \", action, \"\\n(See https://redux.js.org/faq/actions#why-should-type-be-a-string-or-at-least-serializable-why-should-my-action-types-be-constants)\", \"\\n(To allow non-serializable values see: https://redux-toolkit.js.org/usage/usage-guide#working-with-non-serializable-data)\");\n }\n });\n }\n if (!ignoreState) {\n measureUtils.measureTime(() => {\n const state = storeAPI.getState();\n const foundStateNonSerializableValue = findNonSerializableValue(state, \"\", isSerializable, getEntries, ignoredPaths, cache);\n if (foundStateNonSerializableValue) {\n const {\n keyPath,\n value\n } = foundStateNonSerializableValue;\n console.error(`A non-serializable value was detected in the state, in the path: \\`${keyPath}\\`. Value:`, value, `\nTake a look at the reducer(s) handling this action type: ${action.type}.\n(See https://redux.js.org/faq/organizing-state#can-i-put-functions-promises-or-other-non-serializable-items-in-my-store-state)`);\n }\n });\n measureUtils.warnIfExceeded();\n }\n return result;\n };\n }\n}\n\n// src/getDefaultMiddleware.ts\nfunction isBoolean(x) {\n return typeof x === \"boolean\";\n}\nvar buildGetDefaultMiddleware = () => function getDefaultMiddleware(options) {\n const {\n thunk = true,\n immutableCheck = true,\n serializableCheck = true,\n actionCreatorCheck = true\n } = options ?? {};\n let middlewareArray = new Tuple();\n if (thunk) {\n if (isBoolean(thunk)) {\n middlewareArray.push(thunkMiddleware);\n } else {\n middlewareArray.push(withExtraArgument(thunk.extraArgument));\n }\n }\n if (process.env.NODE_ENV !== \"production\") {\n if (immutableCheck) {\n let immutableOptions = {};\n if (!isBoolean(immutableCheck)) {\n immutableOptions = immutableCheck;\n }\n middlewareArray.unshift(createImmutableStateInvariantMiddleware(immutableOptions));\n }\n if (serializableCheck) {\n let serializableOptions = {};\n if (!isBoolean(serializableCheck)) {\n serializableOptions = serializableCheck;\n }\n middlewareArray.push(createSerializableStateInvariantMiddleware(serializableOptions));\n }\n if (actionCreatorCheck) {\n let actionCreatorOptions = {};\n if (!isBoolean(actionCreatorCheck)) {\n actionCreatorOptions = actionCreatorCheck;\n }\n middlewareArray.unshift(createActionCreatorInvariantMiddleware(actionCreatorOptions));\n }\n }\n return middlewareArray;\n};\n\n// src/autoBatchEnhancer.ts\nvar SHOULD_AUTOBATCH = \"RTK_autoBatch\";\nvar prepareAutoBatched = () => (payload) => ({\n payload,\n meta: {\n [SHOULD_AUTOBATCH]: true\n }\n});\nvar createQueueWithTimer = (timeout) => {\n return (notify) => {\n setTimeout(notify, timeout);\n };\n};\nvar autoBatchEnhancer = (options = {\n type: \"raf\"\n}) => (next) => (...args) => {\n const store = next(...args);\n let notifying = true;\n let shouldNotifyAtEndOfTick = false;\n let notificationQueued = false;\n const listeners = /* @__PURE__ */ new Set();\n const queueCallback = options.type === \"tick\" ? queueMicrotask : options.type === \"raf\" ? (\n // requestAnimationFrame won't exist in SSR environments. Fall back to a vague approximation just to keep from erroring.\n typeof window !== \"undefined\" && window.requestAnimationFrame ? window.requestAnimationFrame : createQueueWithTimer(10)\n ) : options.type === \"callback\" ? options.queueNotification : createQueueWithTimer(options.timeout);\n const notifyListeners = () => {\n notificationQueued = false;\n if (shouldNotifyAtEndOfTick) {\n shouldNotifyAtEndOfTick = false;\n listeners.forEach((l) => l());\n }\n };\n return Object.assign({}, store, {\n // Override the base `store.subscribe` method to keep original listeners\n // from running if we're delaying notifications\n subscribe(listener2) {\n const wrappedListener = () => notifying && listener2();\n const unsubscribe = store.subscribe(wrappedListener);\n listeners.add(listener2);\n return () => {\n unsubscribe();\n listeners.delete(listener2);\n };\n },\n // Override the base `store.dispatch` method so that we can check actions\n // for the `shouldAutoBatch` flag and determine if batching is active\n dispatch(action) {\n try {\n notifying = !action?.meta?.[SHOULD_AUTOBATCH];\n shouldNotifyAtEndOfTick = !notifying;\n if (shouldNotifyAtEndOfTick) {\n if (!notificationQueued) {\n notificationQueued = true;\n queueCallback(notifyListeners);\n }\n }\n return store.dispatch(action);\n } finally {\n notifying = true;\n }\n }\n });\n};\n\n// src/getDefaultEnhancers.ts\nvar buildGetDefaultEnhancers = (middlewareEnhancer) => function getDefaultEnhancers(options) {\n const {\n autoBatch = true\n } = options ?? {};\n let enhancerArray = new Tuple(middlewareEnhancer);\n if (autoBatch) {\n enhancerArray.push(autoBatchEnhancer(typeof autoBatch === \"object\" ? autoBatch : void 0));\n }\n return enhancerArray;\n};\n\n// src/configureStore.ts\nfunction configureStore(options) {\n const getDefaultMiddleware = buildGetDefaultMiddleware();\n const {\n reducer = void 0,\n middleware,\n devTools = true,\n preloadedState = void 0,\n enhancers = void 0\n } = options || {};\n let rootReducer;\n if (typeof reducer === \"function\") {\n rootReducer = reducer;\n } else if (isPlainObject2(reducer)) {\n rootReducer = combineReducers(reducer);\n } else {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : \"`reducer` is a required argument, and must be a function or an object of functions that can be passed to combineReducers\");\n }\n if (process.env.NODE_ENV !== \"production\" && middleware && typeof middleware !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : \"`middleware` field must be a callback\");\n }\n let finalMiddleware;\n if (typeof middleware === \"function\") {\n finalMiddleware = middleware(getDefaultMiddleware);\n if (process.env.NODE_ENV !== \"production\" && !Array.isArray(finalMiddleware)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : \"when using a middleware builder function, an array of middleware must be returned\");\n }\n } else {\n finalMiddleware = getDefaultMiddleware();\n }\n if (process.env.NODE_ENV !== \"production\" && finalMiddleware.some((item) => typeof item !== \"function\")) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : \"each middleware provided to configureStore must be a function\");\n }\n let finalCompose = compose2;\n if (devTools) {\n finalCompose = composeWithDevTools({\n // Enable capture of stack traces for dispatched Redux actions\n trace: process.env.NODE_ENV !== \"production\",\n ...typeof devTools === \"object\" && devTools\n });\n }\n const middlewareEnhancer = applyMiddleware(...finalMiddleware);\n const getDefaultEnhancers = buildGetDefaultEnhancers(middlewareEnhancer);\n if (process.env.NODE_ENV !== \"production\" && enhancers && typeof enhancers !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : \"`enhancers` field must be a callback\");\n }\n let storeEnhancers = typeof enhancers === \"function\" ? enhancers(getDefaultEnhancers) : getDefaultEnhancers();\n if (process.env.NODE_ENV !== \"production\" && !Array.isArray(storeEnhancers)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : \"`enhancers` callback must return an array\");\n }\n if (process.env.NODE_ENV !== \"production\" && storeEnhancers.some((item) => typeof item !== \"function\")) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : \"each enhancer provided to configureStore must be a function\");\n }\n if (process.env.NODE_ENV !== \"production\" && finalMiddleware.length && !storeEnhancers.includes(middlewareEnhancer)) {\n console.error(\"middlewares were provided, but middleware enhancer was not included in final enhancers - make sure to call `getDefaultEnhancers`\");\n }\n const composedEnhancer = finalCompose(...storeEnhancers);\n return createStore(rootReducer, preloadedState, composedEnhancer);\n}\n\n// src/createReducer.ts\nimport { produce as createNextState2, isDraft as isDraft2, isDraftable as isDraftable2 } from \"immer\";\n\n// src/mapBuilders.ts\nfunction executeReducerBuilderCallback(builderCallback) {\n const actionsMap = {};\n const actionMatchers = [];\n let defaultCaseReducer;\n const builder = {\n addCase(typeOrActionCreator, reducer) {\n if (process.env.NODE_ENV !== \"production\") {\n if (actionMatchers.length > 0) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(26) : \"`builder.addCase` should only be called before calling `builder.addMatcher`\");\n }\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(27) : \"`builder.addCase` should only be called before calling `builder.addDefaultCase`\");\n }\n }\n const type = typeof typeOrActionCreator === \"string\" ? typeOrActionCreator : typeOrActionCreator.type;\n if (!type) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(28) : \"`builder.addCase` cannot be called with an empty action type\");\n }\n if (type in actionsMap) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(29) : `\\`builder.addCase\\` cannot be called with two reducers for the same action type '${type}'`);\n }\n actionsMap[type] = reducer;\n return builder;\n },\n addMatcher(matcher, reducer) {\n if (process.env.NODE_ENV !== \"production\") {\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(30) : \"`builder.addMatcher` should only be called before calling `builder.addDefaultCase`\");\n }\n }\n actionMatchers.push({\n matcher,\n reducer\n });\n return builder;\n },\n addDefaultCase(reducer) {\n if (process.env.NODE_ENV !== \"production\") {\n if (defaultCaseReducer) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(31) : \"`builder.addDefaultCase` can only be called once\");\n }\n }\n defaultCaseReducer = reducer;\n return builder;\n }\n };\n builderCallback(builder);\n return [actionsMap, actionMatchers, defaultCaseReducer];\n}\n\n// src/createReducer.ts\nfunction isStateFunction(x) {\n return typeof x === \"function\";\n}\nfunction createReducer(initialState, mapOrBuilderCallback) {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof mapOrBuilderCallback === \"object\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : \"The object notation for `createReducer` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createReducer\");\n }\n }\n let [actionsMap, finalActionMatchers, finalDefaultCaseReducer] = executeReducerBuilderCallback(mapOrBuilderCallback);\n let getInitialState;\n if (isStateFunction(initialState)) {\n getInitialState = () => freezeDraftable(initialState());\n } else {\n const frozenInitialState = freezeDraftable(initialState);\n getInitialState = () => frozenInitialState;\n }\n function reducer(state = getInitialState(), action) {\n let caseReducers = [actionsMap[action.type], ...finalActionMatchers.filter(({\n matcher\n }) => matcher(action)).map(({\n reducer: reducer2\n }) => reducer2)];\n if (caseReducers.filter((cr) => !!cr).length === 0) {\n caseReducers = [finalDefaultCaseReducer];\n }\n return caseReducers.reduce((previousState, caseReducer) => {\n if (caseReducer) {\n if (isDraft2(previousState)) {\n const draft = previousState;\n const result = caseReducer(draft, action);\n if (result === void 0) {\n return previousState;\n }\n return result;\n } else if (!isDraftable2(previousState)) {\n const result = caseReducer(previousState, action);\n if (result === void 0) {\n if (previousState === null) {\n return previousState;\n }\n throw Error(\"A case reducer on a non-draftable value must not return undefined\");\n }\n return result;\n } else {\n return createNextState2(previousState, (draft) => {\n return caseReducer(draft, action);\n });\n }\n }\n return previousState;\n }, state);\n }\n reducer.getInitialState = getInitialState;\n return reducer;\n}\n\n// src/matchers.ts\nvar matches = (matcher, action) => {\n if (hasMatchFunction(matcher)) {\n return matcher.match(action);\n } else {\n return matcher(action);\n }\n};\nfunction isAnyOf(...matchers) {\n return (action) => {\n return matchers.some((matcher) => matches(matcher, action));\n };\n}\nfunction isAllOf(...matchers) {\n return (action) => {\n return matchers.every((matcher) => matches(matcher, action));\n };\n}\nfunction hasExpectedRequestMetadata(action, validStatus) {\n if (!action || !action.meta) return false;\n const hasValidRequestId = typeof action.meta.requestId === \"string\";\n const hasValidRequestStatus = validStatus.indexOf(action.meta.requestStatus) > -1;\n return hasValidRequestId && hasValidRequestStatus;\n}\nfunction isAsyncThunkArray(a) {\n return typeof a[0] === \"function\" && \"pending\" in a[0] && \"fulfilled\" in a[0] && \"rejected\" in a[0];\n}\nfunction isPending(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"pending\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isPending()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.pending));\n}\nfunction isRejected(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"rejected\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isRejected()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.rejected));\n}\nfunction isRejectedWithValue(...asyncThunks) {\n const hasFlag = (action) => {\n return action && action.meta && action.meta.rejectedWithValue;\n };\n if (asyncThunks.length === 0) {\n return isAllOf(isRejected(...asyncThunks), hasFlag);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isRejectedWithValue()(asyncThunks[0]);\n }\n return isAllOf(isRejected(...asyncThunks), hasFlag);\n}\nfunction isFulfilled(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"fulfilled\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isFulfilled()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.map((asyncThunk) => asyncThunk.fulfilled));\n}\nfunction isAsyncThunkAction(...asyncThunks) {\n if (asyncThunks.length === 0) {\n return (action) => hasExpectedRequestMetadata(action, [\"pending\", \"fulfilled\", \"rejected\"]);\n }\n if (!isAsyncThunkArray(asyncThunks)) {\n return isAsyncThunkAction()(asyncThunks[0]);\n }\n return isAnyOf(...asyncThunks.flatMap((asyncThunk) => [asyncThunk.pending, asyncThunk.rejected, asyncThunk.fulfilled]));\n}\n\n// src/nanoid.ts\nvar urlAlphabet = \"ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW\";\nvar nanoid = (size = 21) => {\n let id = \"\";\n let i = size;\n while (i--) {\n id += urlAlphabet[Math.random() * 64 | 0];\n }\n return id;\n};\n\n// src/createAsyncThunk.ts\nvar commonProperties = [\"name\", \"message\", \"stack\", \"code\"];\nvar RejectWithValue = class {\n constructor(payload, meta) {\n this.payload = payload;\n this.meta = meta;\n }\n /*\n type-only property to distinguish between RejectWithValue and FulfillWithMeta\n does not exist at runtime\n */\n _type;\n};\nvar FulfillWithMeta = class {\n constructor(payload, meta) {\n this.payload = payload;\n this.meta = meta;\n }\n /*\n type-only property to distinguish between RejectWithValue and FulfillWithMeta\n does not exist at runtime\n */\n _type;\n};\nvar miniSerializeError = (value) => {\n if (typeof value === \"object\" && value !== null) {\n const simpleError = {};\n for (const property of commonProperties) {\n if (typeof value[property] === \"string\") {\n simpleError[property] = value[property];\n }\n }\n return simpleError;\n }\n return {\n message: String(value)\n };\n};\nvar createAsyncThunk = /* @__PURE__ */ (() => {\n function createAsyncThunk2(typePrefix, payloadCreator, options) {\n const fulfilled = createAction(typePrefix + \"/fulfilled\", (payload, requestId, arg, meta) => ({\n payload,\n meta: {\n ...meta || {},\n arg,\n requestId,\n requestStatus: \"fulfilled\"\n }\n }));\n const pending = createAction(typePrefix + \"/pending\", (requestId, arg, meta) => ({\n payload: void 0,\n meta: {\n ...meta || {},\n arg,\n requestId,\n requestStatus: \"pending\"\n }\n }));\n const rejected = createAction(typePrefix + \"/rejected\", (error, requestId, arg, payload, meta) => ({\n payload,\n error: (options && options.serializeError || miniSerializeError)(error || \"Rejected\"),\n meta: {\n ...meta || {},\n arg,\n requestId,\n rejectedWithValue: !!payload,\n requestStatus: \"rejected\",\n aborted: error?.name === \"AbortError\",\n condition: error?.name === \"ConditionError\"\n }\n }));\n function actionCreator(arg) {\n return (dispatch, getState, extra) => {\n const requestId = options?.idGenerator ? options.idGenerator(arg) : nanoid();\n const abortController = new AbortController();\n let abortHandler;\n let abortReason;\n function abort(reason) {\n abortReason = reason;\n abortController.abort();\n }\n const promise = async function() {\n let finalAction;\n try {\n let conditionResult = options?.condition?.(arg, {\n getState,\n extra\n });\n if (isThenable(conditionResult)) {\n conditionResult = await conditionResult;\n }\n if (conditionResult === false || abortController.signal.aborted) {\n throw {\n name: \"ConditionError\",\n message: \"Aborted due to condition callback returning false.\"\n };\n }\n const abortedPromise = new Promise((_, reject) => {\n abortHandler = () => {\n reject({\n name: \"AbortError\",\n message: abortReason || \"Aborted\"\n });\n };\n abortController.signal.addEventListener(\"abort\", abortHandler);\n });\n dispatch(pending(requestId, arg, options?.getPendingMeta?.({\n requestId,\n arg\n }, {\n getState,\n extra\n })));\n finalAction = await Promise.race([abortedPromise, Promise.resolve(payloadCreator(arg, {\n dispatch,\n getState,\n extra,\n requestId,\n signal: abortController.signal,\n abort,\n rejectWithValue: (value, meta) => {\n return new RejectWithValue(value, meta);\n },\n fulfillWithValue: (value, meta) => {\n return new FulfillWithMeta(value, meta);\n }\n })).then((result) => {\n if (result instanceof RejectWithValue) {\n throw result;\n }\n if (result instanceof FulfillWithMeta) {\n return fulfilled(result.payload, requestId, arg, result.meta);\n }\n return fulfilled(result, requestId, arg);\n })]);\n } catch (err) {\n finalAction = err instanceof RejectWithValue ? rejected(null, requestId, arg, err.payload, err.meta) : rejected(err, requestId, arg);\n } finally {\n if (abortHandler) {\n abortController.signal.removeEventListener(\"abort\", abortHandler);\n }\n }\n const skipDispatch = options && !options.dispatchConditionRejection && rejected.match(finalAction) && finalAction.meta.condition;\n if (!skipDispatch) {\n dispatch(finalAction);\n }\n return finalAction;\n }();\n return Object.assign(promise, {\n abort,\n requestId,\n arg,\n unwrap() {\n return promise.then(unwrapResult);\n }\n });\n };\n }\n return Object.assign(actionCreator, {\n pending,\n rejected,\n fulfilled,\n settled: isAnyOf(rejected, fulfilled),\n typePrefix\n });\n }\n createAsyncThunk2.withTypes = () => createAsyncThunk2;\n return createAsyncThunk2;\n})();\nfunction unwrapResult(action) {\n if (action.meta && action.meta.rejectedWithValue) {\n throw action.payload;\n }\n if (action.error) {\n throw action.error;\n }\n return action.payload;\n}\nfunction isThenable(value) {\n return value !== null && typeof value === \"object\" && typeof value.then === \"function\";\n}\n\n// src/createSlice.ts\nvar asyncThunkSymbol = /* @__PURE__ */ Symbol.for(\"rtk-slice-createasyncthunk\");\nvar asyncThunkCreator = {\n [asyncThunkSymbol]: createAsyncThunk\n};\nvar ReducerType = /* @__PURE__ */ ((ReducerType2) => {\n ReducerType2[\"reducer\"] = \"reducer\";\n ReducerType2[\"reducerWithPrepare\"] = \"reducerWithPrepare\";\n ReducerType2[\"asyncThunk\"] = \"asyncThunk\";\n return ReducerType2;\n})(ReducerType || {});\nfunction getType(slice, actionKey) {\n return `${slice}/${actionKey}`;\n}\nfunction buildCreateSlice({\n creators\n} = {}) {\n const cAT = creators?.asyncThunk?.[asyncThunkSymbol];\n return function createSlice2(options) {\n const {\n name,\n reducerPath = name\n } = options;\n if (!name) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : \"`name` is a required option for createSlice\");\n }\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n if (options.initialState === void 0) {\n console.error(\"You must provide an `initialState` value that is not `undefined`. You may have misspelled `initialState`\");\n }\n }\n const reducers = (typeof options.reducers === \"function\" ? options.reducers(buildReducerCreators()) : options.reducers) || {};\n const reducerNames = Object.keys(reducers);\n const context = {\n sliceCaseReducersByName: {},\n sliceCaseReducersByType: {},\n actionCreators: {},\n sliceMatchers: []\n };\n const contextMethods = {\n addCase(typeOrActionCreator, reducer2) {\n const type = typeof typeOrActionCreator === \"string\" ? typeOrActionCreator : typeOrActionCreator.type;\n if (!type) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : \"`context.addCase` cannot be called with an empty action type\");\n }\n if (type in context.sliceCaseReducersByType) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : \"`context.addCase` cannot be called with two reducers for the same action type: \" + type);\n }\n context.sliceCaseReducersByType[type] = reducer2;\n return contextMethods;\n },\n addMatcher(matcher, reducer2) {\n context.sliceMatchers.push({\n matcher,\n reducer: reducer2\n });\n return contextMethods;\n },\n exposeAction(name2, actionCreator) {\n context.actionCreators[name2] = actionCreator;\n return contextMethods;\n },\n exposeCaseReducer(name2, reducer2) {\n context.sliceCaseReducersByName[name2] = reducer2;\n return contextMethods;\n }\n };\n reducerNames.forEach((reducerName) => {\n const reducerDefinition = reducers[reducerName];\n const reducerDetails = {\n reducerName,\n type: getType(name, reducerName),\n createNotation: typeof options.reducers === \"function\"\n };\n if (isAsyncThunkSliceReducerDefinition(reducerDefinition)) {\n handleThunkCaseReducerDefinition(reducerDetails, reducerDefinition, contextMethods, cAT);\n } else {\n handleNormalReducerDefinition(reducerDetails, reducerDefinition, contextMethods);\n }\n });\n function buildReducer() {\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof options.extraReducers === \"object\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : \"The object notation for `createSlice.extraReducers` has been removed. Please use the 'builder callback' notation instead: https://redux-toolkit.js.org/api/createSlice\");\n }\n }\n const [extraReducers = {}, actionMatchers = [], defaultCaseReducer = void 0] = typeof options.extraReducers === \"function\" ? executeReducerBuilderCallback(options.extraReducers) : [options.extraReducers];\n const finalCaseReducers = {\n ...extraReducers,\n ...context.sliceCaseReducersByType\n };\n return createReducer(options.initialState, (builder) => {\n for (let key in finalCaseReducers) {\n builder.addCase(key, finalCaseReducers[key]);\n }\n for (let sM of context.sliceMatchers) {\n builder.addMatcher(sM.matcher, sM.reducer);\n }\n for (let m of actionMatchers) {\n builder.addMatcher(m.matcher, m.reducer);\n }\n if (defaultCaseReducer) {\n builder.addDefaultCase(defaultCaseReducer);\n }\n });\n }\n const selectSelf = (state) => state;\n const injectedSelectorCache = /* @__PURE__ */ new Map();\n let _reducer;\n function reducer(state, action) {\n if (!_reducer) _reducer = buildReducer();\n return _reducer(state, action);\n }\n function getInitialState() {\n if (!_reducer) _reducer = buildReducer();\n return _reducer.getInitialState();\n }\n function makeSelectorProps(reducerPath2, injected = false) {\n function selectSlice(state) {\n let sliceState = state[reducerPath2];\n if (typeof sliceState === \"undefined\") {\n if (injected) {\n sliceState = getInitialState();\n } else if (process.env.NODE_ENV !== \"production\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : \"selectSlice returned undefined for an uninjected slice reducer\");\n }\n }\n return sliceState;\n }\n function getSelectors(selectState = selectSelf) {\n const selectorCache = getOrInsertComputed(injectedSelectorCache, injected, () => /* @__PURE__ */ new WeakMap());\n return getOrInsertComputed(selectorCache, selectState, () => {\n const map = {};\n for (const [name2, selector] of Object.entries(options.selectors ?? {})) {\n map[name2] = wrapSelector(selector, selectState, getInitialState, injected);\n }\n return map;\n });\n }\n return {\n reducerPath: reducerPath2,\n getSelectors,\n get selectors() {\n return getSelectors(selectSlice);\n },\n selectSlice\n };\n }\n const slice = {\n name,\n reducer,\n actions: context.actionCreators,\n caseReducers: context.sliceCaseReducersByName,\n getInitialState,\n ...makeSelectorProps(reducerPath),\n injectInto(injectable, {\n reducerPath: pathOpt,\n ...config\n } = {}) {\n const newReducerPath = pathOpt ?? reducerPath;\n injectable.inject({\n reducerPath: newReducerPath,\n reducer\n }, config);\n return {\n ...slice,\n ...makeSelectorProps(newReducerPath, true)\n };\n }\n };\n return slice;\n };\n}\nfunction wrapSelector(selector, selectState, getInitialState, injected) {\n function wrapper(rootState, ...args) {\n let sliceState = selectState(rootState);\n if (typeof sliceState === \"undefined\") {\n if (injected) {\n sliceState = getInitialState();\n } else if (process.env.NODE_ENV !== \"production\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : \"selectState returned undefined for an uninjected slice reducer\");\n }\n }\n return selector(sliceState, ...args);\n }\n wrapper.unwrapped = selector;\n return wrapper;\n}\nvar createSlice = /* @__PURE__ */ buildCreateSlice();\nfunction buildReducerCreators() {\n function asyncThunk(payloadCreator, config) {\n return {\n _reducerDefinitionType: \"asyncThunk\" /* asyncThunk */,\n payloadCreator,\n ...config\n };\n }\n asyncThunk.withTypes = () => asyncThunk;\n return {\n reducer(caseReducer) {\n return Object.assign({\n // hack so the wrapping function has the same name as the original\n // we need to create a wrapper so the `reducerDefinitionType` is not assigned to the original\n [caseReducer.name](...args) {\n return caseReducer(...args);\n }\n }[caseReducer.name], {\n _reducerDefinitionType: \"reducer\" /* reducer */\n });\n },\n preparedReducer(prepare, reducer) {\n return {\n _reducerDefinitionType: \"reducerWithPrepare\" /* reducerWithPrepare */,\n prepare,\n reducer\n };\n },\n asyncThunk\n };\n}\nfunction handleNormalReducerDefinition({\n type,\n reducerName,\n createNotation\n}, maybeReducerWithPrepare, context) {\n let caseReducer;\n let prepareCallback;\n if (\"reducer\" in maybeReducerWithPrepare) {\n if (createNotation && !isCaseReducerWithPrepareDefinition(maybeReducerWithPrepare)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(17) : \"Please use the `create.preparedReducer` notation for prepared action creators with the `create` notation.\");\n }\n caseReducer = maybeReducerWithPrepare.reducer;\n prepareCallback = maybeReducerWithPrepare.prepare;\n } else {\n caseReducer = maybeReducerWithPrepare;\n }\n context.addCase(type, caseReducer).exposeCaseReducer(reducerName, caseReducer).exposeAction(reducerName, prepareCallback ? createAction(type, prepareCallback) : createAction(type));\n}\nfunction isAsyncThunkSliceReducerDefinition(reducerDefinition) {\n return reducerDefinition._reducerDefinitionType === \"asyncThunk\" /* asyncThunk */;\n}\nfunction isCaseReducerWithPrepareDefinition(reducerDefinition) {\n return reducerDefinition._reducerDefinitionType === \"reducerWithPrepare\" /* reducerWithPrepare */;\n}\nfunction handleThunkCaseReducerDefinition({\n type,\n reducerName\n}, reducerDefinition, context, cAT) {\n if (!cAT) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(18) : \"Cannot use `create.asyncThunk` in the built-in `createSlice`. Use `buildCreateSlice({ creators: { asyncThunk: asyncThunkCreator } })` to create a customised version of `createSlice`.\");\n }\n const {\n payloadCreator,\n fulfilled,\n pending,\n rejected,\n settled,\n options\n } = reducerDefinition;\n const thunk = cAT(type, payloadCreator, options);\n context.exposeAction(reducerName, thunk);\n if (fulfilled) {\n context.addCase(thunk.fulfilled, fulfilled);\n }\n if (pending) {\n context.addCase(thunk.pending, pending);\n }\n if (rejected) {\n context.addCase(thunk.rejected, rejected);\n }\n if (settled) {\n context.addMatcher(thunk.settled, settled);\n }\n context.exposeCaseReducer(reducerName, {\n fulfilled: fulfilled || noop,\n pending: pending || noop,\n rejected: rejected || noop,\n settled: settled || noop\n });\n}\nfunction noop() {\n}\n\n// src/entities/entity_state.ts\nfunction getInitialEntityState() {\n return {\n ids: [],\n entities: {}\n };\n}\nfunction createInitialStateFactory(stateAdapter) {\n function getInitialState(additionalState = {}, entities) {\n const state = Object.assign(getInitialEntityState(), additionalState);\n return entities ? stateAdapter.setAll(state, entities) : state;\n }\n return {\n getInitialState\n };\n}\n\n// src/entities/state_selectors.ts\nfunction createSelectorsFactory() {\n function getSelectors(selectState, options = {}) {\n const {\n createSelector: createSelector2 = createDraftSafeSelector\n } = options;\n const selectIds = (state) => state.ids;\n const selectEntities = (state) => state.entities;\n const selectAll = createSelector2(selectIds, selectEntities, (ids, entities) => ids.map((id) => entities[id]));\n const selectId = (_, id) => id;\n const selectById = (entities, id) => entities[id];\n const selectTotal = createSelector2(selectIds, (ids) => ids.length);\n if (!selectState) {\n return {\n selectIds,\n selectEntities,\n selectAll,\n selectTotal,\n selectById: createSelector2(selectEntities, selectId, selectById)\n };\n }\n const selectGlobalizedEntities = createSelector2(selectState, selectEntities);\n return {\n selectIds: createSelector2(selectState, selectIds),\n selectEntities: selectGlobalizedEntities,\n selectAll: createSelector2(selectState, selectAll),\n selectTotal: createSelector2(selectState, selectTotal),\n selectById: createSelector2(selectGlobalizedEntities, selectId, selectById)\n };\n }\n return {\n getSelectors\n };\n}\n\n// src/entities/state_adapter.ts\nimport { produce as createNextState3, isDraft as isDraft3 } from \"immer\";\nvar isDraftTyped = isDraft3;\nfunction createSingleArgumentStateOperator(mutator) {\n const operator = createStateOperator((_, state) => mutator(state));\n return function operation(state) {\n return operator(state, void 0);\n };\n}\nfunction createStateOperator(mutator) {\n return function operation(state, arg) {\n function isPayloadActionArgument(arg2) {\n return isFSA(arg2);\n }\n const runMutator = (draft) => {\n if (isPayloadActionArgument(arg)) {\n mutator(arg.payload, draft);\n } else {\n mutator(arg, draft);\n }\n };\n if (isDraftTyped(state)) {\n runMutator(state);\n return state;\n }\n return createNextState3(state, runMutator);\n };\n}\n\n// src/entities/utils.ts\nimport { current as current2, isDraft as isDraft4 } from \"immer\";\nfunction selectIdValue(entity, selectId) {\n const key = selectId(entity);\n if (process.env.NODE_ENV !== \"production\" && key === void 0) {\n console.warn(\"The entity passed to the `selectId` implementation returned undefined.\", \"You should probably provide your own `selectId` implementation.\", \"The entity that was passed:\", entity, \"The `selectId` implementation:\", selectId.toString());\n }\n return key;\n}\nfunction ensureEntitiesArray(entities) {\n if (!Array.isArray(entities)) {\n entities = Object.values(entities);\n }\n return entities;\n}\nfunction getCurrent(value) {\n return isDraft4(value) ? current2(value) : value;\n}\nfunction splitAddedUpdatedEntities(newEntities, selectId, state) {\n newEntities = ensureEntitiesArray(newEntities);\n const existingIdsArray = getCurrent(state.ids);\n const existingIds = new Set(existingIdsArray);\n const added = [];\n const updated = [];\n for (const entity of newEntities) {\n const id = selectIdValue(entity, selectId);\n if (existingIds.has(id)) {\n updated.push({\n id,\n changes: entity\n });\n } else {\n added.push(entity);\n }\n }\n return [added, updated, existingIdsArray];\n}\n\n// src/entities/unsorted_state_adapter.ts\nfunction createUnsortedStateAdapter(selectId) {\n function addOneMutably(entity, state) {\n const key = selectIdValue(entity, selectId);\n if (key in state.entities) {\n return;\n }\n state.ids.push(key);\n state.entities[key] = entity;\n }\n function addManyMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n for (const entity of newEntities) {\n addOneMutably(entity, state);\n }\n }\n function setOneMutably(entity, state) {\n const key = selectIdValue(entity, selectId);\n if (!(key in state.entities)) {\n state.ids.push(key);\n }\n ;\n state.entities[key] = entity;\n }\n function setManyMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n for (const entity of newEntities) {\n setOneMutably(entity, state);\n }\n }\n function setAllMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n state.ids = [];\n state.entities = {};\n addManyMutably(newEntities, state);\n }\n function removeOneMutably(key, state) {\n return removeManyMutably([key], state);\n }\n function removeManyMutably(keys, state) {\n let didMutate = false;\n keys.forEach((key) => {\n if (key in state.entities) {\n delete state.entities[key];\n didMutate = true;\n }\n });\n if (didMutate) {\n state.ids = state.ids.filter((id) => id in state.entities);\n }\n }\n function removeAllMutably(state) {\n Object.assign(state, {\n ids: [],\n entities: {}\n });\n }\n function takeNewKey(keys, update, state) {\n const original3 = state.entities[update.id];\n if (original3 === void 0) {\n return false;\n }\n const updated = Object.assign({}, original3, update.changes);\n const newKey = selectIdValue(updated, selectId);\n const hasNewKey = newKey !== update.id;\n if (hasNewKey) {\n keys[update.id] = newKey;\n delete state.entities[update.id];\n }\n ;\n state.entities[newKey] = updated;\n return hasNewKey;\n }\n function updateOneMutably(update, state) {\n return updateManyMutably([update], state);\n }\n function updateManyMutably(updates, state) {\n const newKeys = {};\n const updatesPerEntity = {};\n updates.forEach((update) => {\n if (update.id in state.entities) {\n updatesPerEntity[update.id] = {\n id: update.id,\n // Spreads ignore falsy values, so this works even if there isn't\n // an existing update already at this key\n changes: {\n ...updatesPerEntity[update.id]?.changes,\n ...update.changes\n }\n };\n }\n });\n updates = Object.values(updatesPerEntity);\n const didMutateEntities = updates.length > 0;\n if (didMutateEntities) {\n const didMutateIds = updates.filter((update) => takeNewKey(newKeys, update, state)).length > 0;\n if (didMutateIds) {\n state.ids = Object.values(state.entities).map((e) => selectIdValue(e, selectId));\n }\n }\n }\n function upsertOneMutably(entity, state) {\n return upsertManyMutably([entity], state);\n }\n function upsertManyMutably(newEntities, state) {\n const [added, updated] = splitAddedUpdatedEntities(newEntities, selectId, state);\n updateManyMutably(updated, state);\n addManyMutably(added, state);\n }\n return {\n removeAll: createSingleArgumentStateOperator(removeAllMutably),\n addOne: createStateOperator(addOneMutably),\n addMany: createStateOperator(addManyMutably),\n setOne: createStateOperator(setOneMutably),\n setMany: createStateOperator(setManyMutably),\n setAll: createStateOperator(setAllMutably),\n updateOne: createStateOperator(updateOneMutably),\n updateMany: createStateOperator(updateManyMutably),\n upsertOne: createStateOperator(upsertOneMutably),\n upsertMany: createStateOperator(upsertManyMutably),\n removeOne: createStateOperator(removeOneMutably),\n removeMany: createStateOperator(removeManyMutably)\n };\n}\n\n// src/entities/sorted_state_adapter.ts\nfunction findInsertIndex(sortedItems, item, comparisonFunction) {\n let lowIndex = 0;\n let highIndex = sortedItems.length;\n while (lowIndex < highIndex) {\n let middleIndex = lowIndex + highIndex >>> 1;\n const currentItem = sortedItems[middleIndex];\n const res = comparisonFunction(item, currentItem);\n if (res >= 0) {\n lowIndex = middleIndex + 1;\n } else {\n highIndex = middleIndex;\n }\n }\n return lowIndex;\n}\nfunction insert(sortedItems, item, comparisonFunction) {\n const insertAtIndex = findInsertIndex(sortedItems, item, comparisonFunction);\n sortedItems.splice(insertAtIndex, 0, item);\n return sortedItems;\n}\nfunction createSortedStateAdapter(selectId, comparer) {\n const {\n removeOne,\n removeMany,\n removeAll\n } = createUnsortedStateAdapter(selectId);\n function addOneMutably(entity, state) {\n return addManyMutably([entity], state);\n }\n function addManyMutably(newEntities, state, existingIds) {\n newEntities = ensureEntitiesArray(newEntities);\n const existingKeys = new Set(existingIds ?? getCurrent(state.ids));\n const models = newEntities.filter((model) => !existingKeys.has(selectIdValue(model, selectId)));\n if (models.length !== 0) {\n mergeFunction(state, models);\n }\n }\n function setOneMutably(entity, state) {\n return setManyMutably([entity], state);\n }\n function setManyMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n if (newEntities.length !== 0) {\n for (const item of newEntities) {\n delete state.entities[selectId(item)];\n }\n mergeFunction(state, newEntities);\n }\n }\n function setAllMutably(newEntities, state) {\n newEntities = ensureEntitiesArray(newEntities);\n state.entities = {};\n state.ids = [];\n addManyMutably(newEntities, state, []);\n }\n function updateOneMutably(update, state) {\n return updateManyMutably([update], state);\n }\n function updateManyMutably(updates, state) {\n let appliedUpdates = false;\n let replacedIds = false;\n for (let update of updates) {\n const entity = state.entities[update.id];\n if (!entity) {\n continue;\n }\n appliedUpdates = true;\n Object.assign(entity, update.changes);\n const newId = selectId(entity);\n if (update.id !== newId) {\n replacedIds = true;\n delete state.entities[update.id];\n const oldIndex = state.ids.indexOf(update.id);\n state.ids[oldIndex] = newId;\n state.entities[newId] = entity;\n }\n }\n if (appliedUpdates) {\n mergeFunction(state, [], appliedUpdates, replacedIds);\n }\n }\n function upsertOneMutably(entity, state) {\n return upsertManyMutably([entity], state);\n }\n function upsertManyMutably(newEntities, state) {\n const [added, updated, existingIdsArray] = splitAddedUpdatedEntities(newEntities, selectId, state);\n if (updated.length) {\n updateManyMutably(updated, state);\n }\n if (added.length) {\n addManyMutably(added, state, existingIdsArray);\n }\n }\n function areArraysEqual(a, b) {\n if (a.length !== b.length) {\n return false;\n }\n for (let i = 0; i < a.length; i++) {\n if (a[i] === b[i]) {\n continue;\n }\n return false;\n }\n return true;\n }\n const mergeFunction = (state, addedItems, appliedUpdates, replacedIds) => {\n const currentEntities = getCurrent(state.entities);\n const currentIds = getCurrent(state.ids);\n const stateEntities = state.entities;\n let ids = currentIds;\n if (replacedIds) {\n ids = new Set(currentIds);\n }\n let sortedEntities = [];\n for (const id of ids) {\n const entity = currentEntities[id];\n if (entity) {\n sortedEntities.push(entity);\n }\n }\n const wasPreviouslyEmpty = sortedEntities.length === 0;\n for (const item of addedItems) {\n stateEntities[selectId(item)] = item;\n if (!wasPreviouslyEmpty) {\n insert(sortedEntities, item, comparer);\n }\n }\n if (wasPreviouslyEmpty) {\n sortedEntities = addedItems.slice().sort(comparer);\n } else if (appliedUpdates) {\n sortedEntities.sort(comparer);\n }\n const newSortedIds = sortedEntities.map(selectId);\n if (!areArraysEqual(currentIds, newSortedIds)) {\n state.ids = newSortedIds;\n }\n };\n return {\n removeOne,\n removeMany,\n removeAll,\n addOne: createStateOperator(addOneMutably),\n updateOne: createStateOperator(updateOneMutably),\n upsertOne: createStateOperator(upsertOneMutably),\n setOne: createStateOperator(setOneMutably),\n setMany: createStateOperator(setManyMutably),\n setAll: createStateOperator(setAllMutably),\n addMany: createStateOperator(addManyMutably),\n updateMany: createStateOperator(updateManyMutably),\n upsertMany: createStateOperator(upsertManyMutably)\n };\n}\n\n// src/entities/create_adapter.ts\nfunction createEntityAdapter(options = {}) {\n const {\n selectId,\n sortComparer\n } = {\n sortComparer: false,\n selectId: (instance) => instance.id,\n ...options\n };\n const stateAdapter = sortComparer ? createSortedStateAdapter(selectId, sortComparer) : createUnsortedStateAdapter(selectId);\n const stateFactory = createInitialStateFactory(stateAdapter);\n const selectorsFactory = createSelectorsFactory();\n return {\n selectId,\n sortComparer,\n ...stateFactory,\n ...selectorsFactory,\n ...stateAdapter\n };\n}\n\n// src/listenerMiddleware/index.ts\nimport { isAction as isAction3 } from \"redux\";\n\n// src/listenerMiddleware/exceptions.ts\nvar task = \"task\";\nvar listener = \"listener\";\nvar completed = \"completed\";\nvar cancelled = \"cancelled\";\nvar taskCancelled = `task-${cancelled}`;\nvar taskCompleted = `task-${completed}`;\nvar listenerCancelled = `${listener}-${cancelled}`;\nvar listenerCompleted = `${listener}-${completed}`;\nvar TaskAbortError = class {\n constructor(code) {\n this.code = code;\n this.message = `${task} ${cancelled} (reason: ${code})`;\n }\n name = \"TaskAbortError\";\n message;\n};\n\n// src/listenerMiddleware/utils.ts\nvar assertFunction = (func, expected) => {\n if (typeof func !== \"function\") {\n throw new TypeError(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(32) : `${expected} is not a function`);\n }\n};\nvar noop2 = () => {\n};\nvar catchRejection = (promise, onError = noop2) => {\n promise.catch(onError);\n return promise;\n};\nvar addAbortSignalListener = (abortSignal, callback) => {\n abortSignal.addEventListener(\"abort\", callback, {\n once: true\n });\n return () => abortSignal.removeEventListener(\"abort\", callback);\n};\nvar abortControllerWithReason = (abortController, reason) => {\n const signal = abortController.signal;\n if (signal.aborted) {\n return;\n }\n if (!(\"reason\" in signal)) {\n Object.defineProperty(signal, \"reason\", {\n enumerable: true,\n value: reason,\n configurable: true,\n writable: true\n });\n }\n ;\n abortController.abort(reason);\n};\n\n// src/listenerMiddleware/task.ts\nvar validateActive = (signal) => {\n if (signal.aborted) {\n const {\n reason\n } = signal;\n throw new TaskAbortError(reason);\n }\n};\nfunction raceWithSignal(signal, promise) {\n let cleanup = noop2;\n return new Promise((resolve, reject) => {\n const notifyRejection = () => reject(new TaskAbortError(signal.reason));\n if (signal.aborted) {\n notifyRejection();\n return;\n }\n cleanup = addAbortSignalListener(signal, notifyRejection);\n promise.finally(() => cleanup()).then(resolve, reject);\n }).finally(() => {\n cleanup = noop2;\n });\n}\nvar runTask = async (task2, cleanUp) => {\n try {\n await Promise.resolve();\n const value = await task2();\n return {\n status: \"ok\",\n value\n };\n } catch (error) {\n return {\n status: error instanceof TaskAbortError ? \"cancelled\" : \"rejected\",\n error\n };\n } finally {\n cleanUp?.();\n }\n};\nvar createPause = (signal) => {\n return (promise) => {\n return catchRejection(raceWithSignal(signal, promise).then((output) => {\n validateActive(signal);\n return output;\n }));\n };\n};\nvar createDelay = (signal) => {\n const pause = createPause(signal);\n return (timeoutMs) => {\n return pause(new Promise((resolve) => setTimeout(resolve, timeoutMs)));\n };\n};\n\n// src/listenerMiddleware/index.ts\nvar {\n assign\n} = Object;\nvar INTERNAL_NIL_TOKEN = {};\nvar alm = \"listenerMiddleware\";\nvar createFork = (parentAbortSignal, parentBlockingPromises) => {\n const linkControllers = (controller) => addAbortSignalListener(parentAbortSignal, () => abortControllerWithReason(controller, parentAbortSignal.reason));\n return (taskExecutor, opts) => {\n assertFunction(taskExecutor, \"taskExecutor\");\n const childAbortController = new AbortController();\n linkControllers(childAbortController);\n const result = runTask(async () => {\n validateActive(parentAbortSignal);\n validateActive(childAbortController.signal);\n const result2 = await taskExecutor({\n pause: createPause(childAbortController.signal),\n delay: createDelay(childAbortController.signal),\n signal: childAbortController.signal\n });\n validateActive(childAbortController.signal);\n return result2;\n }, () => abortControllerWithReason(childAbortController, taskCompleted));\n if (opts?.autoJoin) {\n parentBlockingPromises.push(result.catch(noop2));\n }\n return {\n result: createPause(parentAbortSignal)(result),\n cancel() {\n abortControllerWithReason(childAbortController, taskCancelled);\n }\n };\n };\n};\nvar createTakePattern = (startListening, signal) => {\n const take = async (predicate, timeout) => {\n validateActive(signal);\n let unsubscribe = () => {\n };\n const tuplePromise = new Promise((resolve, reject) => {\n let stopListening = startListening({\n predicate,\n effect: (action, listenerApi) => {\n listenerApi.unsubscribe();\n resolve([action, listenerApi.getState(), listenerApi.getOriginalState()]);\n }\n });\n unsubscribe = () => {\n stopListening();\n reject();\n };\n });\n const promises = [tuplePromise];\n if (timeout != null) {\n promises.push(new Promise((resolve) => setTimeout(resolve, timeout, null)));\n }\n try {\n const output = await raceWithSignal(signal, Promise.race(promises));\n validateActive(signal);\n return output;\n } finally {\n unsubscribe();\n }\n };\n return (predicate, timeout) => catchRejection(take(predicate, timeout));\n};\nvar getListenerEntryPropsFrom = (options) => {\n let {\n type,\n actionCreator,\n matcher,\n predicate,\n effect\n } = options;\n if (type) {\n predicate = createAction(type).match;\n } else if (actionCreator) {\n type = actionCreator.type;\n predicate = actionCreator.match;\n } else if (matcher) {\n predicate = matcher;\n } else if (predicate) {\n } else {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(21) : \"Creating or removing a listener requires one of the known fields for matching an action\");\n }\n assertFunction(effect, \"options.listener\");\n return {\n predicate,\n type,\n effect\n };\n};\nvar createListenerEntry = /* @__PURE__ */ assign((options) => {\n const {\n type,\n predicate,\n effect\n } = getListenerEntryPropsFrom(options);\n const entry = {\n id: nanoid(),\n effect,\n type,\n predicate,\n pending: /* @__PURE__ */ new Set(),\n unsubscribe: () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(22) : \"Unsubscribe not initialized\");\n }\n };\n return entry;\n}, {\n withTypes: () => createListenerEntry\n});\nvar findListenerEntry = (listenerMap, options) => {\n const {\n type,\n effect,\n predicate\n } = getListenerEntryPropsFrom(options);\n return Array.from(listenerMap.values()).find((entry) => {\n const matchPredicateOrType = typeof type === \"string\" ? entry.type === type : entry.predicate === predicate;\n return matchPredicateOrType && entry.effect === effect;\n });\n};\nvar cancelActiveListeners = (entry) => {\n entry.pending.forEach((controller) => {\n abortControllerWithReason(controller, listenerCancelled);\n });\n};\nvar createClearListenerMiddleware = (listenerMap) => {\n return () => {\n listenerMap.forEach(cancelActiveListeners);\n listenerMap.clear();\n };\n};\nvar safelyNotifyError = (errorHandler, errorToNotify, errorInfo) => {\n try {\n errorHandler(errorToNotify, errorInfo);\n } catch (errorHandlerError) {\n setTimeout(() => {\n throw errorHandlerError;\n }, 0);\n }\n};\nvar addListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/add`), {\n withTypes: () => addListener\n});\nvar clearAllListeners = /* @__PURE__ */ createAction(`${alm}/removeAll`);\nvar removeListener = /* @__PURE__ */ assign(/* @__PURE__ */ createAction(`${alm}/remove`), {\n withTypes: () => removeListener\n});\nvar defaultErrorHandler = (...args) => {\n console.error(`${alm}/error`, ...args);\n};\nvar createListenerMiddleware = (middlewareOptions = {}) => {\n const listenerMap = /* @__PURE__ */ new Map();\n const {\n extra,\n onError = defaultErrorHandler\n } = middlewareOptions;\n assertFunction(onError, \"onError\");\n const insertEntry = (entry) => {\n entry.unsubscribe = () => listenerMap.delete(entry.id);\n listenerMap.set(entry.id, entry);\n return (cancelOptions) => {\n entry.unsubscribe();\n if (cancelOptions?.cancelActive) {\n cancelActiveListeners(entry);\n }\n };\n };\n const startListening = (options) => {\n const entry = findListenerEntry(listenerMap, options) ?? createListenerEntry(options);\n return insertEntry(entry);\n };\n assign(startListening, {\n withTypes: () => startListening\n });\n const stopListening = (options) => {\n const entry = findListenerEntry(listenerMap, options);\n if (entry) {\n entry.unsubscribe();\n if (options.cancelActive) {\n cancelActiveListeners(entry);\n }\n }\n return !!entry;\n };\n assign(stopListening, {\n withTypes: () => stopListening\n });\n const notifyListener = async (entry, action, api, getOriginalState) => {\n const internalTaskController = new AbortController();\n const take = createTakePattern(startListening, internalTaskController.signal);\n const autoJoinPromises = [];\n try {\n entry.pending.add(internalTaskController);\n await Promise.resolve(entry.effect(\n action,\n // Use assign() rather than ... to avoid extra helper functions added to bundle\n assign({}, api, {\n getOriginalState,\n condition: (predicate, timeout) => take(predicate, timeout).then(Boolean),\n take,\n delay: createDelay(internalTaskController.signal),\n pause: createPause(internalTaskController.signal),\n extra,\n signal: internalTaskController.signal,\n fork: createFork(internalTaskController.signal, autoJoinPromises),\n unsubscribe: entry.unsubscribe,\n subscribe: () => {\n listenerMap.set(entry.id, entry);\n },\n cancelActiveListeners: () => {\n entry.pending.forEach((controller, _, set) => {\n if (controller !== internalTaskController) {\n abortControllerWithReason(controller, listenerCancelled);\n set.delete(controller);\n }\n });\n },\n cancel: () => {\n abortControllerWithReason(internalTaskController, listenerCancelled);\n entry.pending.delete(internalTaskController);\n },\n throwIfCancelled: () => {\n validateActive(internalTaskController.signal);\n }\n })\n ));\n } catch (listenerError) {\n if (!(listenerError instanceof TaskAbortError)) {\n safelyNotifyError(onError, listenerError, {\n raisedBy: \"effect\"\n });\n }\n } finally {\n await Promise.all(autoJoinPromises);\n abortControllerWithReason(internalTaskController, listenerCompleted);\n entry.pending.delete(internalTaskController);\n }\n };\n const clearListenerMiddleware = createClearListenerMiddleware(listenerMap);\n const middleware = (api) => (next) => (action) => {\n if (!isAction3(action)) {\n return next(action);\n }\n if (addListener.match(action)) {\n return startListening(action.payload);\n }\n if (clearAllListeners.match(action)) {\n clearListenerMiddleware();\n return;\n }\n if (removeListener.match(action)) {\n return stopListening(action.payload);\n }\n let originalState = api.getState();\n const getOriginalState = () => {\n if (originalState === INTERNAL_NIL_TOKEN) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(23) : `${alm}: getOriginalState can only be called synchronously`);\n }\n return originalState;\n };\n let result;\n try {\n result = next(action);\n if (listenerMap.size > 0) {\n const currentState = api.getState();\n const listenerEntries = Array.from(listenerMap.values());\n for (const entry of listenerEntries) {\n let runListener = false;\n try {\n runListener = entry.predicate(action, currentState, originalState);\n } catch (predicateError) {\n runListener = false;\n safelyNotifyError(onError, predicateError, {\n raisedBy: \"predicate\"\n });\n }\n if (!runListener) {\n continue;\n }\n notifyListener(entry, action, api, getOriginalState);\n }\n }\n } finally {\n originalState = INTERNAL_NIL_TOKEN;\n }\n return result;\n };\n return {\n middleware,\n startListening,\n stopListening,\n clearListeners: clearListenerMiddleware\n };\n};\n\n// src/dynamicMiddleware/index.ts\nimport { compose as compose3 } from \"redux\";\nvar createMiddlewareEntry = (middleware) => ({\n middleware,\n applied: /* @__PURE__ */ new Map()\n});\nvar matchInstance = (instanceId) => (action) => action?.meta?.instanceId === instanceId;\nvar createDynamicMiddleware = () => {\n const instanceId = nanoid();\n const middlewareMap = /* @__PURE__ */ new Map();\n const withMiddleware = Object.assign(createAction(\"dynamicMiddleware/add\", (...middlewares) => ({\n payload: middlewares,\n meta: {\n instanceId\n }\n })), {\n withTypes: () => withMiddleware\n });\n const addMiddleware = Object.assign(function addMiddleware2(...middlewares) {\n middlewares.forEach((middleware2) => {\n getOrInsertComputed(middlewareMap, middleware2, createMiddlewareEntry);\n });\n }, {\n withTypes: () => addMiddleware\n });\n const getFinalMiddleware = (api) => {\n const appliedMiddleware = Array.from(middlewareMap.values()).map((entry) => getOrInsertComputed(entry.applied, api, entry.middleware));\n return compose3(...appliedMiddleware);\n };\n const isWithMiddleware = isAllOf(withMiddleware, matchInstance(instanceId));\n const middleware = (api) => (next) => (action) => {\n if (isWithMiddleware(action)) {\n addMiddleware(...action.payload);\n return api.dispatch;\n }\n return getFinalMiddleware(api)(next)(action);\n };\n return {\n middleware,\n addMiddleware,\n withMiddleware,\n instanceId\n };\n};\n\n// src/combineSlices.ts\nimport { combineReducers as combineReducers2 } from \"redux\";\nvar isSliceLike = (maybeSliceLike) => \"reducerPath\" in maybeSliceLike && typeof maybeSliceLike.reducerPath === \"string\";\nvar getReducers = (slices) => slices.flatMap((sliceOrMap) => isSliceLike(sliceOrMap) ? [[sliceOrMap.reducerPath, sliceOrMap.reducer]] : Object.entries(sliceOrMap));\nvar ORIGINAL_STATE = Symbol.for(\"rtk-state-proxy-original\");\nvar isStateProxy = (value) => !!value && !!value[ORIGINAL_STATE];\nvar stateProxyMap = /* @__PURE__ */ new WeakMap();\nvar createStateProxy = (state, reducerMap) => getOrInsertComputed(stateProxyMap, state, () => new Proxy(state, {\n get: (target, prop, receiver) => {\n if (prop === ORIGINAL_STATE) return target;\n const result = Reflect.get(target, prop, receiver);\n if (typeof result === \"undefined\") {\n const reducer = reducerMap[prop.toString()];\n if (reducer) {\n const reducerResult = reducer(void 0, {\n type: nanoid()\n });\n if (typeof reducerResult === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(24) : `The slice reducer for key \"${prop.toString()}\" returned undefined when called for selector(). If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);\n }\n return reducerResult;\n }\n }\n return result;\n }\n}));\nvar original = (state) => {\n if (!isStateProxy(state)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(25) : \"original must be used on state Proxy\");\n }\n return state[ORIGINAL_STATE];\n};\nvar noopReducer = (state = {}) => state;\nfunction combineSlices(...slices) {\n const reducerMap = Object.fromEntries(getReducers(slices));\n const getReducer = () => Object.keys(reducerMap).length ? combineReducers2(reducerMap) : noopReducer;\n let reducer = getReducer();\n function combinedReducer(state, action) {\n return reducer(state, action);\n }\n combinedReducer.withLazyLoadedSlices = () => combinedReducer;\n const inject = (slice, config = {}) => {\n const {\n reducerPath,\n reducer: reducerToInject\n } = slice;\n const currentReducer = reducerMap[reducerPath];\n if (!config.overrideExisting && currentReducer && currentReducer !== reducerToInject) {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n console.error(`called \\`inject\\` to override already-existing reducer ${reducerPath} without specifying \\`overrideExisting: true\\``);\n }\n return combinedReducer;\n }\n reducerMap[reducerPath] = reducerToInject;\n reducer = getReducer();\n return combinedReducer;\n };\n const selector = Object.assign(function makeSelector(selectorFn, selectState) {\n return function selector2(state, ...args) {\n return selectorFn(createStateProxy(selectState ? selectState(state, ...args) : state, reducerMap), ...args);\n };\n }, {\n original\n });\n return Object.assign(combinedReducer, {\n inject,\n selector\n });\n}\n\n// src/formatProdErrorMessage.ts\nfunction formatProdErrorMessage(code) {\n return `Minified Redux Toolkit error #${code}; visit https://redux-toolkit.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;\n}\nexport {\n ReducerType,\n SHOULD_AUTOBATCH,\n TaskAbortError,\n Tuple,\n addListener,\n asyncThunkCreator,\n autoBatchEnhancer,\n buildCreateSlice,\n clearAllListeners,\n combineSlices,\n configureStore,\n createAction,\n createActionCreatorInvariantMiddleware,\n createAsyncThunk,\n createDraftSafeSelector,\n createDraftSafeSelectorCreator,\n createDynamicMiddleware,\n createEntityAdapter,\n createImmutableStateInvariantMiddleware,\n createListenerMiddleware,\n produce as createNextState,\n createReducer,\n createSelector,\n createSelectorCreator2 as createSelectorCreator,\n createSerializableStateInvariantMiddleware,\n createSlice,\n current3 as current,\n findNonSerializableValue,\n formatProdErrorMessage,\n freeze,\n isActionCreator,\n isAllOf,\n isAnyOf,\n isAsyncThunkAction,\n isDraft5 as isDraft,\n isFSA as isFluxStandardAction,\n isFulfilled,\n isImmutableDefault,\n isPending,\n isPlain,\n isRejected,\n isRejectedWithValue,\n lruMemoize,\n miniSerializeError,\n nanoid,\n original2 as original,\n prepareAutoBatched,\n removeListener,\n unwrapResult,\n weakMapMemoize2 as weakMapMemoize\n};\n//# sourceMappingURL=redux-toolkit.modern.mjs.map","// src/query/core/apiState.ts\nvar QueryStatus = /* @__PURE__ */ ((QueryStatus2) => {\n QueryStatus2[\"uninitialized\"] = \"uninitialized\";\n QueryStatus2[\"pending\"] = \"pending\";\n QueryStatus2[\"fulfilled\"] = \"fulfilled\";\n QueryStatus2[\"rejected\"] = \"rejected\";\n return QueryStatus2;\n})(QueryStatus || {});\nfunction getRequestStatusFlags(status) {\n return {\n status,\n isUninitialized: status === \"uninitialized\" /* uninitialized */,\n isLoading: status === \"pending\" /* pending */,\n isSuccess: status === \"fulfilled\" /* fulfilled */,\n isError: status === \"rejected\" /* rejected */\n };\n}\n\n// src/query/core/rtkImports.ts\nimport { createAction, createSlice, createSelector, createAsyncThunk, combineReducers, createNextState, isAnyOf, isAllOf, isAction, isPending, isRejected, isFulfilled, isRejectedWithValue, isAsyncThunkAction, prepareAutoBatched, SHOULD_AUTOBATCH, isPlainObject, nanoid } from \"@reduxjs/toolkit\";\n\n// src/query/utils/copyWithStructuralSharing.ts\nvar isPlainObject2 = isPlainObject;\nfunction copyWithStructuralSharing(oldObj, newObj) {\n if (oldObj === newObj || !(isPlainObject2(oldObj) && isPlainObject2(newObj) || Array.isArray(oldObj) && Array.isArray(newObj))) {\n return newObj;\n }\n const newKeys = Object.keys(newObj);\n const oldKeys = Object.keys(oldObj);\n let isSameObject = newKeys.length === oldKeys.length;\n const mergeObj = Array.isArray(newObj) ? [] : {};\n for (const key of newKeys) {\n mergeObj[key] = copyWithStructuralSharing(oldObj[key], newObj[key]);\n if (isSameObject) isSameObject = oldObj[key] === mergeObj[key];\n }\n return isSameObject ? oldObj : mergeObj;\n}\n\n// src/query/utils/countObjectKeys.ts\nfunction countObjectKeys(obj) {\n let count = 0;\n for (const _key in obj) {\n count++;\n }\n return count;\n}\n\n// src/query/utils/flatten.ts\nvar flatten = (arr) => [].concat(...arr);\n\n// src/query/utils/isAbsoluteUrl.ts\nfunction isAbsoluteUrl(url) {\n return new RegExp(`(^|:)//`).test(url);\n}\n\n// src/query/utils/isDocumentVisible.ts\nfunction isDocumentVisible() {\n if (typeof document === \"undefined\") {\n return true;\n }\n return document.visibilityState !== \"hidden\";\n}\n\n// src/query/utils/isNotNullish.ts\nfunction isNotNullish(v) {\n return v != null;\n}\n\n// src/query/utils/isOnline.ts\nfunction isOnline() {\n return typeof navigator === \"undefined\" ? true : navigator.onLine === void 0 ? true : navigator.onLine;\n}\n\n// src/query/utils/joinUrls.ts\nvar withoutTrailingSlash = (url) => url.replace(/\\/$/, \"\");\nvar withoutLeadingSlash = (url) => url.replace(/^\\//, \"\");\nfunction joinUrls(base, url) {\n if (!base) {\n return url;\n }\n if (!url) {\n return base;\n }\n if (isAbsoluteUrl(url)) {\n return url;\n }\n const delimiter = base.endsWith(\"/\") || !url.startsWith(\"?\") ? \"/\" : \"\";\n base = withoutTrailingSlash(base);\n url = withoutLeadingSlash(url);\n return `${base}${delimiter}${url}`;\n}\n\n// src/query/utils/getOrInsert.ts\nfunction getOrInsert(map, key, value) {\n if (map.has(key)) return map.get(key);\n return map.set(key, value).get(key);\n}\n\n// src/query/fetchBaseQuery.ts\nvar defaultFetchFn = (...args) => fetch(...args);\nvar defaultValidateStatus = (response) => response.status >= 200 && response.status <= 299;\nvar defaultIsJsonContentType = (headers) => (\n /*applicat*/\n /ion\\/(vnd\\.api\\+)?json/.test(headers.get(\"content-type\") || \"\")\n);\nfunction stripUndefined(obj) {\n if (!isPlainObject(obj)) {\n return obj;\n }\n const copy = {\n ...obj\n };\n for (const [k, v] of Object.entries(copy)) {\n if (v === void 0) delete copy[k];\n }\n return copy;\n}\nfunction fetchBaseQuery({\n baseUrl,\n prepareHeaders = (x) => x,\n fetchFn = defaultFetchFn,\n paramsSerializer,\n isJsonContentType = defaultIsJsonContentType,\n jsonContentType = \"application/json\",\n jsonReplacer,\n timeout: defaultTimeout,\n responseHandler: globalResponseHandler,\n validateStatus: globalValidateStatus,\n ...baseFetchOptions\n} = {}) {\n if (typeof fetch === \"undefined\" && fetchFn === defaultFetchFn) {\n console.warn(\"Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments.\");\n }\n return async (arg, api, extraOptions) => {\n const {\n getState,\n extra,\n endpoint,\n forced,\n type\n } = api;\n let meta;\n let {\n url,\n headers = new Headers(baseFetchOptions.headers),\n params = void 0,\n responseHandler = globalResponseHandler ?? \"json\",\n validateStatus = globalValidateStatus ?? defaultValidateStatus,\n timeout = defaultTimeout,\n ...rest\n } = typeof arg == \"string\" ? {\n url: arg\n } : arg;\n let abortController, signal = api.signal;\n if (timeout) {\n abortController = new AbortController();\n api.signal.addEventListener(\"abort\", abortController.abort);\n signal = abortController.signal;\n }\n let config = {\n ...baseFetchOptions,\n signal,\n ...rest\n };\n headers = new Headers(stripUndefined(headers));\n config.headers = await prepareHeaders(headers, {\n getState,\n arg,\n extra,\n endpoint,\n forced,\n type,\n extraOptions\n }) || headers;\n const isJsonifiable = (body) => typeof body === \"object\" && (isPlainObject(body) || Array.isArray(body) || typeof body.toJSON === \"function\");\n if (!config.headers.has(\"content-type\") && isJsonifiable(config.body)) {\n config.headers.set(\"content-type\", jsonContentType);\n }\n if (isJsonifiable(config.body) && isJsonContentType(config.headers)) {\n config.body = JSON.stringify(config.body, jsonReplacer);\n }\n if (params) {\n const divider = ~url.indexOf(\"?\") ? \"&\" : \"?\";\n const query = paramsSerializer ? paramsSerializer(params) : new URLSearchParams(stripUndefined(params));\n url += divider + query;\n }\n url = joinUrls(baseUrl, url);\n const request = new Request(url, config);\n const requestClone = new Request(url, config);\n meta = {\n request: requestClone\n };\n let response, timedOut = false, timeoutId = abortController && setTimeout(() => {\n timedOut = true;\n abortController.abort();\n }, timeout);\n try {\n response = await fetchFn(request);\n } catch (e) {\n return {\n error: {\n status: timedOut ? \"TIMEOUT_ERROR\" : \"FETCH_ERROR\",\n error: String(e)\n },\n meta\n };\n } finally {\n if (timeoutId) clearTimeout(timeoutId);\n abortController?.signal.removeEventListener(\"abort\", abortController.abort);\n }\n const responseClone = response.clone();\n meta.response = responseClone;\n let resultData;\n let responseText = \"\";\n try {\n let handleResponseError;\n await Promise.all([\n handleResponse(response, responseHandler).then((r) => resultData = r, (e) => handleResponseError = e),\n // see https://github.com/node-fetch/node-fetch/issues/665#issuecomment-538995182\n // we *have* to \"use up\" both streams at the same time or they will stop running in node-fetch scenarios\n responseClone.text().then((r) => responseText = r, () => {\n })\n ]);\n if (handleResponseError) throw handleResponseError;\n } catch (e) {\n return {\n error: {\n status: \"PARSING_ERROR\",\n originalStatus: response.status,\n data: responseText,\n error: String(e)\n },\n meta\n };\n }\n return validateStatus(response, resultData) ? {\n data: resultData,\n meta\n } : {\n error: {\n status: response.status,\n data: resultData\n },\n meta\n };\n };\n async function handleResponse(response, responseHandler) {\n if (typeof responseHandler === \"function\") {\n return responseHandler(response);\n }\n if (responseHandler === \"content-type\") {\n responseHandler = isJsonContentType(response.headers) ? \"json\" : \"text\";\n }\n if (responseHandler === \"json\") {\n const text = await response.text();\n return text.length ? JSON.parse(text) : null;\n }\n return response.text();\n }\n}\n\n// src/query/HandledError.ts\nvar HandledError = class {\n constructor(value, meta = void 0) {\n this.value = value;\n this.meta = meta;\n }\n};\n\n// src/query/retry.ts\nasync function defaultBackoff(attempt = 0, maxRetries = 5) {\n const attempts = Math.min(attempt, maxRetries);\n const timeout = ~~((Math.random() + 0.4) * (300 << attempts));\n await new Promise((resolve) => setTimeout((res) => resolve(res), timeout));\n}\nfunction fail(error, meta) {\n throw Object.assign(new HandledError({\n error,\n meta\n }), {\n throwImmediately: true\n });\n}\nvar EMPTY_OPTIONS = {};\nvar retryWithBackoff = (baseQuery, defaultOptions) => async (args, api, extraOptions) => {\n const possibleMaxRetries = [5, (defaultOptions || EMPTY_OPTIONS).maxRetries, (extraOptions || EMPTY_OPTIONS).maxRetries].filter((x) => x !== void 0);\n const [maxRetries] = possibleMaxRetries.slice(-1);\n const defaultRetryCondition = (_, __, {\n attempt\n }) => attempt <= maxRetries;\n const options = {\n maxRetries,\n backoff: defaultBackoff,\n retryCondition: defaultRetryCondition,\n ...defaultOptions,\n ...extraOptions\n };\n let retry2 = 0;\n while (true) {\n try {\n const result = await baseQuery(args, api, extraOptions);\n if (result.error) {\n throw new HandledError(result);\n }\n return result;\n } catch (e) {\n retry2++;\n if (e.throwImmediately) {\n if (e instanceof HandledError) {\n return e.value;\n }\n throw e;\n }\n if (e instanceof HandledError && !options.retryCondition(e.value.error, args, {\n attempt: retry2,\n baseQueryApi: api,\n extraOptions\n })) {\n return e.value;\n }\n await options.backoff(retry2, options.maxRetries);\n }\n }\n};\nvar retry = /* @__PURE__ */ Object.assign(retryWithBackoff, {\n fail\n});\n\n// src/query/core/setupListeners.ts\nvar onFocus = /* @__PURE__ */ createAction(\"__rtkq/focused\");\nvar onFocusLost = /* @__PURE__ */ createAction(\"__rtkq/unfocused\");\nvar onOnline = /* @__PURE__ */ createAction(\"__rtkq/online\");\nvar onOffline = /* @__PURE__ */ createAction(\"__rtkq/offline\");\nvar initialized = false;\nfunction setupListeners(dispatch, customHandler) {\n function defaultHandler() {\n const handleFocus = () => dispatch(onFocus());\n const handleFocusLost = () => dispatch(onFocusLost());\n const handleOnline = () => dispatch(onOnline());\n const handleOffline = () => dispatch(onOffline());\n const handleVisibilityChange = () => {\n if (window.document.visibilityState === \"visible\") {\n handleFocus();\n } else {\n handleFocusLost();\n }\n };\n if (!initialized) {\n if (typeof window !== \"undefined\" && window.addEventListener) {\n window.addEventListener(\"visibilitychange\", handleVisibilityChange, false);\n window.addEventListener(\"focus\", handleFocus, false);\n window.addEventListener(\"online\", handleOnline, false);\n window.addEventListener(\"offline\", handleOffline, false);\n initialized = true;\n }\n }\n const unsubscribe = () => {\n window.removeEventListener(\"focus\", handleFocus);\n window.removeEventListener(\"visibilitychange\", handleVisibilityChange);\n window.removeEventListener(\"online\", handleOnline);\n window.removeEventListener(\"offline\", handleOffline);\n initialized = false;\n };\n return unsubscribe;\n }\n return customHandler ? customHandler(dispatch, {\n onFocus,\n onFocusLost,\n onOffline,\n onOnline\n }) : defaultHandler();\n}\n\n// src/query/endpointDefinitions.ts\nfunction isQueryDefinition(e) {\n return e.type === \"query\" /* query */;\n}\nfunction isMutationDefinition(e) {\n return e.type === \"mutation\" /* mutation */;\n}\nfunction calculateProvidedBy(description, result, error, queryArg, meta, assertTagTypes) {\n if (isFunction(description)) {\n return description(result, error, queryArg, meta).filter(isNotNullish).map(expandTagDescription).map(assertTagTypes);\n }\n if (Array.isArray(description)) {\n return description.map(expandTagDescription).map(assertTagTypes);\n }\n return [];\n}\nfunction isFunction(t) {\n return typeof t === \"function\";\n}\nfunction expandTagDescription(description) {\n return typeof description === \"string\" ? {\n type: description\n } : description;\n}\n\n// src/query/core/buildThunks.ts\nimport { isDraftable, produceWithPatches } from \"immer\";\n\n// src/query/core/buildInitiate.ts\nimport { formatProdErrorMessage as _formatProdErrorMessage } from \"@reduxjs/toolkit\";\n\n// src/tsHelpers.ts\nfunction asSafePromise(promise, fallback) {\n return promise.catch(fallback);\n}\n\n// src/query/core/buildInitiate.ts\nvar forceQueryFnSymbol = Symbol(\"forceQueryFn\");\nvar isUpsertQuery = (arg) => typeof arg[forceQueryFnSymbol] === \"function\";\nfunction buildInitiate({\n serializeQueryArgs,\n queryThunk,\n mutationThunk,\n api,\n context\n}) {\n const runningQueries = /* @__PURE__ */ new Map();\n const runningMutations = /* @__PURE__ */ new Map();\n const {\n unsubscribeQueryResult,\n removeMutationResult,\n updateSubscriptionOptions\n } = api.internalActions;\n return {\n buildInitiateQuery,\n buildInitiateMutation,\n getRunningQueryThunk,\n getRunningMutationThunk,\n getRunningQueriesThunk,\n getRunningMutationsThunk\n };\n function getRunningQueryThunk(endpointName, queryArgs) {\n return (dispatch) => {\n const endpointDefinition = context.endpointDefinitions[endpointName];\n const queryCacheKey = serializeQueryArgs({\n queryArgs,\n endpointDefinition,\n endpointName\n });\n return runningQueries.get(dispatch)?.[queryCacheKey];\n };\n }\n function getRunningMutationThunk(_endpointName, fixedCacheKeyOrRequestId) {\n return (dispatch) => {\n return runningMutations.get(dispatch)?.[fixedCacheKeyOrRequestId];\n };\n }\n function getRunningQueriesThunk() {\n return (dispatch) => Object.values(runningQueries.get(dispatch) || {}).filter(isNotNullish);\n }\n function getRunningMutationsThunk() {\n return (dispatch) => Object.values(runningMutations.get(dispatch) || {}).filter(isNotNullish);\n }\n function middlewareWarning(dispatch) {\n if (process.env.NODE_ENV !== \"production\") {\n if (middlewareWarning.triggered) return;\n const returnedValue = dispatch(api.internalActions.internal_getRTKQSubscriptions());\n middlewareWarning.triggered = true;\n if (typeof returnedValue !== \"object\" || typeof returnedValue?.type === \"string\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(34) : `Warning: Middleware for RTK-Query API at reducerPath \"${api.reducerPath}\" has not been added to the store.\nYou must add the middleware for RTK-Query to function correctly!`);\n }\n }\n }\n function buildInitiateQuery(endpointName, endpointDefinition) {\n const queryAction = (arg, {\n subscribe = true,\n forceRefetch,\n subscriptionOptions,\n [forceQueryFnSymbol]: forceQueryFn,\n ...rest\n } = {}) => (dispatch, getState) => {\n const queryCacheKey = serializeQueryArgs({\n queryArgs: arg,\n endpointDefinition,\n endpointName\n });\n const thunk = queryThunk({\n ...rest,\n type: \"query\",\n subscribe,\n forceRefetch,\n subscriptionOptions,\n endpointName,\n originalArgs: arg,\n queryCacheKey,\n [forceQueryFnSymbol]: forceQueryFn\n });\n const selector = api.endpoints[endpointName].select(arg);\n const thunkResult = dispatch(thunk);\n const stateAfter = selector(getState());\n middlewareWarning(dispatch);\n const {\n requestId,\n abort\n } = thunkResult;\n const skippedSynchronously = stateAfter.requestId !== requestId;\n const runningQuery = runningQueries.get(dispatch)?.[queryCacheKey];\n const selectFromState = () => selector(getState());\n const statePromise = Object.assign(forceQueryFn ? (\n // a query has been forced (upsertQueryData)\n // -> we want to resolve it once data has been written with the data that will be written\n thunkResult.then(selectFromState)\n ) : skippedSynchronously && !runningQuery ? (\n // a query has been skipped due to a condition and we do not have any currently running query\n // -> we want to resolve it immediately with the current data\n Promise.resolve(stateAfter)\n ) : (\n // query just started or one is already in flight\n // -> wait for the running query, then resolve with data from after that\n Promise.all([runningQuery, thunkResult]).then(selectFromState)\n ), {\n arg,\n requestId,\n subscriptionOptions,\n queryCacheKey,\n abort,\n async unwrap() {\n const result = await statePromise;\n if (result.isError) {\n throw result.error;\n }\n return result.data;\n },\n refetch: () => dispatch(queryAction(arg, {\n subscribe: false,\n forceRefetch: true\n })),\n unsubscribe() {\n if (subscribe) dispatch(unsubscribeQueryResult({\n queryCacheKey,\n requestId\n }));\n },\n updateSubscriptionOptions(options) {\n statePromise.subscriptionOptions = options;\n dispatch(updateSubscriptionOptions({\n endpointName,\n requestId,\n queryCacheKey,\n options\n }));\n }\n });\n if (!runningQuery && !skippedSynchronously && !forceQueryFn) {\n const running = getOrInsert(runningQueries, dispatch, {});\n running[queryCacheKey] = statePromise;\n statePromise.then(() => {\n delete running[queryCacheKey];\n if (!countObjectKeys(running)) {\n runningQueries.delete(dispatch);\n }\n });\n }\n return statePromise;\n };\n return queryAction;\n }\n function buildInitiateMutation(endpointName) {\n return (arg, {\n track = true,\n fixedCacheKey\n } = {}) => (dispatch, getState) => {\n const thunk = mutationThunk({\n type: \"mutation\",\n endpointName,\n originalArgs: arg,\n track,\n fixedCacheKey\n });\n const thunkResult = dispatch(thunk);\n middlewareWarning(dispatch);\n const {\n requestId,\n abort,\n unwrap\n } = thunkResult;\n const returnValuePromise = asSafePromise(thunkResult.unwrap().then((data) => ({\n data\n })), (error) => ({\n error\n }));\n const reset = () => {\n dispatch(removeMutationResult({\n requestId,\n fixedCacheKey\n }));\n };\n const ret = Object.assign(returnValuePromise, {\n arg: thunkResult.arg,\n requestId,\n abort,\n unwrap,\n reset\n });\n const running = runningMutations.get(dispatch) || {};\n runningMutations.set(dispatch, running);\n running[requestId] = ret;\n ret.then(() => {\n delete running[requestId];\n if (!countObjectKeys(running)) {\n runningMutations.delete(dispatch);\n }\n });\n if (fixedCacheKey) {\n running[fixedCacheKey] = ret;\n ret.then(() => {\n if (running[fixedCacheKey] === ret) {\n delete running[fixedCacheKey];\n if (!countObjectKeys(running)) {\n runningMutations.delete(dispatch);\n }\n }\n });\n }\n return ret;\n };\n }\n}\n\n// src/query/core/buildThunks.ts\nfunction defaultTransformResponse(baseQueryReturnValue) {\n return baseQueryReturnValue;\n}\nfunction buildThunks({\n reducerPath,\n baseQuery,\n context: {\n endpointDefinitions\n },\n serializeQueryArgs,\n api,\n assertTagType\n}) {\n const patchQueryData = (endpointName, arg, patches, updateProvided) => (dispatch, getState) => {\n const endpointDefinition = endpointDefinitions[endpointName];\n const queryCacheKey = serializeQueryArgs({\n queryArgs: arg,\n endpointDefinition,\n endpointName\n });\n dispatch(api.internalActions.queryResultPatched({\n queryCacheKey,\n patches\n }));\n if (!updateProvided) {\n return;\n }\n const newValue = api.endpoints[endpointName].select(arg)(\n // Work around TS 4.1 mismatch\n getState()\n );\n const providedTags = calculateProvidedBy(endpointDefinition.providesTags, newValue.data, void 0, arg, {}, assertTagType);\n dispatch(api.internalActions.updateProvidedBy({\n queryCacheKey,\n providedTags\n }));\n };\n const updateQueryData = (endpointName, arg, updateRecipe, updateProvided = true) => (dispatch, getState) => {\n const endpointDefinition = api.endpoints[endpointName];\n const currentState = endpointDefinition.select(arg)(\n // Work around TS 4.1 mismatch\n getState()\n );\n const ret = {\n patches: [],\n inversePatches: [],\n undo: () => dispatch(api.util.patchQueryData(endpointName, arg, ret.inversePatches, updateProvided))\n };\n if (currentState.status === \"uninitialized\" /* uninitialized */) {\n return ret;\n }\n let newValue;\n if (\"data\" in currentState) {\n if (isDraftable(currentState.data)) {\n const [value, patches, inversePatches] = produceWithPatches(currentState.data, updateRecipe);\n ret.patches.push(...patches);\n ret.inversePatches.push(...inversePatches);\n newValue = value;\n } else {\n newValue = updateRecipe(currentState.data);\n ret.patches.push({\n op: \"replace\",\n path: [],\n value: newValue\n });\n ret.inversePatches.push({\n op: \"replace\",\n path: [],\n value: currentState.data\n });\n }\n }\n if (ret.patches.length === 0) {\n return ret;\n }\n dispatch(api.util.patchQueryData(endpointName, arg, ret.patches, updateProvided));\n return ret;\n };\n const upsertQueryData = (endpointName, arg, value) => (dispatch) => {\n return dispatch(api.endpoints[endpointName].initiate(arg, {\n subscribe: false,\n forceRefetch: true,\n [forceQueryFnSymbol]: () => ({\n data: value\n })\n }));\n };\n const executeEndpoint = async (arg, {\n signal,\n abort,\n rejectWithValue,\n fulfillWithValue,\n dispatch,\n getState,\n extra\n }) => {\n const endpointDefinition = endpointDefinitions[arg.endpointName];\n try {\n let transformResponse = defaultTransformResponse;\n let result;\n const baseQueryApi = {\n signal,\n abort,\n dispatch,\n getState,\n extra,\n endpoint: arg.endpointName,\n type: arg.type,\n forced: arg.type === \"query\" ? isForcedQuery(arg, getState()) : void 0,\n queryCacheKey: arg.type === \"query\" ? arg.queryCacheKey : void 0\n };\n const forceQueryFn = arg.type === \"query\" ? arg[forceQueryFnSymbol] : void 0;\n if (forceQueryFn) {\n result = forceQueryFn();\n } else if (endpointDefinition.query) {\n result = await baseQuery(endpointDefinition.query(arg.originalArgs), baseQueryApi, endpointDefinition.extraOptions);\n if (endpointDefinition.transformResponse) {\n transformResponse = endpointDefinition.transformResponse;\n }\n } else {\n result = await endpointDefinition.queryFn(arg.originalArgs, baseQueryApi, endpointDefinition.extraOptions, (arg2) => baseQuery(arg2, baseQueryApi, endpointDefinition.extraOptions));\n }\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n const what = endpointDefinition.query ? \"`baseQuery`\" : \"`queryFn`\";\n let err;\n if (!result) {\n err = `${what} did not return anything.`;\n } else if (typeof result !== \"object\") {\n err = `${what} did not return an object.`;\n } else if (result.error && result.data) {\n err = `${what} returned an object containing both \\`error\\` and \\`result\\`.`;\n } else if (result.error === void 0 && result.data === void 0) {\n err = `${what} returned an object containing neither a valid \\`error\\` and \\`result\\`. At least one of them should not be \\`undefined\\``;\n } else {\n for (const key of Object.keys(result)) {\n if (key !== \"error\" && key !== \"data\" && key !== \"meta\") {\n err = `The object returned by ${what} has the unknown property ${key}.`;\n break;\n }\n }\n }\n if (err) {\n console.error(`Error encountered handling the endpoint ${arg.endpointName}.\n ${err}\n It needs to return an object with either the shape \\`{ data: }\\` or \\`{ error: }\\` that may contain an optional \\`meta\\` property.\n Object returned was:`, result);\n }\n }\n if (result.error) throw new HandledError(result.error, result.meta);\n return fulfillWithValue(await transformResponse(result.data, result.meta, arg.originalArgs), {\n fulfilledTimeStamp: Date.now(),\n baseQueryMeta: result.meta,\n [SHOULD_AUTOBATCH]: true\n });\n } catch (error) {\n let catchedError = error;\n if (catchedError instanceof HandledError) {\n let transformErrorResponse = defaultTransformResponse;\n if (endpointDefinition.query && endpointDefinition.transformErrorResponse) {\n transformErrorResponse = endpointDefinition.transformErrorResponse;\n }\n try {\n return rejectWithValue(await transformErrorResponse(catchedError.value, catchedError.meta, arg.originalArgs), {\n baseQueryMeta: catchedError.meta,\n [SHOULD_AUTOBATCH]: true\n });\n } catch (e) {\n catchedError = e;\n }\n }\n if (typeof process !== \"undefined\" && process.env.NODE_ENV !== \"production\") {\n console.error(`An unhandled error occurred processing a request for the endpoint \"${arg.endpointName}\".\nIn the case of an unhandled error, no tags will be \"provided\" or \"invalidated\".`, catchedError);\n } else {\n console.error(catchedError);\n }\n throw catchedError;\n }\n };\n function isForcedQuery(arg, state) {\n const requestState = state[reducerPath]?.queries?.[arg.queryCacheKey];\n const baseFetchOnMountOrArgChange = state[reducerPath]?.config.refetchOnMountOrArgChange;\n const fulfilledVal = requestState?.fulfilledTimeStamp;\n const refetchVal = arg.forceRefetch ?? (arg.subscribe && baseFetchOnMountOrArgChange);\n if (refetchVal) {\n return refetchVal === true || (Number(/* @__PURE__ */ new Date()) - Number(fulfilledVal)) / 1e3 >= refetchVal;\n }\n return false;\n }\n const queryThunk = createAsyncThunk(`${reducerPath}/executeQuery`, executeEndpoint, {\n getPendingMeta() {\n return {\n startedTimeStamp: Date.now(),\n [SHOULD_AUTOBATCH]: true\n };\n },\n condition(queryThunkArgs, {\n getState\n }) {\n const state = getState();\n const requestState = state[reducerPath]?.queries?.[queryThunkArgs.queryCacheKey];\n const fulfilledVal = requestState?.fulfilledTimeStamp;\n const currentArg = queryThunkArgs.originalArgs;\n const previousArg = requestState?.originalArgs;\n const endpointDefinition = endpointDefinitions[queryThunkArgs.endpointName];\n if (isUpsertQuery(queryThunkArgs)) {\n return true;\n }\n if (requestState?.status === \"pending\") {\n return false;\n }\n if (isForcedQuery(queryThunkArgs, state)) {\n return true;\n }\n if (isQueryDefinition(endpointDefinition) && endpointDefinition?.forceRefetch?.({\n currentArg,\n previousArg,\n endpointState: requestState,\n state\n })) {\n return true;\n }\n if (fulfilledVal) {\n return false;\n }\n return true;\n },\n dispatchConditionRejection: true\n });\n const mutationThunk = createAsyncThunk(`${reducerPath}/executeMutation`, executeEndpoint, {\n getPendingMeta() {\n return {\n startedTimeStamp: Date.now(),\n [SHOULD_AUTOBATCH]: true\n };\n }\n });\n const hasTheForce = (options) => \"force\" in options;\n const hasMaxAge = (options) => \"ifOlderThan\" in options;\n const prefetch = (endpointName, arg, options) => (dispatch, getState) => {\n const force = hasTheForce(options) && options.force;\n const maxAge = hasMaxAge(options) && options.ifOlderThan;\n const queryAction = (force2 = true) => {\n const options2 = {\n forceRefetch: force2,\n isPrefetch: true\n };\n return api.endpoints[endpointName].initiate(arg, options2);\n };\n const latestStateValue = api.endpoints[endpointName].select(arg)(getState());\n if (force) {\n dispatch(queryAction());\n } else if (maxAge) {\n const lastFulfilledTs = latestStateValue?.fulfilledTimeStamp;\n if (!lastFulfilledTs) {\n dispatch(queryAction());\n return;\n }\n const shouldRetrigger = (Number(/* @__PURE__ */ new Date()) - Number(new Date(lastFulfilledTs))) / 1e3 >= maxAge;\n if (shouldRetrigger) {\n dispatch(queryAction());\n }\n } else {\n dispatch(queryAction(false));\n }\n };\n function matchesEndpoint(endpointName) {\n return (action) => action?.meta?.arg?.endpointName === endpointName;\n }\n function buildMatchThunkActions(thunk, endpointName) {\n return {\n matchPending: isAllOf(isPending(thunk), matchesEndpoint(endpointName)),\n matchFulfilled: isAllOf(isFulfilled(thunk), matchesEndpoint(endpointName)),\n matchRejected: isAllOf(isRejected(thunk), matchesEndpoint(endpointName))\n };\n }\n return {\n queryThunk,\n mutationThunk,\n prefetch,\n updateQueryData,\n upsertQueryData,\n patchQueryData,\n buildMatchThunkActions\n };\n}\nfunction calculateProvidedByThunk(action, type, endpointDefinitions, assertTagType) {\n return calculateProvidedBy(endpointDefinitions[action.meta.arg.endpointName][type], isFulfilled(action) ? action.payload : void 0, isRejectedWithValue(action) ? action.payload : void 0, action.meta.arg.originalArgs, \"baseQueryMeta\" in action.meta ? action.meta.baseQueryMeta : void 0, assertTagType);\n}\n\n// src/query/core/buildSlice.ts\nimport { isDraft } from \"immer\";\nimport { applyPatches, original } from \"immer\";\nfunction updateQuerySubstateIfExists(state, queryCacheKey, update) {\n const substate = state[queryCacheKey];\n if (substate) {\n update(substate);\n }\n}\nfunction getMutationCacheKey(id) {\n return (\"arg\" in id ? id.arg.fixedCacheKey : id.fixedCacheKey) ?? id.requestId;\n}\nfunction updateMutationSubstateIfExists(state, id, update) {\n const substate = state[getMutationCacheKey(id)];\n if (substate) {\n update(substate);\n }\n}\nvar initialState = {};\nfunction buildSlice({\n reducerPath,\n queryThunk,\n mutationThunk,\n serializeQueryArgs,\n context: {\n endpointDefinitions: definitions,\n apiUid,\n extractRehydrationInfo,\n hasRehydrationInfo\n },\n assertTagType,\n config\n}) {\n const resetApiState = createAction(`${reducerPath}/resetApiState`);\n function writePendingCacheEntry(draft, arg, upserting, meta) {\n draft[arg.queryCacheKey] ??= {\n status: \"uninitialized\" /* uninitialized */,\n endpointName: arg.endpointName\n };\n updateQuerySubstateIfExists(draft, arg.queryCacheKey, (substate) => {\n substate.status = \"pending\" /* pending */;\n substate.requestId = upserting && substate.requestId ? (\n // for `upsertQuery` **updates**, keep the current `requestId`\n substate.requestId\n ) : (\n // for normal queries or `upsertQuery` **inserts** always update the `requestId`\n meta.requestId\n );\n if (arg.originalArgs !== void 0) {\n substate.originalArgs = arg.originalArgs;\n }\n substate.startedTimeStamp = meta.startedTimeStamp;\n });\n }\n function writeFulfilledCacheEntry(draft, meta, payload, upserting) {\n updateQuerySubstateIfExists(draft, meta.arg.queryCacheKey, (substate) => {\n if (substate.requestId !== meta.requestId && !upserting) return;\n const {\n merge\n } = definitions[meta.arg.endpointName];\n substate.status = \"fulfilled\" /* fulfilled */;\n if (merge) {\n if (substate.data !== void 0) {\n const {\n fulfilledTimeStamp,\n arg,\n baseQueryMeta,\n requestId\n } = meta;\n let newData = createNextState(substate.data, (draftSubstateData) => {\n return merge(draftSubstateData, payload, {\n arg: arg.originalArgs,\n baseQueryMeta,\n fulfilledTimeStamp,\n requestId\n });\n });\n substate.data = newData;\n } else {\n substate.data = payload;\n }\n } else {\n substate.data = definitions[meta.arg.endpointName].structuralSharing ?? true ? copyWithStructuralSharing(isDraft(substate.data) ? original(substate.data) : substate.data, payload) : payload;\n }\n delete substate.error;\n substate.fulfilledTimeStamp = meta.fulfilledTimeStamp;\n });\n }\n const querySlice = createSlice({\n name: `${reducerPath}/queries`,\n initialState,\n reducers: {\n removeQueryResult: {\n reducer(draft, {\n payload: {\n queryCacheKey\n }\n }) {\n delete draft[queryCacheKey];\n },\n prepare: prepareAutoBatched()\n },\n cacheEntriesUpserted: {\n reducer(draft, action) {\n for (const entry of action.payload) {\n const {\n queryDescription: arg,\n value\n } = entry;\n writePendingCacheEntry(draft, arg, true, {\n arg,\n requestId: action.meta.requestId,\n startedTimeStamp: action.meta.timestamp\n });\n writeFulfilledCacheEntry(\n draft,\n {\n arg,\n requestId: action.meta.requestId,\n fulfilledTimeStamp: action.meta.timestamp,\n baseQueryMeta: {}\n },\n value,\n // We know we're upserting here\n true\n );\n }\n },\n prepare: (payload) => {\n const queryDescriptions = payload.map((entry) => {\n const {\n endpointName,\n arg,\n value\n } = entry;\n const endpointDefinition = definitions[endpointName];\n const queryDescription = {\n type: \"query\",\n endpointName,\n originalArgs: entry.arg,\n queryCacheKey: serializeQueryArgs({\n queryArgs: arg,\n endpointDefinition,\n endpointName\n })\n };\n return {\n queryDescription,\n value\n };\n });\n const result = {\n payload: queryDescriptions,\n meta: {\n [SHOULD_AUTOBATCH]: true,\n requestId: nanoid(),\n timestamp: Date.now()\n }\n };\n return result;\n }\n },\n queryResultPatched: {\n reducer(draft, {\n payload: {\n queryCacheKey,\n patches\n }\n }) {\n updateQuerySubstateIfExists(draft, queryCacheKey, (substate) => {\n substate.data = applyPatches(substate.data, patches.concat());\n });\n },\n prepare: prepareAutoBatched()\n }\n },\n extraReducers(builder) {\n builder.addCase(queryThunk.pending, (draft, {\n meta,\n meta: {\n arg\n }\n }) => {\n const upserting = isUpsertQuery(arg);\n writePendingCacheEntry(draft, arg, upserting, meta);\n }).addCase(queryThunk.fulfilled, (draft, {\n meta,\n payload\n }) => {\n const upserting = isUpsertQuery(meta.arg);\n writeFulfilledCacheEntry(draft, meta, payload, upserting);\n }).addCase(queryThunk.rejected, (draft, {\n meta: {\n condition,\n arg,\n requestId\n },\n error,\n payload\n }) => {\n updateQuerySubstateIfExists(draft, arg.queryCacheKey, (substate) => {\n if (condition) {\n } else {\n if (substate.requestId !== requestId) return;\n substate.status = \"rejected\" /* rejected */;\n substate.error = payload ?? error;\n }\n });\n }).addMatcher(hasRehydrationInfo, (draft, action) => {\n const {\n queries\n } = extractRehydrationInfo(action);\n for (const [key, entry] of Object.entries(queries)) {\n if (\n // do not rehydrate entries that were currently in flight.\n entry?.status === \"fulfilled\" /* fulfilled */ || entry?.status === \"rejected\" /* rejected */\n ) {\n draft[key] = entry;\n }\n }\n });\n }\n });\n const mutationSlice = createSlice({\n name: `${reducerPath}/mutations`,\n initialState,\n reducers: {\n removeMutationResult: {\n reducer(draft, {\n payload\n }) {\n const cacheKey = getMutationCacheKey(payload);\n if (cacheKey in draft) {\n delete draft[cacheKey];\n }\n },\n prepare: prepareAutoBatched()\n }\n },\n extraReducers(builder) {\n builder.addCase(mutationThunk.pending, (draft, {\n meta,\n meta: {\n requestId,\n arg,\n startedTimeStamp\n }\n }) => {\n if (!arg.track) return;\n draft[getMutationCacheKey(meta)] = {\n requestId,\n status: \"pending\" /* pending */,\n endpointName: arg.endpointName,\n startedTimeStamp\n };\n }).addCase(mutationThunk.fulfilled, (draft, {\n payload,\n meta\n }) => {\n if (!meta.arg.track) return;\n updateMutationSubstateIfExists(draft, meta, (substate) => {\n if (substate.requestId !== meta.requestId) return;\n substate.status = \"fulfilled\" /* fulfilled */;\n substate.data = payload;\n substate.fulfilledTimeStamp = meta.fulfilledTimeStamp;\n });\n }).addCase(mutationThunk.rejected, (draft, {\n payload,\n error,\n meta\n }) => {\n if (!meta.arg.track) return;\n updateMutationSubstateIfExists(draft, meta, (substate) => {\n if (substate.requestId !== meta.requestId) return;\n substate.status = \"rejected\" /* rejected */;\n substate.error = payload ?? error;\n });\n }).addMatcher(hasRehydrationInfo, (draft, action) => {\n const {\n mutations\n } = extractRehydrationInfo(action);\n for (const [key, entry] of Object.entries(mutations)) {\n if (\n // do not rehydrate entries that were currently in flight.\n (entry?.status === \"fulfilled\" /* fulfilled */ || entry?.status === \"rejected\" /* rejected */) && // only rehydrate endpoints that were persisted using a `fixedCacheKey`\n key !== entry?.requestId\n ) {\n draft[key] = entry;\n }\n }\n });\n }\n });\n const invalidationSlice = createSlice({\n name: `${reducerPath}/invalidation`,\n initialState,\n reducers: {\n updateProvidedBy: {\n reducer(draft, action) {\n const {\n queryCacheKey,\n providedTags\n } = action.payload;\n for (const tagTypeSubscriptions of Object.values(draft)) {\n for (const idSubscriptions of Object.values(tagTypeSubscriptions)) {\n const foundAt = idSubscriptions.indexOf(queryCacheKey);\n if (foundAt !== -1) {\n idSubscriptions.splice(foundAt, 1);\n }\n }\n }\n for (const {\n type,\n id\n } of providedTags) {\n const subscribedQueries = (draft[type] ??= {})[id || \"__internal_without_id\"] ??= [];\n const alreadySubscribed = subscribedQueries.includes(queryCacheKey);\n if (!alreadySubscribed) {\n subscribedQueries.push(queryCacheKey);\n }\n }\n },\n prepare: prepareAutoBatched()\n }\n },\n extraReducers(builder) {\n builder.addCase(querySlice.actions.removeQueryResult, (draft, {\n payload: {\n queryCacheKey\n }\n }) => {\n for (const tagTypeSubscriptions of Object.values(draft)) {\n for (const idSubscriptions of Object.values(tagTypeSubscriptions)) {\n const foundAt = idSubscriptions.indexOf(queryCacheKey);\n if (foundAt !== -1) {\n idSubscriptions.splice(foundAt, 1);\n }\n }\n }\n }).addMatcher(hasRehydrationInfo, (draft, action) => {\n const {\n provided\n } = extractRehydrationInfo(action);\n for (const [type, incomingTags] of Object.entries(provided)) {\n for (const [id, cacheKeys] of Object.entries(incomingTags)) {\n const subscribedQueries = (draft[type] ??= {})[id || \"__internal_without_id\"] ??= [];\n for (const queryCacheKey of cacheKeys) {\n const alreadySubscribed = subscribedQueries.includes(queryCacheKey);\n if (!alreadySubscribed) {\n subscribedQueries.push(queryCacheKey);\n }\n }\n }\n }\n }).addMatcher(isAnyOf(isFulfilled(queryThunk), isRejectedWithValue(queryThunk)), (draft, action) => {\n const providedTags = calculateProvidedByThunk(action, \"providesTags\", definitions, assertTagType);\n const {\n queryCacheKey\n } = action.meta.arg;\n invalidationSlice.caseReducers.updateProvidedBy(draft, invalidationSlice.actions.updateProvidedBy({\n queryCacheKey,\n providedTags\n }));\n });\n }\n });\n const subscriptionSlice = createSlice({\n name: `${reducerPath}/subscriptions`,\n initialState,\n reducers: {\n updateSubscriptionOptions(d, a) {\n },\n unsubscribeQueryResult(d, a) {\n },\n internal_getRTKQSubscriptions() {\n }\n }\n });\n const internalSubscriptionsSlice = createSlice({\n name: `${reducerPath}/internalSubscriptions`,\n initialState,\n reducers: {\n subscriptionsUpdated: {\n reducer(state, action) {\n return applyPatches(state, action.payload);\n },\n prepare: prepareAutoBatched()\n }\n }\n });\n const configSlice = createSlice({\n name: `${reducerPath}/config`,\n initialState: {\n online: isOnline(),\n focused: isDocumentVisible(),\n middlewareRegistered: false,\n ...config\n },\n reducers: {\n middlewareRegistered(state, {\n payload\n }) {\n state.middlewareRegistered = state.middlewareRegistered === \"conflict\" || apiUid !== payload ? \"conflict\" : true;\n }\n },\n extraReducers: (builder) => {\n builder.addCase(onOnline, (state) => {\n state.online = true;\n }).addCase(onOffline, (state) => {\n state.online = false;\n }).addCase(onFocus, (state) => {\n state.focused = true;\n }).addCase(onFocusLost, (state) => {\n state.focused = false;\n }).addMatcher(hasRehydrationInfo, (draft) => ({\n ...draft\n }));\n }\n });\n const combinedReducer = combineReducers({\n queries: querySlice.reducer,\n mutations: mutationSlice.reducer,\n provided: invalidationSlice.reducer,\n subscriptions: internalSubscriptionsSlice.reducer,\n config: configSlice.reducer\n });\n const reducer = (state, action) => combinedReducer(resetApiState.match(action) ? void 0 : state, action);\n const actions = {\n ...configSlice.actions,\n ...querySlice.actions,\n ...subscriptionSlice.actions,\n ...internalSubscriptionsSlice.actions,\n ...mutationSlice.actions,\n ...invalidationSlice.actions,\n resetApiState\n };\n return {\n reducer,\n actions\n };\n}\n\n// src/query/core/buildSelectors.ts\nvar skipToken = /* @__PURE__ */ Symbol.for(\"RTKQ/skipToken\");\nvar initialSubState = {\n status: \"uninitialized\" /* uninitialized */\n};\nvar defaultQuerySubState = /* @__PURE__ */ createNextState(initialSubState, () => {\n});\nvar defaultMutationSubState = /* @__PURE__ */ createNextState(initialSubState, () => {\n});\nfunction buildSelectors({\n serializeQueryArgs,\n reducerPath,\n createSelector: createSelector2\n}) {\n const selectSkippedQuery = (state) => defaultQuerySubState;\n const selectSkippedMutation = (state) => defaultMutationSubState;\n return {\n buildQuerySelector,\n buildMutationSelector,\n selectInvalidatedBy,\n selectCachedArgsForQuery\n };\n function withRequestFlags(substate) {\n return {\n ...substate,\n ...getRequestStatusFlags(substate.status)\n };\n }\n function selectInternalState(rootState) {\n const state = rootState[reducerPath];\n if (process.env.NODE_ENV !== \"production\") {\n if (!state) {\n if (selectInternalState.triggered) return state;\n selectInternalState.triggered = true;\n console.error(`Error: No data found at \\`state.${reducerPath}\\`. Did you forget to add the reducer to the store?`);\n }\n }\n return state;\n }\n function buildQuerySelector(endpointName, endpointDefinition) {\n return (queryArgs) => {\n if (queryArgs === skipToken) {\n return createSelector2(selectSkippedQuery, withRequestFlags);\n }\n const serializedArgs = serializeQueryArgs({\n queryArgs,\n endpointDefinition,\n endpointName\n });\n const selectQuerySubstate = (state) => selectInternalState(state)?.queries?.[serializedArgs] ?? defaultQuerySubState;\n return createSelector2(selectQuerySubstate, withRequestFlags);\n };\n }\n function buildMutationSelector() {\n return (id) => {\n let mutationId;\n if (typeof id === \"object\") {\n mutationId = getMutationCacheKey(id) ?? skipToken;\n } else {\n mutationId = id;\n }\n const selectMutationSubstate = (state) => selectInternalState(state)?.mutations?.[mutationId] ?? defaultMutationSubState;\n const finalSelectMutationSubstate = mutationId === skipToken ? selectSkippedMutation : selectMutationSubstate;\n return createSelector2(finalSelectMutationSubstate, withRequestFlags);\n };\n }\n function selectInvalidatedBy(state, tags) {\n const apiState = state[reducerPath];\n const toInvalidate = /* @__PURE__ */ new Set();\n for (const tag of tags.filter(isNotNullish).map(expandTagDescription)) {\n const provided = apiState.provided[tag.type];\n if (!provided) {\n continue;\n }\n let invalidateSubscriptions = (tag.id !== void 0 ? (\n // id given: invalidate all queries that provide this type & id\n provided[tag.id]\n ) : (\n // no id: invalidate all queries that provide this type\n flatten(Object.values(provided))\n )) ?? [];\n for (const invalidate of invalidateSubscriptions) {\n toInvalidate.add(invalidate);\n }\n }\n return flatten(Array.from(toInvalidate.values()).map((queryCacheKey) => {\n const querySubState = apiState.queries[queryCacheKey];\n return querySubState ? [{\n queryCacheKey,\n endpointName: querySubState.endpointName,\n originalArgs: querySubState.originalArgs\n }] : [];\n }));\n }\n function selectCachedArgsForQuery(state, queryName) {\n return Object.values(state[reducerPath].queries).filter((entry) => entry?.endpointName === queryName && entry.status !== \"uninitialized\" /* uninitialized */).map((entry) => entry.originalArgs);\n }\n}\n\n// src/query/createApi.ts\nimport { formatProdErrorMessage as _formatProdErrorMessage2 } from \"@reduxjs/toolkit\";\n\n// src/query/defaultSerializeQueryArgs.ts\nvar cache = WeakMap ? /* @__PURE__ */ new WeakMap() : void 0;\nvar defaultSerializeQueryArgs = ({\n endpointName,\n queryArgs\n}) => {\n let serialized = \"\";\n const cached = cache?.get(queryArgs);\n if (typeof cached === \"string\") {\n serialized = cached;\n } else {\n const stringified = JSON.stringify(queryArgs, (key, value) => {\n value = typeof value === \"bigint\" ? {\n $bigint: value.toString()\n } : value;\n value = isPlainObject(value) ? Object.keys(value).sort().reduce((acc, key2) => {\n acc[key2] = value[key2];\n return acc;\n }, {}) : value;\n return value;\n });\n if (isPlainObject(queryArgs)) {\n cache?.set(queryArgs, stringified);\n }\n serialized = stringified;\n }\n return `${endpointName}(${serialized})`;\n};\n\n// src/query/createApi.ts\nimport { weakMapMemoize } from \"reselect\";\nfunction buildCreateApi(...modules) {\n return function baseCreateApi(options) {\n const extractRehydrationInfo = weakMapMemoize((action) => options.extractRehydrationInfo?.(action, {\n reducerPath: options.reducerPath ?? \"api\"\n }));\n const optionsWithDefaults = {\n reducerPath: \"api\",\n keepUnusedDataFor: 60,\n refetchOnMountOrArgChange: false,\n refetchOnFocus: false,\n refetchOnReconnect: false,\n invalidationBehavior: \"delayed\",\n ...options,\n extractRehydrationInfo,\n serializeQueryArgs(queryArgsApi) {\n let finalSerializeQueryArgs = defaultSerializeQueryArgs;\n if (\"serializeQueryArgs\" in queryArgsApi.endpointDefinition) {\n const endpointSQA = queryArgsApi.endpointDefinition.serializeQueryArgs;\n finalSerializeQueryArgs = (queryArgsApi2) => {\n const initialResult = endpointSQA(queryArgsApi2);\n if (typeof initialResult === \"string\") {\n return initialResult;\n } else {\n return defaultSerializeQueryArgs({\n ...queryArgsApi2,\n queryArgs: initialResult\n });\n }\n };\n } else if (options.serializeQueryArgs) {\n finalSerializeQueryArgs = options.serializeQueryArgs;\n }\n return finalSerializeQueryArgs(queryArgsApi);\n },\n tagTypes: [...options.tagTypes || []]\n };\n const context = {\n endpointDefinitions: {},\n batch(fn) {\n fn();\n },\n apiUid: nanoid(),\n extractRehydrationInfo,\n hasRehydrationInfo: weakMapMemoize((action) => extractRehydrationInfo(action) != null)\n };\n const api = {\n injectEndpoints,\n enhanceEndpoints({\n addTagTypes,\n endpoints\n }) {\n if (addTagTypes) {\n for (const eT of addTagTypes) {\n if (!optionsWithDefaults.tagTypes.includes(eT)) {\n ;\n optionsWithDefaults.tagTypes.push(eT);\n }\n }\n }\n if (endpoints) {\n for (const [endpointName, partialDefinition] of Object.entries(endpoints)) {\n if (typeof partialDefinition === \"function\") {\n partialDefinition(context.endpointDefinitions[endpointName]);\n } else {\n Object.assign(context.endpointDefinitions[endpointName] || {}, partialDefinition);\n }\n }\n }\n return api;\n }\n };\n const initializedModules = modules.map((m) => m.init(api, optionsWithDefaults, context));\n function injectEndpoints(inject) {\n const evaluatedEndpoints = inject.endpoints({\n query: (x) => ({\n ...x,\n type: \"query\" /* query */\n }),\n mutation: (x) => ({\n ...x,\n type: \"mutation\" /* mutation */\n })\n });\n for (const [endpointName, definition] of Object.entries(evaluatedEndpoints)) {\n if (inject.overrideExisting !== true && endpointName in context.endpointDefinitions) {\n if (inject.overrideExisting === \"throw\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(39) : `called \\`injectEndpoints\\` to override already-existing endpointName ${endpointName} without specifying \\`overrideExisting: true\\``);\n } else if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n console.error(`called \\`injectEndpoints\\` to override already-existing endpointName ${endpointName} without specifying \\`overrideExisting: true\\``);\n }\n continue;\n }\n context.endpointDefinitions[endpointName] = definition;\n for (const m of initializedModules) {\n m.injectEndpoint(endpointName, definition);\n }\n }\n return api;\n }\n return api.injectEndpoints({\n endpoints: options.endpoints\n });\n };\n}\n\n// src/query/fakeBaseQuery.ts\nimport { formatProdErrorMessage as _formatProdErrorMessage3 } from \"@reduxjs/toolkit\";\nvar _NEVER = /* @__PURE__ */ Symbol();\nfunction fakeBaseQuery() {\n return function() {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(33) : \"When using `fakeBaseQuery`, all queries & mutations must use the `queryFn` definition syntax.\");\n };\n}\n\n// src/query/core/module.ts\nimport { enablePatches } from \"immer\";\n\n// src/query/tsHelpers.ts\nfunction assertCast(v) {\n}\nfunction safeAssign(target, ...args) {\n return Object.assign(target, ...args);\n}\n\n// src/query/core/buildMiddleware/batchActions.ts\nimport { produceWithPatches as produceWithPatches2 } from \"immer\";\nvar buildBatchedActionsHandler = ({\n api,\n queryThunk,\n internalState\n}) => {\n const subscriptionsPrefix = `${api.reducerPath}/subscriptions`;\n let previousSubscriptions = null;\n let updateSyncTimer = null;\n const {\n updateSubscriptionOptions,\n unsubscribeQueryResult\n } = api.internalActions;\n const actuallyMutateSubscriptions = (mutableState, action) => {\n if (updateSubscriptionOptions.match(action)) {\n const {\n queryCacheKey,\n requestId,\n options\n } = action.payload;\n if (mutableState?.[queryCacheKey]?.[requestId]) {\n mutableState[queryCacheKey][requestId] = options;\n }\n return true;\n }\n if (unsubscribeQueryResult.match(action)) {\n const {\n queryCacheKey,\n requestId\n } = action.payload;\n if (mutableState[queryCacheKey]) {\n delete mutableState[queryCacheKey][requestId];\n }\n return true;\n }\n if (api.internalActions.removeQueryResult.match(action)) {\n delete mutableState[action.payload.queryCacheKey];\n return true;\n }\n if (queryThunk.pending.match(action)) {\n const {\n meta: {\n arg,\n requestId\n }\n } = action;\n const substate = mutableState[arg.queryCacheKey] ??= {};\n substate[`${requestId}_running`] = {};\n if (arg.subscribe) {\n substate[requestId] = arg.subscriptionOptions ?? substate[requestId] ?? {};\n }\n return true;\n }\n let mutated = false;\n if (queryThunk.fulfilled.match(action) || queryThunk.rejected.match(action)) {\n const state = mutableState[action.meta.arg.queryCacheKey] || {};\n const key = `${action.meta.requestId}_running`;\n mutated ||= !!state[key];\n delete state[key];\n }\n if (queryThunk.rejected.match(action)) {\n const {\n meta: {\n condition,\n arg,\n requestId\n }\n } = action;\n if (condition && arg.subscribe) {\n const substate = mutableState[arg.queryCacheKey] ??= {};\n substate[requestId] = arg.subscriptionOptions ?? substate[requestId] ?? {};\n mutated = true;\n }\n }\n return mutated;\n };\n const getSubscriptions = () => internalState.currentSubscriptions;\n const getSubscriptionCount = (queryCacheKey) => {\n const subscriptions = getSubscriptions();\n const subscriptionsForQueryArg = subscriptions[queryCacheKey] ?? {};\n return countObjectKeys(subscriptionsForQueryArg);\n };\n const isRequestSubscribed = (queryCacheKey, requestId) => {\n const subscriptions = getSubscriptions();\n return !!subscriptions?.[queryCacheKey]?.[requestId];\n };\n const subscriptionSelectors = {\n getSubscriptions,\n getSubscriptionCount,\n isRequestSubscribed\n };\n return (action, mwApi) => {\n if (!previousSubscriptions) {\n previousSubscriptions = JSON.parse(JSON.stringify(internalState.currentSubscriptions));\n }\n if (api.util.resetApiState.match(action)) {\n previousSubscriptions = internalState.currentSubscriptions = {};\n updateSyncTimer = null;\n return [true, false];\n }\n if (api.internalActions.internal_getRTKQSubscriptions.match(action)) {\n return [false, subscriptionSelectors];\n }\n const didMutate = actuallyMutateSubscriptions(internalState.currentSubscriptions, action);\n let actionShouldContinue = true;\n if (didMutate) {\n if (!updateSyncTimer) {\n updateSyncTimer = setTimeout(() => {\n const newSubscriptions = JSON.parse(JSON.stringify(internalState.currentSubscriptions));\n const [, patches] = produceWithPatches2(previousSubscriptions, () => newSubscriptions);\n mwApi.next(api.internalActions.subscriptionsUpdated(patches));\n previousSubscriptions = newSubscriptions;\n updateSyncTimer = null;\n }, 500);\n }\n const isSubscriptionSliceAction = typeof action.type == \"string\" && !!action.type.startsWith(subscriptionsPrefix);\n const isAdditionalSubscriptionAction = queryThunk.rejected.match(action) && action.meta.condition && !!action.meta.arg.subscribe;\n actionShouldContinue = !isSubscriptionSliceAction && !isAdditionalSubscriptionAction;\n }\n return [actionShouldContinue, false];\n };\n};\n\n// src/query/core/buildMiddleware/cacheCollection.ts\nfunction isObjectEmpty(obj) {\n for (const k in obj) {\n return false;\n }\n return true;\n}\nvar THIRTY_TWO_BIT_MAX_TIMER_SECONDS = 2147483647 / 1e3 - 1;\nvar buildCacheCollectionHandler = ({\n reducerPath,\n api,\n queryThunk,\n context,\n internalState\n}) => {\n const {\n removeQueryResult,\n unsubscribeQueryResult,\n cacheEntriesUpserted\n } = api.internalActions;\n const canTriggerUnsubscribe = isAnyOf(unsubscribeQueryResult.match, queryThunk.fulfilled, queryThunk.rejected, cacheEntriesUpserted.match);\n function anySubscriptionsRemainingForKey(queryCacheKey) {\n const subscriptions = internalState.currentSubscriptions[queryCacheKey];\n return !!subscriptions && !isObjectEmpty(subscriptions);\n }\n const currentRemovalTimeouts = {};\n const handler = (action, mwApi, internalState2) => {\n if (canTriggerUnsubscribe(action)) {\n const state = mwApi.getState()[reducerPath];\n let queryCacheKeys;\n if (cacheEntriesUpserted.match(action)) {\n queryCacheKeys = action.payload.map((entry) => entry.queryDescription.queryCacheKey);\n } else {\n const {\n queryCacheKey\n } = unsubscribeQueryResult.match(action) ? action.payload : action.meta.arg;\n queryCacheKeys = [queryCacheKey];\n }\n for (const queryCacheKey of queryCacheKeys) {\n handleUnsubscribe(queryCacheKey, state.queries[queryCacheKey]?.endpointName, mwApi, state.config);\n }\n }\n if (api.util.resetApiState.match(action)) {\n for (const [key, timeout] of Object.entries(currentRemovalTimeouts)) {\n if (timeout) clearTimeout(timeout);\n delete currentRemovalTimeouts[key];\n }\n }\n if (context.hasRehydrationInfo(action)) {\n const state = mwApi.getState()[reducerPath];\n const {\n queries\n } = context.extractRehydrationInfo(action);\n for (const [queryCacheKey, queryState] of Object.entries(queries)) {\n handleUnsubscribe(queryCacheKey, queryState?.endpointName, mwApi, state.config);\n }\n }\n };\n function handleUnsubscribe(queryCacheKey, endpointName, api2, config) {\n const endpointDefinition = context.endpointDefinitions[endpointName];\n const keepUnusedDataFor = endpointDefinition?.keepUnusedDataFor ?? config.keepUnusedDataFor;\n if (keepUnusedDataFor === Infinity) {\n return;\n }\n const finalKeepUnusedDataFor = Math.max(0, Math.min(keepUnusedDataFor, THIRTY_TWO_BIT_MAX_TIMER_SECONDS));\n if (!anySubscriptionsRemainingForKey(queryCacheKey)) {\n const currentTimeout = currentRemovalTimeouts[queryCacheKey];\n if (currentTimeout) {\n clearTimeout(currentTimeout);\n }\n currentRemovalTimeouts[queryCacheKey] = setTimeout(() => {\n if (!anySubscriptionsRemainingForKey(queryCacheKey)) {\n api2.dispatch(removeQueryResult({\n queryCacheKey\n }));\n }\n delete currentRemovalTimeouts[queryCacheKey];\n }, finalKeepUnusedDataFor * 1e3);\n }\n }\n return handler;\n};\n\n// src/query/core/buildMiddleware/cacheLifecycle.ts\nvar neverResolvedError = new Error(\"Promise never resolved before cacheEntryRemoved.\");\nvar buildCacheLifecycleHandler = ({\n api,\n reducerPath,\n context,\n queryThunk,\n mutationThunk,\n internalState\n}) => {\n const isQueryThunk = isAsyncThunkAction(queryThunk);\n const isMutationThunk = isAsyncThunkAction(mutationThunk);\n const isFulfilledThunk = isFulfilled(queryThunk, mutationThunk);\n const lifecycleMap = {};\n function resolveLifecycleEntry(cacheKey, data, meta) {\n const lifecycle = lifecycleMap[cacheKey];\n if (lifecycle?.valueResolved) {\n lifecycle.valueResolved({\n data,\n meta\n });\n delete lifecycle.valueResolved;\n }\n }\n function removeLifecycleEntry(cacheKey) {\n const lifecycle = lifecycleMap[cacheKey];\n if (lifecycle) {\n delete lifecycleMap[cacheKey];\n lifecycle.cacheEntryRemoved();\n }\n }\n const handler = (action, mwApi, stateBefore) => {\n const cacheKey = getCacheKey(action);\n function checkForNewCacheKey(endpointName, cacheKey2, requestId, originalArgs) {\n const oldState = stateBefore[reducerPath].queries[cacheKey2];\n const state = mwApi.getState()[reducerPath].queries[cacheKey2];\n if (!oldState && state) {\n handleNewKey(endpointName, originalArgs, cacheKey2, mwApi, requestId);\n }\n }\n if (queryThunk.pending.match(action)) {\n checkForNewCacheKey(action.meta.arg.endpointName, cacheKey, action.meta.requestId, action.meta.arg.originalArgs);\n } else if (api.internalActions.cacheEntriesUpserted.match(action)) {\n for (const {\n queryDescription,\n value\n } of action.payload) {\n const {\n endpointName,\n originalArgs,\n queryCacheKey\n } = queryDescription;\n checkForNewCacheKey(endpointName, queryCacheKey, action.meta.requestId, originalArgs);\n resolveLifecycleEntry(queryCacheKey, value, {});\n }\n } else if (mutationThunk.pending.match(action)) {\n const state = mwApi.getState()[reducerPath].mutations[cacheKey];\n if (state) {\n handleNewKey(action.meta.arg.endpointName, action.meta.arg.originalArgs, cacheKey, mwApi, action.meta.requestId);\n }\n } else if (isFulfilledThunk(action)) {\n resolveLifecycleEntry(cacheKey, action.payload, action.meta.baseQueryMeta);\n } else if (api.internalActions.removeQueryResult.match(action) || api.internalActions.removeMutationResult.match(action)) {\n removeLifecycleEntry(cacheKey);\n } else if (api.util.resetApiState.match(action)) {\n for (const cacheKey2 of Object.keys(lifecycleMap)) {\n removeLifecycleEntry(cacheKey2);\n }\n }\n };\n function getCacheKey(action) {\n if (isQueryThunk(action)) return action.meta.arg.queryCacheKey;\n if (isMutationThunk(action)) {\n return action.meta.arg.fixedCacheKey ?? action.meta.requestId;\n }\n if (api.internalActions.removeQueryResult.match(action)) return action.payload.queryCacheKey;\n if (api.internalActions.removeMutationResult.match(action)) return getMutationCacheKey(action.payload);\n return \"\";\n }\n function handleNewKey(endpointName, originalArgs, queryCacheKey, mwApi, requestId) {\n const endpointDefinition = context.endpointDefinitions[endpointName];\n const onCacheEntryAdded = endpointDefinition?.onCacheEntryAdded;\n if (!onCacheEntryAdded) return;\n const lifecycle = {};\n const cacheEntryRemoved = new Promise((resolve) => {\n lifecycle.cacheEntryRemoved = resolve;\n });\n const cacheDataLoaded = Promise.race([new Promise((resolve) => {\n lifecycle.valueResolved = resolve;\n }), cacheEntryRemoved.then(() => {\n throw neverResolvedError;\n })]);\n cacheDataLoaded.catch(() => {\n });\n lifecycleMap[queryCacheKey] = lifecycle;\n const selector = api.endpoints[endpointName].select(endpointDefinition.type === \"query\" /* query */ ? originalArgs : queryCacheKey);\n const extra = mwApi.dispatch((_, __, extra2) => extra2);\n const lifecycleApi = {\n ...mwApi,\n getCacheEntry: () => selector(mwApi.getState()),\n requestId,\n extra,\n updateCachedData: endpointDefinition.type === \"query\" /* query */ ? (updateRecipe) => mwApi.dispatch(api.util.updateQueryData(endpointName, originalArgs, updateRecipe)) : void 0,\n cacheDataLoaded,\n cacheEntryRemoved\n };\n const runningHandler = onCacheEntryAdded(originalArgs, lifecycleApi);\n Promise.resolve(runningHandler).catch((e) => {\n if (e === neverResolvedError) return;\n throw e;\n });\n }\n return handler;\n};\n\n// src/query/core/buildMiddleware/devMiddleware.ts\nvar buildDevCheckHandler = ({\n api,\n context: {\n apiUid\n },\n reducerPath\n}) => {\n return (action, mwApi) => {\n if (api.util.resetApiState.match(action)) {\n mwApi.dispatch(api.internalActions.middlewareRegistered(apiUid));\n }\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n if (api.internalActions.middlewareRegistered.match(action) && action.payload === apiUid && mwApi.getState()[reducerPath]?.config?.middlewareRegistered === \"conflict\") {\n console.warn(`There is a mismatch between slice and middleware for the reducerPath \"${reducerPath}\".\nYou can only have one api per reducer path, this will lead to crashes in various situations!${reducerPath === \"api\" ? `\nIf you have multiple apis, you *have* to specify the reducerPath option when using createApi!` : \"\"}`);\n }\n }\n };\n};\n\n// src/query/core/buildMiddleware/invalidationByTags.ts\nvar buildInvalidationByTagsHandler = ({\n reducerPath,\n context,\n context: {\n endpointDefinitions\n },\n mutationThunk,\n queryThunk,\n api,\n assertTagType,\n refetchQuery,\n internalState\n}) => {\n const {\n removeQueryResult\n } = api.internalActions;\n const isThunkActionWithTags = isAnyOf(isFulfilled(mutationThunk), isRejectedWithValue(mutationThunk));\n const isQueryEnd = isAnyOf(isFulfilled(mutationThunk, queryThunk), isRejected(mutationThunk, queryThunk));\n let pendingTagInvalidations = [];\n const handler = (action, mwApi) => {\n if (isThunkActionWithTags(action)) {\n invalidateTags(calculateProvidedByThunk(action, \"invalidatesTags\", endpointDefinitions, assertTagType), mwApi);\n } else if (isQueryEnd(action)) {\n invalidateTags([], mwApi);\n } else if (api.util.invalidateTags.match(action)) {\n invalidateTags(calculateProvidedBy(action.payload, void 0, void 0, void 0, void 0, assertTagType), mwApi);\n }\n };\n function hasPendingRequests(state) {\n for (const key in state.queries) {\n if (state.queries[key]?.status === \"pending\" /* pending */) return true;\n }\n for (const key in state.mutations) {\n if (state.mutations[key]?.status === \"pending\" /* pending */) return true;\n }\n return false;\n }\n function invalidateTags(newTags, mwApi) {\n const rootState = mwApi.getState();\n const state = rootState[reducerPath];\n pendingTagInvalidations.push(...newTags);\n if (state.config.invalidationBehavior === \"delayed\" && hasPendingRequests(state)) {\n return;\n }\n const tags = pendingTagInvalidations;\n pendingTagInvalidations = [];\n if (tags.length === 0) return;\n const toInvalidate = api.util.selectInvalidatedBy(rootState, tags);\n context.batch(() => {\n const valuesArray = Array.from(toInvalidate.values());\n for (const {\n queryCacheKey\n } of valuesArray) {\n const querySubState = state.queries[queryCacheKey];\n const subscriptionSubState = internalState.currentSubscriptions[queryCacheKey] ?? {};\n if (querySubState) {\n if (countObjectKeys(subscriptionSubState) === 0) {\n mwApi.dispatch(removeQueryResult({\n queryCacheKey\n }));\n } else if (querySubState.status !== \"uninitialized\" /* uninitialized */) {\n mwApi.dispatch(refetchQuery(querySubState));\n }\n }\n }\n });\n }\n return handler;\n};\n\n// src/query/core/buildMiddleware/polling.ts\nvar buildPollingHandler = ({\n reducerPath,\n queryThunk,\n api,\n refetchQuery,\n internalState\n}) => {\n const currentPolls = {};\n const handler = (action, mwApi) => {\n if (api.internalActions.updateSubscriptionOptions.match(action) || api.internalActions.unsubscribeQueryResult.match(action)) {\n updatePollingInterval(action.payload, mwApi);\n }\n if (queryThunk.pending.match(action) || queryThunk.rejected.match(action) && action.meta.condition) {\n updatePollingInterval(action.meta.arg, mwApi);\n }\n if (queryThunk.fulfilled.match(action) || queryThunk.rejected.match(action) && !action.meta.condition) {\n startNextPoll(action.meta.arg, mwApi);\n }\n if (api.util.resetApiState.match(action)) {\n clearPolls();\n }\n };\n function startNextPoll({\n queryCacheKey\n }, api2) {\n const state = api2.getState()[reducerPath];\n const querySubState = state.queries[queryCacheKey];\n const subscriptions = internalState.currentSubscriptions[queryCacheKey];\n if (!querySubState || querySubState.status === \"uninitialized\" /* uninitialized */) return;\n const {\n lowestPollingInterval,\n skipPollingIfUnfocused\n } = findLowestPollingInterval(subscriptions);\n if (!Number.isFinite(lowestPollingInterval)) return;\n const currentPoll = currentPolls[queryCacheKey];\n if (currentPoll?.timeout) {\n clearTimeout(currentPoll.timeout);\n currentPoll.timeout = void 0;\n }\n const nextPollTimestamp = Date.now() + lowestPollingInterval;\n currentPolls[queryCacheKey] = {\n nextPollTimestamp,\n pollingInterval: lowestPollingInterval,\n timeout: setTimeout(() => {\n if (state.config.focused || !skipPollingIfUnfocused) {\n api2.dispatch(refetchQuery(querySubState));\n }\n startNextPoll({\n queryCacheKey\n }, api2);\n }, lowestPollingInterval)\n };\n }\n function updatePollingInterval({\n queryCacheKey\n }, api2) {\n const state = api2.getState()[reducerPath];\n const querySubState = state.queries[queryCacheKey];\n const subscriptions = internalState.currentSubscriptions[queryCacheKey];\n if (!querySubState || querySubState.status === \"uninitialized\" /* uninitialized */) {\n return;\n }\n const {\n lowestPollingInterval\n } = findLowestPollingInterval(subscriptions);\n if (!Number.isFinite(lowestPollingInterval)) {\n cleanupPollForKey(queryCacheKey);\n return;\n }\n const currentPoll = currentPolls[queryCacheKey];\n const nextPollTimestamp = Date.now() + lowestPollingInterval;\n if (!currentPoll || nextPollTimestamp < currentPoll.nextPollTimestamp) {\n startNextPoll({\n queryCacheKey\n }, api2);\n }\n }\n function cleanupPollForKey(key) {\n const existingPoll = currentPolls[key];\n if (existingPoll?.timeout) {\n clearTimeout(existingPoll.timeout);\n }\n delete currentPolls[key];\n }\n function clearPolls() {\n for (const key of Object.keys(currentPolls)) {\n cleanupPollForKey(key);\n }\n }\n function findLowestPollingInterval(subscribers = {}) {\n let skipPollingIfUnfocused = false;\n let lowestPollingInterval = Number.POSITIVE_INFINITY;\n for (let key in subscribers) {\n if (!!subscribers[key].pollingInterval) {\n lowestPollingInterval = Math.min(subscribers[key].pollingInterval, lowestPollingInterval);\n skipPollingIfUnfocused = subscribers[key].skipPollingIfUnfocused || skipPollingIfUnfocused;\n }\n }\n return {\n lowestPollingInterval,\n skipPollingIfUnfocused\n };\n }\n return handler;\n};\n\n// src/query/core/buildMiddleware/queryLifecycle.ts\nvar buildQueryLifecycleHandler = ({\n api,\n context,\n queryThunk,\n mutationThunk\n}) => {\n const isPendingThunk = isPending(queryThunk, mutationThunk);\n const isRejectedThunk = isRejected(queryThunk, mutationThunk);\n const isFullfilledThunk = isFulfilled(queryThunk, mutationThunk);\n const lifecycleMap = {};\n const handler = (action, mwApi) => {\n if (isPendingThunk(action)) {\n const {\n requestId,\n arg: {\n endpointName,\n originalArgs\n }\n } = action.meta;\n const endpointDefinition = context.endpointDefinitions[endpointName];\n const onQueryStarted = endpointDefinition?.onQueryStarted;\n if (onQueryStarted) {\n const lifecycle = {};\n const queryFulfilled = new Promise((resolve, reject) => {\n lifecycle.resolve = resolve;\n lifecycle.reject = reject;\n });\n queryFulfilled.catch(() => {\n });\n lifecycleMap[requestId] = lifecycle;\n const selector = api.endpoints[endpointName].select(endpointDefinition.type === \"query\" /* query */ ? originalArgs : requestId);\n const extra = mwApi.dispatch((_, __, extra2) => extra2);\n const lifecycleApi = {\n ...mwApi,\n getCacheEntry: () => selector(mwApi.getState()),\n requestId,\n extra,\n updateCachedData: endpointDefinition.type === \"query\" /* query */ ? (updateRecipe) => mwApi.dispatch(api.util.updateQueryData(endpointName, originalArgs, updateRecipe)) : void 0,\n queryFulfilled\n };\n onQueryStarted(originalArgs, lifecycleApi);\n }\n } else if (isFullfilledThunk(action)) {\n const {\n requestId,\n baseQueryMeta\n } = action.meta;\n lifecycleMap[requestId]?.resolve({\n data: action.payload,\n meta: baseQueryMeta\n });\n delete lifecycleMap[requestId];\n } else if (isRejectedThunk(action)) {\n const {\n requestId,\n rejectedWithValue,\n baseQueryMeta\n } = action.meta;\n lifecycleMap[requestId]?.reject({\n error: action.payload ?? action.error,\n isUnhandledError: !rejectedWithValue,\n meta: baseQueryMeta\n });\n delete lifecycleMap[requestId];\n }\n };\n return handler;\n};\n\n// src/query/core/buildMiddleware/windowEventHandling.ts\nvar buildWindowEventHandler = ({\n reducerPath,\n context,\n api,\n refetchQuery,\n internalState\n}) => {\n const {\n removeQueryResult\n } = api.internalActions;\n const handler = (action, mwApi) => {\n if (onFocus.match(action)) {\n refetchValidQueries(mwApi, \"refetchOnFocus\");\n }\n if (onOnline.match(action)) {\n refetchValidQueries(mwApi, \"refetchOnReconnect\");\n }\n };\n function refetchValidQueries(api2, type) {\n const state = api2.getState()[reducerPath];\n const queries = state.queries;\n const subscriptions = internalState.currentSubscriptions;\n context.batch(() => {\n for (const queryCacheKey of Object.keys(subscriptions)) {\n const querySubState = queries[queryCacheKey];\n const subscriptionSubState = subscriptions[queryCacheKey];\n if (!subscriptionSubState || !querySubState) continue;\n const shouldRefetch = Object.values(subscriptionSubState).some((sub) => sub[type] === true) || Object.values(subscriptionSubState).every((sub) => sub[type] === void 0) && state.config[type];\n if (shouldRefetch) {\n if (countObjectKeys(subscriptionSubState) === 0) {\n api2.dispatch(removeQueryResult({\n queryCacheKey\n }));\n } else if (querySubState.status !== \"uninitialized\" /* uninitialized */) {\n api2.dispatch(refetchQuery(querySubState));\n }\n }\n }\n });\n }\n return handler;\n};\n\n// src/query/core/buildMiddleware/index.ts\nfunction buildMiddleware(input) {\n const {\n reducerPath,\n queryThunk,\n api,\n context\n } = input;\n const {\n apiUid\n } = context;\n const actions = {\n invalidateTags: createAction(`${reducerPath}/invalidateTags`)\n };\n const isThisApiSliceAction = (action) => action.type.startsWith(`${reducerPath}/`);\n const handlerBuilders = [buildDevCheckHandler, buildCacheCollectionHandler, buildInvalidationByTagsHandler, buildPollingHandler, buildCacheLifecycleHandler, buildQueryLifecycleHandler];\n const middleware = (mwApi) => {\n let initialized2 = false;\n const internalState = {\n currentSubscriptions: {}\n };\n const builderArgs = {\n ...input,\n internalState,\n refetchQuery,\n isThisApiSliceAction\n };\n const handlers = handlerBuilders.map((build) => build(builderArgs));\n const batchedActionsHandler = buildBatchedActionsHandler(builderArgs);\n const windowEventsHandler = buildWindowEventHandler(builderArgs);\n return (next) => {\n return (action) => {\n if (!isAction(action)) {\n return next(action);\n }\n if (!initialized2) {\n initialized2 = true;\n mwApi.dispatch(api.internalActions.middlewareRegistered(apiUid));\n }\n const mwApiWithNext = {\n ...mwApi,\n next\n };\n const stateBefore = mwApi.getState();\n const [actionShouldContinue, internalProbeResult] = batchedActionsHandler(action, mwApiWithNext, stateBefore);\n let res;\n if (actionShouldContinue) {\n res = next(action);\n } else {\n res = internalProbeResult;\n }\n if (!!mwApi.getState()[reducerPath]) {\n windowEventsHandler(action, mwApiWithNext, stateBefore);\n if (isThisApiSliceAction(action) || context.hasRehydrationInfo(action)) {\n for (const handler of handlers) {\n handler(action, mwApiWithNext, stateBefore);\n }\n }\n }\n return res;\n };\n };\n };\n return {\n middleware,\n actions\n };\n function refetchQuery(querySubState) {\n return input.api.endpoints[querySubState.endpointName].initiate(querySubState.originalArgs, {\n subscribe: false,\n forceRefetch: true\n });\n }\n}\n\n// src/query/core/module.ts\nvar coreModuleName = /* @__PURE__ */ Symbol();\nvar coreModule = ({\n createSelector: createSelector2 = createSelector\n} = {}) => ({\n name: coreModuleName,\n init(api, {\n baseQuery,\n tagTypes,\n reducerPath,\n serializeQueryArgs,\n keepUnusedDataFor,\n refetchOnMountOrArgChange,\n refetchOnFocus,\n refetchOnReconnect,\n invalidationBehavior\n }, context) {\n enablePatches();\n assertCast(serializeQueryArgs);\n const assertTagType = (tag) => {\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"development\") {\n if (!tagTypes.includes(tag.type)) {\n console.error(`Tag type '${tag.type}' was used, but not specified in \\`tagTypes\\`!`);\n }\n }\n return tag;\n };\n Object.assign(api, {\n reducerPath,\n endpoints: {},\n internalActions: {\n onOnline,\n onOffline,\n onFocus,\n onFocusLost\n },\n util: {}\n });\n const {\n queryThunk,\n mutationThunk,\n patchQueryData,\n updateQueryData,\n upsertQueryData,\n prefetch,\n buildMatchThunkActions\n } = buildThunks({\n baseQuery,\n reducerPath,\n context,\n api,\n serializeQueryArgs,\n assertTagType\n });\n const {\n reducer,\n actions: sliceActions\n } = buildSlice({\n context,\n queryThunk,\n mutationThunk,\n serializeQueryArgs,\n reducerPath,\n assertTagType,\n config: {\n refetchOnFocus,\n refetchOnReconnect,\n refetchOnMountOrArgChange,\n keepUnusedDataFor,\n reducerPath,\n invalidationBehavior\n }\n });\n safeAssign(api.util, {\n patchQueryData,\n updateQueryData,\n upsertQueryData,\n prefetch,\n resetApiState: sliceActions.resetApiState,\n upsertQueryEntries: sliceActions.cacheEntriesUpserted\n });\n safeAssign(api.internalActions, sliceActions);\n const {\n middleware,\n actions: middlewareActions\n } = buildMiddleware({\n reducerPath,\n context,\n queryThunk,\n mutationThunk,\n api,\n assertTagType\n });\n safeAssign(api.util, middlewareActions);\n safeAssign(api, {\n reducer,\n middleware\n });\n const {\n buildQuerySelector,\n buildMutationSelector,\n selectInvalidatedBy,\n selectCachedArgsForQuery\n } = buildSelectors({\n serializeQueryArgs,\n reducerPath,\n createSelector: createSelector2\n });\n safeAssign(api.util, {\n selectInvalidatedBy,\n selectCachedArgsForQuery\n });\n const {\n buildInitiateQuery,\n buildInitiateMutation,\n getRunningMutationThunk,\n getRunningMutationsThunk,\n getRunningQueriesThunk,\n getRunningQueryThunk\n } = buildInitiate({\n queryThunk,\n mutationThunk,\n api,\n serializeQueryArgs,\n context\n });\n safeAssign(api.util, {\n getRunningMutationThunk,\n getRunningMutationsThunk,\n getRunningQueryThunk,\n getRunningQueriesThunk\n });\n return {\n name: coreModuleName,\n injectEndpoint(endpointName, definition) {\n const anyApi = api;\n anyApi.endpoints[endpointName] ??= {};\n if (isQueryDefinition(definition)) {\n safeAssign(anyApi.endpoints[endpointName], {\n name: endpointName,\n select: buildQuerySelector(endpointName, definition),\n initiate: buildInitiateQuery(endpointName, definition)\n }, buildMatchThunkActions(queryThunk, endpointName));\n } else if (isMutationDefinition(definition)) {\n safeAssign(anyApi.endpoints[endpointName], {\n name: endpointName,\n select: buildMutationSelector(),\n initiate: buildInitiateMutation(endpointName)\n }, buildMatchThunkActions(mutationThunk, endpointName));\n }\n }\n };\n }\n});\n\n// src/query/core/index.ts\nvar createApi = /* @__PURE__ */ buildCreateApi(coreModule());\nexport {\n QueryStatus,\n _NEVER,\n buildCreateApi,\n copyWithStructuralSharing,\n coreModule,\n coreModuleName,\n createApi,\n defaultSerializeQueryArgs,\n fakeBaseQuery,\n fetchBaseQuery,\n retry,\n setupListeners,\n skipToken\n};\n//# sourceMappingURL=rtk-query.modern.mjs.map","/**\n * @license React\n * use-sync-external-store-with-selector.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 is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = React.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/use-sync-external-store-with-selector.production.js');\n} else {\n module.exports = require('./cjs/use-sync-external-store-with-selector.development.js');\n}\n","// src/utils/react.ts\nimport * as React from \"react\";\n\n// src/utils/react-is.ts\nvar IS_REACT_19 = /* @__PURE__ */ React.version.startsWith(\"19\");\nvar REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for(\n IS_REACT_19 ? \"react.transitional.element\" : \"react.element\"\n);\nvar REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for(\"react.portal\");\nvar REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for(\"react.fragment\");\nvar REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for(\"react.strict_mode\");\nvar REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for(\"react.profiler\");\nvar REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for(\"react.consumer\");\nvar REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for(\"react.context\");\nvar REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for(\"react.forward_ref\");\nvar REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for(\"react.suspense\");\nvar REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for(\n \"react.suspense_list\"\n);\nvar REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for(\"react.memo\");\nvar REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for(\"react.lazy\");\nvar REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for(\"react.offscreen\");\nvar REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for(\n \"react.client.reference\"\n);\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nfunction isValidElementType(type) {\n return typeof type === \"string\" || typeof type === \"function\" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_OFFSCREEN_TYPE || typeof type === \"object\" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== void 0) ? true : false;\n}\nfunction typeOf(object) {\n if (typeof object === \"object\" && object !== null) {\n const { $$typeof } = object;\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n switch (object = object.type, object) {\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n case REACT_SUSPENSE_LIST_TYPE:\n return object;\n default:\n switch (object = object && object.$$typeof, object) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n return object;\n case REACT_CONSUMER_TYPE:\n return object;\n default:\n return $$typeof;\n }\n }\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n}\nfunction isContextConsumer(object) {\n return IS_REACT_19 ? typeOf(object) === REACT_CONSUMER_TYPE : typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\n\n// src/utils/warning.ts\nfunction warning(message) {\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(message);\n }\n try {\n throw new Error(message);\n } catch (e) {\n }\n}\n\n// src/connect/verifySubselectors.ts\nfunction verify(selector, methodName) {\n if (!selector) {\n throw new Error(`Unexpected value for ${methodName} in connect.`);\n } else if (methodName === \"mapStateToProps\" || methodName === \"mapDispatchToProps\") {\n if (!Object.prototype.hasOwnProperty.call(selector, \"dependsOnOwnProps\")) {\n warning(\n `The selector for ${methodName} of connect did not specify a value for dependsOnOwnProps.`\n );\n }\n }\n}\nfunction verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps) {\n verify(mapStateToProps, \"mapStateToProps\");\n verify(mapDispatchToProps, \"mapDispatchToProps\");\n verify(mergeProps, \"mergeProps\");\n}\n\n// src/connect/selectorFactory.ts\nfunction pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, {\n areStatesEqual,\n areOwnPropsEqual,\n areStatePropsEqual\n}) {\n let hasRunAtLeastOnce = false;\n let state;\n let ownProps;\n let stateProps;\n let dispatchProps;\n let mergedProps;\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps)\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps)\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps)\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n function handleNewState() {\n const nextStateProps = mapStateToProps(state, ownProps);\n const statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n if (statePropsChanged)\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n function handleSubsequentCalls(nextState, nextOwnProps) {\n const propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n const stateChanged = !areStatesEqual(\n nextState,\n state,\n nextOwnProps,\n ownProps\n );\n state = nextState;\n ownProps = nextOwnProps;\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n}\nfunction finalPropsSelectorFactory(dispatch, {\n initMapStateToProps,\n initMapDispatchToProps,\n initMergeProps,\n ...options\n}) {\n const mapStateToProps = initMapStateToProps(dispatch, options);\n const mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n const mergeProps = initMergeProps(dispatch, options);\n if (process.env.NODE_ENV !== \"production\") {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps);\n }\n return pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}\n\n// src/utils/bindActionCreators.ts\nfunction bindActionCreators(actionCreators, dispatch) {\n const boundActionCreators = {};\n for (const key in actionCreators) {\n const actionCreator = actionCreators[key];\n if (typeof actionCreator === \"function\") {\n boundActionCreators[key] = (...args) => dispatch(actionCreator(...args));\n }\n }\n return boundActionCreators;\n}\n\n// src/utils/isPlainObject.ts\nfunction isPlainObject(obj) {\n if (typeof obj !== \"object\" || obj === null) return false;\n const proto = Object.getPrototypeOf(obj);\n if (proto === null) return true;\n let baseProto = proto;\n while (Object.getPrototypeOf(baseProto) !== null) {\n baseProto = Object.getPrototypeOf(baseProto);\n }\n return proto === baseProto;\n}\n\n// src/utils/verifyPlainObject.ts\nfunction verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(\n `${methodName}() in ${displayName} must return a plain object. Instead received ${value}.`\n );\n }\n}\n\n// src/connect/wrapMapToProps.ts\nfunction wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch) {\n const constant = getConstant(dispatch);\n function constantSelector() {\n return constant;\n }\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n}\nfunction getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\nfunction wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, { displayName }) {\n const proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch, void 0);\n };\n proxy.dependsOnOwnProps = true;\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n let props = proxy(stateOrDispatch, ownProps);\n if (typeof props === \"function\") {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n if (process.env.NODE_ENV !== \"production\")\n verifyPlainObject(props, displayName, methodName);\n return props;\n };\n return proxy;\n };\n}\n\n// src/connect/invalidArgFactory.ts\nfunction createInvalidArgFactory(arg, name) {\n return (dispatch, options) => {\n throw new Error(\n `Invalid value of type ${typeof arg} for ${name} argument when connecting component ${options.wrappedComponentName}.`\n );\n };\n}\n\n// src/connect/mapDispatchToProps.ts\nfunction mapDispatchToPropsFactory(mapDispatchToProps) {\n return mapDispatchToProps && typeof mapDispatchToProps === \"object\" ? wrapMapToPropsConstant(\n (dispatch) => (\n // @ts-ignore\n bindActionCreators(mapDispatchToProps, dispatch)\n )\n ) : !mapDispatchToProps ? wrapMapToPropsConstant((dispatch) => ({\n dispatch\n })) : typeof mapDispatchToProps === \"function\" ? (\n // @ts-ignore\n wrapMapToPropsFunc(mapDispatchToProps, \"mapDispatchToProps\")\n ) : createInvalidArgFactory(mapDispatchToProps, \"mapDispatchToProps\");\n}\n\n// src/connect/mapStateToProps.ts\nfunction mapStateToPropsFactory(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(() => ({})) : typeof mapStateToProps === \"function\" ? (\n // @ts-ignore\n wrapMapToPropsFunc(mapStateToProps, \"mapStateToProps\")\n ) : createInvalidArgFactory(mapStateToProps, \"mapStateToProps\");\n}\n\n// src/connect/mergeProps.ts\nfunction defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return { ...ownProps, ...stateProps, ...dispatchProps };\n}\nfunction wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, { displayName, areMergedPropsEqual }) {\n let hasRunOnce = false;\n let mergedProps;\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n const nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n if (hasRunOnce) {\n if (!areMergedPropsEqual(nextMergedProps, mergedProps))\n mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n if (process.env.NODE_ENV !== \"production\")\n verifyPlainObject(mergedProps, displayName, \"mergeProps\");\n }\n return mergedProps;\n };\n };\n}\nfunction mergePropsFactory(mergeProps) {\n return !mergeProps ? () => defaultMergeProps : typeof mergeProps === \"function\" ? wrapMergePropsFunc(mergeProps) : createInvalidArgFactory(mergeProps, \"mergeProps\");\n}\n\n// src/utils/batch.ts\nfunction defaultNoopBatch(callback) {\n callback();\n}\n\n// src/utils/Subscription.ts\nfunction createListenerCollection() {\n let first = null;\n let last = null;\n return {\n clear() {\n first = null;\n last = null;\n },\n notify() {\n defaultNoopBatch(() => {\n let listener = first;\n while (listener) {\n listener.callback();\n listener = listener.next;\n }\n });\n },\n get() {\n const listeners = [];\n let listener = first;\n while (listener) {\n listeners.push(listener);\n listener = listener.next;\n }\n return listeners;\n },\n subscribe(callback) {\n let isSubscribed = true;\n const listener = last = {\n callback,\n next: null,\n prev: last\n };\n if (listener.prev) {\n listener.prev.next = listener;\n } else {\n first = listener;\n }\n return function unsubscribe() {\n if (!isSubscribed || first === null) return;\n isSubscribed = false;\n if (listener.next) {\n listener.next.prev = listener.prev;\n } else {\n last = listener.prev;\n }\n if (listener.prev) {\n listener.prev.next = listener.next;\n } else {\n first = listener.next;\n }\n };\n }\n };\n}\nvar nullListeners = {\n notify() {\n },\n get: () => []\n};\nfunction createSubscription(store, parentSub) {\n let unsubscribe;\n let listeners = nullListeners;\n let subscriptionsAmount = 0;\n let selfSubscribed = false;\n function addNestedSub(listener) {\n trySubscribe();\n const cleanupListener = listeners.subscribe(listener);\n let removed = false;\n return () => {\n if (!removed) {\n removed = true;\n cleanupListener();\n tryUnsubscribe();\n }\n };\n }\n function notifyNestedSubs() {\n listeners.notify();\n }\n function handleChangeWrapper() {\n if (subscription.onStateChange) {\n subscription.onStateChange();\n }\n }\n function isSubscribed() {\n return selfSubscribed;\n }\n function trySubscribe() {\n subscriptionsAmount++;\n if (!unsubscribe) {\n unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);\n listeners = createListenerCollection();\n }\n }\n function tryUnsubscribe() {\n subscriptionsAmount--;\n if (unsubscribe && subscriptionsAmount === 0) {\n unsubscribe();\n unsubscribe = void 0;\n listeners.clear();\n listeners = nullListeners;\n }\n }\n function trySubscribeSelf() {\n if (!selfSubscribed) {\n selfSubscribed = true;\n trySubscribe();\n }\n }\n function tryUnsubscribeSelf() {\n if (selfSubscribed) {\n selfSubscribed = false;\n tryUnsubscribe();\n }\n }\n const subscription = {\n addNestedSub,\n notifyNestedSubs,\n handleChangeWrapper,\n isSubscribed,\n trySubscribe: trySubscribeSelf,\n tryUnsubscribe: tryUnsubscribeSelf,\n getListeners: () => listeners\n };\n return subscription;\n}\n\n// src/utils/useIsomorphicLayoutEffect.ts\nvar canUseDOM = () => !!(typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\");\nvar isDOM = /* @__PURE__ */ canUseDOM();\nvar isRunningInReactNative = () => typeof navigator !== \"undefined\" && navigator.product === \"ReactNative\";\nvar isReactNative = /* @__PURE__ */ isRunningInReactNative();\nvar getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? React.useLayoutEffect : React.useEffect;\nvar useIsomorphicLayoutEffect = /* @__PURE__ */ getUseIsomorphicLayoutEffect();\n\n// src/utils/shallowEqual.ts\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\nfunction shallowEqual(objA, objB) {\n if (is(objA, objB)) return true;\n if (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) {\n return false;\n }\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) return false;\n for (let i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n return true;\n}\n\n// src/utils/hoistStatics.ts\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 = {\n [ForwardRef]: FORWARD_REF_STATICS,\n [Memo]: MEMO_STATICS\n};\nfunction getStatics(component) {\n if (isMemo(component)) {\n return MEMO_STATICS;\n }\n return TYPE_STATICS[component[\"$$typeof\"]] || REACT_STATICS;\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) {\n if (typeof sourceComponent !== \"string\") {\n if (objectPrototype) {\n const inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent);\n }\n }\n let keys = getOwnPropertyNames(sourceComponent);\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n const targetStatics = getStatics(targetComponent);\n const sourceStatics = getStatics(sourceComponent);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!KNOWN_STATICS[key] && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n const descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n try {\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {\n }\n }\n }\n }\n return targetComponent;\n}\n\n// src/components/Context.ts\nvar ContextKey = /* @__PURE__ */ Symbol.for(`react-redux-context`);\nvar gT = typeof globalThis !== \"undefined\" ? globalThis : (\n /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */\n {}\n);\nfunction getContext() {\n if (!React.createContext) return {};\n const contextMap = gT[ContextKey] ??= /* @__PURE__ */ new Map();\n let realContext = contextMap.get(React.createContext);\n if (!realContext) {\n realContext = React.createContext(\n null\n );\n if (process.env.NODE_ENV !== \"production\") {\n realContext.displayName = \"ReactRedux\";\n }\n contextMap.set(React.createContext, realContext);\n }\n return realContext;\n}\nvar ReactReduxContext = /* @__PURE__ */ getContext();\n\n// src/components/connect.tsx\nvar NO_SUBSCRIPTION_ARRAY = [null, null];\nvar stringifyComponent = (Comp) => {\n try {\n return JSON.stringify(Comp);\n } catch (err) {\n return String(Comp);\n }\n};\nfunction useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {\n useIsomorphicLayoutEffect(() => effectFunc(...effectArgs), dependencies);\n}\nfunction captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs) {\n lastWrapperProps.current = wrapperProps;\n renderIsScheduled.current = false;\n if (childPropsFromStoreUpdate.current) {\n childPropsFromStoreUpdate.current = null;\n notifyNestedSubs();\n }\n}\nfunction subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, additionalSubscribeListener) {\n if (!shouldHandleStateChanges) return () => {\n };\n let didUnsubscribe = false;\n let lastThrownError = null;\n const checkForUpdates = () => {\n if (didUnsubscribe || !isMounted.current) {\n return;\n }\n const latestStoreState = store.getState();\n let newChildProps, error;\n try {\n newChildProps = childPropsSelector(\n latestStoreState,\n lastWrapperProps.current\n );\n } catch (e) {\n error = e;\n lastThrownError = e;\n }\n if (!error) {\n lastThrownError = null;\n }\n if (newChildProps === lastChildProps.current) {\n if (!renderIsScheduled.current) {\n notifyNestedSubs();\n }\n } else {\n lastChildProps.current = newChildProps;\n childPropsFromStoreUpdate.current = newChildProps;\n renderIsScheduled.current = true;\n additionalSubscribeListener();\n }\n };\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe();\n checkForUpdates();\n const unsubscribeWrapper = () => {\n didUnsubscribe = true;\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n if (lastThrownError) {\n throw lastThrownError;\n }\n };\n return unsubscribeWrapper;\n}\nfunction strictEqual(a, b) {\n return a === b;\n}\nvar hasWarnedAboutDeprecatedPureOption = false;\nfunction connect(mapStateToProps, mapDispatchToProps, mergeProps, {\n // The `pure` option has been removed, so TS doesn't like us destructuring this to check its existence.\n // @ts-ignore\n pure,\n areStatesEqual = strictEqual,\n areOwnPropsEqual = shallowEqual,\n areStatePropsEqual = shallowEqual,\n areMergedPropsEqual = shallowEqual,\n // use React's forwardRef to expose a ref of the wrapped component\n forwardRef = false,\n // the context consumer to use\n context = ReactReduxContext\n} = {}) {\n if (process.env.NODE_ENV !== \"production\") {\n if (pure !== void 0 && !hasWarnedAboutDeprecatedPureOption) {\n hasWarnedAboutDeprecatedPureOption = true;\n warning(\n 'The `pure` option has been removed. `connect` is now always a \"pure/memoized\" component'\n );\n }\n }\n const Context = context;\n const initMapStateToProps = mapStateToPropsFactory(mapStateToProps);\n const initMapDispatchToProps = mapDispatchToPropsFactory(mapDispatchToProps);\n const initMergeProps = mergePropsFactory(mergeProps);\n const shouldHandleStateChanges = Boolean(mapStateToProps);\n const wrapWithConnect = (WrappedComponent) => {\n if (process.env.NODE_ENV !== \"production\") {\n const isValid = /* @__PURE__ */ isValidElementType(WrappedComponent);\n if (!isValid)\n throw new Error(\n `You must pass a component to the function returned by connect. Instead received ${stringifyComponent(\n WrappedComponent\n )}`\n );\n }\n const wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || \"Component\";\n const displayName = `Connect(${wrappedComponentName})`;\n const selectorFactoryOptions = {\n shouldHandleStateChanges,\n displayName,\n wrappedComponentName,\n WrappedComponent,\n // @ts-ignore\n initMapStateToProps,\n initMapDispatchToProps,\n initMergeProps,\n areStatesEqual,\n areStatePropsEqual,\n areOwnPropsEqual,\n areMergedPropsEqual\n };\n function ConnectFunction(props) {\n const [propsContext, reactReduxForwardedRef, wrapperProps] = React.useMemo(() => {\n const { reactReduxForwardedRef: reactReduxForwardedRef2, ...wrapperProps2 } = props;\n return [props.context, reactReduxForwardedRef2, wrapperProps2];\n }, [props]);\n const ContextToUse = React.useMemo(() => {\n let ResultContext = Context;\n if (propsContext?.Consumer) {\n if (process.env.NODE_ENV !== \"production\") {\n const isValid = /* @__PURE__ */ isContextConsumer(\n // @ts-ignore\n /* @__PURE__ */ React.createElement(propsContext.Consumer, null)\n );\n if (!isValid) {\n throw new Error(\n \"You must pass a valid React context consumer as `props.context`\"\n );\n }\n ResultContext = propsContext;\n }\n }\n return ResultContext;\n }, [propsContext, Context]);\n const contextValue = React.useContext(ContextToUse);\n const didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);\n const didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);\n if (process.env.NODE_ENV !== \"production\" && !didStoreComeFromProps && !didStoreComeFromContext) {\n throw new Error(\n `Could not find \"store\" in the context of \"${displayName}\". Either wrap the root component in a , or pass a custom React context provider to and the corresponding React context consumer to ${displayName} in connect options.`\n );\n }\n const store = didStoreComeFromProps ? props.store : contextValue.store;\n const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState;\n const childPropsSelector = React.useMemo(() => {\n return finalPropsSelectorFactory(store.dispatch, selectorFactoryOptions);\n }, [store]);\n const [subscription, notifyNestedSubs] = React.useMemo(() => {\n if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY;\n const subscription2 = createSubscription(\n store,\n didStoreComeFromProps ? void 0 : contextValue.subscription\n );\n const notifyNestedSubs2 = subscription2.notifyNestedSubs.bind(subscription2);\n return [subscription2, notifyNestedSubs2];\n }, [store, didStoreComeFromProps, contextValue]);\n const overriddenContextValue = React.useMemo(() => {\n if (didStoreComeFromProps) {\n return contextValue;\n }\n return {\n ...contextValue,\n subscription\n };\n }, [didStoreComeFromProps, contextValue, subscription]);\n const lastChildProps = React.useRef(void 0);\n const lastWrapperProps = React.useRef(wrapperProps);\n const childPropsFromStoreUpdate = React.useRef(void 0);\n const renderIsScheduled = React.useRef(false);\n const isMounted = React.useRef(false);\n const latestSubscriptionCallbackError = React.useRef(\n void 0\n );\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n const actualChildPropsSelector = React.useMemo(() => {\n const selector = () => {\n if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {\n return childPropsFromStoreUpdate.current;\n }\n return childPropsSelector(store.getState(), wrapperProps);\n };\n return selector;\n }, [store, wrapperProps]);\n const subscribeForReact = React.useMemo(() => {\n const subscribe = (reactListener) => {\n if (!subscription) {\n return () => {\n };\n }\n return subscribeUpdates(\n shouldHandleStateChanges,\n store,\n subscription,\n // @ts-ignore\n childPropsSelector,\n lastWrapperProps,\n lastChildProps,\n renderIsScheduled,\n isMounted,\n childPropsFromStoreUpdate,\n notifyNestedSubs,\n reactListener\n );\n };\n return subscribe;\n }, [subscription]);\n useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [\n lastWrapperProps,\n lastChildProps,\n renderIsScheduled,\n wrapperProps,\n childPropsFromStoreUpdate,\n notifyNestedSubs\n ]);\n let actualChildProps;\n try {\n actualChildProps = React.useSyncExternalStore(\n // TODO We're passing through a big wrapper that does a bunch of extra side effects besides subscribing\n subscribeForReact,\n // TODO This is incredibly hacky. We've already processed the store update and calculated new child props,\n // TODO and we're just passing that through so it triggers a re-render for us rather than relying on `uSES`.\n actualChildPropsSelector,\n getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector\n );\n } catch (err) {\n if (latestSubscriptionCallbackError.current) {\n ;\n err.message += `\nThe error may be correlated with this previous error:\n${latestSubscriptionCallbackError.current.stack}\n\n`;\n }\n throw err;\n }\n useIsomorphicLayoutEffect(() => {\n latestSubscriptionCallbackError.current = void 0;\n childPropsFromStoreUpdate.current = void 0;\n lastChildProps.current = actualChildProps;\n });\n const renderedWrappedComponent = React.useMemo(() => {\n return (\n // @ts-ignore\n /* @__PURE__ */ React.createElement(\n WrappedComponent,\n {\n ...actualChildProps,\n ref: reactReduxForwardedRef\n }\n )\n );\n }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]);\n const renderedChild = React.useMemo(() => {\n if (shouldHandleStateChanges) {\n return /* @__PURE__ */ React.createElement(ContextToUse.Provider, { value: overriddenContextValue }, renderedWrappedComponent);\n }\n return renderedWrappedComponent;\n }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);\n return renderedChild;\n }\n const _Connect = React.memo(ConnectFunction);\n const Connect = _Connect;\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = ConnectFunction.displayName = displayName;\n if (forwardRef) {\n const _forwarded = React.forwardRef(\n function forwardConnectRef(props, ref) {\n return /* @__PURE__ */ React.createElement(Connect, { ...props, reactReduxForwardedRef: ref });\n }\n );\n const forwarded = _forwarded;\n forwarded.displayName = displayName;\n forwarded.WrappedComponent = WrappedComponent;\n return /* @__PURE__ */ hoistNonReactStatics(forwarded, WrappedComponent);\n }\n return /* @__PURE__ */ hoistNonReactStatics(Connect, WrappedComponent);\n };\n return wrapWithConnect;\n}\nvar connect_default = connect;\n\n// src/components/Provider.tsx\nfunction Provider(providerProps) {\n const { children, context, serverState, store } = providerProps;\n const contextValue = React.useMemo(() => {\n const subscription = createSubscription(store);\n const baseContextValue = {\n store,\n subscription,\n getServerState: serverState ? () => serverState : void 0\n };\n if (process.env.NODE_ENV === \"production\") {\n return baseContextValue;\n } else {\n const { identityFunctionCheck = \"once\", stabilityCheck = \"once\" } = providerProps;\n return /* @__PURE__ */ Object.assign(baseContextValue, {\n stabilityCheck,\n identityFunctionCheck\n });\n }\n }, [store, serverState]);\n const previousState = React.useMemo(() => store.getState(), [store]);\n useIsomorphicLayoutEffect(() => {\n const { subscription } = contextValue;\n subscription.onStateChange = subscription.notifyNestedSubs;\n subscription.trySubscribe();\n if (previousState !== store.getState()) {\n subscription.notifyNestedSubs();\n }\n return () => {\n subscription.tryUnsubscribe();\n subscription.onStateChange = void 0;\n };\n }, [contextValue, previousState]);\n const Context = context || ReactReduxContext;\n return /* @__PURE__ */ React.createElement(Context.Provider, { value: contextValue }, children);\n}\nvar Provider_default = Provider;\n\n// src/hooks/useReduxContext.ts\nfunction createReduxContextHook(context = ReactReduxContext) {\n return function useReduxContext2() {\n const contextValue = React.useContext(context);\n if (process.env.NODE_ENV !== \"production\" && !contextValue) {\n throw new Error(\n \"could not find react-redux context value; please ensure the component is wrapped in a \"\n );\n }\n return contextValue;\n };\n}\nvar useReduxContext = /* @__PURE__ */ createReduxContextHook();\n\n// src/hooks/useStore.ts\nfunction createStoreHook(context = ReactReduxContext) {\n const useReduxContext2 = context === ReactReduxContext ? useReduxContext : (\n // @ts-ignore\n createReduxContextHook(context)\n );\n const useStore2 = () => {\n const { store } = useReduxContext2();\n return store;\n };\n Object.assign(useStore2, {\n withTypes: () => useStore2\n });\n return useStore2;\n}\nvar useStore = /* @__PURE__ */ createStoreHook();\n\n// src/hooks/useDispatch.ts\nfunction createDispatchHook(context = ReactReduxContext) {\n const useStore2 = context === ReactReduxContext ? useStore : createStoreHook(context);\n const useDispatch2 = () => {\n const store = useStore2();\n return store.dispatch;\n };\n Object.assign(useDispatch2, {\n withTypes: () => useDispatch2\n });\n return useDispatch2;\n}\nvar useDispatch = /* @__PURE__ */ createDispatchHook();\n\n// src/hooks/useSelector.ts\nimport { useSyncExternalStoreWithSelector } from \"use-sync-external-store/with-selector.js\";\nvar refEquality = (a, b) => a === b;\nfunction createSelectorHook(context = ReactReduxContext) {\n const useReduxContext2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context);\n const useSelector2 = (selector, equalityFnOrOptions = {}) => {\n const { equalityFn = refEquality } = typeof equalityFnOrOptions === \"function\" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions;\n if (process.env.NODE_ENV !== \"production\") {\n if (!selector) {\n throw new Error(`You must pass a selector to useSelector`);\n }\n if (typeof selector !== \"function\") {\n throw new Error(`You must pass a function as a selector to useSelector`);\n }\n if (typeof equalityFn !== \"function\") {\n throw new Error(\n `You must pass a function as an equality function to useSelector`\n );\n }\n }\n const reduxContext = useReduxContext2();\n const { store, subscription, getServerState } = reduxContext;\n const firstRun = React.useRef(true);\n const wrappedSelector = React.useCallback(\n {\n [selector.name](state) {\n const selected = selector(state);\n if (process.env.NODE_ENV !== \"production\") {\n const { devModeChecks = {} } = typeof equalityFnOrOptions === \"function\" ? {} : equalityFnOrOptions;\n const { identityFunctionCheck, stabilityCheck } = reduxContext;\n const {\n identityFunctionCheck: finalIdentityFunctionCheck,\n stabilityCheck: finalStabilityCheck\n } = {\n stabilityCheck,\n identityFunctionCheck,\n ...devModeChecks\n };\n if (finalStabilityCheck === \"always\" || finalStabilityCheck === \"once\" && firstRun.current) {\n const toCompare = selector(state);\n if (!equalityFn(selected, toCompare)) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"Selector \" + (selector.name || \"unknown\") + \" returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization\",\n {\n state,\n selected,\n selected2: toCompare,\n stack\n }\n );\n }\n }\n if (finalIdentityFunctionCheck === \"always\" || finalIdentityFunctionCheck === \"once\" && firstRun.current) {\n if (selected === state) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"Selector \" + (selector.name || \"unknown\") + \" returned the root state when called. This can lead to unnecessary rerenders.\\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.\",\n { stack }\n );\n }\n }\n if (firstRun.current) firstRun.current = false;\n }\n return selected;\n }\n }[selector.name],\n [selector]\n );\n const selectedState = useSyncExternalStoreWithSelector(\n subscription.addNestedSub,\n store.getState,\n getServerState || store.getState,\n wrappedSelector,\n equalityFn\n );\n React.useDebugValue(selectedState);\n return selectedState;\n };\n Object.assign(useSelector2, {\n withTypes: () => useSelector2\n });\n return useSelector2;\n}\nvar useSelector = /* @__PURE__ */ createSelectorHook();\n\n// src/exports.ts\nvar batch = defaultNoopBatch;\nexport {\n Provider_default as Provider,\n ReactReduxContext,\n batch,\n connect_default as connect,\n createDispatchHook,\n createSelectorHook,\n createStoreHook,\n shallowEqual,\n useDispatch,\n useSelector,\n useStore\n};\n//# sourceMappingURL=react-redux.mjs.map","// src/query/react/index.ts\nimport { buildCreateApi, coreModule } from \"@reduxjs/toolkit/query\";\n\n// src/query/react/module.ts\nimport { formatProdErrorMessage as _formatProdErrorMessage3 } from \"@reduxjs/toolkit\";\nimport { batch as rrBatch, useDispatch as rrUseDispatch, useSelector as rrUseSelector, useStore as rrUseStore } from \"react-redux\";\nimport { createSelector as _createSelector } from \"reselect\";\n\n// src/query/utils/capitalize.ts\nfunction capitalize(str) {\n return str.replace(str[0], str[0].toUpperCase());\n}\n\n// src/query/core/rtkImports.ts\nimport { createAction, createSlice, createSelector, createAsyncThunk, combineReducers, createNextState, isAnyOf, isAllOf, isAction, isPending, isRejected, isFulfilled, isRejectedWithValue, isAsyncThunkAction, prepareAutoBatched, SHOULD_AUTOBATCH, isPlainObject, nanoid } from \"@reduxjs/toolkit\";\n\n// src/query/utils/countObjectKeys.ts\nfunction countObjectKeys(obj) {\n let count = 0;\n for (const _key in obj) {\n count++;\n }\n return count;\n}\n\n// src/query/endpointDefinitions.ts\nfunction isQueryDefinition(e) {\n return e.type === \"query\" /* query */;\n}\nfunction isMutationDefinition(e) {\n return e.type === \"mutation\" /* mutation */;\n}\n\n// src/query/tsHelpers.ts\nfunction safeAssign(target, ...args) {\n return Object.assign(target, ...args);\n}\n\n// src/query/react/buildHooks.ts\nimport { formatProdErrorMessage as _formatProdErrorMessage, formatProdErrorMessage as _formatProdErrorMessage2 } from \"@reduxjs/toolkit\";\nimport { QueryStatus, skipToken } from \"@reduxjs/toolkit/query\";\nimport { useCallback, useDebugValue, useEffect as useEffect3, useLayoutEffect, useMemo as useMemo2, useRef as useRef3, useState } from \"react\";\nimport { shallowEqual as shallowEqual2 } from \"react-redux\";\n\n// src/query/defaultSerializeQueryArgs.ts\nvar cache = WeakMap ? /* @__PURE__ */ new WeakMap() : void 0;\nvar defaultSerializeQueryArgs = ({\n endpointName,\n queryArgs\n}) => {\n let serialized = \"\";\n const cached = cache?.get(queryArgs);\n if (typeof cached === \"string\") {\n serialized = cached;\n } else {\n const stringified = JSON.stringify(queryArgs, (key, value) => {\n value = typeof value === \"bigint\" ? {\n $bigint: value.toString()\n } : value;\n value = isPlainObject(value) ? Object.keys(value).sort().reduce((acc, key2) => {\n acc[key2] = value[key2];\n return acc;\n }, {}) : value;\n return value;\n });\n if (isPlainObject(queryArgs)) {\n cache?.set(queryArgs, stringified);\n }\n serialized = stringified;\n }\n return `${endpointName}(${serialized})`;\n};\n\n// src/query/react/constants.ts\nvar UNINITIALIZED_VALUE = Symbol();\n\n// src/query/react/useSerializedStableValue.ts\nimport { useEffect, useRef, useMemo } from \"react\";\nfunction useStableQueryArgs(queryArgs, serialize, endpointDefinition, endpointName) {\n const incoming = useMemo(() => ({\n queryArgs,\n serialized: typeof queryArgs == \"object\" ? serialize({\n queryArgs,\n endpointDefinition,\n endpointName\n }) : queryArgs\n }), [queryArgs, serialize, endpointDefinition, endpointName]);\n const cache2 = useRef(incoming);\n useEffect(() => {\n if (cache2.current.serialized !== incoming.serialized) {\n cache2.current = incoming;\n }\n }, [incoming]);\n return cache2.current.serialized === incoming.serialized ? cache2.current.queryArgs : queryArgs;\n}\n\n// src/query/react/useShallowStableValue.ts\nimport { useEffect as useEffect2, useRef as useRef2 } from \"react\";\nimport { shallowEqual } from \"react-redux\";\nfunction useShallowStableValue(value) {\n const cache2 = useRef2(value);\n useEffect2(() => {\n if (!shallowEqual(cache2.current, value)) {\n cache2.current = value;\n }\n }, [value]);\n return shallowEqual(cache2.current, value) ? cache2.current : value;\n}\n\n// src/query/react/buildHooks.ts\nvar canUseDOM = () => !!(typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\");\nvar isDOM = /* @__PURE__ */ canUseDOM();\nvar isRunningInReactNative = () => typeof navigator !== \"undefined\" && navigator.product === \"ReactNative\";\nvar isReactNative = /* @__PURE__ */ isRunningInReactNative();\nvar getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? useLayoutEffect : useEffect3;\nvar useIsomorphicLayoutEffect = /* @__PURE__ */ getUseIsomorphicLayoutEffect();\nvar noPendingQueryStateSelector = (selected) => {\n if (selected.isUninitialized) {\n return {\n ...selected,\n isUninitialized: false,\n isFetching: true,\n isLoading: selected.data !== void 0 ? false : true,\n status: QueryStatus.pending\n };\n }\n return selected;\n};\nfunction buildHooks({\n api,\n moduleOptions: {\n batch,\n hooks: {\n useDispatch,\n useSelector,\n useStore\n },\n unstable__sideEffectsInRender,\n createSelector: createSelector2\n },\n serializeQueryArgs,\n context\n}) {\n const usePossiblyImmediateEffect = unstable__sideEffectsInRender ? (cb) => cb() : useEffect3;\n return {\n buildQueryHooks,\n buildMutationHook,\n usePrefetch\n };\n function queryStatePreSelector(currentState, lastResult, queryArgs) {\n if (lastResult?.endpointName && currentState.isUninitialized) {\n const {\n endpointName\n } = lastResult;\n const endpointDefinition = context.endpointDefinitions[endpointName];\n if (queryArgs !== skipToken && serializeQueryArgs({\n queryArgs: lastResult.originalArgs,\n endpointDefinition,\n endpointName\n }) === serializeQueryArgs({\n queryArgs,\n endpointDefinition,\n endpointName\n })) lastResult = void 0;\n }\n let data = currentState.isSuccess ? currentState.data : lastResult?.data;\n if (data === void 0) data = currentState.data;\n const hasData = data !== void 0;\n const isFetching = currentState.isLoading;\n const isLoading = (!lastResult || lastResult.isLoading || lastResult.isUninitialized) && !hasData && isFetching;\n const isSuccess = currentState.isSuccess || hasData && (isFetching && !lastResult?.isError || currentState.isUninitialized);\n return {\n ...currentState,\n data,\n currentData: currentState.data,\n isFetching,\n isLoading,\n isSuccess\n };\n }\n function usePrefetch(endpointName, defaultOptions) {\n const dispatch = useDispatch();\n const stableDefaultOptions = useShallowStableValue(defaultOptions);\n return useCallback((arg, options) => dispatch(api.util.prefetch(endpointName, arg, {\n ...stableDefaultOptions,\n ...options\n })), [endpointName, dispatch, stableDefaultOptions]);\n }\n function buildQueryHooks(name) {\n const useQuerySubscription = (arg, {\n refetchOnReconnect,\n refetchOnFocus,\n refetchOnMountOrArgChange,\n skip = false,\n pollingInterval = 0,\n skipPollingIfUnfocused = false\n } = {}) => {\n const {\n initiate\n } = api.endpoints[name];\n const dispatch = useDispatch();\n const subscriptionSelectorsRef = useRef3(void 0);\n if (!subscriptionSelectorsRef.current) {\n const returnedValue = dispatch(api.internalActions.internal_getRTKQSubscriptions());\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof returnedValue !== \"object\" || typeof returnedValue?.type === \"string\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage(37) : `Warning: Middleware for RTK-Query API at reducerPath \"${api.reducerPath}\" has not been added to the store.\n You must add the middleware for RTK-Query to function correctly!`);\n }\n }\n subscriptionSelectorsRef.current = returnedValue;\n }\n const stableArg = useStableQueryArgs(\n skip ? skipToken : arg,\n // Even if the user provided a per-endpoint `serializeQueryArgs` with\n // a consistent return value, _here_ we want to use the default behavior\n // so we can tell if _anything_ actually changed. Otherwise, we can end up\n // with a case where the query args did change but the serialization doesn't,\n // and then we never try to initiate a refetch.\n defaultSerializeQueryArgs,\n context.endpointDefinitions[name],\n name\n );\n const stableSubscriptionOptions = useShallowStableValue({\n refetchOnReconnect,\n refetchOnFocus,\n pollingInterval,\n skipPollingIfUnfocused\n });\n const lastRenderHadSubscription = useRef3(false);\n const promiseRef = useRef3(void 0);\n let {\n queryCacheKey,\n requestId\n } = promiseRef.current || {};\n let currentRenderHasSubscription = false;\n if (queryCacheKey && requestId) {\n currentRenderHasSubscription = subscriptionSelectorsRef.current.isRequestSubscribed(queryCacheKey, requestId);\n }\n const subscriptionRemoved = !currentRenderHasSubscription && lastRenderHadSubscription.current;\n usePossiblyImmediateEffect(() => {\n lastRenderHadSubscription.current = currentRenderHasSubscription;\n });\n usePossiblyImmediateEffect(() => {\n if (subscriptionRemoved) {\n promiseRef.current = void 0;\n }\n }, [subscriptionRemoved]);\n usePossiblyImmediateEffect(() => {\n const lastPromise = promiseRef.current;\n if (typeof process !== \"undefined\" && process.env.NODE_ENV === \"removeMeOnCompilation\") {\n console.log(subscriptionRemoved);\n }\n if (stableArg === skipToken) {\n lastPromise?.unsubscribe();\n promiseRef.current = void 0;\n return;\n }\n const lastSubscriptionOptions = promiseRef.current?.subscriptionOptions;\n if (!lastPromise || lastPromise.arg !== stableArg) {\n lastPromise?.unsubscribe();\n const promise = dispatch(initiate(stableArg, {\n subscriptionOptions: stableSubscriptionOptions,\n forceRefetch: refetchOnMountOrArgChange\n }));\n promiseRef.current = promise;\n } else if (stableSubscriptionOptions !== lastSubscriptionOptions) {\n lastPromise.updateSubscriptionOptions(stableSubscriptionOptions);\n }\n }, [dispatch, initiate, refetchOnMountOrArgChange, stableArg, stableSubscriptionOptions, subscriptionRemoved]);\n useEffect3(() => {\n return () => {\n promiseRef.current?.unsubscribe();\n promiseRef.current = void 0;\n };\n }, []);\n return useMemo2(() => ({\n /**\n * A method to manually refetch data for the query\n */\n refetch: () => {\n if (!promiseRef.current) throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage2(38) : \"Cannot refetch a query that has not been started yet.\");\n return promiseRef.current?.refetch();\n }\n }), []);\n };\n const useLazyQuerySubscription = ({\n refetchOnReconnect,\n refetchOnFocus,\n pollingInterval = 0,\n skipPollingIfUnfocused = false\n } = {}) => {\n const {\n initiate\n } = api.endpoints[name];\n const dispatch = useDispatch();\n const [arg, setArg] = useState(UNINITIALIZED_VALUE);\n const promiseRef = useRef3(void 0);\n const stableSubscriptionOptions = useShallowStableValue({\n refetchOnReconnect,\n refetchOnFocus,\n pollingInterval,\n skipPollingIfUnfocused\n });\n usePossiblyImmediateEffect(() => {\n const lastSubscriptionOptions = promiseRef.current?.subscriptionOptions;\n if (stableSubscriptionOptions !== lastSubscriptionOptions) {\n promiseRef.current?.updateSubscriptionOptions(stableSubscriptionOptions);\n }\n }, [stableSubscriptionOptions]);\n const subscriptionOptionsRef = useRef3(stableSubscriptionOptions);\n usePossiblyImmediateEffect(() => {\n subscriptionOptionsRef.current = stableSubscriptionOptions;\n }, [stableSubscriptionOptions]);\n const trigger = useCallback(function(arg2, preferCacheValue = false) {\n let promise;\n batch(() => {\n promiseRef.current?.unsubscribe();\n promiseRef.current = promise = dispatch(initiate(arg2, {\n subscriptionOptions: subscriptionOptionsRef.current,\n forceRefetch: !preferCacheValue\n }));\n setArg(arg2);\n });\n return promise;\n }, [dispatch, initiate]);\n const reset = useCallback(() => {\n if (promiseRef.current?.queryCacheKey) {\n dispatch(api.internalActions.removeQueryResult({\n queryCacheKey: promiseRef.current?.queryCacheKey\n }));\n }\n }, [dispatch]);\n useEffect3(() => {\n return () => {\n promiseRef?.current?.unsubscribe();\n };\n }, []);\n useEffect3(() => {\n if (arg !== UNINITIALIZED_VALUE && !promiseRef.current) {\n trigger(arg, true);\n }\n }, [arg, trigger]);\n return useMemo2(() => [trigger, arg, {\n reset\n }], [trigger, arg, reset]);\n };\n const useQueryState = (arg, {\n skip = false,\n selectFromResult\n } = {}) => {\n const {\n select\n } = api.endpoints[name];\n const stableArg = useStableQueryArgs(skip ? skipToken : arg, serializeQueryArgs, context.endpointDefinitions[name], name);\n const lastValue = useRef3(void 0);\n const selectDefaultResult = useMemo2(() => createSelector2([select(stableArg), (_, lastResult) => lastResult, (_) => stableArg], queryStatePreSelector, {\n memoizeOptions: {\n resultEqualityCheck: shallowEqual2\n }\n }), [select, stableArg]);\n const querySelector = useMemo2(() => selectFromResult ? createSelector2([selectDefaultResult], selectFromResult, {\n devModeChecks: {\n identityFunctionCheck: \"never\"\n }\n }) : selectDefaultResult, [selectDefaultResult, selectFromResult]);\n const currentState = useSelector((state) => querySelector(state, lastValue.current), shallowEqual2);\n const store = useStore();\n const newLastValue = selectDefaultResult(store.getState(), lastValue.current);\n useIsomorphicLayoutEffect(() => {\n lastValue.current = newLastValue;\n }, [newLastValue]);\n return currentState;\n };\n return {\n useQueryState,\n useQuerySubscription,\n useLazyQuerySubscription,\n useLazyQuery(options) {\n const [trigger, arg, {\n reset\n }] = useLazyQuerySubscription(options);\n const queryStateResults = useQueryState(arg, {\n ...options,\n skip: arg === UNINITIALIZED_VALUE\n });\n const info = useMemo2(() => ({\n lastArg: arg\n }), [arg]);\n return useMemo2(() => [trigger, {\n ...queryStateResults,\n reset\n }, info], [trigger, queryStateResults, reset, info]);\n },\n useQuery(arg, options) {\n const querySubscriptionResults = useQuerySubscription(arg, options);\n const queryStateResults = useQueryState(arg, {\n selectFromResult: arg === skipToken || options?.skip ? void 0 : noPendingQueryStateSelector,\n ...options\n });\n const {\n data,\n status,\n isLoading,\n isSuccess,\n isError,\n error\n } = queryStateResults;\n useDebugValue({\n data,\n status,\n isLoading,\n isSuccess,\n isError,\n error\n });\n return useMemo2(() => ({\n ...queryStateResults,\n ...querySubscriptionResults\n }), [queryStateResults, querySubscriptionResults]);\n }\n };\n }\n function buildMutationHook(name) {\n return ({\n selectFromResult,\n fixedCacheKey\n } = {}) => {\n const {\n select,\n initiate\n } = api.endpoints[name];\n const dispatch = useDispatch();\n const [promise, setPromise] = useState();\n useEffect3(() => () => {\n if (!promise?.arg.fixedCacheKey) {\n promise?.reset();\n }\n }, [promise]);\n const triggerMutation = useCallback(function(arg) {\n const promise2 = dispatch(initiate(arg, {\n fixedCacheKey\n }));\n setPromise(promise2);\n return promise2;\n }, [dispatch, initiate, fixedCacheKey]);\n const {\n requestId\n } = promise || {};\n const selectDefaultResult = useMemo2(() => select({\n fixedCacheKey,\n requestId: promise?.requestId\n }), [fixedCacheKey, promise, select]);\n const mutationSelector = useMemo2(() => selectFromResult ? createSelector2([selectDefaultResult], selectFromResult) : selectDefaultResult, [selectFromResult, selectDefaultResult]);\n const currentState = useSelector(mutationSelector, shallowEqual2);\n const originalArgs = fixedCacheKey == null ? promise?.arg.originalArgs : void 0;\n const reset = useCallback(() => {\n batch(() => {\n if (promise) {\n setPromise(void 0);\n }\n if (fixedCacheKey) {\n dispatch(api.internalActions.removeMutationResult({\n requestId,\n fixedCacheKey\n }));\n }\n });\n }, [dispatch, fixedCacheKey, promise, requestId]);\n const {\n endpointName,\n data,\n status,\n isLoading,\n isSuccess,\n isError,\n error\n } = currentState;\n useDebugValue({\n endpointName,\n data,\n status,\n isLoading,\n isSuccess,\n isError,\n error\n });\n const finalState = useMemo2(() => ({\n ...currentState,\n originalArgs,\n reset\n }), [currentState, originalArgs, reset]);\n return useMemo2(() => [triggerMutation, finalState], [triggerMutation, finalState]);\n };\n }\n}\n\n// src/query/react/module.ts\nvar reactHooksModuleName = /* @__PURE__ */ Symbol();\nvar reactHooksModule = ({\n batch = rrBatch,\n hooks = {\n useDispatch: rrUseDispatch,\n useSelector: rrUseSelector,\n useStore: rrUseStore\n },\n createSelector: createSelector2 = _createSelector,\n unstable__sideEffectsInRender = false,\n ...rest\n} = {}) => {\n if (process.env.NODE_ENV !== \"production\") {\n const hookNames = [\"useDispatch\", \"useSelector\", \"useStore\"];\n let warned = false;\n for (const hookName of hookNames) {\n if (countObjectKeys(rest) > 0) {\n if (rest[hookName]) {\n if (!warned) {\n console.warn(\"As of RTK 2.0, the hooks now need to be specified as one object, provided under a `hooks` key:\\n`reactHooksModule({ hooks: { useDispatch, useSelector, useStore } })`\");\n warned = true;\n }\n }\n hooks[hookName] = rest[hookName];\n }\n if (typeof hooks[hookName] !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage3(36) : `When using custom hooks for context, all ${hookNames.length} hooks need to be provided: ${hookNames.join(\", \")}.\nHook ${hookName} was either not provided or not a function.`);\n }\n }\n }\n return {\n name: reactHooksModuleName,\n init(api, {\n serializeQueryArgs\n }, context) {\n const anyApi = api;\n const {\n buildQueryHooks,\n buildMutationHook,\n usePrefetch\n } = buildHooks({\n api,\n moduleOptions: {\n batch,\n hooks,\n unstable__sideEffectsInRender,\n createSelector: createSelector2\n },\n serializeQueryArgs,\n context\n });\n safeAssign(anyApi, {\n usePrefetch\n });\n safeAssign(context, {\n batch\n });\n return {\n injectEndpoint(endpointName, definition) {\n if (isQueryDefinition(definition)) {\n const {\n useQuery,\n useLazyQuery,\n useLazyQuerySubscription,\n useQueryState,\n useQuerySubscription\n } = buildQueryHooks(endpointName);\n safeAssign(anyApi.endpoints[endpointName], {\n useQuery,\n useLazyQuery,\n useLazyQuerySubscription,\n useQueryState,\n useQuerySubscription\n });\n api[`use${capitalize(endpointName)}Query`] = useQuery;\n api[`useLazy${capitalize(endpointName)}Query`] = useLazyQuery;\n } else if (isMutationDefinition(definition)) {\n const useMutation = buildMutationHook(endpointName);\n safeAssign(anyApi.endpoints[endpointName], {\n useMutation\n });\n api[`use${capitalize(endpointName)}Mutation`] = useMutation;\n }\n }\n };\n }\n };\n};\n\n// src/query/react/index.ts\nexport * from \"@reduxjs/toolkit/query\";\n\n// src/query/react/ApiProvider.tsx\nimport { configureStore, formatProdErrorMessage as _formatProdErrorMessage4 } from \"@reduxjs/toolkit\";\nimport { useContext } from \"react\";\nimport { useEffect as useEffect4 } from \"react\";\nimport * as React from \"react\";\nimport { Provider, ReactReduxContext } from \"react-redux\";\nimport { setupListeners } from \"@reduxjs/toolkit/query\";\nfunction ApiProvider(props) {\n const context = props.context || ReactReduxContext;\n const existingContext = useContext(context);\n if (existingContext) {\n throw new Error(process.env.NODE_ENV === \"production\" ? _formatProdErrorMessage4(35) : \"Existing Redux context detected. If you already have a store set up, please use the traditional Redux setup.\");\n }\n const [store] = React.useState(() => configureStore({\n reducer: {\n [props.api.reducerPath]: props.api.reducer\n },\n middleware: (gDM) => gDM().concat(props.api.middleware)\n }));\n useEffect4(() => props.setupListeners === false ? void 0 : setupListeners(store.dispatch, props.setupListeners), [props.setupListeners, store.dispatch]);\n return /* @__PURE__ */ React.createElement(Provider, { store, context }, props.children);\n}\n\n// src/query/react/index.ts\nvar createApi = /* @__PURE__ */ buildCreateApi(coreModule(), reactHooksModule());\nexport {\n ApiProvider,\n UNINITIALIZED_VALUE,\n createApi,\n reactHooksModule,\n reactHooksModuleName\n};\n//# sourceMappingURL=rtk-query-react.modern.mjs.map","/*! *****************************************************************************\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","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport var CognitoHostedUIIdentityProvider;\n(function (CognitoHostedUIIdentityProvider) {\n CognitoHostedUIIdentityProvider[\"Cognito\"] = \"COGNITO\";\n CognitoHostedUIIdentityProvider[\"Google\"] = \"Google\";\n CognitoHostedUIIdentityProvider[\"Facebook\"] = \"Facebook\";\n CognitoHostedUIIdentityProvider[\"Amazon\"] = \"LoginWithAmazon\";\n CognitoHostedUIIdentityProvider[\"Apple\"] = \"SignInWithApple\";\n})(CognitoHostedUIIdentityProvider || (CognitoHostedUIIdentityProvider = {}));\nexport function isFederatedSignInOptions(obj) {\n var keys = ['provider'];\n return obj && !!keys.find(function (k) { return obj.hasOwnProperty(k); });\n}\nexport function isFederatedSignInOptionsCustom(obj) {\n var keys = ['customProvider'];\n return obj && !!keys.find(function (k) { return obj.hasOwnProperty(k); });\n}\nexport function hasCustomState(obj) {\n var keys = ['customState'];\n return obj && !!keys.find(function (k) { return obj.hasOwnProperty(k); });\n}\nexport function isCognitoHostedOpts(oauth) {\n return oauth.redirectSignIn !== undefined;\n}\nexport var AuthErrorTypes;\n(function (AuthErrorTypes) {\n AuthErrorTypes[\"NoConfig\"] = \"noConfig\";\n AuthErrorTypes[\"MissingAuthConfig\"] = \"missingAuthConfig\";\n AuthErrorTypes[\"EmptyUsername\"] = \"emptyUsername\";\n AuthErrorTypes[\"InvalidUsername\"] = \"invalidUsername\";\n AuthErrorTypes[\"EmptyPassword\"] = \"emptyPassword\";\n AuthErrorTypes[\"EmptyCode\"] = \"emptyCode\";\n AuthErrorTypes[\"SignUpError\"] = \"signUpError\";\n AuthErrorTypes[\"NoMFA\"] = \"noMFA\";\n AuthErrorTypes[\"InvalidMFA\"] = \"invalidMFA\";\n AuthErrorTypes[\"EmptyChallengeResponse\"] = \"emptyChallengeResponse\";\n AuthErrorTypes[\"NoUserSession\"] = \"noUserSession\";\n AuthErrorTypes[\"Default\"] = \"default\";\n AuthErrorTypes[\"DeviceConfig\"] = \"deviceConfig\";\n AuthErrorTypes[\"NetworkError\"] = \"networkError\";\n AuthErrorTypes[\"AutoSignInError\"] = \"autoSignInError\";\n})(AuthErrorTypes || (AuthErrorTypes = {}));\nexport function isUsernamePasswordOpts(obj) {\n return !!obj.username;\n}\nexport var GRAPHQL_AUTH_MODE;\n(function (GRAPHQL_AUTH_MODE) {\n GRAPHQL_AUTH_MODE[\"API_KEY\"] = \"API_KEY\";\n GRAPHQL_AUTH_MODE[\"AWS_IAM\"] = \"AWS_IAM\";\n GRAPHQL_AUTH_MODE[\"OPENID_CONNECT\"] = \"OPENID_CONNECT\";\n GRAPHQL_AUTH_MODE[\"AMAZON_COGNITO_USER_POOLS\"] = \"AMAZON_COGNITO_USER_POOLS\";\n GRAPHQL_AUTH_MODE[\"AWS_LAMBDA\"] = \"AWS_LAMBDA\";\n})(GRAPHQL_AUTH_MODE || (GRAPHQL_AUTH_MODE = {}));\n//# sourceMappingURL=Auth.js.map","/*! *****************************************************************************\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","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\n// Logging constants\nvar AWS_CLOUDWATCH_BASE_BUFFER_SIZE = 26;\nvar AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE = 1048576;\nvar AWS_CLOUDWATCH_MAX_EVENT_SIZE = 256000;\nvar AWS_CLOUDWATCH_CATEGORY = 'Logging';\nvar AWS_CLOUDWATCH_PROVIDER_NAME = 'AWSCloudWatch';\nvar NO_CREDS_ERROR_STRING = 'No credentials';\nvar RETRY_ERROR_CODES = [\n 'ResourceNotFoundException',\n 'InvalidSequenceTokenException',\n];\nexport { AWS_CLOUDWATCH_BASE_BUFFER_SIZE, AWS_CLOUDWATCH_CATEGORY, AWS_CLOUDWATCH_MAX_BATCH_EVENT_SIZE, AWS_CLOUDWATCH_MAX_EVENT_SIZE, AWS_CLOUDWATCH_PROVIDER_NAME, NO_CREDS_ERROR_STRING, RETRY_ERROR_CODES, };\n//# sourceMappingURL=Constants.js.map","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { __read, __spread, __values } from \"tslib\";\nimport { AWS_CLOUDWATCH_CATEGORY } from '../Util/Constants';\nvar LOG_LEVELS = {\n VERBOSE: 1,\n DEBUG: 2,\n INFO: 3,\n WARN: 4,\n ERROR: 5,\n};\nexport var LOG_TYPE;\n(function (LOG_TYPE) {\n LOG_TYPE[\"DEBUG\"] = \"DEBUG\";\n LOG_TYPE[\"ERROR\"] = \"ERROR\";\n LOG_TYPE[\"INFO\"] = \"INFO\";\n LOG_TYPE[\"WARN\"] = \"WARN\";\n LOG_TYPE[\"VERBOSE\"] = \"VERBOSE\";\n})(LOG_TYPE || (LOG_TYPE = {}));\n/**\n * Write logs\n * @class Logger\n */\nvar ConsoleLogger = /** @class */ (function () {\n /**\n * @constructor\n * @param {string} name - Name of the logger\n */\n function ConsoleLogger(name, level) {\n if (level === void 0) { level = LOG_TYPE.WARN; }\n this.name = name;\n this.level = level;\n this._pluggables = [];\n }\n ConsoleLogger.prototype._padding = function (n) {\n return n < 10 ? '0' + n : '' + n;\n };\n ConsoleLogger.prototype._ts = function () {\n var dt = new Date();\n return ([this._padding(dt.getMinutes()), this._padding(dt.getSeconds())].join(':') +\n '.' +\n dt.getMilliseconds());\n };\n ConsoleLogger.prototype.configure = function (config) {\n if (!config)\n return this._config;\n this._config = config;\n return this._config;\n };\n /**\n * Write log\n * @method\n * @memeberof Logger\n * @param {LOG_TYPE|string} type - log type, default INFO\n * @param {string|object} msg - Logging message or object\n */\n ConsoleLogger.prototype._log = function (type) {\n var e_1, _a;\n var msg = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n msg[_i - 1] = arguments[_i];\n }\n var logger_level_name = this.level;\n if (ConsoleLogger.LOG_LEVEL) {\n logger_level_name = ConsoleLogger.LOG_LEVEL;\n }\n if (typeof window !== 'undefined' && window.LOG_LEVEL) {\n logger_level_name = window.LOG_LEVEL;\n }\n var logger_level = LOG_LEVELS[logger_level_name];\n var type_level = LOG_LEVELS[type];\n if (!(type_level >= logger_level)) {\n // Do nothing if type is not greater than or equal to logger level (handle undefined)\n return;\n }\n var log = console.log.bind(console);\n if (type === LOG_TYPE.ERROR && console.error) {\n log = console.error.bind(console);\n }\n if (type === LOG_TYPE.WARN && console.warn) {\n log = console.warn.bind(console);\n }\n var prefix = \"[\" + type + \"] \" + this._ts() + \" \" + this.name;\n var message = '';\n if (msg.length === 1 && typeof msg[0] === 'string') {\n message = prefix + \" - \" + msg[0];\n log(message);\n }\n else if (msg.length === 1) {\n message = prefix + \" \" + msg[0];\n log(prefix, msg[0]);\n }\n else if (typeof msg[0] === 'string') {\n var obj = msg.slice(1);\n if (obj.length === 1) {\n obj = obj[0];\n }\n message = prefix + \" - \" + msg[0] + \" \" + obj;\n log(prefix + \" - \" + msg[0], obj);\n }\n else {\n message = prefix + \" \" + msg;\n log(prefix, msg);\n }\n try {\n for (var _b = __values(this._pluggables), _c = _b.next(); !_c.done; _c = _b.next()) {\n var plugin = _c.value;\n var logEvent = { message: message, timestamp: Date.now() };\n plugin.pushLogs([logEvent]);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n };\n /**\n * Write General log. Default to INFO\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n ConsoleLogger.prototype.log = function () {\n var msg = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n msg[_i] = arguments[_i];\n }\n this._log.apply(this, __spread([LOG_TYPE.INFO], msg));\n };\n /**\n * Write INFO log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n ConsoleLogger.prototype.info = function () {\n var msg = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n msg[_i] = arguments[_i];\n }\n this._log.apply(this, __spread([LOG_TYPE.INFO], msg));\n };\n /**\n * Write WARN log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n ConsoleLogger.prototype.warn = function () {\n var msg = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n msg[_i] = arguments[_i];\n }\n this._log.apply(this, __spread([LOG_TYPE.WARN], msg));\n };\n /**\n * Write ERROR log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n ConsoleLogger.prototype.error = function () {\n var msg = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n msg[_i] = arguments[_i];\n }\n this._log.apply(this, __spread([LOG_TYPE.ERROR], msg));\n };\n /**\n * Write DEBUG log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n ConsoleLogger.prototype.debug = function () {\n var msg = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n msg[_i] = arguments[_i];\n }\n this._log.apply(this, __spread([LOG_TYPE.DEBUG], msg));\n };\n /**\n * Write VERBOSE log\n * @method\n * @memeberof Logger\n * @param {string|object} msg - Logging message or object\n */\n ConsoleLogger.prototype.verbose = function () {\n var msg = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n msg[_i] = arguments[_i];\n }\n this._log.apply(this, __spread([LOG_TYPE.VERBOSE], msg));\n };\n ConsoleLogger.prototype.addPluggable = function (pluggable) {\n if (pluggable && pluggable.getCategoryName() === AWS_CLOUDWATCH_CATEGORY) {\n this._pluggables.push(pluggable);\n pluggable.configure(this._config);\n }\n };\n ConsoleLogger.prototype.listPluggables = function () {\n return this._pluggables;\n };\n ConsoleLogger.LOG_LEVEL = null;\n return ConsoleLogger;\n}());\nexport { ConsoleLogger };\n//# sourceMappingURL=ConsoleLogger.js.map","import { __read } from \"tslib\";\nimport { ConsoleLogger as LoggerClass } from './Logger';\nvar logger = new LoggerClass('Amplify');\nvar AmplifyClass = /** @class */ (function () {\n function AmplifyClass() {\n // Everything that is `register`ed is tracked here\n this._components = [];\n this._config = {};\n // All modules (with `getModuleName()`) are stored here for dependency injection\n this._modules = {};\n // for backward compatibility to avoid breaking change\n // if someone is using like Amplify.Auth\n this.Auth = null;\n this.Analytics = null;\n this.API = null;\n this.Credentials = null;\n this.Storage = null;\n this.I18n = null;\n this.Cache = null;\n this.PubSub = null;\n this.Interactions = null;\n this.Pushnotification = null;\n this.UI = null;\n this.XR = null;\n this.Predictions = null;\n this.DataStore = null;\n this.Geo = null;\n this.Notifications = null;\n this.Logger = LoggerClass;\n this.ServiceWorker = null;\n }\n AmplifyClass.prototype.register = function (comp) {\n logger.debug('component registered in amplify', comp);\n this._components.push(comp);\n if (typeof comp.getModuleName === 'function') {\n this._modules[comp.getModuleName()] = comp;\n this[comp.getModuleName()] = comp;\n }\n else {\n logger.debug('no getModuleName method for component', comp);\n }\n // Finally configure this new component(category) loaded\n // With the new modularization changes in Amplify V3, all the Amplify\n // component are not loaded/registered right away but when they are\n // imported (and hence instantiated) in the client's app. This ensures\n // that all new components imported get correctly configured with the\n // configuration that Amplify.configure() was called with.\n comp.configure(this._config);\n };\n AmplifyClass.prototype.configure = function (config) {\n var _this = this;\n if (!config)\n return this._config;\n this._config = Object.assign(this._config, config);\n logger.debug('amplify config', this._config);\n // Dependency Injection via property-setting.\n // This avoids introducing a public method/interface/setter that's difficult to remove later.\n // Plus, it reduces `if` statements within the `constructor` and `configure` of each module\n Object.entries(this._modules).forEach(function (_a) {\n var _b = __read(_a, 2), Name = _b[0], comp = _b[1];\n // e.g. Auth.*\n Object.keys(comp).forEach(function (property) {\n // e.g. Auth[\"Credentials\"] = this._modules[\"Credentials\"] when set\n if (_this._modules[property]) {\n comp[property] = _this._modules[property];\n }\n });\n });\n this._components.map(function (comp) {\n comp.configure(_this._config);\n });\n return this._config;\n };\n AmplifyClass.prototype.addPluggable = function (pluggable) {\n if (pluggable &&\n pluggable['getCategory'] &&\n typeof pluggable['getCategory'] === 'function') {\n this._components.map(function (comp) {\n if (comp['addPluggable'] &&\n typeof comp['addPluggable'] === 'function') {\n comp.addPluggable(pluggable);\n }\n });\n }\n };\n return AmplifyClass;\n}());\nexport { AmplifyClass };\nexport var Amplify = new AmplifyClass();\n//# sourceMappingURL=Amplify.js.map","// generated by genversion\nexport var version = '5.2.1';\n//# sourceMappingURL=version.js.map","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { version } from './version';\nvar BASE_USER_AGENT = \"aws-amplify/\" + version;\nexport var Platform = {\n userAgent: BASE_USER_AGENT + \" js\",\n product: '',\n navigator: null,\n isReactNative: false,\n};\nif (typeof navigator !== 'undefined' && navigator.product) {\n Platform.product = navigator.product || '';\n Platform.navigator = navigator || null;\n switch (navigator.product) {\n case 'ReactNative':\n Platform.userAgent = BASE_USER_AGENT + \" react-native\";\n Platform.isReactNative = true;\n break;\n default:\n Platform.userAgent = BASE_USER_AGENT + \" js\";\n Platform.isReactNative = false;\n break;\n }\n}\nexport var getAmplifyUserAgent = function (content) {\n return \"\" + Platform.userAgent + (content ? content : '');\n};\n//# sourceMappingURL=index.js.map","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { __assign, __read, __spread } from \"tslib\";\nimport { ConsoleLogger as Logger } from './Logger';\nvar logger = new Logger('Hub');\nvar AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'\n ? Symbol.for('amplify_default')\n : '@@amplify_default');\nfunction isLegacyCallback(callback) {\n return callback.onHubCapsule !== undefined;\n}\nvar HubClass = /** @class */ (function () {\n function HubClass(name) {\n this.listeners = [];\n this.patterns = [];\n this.protectedChannels = [\n 'core',\n 'auth',\n 'api',\n 'analytics',\n 'interactions',\n 'pubsub',\n 'storage',\n 'ui',\n 'xr',\n ];\n this.name = name;\n }\n /**\n * Used internally to remove a Hub listener.\n *\n * @remarks\n * This private method is for internal use only. Instead of calling Hub.remove, call the result of Hub.listen.\n */\n HubClass.prototype._remove = function (channel, listener) {\n if (channel instanceof RegExp) {\n var pattern_1 = this.patterns.find(function (_a) {\n var pattern = _a.pattern;\n return pattern.source === channel.source;\n });\n if (!pattern_1) {\n logger.warn(\"No listeners for \" + channel);\n return;\n }\n this.patterns = __spread(this.patterns.filter(function (x) { return x !== pattern_1; }));\n }\n else {\n var holder = this.listeners[channel];\n if (!holder) {\n logger.warn(\"No listeners for \" + channel);\n return;\n }\n this.listeners[channel] = __spread(holder.filter(function (_a) {\n var callback = _a.callback;\n return callback !== listener;\n }));\n }\n };\n /**\n * @deprecated Instead of calling Hub.remove, call the result of Hub.listen.\n */\n HubClass.prototype.remove = function (channel, listener) {\n this._remove(channel, listener);\n };\n /**\n * Used to send a Hub event.\n *\n * @param channel - The channel on which the event will be broadcast\n * @param payload - The HubPayload\n * @param source - The source of the event; defaults to ''\n * @param ampSymbol - Symbol used to determine if the event is dispatched internally on a protected channel\n *\n */\n HubClass.prototype.dispatch = function (channel, payload, source, ampSymbol) {\n if (source === void 0) { source = ''; }\n if (this.protectedChannels.indexOf(channel) > -1) {\n var hasAccess = ampSymbol === AMPLIFY_SYMBOL;\n if (!hasAccess) {\n logger.warn(\"WARNING: \" + channel + \" is protected and dispatching on it can have unintended consequences\");\n }\n }\n var capsule = {\n channel: channel,\n payload: __assign({}, payload),\n source: source,\n patternInfo: [],\n };\n try {\n this._toListeners(capsule);\n }\n catch (e) {\n logger.error(e);\n }\n };\n /**\n * Used to listen for Hub events.\n *\n * @param channel - The channel on which to listen\n * @param callback - The callback to execute when an event is received on the specified channel\n * @param listenerName - The name of the listener; defaults to 'noname'\n * @returns A function which can be called to cancel the listener.\n *\n */\n HubClass.prototype.listen = function (channel, callback, listenerName) {\n var _this = this;\n if (listenerName === void 0) { listenerName = 'noname'; }\n var cb;\n // Check for legacy onHubCapsule callback for backwards compatability\n if (isLegacyCallback(callback)) {\n logger.warn(\"WARNING onHubCapsule is Deprecated. Please pass in a callback.\");\n cb = callback.onHubCapsule.bind(callback);\n }\n else if (typeof callback !== 'function') {\n throw new Error('No callback supplied to Hub');\n }\n else {\n cb = callback;\n }\n if (channel instanceof RegExp) {\n this.patterns.push({\n pattern: channel,\n callback: cb,\n });\n }\n else {\n var holder = this.listeners[channel];\n if (!holder) {\n holder = [];\n this.listeners[channel] = holder;\n }\n holder.push({\n name: listenerName,\n callback: cb,\n });\n }\n return function () {\n _this._remove(channel, cb);\n };\n };\n HubClass.prototype._toListeners = function (capsule) {\n var channel = capsule.channel, payload = capsule.payload;\n var holder = this.listeners[channel];\n if (holder) {\n holder.forEach(function (listener) {\n logger.debug(\"Dispatching to \" + channel + \" with \", payload);\n try {\n listener.callback(capsule);\n }\n catch (e) {\n logger.error(e);\n }\n });\n }\n if (this.patterns.length > 0) {\n if (!payload.message) {\n logger.warn(\"Cannot perform pattern matching without a message key\");\n return;\n }\n var payloadStr_1 = payload.message;\n this.patterns.forEach(function (pattern) {\n var match = payloadStr_1.match(pattern.pattern);\n if (match) {\n var _a = __read(match), groups = _a.slice(1);\n var dispatchingCapsule = __assign(__assign({}, capsule), { patternInfo: groups });\n try {\n pattern.callback(dispatchingCapsule);\n }\n catch (e) {\n logger.error(e);\n }\n }\n });\n }\n };\n return HubClass;\n}());\nexport { HubClass };\n/*We export a __default__ instance of HubClass to use it as a\npseudo Singleton for the main messaging bus, however you can still create\nyour own instance of HubClass() for a separate \"private bus\" of events.*/\nexport var Hub = new HubClass('__default__');\n//# sourceMappingURL=Hub.js.map","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { __assign } from \"tslib\";\nimport { ConsoleLogger as Logger } from '../Logger';\nvar logger = new Logger('I18n');\n/**\n * Language transition class\n */\nvar I18n = /** @class */ (function () {\n /**\n * @constructor\n * Initialize with configurations\n * @param {Object} options\n */\n function I18n(options) {\n /**\n * @private\n */\n this._options = null;\n /**\n * @private\n */\n this._lang = null;\n /**\n * @private\n */\n this._dict = {};\n this._options = Object.assign({}, options);\n this._lang = this._options.language;\n if (!this._lang &&\n typeof window !== 'undefined' &&\n window &&\n window.navigator) {\n this._lang = window.navigator.language;\n }\n logger.debug(this._lang);\n }\n /**\n * @method\n * Explicitly setting language\n * @param {String} lang\n */\n I18n.prototype.setLanguage = function (lang) {\n this._lang = lang;\n };\n /**\n * @method\n * Get value\n * @param {String} key\n * @param {String} defVal - Default value\n */\n I18n.prototype.get = function (key, defVal) {\n if (defVal === void 0) { defVal = undefined; }\n if (!this._lang) {\n return typeof defVal !== 'undefined' ? defVal : key;\n }\n var lang = this._lang;\n var val = this.getByLanguage(key, lang);\n if (val) {\n return val;\n }\n if (lang.indexOf('-') > 0) {\n val = this.getByLanguage(key, lang.split('-')[0]);\n }\n if (val) {\n return val;\n }\n return typeof defVal !== 'undefined' ? defVal : key;\n };\n /**\n * @method\n * Get value according to specified language\n * @param {String} key\n * @param {String} language - Specified langurage to be used\n * @param {String} defVal - Default value\n */\n I18n.prototype.getByLanguage = function (key, language, defVal) {\n if (defVal === void 0) { defVal = null; }\n if (!language) {\n return defVal;\n }\n var lang_dict = this._dict[language];\n if (!lang_dict) {\n return defVal;\n }\n return lang_dict[key];\n };\n /**\n * @method\n * Add vocabularies for one language\n * @param {String} language - Language of the dictionary\n * @param {Object} vocabularies - Object that has key-value as dictionary entry\n */\n I18n.prototype.putVocabulariesForLanguage = function (language, vocabularies) {\n var lang_dict = this._dict[language];\n if (!lang_dict) {\n lang_dict = this._dict[language] = {};\n }\n this._dict[language] = __assign(__assign({}, lang_dict), vocabularies);\n };\n /**\n * @method\n * Add vocabularies for one language\n * @param {Object} vocabularies - Object that has language as key,\n * vocabularies of each language as value\n */\n I18n.prototype.putVocabularies = function (vocabularies) {\n var _this = this;\n Object.keys(vocabularies).map(function (key) {\n _this.putVocabulariesForLanguage(key, vocabularies[key]);\n });\n };\n return I18n;\n}());\nexport { I18n };\n//# sourceMappingURL=I18n.js.map","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { I18n as I18nClass } from './I18n';\nimport { ConsoleLogger as Logger } from '../Logger';\nimport { Amplify } from '../Amplify';\nvar logger = new Logger('I18n');\nvar _config = null;\nvar _i18n = null;\n/**\n * Export I18n APIs\n */\nvar I18n = /** @class */ (function () {\n function I18n() {\n }\n /**\n * @static\n * @method\n * Configure I18n part\n * @param {Object} config - Configuration of the I18n\n */\n I18n.configure = function (config) {\n logger.debug('configure I18n');\n if (!config) {\n return _config;\n }\n _config = Object.assign({}, _config, config.I18n || config);\n I18n.createInstance();\n return _config;\n };\n I18n.getModuleName = function () {\n return 'I18n';\n };\n /**\n * @static\n * @method\n * Create an instance of I18n for the library\n */\n I18n.createInstance = function () {\n logger.debug('create I18n instance');\n if (_i18n) {\n return;\n }\n _i18n = new I18nClass(_config);\n };\n /**\n * @static @method\n * Explicitly setting language\n * @param {String} lang\n */\n I18n.setLanguage = function (lang) {\n I18n.checkConfig();\n return _i18n.setLanguage(lang);\n };\n /**\n * @static @method\n * Get value\n * @param {String} key\n * @param {String} defVal - Default value\n */\n I18n.get = function (key, defVal) {\n if (!I18n.checkConfig()) {\n return typeof defVal === 'undefined' ? key : defVal;\n }\n return _i18n.get(key, defVal);\n };\n /**\n * @static\n * @method\n * Add vocabularies for one language\n * @param {String} langurage - Language of the dictionary\n * @param {Object} vocabularies - Object that has key-value as dictionary entry\n */\n I18n.putVocabulariesForLanguage = function (language, vocabularies) {\n I18n.checkConfig();\n return _i18n.putVocabulariesForLanguage(language, vocabularies);\n };\n /**\n * @static\n * @method\n * Add vocabularies for one language\n * @param {Object} vocabularies - Object that has language as key,\n * vocabularies of each language as value\n */\n I18n.putVocabularies = function (vocabularies) {\n I18n.checkConfig();\n return _i18n.putVocabularies(vocabularies);\n };\n I18n.checkConfig = function () {\n if (!_i18n) {\n _i18n = new I18nClass(_config);\n }\n return true;\n };\n return I18n;\n}());\nexport { I18n };\nAmplify.register(I18n);\n//# sourceMappingURL=index.js.map","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar MIME_MAP = [\n { type: 'text/plain', ext: 'txt' },\n { type: 'text/html', ext: 'html' },\n { type: 'text/javascript', ext: 'js' },\n { type: 'text/css', ext: 'css' },\n { type: 'text/csv', ext: 'csv' },\n { type: 'text/yaml', ext: 'yml' },\n { type: 'text/yaml', ext: 'yaml' },\n { type: 'text/calendar', ext: 'ics' },\n { type: 'text/calendar', ext: 'ical' },\n { type: 'image/apng', ext: 'apng' },\n { type: 'image/bmp', ext: 'bmp' },\n { type: 'image/gif', ext: 'gif' },\n { type: 'image/x-icon', ext: 'ico' },\n { type: 'image/x-icon', ext: 'cur' },\n { type: 'image/jpeg', ext: 'jpg' },\n { type: 'image/jpeg', ext: 'jpeg' },\n { type: 'image/jpeg', ext: 'jfif' },\n { type: 'image/jpeg', ext: 'pjp' },\n { type: 'image/jpeg', ext: 'pjpeg' },\n { type: 'image/png', ext: 'png' },\n { type: 'image/svg+xml', ext: 'svg' },\n { type: 'image/tiff', ext: 'tif' },\n { type: 'image/tiff', ext: 'tiff' },\n { type: 'image/webp', ext: 'webp' },\n { type: 'application/json', ext: 'json' },\n { type: 'application/xml', ext: 'xml' },\n { type: 'application/x-sh', ext: 'sh' },\n { type: 'application/zip', ext: 'zip' },\n { type: 'application/x-rar-compressed', ext: 'rar' },\n { type: 'application/x-tar', ext: 'tar' },\n { type: 'application/x-bzip', ext: 'bz' },\n { type: 'application/x-bzip2', ext: 'bz2' },\n { type: 'application/pdf', ext: 'pdf' },\n { type: 'application/java-archive', ext: 'jar' },\n { type: 'application/msword', ext: 'doc' },\n { type: 'application/vnd.ms-excel', ext: 'xls' },\n { type: 'application/vnd.ms-excel', ext: 'xlsx' },\n { type: 'message/rfc822', ext: 'eml' },\n];\nexport var isEmpty = function (obj) {\n if (obj === void 0) { obj = {}; }\n return Object.keys(obj).length === 0;\n};\nexport var sortByField = function (list, field, dir) {\n if (!list || !list.sort) {\n return false;\n }\n var dirX = dir && dir === 'desc' ? -1 : 1;\n list.sort(function (a, b) {\n var a_val = a[field];\n var b_val = b[field];\n if (typeof b_val === 'undefined') {\n return typeof a_val === 'undefined' ? 0 : 1 * dirX;\n }\n if (typeof a_val === 'undefined') {\n return -1 * dirX;\n }\n if (a_val < b_val) {\n return -1 * dirX;\n }\n if (a_val > b_val) {\n return 1 * dirX;\n }\n return 0;\n });\n return true;\n};\nexport var objectLessAttributes = function (obj, less) {\n var ret = Object.assign({}, obj);\n if (less) {\n if (typeof less === 'string') {\n delete ret[less];\n }\n else {\n less.forEach(function (attr) {\n delete ret[attr];\n });\n }\n }\n return ret;\n};\nexport var filenameToContentType = function (filename, defVal) {\n if (defVal === void 0) { defVal = 'application/octet-stream'; }\n var name = filename.toLowerCase();\n var filtered = MIME_MAP.filter(function (mime) { return name.endsWith('.' + mime.ext); });\n return filtered.length > 0 ? filtered[0].type : defVal;\n};\nexport var isTextFile = function (contentType) {\n var type = contentType.toLowerCase();\n if (type.startsWith('text/')) {\n return true;\n }\n return ('application/json' === type ||\n 'application/xml' === type ||\n 'application/sh' === type);\n};\nexport var generateRandomString = function () {\n var result = '';\n var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for (var i = 32; i > 0; i -= 1) {\n result += chars[Math.floor(Math.random() * chars.length)];\n }\n return result;\n};\nexport var makeQuerablePromise = function (promise) {\n if (promise.isResolved)\n return promise;\n var isPending = true;\n var isRejected = false;\n var isFullfilled = false;\n var result = promise.then(function (data) {\n isFullfilled = true;\n isPending = false;\n return data;\n }, function (e) {\n isRejected = true;\n isPending = false;\n throw e;\n });\n result.isFullfilled = function () { return isFullfilled; };\n result.isPending = function () { return isPending; };\n result.isRejected = function () { return isRejected; };\n return result;\n};\nexport var isWebWorker = function () {\n if (typeof self === 'undefined') {\n return false;\n }\n var selfContext = self;\n return (typeof selfContext.WorkerGlobalScope !== 'undefined' &&\n self instanceof selfContext.WorkerGlobalScope);\n};\nexport var browserOrNode = function () {\n var isBrowser = typeof window !== 'undefined' && typeof window.document !== 'undefined';\n var isNode = typeof process !== 'undefined' &&\n process.versions != null &&\n process.versions.node != null;\n return {\n isBrowser: isBrowser,\n isNode: isNode,\n };\n};\n/**\n * transfer the first letter of the keys to lowercase\n * @param {Object} obj - the object need to be transferred\n * @param {Array} whiteListForItself - whitelist itself from being transferred\n * @param {Array} whiteListForChildren - whitelist its children keys from being transferred\n */\nexport var transferKeyToLowerCase = function (obj, whiteListForItself, whiteListForChildren) {\n if (whiteListForItself === void 0) { whiteListForItself = []; }\n if (whiteListForChildren === void 0) { whiteListForChildren = []; }\n if (!isStrictObject(obj))\n return obj;\n var ret = {};\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n var transferedKey = whiteListForItself.includes(key)\n ? key\n : key[0].toLowerCase() + key.slice(1);\n ret[transferedKey] = whiteListForChildren.includes(key)\n ? obj[key]\n : transferKeyToLowerCase(obj[key], whiteListForItself, whiteListForChildren);\n }\n }\n return ret;\n};\n/**\n * transfer the first letter of the keys to lowercase\n * @param {Object} obj - the object need to be transferred\n * @param {Array} whiteListForItself - whitelist itself from being transferred\n * @param {Array} whiteListForChildren - whitelist its children keys from being transferred\n */\nexport var transferKeyToUpperCase = function (obj, whiteListForItself, whiteListForChildren) {\n if (whiteListForItself === void 0) { whiteListForItself = []; }\n if (whiteListForChildren === void 0) { whiteListForChildren = []; }\n if (!isStrictObject(obj))\n return obj;\n var ret = {};\n for (var key in obj) {\n if (obj.hasOwnProperty(key)) {\n var transferredKey = whiteListForItself.includes(key)\n ? key\n : key[0].toUpperCase() + key.slice(1);\n ret[transferredKey] = whiteListForChildren.includes(key)\n ? obj[key]\n : transferKeyToUpperCase(obj[key], whiteListForItself, whiteListForChildren);\n }\n }\n return ret;\n};\n/**\n * Return true if the object is a strict object\n * which means it's not Array, Function, Number, String, Boolean or Null\n * @param obj the Object\n */\nexport var isStrictObject = function (obj) {\n return (obj instanceof Object &&\n !(obj instanceof Array) &&\n !(obj instanceof Function) &&\n !(obj instanceof Number) &&\n !(obj instanceof String) &&\n !(obj instanceof Boolean));\n};\n//# sourceMappingURL=JS.js.map","import { __awaiter, __extends, __generator, __read, __spread } from \"tslib\";\nimport { ConsoleLogger as Logger } from '../Logger/ConsoleLogger';\nvar logger = new Logger('Util');\nvar NonRetryableError = /** @class */ (function (_super) {\n __extends(NonRetryableError, _super);\n function NonRetryableError(message) {\n var _this = _super.call(this, message) || this;\n _this.nonRetryable = true;\n return _this;\n }\n return NonRetryableError;\n}(Error));\nexport { NonRetryableError };\nexport var isNonRetryableError = function (obj) {\n var key = 'nonRetryable';\n return obj && obj[key];\n};\n/**\n * @private\n * Internal use of Amplify only\n */\nexport function retry(functionToRetry, args, delayFn, onTerminate) {\n return __awaiter(this, void 0, void 0, function () {\n var _this = this;\n return __generator(this, function (_a) {\n if (typeof functionToRetry !== 'function') {\n throw Error('functionToRetry must be a function');\n }\n return [2 /*return*/, new Promise(function (resolve, reject) { return __awaiter(_this, void 0, void 0, function () {\n var attempt, terminated, timeout, wakeUp, lastError, _loop_1, state_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n attempt = 0;\n terminated = false;\n wakeUp = function () { };\n onTerminate &&\n onTerminate.then(function () {\n // signal not to try anymore.\n terminated = true;\n // stop sleeping if we're sleeping.\n clearTimeout(timeout);\n wakeUp();\n });\n _loop_1 = function () {\n var _a, _b, err_1, retryIn_1;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n attempt++;\n logger.debug(functionToRetry.name + \" attempt #\" + attempt + \" with this vars: \" + JSON.stringify(args));\n _c.label = 1;\n case 1:\n _c.trys.push([1, 3, , 7]);\n _a = {};\n _b = resolve;\n return [4 /*yield*/, functionToRetry.apply(void 0, __spread(args))];\n case 2: return [2 /*return*/, (_a.value = _b.apply(void 0, [_c.sent()]), _a)];\n case 3:\n err_1 = _c.sent();\n lastError = err_1;\n logger.debug(\"error on \" + functionToRetry.name, err_1);\n if (isNonRetryableError(err_1)) {\n logger.debug(functionToRetry.name + \" non retryable error\", err_1);\n return [2 /*return*/, { value: reject(err_1) }];\n }\n retryIn_1 = delayFn(attempt, args, err_1);\n logger.debug(functionToRetry.name + \" retrying in \" + retryIn_1 + \" ms\");\n if (!(retryIn_1 === false || terminated)) return [3 /*break*/, 4];\n return [2 /*return*/, { value: reject(err_1) }];\n case 4: return [4 /*yield*/, new Promise(function (r) {\n wakeUp = r; // export wakeUp for onTerminate handling\n timeout = setTimeout(wakeUp, retryIn_1);\n })];\n case 5:\n _c.sent();\n _c.label = 6;\n case 6: return [3 /*break*/, 7];\n case 7: return [2 /*return*/];\n }\n });\n };\n _a.label = 1;\n case 1:\n if (!!terminated) return [3 /*break*/, 3];\n return [5 /*yield**/, _loop_1()];\n case 2:\n state_1 = _a.sent();\n if (typeof state_1 === \"object\")\n return [2 /*return*/, state_1.value];\n return [3 /*break*/, 1];\n case 3:\n // reached if terminated while waiting for a timer.\n reject(lastError);\n return [2 /*return*/];\n }\n });\n }); })];\n });\n });\n}\nvar MAX_DELAY_MS = 5 * 60 * 1000;\n/**\n * @private\n * Internal use of Amplify only\n */\nexport function jitteredBackoff(maxDelayMs) {\n if (maxDelayMs === void 0) { maxDelayMs = MAX_DELAY_MS; }\n var BASE_TIME_MS = 100;\n var JITTER_FACTOR = 100;\n return function (attempt) {\n var delay = Math.pow(2, attempt) * BASE_TIME_MS + JITTER_FACTOR * Math.random();\n return delay > maxDelayMs ? false : delay;\n };\n}\n/**\n * @private\n * Internal use of Amplify only\n */\nexport var jitteredExponentialRetry = function (functionToRetry, args, maxDelayMs, onTerminate) {\n if (maxDelayMs === void 0) { maxDelayMs = MAX_DELAY_MS; }\n return retry(functionToRetry, args, jitteredBackoff(maxDelayMs), onTerminate);\n};\n//# sourceMappingURL=Retry.js.map","export function urlSafeEncode(str) {\n return str\n .split('')\n .map(function (char) {\n return char\n .charCodeAt(0)\n .toString(16)\n .padStart(2, '0');\n })\n .join('');\n}\nexport function urlSafeDecode(hex) {\n return hex\n .match(/.{2}/g)\n .map(function (char) { return String.fromCharCode(parseInt(char, 16)); })\n .join('');\n}\n//# sourceMappingURL=StringUtils.js.map","/*! *****************************************************************************\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","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MAX_HASHABLE_LENGTH = exports.INIT = exports.KEY = exports.DIGEST_LENGTH = exports.BLOCK_SIZE = void 0;\n/**\n * @internal\n */\nexports.BLOCK_SIZE = 64;\n/**\n * @internal\n */\nexports.DIGEST_LENGTH = 32;\n/**\n * @internal\n */\nexports.KEY = new Uint32Array([\n 0x428a2f98,\n 0x71374491,\n 0xb5c0fbcf,\n 0xe9b5dba5,\n 0x3956c25b,\n 0x59f111f1,\n 0x923f82a4,\n 0xab1c5ed5,\n 0xd807aa98,\n 0x12835b01,\n 0x243185be,\n 0x550c7dc3,\n 0x72be5d74,\n 0x80deb1fe,\n 0x9bdc06a7,\n 0xc19bf174,\n 0xe49b69c1,\n 0xefbe4786,\n 0x0fc19dc6,\n 0x240ca1cc,\n 0x2de92c6f,\n 0x4a7484aa,\n 0x5cb0a9dc,\n 0x76f988da,\n 0x983e5152,\n 0xa831c66d,\n 0xb00327c8,\n 0xbf597fc7,\n 0xc6e00bf3,\n 0xd5a79147,\n 0x06ca6351,\n 0x14292967,\n 0x27b70a85,\n 0x2e1b2138,\n 0x4d2c6dfc,\n 0x53380d13,\n 0x650a7354,\n 0x766a0abb,\n 0x81c2c92e,\n 0x92722c85,\n 0xa2bfe8a1,\n 0xa81a664b,\n 0xc24b8b70,\n 0xc76c51a3,\n 0xd192e819,\n 0xd6990624,\n 0xf40e3585,\n 0x106aa070,\n 0x19a4c116,\n 0x1e376c08,\n 0x2748774c,\n 0x34b0bcb5,\n 0x391c0cb3,\n 0x4ed8aa4a,\n 0x5b9cca4f,\n 0x682e6ff3,\n 0x748f82ee,\n 0x78a5636f,\n 0x84c87814,\n 0x8cc70208,\n 0x90befffa,\n 0xa4506ceb,\n 0xbef9a3f7,\n 0xc67178f2\n]);\n/**\n * @internal\n */\nexports.INIT = [\n 0x6a09e667,\n 0xbb67ae85,\n 0x3c6ef372,\n 0xa54ff53a,\n 0x510e527f,\n 0x9b05688c,\n 0x1f83d9ab,\n 0x5be0cd19\n];\n/**\n * @internal\n */\nexports.MAX_HASHABLE_LENGTH = Math.pow(2, 53) - 1;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2NvbnN0YW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBQTs7R0FFRztBQUNVLFFBQUEsVUFBVSxHQUFXLEVBQUUsQ0FBQztBQUVyQzs7R0FFRztBQUNVLFFBQUEsYUFBYSxHQUFXLEVBQUUsQ0FBQztBQUV4Qzs7R0FFRztBQUNVLFFBQUEsR0FBRyxHQUFHLElBQUksV0FBVyxDQUFDO0lBQ2pDLFVBQVU7SUFDVixVQUFVO0lBQ1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*/\nvar RawSha256 = /** @class */ (function () {\n function RawSha256() {\n this.state = Int32Array.from(constants_1.INIT);\n this.temp = new Int32Array(64);\n this.buffer = new Uint8Array(64);\n this.bufferLength = 0;\n this.bytesHashed = 0;\n /**\n * @internal\n */\n this.finished = false;\n }\n RawSha256.prototype.update = function (data) {\n if (this.finished) {\n throw new Error(\"Attempted to update an already finished hash.\");\n }\n var position = 0;\n var byteLength = data.byteLength;\n this.bytesHashed += byteLength;\n if (this.bytesHashed * 8 > constants_1.MAX_HASHABLE_LENGTH) {\n throw new Error(\"Cannot hash more than 2^53 - 1 bits\");\n }\n while (byteLength > 0) {\n this.buffer[this.bufferLength++] = data[position++];\n byteLength--;\n if (this.bufferLength === constants_1.BLOCK_SIZE) {\n this.hashBuffer();\n this.bufferLength = 0;\n }\n }\n };\n RawSha256.prototype.digest = function () {\n if (!this.finished) {\n var bitsHashed = this.bytesHashed * 8;\n var bufferView = new DataView(this.buffer.buffer, this.buffer.byteOffset, this.buffer.byteLength);\n var undecoratedLength = this.bufferLength;\n bufferView.setUint8(this.bufferLength++, 0x80);\n // Ensure the final block has enough room for the hashed length\n if (undecoratedLength % constants_1.BLOCK_SIZE >= constants_1.BLOCK_SIZE - 8) {\n for (var i = this.bufferLength; i < constants_1.BLOCK_SIZE; i++) {\n bufferView.setUint8(i, 0);\n }\n this.hashBuffer();\n this.bufferLength = 0;\n }\n for (var i = this.bufferLength; i < constants_1.BLOCK_SIZE - 8; i++) {\n bufferView.setUint8(i, 0);\n }\n bufferView.setUint32(constants_1.BLOCK_SIZE - 8, Math.floor(bitsHashed / 0x100000000), true);\n bufferView.setUint32(constants_1.BLOCK_SIZE - 4, bitsHashed);\n this.hashBuffer();\n this.finished = true;\n }\n // The value in state is little-endian rather than big-endian, so flip\n // each word into a new Uint8Array\n var out = new Uint8Array(constants_1.DIGEST_LENGTH);\n for (var i = 0; i < 8; i++) {\n out[i * 4] = (this.state[i] >>> 24) & 0xff;\n out[i * 4 + 1] = (this.state[i] >>> 16) & 0xff;\n out[i * 4 + 2] = (this.state[i] >>> 8) & 0xff;\n out[i * 4 + 3] = (this.state[i] >>> 0) & 0xff;\n }\n return out;\n };\n RawSha256.prototype.hashBuffer = function () {\n var _a = this, buffer = _a.buffer, state = _a.state;\n var state0 = state[0], state1 = state[1], state2 = state[2], state3 = state[3], state4 = state[4], state5 = state[5], state6 = state[6], state7 = state[7];\n for (var i = 0; i < constants_1.BLOCK_SIZE; i++) {\n if (i < 16) {\n this.temp[i] =\n ((buffer[i * 4] & 0xff) << 24) |\n ((buffer[i * 4 + 1] & 0xff) << 16) |\n ((buffer[i * 4 + 2] & 0xff) << 8) |\n (buffer[i * 4 + 3] & 0xff);\n }\n else {\n var u = this.temp[i - 2];\n var t1_1 = ((u >>> 17) | (u << 15)) ^ ((u >>> 19) | (u << 13)) ^ (u >>> 10);\n u = this.temp[i - 15];\n var t2_1 = ((u >>> 7) | (u << 25)) ^ ((u >>> 18) | (u << 14)) ^ (u >>> 3);\n this.temp[i] =\n ((t1_1 + this.temp[i - 7]) | 0) + ((t2_1 + this.temp[i - 16]) | 0);\n }\n var t1 = ((((((state4 >>> 6) | (state4 << 26)) ^\n ((state4 >>> 11) | (state4 << 21)) ^\n ((state4 >>> 25) | (state4 << 7))) +\n ((state4 & state5) ^ (~state4 & state6))) |\n 0) +\n ((state7 + ((constants_1.KEY[i] + this.temp[i]) | 0)) | 0)) |\n 0;\n var t2 = ((((state0 >>> 2) | (state0 << 30)) ^\n ((state0 >>> 13) | (state0 << 19)) ^\n ((state0 >>> 22) | (state0 << 10))) +\n ((state0 & state1) ^ (state0 & state2) ^ (state1 & state2))) |\n 0;\n state7 = state6;\n state6 = state5;\n state5 = state4;\n state4 = (state3 + t1) | 0;\n state3 = state2;\n state2 = state1;\n state1 = state0;\n state0 = (t1 + t2) | 0;\n }\n state[0] += state0;\n state[1] += state1;\n state[2] += state2;\n state[3] += state3;\n state[4] += state4;\n state[5] += state5;\n state[6] += state6;\n state[7] += state7;\n };\n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zdGF0ZTcgKyAoKEtFWVtpXSArIHRoaXMudGVtcFtpXSkgfCAwKSkgfCAwKSkgfFxuICAgICAgICAwO1xuXG4gICAgICBjb25zdCB0MiA9XG4gICAgICAgICgoKChzdGF0ZTAgPj4+IDIpIHwgKHN0YXRlMCA8PCAzMCkpIF5cbiAgICAgICAgICAoKHN0YXRlMCA+Pj4gMTMpIHwgKHN0YXRlMCA8PCAxOSkpIF5cbiAgICAgICAgICAoKHN0YXRlMCA+Pj4gMjIpIHwgKHN0YXRlMCA8PCAxMCkpKSArXG4gICAgICAgICAgKChzdGF0ZTAgJiBzdGF0ZTEpIF4gKHN0YXRlMCAmIHN0YXRlMikgXiAoc3RhdGUxICYgc3RhdGUyKSkpIHxcbiAgICAgICAgMDtcblxuICAgICAgc3RhdGU3ID0gc3RhdGU2O1xuICAgICAgc3RhdGU2ID0gc3RhdGU1O1xuICAgICAgc3RhdGU1ID0gc3RhdGU0O1xuICAgICAgc3RhdGU0ID0gKHN0YXRlMyArIHQxKSB8IDA7XG4gICAgICBzdGF0ZTMgPSBzdGF0ZTI7XG4gICAgICBzdGF0ZTIgPSBzdGF0ZTE7XG4gICAgICBzdGF0ZTEgPSBzdGF0ZTA7XG4gICAgICBzdGF0ZTAgPSAodDEgKyB0MikgfCAwO1xuICAgIH1cblxuICAgIHN0YXRlWzBdICs9IHN0YXRlMDtcbiAgICBzdGF0ZVsxXSArPSBzdGF0ZTE7XG4gICAgc3RhdGVbMl0gKz0gc3RhdGUyO1xuICAgIHN0YXRlWzNdICs9IHN0YXRlMztcbiAgICBzdGF0ZVs0XSArPSBzdGF0ZTQ7XG4gICAgc3RhdGVbNV0gKz0gc3RhdGU1O1xuICAgIHN0YXRlWzZdICs9IHN0YXRlNjtcbiAgICBzdGF0ZVs3XSArPSBzdGF0ZTc7XG4gIH1cbn1cbiJdfQ==","export const fromUtf8 = (input) => {\n const bytes = [];\n for (let i = 0, len = input.length; i < len; i++) {\n const value = input.charCodeAt(i);\n if (value < 0x80) {\n bytes.push(value);\n }\n else if (value < 0x800) {\n bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000);\n }\n else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\n const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111);\n bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000);\n }\n else {\n bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000);\n }\n }\n return Uint8Array.from(bytes);\n};\nexport const toUtf8 = (input) => {\n let decoded = \"\";\n for (let i = 0, len = input.length; i < len; i++) {\n const byte = input[i];\n if (byte < 0x80) {\n decoded += String.fromCharCode(byte);\n }\n else if (0b11000000 <= byte && byte < 0b11100000) {\n const nextByte = input[++i];\n decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111));\n }\n else if (0b11110000 <= byte && byte < 0b101101101) {\n const surrogatePair = [byte, input[++i], input[++i], input[++i]];\n const encoded = \"%\" + surrogatePair.map((byteValue) => byteValue.toString(16)).join(\"%\");\n decoded += decodeURIComponent(encoded);\n }\n else {\n decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111));\n }\n }\n return decoded;\n};\n","export function fromUtf8(input) {\n return new TextEncoder().encode(input);\n}\nexport function toUtf8(input) {\n return new TextDecoder(\"utf-8\").decode(input);\n}\n","import { fromUtf8 as jsFromUtf8, toUtf8 as jsToUtf8 } from \"./pureJs\";\nimport { fromUtf8 as textEncoderFromUtf8, toUtf8 as textEncoderToUtf8 } from \"./whatwgEncodingApi\";\nexport const fromUtf8 = (input) => typeof TextEncoder === \"function\" ? textEncoderFromUtf8(input) : jsFromUtf8(input);\nexport const toUtf8 = (input) => typeof TextDecoder === \"function\" ? textEncoderToUtf8(input) : jsToUtf8(input);\n","\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.convertToBuffer = void 0;\nvar util_utf8_browser_1 = require(\"@aws-sdk/util-utf8-browser\");\n// Quick polyfill\nvar fromUtf8 = typeof Buffer !== \"undefined\" && Buffer.from\n ? function (input) { return Buffer.from(input, \"utf8\"); }\n : util_utf8_browser_1.fromUtf8;\nfunction convertToBuffer(data) {\n // Already a Uint8, do nothing\n if (data instanceof Uint8Array)\n return data;\n if (typeof data === \"string\") {\n return fromUtf8(data);\n }\n if (ArrayBuffer.isView(data)) {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);\n }\n return new Uint8Array(data);\n}\nexports.convertToBuffer = convertToBuffer;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udmVydFRvQnVmZmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2NvbnZlcnRUb0J1ZmZlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsb0VBQW9FO0FBQ3BFLHNDQUFzQzs7O0FBR3RDLGdFQUF5RTtBQUV6RSxpQkFBaUI7QUFDakIsSUFBTSxRQUFRLEdBQ1osT0FBTyxNQUFNLEtBQUssV0FBVyxJQUFJLE1BQU0sQ0FBQyxJQUFJO0lBQzFDLENBQUMsQ0FBQyxVQUFDLEtBQWEsSUFBSyxPQUFBLE1BQU0sQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLE1BQU0sQ0FBQyxFQUExQixDQUEwQjtJQUMvQyxDQUFDLENBQUMsNEJBQWUsQ0FBQztBQUV0QixTQUFnQixlQUFlLENBQUMsSUFBZ0I7SUFDOUMsOEJBQThCO0lB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ZXJ0VG9CdWZmZXIoZGF0YTogU291cmNlRGF0YSk6IFVpbnQ4QXJyYXkge1xuICAvLyBBbHJlYWR5IGEgVWludDgsIGRvIG5vdGhpbmdcbiAgaWYgKGRhdGEgaW5zdGFuY2VvZiBVaW50OEFycmF5KSByZXR1cm4gZGF0YTtcblxuICBpZiAodHlwZW9mIGRhdGEgPT09IFwic3RyaW5nXCIpIHtcbiAgICByZXR1cm4gZnJvbVV0ZjgoZGF0YSk7XG4gIH1cblxuICBpZiAoQXJyYXlCdWZmZXIuaXNWaWV3KGRhdGEpKSB7XG4gICAgcmV0dXJuIG5ldyBVaW50OEFycmF5KFxuICAgICAgZGF0YS5idWZmZXIsXG4gICAgICBkYXRhLmJ5dGVPZmZzZXQsXG4gICAgICBkYXRhLmJ5dGVMZW5ndGggLyBVaW50OEFycmF5LkJZVEVTX1BFUl9FTEVNRU5UXG4gICAgKTtcbiAgfVxuXG4gIHJldHVybiBuZXcgVWludDhBcnJheShkYXRhKTtcbn1cbiJdfQ==","\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isEmptyData = void 0;\nfunction isEmptyData(data) {\n if (typeof data === \"string\") {\n return data.length === 0;\n }\n return data.byteLength === 0;\n}\nexports.isEmptyData = isEmptyData;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXNFbXB0eURhdGEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaXNFbXB0eURhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLG9FQUFvRTtBQUNwRSxzQ0FBc0M7OztBQUl0QyxTQUFnQixXQUFXLENBQUMsSUFBZ0I7SUFDMUMsSUFBSSxPQUFPLElBQUksS0FBSyxRQUFRLEVBQUU7UUFDNUIsT0FBTyxJQUFJLENBQUMsTUFBTSxLQUFLLENBQUMsQ0FBQztLQUMxQjtJQUVELE9BQU8sSUFBSSxDQUFDLFVBQVUsS0FBSyxDQUFDLENBQUM7QUFDL0IsQ0FBQztBQU5ELGtDQU1DIiwic291cmNlc0NvbnRlbnQiOlsiLy8gQ29weXJpZ2h0IEFtYXpvbi5jb20gSW5jLiBvciBpdHMgYWZmaWxpYXRlcy4gQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbi8vIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBBcGFjaGUtMi4wXG5cbmltcG9ydCB7IFNvdXJjZURhdGEgfSBmcm9tIFwiQGF3cy1zZGsvdHlwZXNcIjtcblxuZXhwb3J0IGZ1bmN0aW9uIGlzRW1wdHlEYXRhKGRhdGE6IFNvdXJjZURhdGEpOiBib29sZWFuIHtcbiAgaWYgKHR5cGVvZiBkYXRhID09PSBcInN0cmluZ1wiKSB7XG4gICAgcmV0dXJuIGRhdGEubGVuZ3RoID09PSAwO1xuICB9XG5cbiAgcmV0dXJuIGRhdGEuYnl0ZUxlbmd0aCA9PT0gMDtcbn1cbiJdfQ==","\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.numToUint8 = void 0;\nfunction numToUint8(num) {\n return new Uint8Array([\n (num & 0xff000000) >> 24,\n (num & 0x00ff0000) >> 16,\n (num & 0x0000ff00) >> 8,\n num & 0x000000ff,\n ]);\n}\nexports.numToUint8 = numToUint8;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnVtVG9VaW50OC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9udW1Ub1VpbnQ4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxvRUFBb0U7QUFDcEUsc0NBQXNDOzs7QUFFdEMsU0FBZ0IsVUFBVSxDQUFDLEdBQVc7SUFDcEMsT0FBTyxJQUFJLFVBQVUsQ0FBQztRQUNwQixDQUFDLEdBQUcsR0FBRyxVQUFVLENBQUMsSUFBSSxFQUFFO1FBQ3hCLENBQUMsR0FBRyxHQUFHLFVBQVUsQ0FBQyxJQUFJLEVBQUU7UUFDeEIsQ0FBQyxHQUFHLEdBQUcsVUFBVSxDQUFDLElBQUksQ0FBQztRQUN2QixHQUFHLEdBQUcsVUFBVTtLQUNqQixDQUFDLENBQUM7QUFDTCxDQUFDO0FBUEQsZ0NBT0MiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBDb3B5cmlnaHQgQW1hem9uLmNvbSBJbmMuIG9yIGl0cyBhZmZpbGlhdGVzLiBBbGwgUmlnaHRzIFJlc2VydmVkLlxuLy8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEFwYWNoZS0yLjBcblxuZXhwb3J0IGZ1bmN0aW9uIG51bVRvVWludDgobnVtOiBudW1iZXIpIHtcbiAgcmV0dXJuIG5ldyBVaW50OEFycmF5KFtcbiAgICAobnVtICYgMHhmZjAwMDAwMCkgPj4gMjQsXG4gICAgKG51bSAmIDB4MDBmZjAwMDApID4+IDE2LFxuICAgIChudW0gJiAweDAwMDBmZjAwKSA+PiA4LFxuICAgIG51bSAmIDB4MDAwMDAwZmYsXG4gIF0pO1xufVxuIl19","\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.uint32ArrayFrom = void 0;\n// IE 11 does not support Array.from, so we do it manually\nfunction uint32ArrayFrom(a_lookUpTable) {\n if (!Array.from) {\n var return_array = new Uint32Array(a_lookUpTable.length);\n var a_index = 0;\n while (a_index < a_lookUpTable.length) {\n return_array[a_index] = a_lookUpTable[a_index];\n }\n return return_array;\n }\n return Uint32Array.from(a_lookUpTable);\n}\nexports.uint32ArrayFrom = uint32ArrayFrom;\n//# sourceMappingURL=data:application/json;base64,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heS5mcm9tKSB7XG4gICAgY29uc3QgcmV0dXJuX2FycmF5ID0gbmV3IFVpbnQzMkFycmF5KGFfbG9va1VwVGFibGUubGVuZ3RoKVxuICAgIGxldCBhX2luZGV4ID0gMFxuICAgIHdoaWxlIChhX2luZGV4IDwgYV9sb29rVXBUYWJsZS5sZW5ndGgpIHtcbiAgICAgIHJldHVybl9hcnJheVthX2luZGV4XSA9IGFfbG9va1VwVGFibGVbYV9pbmRleF1cbiAgICB9XG4gICAgcmV0dXJuIHJldHVybl9hcnJheVxuICB9XG4gIHJldHVybiBVaW50MzJBcnJheS5mcm9tKGFfbG9va1VwVGFibGUpXG59XG4iXX0=","\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.uint32ArrayFrom = exports.numToUint8 = exports.isEmptyData = exports.convertToBuffer = void 0;\nvar convertToBuffer_1 = require(\"./convertToBuffer\");\nObject.defineProperty(exports, \"convertToBuffer\", { enumerable: true, get: function () { return convertToBuffer_1.convertToBuffer; } });\nvar isEmptyData_1 = require(\"./isEmptyData\");\nObject.defineProperty(exports, \"isEmptyData\", { enumerable: true, get: function () { return isEmptyData_1.isEmptyData; } });\nvar numToUint8_1 = require(\"./numToUint8\");\nObject.defineProperty(exports, \"numToUint8\", { enumerable: true, get: function () { return numToUint8_1.numToUint8; } });\nvar uint32ArrayFrom_1 = require(\"./uint32ArrayFrom\");\nObject.defineProperty(exports, \"uint32ArrayFrom\", { enumerable: true, get: function () { return uint32ArrayFrom_1.uint32ArrayFrom; } });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLG9FQUFvRTtBQUNwRSxzQ0FBc0M7OztBQUV0QyxxREFBb0Q7QUFBM0Msa0hBQUEsZUFBZSxPQUFBO0FBQ3hCLDZDQUE0QztBQUFuQywwR0FBQSxXQUFXLE9BQUE7QUFDcEIsMkNBQTBDO0FBQWpDLHdHQUFBLFVBQVUsT0FBQTtBQUNuQixxREFBa0Q7QUFBMUMsa0hBQUEsZUFBZSxPQUFBIiwic291cmNlc0NvbnRlbnQiOlsiLy8gQ29weXJpZ2h0IEFtYXpvbi5jb20gSW5jLiBvciBpdHMgYWZmaWxpYXRlcy4gQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbi8vIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBBcGFjaGUtMi4wXG5cbmV4cG9ydCB7IGNvbnZlcnRUb0J1ZmZlciB9IGZyb20gXCIuL2NvbnZlcnRUb0J1ZmZlclwiO1xuZXhwb3J0IHsgaXNFbXB0eURhdGEgfSBmcm9tIFwiLi9pc0VtcHR5RGF0YVwiO1xuZXhwb3J0IHsgbnVtVG9VaW50OCB9IGZyb20gXCIuL251bVRvVWludDhcIjtcbmV4cG9ydCB7dWludDMyQXJyYXlGcm9tfSBmcm9tICcuL3VpbnQzMkFycmF5RnJvbSc7XG4iXX0=","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sha256 = void 0;\nvar tslib_1 = require(\"tslib\");\nvar constants_1 = require(\"./constants\");\nvar RawSha256_1 = require(\"./RawSha256\");\nvar util_1 = require(\"@aws-crypto/util\");\nvar Sha256 = /** @class */ (function () {\n function Sha256(secret) {\n this.hash = new RawSha256_1.RawSha256();\n if (secret) {\n this.outer = new RawSha256_1.RawSha256();\n var inner = bufferFromSecret(secret);\n var outer = new Uint8Array(constants_1.BLOCK_SIZE);\n outer.set(inner);\n for (var i = 0; i < constants_1.BLOCK_SIZE; i++) {\n inner[i] ^= 0x36;\n outer[i] ^= 0x5c;\n }\n this.hash.update(inner);\n this.outer.update(outer);\n // overwrite the copied key in memory\n for (var i = 0; i < inner.byteLength; i++) {\n inner[i] = 0;\n }\n }\n }\n Sha256.prototype.update = function (toHash) {\n if ((0, util_1.isEmptyData)(toHash) || this.error) {\n return;\n }\n try {\n this.hash.update((0, util_1.convertToBuffer)(toHash));\n }\n catch (e) {\n this.error = e;\n }\n };\n /* This synchronous method keeps compatibility\n * with the v2 aws-sdk.\n */\n Sha256.prototype.digestSync = function () {\n if (this.error) {\n throw this.error;\n }\n if (this.outer) {\n if (!this.outer.finished) {\n this.outer.update(this.hash.digest());\n }\n return this.outer.digest();\n }\n return this.hash.digest();\n };\n /* The underlying digest method here is synchronous.\n * To keep the same interface with the other hash functions\n * the default is to expose this as an async method.\n * However, it can sometimes be useful to have a sync method.\n */\n Sha256.prototype.digest = function () {\n return (0, tslib_1.__awaiter)(this, void 0, void 0, function () {\n return (0, tslib_1.__generator)(this, function (_a) {\n return [2 /*return*/, this.digestSync()];\n });\n });\n };\n return Sha256;\n}());\nexports.Sha256 = Sha256;\nfunction bufferFromSecret(secret) {\n var input = (0, util_1.convertToBuffer)(secret);\n if (input.byteLength > constants_1.BLOCK_SIZE) {\n var bufferHash = new RawSha256_1.RawSha256();\n bufferHash.update(input);\n input = bufferHash.digest();\n }\n var buffer = new Uint8Array(constants_1.BLOCK_SIZE);\n buffer.set(input);\n return buffer;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoianNTaGEyNTYuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvanNTaGEyNTYudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLHlDQUF5QztBQUN6Qyx5Q0FBd0M7QUFFeEMseUNBQWdFO0FBRWhFO0lBS0UsZ0JBQVksTUFBbUI7UUFKZCxTQUFJLEdBQUcsSUFBSSxxQkFBUyxFQUFFLENBQUM7UUFLdEMsSUFBSSxNQUFNLEVBQUU7WUFDVixJQUFJLENBQUMsS0FBSyxHQUFHLElBQUkscUJBQVMsRUFBRSxDQUFDO1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RoZSB1bmRlcmx5aW5nIGRpZ2VzdCBtZXRob2QgaGVyZSBpcyBzeW5jaHJvbm91cy5cbiAgICogVG8ga2VlcCB0aGUgc2FtZSBpbnRlcmZhY2Ugd2l0aCB0aGUgb3RoZXIgaGFzaCBmdW5jdGlvbnNcbiAgICogdGhlIGRlZmF1bHQgaXMgdG8gZXhwb3NlIHRoaXMgYXMgYW4gYXN5bmMgbWV0aG9kLlxuICAgKiBIb3dldmVyLCBpdCBjYW4gc29tZXRpbWVzIGJlIHVzZWZ1bCB0byBoYXZlIGEgc3luYyBtZXRob2QuXG4gICAqL1xuICBhc3luYyBkaWdlc3QoKTogUHJvbWlzZTxVaW50OEFycmF5PiB7XG4gICAgcmV0dXJuIHRoaXMuZGlnZXN0U3luYygpO1xuICB9XG59XG5cbmZ1bmN0aW9uIGJ1ZmZlckZyb21TZWNyZXQoc2VjcmV0OiBTb3VyY2VEYXRhKTogVWludDhBcnJheSB7XG4gIGxldCBpbnB1dCA9IGNvbnZlcnRUb0J1ZmZlcihzZWNyZXQpO1xuXG4gIGlmIChpbnB1dC5ieXRlTGVuZ3RoID4gQkxPQ0tfU0laRSkge1xuICAgIGNvbnN0IGJ1ZmZlckhhc2ggPSBuZXcgUmF3U2hhMjU2KCk7XG4gICAgYnVmZmVySGFzaC51cGRhdGUoaW5wdXQpO1xuICAgIGlucHV0ID0gYnVmZmVySGFzaC5kaWdlc3QoKTtcbiAgfVxuXG4gIGNvbnN0IGJ1ZmZlciA9IG5ldyBVaW50OEFycmF5KEJMT0NLX1NJWkUpO1xuICBidWZmZXIuc2V0KGlucHV0KTtcbiAgcmV0dXJuIGJ1ZmZlcjtcbn1cbiJdfQ==","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\n(0, tslib_1.__exportStar)(require(\"./jsSha256\"), exports);\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsMERBQTJCIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSBcIi4vanNTaGEyNTZcIjtcbiJdfQ==","var SHORT_TO_HEX = {};\nvar HEX_TO_SHORT = {};\nfor (var i = 0; i < 256; i++) {\n var encodedByte = i.toString(16).toLowerCase();\n if (encodedByte.length === 1) {\n encodedByte = \"0\" + encodedByte;\n }\n SHORT_TO_HEX[i] = encodedByte;\n HEX_TO_SHORT[encodedByte] = i;\n}\n/**\n * Converts a hexadecimal encoded string to a Uint8Array of bytes.\n *\n * @param encoded The hexadecimal encoded string\n */\nexport function fromHex(encoded) {\n if (encoded.length % 2 !== 0) {\n throw new Error(\"Hex encoded strings must have an even number length\");\n }\n var out = new Uint8Array(encoded.length / 2);\n for (var i = 0; i < encoded.length; i += 2) {\n var encodedByte = encoded.substr(i, 2).toLowerCase();\n if (encodedByte in HEX_TO_SHORT) {\n out[i / 2] = HEX_TO_SHORT[encodedByte];\n }\n else {\n throw new Error(\"Cannot decode unrecognized sequence \" + encodedByte + \" as hexadecimal\");\n }\n }\n return out;\n}\n/**\n * Converts a Uint8Array of binary data to a hexadecimal encoded string.\n *\n * @param bytes The binary data to encode\n */\nexport function toHex(bytes) {\n var out = \"\";\n for (var i = 0; i < bytes.byteLength; i++) {\n out += SHORT_TO_HEX[bytes[i]];\n }\n return out;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsSUFBTSxZQUFZLEdBQThCLEVBQUUsQ0FBQztBQUNuRCxJQUFNLFlBQVksR0FBOEIsRUFBRSxDQUFDO0FBRW5ELEtBQU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cIlwiO1xuICBmb3IgKGxldCBpID0gMDsgaSA8IGJ5dGVzLmJ5dGVMZW5ndGg7IGkrKykge1xuICAgIG91dCArPSBTSE9SVF9UT19IRVhbYnl0ZXNbaV1dO1xuICB9XG5cbiAgcmV0dXJuIG91dDtcbn1cbiJdfQ==","import { __assign } from \"tslib\";\nimport { ConsoleLogger as Logger } from './Logger';\nvar logger = new Logger('Parser');\nexport var parseAWSExports = function (config) {\n var amplifyConfig = {};\n // Analytics\n if (config['aws_mobile_analytics_app_id']) {\n var Analytics = {\n AWSPinpoint: {\n appId: config['aws_mobile_analytics_app_id'],\n region: config['aws_mobile_analytics_app_region'],\n },\n };\n amplifyConfig.Analytics = Analytics;\n }\n // Auth\n if (config['aws_cognito_identity_pool_id'] || config['aws_user_pools_id']) {\n amplifyConfig.Auth = {\n userPoolId: config['aws_user_pools_id'],\n userPoolWebClientId: config['aws_user_pools_web_client_id'],\n region: config['aws_cognito_region'],\n identityPoolId: config['aws_cognito_identity_pool_id'],\n identityPoolRegion: config['aws_cognito_region'],\n mandatorySignIn: config['aws_mandatory_sign_in'] === 'enable',\n signUpVerificationMethod: config['aws_cognito_sign_up_verification_method'] || 'code',\n };\n }\n // Storage\n var storageConfig;\n if (config['aws_user_files_s3_bucket']) {\n storageConfig = {\n AWSS3: {\n bucket: config['aws_user_files_s3_bucket'],\n region: config['aws_user_files_s3_bucket_region'],\n dangerouslyConnectToHttpEndpointForTesting: config['aws_user_files_s3_dangerously_connect_to_http_endpoint_for_testing'],\n },\n };\n }\n else {\n storageConfig = config ? config.Storage || config : {};\n }\n // Logging\n if (config['Logging']) {\n amplifyConfig.Logging = __assign(__assign({}, config['Logging']), { region: config['aws_project_region'] });\n }\n // Geo\n if (config['geo']) {\n amplifyConfig.Geo = Object.assign({}, config.geo);\n if (config.geo['amazon_location_service']) {\n amplifyConfig.Geo = {\n AmazonLocationService: config.geo['amazon_location_service'],\n };\n }\n }\n amplifyConfig.Analytics = Object.assign({}, amplifyConfig.Analytics, config.Analytics);\n amplifyConfig.Auth = Object.assign({}, amplifyConfig.Auth, config.Auth);\n amplifyConfig.Storage = Object.assign({}, storageConfig);\n amplifyConfig.Logging = Object.assign({}, amplifyConfig.Logging, config.Logging);\n logger.debug('parse config', config, 'to amplifyconfig', amplifyConfig);\n return amplifyConfig;\n};\n//# sourceMappingURL=parseAWSExports.js.map","/******************************************************************************\nCopyright (c) Microsoft Corporation.\n\nPermission to use, copy, modify, and/or distribute this software for any\npurpose with or without fee is hereby granted.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\nPERFORMANCE OF THIS SOFTWARE.\n***************************************************************************** */\n/* global Reflect, Promise, SuppressedError, Symbol, Iterator */\n\nvar extendStatics = function(d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n};\n\nexport function __extends(d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\n\nexport var __assign = function() {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n }\n return __assign.apply(this, arguments);\n}\n\nexport function __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n}\n\nexport function __decorate(decorators, target, key, desc) {\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\n\nexport function __param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); }\n}\n\nexport function __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _, done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.unshift(_);\n }\n else if (_ = accept(result)) {\n if (kind === \"field\") initializers.unshift(_);\n else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n};\n\nexport function __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n};\n\nexport function __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n};\n\nexport function __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\n};\n\nexport function __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\n\nexport function __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\n\nexport function __generator(thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === \"function\" ? Iterator : Object).prototype);\n return g.next = verb(0), g[\"throw\"] = verb(1), g[\"return\"] = verb(2), typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n}\n\nexport var __createBinding = Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n});\n\nexport function __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\n\nexport function __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\n\nexport function __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n}\n\n/** @deprecated */\nexport function __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++)\n ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nexport function __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\n r[k] = a[j];\n return r;\n}\n\nexport function __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\n\nexport function __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\n\nexport function __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\n return i = Object.create((typeof AsyncIterator === \"function\" ? AsyncIterator : Object).prototype), verb(\"next\"), verb(\"throw\"), verb(\"return\", awaitReturn), i[Symbol.asyncIterator] = function () { return this; }, i;\n function awaitReturn(f) { return function (v) { return Promise.resolve(v).then(f, reject); }; }\n function verb(n, f) { if (g[n]) { i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; if (f) i[n] = f(i[n]); } }\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\n function fulfill(value) { resume(\"next\", value); }\n function reject(value) { resume(\"throw\", value); }\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\n}\n\nexport function __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\n}\n\nexport function __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator], i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\n}\n\nexport function __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\n return cooked;\n};\n\nvar __setModuleDefault = Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n};\n\nvar ownKeys = function(o) {\n ownKeys = Object.getOwnPropertyNames || function (o) {\n var ar = [];\n for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;\n return ar;\n };\n return ownKeys(o);\n};\n\nexport function __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== \"default\") __createBinding(result, mod, k[i]);\n __setModuleDefault(result, mod);\n return result;\n}\n\nexport function __importDefault(mod) {\n return (mod && mod.__esModule) ? mod : { default: mod };\n}\n\nexport function __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\n\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\n}\n\nexport function __classPrivateFieldIn(state, receiver) {\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\nexport function __addDisposableResource(env, value, async) {\n if (value !== null && value !== void 0) {\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\n var dispose, inner;\n if (async) {\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\n dispose = value[Symbol.asyncDispose];\n }\n if (dispose === void 0) {\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\n dispose = value[Symbol.dispose];\n if (async) inner = dispose;\n }\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\n if (inner) dispose = function() { try { inner.call(this); } catch (e) { return Promise.reject(e); } };\n env.stack.push({ value: value, dispose: dispose, async: async });\n }\n else if (async) {\n env.stack.push({ async: true });\n }\n return value;\n}\n\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\n var e = new Error(message);\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\n};\n\nexport function __disposeResources(env) {\n function fail(e) {\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\n env.hasError = true;\n }\n var r, s = 0;\n function next() {\n while (r = env.stack.pop()) {\n try {\n if (!r.async && s === 1) return s = 0, env.stack.push(r), Promise.resolve().then(next);\n if (r.dispose) {\n var result = r.dispose.call(r.value);\n if (r.async) return s |= 2, Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\n }\n else s |= 1;\n }\n catch (e) {\n fail(e);\n }\n }\n if (s === 1) return env.hasError ? Promise.reject(env.error) : Promise.resolve();\n if (env.hasError) throw env.error;\n }\n return next();\n}\n\nexport function __rewriteRelativeImportExtension(path, preserveJsx) {\n if (typeof path === \"string\" && /^\\.\\.?\\//.test(path)) {\n return path.replace(/\\.(tsx)$|((?:\\.d)?)((?:\\.[^./]+?)?)\\.([cm]?)ts$/i, function (m, tsx, d, ext, cm) {\n return tsx ? preserveJsx ? \".jsx\" : \".js\" : d && (!ext || !cm) ? m : (d + ext + \".\" + cm.toLowerCase() + \"js\");\n });\n }\n return path;\n}\n\nexport default {\n __extends,\n __assign,\n __rest,\n __decorate,\n __param,\n __esDecorate,\n __runInitializers,\n __propKey,\n __setFunctionName,\n __metadata,\n __awaiter,\n __generator,\n __createBinding,\n __exportStar,\n __values,\n __read,\n __spread,\n __spreadArrays,\n __spreadArray,\n __await,\n __asyncGenerator,\n __asyncDelegator,\n __asyncValues,\n __makeTemplateObject,\n __importStar,\n __importDefault,\n __classPrivateFieldGet,\n __classPrivateFieldSet,\n __classPrivateFieldIn,\n __addDisposableResource,\n __disposeResources,\n __rewriteRelativeImportExtension,\n};\n","/**\n * Converts a JS string from its native UCS-2/UTF-16 representation into a\n * Uint8Array of the bytes used to represent the equivalent characters in UTF-8.\n *\n * Cribbed from the `goog.crypt.stringToUtf8ByteArray` function in the Google\n * Closure library, though updated to use typed arrays.\n */\nexport var fromUtf8 = function (input) {\n var bytes = [];\n for (var i = 0, len = input.length; i < len; i++) {\n var value = input.charCodeAt(i);\n if (value < 0x80) {\n bytes.push(value);\n }\n else if (value < 0x800) {\n bytes.push((value >> 6) | 192, (value & 63) | 128);\n }\n else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\n var surrogatePair = 0x10000 + ((value & 1023) << 10) + (input.charCodeAt(++i) & 1023);\n bytes.push((surrogatePair >> 18) | 240, ((surrogatePair >> 12) & 63) | 128, ((surrogatePair >> 6) & 63) | 128, (surrogatePair & 63) | 128);\n }\n else {\n bytes.push((value >> 12) | 224, ((value >> 6) & 63) | 128, (value & 63) | 128);\n }\n }\n return Uint8Array.from(bytes);\n};\n/**\n * Converts a typed array of bytes containing UTF-8 data into a native JS\n * string.\n *\n * Partly cribbed from the `goog.crypt.utf8ByteArrayToString` function in the\n * Google Closure library, though updated to use typed arrays and to better\n * handle astral plane code points.\n */\nexport var toUtf8 = function (input) {\n var decoded = \"\";\n for (var i = 0, len = input.length; i < len; i++) {\n var byte = input[i];\n if (byte < 0x80) {\n decoded += String.fromCharCode(byte);\n }\n else if (192 <= byte && byte < 224) {\n var nextByte = input[++i];\n decoded += String.fromCharCode(((byte & 31) << 6) | (nextByte & 63));\n }\n else if (240 <= byte && byte < 365) {\n var surrogatePair = [byte, input[++i], input[++i], input[++i]];\n var encoded = \"%\" + surrogatePair.map(function (byteValue) { return byteValue.toString(16); }).join(\"%\");\n decoded += decodeURIComponent(encoded);\n }\n else {\n decoded += String.fromCharCode(((byte & 15) << 12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lucHV0WysraV0sIGlucHV0WysraV1dO1xuICAgICAgY29uc3QgZW5jb2RlZCA9IFwiJVwiICsgc3Vycm9nYXRlUGFpci5tYXAoKGJ5dGVWYWx1ZSkgPT4gYnl0ZVZhbHVlLnRvU3RyaW5nKDE2KSkuam9pbihcIiVcIik7XG4gICAgICBkZWNvZGVkICs9IGRlY29kZVVSSUNvbXBvbmVudChlbmNvZGVkKTtcbiAgICB9IGVsc2Uge1xuICAgICAgZGVjb2RlZCArPSBTdHJpbmcuZnJvbUNoYXJDb2RlKFxuICAgICAgICAoKGJ5dGUgJiAwYjExMTEpIDw8IDEyKSB8ICgoaW5wdXRbKytpXSAmIDBiMTExMTExKSA8PCA2KSB8IChpbnB1dFsrK2ldICYgMGIxMTExMTEpXG4gICAgICApO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiBkZWNvZGVkO1xufTtcbiJdfQ==","export function fromUtf8(input) {\n return new TextEncoder().encode(input);\n}\nexport function toUtf8(input) {\n return new TextDecoder(\"utf-8\").decode(input);\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2hhdHdnRW5jb2RpbmdBcGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvd2hhdHdnRW5jb2RpbmdBcGkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBeUNBLE1BQU0sVUFBVSxRQUFRLENBQUMsS0FBYTtJQUNwQyxPQUFPLElBQUksV0FBVyxFQUFFLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBQ3pDLENBQUM7QUFFRCxNQUFNLFVBQVUsTUFBTSxDQUFDLEtBQWlCO0lBQ3RDLE9BQU8sSUFBSSxXQUFXLENBQUMsT0FBTyxDQUFDLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxDQUFDO0FBQ2hELENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyIvKipcbiAqIEEgZGVjbG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leHRFbmNvZGVyQ29uc3RydWN0b3Ige1xuICAgIG5ldyAoKTogVGV4dEVuY29kZXI7XG4gIH1cbn1cblxuZGVjbGFyZSBjb25zdCBUZXh0RGVjb2RlcjogRW5jb2RpbmcuVGV4dERlY29kZXJDb25zdHJ1Y3RvcjtcblxuZGVjbGFyZSBjb25zdCBUZXh0RW5jb2RlcjogRW5jb2RpbmcuVGV4dEVuY29kZXJDb25zdHJ1Y3RvcjtcblxuZXhwb3J0IGZ1bmN0aW9uIGZyb21VdGY4KGlucHV0OiBzdHJpbmcpOiBVaW50OEFycmF5IHtcbiAgcmV0dXJuIG5ldyBUZXh0RW5jb2RlcigpLmVuY29kZShpbnB1dCk7XG59XG5cbmV4cG9ydCBmdW5jdGlvbiB0b1V0ZjgoaW5wdXQ6IFVpbnQ4QXJyYXkpOiBzdHJpbmcge1xuICByZXR1cm4gbmV3IFRleHREZWNvZGVyKFwidXRmLThcIikuZGVjb2RlKGlucHV0KTtcbn1cbiJdfQ==","import { fromUtf8 as jsFromUtf8, toUtf8 as jsToUtf8 } from \"./pureJs\";\nimport { fromUtf8 as textEncoderFromUtf8, toUtf8 as textEncoderToUtf8 } from \"./whatwgEncodingApi\";\nexport var fromUtf8 = function (input) {\n return typeof TextEncoder === \"function\" ? textEncoderFromUtf8(input) : jsFromUtf8(input);\n};\nexport var toUtf8 = function (input) {\n return typeof TextDecoder === \"function\" ? textEncoderToUtf8(input) : jsToUtf8(input);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLFFBQVEsSUFBSSxVQUFVLEVBQUUsTUFBTSxJQUFJLFFBQVEsRUFBRSxNQUFNLFVBQVUsQ0FBQztBQUN0RSxPQUFPLEVBQUUsUUFBUSxJQUF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5wdXQpIDoganNGcm9tVXRmOChpbnB1dCk7XG5cbmV4cG9ydCBjb25zdCB0b1V0ZjggPSAoaW5wdXQ6IFVpbnQ4QXJyYXkpOiBzdHJpbmcgPT5cbiAgdHlwZW9mIFRleHREZWNvZGVyID09PSBcImZ1bmN0aW9uXCIgPyB0ZXh0RW5jb2RlclRvVXRmOChpbnB1dCkgOiBqc1RvVXRmOChpbnB1dCk7XG4iXX0=","const fallbackWindow = {};\nexport function locateWindow() {\n if (typeof window !== \"undefined\") {\n return window;\n }\n else if (typeof self !== \"undefined\") {\n return self;\n }\n return fallbackWindow;\n}\n","/*! *****************************************************************************\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","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=CryptoOperation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=Key.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=KeyOperation.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=MsSubtleCrypto.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isMsWindow = void 0;\nvar msSubtleCryptoMethods = [\n \"decrypt\",\n \"digest\",\n \"encrypt\",\n \"exportKey\",\n \"generateKey\",\n \"importKey\",\n \"sign\",\n \"verify\"\n];\nfunction quacksLikeAnMsWindow(window) {\n return \"MSInputMethodContext\" in window && \"msCrypto\" in window;\n}\n/**\n * Determines if the provided window is (or is like) the window object one would\n * expect to encounter in Internet Explorer 11.\n */\nfunction isMsWindow(window) {\n if (quacksLikeAnMsWindow(window) && window.msCrypto.subtle !== undefined) {\n var _a = window.msCrypto, getRandomValues = _a.getRandomValues, subtle_1 = _a.subtle;\n return msSubtleCryptoMethods\n .map(function (methodName) { return subtle_1[methodName]; })\n .concat(getRandomValues)\n .every(function (method) { return typeof method === \"function\"; });\n }\n return false;\n}\nexports.isMsWindow = isMsWindow;\n//# sourceMappingURL=MsWindow.js.map","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./CryptoOperation\"), exports);\ntslib_1.__exportStar(require(\"./Key\"), exports);\ntslib_1.__exportStar(require(\"./KeyOperation\"), exports);\ntslib_1.__exportStar(require(\"./MsSubtleCrypto\"), exports);\ntslib_1.__exportStar(require(\"./MsWindow\"), exports);\n//# sourceMappingURL=index.js.map","/*! *****************************************************************************\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","var HttpResponse = /** @class */ (function () {\n function HttpResponse(options) {\n this.statusCode = options.statusCode;\n this.headers = options.headers || {};\n this.body = options.body;\n }\n HttpResponse.isInstance = function (response) {\n //determine if response is a valid HttpResponse\n if (!response)\n return false;\n var resp = response;\n return typeof resp.statusCode === \"number\" && typeof resp.headers === \"object\";\n };\n return HttpResponse;\n}());\nexport { HttpResponse };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHR0cFJlc3BvbnNlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2h0dHBSZXNwb25zZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFRQTtJQUtFLHNCQUFZLE9BQTRCO1FBQ3RDLElBQUksQ0FBQyxVQUFVLEdBQUcsT0FBTyxDQUFDLFVBQVUsQ0FBQztRQUNyQyxJQUFJLENBQUMsT0FBTyxHQUFHLE9BQU8sQ0FBQyxPQUFPLElBQUksRUFBRSxDQUFDO1FBQ3JDLElBQUksQ0FBQyxJQUFJLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQztJQUMzQixDQUFDO0lBRU0sdUJBQVUsR0FBakIsVUFBa0IsUUFBaUI7UUFDakMsK0NBQStDO1FBQy9DLElBQUksQ0FBQyxRQUFRO1lBQUUsT0FBTyxLQUFLLENBQUM7UUFDNUIsSUFBTSxJQUFJLEdBQUcsUUFBZSxDQUFDO1FBQzdCLE9BQU8sT0FBTyxJQUFJLENBQUMsVUFBVSxLQUFLLFFBQVEsSUFBSSxPQUFPLElBQUksQ0FBQyxPQUFPLEtBQUssUUFBUSxDQUFDO0lBQ2pGLENBQUM7SUFDSCxtQkFBQztBQUFELENBQUMsQUFqQkQsSUFpQkMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBIZWFkZXJCYWcsIEh0dHBNZXNzYWdlLCBIdHRwUmVzcG9uc2UgYXMgSUh0dHBSZXNwb25zZSB9IGZyb20gXCJAYXdzLXNkay90eXBlc1wiO1xuXG50eXBlIEh0dHBSZXNwb25zZU9wdGlvbnMgPSBQYXJ0aWFsPEh0dHBNZXNzYWdlPiAmIHtcbiAgc3RhdHVzQ29kZTogbnVtYmVyO1xufTtcblxuZXhwb3J0IGludGVyZmFjZSBIdHRwUmVzcG9uc2UgZXh0ZW5kcyBJSHR0cFJlc3BvbnNlIHt9XG5cbmV4cG9ydCBjbGFzcyBIdHRwUmVzcG9uc2Uge1xuICBwdWJsaWMgc3RhdHVzQ29kZTogbnVtYmVyO1xuICBwdWJsaWMgaGVhZGVyczogSGVhZGVyQmFnO1xuICBwdWJsaWMgYm9keT86IGFueTtcblxuICBjb25zdHJ1Y3RvcihvcHRpb25zOiBIdHRwUmVzcG9uc2VPcHRpb25zKSB7XG4gICAgdGhpcy5zdGF0dXNDb2RlID0gb3B0aW9ucy5zdGF0dXNDb2RlO1xuICAgIHRoaXMuaGVhZGVycyA9IG9wdGlvbnMuaGVhZGVycyB8fCB7fTtcbiAgICB0aGlzLmJvZHkgPSBvcHRpb25zLmJvZHk7XG4gIH1cblxuICBzdGF0aWMgaXNJbnN0YW5jZShyZXNwb25zZTogdW5rbm93bik6IHJlc3BvbnNlIGlzIEh0dHBSZXNwb25zZSB7XG4gICAgLy9kZXRlcm1pbmUgaWYgcmVzcG9uc2UgaXMgYSB2YWxpZCBIdHRwUmVzcG9uc2VcbiAgICBpZiAoIXJlc3BvbnNlKSByZXR1cm4gZmFsc2U7XG4gICAgY29uc3QgcmVzcCA9IHJlc3BvbnNlIGFzIGFueTtcbiAgICByZXR1cm4gdHlwZW9mIHJlc3Auc3RhdHVzQ29kZSA9PT0gXCJudW1iZXJcIiAmJiB0eXBlb2YgcmVzcC5oZWFkZXJzID09PSBcIm9iamVjdFwiO1xuICB9XG59XG4iXX0=","/*! *****************************************************************************\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","import { __assign, __read, __spread } from \"tslib\";\nvar HttpRequest = /** @class */ (function () {\n function HttpRequest(options) {\n this.method = options.method || \"GET\";\n this.hostname = options.hostname || \"localhost\";\n this.port = options.port;\n this.query = options.query || {};\n this.headers = options.headers || {};\n this.body = options.body;\n this.protocol = options.protocol\n ? options.protocol.substr(-1) !== \":\"\n ? options.protocol + \":\"\n : options.protocol\n : \"https:\";\n this.path = options.path ? (options.path.charAt(0) !== \"/\" ? \"/\" + options.path : options.path) : \"/\";\n }\n HttpRequest.isInstance = function (request) {\n //determine if request is a valid httpRequest\n if (!request)\n return false;\n var req = request;\n return (\"method\" in req &&\n \"protocol\" in req &&\n \"hostname\" in req &&\n \"path\" in req &&\n typeof req[\"query\"] === \"object\" &&\n typeof req[\"headers\"] === \"object\");\n };\n HttpRequest.prototype.clone = function () {\n var cloned = new HttpRequest(__assign(__assign({}, this), { headers: __assign({}, this.headers) }));\n if (cloned.query)\n cloned.query = cloneQuery(cloned.query);\n return cloned;\n };\n return HttpRequest;\n}());\nexport { HttpRequest };\nfunction cloneQuery(query) {\n return Object.keys(query).reduce(function (carry, paramName) {\n var _a;\n var param = query[paramName];\n return __assign(__assign({}, carry), (_a = {}, _a[paramName] = Array.isArray(param) ? __spread(param) : param, _a));\n }, {});\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaHR0cFJlcXVlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaHR0cFJlcXVlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQU1BO0lBVUUscUJBQVksT0FBMkI7UUFDckMsSUFBSSxDQUFDLE1BQU0sR0FBRyxPQUFPLENBQUMsTUFBTSxJQUFJLEtBQUssQ0FBQztRQUN0QyxJQUFJLENBQUMsUUFBUSxHQUFHLE9BQU8sQ0FBQyxRQUFRLElBQUksV0FBVyxDQUFDO1FBQ2hELElBQUksQ0FBQyxJQUFJLEdBQUcsT0FBTyxDQUFDLElBQUksQ0FBQztRQUN6QixJQUFJLENBQUMsS0FBSyxHQUFHLE9BQU8sQ0FBQyxLQUFLLElBQUksRUFBRSxDQUFDO1FBQ2pDLElBQUksQ0FBQyxPQUFPLEdBQUcsT0FBTyxDQUFDLE9BQU8sSUFBSSxFQUFFLENBQUM7UUFDckMsSUFBSSxDQUFDL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WVyeSkucmVkdWNlKChjYXJyeTogUXVlcnlQYXJhbWV0ZXJCYWcsIHBhcmFtTmFtZTogc3RyaW5nKSA9PiB7XG4gICAgY29uc3QgcGFyYW0gPSBxdWVyeVtwYXJhbU5hbWVdO1xuICAgIHJldHVybiB7XG4gICAgICAuLi5jYXJyeSxcbiAgICAgIFtwYXJhbU5hbWVdOiBBcnJheS5pc0FycmF5KHBhcmFtKSA/IFsuLi5wYXJhbV0gOiBwYXJhbSxcbiAgICB9O1xuICB9LCB7fSk7XG59XG4iXX0=","/*! *****************************************************************************\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","export var escapeUri = function (uri) {\n // AWS percent-encodes some extra non-standard characters in a URI\n return encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);\n};\nvar hexEncode = function (c) { return \"%\" + c.charCodeAt(0).toString(16).toUpperCase(); };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXNjYXBlLXVyaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lc2NhcGUtdXJpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBQyxJQUFNLFNBQVMsR0FBRyxVQUFDLEdBQVc7SUFDbkMsa0VBQWtFO0lBQ2xFLE9BQUEsa0JBQWtCLENBQUMsR0FBRyxDQUFDLENBQUMsT0FBTyxDQUFDLFVBQVUsRUFBRSxTQUFTLENBQUM7QUFBdEQsQ0FBc0QsQ0FBQztBQUV6RCxJQUFNLFNBQVMsR0FBRyxVQUFDLENBQVMsSUFBSyxPQUFBLE1BQUksQ0FBQyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUMsRUFBRSxDQUFDLENBQUMsV0FBVyxFQUFJLEVBQWhELENBQWdELENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgZXNjYXBlVXJpID0gKHVyaTogc3RyaW5nKTogc3RyaW5nID0+XG4gIC8vIEFXUyBwZXJjZW50LWVuY29kZXMgc29tZSBleHRyYSBub24tc3RhbmRhcmQgY2hhcmFjdGVycyBpbiBhIFVSSVxuICBlbmNvZGVVUklDb21wb25lbnQodXJpKS5yZXBsYWNlKC9bIScoKSpdL2csIGhleEVuY29kZSk7XG5cbmNvbnN0IGhleEVuY29kZSA9IChjOiBzdHJpbmcpID0+IGAlJHtjLmNoYXJDb2RlQXQoMCkudG9TdHJpbmcoMTYpLnRvVXBwZXJDYXNlKCl9YDtcbiJdfQ==","import { __values } from \"tslib\";\nimport { escapeUri } from \"@aws-sdk/util-uri-escape\";\nexport function buildQueryString(query) {\n var e_1, _a;\n var parts = [];\n try {\n for (var _b = __values(Object.keys(query).sort()), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n var value = query[key];\n key = escapeUri(key);\n if (Array.isArray(value)) {\n for (var i = 0, iLen = value.length; i < iLen; i++) {\n parts.push(key + \"=\" + escapeUri(value[i]));\n }\n }\n else {\n var qsEntry = key;\n if (value || typeof value === \"string\") {\n qsEntry += \"=\" + escapeUri(value);\n }\n parts.push(qsEntry);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return parts.join(\"&\");\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUVyRCxNQUFNLFVBQVUsZ0JBQWdCLENBQUMsS0FBd0I7O0lBQ3ZELElBQU0sS0FBSyxHQUFhLEVBQUUsQ0FBQzs7UUFDM0IsS0FBZ0IsSUFBQSxLQUFBLFNBQUEsTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQyxJQUFJLEVBQUUsQ0FBQSxnQkFBQSw0QkFBRTtZQUF0QyxJQUFJLEdBQUcsV0FBQTt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IHN0cmluZyB7XG4gIGNvbnN0IHBhcnRzOiBzdHJpbmdbXSA9IFtdO1xuICBmb3IgKGxldCBrZXkgb2YgT2JqZWN0LmtleXMocXVlcnkpLnNvcnQoKSkge1xuICAgIGNvbnN0IHZhbHVlID0gcXVlcnlba2V5XTtcbiAgICBrZXkgPSBlc2NhcGVVcmkoa2V5KTtcbiAgICBpZiAoQXJyYXkuaXNBcnJheSh2YWx1ZSkpIHtcbiAgICAgIGZvciAobGV0IGkgPSAwLCBpTGVuID0gdmFsdWUubGVuZ3RoOyBpIDwgaUxlbjsgaSsrKSB7XG4gICAgICAgIHBhcnRzLnB1c2goYCR7a2V5fT0ke2VzY2FwZVVyaSh2YWx1ZVtpXSl9YCk7XG4gICAgICB9XG4gICAgfSBlbHNlIHtcbiAgICAgIGxldCBxc0VudHJ5ID0ga2V5O1xuICAgICAgaWYgKHZhbHVlIHx8IHR5cGVvZiB2YWx1ZSA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgICBxc0VudHJ5ICs9IGA9JHtlc2NhcGVVcmkodmFsdWUpfWA7XG4gICAgICB9XG4gICAgICBwYXJ0cy5wdXNoKHFzRW50cnkpO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiBwYXJ0cy5qb2luKFwiJlwiKTtcbn1cbiJdfQ==","export function requestTimeout(timeoutInMs) {\n if (timeoutInMs === void 0) { timeoutInMs = 0; }\n return new Promise(function (resolve, reject) {\n if (timeoutInMs) {\n setTimeout(function () {\n var timeoutError = new Error(\"Request did not complete within \" + timeoutInMs + \" ms\");\n timeoutError.name = \"TimeoutError\";\n reject(timeoutError);\n }, timeoutInMs);\n }\n });\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVxdWVzdC10aW1lb3V0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3JlcXVlc3QtdGltZW91dC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLFVBQVUsY0FBYyxDQUFDLFdBQWU7SUFBZiw0QkFBQSxFQUFBLGVBQWU7SUFDNUMsT0FBTyxJQUFJLE9BQU8sQ0FBQyxVQUFDLE9BQU8sRUFBRSxNQUFNO1FBQ2pDLElBQUksV0FBVyxFQUFFO1lBQ2YsVUFBVSxDQUFDO2dCQUNULElBQU0sWUFBWSxHQUFHLElBQUksS0FBSyxDQUFDLHFDQUFtQyxXQUFXLFFBQUssQ0FBQyxDQUFDO2dCQUNwRixZQUFZLENBQUMsSUFBSSxHQUFHLGNBQWMsQ0FBQztnQkFDbkMsTUFBTSxDQUFDLFlBQVksQ0FBQyxDQUFDO1lBQ3ZCLENBQUMsRUFBRSxXQUFXLENBQUMsQ0FBQztTQUNqQjtJQUNILENBQUMsQ0FBQyxDQUFDO0FBQ0wsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBmdW5jdGlvbiByZXF1ZXN0VGltZW91dCh0aW1lb3V0SW5NcyA9IDApOiBQcm9taXNlPG5ldmVyPiB7XG4gIHJldHVybiBuZXcgUHJvbWlzZSgocmVzb2x2ZSwgcmVqZWN0KSA9PiB7XG4gICAgaWYgKHRpbWVvdXRJbk1zKSB7XG4gICAgICBzZXRUaW1lb3V0KCgpID0+IHtcbiAgICAgICAgY29uc3QgdGltZW91dEVycm9yID0gbmV3IEVycm9yKGBSZXF1ZXN0IGRpZCBub3QgY29tcGxldGUgd2l0aGluICR7dGltZW91dEluTXN9IG1zYCk7XG4gICAgICAgIHRpbWVvdXRFcnJvci5uYW1lID0gXCJUaW1lb3V0RXJyb3JcIjtcbiAgICAgICAgcmVqZWN0KHRpbWVvdXRFcnJvcik7XG4gICAgICB9LCB0aW1lb3V0SW5Ncyk7XG4gICAgfVxuICB9KTtcbn1cbiJdfQ==","import { __values } from \"tslib\";\nimport { HttpResponse } from \"@aws-sdk/protocol-http\";\nimport { buildQueryString } from \"@aws-sdk/querystring-builder\";\nimport { requestTimeout } from \"./request-timeout\";\nvar FetchHttpHandler = /** @class */ (function () {\n function FetchHttpHandler(_a) {\n var _b = _a === void 0 ? {} : _a, requestTimeout = _b.requestTimeout;\n this.requestTimeout = requestTimeout;\n }\n FetchHttpHandler.prototype.destroy = function () {\n // Do nothing. TLS and HTTP/2 connection pooling is handled by the browser.\n };\n FetchHttpHandler.prototype.handle = function (request, _a) {\n var _b = _a === void 0 ? {} : _a, abortSignal = _b.abortSignal;\n var requestTimeoutInMs = this.requestTimeout;\n // if the request was already aborted, prevent doing extra work\n if (abortSignal === null || abortSignal === void 0 ? void 0 : abortSignal.aborted) {\n var abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n return Promise.reject(abortError);\n }\n var path = request.path;\n if (request.query) {\n var queryString = buildQueryString(request.query);\n if (queryString) {\n path += \"?\" + queryString;\n }\n }\n var port = request.port, method = request.method;\n var url = request.protocol + \"//\" + request.hostname + (port ? \":\" + port : \"\") + path;\n // Request constructor doesn't allow GET/HEAD request with body\n // ref: https://github.com/whatwg/fetch/issues/551\n var body = method === \"GET\" || method === \"HEAD\" ? undefined : request.body;\n var requestOptions = {\n body: body,\n headers: new Headers(request.headers),\n method: method,\n };\n // some browsers support abort signal\n if (typeof AbortController !== \"undefined\") {\n requestOptions[\"signal\"] = abortSignal;\n }\n var fetchRequest = new Request(url, requestOptions);\n var raceOfPromises = [\n fetch(fetchRequest).then(function (response) {\n var e_1, _a;\n var fetchHeaders = response.headers;\n var transformedHeaders = {};\n try {\n for (var _b = __values(fetchHeaders.entries()), _c = _b.next(); !_c.done; _c = _b.next()) {\n var pair = _c.value;\n transformedHeaders[pair[0]] = pair[1];\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n var hasReadableStream = response.body !== undefined;\n // Return the response with buffered body\n if (!hasReadableStream) {\n return response.blob().then(function (body) { return ({\n response: new HttpResponse({\n headers: transformedHeaders,\n statusCode: response.status,\n body: body,\n }),\n }); });\n }\n // Return the response with streaming body\n return {\n response: new HttpResponse({\n headers: transformedHeaders,\n statusCode: response.status,\n body: response.body,\n }),\n };\n }),\n requestTimeout(requestTimeoutInMs),\n ];\n if (abortSignal) {\n raceOfPromises.push(new Promise(function (resolve, reject) {\n abortSignal.onabort = function () {\n var abortError = new Error(\"Request aborted\");\n abortError.name = \"AbortError\";\n reject(abortError);\n };\n }));\n }\n return Promise.race(raceOfPromises);\n };\n return FetchHttpHandler;\n}());\nexport { FetchHttpHandler };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmV0Y2gtaHR0cC1oYW5kbGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ZldGNoLWh0dHAtaGFuZGxlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUE0QixZQUFZLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUNoRixPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSw4QkFBOEIsQ0FBQztBQUdoRSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFlbkQ7SUFHRSwwQkFBWSxFQUFnRDtZQUFoRCxxQkFBOEMsRUFBRSxLQUFBLEVBQTlDLGNBQWMsb0JBQUE7UUFDMUIsSUFBSSxDQUFDLGNBQWMsR0FBRyxjQUFjLENBQUM7SUFDdkMsQ0FBQztJQUVELGtDQUFPLEdBQVA7UUFDRSwyRUFBMkU7SUFDN0UsQ0FBQztJQUVELGlDQUFNLEdBQU4sVUFBTyxPQUFvQixFQUFFLEVBQXdDO1lBQXhDLHFCQUFzQyxFQUFFLEtBQUEsRUFBdEMsV0FBVyxpQkFBQTtRQUN4QyxJQUFNLGtCQUFrQixHQUFHLElBQUksQ0FBQyxjQUFjLENBQUM7UUFFL0MsK0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7XG4gICAgICAgICAgYWJvcnRTaWduYWwub25hYm9ydCA9ICgpID0+IHtcbiAgICAgICAgICAgIGNvbnN0IGFib3J0RXJyb3IgPSBuZXcgRXJyb3IoXCJSZXF1ZXN0IGFib3J0ZWRcIik7XG4gICAgICAgICAgICBhYm9ydEVycm9yLm5hbWUgPSBcIkFib3J0RXJyb3JcIjtcbiAgICAgICAgICAgIHJlamVjdChhYm9ydEVycm9yKTtcbiAgICAgICAgICB9O1xuICAgICAgICB9KVxuICAgICAgKTtcbiAgICB9XG4gICAgcmV0dXJuIFByb21pc2UucmFjZShyYWNlT2ZQcm9taXNlcyk7XG4gIH1cbn1cbiJdfQ==","var alphabetByEncoding = {};\nvar alphabetByValue = new Array(64);\nfor (var i = 0, start = \"A\".charCodeAt(0), limit = \"Z\".charCodeAt(0); i + start <= limit; i++) {\n var char = String.fromCharCode(i + start);\n alphabetByEncoding[char] = i;\n alphabetByValue[i] = char;\n}\nfor (var i = 0, start = \"a\".charCodeAt(0), limit = \"z\".charCodeAt(0); i + start <= limit; i++) {\n var char = String.fromCharCode(i + start);\n var index = i + 26;\n alphabetByEncoding[char] = index;\n alphabetByValue[index] = char;\n}\nfor (var i = 0; i < 10; i++) {\n alphabetByEncoding[i.toString(10)] = i + 52;\n var char = i.toString(10);\n var index = i + 52;\n alphabetByEncoding[char] = index;\n alphabetByValue[index] = char;\n}\nalphabetByEncoding[\"+\"] = 62;\nalphabetByValue[62] = \"+\";\nalphabetByEncoding[\"/\"] = 63;\nalphabetByValue[63] = \"/\";\nvar bitsPerLetter = 6;\nvar bitsPerByte = 8;\nvar maxLetterValue = 63;\n/**\n * Converts a base-64 encoded string to a Uint8Array of bytes.\n *\n * @param input The base-64 encoded string\n *\n * @see https://tools.ietf.org/html/rfc4648#section-4\n */\nexport function fromBase64(input) {\n var totalByteLength = (input.length / 4) * 3;\n if (input.substr(-2) === \"==\") {\n totalByteLength -= 2;\n }\n else if (input.substr(-1) === \"=\") {\n totalByteLength--;\n }\n var out = new ArrayBuffer(totalByteLength);\n var dataView = new DataView(out);\n for (var i = 0; i < input.length; i += 4) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = i + 3; j <= limit; j++) {\n if (input[j] !== \"=\") {\n bits |= alphabetByEncoding[input[j]] << ((limit - j) * bitsPerLetter);\n bitLength += bitsPerLetter;\n }\n else {\n bits >>= bitsPerLetter;\n }\n }\n var chunkOffset = (i / 4) * 3;\n bits >>= bitLength % bitsPerByte;\n var byteLength = Math.floor(bitLength / bitsPerByte);\n for (var k = 0; k < byteLength; k++) {\n var offset = (byteLength - k - 1) * bitsPerByte;\n dataView.setUint8(chunkOffset + k, (bits & (255 << offset)) >> offset);\n }\n }\n return new Uint8Array(out);\n}\n/**\n * Converts a Uint8Array of binary data to a base-64 encoded string.\n *\n * @param input The binary data to encode\n *\n * @see https://tools.ietf.org/html/rfc4648#section-4\n */\nexport function toBase64(input) {\n var str = \"\";\n for (var i = 0; i < input.length; i += 3) {\n var bits = 0;\n var bitLength = 0;\n for (var j = i, limit = Math.min(i + 3, input.length); j < limit; j++) {\n bits |= input[j] << ((limit - j - 1) * bitsPerByte);\n bitLength += bitsPerByte;\n }\n var bitClusterCount = Math.ceil(bitLength / bitsPerLetter);\n bits <<= bitClusterCount * bitsPerLetter - bitLength;\n for (var k = 1; k <= bitClusterCount; k++) {\n var offset = (bitClusterCount - k) * bitsPerLetter;\n str += alphabetByValue[(bits & (maxLetterValue << offset)) >> offset];\n }\n str += \"==\".slice(0, 4 - bitClusterCount);\n }\n return str;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsSUFBTSxrQkFBa0IsR0FBOEIsRUFBRSxDQUFDO0FBQ3pELElBQU0sZUFBZSxHQUFrQixJQUFJLEtBQUss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HNQZXJCeXRlO1xuICAgIH1cblxuICAgIGNvbnN0IGJpdENsdXN0ZXJDb3VudCA9IE1hdGguY2VpbChiaXRMZW5ndGggLyBiaXRzUGVyTGV0dGVyKTtcbiAgICBiaXRzIDw8PSBiaXRDbHVzdGVyQ291bnQgKiBiaXRzUGVyTGV0dGVyIC0gYml0TGVuZ3RoO1xuICAgIGZvciAobGV0IGsgPSAxOyBrIDw9IGJpdENsdXN0ZXJDb3VudDsgaysrKSB7XG4gICAgICBjb25zdCBvZmZzZXQgPSAoYml0Q2x1c3RlckNvdW50IC0gaykgKiBiaXRzUGVyTGV0dGVyO1xuICAgICAgc3RyICs9IGFscGhhYmV0QnlWYWx1ZVsoYml0cyAmIChtYXhMZXR0ZXJWYWx1ZSA8PCBvZmZzZXQpKSA+PiBvZmZzZXRdO1xuICAgIH1cblxuICAgIHN0ciArPSBcIj09XCIuc2xpY2UoMCwgNCAtIGJpdENsdXN0ZXJDb3VudCk7XG4gIH1cblxuICByZXR1cm4gc3RyO1xufVxuIl19","import { __awaiter, __generator } from \"tslib\";\nimport { fromBase64 } from \"@aws-sdk/util-base64-browser\";\n//reference: https://snack.expo.io/r1JCSWRGU\nexport var streamCollector = function (stream) {\n if (typeof Blob === \"function\" && stream instanceof Blob) {\n return collectBlob(stream);\n }\n return collectStream(stream);\n};\nfunction collectBlob(blob) {\n return __awaiter(this, void 0, void 0, function () {\n var base64, arrayBuffer;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, readToBase64(blob)];\n case 1:\n base64 = _a.sent();\n arrayBuffer = fromBase64(base64);\n return [2 /*return*/, new Uint8Array(arrayBuffer)];\n }\n });\n });\n}\nfunction collectStream(stream) {\n return __awaiter(this, void 0, void 0, function () {\n var res, reader, isDone, _a, done, value, prior;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n res = new Uint8Array(0);\n reader = stream.getReader();\n isDone = false;\n _b.label = 1;\n case 1:\n if (!!isDone) return [3 /*break*/, 3];\n return [4 /*yield*/, reader.read()];\n case 2:\n _a = _b.sent(), done = _a.done, value = _a.value;\n if (value) {\n prior = res;\n res = new Uint8Array(prior.length + value.length);\n res.set(prior);\n res.set(value, prior.length);\n }\n isDone = done;\n return [3 /*break*/, 1];\n case 3: return [2 /*return*/, res];\n }\n });\n });\n}\nfunction readToBase64(blob) {\n return new Promise(function (resolve, reject) {\n var reader = new FileReader();\n reader.onloadend = function () {\n var _a;\n // reference: https://developer.mozilla.org/en-US/docs/Web/API/FileReader/readAsDataURL\n // response from readAsDataURL is always prepended with \"data:*/*;base64,\"\n if (reader.readyState !== 2) {\n return reject(new Error(\"Reader aborted too early\"));\n }\n var result = ((_a = reader.result) !== null && _a !== void 0 ? _a : \"\");\n // Response can include only 'data:' for empty blob, return empty string in this case.\n // Otherwise, return the string after ','\n var commaIndex = result.indexOf(\",\");\n var dataOffset = commaIndex > -1 ? commaIndex + 1 : result.length;\n resolve(result.substring(dataOffset));\n };\n reader.onabort = function () { return reject(new Error(\"Read aborted\")); };\n reader.onerror = function () { return reject(reader.error); };\n // reader.readAsArrayBuffer is not always available\n reader.readAsDataURL(blob);\n });\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RyZWFtLWNvbGxlY3Rvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zdHJlYW0tY29sbGVjdG9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFDQSxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sOEJBQThCLENBQUM7QUFFMUQsNENBQTRDO0FBQzVDLE1BQU0sQ0FBQyxJQUFNLGVBQWUsR0FBb0IsVUFBQyxNQUE2QjtJQUM1RSxJQUFJLE9BQU8sSUFBSSxLQUFLLFVBQVUsSUFBSSxNQUFNLFlBQVksSUFBSSxFQUFFO1FBQ3hELE9BQU8sV0FBVyxDQUFDLE1BQU0sQ0FBQyx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lYXJseVwiKSk7XG4gICAgICB9XG4gICAgICBjb25zdCByZXN1bHQgPSAocmVhZGVyLnJlc3VsdCA/PyBcIlwiKSBhcyBzdHJpbmc7XG4gICAgICAvLyBSZXNwb25zZSBjYW4gaW5jbHVkZSBvbmx5ICdkYXRhOicgZm9yIGVtcHR5IGJsb2IsIHJldHVybiBlbXB0eSBzdHJpbmcgaW4gdGhpcyBjYXNlLlxuICAgICAgLy8gT3RoZXJ3aXNlLCByZXR1cm4gdGhlIHN0cmluZyBhZnRlciAnLCdcbiAgICAgIGNvbnN0IGNvbW1hSW5kZXggPSByZXN1bHQuaW5kZXhPZihcIixcIik7XG4gICAgICBjb25zdCBkYXRhT2Zmc2V0ID0gY29tbWFJbmRleCA+IC0xID8gY29tbWFJbmRleCArIDEgOiByZXN1bHQubGVuZ3RoO1xuICAgICAgcmVzb2x2ZShyZXN1bHQuc3Vic3RyaW5nKGRhdGFPZmZzZXQpKTtcbiAgICB9O1xuICAgIHJlYWRlci5vbmFib3J0ID0gKCkgPT4gcmVqZWN0KG5ldyBFcnJvcihcIlJlYWQgYWJvcnRlZFwiKSk7XG4gICAgcmVhZGVyLm9uZXJyb3IgPSAoKSA9PiByZWplY3QocmVhZGVyLmVycm9yKTtcbiAgICAvLyByZWFkZXIucmVhZEFzQXJyYXlCdWZmZXIgaXMgbm90IGFsd2F5cyBhdmFpbGFibGVcbiAgICByZWFkZXIucmVhZEFzRGF0YVVSTChibG9iKTtcbiAgfSk7XG59XG4iXX0=","export var invalidProvider = function (message) { return function () { return Promise.reject(message); }; };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW52YWxpZFByb3ZpZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2ludmFsaWRQcm92aWRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFDQSxNQUFNLENBQUMsSUFBTSxlQUFlLEdBQXVDLFVBQUMsT0FBZSxJQUFLLE9BQUEsY0FBTSxPQUFBLE9BQU8sQ0FBQyxNQUFNLENBQUMsT0FBTyxDQUFDLEVBQXZCLENBQXVCLEVBQTdCLENBQTZCLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBQcm92aWRlciB9IGZyb20gXCJAYXdzLXNkay90eXBlc1wiO1xuZXhwb3J0IGNvbnN0IGludmFsaWRQcm92aWRlcjogKG1lc3NhZ2U6IHN0cmluZykgPT4gUHJvdmlkZXI8YW55PiA9IChtZXNzYWdlOiBzdHJpbmcpID0+ICgpID0+IFByb21pc2UucmVqZWN0KG1lc3NhZ2UpO1xuIl19","/*! *****************************************************************************\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","import { __awaiter, __generator, __read, __spread } from \"tslib\";\nexport var retryMiddleware = function (options) { return function (next, context) { return function (args) { return __awaiter(void 0, void 0, void 0, function () {\n var _a;\n return __generator(this, function (_b) {\n if ((_a = options === null || options === void 0 ? void 0 : options.retryStrategy) === null || _a === void 0 ? void 0 : _a.mode)\n context.userAgent = __spread((context.userAgent || []), [[\"cfg/retry-mode\", options.retryStrategy.mode]]);\n return [2 /*return*/, options.retryStrategy.retry(next, args)];\n });\n}); }; }; };\nexport var retryMiddlewareOptions = {\n name: \"retryMiddleware\",\n tags: [\"RETRY\"],\n step: \"finalizeRequest\",\n priority: \"high\",\n override: true,\n};\nexport var getRetryPlugin = function (options) { return ({\n applyToStack: function (clientStack) {\n clientStack.add(retryMiddleware(options), retryMiddlewareOptions);\n },\n}); };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmV0cnlNaWRkbGV3YXJlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3JldHJ5TWlkZGxld2FyZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBYUEsTUFBTSxDQUFDLElBQU0sZUFBZSxHQUFHLFVBQUMsT0FBNEIsSUFBSyxPQUFBLFVBQy9ELElBQWtDLEVBQ2xDLE9BQWdDLElBQ0MsT0FBQSxVQUNqQyxJQUFtQzs7O1FBRW5DLFVBQUksT0FBTyxhQUFQLE9BQU8sdUJBQVAsT0FBTyxDQUFFLGFBQWEsMENBQUUsSUF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HByaW9yaXR5OiBcImhpZ2hcIixcbiAgb3ZlcnJpZGU6IHRydWUsXG59O1xuXG5leHBvcnQgY29uc3QgZ2V0UmV0cnlQbHVnaW4gPSAob3B0aW9uczogUmV0cnlSZXNvbHZlZENvbmZpZyk6IFBsdWdnYWJsZTxhbnksIGFueT4gPT4gKHtcbiAgYXBwbHlUb1N0YWNrOiAoY2xpZW50U3RhY2spID0+IHtcbiAgICBjbGllbnRTdGFjay5hZGQocmV0cnlNaWRkbGV3YXJlKG9wdGlvbnMpLCByZXRyeU1pZGRsZXdhcmVPcHRpb25zKTtcbiAgfSxcbn0pO1xuIl19","/**\n * The base number of milliseconds to use in calculating a suitable cool-down\n * time when a retryable error is encountered.\n */\nexport var DEFAULT_RETRY_DELAY_BASE = 100;\n/**\n * The maximum amount of time (in milliseconds) that will be used as a delay\n * between retry attempts.\n */\nexport var MAXIMUM_RETRY_DELAY = 20 * 1000;\n/**\n * The retry delay base (in milliseconds) to use when a throttling error is\n * encountered.\n */\nexport var THROTTLING_RETRY_DELAY_BASE = 500;\n/**\n * Initial number of retry tokens in Retry Quota\n */\nexport var INITIAL_RETRY_TOKENS = 500;\n/**\n * The total amount of retry tokens to be decremented from retry token balance.\n */\nexport var RETRY_COST = 5;\n/**\n * The total amount of retry tokens to be decremented from retry token balance\n * when a throttling error is encountered.\n */\nexport var TIMEOUT_RETRY_COST = 10;\n/**\n * The total amount of retry token to be incremented from retry token balance\n * if an SDK operation invocation succeeds without requiring a retry request.\n */\nexport var NO_RETRY_INCREMENT = 1;\n/**\n * Header name for SDK invocation ID\n */\nexport var INVOCATION_ID_HEADER = \"amz-sdk-invocation-id\";\n/**\n * Header name for request retry information.\n */\nexport var REQUEST_HEADER = \"amz-sdk-request\";\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnN0YW50cy50c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ByZXRyeSByZXF1ZXN0LlxuICovXG5leHBvcnQgY29uc3QgTk9fUkVUUllfSU5DUkVNRU5UID0gMTtcblxuLyoqXG4gKiBIZWFkZXIgbmFtZSBmb3IgU0RLIGludm9jYXRpb24gSURcbiAqL1xuZXhwb3J0IGNvbnN0IElOVk9DQVRJT05fSURfSEVBREVSID0gXCJhbXotc2RrLWludm9jYXRpb24taWRcIjtcblxuLyoqXG4gKiBIZWFkZXIgbmFtZSBmb3IgcmVxdWVzdCByZXRyeSBpbmZvcm1hdGlvbi5cbiAqL1xuZXhwb3J0IGNvbnN0IFJFUVVFU1RfSEVBREVSID0gXCJhbXotc2RrLXJlcXVlc3RcIjtcbiJdfQ==","/**\n * Errors encountered when the client clock and server clock cannot agree on the\n * current time.\n *\n * These errors are retryable, assuming the SDK has enabled clock skew\n * correction.\n */\nexport var CLOCK_SKEW_ERROR_CODES = [\n \"AuthFailure\",\n \"InvalidSignatureException\",\n \"RequestExpired\",\n \"RequestInTheFuture\",\n \"RequestTimeTooSkewed\",\n \"SignatureDoesNotMatch\",\n];\n/**\n * Errors that indicate the SDK is being throttled.\n *\n * These errors are always retryable.\n */\nexport var THROTTLING_ERROR_CODES = [\n \"BandwidthLimitExceeded\",\n \"EC2ThrottledException\",\n \"LimitExceededException\",\n \"PriorRequestNotComplete\",\n \"ProvisionedThroughputExceededException\",\n \"RequestLimitExceeded\",\n \"RequestThrottled\",\n \"RequestThrottledException\",\n \"SlowDown\",\n \"ThrottledException\",\n \"Throttling\",\n \"ThrottlingException\",\n \"TooManyRequestsException\",\n \"TransactionInProgressException\",\n];\n/**\n * Error codes that indicate transient issues\n */\nexport var TRANSIENT_ERROR_CODES = [\"AbortError\", \"TimeoutError\", \"RequestTimeout\", \"RequestTimeoutException\"];\n/**\n * Error codes that indicate transient issues\n */\nexport var TRANSIENT_ERROR_STATUS_CODES = [500, 502, 503, 504];\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3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nlSZXF1ZXN0c0V4Y2VwdGlvblwiLFxuICBcIlRyYW5zYWN0aW9uSW5Qcm9ncmVzc0V4Y2VwdGlvblwiLCAvLyBEeW5hbW9EQlxuXTtcblxuLyoqXG4gKiBFcnJvciBjb2RlcyB0aGF0IGluZGljYXRlIHRyYW5zaWVudCBpc3N1ZXNcbiAqL1xuZXhwb3J0IGNvbnN0IFRSQU5TSUVOVF9FUlJPUl9DT0RFUyA9IFtcIkFib3J0RXJyb3JcIiwgXCJUaW1lb3V0RXJyb3JcIiwgXCJSZXF1ZXN0VGltZW91dFwiLCBcIlJlcXVlc3RUaW1lb3V0RXhjZXB0aW9uXCJdO1xuXG4vKipcbiAqIEVycm9yIGNvZGVzIHRoYXQgaW5kaWNhdGUgdHJhbnNpZW50IGlzc3Vlc1xuICovXG5leHBvcnQgY29uc3QgVFJBTlNJRU5UX0VSUk9SX1NUQVRVU19DT0RFUyA9IFs1MDAsIDUwMiwgNTAzLCA1MDRdO1xuIl19","import { CLOCK_SKEW_ERROR_CODES, THROTTLING_ERROR_CODES, TRANSIENT_ERROR_CODES, TRANSIENT_ERROR_STATUS_CODES, } from \"./constants\";\nexport var isRetryableByTrait = function (error) { return error.$retryable !== undefined; };\nexport var isClockSkewError = function (error) { return CLOCK_SKEW_ERROR_CODES.includes(error.name); };\nexport var isThrottlingError = function (error) {\n var _a, _b;\n return ((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) === 429 ||\n THROTTLING_ERROR_CODES.includes(error.name) ||\n ((_b = error.$retryable) === null || _b === void 0 ? void 0 : _b.throttling) == true;\n};\nexport var isTransientError = function (error) {\n var _a;\n return TRANSIENT_ERROR_CODES.includes(error.name) ||\n TRANSIENT_ERROR_STATUS_CODES.includes(((_a = error.$metadata) === null || _a === void 0 ? void 0 : _a.httpStatusCode) || 0);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290Ijoi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cy1zZGsvc21pdGh5LWNsaWVudFwiO1xuXG5pbXBvcnQge1xuICBDTE9DS19TS0VXX0VSUk9SX0NPREVTLFxuICBUSFJPVFRMSU5HX0VSUk9SX0NPREVTLFxuICBUUkFOU0lFTlRfRVJST1JfQ09ERVMsXG4gIFRSQU5TSUVOVF9FUlJPUl9TVEFUVVNfQ09ERVMsXG59IGZyb20gXCIuL2NvbnN0YW50c1wiO1xuXG5leHBvcnQgY29uc3QgaXNSZXRyeWFibGVCeVRyYWl0ID0gKGVycm9yOiBTZGtFcnJvcikgPT4gZXJyb3IuJHJldHJ5YWJsZSAhPT0gdW5kZWZpbmVkO1xuXG5leHBvcnQgY29uc3QgaXNDbG9ja1NrZXdFcnJvciA9IChlcnJvcjogU2RrRXJyb3IpID0+IENMT0NLX1NLRVdfRVJST1JfQ09ERVMuaW5jbHVkZXMoZXJyb3IubmFtZSk7XG5cbmV4cG9ydCBjb25zdCBpc1Rocm90dGxpbmdFcnJvciA9IChlcnJvcjogU2RrRXJyb3IpID0+XG4gIGVycm9yLiRtZXRhZGF0YT8uaHR0cFN0YXR1c0NvZGUgPT09IDQyOSB8fFxuICBUSFJPVFRMSU5HX0VSUk9SX0NPREVTLmluY2x1ZGVzKGVycm9yLm5hbWUpIHx8XG4gIGVycm9yLiRyZXRyeWFibGU/LnRocm90dGxpbmcgPT0gdHJ1ZTtcblxuZXhwb3J0IGNvbnN0IGlzVHJhbnNpZW50RXJyb3IgPSAoZXJyb3I6IFNka0Vycm9yKSA9PlxuICBUUkFOU0lFTlRfRVJST1JfQ09ERVMuaW5jbHVkZXMoZXJyb3IubmFtZSkgfHxcbiAgVFJBTlNJRU5UX0VSUk9SX1NUQVRVU19DT0RFUy5pbmNsdWRlcyhlcnJvci4kbWV0YWRhdGE/Lmh0dHBTdGF0dXNDb2RlIHx8IDApO1xuIl19","// Unique ID creation requires a high quality random # generator. In the\n// browser this is a little complicated due to unknown quality of Math.random()\n// and inconsistent support for the `crypto` API. We do the best we can via\n// feature-detection\n\n// getRandomValues needs to be invoked in a context where \"this\" is a Crypto\n// implementation. Also, find the complete implementation of crypto on IE11.\nvar getRandomValues = (typeof(crypto) != 'undefined' && crypto.getRandomValues && crypto.getRandomValues.bind(crypto)) ||\n (typeof(msCrypto) != 'undefined' && typeof window.msCrypto.getRandomValues == 'function' && msCrypto.getRandomValues.bind(msCrypto));\n\nif (getRandomValues) {\n // WHATWG crypto RNG - http://wiki.whatwg.org/wiki/Crypto\n var rnds8 = new Uint8Array(16); // eslint-disable-line no-undef\n\n module.exports = function whatwgRNG() {\n getRandomValues(rnds8);\n return rnds8;\n };\n} else {\n // Math.random()-based (RNG)\n //\n // If all else fails, use Math.random(). It's fast, but is of unspecified\n // quality.\n var rnds = new Array(16);\n\n module.exports = function mathRNG() {\n for (var i = 0, r; i < 16; i++) {\n if ((i & 0x03) === 0) r = Math.random() * 0x100000000;\n rnds[i] = r >>> ((i & 0x03) << 3) & 0xff;\n }\n\n return rnds;\n };\n}\n","/**\n * Convert array of 16 byte values to UUID string format of the form:\n * XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX\n */\nvar byteToHex = [];\nfor (var i = 0; i < 256; ++i) {\n byteToHex[i] = (i + 0x100).toString(16).substr(1);\n}\n\nfunction bytesToUuid(buf, offset) {\n var i = offset || 0;\n var bth = byteToHex;\n // join used to fix memory issue caused by concatenation: https://bugs.chromium.org/p/v8/issues/detail?id=3175#c4\n return ([\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]], '-',\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]],\n bth[buf[i++]], bth[buf[i++]]\n ]).join('');\n}\n\nmodule.exports = bytesToUuid;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\n// **`v1()` - Generate time-based UUID**\n//\n// Inspired by https://github.com/LiosK/UUID.js\n// and http://docs.python.org/library/uuid.html\n\nvar _nodeId;\nvar _clockseq;\n\n// Previous uuid creation time\nvar _lastMSecs = 0;\nvar _lastNSecs = 0;\n\n// See https://github.com/uuidjs/uuid for API details\nfunction v1(options, buf, offset) {\n var i = buf && offset || 0;\n var b = buf || [];\n\n options = options || {};\n var node = options.node || _nodeId;\n var clockseq = options.clockseq !== undefined ? options.clockseq : _clockseq;\n\n // node and clockseq need to be initialized to random values if they're not\n // specified. We do this lazily to minimize issues related to insufficient\n // system entropy. See #189\n if (node == null || clockseq == null) {\n var seedBytes = rng();\n if (node == null) {\n // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1)\n node = _nodeId = [\n seedBytes[0] | 0x01,\n seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]\n ];\n }\n if (clockseq == null) {\n // Per 4.2.2, randomize (14 bit) clockseq\n clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;\n }\n }\n\n // UUID timestamps are 100 nano-second units since the Gregorian epoch,\n // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so\n // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs'\n // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.\n var msecs = options.msecs !== undefined ? options.msecs : new Date().getTime();\n\n // Per 4.2.1.2, use count of uuid's generated during the current clock\n // cycle to simulate higher resolution clock\n var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;\n\n // Time since last uuid creation (in msecs)\n var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;\n\n // Per 4.2.1.2, Bump clockseq on clock regression\n if (dt < 0 && options.clockseq === undefined) {\n clockseq = clockseq + 1 & 0x3fff;\n }\n\n // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new\n // time interval\n if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {\n nsecs = 0;\n }\n\n // Per 4.2.1.2 Throw error if too many uuids are requested\n if (nsecs >= 10000) {\n throw new Error('uuid.v1(): Can\\'t create more than 10M uuids/sec');\n }\n\n _lastMSecs = msecs;\n _lastNSecs = nsecs;\n _clockseq = clockseq;\n\n // Per 4.1.4 - Convert from unix epoch to Gregorian epoch\n msecs += 12219292800000;\n\n // `time_low`\n var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;\n b[i++] = tl >>> 24 & 0xff;\n b[i++] = tl >>> 16 & 0xff;\n b[i++] = tl >>> 8 & 0xff;\n b[i++] = tl & 0xff;\n\n // `time_mid`\n var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff;\n b[i++] = tmh >>> 8 & 0xff;\n b[i++] = tmh & 0xff;\n\n // `time_high_and_version`\n b[i++] = tmh >>> 24 & 0xf | 0x10; // include version\n b[i++] = tmh >>> 16 & 0xff;\n\n // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)\n b[i++] = clockseq >>> 8 | 0x80;\n\n // `clock_seq_low`\n b[i++] = clockseq & 0xff;\n\n // `node`\n for (var n = 0; n < 6; ++n) {\n b[i + n] = node[n];\n }\n\n return buf ? buf : bytesToUuid(b);\n}\n\nmodule.exports = v1;\n","var rng = require('./lib/rng');\nvar bytesToUuid = require('./lib/bytesToUuid');\n\nfunction v4(options, buf, offset) {\n var i = buf && offset || 0;\n\n if (typeof(options) == 'string') {\n buf = options === 'binary' ? new Array(16) : null;\n options = null;\n }\n options = options || {};\n\n var rnds = options.random || (options.rng || rng)();\n\n // Per 4.4, set bits for version and `clock_seq_hi_and_reserved`\n rnds[6] = (rnds[6] & 0x0f) | 0x40;\n rnds[8] = (rnds[8] & 0x3f) | 0x80;\n\n // Copy bytes to buffer, if provided\n if (buf) {\n for (var ii = 0; ii < 16; ++ii) {\n buf[i + ii] = rnds[ii];\n }\n }\n\n return buf || bytesToUuid(rnds);\n}\n\nmodule.exports = v4;\n","var v1 = require('./v1');\nvar v4 = require('./v4');\n\nvar uuid = v4;\nuuid.v1 = v1;\nuuid.v4 = v4;\n\nmodule.exports = uuid;\n","import { NO_RETRY_INCREMENT, RETRY_COST, TIMEOUT_RETRY_COST } from \"./constants\";\nexport var getDefaultRetryQuota = function (initialRetryTokens) {\n var MAX_CAPACITY = initialRetryTokens;\n var availableCapacity = initialRetryTokens;\n var getCapacityAmount = function (error) { return (error.name === \"TimeoutError\" ? TIMEOUT_RETRY_COST : RETRY_COST); };\n var hasRetryTokens = function (error) { return getCapacityAmount(error) <= availableCapacity; };\n var retrieveRetryTokens = function (error) {\n if (!hasRetryTokens(error)) {\n // retryStrategy should stop retrying, and return last error\n throw new Error(\"No retry token available\");\n }\n var capacityAmount = getCapacityAmount(error);\n availableCapacity -= capacityAmount;\n return capacityAmount;\n };\n var releaseRetryTokens = function (capacityReleaseAmount) {\n availableCapacity += capacityReleaseAmount !== null && capacityReleaseAmount !== void 0 ? capacityReleaseAmount : NO_RETRY_INCREMENT;\n availableCapacity = Math.min(availableCapacity, MAX_CAPACITY);\n };\n return Object.freeze({\n hasRetryTokens: hasRetryTokens,\n retrieveRetryTokens: retrieveRetryTokens,\n releaseRetryTokens: releaseRetryTokens,\n });\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVmYXVsdFJldHJ5UXVvdGEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZGVmYXVsdFJldHJ5UXVvdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsT0FBTyxFQUFFLGtCQUFrQixFQUFFLFVBQVUsRUFBRSxrQkFBa0IsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUdqRixNQUFNLENBQUMsSUFBTSxvQkFBb0IsR0FBRyxVQUFDLGtCQUEwQjtJQUM3RCxJQUFNLFlBQVksR0FBRyxrQkFBa0IsQ0FBQztJQUN4QyxJQUFJLGlCQUFpQixHQUFHLGtCQUFrQixDQUFDO0lBRTNDLElBQU0saUJBQ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bW91bnQgPSBnZXRDYXBhY2l0eUFtb3VudChlcnJvcik7XG4gICAgYXZhaWxhYmxlQ2FwYWNpdHkgLT0gY2FwYWNpdHlBbW91bnQ7XG4gICAgcmV0dXJuIGNhcGFjaXR5QW1vdW50O1xuICB9O1xuXG4gIGNvbnN0IHJlbGVhc2VSZXRyeVRva2VucyA9IChjYXBhY2l0eVJlbGVhc2VBbW91bnQ/OiBudW1iZXIpID0+IHtcbiAgICBhdmFpbGFibGVDYXBhY2l0eSArPSBjYXBhY2l0eVJlbGVhc2VBbW91bnQgPz8gTk9fUkVUUllfSU5DUkVNRU5UO1xuICAgIGF2YWlsYWJsZUNhcGFjaXR5ID0gTWF0aC5taW4oYXZhaWxhYmxlQ2FwYWNpdHksIE1BWF9DQVBBQ0lUWSk7XG4gIH07XG5cbiAgcmV0dXJuIE9iamVjdC5mcmVlemUoe1xuICAgIGhhc1JldHJ5VG9rZW5zLFxuICAgIHJldHJpZXZlUmV0cnlUb2tlbnMsXG4gICAgcmVsZWFzZVJldHJ5VG9rZW5zLFxuICB9KTtcbn07XG4iXX0=","import { MAXIMUM_RETRY_DELAY } from \"./constants\";\n/**\n * Calculate a capped, fully-jittered exponential backoff time.\n */\nexport var defaultDelayDecider = function (delayBase, attempts) {\n return Math.floor(Math.min(MAXIMUM_RETRY_DELAY, Math.random() * Math.pow(2, attempts) * delayBase));\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVsYXlEZWNpZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2RlbGF5RGVjaWRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFFbEQ7O0dBRUc7QUFDSCxNQUFNLENBQUMsSUFBTSxtQkFBbUIsR0FBRyxVQUFDLFNBQWlCLEVBQUUsUUFBZ0I7SUFDckUsT0FBQSxJQUFJLENBQUMsS0FBSyxDQUFDLElBQUksQ0FBQyxHQUFHLENBQUMsbUJBQW1CLEVBQUUsSUFBSSxDQUFDLE1BQU0sRUFBRSxHQUFHLFNBQUEsQ0FBQyxFQUFJLFFBQVEsQ0FBQSxHQUFHLFNBQVMsQ0FBQyxDQUFDO0FBQXBGLENBQW9GLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBNQVhJTVVNX1JFVFJZX0RFTEFZIH0gZnJvbSBcIi4vY29uc3RhbnRzXCI7XG5cbi8qKlxuICogQ2FsY3VsYXRlIGEgY2FwcGVkLCBmdWxseS1qaXR0ZXJlZCBleHBvbmVudGlhbCBiYWNrb2ZmIHRpbWUuXG4gKi9cbmV4cG9ydCBjb25zdCBkZWZhdWx0RGVsYXlEZWNpZGVyID0gKGRlbGF5QmFzZTogbnVtYmVyLCBhdHRlbXB0czogbnVtYmVyKSA9PlxuICBNYXRoLmZsb29yKE1hdGgubWluKE1BWElNVU1fUkVUUllfREVMQVksIE1hdGgucmFuZG9tKCkgKiAyICoqIGF0dGVtcHRzICogZGVsYXlCYXNlKSk7XG4iXX0=","import { isClockSkewError, isRetryableByTrait, isThrottlingError, isTransientError, } from \"@aws-sdk/service-error-classification\";\nexport var defaultRetryDecider = function (error) {\n if (!error) {\n return false;\n }\n return isRetryableByTrait(error) || isClockSkewError(error) || isThrottlingError(error) || isTransientError(error);\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmV0cnlEZWNpZGVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3JldHJ5RGVjaWRlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQ0wsZ0JBQWdCLEVBQ2hCLGtCQUFrQixFQUNsQixpQkFBaUIsRUFDakIsZ0JBQWdCLEdBQ2pCLE1BQU0sdUNBQXVDLENBQUM7QUFHL0MsTUFBTSxDQUFDLElBQU0sbUJBQW1CLEdBQUcsVUFBQyxLQUFlO0lBQ2pELElBQUksQ0FBQyxLQUFLLEVBQUU7UUFDVixPQUFPLEtBQUssQ0FBQztLQUNkO0lBRUQsT0FBTyxrQkFBa0IsQ0FBQyxLQUFLLENBQUMsSUFBSSxnQkFBZ0IsQ0FBQyxLQUFLLENBQUMsSUFBSSxpQkFBaUIsQ0FBQyxLQUFLLENBQUMsSUFBSSxnQkFBZ0IsQ0FBQyxLQUFLLENBQUMsQ0FBQztBQUNySCxDQUFDLENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQge1xuICBpc0Nsb2NrU2tld0Vycm9yLFxuICBpc1JldHJ5YWJsZUJ5VHJhaXQsXG4gIGlzVGhyb3R0bGluZ0Vycm9yLFxuICBpc1RyYW5zaWVudEVycm9yLFxufSBmcm9tIFwiQGF3cy1zZGsvc2VydmljZS1lcnJvci1jbGFzc2lmaWNhdGlvblwiO1xuaW1wb3J0IHsgU2RrRXJyb3IgfSBmcm9tIFwiQGF3cy1zZGsvc21pdGh5LWNsaWVudFwiO1xuXG5leHBvcnQgY29uc3QgZGVmYXVsdFJldHJ5RGVjaWRlciA9IChlcnJvcjogU2RrRXJyb3IpID0+IHtcbiAgaWYgKCFlcnJvcikge1xuICAgIHJldHVybiBmYWxzZTtcbiAgfVxuXG4gIHJldHVybiBpc1JldHJ5YWJsZUJ5VHJhaXQoZXJyb3IpIHx8IGlzQ2xvY2tTa2V3RXJyb3IoZXJyb3IpIHx8IGlzVGhyb3R0bGluZ0Vycm9yKGVycm9yKSB8fCBpc1RyYW5zaWVudEVycm9yKGVycm9yKTtcbn07XG4iXX0=","import { __awaiter, __generator } from \"tslib\";\nimport { HttpRequest } from \"@aws-sdk/protocol-http\";\nimport { isThrottlingError } from \"@aws-sdk/service-error-classification\";\nimport { v4 } from \"uuid\";\nimport { DEFAULT_RETRY_DELAY_BASE, INITIAL_RETRY_TOKENS, INVOCATION_ID_HEADER, REQUEST_HEADER, THROTTLING_RETRY_DELAY_BASE, } from \"./constants\";\nimport { getDefaultRetryQuota } from \"./defaultRetryQuota\";\nimport { defaultDelayDecider } from \"./delayDecider\";\nimport { defaultRetryDecider } from \"./retryDecider\";\n/**\n * The default value for how many HTTP requests an SDK should make for a\n * single SDK operation invocation before giving up\n */\nexport var DEFAULT_MAX_ATTEMPTS = 3;\n/**\n * The default retry algorithm to use.\n */\nexport var DEFAULT_RETRY_MODE = \"standard\";\nvar StandardRetryStrategy = /** @class */ (function () {\n function StandardRetryStrategy(maxAttemptsProvider, options) {\n var _a, _b, _c;\n this.maxAttemptsProvider = maxAttemptsProvider;\n this.mode = DEFAULT_RETRY_MODE;\n this.retryDecider = (_a = options === null || options === void 0 ? void 0 : options.retryDecider) !== null && _a !== void 0 ? _a : defaultRetryDecider;\n this.delayDecider = (_b = options === null || options === void 0 ? void 0 : options.delayDecider) !== null && _b !== void 0 ? _b : defaultDelayDecider;\n this.retryQuota = (_c = options === null || options === void 0 ? void 0 : options.retryQuota) !== null && _c !== void 0 ? _c : getDefaultRetryQuota(INITIAL_RETRY_TOKENS);\n }\n StandardRetryStrategy.prototype.shouldRetry = function (error, attempts, maxAttempts) {\n return attempts < maxAttempts && this.retryDecider(error) && this.retryQuota.hasRetryTokens(error);\n };\n StandardRetryStrategy.prototype.getMaxAttempts = function () {\n return __awaiter(this, void 0, void 0, function () {\n var maxAttempts, error_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, this.maxAttemptsProvider()];\n case 1:\n maxAttempts = _a.sent();\n return [3 /*break*/, 3];\n case 2:\n error_1 = _a.sent();\n maxAttempts = DEFAULT_MAX_ATTEMPTS;\n return [3 /*break*/, 3];\n case 3: return [2 /*return*/, maxAttempts];\n }\n });\n });\n };\n StandardRetryStrategy.prototype.retry = function (next, args) {\n return __awaiter(this, void 0, void 0, function () {\n var retryTokenAmount, attempts, totalDelay, maxAttempts, request, _loop_1, this_1, state_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n attempts = 0;\n totalDelay = 0;\n return [4 /*yield*/, this.getMaxAttempts()];\n case 1:\n maxAttempts = _a.sent();\n request = args.request;\n if (HttpRequest.isInstance(request)) {\n request.headers[INVOCATION_ID_HEADER] = v4();\n }\n _loop_1 = function () {\n var _a, response, output, err_1, delay_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n _b.trys.push([0, 2, , 5]);\n if (HttpRequest.isInstance(request)) {\n request.headers[REQUEST_HEADER] = \"attempt=\" + (attempts + 1) + \"; max=\" + maxAttempts;\n }\n return [4 /*yield*/, next(args)];\n case 1:\n _a = _b.sent(), response = _a.response, output = _a.output;\n this_1.retryQuota.releaseRetryTokens(retryTokenAmount);\n output.$metadata.attempts = attempts + 1;\n output.$metadata.totalRetryDelay = totalDelay;\n return [2 /*return*/, { value: { response: response, output: output } }];\n case 2:\n err_1 = _b.sent();\n attempts++;\n if (!this_1.shouldRetry(err_1, attempts, maxAttempts)) return [3 /*break*/, 4];\n retryTokenAmount = this_1.retryQuota.retrieveRetryTokens(err_1);\n delay_1 = this_1.delayDecider(isThrottlingError(err_1) ? THROTTLING_RETRY_DELAY_BASE : DEFAULT_RETRY_DELAY_BASE, attempts);\n totalDelay += delay_1;\n return [4 /*yield*/, new Promise(function (resolve) { return setTimeout(resolve, delay_1); })];\n case 3:\n _b.sent();\n return [2 /*return*/, \"continue\"];\n case 4:\n if (!err_1.$metadata) {\n err_1.$metadata = {};\n }\n err_1.$metadata.attempts = attempts;\n err_1.$metadata.totalRetryDelay = totalDelay;\n throw err_1;\n case 5: return [2 /*return*/];\n }\n });\n };\n this_1 = this;\n _a.label = 2;\n case 2:\n if (!true) return [3 /*break*/, 4];\n return [5 /*yield**/, _loop_1()];\n case 3:\n state_1 = _a.sent();\n if (typeof state_1 === \"object\")\n return [2 /*return*/, state_1.value];\n return [3 /*break*/, 2];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n return StandardRetryStrategy;\n}());\nexport { StandardRetryStrategy };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVmYXVsdFN0cmF0ZWd5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2RlZmF1bHRTdHJhdGVneS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBQ3JELE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLHVDQUF1QyxDQUFDO0FBRzFFLE9BQU8sRUFBRSxFQUFFLEVBQUUsTUFBTSxNQUFNLENBQUM7QUFFMUIsT0FBTyxFQUNMLHdCQUF3QixFQUN4QixvQkFBb0IsRUFDcEIsb0JBQW9CLEVBQ3BCLGNBQWMsRUFDZCwyQkFBMkIsR0FDNUIsTUFBTSxhQUFhLENBQUM7QUFDckIsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0scUJBQXFCLENBQUM7QUFDM0QsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFDckQsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sZ0JBQWdCLENBQUM7QUFFckQ7OztHQUdHO0FBQ0gsTUFBTSxDQUFDLElBQU0sb0JBQW9CLEdBQUcsQ0FBQyxDQUFDO0FBRXRDOztHQUVHO0FBQ0gsTUFBTSxDQUFDLElBQU0sa0JBQWtCLEdBQUcsVUFBVSxDQUFDO0FBb0Q3QztJQU1FLCtCQUE2QixtQkFBcUMsRUFBRSxPQUFzQzs7UUFBN0Usd0JBQW1CLEdBQW5CLG1CQUFtQixDQUFrQjtRQUZsRCxTQUFJLEdBQUcsa0JBQWtCLENBQUM7UUFHeEMsSUFBSSxDQUFDLFlBQVksU0FBRyxPQUFPLGFBQVAsT0FBTyx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TtcbiAgICAgICAgICBjb25zdCBkZWxheSA9IHRoaXMuZGVsYXlEZWNpZGVyKFxuICAgICAgICAgICAgaXNUaHJvdHRsaW5nRXJyb3IoZXJyKSA/IFRIUk9UVExJTkdfUkVUUllfREVMQVlfQkFTRSA6IERFRkFVTFRfUkVUUllfREVMQVlfQkFTRSxcbiAgICAgICAgICAgIGF0dGVtcHRzXG4gICAgICAgICAgKTtcbiAgICAgICAgICB0b3RhbERlbGF5ICs9IGRlbGF5O1xuXG4gICAgICAgICAgYXdhaXQgbmV3IFByb21pc2UoKHJlc29sdmUpID0+IHNldFRpbWVvdXQocmVzb2x2ZSwgZGVsYXkpKTtcbiAgICAgICAgICBjb250aW51ZTtcbiAgICAgICAgfVxuXG4gICAgICAgIGlmICghZXJyLiRtZXRhZGF0YSkge1xuICAgICAgICAgIGVyci4kbWV0YWRhdGEgPSB7fTtcbiAgICAgICAgfVxuXG4gICAgICAgIGVyci4kbWV0YWRhdGEuYXR0ZW1wdHMgPSBhdHRlbXB0cztcbiAgICAgICAgZXJyLiRtZXRhZGF0YS50b3RhbFJldHJ5RGVsYXkgPSB0b3RhbERlbGF5O1xuICAgICAgICB0aHJvdyBlcnI7XG4gICAgICB9XG4gICAgfVxuICB9XG59XG4iXX0=","import { __assign } from \"tslib\";\nimport { DEFAULT_MAX_ATTEMPTS, DEFAULT_RETRY_MODE, StandardRetryStrategy } from \"./defaultStrategy\";\nexport var ENV_MAX_ATTEMPTS = \"AWS_MAX_ATTEMPTS\";\nexport var CONFIG_MAX_ATTEMPTS = \"max_attempts\";\nexport var NODE_MAX_ATTEMPT_CONFIG_OPTIONS = {\n environmentVariableSelector: function (env) {\n var value = env[ENV_MAX_ATTEMPTS];\n if (!value)\n return undefined;\n var maxAttempt = parseInt(value);\n if (Number.isNaN(maxAttempt)) {\n throw new Error(\"Environment variable \" + ENV_MAX_ATTEMPTS + \" mast be a number, got \\\"\" + value + \"\\\"\");\n }\n return maxAttempt;\n },\n configFileSelector: function (profile) {\n var value = profile[CONFIG_MAX_ATTEMPTS];\n if (!value)\n return undefined;\n var maxAttempt = parseInt(value);\n if (Number.isNaN(maxAttempt)) {\n throw new Error(\"Shared config file entry \" + CONFIG_MAX_ATTEMPTS + \" mast be a number, got \\\"\" + value + \"\\\"\");\n }\n return maxAttempt;\n },\n default: DEFAULT_MAX_ATTEMPTS,\n};\nexport var resolveRetryConfig = function (input) {\n var maxAttempts = normalizeMaxAttempts(input.maxAttempts);\n return __assign(__assign({}, input), { maxAttempts: maxAttempts, retryStrategy: input.retryStrategy || new StandardRetryStrategy(maxAttempts) });\n};\nvar normalizeMaxAttempts = function (maxAttempts) {\n if (maxAttempts === void 0) { maxAttempts = DEFAULT_MAX_ATTEMPTS; }\n if (typeof maxAttempts === \"number\") {\n var promisified_1 = Promise.resolve(maxAttempts);\n return function () { return promisified_1; };\n }\n return maxAttempts;\n};\nexport var ENV_RETRY_MODE = \"AWS_RETRY_MODE\";\nexport var CONFIG_RETRY_MODE = \"retry_mode\";\nexport var NODE_RETRY_MODE_CONFIG_OPTIONS = {\n environmentVariableSelector: function (env) { return env[ENV_RETRY_MODE]; },\n configFileSelector: function (profile) { return profile[CONFIG_RETRY_MODE]; },\n default: DEFAULT_RETRY_MODE,\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29uZmlndXJhdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUdBLE9BQU8sRUFBRSxvQkFBb0IsRUFBRSxrQkFBa0IsRUFBRSxxQkFBcUIsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBRXBHLE1BQU0sQ0FBQyxJQUFNLGdCQUFnQixHQUFHLGtCQUFrQixDQUFDO0FBQ25ELE1BQU0sQ0FBQyxJQUFNLG1CQUFtQixHQUFHLGNBQWMsQ0FBQztBQUV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SUdfUkVUUllfTU9ERV0sXG4gIGRlZmF1bHQ6IERFRkFVTFRfUkVUUllfTU9ERSxcbn07XG4iXX0=","export function calculateBodyLength(body) {\n if (typeof body === \"string\") {\n var len = body.length;\n for (var i = len - 1; i >= 0; i--) {\n var code = body.charCodeAt(i);\n if (code > 0x7f && code <= 0x7ff)\n len++;\n else if (code > 0x7ff && code <= 0xffff)\n len += 2;\n }\n return len;\n }\n else if (typeof body.byteLength === \"number\") {\n // handles Uint8Array, ArrayBuffer, Buffer, and ArrayBufferView\n return body.byteLength;\n }\n else if (typeof body.size === \"number\") {\n // handles browser File object\n return body.size;\n }\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxVQUFVLG1CQUFtQixDQUFDLElBQVM7SUFDM0MsSUFBSSxPQUFPLElBQUksS0FBSyxRQUFRLEVBQUU7UUFDNUIsSUFBSSxHQUFHLEdBQUcsSUFBSSxDQUFDLE1BQU0sQ0FBQztRQUV0QixLQUFLLElBQUksQ0FBQyxHQUFHLEdBQUcsR0FBRyxDQUFDLEVBQUUsQ0FBQyxJQUFJLENBQUMsRUFBRSxDQUFDLEVBQUUsRUFBRTtZQUNqQyxJQUFNLElBQUksR0FBRyxJQUFJLENBQUMsVUFBVSxDQUFDLENBQUMsQ0FBQyxDQUFDO1lBQ2hDLElBQUksSUFBSSxHQUFHLElBQUksSUFBSSxJQUFJLElBQUksS0FBSztnQkFBRSxHQUFHLEVBQUUsQ0FBQztpQkFDbkMsSUFBSSxJQUFJLEdBQUcsS0FBSyxJQUFJLElBQUksSUFBSSxNQUFNO2dCQUFFLEdBQUcsSUFBSSxDQUFDLENBQUM7U0FDbkQ7UUFFRCxPQUFPLEdBQUcsQ0FBQztLQUNaO1NBQU0sS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7XG4gIH1cbn1cbiJdfQ==","/*! *****************************************************************************\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","// NOTE: this list must be up-to-date with browsers listed in\n// test/acceptance/useragentstrings.yml\nexport const BROWSER_ALIASES_MAP = {\n 'Amazon Silk': 'amazon_silk',\n 'Android Browser': 'android',\n Bada: 'bada',\n BlackBerry: 'blackberry',\n Chrome: 'chrome',\n Chromium: 'chromium',\n Electron: 'electron',\n Epiphany: 'epiphany',\n Firefox: 'firefox',\n Focus: 'focus',\n Generic: 'generic',\n 'Google Search': 'google_search',\n Googlebot: 'googlebot',\n 'Internet Explorer': 'ie',\n 'K-Meleon': 'k_meleon',\n Maxthon: 'maxthon',\n 'Microsoft Edge': 'edge',\n 'MZ Browser': 'mz',\n 'NAVER Whale Browser': 'naver',\n Opera: 'opera',\n 'Opera Coast': 'opera_coast',\n PhantomJS: 'phantomjs',\n Puffin: 'puffin',\n QupZilla: 'qupzilla',\n QQ: 'qq',\n QQLite: 'qqlite',\n Safari: 'safari',\n Sailfish: 'sailfish',\n 'Samsung Internet for Android': 'samsung_internet',\n SeaMonkey: 'seamonkey',\n Sleipnir: 'sleipnir',\n Swing: 'swing',\n Tizen: 'tizen',\n 'UC Browser': 'uc',\n Vivaldi: 'vivaldi',\n 'WebOS Browser': 'webos',\n WeChat: 'wechat',\n 'Yandex Browser': 'yandex',\n Roku: 'roku',\n};\n\nexport const BROWSER_MAP = {\n amazon_silk: 'Amazon Silk',\n android: 'Android Browser',\n bada: 'Bada',\n blackberry: 'BlackBerry',\n chrome: 'Chrome',\n chromium: 'Chromium',\n electron: 'Electron',\n epiphany: 'Epiphany',\n firefox: 'Firefox',\n focus: 'Focus',\n generic: 'Generic',\n googlebot: 'Googlebot',\n google_search: 'Google Search',\n ie: 'Internet Explorer',\n k_meleon: 'K-Meleon',\n maxthon: 'Maxthon',\n edge: 'Microsoft Edge',\n mz: 'MZ Browser',\n naver: 'NAVER Whale Browser',\n opera: 'Opera',\n opera_coast: 'Opera Coast',\n phantomjs: 'PhantomJS',\n puffin: 'Puffin',\n qupzilla: 'QupZilla',\n qq: 'QQ Browser',\n qqlite: 'QQ Browser Lite',\n safari: 'Safari',\n sailfish: 'Sailfish',\n samsung_internet: 'Samsung Internet for Android',\n seamonkey: 'SeaMonkey',\n sleipnir: 'Sleipnir',\n swing: 'Swing',\n tizen: 'Tizen',\n uc: 'UC Browser',\n vivaldi: 'Vivaldi',\n webos: 'WebOS Browser',\n wechat: 'WeChat',\n yandex: 'Yandex Browser',\n};\n\nexport const PLATFORMS_MAP = {\n tablet: 'tablet',\n mobile: 'mobile',\n desktop: 'desktop',\n tv: 'tv',\n};\n\nexport const OS_MAP = {\n WindowsPhone: 'Windows Phone',\n Windows: 'Windows',\n MacOS: 'macOS',\n iOS: 'iOS',\n Android: 'Android',\n WebOS: 'WebOS',\n BlackBerry: 'BlackBerry',\n Bada: 'Bada',\n Tizen: 'Tizen',\n Linux: 'Linux',\n ChromeOS: 'Chrome OS',\n PlayStation4: 'PlayStation 4',\n Roku: 'Roku',\n};\n\nexport const ENGINE_MAP = {\n EdgeHTML: 'EdgeHTML',\n Blink: 'Blink',\n Trident: 'Trident',\n Presto: 'Presto',\n Gecko: 'Gecko',\n WebKit: 'WebKit',\n};\n","import { BROWSER_MAP, BROWSER_ALIASES_MAP } from './constants.js';\n\nexport default class Utils {\n /**\n * Get first matched item for a string\n * @param {RegExp} regexp\n * @param {String} ua\n * @return {Array|{index: number, input: string}|*|boolean|string}\n */\n static getFirstMatch(regexp, ua) {\n const match = ua.match(regexp);\n return (match && match.length > 0 && match[1]) || '';\n }\n\n /**\n * Get second matched item for a string\n * @param regexp\n * @param {String} ua\n * @return {Array|{index: number, input: string}|*|boolean|string}\n */\n static getSecondMatch(regexp, ua) {\n const match = ua.match(regexp);\n return (match && match.length > 1 && match[2]) || '';\n }\n\n /**\n * Match a regexp and return a constant or undefined\n * @param {RegExp} regexp\n * @param {String} ua\n * @param {*} _const Any const that will be returned if regexp matches the string\n * @return {*}\n */\n static matchAndReturnConst(regexp, ua, _const) {\n if (regexp.test(ua)) {\n return _const;\n }\n return void (0);\n }\n\n static getWindowsVersionName(version) {\n switch (version) {\n case 'NT': return 'NT';\n case 'XP': return 'XP';\n case 'NT 5.0': return '2000';\n case 'NT 5.1': return 'XP';\n case 'NT 5.2': return '2003';\n case 'NT 6.0': return 'Vista';\n case 'NT 6.1': return '7';\n case 'NT 6.2': return '8';\n case 'NT 6.3': return '8.1';\n case 'NT 10.0': return '10';\n default: return undefined;\n }\n }\n\n /**\n * Get macOS version name\n * 10.5 - Leopard\n * 10.6 - Snow Leopard\n * 10.7 - Lion\n * 10.8 - Mountain Lion\n * 10.9 - Mavericks\n * 10.10 - Yosemite\n * 10.11 - El Capitan\n * 10.12 - Sierra\n * 10.13 - High Sierra\n * 10.14 - Mojave\n * 10.15 - Catalina\n *\n * @example\n * getMacOSVersionName(\"10.14\") // 'Mojave'\n *\n * @param {string} version\n * @return {string} versionName\n */\n static getMacOSVersionName(version) {\n const v = version.split('.').splice(0, 2).map(s => parseInt(s, 10) || 0);\n v.push(0);\n if (v[0] !== 10) return undefined;\n switch (v[1]) {\n case 5: return 'Leopard';\n case 6: return 'Snow Leopard';\n case 7: return 'Lion';\n case 8: return 'Mountain Lion';\n case 9: return 'Mavericks';\n case 10: return 'Yosemite';\n case 11: return 'El Capitan';\n case 12: return 'Sierra';\n case 13: return 'High Sierra';\n case 14: return 'Mojave';\n case 15: return 'Catalina';\n default: return undefined;\n }\n }\n\n /**\n * Get Android version name\n * 1.5 - Cupcake\n * 1.6 - Donut\n * 2.0 - Eclair\n * 2.1 - Eclair\n * 2.2 - Froyo\n * 2.x - Gingerbread\n * 3.x - Honeycomb\n * 4.0 - Ice Cream Sandwich\n * 4.1 - Jelly Bean\n * 4.4 - KitKat\n * 5.x - Lollipop\n * 6.x - Marshmallow\n * 7.x - Nougat\n * 8.x - Oreo\n * 9.x - Pie\n *\n * @example\n * getAndroidVersionName(\"7.0\") // 'Nougat'\n *\n * @param {string} version\n * @return {string} versionName\n */\n static getAndroidVersionName(version) {\n const v = version.split('.').splice(0, 2).map(s => parseInt(s, 10) || 0);\n v.push(0);\n if (v[0] === 1 && v[1] < 5) return undefined;\n if (v[0] === 1 && v[1] < 6) return 'Cupcake';\n if (v[0] === 1 && v[1] >= 6) return 'Donut';\n if (v[0] === 2 && v[1] < 2) return 'Eclair';\n if (v[0] === 2 && v[1] === 2) return 'Froyo';\n if (v[0] === 2 && v[1] > 2) return 'Gingerbread';\n if (v[0] === 3) return 'Honeycomb';\n if (v[0] === 4 && v[1] < 1) return 'Ice Cream Sandwich';\n if (v[0] === 4 && v[1] < 4) return 'Jelly Bean';\n if (v[0] === 4 && v[1] >= 4) return 'KitKat';\n if (v[0] === 5) return 'Lollipop';\n if (v[0] === 6) return 'Marshmallow';\n if (v[0] === 7) return 'Nougat';\n if (v[0] === 8) return 'Oreo';\n if (v[0] === 9) return 'Pie';\n return undefined;\n }\n\n /**\n * Get version precisions count\n *\n * @example\n * getVersionPrecision(\"1.10.3\") // 3\n *\n * @param {string} version\n * @return {number}\n */\n static getVersionPrecision(version) {\n return version.split('.').length;\n }\n\n /**\n * Calculate browser version weight\n *\n * @example\n * compareVersions('1.10.2.1', '1.8.2.1.90') // 1\n * compareVersions('1.010.2.1', '1.09.2.1.90'); // 1\n * compareVersions('1.10.2.1', '1.10.2.1'); // 0\n * compareVersions('1.10.2.1', '1.0800.2'); // -1\n * compareVersions('1.10.2.1', '1.10', true); // 0\n *\n * @param {String} versionA versions versions to compare\n * @param {String} versionB versions versions to compare\n * @param {boolean} [isLoose] enable loose comparison\n * @return {Number} comparison result: -1 when versionA is lower,\n * 1 when versionA is bigger, 0 when both equal\n */\n /* eslint consistent-return: 1 */\n static compareVersions(versionA, versionB, isLoose = false) {\n // 1) get common precision for both versions, for example for \"10.0\" and \"9\" it should be 2\n const versionAPrecision = Utils.getVersionPrecision(versionA);\n const versionBPrecision = Utils.getVersionPrecision(versionB);\n\n let precision = Math.max(versionAPrecision, versionBPrecision);\n let lastPrecision = 0;\n\n const chunks = Utils.map([versionA, versionB], (version) => {\n const delta = precision - Utils.getVersionPrecision(version);\n\n // 2) \"9\" -> \"9.0\" (for precision = 2)\n const _version = version + new Array(delta + 1).join('.0');\n\n // 3) \"9.0\" -> [\"000000000\"\", \"000000009\"]\n return Utils.map(_version.split('.'), chunk => new Array(20 - chunk.length).join('0') + chunk).reverse();\n });\n\n // adjust precision for loose comparison\n if (isLoose) {\n lastPrecision = precision - Math.min(versionAPrecision, versionBPrecision);\n }\n\n // iterate in reverse order by reversed chunks array\n precision -= 1;\n while (precision >= lastPrecision) {\n // 4) compare: \"000000009\" > \"000000010\" = false (but \"9\" > \"10\" = true)\n if (chunks[0][precision] > chunks[1][precision]) {\n return 1;\n }\n\n if (chunks[0][precision] === chunks[1][precision]) {\n if (precision === lastPrecision) {\n // all version chunks are same\n return 0;\n }\n\n precision -= 1;\n } else if (chunks[0][precision] < chunks[1][precision]) {\n return -1;\n }\n }\n\n return undefined;\n }\n\n /**\n * Array::map polyfill\n *\n * @param {Array} arr\n * @param {Function} iterator\n * @return {Array}\n */\n static map(arr, iterator) {\n const result = [];\n let i;\n if (Array.prototype.map) {\n return Array.prototype.map.call(arr, iterator);\n }\n for (i = 0; i < arr.length; i += 1) {\n result.push(iterator(arr[i]));\n }\n return result;\n }\n\n /**\n * Array::find polyfill\n *\n * @param {Array} arr\n * @param {Function} predicate\n * @return {Array}\n */\n static find(arr, predicate) {\n let i;\n let l;\n if (Array.prototype.find) {\n return Array.prototype.find.call(arr, predicate);\n }\n for (i = 0, l = arr.length; i < l; i += 1) {\n const value = arr[i];\n if (predicate(value, i)) {\n return value;\n }\n }\n return undefined;\n }\n\n /**\n * Object::assign polyfill\n *\n * @param {Object} obj\n * @param {Object} ...objs\n * @return {Object}\n */\n static assign(obj, ...assigners) {\n const result = obj;\n let i;\n let l;\n if (Object.assign) {\n return Object.assign(obj, ...assigners);\n }\n for (i = 0, l = assigners.length; i < l; i += 1) {\n const assigner = assigners[i];\n if (typeof assigner === 'object' && assigner !== null) {\n const keys = Object.keys(assigner);\n keys.forEach((key) => {\n result[key] = assigner[key];\n });\n }\n }\n return obj;\n }\n\n /**\n * Get short version/alias for a browser name\n *\n * @example\n * getBrowserAlias('Microsoft Edge') // edge\n *\n * @param {string} browserName\n * @return {string}\n */\n static getBrowserAlias(browserName) {\n return BROWSER_ALIASES_MAP[browserName];\n }\n\n /**\n * Get short version/alias for a browser name\n *\n * @example\n * getBrowserAlias('edge') // Microsoft Edge\n *\n * @param {string} browserAlias\n * @return {string}\n */\n static getBrowserTypeByAlias(browserAlias) {\n return BROWSER_MAP[browserAlias] || '';\n }\n}\n","/**\n * Browsers' descriptors\n *\n * The idea of descriptors is simple. You should know about them two simple things:\n * 1. Every descriptor has a method or property called `test` and a `describe` method.\n * 2. Order of descriptors is important.\n *\n * More details:\n * 1. Method or property `test` serves as a way to detect whether the UA string\n * matches some certain browser or not. The `describe` method helps to make a result\n * object with params that show some browser-specific things: name, version, etc.\n * 2. Order of descriptors is important because a Parser goes through them one by one\n * in course. For example, if you insert Chrome's descriptor as the first one,\n * more then a half of browsers will be described as Chrome, because they will pass\n * the Chrome descriptor's test.\n *\n * Descriptor's `test` could be a property with an array of RegExps, where every RegExp\n * will be applied to a UA string to test it whether it matches or not.\n * If a descriptor has two or more regexps in the `test` array it tests them one by one\n * with a logical sum operation. Parser stops if it has found any RegExp that matches the UA.\n *\n * Or `test` could be a method. In that case it gets a Parser instance and should\n * return true/false to get the Parser know if this browser descriptor matches the UA or not.\n */\n\nimport Utils from './utils.js';\n\nconst commonVersionIdentifier = /version\\/(\\d+(\\.?_?\\d+)+)/i;\n\nconst browsersList = [\n /* Googlebot */\n {\n test: [/googlebot/i],\n describe(ua) {\n const browser = {\n name: 'Googlebot',\n };\n const version = Utils.getFirstMatch(/googlebot\\/(\\d+(\\.\\d+))/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n\n /* Opera < 13.0 */\n {\n test: [/opera/i],\n describe(ua) {\n const browser = {\n name: 'Opera',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:opera)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n\n /* Opera > 13.0 */\n {\n test: [/opr\\/|opios/i],\n describe(ua) {\n const browser = {\n name: 'Opera',\n };\n const version = Utils.getFirstMatch(/(?:opr|opios)[\\s/](\\S+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/SamsungBrowser/i],\n describe(ua) {\n const browser = {\n name: 'Samsung Internet for Android',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:SamsungBrowser)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/Whale/i],\n describe(ua) {\n const browser = {\n name: 'NAVER Whale Browser',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:whale)[\\s/](\\d+(?:\\.\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/MZBrowser/i],\n describe(ua) {\n const browser = {\n name: 'MZ Browser',\n };\n const version = Utils.getFirstMatch(/(?:MZBrowser)[\\s/](\\d+(?:\\.\\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/focus/i],\n describe(ua) {\n const browser = {\n name: 'Focus',\n };\n const version = Utils.getFirstMatch(/(?:focus)[\\s/](\\d+(?:\\.\\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/swing/i],\n describe(ua) {\n const browser = {\n name: 'Swing',\n };\n const version = Utils.getFirstMatch(/(?:swing)[\\s/](\\d+(?:\\.\\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/coast/i],\n describe(ua) {\n const browser = {\n name: 'Opera Coast',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:coast)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/opt\\/\\d+(?:.?_?\\d+)+/i],\n describe(ua) {\n const browser = {\n name: 'Opera Touch',\n };\n const version = Utils.getFirstMatch(/(?:opt)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/yabrowser/i],\n describe(ua) {\n const browser = {\n name: 'Yandex Browser',\n };\n const version = Utils.getFirstMatch(/(?:yabrowser)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/ucbrowser/i],\n describe(ua) {\n const browser = {\n name: 'UC Browser',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:ucbrowser)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/Maxthon|mxios/i],\n describe(ua) {\n const browser = {\n name: 'Maxthon',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:Maxthon|mxios)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/epiphany/i],\n describe(ua) {\n const browser = {\n name: 'Epiphany',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:epiphany)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/puffin/i],\n describe(ua) {\n const browser = {\n name: 'Puffin',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:puffin)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/sleipnir/i],\n describe(ua) {\n const browser = {\n name: 'Sleipnir',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:sleipnir)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/k-meleon/i],\n describe(ua) {\n const browser = {\n name: 'K-Meleon',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/(?:k-meleon)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/micromessenger/i],\n describe(ua) {\n const browser = {\n name: 'WeChat',\n };\n const version = Utils.getFirstMatch(/(?:micromessenger)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/qqbrowser/i],\n describe(ua) {\n const browser = {\n name: (/qqbrowserlite/i).test(ua) ? 'QQ Browser Lite' : 'QQ Browser',\n };\n const version = Utils.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\\d+(\\.?_?\\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/msie|trident/i],\n describe(ua) {\n const browser = {\n name: 'Internet Explorer',\n };\n const version = Utils.getFirstMatch(/(?:msie |rv:)(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/\\sedg\\//i],\n describe(ua) {\n const browser = {\n name: 'Microsoft Edge',\n };\n\n const version = Utils.getFirstMatch(/\\sedg\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/edg([ea]|ios)/i],\n describe(ua) {\n const browser = {\n name: 'Microsoft Edge',\n };\n\n const version = Utils.getSecondMatch(/edg([ea]|ios)\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/vivaldi/i],\n describe(ua) {\n const browser = {\n name: 'Vivaldi',\n };\n const version = Utils.getFirstMatch(/vivaldi\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/seamonkey/i],\n describe(ua) {\n const browser = {\n name: 'SeaMonkey',\n };\n const version = Utils.getFirstMatch(/seamonkey\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/sailfish/i],\n describe(ua) {\n const browser = {\n name: 'Sailfish',\n };\n\n const version = Utils.getFirstMatch(/sailfish\\s?browser\\/(\\d+(\\.\\d+)?)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/silk/i],\n describe(ua) {\n const browser = {\n name: 'Amazon Silk',\n };\n const version = Utils.getFirstMatch(/silk\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/phantom/i],\n describe(ua) {\n const browser = {\n name: 'PhantomJS',\n };\n const version = Utils.getFirstMatch(/phantomjs\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/slimerjs/i],\n describe(ua) {\n const browser = {\n name: 'SlimerJS',\n };\n const version = Utils.getFirstMatch(/slimerjs\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/blackberry|\\bbb\\d+/i, /rim\\stablet/i],\n describe(ua) {\n const browser = {\n name: 'BlackBerry',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/blackberry[\\d]+\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/(web|hpw)[o0]s/i],\n describe(ua) {\n const browser = {\n name: 'WebOS Browser',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua) || Utils.getFirstMatch(/w(?:eb)?[o0]sbrowser\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/bada/i],\n describe(ua) {\n const browser = {\n name: 'Bada',\n };\n const version = Utils.getFirstMatch(/dolfin\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/tizen/i],\n describe(ua) {\n const browser = {\n name: 'Tizen',\n };\n const version = Utils.getFirstMatch(/(?:tizen\\s?)?browser\\/(\\d+(\\.?_?\\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/qupzilla/i],\n describe(ua) {\n const browser = {\n name: 'QupZilla',\n };\n const version = Utils.getFirstMatch(/(?:qupzilla)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/firefox|iceweasel|fxios/i],\n describe(ua) {\n const browser = {\n name: 'Firefox',\n };\n const version = Utils.getFirstMatch(/(?:firefox|iceweasel|fxios)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/electron/i],\n describe(ua) {\n const browser = {\n name: 'Electron',\n };\n const version = Utils.getFirstMatch(/(?:electron)\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/MiuiBrowser/i],\n describe(ua) {\n const browser = {\n name: 'Miui',\n };\n const version = Utils.getFirstMatch(/(?:MiuiBrowser)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/chromium/i],\n describe(ua) {\n const browser = {\n name: 'Chromium',\n };\n const version = Utils.getFirstMatch(/(?:chromium)[\\s/](\\d+(\\.?_?\\d+)+)/i, ua) || Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/chrome|crios|crmo/i],\n describe(ua) {\n const browser = {\n name: 'Chrome',\n };\n const version = Utils.getFirstMatch(/(?:chrome|crios|crmo)\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n {\n test: [/GSA/i],\n describe(ua) {\n const browser = {\n name: 'Google Search',\n };\n const version = Utils.getFirstMatch(/(?:GSA)\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n\n /* Android Browser */\n {\n test(parser) {\n const notLikeAndroid = !parser.test(/like android/i);\n const butAndroid = parser.test(/android/i);\n return notLikeAndroid && butAndroid;\n },\n describe(ua) {\n const browser = {\n name: 'Android Browser',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n\n /* PlayStation 4 */\n {\n test: [/playstation 4/i],\n describe(ua) {\n const browser = {\n name: 'PlayStation 4',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n\n /* Safari */\n {\n test: [/safari|applewebkit/i],\n describe(ua) {\n const browser = {\n name: 'Safari',\n };\n const version = Utils.getFirstMatch(commonVersionIdentifier, ua);\n\n if (version) {\n browser.version = version;\n }\n\n return browser;\n },\n },\n\n /* Something else */\n {\n test: [/.*/i],\n describe(ua) {\n /* Here we try to make sure that there are explicit details about the device\n * in order to decide what regexp exactly we want to apply\n * (as there is a specific decision based on that conclusion)\n */\n const regexpWithoutDeviceSpec = /^(.*)\\/(.*) /;\n const regexpWithDeviceSpec = /^(.*)\\/(.*)[ \\t]\\((.*)/;\n const hasDeviceSpec = ua.search('\\\\(') !== -1;\n const regexp = hasDeviceSpec ? regexpWithDeviceSpec : regexpWithoutDeviceSpec;\n return {\n name: Utils.getFirstMatch(regexp, ua),\n version: Utils.getSecondMatch(regexp, ua),\n };\n },\n },\n];\n\nexport default browsersList;\n","import Utils from './utils.js';\nimport { OS_MAP } from './constants.js';\n\nexport default [\n /* Roku */\n {\n test: [/Roku\\/DVP/],\n describe(ua) {\n const version = Utils.getFirstMatch(/Roku\\/DVP-(\\d+\\.\\d+)/i, ua);\n return {\n name: OS_MAP.Roku,\n version,\n };\n },\n },\n\n /* Windows Phone */\n {\n test: [/windows phone/i],\n describe(ua) {\n const version = Utils.getFirstMatch(/windows phone (?:os)?\\s?(\\d+(\\.\\d+)*)/i, ua);\n return {\n name: OS_MAP.WindowsPhone,\n version,\n };\n },\n },\n\n /* Windows */\n {\n test: [/windows /i],\n describe(ua) {\n const version = Utils.getFirstMatch(/Windows ((NT|XP)( \\d\\d?.\\d)?)/i, ua);\n const versionName = Utils.getWindowsVersionName(version);\n\n return {\n name: OS_MAP.Windows,\n version,\n versionName,\n };\n },\n },\n\n /* Firefox on iPad */\n {\n test: [/Macintosh(.*?) FxiOS(.*?)\\//],\n describe(ua) {\n const result = {\n name: OS_MAP.iOS,\n };\n const version = Utils.getSecondMatch(/(Version\\/)(\\d[\\d.]+)/, ua);\n if (version) {\n result.version = version;\n }\n return result;\n },\n },\n\n /* macOS */\n {\n test: [/macintosh/i],\n describe(ua) {\n const version = Utils.getFirstMatch(/mac os x (\\d+(\\.?_?\\d+)+)/i, ua).replace(/[_\\s]/g, '.');\n const versionName = Utils.getMacOSVersionName(version);\n\n const os = {\n name: OS_MAP.MacOS,\n version,\n };\n if (versionName) {\n os.versionName = versionName;\n }\n return os;\n },\n },\n\n /* iOS */\n {\n test: [/(ipod|iphone|ipad)/i],\n describe(ua) {\n const version = Utils.getFirstMatch(/os (\\d+([_\\s]\\d+)*) like mac os x/i, ua).replace(/[_\\s]/g, '.');\n\n return {\n name: OS_MAP.iOS,\n version,\n };\n },\n },\n\n /* Android */\n {\n test(parser) {\n const notLikeAndroid = !parser.test(/like android/i);\n const butAndroid = parser.test(/android/i);\n return notLikeAndroid && butAndroid;\n },\n describe(ua) {\n const version = Utils.getFirstMatch(/android[\\s/-](\\d+(\\.\\d+)*)/i, ua);\n const versionName = Utils.getAndroidVersionName(version);\n const os = {\n name: OS_MAP.Android,\n version,\n };\n if (versionName) {\n os.versionName = versionName;\n }\n return os;\n },\n },\n\n /* WebOS */\n {\n test: [/(web|hpw)[o0]s/i],\n describe(ua) {\n const version = Utils.getFirstMatch(/(?:web|hpw)[o0]s\\/(\\d+(\\.\\d+)*)/i, ua);\n const os = {\n name: OS_MAP.WebOS,\n };\n\n if (version && version.length) {\n os.version = version;\n }\n return os;\n },\n },\n\n /* BlackBerry */\n {\n test: [/blackberry|\\bbb\\d+/i, /rim\\stablet/i],\n describe(ua) {\n const version = Utils.getFirstMatch(/rim\\stablet\\sos\\s(\\d+(\\.\\d+)*)/i, ua)\n || Utils.getFirstMatch(/blackberry\\d+\\/(\\d+([_\\s]\\d+)*)/i, ua)\n || Utils.getFirstMatch(/\\bbb(\\d+)/i, ua);\n\n return {\n name: OS_MAP.BlackBerry,\n version,\n };\n },\n },\n\n /* Bada */\n {\n test: [/bada/i],\n describe(ua) {\n const version = Utils.getFirstMatch(/bada\\/(\\d+(\\.\\d+)*)/i, ua);\n\n return {\n name: OS_MAP.Bada,\n version,\n };\n },\n },\n\n /* Tizen */\n {\n test: [/tizen/i],\n describe(ua) {\n const version = Utils.getFirstMatch(/tizen[/\\s](\\d+(\\.\\d+)*)/i, ua);\n\n return {\n name: OS_MAP.Tizen,\n version,\n };\n },\n },\n\n /* Linux */\n {\n test: [/linux/i],\n describe() {\n return {\n name: OS_MAP.Linux,\n };\n },\n },\n\n /* Chrome OS */\n {\n test: [/CrOS/],\n describe() {\n return {\n name: OS_MAP.ChromeOS,\n };\n },\n },\n\n /* Playstation 4 */\n {\n test: [/PlayStation 4/],\n describe(ua) {\n const version = Utils.getFirstMatch(/PlayStation 4[/\\s](\\d+(\\.\\d+)*)/i, ua);\n return {\n name: OS_MAP.PlayStation4,\n version,\n };\n },\n },\n];\n","import Utils from './utils.js';\nimport { PLATFORMS_MAP } from './constants.js';\n\n/*\n * Tablets go first since usually they have more specific\n * signs to detect.\n */\n\nexport default [\n /* Googlebot */\n {\n test: [/googlebot/i],\n describe() {\n return {\n type: 'bot',\n vendor: 'Google',\n };\n },\n },\n\n /* Huawei */\n {\n test: [/huawei/i],\n describe(ua) {\n const model = Utils.getFirstMatch(/(can-l01)/i, ua) && 'Nova';\n const platform = {\n type: PLATFORMS_MAP.mobile,\n vendor: 'Huawei',\n };\n if (model) {\n platform.model = model;\n }\n return platform;\n },\n },\n\n /* Nexus Tablet */\n {\n test: [/nexus\\s*(?:7|8|9|10).*/i],\n describe() {\n return {\n type: PLATFORMS_MAP.tablet,\n vendor: 'Nexus',\n };\n },\n },\n\n /* iPad */\n {\n test: [/ipad/i],\n describe() {\n return {\n type: PLATFORMS_MAP.tablet,\n vendor: 'Apple',\n model: 'iPad',\n };\n },\n },\n\n /* Firefox on iPad */\n {\n test: [/Macintosh(.*?) FxiOS(.*?)\\//],\n describe() {\n return {\n type: PLATFORMS_MAP.tablet,\n vendor: 'Apple',\n model: 'iPad',\n };\n },\n },\n\n /* Amazon Kindle Fire */\n {\n test: [/kftt build/i],\n describe() {\n return {\n type: PLATFORMS_MAP.tablet,\n vendor: 'Amazon',\n model: 'Kindle Fire HD 7',\n };\n },\n },\n\n /* Another Amazon Tablet with Silk */\n {\n test: [/silk/i],\n describe() {\n return {\n type: PLATFORMS_MAP.tablet,\n vendor: 'Amazon',\n };\n },\n },\n\n /* Tablet */\n {\n test: [/tablet(?! pc)/i],\n describe() {\n return {\n type: PLATFORMS_MAP.tablet,\n };\n },\n },\n\n /* iPod/iPhone */\n {\n test(parser) {\n const iDevice = parser.test(/ipod|iphone/i);\n const likeIDevice = parser.test(/like (ipod|iphone)/i);\n return iDevice && !likeIDevice;\n },\n describe(ua) {\n const model = Utils.getFirstMatch(/(ipod|iphone)/i, ua);\n return {\n type: PLATFORMS_MAP.mobile,\n vendor: 'Apple',\n model,\n };\n },\n },\n\n /* Nexus Mobile */\n {\n test: [/nexus\\s*[0-6].*/i, /galaxy nexus/i],\n describe() {\n return {\n type: PLATFORMS_MAP.mobile,\n vendor: 'Nexus',\n };\n },\n },\n\n /* Mobile */\n {\n test: [/[^-]mobi/i],\n describe() {\n return {\n type: PLATFORMS_MAP.mobile,\n };\n },\n },\n\n /* BlackBerry */\n {\n test(parser) {\n return parser.getBrowserName(true) === 'blackberry';\n },\n describe() {\n return {\n type: PLATFORMS_MAP.mobile,\n vendor: 'BlackBerry',\n };\n },\n },\n\n /* Bada */\n {\n test(parser) {\n return parser.getBrowserName(true) === 'bada';\n },\n describe() {\n return {\n type: PLATFORMS_MAP.mobile,\n };\n },\n },\n\n /* Windows Phone */\n {\n test(parser) {\n return parser.getBrowserName() === 'windows phone';\n },\n describe() {\n return {\n type: PLATFORMS_MAP.mobile,\n vendor: 'Microsoft',\n };\n },\n },\n\n /* Android Tablet */\n {\n test(parser) {\n const osMajorVersion = Number(String(parser.getOSVersion()).split('.')[0]);\n return parser.getOSName(true) === 'android' && (osMajorVersion >= 3);\n },\n describe() {\n return {\n type: PLATFORMS_MAP.tablet,\n };\n },\n },\n\n /* Android Mobile */\n {\n test(parser) {\n return parser.getOSName(true) === 'android';\n },\n describe() {\n return {\n type: PLATFORMS_MAP.mobile,\n };\n },\n },\n\n /* desktop */\n {\n test(parser) {\n return parser.getOSName(true) === 'macos';\n },\n describe() {\n return {\n type: PLATFORMS_MAP.desktop,\n vendor: 'Apple',\n };\n },\n },\n\n /* Windows */\n {\n test(parser) {\n return parser.getOSName(true) === 'windows';\n },\n describe() {\n return {\n type: PLATFORMS_MAP.desktop,\n };\n },\n },\n\n /* Linux */\n {\n test(parser) {\n return parser.getOSName(true) === 'linux';\n },\n describe() {\n return {\n type: PLATFORMS_MAP.desktop,\n };\n },\n },\n\n /* PlayStation 4 */\n {\n test(parser) {\n return parser.getOSName(true) === 'playstation 4';\n },\n describe() {\n return {\n type: PLATFORMS_MAP.tv,\n };\n },\n },\n\n /* Roku */\n {\n test(parser) {\n return parser.getOSName(true) === 'roku';\n },\n describe() {\n return {\n type: PLATFORMS_MAP.tv,\n };\n },\n },\n];\n","import Utils from './utils.js';\nimport { ENGINE_MAP } from './constants.js';\n\n/*\n * More specific goes first\n */\nexport default [\n /* EdgeHTML */\n {\n test(parser) {\n return parser.getBrowserName(true) === 'microsoft edge';\n },\n describe(ua) {\n const isBlinkBased = /\\sedg\\//i.test(ua);\n\n // return blink if it's blink-based one\n if (isBlinkBased) {\n return {\n name: ENGINE_MAP.Blink,\n };\n }\n\n // otherwise match the version and return EdgeHTML\n const version = Utils.getFirstMatch(/edge\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n return {\n name: ENGINE_MAP.EdgeHTML,\n version,\n };\n },\n },\n\n /* Trident */\n {\n test: [/trident/i],\n describe(ua) {\n const engine = {\n name: ENGINE_MAP.Trident,\n };\n\n const version = Utils.getFirstMatch(/trident\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n engine.version = version;\n }\n\n return engine;\n },\n },\n\n /* Presto */\n {\n test(parser) {\n return parser.test(/presto/i);\n },\n describe(ua) {\n const engine = {\n name: ENGINE_MAP.Presto,\n };\n\n const version = Utils.getFirstMatch(/presto\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n engine.version = version;\n }\n\n return engine;\n },\n },\n\n /* Gecko */\n {\n test(parser) {\n const isGecko = parser.test(/gecko/i);\n const likeGecko = parser.test(/like gecko/i);\n return isGecko && !likeGecko;\n },\n describe(ua) {\n const engine = {\n name: ENGINE_MAP.Gecko,\n };\n\n const version = Utils.getFirstMatch(/gecko\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n engine.version = version;\n }\n\n return engine;\n },\n },\n\n /* Blink */\n {\n test: [/(apple)?webkit\\/537\\.36/i],\n describe() {\n return {\n name: ENGINE_MAP.Blink,\n };\n },\n },\n\n /* WebKit */\n {\n test: [/(apple)?webkit/i],\n describe(ua) {\n const engine = {\n name: ENGINE_MAP.WebKit,\n };\n\n const version = Utils.getFirstMatch(/webkit\\/(\\d+(\\.?_?\\d+)+)/i, ua);\n\n if (version) {\n engine.version = version;\n }\n\n return engine;\n },\n },\n];\n","import browserParsersList from './parser-browsers.js';\nimport osParsersList from './parser-os.js';\nimport platformParsersList from './parser-platforms.js';\nimport enginesParsersList from './parser-engines.js';\nimport Utils from './utils.js';\n\n/**\n * The main class that arranges the whole parsing process.\n */\nclass Parser {\n /**\n * Create instance of Parser\n *\n * @param {String} UA User-Agent string\n * @param {Boolean} [skipParsing=false] parser can skip parsing in purpose of performance\n * improvements if you need to make a more particular parsing\n * like {@link Parser#parseBrowser} or {@link Parser#parsePlatform}\n *\n * @throw {Error} in case of empty UA String\n *\n * @constructor\n */\n constructor(UA, skipParsing = false) {\n if (UA === void (0) || UA === null || UA === '') {\n throw new Error(\"UserAgent parameter can't be empty\");\n }\n\n this._ua = UA;\n\n /**\n * @typedef ParsedResult\n * @property {Object} browser\n * @property {String|undefined} [browser.name]\n * Browser name, like `\"Chrome\"` or `\"Internet Explorer\"`\n * @property {String|undefined} [browser.version] Browser version as a String `\"12.01.45334.10\"`\n * @property {Object} os\n * @property {String|undefined} [os.name] OS name, like `\"Windows\"` or `\"macOS\"`\n * @property {String|undefined} [os.version] OS version, like `\"NT 5.1\"` or `\"10.11.1\"`\n * @property {String|undefined} [os.versionName] OS name, like `\"XP\"` or `\"High Sierra\"`\n * @property {Object} platform\n * @property {String|undefined} [platform.type]\n * platform type, can be either `\"desktop\"`, `\"tablet\"` or `\"mobile\"`\n * @property {String|undefined} [platform.vendor] Vendor of the device,\n * like `\"Apple\"` or `\"Samsung\"`\n * @property {String|undefined} [platform.model] Device model,\n * like `\"iPhone\"` or `\"Kindle Fire HD 7\"`\n * @property {Object} engine\n * @property {String|undefined} [engine.name]\n * Can be any of this: `WebKit`, `Blink`, `Gecko`, `Trident`, `Presto`, `EdgeHTML`\n * @property {String|undefined} [engine.version] String version of the engine\n */\n this.parsedResult = {};\n\n if (skipParsing !== true) {\n this.parse();\n }\n }\n\n /**\n * Get UserAgent string of current Parser instance\n * @return {String} User-Agent String of the current object\n *\n * @public\n */\n getUA() {\n return this._ua;\n }\n\n /**\n * Test a UA string for a regexp\n * @param {RegExp} regex\n * @return {Boolean}\n */\n test(regex) {\n return regex.test(this._ua);\n }\n\n /**\n * Get parsed browser object\n * @return {Object}\n */\n parseBrowser() {\n this.parsedResult.browser = {};\n\n const browserDescriptor = Utils.find(browserParsersList, (_browser) => {\n if (typeof _browser.test === 'function') {\n return _browser.test(this);\n }\n\n if (_browser.test instanceof Array) {\n return _browser.test.some(condition => this.test(condition));\n }\n\n throw new Error(\"Browser's test function is not valid\");\n });\n\n if (browserDescriptor) {\n this.parsedResult.browser = browserDescriptor.describe(this.getUA());\n }\n\n return this.parsedResult.browser;\n }\n\n /**\n * Get parsed browser object\n * @return {Object}\n *\n * @public\n */\n getBrowser() {\n if (this.parsedResult.browser) {\n return this.parsedResult.browser;\n }\n\n return this.parseBrowser();\n }\n\n /**\n * Get browser's name\n * @return {String} Browser's name or an empty string\n *\n * @public\n */\n getBrowserName(toLowerCase) {\n if (toLowerCase) {\n return String(this.getBrowser().name).toLowerCase() || '';\n }\n return this.getBrowser().name || '';\n }\n\n\n /**\n * Get browser's version\n * @return {String} version of browser\n *\n * @public\n */\n getBrowserVersion() {\n return this.getBrowser().version;\n }\n\n /**\n * Get OS\n * @return {Object}\n *\n * @example\n * this.getOS();\n * {\n * name: 'macOS',\n * version: '10.11.12'\n * }\n */\n getOS() {\n if (this.parsedResult.os) {\n return this.parsedResult.os;\n }\n\n return this.parseOS();\n }\n\n /**\n * Parse OS and save it to this.parsedResult.os\n * @return {*|{}}\n */\n parseOS() {\n this.parsedResult.os = {};\n\n const os = Utils.find(osParsersList, (_os) => {\n if (typeof _os.test === 'function') {\n return _os.test(this);\n }\n\n if (_os.test instanceof Array) {\n return _os.test.some(condition => this.test(condition));\n }\n\n throw new Error(\"Browser's test function is not valid\");\n });\n\n if (os) {\n this.parsedResult.os = os.describe(this.getUA());\n }\n\n return this.parsedResult.os;\n }\n\n /**\n * Get OS name\n * @param {Boolean} [toLowerCase] return lower-cased value\n * @return {String} name of the OS — macOS, Windows, Linux, etc.\n */\n getOSName(toLowerCase) {\n const { name } = this.getOS();\n\n if (toLowerCase) {\n return String(name).toLowerCase() || '';\n }\n\n return name || '';\n }\n\n /**\n * Get OS version\n * @return {String} full version with dots ('10.11.12', '5.6', etc)\n */\n getOSVersion() {\n return this.getOS().version;\n }\n\n /**\n * Get parsed platform\n * @return {{}}\n */\n getPlatform() {\n if (this.parsedResult.platform) {\n return this.parsedResult.platform;\n }\n\n return this.parsePlatform();\n }\n\n /**\n * Get platform name\n * @param {Boolean} [toLowerCase=false]\n * @return {*}\n */\n getPlatformType(toLowerCase = false) {\n const { type } = this.getPlatform();\n\n if (toLowerCase) {\n return String(type).toLowerCase() || '';\n }\n\n return type || '';\n }\n\n /**\n * Get parsed platform\n * @return {{}}\n */\n parsePlatform() {\n this.parsedResult.platform = {};\n\n const platform = Utils.find(platformParsersList, (_platform) => {\n if (typeof _platform.test === 'function') {\n return _platform.test(this);\n }\n\n if (_platform.test instanceof Array) {\n return _platform.test.some(condition => this.test(condition));\n }\n\n throw new Error(\"Browser's test function is not valid\");\n });\n\n if (platform) {\n this.parsedResult.platform = platform.describe(this.getUA());\n }\n\n return this.parsedResult.platform;\n }\n\n /**\n * Get parsed engine\n * @return {{}}\n */\n getEngine() {\n if (this.parsedResult.engine) {\n return this.parsedResult.engine;\n }\n\n return this.parseEngine();\n }\n\n /**\n * Get engines's name\n * @return {String} Engines's name or an empty string\n *\n * @public\n */\n getEngineName(toLowerCase) {\n if (toLowerCase) {\n return String(this.getEngine().name).toLowerCase() || '';\n }\n return this.getEngine().name || '';\n }\n\n /**\n * Get parsed platform\n * @return {{}}\n */\n parseEngine() {\n this.parsedResult.engine = {};\n\n const engine = Utils.find(enginesParsersList, (_engine) => {\n if (typeof _engine.test === 'function') {\n return _engine.test(this);\n }\n\n if (_engine.test instanceof Array) {\n return _engine.test.some(condition => this.test(condition));\n }\n\n throw new Error(\"Browser's test function is not valid\");\n });\n\n if (engine) {\n this.parsedResult.engine = engine.describe(this.getUA());\n }\n\n return this.parsedResult.engine;\n }\n\n /**\n * Parse full information about the browser\n * @returns {Parser}\n */\n parse() {\n this.parseBrowser();\n this.parseOS();\n this.parsePlatform();\n this.parseEngine();\n\n return this;\n }\n\n /**\n * Get parsed result\n * @return {ParsedResult}\n */\n getResult() {\n return Utils.assign({}, this.parsedResult);\n }\n\n /**\n * Check if parsed browser matches certain conditions\n *\n * @param {Object} checkTree It's one or two layered object,\n * which can include a platform or an OS on the first layer\n * and should have browsers specs on the bottom-laying layer\n *\n * @returns {Boolean|undefined} Whether the browser satisfies the set conditions or not.\n * Returns `undefined` when the browser is no described in the checkTree object.\n *\n * @example\n * const browser = Bowser.getParser(window.navigator.userAgent);\n * if (browser.satisfies({chrome: '>118.01.1322' }))\n * // or with os\n * if (browser.satisfies({windows: { chrome: '>118.01.1322' } }))\n * // or with platforms\n * if (browser.satisfies({desktop: { chrome: '>118.01.1322' } }))\n */\n satisfies(checkTree) {\n const platformsAndOSes = {};\n let platformsAndOSCounter = 0;\n const browsers = {};\n let browsersCounter = 0;\n\n const allDefinitions = Object.keys(checkTree);\n\n allDefinitions.forEach((key) => {\n const currentDefinition = checkTree[key];\n if (typeof currentDefinition === 'string') {\n browsers[key] = currentDefinition;\n browsersCounter += 1;\n } else if (typeof currentDefinition === 'object') {\n platformsAndOSes[key] = currentDefinition;\n platformsAndOSCounter += 1;\n }\n });\n\n if (platformsAndOSCounter > 0) {\n const platformsAndOSNames = Object.keys(platformsAndOSes);\n const OSMatchingDefinition = Utils.find(platformsAndOSNames, name => (this.isOS(name)));\n\n if (OSMatchingDefinition) {\n const osResult = this.satisfies(platformsAndOSes[OSMatchingDefinition]);\n\n if (osResult !== void 0) {\n return osResult;\n }\n }\n\n const platformMatchingDefinition = Utils.find(\n platformsAndOSNames,\n name => (this.isPlatform(name)),\n );\n if (platformMatchingDefinition) {\n const platformResult = this.satisfies(platformsAndOSes[platformMatchingDefinition]);\n\n if (platformResult !== void 0) {\n return platformResult;\n }\n }\n }\n\n if (browsersCounter > 0) {\n const browserNames = Object.keys(browsers);\n const matchingDefinition = Utils.find(browserNames, name => (this.isBrowser(name, true)));\n\n if (matchingDefinition !== void 0) {\n return this.compareVersion(browsers[matchingDefinition]);\n }\n }\n\n return undefined;\n }\n\n /**\n * Check if the browser name equals the passed string\n * @param browserName The string to compare with the browser name\n * @param [includingAlias=false] The flag showing whether alias will be included into comparison\n * @returns {boolean}\n */\n isBrowser(browserName, includingAlias = false) {\n const defaultBrowserName = this.getBrowserName().toLowerCase();\n let browserNameLower = browserName.toLowerCase();\n const alias = Utils.getBrowserTypeByAlias(browserNameLower);\n\n if (includingAlias && alias) {\n browserNameLower = alias.toLowerCase();\n }\n return browserNameLower === defaultBrowserName;\n }\n\n compareVersion(version) {\n let expectedResults = [0];\n let comparableVersion = version;\n let isLoose = false;\n\n const currentBrowserVersion = this.getBrowserVersion();\n\n if (typeof currentBrowserVersion !== 'string') {\n return void 0;\n }\n\n if (version[0] === '>' || version[0] === '<') {\n comparableVersion = version.substr(1);\n if (version[1] === '=') {\n isLoose = true;\n comparableVersion = version.substr(2);\n } else {\n expectedResults = [];\n }\n if (version[0] === '>') {\n expectedResults.push(1);\n } else {\n expectedResults.push(-1);\n }\n } else if (version[0] === '=') {\n comparableVersion = version.substr(1);\n } else if (version[0] === '~') {\n isLoose = true;\n comparableVersion = version.substr(1);\n }\n\n return expectedResults.indexOf(\n Utils.compareVersions(currentBrowserVersion, comparableVersion, isLoose),\n ) > -1;\n }\n\n isOS(osName) {\n return this.getOSName(true) === String(osName).toLowerCase();\n }\n\n isPlatform(platformType) {\n return this.getPlatformType(true) === String(platformType).toLowerCase();\n }\n\n isEngine(engineName) {\n return this.getEngineName(true) === String(engineName).toLowerCase();\n }\n\n /**\n * Is anything? Check if the browser is called \"anything\",\n * the OS called \"anything\" or the platform called \"anything\"\n * @param {String} anything\n * @param [includingAlias=false] The flag showing whether alias will be included into comparison\n * @returns {Boolean}\n */\n is(anything, includingAlias = false) {\n return this.isBrowser(anything, includingAlias) || this.isOS(anything)\n || this.isPlatform(anything);\n }\n\n /**\n * Check if any of the given values satisfies this.is(anything)\n * @param {String[]} anythings\n * @returns {Boolean}\n */\n some(anythings = []) {\n return anythings.some(anything => this.is(anything));\n }\n}\n\nexport default Parser;\n","/*!\n * Bowser - a browser detector\n * https://github.com/lancedikson/bowser\n * MIT License | (c) Dustin Diaz 2012-2015\n * MIT License | (c) Denis Demchenko 2015-2019\n */\nimport Parser from './parser.js';\nimport {\n BROWSER_MAP,\n ENGINE_MAP,\n OS_MAP,\n PLATFORMS_MAP,\n} from './constants.js';\n\n/**\n * Bowser class.\n * Keep it simple as much as it can be.\n * It's supposed to work with collections of {@link Parser} instances\n * rather then solve one-instance problems.\n * All the one-instance stuff is located in Parser class.\n *\n * @class\n * @classdesc Bowser is a static object, that provides an API to the Parsers\n * @hideconstructor\n */\nclass Bowser {\n /**\n * Creates a {@link Parser} instance\n *\n * @param {String} UA UserAgent string\n * @param {Boolean} [skipParsing=false] Will make the Parser postpone parsing until you ask it\n * explicitly. Same as `skipParsing` for {@link Parser}.\n * @returns {Parser}\n * @throws {Error} when UA is not a String\n *\n * @example\n * const parser = Bowser.getParser(window.navigator.userAgent);\n * const result = parser.getResult();\n */\n static getParser(UA, skipParsing = false) {\n if (typeof UA !== 'string') {\n throw new Error('UserAgent should be a string');\n }\n return new Parser(UA, skipParsing);\n }\n\n /**\n * Creates a {@link Parser} instance and runs {@link Parser.getResult} immediately\n *\n * @param UA\n * @return {ParsedResult}\n *\n * @example\n * const result = Bowser.parse(window.navigator.userAgent);\n */\n static parse(UA) {\n return (new Parser(UA)).getResult();\n }\n\n static get BROWSER_MAP() {\n return BROWSER_MAP;\n }\n\n static get ENGINE_MAP() {\n return ENGINE_MAP;\n }\n\n static get OS_MAP() {\n return OS_MAP;\n }\n\n static get PLATFORMS_MAP() {\n return PLATFORMS_MAP;\n }\n}\n\nexport default Bowser;\n","import { __awaiter, __generator } from \"tslib\";\nimport bowser from \"bowser\";\n/**\n * Default provider to the user agent in browsers. It's a best effort to infer\n * the device information. It uses bowser library to detect the browser and virsion\n */\nexport var defaultUserAgent = function (_a) {\n var serviceId = _a.serviceId, clientVersion = _a.clientVersion;\n return function () { return __awaiter(void 0, void 0, void 0, function () {\n var parsedUA, sections;\n var _a, _b, _c, _d, _e, _f, _g;\n return __generator(this, function (_h) {\n parsedUA = ((_a = window === null || window === void 0 ? void 0 : window.navigator) === null || _a === void 0 ? void 0 : _a.userAgent) ? bowser.parse(window.navigator.userAgent) : undefined;\n sections = [\n // sdk-metadata\n [\"aws-sdk-js\", clientVersion],\n // os-metadata\n [\"os/\" + (((_b = parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.os) === null || _b === void 0 ? void 0 : _b.name) || \"other\"), (_c = parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.os) === null || _c === void 0 ? void 0 : _c.version],\n // language-metadata\n // ECMAScript edition doesn't matter in JS.\n [\"lang/js\"],\n // browser vendor and version.\n [\"md/browser\", ((_e = (_d = parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.browser) === null || _d === void 0 ? void 0 : _d.name) !== null && _e !== void 0 ? _e : \"unknown\") + \"_\" + ((_g = (_f = parsedUA === null || parsedUA === void 0 ? void 0 : parsedUA.browser) === null || _f === void 0 ? void 0 : _f.version) !== null && _g !== void 0 ? _g : \"unknown\")],\n ];\n if (serviceId) {\n // api-metadata\n // service Id may not appear in non-AWS clients\n sections.push([\"api/\" + serviceId, clientVersion]);\n }\n return [2 /*return*/, sections];\n });\n }); };\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLE9BQU8sTUFBTSxNQUFNLFFBQVEsQ0FBQztBQUk1Qjs7O0dBR0c7QUFDSCxNQUFNLENBQUMsSUFBTSxnQkFBZ0IsR0FBRyxVQUFDLEVBR1A7UUFGeEIsU0FBUyxlQUFBLEVBQ1QsYUFBYSxtQkFBQTtJQUNxQyxPQUFBOzs7O1lBQzVDLFFBQVEsR0FBRyxPQUFBLE1BQU0sYUFBTixNQUFNLHVCQUFOLE1BQU0sQ0FBRSxTQUFTLDBDQUFFLFNBQVMsRUFBQyxDQUFDLENBQUMsTUFBTSxDQUFDLEtBQUssQ0FBQyxNQUFNLENBQUMsU0FBUyxDQUFDLFNBQVMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLENBQUM7WUFDL0YsUUFBUSxHQUFjO2dCQUMxQixlQUFlO2dCQUNmLENBQUMsWUFBWSxFQUFFLGFBQWEsQ0FBQztnQkFDN0IsY0FBYztnQkFDZCxDQUFDLFNBQU0sT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ElkIG1heSBub3QgYXBwZWFyIGluIG5vbi1BV1MgY2xpZW50c1xuICAgIHNlY3Rpb25zLnB1c2goW2BhcGkvJHtzZXJ2aWNlSWR9YCwgY2xpZW50VmVyc2lvbl0pO1xuICB9XG5cbiAgcmV0dXJuIHNlY3Rpb25zO1xufTtcbiJdfQ==","/*! *****************************************************************************\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","import { __read, __values } from \"tslib\";\nexport function parseQueryString(querystring) {\n var e_1, _a;\n var query = {};\n querystring = querystring.replace(/^\\?/, \"\");\n if (querystring) {\n try {\n for (var _b = __values(querystring.split(\"&\")), _c = _b.next(); !_c.done; _c = _b.next()) {\n var pair = _c.value;\n var _d = __read(pair.split(\"=\"), 2), key = _d[0], _e = _d[1], value = _e === void 0 ? null : _e;\n key = decodeURIComponent(key);\n if (value) {\n value = decodeURIComponent(value);\n }\n if (!(key in query)) {\n query[key] = value;\n }\n else if (Array.isArray(query[key])) {\n query[key].push(value);\n }\n else {\n query[key] = [query[key], value];\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n }\n return query;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUVBLE1BQU0sVUFBVSxnQkFBZ0IsQ0FBQyxXQUFtQjs7SUFDbEQsSUFBTSxLQUFLLEdBQXNCLEVBQUUsQ0FBQztJQUNwQyxXQUFXLEdBQUcsV0FBVyxDQUFDLE9BQU8sQ0FBQyxLQUFLLEVBQUUsRUFBRSxDQUFDLENBQUM7SUFFN0MsSUFBSSxXQUFXLEVBQUU7O1lBQ2YsS0FBbUIsSUFBQSxLQUFBLFNBQUEsV0FBVyxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQSxnQkFBQSw0QkFBRTtnQkFBdEMsSUFBTSxJQUFJLFdBQUE7Z0JBQ1QsSUFBQSxLQUFBLE9BQXNCLElBQUksQ0FBQyxLQUFLLENBQUMsR0FBRy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iXCIpO1xuXG4gIGlmIChxdWVyeXN0cmluZykge1xuICAgIGZvciAoY29uc3QgcGFpciBvZiBxdWVyeXN0cmluZy5zcGxpdChcIiZcIikpIHtcbiAgICAgIGxldCBba2V5LCB2YWx1ZSA9IG51bGxdID0gcGFpci5zcGxpdChcIj1cIik7XG4gICAgICBrZXkgPSBkZWNvZGVVUklDb21wb25lbnQoa2V5KTtcbiAgICAgIGlmICh2YWx1ZSkge1xuICAgICAgICB2YWx1ZSA9IGRlY29kZVVSSUNvbXBvbmVudCh2YWx1ZSk7XG4gICAgICB9XG4gICAgICBpZiAoIShrZXkgaW4gcXVlcnkpKSB7XG4gICAgICAgIHF1ZXJ5W2tleV0gPSB2YWx1ZTtcbiAgICAgIH0gZWxzZSBpZiAoQXJyYXkuaXNBcnJheShxdWVyeVtrZXldKSkge1xuICAgICAgICAocXVlcnlba2V5XSBhcyBBcnJheTxzdHJpbmc+KS5wdXNoKHZhbHVlIGFzIHN0cmluZyk7XG4gICAgICB9IGVsc2Uge1xuICAgICAgICBxdWVyeVtrZXldID0gW3F1ZXJ5W2tleV0gYXMgc3RyaW5nLCB2YWx1ZSBhcyBzdHJpbmddO1xuICAgICAgfVxuICAgIH1cbiAgfVxuXG4gIHJldHVybiBxdWVyeTtcbn1cbiJdfQ==","import { parseQueryString } from \"@aws-sdk/querystring-parser\";\nexport var parseUrl = function (url) {\n var _a = new URL(url), hostname = _a.hostname, pathname = _a.pathname, port = _a.port, protocol = _a.protocol, search = _a.search;\n var query;\n if (search) {\n query = parseQueryString(search);\n }\n return {\n hostname: hostname,\n port: port ? parseInt(port) : undefined,\n protocol: protocol,\n path: pathname,\n query: query,\n };\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyx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J5OiBRdWVyeVBhcmFtZXRlckJhZyB8IHVuZGVmaW5lZDtcbiAgaWYgKHNlYXJjaCkge1xuICAgIHF1ZXJ5ID0gcGFyc2VRdWVyeVN0cmluZyhzZWFyY2gpO1xuICB9XG5cbiAgcmV0dXJuIHtcbiAgICBob3N0bmFtZSxcbiAgICBwb3J0OiBwb3J0ID8gcGFyc2VJbnQocG9ydCkgOiB1bmRlZmluZWQsXG4gICAgcHJvdG9jb2wsXG4gICAgcGF0aDogcGF0aG5hbWUsXG4gICAgcXVlcnksXG4gIH07XG59O1xuIl19","/*! *****************************************************************************\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","import { __assign, __awaiter, __generator } from \"tslib\";\nexport var resolveEndpointsConfig = function (input) {\n var _a;\n return (__assign(__assign({}, input), { tls: (_a = input.tls) !== null && _a !== void 0 ? _a : true, endpoint: input.endpoint ? normalizeEndpoint(input) : function () { return getEndPointFromRegion(input); }, isCustomEndpoint: input.endpoint ? true : false }));\n};\nvar normalizeEndpoint = function (input) {\n var endpoint = input.endpoint, urlParser = input.urlParser;\n if (typeof endpoint === \"string\") {\n var promisified_1 = Promise.resolve(urlParser(endpoint));\n return function () { return promisified_1; };\n }\n else if (typeof endpoint === \"object\") {\n var promisified_2 = Promise.resolve(endpoint);\n return function () { return promisified_2; };\n }\n return endpoint;\n};\nvar getEndPointFromRegion = function (input) { return __awaiter(void 0, void 0, void 0, function () {\n var _a, tls, region, dnsHostRegex, hostname;\n var _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _a = input.tls, tls = _a === void 0 ? true : _a;\n return [4 /*yield*/, input.region()];\n case 1:\n region = _c.sent();\n dnsHostRegex = new RegExp(/^([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9-]{0,61}[a-zA-Z0-9])$/);\n if (!dnsHostRegex.test(region)) {\n throw new Error(\"Invalid region in client config\");\n }\n return [4 /*yield*/, input.regionInfoProvider(region)];\n case 2:\n hostname = ((_b = (_c.sent())) !== null && _b !== void 0 ? _b : {}).hostname;\n if (!hostname) {\n throw new Error(\"Cannot resolve hostname from client config\");\n }\n return [2 /*return*/, input.urlParser((tls ? \"https:\" : \"http:\") + \"//\" + hostname)];\n }\n });\n}); };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW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owLTldfFthLXpBLVowLTldW2EtekEtWjAtOS1dezAsNjF9W2EtekEtWjAtOV0pJC8pO1xuICBpZiAoIWRuc0hvc3RSZWdleC50ZXN0KHJlZ2lvbikpIHtcbiAgICB0aHJvdyBuZXcgRXJyb3IoXCJJbnZhbGlkIHJlZ2lvbiBpbiBjbGllbnQgY29uZmlnXCIpO1xuICB9XG5cbiAgY29uc3QgeyBob3N0bmFtZSB9ID0gKGF3YWl0IGlucHV0LnJlZ2lvbkluZm9Qcm92aWRlcihyZWdpb24pKSA/PyB7fTtcbiAgaWYgKCFob3N0bmFtZSkge1xuICAgIHRocm93IG5ldyBFcnJvcihcIkNhbm5vdCByZXNvbHZlIGhvc3RuYW1lIGZyb20gY2xpZW50IGNvbmZpZ1wiKTtcbiAgfVxuXG4gIHJldHVybiBpbnB1dC51cmxQYXJzZXIoYCR7dGxzID8gXCJodHRwczpcIiA6IFwiaHR0cDpcIn0vLyR7aG9zdG5hbWV9YCk7XG59O1xuIl19","import { __assign } from \"tslib\";\nexport var REGION_ENV_NAME = \"AWS_REGION\";\nexport var REGION_INI_NAME = \"region\";\nexport var NODE_REGION_CONFIG_OPTIONS = {\n environmentVariableSelector: function (env) { return env[REGION_ENV_NAME]; },\n configFileSelector: function (profile) { return profile[REGION_INI_NAME]; },\n default: function () {\n throw new Error(\"Region is missing\");\n },\n};\nexport var NODE_REGION_CONFIG_FILE_OPTIONS = {\n preferredFile: \"credentials\",\n};\nexport var resolveRegionConfig = function (input) {\n if (!input.region) {\n throw new Error(\"Region is missing\");\n }\n return __assign(__assign({}, input), { region: normalizeRegion(input.region) });\n};\nvar normalizeRegion = function (region) {\n if (typeof region === \"string\") {\n var promisified_1 = Promise.resolve(region);\n return function () { return promisified_1; };\n }\n return region;\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUmVnaW9uQ29uZmlnLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3Jj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W5kIHJlcXVlc3RzXG4gICAqL1xuICByZWdpb24/OiBzdHJpbmcgfCBQcm92aWRlcjxzdHJpbmc+O1xufVxuXG5pbnRlcmZhY2UgUHJldmlvdXNseVJlc29sdmVkIHt9XG5cbmV4cG9ydCBpbnRlcmZhY2UgUmVnaW9uUmVzb2x2ZWRDb25maWcge1xuICByZWdpb246IFByb3ZpZGVyPHN0cmluZz47XG59XG5cbmV4cG9ydCBjb25zdCByZXNvbHZlUmVnaW9uQ29uZmlnID0gPFQ+KGlucHV0OiBUICYgUmVnaW9uSW5wdXRDb25maWcgJiBQcmV2aW91c2x5UmVzb2x2ZWQpOiBUICYgUmVnaW9uUmVzb2x2ZWRDb25maWcgPT4ge1xuICBpZiAoIWlucHV0LnJlZ2lvbikge1xuICAgIHRocm93IG5ldyBFcnJvcihcIlJlZ2lvbiBpcyBtaXNzaW5nXCIpO1xuICB9XG4gIHJldHVybiB7XG4gICAgLi4uaW5wdXQsXG4gICAgcmVnaW9uOiBub3JtYWxpemVSZWdpb24oaW5wdXQucmVnaW9uISksXG4gIH07XG59O1xuXG5jb25zdCBub3JtYWxpemVSZWdpb24gPSAocmVnaW9uOiBzdHJpbmcgfCBQcm92aWRlcjxzdHJpbmc+KTogUHJvdmlkZXI8c3RyaW5nPiA9PiB7XG4gIGlmICh0eXBlb2YgcmVnaW9uID09PSBcInN0cmluZ1wiKSB7XG4gICAgY29uc3QgcHJvbWlzaWZpZWQgPSBQcm9taXNlLnJlc29sdmUocmVnaW9uKTtcbiAgICByZXR1cm4gKCkgPT4gcHJvbWlzaWZpZWQ7XG4gIH1cbiAgcmV0dXJuIHJlZ2lvbiBhcyBQcm92aWRlcjxzdHJpbmc+O1xufTtcbiJdfQ==","/*! *****************************************************************************\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","import { __assign, __awaiter, __generator } from \"tslib\";\nimport { HttpRequest } from \"@aws-sdk/protocol-http\";\nvar CONTENT_LENGTH_HEADER = \"content-length\";\nexport function contentLengthMiddleware(bodyLengthChecker) {\n var _this = this;\n return function (next) { return function (args) { return __awaiter(_this, void 0, void 0, function () {\n var request, body, headers, length;\n var _a;\n return __generator(this, function (_b) {\n request = args.request;\n if (HttpRequest.isInstance(request)) {\n body = request.body, headers = request.headers;\n if (body &&\n Object.keys(headers)\n .map(function (str) { return str.toLowerCase(); })\n .indexOf(CONTENT_LENGTH_HEADER) === -1) {\n length = bodyLengthChecker(body);\n if (length !== undefined) {\n request.headers = __assign(__assign({}, request.headers), (_a = {}, _a[CONTENT_LENGTH_HEADER] = String(length), _a));\n }\n }\n }\n return [2 /*return*/, next(__assign(__assign({}, args), { request: request }))];\n });\n }); }; };\n}\nexport var contentLengthMiddlewareOptions = {\n step: \"build\",\n tags: [\"SET_CONTENT_LENGTH\", \"CONTENT_LENGTH\"],\n name: \"contentLengthMiddleware\",\n override: true,\n};\nexport var getContentLengthPlugin = function (options) { return ({\n applyToStack: function (clientStack) {\n clientStack.add(contentLengthMiddleware(options.bodyLengthChecker), contentLengthMiddlewareOptions);\n },\n}); };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQVlyRCxJQUFNLHFCQUFxQixHQUFHLGdCQUFnQixDQUFDO0FBRS9DLE1BQU0sVUFBVSx1QkFBdUIsQ0FBQyxpQkFBdUM7SUFBL0UsaUJBNEJDO0lBM0JDLE9BQU8sVUFBZ0MsSUFBK0IsSUFBZ0MsT0FBQSxVQUNwRyxJQUFnQzs7OztZQUUxQixPQUFPLEdBQUcsSUFBSSxDQUFDLE9BQU8sQ0FBQztZQUM3QixJQUFJLFdBQVcsQ0FBQyxVQUFVLENBQUMsT0FBTyxDQUFDLEVBQUU7Z0JBQzNCLElBQUksR0FBYyxPQUFPLEtBQXJCLEVBQUUsT0FBTyxHQUFLLE9BQU8sUUFBWixDQUFhO2dCQUNsQyxJQUNFLElBQUk7b0JBQ0osTUFBTSxDQUFDLElBQUksQ0FBQyxPQUFPLENBQUM7eUJBQ2pCLE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3RoQ2hlY2tlciksIGNvbnRlbnRMZW5ndGhNaWRkbGV3YXJlT3B0aW9ucyk7XG4gIH0sXG59KTtcbiJdfQ==","/*! *****************************************************************************\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","import { __awaiter, __generator } from \"tslib\";\nimport { HttpRequest } from \"@aws-sdk/protocol-http\";\nexport function resolveHostHeaderConfig(input) {\n return input;\n}\nexport var hostHeaderMiddleware = function (options) { return function (next) { return function (args) { return __awaiter(void 0, void 0, void 0, function () {\n var request, _a, handlerProtocol;\n return __generator(this, function (_b) {\n if (!HttpRequest.isInstance(args.request))\n return [2 /*return*/, next(args)];\n request = args.request;\n _a = (options.requestHandler.metadata || {}).handlerProtocol, handlerProtocol = _a === void 0 ? \"\" : _a;\n //For H2 request, remove 'host' header and use ':authority' header instead\n //reference: https://nodejs.org/dist/latest-v13.x/docs/api/errors.html#ERR_HTTP2_INVALID_CONNECTION_HEADERS\n if (handlerProtocol.indexOf(\"h2\") >= 0 && !request.headers[\":authority\"]) {\n delete request.headers[\"host\"];\n request.headers[\":authority\"] = \"\";\n //non-H2 request and 'host' header is not set, set the 'host' header to request's hostname.\n }\n else if (!request.headers[\"host\"]) {\n request.headers[\"host\"] = request.hostname;\n }\n return [2 /*return*/, next(args)];\n });\n}); }; }; };\nexport var hostHeaderMiddlewareOptions = {\n name: \"hostHeaderMiddleware\",\n step: \"build\",\n priority: \"low\",\n tags: [\"HOST\"],\n override: true,\n};\nexport var getHostHeaderPlugin = function (options) { return ({\n applyToStack: function (clientStack) {\n clientStack.add(hostHeaderMiddleware(options), hostHeaderMiddlewareOptions);\n },\n}); };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQVVyRCxNQUFNLFVBQVUsdUJBQXVCLENBQ3JDLEtBQXFEO0lBRXJELE9BQU8sS0FBSyxDQUFDO0FBQ2YsQ0FBQztBQUVELE1BQU0sQ0FBQyxJQUFNLG9CQUFvQixHQUFHLFVBQ2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QgdGhlICdob3N0JyBoZWFkZXIgdG8gcmVxdWVzdCdzIGhvc3RuYW1lLlxuICB9IGVsc2UgaWYgKCFyZXF1ZXN0LmhlYWRlcnNbXCJob3N0XCJdKSB7XG4gICAgcmVxdWVzdC5oZWFkZXJzW1wiaG9zdFwiXSA9IHJlcXVlc3QuaG9zdG5hbWU7XG4gIH1cbiAgcmV0dXJuIG5leHQoYXJncyk7XG59O1xuXG5leHBvcnQgY29uc3QgaG9zdEhlYWRlck1pZGRsZXdhcmVPcHRpb25zOiBCdWlsZEhhbmRsZXJPcHRpb25zICYgQWJzb2x1dGVMb2NhdGlvbiA9IHtcbiAgbmFtZTogXCJob3N0SGVhZGVyTWlkZGxld2FyZVwiLFxuICBzdGVwOiBcImJ1aWxkXCIsXG4gIHByaW9yaXR5OiBcImxvd1wiLFxuICB0YWdzOiBbXCJIT1NUXCJdLFxuICBvdmVycmlkZTogdHJ1ZSxcbn07XG5cbmV4cG9ydCBjb25zdCBnZXRIb3N0SGVhZGVyUGx1Z2luID0gKG9wdGlvbnM6IEhvc3RIZWFkZXJSZXNvbHZlZENvbmZpZyk6IFBsdWdnYWJsZTxhbnksIGFueT4gPT4gKHtcbiAgYXBwbHlUb1N0YWNrOiAoY2xpZW50U3RhY2spID0+IHtcbiAgICBjbGllbnRTdGFjay5hZGQoaG9zdEhlYWRlck1pZGRsZXdhcmUob3B0aW9ucyksIGhvc3RIZWFkZXJNaWRkbGV3YXJlT3B0aW9ucyk7XG4gIH0sXG59KTtcbiJdfQ==","/*! *****************************************************************************\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","import { __awaiter, __generator, __rest } from \"tslib\";\nexport var loggerMiddleware = function () { return function (next, context) { return function (args) { return __awaiter(void 0, void 0, void 0, function () {\n var clientName, commandName, inputFilterSensitiveLog, logger, outputFilterSensitiveLog, response, _a, $metadata, outputWithoutMetadata;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n clientName = context.clientName, commandName = context.commandName, inputFilterSensitiveLog = context.inputFilterSensitiveLog, logger = context.logger, outputFilterSensitiveLog = context.outputFilterSensitiveLog;\n return [4 /*yield*/, next(args)];\n case 1:\n response = _b.sent();\n if (!logger) {\n return [2 /*return*/, response];\n }\n if (typeof logger.info === \"function\") {\n _a = response.output, $metadata = _a.$metadata, outputWithoutMetadata = __rest(_a, [\"$metadata\"]);\n logger.info({\n clientName: clientName,\n commandName: commandName,\n input: inputFilterSensitiveLog(args.input),\n output: outputFilterSensitiveLog(outputWithoutMetadata),\n metadata: $metadata,\n });\n }\n return [2 /*return*/, response];\n }\n });\n}); }; }; };\nexport var loggerMiddlewareOptions = {\n name: \"loggerMiddleware\",\n tags: [\"LOGGER\"],\n step: \"initialize\",\n override: true,\n};\n// eslint-disable-next-line @typescript-eslint/no-unused-vars\nexport var getLoggerPlugin = function (options) { return ({\n applyToStack: function (clientStack) {\n clientStack.add(loggerMiddleware(), loggerMiddlewareOptions);\n },\n}); };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9nZ2VyTWlkZGxld2FyZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9sb2dnZXJNaWRkbGV3YXJlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFZQSxNQUFNLENBQUMsSUFBTSxnQkFBZ0IsR0FBRyxjQUFNLE9BQUEsVUFDcEMsSUFBb0MsRUFDcEMsT0FBZ0MsSUFDRyxPQUFBLFVBQ25DLElBQXFDOzs7OztnQkFFN0IsVUFBVSxHQUE2RSxPQUFPLFdBQXBGLEVBQUUsV0FBVyxHQUFnRSxPQUFPLFlBQXZFLEVBQUUsdUJBQXVCLEdBQXVDLE9BQU8sd0JBQTlDLEVBQUUsTUFBTSxHQUErQixPQUFPLE9BQXRDLEVBQUUsd0JBQXdCLEdBQUssT0FBTyx5QkFBWixDQUFhO2dCQUV0RixxQkFBTSxJQUFJLENBQUMsSUFBSSxDQUFDLEVBQUE7O2dCQUEzQixRQUFRLEdBQUcsU0FBZ0I7Z0JBRWpDLElBQUksQ0FBQyxNQUFNLEVBQUU7b0JBQ1gsc0JBQU8sUUFBUSxFQUFDO2lCQUNqQjtnQkFFRCxJQUFJLE9BQU8sTUFBTSxDQUFDLElB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XNwb25zZS5vdXRwdXQ7XG4gICAgbG9nZ2VyLmluZm8oe1xuICAgICAgY2xpZW50TmFtZSxcbiAgICAgIGNvbW1hbmROYW1lLFxuICAgICAgaW5wdXQ6IGlucHV0RmlsdGVyU2Vuc2l0aXZlTG9nKGFyZ3MuaW5wdXQpLFxuICAgICAgb3V0cHV0OiBvdXRwdXRGaWx0ZXJTZW5zaXRpdmVMb2cob3V0cHV0V2l0aG91dE1ldGFkYXRhKSxcbiAgICAgIG1ldGFkYXRhOiAkbWV0YWRhdGEsXG4gICAgfSk7XG4gIH1cblxuICByZXR1cm4gcmVzcG9uc2U7XG59O1xuXG5leHBvcnQgY29uc3QgbG9nZ2VyTWlkZGxld2FyZU9wdGlvbnM6IEluaXRpYWxpemVIYW5kbGVyT3B0aW9ucyAmIEFic29sdXRlTG9jYXRpb24gPSB7XG4gIG5hbWU6IFwibG9nZ2VyTWlkZGxld2FyZVwiLFxuICB0YWdzOiBbXCJMT0dHRVJcIl0sXG4gIHN0ZXA6IFwiaW5pdGlhbGl6ZVwiLFxuICBvdmVycmlkZTogdHJ1ZSxcbn07XG5cbi8vIGVzbGludC1kaXNhYmxlLW5leHQtbGluZSBAdHlwZXNjcmlwdC1lc2xpbnQvbm8tdW51c2VkLXZhcnNcbmV4cG9ydCBjb25zdCBnZXRMb2dnZXJQbHVnaW4gPSAob3B0aW9uczogYW55KTogUGx1Z2dhYmxlPGFueSwgYW55PiA9PiAoe1xuICBhcHBseVRvU3RhY2s6IChjbGllbnRTdGFjaykgPT4ge1xuICAgIGNsaWVudFN0YWNrLmFkZChsb2dnZXJNaWRkbGV3YXJlKCksIGxvZ2dlck1pZGRsZXdhcmVPcHRpb25zKTtcbiAgfSxcbn0pO1xuIl19","/*! *****************************************************************************\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","export var ALGORITHM_QUERY_PARAM = \"X-Amz-Algorithm\";\nexport var CREDENTIAL_QUERY_PARAM = \"X-Amz-Credential\";\nexport var AMZ_DATE_QUERY_PARAM = \"X-Amz-Date\";\nexport var SIGNED_HEADERS_QUERY_PARAM = \"X-Amz-SignedHeaders\";\nexport var EXPIRES_QUERY_PARAM = \"X-Amz-Expires\";\nexport var SIGNATURE_QUERY_PARAM = \"X-Amz-Signature\";\nexport var TOKEN_QUERY_PARAM = \"X-Amz-Security-Token\";\nexport var AUTH_HEADER = \"authorization\";\nexport var AMZ_DATE_HEADER = AMZ_DATE_QUERY_PARAM.toLowerCase();\nexport var DATE_HEADER = \"date\";\nexport var GENERATED_HEADERS = [AUTH_HEADER, AMZ_DATE_HEADER, DATE_HEADER];\nexport var SIGNATURE_HEADER = SIGNATURE_QUERY_PARAM.toLowerCase();\nexport var SHA256_HEADER = \"x-amz-content-sha256\";\nexport var TOKEN_HEADER = TOKEN_QUERY_PARAM.toLowerCase();\nexport var HOST_HEADER = \"host\";\nexport var ALWAYS_UNSIGNABLE_HEADERS = {\n authorization: true,\n \"cache-control\": true,\n connection: true,\n expect: true,\n from: true,\n \"keep-alive\": true,\n \"max-forwards\": true,\n pragma: true,\n referer: true,\n te: true,\n trailer: true,\n \"transfer-encoding\": true,\n upgrade: true,\n \"user-agent\": true,\n \"x-amzn-trace-id\": true,\n};\nexport var PROXY_HEADER_PATTERN = /^proxy-/;\nexport var SEC_HEADER_PATTERN = /^sec-/;\nexport var UNSIGNABLE_PATTERNS = [/^proxy-/i, /^sec-/i];\nexport var ALGORITHM_IDENTIFIER = \"AWS4-HMAC-SHA256\";\nexport var EVENT_ALGORITHM_IDENTIFIER = \"AWS4-HMAC-SHA256-PAYLOAD\";\nexport var UNSIGNED_PAYLOAD = \"UNSIGNED-PAYLOAD\";\nexport var MAX_CACHE_SIZE = 50;\nexport var KEY_TYPE_IDENTIFIER = \"aws4_request\";\nexport var MAX_PRESIGNED_TTL = 60 * 60 * 24 * 7;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnN0YW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsSUFBTSxxQkFBcUIsR0FBRyxpQkFBaUIsQ0FBQztBQUN2RCxNQUFNLENBQUMsS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X1RUTCA9IDYwICogNjAgKiAyNCAqIDc7XG4iXX0=","import { __awaiter, __generator, __values } from \"tslib\";\nimport { toHex } from \"@aws-sdk/util-hex-encoding\";\nimport { KEY_TYPE_IDENTIFIER, MAX_CACHE_SIZE } from \"./constants\";\nvar signingKeyCache = {};\nvar cacheQueue = [];\n/**\n * Create a string describing the scope of credentials used to sign a request.\n *\n * @param shortDate The current calendar date in the form YYYYMMDD.\n * @param region The AWS region in which the service resides.\n * @param service The service to which the signed request is being sent.\n */\nexport function createScope(shortDate, region, service) {\n return shortDate + \"/\" + region + \"/\" + service + \"/\" + KEY_TYPE_IDENTIFIER;\n}\n/**\n * Derive a signing key from its composite parts\n *\n * @param sha256Constructor A constructor function that can instantiate SHA-256\n * hash objects.\n * @param credentials The credentials with which the request will be\n * signed.\n * @param shortDate The current calendar date in the form YYYYMMDD.\n * @param region The AWS region in which the service resides.\n * @param service The service to which the signed request is being\n * sent.\n */\nexport var getSigningKey = function (sha256Constructor, credentials, shortDate, region, service) { return __awaiter(void 0, void 0, void 0, function () {\n var credsHash, cacheKey, key, _a, _b, signable, e_1_1;\n var e_1, _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0: return [4 /*yield*/, hmac(sha256Constructor, credentials.secretAccessKey, credentials.accessKeyId)];\n case 1:\n credsHash = _d.sent();\n cacheKey = shortDate + \":\" + region + \":\" + service + \":\" + toHex(credsHash) + \":\" + credentials.sessionToken;\n if (cacheKey in signingKeyCache) {\n return [2 /*return*/, signingKeyCache[cacheKey]];\n }\n cacheQueue.push(cacheKey);\n while (cacheQueue.length > MAX_CACHE_SIZE) {\n delete signingKeyCache[cacheQueue.shift()];\n }\n key = \"AWS4\" + credentials.secretAccessKey;\n _d.label = 2;\n case 2:\n _d.trys.push([2, 7, 8, 9]);\n _a = __values([shortDate, region, service, KEY_TYPE_IDENTIFIER]), _b = _a.next();\n _d.label = 3;\n case 3:\n if (!!_b.done) return [3 /*break*/, 6];\n signable = _b.value;\n return [4 /*yield*/, hmac(sha256Constructor, key, signable)];\n case 4:\n key = _d.sent();\n _d.label = 5;\n case 5:\n _b = _a.next();\n return [3 /*break*/, 3];\n case 6: return [3 /*break*/, 9];\n case 7:\n e_1_1 = _d.sent();\n e_1 = { error: e_1_1 };\n return [3 /*break*/, 9];\n case 8:\n try {\n if (_b && !_b.done && (_c = _a.return)) _c.call(_a);\n }\n finally { if (e_1) throw e_1.error; }\n return [7 /*endfinally*/];\n case 9: return [2 /*return*/, (signingKeyCache[cacheKey] = key)];\n }\n });\n}); };\n/**\n * @internal\n */\nexport function clearCredentialCache() {\n cacheQueue.length = 0;\n Object.keys(signingKeyCache).forEach(function (cacheKey) {\n delete signingKeyCache[cacheKey];\n });\n}\nfunction hmac(ctor, secret, data) {\n var hash = new ctor(secret);\n hash.update(data);\n return hash.digest();\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3JlZGVudGlhbERlcml2YXRpb24uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY3JlZGVudGlhbERlcml2YXRpb24udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLE9BQU8sRUFBRSxLQUFLLEVBQUUsTUFBTSw0QkFBNEIsQ0FBQztBQUVuRCxPQUFPLEVBQUUsbUJBQW1CLEVBQUUsY0FBYyxFQUFFLE1BQU0sYUFBYSxDQUFDO0FBRWxFLElBQU0sZUFBZSxHQUFrQyxFQUFFLENBQUM7QUFDMUQsSUFBTSxVQUFVLEdBQWtCLEVBQUUsQ0FBQztBQUVyQzs7Ozs7O0dBTUc7QUFDSCxNQUFNLFVBQVUsV0FBVyxDQUFDLFNBQWlCLEVBQUUsTUFBYyxFQUFFLE9BQWU7SUFDNUUsT0FBVSxTQUFTLFNBQUksTUFBTSxTQUFJLE9BQU8sU0FBSSxtQkFBcUIsQ0FBQztBQUNwRSxDQUFDO0FBRUQ7Ozs7Ozs7Ozs7O0dBV0c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ID0gYEFXUzQke2NyZWRlbnRpYWxzLnNlY3JldEFjY2Vzc0tleX1gO1xuICBmb3IgKGNvbnN0IHNpZ25hYmxlIG9mIFtzaG9ydERhdGUsIHJlZ2lvbiwgc2VydmljZSwgS0VZX1RZUEVfSURFTlRJRklFUl0pIHtcbiAgICBrZXkgPSBhd2FpdCBobWFjKHNoYTI1NkNvbnN0cnVjdG9yLCBrZXksIHNpZ25hYmxlKTtcbiAgfVxuICByZXR1cm4gKHNpZ25pbmdLZXlDYWNoZVtjYWNoZUtleV0gPSBrZXkgYXMgVWludDhBcnJheSk7XG59O1xuXG4vKipcbiAqIEBpbnRlcm5hbFxuICovXG5leHBvcnQgZnVuY3Rpb24gY2xlYXJDcmVkZW50aWFsQ2FjaGUoKTogdm9pZCB7XG4gIGNhY2hlUXVldWUubGVuZ3RoID0gMDtcbiAgT2JqZWN0LmtleXMoc2lnbmluZ0tleUNhY2hlKS5mb3JFYWNoKChjYWNoZUtleSkgPT4ge1xuICAgIGRlbGV0ZSBzaWduaW5nS2V5Q2FjaGVbY2FjaGVLZXldO1xuICB9KTtcbn1cblxuZnVuY3Rpb24gaG1hYyhjdG9yOiBIYXNoQ29uc3RydWN0b3IsIHNlY3JldDogU291cmNlRGF0YSwgZGF0YTogU291cmNlRGF0YSk6IFByb21pc2U8VWludDhBcnJheT4ge1xuICBjb25zdCBoYXNoID0gbmV3IGN0b3Ioc2VjcmV0KTtcbiAgaGFzaC51cGRhdGUoZGF0YSk7XG4gIHJldHVybiBoYXNoLmRpZ2VzdCgpO1xufVxuIl19","import { __values } from \"tslib\";\nimport { ALWAYS_UNSIGNABLE_HEADERS, PROXY_HEADER_PATTERN, SEC_HEADER_PATTERN } from \"./constants\";\n/**\n * @internal\n */\nexport function getCanonicalHeaders(_a, unsignableHeaders, signableHeaders) {\n var e_1, _b;\n var headers = _a.headers;\n var canonical = {};\n try {\n for (var _c = __values(Object.keys(headers).sort()), _d = _c.next(); !_d.done; _d = _c.next()) {\n var headerName = _d.value;\n var canonicalHeaderName = headerName.toLowerCase();\n if (canonicalHeaderName in ALWAYS_UNSIGNABLE_HEADERS || (unsignableHeaders === null || unsignableHeaders === void 0 ? void 0 : unsignableHeaders.has(canonicalHeaderName)) ||\n PROXY_HEADER_PATTERN.test(canonicalHeaderName) ||\n SEC_HEADER_PATTERN.test(canonicalHeaderName)) {\n if (!signableHeaders || (signableHeaders && !signableHeaders.has(canonicalHeaderName))) {\n continue;\n }\n }\n canonical[canonicalHeaderName] = headers[headerName].trim().replace(/\\s+/g, \" \");\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return canonical;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0Q2Fub25pY2FsSGVhZGVycy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9nZXRDYW5vbmljYWxIZWFkZXJzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFFQSxPQUFPLEVBQUUseUJBQXlCLEVBQUUsb0JBQW9CLEVBQUUsa0JBQWtCLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFFbEc7O0dBRUc7QUFDSCxNQUFNLFVBQVUsbUJBQW1CLENBQ2pDLEVBQXdCLEVBQ3hCLGlCQUErQixFQUMvQixlQUE2Qjs7UUFGM0IsT0FBTyxhQUFBO0lBSVQsSUFBTSxTQUFTLEdBQWMsRUFBRSxDQUFDOztRQUNoQyxLQUF5QixJQUFBLEtBQUEsU0FBQSxNQUFNLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxDQUFDLElBQUksRUFBRSxDQUFBLGdCQUFBLDRCQUFFO1lBQWpELElBQU0sVUFBVSxXQUFBO1lBQ25CLElBQU0sbUJBQW1CLEdBQUcsVUFBVSxDQUFDLFdBQVcsRUFBR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RyaW5nPlxuKTogSGVhZGVyQmFnIHtcbiAgY29uc3QgY2Fub25pY2FsOiBIZWFkZXJCYWcgPSB7fTtcbiAgZm9yIChjb25zdCBoZWFkZXJOYW1lIG9mIE9iamVjdC5rZXlzKGhlYWRlcnMpLnNvcnQoKSkge1xuICAgIGNvbnN0IGNhbm9uaWNhbEhlYWRlck5hbWUgPSBoZWFkZXJOYW1lLnRvTG93ZXJDYXNlKCk7XG4gICAgaWYgKFxuICAgICAgY2Fub25pY2FsSGVhZGVyTmFtZSBpbiBBTFdBWVNfVU5TSUdOQUJMRV9IRUFERVJTIHx8XG4gICAgICB1bnNpZ25hYmxlSGVhZGVycz8uaGFzKGNhbm9uaWNhbEhlYWRlck5hbWUpIHx8XG4gICAgICBQUk9YWV9IRUFERVJfUEFUVEVSTi50ZXN0KGNhbm9uaWNhbEhlYWRlck5hbWUpIHx8XG4gICAgICBTRUNfSEVBREVSX1BBVFRFUk4udGVzdChjYW5vbmljYWxIZWFkZXJOYW1lKVxuICAgICkge1xuICAgICAgaWYgKCFzaWduYWJsZUhlYWRlcnMgfHwgKHNpZ25hYmxlSGVhZGVycyAmJiAhc2lnbmFibGVIZWFkZXJzLmhhcyhjYW5vbmljYWxIZWFkZXJOYW1lKSkpIHtcbiAgICAgICAgY29udGludWU7XG4gICAgICB9XG4gICAgfVxuXG4gICAgY2Fub25pY2FsW2Nhbm9uaWNhbEhlYWRlck5hbWVdID0gaGVhZGVyc1toZWFkZXJOYW1lXS50cmltKCkucmVwbGFjZSgvXFxzKy9nLCBcIiBcIik7XG4gIH1cblxuICByZXR1cm4gY2Fub25pY2FsO1xufVxuIl19","export var escapeUri = function (uri) {\n // AWS percent-encodes some extra non-standard characters in a URI\n return encodeURIComponent(uri).replace(/[!'()*]/g, hexEncode);\n};\nvar hexEncode = function (c) { return \"%\" + c.charCodeAt(0).toString(16).toUpperCase(); };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXNjYXBlLXVyaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9lc2NhcGUtdXJpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE1BQU0sQ0FBQyxJQUFNLFNBQVMsR0FBRyxVQUFDLEdBQVc7SUFDbkMsa0VBQWtFO0lBQ2xFLE9BQUEsa0JBQWtCLENBQUMsR0FBRyxDQUFDLENBQUMsT0FBTyxDQUFDLFVBQVUsRUFBRSxTQUFTLENBQUM7QUFBdEQsQ0FBc0QsQ0FBQztBQUV6RCxJQUFNLFNBQVMsR0FBRyxVQUFDLENBQVMsSUFBSyxPQUFBLE1BQUksQ0FBQyxDQUFDLFVBQVUsQ0FBQyxDQUFDLENBQUMsQ0FBQyxRQUFRLENBQUMsRUFBRSxDQUFDLENBQUMsV0FBVyxFQUFJLEVBQWhELENBQWdELENBQUMiLCJzb3VyY2VzQ29udGVudCI6WyJleHBvcnQgY29uc3QgZXNjYXBlVXJpID0gKHVyaTogc3RyaW5nKTogc3RyaW5nID0+XG4gIC8vIEFXUyBwZXJjZW50LWVuY29kZXMgc29tZSBleHRyYSBub24tc3RhbmRhcmQgY2hhcmFjdGVycyBpbiBhIFVSSVxuICBlbmNvZGVVUklDb21wb25lbnQodXJpKS5yZXBsYWNlKC9bIScoKSpdL2csIGhleEVuY29kZSk7XG5cbmNvbnN0IGhleEVuY29kZSA9IChjOiBzdHJpbmcpID0+IGAlJHtjLmNoYXJDb2RlQXQoMCkudG9TdHJpbmcoMTYpLnRvVXBwZXJDYXNlKCl9YDtcbiJdfQ==","import { __values } from \"tslib\";\nimport { escapeUri } from \"@aws-sdk/util-uri-escape\";\nimport { SIGNATURE_HEADER } from \"./constants\";\n/**\n * @internal\n */\nexport function getCanonicalQuery(_a) {\n var e_1, _b;\n var _c = _a.query, query = _c === void 0 ? {} : _c;\n var keys = [];\n var serialized = {};\n var _loop_1 = function (key) {\n if (key.toLowerCase() === SIGNATURE_HEADER) {\n return \"continue\";\n }\n keys.push(key);\n var value = query[key];\n if (typeof value === \"string\") {\n serialized[key] = escapeUri(key) + \"=\" + escapeUri(value);\n }\n else if (Array.isArray(value)) {\n serialized[key] = value\n .slice(0)\n .sort()\n .reduce(function (encoded, value) { return encoded.concat([escapeUri(key) + \"=\" + escapeUri(value)]); }, [])\n .join(\"&\");\n }\n };\n try {\n for (var _d = __values(Object.keys(query).sort()), _e = _d.next(); !_e.done; _e = _d.next()) {\n var key = _e.value;\n _loop_1(key);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_e && !_e.done && (_b = _d.return)) _b.call(_d);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return keys\n .map(function (key) { return serialized[key]; })\n .filter(function (serialized) { return serialized; }) // omit any falsy values\n .join(\"&\");\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2V0Q2Fub25pY2FsUXVlcnkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZ2V0Q2Fub25pY2FsUXVlcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUNBLE9BQU8sRUFBRSxTQUFTLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUVyRCxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxhQUFhLENBQUM7QUFFL0M7O0dBRUc7QUFDSCxNQUFNLFVBQVUsaUJBQWlCLENBQUMsRUFBMkI7O1FBQXpCLGFBQVUsRUFBVixLQUFLLG1CQUFHLEVBQUUsS0FBQTtJQUM1QyxJQUFNLElBQUksR0FBa0IsRUFBRSxDQUFDO0lBQy9CLElBQU0sVUFBVSxHQUE4QixFQUFFLENBQUM7NEJBQ3RDLEdBQUc7UUFDWixJQUFJLEdBQUcsQ0FBQyxXQUFXLEVBQUUsS0FBSyxnQkFBZ0IsRUFBRTs7U0FFM0M7UUFFRCxJQUFJL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uICAgICAgICAuc29ydCgpXG4gICAgICAgIC5yZWR1Y2UoXG4gICAgICAgICAgKGVuY29kZWQ6IEFycmF5PHN0cmluZz4sIHZhbHVlOiBzdHJpbmcpID0+IGVuY29kZWQuY29uY2F0KFtgJHtlc2NhcGVVcmkoa2V5KX09JHtlc2NhcGVVcmkodmFsdWUpfWBdKSxcbiAgICAgICAgICBbXVxuICAgICAgICApXG4gICAgICAgIC5qb2luKFwiJlwiKTtcbiAgICB9XG4gIH1cblxuICByZXR1cm4ga2V5c1xuICAgIC5tYXAoKGtleSkgPT4gc2VyaWFsaXplZFtrZXldKVxuICAgIC5maWx0ZXIoKHNlcmlhbGl6ZWQpID0+IHNlcmlhbGl6ZWQpIC8vIG9taXQgYW55IGZhbHN5IHZhbHVlc1xuICAgIC5qb2luKFwiJlwiKTtcbn1cbiJdfQ==","export var isArrayBuffer = function (arg) {\n return (typeof ArrayBuffer === \"function\" && arg instanceof ArrayBuffer) ||\n Object.prototype.toString.call(arg) === \"[object ArrayBuffer]\";\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxDQUFDLElBQU0sYUFBYSxHQUFHLFVBQUMsR0FBUTtJQUNwQyxPQUFBLENBQUMsT0FBTyxXQUFXLEtBQUssVUFBVSxJQUFJLEdBQUcsWUFBWSxXQUFXLENBQUM7UUFDakUsTUFBTSxDQUFDLFNBQVMsQ0FBQyxRQUFRLENBQUMsSUFBSSxDQUFDLEdBQUcsQ0FBQyxLQUFLLHNCQUFzQjtBQUQ5RCxDQUM4RCxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IGlzQXJyYXlCdWZmZXIgPSAoYXJnOiBhbnkpOiBhcmcgaXMgQXJyYXlCdWZmZXIgPT5cbiAgKHR5cGVvZiBBcnJheUJ1ZmZlciA9PT0gXCJmdW5jdGlvblwiICYmIGFyZyBpbnN0YW5jZW9mIEFycmF5QnVmZmVyKSB8fFxuICBPYmplY3QucHJvdG90eXBlLnRvU3RyaW5nLmNhbGwoYXJnKSA9PT0gXCJbb2JqZWN0IEFycmF5QnVmZmVyXVwiO1xuIl19","import { __awaiter, __generator, __values } from \"tslib\";\nimport { isArrayBuffer } from \"@aws-sdk/is-array-buffer\";\nimport { toHex } from \"@aws-sdk/util-hex-encoding\";\nimport { SHA256_HEADER, UNSIGNED_PAYLOAD } from \"./constants\";\n/**\n * @internal\n */\nexport function getPayloadHash(_a, hashConstructor) {\n var headers = _a.headers, body = _a.body;\n return __awaiter(this, void 0, void 0, function () {\n var _b, _c, headerName, hashCtor, _d;\n var e_1, _e;\n return __generator(this, function (_f) {\n switch (_f.label) {\n case 0:\n try {\n for (_b = __values(Object.keys(headers)), _c = _b.next(); !_c.done; _c = _b.next()) {\n headerName = _c.value;\n if (headerName.toLowerCase() === SHA256_HEADER) {\n return [2 /*return*/, headers[headerName]];\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_e = _b.return)) _e.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n if (!(body == undefined)) return [3 /*break*/, 1];\n return [2 /*return*/, \"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855\"];\n case 1:\n if (!(typeof body === \"string\" || ArrayBuffer.isView(body) || isArrayBuffer(body))) return [3 /*break*/, 3];\n hashCtor = new hashConstructor();\n hashCtor.update(body);\n _d = toHex;\n return [4 /*yield*/, hashCtor.digest()];\n case 2: return [2 /*return*/, _d.apply(void 0, [_f.sent()])];\n case 3: \n // As any defined body that is not a string or binary data is a stream, this\n // body is unsignable. Attempt to send the request with an unsigned payload,\n // which may or may not be accepted by the service.\n return [2 /*return*/, UNSIGNED_PAYLOAD];\n }\n });\n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ZHkgPT0gdW5kZWZpbmVkKSB7XG4gICAgcmV0dXJuIFwiZTNiMGM0NDI5OGZjMWMxNDlhZmJmNGM4OTk2ZmI5MjQyN2FlNDFlNDY0OWI5MzRjYTQ5NTk5MWI3ODUyYjg1NVwiO1xuICB9IGVsc2UgaWYgKHR5cGVvZiBib2R5ID09PSBcInN0cmluZ1wiIHx8IEFycmF5QnVmZmVyLmlzVmlldyhib2R5KSB8fCBpc0FycmF5QnVmZmVyKGJvZHkpKSB7XG4gICAgY29uc3QgaGFzaEN0b3IgPSBuZXcgaGFzaENvbnN0cnVjdG9yKCk7XG4gICAgaGFzaEN0b3IudXBkYXRlKGJvZHkpO1xuICAgIHJldHVybiB0b0hleChhd2FpdCBoYXNoQ3Rvci5kaWdlc3QoKSk7XG4gIH1cblxuICAvLyBBcyBhbnkgZGVmaW5lZCBib2R5IHRoYXQgaXMgbm90IGEgc3RyaW5nIG9yIGJpbmFyeSBkYXRhIGlzIGEgc3RyZWFtLCB0aGlzXG4gIC8vIGJvZHkgaXMgdW5zaWduYWJsZS4gQXR0ZW1wdCB0byBzZW5kIHRoZSByZXF1ZXN0IHdpdGggYW4gdW5zaWduZWQgcGF5bG9hZCxcbiAgLy8gd2hpY2ggbWF5IG9yIG1heSBub3QgYmUgYWNjZXB0ZWQgYnkgdGhlIHNlcnZpY2UuXG4gIHJldHVybiBVTlNJR05FRF9QQVlMT0FEO1xufVxuIl19","import { __values } from \"tslib\";\nexport function hasHeader(soughtHeader, headers) {\n var e_1, _a;\n soughtHeader = soughtHeader.toLowerCase();\n try {\n for (var _b = __values(Object.keys(headers)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var headerName = _c.value;\n if (soughtHeader === headerName.toLowerCase()) {\n return true;\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return false;\n}\n//# sourceMappingURL=data:application/json;base64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*/\nexport function cloneRequest(_a) {\n var headers = _a.headers, query = _a.query, rest = __rest(_a, [\"headers\", \"query\"]);\n return __assign(__assign({}, rest), { headers: __assign({}, headers), query: query ? cloneQuery(query) : undefined });\n}\nfunction cloneQuery(query) {\n return Object.keys(query).reduce(function (carry, paramName) {\n var _a;\n var param = query[paramName];\n return __assign(__assign({}, carry), (_a = {}, _a[paramName] = Array.isArray(param) ? __spread(param) : param, _a));\n }, {});\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xvbmVSZXF1ZXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2Nsb25lUmVxdWVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBRUE7O0dBRUc7QUFDSCxNQUFNLFVBQVUsWUFBWSxDQUFDLEVBQXdDO0lBQXRDLElBQUEsT0FBTyxhQUFBLEVBQUUsS0FBSyxXQUFBLEVBQUssSUFBSSxjQUF6QixvQkFBMkIsQ0FBRjtJQUNwRCw2QkFDSyxJQUFJLEtBQ1AsT0FBTyxlQUFPLE9BQU8sR0FDckIsS0FBSyxFQUFFLEtBQUssQ0FBQyxDQUFDLENBQUMsVUFBVSxDQUFDLEtBQUssQ0FBQyxDQUFDLENBQUMsQ0FBQyxTQUFTLElBQzVDO0FBQ0osQ0FBQztBQUVELFNBQVMsVUFBVSxDQUFDLEtBQXdCO0lBQzFDLE9BQU8sTUFBTSxDQUFDLElBQUksQ0FBQyxLQUFLLENBQUMsQ0FBQyxNQUFNLENBQUMsVUFBQyxLQUF3QixFQUFFLFNBQWlCOztRQUMzRSxJQUFNLEtBQUssR0FBRyxLQUFLLENBQUMsU0FBUyxDQUFDLENBQUM7UUFDL0IsNkJBQ0ssS0FBSyxnQkFDUCxTQUFTLElBQUcsS0FBSyxDQUFDLE9BQU8sQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLFVBQUssS0FBSyxFQUFFLENBQUMsQ0FBQyxLQUFLLE9BQ3REO0lBQ0osQ0FBQyxFQUFFLEVBQUUsQ0FBQyxDQUFDO0FBQ1QsQ0FBQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IEh0dHBSZXF1ZXN0LCBRdWVyeVBhcmFtZXRlckJhZyB9IGZyb20gXCJAYXdzLXNkay90eXBlc1wiO1xuXG4vKipcbiAqIEBpbnRlcm5hbFxuICovXG5leHBvcnQgZnVuY3Rpb24gY2xvbmVSZXF1ZXN0KHsgaGVhZGVycywgcXVlcnksIC4uLnJlc3QgfTogSHR0cFJlcXVlc3QpOiBIdHRwUmVxdWVzdCB7XG4gIHJldHVybiB7XG4gICAgLi4ucmVzdCxcbiAgICBoZWFkZXJzOiB7IC4uLmhlYWRlcnMgfSxcbiAgICBxdWVyeTogcXVlcnkgPyBjbG9uZVF1ZXJ5KHF1ZXJ5KSA6IHVuZGVmaW5lZCxcbiAgfTtcbn1cblxuZnVuY3Rpb24gY2xvbmVRdWVyeShxdWVyeTogUXVlcnlQYXJhbWV0ZXJCYWcpOiBRdWVyeVBhcmFtZXRlckJhZyB7XG4gIHJldHVybiBPYmplY3Qua2V5cyhxdWVyeSkucmVkdWNlKChjYXJyeTogUXVlcnlQYXJhbWV0ZXJCYWcsIHBhcmFtTmFtZTogc3RyaW5nKSA9PiB7XG4gICAgY29uc3QgcGFyYW0gPSBxdWVyeVtwYXJhbU5hbWVdO1xuICAgIHJldHVybiB7XG4gICAgICAuLi5jYXJyeSxcbiAgICAgIFtwYXJhbU5hbWVdOiBBcnJheS5pc0FycmF5KHBhcmFtKSA/IFsuLi5wYXJhbV0gOiBwYXJhbSxcbiAgICB9O1xuICB9LCB7fSk7XG59XG4iXX0=","import { __assign, __values } from \"tslib\";\nimport { cloneRequest } from \"./cloneRequest\";\n/**\n * @internal\n */\nexport function moveHeadersToQuery(request, options) {\n var e_1, _a;\n var _b;\n if (options === void 0) { options = {}; }\n var _c = typeof request.clone === \"function\" ? request.clone() : cloneRequest(request), headers = _c.headers, _d = _c.query, query = _d === void 0 ? {} : _d;\n try {\n for (var _e = __values(Object.keys(headers)), _f = _e.next(); !_f.done; _f = _e.next()) {\n var name = _f.value;\n var lname = name.toLowerCase();\n if (lname.substr(0, 6) === \"x-amz-\" && !((_b = options.unhoistableHeaders) === null || _b === void 0 ? void 0 : _b.has(lname))) {\n query[name] = headers[name];\n delete headers[name];\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_f && !_f.done && (_a = _e.return)) _a.call(_e);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return __assign(__assign({}, request), { headers: headers,\n query: query });\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibW92ZUhlYWRlcnNUb1F1ZXJ5LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL21vdmVIZWFkZXJzVG9RdWVyeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBRUEsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBRTlDOztHQUVHO0FBQ0gsTUFBTSxVQUFVLGtCQUFrQixDQUNoQyxPQUFvQixFQUNwQixPQUFrRDs7O0lBQWxELHdCQUFBLEVBQUEsWUFBa0Q7SUFFNUMsSUFBQSxLQUNKLE9BQVEsT0FBZSxDQUFDLEtBQUssS0FBSyxVQUFVLENBQUMsQ0FBQyxDQUFFLE9BQWUsQ0FBQyxLQUFLLEVBQUUsQ0FBQyxDQUFDLENBQUMsWUFBWSxDQUFDLE9BQU8sQ0FBQyxFQUR6RixPQUFPLGFBQUEsRUFBRSxhQUErQixFQUEvQixLQUFLLG1CQUFHLEVBQXVCLEtBQ2lELENBQUM7O1FBQ2xHLEtBQW1CLElBQUEsS0FBQSxTQUFBLE1BQU0sQ0FBQyxJQUFJLENBQUMsT0FBTyxDQUFDLENBQUEsZ0JBQUEsNE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T09IFwiZnVuY3Rpb25cIiA/IChyZXF1ZXN0IGFzIGFueSkuY2xvbmUoKSA6IGNsb25lUmVxdWVzdChyZXF1ZXN0KTtcbiAgZm9yIChjb25zdCBuYW1lIG9mIE9iamVjdC5rZXlzKGhlYWRlcnMpKSB7XG4gICAgY29uc3QgbG5hbWUgPSBuYW1lLnRvTG93ZXJDYXNlKCk7XG4gICAgaWYgKGxuYW1lLnN1YnN0cigwLCA2KSA9PT0gXCJ4LWFtei1cIiAmJiAhb3B0aW9ucy51bmhvaXN0YWJsZUhlYWRlcnM/LmhhcyhsbmFtZSkpIHtcbiAgICAgIHF1ZXJ5W25hbWVdID0gaGVhZGVyc1tuYW1lXTtcbiAgICAgIGRlbGV0ZSBoZWFkZXJzW25hbWVdO1xuICAgIH1cbiAgfVxuXG4gIHJldHVybiB7XG4gICAgLi4ucmVxdWVzdCxcbiAgICBoZWFkZXJzLFxuICAgIHF1ZXJ5LFxuICB9O1xufVxuIl19","import { __values } from \"tslib\";\nimport { cloneRequest } from \"./cloneRequest\";\nimport { GENERATED_HEADERS } from \"./constants\";\n/**\n * @internal\n */\nexport function prepareRequest(request) {\n var e_1, _a;\n // Create a clone of the request object that does not clone the body\n request = typeof request.clone === \"function\" ? request.clone() : cloneRequest(request);\n try {\n for (var _b = __values(Object.keys(request.headers)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var headerName = _c.value;\n if (GENERATED_HEADERS.indexOf(headerName.toLowerCase()) > -1) {\n delete request.headers[headerName];\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return request;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHJlcGFyZVJlcXVlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHJlcGFyZVJlcXVlc3QudHMiX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vbiBwcmVwYXJlUmVxdWVzdChyZXF1ZXN0OiBIdHRwUmVxdWVzdCk6IEh0dHBSZXF1ZXN0IHtcbiAgLy8gQ3JlYXRlIGEgY2xvbmUgb2YgdGhlIHJlcXVlc3Qgb2JqZWN0IHRoYXQgZG9lcyBub3QgY2xvbmUgdGhlIGJvZHlcbiAgcmVxdWVzdCA9IHR5cGVvZiAocmVxdWVzdCBhcyBhbnkpLmNsb25lID09PSBcImZ1bmN0aW9uXCIgPyAocmVxdWVzdCBhcyBhbnkpLmNsb25lKCkgOiBjbG9uZVJlcXVlc3QocmVxdWVzdCk7XG5cbiAgZm9yIChjb25zdCBoZWFkZXJOYW1lIG9mIE9iamVjdC5rZXlzKHJlcXVlc3QuaGVhZGVycykpIHtcbiAgICBpZiAoR0VORVJBVEVEX0hFQURFUlMuaW5kZXhPZihoZWFkZXJOYW1lLnRvTG93ZXJDYXNlKCkpID4gLTEpIHtcbiAgICAgIGRlbGV0ZSByZXF1ZXN0LmhlYWRlcnNbaGVhZGVyTmFtZV07XG4gICAgfVxuICB9XG5cbiAgcmV0dXJuIHJlcXVlc3Q7XG59XG4iXX0=","export function iso8601(time) {\n return toDate(time)\n .toISOString()\n .replace(/\\.\\d{3}Z$/, \"Z\");\n}\nexport function toDate(time) {\n if (typeof time === \"number\") {\n return new Date(time * 1000);\n }\n if (typeof time === \"string\") {\n if (Number(time)) {\n return new Date(Number(time) * 1000);\n }\n return new Date(time);\n }\n return time;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbERhdGUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdXRpbERhdGUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsTUFBTSxVQUFVLE9BQU8sQ0FBQyxJQUE0QjtJQUNsRCxPQUFPLE1BQU0sQ0FBQyxJQUFJLENBQUM7U0FDaEIsV0FBVyxFQUFFO1NBQ2IsT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ICByZXR1cm4gbmV3IERhdGUodGltZSk7XG4gIH1cblxuICByZXR1cm4gdGltZTtcbn1cbiJdfQ==","import { __awaiter, __generator } from \"tslib\";\nimport { toHex } from \"@aws-sdk/util-hex-encoding\";\nimport { ALGORITHM_IDENTIFIER, ALGORITHM_QUERY_PARAM, AMZ_DATE_HEADER, AMZ_DATE_QUERY_PARAM, AUTH_HEADER, CREDENTIAL_QUERY_PARAM, EVENT_ALGORITHM_IDENTIFIER, EXPIRES_QUERY_PARAM, MAX_PRESIGNED_TTL, SHA256_HEADER, SIGNATURE_QUERY_PARAM, SIGNED_HEADERS_QUERY_PARAM, TOKEN_HEADER, TOKEN_QUERY_PARAM, } from \"./constants\";\nimport { createScope, getSigningKey } from \"./credentialDerivation\";\nimport { getCanonicalHeaders } from \"./getCanonicalHeaders\";\nimport { getCanonicalQuery } from \"./getCanonicalQuery\";\nimport { getPayloadHash } from \"./getPayloadHash\";\nimport { hasHeader } from \"./hasHeader\";\nimport { moveHeadersToQuery } from \"./moveHeadersToQuery\";\nimport { prepareRequest } from \"./prepareRequest\";\nimport { iso8601 } from \"./utilDate\";\nvar SignatureV4 = /** @class */ (function () {\n function SignatureV4(_a) {\n var applyChecksum = _a.applyChecksum, credentials = _a.credentials, region = _a.region, service = _a.service, sha256 = _a.sha256, _b = _a.uriEscapePath, uriEscapePath = _b === void 0 ? true : _b;\n this.service = service;\n this.sha256 = sha256;\n this.uriEscapePath = uriEscapePath;\n // default to true if applyChecksum isn't set\n this.applyChecksum = typeof applyChecksum === \"boolean\" ? applyChecksum : true;\n this.regionProvider = normalizeRegionProvider(region);\n this.credentialProvider = normalizeCredentialsProvider(credentials);\n }\n SignatureV4.prototype.presign = function (originalRequest, options) {\n if (options === void 0) { options = {}; }\n return __awaiter(this, void 0, void 0, function () {\n var _a, signingDate, _b, expiresIn, unsignableHeaders, unhoistableHeaders, signableHeaders, signingRegion, signingService, credentials, region, _c, _d, longDate, shortDate, scope, request, canonicalHeaders, _e, _f, _g, _h, _j, _k;\n return __generator(this, function (_l) {\n switch (_l.label) {\n case 0:\n _a = options.signingDate, signingDate = _a === void 0 ? new Date() : _a, _b = options.expiresIn, expiresIn = _b === void 0 ? 3600 : _b, unsignableHeaders = options.unsignableHeaders, unhoistableHeaders = options.unhoistableHeaders, signableHeaders = options.signableHeaders, signingRegion = options.signingRegion, signingService = options.signingService;\n return [4 /*yield*/, this.credentialProvider()];\n case 1:\n credentials = _l.sent();\n if (!(signingRegion !== null && signingRegion !== void 0)) return [3 /*break*/, 2];\n _c = signingRegion;\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, this.regionProvider()];\n case 3:\n _c = (_l.sent());\n _l.label = 4;\n case 4:\n region = _c;\n _d = formatDate(signingDate), longDate = _d.longDate, shortDate = _d.shortDate;\n if (expiresIn > MAX_PRESIGNED_TTL) {\n return [2 /*return*/, Promise.reject(\"Signature version 4 presigned URLs\" + \" must have an expiration date less than one week in\" + \" the future\")];\n }\n scope = createScope(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service);\n request = moveHeadersToQuery(prepareRequest(originalRequest), { unhoistableHeaders: unhoistableHeaders });\n if (credentials.sessionToken) {\n request.query[TOKEN_QUERY_PARAM] = credentials.sessionToken;\n }\n request.query[ALGORITHM_QUERY_PARAM] = ALGORITHM_IDENTIFIER;\n request.query[CREDENTIAL_QUERY_PARAM] = credentials.accessKeyId + \"/\" + scope;\n request.query[AMZ_DATE_QUERY_PARAM] = longDate;\n request.query[EXPIRES_QUERY_PARAM] = expiresIn.toString(10);\n canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);\n request.query[SIGNED_HEADERS_QUERY_PARAM] = getCanonicalHeaderList(canonicalHeaders);\n _e = request.query;\n _f = SIGNATURE_QUERY_PARAM;\n _g = this.getSignature;\n _h = [longDate,\n scope,\n this.getSigningKey(credentials, region, shortDate, signingService)];\n _j = this.createCanonicalRequest;\n _k = [request, canonicalHeaders];\n return [4 /*yield*/, getPayloadHash(originalRequest, this.sha256)];\n case 5: return [4 /*yield*/, _g.apply(this, _h.concat([_j.apply(this, _k.concat([_l.sent()]))]))];\n case 6:\n _e[_f] = _l.sent();\n return [2 /*return*/, request];\n }\n });\n });\n };\n SignatureV4.prototype.sign = function (toSign, options) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (typeof toSign === \"string\") {\n return [2 /*return*/, this.signString(toSign, options)];\n }\n else if (toSign.headers && toSign.payload) {\n return [2 /*return*/, this.signEvent(toSign, options)];\n }\n else {\n return [2 /*return*/, this.signRequest(toSign, options)];\n }\n return [2 /*return*/];\n });\n });\n };\n SignatureV4.prototype.signEvent = function (_a, _b) {\n var headers = _a.headers, payload = _a.payload;\n var _c = _b.signingDate, signingDate = _c === void 0 ? new Date() : _c, priorSignature = _b.priorSignature, signingRegion = _b.signingRegion, signingService = _b.signingService;\n return __awaiter(this, void 0, void 0, function () {\n var region, _d, _e, shortDate, longDate, scope, hashedPayload, hash, hashedHeaders, _f, stringToSign;\n return __generator(this, function (_g) {\n switch (_g.label) {\n case 0:\n if (!(signingRegion !== null && signingRegion !== void 0)) return [3 /*break*/, 1];\n _d = signingRegion;\n return [3 /*break*/, 3];\n case 1: return [4 /*yield*/, this.regionProvider()];\n case 2:\n _d = (_g.sent());\n _g.label = 3;\n case 3:\n region = _d;\n _e = formatDate(signingDate), shortDate = _e.shortDate, longDate = _e.longDate;\n scope = createScope(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service);\n return [4 /*yield*/, getPayloadHash({ headers: {}, body: payload }, this.sha256)];\n case 4:\n hashedPayload = _g.sent();\n hash = new this.sha256();\n hash.update(headers);\n _f = toHex;\n return [4 /*yield*/, hash.digest()];\n case 5:\n hashedHeaders = _f.apply(void 0, [_g.sent()]);\n stringToSign = [\n EVENT_ALGORITHM_IDENTIFIER,\n longDate,\n scope,\n priorSignature,\n hashedHeaders,\n hashedPayload,\n ].join(\"\\n\");\n return [2 /*return*/, this.signString(stringToSign, { signingDate: signingDate, signingRegion: region, signingService: signingService })];\n }\n });\n });\n };\n SignatureV4.prototype.signString = function (stringToSign, _a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.signingDate, signingDate = _c === void 0 ? new Date() : _c, signingRegion = _b.signingRegion, signingService = _b.signingService;\n return __awaiter(this, void 0, void 0, function () {\n var credentials, region, _d, shortDate, hash, _e, _f, _g;\n return __generator(this, function (_h) {\n switch (_h.label) {\n case 0: return [4 /*yield*/, this.credentialProvider()];\n case 1:\n credentials = _h.sent();\n if (!(signingRegion !== null && signingRegion !== void 0)) return [3 /*break*/, 2];\n _d = signingRegion;\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, this.regionProvider()];\n case 3:\n _d = (_h.sent());\n _h.label = 4;\n case 4:\n region = _d;\n shortDate = formatDate(signingDate).shortDate;\n _f = (_e = this.sha256).bind;\n return [4 /*yield*/, this.getSigningKey(credentials, region, shortDate, signingService)];\n case 5:\n hash = new (_f.apply(_e, [void 0, _h.sent()]))();\n hash.update(stringToSign);\n _g = toHex;\n return [4 /*yield*/, hash.digest()];\n case 6: return [2 /*return*/, _g.apply(void 0, [_h.sent()])];\n }\n });\n });\n };\n SignatureV4.prototype.signRequest = function (requestToSign, _a) {\n var _b = _a === void 0 ? {} : _a, _c = _b.signingDate, signingDate = _c === void 0 ? new Date() : _c, signableHeaders = _b.signableHeaders, unsignableHeaders = _b.unsignableHeaders, signingRegion = _b.signingRegion, signingService = _b.signingService;\n return __awaiter(this, void 0, void 0, function () {\n var credentials, region, _d, request, _e, longDate, shortDate, scope, payloadHash, canonicalHeaders, signature;\n return __generator(this, function (_f) {\n switch (_f.label) {\n case 0: return [4 /*yield*/, this.credentialProvider()];\n case 1:\n credentials = _f.sent();\n if (!(signingRegion !== null && signingRegion !== void 0)) return [3 /*break*/, 2];\n _d = signingRegion;\n return [3 /*break*/, 4];\n case 2: return [4 /*yield*/, this.regionProvider()];\n case 3:\n _d = (_f.sent());\n _f.label = 4;\n case 4:\n region = _d;\n request = prepareRequest(requestToSign);\n _e = formatDate(signingDate), longDate = _e.longDate, shortDate = _e.shortDate;\n scope = createScope(shortDate, region, signingService !== null && signingService !== void 0 ? signingService : this.service);\n request.headers[AMZ_DATE_HEADER] = longDate;\n if (credentials.sessionToken) {\n request.headers[TOKEN_HEADER] = credentials.sessionToken;\n }\n return [4 /*yield*/, getPayloadHash(request, this.sha256)];\n case 5:\n payloadHash = _f.sent();\n if (!hasHeader(SHA256_HEADER, request.headers) && this.applyChecksum) {\n request.headers[SHA256_HEADER] = payloadHash;\n }\n canonicalHeaders = getCanonicalHeaders(request, unsignableHeaders, signableHeaders);\n return [4 /*yield*/, this.getSignature(longDate, scope, this.getSigningKey(credentials, region, shortDate, signingService), this.createCanonicalRequest(request, canonicalHeaders, payloadHash))];\n case 6:\n signature = _f.sent();\n request.headers[AUTH_HEADER] =\n ALGORITHM_IDENTIFIER + \" \" +\n (\"Credential=\" + credentials.accessKeyId + \"/\" + scope + \", \") +\n (\"SignedHeaders=\" + getCanonicalHeaderList(canonicalHeaders) + \", \") +\n (\"Signature=\" + signature);\n return [2 /*return*/, request];\n }\n });\n });\n };\n SignatureV4.prototype.createCanonicalRequest = function (request, canonicalHeaders, payloadHash) {\n var sortedHeaders = Object.keys(canonicalHeaders).sort();\n return request.method + \"\\n\" + this.getCanonicalPath(request) + \"\\n\" + getCanonicalQuery(request) + \"\\n\" + sortedHeaders.map(function (name) { return name + \":\" + canonicalHeaders[name]; }).join(\"\\n\") + \"\\n\\n\" + sortedHeaders.join(\";\") + \"\\n\" + payloadHash;\n };\n SignatureV4.prototype.createStringToSign = function (longDate, credentialScope, canonicalRequest) {\n return __awaiter(this, void 0, void 0, function () {\n var hash, hashedRequest;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n hash = new this.sha256();\n hash.update(canonicalRequest);\n return [4 /*yield*/, hash.digest()];\n case 1:\n hashedRequest = _a.sent();\n return [2 /*return*/, ALGORITHM_IDENTIFIER + \"\\n\" + longDate + \"\\n\" + credentialScope + \"\\n\" + toHex(hashedRequest)];\n }\n });\n });\n };\n SignatureV4.prototype.getCanonicalPath = function (_a) {\n var path = _a.path;\n if (this.uriEscapePath) {\n var doubleEncoded = encodeURIComponent(path.replace(/^\\//, \"\"));\n return \"/\" + doubleEncoded.replace(/%2F/g, \"/\");\n }\n return path;\n };\n SignatureV4.prototype.getSignature = function (longDate, credentialScope, keyPromise, canonicalRequest) {\n return __awaiter(this, void 0, void 0, function () {\n var stringToSign, hash, _a, _b, _c;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0: return [4 /*yield*/, this.createStringToSign(longDate, credentialScope, canonicalRequest)];\n case 1:\n stringToSign = _d.sent();\n _b = (_a = this.sha256).bind;\n return [4 /*yield*/, keyPromise];\n case 2:\n hash = new (_b.apply(_a, [void 0, _d.sent()]))();\n hash.update(stringToSign);\n _c = toHex;\n return [4 /*yield*/, hash.digest()];\n case 3: return [2 /*return*/, _c.apply(void 0, [_d.sent()])];\n }\n });\n });\n };\n SignatureV4.prototype.getSigningKey = function (credentials, region, shortDate, service) {\n return getSigningKey(this.sha256, credentials, shortDate, region, service || this.service);\n };\n return SignatureV4;\n}());\nexport { SignatureV4 };\nvar formatDate = function (now) {\n var longDate = iso8601(now).replace(/[\\-:]/g, \"\");\n return {\n longDate: longDate,\n shortDate: longDate.substr(0, 8),\n };\n};\nvar getCanonicalHeaderList = function (headers) { return Object.keys(headers).sort().join(\";\"); };\nvar normalizeRegionProvider = function (region) {\n if (typeof region === \"string\") {\n var promisified_1 = Promise.resolve(region);\n return function () { return promisified_1; };\n }\n else {\n return region;\n }\n};\nvar normalizeCredentialsProvider = function (credentials) {\n if (typeof credentials === \"object\") {\n var promisified_2 = Promise.resolve(credentials);\n return function () { return promisified_2; };\n }\n else {\n return credentials;\n }\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiU2lnbmF0dXJlVjQuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlc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iA9PiB7XG4gIGlmICh0eXBlb2YgcmVnaW9uID09PSBcInN0cmluZ1wiKSB7XG4gICAgY29uc3QgcHJvbWlzaWZpZWQgPSBQcm9taXNlLnJlc29sdmUocmVnaW9uKTtcbiAgICByZXR1cm4gKCkgPT4gcHJvbWlzaWZpZWQ7XG4gIH0gZWxzZSB7XG4gICAgcmV0dXJuIHJlZ2lvbjtcbiAgfVxufTtcblxuY29uc3Qgbm9ybWFsaXplQ3JlZGVudGlhbHNQcm92aWRlciA9IChjcmVkZW50aWFsczogQ3JlZGVudGlhbHMgfCBQcm92aWRlcjxDcmVkZW50aWFscz4pOiBQcm92aWRlcjxDcmVkZW50aWFscz4gPT4ge1xuICBpZiAodHlwZW9mIGNyZWRlbnRpYWxzID09PSBcIm9iamVjdFwiKSB7XG4gICAgY29uc3QgcHJvbWlzaWZpZWQgPSBQcm9taXNlLnJlc29sdmUoY3JlZGVudGlhbHMpO1xuICAgIHJldHVybiAoKSA9PiBwcm9taXNpZmllZDtcbiAgfSBlbHNlIHtcbiAgICByZXR1cm4gY3JlZGVudGlhbHM7XG4gIH1cbn07XG4iXX0=","import { __assign, __awaiter, __generator, __read } from \"tslib\";\nimport { SignatureV4 } from \"@aws-sdk/signature-v4\";\nexport function resolveAwsAuthConfig(input) {\n var _this = this;\n var credentials = input.credentials || input.credentialDefaultProvider(input);\n var normalizedCreds = normalizeProvider(credentials);\n var _a = input.signingEscapePath, signingEscapePath = _a === void 0 ? true : _a, _b = input.systemClockOffset, systemClockOffset = _b === void 0 ? input.systemClockOffset || 0 : _b, sha256 = input.sha256;\n var signer;\n if (input.signer) {\n //if signer is supplied by user, normalize it to a function returning a promise for signer.\n signer = normalizeProvider(input.signer);\n }\n else {\n //construct a provider inferring signing from region.\n signer = function () {\n return normalizeProvider(input.region)()\n .then(function (region) { return __awaiter(_this, void 0, void 0, function () { return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, input.regionInfoProvider(region)];\n case 1: return [2 /*return*/, [(_a.sent()) || {}, region]];\n }\n }); }); })\n .then(function (_a) {\n var _b = __read(_a, 2), regionInfo = _b[0], region = _b[1];\n var signingRegion = regionInfo.signingRegion, signingService = regionInfo.signingService;\n //update client's singing region and signing service config if they are resolved.\n //signing region resolving order: user supplied signingRegion -> endpoints.json inferred region -> client region\n input.signingRegion = input.signingRegion || signingRegion || region;\n //signing name resolving order:\n //user supplied signingName -> endpoints.json inferred (credential scope -> model arnNamespace) -> model service id\n input.signingName = input.signingName || signingService || input.serviceId;\n return new SignatureV4({\n credentials: normalizedCreds,\n region: input.signingRegion,\n service: input.signingName,\n sha256: sha256,\n uriEscapePath: signingEscapePath,\n });\n });\n };\n }\n return __assign(__assign({}, input), { systemClockOffset: systemClockOffset,\n signingEscapePath: signingEscapePath, credentials: normalizedCreds, signer: signer });\n}\nfunction normalizeProvider(input) {\n if (typeof input === \"object\") {\n var promisified_1 = Promise.resolve(input);\n return function () { return promisified_1; };\n }\n return input;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY29uZmlndXJhdGlvbnMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxXQUFXLEVBQUUsTUFBTSx1QkFBdUIsQ0FBQztBQTRDcEQsTUFBTSxVQUFVLG9CQUFvQixDQUFJLEtBQWtEO0lBQTFGLGlCQXVDQztJQXRDQyxJQUFNLFdBQVcsR0FBRyxLQUFLLENBQUMsV0FBVyxJQUFJLEtBQUssQ0FBQyx5QkFBeUIsQ0FBQyxLQUFZLENBQUMsQ0FBQztJQUN2RixJQUFNLGVBQWUsR0FBRyxpQkFBaUIsQ0FBQyxXQUFXLENBQUMsQ0FBQztJQUMvQyxJQUFBLEtBQXVGLEtBQUssa0JBQXBFLEVBQXhCLGlCQUFpQixtQkFBRyxJQUF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+IG1vZGVsIHNlcnZpY2UgaWRcbiAgICAgICAgICBpbnB1dC5zaWduaW5nTmFtZSA9IGlucHV0LnNpZ25pbmdOYW1lIHx8IHNpZ25pbmdTZXJ2aWNlIHx8IGlucHV0LnNlcnZpY2VJZDtcblxuICAgICAgICAgIHJldHVybiBuZXcgU2lnbmF0dXJlVjQoe1xuICAgICAgICAgICAgY3JlZGVudGlhbHM6IG5vcm1hbGl6ZWRDcmVkcyxcbiAgICAgICAgICAgIHJlZ2lvbjogaW5wdXQuc2lnbmluZ1JlZ2lvbixcbiAgICAgICAgICAgIHNlcnZpY2U6IGlucHV0LnNpZ25pbmdOYW1lLFxuICAgICAgICAgICAgc2hhMjU2LFxuICAgICAgICAgICAgdXJpRXNjYXBlUGF0aDogc2lnbmluZ0VzY2FwZVBhdGgsXG4gICAgICAgICAgfSk7XG4gICAgICAgIH0pO1xuICB9XG5cbiAgcmV0dXJuIHtcbiAgICAuLi5pbnB1dCxcbiAgICBzeXN0ZW1DbG9ja09mZnNldCxcbiAgICBzaWduaW5nRXNjYXBlUGF0aCxcbiAgICBjcmVkZW50aWFsczogbm9ybWFsaXplZENyZWRzLFxuICAgIHNpZ25lcixcbiAgfTtcbn1cblxuZnVuY3Rpb24gbm9ybWFsaXplUHJvdmlkZXI8VD4oaW5wdXQ6IFQgfCBQcm92aWRlcjxUPik6IFByb3ZpZGVyPFQ+IHtcbiAgaWYgKHR5cGVvZiBpbnB1dCA9PT0gXCJvYmplY3RcIikge1xuICAgIGNvbnN0IHByb21pc2lmaWVkID0gUHJvbWlzZS5yZXNvbHZlKGlucHV0KTtcbiAgICByZXR1cm4gKCkgPT4gcHJvbWlzaWZpZWQ7XG4gIH1cbiAgcmV0dXJuIGlucHV0IGFzIFByb3ZpZGVyPFQ+O1xufVxuIl19","/*! *****************************************************************************\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","import { __assign } from \"tslib\";\nexport function resolveUserAgentConfig(input) {\n return __assign(__assign({}, input), { customUserAgent: typeof input.customUserAgent === \"string\" ? [[input.customUserAgent]] : input.customUserAgent });\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlndXJhdGlvbnMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi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x5UmVzb2x2ZWQgJiBVc2VyQWdlbnRJbnB1dENvbmZpZ1xuKTogVCAmIFVzZXJBZ2VudFJlc29sdmVkQ29uZmlnIHtcbiAgcmV0dXJuIHtcbiAgICAuLi5pbnB1dCxcbiAgICBjdXN0b21Vc2VyQWdlbnQ6IHR5cGVvZiBpbnB1dC5jdXN0b21Vc2VyQWdlbnQgPT09IFwic3RyaW5nXCIgPyBbW2lucHV0LmN1c3RvbVVzZXJBZ2VudF1dIDogaW5wdXQuY3VzdG9tVXNlckFnZW50LFxuICB9O1xufVxuIl19","export var USER_AGENT = \"user-agent\";\nexport var X_AMZ_USER_AGENT = \"x-amz-user-agent\";\nexport var SPACE = \" \";\nexport var UA_ESCAPE_REGEX = /[^\\!\\#\\$\\%\\&\\'\\*\\+\\-\\.\\^\\_\\`\\|\\~\\d\\w]/g;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NvbnN0YW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxNQUFNLENBQUMsSUFBTSxVQUFVLEdBQUcsWUFBWSxDQUFDO0FBRXZDLE1BQU0sQ0FBQyxJQUFNLGdCQUFnQixHQUFHLGtCQUFrQixDQUFDO0FBRW5ELE1BQU0sQ0FBQyxJQUFNLEtBQUssR0FBRyxHQUFHLENBQUM7QUFFekIsTUFBTSxDQUFDLElBQU0sZUFBZSxHQUFHLHdDQUF3QyxDQUFDIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IGNvbnN0IFVTRVJfQUdFTlQgPSBcInVzZXItYWdlbnRcIjtcblxuZXhwb3J0IGNvbnN0IFhfQU1aX1VTRVJfQUdFTlQgPSBcIngtYW16LXVzZXItYWdlbnRcIjtcblxuZXhwb3J0IGNvbnN0IFNQQUNFID0gXCIgXCI7XG5cbmV4cG9ydCBjb25zdCBVQV9FU0NBUEVfUkVHRVggPSAvW15cXCFcXCNcXCRcXCVcXCZcXCdcXCpcXCtcXC1cXC5cXF5cXF9cXGBcXHxcXH5cXGRcXHddL2c7XG4iXX0=","import { __assign, __awaiter, __generator, __read, __spread } from \"tslib\";\nimport { HttpRequest } from \"@aws-sdk/protocol-http\";\nimport { SPACE, UA_ESCAPE_REGEX, USER_AGENT, X_AMZ_USER_AGENT } from \"./constants\";\n/**\n * Build user agent header sections from:\n * 1. runtime-specific default user agent provider;\n * 2. custom user agent from `customUserAgent` client config;\n * 3. handler execution context set by internal SDK components;\n * The built user agent will be set to `x-amz-user-agent` header for ALL the\n * runtimes.\n * Please note that any override to the `user-agent` or `x-amz-user-agent` header\n * in the HTTP request is discouraged. Please use `customUserAgent` client\n * config or middleware setting the `userAgent` context to generate desired user\n * agent.\n */\nexport var userAgentMiddleware = function (options) { return function (next, context) { return function (args) { return __awaiter(void 0, void 0, void 0, function () {\n var request, headers, userAgent, defaultUserAgent, customUserAgent, normalUAValue;\n var _a, _b;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n request = args.request;\n if (!HttpRequest.isInstance(request))\n return [2 /*return*/, next(args)];\n headers = request.headers;\n userAgent = ((_a = context === null || context === void 0 ? void 0 : context.userAgent) === null || _a === void 0 ? void 0 : _a.map(escapeUserAgent)) || [];\n return [4 /*yield*/, options.defaultUserAgentProvider()];\n case 1:\n defaultUserAgent = (_c.sent()).map(escapeUserAgent);\n customUserAgent = ((_b = options === null || options === void 0 ? void 0 : options.customUserAgent) === null || _b === void 0 ? void 0 : _b.map(escapeUserAgent)) || [];\n // Set value to AWS-specific user agent header\n headers[X_AMZ_USER_AGENT] = __spread(defaultUserAgent, userAgent, customUserAgent).join(SPACE);\n normalUAValue = __spread(defaultUserAgent.filter(function (section) { return section.startsWith(\"aws-sdk-\"); }), customUserAgent).join(SPACE);\n if (options.runtime !== \"browser\" && normalUAValue) {\n headers[USER_AGENT] = headers[USER_AGENT] ? headers[USER_AGENT] + \" \" + normalUAValue : normalUAValue;\n }\n return [2 /*return*/, next(__assign(__assign({}, args), { request: request }))];\n }\n });\n}); }; }; };\n/**\n * Escape the each pair according to https://tools.ietf.org/html/rfc5234 and join the pair with pattern `name/version`.\n * User agent name may include prefix like `md/`, `api/`, `os/` etc., we should not escape the `/` after the prefix.\n * @private\n */\nvar escapeUserAgent = function (_a) {\n var _b = __read(_a, 2), name = _b[0], version = _b[1];\n var prefixSeparatorIndex = name.indexOf(\"/\");\n var prefix = name.substring(0, prefixSeparatorIndex); // If no prefix, prefix is just \"\"\n var uaName = name.substring(prefixSeparatorIndex + 1);\n if (prefix === \"api\") {\n uaName = uaName.toLowerCase();\n }\n return [prefix, uaName, version]\n .filter(function (item) { return item && item.length > 0; })\n .map(function (item) { return item === null || item === void 0 ? void 0 : item.replace(UA_ESCAPE_REGEX, \"_\"); })\n .join(\"/\");\n};\nexport var getUserAgentMiddlewareOptions = {\n name: \"getUserAgentMiddleware\",\n step: \"build\",\n priority: \"low\",\n tags: [\"SET_USER_AGENT\", \"USER_AGENT\"],\n override: true,\n};\nexport var getUserAgentPlugin = function (config) { return ({\n applyToStack: function (clientStack) {\n clientStack.add(userAgentMiddleware(config), getUserAgentMiddlewareOptions);\n },\n}); };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXNlci1hZ2VudC1taWRkbGV3YXJlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3VzZXItYWdlbnQtbWlkZGxld2FyZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsT0FBTyxFQUFFLFdBQVcsRUFBRSxNQUFNLHdCQUF3QixDQUFDO0FBY3JELE9BQU8sRUFBRSxLQUFLLEVBQUUsZUFBZSxFQUFFLFVBQVUsRUFBRSxnQkFBZ0IsRUFBRSxNQUFNLGFBQWEsQ0FBQztBQUVuRjs7Ozs7Ozs7Ozs7R0FX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pLCBnZXRVc2VyQWdlbnRNaWRkbGV3YXJlT3B0aW9ucyk7XG4gIH0sXG59KTtcbiJdfQ==","/*! *****************************************************************************\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","import { __assign, __read, __spread, __values } from \"tslib\";\nexport var constructStack = function () {\n var absoluteEntries = [];\n var relativeEntries = [];\n var entriesNameSet = new Set();\n var sort = function (entries) {\n return entries.sort(function (a, b) {\n return stepWeights[b.step] - stepWeights[a.step] ||\n priorityWeights[b.priority || \"normal\"] - priorityWeights[a.priority || \"normal\"];\n });\n };\n var removeByName = function (toRemove) {\n var isRemoved = false;\n var filterCb = function (entry) {\n if (entry.name && entry.name === toRemove) {\n isRemoved = true;\n entriesNameSet.delete(toRemove);\n return false;\n }\n return true;\n };\n absoluteEntries = absoluteEntries.filter(filterCb);\n relativeEntries = relativeEntries.filter(filterCb);\n return isRemoved;\n };\n var removeByReference = function (toRemove) {\n var isRemoved = false;\n var filterCb = function (entry) {\n if (entry.middleware === toRemove) {\n isRemoved = true;\n if (entry.name)\n entriesNameSet.delete(entry.name);\n return false;\n }\n return true;\n };\n absoluteEntries = absoluteEntries.filter(filterCb);\n relativeEntries = relativeEntries.filter(filterCb);\n return isRemoved;\n };\n var cloneTo = function (toStack) {\n absoluteEntries.forEach(function (entry) {\n //@ts-ignore\n toStack.add(entry.middleware, __assign({}, entry));\n });\n relativeEntries.forEach(function (entry) {\n //@ts-ignore\n toStack.addRelativeTo(entry.middleware, __assign({}, entry));\n });\n return toStack;\n };\n var expandRelativeMiddlewareList = function (from) {\n var expandedMiddlewareList = [];\n from.before.forEach(function (entry) {\n if (entry.before.length === 0 && entry.after.length === 0) {\n expandedMiddlewareList.push(entry);\n }\n else {\n expandedMiddlewareList.push.apply(expandedMiddlewareList, __spread(expandRelativeMiddlewareList(entry)));\n }\n });\n expandedMiddlewareList.push(from);\n from.after.reverse().forEach(function (entry) {\n if (entry.before.length === 0 && entry.after.length === 0) {\n expandedMiddlewareList.push(entry);\n }\n else {\n expandedMiddlewareList.push.apply(expandedMiddlewareList, __spread(expandRelativeMiddlewareList(entry)));\n }\n });\n return expandedMiddlewareList;\n };\n /**\n * Get a final list of middleware in the order of being executed in the resolved handler.\n */\n var getMiddlewareList = function () {\n var normalizedAbsoluteEntries = [];\n var normalizedRelativeEntries = [];\n var normalizedEntriesNameMap = {};\n absoluteEntries.forEach(function (entry) {\n var normalizedEntry = __assign(__assign({}, entry), { before: [], after: [] });\n if (normalizedEntry.name)\n normalizedEntriesNameMap[normalizedEntry.name] = normalizedEntry;\n normalizedAbsoluteEntries.push(normalizedEntry);\n });\n relativeEntries.forEach(function (entry) {\n var normalizedEntry = __assign(__assign({}, entry), { before: [], after: [] });\n if (normalizedEntry.name)\n normalizedEntriesNameMap[normalizedEntry.name] = normalizedEntry;\n normalizedRelativeEntries.push(normalizedEntry);\n });\n normalizedRelativeEntries.forEach(function (entry) {\n if (entry.toMiddleware) {\n var toMiddleware = normalizedEntriesNameMap[entry.toMiddleware];\n if (toMiddleware === undefined) {\n throw new Error(entry.toMiddleware + \" is not found when adding \" + (entry.name || \"anonymous\") + \" middleware \" + entry.relation + \" \" + entry.toMiddleware);\n }\n if (entry.relation === \"after\") {\n toMiddleware.after.push(entry);\n }\n if (entry.relation === \"before\") {\n toMiddleware.before.push(entry);\n }\n }\n });\n var mainChain = sort(normalizedAbsoluteEntries)\n .map(expandRelativeMiddlewareList)\n .reduce(function (wholeList, expendedMiddlewareList) {\n // TODO: Replace it with Array.flat();\n wholeList.push.apply(wholeList, __spread(expendedMiddlewareList));\n return wholeList;\n }, []);\n return mainChain.map(function (entry) { return entry.middleware; });\n };\n var stack = {\n add: function (middleware, options) {\n if (options === void 0) { options = {}; }\n var name = options.name, override = options.override;\n var entry = __assign({ step: \"initialize\", priority: \"normal\", middleware: middleware }, options);\n if (name) {\n if (entriesNameSet.has(name)) {\n if (!override)\n throw new Error(\"Duplicate middleware name '\" + name + \"'\");\n var toOverrideIndex = absoluteEntries.findIndex(function (entry) { return entry.name === name; });\n var toOverride = absoluteEntries[toOverrideIndex];\n if (toOverride.step !== entry.step || toOverride.priority !== entry.priority) {\n throw new Error(\"\\\"\" + name + \"\\\" middleware with \" + toOverride.priority + \" priority in \" + toOverride.step + \" step cannot be \" +\n (\"overridden by same-name middleware with \" + entry.priority + \" priority in \" + entry.step + \" step.\"));\n }\n absoluteEntries.splice(toOverrideIndex, 1);\n }\n entriesNameSet.add(name);\n }\n absoluteEntries.push(entry);\n },\n addRelativeTo: function (middleware, options) {\n var name = options.name, override = options.override;\n var entry = __assign({ middleware: middleware }, options);\n if (name) {\n if (entriesNameSet.has(name)) {\n if (!override)\n throw new Error(\"Duplicate middleware name '\" + name + \"'\");\n var toOverrideIndex = relativeEntries.findIndex(function (entry) { return entry.name === name; });\n var toOverride = relativeEntries[toOverrideIndex];\n if (toOverride.toMiddleware !== entry.toMiddleware || toOverride.relation !== entry.relation) {\n throw new Error(\"\\\"\" + name + \"\\\" middleware \" + toOverride.relation + \" \\\"\" + toOverride.toMiddleware + \"\\\" middleware cannot be overridden \" +\n (\"by same-name middleware \" + entry.relation + \" \\\"\" + entry.toMiddleware + \"\\\" middleware.\"));\n }\n relativeEntries.splice(toOverrideIndex, 1);\n }\n entriesNameSet.add(name);\n }\n relativeEntries.push(entry);\n },\n clone: function () { return cloneTo(constructStack()); },\n use: function (plugin) {\n plugin.applyToStack(stack);\n },\n remove: function (toRemove) {\n if (typeof toRemove === \"string\")\n return removeByName(toRemove);\n else\n return removeByReference(toRemove);\n },\n removeByTag: function (toRemove) {\n var isRemoved = false;\n var filterCb = function (entry) {\n var tags = entry.tags, name = entry.name;\n if (tags && tags.includes(toRemove)) {\n if (name)\n entriesNameSet.delete(name);\n isRemoved = true;\n return false;\n }\n return true;\n };\n absoluteEntries = absoluteEntries.filter(filterCb);\n relativeEntries = relativeEntries.filter(filterCb);\n return isRemoved;\n },\n concat: function (from) {\n var cloned = cloneTo(constructStack());\n cloned.use(from);\n return cloned;\n },\n applyToStack: cloneTo,\n resolve: function (handler, context) {\n var e_1, _a;\n try {\n for (var _b = __values(getMiddlewareList().reverse()), _c = _b.next(); !_c.done; _c = _b.next()) {\n var middleware = _c.value;\n handler = middleware(handler, context);\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return handler;\n },\n };\n return stack;\n};\nvar stepWeights = {\n initialize: 5,\n serialize: 4,\n build: 3,\n finalizeRequest: 2,\n deserialize: 1,\n};\nvar priorityWeights = {\n high: 3,\n normal: 2,\n low: 1,\n};\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiTWlkZGxld2FyZVN0YWNrLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL01pZGRsZXdhcmVTdGFjay50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBZ0JBLE1BQU0sQ0FBQyxJQUFNLGNBQWMsR0FBRztJQUM1QixJQUFJLGVBQWUsR0FBNkMsRUFBRSxDQUFDO0lBQ25FLElBQUksZUFBZSxHQUE2QyxFQUFFLENBQUM7SUFDbkUsSUFBTSxjQUFjLEdBQWdCLElBQUksR0FBRyxFQUFFLENBQUM7SUFFOUMsSUFBTSxJQUFJLEdBQUcsVUFBbUQsT0FBWTtRQUMxRSxPQUFBLE9BQU8sQ0FBQyxJQUFJLENBQ1YsVUFBQyxDQUFDLEVBQUUsQ0FBQztZQUNILE9BQUEsV0FBVyxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsR0FBRyxXQUFXLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQztnQkFDekMsZUFBZSxDQUFDLENBQUMsQ0FBQyxRQUFRLElBQUksUUFBUSxDQUFDLEdBQUcsZUFBZSxDQUFDLENBQUMsQ0FBQyxRQUFRLElBQUksUUFBUSxDQUFDO1FBRGpGLENBQ2lGLENBQ3BGO0lBSkQsQ0FJQyxDQUFDO0lBRUosSUFBTSxZQUFZLEdBQUcsVUFBQyxRQUFnQjtRQUNwQyxJQUFJLFNBQVMsR0FBRyxLQUFLLENBQUM7UUFDdEIsSUFBTSxRQUFRLEdBQUcsVUFBQyxLQUFxQztZ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biBTdGVwXTogbnVtYmVyIH0gPSB7XG4gIGluaXRpYWxpemU6IDUsXG4gIHNlcmlhbGl6ZTogNCxcbiAgYnVpbGQ6IDMsXG4gIGZpbmFsaXplUmVxdWVzdDogMixcbiAgZGVzZXJpYWxpemU6IDEsXG59O1xuXG5jb25zdCBwcmlvcml0eVdlaWdodHM6IHsgW2tleSBpbiBQcmlvcml0eV06IG51bWJlciB9ID0ge1xuICBoaWdoOiAzLFxuICBub3JtYWw6IDIsXG4gIGxvdzogMSxcbn07XG4iXX0=","import { constructStack } from \"@aws-sdk/middleware-stack\";\nvar Client = /** @class */ (function () {\n function Client(config) {\n this.middlewareStack = constructStack();\n this.config = config;\n }\n Client.prototype.send = function (command, optionsOrCb, cb) {\n var options = typeof optionsOrCb !== \"function\" ? optionsOrCb : undefined;\n var callback = typeof optionsOrCb === \"function\" ? optionsOrCb : cb;\n var handler = command.resolveMiddleware(this.middlewareStack, this.config, options);\n if (callback) {\n handler(command)\n .then(function (result) { return callback(null, result.output); }, function (err) { return callback(err); })\n .catch(\n // prevent any errors thrown in the callback from triggering an\n // unhandled promise rejection\n function () { });\n }\n else {\n return handler(command).then(function (result) { return result.output; });\n }\n };\n Client.prototype.destroy = function () {\n if (this.config.requestHandler.destroy)\n this.config.requestHandler.destroy();\n };\n return Client;\n}());\nexport { Client };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY2xpZW50LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NsaWVudC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsY0FBYyxFQUFFLE1BQU0sMkJBQTJCLENBQUM7QUFlM0Q7SUFRRSxnQkFBWSxNQUFtQztRQUZ4QyxvQkFBZSxHQUFHLGNBQWMsRUFBNkIsQ0FBQztRQUduRSxJQUFJLENBQUMsTUFBTSxHQUFHLE1BQU0sQ0FBQztJQUN2Qix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4gICAgY29uc3QgaGFuZGxlciA9IGNvbW1hbmQucmVzb2x2ZU1pZGRsZXdhcmUodGhpcy5taWRkbGV3YXJlU3RhY2sgYXMgYW55LCB0aGlzLmNvbmZpZywgb3B0aW9ucyk7XG4gICAgaWYgKGNhbGxiYWNrKSB7XG4gICAgICBoYW5kbGVyKGNvbW1hbmQpXG4gICAgICAgIC50aGVuKFxuICAgICAgICAgIChyZXN1bHQpID0+IGNhbGxiYWNrKG51bGwsIHJlc3VsdC5vdXRwdXQpLFxuICAgICAgICAgIChlcnI6IGFueSkgPT4gY2FsbGJhY2soZXJyKVxuICAgICAgICApXG4gICAgICAgIC5jYXRjaChcbiAgICAgICAgICAvLyBwcmV2ZW50IGFueSBlcnJvcnMgdGhyb3duIGluIHRoZSBjYWxsYmFjayBmcm9tIHRyaWdnZXJpbmcgYW5cbiAgICAgICAgICAvLyB1bmhhbmRsZWQgcHJvbWlzZSByZWplY3Rpb25cbiAgICAgICAgICAoKSA9PiB7fVxuICAgICAgICApO1xuICAgIH0gZWxzZSB7XG4gICAgICByZXR1cm4gaGFuZGxlcihjb21tYW5kKS50aGVuKChyZXN1bHQpID0+IHJlc3VsdC5vdXRwdXQpO1xuICAgIH1cbiAgfVxuXG4gIGRlc3Ryb3koKSB7XG4gICAgaWYgKHRoaXMuY29uZmlnLnJlcXVlc3RIYW5kbGVyLmRlc3Ryb3kpIHRoaXMuY29uZmlnLnJlcXVlc3RIYW5kbGVyLmRlc3Ryb3koKTtcbiAgfVxufVxuIl19","import { constructStack } from \"@aws-sdk/middleware-stack\";\nvar Command = /** @class */ (function () {\n function Command() {\n this.middlewareStack = constructStack();\n }\n return Command;\n}());\nexport { Command };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29tbWFuZC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jb21tYW5kLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3Mi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dhcmVTdGFjazxDbGllbnRJbnB1dCwgQ2xpZW50T3V0cHV0PixcbiAgICBjb25maWd1cmF0aW9uOiBSZXNvbHZlZENsaWVudENvbmZpZ3VyYXRpb24sXG4gICAgb3B0aW9uczogYW55XG4gICk6IEhhbmRsZXI8SW5wdXQsIE91dHB1dD47XG59XG4iXX0=","/*! *****************************************************************************\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","/**\n * Lazy String holder for JSON typed contents.\n */\nimport { __extends, __read, __spread } from \"tslib\";\n/**\n * Because of https://github.com/microsoft/tslib/issues/95,\n * TS 'extends' shim doesn't support extending native types like String.\n * So here we create StringWrapper that duplicate everything from String\n * class including its prototype chain. So we can extend from here.\n */\n// @ts-ignore StringWrapper implementation is not a simple constructor\nexport var StringWrapper = function () {\n //@ts-ignore 'this' cannot be assigned to any, but Object.getPrototypeOf accepts any\n var Class = Object.getPrototypeOf(this).constructor;\n var Constructor = Function.bind.apply(String, __spread([null], arguments));\n //@ts-ignore Call wrapped String constructor directly, don't bother typing it.\n var instance = new Constructor();\n Object.setPrototypeOf(instance, Class.prototype);\n return instance;\n};\nStringWrapper.prototype = Object.create(String.prototype, {\n constructor: {\n value: StringWrapper,\n enumerable: false,\n writable: true,\n configurable: true,\n },\n});\nObject.setPrototypeOf(StringWrapper, String);\nvar LazyJsonString = /** @class */ (function (_super) {\n __extends(LazyJsonString, _super);\n function LazyJsonString() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n LazyJsonString.prototype.deserializeJSON = function () {\n return JSON.parse(_super.prototype.toString.call(this));\n };\n LazyJsonString.prototype.toJSON = function () {\n return _super.prototype.toString.call(this);\n };\n LazyJsonString.fromObject = function (object) {\n if (object instanceof LazyJsonString) {\n return object;\n }\n else if (object instanceof String || typeof object === \"string\") {\n return new LazyJsonString(object);\n }\n return new LazyJsonString(JSON.stringify(object));\n };\n return LazyJsonString;\n}(StringWrapper));\nexport { LazyJsonString };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibGF6eS1qc29uLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xhenktanNvbi50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7R0FFRzs7QUFNSDs7Ozs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iBhbnkge1xuICAgIHJldHVybiBKU09OLnBhcnNlKHN1cGVyLnRvU3RyaW5nKCkpO1xuICB9XG5cbiAgdG9KU09OKCk6IHN0cmluZyB7XG4gICAgcmV0dXJuIHN1cGVyLnRvU3RyaW5nKCk7XG4gIH1cblxuICBzdGF0aWMgZnJvbU9iamVjdChvYmplY3Q6IGFueSk6IExhenlKc29uU3RyaW5nIHtcbiAgICBpZiAob2JqZWN0IGluc3RhbmNlb2YgTGF6eUpzb25TdHJpbmcpIHtcbiAgICAgIHJldHVybiBvYmplY3Q7XG4gICAgfSBlbHNlIGlmIChvYmplY3QgaW5zdGFuY2VvZiBTdHJpbmcgfHwgdHlwZW9mIG9iamVjdCA9PT0gXCJzdHJpbmdcIikge1xuICAgICAgcmV0dXJuIG5ldyBMYXp5SnNvblN0cmluZyhvYmplY3QpO1xuICAgIH1cbiAgICByZXR1cm4gbmV3IExhenlKc29uU3RyaW5nKEpTT04uc3RyaW5naWZ5KG9iamVjdCkpO1xuICB9XG59XG4iXX0=","/*! *****************************************************************************\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","import { __awaiter, __generator } from \"tslib\";\nexport var deserializerMiddleware = function (options, deserializer) { return function (next, context) { return function (args) { return __awaiter(void 0, void 0, void 0, function () {\n var response, parsed;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, next(args)];\n case 1:\n response = (_a.sent()).response;\n return [4 /*yield*/, deserializer(response, options)];\n case 2:\n parsed = _a.sent();\n return [2 /*return*/, {\n response: response,\n output: parsed,\n }];\n }\n });\n}); }; }; };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZGVzZXJpYWxpemVyTWlkZGxld2FyZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9kZXNlcmlhbGl6ZXJNaWRkbGV3YXJlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFTQSxNQUFNLENBQUMsSUFBTSxzQkFBc0IsR0FBRyxVQUNwQyxPQUFxQixFQUNyQixZQUEwRCxJQUNqQixPQUFBLFVBQ3pDLElBQXVDLEVBQ3ZDLE9BQWdDLElBQ00sT0FBQSxVQUN0QyxJQUF3Qzs7OztvQkFFbkIsc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xlcjxJbnB1dCwgT3V0cHV0PiA9PiBhc3luYyAoXG4gIGFyZ3M6IERlc2VyaWFsaXplSGFuZGxlckFyZ3VtZW50czxJbnB1dD5cbik6IFByb21pc2U8RGVzZXJpYWxpemVIYW5kbGVyT3V0cHV0PE91dHB1dD4+ID0+IHtcbiAgY29uc3QgeyByZXNwb25zZSB9ID0gYXdhaXQgbmV4dChhcmdzKTtcbiAgY29uc3QgcGFyc2VkID0gYXdhaXQgZGVzZXJpYWxpemVyKHJlc3BvbnNlLCBvcHRpb25zKTtcbiAgcmV0dXJuIHtcbiAgICByZXNwb25zZSxcbiAgICBvdXRwdXQ6IHBhcnNlZCBhcyBPdXRwdXQsXG4gIH07XG59O1xuIl19","import { __assign, __awaiter, __generator } from \"tslib\";\nexport var serializerMiddleware = function (options, serializer) { return function (next, context) { return function (args) { return __awaiter(void 0, void 0, void 0, function () {\n var request;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, serializer(args.input, options)];\n case 1:\n request = _a.sent();\n return [2 /*return*/, next(__assign(__assign({}, args), { request: request }))];\n }\n });\n}); }; }; };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VyaWFsaXplck1pZGRsZXdhcmUuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VyaWFsaXplck1pZGRsZXdhcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQVVBLE1BQU0sQ0FBQyxJQUFNLG9CQUFvQixHQUFHLFVBQ2xDLE9BQXFCLEVBQ3JCLFVBQWdELElBQ1QsT0FBQSxVQUN2QyxJQUFxQyxFQUNyQyxPQUFnQyxJQUNJLE9BQUEsVUFDcEMsSUFBc0M7Ozs7b0JBRXRCLHFCQUFNLFVBQVUsQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLE9BQU8sQ0FBQyxFQUFBOztnQkFBL0MsT0FBTyxHQUFHLFN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F3YWl0IHNlcmlhbGl6ZXIoYXJncy5pbnB1dCwgb3B0aW9ucyk7XG4gIHJldHVybiBuZXh0KHtcbiAgICAuLi5hcmdzLFxuICAgIHJlcXVlc3QsXG4gIH0pO1xufTtcbiJdfQ==","import { deserializerMiddleware } from \"./deserializerMiddleware\";\nimport { serializerMiddleware } from \"./serializerMiddleware\";\nexport var deserializerMiddlewareOption = {\n name: \"deserializerMiddleware\",\n step: \"deserialize\",\n tags: [\"DESERIALIZER\"],\n override: true,\n};\nexport var serializerMiddlewareOption = {\n name: \"serializerMiddleware\",\n step: \"serialize\",\n tags: [\"SERIALIZER\"],\n override: true,\n};\nexport function getSerdePlugin(config, serializer, deserializer) {\n return {\n applyToStack: function (commandStack) {\n commandStack.add(deserializerMiddleware(config, deserializer), deserializerMiddlewareOption);\n commandStack.add(serializerMiddleware(config, serializer), serializerMiddlewareOption);\n },\n };\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VyZGVQbHVnaW4uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VyZGVQbHVnaW4udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBV0EsT0FBTyxFQUFFLHNCQUFzQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDbEUsT0FBTyxFQUFFLG9CQUFvQixFQUFFLE1BQU0sd0JBQXdCLENBQUM7QUFFOUQsTUFBTSxDQUFDLElBQU0sNEJBQTRCLEdBQThCO0lBQ3JFLElBQUksRUFBRSx3QkFBd0I7SUFDOUIsSUFBSSxFQUFFLGFBQWE7SUFDbkIsSUFBSSxFQUFFLENBQUMsY0FBYyxDQUFDO0lBQ3RCLFFBQVEsRUFBRSxJQUFJO0NBQ2YsQ0FBQztBQUVGLE1BQU0sQ0FBQyxJQUFNLDBCQUEwQixHQUE0QjtJQUNqRSxJQUFJLEVBQUUsc0JBQXNCO0lBQzVCLElBQUksRUFBRSxX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aW9uKTtcbiAgICAgIGNvbW1hbmRTdGFjay5hZGQoc2VyaWFsaXplck1pZGRsZXdhcmUoY29uZmlnLCBzZXJpYWxpemVyKSwgc2VyaWFsaXplck1pZGRsZXdhcmVPcHRpb24pO1xuICAgIH0sXG4gIH07XG59XG4iXX0=","import { __awaiter, __generator } from \"tslib\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ConsoleLogger as Logger } from '../Logger';\nimport { browserOrNode } from '../JS';\nimport { NonRetryableError } from '../Util';\nvar logger = new Logger('CognitoCredentials');\nvar waitForInit = new Promise(function (res, rej) {\n if (!browserOrNode().isBrowser) {\n logger.debug('not in the browser, directly resolved');\n return res();\n }\n var ga = window['gapi'] && window['gapi'].auth2 ? window['gapi'].auth2 : null;\n if (ga) {\n logger.debug('google api already loaded');\n return res();\n }\n else {\n setTimeout(function () {\n return res();\n }, 2000);\n }\n});\nvar GoogleOAuth = /** @class */ (function () {\n function GoogleOAuth() {\n this.initialized = false;\n this.refreshGoogleToken = this.refreshGoogleToken.bind(this);\n this._refreshGoogleTokenImpl = this._refreshGoogleTokenImpl.bind(this);\n }\n GoogleOAuth.prototype.refreshGoogleToken = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!this.initialized) return [3 /*break*/, 2];\n logger.debug('need to wait for the Google SDK loaded');\n return [4 /*yield*/, waitForInit];\n case 1:\n _a.sent();\n this.initialized = true;\n logger.debug('finish waiting');\n _a.label = 2;\n case 2: return [2 /*return*/, this._refreshGoogleTokenImpl()];\n }\n });\n });\n };\n GoogleOAuth.prototype._refreshGoogleTokenImpl = function () {\n var ga = null;\n if (browserOrNode().isBrowser)\n ga = window['gapi'] && window['gapi'].auth2 ? window['gapi'].auth2 : null;\n if (!ga) {\n logger.debug('no gapi auth2 available');\n return Promise.reject('no gapi auth2 available');\n }\n return new Promise(function (res, rej) {\n ga.getAuthInstance()\n .then(function (googleAuth) {\n if (!googleAuth) {\n logger.debug('google Auth undefined');\n rej(new NonRetryableError('google Auth undefined'));\n }\n var googleUser = googleAuth.currentUser.get();\n // refresh the token\n if (googleUser.isSignedIn()) {\n logger.debug('refreshing the google access token');\n googleUser\n .reloadAuthResponse()\n .then(function (authResponse) {\n var id_token = authResponse.id_token, expires_at = authResponse.expires_at;\n res({ token: id_token, expires_at: expires_at });\n })\n .catch(function (err) {\n if (err && err.error === 'network_error') {\n // Not using NonRetryableError so handler will be retried\n rej('Network error reloading google auth response');\n }\n else {\n rej(new NonRetryableError('Failed to reload google auth response'));\n }\n });\n }\n else {\n rej(new NonRetryableError('User is not signed in with Google'));\n }\n })\n .catch(function (err) {\n logger.debug('Failed to refresh google token', err);\n rej(new NonRetryableError('Failed to refresh google token'));\n });\n });\n };\n return GoogleOAuth;\n}());\nexport { GoogleOAuth };\n//# sourceMappingURL=GoogleOAuth.js.map","import { __awaiter, __generator } from \"tslib\";\n// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { ConsoleLogger as Logger } from '../Logger';\nimport { browserOrNode } from '../JS';\nimport { NonRetryableError } from '../Util';\nvar logger = new Logger('CognitoCredentials');\nvar waitForInit = new Promise(function (res, rej) {\n if (!browserOrNode().isBrowser) {\n logger.debug('not in the browser, directly resolved');\n return res();\n }\n var fb = window['FB'];\n if (fb) {\n logger.debug('FB SDK already loaded');\n return res();\n }\n else {\n setTimeout(function () {\n return res();\n }, 2000);\n }\n});\nvar FacebookOAuth = /** @class */ (function () {\n function FacebookOAuth() {\n this.initialized = false;\n this.refreshFacebookToken = this.refreshFacebookToken.bind(this);\n this._refreshFacebookTokenImpl = this._refreshFacebookTokenImpl.bind(this);\n }\n FacebookOAuth.prototype.refreshFacebookToken = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!!this.initialized) return [3 /*break*/, 2];\n logger.debug('need to wait for the Facebook SDK loaded');\n return [4 /*yield*/, waitForInit];\n case 1:\n _a.sent();\n this.initialized = true;\n logger.debug('finish waiting');\n _a.label = 2;\n case 2: return [2 /*return*/, this._refreshFacebookTokenImpl()];\n }\n });\n });\n };\n FacebookOAuth.prototype._refreshFacebookTokenImpl = function () {\n var fb = null;\n if (browserOrNode().isBrowser)\n fb = window['FB'];\n if (!fb) {\n var errorMessage = 'no fb sdk available';\n logger.debug(errorMessage);\n return Promise.reject(new NonRetryableError(errorMessage));\n }\n return new Promise(function (res, rej) {\n fb.getLoginStatus(function (fbResponse) {\n if (!fbResponse || !fbResponse.authResponse) {\n var errorMessage = 'no response from facebook when refreshing the jwt token';\n logger.debug(errorMessage);\n // There is no definitive indication for a network error in\n // fbResponse, so we are treating it as an invalid token.\n rej(new NonRetryableError(errorMessage));\n }\n else {\n var response = fbResponse.authResponse;\n var accessToken = response.accessToken, expiresIn = response.expiresIn;\n var date = new Date();\n var expires_at = expiresIn * 1000 + date.getTime();\n if (!accessToken) {\n var errorMessage = 'the jwtToken is undefined';\n logger.debug(errorMessage);\n rej(new NonRetryableError(errorMessage));\n }\n res({\n token: accessToken,\n expires_at: expires_at,\n });\n }\n }, { scope: 'public_profile,email' });\n });\n };\n return FacebookOAuth;\n}());\nexport { FacebookOAuth };\n//# sourceMappingURL=FacebookOAuth.js.map","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { GoogleOAuth as GoogleOAuthClass } from './GoogleOAuth';\nimport { FacebookOAuth as FacebookOAuthClass } from './FacebookOAuth';\nexport var GoogleOAuth = new GoogleOAuthClass();\nexport var FacebookOAuth = new FacebookOAuthClass();\n//# sourceMappingURL=index.js.map","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar dataMemory = {};\n/** @class */\nvar MemoryStorage = /** @class */ (function () {\n function MemoryStorage() {\n }\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n MemoryStorage.setItem = function (key, value) {\n dataMemory[key] = value;\n return dataMemory[key];\n };\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */\n MemoryStorage.getItem = function (key) {\n return Object.prototype.hasOwnProperty.call(dataMemory, key)\n ? dataMemory[key]\n : undefined;\n };\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */\n MemoryStorage.removeItem = function (key) {\n return delete dataMemory[key];\n };\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */\n MemoryStorage.clear = function () {\n dataMemory = {};\n return dataMemory;\n };\n return MemoryStorage;\n}());\nexport { MemoryStorage };\nvar StorageHelper = /** @class */ (function () {\n /**\n * This is used to get a storage object\n * @returns {object} the storage\n */\n function StorageHelper() {\n try {\n this.storageWindow = window.localStorage;\n this.storageWindow.setItem('aws.amplify.test-ls', 1);\n this.storageWindow.removeItem('aws.amplify.test-ls');\n }\n catch (exception) {\n this.storageWindow = MemoryStorage;\n }\n }\n /**\n * This is used to return the storage\n * @returns {object} the storage\n */\n StorageHelper.prototype.getStorage = function () {\n return this.storageWindow;\n };\n return StorageHelper;\n}());\nexport { StorageHelper };\n//# sourceMappingURL=index.js.map","/*! *****************************************************************************\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","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isEmptyData = void 0;\nfunction isEmptyData(data) {\n if (typeof data === \"string\") {\n return data.length === 0;\n }\n return data.byteLength === 0;\n}\nexports.isEmptyData = isEmptyData;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXNFbXB0eURhdGEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaXNFbXB0eURhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBRUEsU0FBZ0IsV0FBVyxDQUFDLElBQWdCO0lBQzFDLElBQUksT0FBTyxJQUFJLEtBQUssUUFBUSxFQUFFO1FBQzVCLE9BQU8sSUFBSSxDQUFDLE1BQU0sS0FBSyxDQUFDLENBQUM7S0FDMUI7SUFFRCxPQUFPLElBQUksQ0FBQyxVQUFVLEtBQUssQ0FBQyxDQUFDO0FBQy9CLENBQUM7QUFORCxrQ0FNQyIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFNvdXJjZURhdGEgfSBmcm9tIFwiQGF3cy1zZGsvdHlwZXNcIjtcblxuZXhwb3J0IGZ1bmN0aW9uIGlzRW1wdHlEYXRhKGRhdGE6IFNvdXJjZURhdGEpOiBib29sZWFuIHtcbiAgaWYgKHR5cGVvZiBkYXRhID09PSBcInN0cmluZ1wiKSB7XG4gICAgcmV0dXJuIGRhdGEubGVuZ3RoID09PSAwO1xuICB9XG5cbiAgcmV0dXJuIGRhdGEuYnl0ZUxlbmd0aCA9PT0gMDtcbn1cbiJdfQ==","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.EMPTY_DATA_SHA_256 = exports.SHA_256_HMAC_ALGO = exports.SHA_256_HASH = void 0;\nexports.SHA_256_HASH = { name: \"SHA-256\" };\nexports.SHA_256_HMAC_ALGO = {\n name: \"HMAC\",\n hash: exports.SHA_256_HASH\n};\nexports.EMPTY_DATA_SHA_256 = new Uint8Array([\n 227,\n 176,\n 196,\n 66,\n 152,\n 252,\n 28,\n 20,\n 154,\n 251,\n 244,\n 200,\n 153,\n 111,\n 185,\n 36,\n 39,\n 174,\n 65,\n 228,\n 100,\n 155,\n 147,\n 76,\n 164,\n 149,\n 153,\n 27,\n 120,\n 82,\n 184,\n 85\n]);\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uc3RhbnRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2NvbnN0YW50cy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFBYSxRQUFBLFlBQVksR0FBd0IsRUFBRSxJQUFJLEVBQUUsU0FBUyxFQUFFLENBQUM7QUFFeEQsUUFBQSxpQkFBaUIsR0FBZ0Q7SUFDNUUsSU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ICAyMDAsXG4gIDE1MyxcbiAgMTExLFxuICAxODUsXG4gIDM2LFxuICAzOSxcbiAgMTc0LFxuICA2NSxcbiAgMjI4LFxuICAxMDAsXG4gIDE1NSxcbiAgMTQ3LFxuICA3NixcbiAgMTY0LFxuICAxNDksXG4gIDE1MyxcbiAgMjcsXG4gIDEyMCxcbiAgODIsXG4gIDE4NCxcbiAgODVcbl0pO1xuIl19","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sha256 = void 0;\nvar isEmptyData_1 = require(\"./isEmptyData\");\nvar constants_1 = require(\"./constants\");\nvar util_utf8_browser_1 = require(\"@aws-sdk/util-utf8-browser\");\nvar util_locate_window_1 = require(\"@aws-sdk/util-locate-window\");\nvar Sha256 = /** @class */ (function () {\n function Sha256(secret) {\n if (secret) {\n this.operation = getKeyPromise(secret).then(function (keyData) {\n return (0, util_locate_window_1.locateWindow)().msCrypto.subtle.sign(constants_1.SHA_256_HMAC_ALGO, keyData);\n });\n this.operation.catch(function () { });\n }\n else {\n this.operation = Promise.resolve((0, util_locate_window_1.locateWindow)().msCrypto.subtle.digest(\"SHA-256\"));\n }\n }\n Sha256.prototype.update = function (toHash) {\n var _this = this;\n if ((0, isEmptyData_1.isEmptyData)(toHash)) {\n return;\n }\n this.operation = this.operation.then(function (operation) {\n operation.onerror = function () {\n _this.operation = Promise.reject(new Error(\"Error encountered updating hash\"));\n };\n operation.process(toArrayBufferView(toHash));\n return operation;\n });\n this.operation.catch(function () { });\n };\n Sha256.prototype.digest = function () {\n return this.operation.then(function (operation) {\n return new Promise(function (resolve, reject) {\n operation.onerror = function () {\n reject(new Error(\"Error encountered finalizing hash\"));\n };\n operation.oncomplete = function () {\n if (operation.result) {\n resolve(new Uint8Array(operation.result));\n }\n reject(new Error(\"Error encountered finalizing hash\"));\n };\n operation.finish();\n });\n });\n };\n return Sha256;\n}());\nexports.Sha256 = Sha256;\nfunction getKeyPromise(secret) {\n return new Promise(function (resolve, reject) {\n var keyOperation = (0, util_locate_window_1.locateWindow)().msCrypto.subtle.importKey(\"raw\", toArrayBufferView(secret), constants_1.SHA_256_HMAC_ALGO, false, [\"sign\"]);\n keyOperation.oncomplete = function () {\n if (keyOperation.result) {\n resolve(keyOperation.result);\n }\n reject(new Error(\"ImportKey completed without importing key.\"));\n };\n keyOperation.onerror = function () {\n reject(new Error(\"ImportKey failed to import key.\"));\n };\n });\n}\nfunction toArrayBufferView(data) {\n if (typeof data === \"string\") {\n return (0, util_utf8_browser_1.fromUtf8)(data);\n }\n if (ArrayBuffer.isView(data)) {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);\n }\n return new Uint8Array(data);\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaWUxMVNoYTI1Ni5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pZTExU2hhMjU2LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDZDQUE0QztBQUM1Qyx5Q0FBZ0Q7QUFFaEQsZ0VBQXNEO0FBRXRELGtFQUEyRDtBQUUzRDtJQUdFLGdCQUFZLE1BQW1CO1FBQzdCLElBQUksTUFBTSxFQUFFO1lBQ1YsSUFBSSxDQUFDLFNBQVMsR0FBRyxhQUFhLENBQUMsTUFBTSxDQUFDLENBQUMsSUFBSSxDQUFDLFVBQUEsT0FBTztnQkFDakQsT0FBQyxJQUFBLGlDQUFZLEdBQWUsQ0FBQyxRQUFRLENBQUMsTUFBTSxDQUFDLElBQUksQ0FDL0MsNkJBQWlCLEVBQ2pCLE9BQU8sQ0FDUjtZQUhELENBR0MsQ0FDRixDQUFDO1lBQ0YsSUFBSSxDQUFDLFNBQVMsQ0FBQyxLQUFLLENBQUMsY0FBTyxDQUFDLENBQUMsQ0FBQztTQUNoQzthQUFNO1lBQ0wsSUFBSSxDQUFDLFNBQVMsR0FBRyxPQUFPLENB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koXG4gICAgICBcInJhd1wiLFxuICAgICAgdG9BcnJheUJ1ZmZlclZpZXcoc2VjcmV0KSxcbiAgICAgIFNIQV8yNTZfSE1BQ19BTEdPLFxuICAgICAgZmFsc2UsXG4gICAgICBbXCJzaWduXCJdXG4gICAgKTtcblxuICAgIGtleU9wZXJhdGlvbi5vbmNvbXBsZXRlID0gKCkgPT4ge1xuICAgICAgaWYgKGtleU9wZXJhdGlvbi5yZXN1bHQpIHtcbiAgICAgICAgcmVzb2x2ZShrZXlPcGVyYXRpb24ucmVzdWx0KTtcbiAgICAgIH1cblxuICAgICAgcmVqZWN0KG5ldyBFcnJvcihcIkltcG9ydEtleSBjb21wbGV0ZWQgd2l0aG91dCBpbXBvcnRpbmcga2V5LlwiKSk7XG4gICAgfTtcbiAgICBrZXlPcGVyYXRpb24ub25lcnJvciA9ICgpID0+IHtcbiAgICAgIHJlamVjdChuZXcgRXJyb3IoXCJJbXBvcnRLZXkgZmFpbGVkIHRvIGltcG9ydCBrZXkuXCIpKTtcbiAgICB9O1xuICB9KTtcbn1cblxuZnVuY3Rpb24gdG9BcnJheUJ1ZmZlclZpZXcoZGF0YTogU291cmNlRGF0YSk6IFVpbnQ4QXJyYXkge1xuICBpZiAodHlwZW9mIGRhdGEgPT09IFwic3RyaW5nXCIpIHtcbiAgICByZXR1cm4gZnJvbVV0ZjgoZGF0YSk7XG4gIH1cblxuICBpZiAoQXJyYXlCdWZmZXIuaXNWaWV3KGRhdGEpKSB7XG4gICAgcmV0dXJuIG5ldyBVaW50OEFycmF5KFxuICAgICAgZGF0YS5idWZmZXIsXG4gICAgICBkYXRhLmJ5dGVPZmZzZXQsXG4gICAgICBkYXRhLmJ5dGVMZW5ndGggLyBVaW50OEFycmF5LkJZVEVTX1BFUl9FTEVNRU5UXG4gICAgKTtcbiAgfVxuXG4gIHJldHVybiBuZXcgVWludDhBcnJheShkYXRhKTtcbn1cbiJdfQ==","export const fromUtf8 = (input) => {\n const bytes = [];\n for (let i = 0, len = input.length; i < len; i++) {\n const value = input.charCodeAt(i);\n if (value < 0x80) {\n bytes.push(value);\n }\n else if (value < 0x800) {\n bytes.push((value >> 6) | 0b11000000, (value & 0b111111) | 0b10000000);\n }\n else if (i + 1 < input.length && (value & 0xfc00) === 0xd800 && (input.charCodeAt(i + 1) & 0xfc00) === 0xdc00) {\n const surrogatePair = 0x10000 + ((value & 0b1111111111) << 10) + (input.charCodeAt(++i) & 0b1111111111);\n bytes.push((surrogatePair >> 18) | 0b11110000, ((surrogatePair >> 12) & 0b111111) | 0b10000000, ((surrogatePair >> 6) & 0b111111) | 0b10000000, (surrogatePair & 0b111111) | 0b10000000);\n }\n else {\n bytes.push((value >> 12) | 0b11100000, ((value >> 6) & 0b111111) | 0b10000000, (value & 0b111111) | 0b10000000);\n }\n }\n return Uint8Array.from(bytes);\n};\nexport const toUtf8 = (input) => {\n let decoded = \"\";\n for (let i = 0, len = input.length; i < len; i++) {\n const byte = input[i];\n if (byte < 0x80) {\n decoded += String.fromCharCode(byte);\n }\n else if (0b11000000 <= byte && byte < 0b11100000) {\n const nextByte = input[++i];\n decoded += String.fromCharCode(((byte & 0b11111) << 6) | (nextByte & 0b111111));\n }\n else if (0b11110000 <= byte && byte < 0b101101101) {\n const surrogatePair = [byte, input[++i], input[++i], input[++i]];\n const encoded = \"%\" + surrogatePair.map((byteValue) => byteValue.toString(16)).join(\"%\");\n decoded += decodeURIComponent(encoded);\n }\n else {\n decoded += String.fromCharCode(((byte & 0b1111) << 12) | ((input[++i] & 0b111111) << 6) | (input[++i] & 0b111111));\n }\n }\n return decoded;\n};\n","export function fromUtf8(input) {\n return new TextEncoder().encode(input);\n}\nexport function toUtf8(input) {\n return new TextDecoder(\"utf-8\").decode(input);\n}\n","import { fromUtf8 as jsFromUtf8, toUtf8 as jsToUtf8 } from \"./pureJs\";\nimport { fromUtf8 as textEncoderFromUtf8, toUtf8 as textEncoderToUtf8 } from \"./whatwgEncodingApi\";\nexport const fromUtf8 = (input) => typeof TextEncoder === \"function\" ? textEncoderFromUtf8(input) : jsFromUtf8(input);\nexport const toUtf8 = (input) => typeof TextDecoder === \"function\" ? textEncoderToUtf8(input) : jsToUtf8(input);\n","\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.convertToBuffer = void 0;\nvar util_utf8_browser_1 = require(\"@aws-sdk/util-utf8-browser\");\n// Quick polyfill\nvar fromUtf8 = typeof Buffer !== \"undefined\" && Buffer.from\n ? function (input) { return Buffer.from(input, \"utf8\"); }\n : util_utf8_browser_1.fromUtf8;\nfunction convertToBuffer(data) {\n // Already a Uint8, do nothing\n if (data instanceof Uint8Array)\n return data;\n if (typeof data === \"string\") {\n return fromUtf8(data);\n }\n if (ArrayBuffer.isView(data)) {\n return new Uint8Array(data.buffer, data.byteOffset, data.byteLength / Uint8Array.BYTES_PER_ELEMENT);\n }\n return new Uint8Array(data);\n}\nexports.convertToBuffer = convertToBuffer;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29udmVydFRvQnVmZmVyLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2NvbnZlcnRUb0J1ZmZlci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUEsb0VBQW9FO0FBQ3BFLHNDQUFzQzs7O0FBR3RDLGdFQUF5RTtBQUV6RSxpQkFBaUI7QUFDakIsSUFBTSxRQUFRLEdBQ1osT0FBTyxNQUFNLEtBQUssV0FBVyxJQUFJLE1BQU0sQ0FBQyxJQUFJO0lBQzFDLENBQUMsQ0FBQyxVQUFDLEtBQWEsSUFBSyxPQUFBLE1BQU0sQ0FBQyxJQUFJLENBQUMsS0FBSyxFQUFFLE1BQU0sQ0FBQyxFQUExQixDQUEwQjtJQUMvQyxDQUFDLENBQUMsNEJBQWUsQ0FBQztBQUV0QixTQUFnQixlQU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3dzZXI7XG5cbmV4cG9ydCBmdW5jdGlvbiBjb252ZXJ0VG9CdWZmZXIoZGF0YTogU291cmNlRGF0YSk6IFVpbnQ4QXJyYXkge1xuICAvLyBBbHJlYWR5IGEgVWludDgsIGRvIG5vdGhpbmdcbiAgaWYgKGRhdGEgaW5zdGFuY2VvZiBVaW50OEFycmF5KSByZXR1cm4gZGF0YTtcblxuICBpZiAodHlwZW9mIGRhdGEgPT09IFwic3RyaW5nXCIpIHtcbiAgICByZXR1cm4gZnJvbVV0ZjgoZGF0YSk7XG4gIH1cblxuICBpZiAoQXJyYXlCdWZmZXIuaXNWaWV3KGRhdGEpKSB7XG4gICAgcmV0dXJuIG5ldyBVaW50OEFycmF5KFxuICAgICAgZGF0YS5idWZmZXIsXG4gICAgICBkYXRhLmJ5dGVPZmZzZXQsXG4gICAgICBkYXRhLmJ5dGVMZW5ndGggLyBVaW50OEFycmF5LkJZVEVTX1BFUl9FTEVNRU5UXG4gICAgKTtcbiAgfVxuXG4gIHJldHVybiBuZXcgVWludDhBcnJheShkYXRhKTtcbn1cbiJdfQ==","\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isEmptyData = void 0;\nfunction isEmptyData(data) {\n if (typeof data === \"string\") {\n return data.length === 0;\n }\n return data.byteLength === 0;\n}\nexports.isEmptyData = isEmptyData;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaXNFbXB0eURhdGEuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaXNFbXB0eURhdGEudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLG9FQUFvRTtBQUNwRSxzQ0FBc0M7OztBQUl0QyxTQUFnQixXQUFXLENBQUMsSUFBZ0I7SUFDMUMsSUFBSSxPQUFPLElBQUksS0FBSyxRQUFRLEVBQUU7UUFDNUIsT0FBTyxJQUFJLENBQUMsTUFBTSxLQUFLLENBQUMsQ0FBQztLQUMxQjtJQUVELE9BQU8sSUFBSSxDQUFDLFVBQVUsS0FBSyxDQUFDLENBQUM7QUFDL0IsQ0FBQztBQU5ELGtDQU1DIiwic291cmNlc0NvbnRlbnQiOlsiLy8gQ29weXJpZ2h0IEFtYXpvbi5jb20gSW5jLiBvciBpdHMgYWZmaWxpYXRlcy4gQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbi8vIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBBcGFjaGUtMi4wXG5cbmltcG9ydCB7IFNvdXJjZURhdGEgfSBmcm9tIFwiQGF3cy1zZGsvdHlwZXNcIjtcblxuZXhwb3J0IGZ1bmN0aW9uIGlzRW1wdHlEYXRhKGRhdGE6IFNvdXJjZURhdGEpOiBib29sZWFuIHtcbiAgaWYgKHR5cGVvZiBkYXRhID09PSBcInN0cmluZ1wiKSB7XG4gICAgcmV0dXJuIGRhdGEubGVuZ3RoID09PSAwO1xuICB9XG5cbiAgcmV0dXJuIGRhdGEuYnl0ZUxlbmd0aCA9PT0gMDtcbn1cbiJdfQ==","\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.numToUint8 = void 0;\nfunction numToUint8(num) {\n return new Uint8Array([\n (num & 0xff000000) >> 24,\n (num & 0x00ff0000) >> 16,\n (num & 0x0000ff00) >> 8,\n num & 0x000000ff,\n ]);\n}\nexports.numToUint8 = numToUint8;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibnVtVG9VaW50OC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9udW1Ub1VpbnQ4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxvRUFBb0U7QUFDcEUsc0NBQXNDOzs7QUFFdEMsU0FBZ0IsVUFBVSxDQUFDLEdBQVc7SUFDcEMsT0FBTyxJQUFJLFVBQVUsQ0FBQztRQUNwQixDQUFDLEdBQUcsR0FBRyxVQUFVLENBQUMsSUFBSSxFQUFFO1FBQ3hCLENBQUMsR0FBRyxHQUFHLFVBQVUsQ0FBQyxJQUFJLEVBQUU7UUFDeEIsQ0FBQyxHQUFHLEdBQUcsVUFBVSxDQUFDLElBQUksQ0FBQztRQUN2QixHQUFHLEdBQUcsVUFBVTtLQUNqQixDQUFDLENBQUM7QUFDTCxDQUFDO0FBUEQsZ0NBT0MiLCJzb3VyY2VzQ29udGVudCI6WyIvLyBDb3B5cmlnaHQgQW1hem9uLmNvbSBJbmMuIG9yIGl0cyBhZmZpbGlhdGVzLiBBbGwgUmlnaHRzIFJlc2VydmVkLlxuLy8gU1BEWC1MaWNlbnNlLUlkZW50aWZpZXI6IEFwYWNoZS0yLjBcblxuZXhwb3J0IGZ1bmN0aW9uIG51bVRvVWludDgobnVtOiBudW1iZXIpIHtcbiAgcmV0dXJuIG5ldyBVaW50OEFycmF5KFtcbiAgICAobnVtICYgMHhmZjAwMDAwMCkgPj4gMjQsXG4gICAgKG51bSAmIDB4MDBmZjAwMDApID4+IDE2LFxuICAgIChudW0gJiAweDAwMDBmZjAwKSA+PiA4LFxuICAgIG51bSAmIDB4MDAwMDAwZmYsXG4gIF0pO1xufVxuIl19","\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.uint32ArrayFrom = void 0;\n// IE 11 does not support Array.from, so we do it manually\nfunction uint32ArrayFrom(a_lookUpTable) {\n if (!Array.from) {\n var return_array = new Uint32Array(a_lookUpTable.length);\n var a_index = 0;\n while (a_index < a_lookUpTable.length) {\n return_array[a_index] = a_lookUpTable[a_index];\n }\n return return_array;\n }\n return Uint32Array.from(a_lookUpTable);\n}\nexports.uint32Array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Pik6IFVpbnQzMkFycmF5IHtcbiAgaWYgKCFBcnJheS5mcm9tKSB7XG4gICAgY29uc3QgcmV0dXJuX2FycmF5ID0gbmV3IFVpbnQzMkFycmF5KGFfbG9va1VwVGFibGUubGVuZ3RoKVxuICAgIGxldCBhX2luZGV4ID0gMFxuICAgIHdoaWxlIChhX2luZGV4IDwgYV9sb29rVXBUYWJsZS5sZW5ndGgpIHtcbiAgICAgIHJldHVybl9hcnJheVthX2luZGV4XSA9IGFfbG9va1VwVGFibGVbYV9pbmRleF1cbiAgICB9XG4gICAgcmV0dXJuIHJldHVybl9hcnJheVxuICB9XG4gIHJldHVybiBVaW50MzJBcnJheS5mcm9tKGFfbG9va1VwVGFibGUpXG59XG4iXX0=","\"use strict\";\n// Copyright Amazon.com Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.uint32ArrayFrom = exports.numToUint8 = exports.isEmptyData = exports.convertToBuffer = void 0;\nvar convertToBuffer_1 = require(\"./convertToBuffer\");\nObject.defineProperty(exports, \"convertToBuffer\", { enumerable: true, get: function () { return convertToBuffer_1.convertToBuffer; } });\nvar isEmptyData_1 = require(\"./isEmptyData\");\nObject.defineProperty(exports, \"isEmptyData\", { enumerable: true, get: function () { return isEmptyData_1.isEmptyData; } });\nvar numToUint8_1 = require(\"./numToUint8\");\nObject.defineProperty(exports, \"numToUint8\", { enumerable: true, get: function () { return numToUint8_1.numToUint8; } });\nvar uint32ArrayFrom_1 = require(\"./uint32ArrayFrom\");\nObject.defineProperty(exports, \"uint32ArrayFrom\", { enumerable: true, get: function () { return uint32ArrayFrom_1.uint32ArrayFrom; } });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLG9FQUFvRTtBQUNwRSxzQ0FBc0M7OztBQUV0QyxxREFBb0Q7QUFBM0Msa0hBQUEsZUFBZSxPQUFBO0FBQ3hCLDZDQUE0QztBQUFuQywwR0FBQSxXQUFXLE9BQUE7QUFDcEIsMkNBQTBDO0FBQWpDLHdHQUFBLFVBQVUsT0FBQTtBQUNuQixxREFBa0Q7QUFBMUMsa0hBQUEsZUFBZSxPQUFBIiwic291cmNlc0NvbnRlbnQiOlsiLy8gQ29weXJpZ2h0IEFtYXpvbi5jb20gSW5jLiBvciBpdHMgYWZmaWxpYXRlcy4gQWxsIFJpZ2h0cyBSZXNlcnZlZC5cbi8vIFNQRFgtTGljZW5zZS1JZGVudGlmaWVyOiBBcGFjaGUtMi4wXG5cbmV4cG9ydCB7IGNvbnZlcnRUb0J1ZmZlciB9IGZyb20gXCIuL2NvbnZlcnRUb0J1ZmZlclwiO1xuZXhwb3J0IHsgaXNFbXB0eURhdGEgfSBmcm9tIFwiLi9pc0VtcHR5RGF0YVwiO1xuZXhwb3J0IHsgbnVtVG9VaW50OCB9IGZyb20gXCIuL251bVRvVWludDhcIjtcbmV4cG9ydCB7dWludDMyQXJyYXlGcm9tfSBmcm9tICcuL3VpbnQzMkFycmF5RnJvbSc7XG4iXX0=","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sha256 = void 0;\nvar util_1 = require(\"@aws-crypto/util\");\nvar constants_1 = require(\"./constants\");\nvar util_locate_window_1 = require(\"@aws-sdk/util-locate-window\");\nvar Sha256 = /** @class */ (function () {\n function Sha256(secret) {\n this.toHash = new Uint8Array(0);\n if (secret !== void 0) {\n this.key = new Promise(function (resolve, reject) {\n (0, util_locate_window_1.locateWindow)()\n .crypto.subtle.importKey(\"raw\", (0, util_1.convertToBuffer)(secret), constants_1.SHA_256_HMAC_ALGO, false, [\"sign\"])\n .then(resolve, reject);\n });\n this.key.catch(function () { });\n }\n }\n Sha256.prototype.update = function (data) {\n if ((0, util_1.isEmptyData)(data)) {\n return;\n }\n var update = (0, util_1.convertToBuffer)(data);\n var typedArray = new Uint8Array(this.toHash.byteLength + update.byteLength);\n typedArray.set(this.toHash, 0);\n typedArray.set(update, this.toHash.byteLength);\n this.toHash = typedArray;\n };\n Sha256.prototype.digest = function () {\n var _this = this;\n if (this.key) {\n return this.key.then(function (key) {\n return (0, util_locate_window_1.locateWindow)()\n .crypto.subtle.sign(constants_1.SHA_256_HMAC_ALGO, key, _this.toHash)\n .then(function (data) { return new Uint8Array(data); });\n });\n }\n if ((0, util_1.isEmptyData)(this.toHash)) {\n return Promise.resolve(constants_1.EMPTY_DATA_SHA_256);\n }\n return Promise.resolve()\n .then(function () {\n return (0, util_locate_window_1.locateWindow)().crypto.subtle.digest(constants_1.SHA_256_HASH, _this.toHash);\n })\n .then(function (data) { return Promise.resolve(new Uint8Array(data)); });\n };\n return Sha256;\n}());\nexports.Sha256 = Sha256;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2ViQ3J5cHRvU2hhMjU2LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL3dlYkNyeXB0b1NoYTI1Ni50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7QUFDQSx5Q0FBZ0U7QUFDaEUseUNBSXFCO0FBQ3JCLGtFQUEyRDtBQUUzRDtJQUlFLGdCQUFZLE1BQW1CO1FBRnZCLFdBQU0sR0FBZSxJQUFJLFVBQVUsQ0FBQyxDQUFDLENBQUMsQ0FBQztRQUc3QyxJQUFJLE1BQU0sS0FBSyxLQUFLLENBQUMsRUFBRTtZQUNyQixJQUFJLENBQUMsR0FBRyxHQUFHLElBQUksT0FBTyxDQUFDLFVBQUMsT0FBTyxFQUFFLE1BQU07Z0JBQ3JDLElBQUEsaUNBQVksR0FBRTtxQkFDWCxNQUFNLENBQUMsTUFBTSxDQUFDLFNBQVMsQ0FDdEIsS0FBSyxFQUNMLElBQUEsc0JBQWUsRU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3RoICsgdXBkYXRlLmJ5dGVMZW5ndGhcbiAgICApO1xuICAgIHR5cGVkQXJyYXkuc2V0KHRoaXMudG9IYXNoLCAwKTtcbiAgICB0eXBlZEFycmF5LnNldCh1cGRhdGUsIHRoaXMudG9IYXNoLmJ5dGVMZW5ndGgpO1xuICAgIHRoaXMudG9IYXNoID0gdHlwZWRBcnJheTtcbiAgfVxuXG4gIGRpZ2VzdCgpOiBQcm9taXNlPFVpbnQ4QXJyYXk+IHtcbiAgICBpZiAodGhpcy5rZXkpIHtcbiAgICAgIHJldHVybiB0aGlzLmtleS50aGVuKChrZXkpID0+XG4gICAgICAgIGxvY2F0ZVdpbmRvdygpXG4gICAgICAgICAgLmNyeXB0by5zdWJ0bGUuc2lnbihTSEFfMjU2X0hNQUNfQUxHTywga2V5LCB0aGlzLnRvSGFzaClcbiAgICAgICAgICAudGhlbigoZGF0YSkgPT4gbmV3IFVpbnQ4QXJyYXkoZGF0YSkpXG4gICAgICApO1xuICAgIH1cblxuICAgIGlmIChpc0VtcHR5RGF0YSh0aGlzLnRvSGFzaCkpIHtcbiAgICAgIHJldHVybiBQcm9taXNlLnJlc29sdmUoRU1QVFlfREFUQV9TSEFfMjU2KTtcbiAgICB9XG5cbiAgICByZXR1cm4gUHJvbWlzZS5yZXNvbHZlKClcbiAgICAgIC50aGVuKCgpID0+XG4gICAgICAgIGxvY2F0ZVdpbmRvdygpLmNyeXB0by5zdWJ0bGUuZGlnZXN0KFNIQV8yNTZfSEFTSCwgdGhpcy50b0hhc2gpXG4gICAgICApXG4gICAgICAudGhlbigoZGF0YSkgPT4gUHJvbWlzZS5yZXNvbHZlKG5ldyBVaW50OEFycmF5KGRhdGEpKSk7XG4gIH1cbn1cbiJdfQ==","/*! *****************************************************************************\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","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.supportsZeroByteGCM = exports.supportsSubtleCrypto = exports.supportsSecureRandom = exports.supportsWebCrypto = void 0;\nvar tslib_1 = require(\"tslib\");\nvar subtleCryptoMethods = [\n \"decrypt\",\n \"digest\",\n \"encrypt\",\n \"exportKey\",\n \"generateKey\",\n \"importKey\",\n \"sign\",\n \"verify\"\n];\nfunction supportsWebCrypto(window) {\n if (supportsSecureRandom(window) &&\n typeof window.crypto.subtle === \"object\") {\n var subtle = window.crypto.subtle;\n return supportsSubtleCrypto(subtle);\n }\n return false;\n}\nexports.supportsWebCrypto = supportsWebCrypto;\nfunction supportsSecureRandom(window) {\n if (typeof window === \"object\" && typeof window.crypto === \"object\") {\n var getRandomValues = window.crypto.getRandomValues;\n return typeof getRandomValues === \"function\";\n }\n return false;\n}\nexports.supportsSecureRandom = supportsSecureRandom;\nfunction supportsSubtleCrypto(subtle) {\n return (subtle &&\n subtleCryptoMethods.every(function (methodName) { return typeof subtle[methodName] === \"function\"; }));\n}\nexports.supportsSubtleCrypto = supportsSubtleCrypto;\nfunction supportsZeroByteGCM(subtle) {\n return tslib_1.__awaiter(this, void 0, void 0, function () {\n var key, zeroByteAuthTag, _a;\n return tslib_1.__generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (!supportsSubtleCrypto(subtle))\n return [2 /*return*/, false];\n _b.label = 1;\n case 1:\n _b.trys.push([1, 4, , 5]);\n return [4 /*yield*/, subtle.generateKey({ name: \"AES-GCM\", length: 128 }, false, [\"encrypt\"])];\n case 2:\n key = _b.sent();\n return [4 /*yield*/, subtle.encrypt({\n name: \"AES-GCM\",\n iv: new Uint8Array(Array(12)),\n additionalData: new Uint8Array(Array(16)),\n tagLength: 128\n }, key, new Uint8Array(0))];\n case 3:\n zeroByteAuthTag = _b.sent();\n return [2 /*return*/, zeroByteAuthTag.byteLength === 16];\n case 4:\n _a = _b.sent();\n return [2 /*return*/, false];\n case 5: return [2 /*return*/];\n }\n });\n });\n}\nexports.supportsZeroByteGCM = supportsZeroByteGCM;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3VwcG9ydHNXZWJDcnlwdG8uanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvc3VwcG9ydHNXZWJDcnlwdG8udHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQVVBLElBQU0sbUJBQW1CLE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GUgJiZcbiAgICBzdWJ0bGVDcnlwdG9NZXRob2RzLmV2ZXJ5KFxuICAgICAgbWV0aG9kTmFtZSA9PiB0eXBlb2Ygc3VidGxlW21ldGhvZE5hbWVdID09PSBcImZ1bmN0aW9uXCJcbiAgICApXG4gICk7XG59XG5cbmV4cG9ydCBhc3luYyBmdW5jdGlvbiBzdXBwb3J0c1plcm9CeXRlR0NNKHN1YnRsZTogU3VidGxlQ3J5cHRvKSB7XG4gIGlmICghc3VwcG9ydHNTdWJ0bGVDcnlwdG8oc3VidGxlKSkgcmV0dXJuIGZhbHNlO1xuICB0cnkge1xuICAgIGNvbnN0IGtleSA9IGF3YWl0IHN1YnRsZS5nZW5lcmF0ZUtleShcbiAgICAgIHsgbmFtZTogXCJBRVMtR0NNXCIsIGxlbmd0aDogMTI4IH0sXG4gICAgICBmYWxzZSxcbiAgICAgIFtcImVuY3J5cHRcIl1cbiAgICApO1xuICAgIGNvbnN0IHplcm9CeXRlQXV0aFRhZyA9IGF3YWl0IHN1YnRsZS5lbmNyeXB0KFxuICAgICAge1xuICAgICAgICBuYW1lOiBcIkFFUy1HQ01cIixcbiAgICAgICAgaXY6IG5ldyBVaW50OEFycmF5KEFycmF5KDEyKSksXG4gICAgICAgIGFkZGl0aW9uYWxEYXRhOiBuZXcgVWludDhBcnJheShBcnJheSgxNikpLFxuICAgICAgICB0YWdMZW5ndGg6IDEyOFxuICAgICAgfSxcbiAgICAgIGtleSxcbiAgICAgIG5ldyBVaW50OEFycmF5KDApXG4gICAgKTtcbiAgICByZXR1cm4gemVyb0J5dGVBdXRoVGFnLmJ5dGVMZW5ndGggPT09IDE2O1xuICB9IGNhdGNoIHtcbiAgICByZXR1cm4gZmFsc2U7XG4gIH1cbn1cbiJdfQ==","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar tslib_1 = require(\"tslib\");\ntslib_1.__exportStar(require(\"./supportsWebCrypto\"), exports);\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsOERBQW9DIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSBcIi4vc3VwcG9ydHNXZWJDcnlwdG9cIjtcbiJdfQ==","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Sha256 = void 0;\nvar ie11Sha256_1 = require(\"./ie11Sha256\");\nvar webCryptoSha256_1 = require(\"./webCryptoSha256\");\nvar sha256_js_1 = require(\"@aws-crypto/sha256-js\");\nvar supports_web_crypto_1 = require(\"@aws-crypto/supports-web-crypto\");\nvar ie11_detection_1 = require(\"@aws-crypto/ie11-detection\");\nvar util_locate_window_1 = require(\"@aws-sdk/util-locate-window\");\nvar Sha256 = /** @class */ (function () {\n function Sha256(secret) {\n if ((0, supports_web_crypto_1.supportsWebCrypto)((0, util_locate_window_1.locateWindow)())) {\n this.hash = new webCryptoSha256_1.Sha256(secret);\n }\n else if ((0, ie11_detection_1.isMsWindow)((0, util_locate_window_1.locateWindow)())) {\n this.hash = new ie11Sha256_1.Sha256(secret);\n }\n else {\n this.hash = new sha256_js_1.Sha256(secret);\n }\n }\n Sha256.prototype.update = function (data, encoding) {\n this.hash.update(data, encoding);\n };\n Sha256.prototype.digest = function () {\n return this.hash.digest();\n };\n return Sha256;\n}());\nexports.Sha256 = Sha256;\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3Jvc3NQbGF0Zm9ybVNoYTI1Ni5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9jcm9zc1BsYXRmb3JtU2hhMjU2LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQUFBLDJDQUFvRDtBQUNwRCxxREFBOEQ7QUFDOUQsbURB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RoaXMuaGFzaC5kaWdlc3QoKTtcbiAgfVxufVxuIl19","\"use strict\";\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.WebCryptoSha256 = exports.Ie11Sha256 = void 0;\nvar tslib_1 = require(\"tslib\");\n(0, tslib_1.__exportStar)(require(\"./crossPlatformSha256\"), exports);\nvar ie11Sha256_1 = require(\"./ie11Sha256\");\nObject.defineProperty(exports, \"Ie11Sha256\", { enumerable: true, get: function () { return ie11Sha256_1.Sha256; } });\nvar webCryptoSha256_1 = require(\"./webCryptoSha256\");\nObject.defineProperty(exports, \"WebCryptoSha256\", { enumerable: true, get: function () { return webCryptoSha256_1.Sha256; } });\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7OztBQUFBLHFFQUFzQztBQUN0QywyQ0FBb0Q7QUFBM0Msd0dBQUEsTUFBTSxPQUFjO0FBQzdCLHFEQUE4RDtBQUFyRCxrSEFBQSxNQUFNLE9BQW1CIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0ICogZnJvbSBcIi4vY3Jvc3NQbGF0Zm9ybVNoYTI1NlwiO1xuZXhwb3J0IHsgU2hhMjU2IGFzIEllMTFTaGEyNTYgfSBmcm9tIFwiLi9pZTExU2hhMjU2XCI7XG5leHBvcnQgeyBTaGEyNTYgYXMgV2ViQ3J5cHRvU2hhMjU2IH0gZnJvbSBcIi4vd2ViQ3J5cHRvU2hhMjU2XCI7XG4iXX0=","import { __assign } from \"tslib\";\n// Partition default templates\nvar AWS_TEMPLATE = \"cognito-identity.{region}.amazonaws.com\";\nvar AWS_CN_TEMPLATE = \"cognito-identity.{region}.amazonaws.com.cn\";\nvar AWS_ISO_TEMPLATE = \"cognito-identity.{region}.c2s.ic.gov\";\nvar AWS_ISO_B_TEMPLATE = \"cognito-identity.{region}.sc2s.sgov.gov\";\nvar AWS_US_GOV_TEMPLATE = \"cognito-identity.{region}.amazonaws.com\";\n// Partition regions\nvar AWS_REGIONS = new Set([\n \"af-south-1\",\n \"ap-east-1\",\n \"ap-northeast-1\",\n \"ap-northeast-2\",\n \"ap-south-1\",\n \"ap-southeast-1\",\n \"ap-southeast-2\",\n \"ca-central-1\",\n \"eu-central-1\",\n \"eu-north-1\",\n \"eu-south-1\",\n \"eu-west-1\",\n \"eu-west-2\",\n \"eu-west-3\",\n \"me-south-1\",\n \"sa-east-1\",\n \"us-east-1\",\n \"us-east-2\",\n \"us-west-1\",\n \"us-west-2\",\n]);\nvar AWS_CN_REGIONS = new Set([\"cn-north-1\", \"cn-northwest-1\"]);\nvar AWS_ISO_REGIONS = new Set([\"us-iso-east-1\"]);\nvar AWS_ISO_B_REGIONS = new Set([\"us-isob-east-1\"]);\nvar AWS_US_GOV_REGIONS = new Set([\"us-gov-east-1\", \"us-gov-west-1\"]);\nexport var defaultRegionInfoProvider = function (region, options) {\n var regionInfo = undefined;\n switch (region) {\n // First, try to match exact region names.\n case \"ap-northeast-1\":\n regionInfo = {\n hostname: \"cognito-identity.ap-northeast-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"ap-northeast-2\":\n regionInfo = {\n hostname: \"cognito-identity.ap-northeast-2.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"ap-south-1\":\n regionInfo = {\n hostname: \"cognito-identity.ap-south-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"ap-southeast-1\":\n regionInfo = {\n hostname: \"cognito-identity.ap-southeast-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"ap-southeast-2\":\n regionInfo = {\n hostname: \"cognito-identity.ap-southeast-2.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"ca-central-1\":\n regionInfo = {\n hostname: \"cognito-identity.ca-central-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"cn-north-1\":\n regionInfo = {\n hostname: \"cognito-identity.cn-north-1.amazonaws.com.cn\",\n partition: \"aws-cn\",\n };\n break;\n case \"eu-central-1\":\n regionInfo = {\n hostname: \"cognito-identity.eu-central-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"eu-north-1\":\n regionInfo = {\n hostname: \"cognito-identity.eu-north-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"eu-west-1\":\n regionInfo = {\n hostname: \"cognito-identity.eu-west-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"eu-west-2\":\n regionInfo = {\n hostname: \"cognito-identity.eu-west-2.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"eu-west-3\":\n regionInfo = {\n hostname: \"cognito-identity.eu-west-3.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"fips-us-east-1\":\n regionInfo = {\n hostname: \"cognito-identity-fips.us-east-1.amazonaws.com\",\n partition: \"aws\",\n signingRegion: \"us-east-1\",\n };\n break;\n case \"fips-us-east-2\":\n regionInfo = {\n hostname: \"cognito-identity-fips.us-east-2.amazonaws.com\",\n partition: \"aws\",\n signingRegion: \"us-east-2\",\n };\n break;\n case \"fips-us-gov-west-1\":\n regionInfo = {\n hostname: \"cognito-identity-fips.us-gov-west-1.amazonaws.com\",\n partition: \"aws-us-gov\",\n signingRegion: \"us-gov-west-1\",\n };\n break;\n case \"fips-us-west-2\":\n regionInfo = {\n hostname: \"cognito-identity-fips.us-west-2.amazonaws.com\",\n partition: \"aws\",\n signingRegion: \"us-west-2\",\n };\n break;\n case \"sa-east-1\":\n regionInfo = {\n hostname: \"cognito-identity.sa-east-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"us-east-1\":\n regionInfo = {\n hostname: \"cognito-identity.us-east-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"us-east-2\":\n regionInfo = {\n hostname: \"cognito-identity.us-east-2.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"us-gov-west-1\":\n regionInfo = {\n hostname: \"cognito-identity.us-gov-west-1.amazonaws.com\",\n partition: \"aws-us-gov\",\n };\n break;\n case \"us-west-1\":\n regionInfo = {\n hostname: \"cognito-identity.us-west-1.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n case \"us-west-2\":\n regionInfo = {\n hostname: \"cognito-identity.us-west-2.amazonaws.com\",\n partition: \"aws\",\n };\n break;\n // Next, try to match partition endpoints.\n default:\n if (AWS_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws\",\n };\n }\n if (AWS_CN_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_CN_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws-cn\",\n };\n }\n if (AWS_ISO_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_ISO_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws-iso\",\n };\n }\n if (AWS_ISO_B_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_ISO_B_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws-iso-b\",\n };\n }\n if (AWS_US_GOV_REGIONS.has(region)) {\n regionInfo = {\n hostname: AWS_US_GOV_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws-us-gov\",\n };\n }\n // Finally, assume it's an AWS partition endpoint.\n if (regionInfo === undefined) {\n regionInfo = {\n hostname: AWS_TEMPLATE.replace(\"{region}\", region),\n partition: \"aws\",\n };\n }\n }\n return Promise.resolve(__assign({ signingService: \"cognito-identity\" }, regionInfo));\n};\n//# sourceMappingURL=endpoints.js.map","import { defaultRegionInfoProvider } from \"./endpoints\";\nimport { parseUrl } from \"@aws-sdk/url-parser\";\n/**\n * @internal\n */\nexport var ClientSharedValues = {\n apiVersion: \"2014-06-30\",\n disableHostPrefix: false,\n logger: {},\n regionInfoProvider: defaultRegionInfoProvider,\n serviceId: \"Cognito Identity\",\n urlParser: parseUrl,\n};\n//# sourceMappingURL=runtimeConfig.shared.js.map","import { __assign } from \"tslib\";\nimport packageInfo from \"./package.json\";\nimport { Sha256 } from \"@aws-crypto/sha256-browser\";\nimport { FetchHttpHandler, streamCollector } from \"@aws-sdk/fetch-http-handler\";\nimport { invalidProvider } from \"@aws-sdk/invalid-dependency\";\nimport { DEFAULT_MAX_ATTEMPTS } from \"@aws-sdk/middleware-retry\";\nimport { fromBase64, toBase64 } from \"@aws-sdk/util-base64-browser\";\nimport { calculateBodyLength } from \"@aws-sdk/util-body-length-browser\";\nimport { defaultUserAgent } from \"@aws-sdk/util-user-agent-browser\";\nimport { fromUtf8, toUtf8 } from \"@aws-sdk/util-utf8-browser\";\nimport { ClientSharedValues } from \"./runtimeConfig.shared\";\n/**\n * @internal\n */\nexport var ClientDefaultValues = __assign(__assign({}, ClientSharedValues), { runtime: \"browser\", base64Decoder: fromBase64, base64Encoder: toBase64, bodyLengthChecker: calculateBodyLength, credentialDefaultProvider: function (_) { return function () { return Promise.reject(new Error(\"Credential is missing\")); }; }, defaultUserAgentProvider: defaultUserAgent({\n serviceId: ClientSharedValues.serviceId,\n clientVersion: packageInfo.version,\n }), maxAttempts: DEFAULT_MAX_ATTEMPTS, region: invalidProvider(\"Region is missing\"), requestHandler: new FetchHttpHandler(), sha256: Sha256, streamCollector: streamCollector, utf8Decoder: fromUtf8, utf8Encoder: toUtf8 });\n//# sourceMappingURL=runtimeConfig.browser.js.map","import { __assign, __extends } from \"tslib\";\nimport { ClientDefaultValues as __ClientDefaultValues } from \"./runtimeConfig\";\nimport { resolveEndpointsConfig, resolveRegionConfig, } from \"@aws-sdk/config-resolver\";\nimport { getContentLengthPlugin } from \"@aws-sdk/middleware-content-length\";\nimport { getHostHeaderPlugin, resolveHostHeaderConfig, } from \"@aws-sdk/middleware-host-header\";\nimport { getLoggerPlugin } from \"@aws-sdk/middleware-logger\";\nimport { getRetryPlugin, resolveRetryConfig } from \"@aws-sdk/middleware-retry\";\nimport { resolveAwsAuthConfig } from \"@aws-sdk/middleware-signing\";\nimport { getUserAgentPlugin, resolveUserAgentConfig, } from \"@aws-sdk/middleware-user-agent\";\nimport { Client as __Client, } from \"@aws-sdk/smithy-client\";\n/**\n * Amazon Cognito Federated Identities\n *

Amazon Cognito Federated Identities is a web service that delivers scoped temporary\n * credentials to mobile devices and other untrusted environments. It uniquely identifies a\n * device and supplies the user with a consistent identity over the lifetime of an\n * application.

\n *

Using Amazon Cognito Federated Identities, you can enable authentication with one or\n * more third-party identity providers (Facebook, Google, or Login with Amazon) or an Amazon\n * Cognito user pool, and you can also choose to support unauthenticated access from your app.\n * Cognito delivers a unique identifier for each user and acts as an OpenID token provider\n * trusted by AWS Security Token Service (STS) to access temporary, limited-privilege AWS\n * credentials.

\n *

For a description of the authentication flow from the Amazon Cognito Developer Guide\n * see Authentication Flow.

\n *

For more information see Amazon Cognito Federated Identities.

\n */\nvar CognitoIdentityClient = /** @class */ (function (_super) {\n __extends(CognitoIdentityClient, _super);\n function CognitoIdentityClient(configuration) {\n var _this = this;\n var _config_0 = __assign(__assign({}, __ClientDefaultValues), configuration);\n var _config_1 = resolveRegionConfig(_config_0);\n var _config_2 = resolveEndpointsConfig(_config_1);\n var _config_3 = resolveAwsAuthConfig(_config_2);\n var _config_4 = resolveRetryConfig(_config_3);\n var _config_5 = resolveHostHeaderConfig(_config_4);\n var _config_6 = resolveUserAgentConfig(_config_5);\n _this = _super.call(this, _config_6) || this;\n _this.config = _config_6;\n _this.middlewareStack.use(getRetryPlugin(_this.config));\n _this.middlewareStack.use(getContentLengthPlugin(_this.config));\n _this.middlewareStack.use(getHostHeaderPlugin(_this.config));\n _this.middlewareStack.use(getLoggerPlugin(_this.config));\n _this.middlewareStack.use(getUserAgentPlugin(_this.config));\n return _this;\n }\n CognitoIdentityClient.prototype.destroy = function () {\n _super.prototype.destroy.call(this);\n };\n return CognitoIdentityClient;\n}(__Client));\nexport { CognitoIdentityClient };\n//# sourceMappingURL=CognitoIdentityClient.js.map","import { __assign } from \"tslib\";\nexport var AmbiguousRoleResolutionType;\n(function (AmbiguousRoleResolutionType) {\n AmbiguousRoleResolutionType[\"AUTHENTICATED_ROLE\"] = \"AuthenticatedRole\";\n AmbiguousRoleResolutionType[\"DENY\"] = \"Deny\";\n})(AmbiguousRoleResolutionType || (AmbiguousRoleResolutionType = {}));\nexport var CognitoIdentityProvider;\n(function (CognitoIdentityProvider) {\n CognitoIdentityProvider.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(CognitoIdentityProvider || (CognitoIdentityProvider = {}));\nexport var CreateIdentityPoolInput;\n(function (CreateIdentityPoolInput) {\n CreateIdentityPoolInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(CreateIdentityPoolInput || (CreateIdentityPoolInput = {}));\nexport var IdentityPool;\n(function (IdentityPool) {\n IdentityPool.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(IdentityPool || (IdentityPool = {}));\nexport var InternalErrorException;\n(function (InternalErrorException) {\n InternalErrorException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(InternalErrorException || (InternalErrorException = {}));\nexport var InvalidParameterException;\n(function (InvalidParameterException) {\n InvalidParameterException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(InvalidParameterException || (InvalidParameterException = {}));\nexport var LimitExceededException;\n(function (LimitExceededException) {\n LimitExceededException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(LimitExceededException || (LimitExceededException = {}));\nexport var NotAuthorizedException;\n(function (NotAuthorizedException) {\n NotAuthorizedException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(NotAuthorizedException || (NotAuthorizedException = {}));\nexport var ResourceConflictException;\n(function (ResourceConflictException) {\n ResourceConflictException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(ResourceConflictException || (ResourceConflictException = {}));\nexport var TooManyRequestsException;\n(function (TooManyRequestsException) {\n TooManyRequestsException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(TooManyRequestsException || (TooManyRequestsException = {}));\nexport var DeleteIdentitiesInput;\n(function (DeleteIdentitiesInput) {\n DeleteIdentitiesInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(DeleteIdentitiesInput || (DeleteIdentitiesInput = {}));\nexport var ErrorCode;\n(function (ErrorCode) {\n ErrorCode[\"ACCESS_DENIED\"] = \"AccessDenied\";\n ErrorCode[\"INTERNAL_SERVER_ERROR\"] = \"InternalServerError\";\n})(ErrorCode || (ErrorCode = {}));\nexport var UnprocessedIdentityId;\n(function (UnprocessedIdentityId) {\n UnprocessedIdentityId.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(UnprocessedIdentityId || (UnprocessedIdentityId = {}));\nexport var DeleteIdentitiesResponse;\n(function (DeleteIdentitiesResponse) {\n DeleteIdentitiesResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(DeleteIdentitiesResponse || (DeleteIdentitiesResponse = {}));\nexport var DeleteIdentityPoolInput;\n(function (DeleteIdentityPoolInput) {\n DeleteIdentityPoolInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(DeleteIdentityPoolInput || (DeleteIdentityPoolInput = {}));\nexport var ResourceNotFoundException;\n(function (ResourceNotFoundException) {\n ResourceNotFoundException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(ResourceNotFoundException || (ResourceNotFoundException = {}));\nexport var DescribeIdentityInput;\n(function (DescribeIdentityInput) {\n DescribeIdentityInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(DescribeIdentityInput || (DescribeIdentityInput = {}));\nexport var IdentityDescription;\n(function (IdentityDescription) {\n IdentityDescription.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(IdentityDescription || (IdentityDescription = {}));\nexport var DescribeIdentityPoolInput;\n(function (DescribeIdentityPoolInput) {\n DescribeIdentityPoolInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(DescribeIdentityPoolInput || (DescribeIdentityPoolInput = {}));\nexport var ExternalServiceException;\n(function (ExternalServiceException) {\n ExternalServiceException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(ExternalServiceException || (ExternalServiceException = {}));\nexport var GetCredentialsForIdentityInput;\n(function (GetCredentialsForIdentityInput) {\n GetCredentialsForIdentityInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(GetCredentialsForIdentityInput || (GetCredentialsForIdentityInput = {}));\nexport var Credentials;\n(function (Credentials) {\n Credentials.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(Credentials || (Credentials = {}));\nexport var GetCredentialsForIdentityResponse;\n(function (GetCredentialsForIdentityResponse) {\n GetCredentialsForIdentityResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(GetCredentialsForIdentityResponse || (GetCredentialsForIdentityResponse = {}));\nexport var InvalidIdentityPoolConfigurationException;\n(function (InvalidIdentityPoolConfigurationException) {\n InvalidIdentityPoolConfigurationException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(InvalidIdentityPoolConfigurationException || (InvalidIdentityPoolConfigurationException = {}));\nexport var GetIdInput;\n(function (GetIdInput) {\n GetIdInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(GetIdInput || (GetIdInput = {}));\nexport var GetIdResponse;\n(function (GetIdResponse) {\n GetIdResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(GetIdResponse || (GetIdResponse = {}));\nexport var GetIdentityPoolRolesInput;\n(function (GetIdentityPoolRolesInput) {\n GetIdentityPoolRolesInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(GetIdentityPoolRolesInput || (GetIdentityPoolRolesInput = {}));\nexport var MappingRuleMatchType;\n(function (MappingRuleMatchType) {\n MappingRuleMatchType[\"CONTAINS\"] = \"Contains\";\n MappingRuleMatchType[\"EQUALS\"] = \"Equals\";\n MappingRuleMatchType[\"NOT_EQUAL\"] = \"NotEqual\";\n MappingRuleMatchType[\"STARTS_WITH\"] = \"StartsWith\";\n})(MappingRuleMatchType || (MappingRuleMatchType = {}));\nexport var MappingRule;\n(function (MappingRule) {\n MappingRule.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(MappingRule || (MappingRule = {}));\nexport var RulesConfigurationType;\n(function (RulesConfigurationType) {\n RulesConfigurationType.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(RulesConfigurationType || (RulesConfigurationType = {}));\nexport var RoleMappingType;\n(function (RoleMappingType) {\n RoleMappingType[\"RULES\"] = \"Rules\";\n RoleMappingType[\"TOKEN\"] = \"Token\";\n})(RoleMappingType || (RoleMappingType = {}));\nexport var RoleMapping;\n(function (RoleMapping) {\n RoleMapping.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(RoleMapping || (RoleMapping = {}));\nexport var GetIdentityPoolRolesResponse;\n(function (GetIdentityPoolRolesResponse) {\n GetIdentityPoolRolesResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(GetIdentityPoolRolesResponse || (GetIdentityPoolRolesResponse = {}));\nexport var GetOpenIdTokenInput;\n(function (GetOpenIdTokenInput) {\n GetOpenIdTokenInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(GetOpenIdTokenInput || (GetOpenIdTokenInput = {}));\nexport var GetOpenIdTokenResponse;\n(function (GetOpenIdTokenResponse) {\n GetOpenIdTokenResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(GetOpenIdTokenResponse || (GetOpenIdTokenResponse = {}));\nexport var DeveloperUserAlreadyRegisteredException;\n(function (DeveloperUserAlreadyRegisteredException) {\n DeveloperUserAlreadyRegisteredException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(DeveloperUserAlreadyRegisteredException || (DeveloperUserAlreadyRegisteredException = {}));\nexport var GetOpenIdTokenForDeveloperIdentityInput;\n(function (GetOpenIdTokenForDeveloperIdentityInput) {\n GetOpenIdTokenForDeveloperIdentityInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(GetOpenIdTokenForDeveloperIdentityInput || (GetOpenIdTokenForDeveloperIdentityInput = {}));\nexport var GetOpenIdTokenForDeveloperIdentityResponse;\n(function (GetOpenIdTokenForDeveloperIdentityResponse) {\n GetOpenIdTokenForDeveloperIdentityResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(GetOpenIdTokenForDeveloperIdentityResponse || (GetOpenIdTokenForDeveloperIdentityResponse = {}));\nexport var ListIdentitiesInput;\n(function (ListIdentitiesInput) {\n ListIdentitiesInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(ListIdentitiesInput || (ListIdentitiesInput = {}));\nexport var ListIdentitiesResponse;\n(function (ListIdentitiesResponse) {\n ListIdentitiesResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(ListIdentitiesResponse || (ListIdentitiesResponse = {}));\nexport var ListIdentityPoolsInput;\n(function (ListIdentityPoolsInput) {\n ListIdentityPoolsInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(ListIdentityPoolsInput || (ListIdentityPoolsInput = {}));\nexport var IdentityPoolShortDescription;\n(function (IdentityPoolShortDescription) {\n IdentityPoolShortDescription.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(IdentityPoolShortDescription || (IdentityPoolShortDescription = {}));\nexport var ListIdentityPoolsResponse;\n(function (ListIdentityPoolsResponse) {\n ListIdentityPoolsResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(ListIdentityPoolsResponse || (ListIdentityPoolsResponse = {}));\nexport var ListTagsForResourceInput;\n(function (ListTagsForResourceInput) {\n ListTagsForResourceInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(ListTagsForResourceInput || (ListTagsForResourceInput = {}));\nexport var ListTagsForResourceResponse;\n(function (ListTagsForResourceResponse) {\n ListTagsForResourceResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(ListTagsForResourceResponse || (ListTagsForResourceResponse = {}));\nexport var LookupDeveloperIdentityInput;\n(function (LookupDeveloperIdentityInput) {\n LookupDeveloperIdentityInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(LookupDeveloperIdentityInput || (LookupDeveloperIdentityInput = {}));\nexport var LookupDeveloperIdentityResponse;\n(function (LookupDeveloperIdentityResponse) {\n LookupDeveloperIdentityResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(LookupDeveloperIdentityResponse || (LookupDeveloperIdentityResponse = {}));\nexport var MergeDeveloperIdentitiesInput;\n(function (MergeDeveloperIdentitiesInput) {\n MergeDeveloperIdentitiesInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(MergeDeveloperIdentitiesInput || (MergeDeveloperIdentitiesInput = {}));\nexport var MergeDeveloperIdentitiesResponse;\n(function (MergeDeveloperIdentitiesResponse) {\n MergeDeveloperIdentitiesResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(MergeDeveloperIdentitiesResponse || (MergeDeveloperIdentitiesResponse = {}));\nexport var ConcurrentModificationException;\n(function (ConcurrentModificationException) {\n ConcurrentModificationException.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(ConcurrentModificationException || (ConcurrentModificationException = {}));\nexport var SetIdentityPoolRolesInput;\n(function (SetIdentityPoolRolesInput) {\n SetIdentityPoolRolesInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(SetIdentityPoolRolesInput || (SetIdentityPoolRolesInput = {}));\nexport var TagResourceInput;\n(function (TagResourceInput) {\n TagResourceInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(TagResourceInput || (TagResourceInput = {}));\nexport var TagResourceResponse;\n(function (TagResourceResponse) {\n TagResourceResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(TagResourceResponse || (TagResourceResponse = {}));\nexport var UnlinkDeveloperIdentityInput;\n(function (UnlinkDeveloperIdentityInput) {\n UnlinkDeveloperIdentityInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(UnlinkDeveloperIdentityInput || (UnlinkDeveloperIdentityInput = {}));\nexport var UnlinkIdentityInput;\n(function (UnlinkIdentityInput) {\n UnlinkIdentityInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(UnlinkIdentityInput || (UnlinkIdentityInput = {}));\nexport var UntagResourceInput;\n(function (UntagResourceInput) {\n UntagResourceInput.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(UntagResourceInput || (UntagResourceInput = {}));\nexport var UntagResourceResponse;\n(function (UntagResourceResponse) {\n UntagResourceResponse.filterSensitiveLog = function (obj) { return (__assign({}, obj)); };\n})(UntagResourceResponse || (UntagResourceResponse = {}));\n//# sourceMappingURL=models_0.js.map","import { __assign, __awaiter, __generator, __read } from \"tslib\";\nimport { HttpRequest as __HttpRequest } from \"@aws-sdk/protocol-http\";\nexport var serializeAws_json1_1CreateIdentityPoolCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.CreateIdentityPool\",\n };\n body = JSON.stringify(serializeAws_json1_1CreateIdentityPoolInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1DeleteIdentitiesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.DeleteIdentities\",\n };\n body = JSON.stringify(serializeAws_json1_1DeleteIdentitiesInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1DeleteIdentityPoolCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.DeleteIdentityPool\",\n };\n body = JSON.stringify(serializeAws_json1_1DeleteIdentityPoolInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1DescribeIdentityCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.DescribeIdentity\",\n };\n body = JSON.stringify(serializeAws_json1_1DescribeIdentityInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1DescribeIdentityPoolCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.DescribeIdentityPool\",\n };\n body = JSON.stringify(serializeAws_json1_1DescribeIdentityPoolInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1GetCredentialsForIdentityCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetCredentialsForIdentity\",\n };\n body = JSON.stringify(serializeAws_json1_1GetCredentialsForIdentityInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1GetIdCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetId\",\n };\n body = JSON.stringify(serializeAws_json1_1GetIdInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1GetIdentityPoolRolesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetIdentityPoolRoles\",\n };\n body = JSON.stringify(serializeAws_json1_1GetIdentityPoolRolesInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1GetOpenIdTokenCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetOpenIdToken\",\n };\n body = JSON.stringify(serializeAws_json1_1GetOpenIdTokenInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.GetOpenIdTokenForDeveloperIdentity\",\n };\n body = JSON.stringify(serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1ListIdentitiesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.ListIdentities\",\n };\n body = JSON.stringify(serializeAws_json1_1ListIdentitiesInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1ListIdentityPoolsCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.ListIdentityPools\",\n };\n body = JSON.stringify(serializeAws_json1_1ListIdentityPoolsInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1ListTagsForResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.ListTagsForResource\",\n };\n body = JSON.stringify(serializeAws_json1_1ListTagsForResourceInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1LookupDeveloperIdentityCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.LookupDeveloperIdentity\",\n };\n body = JSON.stringify(serializeAws_json1_1LookupDeveloperIdentityInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1MergeDeveloperIdentitiesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.MergeDeveloperIdentities\",\n };\n body = JSON.stringify(serializeAws_json1_1MergeDeveloperIdentitiesInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1SetIdentityPoolRolesCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.SetIdentityPoolRoles\",\n };\n body = JSON.stringify(serializeAws_json1_1SetIdentityPoolRolesInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1TagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.TagResource\",\n };\n body = JSON.stringify(serializeAws_json1_1TagResourceInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1UnlinkDeveloperIdentityCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.UnlinkDeveloperIdentity\",\n };\n body = JSON.stringify(serializeAws_json1_1UnlinkDeveloperIdentityInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1UnlinkIdentityCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.UnlinkIdentity\",\n };\n body = JSON.stringify(serializeAws_json1_1UnlinkIdentityInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1UntagResourceCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.UntagResource\",\n };\n body = JSON.stringify(serializeAws_json1_1UntagResourceInput(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var serializeAws_json1_1UpdateIdentityPoolCommand = function (input, context) { return __awaiter(void 0, void 0, void 0, function () {\n var headers, body;\n return __generator(this, function (_a) {\n headers = {\n \"content-type\": \"application/x-amz-json-1.1\",\n \"x-amz-target\": \"AWSCognitoIdentityService.UpdateIdentityPool\",\n };\n body = JSON.stringify(serializeAws_json1_1IdentityPool(input, context));\n return [2 /*return*/, buildHttpRpcRequest(context, headers, \"/\", undefined, body)];\n });\n}); };\nexport var deserializeAws_json1_1CreateIdentityPoolCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1CreateIdentityPoolCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1IdentityPool(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1CreateIdentityPoolCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;\n var _j;\n return __generator(this, function (_k) {\n switch (_k.label) {\n case 0:\n _a = [__assign({}, output)];\n _j = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"LimitExceededException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#LimitExceededException\": return [3 /*break*/, 6];\n case \"NotAuthorizedException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 8];\n case \"ResourceConflictException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\": return [3 /*break*/, 10];\n case \"TooManyRequestsException\": return [3 /*break*/, 12];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 12];\n }\n return [3 /*break*/, 14];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 12:\n _h = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 13:\n response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 14:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _k.label = 15;\n case 15:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1DeleteIdentitiesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1DeleteIdentitiesCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1DeleteIdentitiesResponse(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1DeleteIdentitiesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, parsedBody, message;\n var _f;\n return __generator(this, function (_g) {\n switch (_g.label) {\n case 0:\n _a = [__assign({}, output)];\n _f = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_f.body = _g.sent(), _f)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"TooManyRequestsException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 6];\n }\n return [3 /*break*/, 8];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 9];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 9];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_g.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 9];\n case 8:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _g.label = 9;\n case 9:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1DeleteIdentityPoolCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1DeleteIdentityPoolCommandError(output, context)];\n }\n return [4 /*yield*/, collectBody(output.body, context)];\n case 1:\n _a.sent();\n response = {\n $metadata: deserializeMetadata(output),\n };\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1DeleteIdentityPoolCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;\n var _h;\n return __generator(this, function (_j) {\n switch (_j.label) {\n case 0:\n _a = [__assign({}, output)];\n _h = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"NotAuthorizedException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 6];\n case \"ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"TooManyRequestsException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 10];\n }\n return [3 /*break*/, 12];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 12:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _j.label = 13;\n case 13:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1DescribeIdentityCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1DescribeIdentityCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1IdentityDescription(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1DescribeIdentityCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;\n var _h;\n return __generator(this, function (_j) {\n switch (_j.label) {\n case 0:\n _a = [__assign({}, output)];\n _h = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"NotAuthorizedException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 6];\n case \"ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"TooManyRequestsException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 10];\n }\n return [3 /*break*/, 12];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 12:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _j.label = 13;\n case 13:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1DescribeIdentityPoolCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1DescribeIdentityPoolCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1IdentityPool(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1DescribeIdentityPoolCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;\n var _h;\n return __generator(this, function (_j) {\n switch (_j.label) {\n case 0:\n _a = [__assign({}, output)];\n _h = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"NotAuthorizedException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 6];\n case \"ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"TooManyRequestsException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 10];\n }\n return [3 /*break*/, 12];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 12:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _j.label = 13;\n case 13:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1GetCredentialsForIdentityCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1GetCredentialsForIdentityCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1GetCredentialsForIdentityResponse(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1GetCredentialsForIdentityCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, _k, parsedBody, message;\n var _l;\n return __generator(this, function (_m) {\n switch (_m.label) {\n case 0:\n _a = [__assign({}, output)];\n _l = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_l.body = _m.sent(), _l)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"ExternalServiceException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#ExternalServiceException\": return [3 /*break*/, 2];\n case \"InternalErrorException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 4];\n case \"InvalidIdentityPoolConfigurationException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException\": return [3 /*break*/, 6];\n case \"InvalidParameterException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 8];\n case \"NotAuthorizedException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 10];\n case \"ResourceConflictException\": return [3 /*break*/, 12];\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\": return [3 /*break*/, 12];\n case \"ResourceNotFoundException\": return [3 /*break*/, 14];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 14];\n case \"TooManyRequestsException\": return [3 /*break*/, 16];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 16];\n }\n return [3 /*break*/, 18];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidIdentityPoolConfigurationExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 12:\n _h = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)];\n case 13:\n response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 14:\n _j = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 15:\n response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 16:\n _k = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 17:\n response = __assign.apply(void 0, [__assign.apply(void 0, _k.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 18:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _m.label = 19;\n case 19:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1GetIdCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1GetIdCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1GetIdResponse(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1GetIdCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, _k, parsedBody, message;\n var _l;\n return __generator(this, function (_m) {\n switch (_m.label) {\n case 0:\n _a = [__assign({}, output)];\n _l = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_l.body = _m.sent(), _l)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"ExternalServiceException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#ExternalServiceException\": return [3 /*break*/, 2];\n case \"InternalErrorException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 4];\n case \"InvalidParameterException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 6];\n case \"LimitExceededException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#LimitExceededException\": return [3 /*break*/, 8];\n case \"NotAuthorizedException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 10];\n case \"ResourceConflictException\": return [3 /*break*/, 12];\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\": return [3 /*break*/, 12];\n case \"ResourceNotFoundException\": return [3 /*break*/, 14];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 14];\n case \"TooManyRequestsException\": return [3 /*break*/, 16];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 16];\n }\n return [3 /*break*/, 18];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 12:\n _h = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)];\n case 13:\n response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 14:\n _j = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 15:\n response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 16:\n _k = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 17:\n response = __assign.apply(void 0, [__assign.apply(void 0, _k.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 18:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _m.label = 19;\n case 19:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1GetIdentityPoolRolesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1GetIdentityPoolRolesCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1GetIdentityPoolRolesResponse(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1GetIdentityPoolRolesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;\n var _j;\n return __generator(this, function (_k) {\n switch (_k.label) {\n case 0:\n _a = [__assign({}, output)];\n _j = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"NotAuthorizedException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 6];\n case \"ResourceConflictException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\": return [3 /*break*/, 8];\n case \"ResourceNotFoundException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 10];\n case \"TooManyRequestsException\": return [3 /*break*/, 12];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 12];\n }\n return [3 /*break*/, 14];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 12:\n _h = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 13:\n response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 14:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _k.label = 15;\n case 15:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1GetOpenIdTokenCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1GetOpenIdTokenCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1GetOpenIdTokenResponse(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1GetOpenIdTokenCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;\n var _k;\n return __generator(this, function (_l) {\n switch (_l.label) {\n case 0:\n _a = [__assign({}, output)];\n _k = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"ExternalServiceException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#ExternalServiceException\": return [3 /*break*/, 2];\n case \"InternalErrorException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 4];\n case \"InvalidParameterException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 6];\n case \"NotAuthorizedException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 8];\n case \"ResourceConflictException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\": return [3 /*break*/, 10];\n case \"ResourceNotFoundException\": return [3 /*break*/, 12];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 12];\n case \"TooManyRequestsException\": return [3 /*break*/, 14];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 14];\n }\n return [3 /*break*/, 16];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 12:\n _h = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 13:\n response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 14:\n _j = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 15:\n response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 16:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _l.label = 17;\n case 17:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityResponse(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;\n var _k;\n return __generator(this, function (_l) {\n switch (_l.label) {\n case 0:\n _a = [__assign({}, output)];\n _k = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"DeveloperUserAlreadyRegisteredException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException\": return [3 /*break*/, 2];\n case \"InternalErrorException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 4];\n case \"InvalidParameterException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 6];\n case \"NotAuthorizedException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 8];\n case \"ResourceConflictException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\": return [3 /*break*/, 10];\n case \"ResourceNotFoundException\": return [3 /*break*/, 12];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 12];\n case \"TooManyRequestsException\": return [3 /*break*/, 14];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 14];\n }\n return [3 /*break*/, 16];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1DeveloperUserAlreadyRegisteredExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 12:\n _h = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 13:\n response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 14:\n _j = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 15:\n response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 16:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _l.label = 17;\n case 17:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1ListIdentitiesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1ListIdentitiesCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1ListIdentitiesResponse(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1ListIdentitiesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;\n var _h;\n return __generator(this, function (_j) {\n switch (_j.label) {\n case 0:\n _a = [__assign({}, output)];\n _h = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"NotAuthorizedException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 6];\n case \"ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"TooManyRequestsException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 10];\n }\n return [3 /*break*/, 12];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 12:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _j.label = 13;\n case 13:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1ListIdentityPoolsCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1ListIdentityPoolsCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1ListIdentityPoolsResponse(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1ListIdentityPoolsCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;\n var _h;\n return __generator(this, function (_j) {\n switch (_j.label) {\n case 0:\n _a = [__assign({}, output)];\n _h = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"NotAuthorizedException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 6];\n case \"ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"TooManyRequestsException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 10];\n }\n return [3 /*break*/, 12];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 12:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _j.label = 13;\n case 13:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1ListTagsForResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1ListTagsForResourceCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1ListTagsForResourceResponse(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1ListTagsForResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;\n var _h;\n return __generator(this, function (_j) {\n switch (_j.label) {\n case 0:\n _a = [__assign({}, output)];\n _h = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"NotAuthorizedException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 6];\n case \"ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"TooManyRequestsException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 10];\n }\n return [3 /*break*/, 12];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 12:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _j.label = 13;\n case 13:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1LookupDeveloperIdentityCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1LookupDeveloperIdentityCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1LookupDeveloperIdentityResponse(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1LookupDeveloperIdentityCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;\n var _j;\n return __generator(this, function (_k) {\n switch (_k.label) {\n case 0:\n _a = [__assign({}, output)];\n _j = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"NotAuthorizedException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 6];\n case \"ResourceConflictException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\": return [3 /*break*/, 8];\n case \"ResourceNotFoundException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 10];\n case \"TooManyRequestsException\": return [3 /*break*/, 12];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 12];\n }\n return [3 /*break*/, 14];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 12:\n _h = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 13:\n response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 14:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _k.label = 15;\n case 15:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1MergeDeveloperIdentitiesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1MergeDeveloperIdentitiesCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1MergeDeveloperIdentitiesResponse(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1MergeDeveloperIdentitiesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;\n var _j;\n return __generator(this, function (_k) {\n switch (_k.label) {\n case 0:\n _a = [__assign({}, output)];\n _j = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"NotAuthorizedException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 6];\n case \"ResourceConflictException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\": return [3 /*break*/, 8];\n case \"ResourceNotFoundException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 10];\n case \"TooManyRequestsException\": return [3 /*break*/, 12];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 12];\n }\n return [3 /*break*/, 14];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 12:\n _h = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 13:\n response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 14:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _k.label = 15;\n case 15:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1SetIdentityPoolRolesCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1SetIdentityPoolRolesCommandError(output, context)];\n }\n return [4 /*yield*/, collectBody(output.body, context)];\n case 1:\n _a.sent();\n response = {\n $metadata: deserializeMetadata(output),\n };\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1SetIdentityPoolRolesCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;\n var _k;\n return __generator(this, function (_l) {\n switch (_l.label) {\n case 0:\n _a = [__assign({}, output)];\n _k = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"ConcurrentModificationException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#ConcurrentModificationException\": return [3 /*break*/, 2];\n case \"InternalErrorException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 4];\n case \"InvalidParameterException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 6];\n case \"NotAuthorizedException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 8];\n case \"ResourceConflictException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\": return [3 /*break*/, 10];\n case \"ResourceNotFoundException\": return [3 /*break*/, 12];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 12];\n case \"TooManyRequestsException\": return [3 /*break*/, 14];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 14];\n }\n return [3 /*break*/, 16];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 12:\n _h = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 13:\n response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 14:\n _j = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 15:\n response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 16:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _l.label = 17;\n case 17:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1TagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1TagResourceCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1TagResourceResponse(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1TagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;\n var _h;\n return __generator(this, function (_j) {\n switch (_j.label) {\n case 0:\n _a = [__assign({}, output)];\n _h = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"NotAuthorizedException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 6];\n case \"ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"TooManyRequestsException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 10];\n }\n return [3 /*break*/, 12];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 12:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _j.label = 13;\n case 13:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1UnlinkDeveloperIdentityCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1UnlinkDeveloperIdentityCommandError(output, context)];\n }\n return [4 /*yield*/, collectBody(output.body, context)];\n case 1:\n _a.sent();\n response = {\n $metadata: deserializeMetadata(output),\n };\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1UnlinkDeveloperIdentityCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, parsedBody, message;\n var _j;\n return __generator(this, function (_k) {\n switch (_k.label) {\n case 0:\n _a = [__assign({}, output)];\n _j = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_j.body = _k.sent(), _j)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"NotAuthorizedException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 6];\n case \"ResourceConflictException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\": return [3 /*break*/, 8];\n case \"ResourceNotFoundException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 10];\n case \"TooManyRequestsException\": return [3 /*break*/, 12];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 12];\n }\n return [3 /*break*/, 14];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 12:\n _h = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 13:\n response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_k.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 15];\n case 14:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _k.label = 15;\n case 15:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1UnlinkIdentityCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1UnlinkIdentityCommandError(output, context)];\n }\n return [4 /*yield*/, collectBody(output.body, context)];\n case 1:\n _a.sent();\n response = {\n $metadata: deserializeMetadata(output),\n };\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1UnlinkIdentityCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, parsedBody, message;\n var _k;\n return __generator(this, function (_l) {\n switch (_l.label) {\n case 0:\n _a = [__assign({}, output)];\n _k = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_k.body = _l.sent(), _k)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"ExternalServiceException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#ExternalServiceException\": return [3 /*break*/, 2];\n case \"InternalErrorException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 4];\n case \"InvalidParameterException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 6];\n case \"NotAuthorizedException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 8];\n case \"ResourceConflictException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\": return [3 /*break*/, 10];\n case \"ResourceNotFoundException\": return [3 /*break*/, 12];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 12];\n case \"TooManyRequestsException\": return [3 /*break*/, 14];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 14];\n }\n return [3 /*break*/, 16];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ExternalServiceExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 12:\n _h = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 13:\n response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 14:\n _j = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 15:\n response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_l.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 17];\n case 16:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _l.label = 17;\n case 17:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1UntagResourceCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1UntagResourceCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1UntagResourceResponse(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1UntagResourceCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, parsedBody, message;\n var _h;\n return __generator(this, function (_j) {\n switch (_j.label) {\n case 0:\n _a = [__assign({}, output)];\n _h = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_h.body = _j.sent(), _h)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"InternalErrorException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 2];\n case \"InvalidParameterException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 4];\n case \"NotAuthorizedException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 6];\n case \"ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 8];\n case \"TooManyRequestsException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 10];\n }\n return [3 /*break*/, 12];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_j.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 13];\n case 12:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _j.label = 13;\n case 13:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nexport var deserializeAws_json1_1UpdateIdentityPoolCommand = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var data, contents, response;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (output.statusCode >= 300) {\n return [2 /*return*/, deserializeAws_json1_1UpdateIdentityPoolCommandError(output, context)];\n }\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n data = _a.sent();\n contents = {};\n contents = deserializeAws_json1_1IdentityPool(data, context);\n response = __assign({ $metadata: deserializeMetadata(output) }, contents);\n return [2 /*return*/, Promise.resolve(response)];\n }\n });\n}); };\nvar deserializeAws_json1_1UpdateIdentityPoolCommandError = function (output, context) { return __awaiter(void 0, void 0, void 0, function () {\n var parsedOutput, _a, response, errorCode, _b, _c, _d, _e, _f, _g, _h, _j, _k, parsedBody, message;\n var _l;\n return __generator(this, function (_m) {\n switch (_m.label) {\n case 0:\n _a = [__assign({}, output)];\n _l = {};\n return [4 /*yield*/, parseBody(output.body, context)];\n case 1:\n parsedOutput = __assign.apply(void 0, _a.concat([(_l.body = _m.sent(), _l)]));\n errorCode = \"UnknownError\";\n errorCode = loadRestJsonErrorCode(output, parsedOutput.body);\n _b = errorCode;\n switch (_b) {\n case \"ConcurrentModificationException\": return [3 /*break*/, 2];\n case \"com.amazonaws.cognitoidentity#ConcurrentModificationException\": return [3 /*break*/, 2];\n case \"InternalErrorException\": return [3 /*break*/, 4];\n case \"com.amazonaws.cognitoidentity#InternalErrorException\": return [3 /*break*/, 4];\n case \"InvalidParameterException\": return [3 /*break*/, 6];\n case \"com.amazonaws.cognitoidentity#InvalidParameterException\": return [3 /*break*/, 6];\n case \"LimitExceededException\": return [3 /*break*/, 8];\n case \"com.amazonaws.cognitoidentity#LimitExceededException\": return [3 /*break*/, 8];\n case \"NotAuthorizedException\": return [3 /*break*/, 10];\n case \"com.amazonaws.cognitoidentity#NotAuthorizedException\": return [3 /*break*/, 10];\n case \"ResourceConflictException\": return [3 /*break*/, 12];\n case \"com.amazonaws.cognitoidentity#ResourceConflictException\": return [3 /*break*/, 12];\n case \"ResourceNotFoundException\": return [3 /*break*/, 14];\n case \"com.amazonaws.cognitoidentity#ResourceNotFoundException\": return [3 /*break*/, 14];\n case \"TooManyRequestsException\": return [3 /*break*/, 16];\n case \"com.amazonaws.cognitoidentity#TooManyRequestsException\": return [3 /*break*/, 16];\n }\n return [3 /*break*/, 18];\n case 2:\n _c = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ConcurrentModificationExceptionResponse(parsedOutput, context)];\n case 3:\n response = __assign.apply(void 0, [__assign.apply(void 0, _c.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 4:\n _d = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InternalErrorExceptionResponse(parsedOutput, context)];\n case 5:\n response = __assign.apply(void 0, [__assign.apply(void 0, _d.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 6:\n _e = [{}];\n return [4 /*yield*/, deserializeAws_json1_1InvalidParameterExceptionResponse(parsedOutput, context)];\n case 7:\n response = __assign.apply(void 0, [__assign.apply(void 0, _e.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 8:\n _f = [{}];\n return [4 /*yield*/, deserializeAws_json1_1LimitExceededExceptionResponse(parsedOutput, context)];\n case 9:\n response = __assign.apply(void 0, [__assign.apply(void 0, _f.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 10:\n _g = [{}];\n return [4 /*yield*/, deserializeAws_json1_1NotAuthorizedExceptionResponse(parsedOutput, context)];\n case 11:\n response = __assign.apply(void 0, [__assign.apply(void 0, _g.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 12:\n _h = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceConflictExceptionResponse(parsedOutput, context)];\n case 13:\n response = __assign.apply(void 0, [__assign.apply(void 0, _h.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 14:\n _j = [{}];\n return [4 /*yield*/, deserializeAws_json1_1ResourceNotFoundExceptionResponse(parsedOutput, context)];\n case 15:\n response = __assign.apply(void 0, [__assign.apply(void 0, _j.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 16:\n _k = [{}];\n return [4 /*yield*/, deserializeAws_json1_1TooManyRequestsExceptionResponse(parsedOutput, context)];\n case 17:\n response = __assign.apply(void 0, [__assign.apply(void 0, _k.concat([(_m.sent())])), { name: errorCode, $metadata: deserializeMetadata(output) }]);\n return [3 /*break*/, 19];\n case 18:\n parsedBody = parsedOutput.body;\n errorCode = parsedBody.code || parsedBody.Code || errorCode;\n response = __assign(__assign({}, parsedBody), { name: \"\" + errorCode, message: parsedBody.message || parsedBody.Message || errorCode, $fault: \"client\", $metadata: deserializeMetadata(output) });\n _m.label = 19;\n case 19:\n message = response.message || response.Message || errorCode;\n response.message = message;\n delete response.Message;\n return [2 /*return*/, Promise.reject(Object.assign(new Error(message), response))];\n }\n });\n}); };\nvar deserializeAws_json1_1ConcurrentModificationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {\n var body, deserialized, contents;\n return __generator(this, function (_a) {\n body = parsedOutput.body;\n deserialized = deserializeAws_json1_1ConcurrentModificationException(body, context);\n contents = __assign({ name: \"ConcurrentModificationException\", $fault: \"client\", $metadata: deserializeMetadata(parsedOutput) }, deserialized);\n return [2 /*return*/, contents];\n });\n}); };\nvar deserializeAws_json1_1DeveloperUserAlreadyRegisteredExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {\n var body, deserialized, contents;\n return __generator(this, function (_a) {\n body = parsedOutput.body;\n deserialized = deserializeAws_json1_1DeveloperUserAlreadyRegisteredException(body, context);\n contents = __assign({ name: \"DeveloperUserAlreadyRegisteredException\", $fault: \"client\", $metadata: deserializeMetadata(parsedOutput) }, deserialized);\n return [2 /*return*/, contents];\n });\n}); };\nvar deserializeAws_json1_1ExternalServiceExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {\n var body, deserialized, contents;\n return __generator(this, function (_a) {\n body = parsedOutput.body;\n deserialized = deserializeAws_json1_1ExternalServiceException(body, context);\n contents = __assign({ name: \"ExternalServiceException\", $fault: \"client\", $metadata: deserializeMetadata(parsedOutput) }, deserialized);\n return [2 /*return*/, contents];\n });\n}); };\nvar deserializeAws_json1_1InternalErrorExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {\n var body, deserialized, contents;\n return __generator(this, function (_a) {\n body = parsedOutput.body;\n deserialized = deserializeAws_json1_1InternalErrorException(body, context);\n contents = __assign({ name: \"InternalErrorException\", $fault: \"server\", $metadata: deserializeMetadata(parsedOutput) }, deserialized);\n return [2 /*return*/, contents];\n });\n}); };\nvar deserializeAws_json1_1InvalidIdentityPoolConfigurationExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {\n var body, deserialized, contents;\n return __generator(this, function (_a) {\n body = parsedOutput.body;\n deserialized = deserializeAws_json1_1InvalidIdentityPoolConfigurationException(body, context);\n contents = __assign({ name: \"InvalidIdentityPoolConfigurationException\", $fault: \"client\", $metadata: deserializeMetadata(parsedOutput) }, deserialized);\n return [2 /*return*/, contents];\n });\n}); };\nvar deserializeAws_json1_1InvalidParameterExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {\n var body, deserialized, contents;\n return __generator(this, function (_a) {\n body = parsedOutput.body;\n deserialized = deserializeAws_json1_1InvalidParameterException(body, context);\n contents = __assign({ name: \"InvalidParameterException\", $fault: \"client\", $metadata: deserializeMetadata(parsedOutput) }, deserialized);\n return [2 /*return*/, contents];\n });\n}); };\nvar deserializeAws_json1_1LimitExceededExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {\n var body, deserialized, contents;\n return __generator(this, function (_a) {\n body = parsedOutput.body;\n deserialized = deserializeAws_json1_1LimitExceededException(body, context);\n contents = __assign({ name: \"LimitExceededException\", $fault: \"client\", $metadata: deserializeMetadata(parsedOutput) }, deserialized);\n return [2 /*return*/, contents];\n });\n}); };\nvar deserializeAws_json1_1NotAuthorizedExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {\n var body, deserialized, contents;\n return __generator(this, function (_a) {\n body = parsedOutput.body;\n deserialized = deserializeAws_json1_1NotAuthorizedException(body, context);\n contents = __assign({ name: \"NotAuthorizedException\", $fault: \"client\", $metadata: deserializeMetadata(parsedOutput) }, deserialized);\n return [2 /*return*/, contents];\n });\n}); };\nvar deserializeAws_json1_1ResourceConflictExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {\n var body, deserialized, contents;\n return __generator(this, function (_a) {\n body = parsedOutput.body;\n deserialized = deserializeAws_json1_1ResourceConflictException(body, context);\n contents = __assign({ name: \"ResourceConflictException\", $fault: \"client\", $metadata: deserializeMetadata(parsedOutput) }, deserialized);\n return [2 /*return*/, contents];\n });\n}); };\nvar deserializeAws_json1_1ResourceNotFoundExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {\n var body, deserialized, contents;\n return __generator(this, function (_a) {\n body = parsedOutput.body;\n deserialized = deserializeAws_json1_1ResourceNotFoundException(body, context);\n contents = __assign({ name: \"ResourceNotFoundException\", $fault: \"client\", $metadata: deserializeMetadata(parsedOutput) }, deserialized);\n return [2 /*return*/, contents];\n });\n}); };\nvar deserializeAws_json1_1TooManyRequestsExceptionResponse = function (parsedOutput, context) { return __awaiter(void 0, void 0, void 0, function () {\n var body, deserialized, contents;\n return __generator(this, function (_a) {\n body = parsedOutput.body;\n deserialized = deserializeAws_json1_1TooManyRequestsException(body, context);\n contents = __assign({ name: \"TooManyRequestsException\", $fault: \"client\", $metadata: deserializeMetadata(parsedOutput) }, deserialized);\n return [2 /*return*/, contents];\n });\n}); };\nvar serializeAws_json1_1CognitoIdentityProvider = function (input, context) {\n return __assign(__assign(__assign({}, (input.ClientId !== undefined && input.ClientId !== null && { ClientId: input.ClientId })), (input.ProviderName !== undefined && input.ProviderName !== null && { ProviderName: input.ProviderName })), (input.ServerSideTokenCheck !== undefined &&\n input.ServerSideTokenCheck !== null && { ServerSideTokenCheck: input.ServerSideTokenCheck }));\n};\nvar serializeAws_json1_1CognitoIdentityProviderList = function (input, context) {\n return input\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return serializeAws_json1_1CognitoIdentityProvider(entry, context);\n });\n};\nvar serializeAws_json1_1CreateIdentityPoolInput = function (input, context) {\n return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AllowClassicFlow !== undefined &&\n input.AllowClassicFlow !== null && { AllowClassicFlow: input.AllowClassicFlow })), (input.AllowUnauthenticatedIdentities !== undefined &&\n input.AllowUnauthenticatedIdentities !== null && {\n AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities,\n })), (input.CognitoIdentityProviders !== undefined &&\n input.CognitoIdentityProviders !== null && {\n CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList(input.CognitoIdentityProviders, context),\n })), (input.DeveloperProviderName !== undefined &&\n input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName })), (input.IdentityPoolName !== undefined &&\n input.IdentityPoolName !== null && { IdentityPoolName: input.IdentityPoolName })), (input.IdentityPoolTags !== undefined &&\n input.IdentityPoolTags !== null && {\n IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context),\n })), (input.OpenIdConnectProviderARNs !== undefined &&\n input.OpenIdConnectProviderARNs !== null && {\n OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context),\n })), (input.SamlProviderARNs !== undefined &&\n input.SamlProviderARNs !== null && {\n SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context),\n })), (input.SupportedLoginProviders !== undefined &&\n input.SupportedLoginProviders !== null && {\n SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context),\n }));\n};\nvar serializeAws_json1_1DeleteIdentitiesInput = function (input, context) {\n return __assign({}, (input.IdentityIdsToDelete !== undefined &&\n input.IdentityIdsToDelete !== null && {\n IdentityIdsToDelete: serializeAws_json1_1IdentityIdList(input.IdentityIdsToDelete, context),\n }));\n};\nvar serializeAws_json1_1DeleteIdentityPoolInput = function (input, context) {\n return __assign({}, (input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }));\n};\nvar serializeAws_json1_1DescribeIdentityInput = function (input, context) {\n return __assign({}, (input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId }));\n};\nvar serializeAws_json1_1DescribeIdentityPoolInput = function (input, context) {\n return __assign({}, (input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }));\n};\nvar serializeAws_json1_1GetCredentialsForIdentityInput = function (input, context) {\n return __assign(__assign(__assign({}, (input.CustomRoleArn !== undefined && input.CustomRoleArn !== null && { CustomRoleArn: input.CustomRoleArn })), (input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId })), (input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }));\n};\nvar serializeAws_json1_1GetIdentityPoolRolesInput = function (input, context) {\n return __assign({}, (input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }));\n};\nvar serializeAws_json1_1GetIdInput = function (input, context) {\n return __assign(__assign(__assign({}, (input.AccountId !== undefined && input.AccountId !== null && { AccountId: input.AccountId })), (input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId })), (input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }));\n};\nvar serializeAws_json1_1GetOpenIdTokenForDeveloperIdentityInput = function (input, context) {\n return __assign(__assign(__assign(__assign({}, (input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId })), (input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId })), (input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) })), (input.TokenDuration !== undefined && input.TokenDuration !== null && { TokenDuration: input.TokenDuration }));\n};\nvar serializeAws_json1_1GetOpenIdTokenInput = function (input, context) {\n return __assign(__assign({}, (input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId })), (input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) }));\n};\nvar serializeAws_json1_1IdentityIdList = function (input, context) {\n return input\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return entry;\n });\n};\nvar serializeAws_json1_1IdentityPool = function (input, context) {\n return __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, (input.AllowClassicFlow !== undefined &&\n input.AllowClassicFlow !== null && { AllowClassicFlow: input.AllowClassicFlow })), (input.AllowUnauthenticatedIdentities !== undefined &&\n input.AllowUnauthenticatedIdentities !== null && {\n AllowUnauthenticatedIdentities: input.AllowUnauthenticatedIdentities,\n })), (input.CognitoIdentityProviders !== undefined &&\n input.CognitoIdentityProviders !== null && {\n CognitoIdentityProviders: serializeAws_json1_1CognitoIdentityProviderList(input.CognitoIdentityProviders, context),\n })), (input.DeveloperProviderName !== undefined &&\n input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName })), (input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId })), (input.IdentityPoolName !== undefined &&\n input.IdentityPoolName !== null && { IdentityPoolName: input.IdentityPoolName })), (input.IdentityPoolTags !== undefined &&\n input.IdentityPoolTags !== null && {\n IdentityPoolTags: serializeAws_json1_1IdentityPoolTagsType(input.IdentityPoolTags, context),\n })), (input.OpenIdConnectProviderARNs !== undefined &&\n input.OpenIdConnectProviderARNs !== null && {\n OpenIdConnectProviderARNs: serializeAws_json1_1OIDCProviderList(input.OpenIdConnectProviderARNs, context),\n })), (input.SamlProviderARNs !== undefined &&\n input.SamlProviderARNs !== null && {\n SamlProviderARNs: serializeAws_json1_1SAMLProviderList(input.SamlProviderARNs, context),\n })), (input.SupportedLoginProviders !== undefined &&\n input.SupportedLoginProviders !== null && {\n SupportedLoginProviders: serializeAws_json1_1IdentityProviders(input.SupportedLoginProviders, context),\n }));\n};\nvar serializeAws_json1_1IdentityPoolTagsListType = function (input, context) {\n return input\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return entry;\n });\n};\nvar serializeAws_json1_1IdentityPoolTagsType = function (input, context) {\n return Object.entries(input).reduce(function (acc, _a) {\n var _b;\n var _c = __read(_a, 2), key = _c[0], value = _c[1];\n if (value === null) {\n return acc;\n }\n return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));\n }, {});\n};\nvar serializeAws_json1_1IdentityProviders = function (input, context) {\n return Object.entries(input).reduce(function (acc, _a) {\n var _b;\n var _c = __read(_a, 2), key = _c[0], value = _c[1];\n if (value === null) {\n return acc;\n }\n return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));\n }, {});\n};\nvar serializeAws_json1_1ListIdentitiesInput = function (input, context) {\n return __assign(__assign(__assign(__assign({}, (input.HideDisabled !== undefined && input.HideDisabled !== null && { HideDisabled: input.HideDisabled })), (input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId })), (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }));\n};\nvar serializeAws_json1_1ListIdentityPoolsInput = function (input, context) {\n return __assign(__assign({}, (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }));\n};\nvar serializeAws_json1_1ListTagsForResourceInput = function (input, context) {\n return __assign({}, (input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn }));\n};\nvar serializeAws_json1_1LoginsList = function (input, context) {\n return input\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return entry;\n });\n};\nvar serializeAws_json1_1LoginsMap = function (input, context) {\n return Object.entries(input).reduce(function (acc, _a) {\n var _b;\n var _c = __read(_a, 2), key = _c[0], value = _c[1];\n if (value === null) {\n return acc;\n }\n return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));\n }, {});\n};\nvar serializeAws_json1_1LookupDeveloperIdentityInput = function (input, context) {\n return __assign(__assign(__assign(__assign(__assign({}, (input.DeveloperUserIdentifier !== undefined &&\n input.DeveloperUserIdentifier !== null && { DeveloperUserIdentifier: input.DeveloperUserIdentifier })), (input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId })), (input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId })), (input.MaxResults !== undefined && input.MaxResults !== null && { MaxResults: input.MaxResults })), (input.NextToken !== undefined && input.NextToken !== null && { NextToken: input.NextToken }));\n};\nvar serializeAws_json1_1MappingRule = function (input, context) {\n return __assign(__assign(__assign(__assign({}, (input.Claim !== undefined && input.Claim !== null && { Claim: input.Claim })), (input.MatchType !== undefined && input.MatchType !== null && { MatchType: input.MatchType })), (input.RoleARN !== undefined && input.RoleARN !== null && { RoleARN: input.RoleARN })), (input.Value !== undefined && input.Value !== null && { Value: input.Value }));\n};\nvar serializeAws_json1_1MappingRulesList = function (input, context) {\n return input\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return serializeAws_json1_1MappingRule(entry, context);\n });\n};\nvar serializeAws_json1_1MergeDeveloperIdentitiesInput = function (input, context) {\n return __assign(__assign(__assign(__assign({}, (input.DestinationUserIdentifier !== undefined &&\n input.DestinationUserIdentifier !== null && { DestinationUserIdentifier: input.DestinationUserIdentifier })), (input.DeveloperProviderName !== undefined &&\n input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName })), (input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId })), (input.SourceUserIdentifier !== undefined &&\n input.SourceUserIdentifier !== null && { SourceUserIdentifier: input.SourceUserIdentifier }));\n};\nvar serializeAws_json1_1OIDCProviderList = function (input, context) {\n return input\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return entry;\n });\n};\nvar serializeAws_json1_1RoleMapping = function (input, context) {\n return __assign(__assign(__assign({}, (input.AmbiguousRoleResolution !== undefined &&\n input.AmbiguousRoleResolution !== null && { AmbiguousRoleResolution: input.AmbiguousRoleResolution })), (input.RulesConfiguration !== undefined &&\n input.RulesConfiguration !== null && {\n RulesConfiguration: serializeAws_json1_1RulesConfigurationType(input.RulesConfiguration, context),\n })), (input.Type !== undefined && input.Type !== null && { Type: input.Type }));\n};\nvar serializeAws_json1_1RoleMappingMap = function (input, context) {\n return Object.entries(input).reduce(function (acc, _a) {\n var _b;\n var _c = __read(_a, 2), key = _c[0], value = _c[1];\n if (value === null) {\n return acc;\n }\n return __assign(__assign({}, acc), (_b = {}, _b[key] = serializeAws_json1_1RoleMapping(value, context), _b));\n }, {});\n};\nvar serializeAws_json1_1RolesMap = function (input, context) {\n return Object.entries(input).reduce(function (acc, _a) {\n var _b;\n var _c = __read(_a, 2), key = _c[0], value = _c[1];\n if (value === null) {\n return acc;\n }\n return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));\n }, {});\n};\nvar serializeAws_json1_1RulesConfigurationType = function (input, context) {\n return __assign({}, (input.Rules !== undefined &&\n input.Rules !== null && { Rules: serializeAws_json1_1MappingRulesList(input.Rules, context) }));\n};\nvar serializeAws_json1_1SAMLProviderList = function (input, context) {\n return input\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return entry;\n });\n};\nvar serializeAws_json1_1SetIdentityPoolRolesInput = function (input, context) {\n return __assign(__assign(__assign({}, (input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId })), (input.RoleMappings !== undefined &&\n input.RoleMappings !== null && { RoleMappings: serializeAws_json1_1RoleMappingMap(input.RoleMappings, context) })), (input.Roles !== undefined &&\n input.Roles !== null && { Roles: serializeAws_json1_1RolesMap(input.Roles, context) }));\n};\nvar serializeAws_json1_1TagResourceInput = function (input, context) {\n return __assign(__assign({}, (input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn })), (input.Tags !== undefined &&\n input.Tags !== null && { Tags: serializeAws_json1_1IdentityPoolTagsType(input.Tags, context) }));\n};\nvar serializeAws_json1_1UnlinkDeveloperIdentityInput = function (input, context) {\n return __assign(__assign(__assign(__assign({}, (input.DeveloperProviderName !== undefined &&\n input.DeveloperProviderName !== null && { DeveloperProviderName: input.DeveloperProviderName })), (input.DeveloperUserIdentifier !== undefined &&\n input.DeveloperUserIdentifier !== null && { DeveloperUserIdentifier: input.DeveloperUserIdentifier })), (input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId })), (input.IdentityPoolId !== undefined &&\n input.IdentityPoolId !== null && { IdentityPoolId: input.IdentityPoolId }));\n};\nvar serializeAws_json1_1UnlinkIdentityInput = function (input, context) {\n return __assign(__assign(__assign({}, (input.IdentityId !== undefined && input.IdentityId !== null && { IdentityId: input.IdentityId })), (input.Logins !== undefined &&\n input.Logins !== null && { Logins: serializeAws_json1_1LoginsMap(input.Logins, context) })), (input.LoginsToRemove !== undefined &&\n input.LoginsToRemove !== null && {\n LoginsToRemove: serializeAws_json1_1LoginsList(input.LoginsToRemove, context),\n }));\n};\nvar serializeAws_json1_1UntagResourceInput = function (input, context) {\n return __assign(__assign({}, (input.ResourceArn !== undefined && input.ResourceArn !== null && { ResourceArn: input.ResourceArn })), (input.TagKeys !== undefined &&\n input.TagKeys !== null && { TagKeys: serializeAws_json1_1IdentityPoolTagsListType(input.TagKeys, context) }));\n};\nvar deserializeAws_json1_1CognitoIdentityProvider = function (output, context) {\n return {\n ClientId: output.ClientId !== undefined && output.ClientId !== null ? output.ClientId : undefined,\n ProviderName: output.ProviderName !== undefined && output.ProviderName !== null ? output.ProviderName : undefined,\n ServerSideTokenCheck: output.ServerSideTokenCheck !== undefined && output.ServerSideTokenCheck !== null\n ? output.ServerSideTokenCheck\n : undefined,\n };\n};\nvar deserializeAws_json1_1CognitoIdentityProviderList = function (output, context) {\n return (output || [])\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return deserializeAws_json1_1CognitoIdentityProvider(entry, context);\n });\n};\nvar deserializeAws_json1_1ConcurrentModificationException = function (output, context) {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n };\n};\nvar deserializeAws_json1_1Credentials = function (output, context) {\n return {\n AccessKeyId: output.AccessKeyId !== undefined && output.AccessKeyId !== null ? output.AccessKeyId : undefined,\n Expiration: output.Expiration !== undefined && output.Expiration !== null\n ? new Date(Math.round(output.Expiration * 1000))\n : undefined,\n SecretKey: output.SecretKey !== undefined && output.SecretKey !== null ? output.SecretKey : undefined,\n SessionToken: output.SessionToken !== undefined && output.SessionToken !== null ? output.SessionToken : undefined,\n };\n};\nvar deserializeAws_json1_1DeleteIdentitiesResponse = function (output, context) {\n return {\n UnprocessedIdentityIds: output.UnprocessedIdentityIds !== undefined && output.UnprocessedIdentityIds !== null\n ? deserializeAws_json1_1UnprocessedIdentityIdList(output.UnprocessedIdentityIds, context)\n : undefined,\n };\n};\nvar deserializeAws_json1_1DeveloperUserAlreadyRegisteredException = function (output, context) {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n };\n};\nvar deserializeAws_json1_1DeveloperUserIdentifierList = function (output, context) {\n return (output || [])\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return entry;\n });\n};\nvar deserializeAws_json1_1ExternalServiceException = function (output, context) {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n };\n};\nvar deserializeAws_json1_1GetCredentialsForIdentityResponse = function (output, context) {\n return {\n Credentials: output.Credentials !== undefined && output.Credentials !== null\n ? deserializeAws_json1_1Credentials(output.Credentials, context)\n : undefined,\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n };\n};\nvar deserializeAws_json1_1GetIdentityPoolRolesResponse = function (output, context) {\n return {\n IdentityPoolId: output.IdentityPoolId !== undefined && output.IdentityPoolId !== null ? output.IdentityPoolId : undefined,\n RoleMappings: output.RoleMappings !== undefined && output.RoleMappings !== null\n ? deserializeAws_json1_1RoleMappingMap(output.RoleMappings, context)\n : undefined,\n Roles: output.Roles !== undefined && output.Roles !== null\n ? deserializeAws_json1_1RolesMap(output.Roles, context)\n : undefined,\n };\n};\nvar deserializeAws_json1_1GetIdResponse = function (output, context) {\n return {\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n };\n};\nvar deserializeAws_json1_1GetOpenIdTokenForDeveloperIdentityResponse = function (output, context) {\n return {\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n Token: output.Token !== undefined && output.Token !== null ? output.Token : undefined,\n };\n};\nvar deserializeAws_json1_1GetOpenIdTokenResponse = function (output, context) {\n return {\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n Token: output.Token !== undefined && output.Token !== null ? output.Token : undefined,\n };\n};\nvar deserializeAws_json1_1IdentitiesList = function (output, context) {\n return (output || [])\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return deserializeAws_json1_1IdentityDescription(entry, context);\n });\n};\nvar deserializeAws_json1_1IdentityDescription = function (output, context) {\n return {\n CreationDate: output.CreationDate !== undefined && output.CreationDate !== null\n ? new Date(Math.round(output.CreationDate * 1000))\n : undefined,\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n LastModifiedDate: output.LastModifiedDate !== undefined && output.LastModifiedDate !== null\n ? new Date(Math.round(output.LastModifiedDate * 1000))\n : undefined,\n Logins: output.Logins !== undefined && output.Logins !== null\n ? deserializeAws_json1_1LoginsList(output.Logins, context)\n : undefined,\n };\n};\nvar deserializeAws_json1_1IdentityPool = function (output, context) {\n return {\n AllowClassicFlow: output.AllowClassicFlow !== undefined && output.AllowClassicFlow !== null ? output.AllowClassicFlow : undefined,\n AllowUnauthenticatedIdentities: output.AllowUnauthenticatedIdentities !== undefined && output.AllowUnauthenticatedIdentities !== null\n ? output.AllowUnauthenticatedIdentities\n : undefined,\n CognitoIdentityProviders: output.CognitoIdentityProviders !== undefined && output.CognitoIdentityProviders !== null\n ? deserializeAws_json1_1CognitoIdentityProviderList(output.CognitoIdentityProviders, context)\n : undefined,\n DeveloperProviderName: output.DeveloperProviderName !== undefined && output.DeveloperProviderName !== null\n ? output.DeveloperProviderName\n : undefined,\n IdentityPoolId: output.IdentityPoolId !== undefined && output.IdentityPoolId !== null ? output.IdentityPoolId : undefined,\n IdentityPoolName: output.IdentityPoolName !== undefined && output.IdentityPoolName !== null ? output.IdentityPoolName : undefined,\n IdentityPoolTags: output.IdentityPoolTags !== undefined && output.IdentityPoolTags !== null\n ? deserializeAws_json1_1IdentityPoolTagsType(output.IdentityPoolTags, context)\n : undefined,\n OpenIdConnectProviderARNs: output.OpenIdConnectProviderARNs !== undefined && output.OpenIdConnectProviderARNs !== null\n ? deserializeAws_json1_1OIDCProviderList(output.OpenIdConnectProviderARNs, context)\n : undefined,\n SamlProviderARNs: output.SamlProviderARNs !== undefined && output.SamlProviderARNs !== null\n ? deserializeAws_json1_1SAMLProviderList(output.SamlProviderARNs, context)\n : undefined,\n SupportedLoginProviders: output.SupportedLoginProviders !== undefined && output.SupportedLoginProviders !== null\n ? deserializeAws_json1_1IdentityProviders(output.SupportedLoginProviders, context)\n : undefined,\n };\n};\nvar deserializeAws_json1_1IdentityPoolShortDescription = function (output, context) {\n return {\n IdentityPoolId: output.IdentityPoolId !== undefined && output.IdentityPoolId !== null ? output.IdentityPoolId : undefined,\n IdentityPoolName: output.IdentityPoolName !== undefined && output.IdentityPoolName !== null ? output.IdentityPoolName : undefined,\n };\n};\nvar deserializeAws_json1_1IdentityPoolsList = function (output, context) {\n return (output || [])\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return deserializeAws_json1_1IdentityPoolShortDescription(entry, context);\n });\n};\nvar deserializeAws_json1_1IdentityPoolTagsType = function (output, context) {\n return Object.entries(output).reduce(function (acc, _a) {\n var _b;\n var _c = __read(_a, 2), key = _c[0], value = _c[1];\n if (value === null) {\n return acc;\n }\n return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));\n }, {});\n};\nvar deserializeAws_json1_1IdentityProviders = function (output, context) {\n return Object.entries(output).reduce(function (acc, _a) {\n var _b;\n var _c = __read(_a, 2), key = _c[0], value = _c[1];\n if (value === null) {\n return acc;\n }\n return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));\n }, {});\n};\nvar deserializeAws_json1_1InternalErrorException = function (output, context) {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n };\n};\nvar deserializeAws_json1_1InvalidIdentityPoolConfigurationException = function (output, context) {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n };\n};\nvar deserializeAws_json1_1InvalidParameterException = function (output, context) {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n };\n};\nvar deserializeAws_json1_1LimitExceededException = function (output, context) {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n };\n};\nvar deserializeAws_json1_1ListIdentitiesResponse = function (output, context) {\n return {\n Identities: output.Identities !== undefined && output.Identities !== null\n ? deserializeAws_json1_1IdentitiesList(output.Identities, context)\n : undefined,\n IdentityPoolId: output.IdentityPoolId !== undefined && output.IdentityPoolId !== null ? output.IdentityPoolId : undefined,\n NextToken: output.NextToken !== undefined && output.NextToken !== null ? output.NextToken : undefined,\n };\n};\nvar deserializeAws_json1_1ListIdentityPoolsResponse = function (output, context) {\n return {\n IdentityPools: output.IdentityPools !== undefined && output.IdentityPools !== null\n ? deserializeAws_json1_1IdentityPoolsList(output.IdentityPools, context)\n : undefined,\n NextToken: output.NextToken !== undefined && output.NextToken !== null ? output.NextToken : undefined,\n };\n};\nvar deserializeAws_json1_1ListTagsForResourceResponse = function (output, context) {\n return {\n Tags: output.Tags !== undefined && output.Tags !== null\n ? deserializeAws_json1_1IdentityPoolTagsType(output.Tags, context)\n : undefined,\n };\n};\nvar deserializeAws_json1_1LoginsList = function (output, context) {\n return (output || [])\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return entry;\n });\n};\nvar deserializeAws_json1_1LookupDeveloperIdentityResponse = function (output, context) {\n return {\n DeveloperUserIdentifierList: output.DeveloperUserIdentifierList !== undefined && output.DeveloperUserIdentifierList !== null\n ? deserializeAws_json1_1DeveloperUserIdentifierList(output.DeveloperUserIdentifierList, context)\n : undefined,\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n NextToken: output.NextToken !== undefined && output.NextToken !== null ? output.NextToken : undefined,\n };\n};\nvar deserializeAws_json1_1MappingRule = function (output, context) {\n return {\n Claim: output.Claim !== undefined && output.Claim !== null ? output.Claim : undefined,\n MatchType: output.MatchType !== undefined && output.MatchType !== null ? output.MatchType : undefined,\n RoleARN: output.RoleARN !== undefined && output.RoleARN !== null ? output.RoleARN : undefined,\n Value: output.Value !== undefined && output.Value !== null ? output.Value : undefined,\n };\n};\nvar deserializeAws_json1_1MappingRulesList = function (output, context) {\n return (output || [])\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return deserializeAws_json1_1MappingRule(entry, context);\n });\n};\nvar deserializeAws_json1_1MergeDeveloperIdentitiesResponse = function (output, context) {\n return {\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n };\n};\nvar deserializeAws_json1_1NotAuthorizedException = function (output, context) {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n };\n};\nvar deserializeAws_json1_1OIDCProviderList = function (output, context) {\n return (output || [])\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return entry;\n });\n};\nvar deserializeAws_json1_1ResourceConflictException = function (output, context) {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n };\n};\nvar deserializeAws_json1_1ResourceNotFoundException = function (output, context) {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n };\n};\nvar deserializeAws_json1_1RoleMapping = function (output, context) {\n return {\n AmbiguousRoleResolution: output.AmbiguousRoleResolution !== undefined && output.AmbiguousRoleResolution !== null\n ? output.AmbiguousRoleResolution\n : undefined,\n RulesConfiguration: output.RulesConfiguration !== undefined && output.RulesConfiguration !== null\n ? deserializeAws_json1_1RulesConfigurationType(output.RulesConfiguration, context)\n : undefined,\n Type: output.Type !== undefined && output.Type !== null ? output.Type : undefined,\n };\n};\nvar deserializeAws_json1_1RoleMappingMap = function (output, context) {\n return Object.entries(output).reduce(function (acc, _a) {\n var _b;\n var _c = __read(_a, 2), key = _c[0], value = _c[1];\n if (value === null) {\n return acc;\n }\n return __assign(__assign({}, acc), (_b = {}, _b[key] = deserializeAws_json1_1RoleMapping(value, context), _b));\n }, {});\n};\nvar deserializeAws_json1_1RolesMap = function (output, context) {\n return Object.entries(output).reduce(function (acc, _a) {\n var _b;\n var _c = __read(_a, 2), key = _c[0], value = _c[1];\n if (value === null) {\n return acc;\n }\n return __assign(__assign({}, acc), (_b = {}, _b[key] = value, _b));\n }, {});\n};\nvar deserializeAws_json1_1RulesConfigurationType = function (output, context) {\n return {\n Rules: output.Rules !== undefined && output.Rules !== null\n ? deserializeAws_json1_1MappingRulesList(output.Rules, context)\n : undefined,\n };\n};\nvar deserializeAws_json1_1SAMLProviderList = function (output, context) {\n return (output || [])\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return entry;\n });\n};\nvar deserializeAws_json1_1TagResourceResponse = function (output, context) {\n return {};\n};\nvar deserializeAws_json1_1TooManyRequestsException = function (output, context) {\n return {\n message: output.message !== undefined && output.message !== null ? output.message : undefined,\n };\n};\nvar deserializeAws_json1_1UnprocessedIdentityId = function (output, context) {\n return {\n ErrorCode: output.ErrorCode !== undefined && output.ErrorCode !== null ? output.ErrorCode : undefined,\n IdentityId: output.IdentityId !== undefined && output.IdentityId !== null ? output.IdentityId : undefined,\n };\n};\nvar deserializeAws_json1_1UnprocessedIdentityIdList = function (output, context) {\n return (output || [])\n .filter(function (e) { return e != null; })\n .map(function (entry) {\n if (entry === null) {\n return null;\n }\n return deserializeAws_json1_1UnprocessedIdentityId(entry, context);\n });\n};\nvar deserializeAws_json1_1UntagResourceResponse = function (output, context) {\n return {};\n};\nvar deserializeMetadata = function (output) {\n var _a;\n return ({\n httpStatusCode: output.statusCode,\n requestId: (_a = output.headers[\"x-amzn-requestid\"]) !== null && _a !== void 0 ? _a : output.headers[\"x-amzn-request-id\"],\n extendedRequestId: output.headers[\"x-amz-id-2\"],\n cfId: output.headers[\"x-amz-cf-id\"],\n });\n};\n// Collect low-level response body stream to Uint8Array.\nvar collectBody = function (streamBody, context) {\n if (streamBody === void 0) { streamBody = new Uint8Array(); }\n if (streamBody instanceof Uint8Array) {\n return Promise.resolve(streamBody);\n }\n return context.streamCollector(streamBody) || Promise.resolve(new Uint8Array());\n};\n// Encode Uint8Array data into string with utf-8.\nvar collectBodyString = function (streamBody, context) {\n return collectBody(streamBody, context).then(function (body) { return context.utf8Encoder(body); });\n};\nvar buildHttpRpcRequest = function (context, headers, path, resolvedHostname, body) { return __awaiter(void 0, void 0, void 0, function () {\n var _a, hostname, _b, protocol, port, contents;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0: return [4 /*yield*/, context.endpoint()];\n case 1:\n _a = _c.sent(), hostname = _a.hostname, _b = _a.protocol, protocol = _b === void 0 ? \"https\" : _b, port = _a.port;\n contents = {\n protocol: protocol,\n hostname: hostname,\n port: port,\n method: \"POST\",\n path: path,\n headers: headers,\n };\n if (resolvedHostname !== undefined) {\n contents.hostname = resolvedHostname;\n }\n if (body !== undefined) {\n contents.body = body;\n }\n return [2 /*return*/, new __HttpRequest(contents)];\n }\n });\n}); };\nvar parseBody = function (streamBody, context) {\n return collectBodyString(streamBody, context).then(function (encoded) {\n if (encoded.length) {\n return JSON.parse(encoded);\n }\n return {};\n });\n};\n/**\n * Load an error code for the aws.rest-json-1.1 protocol.\n */\nvar loadRestJsonErrorCode = function (output, data) {\n var findKey = function (object, key) { return Object.keys(object).find(function (k) { return k.toLowerCase() === key.toLowerCase(); }); };\n var sanitizeErrorCode = function (rawValue) {\n var cleanValue = rawValue;\n if (cleanValue.indexOf(\":\") >= 0) {\n cleanValue = cleanValue.split(\":\")[0];\n }\n if (cleanValue.indexOf(\"#\") >= 0) {\n cleanValue = cleanValue.split(\"#\")[1];\n }\n return cleanValue;\n };\n var headerKey = findKey(output.headers, \"x-amzn-errortype\");\n if (headerKey !== undefined) {\n return sanitizeErrorCode(output.headers[headerKey]);\n }\n if (data.code !== undefined) {\n return sanitizeErrorCode(data.code);\n }\n if (data[\"__type\"] !== undefined) {\n return sanitizeErrorCode(data[\"__type\"]);\n }\n return \"\";\n};\n//# sourceMappingURL=Aws_json1_1.js.map","import { __extends } from \"tslib\";\nimport { GetCredentialsForIdentityInput, GetCredentialsForIdentityResponse } from \"../models/models_0\";\nimport { deserializeAws_json1_1GetCredentialsForIdentityCommand, serializeAws_json1_1GetCredentialsForIdentityCommand, } from \"../protocols/Aws_json1_1\";\nimport { getSerdePlugin } from \"@aws-sdk/middleware-serde\";\nimport { Command as $Command } from \"@aws-sdk/smithy-client\";\n/**\n *

Returns credentials for the provided identity ID. Any provided logins will be\n * validated against supported login providers. If the token is for\n * cognito-identity.amazonaws.com, it will be passed through to AWS Security Token Service\n * with the appropriate role for the token.

\n *

This is a public API. You do not need any credentials to call this API.

\n */\nvar GetCredentialsForIdentityCommand = /** @class */ (function (_super) {\n __extends(GetCredentialsForIdentityCommand, _super);\n // Start section: command_properties\n // End section: command_properties\n function GetCredentialsForIdentityCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }\n /**\n * @internal\n */\n GetCredentialsForIdentityCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {\n this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));\n var stack = clientStack.concat(this.middlewareStack);\n var logger = configuration.logger;\n var clientName = \"CognitoIdentityClient\";\n var commandName = \"GetCredentialsForIdentityCommand\";\n var handlerExecutionContext = {\n logger: logger,\n clientName: clientName,\n commandName: commandName,\n inputFilterSensitiveLog: GetCredentialsForIdentityInput.filterSensitiveLog,\n outputFilterSensitiveLog: GetCredentialsForIdentityResponse.filterSensitiveLog,\n };\n var requestHandler = configuration.requestHandler;\n return stack.resolve(function (request) {\n return requestHandler.handle(request.request, options || {});\n }, handlerExecutionContext);\n };\n GetCredentialsForIdentityCommand.prototype.serialize = function (input, context) {\n return serializeAws_json1_1GetCredentialsForIdentityCommand(input, context);\n };\n GetCredentialsForIdentityCommand.prototype.deserialize = function (output, context) {\n return deserializeAws_json1_1GetCredentialsForIdentityCommand(output, context);\n };\n return GetCredentialsForIdentityCommand;\n}($Command));\nexport { GetCredentialsForIdentityCommand };\n//# sourceMappingURL=GetCredentialsForIdentityCommand.js.map","import { __extends } from \"tslib\";\nimport { GetIdInput, GetIdResponse } from \"../models/models_0\";\nimport { deserializeAws_json1_1GetIdCommand, serializeAws_json1_1GetIdCommand } from \"../protocols/Aws_json1_1\";\nimport { getSerdePlugin } from \"@aws-sdk/middleware-serde\";\nimport { Command as $Command } from \"@aws-sdk/smithy-client\";\n/**\n *

Generates (or retrieves) a Cognito ID. Supplying multiple logins will create an\n * implicit linked account.

\n *

This is a public API. You do not need any credentials to call this API.

\n */\nvar GetIdCommand = /** @class */ (function (_super) {\n __extends(GetIdCommand, _super);\n // Start section: command_properties\n // End section: command_properties\n function GetIdCommand(input) {\n var _this = \n // Start section: command_constructor\n _super.call(this) || this;\n _this.input = input;\n return _this;\n // End section: command_constructor\n }\n /**\n * @internal\n */\n GetIdCommand.prototype.resolveMiddleware = function (clientStack, configuration, options) {\n this.middlewareStack.use(getSerdePlugin(configuration, this.serialize, this.deserialize));\n var stack = clientStack.concat(this.middlewareStack);\n var logger = configuration.logger;\n var clientName = \"CognitoIdentityClient\";\n var commandName = \"GetIdCommand\";\n var handlerExecutionContext = {\n logger: logger,\n clientName: clientName,\n commandName: commandName,\n inputFilterSensitiveLog: GetIdInput.filterSensitiveLog,\n outputFilterSensitiveLog: GetIdResponse.filterSensitiveLog,\n };\n var requestHandler = configuration.requestHandler;\n return stack.resolve(function (request) {\n return requestHandler.handle(request.request, options || {});\n }, handlerExecutionContext);\n };\n GetIdCommand.prototype.serialize = function (input, context) {\n return serializeAws_json1_1GetIdCommand(input, context);\n };\n GetIdCommand.prototype.deserialize = function (output, context) {\n return deserializeAws_json1_1GetIdCommand(output, context);\n };\n return GetIdCommand;\n}($Command));\nexport { GetIdCommand };\n//# sourceMappingURL=GetIdCommand.js.map","import { __extends } from \"tslib\";\n/**\n * An error representing a failure of an individual credential provider.\n *\n * This error class has special meaning to the {@link chain} method. If a\n * provider in the chain is rejected with an error, the chain will only proceed\n * to the next provider if the value of the `tryNextLink` property on the error\n * is truthy. This allows individual providers to halt the chain and also\n * ensures the chain will stop if an entirely unexpected error is encountered.\n */\nvar ProviderError = /** @class */ (function (_super) {\n __extends(ProviderError, _super);\n function ProviderError(message, tryNextLink) {\n if (tryNextLink === void 0) { tryNextLink = true; }\n var _this = _super.call(this, message) || this;\n _this.tryNextLink = tryNextLink;\n return _this;\n }\n return ProviderError;\n}(Error));\nexport { ProviderError };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiUHJvdmlkZXJFcnJvci5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9Qcm92aWRlckVycm9yLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7Ozs7Ozs7R0FRRztBQUNIO0lBQW1DLGlDQUFLO0lBQ3RDLHVCQUFZLE9BQWUsRUFBa0IsV0FBMkI7UUFBM0IsNEJBQUEsRUFBQSxrQkFBMkI7UUFBeEUsWUFDRSxrQkFBTSxPQUFPLENBQUMsU0FDZjtRQUY0QyxpQkFBVyxHQUFYLFdBQVcsQ0FBZ0I7O0lBRXhFLENBQUM7SUFDSCxvQkFBQztBQUFELENBQUMsQUFKRCxDQUFtQyxLQUFLLEdBSXZDIiwic291cmNlc0NvbnRlbnQiOlsiLyoqXG4gKiBBbiBlcnJvciByZXByZXNlbnRpbmcgYSBmYWlsdXJlIG9mIGFuIGluZGl2aWR1YWwgY3JlZGVudGlhbCBwcm92aWRlci5cbiAqXG4gKiBUaGlzIGVycm9yIGNsYXNzIGhhcyBzcGVjaWFsIG1lYW5pbmcgdG8gdGhlIHtAbGluayBjaGFpbn0gbWV0aG9kLiBJZiBhXG4gKiBwcm92aWRlciBpbiB0aGUgY2hhaW4gaXMgcmVqZWN0ZWQgd2l0aCBhbiBlcnJvciwgdGhlIGNoYWluIHdpbGwgb25seSBwcm9jZWVkXG4gKiB0byB0aGUgbmV4dCBwcm92aWRlciBpZiB0aGUgdmFsdWUgb2YgdGhlIGB0cnlOZXh0TGlua2AgcHJvcGVydHkgb24gdGhlIGVycm9yXG4gKiBpcyB0cnV0aHkuIFRoaXMgYWxsb3dzIGluZGl2aWR1YWwgcHJvdmlkZXJzIHRvIGhhbHQgdGhlIGNoYWluIGFuZCBhbHNvXG4gKiBlbnN1cmVzIHRoZSBjaGFpbiB3aWxsIHN0b3AgaWYgYW4gZW50aXJlbHkgdW5leHBlY3RlZCBlcnJvciBpcyBlbmNvdW50ZXJlZC5cbiAqL1xuZXhwb3J0IGNsYXNzIFByb3ZpZGVyRXJyb3IgZXh0ZW5kcyBFcnJvciB7XG4gIGNvbnN0cnVjdG9yKG1lc3NhZ2U6IHN0cmluZywgcHVibGljIHJlYWRvbmx5IHRyeU5leHRMaW5rOiBib29sZWFuID0gdHJ1ZSkge1xuICAgIHN1cGVyKG1lc3NhZ2UpO1xuICB9XG59XG4iXX0=","import { __read } from \"tslib\";\n/**\n * @internal\n */\nexport function resolveLogins(logins) {\n return Promise.all(Object.keys(logins).reduce(function (arr, name) {\n var tokenOrProvider = logins[name];\n if (typeof tokenOrProvider === \"string\") {\n arr.push([name, tokenOrProvider]);\n }\n else {\n arr.push(tokenOrProvider().then(function (token) { return [name, token]; }));\n }\n return arr;\n }, [])).then(function (resolvedPairs) {\n return resolvedPairs.reduce(function (logins, _a) {\n var _b = __read(_a, 2), key = _b[0], value = _b[1];\n logins[key] = value;\n return logins;\n }, {});\n });\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicmVzb2x2ZUxvZ2lucy5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9yZXNvbHZlTG9naW5zLnRzIl0sIm5hbW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sdmVkTG9naW5zIH0gZnJvbSBcIi4vTG9naW5zXCI7XG5cbi8qKlxuICogQGludGVybmFsXG4gKi9cbmV4cG9ydCBmdW5jdGlvbiByZXNvbHZlTG9naW5zKGxvZ2luczogTG9naW5zKTogUHJvbWlzZTxSZXNvbHZlZExvZ2lucz4ge1xuICByZXR1cm4gUHJvbWlzZS5hbGwoXG4gICAgT2JqZWN0LmtleXMobG9naW5zKS5yZWR1Y2UoKGFycjogQXJyYXk8W3N0cmluZywgc3RyaW5nXSB8IFByb21pc2U8W3N0cmluZywgc3RyaW5nXT4+LCBuYW1lOiBzdHJpbmcpID0+IHtcbiAgICAgIGNvbnN0IHRva2VuT3JQcm92aWRlciA9IGxvZ2luc1tuYW1lXTtcbiAgICAgIGlmICh0eXBlb2YgdG9rZW5PclByb3ZpZGVyID09PSBcInN0cmluZ1wiKSB7XG4gICAgICAgIGFyci5wdXNoKFtuYW1lLCB0b2tlbk9yUHJvdmlkZXJdIGFzIFtzdHJpbmcsIHN0cmluZ10pO1xuICAgICAgfSBlbHNlIHtcbiAgICAgICAgYXJyLnB1c2godG9rZW5PclByb3ZpZGVyKCkudGhlbigodG9rZW4pID0+IFtuYW1lLCB0b2tlbl0gYXMgW3N0cmluZywgc3RyaW5nXSkpO1xuICAgICAgfVxuICAgICAgcmV0dXJuIGFycjtcbiAgICB9LCBbXSBhcyBBcnJheTxQcm9taXNlPFtzdHJpbmcsIHN0cmluZ10+PilcbiAgKS50aGVuKChyZXNvbHZlZFBhaXJzKSA9PlxuICAgIHJlc29sdmVkUGFpcnMucmVkdWNlKChsb2dpbnM6IFJlc29sdmVkTG9naW5zLCBba2V5LCB2YWx1ZV0pID0+IHtcbiAgICAgIGxvZ2luc1trZXldID0gdmFsdWU7XG4gICAgICByZXR1cm4gbG9naW5zO1xuICAgIH0sIHt9IGFzIFJlc29sdmVkTG9naW5zKVxuICApO1xufVxuIl19","import { __awaiter, __generator } from \"tslib\";\nimport { GetCredentialsForIdentityCommand } from \"@aws-sdk/client-cognito-identity\";\nimport { ProviderError } from \"@aws-sdk/property-provider\";\nimport { resolveLogins } from \"./resolveLogins\";\n/**\n * Retrieves temporary AWS credentials using Amazon Cognito's\n * `GetCredentialsForIdentity` operation.\n *\n * Results from this function call are not cached internally.\n */\nexport function fromCognitoIdentity(parameters) {\n var _this = this;\n return function () { return __awaiter(_this, void 0, void 0, function () {\n var _a, _b, _c, AccessKeyId, Expiration, _d, SecretKey, SessionToken, _e, _f, _g, _h;\n var _j;\n return __generator(this, function (_k) {\n switch (_k.label) {\n case 0:\n _f = (_e = parameters.client).send;\n _g = GetCredentialsForIdentityCommand.bind;\n _j = {\n CustomRoleArn: parameters.customRoleArn,\n IdentityId: parameters.identityId\n };\n if (!parameters.logins) return [3 /*break*/, 2];\n return [4 /*yield*/, resolveLogins(parameters.logins)];\n case 1:\n _h = _k.sent();\n return [3 /*break*/, 3];\n case 2:\n _h = undefined;\n _k.label = 3;\n case 3: return [4 /*yield*/, _f.apply(_e, [new (_g.apply(GetCredentialsForIdentityCommand, [void 0, (_j.Logins = _h,\n _j)]))()])];\n case 4:\n _a = (_k.sent()).Credentials, _b = _a === void 0 ? throwOnMissingCredentials() : _a, _c = _b.AccessKeyId, AccessKeyId = _c === void 0 ? throwOnMissingAccessKeyId() : _c, Expiration = _b.Expiration, _d = _b.SecretKey, SecretKey = _d === void 0 ? throwOnMissingSecretKey() : _d, SessionToken = _b.SessionToken;\n return [2 /*return*/, {\n identityId: parameters.identityId,\n accessKeyId: AccessKeyId,\n secretAccessKey: SecretKey,\n sessionToken: SessionToken,\n expiration: Expiration,\n }];\n }\n });\n }); };\n}\nfunction throwOnMissingAccessKeyId() {\n throw new ProviderError(\"Response from Amazon Cognito contained no access key ID\");\n}\nfunction throwOnMissingCredentials() {\n throw new ProviderError(\"Response from Amazon Cognito contained no credentials\");\n}\nfunction throwOnMissingSecretKey() {\n throw new ProviderError(\"Response from Amazon Cognito contained no secret key\");\n}\n//# sourceMappingURL=data:application/json;base64,e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BJRFwiKTtcbn1cblxuZnVuY3Rpb24gdGhyb3dPbk1pc3NpbmdDcmVkZW50aWFscygpOiBuZXZlciB7XG4gIHRocm93IG5ldyBQcm92aWRlckVycm9yKFwiUmVzcG9uc2UgZnJvbSBBbWF6b24gQ29nbml0byBjb250YWluZWQgbm8gY3JlZGVudGlhbHNcIik7XG59XG5cbmZ1bmN0aW9uIHRocm93T25NaXNzaW5nU2VjcmV0S2V5KCk6IG5ldmVyIHtcbiAgdGhyb3cgbmV3IFByb3ZpZGVyRXJyb3IoXCJSZXNwb25zZSBmcm9tIEFtYXpvbiBDb2duaXRvIGNvbnRhaW5lZCBubyBzZWNyZXQga2V5XCIpO1xufVxuIl19","var STORE_NAME = \"IdentityIds\";\nvar IndexedDbStorage = /** @class */ (function () {\n function IndexedDbStorage(dbName) {\n if (dbName === void 0) { dbName = \"aws:cognito-identity-ids\"; }\n this.dbName = dbName;\n }\n IndexedDbStorage.prototype.getItem = function (key) {\n return this.withObjectStore(\"readonly\", function (store) {\n var req = store.get(key);\n return new Promise(function (resolve) {\n req.onerror = function () { return resolve(null); };\n req.onsuccess = function () { return resolve(req.result ? req.result.value : null); };\n });\n }).catch(function () { return null; });\n };\n IndexedDbStorage.prototype.removeItem = function (key) {\n return this.withObjectStore(\"readwrite\", function (store) {\n var req = store.delete(key);\n return new Promise(function (resolve, reject) {\n req.onerror = function () { return reject(req.error); };\n req.onsuccess = function () { return resolve(); };\n });\n });\n };\n IndexedDbStorage.prototype.setItem = function (id, value) {\n return this.withObjectStore(\"readwrite\", function (store) {\n var req = store.put({ id: id, value: value });\n return new Promise(function (resolve, reject) {\n req.onerror = function () { return reject(req.error); };\n req.onsuccess = function () { return resolve(); };\n });\n });\n };\n IndexedDbStorage.prototype.getDb = function () {\n var openDbRequest = self.indexedDB.open(this.dbName, 1);\n return new Promise(function (resolve, reject) {\n openDbRequest.onsuccess = function () {\n resolve(openDbRequest.result);\n };\n openDbRequest.onerror = function () {\n reject(openDbRequest.error);\n };\n openDbRequest.onblocked = function () {\n reject(new Error(\"Unable to access DB\"));\n };\n openDbRequest.onupgradeneeded = function () {\n var db = openDbRequest.result;\n db.onerror = function () {\n reject(new Error(\"Failed to create object store\"));\n };\n db.createObjectStore(STORE_NAME, { keyPath: \"id\" });\n };\n });\n };\n IndexedDbStorage.prototype.withObjectStore = function (mode, action) {\n return this.getDb().then(function (db) {\n var tx = db.transaction(STORE_NAME, mode);\n tx.oncomplete = function () { return db.close(); };\n return new Promise(function (resolve, reject) {\n tx.onerror = function () { return reject(tx.error); };\n resolve(action(tx.objectStore(STORE_NAME)));\n }).catch(function (err) {\n db.close();\n throw err;\n });\n });\n };\n return IndexedDbStorage;\n}());\nexport { IndexedDbStorage };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSW5kZXhlZERiU3RvcmFnZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9JbmRleGVkRGJTdG9yYWdlLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLElBQU0sVUFBVSxHQUFHLGFBQWEsQ0FBQztBQUVqQztJQUNFLDBCQUE2QixNQUEyQztRQUEzQyx1QkFBQSxFQUFBLG1DQUEyQztRQUEzQyxXQUFNLEdBQU4sTUFBTSxDQUFxQztJQUFHLENBQUM7SUFFNUUsa0NBQU8sR0FBUCxVQUFRLEdBQVc7UUFDakIsT0FBTyxJQUFJLENBQUMsZUFBZSxDQUFDLFVBQVUsRUFBRSxVQUFDLEtBQUs7WUFDNUMsSUFBTSxHQUFHLEdBQUcsS0FBSyxDQUFDLEdBQUcsQ0FBQyxHQUFHLENBQUMsQ0FBQztZQUUzQixPQUFPLElBQUksT0FBTyxDQUFnQixVQUFDLE9BQU87Z0JBQ3hDLEdBQUcsQ0FBQyxPQUFPLEdBQUcsY0FBTSxPQUFBLE9BQU8sQ0FBQyxJQUFJLENBQUMsRUFBYixDQUFhLENBQUM7Z0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JvdyBlcnI7XG4gICAgICB9KTtcbiAgICB9KTtcbiAgfVxufVxuIl19","var InMemoryStorage = /** @class */ (function () {\n function InMemoryStorage(store) {\n if (store === void 0) { store = {}; }\n this.store = store;\n }\n InMemoryStorage.prototype.getItem = function (key) {\n if (key in this.store) {\n return this.store[key];\n }\n return null;\n };\n InMemoryStorage.prototype.removeItem = function (key) {\n delete this.store[key];\n };\n InMemoryStorage.prototype.setItem = function (key, value) {\n this.store[key] = value;\n };\n return InMemoryStorage;\n}());\nexport { InMemoryStorage };\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiSW5NZW1vcnlTdG9yYWdlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL0luTWVtb3J5U3RvcmFnZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFFQTtJQUNFLHlCQUFvQixLQUFxQztRQUFyQyxzQkFBQSxFQUFBLFVBQXFDO1FBQXJDLFVBQUssR0FBTCxLQUFLLENBQWdDO0lBQUcsQ0FBQztJQUU3RCxpQ0FBTyxHQUFQLFVBQVEsR0FBVztRQUNqQixJQUFJLEdBQUcsSUFBSSxJQUFJLENBQUMsS0FBSyxFQUFFO1lBQ3JCLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQztTQUN4QjtRQUVELE9BQU8sSUFBSSxDQUFDO0lBQ2QsQ0FBQztJQUVELG9DQUFVLEdBQVYsVUFBVyxHQUFXO1FBQ3BCLE9BQU8sSUFBSSxDQUFDLEtBQUssQ0FBQyxHQUFHLENBQUMsQ0FBQztJQUN6QixDQUFDO0lBRUQsaUNBQU8sR0FBUCxVQUFRLEdBQVcsRUFBRSxLQUFhO1FBQ2hDLElBQUksQ0FBQyxLQUFLLENBQUMsR0FBRyxDQUFDLEdBQUcsS0FBSyxDQUFDO0lBQzFCLENBQUM7SUFDSCxzQkFBQztBQUFELENBQUMsQUFsQkQsSUFrQkMiLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBTdG9yYWdlIH0gZnJvbSBcIi4vU3RvcmFnZVwiO1xuXG5leHBvcnQgY2xhc3MgSW5NZW1vcnlTdG9yYWdlIGltcGxlbWVudHMgU3RvcmFnZSB7XG4gIGNvbnN0cnVjdG9yKHByaXZhdGUgc3RvcmU6IHsgW2tleTogc3RyaW5nXTogc3RyaW5nIH0gPSB7fSkge31cblxuICBnZXRJdGVtKGtleTogc3RyaW5nKTogc3RyaW5nIHwgbnVsbCB7XG4gICAgaWYgKGtleSBpbiB0aGlzLnN0b3JlKSB7XG4gICAgICByZXR1cm4gdGhpcy5zdG9yZVtrZXldO1xuICAgIH1cblxuICAgIHJldHVybiBudWxsO1xuICB9XG5cbiAgcmVtb3ZlSXRlbShrZXk6IHN0cmluZyk6IHZvaWQge1xuICAgIGRlbGV0ZSB0aGlzLnN0b3JlW2tleV07XG4gIH1cblxuICBzZXRJdGVtKGtleTogc3RyaW5nLCB2YWx1ZTogc3RyaW5nKTogdm9pZCB7XG4gICAgdGhpcy5zdG9yZVtrZXldID0gdmFsdWU7XG4gIH1cbn1cbiJdfQ==","import { IndexedDbStorage } from \"./IndexedDbStorage\";\nimport { InMemoryStorage } from \"./InMemoryStorage\";\nvar inMemoryStorage = new InMemoryStorage();\nexport function localStorage() {\n if (typeof self === \"object\" && self.indexedDB) {\n return new IndexedDbStorage();\n }\n if (typeof window === \"object\" && window.localStorage) {\n return window.localStorage;\n }\n return inMemoryStorage;\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibG9jYWxTdG9yYWdlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2xvY2FsU3RvcmFnZS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsZ0JBQWdCLEVBQUUsTUFBTSxvQkFBb0IsQ0FBQzt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JldHVybiBpbk1lbW9yeVN0b3JhZ2U7XG59XG4iXX0=","import { __awaiter, __generator } from \"tslib\";\nimport { GetIdCommand } from \"@aws-sdk/client-cognito-identity\";\nimport { ProviderError } from \"@aws-sdk/property-provider\";\nimport { fromCognitoIdentity } from \"./fromCognitoIdentity\";\nimport { localStorage } from \"./localStorage\";\nimport { resolveLogins } from \"./resolveLogins\";\n/**\n * Retrieves or generates a unique identifier using Amazon Cognito's `GetId`\n * operation, then generates temporary AWS credentials using Amazon Cognito's\n * `GetCredentialsForIdentity` operation.\n *\n * Results from `GetId` are cached internally, but results from\n * `GetCredentialsForIdentity` are not.\n */\nexport function fromCognitoIdentityPool(_a) {\n var _this = this;\n var accountId = _a.accountId, _b = _a.cache, cache = _b === void 0 ? localStorage() : _b, client = _a.client, customRoleArn = _a.customRoleArn, identityPoolId = _a.identityPoolId, logins = _a.logins, _c = _a.userIdentifier, userIdentifier = _c === void 0 ? !logins || Object.keys(logins).length === 0 ? \"ANONYMOUS\" : undefined : _c;\n var cacheKey = userIdentifier ? \"aws:cognito-identity-credentials:\" + identityPoolId + \":\" + userIdentifier : undefined;\n var provider = function () { return __awaiter(_this, void 0, void 0, function () {\n var identityId, _a, _b, IdentityId, _c, _d, _e, _f;\n var _g;\n return __generator(this, function (_h) {\n switch (_h.label) {\n case 0:\n _a = cacheKey;\n if (!_a) return [3 /*break*/, 2];\n return [4 /*yield*/, cache.getItem(cacheKey)];\n case 1:\n _a = (_h.sent());\n _h.label = 2;\n case 2:\n identityId = _a;\n if (!!identityId) return [3 /*break*/, 7];\n _d = (_c = client).send;\n _e = GetIdCommand.bind;\n _g = {\n AccountId: accountId,\n IdentityPoolId: identityPoolId\n };\n if (!logins) return [3 /*break*/, 4];\n return [4 /*yield*/, resolveLogins(logins)];\n case 3:\n _f = _h.sent();\n return [3 /*break*/, 5];\n case 4:\n _f = undefined;\n _h.label = 5;\n case 5: return [4 /*yield*/, _d.apply(_c, [new (_e.apply(GetIdCommand, [void 0, (_g.Logins = _f,\n _g)]))()])];\n case 6:\n _b = (_h.sent()).IdentityId, IdentityId = _b === void 0 ? throwOnMissingId() : _b;\n identityId = IdentityId;\n if (cacheKey) {\n Promise.resolve(cache.setItem(cacheKey, identityId)).catch(function () { });\n }\n _h.label = 7;\n case 7:\n provider = fromCognitoIdentity({\n client: client,\n customRoleArn: customRoleArn,\n logins: logins,\n identityId: identityId,\n });\n return [2 /*return*/, provider()];\n }\n });\n }); };\n return function () {\n return provider().catch(function (err) { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n if (cacheKey) {\n Promise.resolve(cache.removeItem(cacheKey)).catch(function () { });\n }\n throw err;\n });\n }); });\n };\n}\nfunction throwOnMissingId() {\n throw new ProviderError(\"Response from Amazon Cognito contained no identity ID\");\n}\n//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZnJvbUNvZ25pdG9JZGVudGl0eVBvb2wuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZnJvbUNvZ25pdG9JZGVudGl0eVBvb2wudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBLE9BQU8sRUFBRSxZQUFZLEVBQUUsTUFBTSxrQ0FBa0MsQ0FBQztBQUNoRSxPQUFPLEVBQUUsYUFBYSxFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFJM0QsT0FBTyxFQUFFLG1CQUFtQixFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFDNUQsT0FBTyxFQUFFLFlBQVksRUFBRSxNQUFNLGdCQUFnQixDQUFDO0FBQzlDLE9BQU8sRUFBRSxhQUFhLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUdoRDs7Ozs7OztHQU9HO0FBQ0gsTUFBTSxVQUFVLHVCQUF1QixDQUFDLEVBUUo7SUFScEMsaUJBNkNDO1FBNUNDLFNBQVMsZUFBQSxFQUNULGFBQXNCLEVBQXRCLEtBQUssbUJB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V2ZXIge1xuICB0aHJvdyBuZXcgUHJvdmlkZXJFcnJvcihcIlJlc3BvbnNlIGZyb20gQW1hem9uIENvZ25pdG8gY29udGFpbmVkIG5vIGlkZW50aXR5IElEXCIpO1xufVxuIl19","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { __assign } from \"tslib\";\nimport { CognitoIdentityClient, } from '@aws-sdk/client-cognito-identity';\nimport { getAmplifyUserAgent } from '../Platform';\n/**\n * Returns a CognitoIdentityClient with middleware\n * @param {CognitoIdentityClientConfig} config\n * @return {CognitoIdentityClient}\n */\nexport function createCognitoIdentityClient(config) {\n var client = new CognitoIdentityClient({\n region: config.region,\n customUserAgent: getAmplifyUserAgent(),\n });\n client.middlewareStack.add(function (next, _) { return function (args) {\n return next(middlewareArgs(args));\n }; }, {\n step: 'build',\n name: 'cacheControlMiddleWare',\n });\n return client;\n}\nexport function middlewareArgs(args) {\n return __assign(__assign({}, args), { request: __assign(__assign({}, args.request), { headers: __assign(__assign({}, args.request.headers), { 'cache-control': 'no-store' }) }) });\n}\n//# sourceMappingURL=CognitoIdentityClient.js.map","import { __assign, __awaiter, __generator } from \"tslib\";\nimport { ConsoleLogger as Logger } from './Logger';\nimport { StorageHelper } from './StorageHelper';\nimport { makeQuerablePromise } from './JS';\nimport { FacebookOAuth, GoogleOAuth } from './OAuthHelper';\nimport { jitteredExponentialRetry } from './Util';\nimport { Amplify } from './Amplify';\nimport { fromCognitoIdentity, fromCognitoIdentityPool, } from '@aws-sdk/credential-provider-cognito-identity';\nimport { GetIdCommand, GetCredentialsForIdentityCommand, } from '@aws-sdk/client-cognito-identity';\nimport { parseAWSExports } from './parseAWSExports';\nimport { Hub } from './Hub';\nimport { createCognitoIdentityClient } from './Util/CognitoIdentityClient';\nvar logger = new Logger('Credentials');\nvar CREDENTIALS_TTL = 50 * 60 * 1000; // 50 min, can be modified on config if required in the future\nvar COGNITO_IDENTITY_KEY_PREFIX = 'CognitoIdentityId-';\nvar AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'\n ? Symbol.for('amplify_default')\n : '@@amplify_default');\nvar dispatchCredentialsEvent = function (event, data, message) {\n Hub.dispatch('core', { event: event, data: data, message: message }, 'Credentials', AMPLIFY_SYMBOL);\n};\nvar CredentialsClass = /** @class */ (function () {\n function CredentialsClass(config) {\n this._gettingCredPromise = null;\n this._refreshHandlers = {};\n // Allow `Auth` to be injected for SSR, but Auth isn't a required dependency for Credentials\n this.Auth = undefined;\n this.configure(config);\n this._refreshHandlers['google'] = GoogleOAuth.refreshGoogleToken;\n this._refreshHandlers['facebook'] = FacebookOAuth.refreshFacebookToken;\n }\n CredentialsClass.prototype.getModuleName = function () {\n return 'Credentials';\n };\n CredentialsClass.prototype.getCredSource = function () {\n return this._credentials_source;\n };\n CredentialsClass.prototype.configure = function (config) {\n if (!config)\n return this._config || {};\n this._config = Object.assign({}, this._config, config);\n var refreshHandlers = this._config.refreshHandlers;\n // If the developer has provided an object of refresh handlers,\n // then we can merge the provided handlers with the current handlers.\n if (refreshHandlers) {\n this._refreshHandlers = __assign(__assign({}, this._refreshHandlers), refreshHandlers);\n }\n this._storage = this._config.storage;\n if (!this._storage) {\n this._storage = new StorageHelper().getStorage();\n }\n this._storageSync = Promise.resolve();\n if (typeof this._storage['sync'] === 'function') {\n this._storageSync = this._storage['sync']();\n }\n dispatchCredentialsEvent('credentials_configured', null, \"Credentials has been configured successfully\");\n return this._config;\n };\n CredentialsClass.prototype.get = function () {\n logger.debug('getting credentials');\n return this._pickupCredentials();\n };\n // currently we only store the guest identity in local storage\n CredentialsClass.prototype._getCognitoIdentityIdStorageKey = function (identityPoolId) {\n return \"\" + COGNITO_IDENTITY_KEY_PREFIX + identityPoolId;\n };\n CredentialsClass.prototype._pickupCredentials = function () {\n logger.debug('picking up credentials');\n if (!this._gettingCredPromise || !this._gettingCredPromise.isPending()) {\n logger.debug('getting new cred promise');\n this._gettingCredPromise = makeQuerablePromise(this._keepAlive());\n }\n else {\n logger.debug('getting old cred promise');\n }\n return this._gettingCredPromise;\n };\n CredentialsClass.prototype._keepAlive = function () {\n return __awaiter(this, void 0, void 0, function () {\n var cred, _a, Auth, user_1, session, refreshToken_1, refreshRequest, err_1;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n logger.debug('checking if credentials exists and not expired');\n cred = this._credentials;\n if (cred && !this._isExpired(cred) && !this._isPastTTL()) {\n logger.debug('credentials not changed and not expired, directly return');\n return [2 /*return*/, Promise.resolve(cred)];\n }\n logger.debug('need to get a new credential or refresh the existing one');\n _a = this.Auth, Auth = _a === void 0 ? Amplify.Auth : _a;\n if (!Auth || typeof Auth.currentUserCredentials !== 'function') {\n // If Auth module is not imported, do a best effort to get guest credentials\n return [2 /*return*/, this._setCredentialsForGuest()];\n }\n if (!(!this._isExpired(cred) && this._isPastTTL())) return [3 /*break*/, 6];\n logger.debug('ttl has passed but token is not yet expired');\n _b.label = 1;\n case 1:\n _b.trys.push([1, 5, , 6]);\n return [4 /*yield*/, Auth.currentUserPoolUser()];\n case 2:\n user_1 = _b.sent();\n return [4 /*yield*/, Auth.currentSession()];\n case 3:\n session = _b.sent();\n refreshToken_1 = session.refreshToken;\n refreshRequest = new Promise(function (res, rej) {\n user_1.refreshSession(refreshToken_1, function (err, data) {\n return err ? rej(err) : res(data);\n });\n });\n return [4 /*yield*/, refreshRequest];\n case 4:\n _b.sent(); // note that rejections will be caught and handled in the catch block.\n return [3 /*break*/, 6];\n case 5:\n err_1 = _b.sent();\n // should not throw because user might just be on guest access or is authenticated through federation\n logger.debug('Error attempting to refreshing the session', err_1);\n return [3 /*break*/, 6];\n case 6: return [2 /*return*/, Auth.currentUserCredentials()];\n }\n });\n });\n };\n CredentialsClass.prototype.refreshFederatedToken = function (federatedInfo) {\n logger.debug('Getting federated credentials');\n var provider = federatedInfo.provider, user = federatedInfo.user, token = federatedInfo.token, identity_id = federatedInfo.identity_id;\n var expires_at = federatedInfo.expires_at;\n // Make sure expires_at is in millis\n expires_at =\n new Date(expires_at).getFullYear() === 1970\n ? expires_at * 1000\n : expires_at;\n var that = this;\n logger.debug('checking if federated jwt token expired');\n if (expires_at > new Date().getTime()) {\n // if not expired\n logger.debug('token not expired');\n return this._setCredentialsFromFederation({\n provider: provider,\n token: token,\n user: user,\n identity_id: identity_id,\n expires_at: expires_at,\n });\n }\n else {\n // if refresh handler exists\n if (that._refreshHandlers[provider] &&\n typeof that._refreshHandlers[provider] === 'function') {\n logger.debug('getting refreshed jwt token from federation provider');\n return this._providerRefreshWithRetry({\n refreshHandler: that._refreshHandlers[provider],\n provider: provider,\n user: user,\n });\n }\n else {\n logger.debug('no refresh handler for provider:', provider);\n this.clear();\n return Promise.reject('no refresh handler for provider');\n }\n }\n };\n CredentialsClass.prototype._providerRefreshWithRetry = function (_a) {\n var _this = this;\n var refreshHandler = _a.refreshHandler, provider = _a.provider, user = _a.user;\n var MAX_DELAY_MS = 10 * 1000;\n // refreshHandler will retry network errors, otherwise it will\n // return NonRetryableError to break out of jitteredExponentialRetry\n return jitteredExponentialRetry(refreshHandler, [], MAX_DELAY_MS)\n .then(function (data) {\n logger.debug('refresh federated token sucessfully', data);\n return _this._setCredentialsFromFederation({\n provider: provider,\n token: data.token,\n user: user,\n identity_id: data.identity_id,\n expires_at: data.expires_at,\n });\n })\n .catch(function (e) {\n var isNetworkError = typeof e === 'string' &&\n e.toLowerCase().lastIndexOf('network error', e.length) === 0;\n if (!isNetworkError) {\n _this.clear();\n }\n logger.debug('refresh federated token failed', e);\n return Promise.reject('refreshing federation token failed: ' + e);\n });\n };\n CredentialsClass.prototype._isExpired = function (credentials) {\n if (!credentials) {\n logger.debug('no credentials for expiration check');\n return true;\n }\n logger.debug('are these credentials expired?', credentials);\n var ts = Date.now();\n /* returns date object.\n https://github.com/aws/aws-sdk-js-v3/blob/v1.0.0-beta.1/packages/types/src/credentials.ts#L26\n */\n var expiration = credentials.expiration;\n return expiration.getTime() <= ts;\n };\n CredentialsClass.prototype._isPastTTL = function () {\n return this._nextCredentialsRefresh <= Date.now();\n };\n CredentialsClass.prototype._setCredentialsForGuest = function () {\n var _a;\n return __awaiter(this, void 0, void 0, function () {\n var _b, identityPoolId, region, mandatorySignIn, identityPoolRegion, identityId, _c, cognitoClient, credentials, cognitoIdentityParams, credentialsProvider;\n var _this = this;\n return __generator(this, function (_d) {\n switch (_d.label) {\n case 0:\n logger.debug('setting credentials for guest');\n if (!((_a = this._config) === null || _a === void 0 ? void 0 : _a.identityPoolId)) {\n // If Credentials are not configured thru Auth module,\n // doing best effort to check if the library was configured\n this._config = Object.assign({}, this._config, parseAWSExports(this._config || {}).Auth);\n }\n _b = this._config, identityPoolId = _b.identityPoolId, region = _b.region, mandatorySignIn = _b.mandatorySignIn, identityPoolRegion = _b.identityPoolRegion;\n if (mandatorySignIn) {\n return [2 /*return*/, Promise.reject('cannot get guest credentials when mandatory signin enabled')];\n }\n if (!identityPoolId) {\n logger.debug('No Cognito Identity pool provided for unauthenticated access');\n return [2 /*return*/, Promise.reject('No Cognito Identity pool provided for unauthenticated access')];\n }\n if (!identityPoolRegion && !region) {\n logger.debug('region is not configured for getting the credentials');\n return [2 /*return*/, Promise.reject('region is not configured for getting the credentials')];\n }\n _c = this;\n return [4 /*yield*/, this._getGuestIdentityId()];\n case 1:\n identityId = (_c._identityId = _d.sent());\n cognitoClient = createCognitoIdentityClient({\n region: identityPoolRegion || region,\n });\n credentials = undefined;\n if (identityId) {\n cognitoIdentityParams = {\n identityId: identityId,\n client: cognitoClient,\n };\n credentials = fromCognitoIdentity(cognitoIdentityParams)();\n }\n else {\n credentialsProvider = function () { return __awaiter(_this, void 0, void 0, function () {\n var IdentityId, cognitoIdentityParams, credentialsFromCognitoIdentity;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, cognitoClient.send(new GetIdCommand({\n IdentityPoolId: identityPoolId,\n }))];\n case 1:\n IdentityId = (_a.sent()).IdentityId;\n this._identityId = IdentityId;\n cognitoIdentityParams = {\n client: cognitoClient,\n identityId: IdentityId,\n };\n credentialsFromCognitoIdentity = fromCognitoIdentity(cognitoIdentityParams);\n return [2 /*return*/, credentialsFromCognitoIdentity()];\n }\n });\n }); };\n credentials = credentialsProvider().catch(function (err) { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw err;\n });\n }); });\n }\n return [2 /*return*/, this._loadCredentials(credentials, 'guest', false, null)\n .then(function (res) {\n return res;\n })\n .catch(function (e) { return __awaiter(_this, void 0, void 0, function () {\n var credentialsProvider;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(e.name === 'ResourceNotFoundException' &&\n e.message === \"Identity '\" + identityId + \"' not found.\")) return [3 /*break*/, 2];\n logger.debug('Failed to load guest credentials');\n return [4 /*yield*/, this._removeGuestIdentityId()];\n case 1:\n _a.sent();\n credentialsProvider = function () { return __awaiter(_this, void 0, void 0, function () {\n var IdentityId, cognitoIdentityParams, credentialsFromCognitoIdentity;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, cognitoClient.send(new GetIdCommand({\n IdentityPoolId: identityPoolId,\n }))];\n case 1:\n IdentityId = (_a.sent()).IdentityId;\n this._identityId = IdentityId;\n cognitoIdentityParams = {\n client: cognitoClient,\n identityId: IdentityId,\n };\n credentialsFromCognitoIdentity = fromCognitoIdentity(cognitoIdentityParams);\n return [2 /*return*/, credentialsFromCognitoIdentity()];\n }\n });\n }); };\n credentials = credentialsProvider().catch(function (err) { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw err;\n });\n }); });\n return [2 /*return*/, this._loadCredentials(credentials, 'guest', false, null)];\n case 2: return [2 /*return*/, e];\n }\n });\n }); })];\n }\n });\n });\n };\n CredentialsClass.prototype._setCredentialsFromFederation = function (params) {\n var provider = params.provider, token = params.token, identity_id = params.identity_id;\n var domains = {\n google: 'accounts.google.com',\n facebook: 'graph.facebook.com',\n amazon: 'www.amazon.com',\n developer: 'cognito-identity.amazonaws.com',\n };\n // Use custom provider url instead of the predefined ones\n var domain = domains[provider] || provider;\n if (!domain) {\n return Promise.reject('You must specify a federated provider');\n }\n var logins = {};\n logins[domain] = token;\n var _a = this._config, identityPoolId = _a.identityPoolId, region = _a.region, identityPoolRegion = _a.identityPoolRegion;\n if (!identityPoolId) {\n logger.debug('No Cognito Federated Identity pool provided');\n return Promise.reject('No Cognito Federated Identity pool provided');\n }\n if (!identityPoolRegion && !region) {\n logger.debug('region is not configured for getting the credentials');\n return Promise.reject('region is not configured for getting the credentials');\n }\n var cognitoClient = createCognitoIdentityClient({\n region: identityPoolRegion || region,\n });\n var credentials = undefined;\n if (identity_id) {\n var cognitoIdentityParams = {\n identityId: identity_id,\n logins: logins,\n client: cognitoClient,\n };\n credentials = fromCognitoIdentity(cognitoIdentityParams)();\n }\n else {\n var cognitoIdentityParams = {\n logins: logins,\n identityPoolId: identityPoolId,\n client: cognitoClient,\n };\n credentials = fromCognitoIdentityPool(cognitoIdentityParams)();\n }\n return this._loadCredentials(credentials, 'federated', true, params);\n };\n CredentialsClass.prototype._setCredentialsFromSession = function (session) {\n var _this = this;\n logger.debug('set credentials from session');\n var idToken = session.getIdToken().getJwtToken();\n var _a = this._config, region = _a.region, userPoolId = _a.userPoolId, identityPoolId = _a.identityPoolId, identityPoolRegion = _a.identityPoolRegion;\n if (!identityPoolId) {\n logger.debug('No Cognito Federated Identity pool provided');\n return Promise.reject('No Cognito Federated Identity pool provided');\n }\n if (!identityPoolRegion && !region) {\n logger.debug('region is not configured for getting the credentials');\n return Promise.reject('region is not configured for getting the credentials');\n }\n var key = 'cognito-idp.' + region + '.amazonaws.com/' + userPoolId;\n var logins = {};\n logins[key] = idToken;\n var cognitoClient = createCognitoIdentityClient({\n region: identityPoolRegion || region,\n });\n /*\n Retreiving identityId with GetIdCommand to mimic the behavior in the following code in aws-sdk-v3:\n https://git.io/JeDxU\n\n Note: Retreive identityId from CredentialsProvider once aws-sdk-js v3 supports this.\n */\n var credentialsProvider = function () { return __awaiter(_this, void 0, void 0, function () {\n var guestIdentityId, generatedOrRetrievedIdentityId, IdentityId, _a, _b, AccessKeyId, Expiration, SecretKey, SessionToken, primaryIdentityId;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0: return [4 /*yield*/, this._getGuestIdentityId()];\n case 1:\n guestIdentityId = _c.sent();\n if (!!guestIdentityId) return [3 /*break*/, 3];\n return [4 /*yield*/, cognitoClient.send(new GetIdCommand({\n IdentityPoolId: identityPoolId,\n Logins: logins,\n }))];\n case 2:\n IdentityId = (_c.sent()).IdentityId;\n generatedOrRetrievedIdentityId = IdentityId;\n _c.label = 3;\n case 3: return [4 /*yield*/, cognitoClient.send(new GetCredentialsForIdentityCommand({\n IdentityId: guestIdentityId || generatedOrRetrievedIdentityId,\n Logins: logins,\n }))];\n case 4:\n _a = _c.sent(), _b = _a.Credentials, AccessKeyId = _b.AccessKeyId, Expiration = _b.Expiration, SecretKey = _b.SecretKey, SessionToken = _b.SessionToken, primaryIdentityId = _a.IdentityId;\n this._identityId = primaryIdentityId;\n if (!guestIdentityId) return [3 /*break*/, 6];\n // if guestIdentity is found and used by GetCredentialsForIdentity\n // it will be linked to the logins provided, and disqualified as an unauth identity\n logger.debug(\"The guest identity \" + guestIdentityId + \" has been successfully linked to the logins\");\n if (guestIdentityId === primaryIdentityId) {\n logger.debug(\"The guest identity \" + guestIdentityId + \" has become the primary identity\");\n }\n // remove it from local storage to avoid being used as a guest Identity by _setCredentialsForGuest\n return [4 /*yield*/, this._removeGuestIdentityId()];\n case 5:\n // remove it from local storage to avoid being used as a guest Identity by _setCredentialsForGuest\n _c.sent();\n _c.label = 6;\n case 6: \n // https://github.com/aws/aws-sdk-js-v3/blob/main/packages/credential-provider-cognito-identity/src/fromCognitoIdentity.ts#L40\n return [2 /*return*/, {\n accessKeyId: AccessKeyId,\n secretAccessKey: SecretKey,\n sessionToken: SessionToken,\n expiration: Expiration,\n identityId: primaryIdentityId,\n }];\n }\n });\n }); };\n var credentials = credentialsProvider().catch(function (err) { return __awaiter(_this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n throw err;\n });\n }); });\n return this._loadCredentials(credentials, 'userPool', true, null);\n };\n CredentialsClass.prototype._loadCredentials = function (credentials, source, authenticated, info) {\n var _this = this;\n var that = this;\n return new Promise(function (res, rej) {\n credentials\n .then(function (credentials) { return __awaiter(_this, void 0, void 0, function () {\n var user, provider, token, expires_at, identity_id;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n logger.debug('Load credentials successfully', credentials);\n if (this._identityId && !credentials.identityId) {\n credentials['identityId'] = this._identityId;\n }\n that._credentials = credentials;\n that._credentials.authenticated = authenticated;\n that._credentials_source = source;\n that._nextCredentialsRefresh = new Date().getTime() + CREDENTIALS_TTL;\n if (source === 'federated') {\n user = Object.assign({ id: this._credentials.identityId }, info.user);\n provider = info.provider, token = info.token, expires_at = info.expires_at, identity_id = info.identity_id;\n try {\n this._storage.setItem('aws-amplify-federatedInfo', JSON.stringify({\n provider: provider,\n token: token,\n user: user,\n expires_at: expires_at,\n identity_id: identity_id,\n }));\n }\n catch (e) {\n logger.debug('Failed to put federated info into auth storage', e);\n }\n }\n if (!(source === 'guest')) return [3 /*break*/, 2];\n return [4 /*yield*/, this._setGuestIdentityId(credentials.identityId)];\n case 1:\n _a.sent();\n _a.label = 2;\n case 2:\n res(that._credentials);\n return [2 /*return*/];\n }\n });\n }); })\n .catch(function (err) {\n if (err) {\n logger.debug('Failed to load credentials', credentials);\n logger.debug('Error loading credentials', err);\n rej(err);\n return;\n }\n });\n });\n };\n CredentialsClass.prototype.set = function (params, source) {\n if (source === 'session') {\n return this._setCredentialsFromSession(params);\n }\n else if (source === 'federation') {\n return this._setCredentialsFromFederation(params);\n }\n else if (source === 'guest') {\n return this._setCredentialsForGuest();\n }\n else {\n logger.debug('no source specified for setting credentials');\n return Promise.reject('invalid source');\n }\n };\n CredentialsClass.prototype.clear = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n this._credentials = null;\n this._credentials_source = null;\n logger.debug('removing aws-amplify-federatedInfo from storage');\n this._storage.removeItem('aws-amplify-federatedInfo');\n return [2 /*return*/];\n });\n });\n };\n /* operations on local stored guest identity */\n CredentialsClass.prototype._getGuestIdentityId = function () {\n return __awaiter(this, void 0, void 0, function () {\n var identityPoolId, e_1;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n identityPoolId = this._config.identityPoolId;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this._storageSync];\n case 2:\n _a.sent();\n return [2 /*return*/, this._storage.getItem(this._getCognitoIdentityIdStorageKey(identityPoolId))];\n case 3:\n e_1 = _a.sent();\n logger.debug('Failed to get the cached guest identityId', e_1);\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n CredentialsClass.prototype._setGuestIdentityId = function (identityId) {\n return __awaiter(this, void 0, void 0, function () {\n var identityPoolId, e_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n identityPoolId = this._config.identityPoolId;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this._storageSync];\n case 2:\n _a.sent();\n this._storage.setItem(this._getCognitoIdentityIdStorageKey(identityPoolId), identityId);\n return [3 /*break*/, 4];\n case 3:\n e_2 = _a.sent();\n logger.debug('Failed to cache guest identityId', e_2);\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n CredentialsClass.prototype._removeGuestIdentityId = function () {\n return __awaiter(this, void 0, void 0, function () {\n var identityPoolId;\n return __generator(this, function (_a) {\n identityPoolId = this._config.identityPoolId;\n logger.debug(\"removing \" + this._getCognitoIdentityIdStorageKey(identityPoolId) + \" from storage\");\n this._storage.removeItem(this._getCognitoIdentityIdStorageKey(identityPoolId));\n return [2 /*return*/];\n });\n });\n };\n /**\n * Compact version of credentials\n * @param {Object} credentials\n * @return {Object} - Credentials\n */\n CredentialsClass.prototype.shear = function (credentials) {\n return {\n accessKeyId: credentials.accessKeyId,\n sessionToken: credentials.sessionToken,\n secretAccessKey: credentials.secretAccessKey,\n identityId: credentials.identityId,\n authenticated: credentials.authenticated,\n };\n };\n return CredentialsClass;\n}());\nexport { CredentialsClass };\nexport var Credentials = new CredentialsClass(null);\nAmplify.register(Credentials);\n//# sourceMappingURL=Credentials.js.map","/*!\n * cookie\n * Copyright(c) 2012-2014 Roman Shtylman\n * Copyright(c) 2015 Douglas Christopher Wilson\n * MIT Licensed\n */\n\n'use strict';\n\n/**\n * Module exports.\n * @public\n */\n\nexports.parse = parse;\nexports.serialize = serialize;\n\n/**\n * Module variables.\n * @private\n */\n\nvar decode = decodeURIComponent;\nvar encode = encodeURIComponent;\n\n/**\n * RegExp to match field-content in RFC 7230 sec 3.2\n *\n * field-content = field-vchar [ 1*( SP / HTAB ) field-vchar ]\n * field-vchar = VCHAR / obs-text\n * obs-text = %x80-FF\n */\n\nvar fieldContentRegExp = /^[\\u0009\\u0020-\\u007e\\u0080-\\u00ff]+$/;\n\n/**\n * Parse a cookie header.\n *\n * Parse the given cookie header string into an object\n * The object has the various cookies as keys(names) => values\n *\n * @param {string} str\n * @param {object} [options]\n * @return {object}\n * @public\n */\n\nfunction parse(str, options) {\n if (typeof str !== 'string') {\n throw new TypeError('argument str must be a string');\n }\n\n var obj = {}\n var opt = options || {};\n var pairs = str.split(';')\n var dec = opt.decode || decode;\n\n for (var i = 0; i < pairs.length; i++) {\n var pair = pairs[i];\n var index = pair.indexOf('=')\n\n // skip things that don't look like key=value\n if (index < 0) {\n continue;\n }\n\n var key = pair.substring(0, index).trim()\n\n // only assign once\n if (undefined == obj[key]) {\n var val = pair.substring(index + 1, pair.length).trim()\n\n // quoted values\n if (val[0] === '\"') {\n val = val.slice(1, -1)\n }\n\n obj[key] = tryDecode(val, dec);\n }\n }\n\n return obj;\n}\n\n/**\n * Serialize data into a cookie header.\n *\n * Serialize the a name value pair into a cookie string suitable for\n * http headers. An optional options object specified cookie parameters.\n *\n * serialize('foo', 'bar', { httpOnly: true })\n * => \"foo=bar; httpOnly\"\n *\n * @param {string} name\n * @param {string} val\n * @param {object} [options]\n * @return {string}\n * @public\n */\n\nfunction serialize(name, val, options) {\n var opt = options || {};\n var enc = opt.encode || encode;\n\n if (typeof enc !== 'function') {\n throw new TypeError('option encode is invalid');\n }\n\n if (!fieldContentRegExp.test(name)) {\n throw new TypeError('argument name is invalid');\n }\n\n var value = enc(val);\n\n if (value && !fieldContentRegExp.test(value)) {\n throw new TypeError('argument val is invalid');\n }\n\n var str = name + '=' + value;\n\n if (null != opt.maxAge) {\n var maxAge = opt.maxAge - 0;\n\n if (isNaN(maxAge) || !isFinite(maxAge)) {\n throw new TypeError('option maxAge is invalid')\n }\n\n str += '; Max-Age=' + Math.floor(maxAge);\n }\n\n if (opt.domain) {\n if (!fieldContentRegExp.test(opt.domain)) {\n throw new TypeError('option domain is invalid');\n }\n\n str += '; Domain=' + opt.domain;\n }\n\n if (opt.path) {\n if (!fieldContentRegExp.test(opt.path)) {\n throw new TypeError('option path is invalid');\n }\n\n str += '; Path=' + opt.path;\n }\n\n if (opt.expires) {\n if (typeof opt.expires.toUTCString !== 'function') {\n throw new TypeError('option expires is invalid');\n }\n\n str += '; Expires=' + opt.expires.toUTCString();\n }\n\n if (opt.httpOnly) {\n str += '; HttpOnly';\n }\n\n if (opt.secure) {\n str += '; Secure';\n }\n\n if (opt.sameSite) {\n var sameSite = typeof opt.sameSite === 'string'\n ? opt.sameSite.toLowerCase() : opt.sameSite;\n\n switch (sameSite) {\n case true:\n str += '; SameSite=Strict';\n break;\n case 'lax':\n str += '; SameSite=Lax';\n break;\n case 'strict':\n str += '; SameSite=Strict';\n break;\n case 'none':\n str += '; SameSite=None';\n break;\n default:\n throw new TypeError('option sameSite is invalid');\n }\n }\n\n return str;\n}\n\n/**\n * Try decoding a string using a decoding function.\n *\n * @param {string} str\n * @param {function} decode\n * @private\n */\n\nfunction tryDecode(str, decode) {\n try {\n return decode(str);\n } catch (e) {\n return str;\n }\n}\n","import * as cookie from 'cookie';\r\nexport function hasDocumentCookie() {\r\n // Can we get/set cookies on document.cookie?\r\n return typeof document === 'object' && typeof document.cookie === 'string';\r\n}\r\nexport function cleanCookies() {\r\n document.cookie.split(';').forEach(function (c) {\r\n document.cookie = c\r\n .replace(/^ +/, '')\r\n .replace(/=.*/, '=;expires=' + new Date().toUTCString() + ';path=/');\r\n });\r\n}\r\nexport function parseCookies(cookies, options) {\r\n if (typeof cookies === 'string') {\r\n return cookie.parse(cookies, options);\r\n }\r\n else if (typeof cookies === 'object' && cookies !== null) {\r\n return cookies;\r\n }\r\n else {\r\n return {};\r\n }\r\n}\r\nexport function isParsingCookie(value, doNotParse) {\r\n if (typeof doNotParse === 'undefined') {\r\n // We guess if the cookie start with { or [, it has been serialized\r\n doNotParse =\r\n !value || (value[0] !== '{' && value[0] !== '[' && value[0] !== '\"');\r\n }\r\n return !doNotParse;\r\n}\r\nexport function readCookie(value, options) {\r\n if (options === void 0) { options = {}; }\r\n var cleanValue = cleanupCookieValue(value);\r\n if (isParsingCookie(cleanValue, options.doNotParse)) {\r\n try {\r\n return JSON.parse(cleanValue);\r\n }\r\n catch (e) {\r\n // At least we tried\r\n }\r\n }\r\n // Ignore clean value if we failed the deserialization\r\n // It is not relevant anymore to trim those values\r\n return value;\r\n}\r\nfunction cleanupCookieValue(value) {\r\n // express prepend j: before serializing a cookie\r\n if (value && value[0] === 'j' && value[1] === ':') {\r\n return value.substr(2);\r\n }\r\n return value;\r\n}\r\n","var __assign = (this && this.__assign) || function () {\r\n __assign = Object.assign || function(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))\r\n t[p] = s[p];\r\n }\r\n return t;\r\n };\r\n return __assign.apply(this, arguments);\r\n};\r\nimport * as cookie from 'cookie';\r\nimport { hasDocumentCookie, parseCookies, readCookie } from './utils';\r\nvar Cookies = /** @class */ (function () {\r\n function Cookies(cookies, options) {\r\n var _this = this;\r\n this.changeListeners = [];\r\n this.HAS_DOCUMENT_COOKIE = false;\r\n this.cookies = parseCookies(cookies, options);\r\n new Promise(function () {\r\n _this.HAS_DOCUMENT_COOKIE = hasDocumentCookie();\r\n }).catch(function () { });\r\n }\r\n Cookies.prototype._updateBrowserValues = function (parseOptions) {\r\n if (!this.HAS_DOCUMENT_COOKIE) {\r\n return;\r\n }\r\n this.cookies = cookie.parse(document.cookie, parseOptions);\r\n };\r\n Cookies.prototype._emitChange = function (params) {\r\n for (var i = 0; i < this.changeListeners.length; ++i) {\r\n this.changeListeners[i](params);\r\n }\r\n };\r\n Cookies.prototype.get = function (name, options, parseOptions) {\r\n if (options === void 0) { options = {}; }\r\n this._updateBrowserValues(parseOptions);\r\n return readCookie(this.cookies[name], options);\r\n };\r\n Cookies.prototype.getAll = function (options, parseOptions) {\r\n if (options === void 0) { options = {}; }\r\n this._updateBrowserValues(parseOptions);\r\n var result = {};\r\n for (var name_1 in this.cookies) {\r\n result[name_1] = readCookie(this.cookies[name_1], options);\r\n }\r\n return result;\r\n };\r\n Cookies.prototype.set = function (name, value, options) {\r\n var _a;\r\n if (typeof value === 'object') {\r\n value = JSON.stringify(value);\r\n }\r\n this.cookies = __assign(__assign({}, this.cookies), (_a = {}, _a[name] = value, _a));\r\n if (this.HAS_DOCUMENT_COOKIE) {\r\n document.cookie = cookie.serialize(name, value, options);\r\n }\r\n this._emitChange({ name: name, value: value, options: options });\r\n };\r\n Cookies.prototype.remove = function (name, options) {\r\n var finalOptions = (options = __assign(__assign({}, options), { expires: new Date(1970, 1, 1, 0, 0, 1), maxAge: 0 }));\r\n this.cookies = __assign({}, this.cookies);\r\n delete this.cookies[name];\r\n if (this.HAS_DOCUMENT_COOKIE) {\r\n document.cookie = cookie.serialize(name, '', finalOptions);\r\n }\r\n this._emitChange({ name: name, value: undefined, options: options });\r\n };\r\n Cookies.prototype.addChangeListener = function (callback) {\r\n this.changeListeners.push(callback);\r\n };\r\n Cookies.prototype.removeChangeListener = function (callback) {\r\n var idx = this.changeListeners.indexOf(callback);\r\n if (idx >= 0) {\r\n this.changeListeners.splice(idx, 1);\r\n }\r\n };\r\n return Cookies;\r\n}());\r\nexport default Cookies;\r\n","import { __assign } from \"tslib\";\nimport Cookies from 'universal-cookie';\nimport { browserOrNode } from '../JS';\nvar isBrowser = browserOrNode().isBrowser;\nvar ONE_YEAR_IN_MS = 365 * 24 * 60 * 60 * 1000;\nvar UniversalStorage = /** @class */ (function () {\n function UniversalStorage(context) {\n if (context === void 0) { context = {}; }\n this.cookies = new Cookies();\n this.store = isBrowser ? window.localStorage : Object.create(null);\n this.cookies = context.req\n ? new Cookies(context.req.headers.cookie)\n : new Cookies();\n Object.assign(this.store, this.cookies.getAll());\n }\n Object.defineProperty(UniversalStorage.prototype, \"length\", {\n get: function () {\n return Object.entries(this.store).length;\n },\n enumerable: true,\n configurable: true\n });\n UniversalStorage.prototype.clear = function () {\n var _this = this;\n Array.from(new Array(this.length))\n .map(function (_, i) { return _this.key(i); })\n .forEach(function (key) { return _this.removeItem(key); });\n };\n UniversalStorage.prototype.getItem = function (key) {\n return this.getLocalItem(key);\n };\n UniversalStorage.prototype.getLocalItem = function (key) {\n return Object.prototype.hasOwnProperty.call(this.store, key)\n ? this.store[key]\n : null;\n };\n UniversalStorage.prototype.getUniversalItem = function (key) {\n return this.cookies.get(key);\n };\n UniversalStorage.prototype.key = function (index) {\n return Object.keys(this.store)[index];\n };\n UniversalStorage.prototype.removeItem = function (key) {\n this.removeLocalItem(key);\n this.removeUniversalItem(key);\n };\n UniversalStorage.prototype.removeLocalItem = function (key) {\n delete this.store[key];\n };\n UniversalStorage.prototype.removeUniversalItem = function (key) {\n this.cookies.remove(key, {\n path: '/',\n });\n };\n UniversalStorage.prototype.setItem = function (key, value) {\n this.setLocalItem(key, value);\n // keys take the shape:\n // 1. `${ProviderPrefix}.${userPoolClientId}.${username}.${tokenType}\n // 2. `${ProviderPrefix}.${userPoolClientId}.LastAuthUser\n var tokenType = key.split('.').pop();\n var sessionTokenTypes = [\n 'LastAuthUser',\n 'accessToken',\n // refreshToken originates on the client, but SSR pages won't fail when this expires\n // Note: the new `accessToken` will also be refreshed on the client (since Amplify doesn't set server-side cookies)\n 'refreshToken',\n // Required for CognitoUserSession\n 'idToken',\n ];\n if (sessionTokenTypes.includes(tokenType !== null && tokenType !== void 0 ? tokenType : '')) {\n this.setUniversalItem(key, value, {\n expires: new Date(Date.now() + ONE_YEAR_IN_MS),\n });\n }\n };\n UniversalStorage.prototype.setLocalItem = function (key, value) {\n this.store[key] = value;\n };\n UniversalStorage.prototype.setUniversalItem = function (key, value, options) {\n if (options === void 0) { options = {}; }\n this.cookies.set(key, value, __assign(__assign({}, options), { path: '/', \n // `httpOnly` cannot be set via JavaScript: https://developer.mozilla.org/en-US/docs/Web/HTTP/Cookies#JavaScript_access_using_Document.cookie\n sameSite: true, \n // Allow unsecure requests to http://localhost:3000/ when in development.\n secure: isBrowser && window.location.hostname === 'localhost' ? false : true }));\n };\n return UniversalStorage;\n}());\nexport { UniversalStorage };\n//# sourceMappingURL=index.js.map","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/** @class */\nvar AuthenticationDetails = /*#__PURE__*/function () {\n /**\n * Constructs a new AuthenticationDetails object\n * @param {object=} data Creation options.\n * @param {string} data.Username User being authenticated.\n * @param {string} data.Password Plain-text password to authenticate with.\n * @param {(AttributeArg[])?} data.ValidationData Application extra metadata.\n * @param {(AttributeArg[])?} data.AuthParamaters Authentication paramaters for custom auth.\n */\n function AuthenticationDetails(data) {\n var _ref = data || {},\n ValidationData = _ref.ValidationData,\n Username = _ref.Username,\n Password = _ref.Password,\n AuthParameters = _ref.AuthParameters,\n ClientMetadata = _ref.ClientMetadata;\n this.validationData = ValidationData || {};\n this.authParameters = AuthParameters || {};\n this.clientMetadata = ClientMetadata || {};\n this.username = Username;\n this.password = Password;\n }\n\n /**\n * @returns {string} the record's username\n */\n var _proto = AuthenticationDetails.prototype;\n _proto.getUsername = function getUsername() {\n return this.username;\n }\n\n /**\n * @returns {string} the record's password\n */;\n _proto.getPassword = function getPassword() {\n return this.password;\n }\n\n /**\n * @returns {Array} the record's validationData\n */;\n _proto.getValidationData = function getValidationData() {\n return this.validationData;\n }\n\n /**\n * @returns {Array} the record's authParameters\n */;\n _proto.getAuthParameters = function getAuthParameters() {\n return this.authParameters;\n }\n\n /**\n * @returns {ClientMetadata} the clientMetadata for a Lambda trigger\n */;\n _proto.getClientMetadata = function getClientMetadata() {\n return this.clientMetadata;\n };\n return AuthenticationDetails;\n}();\nexport { AuthenticationDetails as default };","'use strict'\n\nexports.byteLength = byteLength\nexports.toByteArray = toByteArray\nexports.fromByteArray = fromByteArray\n\nvar lookup = []\nvar revLookup = []\nvar Arr = typeof Uint8Array !== 'undefined' ? Uint8Array : Array\n\nvar code = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'\nfor (var i = 0, len = code.length; i < len; ++i) {\n lookup[i] = code[i]\n revLookup[code.charCodeAt(i)] = i\n}\n\n// Support decoding URL-safe base64 strings, as Node.js does.\n// See: https://en.wikipedia.org/wiki/Base64#URL_applications\nrevLookup['-'.charCodeAt(0)] = 62\nrevLookup['_'.charCodeAt(0)] = 63\n\nfunction getLens (b64) {\n var len = b64.length\n\n if (len % 4 > 0) {\n throw new Error('Invalid string. Length must be a multiple of 4')\n }\n\n // Trim off extra bytes after placeholder bytes are found\n // See: https://github.com/beatgammit/base64-js/issues/42\n var validLen = b64.indexOf('=')\n if (validLen === -1) validLen = len\n\n var placeHoldersLen = validLen === len\n ? 0\n : 4 - (validLen % 4)\n\n return [validLen, placeHoldersLen]\n}\n\n// base64 is 4/3 + up to two characters of the original data\nfunction byteLength (b64) {\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction _byteLength (b64, validLen, placeHoldersLen) {\n return ((validLen + placeHoldersLen) * 3 / 4) - placeHoldersLen\n}\n\nfunction toByteArray (b64) {\n var tmp\n var lens = getLens(b64)\n var validLen = lens[0]\n var placeHoldersLen = lens[1]\n\n var arr = new Arr(_byteLength(b64, validLen, placeHoldersLen))\n\n var curByte = 0\n\n // if there are placeholders, only get up to the last complete 4 chars\n var len = placeHoldersLen > 0\n ? validLen - 4\n : validLen\n\n var i\n for (i = 0; i < len; i += 4) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 18) |\n (revLookup[b64.charCodeAt(i + 1)] << 12) |\n (revLookup[b64.charCodeAt(i + 2)] << 6) |\n revLookup[b64.charCodeAt(i + 3)]\n arr[curByte++] = (tmp >> 16) & 0xFF\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 2) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 2) |\n (revLookup[b64.charCodeAt(i + 1)] >> 4)\n arr[curByte++] = tmp & 0xFF\n }\n\n if (placeHoldersLen === 1) {\n tmp =\n (revLookup[b64.charCodeAt(i)] << 10) |\n (revLookup[b64.charCodeAt(i + 1)] << 4) |\n (revLookup[b64.charCodeAt(i + 2)] >> 2)\n arr[curByte++] = (tmp >> 8) & 0xFF\n arr[curByte++] = tmp & 0xFF\n }\n\n return arr\n}\n\nfunction tripletToBase64 (num) {\n return lookup[num >> 18 & 0x3F] +\n lookup[num >> 12 & 0x3F] +\n lookup[num >> 6 & 0x3F] +\n lookup[num & 0x3F]\n}\n\nfunction encodeChunk (uint8, start, end) {\n var tmp\n var output = []\n for (var i = start; i < end; i += 3) {\n tmp =\n ((uint8[i] << 16) & 0xFF0000) +\n ((uint8[i + 1] << 8) & 0xFF00) +\n (uint8[i + 2] & 0xFF)\n output.push(tripletToBase64(tmp))\n }\n return output.join('')\n}\n\nfunction fromByteArray (uint8) {\n var tmp\n var len = uint8.length\n var extraBytes = len % 3 // if we have 1 byte left, pad 2 bytes\n var parts = []\n var maxChunkLength = 16383 // must be multiple of 3\n\n // go through the array every three bytes, we'll deal with trailing stuff later\n for (var i = 0, len2 = len - extraBytes; i < len2; i += maxChunkLength) {\n parts.push(encodeChunk(uint8, i, (i + maxChunkLength) > len2 ? len2 : (i + maxChunkLength)))\n }\n\n // pad the end with zeros, but make sure to not forget the extra bytes\n if (extraBytes === 1) {\n tmp = uint8[len - 1]\n parts.push(\n lookup[tmp >> 2] +\n lookup[(tmp << 4) & 0x3F] +\n '=='\n )\n } else if (extraBytes === 2) {\n tmp = (uint8[len - 2] << 8) + uint8[len - 1]\n parts.push(\n lookup[tmp >> 10] +\n lookup[(tmp >> 4) & 0x3F] +\n lookup[(tmp << 2) & 0x3F] +\n '='\n )\n }\n\n return parts.join('')\n}\n","/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */\nexports.read = function (buffer, offset, isLE, mLen, nBytes) {\n var e, m\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var nBits = -7\n var i = isLE ? (nBytes - 1) : 0\n var d = isLE ? -1 : 1\n var s = buffer[offset + i]\n\n i += d\n\n e = s & ((1 << (-nBits)) - 1)\n s >>= (-nBits)\n nBits += eLen\n for (; nBits > 0; e = (e * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n m = e & ((1 << (-nBits)) - 1)\n e >>= (-nBits)\n nBits += mLen\n for (; nBits > 0; m = (m * 256) + buffer[offset + i], i += d, nBits -= 8) {}\n\n if (e === 0) {\n e = 1 - eBias\n } else if (e === eMax) {\n return m ? NaN : ((s ? -1 : 1) * Infinity)\n } else {\n m = m + Math.pow(2, mLen)\n e = e - eBias\n }\n return (s ? -1 : 1) * m * Math.pow(2, e - mLen)\n}\n\nexports.write = function (buffer, value, offset, isLE, mLen, nBytes) {\n var e, m, c\n var eLen = (nBytes * 8) - mLen - 1\n var eMax = (1 << eLen) - 1\n var eBias = eMax >> 1\n var rt = (mLen === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0)\n var i = isLE ? 0 : (nBytes - 1)\n var d = isLE ? 1 : -1\n var s = value < 0 || (value === 0 && 1 / value < 0) ? 1 : 0\n\n value = Math.abs(value)\n\n if (isNaN(value) || value === Infinity) {\n m = isNaN(value) ? 1 : 0\n e = eMax\n } else {\n e = Math.floor(Math.log(value) / Math.LN2)\n if (value * (c = Math.pow(2, -e)) < 1) {\n e--\n c *= 2\n }\n if (e + eBias >= 1) {\n value += rt / c\n } else {\n value += rt * Math.pow(2, 1 - eBias)\n }\n if (value * c >= 2) {\n e++\n c /= 2\n }\n\n if (e + eBias >= eMax) {\n m = 0\n e = eMax\n } else if (e + eBias >= 1) {\n m = ((value * c) - 1) * Math.pow(2, mLen)\n e = e + eBias\n } else {\n m = value * Math.pow(2, eBias - 1) * Math.pow(2, mLen)\n e = 0\n }\n }\n\n for (; mLen >= 8; buffer[offset + i] = m & 0xff, i += d, m /= 256, mLen -= 8) {}\n\n e = (e << mLen) | m\n eLen += mLen\n for (; eLen > 0; buffer[offset + i] = e & 0xff, i += d, e /= 256, eLen -= 8) {}\n\n buffer[offset + i - d] |= s * 128\n}\n","var toString = {}.toString;\n\nmodule.exports = Array.isArray || function (arr) {\n return toString.call(arr) == '[object Array]';\n};\n","/*!\n * The buffer module from node.js, for the browser.\n *\n * @author Feross Aboukhadijeh \n * @license MIT\n */\n/* eslint-disable no-proto */\n\n'use strict'\n\nvar base64 = require('base64-js')\nvar ieee754 = require('ieee754')\nvar isArray = require('isarray')\n\nexports.Buffer = Buffer\nexports.SlowBuffer = SlowBuffer\nexports.INSPECT_MAX_BYTES = 50\n\n/**\n * If `Buffer.TYPED_ARRAY_SUPPORT`:\n * === true Use Uint8Array implementation (fastest)\n * === false Use Object implementation (most compatible, even IE6)\n *\n * Browsers that support typed arrays are IE 10+, Firefox 4+, Chrome 7+, Safari 5.1+,\n * Opera 11.6+, iOS 4.2+.\n *\n * Due to various browser bugs, sometimes the Object implementation will be used even\n * when the browser supports typed arrays.\n *\n * Note:\n *\n * - Firefox 4-29 lacks support for adding new properties to `Uint8Array` instances,\n * See: https://bugzilla.mozilla.org/show_bug.cgi?id=695438.\n *\n * - Chrome 9-10 is missing the `TypedArray.prototype.subarray` function.\n *\n * - IE10 has a broken `TypedArray.prototype.subarray` function which returns arrays of\n * incorrect length in some situations.\n\n * We detect these buggy browsers and set `Buffer.TYPED_ARRAY_SUPPORT` to `false` so they\n * get the Object implementation, which is slower but behaves correctly.\n */\nBuffer.TYPED_ARRAY_SUPPORT = global.TYPED_ARRAY_SUPPORT !== undefined\n ? global.TYPED_ARRAY_SUPPORT\n : typedArraySupport()\n\n/*\n * Export kMaxLength after typed array support is determined.\n */\nexports.kMaxLength = kMaxLength()\n\nfunction typedArraySupport () {\n try {\n var arr = new Uint8Array(1)\n arr.__proto__ = {__proto__: Uint8Array.prototype, foo: function () { return 42 }}\n return arr.foo() === 42 && // typed array instances can be augmented\n typeof arr.subarray === 'function' && // chrome 9-10 lack `subarray`\n arr.subarray(1, 1).byteLength === 0 // ie10 has broken `subarray`\n } catch (e) {\n return false\n }\n}\n\nfunction kMaxLength () {\n return Buffer.TYPED_ARRAY_SUPPORT\n ? 0x7fffffff\n : 0x3fffffff\n}\n\nfunction createBuffer (that, length) {\n if (kMaxLength() < length) {\n throw new RangeError('Invalid typed array length')\n }\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = new Uint8Array(length)\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n if (that === null) {\n that = new Buffer(length)\n }\n that.length = length\n }\n\n return that\n}\n\n/**\n * The Buffer constructor returns instances of `Uint8Array` that have their\n * prototype changed to `Buffer.prototype`. Furthermore, `Buffer` is a subclass of\n * `Uint8Array`, so the returned instances will have all the node `Buffer` methods\n * and the `Uint8Array` methods. Square bracket notation works as expected -- it\n * returns a single octet.\n *\n * The `Uint8Array` prototype remains unmodified.\n */\n\nfunction Buffer (arg, encodingOrOffset, length) {\n if (!Buffer.TYPED_ARRAY_SUPPORT && !(this instanceof Buffer)) {\n return new Buffer(arg, encodingOrOffset, length)\n }\n\n // Common case.\n if (typeof arg === 'number') {\n if (typeof encodingOrOffset === 'string') {\n throw new Error(\n 'If encoding is specified then the first argument must be a string'\n )\n }\n return allocUnsafe(this, arg)\n }\n return from(this, arg, encodingOrOffset, length)\n}\n\nBuffer.poolSize = 8192 // not used by this implementation\n\n// TODO: Legacy, not needed anymore. Remove in next major version.\nBuffer._augment = function (arr) {\n arr.__proto__ = Buffer.prototype\n return arr\n}\n\nfunction from (that, value, encodingOrOffset, length) {\n if (typeof value === 'number') {\n throw new TypeError('\"value\" argument must not be a number')\n }\n\n if (typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer) {\n return fromArrayBuffer(that, value, encodingOrOffset, length)\n }\n\n if (typeof value === 'string') {\n return fromString(that, value, encodingOrOffset)\n }\n\n return fromObject(that, value)\n}\n\n/**\n * Functionally equivalent to Buffer(arg, encoding) but throws a TypeError\n * if value is a number.\n * Buffer.from(str[, encoding])\n * Buffer.from(array)\n * Buffer.from(buffer)\n * Buffer.from(arrayBuffer[, byteOffset[, length]])\n **/\nBuffer.from = function (value, encodingOrOffset, length) {\n return from(null, value, encodingOrOffset, length)\n}\n\nif (Buffer.TYPED_ARRAY_SUPPORT) {\n Buffer.prototype.__proto__ = Uint8Array.prototype\n Buffer.__proto__ = Uint8Array\n if (typeof Symbol !== 'undefined' && Symbol.species &&\n Buffer[Symbol.species] === Buffer) {\n // Fix subarray() in ES2016. See: https://github.com/feross/buffer/pull/97\n Object.defineProperty(Buffer, Symbol.species, {\n value: null,\n configurable: true\n })\n }\n}\n\nfunction assertSize (size) {\n if (typeof size !== 'number') {\n throw new TypeError('\"size\" argument must be a number')\n } else if (size < 0) {\n throw new RangeError('\"size\" argument must not be negative')\n }\n}\n\nfunction alloc (that, size, fill, encoding) {\n assertSize(size)\n if (size <= 0) {\n return createBuffer(that, size)\n }\n if (fill !== undefined) {\n // Only pay attention to encoding if it's a string. This\n // prevents accidentally sending in a number that would\n // be interpretted as a start offset.\n return typeof encoding === 'string'\n ? createBuffer(that, size).fill(fill, encoding)\n : createBuffer(that, size).fill(fill)\n }\n return createBuffer(that, size)\n}\n\n/**\n * Creates a new filled Buffer instance.\n * alloc(size[, fill[, encoding]])\n **/\nBuffer.alloc = function (size, fill, encoding) {\n return alloc(null, size, fill, encoding)\n}\n\nfunction allocUnsafe (that, size) {\n assertSize(size)\n that = createBuffer(that, size < 0 ? 0 : checked(size) | 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) {\n for (var i = 0; i < size; ++i) {\n that[i] = 0\n }\n }\n return that\n}\n\n/**\n * Equivalent to Buffer(num), by default creates a non-zero-filled Buffer instance.\n * */\nBuffer.allocUnsafe = function (size) {\n return allocUnsafe(null, size)\n}\n/**\n * Equivalent to SlowBuffer(num), by default creates a non-zero-filled Buffer instance.\n */\nBuffer.allocUnsafeSlow = function (size) {\n return allocUnsafe(null, size)\n}\n\nfunction fromString (that, string, encoding) {\n if (typeof encoding !== 'string' || encoding === '') {\n encoding = 'utf8'\n }\n\n if (!Buffer.isEncoding(encoding)) {\n throw new TypeError('\"encoding\" must be a valid string encoding')\n }\n\n var length = byteLength(string, encoding) | 0\n that = createBuffer(that, length)\n\n var actual = that.write(string, encoding)\n\n if (actual !== length) {\n // Writing a hex string, for example, that contains invalid characters will\n // cause everything after the first invalid character to be ignored. (e.g.\n // 'abxxcd' will be treated as 'ab')\n that = that.slice(0, actual)\n }\n\n return that\n}\n\nfunction fromArrayLike (that, array) {\n var length = array.length < 0 ? 0 : checked(array.length) | 0\n that = createBuffer(that, length)\n for (var i = 0; i < length; i += 1) {\n that[i] = array[i] & 255\n }\n return that\n}\n\nfunction fromArrayBuffer (that, array, byteOffset, length) {\n array.byteLength // this throws if `array` is not a valid ArrayBuffer\n\n if (byteOffset < 0 || array.byteLength < byteOffset) {\n throw new RangeError('\\'offset\\' is out of bounds')\n }\n\n if (array.byteLength < byteOffset + (length || 0)) {\n throw new RangeError('\\'length\\' is out of bounds')\n }\n\n if (byteOffset === undefined && length === undefined) {\n array = new Uint8Array(array)\n } else if (length === undefined) {\n array = new Uint8Array(array, byteOffset)\n } else {\n array = new Uint8Array(array, byteOffset, length)\n }\n\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n // Return an augmented `Uint8Array` instance, for best performance\n that = array\n that.__proto__ = Buffer.prototype\n } else {\n // Fallback: Return an object instance of the Buffer class\n that = fromArrayLike(that, array)\n }\n return that\n}\n\nfunction fromObject (that, obj) {\n if (Buffer.isBuffer(obj)) {\n var len = checked(obj.length) | 0\n that = createBuffer(that, len)\n\n if (that.length === 0) {\n return that\n }\n\n obj.copy(that, 0, 0, len)\n return that\n }\n\n if (obj) {\n if ((typeof ArrayBuffer !== 'undefined' &&\n obj.buffer instanceof ArrayBuffer) || 'length' in obj) {\n if (typeof obj.length !== 'number' || isnan(obj.length)) {\n return createBuffer(that, 0)\n }\n return fromArrayLike(that, obj)\n }\n\n if (obj.type === 'Buffer' && isArray(obj.data)) {\n return fromArrayLike(that, obj.data)\n }\n }\n\n throw new TypeError('First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.')\n}\n\nfunction checked (length) {\n // Note: cannot use `length < kMaxLength()` here because that fails when\n // length is NaN (which is otherwise coerced to zero.)\n if (length >= kMaxLength()) {\n throw new RangeError('Attempt to allocate Buffer larger than maximum ' +\n 'size: 0x' + kMaxLength().toString(16) + ' bytes')\n }\n return length | 0\n}\n\nfunction SlowBuffer (length) {\n if (+length != length) { // eslint-disable-line eqeqeq\n length = 0\n }\n return Buffer.alloc(+length)\n}\n\nBuffer.isBuffer = function isBuffer (b) {\n return !!(b != null && b._isBuffer)\n}\n\nBuffer.compare = function compare (a, b) {\n if (!Buffer.isBuffer(a) || !Buffer.isBuffer(b)) {\n throw new TypeError('Arguments must be Buffers')\n }\n\n if (a === b) return 0\n\n var x = a.length\n var y = b.length\n\n for (var i = 0, len = Math.min(x, y); i < len; ++i) {\n if (a[i] !== b[i]) {\n x = a[i]\n y = b[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\nBuffer.isEncoding = function isEncoding (encoding) {\n switch (String(encoding).toLowerCase()) {\n case 'hex':\n case 'utf8':\n case 'utf-8':\n case 'ascii':\n case 'latin1':\n case 'binary':\n case 'base64':\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return true\n default:\n return false\n }\n}\n\nBuffer.concat = function concat (list, length) {\n if (!isArray(list)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n\n if (list.length === 0) {\n return Buffer.alloc(0)\n }\n\n var i\n if (length === undefined) {\n length = 0\n for (i = 0; i < list.length; ++i) {\n length += list[i].length\n }\n }\n\n var buffer = Buffer.allocUnsafe(length)\n var pos = 0\n for (i = 0; i < list.length; ++i) {\n var buf = list[i]\n if (!Buffer.isBuffer(buf)) {\n throw new TypeError('\"list\" argument must be an Array of Buffers')\n }\n buf.copy(buffer, pos)\n pos += buf.length\n }\n return buffer\n}\n\nfunction byteLength (string, encoding) {\n if (Buffer.isBuffer(string)) {\n return string.length\n }\n if (typeof ArrayBuffer !== 'undefined' && typeof ArrayBuffer.isView === 'function' &&\n (ArrayBuffer.isView(string) || string instanceof ArrayBuffer)) {\n return string.byteLength\n }\n if (typeof string !== 'string') {\n string = '' + string\n }\n\n var len = string.length\n if (len === 0) return 0\n\n // Use a for loop to avoid recursion\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'ascii':\n case 'latin1':\n case 'binary':\n return len\n case 'utf8':\n case 'utf-8':\n case undefined:\n return utf8ToBytes(string).length\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return len * 2\n case 'hex':\n return len >>> 1\n case 'base64':\n return base64ToBytes(string).length\n default:\n if (loweredCase) return utf8ToBytes(string).length // assume utf8\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\nBuffer.byteLength = byteLength\n\nfunction slowToString (encoding, start, end) {\n var loweredCase = false\n\n // No need to verify that \"this.length <= MAX_UINT32\" since it's a read-only\n // property of a typed array.\n\n // This behaves neither like String nor Uint8Array in that we set start/end\n // to their upper/lower bounds if the value passed is out of range.\n // undefined is handled specially as per ECMA-262 6th Edition,\n // Section 13.3.3.7 Runtime Semantics: KeyedBindingInitialization.\n if (start === undefined || start < 0) {\n start = 0\n }\n // Return early if start > this.length. Done here to prevent potential uint32\n // coercion fail below.\n if (start > this.length) {\n return ''\n }\n\n if (end === undefined || end > this.length) {\n end = this.length\n }\n\n if (end <= 0) {\n return ''\n }\n\n // Force coersion to uint32. This will also coerce falsey/NaN values to 0.\n end >>>= 0\n start >>>= 0\n\n if (end <= start) {\n return ''\n }\n\n if (!encoding) encoding = 'utf8'\n\n while (true) {\n switch (encoding) {\n case 'hex':\n return hexSlice(this, start, end)\n\n case 'utf8':\n case 'utf-8':\n return utf8Slice(this, start, end)\n\n case 'ascii':\n return asciiSlice(this, start, end)\n\n case 'latin1':\n case 'binary':\n return latin1Slice(this, start, end)\n\n case 'base64':\n return base64Slice(this, start, end)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return utf16leSlice(this, start, end)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = (encoding + '').toLowerCase()\n loweredCase = true\n }\n }\n}\n\n// The property is used by `Buffer.isBuffer` and `is-buffer` (in Safari 5-7) to detect\n// Buffer instances.\nBuffer.prototype._isBuffer = true\n\nfunction swap (b, n, m) {\n var i = b[n]\n b[n] = b[m]\n b[m] = i\n}\n\nBuffer.prototype.swap16 = function swap16 () {\n var len = this.length\n if (len % 2 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 16-bits')\n }\n for (var i = 0; i < len; i += 2) {\n swap(this, i, i + 1)\n }\n return this\n}\n\nBuffer.prototype.swap32 = function swap32 () {\n var len = this.length\n if (len % 4 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 32-bits')\n }\n for (var i = 0; i < len; i += 4) {\n swap(this, i, i + 3)\n swap(this, i + 1, i + 2)\n }\n return this\n}\n\nBuffer.prototype.swap64 = function swap64 () {\n var len = this.length\n if (len % 8 !== 0) {\n throw new RangeError('Buffer size must be a multiple of 64-bits')\n }\n for (var i = 0; i < len; i += 8) {\n swap(this, i, i + 7)\n swap(this, i + 1, i + 6)\n swap(this, i + 2, i + 5)\n swap(this, i + 3, i + 4)\n }\n return this\n}\n\nBuffer.prototype.toString = function toString () {\n var length = this.length | 0\n if (length === 0) return ''\n if (arguments.length === 0) return utf8Slice(this, 0, length)\n return slowToString.apply(this, arguments)\n}\n\nBuffer.prototype.equals = function equals (b) {\n if (!Buffer.isBuffer(b)) throw new TypeError('Argument must be a Buffer')\n if (this === b) return true\n return Buffer.compare(this, b) === 0\n}\n\nBuffer.prototype.inspect = function inspect () {\n var str = ''\n var max = exports.INSPECT_MAX_BYTES\n if (this.length > 0) {\n str = this.toString('hex', 0, max).match(/.{2}/g).join(' ')\n if (this.length > max) str += ' ... '\n }\n return ''\n}\n\nBuffer.prototype.compare = function compare (target, start, end, thisStart, thisEnd) {\n if (!Buffer.isBuffer(target)) {\n throw new TypeError('Argument must be a Buffer')\n }\n\n if (start === undefined) {\n start = 0\n }\n if (end === undefined) {\n end = target ? target.length : 0\n }\n if (thisStart === undefined) {\n thisStart = 0\n }\n if (thisEnd === undefined) {\n thisEnd = this.length\n }\n\n if (start < 0 || end > target.length || thisStart < 0 || thisEnd > this.length) {\n throw new RangeError('out of range index')\n }\n\n if (thisStart >= thisEnd && start >= end) {\n return 0\n }\n if (thisStart >= thisEnd) {\n return -1\n }\n if (start >= end) {\n return 1\n }\n\n start >>>= 0\n end >>>= 0\n thisStart >>>= 0\n thisEnd >>>= 0\n\n if (this === target) return 0\n\n var x = thisEnd - thisStart\n var y = end - start\n var len = Math.min(x, y)\n\n var thisCopy = this.slice(thisStart, thisEnd)\n var targetCopy = target.slice(start, end)\n\n for (var i = 0; i < len; ++i) {\n if (thisCopy[i] !== targetCopy[i]) {\n x = thisCopy[i]\n y = targetCopy[i]\n break\n }\n }\n\n if (x < y) return -1\n if (y < x) return 1\n return 0\n}\n\n// Finds either the first index of `val` in `buffer` at offset >= `byteOffset`,\n// OR the last index of `val` in `buffer` at offset <= `byteOffset`.\n//\n// Arguments:\n// - buffer - a Buffer to search\n// - val - a string, Buffer, or number\n// - byteOffset - an index into `buffer`; will be clamped to an int32\n// - encoding - an optional encoding, relevant is val is a string\n// - dir - true for indexOf, false for lastIndexOf\nfunction bidirectionalIndexOf (buffer, val, byteOffset, encoding, dir) {\n // Empty buffer means no match\n if (buffer.length === 0) return -1\n\n // Normalize byteOffset\n if (typeof byteOffset === 'string') {\n encoding = byteOffset\n byteOffset = 0\n } else if (byteOffset > 0x7fffffff) {\n byteOffset = 0x7fffffff\n } else if (byteOffset < -0x80000000) {\n byteOffset = -0x80000000\n }\n byteOffset = +byteOffset // Coerce to Number.\n if (isNaN(byteOffset)) {\n // byteOffset: it it's undefined, null, NaN, \"foo\", etc, search whole buffer\n byteOffset = dir ? 0 : (buffer.length - 1)\n }\n\n // Normalize byteOffset: negative offsets start from the end of the buffer\n if (byteOffset < 0) byteOffset = buffer.length + byteOffset\n if (byteOffset >= buffer.length) {\n if (dir) return -1\n else byteOffset = buffer.length - 1\n } else if (byteOffset < 0) {\n if (dir) byteOffset = 0\n else return -1\n }\n\n // Normalize val\n if (typeof val === 'string') {\n val = Buffer.from(val, encoding)\n }\n\n // Finally, search either indexOf (if dir is true) or lastIndexOf\n if (Buffer.isBuffer(val)) {\n // Special case: looking for empty string/buffer always fails\n if (val.length === 0) {\n return -1\n }\n return arrayIndexOf(buffer, val, byteOffset, encoding, dir)\n } else if (typeof val === 'number') {\n val = val & 0xFF // Search for a byte value [0-255]\n if (Buffer.TYPED_ARRAY_SUPPORT &&\n typeof Uint8Array.prototype.indexOf === 'function') {\n if (dir) {\n return Uint8Array.prototype.indexOf.call(buffer, val, byteOffset)\n } else {\n return Uint8Array.prototype.lastIndexOf.call(buffer, val, byteOffset)\n }\n }\n return arrayIndexOf(buffer, [ val ], byteOffset, encoding, dir)\n }\n\n throw new TypeError('val must be string, number or Buffer')\n}\n\nfunction arrayIndexOf (arr, val, byteOffset, encoding, dir) {\n var indexSize = 1\n var arrLength = arr.length\n var valLength = val.length\n\n if (encoding !== undefined) {\n encoding = String(encoding).toLowerCase()\n if (encoding === 'ucs2' || encoding === 'ucs-2' ||\n encoding === 'utf16le' || encoding === 'utf-16le') {\n if (arr.length < 2 || val.length < 2) {\n return -1\n }\n indexSize = 2\n arrLength /= 2\n valLength /= 2\n byteOffset /= 2\n }\n }\n\n function read (buf, i) {\n if (indexSize === 1) {\n return buf[i]\n } else {\n return buf.readUInt16BE(i * indexSize)\n }\n }\n\n var i\n if (dir) {\n var foundIndex = -1\n for (i = byteOffset; i < arrLength; i++) {\n if (read(arr, i) === read(val, foundIndex === -1 ? 0 : i - foundIndex)) {\n if (foundIndex === -1) foundIndex = i\n if (i - foundIndex + 1 === valLength) return foundIndex * indexSize\n } else {\n if (foundIndex !== -1) i -= i - foundIndex\n foundIndex = -1\n }\n }\n } else {\n if (byteOffset + valLength > arrLength) byteOffset = arrLength - valLength\n for (i = byteOffset; i >= 0; i--) {\n var found = true\n for (var j = 0; j < valLength; j++) {\n if (read(arr, i + j) !== read(val, j)) {\n found = false\n break\n }\n }\n if (found) return i\n }\n }\n\n return -1\n}\n\nBuffer.prototype.includes = function includes (val, byteOffset, encoding) {\n return this.indexOf(val, byteOffset, encoding) !== -1\n}\n\nBuffer.prototype.indexOf = function indexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, true)\n}\n\nBuffer.prototype.lastIndexOf = function lastIndexOf (val, byteOffset, encoding) {\n return bidirectionalIndexOf(this, val, byteOffset, encoding, false)\n}\n\nfunction hexWrite (buf, string, offset, length) {\n offset = Number(offset) || 0\n var remaining = buf.length - offset\n if (!length) {\n length = remaining\n } else {\n length = Number(length)\n if (length > remaining) {\n length = remaining\n }\n }\n\n // must be an even number of digits\n var strLen = string.length\n if (strLen % 2 !== 0) throw new TypeError('Invalid hex string')\n\n if (length > strLen / 2) {\n length = strLen / 2\n }\n for (var i = 0; i < length; ++i) {\n var parsed = parseInt(string.substr(i * 2, 2), 16)\n if (isNaN(parsed)) return i\n buf[offset + i] = parsed\n }\n return i\n}\n\nfunction utf8Write (buf, string, offset, length) {\n return blitBuffer(utf8ToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nfunction asciiWrite (buf, string, offset, length) {\n return blitBuffer(asciiToBytes(string), buf, offset, length)\n}\n\nfunction latin1Write (buf, string, offset, length) {\n return asciiWrite(buf, string, offset, length)\n}\n\nfunction base64Write (buf, string, offset, length) {\n return blitBuffer(base64ToBytes(string), buf, offset, length)\n}\n\nfunction ucs2Write (buf, string, offset, length) {\n return blitBuffer(utf16leToBytes(string, buf.length - offset), buf, offset, length)\n}\n\nBuffer.prototype.write = function write (string, offset, length, encoding) {\n // Buffer#write(string)\n if (offset === undefined) {\n encoding = 'utf8'\n length = this.length\n offset = 0\n // Buffer#write(string, encoding)\n } else if (length === undefined && typeof offset === 'string') {\n encoding = offset\n length = this.length\n offset = 0\n // Buffer#write(string, offset[, length][, encoding])\n } else if (isFinite(offset)) {\n offset = offset | 0\n if (isFinite(length)) {\n length = length | 0\n if (encoding === undefined) encoding = 'utf8'\n } else {\n encoding = length\n length = undefined\n }\n // legacy write(string, encoding, offset, length) - remove in v0.13\n } else {\n throw new Error(\n 'Buffer.write(string, encoding, offset[, length]) is no longer supported'\n )\n }\n\n var remaining = this.length - offset\n if (length === undefined || length > remaining) length = remaining\n\n if ((string.length > 0 && (length < 0 || offset < 0)) || offset > this.length) {\n throw new RangeError('Attempt to write outside buffer bounds')\n }\n\n if (!encoding) encoding = 'utf8'\n\n var loweredCase = false\n for (;;) {\n switch (encoding) {\n case 'hex':\n return hexWrite(this, string, offset, length)\n\n case 'utf8':\n case 'utf-8':\n return utf8Write(this, string, offset, length)\n\n case 'ascii':\n return asciiWrite(this, string, offset, length)\n\n case 'latin1':\n case 'binary':\n return latin1Write(this, string, offset, length)\n\n case 'base64':\n // Warning: maxLength not taken into account in base64Write\n return base64Write(this, string, offset, length)\n\n case 'ucs2':\n case 'ucs-2':\n case 'utf16le':\n case 'utf-16le':\n return ucs2Write(this, string, offset, length)\n\n default:\n if (loweredCase) throw new TypeError('Unknown encoding: ' + encoding)\n encoding = ('' + encoding).toLowerCase()\n loweredCase = true\n }\n }\n}\n\nBuffer.prototype.toJSON = function toJSON () {\n return {\n type: 'Buffer',\n data: Array.prototype.slice.call(this._arr || this, 0)\n }\n}\n\nfunction base64Slice (buf, start, end) {\n if (start === 0 && end === buf.length) {\n return base64.fromByteArray(buf)\n } else {\n return base64.fromByteArray(buf.slice(start, end))\n }\n}\n\nfunction utf8Slice (buf, start, end) {\n end = Math.min(buf.length, end)\n var res = []\n\n var i = start\n while (i < end) {\n var firstByte = buf[i]\n var codePoint = null\n var bytesPerSequence = (firstByte > 0xEF) ? 4\n : (firstByte > 0xDF) ? 3\n : (firstByte > 0xBF) ? 2\n : 1\n\n if (i + bytesPerSequence <= end) {\n var secondByte, thirdByte, fourthByte, tempCodePoint\n\n switch (bytesPerSequence) {\n case 1:\n if (firstByte < 0x80) {\n codePoint = firstByte\n }\n break\n case 2:\n secondByte = buf[i + 1]\n if ((secondByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0x1F) << 0x6 | (secondByte & 0x3F)\n if (tempCodePoint > 0x7F) {\n codePoint = tempCodePoint\n }\n }\n break\n case 3:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0xC | (secondByte & 0x3F) << 0x6 | (thirdByte & 0x3F)\n if (tempCodePoint > 0x7FF && (tempCodePoint < 0xD800 || tempCodePoint > 0xDFFF)) {\n codePoint = tempCodePoint\n }\n }\n break\n case 4:\n secondByte = buf[i + 1]\n thirdByte = buf[i + 2]\n fourthByte = buf[i + 3]\n if ((secondByte & 0xC0) === 0x80 && (thirdByte & 0xC0) === 0x80 && (fourthByte & 0xC0) === 0x80) {\n tempCodePoint = (firstByte & 0xF) << 0x12 | (secondByte & 0x3F) << 0xC | (thirdByte & 0x3F) << 0x6 | (fourthByte & 0x3F)\n if (tempCodePoint > 0xFFFF && tempCodePoint < 0x110000) {\n codePoint = tempCodePoint\n }\n }\n }\n }\n\n if (codePoint === null) {\n // we did not generate a valid codePoint so insert a\n // replacement char (U+FFFD) and advance only 1 byte\n codePoint = 0xFFFD\n bytesPerSequence = 1\n } else if (codePoint > 0xFFFF) {\n // encode to utf16 (surrogate pair dance)\n codePoint -= 0x10000\n res.push(codePoint >>> 10 & 0x3FF | 0xD800)\n codePoint = 0xDC00 | codePoint & 0x3FF\n }\n\n res.push(codePoint)\n i += bytesPerSequence\n }\n\n return decodeCodePointsArray(res)\n}\n\n// Based on http://stackoverflow.com/a/22747272/680742, the browser with\n// the lowest limit is Chrome, with 0x10000 args.\n// We go 1 magnitude less, for safety\nvar MAX_ARGUMENTS_LENGTH = 0x1000\n\nfunction decodeCodePointsArray (codePoints) {\n var len = codePoints.length\n if (len <= MAX_ARGUMENTS_LENGTH) {\n return String.fromCharCode.apply(String, codePoints) // avoid extra slice()\n }\n\n // Decode in chunks to avoid \"call stack size exceeded\".\n var res = ''\n var i = 0\n while (i < len) {\n res += String.fromCharCode.apply(\n String,\n codePoints.slice(i, i += MAX_ARGUMENTS_LENGTH)\n )\n }\n return res\n}\n\nfunction asciiSlice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i] & 0x7F)\n }\n return ret\n}\n\nfunction latin1Slice (buf, start, end) {\n var ret = ''\n end = Math.min(buf.length, end)\n\n for (var i = start; i < end; ++i) {\n ret += String.fromCharCode(buf[i])\n }\n return ret\n}\n\nfunction hexSlice (buf, start, end) {\n var len = buf.length\n\n if (!start || start < 0) start = 0\n if (!end || end < 0 || end > len) end = len\n\n var out = ''\n for (var i = start; i < end; ++i) {\n out += toHex(buf[i])\n }\n return out\n}\n\nfunction utf16leSlice (buf, start, end) {\n var bytes = buf.slice(start, end)\n var res = ''\n for (var i = 0; i < bytes.length; i += 2) {\n res += String.fromCharCode(bytes[i] + bytes[i + 1] * 256)\n }\n return res\n}\n\nBuffer.prototype.slice = function slice (start, end) {\n var len = this.length\n start = ~~start\n end = end === undefined ? len : ~~end\n\n if (start < 0) {\n start += len\n if (start < 0) start = 0\n } else if (start > len) {\n start = len\n }\n\n if (end < 0) {\n end += len\n if (end < 0) end = 0\n } else if (end > len) {\n end = len\n }\n\n if (end < start) end = start\n\n var newBuf\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n newBuf = this.subarray(start, end)\n newBuf.__proto__ = Buffer.prototype\n } else {\n var sliceLen = end - start\n newBuf = new Buffer(sliceLen, undefined)\n for (var i = 0; i < sliceLen; ++i) {\n newBuf[i] = this[i + start]\n }\n }\n\n return newBuf\n}\n\n/*\n * Need to make sure that buffer isn't trying to write out of bounds.\n */\nfunction checkOffset (offset, ext, length) {\n if ((offset % 1) !== 0 || offset < 0) throw new RangeError('offset is not uint')\n if (offset + ext > length) throw new RangeError('Trying to access beyond buffer length')\n}\n\nBuffer.prototype.readUIntLE = function readUIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUIntBE = function readUIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n checkOffset(offset, byteLength, this.length)\n }\n\n var val = this[offset + --byteLength]\n var mul = 1\n while (byteLength > 0 && (mul *= 0x100)) {\n val += this[offset + --byteLength] * mul\n }\n\n return val\n}\n\nBuffer.prototype.readUInt8 = function readUInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n return this[offset]\n}\n\nBuffer.prototype.readUInt16LE = function readUInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return this[offset] | (this[offset + 1] << 8)\n}\n\nBuffer.prototype.readUInt16BE = function readUInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n return (this[offset] << 8) | this[offset + 1]\n}\n\nBuffer.prototype.readUInt32LE = function readUInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return ((this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16)) +\n (this[offset + 3] * 0x1000000)\n}\n\nBuffer.prototype.readUInt32BE = function readUInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] * 0x1000000) +\n ((this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n this[offset + 3])\n}\n\nBuffer.prototype.readIntLE = function readIntLE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var val = this[offset]\n var mul = 1\n var i = 0\n while (++i < byteLength && (mul *= 0x100)) {\n val += this[offset + i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readIntBE = function readIntBE (offset, byteLength, noAssert) {\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) checkOffset(offset, byteLength, this.length)\n\n var i = byteLength\n var mul = 1\n var val = this[offset + --i]\n while (i > 0 && (mul *= 0x100)) {\n val += this[offset + --i] * mul\n }\n mul *= 0x80\n\n if (val >= mul) val -= Math.pow(2, 8 * byteLength)\n\n return val\n}\n\nBuffer.prototype.readInt8 = function readInt8 (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 1, this.length)\n if (!(this[offset] & 0x80)) return (this[offset])\n return ((0xff - this[offset] + 1) * -1)\n}\n\nBuffer.prototype.readInt16LE = function readInt16LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset] | (this[offset + 1] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt16BE = function readInt16BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 2, this.length)\n var val = this[offset + 1] | (this[offset] << 8)\n return (val & 0x8000) ? val | 0xFFFF0000 : val\n}\n\nBuffer.prototype.readInt32LE = function readInt32LE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset]) |\n (this[offset + 1] << 8) |\n (this[offset + 2] << 16) |\n (this[offset + 3] << 24)\n}\n\nBuffer.prototype.readInt32BE = function readInt32BE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n\n return (this[offset] << 24) |\n (this[offset + 1] << 16) |\n (this[offset + 2] << 8) |\n (this[offset + 3])\n}\n\nBuffer.prototype.readFloatLE = function readFloatLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, true, 23, 4)\n}\n\nBuffer.prototype.readFloatBE = function readFloatBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 4, this.length)\n return ieee754.read(this, offset, false, 23, 4)\n}\n\nBuffer.prototype.readDoubleLE = function readDoubleLE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, true, 52, 8)\n}\n\nBuffer.prototype.readDoubleBE = function readDoubleBE (offset, noAssert) {\n if (!noAssert) checkOffset(offset, 8, this.length)\n return ieee754.read(this, offset, false, 52, 8)\n}\n\nfunction checkInt (buf, value, offset, ext, max, min) {\n if (!Buffer.isBuffer(buf)) throw new TypeError('\"buffer\" argument must be a Buffer instance')\n if (value > max || value < min) throw new RangeError('\"value\" argument is out of bounds')\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n}\n\nBuffer.prototype.writeUIntLE = function writeUIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var mul = 1\n var i = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUIntBE = function writeUIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n byteLength = byteLength | 0\n if (!noAssert) {\n var maxBytes = Math.pow(2, 8 * byteLength) - 1\n checkInt(this, value, offset, byteLength, maxBytes, 0)\n }\n\n var i = byteLength - 1\n var mul = 1\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n this[offset + i] = (value / mul) & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeUInt8 = function writeUInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0xff, 0)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nfunction objectWriteUInt16 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 2); i < j; ++i) {\n buf[offset + i] = (value & (0xff << (8 * (littleEndian ? i : 1 - i)))) >>>\n (littleEndian ? i : 1 - i) * 8\n }\n}\n\nBuffer.prototype.writeUInt16LE = function writeUInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeUInt16BE = function writeUInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0xffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nfunction objectWriteUInt32 (buf, value, offset, littleEndian) {\n if (value < 0) value = 0xffffffff + value + 1\n for (var i = 0, j = Math.min(buf.length - offset, 4); i < j; ++i) {\n buf[offset + i] = (value >>> (littleEndian ? i : 3 - i) * 8) & 0xff\n }\n}\n\nBuffer.prototype.writeUInt32LE = function writeUInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset + 3] = (value >>> 24)\n this[offset + 2] = (value >>> 16)\n this[offset + 1] = (value >>> 8)\n this[offset] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeUInt32BE = function writeUInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0xffffffff, 0)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeIntLE = function writeIntLE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = 0\n var mul = 1\n var sub = 0\n this[offset] = value & 0xFF\n while (++i < byteLength && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i - 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeIntBE = function writeIntBE (value, offset, byteLength, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) {\n var limit = Math.pow(2, 8 * byteLength - 1)\n\n checkInt(this, value, offset, byteLength, limit - 1, -limit)\n }\n\n var i = byteLength - 1\n var mul = 1\n var sub = 0\n this[offset + i] = value & 0xFF\n while (--i >= 0 && (mul *= 0x100)) {\n if (value < 0 && sub === 0 && this[offset + i + 1] !== 0) {\n sub = 1\n }\n this[offset + i] = ((value / mul) >> 0) - sub & 0xFF\n }\n\n return offset + byteLength\n}\n\nBuffer.prototype.writeInt8 = function writeInt8 (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 1, 0x7f, -0x80)\n if (!Buffer.TYPED_ARRAY_SUPPORT) value = Math.floor(value)\n if (value < 0) value = 0xff + value + 1\n this[offset] = (value & 0xff)\n return offset + 1\n}\n\nBuffer.prototype.writeInt16LE = function writeInt16LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n } else {\n objectWriteUInt16(this, value, offset, true)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt16BE = function writeInt16BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 2, 0x7fff, -0x8000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 8)\n this[offset + 1] = (value & 0xff)\n } else {\n objectWriteUInt16(this, value, offset, false)\n }\n return offset + 2\n}\n\nBuffer.prototype.writeInt32LE = function writeInt32LE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value & 0xff)\n this[offset + 1] = (value >>> 8)\n this[offset + 2] = (value >>> 16)\n this[offset + 3] = (value >>> 24)\n } else {\n objectWriteUInt32(this, value, offset, true)\n }\n return offset + 4\n}\n\nBuffer.prototype.writeInt32BE = function writeInt32BE (value, offset, noAssert) {\n value = +value\n offset = offset | 0\n if (!noAssert) checkInt(this, value, offset, 4, 0x7fffffff, -0x80000000)\n if (value < 0) value = 0xffffffff + value + 1\n if (Buffer.TYPED_ARRAY_SUPPORT) {\n this[offset] = (value >>> 24)\n this[offset + 1] = (value >>> 16)\n this[offset + 2] = (value >>> 8)\n this[offset + 3] = (value & 0xff)\n } else {\n objectWriteUInt32(this, value, offset, false)\n }\n return offset + 4\n}\n\nfunction checkIEEE754 (buf, value, offset, ext, max, min) {\n if (offset + ext > buf.length) throw new RangeError('Index out of range')\n if (offset < 0) throw new RangeError('Index out of range')\n}\n\nfunction writeFloat (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 4, 3.4028234663852886e+38, -3.4028234663852886e+38)\n }\n ieee754.write(buf, value, offset, littleEndian, 23, 4)\n return offset + 4\n}\n\nBuffer.prototype.writeFloatLE = function writeFloatLE (value, offset, noAssert) {\n return writeFloat(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeFloatBE = function writeFloatBE (value, offset, noAssert) {\n return writeFloat(this, value, offset, false, noAssert)\n}\n\nfunction writeDouble (buf, value, offset, littleEndian, noAssert) {\n if (!noAssert) {\n checkIEEE754(buf, value, offset, 8, 1.7976931348623157E+308, -1.7976931348623157E+308)\n }\n ieee754.write(buf, value, offset, littleEndian, 52, 8)\n return offset + 8\n}\n\nBuffer.prototype.writeDoubleLE = function writeDoubleLE (value, offset, noAssert) {\n return writeDouble(this, value, offset, true, noAssert)\n}\n\nBuffer.prototype.writeDoubleBE = function writeDoubleBE (value, offset, noAssert) {\n return writeDouble(this, value, offset, false, noAssert)\n}\n\n// copy(targetBuffer, targetStart=0, sourceStart=0, sourceEnd=buffer.length)\nBuffer.prototype.copy = function copy (target, targetStart, start, end) {\n if (!start) start = 0\n if (!end && end !== 0) end = this.length\n if (targetStart >= target.length) targetStart = target.length\n if (!targetStart) targetStart = 0\n if (end > 0 && end < start) end = start\n\n // Copy 0 bytes; we're done\n if (end === start) return 0\n if (target.length === 0 || this.length === 0) return 0\n\n // Fatal error conditions\n if (targetStart < 0) {\n throw new RangeError('targetStart out of bounds')\n }\n if (start < 0 || start >= this.length) throw new RangeError('sourceStart out of bounds')\n if (end < 0) throw new RangeError('sourceEnd out of bounds')\n\n // Are we oob?\n if (end > this.length) end = this.length\n if (target.length - targetStart < end - start) {\n end = target.length - targetStart + start\n }\n\n var len = end - start\n var i\n\n if (this === target && start < targetStart && targetStart < end) {\n // descending copy from end\n for (i = len - 1; i >= 0; --i) {\n target[i + targetStart] = this[i + start]\n }\n } else if (len < 1000 || !Buffer.TYPED_ARRAY_SUPPORT) {\n // ascending copy from start\n for (i = 0; i < len; ++i) {\n target[i + targetStart] = this[i + start]\n }\n } else {\n Uint8Array.prototype.set.call(\n target,\n this.subarray(start, start + len),\n targetStart\n )\n }\n\n return len\n}\n\n// Usage:\n// buffer.fill(number[, offset[, end]])\n// buffer.fill(buffer[, offset[, end]])\n// buffer.fill(string[, offset[, end]][, encoding])\nBuffer.prototype.fill = function fill (val, start, end, encoding) {\n // Handle string cases:\n if (typeof val === 'string') {\n if (typeof start === 'string') {\n encoding = start\n start = 0\n end = this.length\n } else if (typeof end === 'string') {\n encoding = end\n end = this.length\n }\n if (val.length === 1) {\n var code = val.charCodeAt(0)\n if (code < 256) {\n val = code\n }\n }\n if (encoding !== undefined && typeof encoding !== 'string') {\n throw new TypeError('encoding must be a string')\n }\n if (typeof encoding === 'string' && !Buffer.isEncoding(encoding)) {\n throw new TypeError('Unknown encoding: ' + encoding)\n }\n } else if (typeof val === 'number') {\n val = val & 255\n }\n\n // Invalid ranges are not set to a default, so can range check early.\n if (start < 0 || this.length < start || this.length < end) {\n throw new RangeError('Out of range index')\n }\n\n if (end <= start) {\n return this\n }\n\n start = start >>> 0\n end = end === undefined ? this.length : end >>> 0\n\n if (!val) val = 0\n\n var i\n if (typeof val === 'number') {\n for (i = start; i < end; ++i) {\n this[i] = val\n }\n } else {\n var bytes = Buffer.isBuffer(val)\n ? val\n : utf8ToBytes(new Buffer(val, encoding).toString())\n var len = bytes.length\n for (i = 0; i < end - start; ++i) {\n this[i + start] = bytes[i % len]\n }\n }\n\n return this\n}\n\n// HELPER FUNCTIONS\n// ================\n\nvar INVALID_BASE64_RE = /[^+\\/0-9A-Za-z-_]/g\n\nfunction base64clean (str) {\n // Node strips out invalid characters like \\n and \\t from the string, base64-js does not\n str = stringtrim(str).replace(INVALID_BASE64_RE, '')\n // Node converts strings with length < 2 to ''\n if (str.length < 2) return ''\n // Node allows for non-padded base64 strings (missing trailing ===), base64-js does not\n while (str.length % 4 !== 0) {\n str = str + '='\n }\n return str\n}\n\nfunction stringtrim (str) {\n if (str.trim) return str.trim()\n return str.replace(/^\\s+|\\s+$/g, '')\n}\n\nfunction toHex (n) {\n if (n < 16) return '0' + n.toString(16)\n return n.toString(16)\n}\n\nfunction utf8ToBytes (string, units) {\n units = units || Infinity\n var codePoint\n var length = string.length\n var leadSurrogate = null\n var bytes = []\n\n for (var i = 0; i < length; ++i) {\n codePoint = string.charCodeAt(i)\n\n // is surrogate component\n if (codePoint > 0xD7FF && codePoint < 0xE000) {\n // last char was a lead\n if (!leadSurrogate) {\n // no lead yet\n if (codePoint > 0xDBFF) {\n // unexpected trail\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n } else if (i + 1 === length) {\n // unpaired lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n continue\n }\n\n // valid lead\n leadSurrogate = codePoint\n\n continue\n }\n\n // 2 leads in a row\n if (codePoint < 0xDC00) {\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n leadSurrogate = codePoint\n continue\n }\n\n // valid surrogate pair\n codePoint = (leadSurrogate - 0xD800 << 10 | codePoint - 0xDC00) + 0x10000\n } else if (leadSurrogate) {\n // valid bmp char, but last char was a lead\n if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)\n }\n\n leadSurrogate = null\n\n // encode utf8\n if (codePoint < 0x80) {\n if ((units -= 1) < 0) break\n bytes.push(codePoint)\n } else if (codePoint < 0x800) {\n if ((units -= 2) < 0) break\n bytes.push(\n codePoint >> 0x6 | 0xC0,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x10000) {\n if ((units -= 3) < 0) break\n bytes.push(\n codePoint >> 0xC | 0xE0,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else if (codePoint < 0x110000) {\n if ((units -= 4) < 0) break\n bytes.push(\n codePoint >> 0x12 | 0xF0,\n codePoint >> 0xC & 0x3F | 0x80,\n codePoint >> 0x6 & 0x3F | 0x80,\n codePoint & 0x3F | 0x80\n )\n } else {\n throw new Error('Invalid code point')\n }\n }\n\n return bytes\n}\n\nfunction asciiToBytes (str) {\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n // Node's code seems to be doing this and not & 0x7F..\n byteArray.push(str.charCodeAt(i) & 0xFF)\n }\n return byteArray\n}\n\nfunction utf16leToBytes (str, units) {\n var c, hi, lo\n var byteArray = []\n for (var i = 0; i < str.length; ++i) {\n if ((units -= 2) < 0) break\n\n c = str.charCodeAt(i)\n hi = c >> 8\n lo = c % 256\n byteArray.push(lo)\n byteArray.push(hi)\n }\n\n return byteArray\n}\n\nfunction base64ToBytes (str) {\n return base64.toByteArray(base64clean(str))\n}\n\nfunction blitBuffer (src, dst, offset, length) {\n for (var i = 0; i < length; ++i) {\n if ((i + offset >= dst.length) || (i >= src.length)) break\n dst[i + offset] = src[i]\n }\n return i\n}\n\nfunction isnan (val) {\n return val !== val // eslint-disable-line no-self-compare\n}\n","var crypto;\n\n// Native crypto from window (Browser)\nif (typeof window !== 'undefined' && window.crypto) {\n crypto = window.crypto;\n}\n\n// Native (experimental IE 11) crypto from window (Browser)\nif (!crypto && typeof window !== 'undefined' && window.msCrypto) {\n crypto = window.msCrypto;\n}\n\n// Native crypto from global (NodeJS)\nif (!crypto && typeof global !== 'undefined' && global.crypto) {\n crypto = global.crypto;\n}\n\n// Native crypto import via require (NodeJS)\nif (!crypto && typeof require === 'function') {\n try {\n crypto = require('crypto');\n } catch (err) {}\n}\n\n/*\n * Cryptographically secure pseudorandom number generator\n * As Math.random() is cryptographically not safe to use\n */\nexport default function cryptoSecureRandomInt() {\n if (crypto) {\n // Use getRandomValues method (Browser)\n if (typeof crypto.getRandomValues === 'function') {\n try {\n return crypto.getRandomValues(new Uint32Array(1))[0];\n } catch (err) {}\n }\n\n // Use randomBytes method (NodeJS)\n if (typeof crypto.randomBytes === 'function') {\n try {\n return crypto.randomBytes(4).readInt32LE();\n } catch (err) {}\n }\n }\n throw new Error('Native crypto module could not be used to get secure random number.');\n}","import cryptoSecureRandomInt from './cryptoSecureRandomInt';\n\n/**\n * Hex encoding strategy.\n * Converts a word array to a hex string.\n * @param {WordArray} wordArray The word array.\n * @return {string} The hex string.\n * @static\n */\nfunction hexStringify(wordArray) {\n // Shortcuts\n var words = wordArray.words;\n var sigBytes = wordArray.sigBytes;\n\n // Convert\n var hexChars = [];\n for (var i = 0; i < sigBytes; i++) {\n var bite = words[i >>> 2] >>> 24 - i % 4 * 8 & 0xff;\n hexChars.push((bite >>> 4).toString(16));\n hexChars.push((bite & 0x0f).toString(16));\n }\n return hexChars.join('');\n}\nvar WordArray = /*#__PURE__*/function () {\n function WordArray(words, sigBytes) {\n words = this.words = words || [];\n if (sigBytes != undefined) {\n this.sigBytes = sigBytes;\n } else {\n this.sigBytes = words.length * 4;\n }\n }\n var _proto = WordArray.prototype;\n _proto.random = function random(nBytes) {\n var words = [];\n for (var i = 0; i < nBytes; i += 4) {\n words.push(cryptoSecureRandomInt());\n }\n return new WordArray(words, nBytes);\n };\n _proto.toString = function toString() {\n return hexStringify(this);\n };\n return WordArray;\n}();\nexport { WordArray as default };","// A small implementation of BigInteger based on http://www-cs-students.stanford.edu/~tjw/jsbn/\n//\n// All public methods have been removed except the following:\n// new BigInteger(a, b) (only radix 2, 4, 8, 16 and 32 supported)\n// toString (only radix 2, 4, 8, 16 and 32 supported)\n// negate\n// abs\n// compareTo\n// bitLength\n// mod\n// equals\n// add\n// subtract\n// multiply\n// divide\n// modPow\n\nexport default BigInteger;\n\n/*\n * Copyright (c) 2003-2005 Tom Wu\n * All Rights Reserved.\n *\n * Permission is hereby granted, free of charge, to any person obtaining\n * a copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to\n * permit persons to whom the Software is furnished to do so, subject to\n * the following conditions:\n *\n * The above copyright notice and this permission notice shall be\n * included in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS-IS\" AND WITHOUT WARRANTY OF ANY KIND,\n * EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY\n * WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.\n *\n * IN NO EVENT SHALL TOM WU BE LIABLE FOR ANY SPECIAL, INCIDENTAL,\n * INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND, OR ANY DAMAGES WHATSOEVER\n * RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER OR NOT ADVISED OF\n * THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF LIABILITY, ARISING OUT\n * OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.\n *\n * In addition, the following condition applies:\n *\n * All redistributions must retain an intact copy of this copyright notice\n * and disclaimer.\n */\n\n// (public) Constructor\nfunction BigInteger(a, b) {\n if (a != null) this.fromString(a, b);\n}\n\n// return new, unset BigInteger\nfunction nbi() {\n return new BigInteger(null);\n}\n\n// Bits per digit\nvar dbits;\n\n// JavaScript engine analysis\nvar canary = 0xdeadbeefcafe;\nvar j_lm = (canary & 0xffffff) == 0xefcafe;\n\n// am: Compute w_j += (x*this_i), propagate carries,\n// c is initial carry, returns final carry.\n// c < 3*dvalue, x < 2*dvalue, this_i < dvalue\n// We need to select the fastest one that works in this environment.\n\n// am1: use a single mult and divide to get the high bits,\n// max digit bits should be 26 because\n// max internal value = 2*dvalue^2-2*dvalue (< 2^53)\nfunction am1(i, x, w, j, c, n) {\n while (--n >= 0) {\n var v = x * this[i++] + w[j] + c;\n c = Math.floor(v / 0x4000000);\n w[j++] = v & 0x3ffffff;\n }\n return c;\n}\n// am2 avoids a big mult-and-extract completely.\n// Max digit bits should be <= 30 because we do bitwise ops\n// on values up to 2*hdvalue^2-hdvalue-1 (< 2^31)\nfunction am2(i, x, w, j, c, n) {\n var xl = x & 0x7fff,\n xh = x >> 15;\n while (--n >= 0) {\n var l = this[i] & 0x7fff;\n var h = this[i++] >> 15;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x7fff) << 15) + w[j] + (c & 0x3fffffff);\n c = (l >>> 30) + (m >>> 15) + xh * h + (c >>> 30);\n w[j++] = l & 0x3fffffff;\n }\n return c;\n}\n// Alternately, set max digit bits to 28 since some\n// browsers slow down when dealing with 32-bit numbers.\nfunction am3(i, x, w, j, c, n) {\n var xl = x & 0x3fff,\n xh = x >> 14;\n while (--n >= 0) {\n var l = this[i] & 0x3fff;\n var h = this[i++] >> 14;\n var m = xh * l + h * xl;\n l = xl * l + ((m & 0x3fff) << 14) + w[j] + c;\n c = (l >> 28) + (m >> 14) + xh * h;\n w[j++] = l & 0xfffffff;\n }\n return c;\n}\nvar inBrowser = typeof navigator !== 'undefined';\nif (inBrowser && j_lm && navigator.appName == 'Microsoft Internet Explorer') {\n BigInteger.prototype.am = am2;\n dbits = 30;\n} else if (inBrowser && j_lm && navigator.appName != 'Netscape') {\n BigInteger.prototype.am = am1;\n dbits = 26;\n} else {\n // Mozilla/Netscape seems to prefer am3\n BigInteger.prototype.am = am3;\n dbits = 28;\n}\nBigInteger.prototype.DB = dbits;\nBigInteger.prototype.DM = (1 << dbits) - 1;\nBigInteger.prototype.DV = 1 << dbits;\nvar BI_FP = 52;\nBigInteger.prototype.FV = Math.pow(2, BI_FP);\nBigInteger.prototype.F1 = BI_FP - dbits;\nBigInteger.prototype.F2 = 2 * dbits - BI_FP;\n\n// Digit conversions\nvar BI_RM = '0123456789abcdefghijklmnopqrstuvwxyz';\nvar BI_RC = new Array();\nvar rr, vv;\nrr = '0'.charCodeAt(0);\nfor (vv = 0; vv <= 9; ++vv) BI_RC[rr++] = vv;\nrr = 'a'.charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\nrr = 'A'.charCodeAt(0);\nfor (vv = 10; vv < 36; ++vv) BI_RC[rr++] = vv;\nfunction int2char(n) {\n return BI_RM.charAt(n);\n}\nfunction intAt(s, i) {\n var c = BI_RC[s.charCodeAt(i)];\n return c == null ? -1 : c;\n}\n\n// (protected) copy this to r\nfunction bnpCopyTo(r) {\n for (var i = this.t - 1; i >= 0; --i) r[i] = this[i];\n r.t = this.t;\n r.s = this.s;\n}\n\n// (protected) set from integer value x, -DV <= x < DV\nfunction bnpFromInt(x) {\n this.t = 1;\n this.s = x < 0 ? -1 : 0;\n if (x > 0) this[0] = x;else if (x < -1) this[0] = x + this.DV;else this.t = 0;\n}\n\n// return bigint initialized to value\nfunction nbv(i) {\n var r = nbi();\n r.fromInt(i);\n return r;\n}\n\n// (protected) set from string and radix\nfunction bnpFromString(s, b) {\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error('Only radix 2, 4, 8, 16, 32 are supported');\n this.t = 0;\n this.s = 0;\n var i = s.length,\n mi = false,\n sh = 0;\n while (--i >= 0) {\n var x = intAt(s, i);\n if (x < 0) {\n if (s.charAt(i) == '-') mi = true;\n continue;\n }\n mi = false;\n if (sh == 0) this[this.t++] = x;else if (sh + k > this.DB) {\n this[this.t - 1] |= (x & (1 << this.DB - sh) - 1) << sh;\n this[this.t++] = x >> this.DB - sh;\n } else this[this.t - 1] |= x << sh;\n sh += k;\n if (sh >= this.DB) sh -= this.DB;\n }\n this.clamp();\n if (mi) BigInteger.ZERO.subTo(this, this);\n}\n\n// (protected) clamp off excess high words\nfunction bnpClamp() {\n var c = this.s & this.DM;\n while (this.t > 0 && this[this.t - 1] == c) --this.t;\n}\n\n// (public) return string representation in given radix\nfunction bnToString(b) {\n if (this.s < 0) return '-' + this.negate().toString(b);\n var k;\n if (b == 16) k = 4;else if (b == 8) k = 3;else if (b == 2) k = 1;else if (b == 32) k = 5;else if (b == 4) k = 2;else throw new Error('Only radix 2, 4, 8, 16, 32 are supported');\n var km = (1 << k) - 1,\n d,\n m = false,\n r = '',\n i = this.t;\n var p = this.DB - i * this.DB % k;\n if (i-- > 0) {\n if (p < this.DB && (d = this[i] >> p) > 0) {\n m = true;\n r = int2char(d);\n }\n while (i >= 0) {\n if (p < k) {\n d = (this[i] & (1 << p) - 1) << k - p;\n d |= this[--i] >> (p += this.DB - k);\n } else {\n d = this[i] >> (p -= k) & km;\n if (p <= 0) {\n p += this.DB;\n --i;\n }\n }\n if (d > 0) m = true;\n if (m) r += int2char(d);\n }\n }\n return m ? r : '0';\n}\n\n// (public) -this\nfunction bnNegate() {\n var r = nbi();\n BigInteger.ZERO.subTo(this, r);\n return r;\n}\n\n// (public) |this|\nfunction bnAbs() {\n return this.s < 0 ? this.negate() : this;\n}\n\n// (public) return + if this > a, - if this < a, 0 if equal\nfunction bnCompareTo(a) {\n var r = this.s - a.s;\n if (r != 0) return r;\n var i = this.t;\n r = i - a.t;\n if (r != 0) return this.s < 0 ? -r : r;\n while (--i >= 0) if ((r = this[i] - a[i]) != 0) return r;\n return 0;\n}\n\n// returns bit length of the integer x\nfunction nbits(x) {\n var r = 1,\n t;\n if ((t = x >>> 16) != 0) {\n x = t;\n r += 16;\n }\n if ((t = x >> 8) != 0) {\n x = t;\n r += 8;\n }\n if ((t = x >> 4) != 0) {\n x = t;\n r += 4;\n }\n if ((t = x >> 2) != 0) {\n x = t;\n r += 2;\n }\n if ((t = x >> 1) != 0) {\n x = t;\n r += 1;\n }\n return r;\n}\n\n// (public) return the number of bits in \"this\"\nfunction bnBitLength() {\n if (this.t <= 0) return 0;\n return this.DB * (this.t - 1) + nbits(this[this.t - 1] ^ this.s & this.DM);\n}\n\n// (protected) r = this << n*DB\nfunction bnpDLShiftTo(n, r) {\n var i;\n for (i = this.t - 1; i >= 0; --i) r[i + n] = this[i];\n for (i = n - 1; i >= 0; --i) r[i] = 0;\n r.t = this.t + n;\n r.s = this.s;\n}\n\n// (protected) r = this >> n*DB\nfunction bnpDRShiftTo(n, r) {\n for (var i = n; i < this.t; ++i) r[i - n] = this[i];\n r.t = Math.max(this.t - n, 0);\n r.s = this.s;\n}\n\n// (protected) r = this << n\nfunction bnpLShiftTo(n, r) {\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << cbs) - 1;\n var ds = Math.floor(n / this.DB),\n c = this.s << bs & this.DM,\n i;\n for (i = this.t - 1; i >= 0; --i) {\n r[i + ds + 1] = this[i] >> cbs | c;\n c = (this[i] & bm) << bs;\n }\n for (i = ds - 1; i >= 0; --i) r[i] = 0;\n r[ds] = c;\n r.t = this.t + ds + 1;\n r.s = this.s;\n r.clamp();\n}\n\n// (protected) r = this >> n\nfunction bnpRShiftTo(n, r) {\n r.s = this.s;\n var ds = Math.floor(n / this.DB);\n if (ds >= this.t) {\n r.t = 0;\n return;\n }\n var bs = n % this.DB;\n var cbs = this.DB - bs;\n var bm = (1 << bs) - 1;\n r[0] = this[ds] >> bs;\n for (var i = ds + 1; i < this.t; ++i) {\n r[i - ds - 1] |= (this[i] & bm) << cbs;\n r[i - ds] = this[i] >> bs;\n }\n if (bs > 0) r[this.t - ds - 1] |= (this.s & bm) << cbs;\n r.t = this.t - ds;\n r.clamp();\n}\n\n// (protected) r = this - a\nfunction bnpSubTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] - a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c -= a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c -= a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c -= a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c < -1) r[i++] = this.DV + c;else if (c > 0) r[i++] = c;\n r.t = i;\n r.clamp();\n}\n\n// (protected) r = this * a, r != this,a (HAC 14.12)\n// \"this\" should be the larger one if appropriate.\nfunction bnpMultiplyTo(a, r) {\n var x = this.abs(),\n y = a.abs();\n var i = x.t;\n r.t = i + y.t;\n while (--i >= 0) r[i] = 0;\n for (i = 0; i < y.t; ++i) r[i + x.t] = x.am(0, y[i], r, i, 0, x.t);\n r.s = 0;\n r.clamp();\n if (this.s != a.s) BigInteger.ZERO.subTo(r, r);\n}\n\n// (protected) r = this^2, r != this (HAC 14.16)\nfunction bnpSquareTo(r) {\n var x = this.abs();\n var i = r.t = 2 * x.t;\n while (--i >= 0) r[i] = 0;\n for (i = 0; i < x.t - 1; ++i) {\n var c = x.am(i, x[i], r, 2 * i, 0, 1);\n if ((r[i + x.t] += x.am(i + 1, 2 * x[i], r, 2 * i + 1, c, x.t - i - 1)) >= x.DV) {\n r[i + x.t] -= x.DV;\n r[i + x.t + 1] = 1;\n }\n }\n if (r.t > 0) r[r.t - 1] += x.am(i, x[i], r, 2 * i, 0, 1);\n r.s = 0;\n r.clamp();\n}\n\n// (protected) divide this by m, quotient and remainder to q, r (HAC 14.20)\n// r != q, this != m. q or r may be null.\nfunction bnpDivRemTo(m, q, r) {\n var pm = m.abs();\n if (pm.t <= 0) return;\n var pt = this.abs();\n if (pt.t < pm.t) {\n if (q != null) q.fromInt(0);\n if (r != null) this.copyTo(r);\n return;\n }\n if (r == null) r = nbi();\n var y = nbi(),\n ts = this.s,\n ms = m.s;\n var nsh = this.DB - nbits(pm[pm.t - 1]);\n // normalize modulus\n if (nsh > 0) {\n pm.lShiftTo(nsh, y);\n pt.lShiftTo(nsh, r);\n } else {\n pm.copyTo(y);\n pt.copyTo(r);\n }\n var ys = y.t;\n var y0 = y[ys - 1];\n if (y0 == 0) return;\n var yt = y0 * (1 << this.F1) + (ys > 1 ? y[ys - 2] >> this.F2 : 0);\n var d1 = this.FV / yt,\n d2 = (1 << this.F1) / yt,\n e = 1 << this.F2;\n var i = r.t,\n j = i - ys,\n t = q == null ? nbi() : q;\n y.dlShiftTo(j, t);\n if (r.compareTo(t) >= 0) {\n r[r.t++] = 1;\n r.subTo(t, r);\n }\n BigInteger.ONE.dlShiftTo(ys, t);\n t.subTo(y, y);\n // \"negative\" y so we can replace sub with am later\n while (y.t < ys) y[y.t++] = 0;\n while (--j >= 0) {\n // Estimate quotient digit\n var qd = r[--i] == y0 ? this.DM : Math.floor(r[i] * d1 + (r[i - 1] + e) * d2);\n if ((r[i] += y.am(0, qd, r, j, 0, ys)) < qd) {\n // Try it out\n y.dlShiftTo(j, t);\n r.subTo(t, r);\n while (r[i] < --qd) r.subTo(t, r);\n }\n }\n if (q != null) {\n r.drShiftTo(ys, q);\n if (ts != ms) BigInteger.ZERO.subTo(q, q);\n }\n r.t = ys;\n r.clamp();\n if (nsh > 0) r.rShiftTo(nsh, r);\n // Denormalize remainder\n if (ts < 0) BigInteger.ZERO.subTo(r, r);\n}\n\n// (public) this mod a\nfunction bnMod(a) {\n var r = nbi();\n this.abs().divRemTo(a, null, r);\n if (this.s < 0 && r.compareTo(BigInteger.ZERO) > 0) a.subTo(r, r);\n return r;\n}\n\n// (protected) return \"-1/this % 2^DB\"; useful for Mont. reduction\n// justification:\n// xy == 1 (mod m)\n// xy = 1+km\n// xy(2-xy) = (1+km)(1-km)\n// x[y(2-xy)] = 1-k^2m^2\n// x[y(2-xy)] == 1 (mod m^2)\n// if y is 1/x mod m, then y(2-xy) is 1/x mod m^2\n// should reduce x and y(2-xy) by m^2 at each step to keep size bounded.\n// JS multiply \"overflows\" differently from C/C++, so care is needed here.\nfunction bnpInvDigit() {\n if (this.t < 1) return 0;\n var x = this[0];\n if ((x & 1) == 0) return 0;\n var y = x & 3;\n // y == 1/x mod 2^2\n y = y * (2 - (x & 0xf) * y) & 0xf;\n // y == 1/x mod 2^4\n y = y * (2 - (x & 0xff) * y) & 0xff;\n // y == 1/x mod 2^8\n y = y * (2 - ((x & 0xffff) * y & 0xffff)) & 0xffff;\n // y == 1/x mod 2^16\n // last step - calculate inverse mod DV directly;\n // assumes 16 < DB <= 32 and assumes ability to handle 48-bit ints\n y = y * (2 - x * y % this.DV) % this.DV;\n // y == 1/x mod 2^dbits\n // we really want the negative inverse, and -DV < y < DV\n return y > 0 ? this.DV - y : -y;\n}\nfunction bnEquals(a) {\n return this.compareTo(a) == 0;\n}\n\n// (protected) r = this + a\nfunction bnpAddTo(a, r) {\n var i = 0,\n c = 0,\n m = Math.min(a.t, this.t);\n while (i < m) {\n c += this[i] + a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n if (a.t < this.t) {\n c += a.s;\n while (i < this.t) {\n c += this[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += this.s;\n } else {\n c += this.s;\n while (i < a.t) {\n c += a[i];\n r[i++] = c & this.DM;\n c >>= this.DB;\n }\n c += a.s;\n }\n r.s = c < 0 ? -1 : 0;\n if (c > 0) r[i++] = c;else if (c < -1) r[i++] = this.DV + c;\n r.t = i;\n r.clamp();\n}\n\n// (public) this + a\nfunction bnAdd(a) {\n var r = nbi();\n this.addTo(a, r);\n return r;\n}\n\n// (public) this - a\nfunction bnSubtract(a) {\n var r = nbi();\n this.subTo(a, r);\n return r;\n}\n\n// (public) this * a\nfunction bnMultiply(a) {\n var r = nbi();\n this.multiplyTo(a, r);\n return r;\n}\n\n// (public) this / a\nfunction bnDivide(a) {\n var r = nbi();\n this.divRemTo(a, r, null);\n return r;\n}\n\n// Montgomery reduction\nfunction Montgomery(m) {\n this.m = m;\n this.mp = m.invDigit();\n this.mpl = this.mp & 0x7fff;\n this.mph = this.mp >> 15;\n this.um = (1 << m.DB - 15) - 1;\n this.mt2 = 2 * m.t;\n}\n\n// xR mod m\nfunction montConvert(x) {\n var r = nbi();\n x.abs().dlShiftTo(this.m.t, r);\n r.divRemTo(this.m, null, r);\n if (x.s < 0 && r.compareTo(BigInteger.ZERO) > 0) this.m.subTo(r, r);\n return r;\n}\n\n// x/R mod m\nfunction montRevert(x) {\n var r = nbi();\n x.copyTo(r);\n this.reduce(r);\n return r;\n}\n\n// x = x/R mod m (HAC 14.32)\nfunction montReduce(x) {\n while (x.t <= this.mt2)\n // pad x so am has enough room later\n x[x.t++] = 0;\n for (var i = 0; i < this.m.t; ++i) {\n // faster way of calculating u0 = x[i]*mp mod DV\n var j = x[i] & 0x7fff;\n var u0 = j * this.mpl + ((j * this.mph + (x[i] >> 15) * this.mpl & this.um) << 15) & x.DM;\n // use am to combine the multiply-shift-add into one call\n j = i + this.m.t;\n x[j] += this.m.am(0, u0, x, i, 0, this.m.t);\n // propagate carry\n while (x[j] >= x.DV) {\n x[j] -= x.DV;\n x[++j]++;\n }\n }\n x.clamp();\n x.drShiftTo(this.m.t, x);\n if (x.compareTo(this.m) >= 0) x.subTo(this.m, x);\n}\n\n// r = \"x^2/R mod m\"; x != r\nfunction montSqrTo(x, r) {\n x.squareTo(r);\n this.reduce(r);\n}\n\n// r = \"xy/R mod m\"; x,y != r\nfunction montMulTo(x, y, r) {\n x.multiplyTo(y, r);\n this.reduce(r);\n}\nMontgomery.prototype.convert = montConvert;\nMontgomery.prototype.revert = montRevert;\nMontgomery.prototype.reduce = montReduce;\nMontgomery.prototype.mulTo = montMulTo;\nMontgomery.prototype.sqrTo = montSqrTo;\n\n// (public) this^e % m (HAC 14.85)\nfunction bnModPow(e, m, callback) {\n var i = e.bitLength(),\n k,\n r = nbv(1),\n z = new Montgomery(m);\n if (i <= 0) return r;else if (i < 18) k = 1;else if (i < 48) k = 3;else if (i < 144) k = 4;else if (i < 768) k = 5;else k = 6;\n\n // precomputation\n var g = new Array(),\n n = 3,\n k1 = k - 1,\n km = (1 << k) - 1;\n g[1] = z.convert(this);\n if (k > 1) {\n var g2 = nbi();\n z.sqrTo(g[1], g2);\n while (n <= km) {\n g[n] = nbi();\n z.mulTo(g2, g[n - 2], g[n]);\n n += 2;\n }\n }\n var j = e.t - 1,\n w,\n is1 = true,\n r2 = nbi(),\n t;\n i = nbits(e[j]) - 1;\n while (j >= 0) {\n if (i >= k1) w = e[j] >> i - k1 & km;else {\n w = (e[j] & (1 << i + 1) - 1) << k1 - i;\n if (j > 0) w |= e[j - 1] >> this.DB + i - k1;\n }\n n = k;\n while ((w & 1) == 0) {\n w >>= 1;\n --n;\n }\n if ((i -= n) < 0) {\n i += this.DB;\n --j;\n }\n if (is1) {\n // ret == 1, don't bother squaring or multiplying it\n g[w].copyTo(r);\n is1 = false;\n } else {\n while (n > 1) {\n z.sqrTo(r, r2);\n z.sqrTo(r2, r);\n n -= 2;\n }\n if (n > 0) z.sqrTo(r, r2);else {\n t = r;\n r = r2;\n r2 = t;\n }\n z.mulTo(r2, g[w], r);\n }\n while (j >= 0 && (e[j] & 1 << i) == 0) {\n z.sqrTo(r, r2);\n t = r;\n r = r2;\n r2 = t;\n if (--i < 0) {\n i = this.DB - 1;\n --j;\n }\n }\n }\n var result = z.revert(r);\n callback(null, result);\n return result;\n}\n\n// protected\nBigInteger.prototype.copyTo = bnpCopyTo;\nBigInteger.prototype.fromInt = bnpFromInt;\nBigInteger.prototype.fromString = bnpFromString;\nBigInteger.prototype.clamp = bnpClamp;\nBigInteger.prototype.dlShiftTo = bnpDLShiftTo;\nBigInteger.prototype.drShiftTo = bnpDRShiftTo;\nBigInteger.prototype.lShiftTo = bnpLShiftTo;\nBigInteger.prototype.rShiftTo = bnpRShiftTo;\nBigInteger.prototype.subTo = bnpSubTo;\nBigInteger.prototype.multiplyTo = bnpMultiplyTo;\nBigInteger.prototype.squareTo = bnpSquareTo;\nBigInteger.prototype.divRemTo = bnpDivRemTo;\nBigInteger.prototype.invDigit = bnpInvDigit;\nBigInteger.prototype.addTo = bnpAddTo;\n\n// public\nBigInteger.prototype.toString = bnToString;\nBigInteger.prototype.negate = bnNegate;\nBigInteger.prototype.abs = bnAbs;\nBigInteger.prototype.compareTo = bnCompareTo;\nBigInteger.prototype.bitLength = bnBitLength;\nBigInteger.prototype.mod = bnMod;\nBigInteger.prototype.equals = bnEquals;\nBigInteger.prototype.add = bnAdd;\nBigInteger.prototype.subtract = bnSubtract;\nBigInteger.prototype.multiply = bnMultiply;\nBigInteger.prototype.divide = bnDivide;\nBigInteger.prototype.modPow = bnModPow;\n\n// \"constants\"\nBigInteger.ZERO = nbv(0);\nBigInteger.ONE = nbv(1);","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Buffer } from 'buffer';\nimport WordArray from './utils/WordArray';\nimport { Sha256 } from '@aws-crypto/sha256-js';\n\n/**\n * Returns a Buffer with a sequence of random nBytes\n *\n * @param {number} nBytes\n * @returns {Buffer} fixed-length sequence of random bytes\n */\n\nfunction randomBytes(nBytes) {\n return Buffer.from(new WordArray().random(nBytes).toString(), 'hex');\n}\nimport BigInteger from './BigInteger';\n\n/**\n * Tests if a hex string has it most significant bit set (case-insensitive regex)\n */\nvar HEX_MSB_REGEX = /^[89a-f]/i;\nvar initN = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD1' + '29024E088A67CC74020BBEA63B139B22514A08798E3404DD' + 'EF9519B3CD3A431B302B0A6DF25F14374FE1356D6D51C245' + 'E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3D' + 'C2007CB8A163BF0598DA48361C55D39A69163FA8FD24CF5F' + '83655D23DCA3AD961C62F356208552BB9ED529077096966D' + '670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' + 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9' + 'DE2BCBF6955817183995497CEA956AE515D2261898FA0510' + '15728E5A8AAAC42DAD33170D04507A33A85521ABDF1CBA64' + 'ECFB850458DBEF0A8AEA71575D060C7DB3970F85A6E1E4C7' + 'ABF5AE8CDB0933D71E8C94E04A25619DCEE3D2261AD2EE6B' + 'F12FFA06D98A0864D87602733EC86A64521F2B18177B200C' + 'BBE117577A615D6C770988C0BAD946E208E24FA074E5AB31' + '43DB5BFCE0FD108E4B82D120A93AD2CAFFFFFFFFFFFFFFFF';\nvar newPasswordRequiredChallengeUserAttributePrefix = 'userAttributes.';\n\n/** @class */\nvar AuthenticationHelper = /*#__PURE__*/function () {\n /**\n * Constructs a new AuthenticationHelper object\n * @param {string} PoolName Cognito user pool name.\n */\n function AuthenticationHelper(PoolName) {\n this.N = new BigInteger(initN, 16);\n this.g = new BigInteger('2', 16);\n this.k = new BigInteger(this.hexHash(\"\" + this.padHex(this.N) + this.padHex(this.g)), 16);\n this.smallAValue = this.generateRandomSmallA();\n this.getLargeAValue(function () {});\n this.infoBits = Buffer.from('Caldera Derived Key', 'utf8');\n this.poolName = PoolName;\n }\n\n /**\n * @returns {BigInteger} small A, a random number\n */\n var _proto = AuthenticationHelper.prototype;\n _proto.getSmallAValue = function getSmallAValue() {\n return this.smallAValue;\n }\n\n /**\n * @param {nodeCallback} callback Called with (err, largeAValue)\n * @returns {void}\n */;\n _proto.getLargeAValue = function getLargeAValue(callback) {\n var _this = this;\n if (this.largeAValue) {\n callback(null, this.largeAValue);\n } else {\n this.calculateA(this.smallAValue, function (err, largeAValue) {\n if (err) {\n callback(err, null);\n }\n _this.largeAValue = largeAValue;\n callback(null, _this.largeAValue);\n });\n }\n }\n\n /**\n * helper function to generate a random big integer\n * @returns {BigInteger} a random value.\n * @private\n */;\n _proto.generateRandomSmallA = function generateRandomSmallA() {\n // This will be interpreted as a postive 128-bit integer\n var hexRandom = randomBytes(128).toString('hex');\n var randomBigInt = new BigInteger(hexRandom, 16);\n\n // There is no need to do randomBigInt.mod(this.N - 1) as N (3072-bit) is > 128 bytes (1024-bit)\n\n return randomBigInt;\n }\n\n /**\n * helper function to generate a random string\n * @returns {string} a random value.\n * @private\n */;\n _proto.generateRandomString = function generateRandomString() {\n return randomBytes(40).toString('base64');\n }\n\n /**\n * @returns {string} Generated random value included in password hash.\n */;\n _proto.getRandomPassword = function getRandomPassword() {\n return this.randomPassword;\n }\n\n /**\n * @returns {string} Generated random value included in devices hash.\n */;\n _proto.getSaltDevices = function getSaltDevices() {\n return this.SaltToHashDevices;\n }\n\n /**\n * @returns {string} Value used to verify devices.\n */;\n _proto.getVerifierDevices = function getVerifierDevices() {\n return this.verifierDevices;\n }\n\n /**\n * Generate salts and compute verifier.\n * @param {string} deviceGroupKey Devices to generate verifier for.\n * @param {string} username User to generate verifier for.\n * @param {nodeCallback} callback Called with (err, null)\n * @returns {void}\n */;\n _proto.generateHashDevice = function generateHashDevice(deviceGroupKey, username, callback) {\n var _this2 = this;\n this.randomPassword = this.generateRandomString();\n var combinedString = \"\" + deviceGroupKey + username + \":\" + this.randomPassword;\n var hashedString = this.hash(combinedString);\n var hexRandom = randomBytes(16).toString('hex');\n\n // The random hex will be unambiguously represented as a postive integer\n this.SaltToHashDevices = this.padHex(new BigInteger(hexRandom, 16));\n this.g.modPow(new BigInteger(this.hexHash(this.SaltToHashDevices + hashedString), 16), this.N, function (err, verifierDevicesNotPadded) {\n if (err) {\n callback(err, null);\n }\n _this2.verifierDevices = _this2.padHex(verifierDevicesNotPadded);\n callback(null, null);\n });\n }\n\n /**\n * Calculate the client's public value A = g^a%N\n * with the generated random number a\n * @param {BigInteger} a Randomly generated small A.\n * @param {nodeCallback} callback Called with (err, largeAValue)\n * @returns {void}\n * @private\n */;\n _proto.calculateA = function calculateA(a, callback) {\n var _this3 = this;\n this.g.modPow(a, this.N, function (err, A) {\n if (err) {\n callback(err, null);\n }\n if (A.mod(_this3.N).equals(BigInteger.ZERO)) {\n callback(new Error('Illegal paramater. A mod N cannot be 0.'), null);\n }\n callback(null, A);\n });\n }\n\n /**\n * Calculate the client's value U which is the hash of A and B\n * @param {BigInteger} A Large A value.\n * @param {BigInteger} B Server B value.\n * @returns {BigInteger} Computed U value.\n * @private\n */;\n _proto.calculateU = function calculateU(A, B) {\n this.UHexHash = this.hexHash(this.padHex(A) + this.padHex(B));\n var finalU = new BigInteger(this.UHexHash, 16);\n return finalU;\n }\n\n /**\n * Calculate a hash from a bitArray\n * @param {Buffer} buf Value to hash.\n * @returns {String} Hex-encoded hash.\n * @private\n */;\n _proto.hash = function hash(buf) {\n var awsCryptoHash = new Sha256();\n awsCryptoHash.update(buf);\n var resultFromAWSCrypto = awsCryptoHash.digestSync();\n var hashHex = Buffer.from(resultFromAWSCrypto).toString('hex');\n return new Array(64 - hashHex.length).join('0') + hashHex;\n }\n\n /**\n * Calculate a hash from a hex string\n * @param {String} hexStr Value to hash.\n * @returns {String} Hex-encoded hash.\n * @private\n */;\n _proto.hexHash = function hexHash(hexStr) {\n return this.hash(Buffer.from(hexStr, 'hex'));\n }\n\n /**\n * Standard hkdf algorithm\n * @param {Buffer} ikm Input key material.\n * @param {Buffer} salt Salt value.\n * @returns {Buffer} Strong key material.\n * @private\n */;\n _proto.computehkdf = function computehkdf(ikm, salt) {\n var infoBitsBuffer = Buffer.concat([this.infoBits, Buffer.from(String.fromCharCode(1), 'utf8')]);\n var awsCryptoHash = new Sha256(salt);\n awsCryptoHash.update(ikm);\n var resultFromAWSCryptoPrk = awsCryptoHash.digestSync();\n var awsCryptoHashHmac = new Sha256(resultFromAWSCryptoPrk);\n awsCryptoHashHmac.update(infoBitsBuffer);\n var resultFromAWSCryptoHmac = awsCryptoHashHmac.digestSync();\n var hashHexFromAWSCrypto = resultFromAWSCryptoHmac;\n var currentHex = hashHexFromAWSCrypto.slice(0, 16);\n return currentHex;\n }\n\n /**\n * Calculates the final hkdf based on computed S value, and computed U value and the key\n * @param {String} username Username.\n * @param {String} password Password.\n * @param {BigInteger} serverBValue Server B value.\n * @param {BigInteger} salt Generated salt.\n * @param {nodeCallback} callback Called with (err, hkdfValue)\n * @returns {void}\n */;\n _proto.getPasswordAuthenticationKey = function getPasswordAuthenticationKey(username, password, serverBValue, salt, callback) {\n var _this4 = this;\n if (serverBValue.mod(this.N).equals(BigInteger.ZERO)) {\n throw new Error('B cannot be zero.');\n }\n this.UValue = this.calculateU(this.largeAValue, serverBValue);\n if (this.UValue.equals(BigInteger.ZERO)) {\n throw new Error('U cannot be zero.');\n }\n var usernamePassword = \"\" + this.poolName + username + \":\" + password;\n var usernamePasswordHash = this.hash(usernamePassword);\n var xValue = new BigInteger(this.hexHash(this.padHex(salt) + usernamePasswordHash), 16);\n this.calculateS(xValue, serverBValue, function (err, sValue) {\n if (err) {\n callback(err, null);\n }\n var hkdf = _this4.computehkdf(Buffer.from(_this4.padHex(sValue), 'hex'), Buffer.from(_this4.padHex(_this4.UValue), 'hex'));\n callback(null, hkdf);\n });\n }\n\n /**\n * Calculates the S value used in getPasswordAuthenticationKey\n * @param {BigInteger} xValue Salted password hash value.\n * @param {BigInteger} serverBValue Server B value.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */;\n _proto.calculateS = function calculateS(xValue, serverBValue, callback) {\n var _this5 = this;\n this.g.modPow(xValue, this.N, function (err, gModPowXN) {\n if (err) {\n callback(err, null);\n }\n var intValue2 = serverBValue.subtract(_this5.k.multiply(gModPowXN));\n intValue2.modPow(_this5.smallAValue.add(_this5.UValue.multiply(xValue)), _this5.N, function (err2, result) {\n if (err2) {\n callback(err2, null);\n }\n callback(null, result.mod(_this5.N));\n });\n });\n }\n\n /**\n * Return constant newPasswordRequiredChallengeUserAttributePrefix\n * @return {newPasswordRequiredChallengeUserAttributePrefix} constant prefix value\n */;\n _proto.getNewPasswordRequiredChallengeUserAttributePrefix = function getNewPasswordRequiredChallengeUserAttributePrefix() {\n return newPasswordRequiredChallengeUserAttributePrefix;\n }\n\n /**\n * Returns an unambiguous, even-length hex string of the two's complement encoding of an integer.\n *\n * It is compatible with the hex encoding of Java's BigInteger's toByteArray(), wich returns a\n * byte array containing the two's-complement representation of a BigInteger. The array contains\n * the minimum number of bytes required to represent the BigInteger, including at least one sign bit.\n *\n * Examples showing how ambiguity is avoided by left padding with:\n * \t\"00\" (for positive values where the most-significant-bit is set)\n * \"FF\" (for negative values where the most-significant-bit is set)\n *\n * padHex(bigInteger.fromInt(-236)) === \"FF14\"\n * padHex(bigInteger.fromInt(20)) === \"14\"\n *\n * padHex(bigInteger.fromInt(-200)) === \"FF38\"\n * padHex(bigInteger.fromInt(56)) === \"38\"\n *\n * padHex(bigInteger.fromInt(-20)) === \"EC\"\n * padHex(bigInteger.fromInt(236)) === \"00EC\"\n *\n * padHex(bigInteger.fromInt(-56)) === \"C8\"\n * padHex(bigInteger.fromInt(200)) === \"00C8\"\n *\n * @param {BigInteger} bigInt Number to encode.\n * @returns {String} even-length hex string of the two's complement encoding.\n */;\n _proto.padHex = function padHex(bigInt) {\n if (!(bigInt instanceof BigInteger)) {\n throw new Error('Not a BigInteger');\n }\n var isNegative = bigInt.compareTo(BigInteger.ZERO) < 0;\n\n /* Get a hex string for abs(bigInt) */\n var hexStr = bigInt.abs().toString(16);\n\n /* Pad hex to even length if needed */\n hexStr = hexStr.length % 2 !== 0 ? \"0\" + hexStr : hexStr;\n\n /* Prepend \"00\" if the most significant bit is set */\n hexStr = HEX_MSB_REGEX.test(hexStr) ? \"00\" + hexStr : hexStr;\n if (isNegative) {\n /* Flip the bits of the representation */\n var invertedNibbles = hexStr.split('').map(function (x) {\n var invertedNibble = ~parseInt(x, 16) & 0xf;\n return '0123456789ABCDEF'.charAt(invertedNibble);\n }).join('');\n\n /* After flipping the bits, add one to get the 2's complement representation */\n var flippedBitsBI = new BigInteger(invertedNibbles, 16).add(BigInteger.ONE);\n hexStr = flippedBitsBI.toString(16);\n\n /*\n For hex strings starting with 'FF8', 'FF' can be dropped, e.g. 0xFFFF80=0xFF80=0x80=-128\n \t\tAny sequence of '1' bits on the left can always be substituted with a single '1' bit\n without changing the represented value.\n \t\tThis only happens in the case when the input is 80...00\n */\n if (hexStr.toUpperCase().startsWith('FF8')) {\n hexStr = hexStr.substring(2);\n }\n }\n return hexStr;\n };\n return AuthenticationHelper;\n}();\nexport { AuthenticationHelper as default };","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Buffer } from 'buffer';\n\n/** @class */\nvar CognitoJwtToken = /*#__PURE__*/function () {\n /**\n * Constructs a new CognitoJwtToken object\n * @param {string=} token The JWT token.\n */\n function CognitoJwtToken(token) {\n // Assign object\n this.jwtToken = token || '';\n this.payload = this.decodePayload();\n }\n\n /**\n * @returns {string} the record's token.\n */\n var _proto = CognitoJwtToken.prototype;\n _proto.getJwtToken = function getJwtToken() {\n return this.jwtToken;\n }\n\n /**\n * @returns {int} the token's expiration (exp member).\n */;\n _proto.getExpiration = function getExpiration() {\n return this.payload.exp;\n }\n\n /**\n * @returns {int} the token's \"issued at\" (iat member).\n */;\n _proto.getIssuedAt = function getIssuedAt() {\n return this.payload.iat;\n }\n\n /**\n * @returns {object} the token's payload.\n */;\n _proto.decodePayload = function decodePayload() {\n var payload = this.jwtToken.split('.')[1];\n try {\n return JSON.parse(Buffer.from(payload, 'base64').toString('utf8'));\n } catch (err) {\n return {};\n }\n };\n return CognitoJwtToken;\n}();\nexport { CognitoJwtToken as default };","function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport CognitoJwtToken from './CognitoJwtToken';\n\n/** @class */\nvar CognitoAccessToken = /*#__PURE__*/function (_CognitoJwtToken) {\n _inheritsLoose(CognitoAccessToken, _CognitoJwtToken);\n /**\n * Constructs a new CognitoAccessToken object\n * @param {string=} AccessToken The JWT access token.\n */\n function CognitoAccessToken(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n AccessToken = _ref.AccessToken;\n return _CognitoJwtToken.call(this, AccessToken || '') || this;\n }\n return CognitoAccessToken;\n}(CognitoJwtToken);\nexport { CognitoAccessToken as default };","function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport CognitoJwtToken from './CognitoJwtToken';\n\n/** @class */\nvar CognitoIdToken = /*#__PURE__*/function (_CognitoJwtToken) {\n _inheritsLoose(CognitoIdToken, _CognitoJwtToken);\n /**\n * Constructs a new CognitoIdToken object\n * @param {string=} IdToken The JWT Id token\n */\n function CognitoIdToken(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n IdToken = _ref.IdToken;\n return _CognitoJwtToken.call(this, IdToken || '') || this;\n }\n return CognitoIdToken;\n}(CognitoJwtToken);\nexport { CognitoIdToken as default };","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/** @class */\nvar CognitoRefreshToken = /*#__PURE__*/function () {\n /**\n * Constructs a new CognitoRefreshToken object\n * @param {string=} RefreshToken The JWT refresh token.\n */\n function CognitoRefreshToken(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n RefreshToken = _ref.RefreshToken;\n // Assign object\n this.token = RefreshToken || '';\n }\n\n /**\n * @returns {string} the record's token.\n */\n var _proto = CognitoRefreshToken.prototype;\n _proto.getToken = function getToken() {\n return this.token;\n };\n return CognitoRefreshToken;\n}();\nexport { CognitoRefreshToken as default };","// generated by genversion\nexport var version = '5.0.4';","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\nimport { version } from './version';\nvar BASE_USER_AGENT = \"aws-amplify/\" + version;\nexport var Platform = {\n userAgent: BASE_USER_AGENT + \" js\",\n product: '',\n navigator: null,\n isReactNative: false\n};\nif (typeof navigator !== 'undefined' && navigator.product) {\n Platform.product = navigator.product || '';\n Platform.navigator = navigator || null;\n switch (navigator.product) {\n case 'ReactNative':\n Platform.userAgent = BASE_USER_AGENT + \" react-native\";\n Platform.isReactNative = true;\n break;\n default:\n Platform.userAgent = BASE_USER_AGENT + \" js\";\n Platform.isReactNative = false;\n break;\n }\n}\nexport var getUserAgent = function getUserAgent() {\n return Platform.userAgent;\n};\n\n/**\n * @deprecated use named import\n */\nexport default Platform;","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/** @class */\nvar CognitoUserSession = /*#__PURE__*/function () {\n /**\n * Constructs a new CognitoUserSession object\n * @param {CognitoIdToken} IdToken The session's Id token.\n * @param {CognitoRefreshToken=} RefreshToken The session's refresh token.\n * @param {CognitoAccessToken} AccessToken The session's access token.\n * @param {int} ClockDrift The saved computer's clock drift or undefined to force calculation.\n */\n function CognitoUserSession(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n IdToken = _ref.IdToken,\n RefreshToken = _ref.RefreshToken,\n AccessToken = _ref.AccessToken,\n ClockDrift = _ref.ClockDrift;\n if (AccessToken == null || IdToken == null) {\n throw new Error('Id token and Access Token must be present.');\n }\n this.idToken = IdToken;\n this.refreshToken = RefreshToken;\n this.accessToken = AccessToken;\n this.clockDrift = ClockDrift === undefined ? this.calculateClockDrift() : ClockDrift;\n }\n\n /**\n * @returns {CognitoIdToken} the session's Id token\n */\n var _proto = CognitoUserSession.prototype;\n _proto.getIdToken = function getIdToken() {\n return this.idToken;\n }\n\n /**\n * @returns {CognitoRefreshToken} the session's refresh token\n */;\n _proto.getRefreshToken = function getRefreshToken() {\n return this.refreshToken;\n }\n\n /**\n * @returns {CognitoAccessToken} the session's access token\n */;\n _proto.getAccessToken = function getAccessToken() {\n return this.accessToken;\n }\n\n /**\n * @returns {int} the session's clock drift\n */;\n _proto.getClockDrift = function getClockDrift() {\n return this.clockDrift;\n }\n\n /**\n * @returns {int} the computer's clock drift\n */;\n _proto.calculateClockDrift = function calculateClockDrift() {\n var now = Math.floor(new Date() / 1000);\n var iat = Math.min(this.accessToken.getIssuedAt(), this.idToken.getIssuedAt());\n return now - iat;\n }\n\n /**\n * Checks to see if the session is still valid based on session expiry information found\n * in tokens and the current time (adjusted with clock drift)\n * @returns {boolean} if the session is still valid\n */;\n _proto.isValid = function isValid() {\n var now = Math.floor(new Date() / 1000);\n var adjusted = now - this.clockDrift;\n return adjusted < this.accessToken.getExpiration() && adjusted < this.idToken.getExpiration();\n };\n return CognitoUserSession;\n}();\nexport { CognitoUserSession as default };","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nvar monthNames = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'];\nvar weekNames = ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'];\n\n/** @class */\nvar DateHelper = /*#__PURE__*/function () {\n function DateHelper() {}\n var _proto = DateHelper.prototype;\n /**\n * @returns {string} The current time in \"ddd MMM D HH:mm:ss UTC YYYY\" format.\n */\n _proto.getNowString = function getNowString() {\n var now = new Date();\n var weekDay = weekNames[now.getUTCDay()];\n var month = monthNames[now.getUTCMonth()];\n var day = now.getUTCDate();\n var hours = now.getUTCHours();\n if (hours < 10) {\n hours = \"0\" + hours;\n }\n var minutes = now.getUTCMinutes();\n if (minutes < 10) {\n minutes = \"0\" + minutes;\n }\n var seconds = now.getUTCSeconds();\n if (seconds < 10) {\n seconds = \"0\" + seconds;\n }\n var year = now.getUTCFullYear();\n\n // ddd MMM D HH:mm:ss UTC YYYY\n var dateNow = weekDay + \" \" + month + \" \" + day + \" \" + hours + \":\" + minutes + \":\" + seconds + \" UTC \" + year;\n return dateNow;\n };\n return DateHelper;\n}();\nexport { DateHelper as default };","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n/** @class */\nvar CognitoUserAttribute = /*#__PURE__*/function () {\n /**\n * Constructs a new CognitoUserAttribute object\n * @param {string=} Name The record's name\n * @param {string=} Value The record's value\n */\n function CognitoUserAttribute(_temp) {\n var _ref = _temp === void 0 ? {} : _temp,\n Name = _ref.Name,\n Value = _ref.Value;\n this.Name = Name || '';\n this.Value = Value || '';\n }\n\n /**\n * @returns {string} the record's value.\n */\n var _proto = CognitoUserAttribute.prototype;\n _proto.getValue = function getValue() {\n return this.Value;\n }\n\n /**\n * Sets the record's value.\n * @param {string} value The new value.\n * @returns {CognitoUserAttribute} The record for method chaining.\n */;\n _proto.setValue = function setValue(value) {\n this.Value = value;\n return this;\n }\n\n /**\n * @returns {string} the record's name.\n */;\n _proto.getName = function getName() {\n return this.Name;\n }\n\n /**\n * Sets the record's name\n * @param {string} name The new name.\n * @returns {CognitoUserAttribute} The record for method chaining.\n */;\n _proto.setName = function setName(name) {\n this.Name = name;\n return this;\n }\n\n /**\n * @returns {string} a string representation of the record.\n */;\n _proto.toString = function toString() {\n return JSON.stringify(this);\n }\n\n /**\n * @returns {object} a flat object representing the record.\n */;\n _proto.toJSON = function toJSON() {\n return {\n Name: this.Name,\n Value: this.Value\n };\n };\n return CognitoUserAttribute;\n}();\nexport { CognitoUserAttribute as default };","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nvar dataMemory = {};\n\n/** @class */\nexport var MemoryStorage = /*#__PURE__*/function () {\n function MemoryStorage() {}\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n MemoryStorage.setItem = function setItem(key, value) {\n dataMemory[key] = value;\n return dataMemory[key];\n }\n\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */;\n MemoryStorage.getItem = function getItem(key) {\n return Object.prototype.hasOwnProperty.call(dataMemory, key) ? dataMemory[key] : undefined;\n }\n\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {boolean} return true\n */;\n MemoryStorage.removeItem = function removeItem(key) {\n return delete dataMemory[key];\n }\n\n /**\n * This is used to clear the storage\n * @returns {string} nothing\n */;\n MemoryStorage.clear = function clear() {\n dataMemory = {};\n return dataMemory;\n };\n return MemoryStorage;\n}();\n\n/** @class */\nvar StorageHelper = /*#__PURE__*/function () {\n /**\n * This is used to get a storage object\n * @returns {object} the storage\n */\n function StorageHelper() {\n try {\n this.storageWindow = window.localStorage;\n this.storageWindow.setItem('aws.cognito.test-ls', 1);\n this.storageWindow.removeItem('aws.cognito.test-ls');\n } catch (exception) {\n this.storageWindow = MemoryStorage;\n }\n }\n\n /**\n * This is used to return the storage\n * @returns {object} the storage\n */\n var _proto = StorageHelper.prototype;\n _proto.getStorage = function getStorage() {\n return this.storageWindow;\n };\n return StorageHelper;\n}();\nexport { StorageHelper as default };","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport { Buffer } from 'buffer';\nimport { Sha256 } from '@aws-crypto/sha256-js';\nimport { Platform } from './Platform';\nimport BigInteger from './BigInteger';\nimport AuthenticationHelper from './AuthenticationHelper';\nimport CognitoAccessToken from './CognitoAccessToken';\nimport CognitoIdToken from './CognitoIdToken';\nimport CognitoRefreshToken from './CognitoRefreshToken';\nimport CognitoUserSession from './CognitoUserSession';\nimport DateHelper from './DateHelper';\nimport CognitoUserAttribute from './CognitoUserAttribute';\nimport StorageHelper from './StorageHelper';\n\n/**\n * @callback nodeCallback\n * @template T result\n * @param {*} err The operation failure reason, or null.\n * @param {T} result The operation result.\n */\n\n/**\n * @callback onFailure\n * @param {*} err Failure reason.\n */\n\n/**\n * @callback onSuccess\n * @template T result\n * @param {T} result The operation result.\n */\n\n/**\n * @callback mfaRequired\n * @param {*} details MFA challenge details.\n */\n\n/**\n * @callback customChallenge\n * @param {*} details Custom challenge details.\n */\n\n/**\n * @callback inputVerificationCode\n * @param {*} data Server response.\n */\n\n/**\n * @callback authSuccess\n * @param {CognitoUserSession} session The new session.\n * @param {bool=} userConfirmationNecessary User must be confirmed.\n */\n\nvar isNavigatorAvailable = typeof navigator !== 'undefined';\nvar userAgent = isNavigatorAvailable ? Platform.isReactNative ? 'react-native' : navigator.userAgent : 'nodejs';\n\n/** @class */\nvar CognitoUser = /*#__PURE__*/function () {\n /**\n * Constructs a new CognitoUser object\n * @param {object} data Creation options\n * @param {string} data.Username The user's username.\n * @param {CognitoUserPool} data.Pool Pool containing the user.\n * @param {object} data.Storage Optional storage object.\n */\n function CognitoUser(data) {\n if (data == null || data.Username == null || data.Pool == null) {\n throw new Error('Username and Pool information are required.');\n }\n this.username = data.Username || '';\n this.pool = data.Pool;\n this.Session = null;\n this.client = data.Pool.client;\n this.signInUserSession = null;\n this.authenticationFlowType = 'USER_SRP_AUTH';\n this.storage = data.Storage || new StorageHelper().getStorage();\n this.keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId();\n this.userDataKey = this.keyPrefix + \".\" + this.username + \".userData\";\n }\n\n /**\n * Sets the session for this user\n * @param {CognitoUserSession} signInUserSession the session\n * @returns {void}\n */\n var _proto = CognitoUser.prototype;\n _proto.setSignInUserSession = function setSignInUserSession(signInUserSession) {\n this.clearCachedUserData();\n this.signInUserSession = signInUserSession;\n this.cacheTokens();\n }\n\n /**\n * @returns {CognitoUserSession} the current session for this user\n */;\n _proto.getSignInUserSession = function getSignInUserSession() {\n return this.signInUserSession;\n }\n\n /**\n * @returns {string} the user's username\n */;\n _proto.getUsername = function getUsername() {\n return this.username;\n }\n\n /**\n * @returns {String} the authentication flow type\n */;\n _proto.getAuthenticationFlowType = function getAuthenticationFlowType() {\n return this.authenticationFlowType;\n }\n\n /**\n * sets authentication flow type\n * @param {string} authenticationFlowType New value.\n * @returns {void}\n */;\n _proto.setAuthenticationFlowType = function setAuthenticationFlowType(authenticationFlowType) {\n this.authenticationFlowType = authenticationFlowType;\n }\n\n /**\n * This is used for authenticating the user through the custom authentication flow.\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */;\n _proto.initiateAuth = function initiateAuth(authDetails, callback) {\n var _this = this;\n var authParameters = authDetails.getAuthParameters();\n authParameters.USERNAME = this.username;\n var clientMetaData = Object.keys(authDetails.getValidationData()).length !== 0 ? authDetails.getValidationData() : authDetails.getClientMetadata();\n var jsonReq = {\n AuthFlow: 'CUSTOM_AUTH',\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: clientMetaData\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('InitiateAuth', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n var challengeName = data.ChallengeName;\n var challengeParameters = data.ChallengeParameters;\n if (challengeName === 'CUSTOM_CHALLENGE') {\n _this.Session = data.Session;\n return callback.customChallenge(challengeParameters);\n }\n _this.signInUserSession = _this.getCognitoUserSession(data.AuthenticationResult);\n _this.cacheTokens();\n return callback.onSuccess(_this.signInUserSession);\n });\n }\n\n /**\n * This is used for authenticating the user.\n * stuff\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {newPasswordRequired} callback.newPasswordRequired new\n * password and any required attributes are required to continue\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */;\n _proto.authenticateUser = function authenticateUser(authDetails, callback) {\n if (this.authenticationFlowType === 'USER_PASSWORD_AUTH') {\n return this.authenticateUserPlainUsernamePassword(authDetails, callback);\n } else if (this.authenticationFlowType === 'USER_SRP_AUTH' || this.authenticationFlowType === 'CUSTOM_AUTH') {\n return this.authenticateUserDefaultAuth(authDetails, callback);\n }\n return callback.onFailure(new Error('Authentication flow type is invalid.'));\n }\n\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n * It calls the AuthenticationHelper for SRP related\n * stuff\n * @param {AuthenticationDetails} authDetails Contains the authentication data\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {newPasswordRequired} callback.newPasswordRequired new\n * password and any required attributes are required to continue\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */;\n _proto.authenticateUserDefaultAuth = function authenticateUserDefaultAuth(authDetails, callback) {\n var _this2 = this;\n var authenticationHelper = new AuthenticationHelper(this.pool.getUserPoolName());\n var dateHelper = new DateHelper();\n var serverBValue;\n var salt;\n var authParameters = {};\n if (this.deviceKey != null) {\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n authParameters.USERNAME = this.username;\n authenticationHelper.getLargeAValue(function (errOnAValue, aValue) {\n // getLargeAValue callback start\n if (errOnAValue) {\n callback.onFailure(errOnAValue);\n }\n authParameters.SRP_A = aValue.toString(16);\n if (_this2.authenticationFlowType === 'CUSTOM_AUTH') {\n authParameters.CHALLENGE_NAME = 'SRP_A';\n }\n var clientMetaData = Object.keys(authDetails.getValidationData()).length !== 0 ? authDetails.getValidationData() : authDetails.getClientMetadata();\n var jsonReq = {\n AuthFlow: _this2.authenticationFlowType,\n ClientId: _this2.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: clientMetaData\n };\n if (_this2.getUserContextData(_this2.username)) {\n jsonReq.UserContextData = _this2.getUserContextData(_this2.username);\n }\n _this2.client.request('InitiateAuth', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n var challengeParameters = data.ChallengeParameters;\n _this2.username = challengeParameters.USER_ID_FOR_SRP;\n _this2.userDataKey = _this2.keyPrefix + \".\" + _this2.username + \".userData\";\n serverBValue = new BigInteger(challengeParameters.SRP_B, 16);\n salt = new BigInteger(challengeParameters.SALT, 16);\n _this2.getCachedDeviceKeyAndPassword();\n authenticationHelper.getPasswordAuthenticationKey(_this2.username, authDetails.getPassword(), serverBValue, salt, function (errOnHkdf, hkdf) {\n // getPasswordAuthenticationKey callback start\n if (errOnHkdf) {\n callback.onFailure(errOnHkdf);\n }\n var dateNow = dateHelper.getNowString();\n var concatBuffer = Buffer.concat([Buffer.from(_this2.pool.getUserPoolName(), 'utf8'), Buffer.from(_this2.username, 'utf8'), Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), Buffer.from(dateNow, 'utf8')]);\n var awsCryptoHash = new Sha256(hkdf);\n awsCryptoHash.update(concatBuffer);\n var resultFromAWSCrypto = awsCryptoHash.digestSync();\n var signatureString = Buffer.from(resultFromAWSCrypto).toString('base64');\n var challengeResponses = {};\n challengeResponses.USERNAME = _this2.username;\n challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n challengeResponses.TIMESTAMP = dateNow;\n challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n if (_this2.deviceKey != null) {\n challengeResponses.DEVICE_KEY = _this2.deviceKey;\n }\n var respondToAuthChallenge = function respondToAuthChallenge(challenge, challengeCallback) {\n return _this2.client.request('RespondToAuthChallenge', challenge, function (errChallenge, dataChallenge) {\n if (errChallenge && errChallenge.code === 'ResourceNotFoundException' && errChallenge.message.toLowerCase().indexOf('device') !== -1) {\n challengeResponses.DEVICE_KEY = null;\n _this2.deviceKey = null;\n _this2.randomPassword = null;\n _this2.deviceGroupKey = null;\n _this2.clearCachedDeviceKeyAndPassword();\n return respondToAuthChallenge(challenge, challengeCallback);\n }\n return challengeCallback(errChallenge, dataChallenge);\n });\n };\n var jsonReqResp = {\n ChallengeName: 'PASSWORD_VERIFIER',\n ClientId: _this2.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: data.Session,\n ClientMetadata: clientMetaData\n };\n if (_this2.getUserContextData()) {\n jsonReqResp.UserContextData = _this2.getUserContextData();\n }\n respondToAuthChallenge(jsonReqResp, function (errAuthenticate, dataAuthenticate) {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n return _this2.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);\n });\n return undefined;\n // getPasswordAuthenticationKey callback end\n });\n\n return undefined;\n });\n // getLargeAValue callback end\n });\n }\n\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n * @param {AuthenticationDetails} authDetails Contains the authentication data.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {mfaRequired} callback.mfaRequired MFA code\n * required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @returns {void}\n */;\n _proto.authenticateUserPlainUsernamePassword = function authenticateUserPlainUsernamePassword(authDetails, callback) {\n var _this3 = this;\n var authParameters = {};\n authParameters.USERNAME = this.username;\n authParameters.PASSWORD = authDetails.getPassword();\n if (!authParameters.PASSWORD) {\n callback.onFailure(new Error('PASSWORD parameter is required'));\n return;\n }\n var authenticationHelper = new AuthenticationHelper(this.pool.getUserPoolName());\n this.getCachedDeviceKeyAndPassword();\n if (this.deviceKey != null) {\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n var clientMetaData = Object.keys(authDetails.getValidationData()).length !== 0 ? authDetails.getValidationData() : authDetails.getClientMetadata();\n var jsonReq = {\n AuthFlow: 'USER_PASSWORD_AUTH',\n ClientId: this.pool.getClientId(),\n AuthParameters: authParameters,\n ClientMetadata: clientMetaData\n };\n if (this.getUserContextData(this.username)) {\n jsonReq.UserContextData = this.getUserContextData(this.username);\n }\n // USER_PASSWORD_AUTH happens in a single round-trip: client sends userName and password,\n // Cognito UserPools verifies password and returns tokens.\n this.client.request('InitiateAuth', jsonReq, function (err, authResult) {\n if (err) {\n return callback.onFailure(err);\n }\n return _this3.authenticateUserInternal(authResult, authenticationHelper, callback);\n });\n }\n\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n * @param {object} dataAuthenticate authentication data\n * @param {object} authenticationHelper helper created\n * @param {callback} callback passed on from caller\n * @returns {void}\n */;\n _proto.authenticateUserInternal = function authenticateUserInternal(dataAuthenticate, authenticationHelper, callback) {\n var _this4 = this;\n var challengeName = dataAuthenticate.ChallengeName;\n var challengeParameters = dataAuthenticate.ChallengeParameters;\n if (challengeName === 'SMS_MFA') {\n this.Session = dataAuthenticate.Session;\n return callback.mfaRequired(challengeName, challengeParameters);\n }\n if (challengeName === 'SELECT_MFA_TYPE') {\n this.Session = dataAuthenticate.Session;\n return callback.selectMFAType(challengeName, challengeParameters);\n }\n if (challengeName === 'MFA_SETUP') {\n this.Session = dataAuthenticate.Session;\n return callback.mfaSetup(challengeName, challengeParameters);\n }\n if (challengeName === 'SOFTWARE_TOKEN_MFA') {\n this.Session = dataAuthenticate.Session;\n return callback.totpRequired(challengeName, challengeParameters);\n }\n if (challengeName === 'CUSTOM_CHALLENGE') {\n this.Session = dataAuthenticate.Session;\n return callback.customChallenge(challengeParameters);\n }\n if (challengeName === 'NEW_PASSWORD_REQUIRED') {\n this.Session = dataAuthenticate.Session;\n var userAttributes = null;\n var rawRequiredAttributes = null;\n var requiredAttributes = [];\n var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix();\n if (challengeParameters) {\n userAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.userAttributes);\n rawRequiredAttributes = JSON.parse(dataAuthenticate.ChallengeParameters.requiredAttributes);\n }\n if (rawRequiredAttributes) {\n for (var i = 0; i < rawRequiredAttributes.length; i++) {\n requiredAttributes[i] = rawRequiredAttributes[i].substr(userAttributesPrefix.length);\n }\n }\n return callback.newPasswordRequired(userAttributes, requiredAttributes);\n }\n if (challengeName === 'DEVICE_SRP_AUTH') {\n this.Session = dataAuthenticate.Session;\n this.getDeviceResponse(callback);\n return undefined;\n }\n this.signInUserSession = this.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n this.challengeName = challengeName;\n this.cacheTokens();\n var newDeviceMetadata = dataAuthenticate.AuthenticationResult.NewDeviceMetadata;\n if (newDeviceMetadata == null) {\n return callback.onSuccess(this.signInUserSession);\n }\n authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) {\n if (errGenHash) {\n return callback.onFailure(errGenHash);\n }\n var deviceSecretVerifierConfig = {\n Salt: Buffer.from(authenticationHelper.getSaltDevices(), 'hex').toString('base64'),\n PasswordVerifier: Buffer.from(authenticationHelper.getVerifierDevices(), 'hex').toString('base64')\n };\n _this4.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n _this4.deviceGroupKey = newDeviceMetadata.DeviceGroupKey;\n _this4.randomPassword = authenticationHelper.getRandomPassword();\n _this4.client.request('ConfirmDevice', {\n DeviceKey: newDeviceMetadata.DeviceKey,\n AccessToken: _this4.signInUserSession.getAccessToken().getJwtToken(),\n DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n DeviceName: userAgent\n }, function (errConfirm, dataConfirm) {\n if (errConfirm) {\n return callback.onFailure(errConfirm);\n }\n _this4.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n _this4.cacheDeviceKeyAndPassword();\n if (dataConfirm.UserConfirmationNecessary === true) {\n return callback.onSuccess(_this4.signInUserSession, dataConfirm.UserConfirmationNecessary);\n }\n return callback.onSuccess(_this4.signInUserSession);\n });\n return undefined;\n });\n return undefined;\n }\n\n /**\n * This method is user to complete the NEW_PASSWORD_REQUIRED challenge.\n * Pass the new password with any new user attributes to be updated.\n * User attribute keys must be of format userAttributes..\n * @param {string} newPassword new password for this user\n * @param {object} requiredAttributeData map with values for all required attributes\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {mfaRequired} callback.mfaRequired MFA code required to continue.\n * @param {customChallenge} callback.customChallenge Custom challenge\n * response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */;\n _proto.completeNewPasswordChallenge = function completeNewPasswordChallenge(newPassword, requiredAttributeData, callback, clientMetadata) {\n var _this5 = this;\n if (!newPassword) {\n return callback.onFailure(new Error('New password is required.'));\n }\n var authenticationHelper = new AuthenticationHelper(this.pool.getUserPoolName());\n var userAttributesPrefix = authenticationHelper.getNewPasswordRequiredChallengeUserAttributePrefix();\n var finalUserAttributes = {};\n if (requiredAttributeData) {\n Object.keys(requiredAttributeData).forEach(function (key) {\n finalUserAttributes[userAttributesPrefix + key] = requiredAttributeData[key];\n });\n }\n finalUserAttributes.NEW_PASSWORD = newPassword;\n finalUserAttributes.USERNAME = this.username;\n var jsonReq = {\n ChallengeName: 'NEW_PASSWORD_REQUIRED',\n ClientId: this.pool.getClientId(),\n ChallengeResponses: finalUserAttributes,\n Session: this.Session,\n ClientMetadata: clientMetadata\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge', jsonReq, function (errAuthenticate, dataAuthenticate) {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n return _this5.authenticateUserInternal(dataAuthenticate, authenticationHelper, callback);\n });\n return undefined;\n }\n\n /**\n * This is used to get a session using device authentication. It is called at the end of user\n * authentication\n *\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n * @private\n */;\n _proto.getDeviceResponse = function getDeviceResponse(callback, clientMetadata) {\n var _this6 = this;\n var authenticationHelper = new AuthenticationHelper(this.deviceGroupKey);\n var dateHelper = new DateHelper();\n var authParameters = {};\n authParameters.USERNAME = this.username;\n authParameters.DEVICE_KEY = this.deviceKey;\n authenticationHelper.getLargeAValue(function (errAValue, aValue) {\n // getLargeAValue callback start\n if (errAValue) {\n callback.onFailure(errAValue);\n }\n authParameters.SRP_A = aValue.toString(16);\n var jsonReq = {\n ChallengeName: 'DEVICE_SRP_AUTH',\n ClientId: _this6.pool.getClientId(),\n ChallengeResponses: authParameters,\n ClientMetadata: clientMetadata,\n Session: _this6.Session\n };\n if (_this6.getUserContextData()) {\n jsonReq.UserContextData = _this6.getUserContextData();\n }\n _this6.client.request('RespondToAuthChallenge', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n var challengeParameters = data.ChallengeParameters;\n var serverBValue = new BigInteger(challengeParameters.SRP_B, 16);\n var salt = new BigInteger(challengeParameters.SALT, 16);\n authenticationHelper.getPasswordAuthenticationKey(_this6.deviceKey, _this6.randomPassword, serverBValue, salt, function (errHkdf, hkdf) {\n // getPasswordAuthenticationKey callback start\n if (errHkdf) {\n return callback.onFailure(errHkdf);\n }\n var dateNow = dateHelper.getNowString();\n var concatBuffer = Buffer.concat([Buffer.from(_this6.deviceGroupKey, 'utf8'), Buffer.from(_this6.deviceKey, 'utf8'), Buffer.from(challengeParameters.SECRET_BLOCK, 'base64'), Buffer.from(dateNow, 'utf8')]);\n var awsCryptoHash = new Sha256(hkdf);\n awsCryptoHash.update(concatBuffer);\n var resultFromAWSCrypto = awsCryptoHash.digestSync();\n var signatureString = Buffer.from(resultFromAWSCrypto).toString('base64');\n var challengeResponses = {};\n challengeResponses.USERNAME = _this6.username;\n challengeResponses.PASSWORD_CLAIM_SECRET_BLOCK = challengeParameters.SECRET_BLOCK;\n challengeResponses.TIMESTAMP = dateNow;\n challengeResponses.PASSWORD_CLAIM_SIGNATURE = signatureString;\n challengeResponses.DEVICE_KEY = _this6.deviceKey;\n var jsonReqResp = {\n ChallengeName: 'DEVICE_PASSWORD_VERIFIER',\n ClientId: _this6.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: data.Session\n };\n if (_this6.getUserContextData()) {\n jsonReqResp.UserContextData = _this6.getUserContextData();\n }\n _this6.client.request('RespondToAuthChallenge', jsonReqResp, function (errAuthenticate, dataAuthenticate) {\n if (errAuthenticate) {\n return callback.onFailure(errAuthenticate);\n }\n _this6.signInUserSession = _this6.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n _this6.cacheTokens();\n return callback.onSuccess(_this6.signInUserSession);\n });\n return undefined;\n // getPasswordAuthenticationKey callback end\n });\n\n return undefined;\n });\n // getLargeAValue callback end\n });\n }\n\n /**\n * This is used for a certain user to confirm the registration by using a confirmation code\n * @param {string} confirmationCode Code entered by user.\n * @param {bool} forceAliasCreation Allow migrating from an existing email / phone number.\n * @param {nodeCallback} callback Called on success or error.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */;\n _proto.confirmRegistration = function confirmRegistration(confirmationCode, forceAliasCreation, callback, clientMetadata) {\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n ConfirmationCode: confirmationCode,\n Username: this.username,\n ForceAliasCreation: forceAliasCreation,\n ClientMetadata: clientMetadata\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('ConfirmSignUp', jsonReq, function (err) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n }\n\n /**\n * This is used by the user once he has the responses to a custom challenge\n * @param {string} answerChallenge The custom challenge answer.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {customChallenge} callback.customChallenge\n * Custom challenge response required to continue.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */;\n _proto.sendCustomChallengeAnswer = function sendCustomChallengeAnswer(answerChallenge, callback, clientMetadata) {\n var _this7 = this;\n var challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.ANSWER = answerChallenge;\n var authenticationHelper = new AuthenticationHelper(this.pool.getUserPoolName());\n this.getCachedDeviceKeyAndPassword();\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n var jsonReq = {\n ChallengeName: 'CUSTOM_CHALLENGE',\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session,\n ClientMetadata: clientMetadata\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n return _this7.authenticateUserInternal(data, authenticationHelper, callback);\n });\n }\n\n /**\n * This is used by the user once he has an MFA code\n * @param {string} confirmationCode The MFA code entered by the user.\n * @param {object} callback Result callback map.\n * @param {string} mfaType The mfa we are replying to.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {authSuccess} callback.onSuccess Called on success with the new session.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */;\n _proto.sendMFACode = function sendMFACode(confirmationCode, callback, mfaType, clientMetadata) {\n var _this8 = this;\n var challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.SMS_MFA_CODE = confirmationCode;\n var mfaTypeSelection = mfaType || 'SMS_MFA';\n if (mfaTypeSelection === 'SOFTWARE_TOKEN_MFA') {\n challengeResponses.SOFTWARE_TOKEN_MFA_CODE = confirmationCode;\n }\n if (this.deviceKey != null) {\n challengeResponses.DEVICE_KEY = this.deviceKey;\n }\n var jsonReq = {\n ChallengeName: mfaTypeSelection,\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session,\n ClientMetadata: clientMetadata\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge', jsonReq, function (err, dataAuthenticate) {\n if (err) {\n return callback.onFailure(err);\n }\n var challengeName = dataAuthenticate.ChallengeName;\n if (challengeName === 'DEVICE_SRP_AUTH') {\n _this8.getDeviceResponse(callback);\n return undefined;\n }\n _this8.signInUserSession = _this8.getCognitoUserSession(dataAuthenticate.AuthenticationResult);\n _this8.cacheTokens();\n if (dataAuthenticate.AuthenticationResult.NewDeviceMetadata == null) {\n return callback.onSuccess(_this8.signInUserSession);\n }\n var authenticationHelper = new AuthenticationHelper(_this8.pool.getUserPoolName());\n authenticationHelper.generateHashDevice(dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey, dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey, function (errGenHash) {\n if (errGenHash) {\n return callback.onFailure(errGenHash);\n }\n var deviceSecretVerifierConfig = {\n Salt: Buffer.from(authenticationHelper.getSaltDevices(), 'hex').toString('base64'),\n PasswordVerifier: Buffer.from(authenticationHelper.getVerifierDevices(), 'hex').toString('base64')\n };\n _this8.verifierDevices = deviceSecretVerifierConfig.PasswordVerifier;\n _this8.deviceGroupKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceGroupKey;\n _this8.randomPassword = authenticationHelper.getRandomPassword();\n _this8.client.request('ConfirmDevice', {\n DeviceKey: dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey,\n AccessToken: _this8.signInUserSession.getAccessToken().getJwtToken(),\n DeviceSecretVerifierConfig: deviceSecretVerifierConfig,\n DeviceName: userAgent\n }, function (errConfirm, dataConfirm) {\n if (errConfirm) {\n return callback.onFailure(errConfirm);\n }\n _this8.deviceKey = dataAuthenticate.AuthenticationResult.NewDeviceMetadata.DeviceKey;\n _this8.cacheDeviceKeyAndPassword();\n if (dataConfirm.UserConfirmationNecessary === true) {\n return callback.onSuccess(_this8.signInUserSession, dataConfirm.UserConfirmationNecessary);\n }\n return callback.onSuccess(_this8.signInUserSession);\n });\n return undefined;\n });\n return undefined;\n });\n }\n\n /**\n * This is used by an authenticated user to change the current password\n * @param {string} oldUserPassword The current password.\n * @param {string} newUserPassword The requested new password.\n * @param {nodeCallback} callback Called on success or error.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */;\n _proto.changePassword = function changePassword(oldUserPassword, newUserPassword, callback, clientMetadata) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n this.client.request('ChangePassword', {\n PreviousPassword: oldUserPassword,\n ProposedPassword: newUserPassword,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n ClientMetadata: clientMetadata\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to enable MFA for itself\n * @deprecated\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */;\n _proto.enableMFA = function enableMFA(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n var mfaOptions = [];\n var mfaEnabled = {\n DeliveryMedium: 'SMS',\n AttributeName: 'phone_number'\n };\n mfaOptions.push(mfaEnabled);\n this.client.request('SetUserSettings', {\n MFAOptions: mfaOptions,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to enable MFA for itself\n * @param {IMfaSettings} smsMfaSettings the sms mfa settings\n * @param {IMFASettings} softwareTokenMfaSettings the software token mfa settings\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */;\n _proto.setUserMfaPreference = function setUserMfaPreference(smsMfaSettings, softwareTokenMfaSettings, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n this.client.request('SetUserMFAPreference', {\n SMSMfaSettings: smsMfaSettings,\n SoftwareTokenMfaSettings: softwareTokenMfaSettings,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to disable MFA for itself\n * @deprecated\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */;\n _proto.disableMFA = function disableMFA(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n var mfaOptions = [];\n this.client.request('SetUserSettings', {\n MFAOptions: mfaOptions,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to delete itself\n * @param {nodeCallback} callback Called on success or error.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */;\n _proto.deleteUser = function deleteUser(callback, clientMetadata) {\n var _this9 = this;\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n this.client.request('DeleteUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n ClientMetadata: clientMetadata\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n _this9.clearCachedUser();\n return callback(null, 'SUCCESS');\n });\n return undefined;\n }\n\n /**\n * @typedef {CognitoUserAttribute | { Name:string, Value:string }} AttributeArg\n */\n /**\n * This is used by an authenticated user to change a list of attributes\n * @param {AttributeArg[]} attributes A list of the new user attributes.\n * @param {nodeCallback} callback Called on success or error.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */;\n _proto.updateAttributes = function updateAttributes(attributes, callback, clientMetadata) {\n var _this10 = this;\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback(new Error('User is not authenticated'), null);\n }\n this.client.request('UpdateUserAttributes', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n UserAttributes: attributes,\n ClientMetadata: clientMetadata\n }, function (err, result) {\n if (err) {\n return callback(err, null);\n }\n\n // update cached user\n return _this10.getUserData(function () {\n return callback(null, 'SUCCESS', result);\n }, {\n bypassCache: true\n });\n });\n return undefined;\n }\n\n /**\n * This is used by an authenticated user to get a list of attributes\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */;\n _proto.getUserAttributes = function getUserAttributes(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n this.client.request('GetUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err, userData) {\n if (err) {\n return callback(err, null);\n }\n var attributeList = [];\n for (var i = 0; i < userData.UserAttributes.length; i++) {\n var attribute = {\n Name: userData.UserAttributes[i].Name,\n Value: userData.UserAttributes[i].Value\n };\n var userAttribute = new CognitoUserAttribute(attribute);\n attributeList.push(userAttribute);\n }\n return callback(null, attributeList);\n });\n return undefined;\n }\n\n /**\n * This was previously used by an authenticated user to get MFAOptions,\n * but no longer returns a meaningful response. Refer to the documentation for\n * how to setup and use MFA: https://docs.amplify.aws/lib/auth/mfa/q/platform/js\n * @deprecated\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */;\n _proto.getMFAOptions = function getMFAOptions(callback) {\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n this.client.request('GetUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err, userData) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, userData.MFAOptions);\n });\n return undefined;\n }\n\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n */;\n _proto.createGetUserRequest = function createGetUserRequest() {\n return this.client.promisifyRequest('GetUser', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n });\n }\n\n /**\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n */;\n _proto.refreshSessionIfPossible = function refreshSessionIfPossible(options) {\n var _this11 = this;\n if (options === void 0) {\n options = {};\n }\n // best effort, if not possible\n return new Promise(function (resolve) {\n var refresh = _this11.signInUserSession.getRefreshToken();\n if (refresh && refresh.getToken()) {\n _this11.refreshSession(refresh, resolve, options.clientMetadata);\n } else {\n resolve();\n }\n });\n }\n\n /**\n * @typedef {Object} GetUserDataOptions\n * @property {boolean} bypassCache - force getting data from Cognito service\n * @property {Record} clientMetadata - clientMetadata for getSession\n */\n\n /**\n * This is used by an authenticated users to get the userData\n * @param {nodeCallback} callback Called on success or error.\n * @param {GetUserDataOptions} params\n * @returns {void}\n */;\n _proto.getUserData = function getUserData(callback, params) {\n var _this12 = this;\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.clearCachedUserData();\n return callback(new Error('User is not authenticated'), null);\n }\n var userData = this.getUserDataFromCache();\n if (!userData) {\n this.fetchUserData().then(function (data) {\n callback(null, data);\n })[\"catch\"](callback);\n return;\n }\n if (this.isFetchUserDataAndTokenRequired(params)) {\n this.fetchUserData().then(function (data) {\n return _this12.refreshSessionIfPossible(params).then(function () {\n return data;\n });\n }).then(function (data) {\n return callback(null, data);\n })[\"catch\"](callback);\n return;\n }\n try {\n callback(null, JSON.parse(userData));\n return;\n } catch (err) {\n this.clearCachedUserData();\n callback(err, null);\n return;\n }\n }\n\n /**\n *\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n */;\n _proto.getUserDataFromCache = function getUserDataFromCache() {\n var userData = this.storage.getItem(this.userDataKey);\n return userData;\n }\n\n /**\n *\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n */;\n _proto.isFetchUserDataAndTokenRequired = function isFetchUserDataAndTokenRequired(params) {\n var _ref = params || {},\n _ref$bypassCache = _ref.bypassCache,\n bypassCache = _ref$bypassCache === void 0 ? false : _ref$bypassCache;\n return bypassCache;\n }\n /**\n *\n * PRIVATE ONLY: This is an internal only method and should not\n * be directly called by the consumers.\n */;\n _proto.fetchUserData = function fetchUserData() {\n var _this13 = this;\n return this.createGetUserRequest().then(function (data) {\n _this13.cacheUserData(data);\n return data;\n });\n }\n\n /**\n * This is used by an authenticated user to delete a list of attributes\n * @param {string[]} attributeList Names of the attributes to delete.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */;\n _proto.deleteAttributes = function deleteAttributes(attributeList, callback) {\n var _this14 = this;\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n return callback(new Error('User is not authenticated'), null);\n }\n this.client.request('DeleteUserAttributes', {\n UserAttributeNames: attributeList,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback(err, null);\n }\n\n // update cached user\n return _this14.getUserData(function () {\n return callback(null, 'SUCCESS');\n }, {\n bypassCache: true\n });\n });\n return undefined;\n }\n\n /**\n * This is used by a user to resend a confirmation code\n * @param {nodeCallback} callback Called on success or error.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */;\n _proto.resendConfirmationCode = function resendConfirmationCode(callback, clientMetadata) {\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n ClientMetadata: clientMetadata\n };\n this.client.request('ResendConfirmationCode', jsonReq, function (err, result) {\n if (err) {\n return callback(err, null);\n }\n return callback(null, result);\n });\n }\n\n /**\n * @typedef {Object} GetSessionOptions\n * @property {Record} clientMetadata - clientMetadata for getSession\n */\n\n /**\n * This is used to get a session, either from the session object\n * or from the local storage, or by using a refresh token\n *\n * @param {nodeCallback} callback Called on success or error.\n * @param {GetSessionOptions} options\n * @returns {void}\n */;\n _proto.getSession = function getSession(callback, options) {\n if (options === void 0) {\n options = {};\n }\n if (this.username == null) {\n return callback(new Error('Username is null. Cannot retrieve a new session'), null);\n }\n if (this.signInUserSession != null && this.signInUserSession.isValid()) {\n return callback(null, this.signInUserSession);\n }\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId() + \".\" + this.username;\n var idTokenKey = keyPrefix + \".idToken\";\n var accessTokenKey = keyPrefix + \".accessToken\";\n var refreshTokenKey = keyPrefix + \".refreshToken\";\n var clockDriftKey = keyPrefix + \".clockDrift\";\n if (this.storage.getItem(idTokenKey)) {\n var idToken = new CognitoIdToken({\n IdToken: this.storage.getItem(idTokenKey)\n });\n var accessToken = new CognitoAccessToken({\n AccessToken: this.storage.getItem(accessTokenKey)\n });\n var refreshToken = new CognitoRefreshToken({\n RefreshToken: this.storage.getItem(refreshTokenKey)\n });\n var clockDrift = parseInt(this.storage.getItem(clockDriftKey), 0) || 0;\n var sessionData = {\n IdToken: idToken,\n AccessToken: accessToken,\n RefreshToken: refreshToken,\n ClockDrift: clockDrift\n };\n var cachedSession = new CognitoUserSession(sessionData);\n if (cachedSession.isValid()) {\n this.signInUserSession = cachedSession;\n return callback(null, this.signInUserSession);\n }\n if (!refreshToken.getToken()) {\n return callback(new Error('Cannot retrieve a new session. Please authenticate.'), null);\n }\n this.refreshSession(refreshToken, callback, options.clientMetadata);\n } else {\n callback(new Error('Local storage is missing an ID Token, Please authenticate'), null);\n }\n return undefined;\n }\n\n /**\n * This uses the refreshToken to retrieve a new session\n * @param {CognitoRefreshToken} refreshToken A previous session's refresh token.\n * @param {nodeCallback} callback Called on success or error.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */;\n _proto.refreshSession = function refreshSession(refreshToken, callback, clientMetadata) {\n var _this15 = this;\n var wrappedCallback = this.pool.wrapRefreshSessionCallback ? this.pool.wrapRefreshSessionCallback(callback) : callback;\n var authParameters = {};\n authParameters.REFRESH_TOKEN = refreshToken.getToken();\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId();\n var lastUserKey = keyPrefix + \".LastAuthUser\";\n if (this.storage.getItem(lastUserKey)) {\n this.username = this.storage.getItem(lastUserKey);\n var deviceKeyKey = keyPrefix + \".\" + this.username + \".deviceKey\";\n this.deviceKey = this.storage.getItem(deviceKeyKey);\n authParameters.DEVICE_KEY = this.deviceKey;\n }\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n AuthFlow: 'REFRESH_TOKEN_AUTH',\n AuthParameters: authParameters,\n ClientMetadata: clientMetadata\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('InitiateAuth', jsonReq, function (err, authResult) {\n if (err) {\n if (err.code === 'NotAuthorizedException') {\n _this15.clearCachedUser();\n }\n return wrappedCallback(err, null);\n }\n if (authResult) {\n var authenticationResult = authResult.AuthenticationResult;\n if (!Object.prototype.hasOwnProperty.call(authenticationResult, 'RefreshToken')) {\n authenticationResult.RefreshToken = refreshToken.getToken();\n }\n _this15.signInUserSession = _this15.getCognitoUserSession(authenticationResult);\n _this15.cacheTokens();\n return wrappedCallback(null, _this15.signInUserSession);\n }\n return undefined;\n });\n }\n\n /**\n * This is used to save the session tokens to local storage\n * @returns {void}\n */;\n _proto.cacheTokens = function cacheTokens() {\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId();\n var idTokenKey = keyPrefix + \".\" + this.username + \".idToken\";\n var accessTokenKey = keyPrefix + \".\" + this.username + \".accessToken\";\n var refreshTokenKey = keyPrefix + \".\" + this.username + \".refreshToken\";\n var clockDriftKey = keyPrefix + \".\" + this.username + \".clockDrift\";\n var lastUserKey = keyPrefix + \".LastAuthUser\";\n this.storage.setItem(idTokenKey, this.signInUserSession.getIdToken().getJwtToken());\n this.storage.setItem(accessTokenKey, this.signInUserSession.getAccessToken().getJwtToken());\n this.storage.setItem(refreshTokenKey, this.signInUserSession.getRefreshToken().getToken());\n this.storage.setItem(clockDriftKey, \"\" + this.signInUserSession.getClockDrift());\n this.storage.setItem(lastUserKey, this.username);\n }\n\n /**\n * This is to cache user data\n */;\n _proto.cacheUserData = function cacheUserData(userData) {\n this.storage.setItem(this.userDataKey, JSON.stringify(userData));\n }\n\n /**\n * This is to remove cached user data\n */;\n _proto.clearCachedUserData = function clearCachedUserData() {\n this.storage.removeItem(this.userDataKey);\n };\n _proto.clearCachedUser = function clearCachedUser() {\n this.clearCachedTokens();\n this.clearCachedUserData();\n }\n\n /**\n * This is used to cache the device key and device group and device password\n * @returns {void}\n */;\n _proto.cacheDeviceKeyAndPassword = function cacheDeviceKeyAndPassword() {\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId() + \".\" + this.username;\n var deviceKeyKey = keyPrefix + \".deviceKey\";\n var randomPasswordKey = keyPrefix + \".randomPasswordKey\";\n var deviceGroupKeyKey = keyPrefix + \".deviceGroupKey\";\n this.storage.setItem(deviceKeyKey, this.deviceKey);\n this.storage.setItem(randomPasswordKey, this.randomPassword);\n this.storage.setItem(deviceGroupKeyKey, this.deviceGroupKey);\n }\n\n /**\n * This is used to get current device key and device group and device password\n * @returns {void}\n */;\n _proto.getCachedDeviceKeyAndPassword = function getCachedDeviceKeyAndPassword() {\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId() + \".\" + this.username;\n var deviceKeyKey = keyPrefix + \".deviceKey\";\n var randomPasswordKey = keyPrefix + \".randomPasswordKey\";\n var deviceGroupKeyKey = keyPrefix + \".deviceGroupKey\";\n if (this.storage.getItem(deviceKeyKey)) {\n this.deviceKey = this.storage.getItem(deviceKeyKey);\n this.randomPassword = this.storage.getItem(randomPasswordKey);\n this.deviceGroupKey = this.storage.getItem(deviceGroupKeyKey);\n }\n }\n\n /**\n * This is used to clear the device key info from local storage\n * @returns {void}\n */;\n _proto.clearCachedDeviceKeyAndPassword = function clearCachedDeviceKeyAndPassword() {\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId() + \".\" + this.username;\n var deviceKeyKey = keyPrefix + \".deviceKey\";\n var randomPasswordKey = keyPrefix + \".randomPasswordKey\";\n var deviceGroupKeyKey = keyPrefix + \".deviceGroupKey\";\n this.storage.removeItem(deviceKeyKey);\n this.storage.removeItem(randomPasswordKey);\n this.storage.removeItem(deviceGroupKeyKey);\n }\n\n /**\n * This is used to clear the session tokens from local storage\n * @returns {void}\n */;\n _proto.clearCachedTokens = function clearCachedTokens() {\n var keyPrefix = \"CognitoIdentityServiceProvider.\" + this.pool.getClientId();\n var idTokenKey = keyPrefix + \".\" + this.username + \".idToken\";\n var accessTokenKey = keyPrefix + \".\" + this.username + \".accessToken\";\n var refreshTokenKey = keyPrefix + \".\" + this.username + \".refreshToken\";\n var lastUserKey = keyPrefix + \".LastAuthUser\";\n var clockDriftKey = keyPrefix + \".\" + this.username + \".clockDrift\";\n this.storage.removeItem(idTokenKey);\n this.storage.removeItem(accessTokenKey);\n this.storage.removeItem(refreshTokenKey);\n this.storage.removeItem(lastUserKey);\n this.storage.removeItem(clockDriftKey);\n }\n\n /**\n * This is used to build a user session from tokens retrieved in the authentication result\n * @param {object} authResult Successful auth response from server.\n * @returns {CognitoUserSession} The new user session.\n * @private\n */;\n _proto.getCognitoUserSession = function getCognitoUserSession(authResult) {\n var idToken = new CognitoIdToken(authResult);\n var accessToken = new CognitoAccessToken(authResult);\n var refreshToken = new CognitoRefreshToken(authResult);\n var sessionData = {\n IdToken: idToken,\n AccessToken: accessToken,\n RefreshToken: refreshToken\n };\n return new CognitoUserSession(sessionData);\n }\n\n /**\n * This is used to initiate a forgot password request\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {inputVerificationCode?} callback.inputVerificationCode\n * Optional callback raised instead of onSuccess with response data.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */;\n _proto.forgotPassword = function forgotPassword(callback, clientMetadata) {\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n ClientMetadata: clientMetadata\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('ForgotPassword', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n if (typeof callback.inputVerificationCode === 'function') {\n return callback.inputVerificationCode(data);\n }\n return callback.onSuccess(data);\n });\n }\n\n /**\n * This is used to confirm a new password using a confirmationCode\n * @param {string} confirmationCode Code entered by user.\n * @param {string} newPassword Confirm new password.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */;\n _proto.confirmPassword = function confirmPassword(confirmationCode, newPassword, callback, clientMetadata) {\n var jsonReq = {\n ClientId: this.pool.getClientId(),\n Username: this.username,\n ConfirmationCode: confirmationCode,\n Password: newPassword,\n ClientMetadata: clientMetadata\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('ConfirmForgotPassword', jsonReq, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n }\n\n /**\n * This is used to initiate an attribute confirmation request\n * @param {string} attributeName User attribute that needs confirmation.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {inputVerificationCode} callback.inputVerificationCode Called on success.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */;\n _proto.getAttributeVerificationCode = function getAttributeVerificationCode(attributeName, callback, clientMetadata) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n this.client.request('GetUserAttributeVerificationCode', {\n AttributeName: attributeName,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n ClientMetadata: clientMetadata\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n if (typeof callback.inputVerificationCode === 'function') {\n return callback.inputVerificationCode(data);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to confirm an attribute using a confirmation code\n * @param {string} attributeName Attribute being confirmed.\n * @param {string} confirmationCode Code entered by user.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */;\n _proto.verifyAttribute = function verifyAttribute(attributeName, confirmationCode, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n this.client.request('VerifyUserAttribute', {\n AttributeName: attributeName,\n Code: confirmationCode,\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to get the device information using the current device key\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess<*>} callback.onSuccess Called on success with device data.\n * @returns {void}\n */;\n _proto.getDevice = function getDevice(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n this.client.request('GetDevice', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n return undefined;\n }\n\n /**\n * This is used to forget a specific device\n * @param {string} deviceKey Device key.\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */;\n _proto.forgetSpecificDevice = function forgetSpecificDevice(deviceKey, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n this.client.request('ForgetDevice', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: deviceKey\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to forget the current device\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */;\n _proto.forgetDevice = function forgetDevice(callback) {\n var _this16 = this;\n this.forgetSpecificDevice(this.deviceKey, {\n onFailure: callback.onFailure,\n onSuccess: function onSuccess(result) {\n _this16.deviceKey = null;\n _this16.deviceGroupKey = null;\n _this16.randomPassword = null;\n _this16.clearCachedDeviceKeyAndPassword();\n return callback.onSuccess(result);\n }\n });\n }\n\n /**\n * This is used to set the device status as remembered\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */;\n _proto.setDeviceStatusRemembered = function setDeviceStatusRemembered(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n this.client.request('UpdateDeviceStatus', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n DeviceRememberedStatus: 'remembered'\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to set the device status as not remembered\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */;\n _proto.setDeviceStatusNotRemembered = function setDeviceStatusNotRemembered(callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n this.client.request('UpdateDeviceStatus', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n DeviceKey: this.deviceKey,\n DeviceRememberedStatus: 'not_remembered'\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used to list all devices for a user\n *\n * @param {int} limit the number of devices returned in a call\n * @param {string | null} paginationToken the pagination token in case any was returned before\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess<*>} callback.onSuccess Called on success with device list.\n * @returns {void}\n */;\n _proto.listDevices = function listDevices(limit, paginationToken, callback) {\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n var requestParams = {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n Limit: limit\n };\n if (paginationToken) {\n requestParams.PaginationToken = paginationToken;\n }\n this.client.request('ListDevices', requestParams, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n return undefined;\n }\n\n /**\n * This is used to globally revoke all tokens issued to a user\n * @param {object} callback Result callback map.\n * @param {onFailure} callback.onFailure Called on any error.\n * @param {onSuccess} callback.onSuccess Called on success.\n * @returns {void}\n */;\n _proto.globalSignOut = function globalSignOut(callback) {\n var _this17 = this;\n if (this.signInUserSession == null || !this.signInUserSession.isValid()) {\n return callback.onFailure(new Error('User is not authenticated'));\n }\n this.client.request('GlobalSignOut', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err) {\n if (err) {\n return callback.onFailure(err);\n }\n _this17.clearCachedUser();\n return callback.onSuccess('SUCCESS');\n });\n return undefined;\n }\n\n /**\n * This is used for the user to signOut of the application and clear the cached tokens.\n * @returns {void}\n */;\n _proto.signOut = function signOut(revokeTokenCallback) {\n var _this18 = this;\n // If tokens won't be revoked, we just clean the client data.\n if (!revokeTokenCallback || typeof revokeTokenCallback !== 'function') {\n this.cleanClientData();\n return;\n }\n this.getSession(function (error, _session) {\n if (error) {\n return revokeTokenCallback(error);\n }\n _this18.revokeTokens(function (err) {\n _this18.cleanClientData();\n revokeTokenCallback(err);\n });\n });\n };\n _proto.revokeTokens = function revokeTokens(revokeTokenCallback) {\n if (revokeTokenCallback === void 0) {\n revokeTokenCallback = function revokeTokenCallback() {};\n }\n if (typeof revokeTokenCallback !== 'function') {\n throw new Error('Invalid revokeTokenCallback. It should be a function.');\n }\n var tokensToBeRevoked = [];\n if (!this.signInUserSession) {\n var error = new Error('User is not authenticated');\n return revokeTokenCallback(error);\n }\n if (!this.signInUserSession.getAccessToken()) {\n var _error = new Error('No Access token available');\n return revokeTokenCallback(_error);\n }\n var refreshToken = this.signInUserSession.getRefreshToken().getToken();\n var accessToken = this.signInUserSession.getAccessToken();\n if (this.isSessionRevocable(accessToken)) {\n if (refreshToken) {\n return this.revokeToken({\n token: refreshToken,\n callback: revokeTokenCallback\n });\n }\n }\n revokeTokenCallback();\n };\n _proto.isSessionRevocable = function isSessionRevocable(token) {\n if (token && typeof token.decodePayload === 'function') {\n try {\n var _token$decodePayload = token.decodePayload(),\n origin_jti = _token$decodePayload.origin_jti;\n return !!origin_jti;\n } catch (err) {\n // Nothing to do, token doesnt have origin_jti claim\n }\n }\n return false;\n };\n _proto.cleanClientData = function cleanClientData() {\n this.signInUserSession = null;\n this.clearCachedUser();\n };\n _proto.revokeToken = function revokeToken(_ref2) {\n var token = _ref2.token,\n callback = _ref2.callback;\n this.client.requestWithRetry('RevokeToken', {\n Token: token,\n ClientId: this.pool.getClientId()\n }, function (err) {\n if (err) {\n return callback(err);\n }\n callback();\n });\n }\n\n /**\n * This is used by a user trying to select a given MFA\n * @param {string} answerChallenge the mfa the user wants\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */;\n _proto.sendMFASelectionAnswer = function sendMFASelectionAnswer(answerChallenge, callback) {\n var _this19 = this;\n var challengeResponses = {};\n challengeResponses.USERNAME = this.username;\n challengeResponses.ANSWER = answerChallenge;\n var jsonReq = {\n ChallengeName: 'SELECT_MFA_TYPE',\n ChallengeResponses: challengeResponses,\n ClientId: this.pool.getClientId(),\n Session: this.Session\n };\n if (this.getUserContextData()) {\n jsonReq.UserContextData = this.getUserContextData();\n }\n this.client.request('RespondToAuthChallenge', jsonReq, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n _this19.Session = data.Session;\n if (answerChallenge === 'SMS_MFA') {\n return callback.mfaRequired(data.ChallengeName, data.ChallengeParameters);\n }\n if (answerChallenge === 'SOFTWARE_TOKEN_MFA') {\n return callback.totpRequired(data.ChallengeName, data.ChallengeParameters);\n }\n return undefined;\n });\n }\n\n /**\n * This returns the user context data for advanced security feature.\n * @returns {string} the user context data from CognitoUserPool\n */;\n _proto.getUserContextData = function getUserContextData() {\n var pool = this.pool;\n return pool.getUserContextData(this.username);\n }\n\n /**\n * This is used by an authenticated or a user trying to authenticate to associate a TOTP MFA\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */;\n _proto.associateSoftwareToken = function associateSoftwareToken(callback) {\n var _this20 = this;\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.client.request('AssociateSoftwareToken', {\n Session: this.Session\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n _this20.Session = data.Session;\n return callback.associateSecretCode(data.SecretCode);\n });\n } else {\n this.client.request('AssociateSoftwareToken', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken()\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.associateSecretCode(data.SecretCode);\n });\n }\n }\n\n /**\n * This is used by an authenticated or a user trying to authenticate to verify a TOTP MFA\n * @param {string} totpCode The MFA code entered by the user.\n * @param {string} friendlyDeviceName The device name we are assigning to the device.\n * @param {nodeCallback} callback Called on success or error.\n * @returns {void}\n */;\n _proto.verifySoftwareToken = function verifySoftwareToken(totpCode, friendlyDeviceName, callback) {\n var _this21 = this;\n if (!(this.signInUserSession != null && this.signInUserSession.isValid())) {\n this.client.request('VerifySoftwareToken', {\n Session: this.Session,\n UserCode: totpCode,\n FriendlyDeviceName: friendlyDeviceName\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n _this21.Session = data.Session;\n var challengeResponses = {};\n challengeResponses.USERNAME = _this21.username;\n var jsonReq = {\n ChallengeName: 'MFA_SETUP',\n ClientId: _this21.pool.getClientId(),\n ChallengeResponses: challengeResponses,\n Session: _this21.Session\n };\n if (_this21.getUserContextData()) {\n jsonReq.UserContextData = _this21.getUserContextData();\n }\n _this21.client.request('RespondToAuthChallenge', jsonReq, function (errRespond, dataRespond) {\n if (errRespond) {\n return callback.onFailure(errRespond);\n }\n _this21.signInUserSession = _this21.getCognitoUserSession(dataRespond.AuthenticationResult);\n _this21.cacheTokens();\n return callback.onSuccess(_this21.signInUserSession);\n });\n return undefined;\n });\n } else {\n this.client.request('VerifySoftwareToken', {\n AccessToken: this.signInUserSession.getAccessToken().getJwtToken(),\n UserCode: totpCode,\n FriendlyDeviceName: friendlyDeviceName\n }, function (err, data) {\n if (err) {\n return callback.onFailure(err);\n }\n return callback.onSuccess(data);\n });\n }\n };\n return CognitoUser;\n}();\nexport { CognitoUser as default };","export default function(e,n){return n=n||{},new Promise(function(t,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return{ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var l in s.open(n.method||\"get\",e,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\\S\\n]*([\\s\\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+\",\"+t:t}),t(a())},s.onerror=r,s.withCredentials=\"include\"==n.credentials,n.headers)s.setRequestHeader(l,n.headers[l]);s.send(n.body||null)})}\n//# sourceMappingURL=unfetch.module.js.map\n","module.exports = self.fetch || (self.fetch = require('unfetch').default || require('unfetch'));\n","import { getUserAgent } from \"./Platform\";\n// constructor\nfunction UserAgent() {}\n// public\nUserAgent.prototype.userAgent = getUserAgent();\nexport var appendToCognitoUserAgent = function appendToCognitoUserAgent(content) {\n if (!content) {\n return;\n }\n if (UserAgent.prototype.userAgent && !UserAgent.prototype.userAgent.includes(content)) {\n UserAgent.prototype.userAgent = UserAgent.prototype.userAgent.concat(' ', content);\n }\n if (!UserAgent.prototype.userAgent || UserAgent.prototype.userAgent === '') {\n UserAgent.prototype.userAgent = content;\n }\n};\n\n// class for defining the amzn user-agent\nexport default UserAgent;","function _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct.bind(); } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\nimport 'isomorphic-unfetch';\nimport UserAgent from './UserAgent';\nvar CognitoError = /*#__PURE__*/function (_Error) {\n _inheritsLoose(CognitoError, _Error);\n function CognitoError(message, code, name, statusCode) {\n var _this;\n _this = _Error.call(this, message) || this;\n _this.code = code;\n _this.name = name;\n _this.statusCode = statusCode;\n return _this;\n }\n return CognitoError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n/** @class */\nvar Client = /*#__PURE__*/function () {\n /**\n * Constructs a new AWS Cognito Identity Provider client object\n * @param {string} region AWS region\n * @param {string} endpoint endpoint\n * @param {object} fetchOptions options for fetch API (only credentials is supported)\n */\n function Client(region, endpoint, fetchOptions) {\n this.endpoint = endpoint || \"https://cognito-idp.\" + region + \".amazonaws.com/\";\n var _ref = fetchOptions || {},\n credentials = _ref.credentials;\n this.fetchOptions = credentials ? {\n credentials: credentials\n } : {};\n }\n\n /**\n * Makes an unauthenticated request on AWS Cognito Identity Provider API\n * using fetch\n * @param {string} operation API operation\n * @param {object} params Input parameters\n * @returns Promise\n */\n var _proto = Client.prototype;\n _proto.promisifyRequest = function promisifyRequest(operation, params) {\n var _this2 = this;\n return new Promise(function (resolve, reject) {\n _this2.request(operation, params, function (err, data) {\n if (err) {\n reject(new CognitoError(err.message, err.code, err.name, err.statusCode));\n } else {\n resolve(data);\n }\n });\n });\n };\n _proto.requestWithRetry = function requestWithRetry(operation, params, callback) {\n var _this3 = this;\n var MAX_DELAY_IN_MILLIS = 5 * 1000;\n jitteredExponentialRetry(function (p) {\n return new Promise(function (res, rej) {\n _this3.request(operation, p, function (error, result) {\n if (error) {\n rej(error);\n } else {\n res(result);\n }\n });\n });\n }, [params], MAX_DELAY_IN_MILLIS).then(function (result) {\n return callback(null, result);\n })[\"catch\"](function (error) {\n return callback(error);\n });\n }\n\n /**\n * Makes an unauthenticated request on AWS Cognito Identity Provider API\n * using fetch\n * @param {string} operation API operation\n * @param {object} params Input parameters\n * @param {function} callback Callback called when a response is returned\n * @returns {void}\n */;\n _proto.request = function request(operation, params, callback) {\n var headers = {\n 'Content-Type': 'application/x-amz-json-1.1',\n 'X-Amz-Target': \"AWSCognitoIdentityProviderService.\" + operation,\n 'X-Amz-User-Agent': UserAgent.prototype.userAgent,\n 'Cache-Control': 'no-store'\n };\n var options = Object.assign({}, this.fetchOptions, {\n headers: headers,\n method: 'POST',\n mode: 'cors',\n body: JSON.stringify(params)\n });\n var response;\n var responseJsonData;\n fetch(this.endpoint, options).then(function (resp) {\n response = resp;\n return resp;\n }, function (err) {\n // If error happens here, the request failed\n // if it is TypeError throw network error\n if (err instanceof TypeError) {\n throw new Error('Network error');\n }\n throw err;\n }).then(function (resp) {\n return resp.json()[\"catch\"](function () {\n return {};\n });\n }).then(function (data) {\n // return parsed body stream\n if (response.ok) return callback(null, data);\n responseJsonData = data;\n\n // Taken from aws-sdk-js/lib/protocol/json.js\n // eslint-disable-next-line no-underscore-dangle\n var code = (data.__type || data.code).split('#').pop();\n var error = new Error(data.message || data.Message || null);\n error.name = code;\n error.code = code;\n return callback(error);\n })[\"catch\"](function (err) {\n // first check if we have a service error\n if (response && response.headers && response.headers.get('x-amzn-errortype')) {\n try {\n var code = response.headers.get('x-amzn-errortype').split(':')[0];\n var error = new Error(response.status ? response.status.toString() : null);\n error.code = code;\n error.name = code;\n error.statusCode = response.status;\n return callback(error);\n } catch (ex) {\n return callback(err);\n }\n // otherwise check if error is Network error\n } else if (err instanceof Error && err.message === 'Network error') {\n err.code = 'NetworkError';\n }\n return callback(err);\n });\n };\n return Client;\n}();\nexport { Client as default };\nvar logger = {\n debug: function debug() {\n // Intentionally blank. This package doesn't have logging\n }\n};\n\n/**\n * For now, all errors are retryable.\n */\nvar NonRetryableError = /*#__PURE__*/function (_Error2) {\n _inheritsLoose(NonRetryableError, _Error2);\n function NonRetryableError(message) {\n var _this4;\n _this4 = _Error2.call(this, message) || this;\n _this4.nonRetryable = true;\n return _this4;\n }\n return NonRetryableError;\n}( /*#__PURE__*/_wrapNativeSuper(Error));\nvar isNonRetryableError = function isNonRetryableError(obj) {\n var key = 'nonRetryable';\n return obj && obj[key];\n};\nfunction retry(functionToRetry, args, delayFn, attempt) {\n if (attempt === void 0) {\n attempt = 1;\n }\n if (typeof functionToRetry !== 'function') {\n throw Error('functionToRetry must be a function');\n }\n logger.debug(functionToRetry.name + \" attempt #\" + attempt + \" with args: \" + JSON.stringify(args));\n return functionToRetry.apply(void 0, args)[\"catch\"](function (err) {\n logger.debug(\"error on \" + functionToRetry.name, err);\n if (isNonRetryableError(err)) {\n logger.debug(functionToRetry.name + \" non retryable error\", err);\n throw err;\n }\n var retryIn = delayFn(attempt, args, err);\n logger.debug(functionToRetry.name + \" retrying in \" + retryIn + \" ms\");\n if (retryIn !== false) {\n return new Promise(function (res) {\n return setTimeout(res, retryIn);\n }).then(function () {\n return retry(functionToRetry, args, delayFn, attempt + 1);\n });\n } else {\n throw err;\n }\n });\n}\nfunction jitteredBackoff(maxDelayMs) {\n var BASE_TIME_MS = 100;\n var JITTER_FACTOR = 100;\n return function (attempt) {\n var delay = Math.pow(2, attempt) * BASE_TIME_MS + JITTER_FACTOR * Math.random();\n return delay > maxDelayMs ? false : delay;\n };\n}\nvar MAX_DELAY_MS = 5 * 60 * 1000;\nfunction jitteredExponentialRetry(functionToRetry, args, maxDelayMs) {\n if (maxDelayMs === void 0) {\n maxDelayMs = MAX_DELAY_MS;\n }\n return retry(functionToRetry, args, jitteredBackoff(maxDelayMs));\n}","/*!\n * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport Client from './Client';\nimport CognitoUser from './CognitoUser';\nimport StorageHelper from './StorageHelper';\nvar USER_POOL_ID_MAX_LENGTH = 55;\n\n/** @class */\nvar CognitoUserPool = /*#__PURE__*/function () {\n /**\n * Constructs a new CognitoUserPool object\n * @param {object} data Creation options.\n * @param {string} data.UserPoolId Cognito user pool id.\n * @param {string} data.ClientId User pool application client id.\n * @param {string} data.endpoint Optional custom service endpoint.\n * @param {object} data.fetchOptions Optional options for fetch API.\n * (only credentials option is supported)\n * @param {object} data.Storage Optional storage object.\n * @param {boolean} data.AdvancedSecurityDataCollectionFlag Optional:\n * boolean flag indicating if the data collection is enabled\n * to support cognito advanced security features. By default, this\n * flag is set to true.\n */\n function CognitoUserPool(data, wrapRefreshSessionCallback) {\n var _ref = data || {},\n UserPoolId = _ref.UserPoolId,\n ClientId = _ref.ClientId,\n endpoint = _ref.endpoint,\n fetchOptions = _ref.fetchOptions,\n AdvancedSecurityDataCollectionFlag = _ref.AdvancedSecurityDataCollectionFlag;\n if (!UserPoolId || !ClientId) {\n throw new Error('Both UserPoolId and ClientId are required.');\n }\n if (UserPoolId.length > USER_POOL_ID_MAX_LENGTH || !/^[\\w-]+_[0-9a-zA-Z]+$/.test(UserPoolId)) {\n throw new Error('Invalid UserPoolId format.');\n }\n var region = UserPoolId.split('_')[0];\n this.userPoolId = UserPoolId;\n this.clientId = ClientId;\n this.client = new Client(region, endpoint, fetchOptions);\n\n /**\n * By default, AdvancedSecurityDataCollectionFlag is set to true,\n * if no input value is provided.\n */\n this.advancedSecurityDataCollectionFlag = AdvancedSecurityDataCollectionFlag !== false;\n this.storage = data.Storage || new StorageHelper().getStorage();\n if (wrapRefreshSessionCallback) {\n this.wrapRefreshSessionCallback = wrapRefreshSessionCallback;\n }\n }\n\n /**\n * @returns {string} the user pool id\n */\n var _proto = CognitoUserPool.prototype;\n _proto.getUserPoolId = function getUserPoolId() {\n return this.userPoolId;\n }\n\n /**\n * @returns {string} the user pool name\n */;\n _proto.getUserPoolName = function getUserPoolName() {\n return this.getUserPoolId().split('_')[1];\n }\n\n /**\n * @returns {string} the client id\n */;\n _proto.getClientId = function getClientId() {\n return this.clientId;\n }\n\n /**\n * @typedef {object} SignUpResult\n * @property {CognitoUser} user New user.\n * @property {bool} userConfirmed If the user is already confirmed.\n */\n /**\n * method for signing up a user\n * @param {string} username User's username.\n * @param {string} password Plain-text initial password entered by user.\n * @param {(AttributeArg[])=} userAttributes New user attributes.\n * @param {(AttributeArg[])=} validationData Application metadata.\n * @param {(AttributeArg[])=} clientMetadata Client metadata.\n * @param {nodeCallback} callback Called on error or with the new user.\n * @param {ClientMetadata} clientMetadata object which is passed from client to Cognito Lambda trigger\n * @returns {void}\n */;\n _proto.signUp = function signUp(username, password, userAttributes, validationData, callback, clientMetadata) {\n var _this = this;\n var jsonReq = {\n ClientId: this.clientId,\n Username: username,\n Password: password,\n UserAttributes: userAttributes,\n ValidationData: validationData,\n ClientMetadata: clientMetadata\n };\n if (this.getUserContextData(username)) {\n jsonReq.UserContextData = this.getUserContextData(username);\n }\n this.client.request('SignUp', jsonReq, function (err, data) {\n if (err) {\n return callback(err, null);\n }\n var cognitoUser = {\n Username: username,\n Pool: _this,\n Storage: _this.storage\n };\n var returnData = {\n user: new CognitoUser(cognitoUser),\n userConfirmed: data.UserConfirmed,\n userSub: data.UserSub,\n codeDeliveryDetails: data.CodeDeliveryDetails\n };\n return callback(null, returnData);\n });\n }\n\n /**\n * method for getting the current user of the application from the local storage\n *\n * @returns {CognitoUser} the user retrieved from storage\n */;\n _proto.getCurrentUser = function getCurrentUser() {\n var lastUserKey = \"CognitoIdentityServiceProvider.\" + this.clientId + \".LastAuthUser\";\n var lastAuthUser = this.storage.getItem(lastUserKey);\n if (lastAuthUser) {\n var cognitoUser = {\n Username: lastAuthUser,\n Pool: this,\n Storage: this.storage\n };\n return new CognitoUser(cognitoUser);\n }\n return null;\n }\n\n /**\n * This method returns the encoded data string used for cognito advanced security feature.\n * This would be generated only when developer has included the JS used for collecting the\n * data on their client. Please refer to documentation to know more about using AdvancedSecurity\n * features\n * @param {string} username the username for the context data\n * @returns {string} the user context data\n **/;\n _proto.getUserContextData = function getUserContextData(username) {\n if (typeof AmazonCognitoAdvancedSecurityData === 'undefined') {\n return undefined;\n }\n /* eslint-disable */\n var amazonCognitoAdvancedSecurityDataConst = AmazonCognitoAdvancedSecurityData;\n /* eslint-enable */\n\n if (this.advancedSecurityDataCollectionFlag) {\n var advancedSecurityData = amazonCognitoAdvancedSecurityDataConst.getData(username, this.userPoolId, this.clientId);\n if (advancedSecurityData) {\n var userContextData = {\n EncodedData: advancedSecurityData\n };\n return userContextData;\n }\n }\n return {};\n };\n return CognitoUserPool;\n}();\nexport { CognitoUserPool as default };","/*!\n * JavaScript Cookie v2.2.1\n * https://github.com/js-cookie/js-cookie\n *\n * Copyright 2006, 2015 Klaus Hartl & Fagner Brack\n * Released under the MIT license\n */\n;(function (factory) {\n\tvar registeredInModuleLoader;\n\tif (typeof define === 'function' && define.amd) {\n\t\tdefine(factory);\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (typeof exports === 'object') {\n\t\tmodule.exports = factory();\n\t\tregisteredInModuleLoader = true;\n\t}\n\tif (!registeredInModuleLoader) {\n\t\tvar OldCookies = window.Cookies;\n\t\tvar api = window.Cookies = factory();\n\t\tapi.noConflict = function () {\n\t\t\twindow.Cookies = OldCookies;\n\t\t\treturn api;\n\t\t};\n\t}\n}(function () {\n\tfunction extend () {\n\t\tvar i = 0;\n\t\tvar result = {};\n\t\tfor (; i < arguments.length; i++) {\n\t\t\tvar attributes = arguments[ i ];\n\t\t\tfor (var key in attributes) {\n\t\t\t\tresult[key] = attributes[key];\n\t\t\t}\n\t\t}\n\t\treturn result;\n\t}\n\n\tfunction decode (s) {\n\t\treturn s.replace(/(%[0-9A-Z]{2})+/g, decodeURIComponent);\n\t}\n\n\tfunction init (converter) {\n\t\tfunction api() {}\n\n\t\tfunction set (key, value, attributes) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tattributes = extend({\n\t\t\t\tpath: '/'\n\t\t\t}, api.defaults, attributes);\n\n\t\t\tif (typeof attributes.expires === 'number') {\n\t\t\t\tattributes.expires = new Date(new Date() * 1 + attributes.expires * 864e+5);\n\t\t\t}\n\n\t\t\t// We're using \"expires\" because \"max-age\" is not supported by IE\n\t\t\tattributes.expires = attributes.expires ? attributes.expires.toUTCString() : '';\n\n\t\t\ttry {\n\t\t\t\tvar result = JSON.stringify(value);\n\t\t\t\tif (/^[\\{\\[]/.test(result)) {\n\t\t\t\t\tvalue = result;\n\t\t\t\t}\n\t\t\t} catch (e) {}\n\n\t\t\tvalue = converter.write ?\n\t\t\t\tconverter.write(value, key) :\n\t\t\t\tencodeURIComponent(String(value))\n\t\t\t\t\t.replace(/%(23|24|26|2B|3A|3C|3E|3D|2F|3F|40|5B|5D|5E|60|7B|7D|7C)/g, decodeURIComponent);\n\n\t\t\tkey = encodeURIComponent(String(key))\n\t\t\t\t.replace(/%(23|24|26|2B|5E|60|7C)/g, decodeURIComponent)\n\t\t\t\t.replace(/[\\(\\)]/g, escape);\n\n\t\t\tvar stringifiedAttributes = '';\n\t\t\tfor (var attributeName in attributes) {\n\t\t\t\tif (!attributes[attributeName]) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\t\t\t\tstringifiedAttributes += '; ' + attributeName;\n\t\t\t\tif (attributes[attributeName] === true) {\n\t\t\t\t\tcontinue;\n\t\t\t\t}\n\n\t\t\t\t// Considers RFC 6265 section 5.2:\n\t\t\t\t// ...\n\t\t\t\t// 3. If the remaining unparsed-attributes contains a %x3B (\";\")\n\t\t\t\t// character:\n\t\t\t\t// Consume the characters of the unparsed-attributes up to,\n\t\t\t\t// not including, the first %x3B (\";\") character.\n\t\t\t\t// ...\n\t\t\t\tstringifiedAttributes += '=' + attributes[attributeName].split(';')[0];\n\t\t\t}\n\n\t\t\treturn (document.cookie = key + '=' + value + stringifiedAttributes);\n\t\t}\n\n\t\tfunction get (key, json) {\n\t\t\tif (typeof document === 'undefined') {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tvar jar = {};\n\t\t\t// To prevent the for loop in the first place assign an empty array\n\t\t\t// in case there are no cookies at all.\n\t\t\tvar cookies = document.cookie ? document.cookie.split('; ') : [];\n\t\t\tvar i = 0;\n\n\t\t\tfor (; i < cookies.length; i++) {\n\t\t\t\tvar parts = cookies[i].split('=');\n\t\t\t\tvar cookie = parts.slice(1).join('=');\n\n\t\t\t\tif (!json && cookie.charAt(0) === '\"') {\n\t\t\t\t\tcookie = cookie.slice(1, -1);\n\t\t\t\t}\n\n\t\t\t\ttry {\n\t\t\t\t\tvar name = decode(parts[0]);\n\t\t\t\t\tcookie = (converter.read || converter)(cookie, name) ||\n\t\t\t\t\t\tdecode(cookie);\n\n\t\t\t\t\tif (json) {\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tcookie = JSON.parse(cookie);\n\t\t\t\t\t\t} catch (e) {}\n\t\t\t\t\t}\n\n\t\t\t\t\tjar[name] = cookie;\n\n\t\t\t\t\tif (key === name) {\n\t\t\t\t\t\tbreak;\n\t\t\t\t\t}\n\t\t\t\t} catch (e) {}\n\t\t\t}\n\n\t\t\treturn key ? jar[key] : jar;\n\t\t}\n\n\t\tapi.set = set;\n\t\tapi.get = function (key) {\n\t\t\treturn get(key, false /* read as raw */);\n\t\t};\n\t\tapi.getJSON = function (key) {\n\t\t\treturn get(key, true /* read as json */);\n\t\t};\n\t\tapi.remove = function (key, attributes) {\n\t\t\tset(key, '', extend(attributes, {\n\t\t\t\texpires: -1\n\t\t\t}));\n\t\t};\n\n\t\tapi.defaults = {};\n\n\t\tapi.withConverter = init;\n\n\t\treturn api;\n\t}\n\n\treturn init(function () {});\n}));\n","import * as Cookies from 'js-cookie';\n\n/** @class */\nvar CookieStorage = /*#__PURE__*/function () {\n /**\n * Constructs a new CookieStorage object\n * @param {object} data Creation options.\n * @param {string} data.domain Cookies domain (default: domain of the page\n * \t\t\t\twhere the cookie was created, excluding subdomains)\n * @param {string} data.path Cookies path (default: '/')\n * @param {integer} data.expires Cookie expiration (in days, default: 365)\n * @param {boolean} data.secure Cookie secure flag (default: true)\n * @param {string} data.sameSite Cookie request behavior (default: null)\n */\n function CookieStorage(data) {\n if (data === void 0) {\n data = {};\n }\n if (data.domain) {\n this.domain = data.domain;\n }\n if (data.path) {\n this.path = data.path;\n } else {\n this.path = '/';\n }\n if (Object.prototype.hasOwnProperty.call(data, 'expires')) {\n this.expires = data.expires;\n } else {\n this.expires = 365;\n }\n if (Object.prototype.hasOwnProperty.call(data, 'secure')) {\n this.secure = data.secure;\n } else {\n this.secure = true;\n }\n if (Object.prototype.hasOwnProperty.call(data, 'sameSite')) {\n if (!['strict', 'lax', 'none'].includes(data.sameSite)) {\n throw new Error('The sameSite value of cookieStorage must be \"lax\", \"strict\" or \"none\".');\n }\n if (data.sameSite === 'none' && !this.secure) {\n throw new Error('sameSite = None requires the Secure attribute in latest browser versions.');\n }\n this.sameSite = data.sameSite;\n } else {\n this.sameSite = null;\n }\n }\n\n /**\n * This is used to set a specific item in storage\n * @param {string} key - the key for the item\n * @param {object} value - the value\n * @returns {string} value that was set\n */\n var _proto = CookieStorage.prototype;\n _proto.setItem = function setItem(key, value) {\n var options = {\n path: this.path,\n expires: this.expires,\n domain: this.domain,\n secure: this.secure\n };\n if (this.sameSite) {\n options.sameSite = this.sameSite;\n }\n Cookies.set(key, value, options);\n return Cookies.get(key);\n }\n\n /**\n * This is used to get a specific key from storage\n * @param {string} key - the key for the item\n * This is used to clear the storage\n * @returns {string} the data item\n */;\n _proto.getItem = function getItem(key) {\n return Cookies.get(key);\n }\n\n /**\n * This is used to remove an item from storage\n * @param {string} key - the key being set\n * @returns {string} value - value that was deleted\n */;\n _proto.removeItem = function removeItem(key) {\n var options = {\n path: this.path,\n expires: this.expires,\n domain: this.domain,\n secure: this.secure\n };\n if (this.sameSite) {\n options.sameSite = this.sameSite;\n }\n return Cookies.remove(key, options);\n }\n\n /**\n * This is used to clear the storage of optional\n * items that were previously set\n * @returns {} an empty object\n */;\n _proto.clear = function clear() {\n var cookies = Cookies.get();\n var numKeys = Object.keys(cookies).length;\n for (var index = 0; index < numKeys; ++index) {\n this.removeItem(Object.keys(cookies)[index]);\n }\n return {};\n };\n return CookieStorage;\n}();\nexport { CookieStorage as default };","/*! https://mths.be/punycode v1.4.1 by @mathias */\n;(function(root) {\n\n\t/** Detect free variables */\n\tvar freeExports = typeof exports == 'object' && exports &&\n\t\t!exports.nodeType && exports;\n\tvar freeModule = typeof module == 'object' && module &&\n\t\t!module.nodeType && module;\n\tvar freeGlobal = typeof global == 'object' && global;\n\tif (\n\t\tfreeGlobal.global === freeGlobal ||\n\t\tfreeGlobal.window === freeGlobal ||\n\t\tfreeGlobal.self === freeGlobal\n\t) {\n\t\troot = freeGlobal;\n\t}\n\n\t/**\n\t * The `punycode` object.\n\t * @name punycode\n\t * @type Object\n\t */\n\tvar punycode,\n\n\t/** Highest positive signed 32-bit float value */\n\tmaxInt = 2147483647, // aka. 0x7FFFFFFF or 2^31-1\n\n\t/** Bootstring parameters */\n\tbase = 36,\n\ttMin = 1,\n\ttMax = 26,\n\tskew = 38,\n\tdamp = 700,\n\tinitialBias = 72,\n\tinitialN = 128, // 0x80\n\tdelimiter = '-', // '\\x2D'\n\n\t/** Regular expressions */\n\tregexPunycode = /^xn--/,\n\tregexNonASCII = /[^\\x20-\\x7E]/, // unprintable ASCII chars + non-ASCII chars\n\tregexSeparators = /[\\x2E\\u3002\\uFF0E\\uFF61]/g, // RFC 3490 separators\n\n\t/** Error messages */\n\terrors = {\n\t\t'overflow': 'Overflow: input needs wider integers to process',\n\t\t'not-basic': 'Illegal input >= 0x80 (not a basic code point)',\n\t\t'invalid-input': 'Invalid input'\n\t},\n\n\t/** Convenience shortcuts */\n\tbaseMinusTMin = base - tMin,\n\tfloor = Math.floor,\n\tstringFromCharCode = String.fromCharCode,\n\n\t/** Temporary variable */\n\tkey;\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/**\n\t * A generic error utility function.\n\t * @private\n\t * @param {String} type The error type.\n\t * @returns {Error} Throws a `RangeError` with the applicable error message.\n\t */\n\tfunction error(type) {\n\t\tthrow new RangeError(errors[type]);\n\t}\n\n\t/**\n\t * A generic `Array#map` utility function.\n\t * @private\n\t * @param {Array} array The array to iterate over.\n\t * @param {Function} callback The function that gets called for every array\n\t * item.\n\t * @returns {Array} A new array of values returned by the callback function.\n\t */\n\tfunction map(array, fn) {\n\t\tvar length = array.length;\n\t\tvar result = [];\n\t\twhile (length--) {\n\t\t\tresult[length] = fn(array[length]);\n\t\t}\n\t\treturn result;\n\t}\n\n\t/**\n\t * A simple `Array#map`-like wrapper to work with domain name strings or email\n\t * addresses.\n\t * @private\n\t * @param {String} domain The domain name or email address.\n\t * @param {Function} callback The function that gets called for every\n\t * character.\n\t * @returns {Array} A new string of characters returned by the callback\n\t * function.\n\t */\n\tfunction mapDomain(string, fn) {\n\t\tvar parts = string.split('@');\n\t\tvar result = '';\n\t\tif (parts.length > 1) {\n\t\t\t// In email addresses, only the domain name should be punycoded. Leave\n\t\t\t// the local part (i.e. everything up to `@`) intact.\n\t\t\tresult = parts[0] + '@';\n\t\t\tstring = parts[1];\n\t\t}\n\t\t// Avoid `split(regex)` for IE8 compatibility. See #17.\n\t\tstring = string.replace(regexSeparators, '\\x2E');\n\t\tvar labels = string.split('.');\n\t\tvar encoded = map(labels, fn).join('.');\n\t\treturn result + encoded;\n\t}\n\n\t/**\n\t * Creates an array containing the numeric code points of each Unicode\n\t * character in the string. While JavaScript uses UCS-2 internally,\n\t * this function will convert a pair of surrogate halves (each of which\n\t * UCS-2 exposes as separate characters) into a single code point,\n\t * matching UTF-16.\n\t * @see `punycode.ucs2.encode`\n\t * @see \n\t * @memberOf punycode.ucs2\n\t * @name decode\n\t * @param {String} string The Unicode input string (UCS-2).\n\t * @returns {Array} The new array of code points.\n\t */\n\tfunction ucs2decode(string) {\n\t\tvar output = [],\n\t\t counter = 0,\n\t\t length = string.length,\n\t\t value,\n\t\t extra;\n\t\twhile (counter < length) {\n\t\t\tvalue = string.charCodeAt(counter++);\n\t\t\tif (value >= 0xD800 && value <= 0xDBFF && counter < length) {\n\t\t\t\t// high surrogate, and there is a next character\n\t\t\t\textra = string.charCodeAt(counter++);\n\t\t\t\tif ((extra & 0xFC00) == 0xDC00) { // low surrogate\n\t\t\t\t\toutput.push(((value & 0x3FF) << 10) + (extra & 0x3FF) + 0x10000);\n\t\t\t\t} else {\n\t\t\t\t\t// unmatched surrogate; only append this code unit, in case the next\n\t\t\t\t\t// code unit is the high surrogate of a surrogate pair\n\t\t\t\t\toutput.push(value);\n\t\t\t\t\tcounter--;\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\toutput.push(value);\n\t\t\t}\n\t\t}\n\t\treturn output;\n\t}\n\n\t/**\n\t * Creates a string based on an array of numeric code points.\n\t * @see `punycode.ucs2.decode`\n\t * @memberOf punycode.ucs2\n\t * @name encode\n\t * @param {Array} codePoints The array of numeric code points.\n\t * @returns {String} The new Unicode string (UCS-2).\n\t */\n\tfunction ucs2encode(array) {\n\t\treturn map(array, function(value) {\n\t\t\tvar output = '';\n\t\t\tif (value > 0xFFFF) {\n\t\t\t\tvalue -= 0x10000;\n\t\t\t\toutput += stringFromCharCode(value >>> 10 & 0x3FF | 0xD800);\n\t\t\t\tvalue = 0xDC00 | value & 0x3FF;\n\t\t\t}\n\t\t\toutput += stringFromCharCode(value);\n\t\t\treturn output;\n\t\t}).join('');\n\t}\n\n\t/**\n\t * Converts a basic code point into a digit/integer.\n\t * @see `digitToBasic()`\n\t * @private\n\t * @param {Number} codePoint The basic numeric code point value.\n\t * @returns {Number} The numeric value of a basic code point (for use in\n\t * representing integers) in the range `0` to `base - 1`, or `base` if\n\t * the code point does not represent a value.\n\t */\n\tfunction basicToDigit(codePoint) {\n\t\tif (codePoint - 48 < 10) {\n\t\t\treturn codePoint - 22;\n\t\t}\n\t\tif (codePoint - 65 < 26) {\n\t\t\treturn codePoint - 65;\n\t\t}\n\t\tif (codePoint - 97 < 26) {\n\t\t\treturn codePoint - 97;\n\t\t}\n\t\treturn base;\n\t}\n\n\t/**\n\t * Converts a digit/integer into a basic code point.\n\t * @see `basicToDigit()`\n\t * @private\n\t * @param {Number} digit The numeric value of a basic code point.\n\t * @returns {Number} The basic code point whose value (when used for\n\t * representing integers) is `digit`, which needs to be in the range\n\t * `0` to `base - 1`. If `flag` is non-zero, the uppercase form is\n\t * used; else, the lowercase form is used. The behavior is undefined\n\t * if `flag` is non-zero and `digit` has no uppercase form.\n\t */\n\tfunction digitToBasic(digit, flag) {\n\t\t// 0..25 map to ASCII a..z or A..Z\n\t\t// 26..35 map to ASCII 0..9\n\t\treturn digit + 22 + 75 * (digit < 26) - ((flag != 0) << 5);\n\t}\n\n\t/**\n\t * Bias adaptation function as per section 3.4 of RFC 3492.\n\t * https://tools.ietf.org/html/rfc3492#section-3.4\n\t * @private\n\t */\n\tfunction adapt(delta, numPoints, firstTime) {\n\t\tvar k = 0;\n\t\tdelta = firstTime ? floor(delta / damp) : delta >> 1;\n\t\tdelta += floor(delta / numPoints);\n\t\tfor (/* no initialization */; delta > baseMinusTMin * tMax >> 1; k += base) {\n\t\t\tdelta = floor(delta / baseMinusTMin);\n\t\t}\n\t\treturn floor(k + (baseMinusTMin + 1) * delta / (delta + skew));\n\t}\n\n\t/**\n\t * Converts a Punycode string of ASCII-only symbols to a string of Unicode\n\t * symbols.\n\t * @memberOf punycode\n\t * @param {String} input The Punycode string of ASCII-only symbols.\n\t * @returns {String} The resulting string of Unicode symbols.\n\t */\n\tfunction decode(input) {\n\t\t// Don't use UCS-2\n\t\tvar output = [],\n\t\t inputLength = input.length,\n\t\t out,\n\t\t i = 0,\n\t\t n = initialN,\n\t\t bias = initialBias,\n\t\t basic,\n\t\t j,\n\t\t index,\n\t\t oldi,\n\t\t w,\n\t\t k,\n\t\t digit,\n\t\t t,\n\t\t /** Cached calculation results */\n\t\t baseMinusT;\n\n\t\t// Handle the basic code points: let `basic` be the number of input code\n\t\t// points before the last delimiter, or `0` if there is none, then copy\n\t\t// the first basic code points to the output.\n\n\t\tbasic = input.lastIndexOf(delimiter);\n\t\tif (basic < 0) {\n\t\t\tbasic = 0;\n\t\t}\n\n\t\tfor (j = 0; j < basic; ++j) {\n\t\t\t// if it's not a basic code point\n\t\t\tif (input.charCodeAt(j) >= 0x80) {\n\t\t\t\terror('not-basic');\n\t\t\t}\n\t\t\toutput.push(input.charCodeAt(j));\n\t\t}\n\n\t\t// Main decoding loop: start just after the last delimiter if any basic code\n\t\t// points were copied; start at the beginning otherwise.\n\n\t\tfor (index = basic > 0 ? basic + 1 : 0; index < inputLength; /* no final expression */) {\n\n\t\t\t// `index` is the index of the next character to be consumed.\n\t\t\t// Decode a generalized variable-length integer into `delta`,\n\t\t\t// which gets added to `i`. The overflow checking is easier\n\t\t\t// if we increase `i` as we go, then subtract off its starting\n\t\t\t// value at the end to obtain `delta`.\n\t\t\tfor (oldi = i, w = 1, k = base; /* no condition */; k += base) {\n\n\t\t\t\tif (index >= inputLength) {\n\t\t\t\t\terror('invalid-input');\n\t\t\t\t}\n\n\t\t\t\tdigit = basicToDigit(input.charCodeAt(index++));\n\n\t\t\t\tif (digit >= base || digit > floor((maxInt - i) / w)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\ti += digit * w;\n\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\n\t\t\t\tif (digit < t) {\n\t\t\t\t\tbreak;\n\t\t\t\t}\n\n\t\t\t\tbaseMinusT = base - t;\n\t\t\t\tif (w > floor(maxInt / baseMinusT)) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tw *= baseMinusT;\n\n\t\t\t}\n\n\t\t\tout = output.length + 1;\n\t\t\tbias = adapt(i - oldi, out, oldi == 0);\n\n\t\t\t// `i` was supposed to wrap around from `out` to `0`,\n\t\t\t// incrementing `n` each time, so we'll fix that now:\n\t\t\tif (floor(i / out) > maxInt - n) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tn += floor(i / out);\n\t\t\ti %= out;\n\n\t\t\t// Insert `n` at position `i` of the output\n\t\t\toutput.splice(i++, 0, n);\n\n\t\t}\n\n\t\treturn ucs2encode(output);\n\t}\n\n\t/**\n\t * Converts a string of Unicode symbols (e.g. a domain name label) to a\n\t * Punycode string of ASCII-only symbols.\n\t * @memberOf punycode\n\t * @param {String} input The string of Unicode symbols.\n\t * @returns {String} The resulting Punycode string of ASCII-only symbols.\n\t */\n\tfunction encode(input) {\n\t\tvar n,\n\t\t delta,\n\t\t handledCPCount,\n\t\t basicLength,\n\t\t bias,\n\t\t j,\n\t\t m,\n\t\t q,\n\t\t k,\n\t\t t,\n\t\t currentValue,\n\t\t output = [],\n\t\t /** `inputLength` will hold the number of code points in `input`. */\n\t\t inputLength,\n\t\t /** Cached calculation results */\n\t\t handledCPCountPlusOne,\n\t\t baseMinusT,\n\t\t qMinusT;\n\n\t\t// Convert the input in UCS-2 to Unicode\n\t\tinput = ucs2decode(input);\n\n\t\t// Cache the length\n\t\tinputLength = input.length;\n\n\t\t// Initialize the state\n\t\tn = initialN;\n\t\tdelta = 0;\n\t\tbias = initialBias;\n\n\t\t// Handle the basic code points\n\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\tcurrentValue = input[j];\n\t\t\tif (currentValue < 0x80) {\n\t\t\t\toutput.push(stringFromCharCode(currentValue));\n\t\t\t}\n\t\t}\n\n\t\thandledCPCount = basicLength = output.length;\n\n\t\t// `handledCPCount` is the number of code points that have been handled;\n\t\t// `basicLength` is the number of basic code points.\n\n\t\t// Finish the basic string - if it is not empty - with a delimiter\n\t\tif (basicLength) {\n\t\t\toutput.push(delimiter);\n\t\t}\n\n\t\t// Main encoding loop:\n\t\twhile (handledCPCount < inputLength) {\n\n\t\t\t// All non-basic code points < n have been handled already. Find the next\n\t\t\t// larger one:\n\t\t\tfor (m = maxInt, j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\t\t\t\tif (currentValue >= n && currentValue < m) {\n\t\t\t\t\tm = currentValue;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Increase `delta` enough to advance the decoder's state to ,\n\t\t\t// but guard against overflow\n\t\t\thandledCPCountPlusOne = handledCPCount + 1;\n\t\t\tif (m - n > floor((maxInt - delta) / handledCPCountPlusOne)) {\n\t\t\t\terror('overflow');\n\t\t\t}\n\n\t\t\tdelta += (m - n) * handledCPCountPlusOne;\n\t\t\tn = m;\n\n\t\t\tfor (j = 0; j < inputLength; ++j) {\n\t\t\t\tcurrentValue = input[j];\n\n\t\t\t\tif (currentValue < n && ++delta > maxInt) {\n\t\t\t\t\terror('overflow');\n\t\t\t\t}\n\n\t\t\t\tif (currentValue == n) {\n\t\t\t\t\t// Represent delta as a generalized variable-length integer\n\t\t\t\t\tfor (q = delta, k = base; /* no condition */; k += base) {\n\t\t\t\t\t\tt = k <= bias ? tMin : (k >= bias + tMax ? tMax : k - bias);\n\t\t\t\t\t\tif (q < t) {\n\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tqMinusT = q - t;\n\t\t\t\t\t\tbaseMinusT = base - t;\n\t\t\t\t\t\toutput.push(\n\t\t\t\t\t\t\tstringFromCharCode(digitToBasic(t + qMinusT % baseMinusT, 0))\n\t\t\t\t\t\t);\n\t\t\t\t\t\tq = floor(qMinusT / baseMinusT);\n\t\t\t\t\t}\n\n\t\t\t\t\toutput.push(stringFromCharCode(digitToBasic(q, 0)));\n\t\t\t\t\tbias = adapt(delta, handledCPCountPlusOne, handledCPCount == basicLength);\n\t\t\t\t\tdelta = 0;\n\t\t\t\t\t++handledCPCount;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t++delta;\n\t\t\t++n;\n\n\t\t}\n\t\treturn output.join('');\n\t}\n\n\t/**\n\t * Converts a Punycode string representing a domain name or an email address\n\t * to Unicode. Only the Punycoded parts of the input will be converted, i.e.\n\t * it doesn't matter if you call it on a string that has already been\n\t * converted to Unicode.\n\t * @memberOf punycode\n\t * @param {String} input The Punycoded domain name or email address to\n\t * convert to Unicode.\n\t * @returns {String} The Unicode representation of the given Punycode\n\t * string.\n\t */\n\tfunction toUnicode(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexPunycode.test(string)\n\t\t\t\t? decode(string.slice(4).toLowerCase())\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/**\n\t * Converts a Unicode string representing a domain name or an email address to\n\t * Punycode. Only the non-ASCII parts of the domain name will be converted,\n\t * i.e. it doesn't matter if you call it with a domain that's already in\n\t * ASCII.\n\t * @memberOf punycode\n\t * @param {String} input The domain name or email address to convert, as a\n\t * Unicode string.\n\t * @returns {String} The Punycode representation of the given domain name or\n\t * email address.\n\t */\n\tfunction toASCII(input) {\n\t\treturn mapDomain(input, function(string) {\n\t\t\treturn regexNonASCII.test(string)\n\t\t\t\t? 'xn--' + encode(string)\n\t\t\t\t: string;\n\t\t});\n\t}\n\n\t/*--------------------------------------------------------------------------*/\n\n\t/** Define the public API */\n\tpunycode = {\n\t\t/**\n\t\t * A string representing the current Punycode.js version number.\n\t\t * @memberOf punycode\n\t\t * @type String\n\t\t */\n\t\t'version': '1.4.1',\n\t\t/**\n\t\t * An object of methods to convert from JavaScript's internal character\n\t\t * representation (UCS-2) to Unicode code points, and back.\n\t\t * @see \n\t\t * @memberOf punycode\n\t\t * @type Object\n\t\t */\n\t\t'ucs2': {\n\t\t\t'decode': ucs2decode,\n\t\t\t'encode': ucs2encode\n\t\t},\n\t\t'decode': decode,\n\t\t'encode': encode,\n\t\t'toASCII': toASCII,\n\t\t'toUnicode': toUnicode\n\t};\n\n\t/** Expose `punycode` */\n\t// Some AMD build optimizers, like r.js, check for specific condition patterns\n\t// like the following:\n\tif (\n\t\ttypeof define == 'function' &&\n\t\ttypeof define.amd == 'object' &&\n\t\tdefine.amd\n\t) {\n\t\tdefine('punycode', function() {\n\t\t\treturn punycode;\n\t\t});\n\t} else if (freeExports && freeModule) {\n\t\tif (module.exports == freeExports) {\n\t\t\t// in Node.js, io.js, or RingoJS v0.8.0+\n\t\t\tfreeModule.exports = punycode;\n\t\t} else {\n\t\t\t// in Narwhal or RingoJS v0.7.0-\n\t\t\tfor (key in punycode) {\n\t\t\t\tpunycode.hasOwnProperty(key) && (freeExports[key] = punycode[key]);\n\t\t\t}\n\t\t}\n\t} else {\n\t\t// in Rhino or a web browser\n\t\troot.punycode = punycode;\n\t}\n\n}(this));\n","'use strict';\n\n/** @type {import('.')} */\nmodule.exports = Error;\n","'use strict';\n\n/** @type {import('./eval')} */\nmodule.exports = EvalError;\n","'use strict';\n\n/** @type {import('./range')} */\nmodule.exports = RangeError;\n","'use strict';\n\n/** @type {import('./ref')} */\nmodule.exports = ReferenceError;\n","'use strict';\n\n/** @type {import('./syntax')} */\nmodule.exports = SyntaxError;\n","'use strict';\n\n/** @type {import('./type')} */\nmodule.exports = TypeError;\n","'use strict';\n\n/** @type {import('./uri')} */\nmodule.exports = URIError;\n","'use strict';\n\n/* eslint complexity: [2, 18], max-statements: [2, 33] */\nmodule.exports = function hasSymbols() {\n\tif (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; }\n\tif (typeof Symbol.iterator === 'symbol') { return true; }\n\n\tvar obj = {};\n\tvar sym = Symbol('test');\n\tvar symObj = Object(sym);\n\tif (typeof sym === 'string') { return false; }\n\n\tif (Object.prototype.toString.call(sym) !== '[object Symbol]') { return false; }\n\tif (Object.prototype.toString.call(symObj) !== '[object Symbol]') { return false; }\n\n\t// temp disabled per https://github.com/ljharb/object.assign/issues/17\n\t// if (sym instanceof Symbol) { return false; }\n\t// temp disabled per https://github.com/WebReflection/get-own-property-symbols/issues/4\n\t// if (!(symObj instanceof Symbol)) { return false; }\n\n\t// if (typeof Symbol.prototype.toString !== 'function') { return false; }\n\t// if (String(sym) !== Symbol.prototype.toString.call(sym)) { return false; }\n\n\tvar symVal = 42;\n\tobj[sym] = symVal;\n\tfor (sym in obj) { return false; } // eslint-disable-line no-restricted-syntax, no-unreachable-loop\n\tif (typeof Object.keys === 'function' && Object.keys(obj).length !== 0) { return false; }\n\n\tif (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(obj).length !== 0) { return false; }\n\n\tvar syms = Object.getOwnPropertySymbols(obj);\n\tif (syms.length !== 1 || syms[0] !== sym) { return false; }\n\n\tif (!Object.prototype.propertyIsEnumerable.call(obj, sym)) { return false; }\n\n\tif (typeof Object.getOwnPropertyDescriptor === 'function') {\n\t\tvar descriptor = Object.getOwnPropertyDescriptor(obj, sym);\n\t\tif (descriptor.value !== symVal || descriptor.enumerable !== true) { return false; }\n\t}\n\n\treturn true;\n};\n","'use strict';\n\nvar origSymbol = typeof Symbol !== 'undefined' && Symbol;\nvar hasSymbolSham = require('./shams');\n\nmodule.exports = function hasNativeSymbols() {\n\tif (typeof origSymbol !== 'function') { return false; }\n\tif (typeof Symbol !== 'function') { return false; }\n\tif (typeof origSymbol('foo') !== 'symbol') { return false; }\n\tif (typeof Symbol('bar') !== 'symbol') { return false; }\n\n\treturn hasSymbolSham();\n};\n","'use strict';\n\nvar test = {\n\t__proto__: null,\n\tfoo: {}\n};\n\nvar $Object = Object;\n\n/** @type {import('.')} */\nmodule.exports = function hasProto() {\n\t// @ts-expect-error: TS errors on an inherited property for some reason\n\treturn { __proto__: test }.foo === test.foo\n\t\t&& !(test instanceof $Object);\n};\n","'use strict';\n\n/* eslint no-invalid-this: 1 */\n\nvar ERROR_MESSAGE = 'Function.prototype.bind called on incompatible ';\nvar toStr = Object.prototype.toString;\nvar max = Math.max;\nvar funcType = '[object Function]';\n\nvar concatty = function concatty(a, b) {\n var arr = [];\n\n for (var i = 0; i < a.length; i += 1) {\n arr[i] = a[i];\n }\n for (var j = 0; j < b.length; j += 1) {\n arr[j + a.length] = b[j];\n }\n\n return arr;\n};\n\nvar slicy = function slicy(arrLike, offset) {\n var arr = [];\n for (var i = offset || 0, j = 0; i < arrLike.length; i += 1, j += 1) {\n arr[j] = arrLike[i];\n }\n return arr;\n};\n\nvar joiny = function (arr, joiner) {\n var str = '';\n for (var i = 0; i < arr.length; i += 1) {\n str += arr[i];\n if (i + 1 < arr.length) {\n str += joiner;\n }\n }\n return str;\n};\n\nmodule.exports = function bind(that) {\n var target = this;\n if (typeof target !== 'function' || toStr.apply(target) !== funcType) {\n throw new TypeError(ERROR_MESSAGE + target);\n }\n var args = slicy(arguments, 1);\n\n var bound;\n var binder = function () {\n if (this instanceof bound) {\n var result = target.apply(\n this,\n concatty(args, arguments)\n );\n if (Object(result) === result) {\n return result;\n }\n return this;\n }\n return target.apply(\n that,\n concatty(args, arguments)\n );\n\n };\n\n var boundLength = max(0, target.length - args.length);\n var boundArgs = [];\n for (var i = 0; i < boundLength; i++) {\n boundArgs[i] = '$' + i;\n }\n\n bound = Function('binder', 'return function (' + joiny(boundArgs, ',') + '){ return binder.apply(this,arguments); }')(binder);\n\n if (target.prototype) {\n var Empty = function Empty() {};\n Empty.prototype = target.prototype;\n bound.prototype = new Empty();\n Empty.prototype = null;\n }\n\n return bound;\n};\n","'use strict';\n\nvar implementation = require('./implementation');\n\nmodule.exports = Function.prototype.bind || implementation;\n","'use strict';\n\nvar call = Function.prototype.call;\nvar $hasOwn = Object.prototype.hasOwnProperty;\nvar bind = require('function-bind');\n\n/** @type {import('.')} */\nmodule.exports = bind.call(call, $hasOwn);\n","'use strict';\n\nvar undefined;\n\nvar $Error = require('es-errors');\nvar $EvalError = require('es-errors/eval');\nvar $RangeError = require('es-errors/range');\nvar $ReferenceError = require('es-errors/ref');\nvar $SyntaxError = require('es-errors/syntax');\nvar $TypeError = require('es-errors/type');\nvar $URIError = require('es-errors/uri');\n\nvar $Function = Function;\n\n// eslint-disable-next-line consistent-return\nvar getEvalledConstructor = function (expressionSyntax) {\n\ttry {\n\t\treturn $Function('\"use strict\"; return (' + expressionSyntax + ').constructor;')();\n\t} catch (e) {}\n};\n\nvar $gOPD = Object.getOwnPropertyDescriptor;\nif ($gOPD) {\n\ttry {\n\t\t$gOPD({}, '');\n\t} catch (e) {\n\t\t$gOPD = null; // this is IE 8, which has a broken gOPD\n\t}\n}\n\nvar throwTypeError = function () {\n\tthrow new $TypeError();\n};\nvar ThrowTypeError = $gOPD\n\t? (function () {\n\t\ttry {\n\t\t\t// eslint-disable-next-line no-unused-expressions, no-caller, no-restricted-properties\n\t\t\targuments.callee; // IE 8 does not throw here\n\t\t\treturn throwTypeError;\n\t\t} catch (calleeThrows) {\n\t\t\ttry {\n\t\t\t\t// IE 8 throws on Object.getOwnPropertyDescriptor(arguments, '')\n\t\t\t\treturn $gOPD(arguments, 'callee').get;\n\t\t\t} catch (gOPDthrows) {\n\t\t\t\treturn throwTypeError;\n\t\t\t}\n\t\t}\n\t}())\n\t: throwTypeError;\n\nvar hasSymbols = require('has-symbols')();\nvar hasProto = require('has-proto')();\n\nvar getProto = Object.getPrototypeOf || (\n\thasProto\n\t\t? function (x) { return x.__proto__; } // eslint-disable-line no-proto\n\t\t: null\n);\n\nvar needsEval = {};\n\nvar TypedArray = typeof Uint8Array === 'undefined' || !getProto ? undefined : getProto(Uint8Array);\n\nvar INTRINSICS = {\n\t__proto__: null,\n\t'%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError,\n\t'%Array%': Array,\n\t'%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer,\n\t'%ArrayIteratorPrototype%': hasSymbols && getProto ? getProto([][Symbol.iterator]()) : undefined,\n\t'%AsyncFromSyncIteratorPrototype%': undefined,\n\t'%AsyncFunction%': needsEval,\n\t'%AsyncGenerator%': needsEval,\n\t'%AsyncGeneratorFunction%': needsEval,\n\t'%AsyncIteratorPrototype%': needsEval,\n\t'%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics,\n\t'%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt,\n\t'%BigInt64Array%': typeof BigInt64Array === 'undefined' ? undefined : BigInt64Array,\n\t'%BigUint64Array%': typeof BigUint64Array === 'undefined' ? undefined : BigUint64Array,\n\t'%Boolean%': Boolean,\n\t'%DataView%': typeof DataView === 'undefined' ? undefined : DataView,\n\t'%Date%': Date,\n\t'%decodeURI%': decodeURI,\n\t'%decodeURIComponent%': decodeURIComponent,\n\t'%encodeURI%': encodeURI,\n\t'%encodeURIComponent%': encodeURIComponent,\n\t'%Error%': $Error,\n\t'%eval%': eval, // eslint-disable-line no-eval\n\t'%EvalError%': $EvalError,\n\t'%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array,\n\t'%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array,\n\t'%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry,\n\t'%Function%': $Function,\n\t'%GeneratorFunction%': needsEval,\n\t'%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array,\n\t'%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array,\n\t'%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array,\n\t'%isFinite%': isFinite,\n\t'%isNaN%': isNaN,\n\t'%IteratorPrototype%': hasSymbols && getProto ? getProto(getProto([][Symbol.iterator]())) : undefined,\n\t'%JSON%': typeof JSON === 'object' ? JSON : undefined,\n\t'%Map%': typeof Map === 'undefined' ? undefined : Map,\n\t'%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Map()[Symbol.iterator]()),\n\t'%Math%': Math,\n\t'%Number%': Number,\n\t'%Object%': Object,\n\t'%parseFloat%': parseFloat,\n\t'%parseInt%': parseInt,\n\t'%Promise%': typeof Promise === 'undefined' ? undefined : Promise,\n\t'%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy,\n\t'%RangeError%': $RangeError,\n\t'%ReferenceError%': $ReferenceError,\n\t'%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect,\n\t'%RegExp%': RegExp,\n\t'%Set%': typeof Set === 'undefined' ? undefined : Set,\n\t'%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols || !getProto ? undefined : getProto(new Set()[Symbol.iterator]()),\n\t'%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer,\n\t'%String%': String,\n\t'%StringIteratorPrototype%': hasSymbols && getProto ? getProto(''[Symbol.iterator]()) : undefined,\n\t'%Symbol%': hasSymbols ? Symbol : undefined,\n\t'%SyntaxError%': $SyntaxError,\n\t'%ThrowTypeError%': ThrowTypeError,\n\t'%TypedArray%': TypedArray,\n\t'%TypeError%': $TypeError,\n\t'%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array,\n\t'%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray,\n\t'%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array,\n\t'%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array,\n\t'%URIError%': $URIError,\n\t'%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap,\n\t'%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef,\n\t'%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet\n};\n\nif (getProto) {\n\ttry {\n\t\tnull.error; // eslint-disable-line no-unused-expressions\n\t} catch (e) {\n\t\t// https://github.com/tc39/proposal-shadowrealm/pull/384#issuecomment-1364264229\n\t\tvar errorProto = getProto(getProto(e));\n\t\tINTRINSICS['%Error.prototype%'] = errorProto;\n\t}\n}\n\nvar doEval = function doEval(name) {\n\tvar value;\n\tif (name === '%AsyncFunction%') {\n\t\tvalue = getEvalledConstructor('async function () {}');\n\t} else if (name === '%GeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('function* () {}');\n\t} else if (name === '%AsyncGeneratorFunction%') {\n\t\tvalue = getEvalledConstructor('async function* () {}');\n\t} else if (name === '%AsyncGenerator%') {\n\t\tvar fn = doEval('%AsyncGeneratorFunction%');\n\t\tif (fn) {\n\t\t\tvalue = fn.prototype;\n\t\t}\n\t} else if (name === '%AsyncIteratorPrototype%') {\n\t\tvar gen = doEval('%AsyncGenerator%');\n\t\tif (gen && getProto) {\n\t\t\tvalue = getProto(gen.prototype);\n\t\t}\n\t}\n\n\tINTRINSICS[name] = value;\n\n\treturn value;\n};\n\nvar LEGACY_ALIASES = {\n\t__proto__: null,\n\t'%ArrayBufferPrototype%': ['ArrayBuffer', 'prototype'],\n\t'%ArrayPrototype%': ['Array', 'prototype'],\n\t'%ArrayProto_entries%': ['Array', 'prototype', 'entries'],\n\t'%ArrayProto_forEach%': ['Array', 'prototype', 'forEach'],\n\t'%ArrayProto_keys%': ['Array', 'prototype', 'keys'],\n\t'%ArrayProto_values%': ['Array', 'prototype', 'values'],\n\t'%AsyncFunctionPrototype%': ['AsyncFunction', 'prototype'],\n\t'%AsyncGenerator%': ['AsyncGeneratorFunction', 'prototype'],\n\t'%AsyncGeneratorPrototype%': ['AsyncGeneratorFunction', 'prototype', 'prototype'],\n\t'%BooleanPrototype%': ['Boolean', 'prototype'],\n\t'%DataViewPrototype%': ['DataView', 'prototype'],\n\t'%DatePrototype%': ['Date', 'prototype'],\n\t'%ErrorPrototype%': ['Error', 'prototype'],\n\t'%EvalErrorPrototype%': ['EvalError', 'prototype'],\n\t'%Float32ArrayPrototype%': ['Float32Array', 'prototype'],\n\t'%Float64ArrayPrototype%': ['Float64Array', 'prototype'],\n\t'%FunctionPrototype%': ['Function', 'prototype'],\n\t'%Generator%': ['GeneratorFunction', 'prototype'],\n\t'%GeneratorPrototype%': ['GeneratorFunction', 'prototype', 'prototype'],\n\t'%Int8ArrayPrototype%': ['Int8Array', 'prototype'],\n\t'%Int16ArrayPrototype%': ['Int16Array', 'prototype'],\n\t'%Int32ArrayPrototype%': ['Int32Array', 'prototype'],\n\t'%JSONParse%': ['JSON', 'parse'],\n\t'%JSONStringify%': ['JSON', 'stringify'],\n\t'%MapPrototype%': ['Map', 'prototype'],\n\t'%NumberPrototype%': ['Number', 'prototype'],\n\t'%ObjectPrototype%': ['Object', 'prototype'],\n\t'%ObjProto_toString%': ['Object', 'prototype', 'toString'],\n\t'%ObjProto_valueOf%': ['Object', 'prototype', 'valueOf'],\n\t'%PromisePrototype%': ['Promise', 'prototype'],\n\t'%PromiseProto_then%': ['Promise', 'prototype', 'then'],\n\t'%Promise_all%': ['Promise', 'all'],\n\t'%Promise_reject%': ['Promise', 'reject'],\n\t'%Promise_resolve%': ['Promise', 'resolve'],\n\t'%RangeErrorPrototype%': ['RangeError', 'prototype'],\n\t'%ReferenceErrorPrototype%': ['ReferenceError', 'prototype'],\n\t'%RegExpPrototype%': ['RegExp', 'prototype'],\n\t'%SetPrototype%': ['Set', 'prototype'],\n\t'%SharedArrayBufferPrototype%': ['SharedArrayBuffer', 'prototype'],\n\t'%StringPrototype%': ['String', 'prototype'],\n\t'%SymbolPrototype%': ['Symbol', 'prototype'],\n\t'%SyntaxErrorPrototype%': ['SyntaxError', 'prototype'],\n\t'%TypedArrayPrototype%': ['TypedArray', 'prototype'],\n\t'%TypeErrorPrototype%': ['TypeError', 'prototype'],\n\t'%Uint8ArrayPrototype%': ['Uint8Array', 'prototype'],\n\t'%Uint8ClampedArrayPrototype%': ['Uint8ClampedArray', 'prototype'],\n\t'%Uint16ArrayPrototype%': ['Uint16Array', 'prototype'],\n\t'%Uint32ArrayPrototype%': ['Uint32Array', 'prototype'],\n\t'%URIErrorPrototype%': ['URIError', 'prototype'],\n\t'%WeakMapPrototype%': ['WeakMap', 'prototype'],\n\t'%WeakSetPrototype%': ['WeakSet', 'prototype']\n};\n\nvar bind = require('function-bind');\nvar hasOwn = require('hasown');\nvar $concat = bind.call(Function.call, Array.prototype.concat);\nvar $spliceApply = bind.call(Function.apply, Array.prototype.splice);\nvar $replace = bind.call(Function.call, String.prototype.replace);\nvar $strSlice = bind.call(Function.call, String.prototype.slice);\nvar $exec = bind.call(Function.call, RegExp.prototype.exec);\n\n/* adapted from https://github.com/lodash/lodash/blob/4.17.15/dist/lodash.js#L6735-L6744 */\nvar rePropName = /[^%.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|%$))/g;\nvar reEscapeChar = /\\\\(\\\\)?/g; /** Used to match backslashes in property paths. */\nvar stringToPath = function stringToPath(string) {\n\tvar first = $strSlice(string, 0, 1);\n\tvar last = $strSlice(string, -1);\n\tif (first === '%' && last !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected closing `%`');\n\t} else if (last === '%' && first !== '%') {\n\t\tthrow new $SyntaxError('invalid intrinsic syntax, expected opening `%`');\n\t}\n\tvar result = [];\n\t$replace(string, rePropName, function (match, number, quote, subString) {\n\t\tresult[result.length] = quote ? $replace(subString, reEscapeChar, '$1') : number || match;\n\t});\n\treturn result;\n};\n/* end adaptation */\n\nvar getBaseIntrinsic = function getBaseIntrinsic(name, allowMissing) {\n\tvar intrinsicName = name;\n\tvar alias;\n\tif (hasOwn(LEGACY_ALIASES, intrinsicName)) {\n\t\talias = LEGACY_ALIASES[intrinsicName];\n\t\tintrinsicName = '%' + alias[0] + '%';\n\t}\n\n\tif (hasOwn(INTRINSICS, intrinsicName)) {\n\t\tvar value = INTRINSICS[intrinsicName];\n\t\tif (value === needsEval) {\n\t\t\tvalue = doEval(intrinsicName);\n\t\t}\n\t\tif (typeof value === 'undefined' && !allowMissing) {\n\t\t\tthrow new $TypeError('intrinsic ' + name + ' exists, but is not available. Please file an issue!');\n\t\t}\n\n\t\treturn {\n\t\t\talias: alias,\n\t\t\tname: intrinsicName,\n\t\t\tvalue: value\n\t\t};\n\t}\n\n\tthrow new $SyntaxError('intrinsic ' + name + ' does not exist!');\n};\n\nmodule.exports = function GetIntrinsic(name, allowMissing) {\n\tif (typeof name !== 'string' || name.length === 0) {\n\t\tthrow new $TypeError('intrinsic name must be a non-empty string');\n\t}\n\tif (arguments.length > 1 && typeof allowMissing !== 'boolean') {\n\t\tthrow new $TypeError('\"allowMissing\" argument must be a boolean');\n\t}\n\n\tif ($exec(/^%?[^%]*%?$/, name) === null) {\n\t\tthrow new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name');\n\t}\n\tvar parts = stringToPath(name);\n\tvar intrinsicBaseName = parts.length > 0 ? parts[0] : '';\n\n\tvar intrinsic = getBaseIntrinsic('%' + intrinsicBaseName + '%', allowMissing);\n\tvar intrinsicRealName = intrinsic.name;\n\tvar value = intrinsic.value;\n\tvar skipFurtherCaching = false;\n\n\tvar alias = intrinsic.alias;\n\tif (alias) {\n\t\tintrinsicBaseName = alias[0];\n\t\t$spliceApply(parts, $concat([0, 1], alias));\n\t}\n\n\tfor (var i = 1, isOwn = true; i < parts.length; i += 1) {\n\t\tvar part = parts[i];\n\t\tvar first = $strSlice(part, 0, 1);\n\t\tvar last = $strSlice(part, -1);\n\t\tif (\n\t\t\t(\n\t\t\t\t(first === '\"' || first === \"'\" || first === '`')\n\t\t\t\t|| (last === '\"' || last === \"'\" || last === '`')\n\t\t\t)\n\t\t\t&& first !== last\n\t\t) {\n\t\t\tthrow new $SyntaxError('property names with quotes must have matching quotes');\n\t\t}\n\t\tif (part === 'constructor' || !isOwn) {\n\t\t\tskipFurtherCaching = true;\n\t\t}\n\n\t\tintrinsicBaseName += '.' + part;\n\t\tintrinsicRealName = '%' + intrinsicBaseName + '%';\n\n\t\tif (hasOwn(INTRINSICS, intrinsicRealName)) {\n\t\t\tvalue = INTRINSICS[intrinsicRealName];\n\t\t} else if (value != null) {\n\t\t\tif (!(part in value)) {\n\t\t\t\tif (!allowMissing) {\n\t\t\t\t\tthrow new $TypeError('base intrinsic for ' + name + ' exists, but the property is not available.');\n\t\t\t\t}\n\t\t\t\treturn void undefined;\n\t\t\t}\n\t\t\tif ($gOPD && (i + 1) >= parts.length) {\n\t\t\t\tvar desc = $gOPD(value, part);\n\t\t\t\tisOwn = !!desc;\n\n\t\t\t\t// By convention, when a data property is converted to an accessor\n\t\t\t\t// property to emulate a data property that does not suffer from\n\t\t\t\t// the override mistake, that accessor's getter is marked with\n\t\t\t\t// an `originalValue` property. Here, when we detect this, we\n\t\t\t\t// uphold the illusion by pretending to see that original data\n\t\t\t\t// property, i.e., returning the value rather than the getter\n\t\t\t\t// itself.\n\t\t\t\tif (isOwn && 'get' in desc && !('originalValue' in desc.get)) {\n\t\t\t\t\tvalue = desc.get;\n\t\t\t\t} else {\n\t\t\t\t\tvalue = value[part];\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tisOwn = hasOwn(value, part);\n\t\t\t\tvalue = value[part];\n\t\t\t}\n\n\t\t\tif (isOwn && !skipFurtherCaching) {\n\t\t\t\tINTRINSICS[intrinsicRealName] = value;\n\t\t\t}\n\t\t}\n\t}\n\treturn value;\n};\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\n/** @type {import('.')} */\nvar $defineProperty = GetIntrinsic('%Object.defineProperty%', true) || false;\nif ($defineProperty) {\n\ttry {\n\t\t$defineProperty({}, 'a', { value: 1 });\n\t} catch (e) {\n\t\t// IE 8 has a broken defineProperty\n\t\t$defineProperty = false;\n\t}\n}\n\nmodule.exports = $defineProperty;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar $gOPD = GetIntrinsic('%Object.getOwnPropertyDescriptor%', true);\n\nif ($gOPD) {\n\ttry {\n\t\t$gOPD([], 'length');\n\t} catch (e) {\n\t\t// IE 8 has a broken gOPD\n\t\t$gOPD = null;\n\t}\n}\n\nmodule.exports = $gOPD;\n","'use strict';\n\nvar $defineProperty = require('es-define-property');\n\nvar $SyntaxError = require('es-errors/syntax');\nvar $TypeError = require('es-errors/type');\n\nvar gopd = require('gopd');\n\n/** @type {import('.')} */\nmodule.exports = function defineDataProperty(\n\tobj,\n\tproperty,\n\tvalue\n) {\n\tif (!obj || (typeof obj !== 'object' && typeof obj !== 'function')) {\n\t\tthrow new $TypeError('`obj` must be an object or a function`');\n\t}\n\tif (typeof property !== 'string' && typeof property !== 'symbol') {\n\t\tthrow new $TypeError('`property` must be a string or a symbol`');\n\t}\n\tif (arguments.length > 3 && typeof arguments[3] !== 'boolean' && arguments[3] !== null) {\n\t\tthrow new $TypeError('`nonEnumerable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 4 && typeof arguments[4] !== 'boolean' && arguments[4] !== null) {\n\t\tthrow new $TypeError('`nonWritable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 5 && typeof arguments[5] !== 'boolean' && arguments[5] !== null) {\n\t\tthrow new $TypeError('`nonConfigurable`, if provided, must be a boolean or null');\n\t}\n\tif (arguments.length > 6 && typeof arguments[6] !== 'boolean') {\n\t\tthrow new $TypeError('`loose`, if provided, must be a boolean');\n\t}\n\n\tvar nonEnumerable = arguments.length > 3 ? arguments[3] : null;\n\tvar nonWritable = arguments.length > 4 ? arguments[4] : null;\n\tvar nonConfigurable = arguments.length > 5 ? arguments[5] : null;\n\tvar loose = arguments.length > 6 ? arguments[6] : false;\n\n\t/* @type {false | TypedPropertyDescriptor} */\n\tvar desc = !!gopd && gopd(obj, property);\n\n\tif ($defineProperty) {\n\t\t$defineProperty(obj, property, {\n\t\t\tconfigurable: nonConfigurable === null && desc ? desc.configurable : !nonConfigurable,\n\t\t\tenumerable: nonEnumerable === null && desc ? desc.enumerable : !nonEnumerable,\n\t\t\tvalue: value,\n\t\t\twritable: nonWritable === null && desc ? desc.writable : !nonWritable\n\t\t});\n\t} else if (loose || (!nonEnumerable && !nonWritable && !nonConfigurable)) {\n\t\t// must fall back to [[Set]], and was not explicitly asked to make non-enumerable, non-writable, or non-configurable\n\t\tobj[property] = value; // eslint-disable-line no-param-reassign\n\t} else {\n\t\tthrow new $SyntaxError('This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.');\n\t}\n};\n","'use strict';\n\nvar $defineProperty = require('es-define-property');\n\nvar hasPropertyDescriptors = function hasPropertyDescriptors() {\n\treturn !!$defineProperty;\n};\n\nhasPropertyDescriptors.hasArrayLengthDefineBug = function hasArrayLengthDefineBug() {\n\t// node v0.6 has a bug where array lengths can be Set but not Defined\n\tif (!$defineProperty) {\n\t\treturn null;\n\t}\n\ttry {\n\t\treturn $defineProperty([], 'length', { value: 1 }).length !== 1;\n\t} catch (e) {\n\t\t// In Firefox 4-22, defining length on an array throws an exception.\n\t\treturn true;\n\t}\n};\n\nmodule.exports = hasPropertyDescriptors;\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar define = require('define-data-property');\nvar hasDescriptors = require('has-property-descriptors')();\nvar gOPD = require('gopd');\n\nvar $TypeError = require('es-errors/type');\nvar $floor = GetIntrinsic('%Math.floor%');\n\n/** @type {import('.')} */\nmodule.exports = function setFunctionLength(fn, length) {\n\tif (typeof fn !== 'function') {\n\t\tthrow new $TypeError('`fn` is not a function');\n\t}\n\tif (typeof length !== 'number' || length < 0 || length > 0xFFFFFFFF || $floor(length) !== length) {\n\t\tthrow new $TypeError('`length` must be a positive 32-bit integer');\n\t}\n\n\tvar loose = arguments.length > 2 && !!arguments[2];\n\n\tvar functionLengthIsConfigurable = true;\n\tvar functionLengthIsWritable = true;\n\tif ('length' in fn && gOPD) {\n\t\tvar desc = gOPD(fn, 'length');\n\t\tif (desc && !desc.configurable) {\n\t\t\tfunctionLengthIsConfigurable = false;\n\t\t}\n\t\tif (desc && !desc.writable) {\n\t\t\tfunctionLengthIsWritable = false;\n\t\t}\n\t}\n\n\tif (functionLengthIsConfigurable || functionLengthIsWritable || !loose) {\n\t\tif (hasDescriptors) {\n\t\t\tdefine(/** @type {Parameters[0]} */ (fn), 'length', length, true, true);\n\t\t} else {\n\t\t\tdefine(/** @type {Parameters[0]} */ (fn), 'length', length);\n\t\t}\n\t}\n\treturn fn;\n};\n","'use strict';\n\nvar bind = require('function-bind');\nvar GetIntrinsic = require('get-intrinsic');\nvar setFunctionLength = require('set-function-length');\n\nvar $TypeError = require('es-errors/type');\nvar $apply = GetIntrinsic('%Function.prototype.apply%');\nvar $call = GetIntrinsic('%Function.prototype.call%');\nvar $reflectApply = GetIntrinsic('%Reflect.apply%', true) || bind.call($call, $apply);\n\nvar $defineProperty = require('es-define-property');\nvar $max = GetIntrinsic('%Math.max%');\n\nmodule.exports = function callBind(originalFunction) {\n\tif (typeof originalFunction !== 'function') {\n\t\tthrow new $TypeError('a function is required');\n\t}\n\tvar func = $reflectApply(bind, $call, arguments);\n\treturn setFunctionLength(\n\t\tfunc,\n\t\t1 + $max(0, originalFunction.length - (arguments.length - 1)),\n\t\ttrue\n\t);\n};\n\nvar applyBind = function applyBind() {\n\treturn $reflectApply(bind, $apply, arguments);\n};\n\nif ($defineProperty) {\n\t$defineProperty(module.exports, 'apply', { value: applyBind });\n} else {\n\tmodule.exports.apply = applyBind;\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\n\nvar callBind = require('./');\n\nvar $indexOf = callBind(GetIntrinsic('String.prototype.indexOf'));\n\nmodule.exports = function callBoundIntrinsic(name, allowMissing) {\n\tvar intrinsic = GetIntrinsic(name, !!allowMissing);\n\tif (typeof intrinsic === 'function' && $indexOf(name, '.prototype.') > -1) {\n\t\treturn callBind(intrinsic);\n\t}\n\treturn intrinsic;\n};\n","export default {}","var hasMap = typeof Map === 'function' && Map.prototype;\nvar mapSizeDescriptor = Object.getOwnPropertyDescriptor && hasMap ? Object.getOwnPropertyDescriptor(Map.prototype, 'size') : null;\nvar mapSize = hasMap && mapSizeDescriptor && typeof mapSizeDescriptor.get === 'function' ? mapSizeDescriptor.get : null;\nvar mapForEach = hasMap && Map.prototype.forEach;\nvar hasSet = typeof Set === 'function' && Set.prototype;\nvar setSizeDescriptor = Object.getOwnPropertyDescriptor && hasSet ? Object.getOwnPropertyDescriptor(Set.prototype, 'size') : null;\nvar setSize = hasSet && setSizeDescriptor && typeof setSizeDescriptor.get === 'function' ? setSizeDescriptor.get : null;\nvar setForEach = hasSet && Set.prototype.forEach;\nvar hasWeakMap = typeof WeakMap === 'function' && WeakMap.prototype;\nvar weakMapHas = hasWeakMap ? WeakMap.prototype.has : null;\nvar hasWeakSet = typeof WeakSet === 'function' && WeakSet.prototype;\nvar weakSetHas = hasWeakSet ? WeakSet.prototype.has : null;\nvar hasWeakRef = typeof WeakRef === 'function' && WeakRef.prototype;\nvar weakRefDeref = hasWeakRef ? WeakRef.prototype.deref : null;\nvar booleanValueOf = Boolean.prototype.valueOf;\nvar objectToString = Object.prototype.toString;\nvar functionToString = Function.prototype.toString;\nvar $match = String.prototype.match;\nvar $slice = String.prototype.slice;\nvar $replace = String.prototype.replace;\nvar $toUpperCase = String.prototype.toUpperCase;\nvar $toLowerCase = String.prototype.toLowerCase;\nvar $test = RegExp.prototype.test;\nvar $concat = Array.prototype.concat;\nvar $join = Array.prototype.join;\nvar $arrSlice = Array.prototype.slice;\nvar $floor = Math.floor;\nvar bigIntValueOf = typeof BigInt === 'function' ? BigInt.prototype.valueOf : null;\nvar gOPS = Object.getOwnPropertySymbols;\nvar symToString = typeof Symbol === 'function' && typeof Symbol.iterator === 'symbol' ? Symbol.prototype.toString : null;\nvar hasShammedSymbols = typeof Symbol === 'function' && typeof Symbol.iterator === 'object';\n// ie, `has-tostringtag/shams\nvar toStringTag = typeof Symbol === 'function' && Symbol.toStringTag && (typeof Symbol.toStringTag === hasShammedSymbols ? 'object' : 'symbol')\n ? Symbol.toStringTag\n : null;\nvar isEnumerable = Object.prototype.propertyIsEnumerable;\n\nvar gPO = (typeof Reflect === 'function' ? Reflect.getPrototypeOf : Object.getPrototypeOf) || (\n [].__proto__ === Array.prototype // eslint-disable-line no-proto\n ? function (O) {\n return O.__proto__; // eslint-disable-line no-proto\n }\n : null\n);\n\nfunction addNumericSeparator(num, str) {\n if (\n num === Infinity\n || num === -Infinity\n || num !== num\n || (num && num > -1000 && num < 1000)\n || $test.call(/e/, str)\n ) {\n return str;\n }\n var sepRegex = /[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;\n if (typeof num === 'number') {\n var int = num < 0 ? -$floor(-num) : $floor(num); // trunc(num)\n if (int !== num) {\n var intStr = String(int);\n var dec = $slice.call(str, intStr.length + 1);\n return $replace.call(intStr, sepRegex, '$&_') + '.' + $replace.call($replace.call(dec, /([0-9]{3})/g, '$&_'), /_$/, '');\n }\n }\n return $replace.call(str, sepRegex, '$&_');\n}\n\nvar utilInspect = require('./util.inspect');\nvar inspectCustom = utilInspect.custom;\nvar inspectSymbol = isSymbol(inspectCustom) ? inspectCustom : null;\n\nvar quotes = {\n __proto__: null,\n 'double': '\"',\n single: \"'\"\n};\nvar quoteREs = {\n __proto__: null,\n 'double': /([\"\\\\])/g,\n single: /(['\\\\])/g\n};\n\nmodule.exports = function inspect_(obj, options, depth, seen) {\n var opts = options || {};\n\n if (has(opts, 'quoteStyle') && !has(quotes, opts.quoteStyle)) {\n throw new TypeError('option \"quoteStyle\" must be \"single\" or \"double\"');\n }\n if (\n has(opts, 'maxStringLength') && (typeof opts.maxStringLength === 'number'\n ? opts.maxStringLength < 0 && opts.maxStringLength !== Infinity\n : opts.maxStringLength !== null\n )\n ) {\n throw new TypeError('option \"maxStringLength\", if provided, must be a positive integer, Infinity, or `null`');\n }\n var customInspect = has(opts, 'customInspect') ? opts.customInspect : true;\n if (typeof customInspect !== 'boolean' && customInspect !== 'symbol') {\n throw new TypeError('option \"customInspect\", if provided, must be `true`, `false`, or `\\'symbol\\'`');\n }\n\n if (\n has(opts, 'indent')\n && opts.indent !== null\n && opts.indent !== '\\t'\n && !(parseInt(opts.indent, 10) === opts.indent && opts.indent > 0)\n ) {\n throw new TypeError('option \"indent\" must be \"\\\\t\", an integer > 0, or `null`');\n }\n if (has(opts, 'numericSeparator') && typeof opts.numericSeparator !== 'boolean') {\n throw new TypeError('option \"numericSeparator\", if provided, must be `true` or `false`');\n }\n var numericSeparator = opts.numericSeparator;\n\n if (typeof obj === 'undefined') {\n return 'undefined';\n }\n if (obj === null) {\n return 'null';\n }\n if (typeof obj === 'boolean') {\n return obj ? 'true' : 'false';\n }\n\n if (typeof obj === 'string') {\n return inspectString(obj, opts);\n }\n if (typeof obj === 'number') {\n if (obj === 0) {\n return Infinity / obj > 0 ? '0' : '-0';\n }\n var str = String(obj);\n return numericSeparator ? addNumericSeparator(obj, str) : str;\n }\n if (typeof obj === 'bigint') {\n var bigIntStr = String(obj) + 'n';\n return numericSeparator ? addNumericSeparator(obj, bigIntStr) : bigIntStr;\n }\n\n var maxDepth = typeof opts.depth === 'undefined' ? 5 : opts.depth;\n if (typeof depth === 'undefined') { depth = 0; }\n if (depth >= maxDepth && maxDepth > 0 && typeof obj === 'object') {\n return isArray(obj) ? '[Array]' : '[Object]';\n }\n\n var indent = getIndent(opts, depth);\n\n if (typeof seen === 'undefined') {\n seen = [];\n } else if (indexOf(seen, obj) >= 0) {\n return '[Circular]';\n }\n\n function inspect(value, from, noIndent) {\n if (from) {\n seen = $arrSlice.call(seen);\n seen.push(from);\n }\n if (noIndent) {\n var newOpts = {\n depth: opts.depth\n };\n if (has(opts, 'quoteStyle')) {\n newOpts.quoteStyle = opts.quoteStyle;\n }\n return inspect_(value, newOpts, depth + 1, seen);\n }\n return inspect_(value, opts, depth + 1, seen);\n }\n\n if (typeof obj === 'function' && !isRegExp(obj)) { // in older engines, regexes are callable\n var name = nameOf(obj);\n var keys = arrObjKeys(obj, inspect);\n return '[Function' + (name ? ': ' + name : ' (anonymous)') + ']' + (keys.length > 0 ? ' { ' + $join.call(keys, ', ') + ' }' : '');\n }\n if (isSymbol(obj)) {\n var symString = hasShammedSymbols ? $replace.call(String(obj), /^(Symbol\\(.*\\))_[^)]*$/, '$1') : symToString.call(obj);\n return typeof obj === 'object' && !hasShammedSymbols ? markBoxed(symString) : symString;\n }\n if (isElement(obj)) {\n var s = '<' + $toLowerCase.call(String(obj.nodeName));\n var attrs = obj.attributes || [];\n for (var i = 0; i < attrs.length; i++) {\n s += ' ' + attrs[i].name + '=' + wrapQuotes(quote(attrs[i].value), 'double', opts);\n }\n s += '>';\n if (obj.childNodes && obj.childNodes.length) { s += '...'; }\n s += '';\n return s;\n }\n if (isArray(obj)) {\n if (obj.length === 0) { return '[]'; }\n var xs = arrObjKeys(obj, inspect);\n if (indent && !singleLineValues(xs)) {\n return '[' + indentedJoin(xs, indent) + ']';\n }\n return '[ ' + $join.call(xs, ', ') + ' ]';\n }\n if (isError(obj)) {\n var parts = arrObjKeys(obj, inspect);\n if (!('cause' in Error.prototype) && 'cause' in obj && !isEnumerable.call(obj, 'cause')) {\n return '{ [' + String(obj) + '] ' + $join.call($concat.call('[cause]: ' + inspect(obj.cause), parts), ', ') + ' }';\n }\n if (parts.length === 0) { return '[' + String(obj) + ']'; }\n return '{ [' + String(obj) + '] ' + $join.call(parts, ', ') + ' }';\n }\n if (typeof obj === 'object' && customInspect) {\n if (inspectSymbol && typeof obj[inspectSymbol] === 'function' && utilInspect) {\n return utilInspect(obj, { depth: maxDepth - depth });\n } else if (customInspect !== 'symbol' && typeof obj.inspect === 'function') {\n return obj.inspect();\n }\n }\n if (isMap(obj)) {\n var mapParts = [];\n if (mapForEach) {\n mapForEach.call(obj, function (value, key) {\n mapParts.push(inspect(key, obj, true) + ' => ' + inspect(value, obj));\n });\n }\n return collectionOf('Map', mapSize.call(obj), mapParts, indent);\n }\n if (isSet(obj)) {\n var setParts = [];\n if (setForEach) {\n setForEach.call(obj, function (value) {\n setParts.push(inspect(value, obj));\n });\n }\n return collectionOf('Set', setSize.call(obj), setParts, indent);\n }\n if (isWeakMap(obj)) {\n return weakCollectionOf('WeakMap');\n }\n if (isWeakSet(obj)) {\n return weakCollectionOf('WeakSet');\n }\n if (isWeakRef(obj)) {\n return weakCollectionOf('WeakRef');\n }\n if (isNumber(obj)) {\n return markBoxed(inspect(Number(obj)));\n }\n if (isBigInt(obj)) {\n return markBoxed(inspect(bigIntValueOf.call(obj)));\n }\n if (isBoolean(obj)) {\n return markBoxed(booleanValueOf.call(obj));\n }\n if (isString(obj)) {\n return markBoxed(inspect(String(obj)));\n }\n // note: in IE 8, sometimes `global !== window` but both are the prototypes of each other\n /* eslint-env browser */\n if (typeof window !== 'undefined' && obj === window) {\n return '{ [object Window] }';\n }\n if (\n (typeof globalThis !== 'undefined' && obj === globalThis)\n || (typeof global !== 'undefined' && obj === global)\n ) {\n return '{ [object globalThis] }';\n }\n if (!isDate(obj) && !isRegExp(obj)) {\n var ys = arrObjKeys(obj, inspect);\n var isPlainObject = gPO ? gPO(obj) === Object.prototype : obj instanceof Object || obj.constructor === Object;\n var protoTag = obj instanceof Object ? '' : 'null prototype';\n var stringTag = !isPlainObject && toStringTag && Object(obj) === obj && toStringTag in obj ? $slice.call(toStr(obj), 8, -1) : protoTag ? 'Object' : '';\n var constructorTag = isPlainObject || typeof obj.constructor !== 'function' ? '' : obj.constructor.name ? obj.constructor.name + ' ' : '';\n var tag = constructorTag + (stringTag || protoTag ? '[' + $join.call($concat.call([], stringTag || [], protoTag || []), ': ') + '] ' : '');\n if (ys.length === 0) { return tag + '{}'; }\n if (indent) {\n return tag + '{' + indentedJoin(ys, indent) + '}';\n }\n return tag + '{ ' + $join.call(ys, ', ') + ' }';\n }\n return String(obj);\n};\n\nfunction wrapQuotes(s, defaultStyle, opts) {\n var style = opts.quoteStyle || defaultStyle;\n var quoteChar = quotes[style];\n return quoteChar + s + quoteChar;\n}\n\nfunction quote(s) {\n return $replace.call(String(s), /\"/g, '"');\n}\n\nfunction isArray(obj) { return toStr(obj) === '[object Array]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isDate(obj) { return toStr(obj) === '[object Date]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isRegExp(obj) { return toStr(obj) === '[object RegExp]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isError(obj) { return toStr(obj) === '[object Error]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isString(obj) { return toStr(obj) === '[object String]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isNumber(obj) { return toStr(obj) === '[object Number]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\nfunction isBoolean(obj) { return toStr(obj) === '[object Boolean]' && (!toStringTag || !(typeof obj === 'object' && toStringTag in obj)); }\n\n// Symbol and BigInt do have Symbol.toStringTag by spec, so that can't be used to eliminate false positives\nfunction isSymbol(obj) {\n if (hasShammedSymbols) {\n return obj && typeof obj === 'object' && obj instanceof Symbol;\n }\n if (typeof obj === 'symbol') {\n return true;\n }\n if (!obj || typeof obj !== 'object' || !symToString) {\n return false;\n }\n try {\n symToString.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isBigInt(obj) {\n if (!obj || typeof obj !== 'object' || !bigIntValueOf) {\n return false;\n }\n try {\n bigIntValueOf.call(obj);\n return true;\n } catch (e) {}\n return false;\n}\n\nvar hasOwn = Object.prototype.hasOwnProperty || function (key) { return key in this; };\nfunction has(obj, key) {\n return hasOwn.call(obj, key);\n}\n\nfunction toStr(obj) {\n return objectToString.call(obj);\n}\n\nfunction nameOf(f) {\n if (f.name) { return f.name; }\n var m = $match.call(functionToString.call(f), /^function\\s*([\\w$]+)/);\n if (m) { return m[1]; }\n return null;\n}\n\nfunction indexOf(xs, x) {\n if (xs.indexOf) { return xs.indexOf(x); }\n for (var i = 0, l = xs.length; i < l; i++) {\n if (xs[i] === x) { return i; }\n }\n return -1;\n}\n\nfunction isMap(x) {\n if (!mapSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n mapSize.call(x);\n try {\n setSize.call(x);\n } catch (s) {\n return true;\n }\n return x instanceof Map; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakMap(x) {\n if (!weakMapHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakMapHas.call(x, weakMapHas);\n try {\n weakSetHas.call(x, weakSetHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakMap; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakRef(x) {\n if (!weakRefDeref || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakRefDeref.call(x);\n return true;\n } catch (e) {}\n return false;\n}\n\nfunction isSet(x) {\n if (!setSize || !x || typeof x !== 'object') {\n return false;\n }\n try {\n setSize.call(x);\n try {\n mapSize.call(x);\n } catch (m) {\n return true;\n }\n return x instanceof Set; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isWeakSet(x) {\n if (!weakSetHas || !x || typeof x !== 'object') {\n return false;\n }\n try {\n weakSetHas.call(x, weakSetHas);\n try {\n weakMapHas.call(x, weakMapHas);\n } catch (s) {\n return true;\n }\n return x instanceof WeakSet; // core-js workaround, pre-v2.5.0\n } catch (e) {}\n return false;\n}\n\nfunction isElement(x) {\n if (!x || typeof x !== 'object') { return false; }\n if (typeof HTMLElement !== 'undefined' && x instanceof HTMLElement) {\n return true;\n }\n return typeof x.nodeName === 'string' && typeof x.getAttribute === 'function';\n}\n\nfunction inspectString(str, opts) {\n if (str.length > opts.maxStringLength) {\n var remaining = str.length - opts.maxStringLength;\n var trailer = '... ' + remaining + ' more character' + (remaining > 1 ? 's' : '');\n return inspectString($slice.call(str, 0, opts.maxStringLength), opts) + trailer;\n }\n var quoteRE = quoteREs[opts.quoteStyle || 'single'];\n quoteRE.lastIndex = 0;\n // eslint-disable-next-line no-control-regex\n var s = $replace.call($replace.call(str, quoteRE, '\\\\$1'), /[\\x00-\\x1f]/g, lowbyte);\n return wrapQuotes(s, 'single', opts);\n}\n\nfunction lowbyte(c) {\n var n = c.charCodeAt(0);\n var x = {\n 8: 'b',\n 9: 't',\n 10: 'n',\n 12: 'f',\n 13: 'r'\n }[n];\n if (x) { return '\\\\' + x; }\n return '\\\\x' + (n < 0x10 ? '0' : '') + $toUpperCase.call(n.toString(16));\n}\n\nfunction markBoxed(str) {\n return 'Object(' + str + ')';\n}\n\nfunction weakCollectionOf(type) {\n return type + ' { ? }';\n}\n\nfunction collectionOf(type, size, entries, indent) {\n var joinedEntries = indent ? indentedJoin(entries, indent) : $join.call(entries, ', ');\n return type + ' (' + size + ') {' + joinedEntries + '}';\n}\n\nfunction singleLineValues(xs) {\n for (var i = 0; i < xs.length; i++) {\n if (indexOf(xs[i], '\\n') >= 0) {\n return false;\n }\n }\n return true;\n}\n\nfunction getIndent(opts, depth) {\n var baseIndent;\n if (opts.indent === '\\t') {\n baseIndent = '\\t';\n } else if (typeof opts.indent === 'number' && opts.indent > 0) {\n baseIndent = $join.call(Array(opts.indent + 1), ' ');\n } else {\n return null;\n }\n return {\n base: baseIndent,\n prev: $join.call(Array(depth + 1), baseIndent)\n };\n}\n\nfunction indentedJoin(xs, indent) {\n if (xs.length === 0) { return ''; }\n var lineJoiner = '\\n' + indent.prev + indent.base;\n return lineJoiner + $join.call(xs, ',' + lineJoiner) + '\\n' + indent.prev;\n}\n\nfunction arrObjKeys(obj, inspect) {\n var isArr = isArray(obj);\n var xs = [];\n if (isArr) {\n xs.length = obj.length;\n for (var i = 0; i < obj.length; i++) {\n xs[i] = has(obj, i) ? inspect(obj[i], obj) : '';\n }\n }\n var syms = typeof gOPS === 'function' ? gOPS(obj) : [];\n var symMap;\n if (hasShammedSymbols) {\n symMap = {};\n for (var k = 0; k < syms.length; k++) {\n symMap['$' + syms[k]] = syms[k];\n }\n }\n\n for (var key in obj) { // eslint-disable-line no-restricted-syntax\n if (!has(obj, key)) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (isArr && String(Number(key)) === key && key < obj.length) { continue; } // eslint-disable-line no-restricted-syntax, no-continue\n if (hasShammedSymbols && symMap['$' + key] instanceof Symbol) {\n // this is to prevent shammed Symbols, which are stored as strings, from being included in the string key section\n continue; // eslint-disable-line no-restricted-syntax, no-continue\n } else if ($test.call(/[^\\w$]/, key)) {\n xs.push(inspect(key, obj) + ': ' + inspect(obj[key], obj));\n } else {\n xs.push(key + ': ' + inspect(obj[key], obj));\n }\n }\n if (typeof gOPS === 'function') {\n for (var j = 0; j < syms.length; j++) {\n if (isEnumerable.call(obj, syms[j])) {\n xs.push('[' + inspect(syms[j]) + ']: ' + inspect(obj[syms[j]], obj));\n }\n }\n }\n return xs;\n}\n","'use strict';\n\nvar GetIntrinsic = require('get-intrinsic');\nvar callBound = require('call-bind/callBound');\nvar inspect = require('object-inspect');\n\nvar $TypeError = require('es-errors/type');\nvar $WeakMap = GetIntrinsic('%WeakMap%', true);\nvar $Map = GetIntrinsic('%Map%', true);\n\nvar $weakMapGet = callBound('WeakMap.prototype.get', true);\nvar $weakMapSet = callBound('WeakMap.prototype.set', true);\nvar $weakMapHas = callBound('WeakMap.prototype.has', true);\nvar $mapGet = callBound('Map.prototype.get', true);\nvar $mapSet = callBound('Map.prototype.set', true);\nvar $mapHas = callBound('Map.prototype.has', true);\n\n/*\n* This function traverses the list returning the node corresponding to the given key.\n*\n* That node is also moved to the head of the list, so that if it's accessed again we don't need to traverse the whole list. By doing so, all the recently used nodes can be accessed relatively quickly.\n*/\n/** @type {import('.').listGetNode} */\nvar listGetNode = function (list, key) { // eslint-disable-line consistent-return\n\t/** @type {typeof list | NonNullable<(typeof list)['next']>} */\n\tvar prev = list;\n\t/** @type {(typeof list)['next']} */\n\tvar curr;\n\tfor (; (curr = prev.next) !== null; prev = curr) {\n\t\tif (curr.key === key) {\n\t\t\tprev.next = curr.next;\n\t\t\t// eslint-disable-next-line no-extra-parens\n\t\t\tcurr.next = /** @type {NonNullable} */ (list.next);\n\t\t\tlist.next = curr; // eslint-disable-line no-param-reassign\n\t\t\treturn curr;\n\t\t}\n\t}\n};\n\n/** @type {import('.').listGet} */\nvar listGet = function (objects, key) {\n\tvar node = listGetNode(objects, key);\n\treturn node && node.value;\n};\n/** @type {import('.').listSet} */\nvar listSet = function (objects, key, value) {\n\tvar node = listGetNode(objects, key);\n\tif (node) {\n\t\tnode.value = value;\n\t} else {\n\t\t// Prepend the new node to the beginning of the list\n\t\tobjects.next = /** @type {import('.').ListNode} */ ({ // eslint-disable-line no-param-reassign, no-extra-parens\n\t\t\tkey: key,\n\t\t\tnext: objects.next,\n\t\t\tvalue: value\n\t\t});\n\t}\n};\n/** @type {import('.').listHas} */\nvar listHas = function (objects, key) {\n\treturn !!listGetNode(objects, key);\n};\n\n/** @type {import('.')} */\nmodule.exports = function getSideChannel() {\n\t/** @type {WeakMap} */ var $wm;\n\t/** @type {Map} */ var $m;\n\t/** @type {import('.').RootNode} */ var $o;\n\n\t/** @type {import('.').Channel} */\n\tvar channel = {\n\t\tassert: function (key) {\n\t\t\tif (!channel.has(key)) {\n\t\t\t\tthrow new $TypeError('Side channel does not contain ' + inspect(key));\n\t\t\t}\n\t\t},\n\t\tget: function (key) { // eslint-disable-line consistent-return\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapGet($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapGet($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listGet($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\thas: function (key) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif ($wm) {\n\t\t\t\t\treturn $weakMapHas($wm, key);\n\t\t\t\t}\n\t\t\t} else if ($Map) {\n\t\t\t\tif ($m) {\n\t\t\t\t\treturn $mapHas($m, key);\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tif ($o) { // eslint-disable-line no-lonely-if\n\t\t\t\t\treturn listHas($o, key);\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn false;\n\t\t},\n\t\tset: function (key, value) {\n\t\t\tif ($WeakMap && key && (typeof key === 'object' || typeof key === 'function')) {\n\t\t\t\tif (!$wm) {\n\t\t\t\t\t$wm = new $WeakMap();\n\t\t\t\t}\n\t\t\t\t$weakMapSet($wm, key, value);\n\t\t\t} else if ($Map) {\n\t\t\t\tif (!$m) {\n\t\t\t\t\t$m = new $Map();\n\t\t\t\t}\n\t\t\t\t$mapSet($m, key, value);\n\t\t\t} else {\n\t\t\t\tif (!$o) {\n\t\t\t\t\t// Initialize the linked list as an empty node, so that we don't have to special-case handling of the first node: we can always refer to it as (previous node).next, instead of something like (list).head\n\t\t\t\t\t$o = { key: {}, next: null };\n\t\t\t\t}\n\t\t\t\tlistSet($o, key, value);\n\t\t\t}\n\t\t}\n\t};\n\treturn channel;\n};\n","'use strict';\n\nvar replace = String.prototype.replace;\nvar percentTwenties = /%20/g;\n\nvar Format = {\n RFC1738: 'RFC1738',\n RFC3986: 'RFC3986'\n};\n\nmodule.exports = {\n 'default': Format.RFC3986,\n formatters: {\n RFC1738: function (value) {\n return replace.call(value, percentTwenties, '+');\n },\n RFC3986: function (value) {\n return String(value);\n }\n },\n RFC1738: Format.RFC1738,\n RFC3986: Format.RFC3986\n};\n","'use strict';\n\nvar formats = require('./formats');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar hexTable = (function () {\n var array = [];\n for (var i = 0; i < 256; ++i) {\n array.push('%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase());\n }\n\n return array;\n}());\n\nvar compactQueue = function compactQueue(queue) {\n while (queue.length > 1) {\n var item = queue.pop();\n var obj = item.obj[item.prop];\n\n if (isArray(obj)) {\n var compacted = [];\n\n for (var j = 0; j < obj.length; ++j) {\n if (typeof obj[j] !== 'undefined') {\n compacted.push(obj[j]);\n }\n }\n\n item.obj[item.prop] = compacted;\n }\n }\n};\n\nvar arrayToObject = function arrayToObject(source, options) {\n var obj = options && options.plainObjects ? { __proto__: null } : {};\n for (var i = 0; i < source.length; ++i) {\n if (typeof source[i] !== 'undefined') {\n obj[i] = source[i];\n }\n }\n\n return obj;\n};\n\nvar merge = function merge(target, source, options) {\n /* eslint no-param-reassign: 0 */\n if (!source) {\n return target;\n }\n\n if (typeof source !== 'object' && typeof source !== 'function') {\n if (isArray(target)) {\n target.push(source);\n } else if (target && typeof target === 'object') {\n if (\n (options && (options.plainObjects || options.allowPrototypes))\n || !has.call(Object.prototype, source)\n ) {\n target[source] = true;\n }\n } else {\n return [target, source];\n }\n\n return target;\n }\n\n if (!target || typeof target !== 'object') {\n return [target].concat(source);\n }\n\n var mergeTarget = target;\n if (isArray(target) && !isArray(source)) {\n mergeTarget = arrayToObject(target, options);\n }\n\n if (isArray(target) && isArray(source)) {\n source.forEach(function (item, i) {\n if (has.call(target, i)) {\n var targetItem = target[i];\n if (targetItem && typeof targetItem === 'object' && item && typeof item === 'object') {\n target[i] = merge(targetItem, item, options);\n } else {\n target.push(item);\n }\n } else {\n target[i] = item;\n }\n });\n return target;\n }\n\n return Object.keys(source).reduce(function (acc, key) {\n var value = source[key];\n\n if (has.call(acc, key)) {\n acc[key] = merge(acc[key], value, options);\n } else {\n acc[key] = value;\n }\n return acc;\n }, mergeTarget);\n};\n\nvar assign = function assignSingleSource(target, source) {\n return Object.keys(source).reduce(function (acc, key) {\n acc[key] = source[key];\n return acc;\n }, target);\n};\n\nvar decode = function (str, defaultDecoder, charset) {\n var strWithoutPlus = str.replace(/\\+/g, ' ');\n if (charset === 'iso-8859-1') {\n // unescape never throws, no try...catch needed:\n return strWithoutPlus.replace(/%[0-9a-f]{2}/gi, unescape);\n }\n // utf-8\n try {\n return decodeURIComponent(strWithoutPlus);\n } catch (e) {\n return strWithoutPlus;\n }\n};\n\nvar limit = 1024;\n\n/* eslint operator-linebreak: [2, \"before\"] */\n\nvar encode = function encode(str, defaultEncoder, charset, kind, format) {\n // This code was originally written by Brian White (mscdex) for the io.js core querystring library.\n // It has been adapted here for stricter adherence to RFC 3986\n if (str.length === 0) {\n return str;\n }\n\n var string = str;\n if (typeof str === 'symbol') {\n string = Symbol.prototype.toString.call(str);\n } else if (typeof str !== 'string') {\n string = String(str);\n }\n\n if (charset === 'iso-8859-1') {\n return escape(string).replace(/%u[0-9a-f]{4}/gi, function ($0) {\n return '%26%23' + parseInt($0.slice(2), 16) + '%3B';\n });\n }\n\n var out = '';\n for (var j = 0; j < string.length; j += limit) {\n var segment = string.length >= limit ? string.slice(j, j + limit) : string;\n var arr = [];\n\n for (var i = 0; i < segment.length; ++i) {\n var c = segment.charCodeAt(i);\n if (\n c === 0x2D // -\n || c === 0x2E // .\n || c === 0x5F // _\n || c === 0x7E // ~\n || (c >= 0x30 && c <= 0x39) // 0-9\n || (c >= 0x41 && c <= 0x5A) // a-z\n || (c >= 0x61 && c <= 0x7A) // A-Z\n || (format === formats.RFC1738 && (c === 0x28 || c === 0x29)) // ( )\n ) {\n arr[arr.length] = segment.charAt(i);\n continue;\n }\n\n if (c < 0x80) {\n arr[arr.length] = hexTable[c];\n continue;\n }\n\n if (c < 0x800) {\n arr[arr.length] = hexTable[0xC0 | (c >> 6)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n if (c < 0xD800 || c >= 0xE000) {\n arr[arr.length] = hexTable[0xE0 | (c >> 12)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n continue;\n }\n\n i += 1;\n c = 0x10000 + (((c & 0x3FF) << 10) | (segment.charCodeAt(i) & 0x3FF));\n\n arr[arr.length] = hexTable[0xF0 | (c >> 18)]\n + hexTable[0x80 | ((c >> 12) & 0x3F)]\n + hexTable[0x80 | ((c >> 6) & 0x3F)]\n + hexTable[0x80 | (c & 0x3F)];\n }\n\n out += arr.join('');\n }\n\n return out;\n};\n\nvar compact = function compact(value) {\n var queue = [{ obj: { o: value }, prop: 'o' }];\n var refs = [];\n\n for (var i = 0; i < queue.length; ++i) {\n var item = queue[i];\n var obj = item.obj[item.prop];\n\n var keys = Object.keys(obj);\n for (var j = 0; j < keys.length; ++j) {\n var key = keys[j];\n var val = obj[key];\n if (typeof val === 'object' && val !== null && refs.indexOf(val) === -1) {\n queue.push({ obj: obj, prop: key });\n refs.push(val);\n }\n }\n }\n\n compactQueue(queue);\n\n return value;\n};\n\nvar isRegExp = function isRegExp(obj) {\n return Object.prototype.toString.call(obj) === '[object RegExp]';\n};\n\nvar isBuffer = function isBuffer(obj) {\n if (!obj || typeof obj !== 'object') {\n return false;\n }\n\n return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));\n};\n\nvar combine = function combine(a, b) {\n return [].concat(a, b);\n};\n\nvar maybeMap = function maybeMap(val, fn) {\n if (isArray(val)) {\n var mapped = [];\n for (var i = 0; i < val.length; i += 1) {\n mapped.push(fn(val[i]));\n }\n return mapped;\n }\n return fn(val);\n};\n\nmodule.exports = {\n arrayToObject: arrayToObject,\n assign: assign,\n combine: combine,\n compact: compact,\n decode: decode,\n encode: encode,\n isBuffer: isBuffer,\n isRegExp: isRegExp,\n maybeMap: maybeMap,\n merge: merge\n};\n","'use strict';\n\nvar getSideChannel = require('side-channel');\nvar utils = require('./utils');\nvar formats = require('./formats');\nvar has = Object.prototype.hasOwnProperty;\n\nvar arrayPrefixGenerators = {\n brackets: function brackets(prefix) {\n return prefix + '[]';\n },\n comma: 'comma',\n indices: function indices(prefix, key) {\n return prefix + '[' + key + ']';\n },\n repeat: function repeat(prefix) {\n return prefix;\n }\n};\n\nvar isArray = Array.isArray;\nvar push = Array.prototype.push;\nvar pushToArray = function (arr, valueOrArray) {\n push.apply(arr, isArray(valueOrArray) ? valueOrArray : [valueOrArray]);\n};\n\nvar toISO = Date.prototype.toISOString;\n\nvar defaultFormat = formats['default'];\nvar defaults = {\n addQueryPrefix: false,\n allowDots: false,\n allowEmptyArrays: false,\n arrayFormat: 'indices',\n charset: 'utf-8',\n charsetSentinel: false,\n commaRoundTrip: false,\n delimiter: '&',\n encode: true,\n encodeDotInKeys: false,\n encoder: utils.encode,\n encodeValuesOnly: false,\n filter: void undefined,\n format: defaultFormat,\n formatter: formats.formatters[defaultFormat],\n // deprecated\n indices: false,\n serializeDate: function serializeDate(date) {\n return toISO.call(date);\n },\n skipNulls: false,\n strictNullHandling: false\n};\n\nvar isNonNullishPrimitive = function isNonNullishPrimitive(v) {\n return typeof v === 'string'\n || typeof v === 'number'\n || typeof v === 'boolean'\n || typeof v === 'symbol'\n || typeof v === 'bigint';\n};\n\nvar sentinel = {};\n\nvar stringify = function stringify(\n object,\n prefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n sideChannel\n) {\n var obj = object;\n\n var tmpSc = sideChannel;\n var step = 0;\n var findFlag = false;\n while ((tmpSc = tmpSc.get(sentinel)) !== void undefined && !findFlag) {\n // Where object last appeared in the ref tree\n var pos = tmpSc.get(object);\n step += 1;\n if (typeof pos !== 'undefined') {\n if (pos === step) {\n throw new RangeError('Cyclic object value');\n } else {\n findFlag = true; // Break while\n }\n }\n if (typeof tmpSc.get(sentinel) === 'undefined') {\n step = 0;\n }\n }\n\n if (typeof filter === 'function') {\n obj = filter(prefix, obj);\n } else if (obj instanceof Date) {\n obj = serializeDate(obj);\n } else if (generateArrayPrefix === 'comma' && isArray(obj)) {\n obj = utils.maybeMap(obj, function (value) {\n if (value instanceof Date) {\n return serializeDate(value);\n }\n return value;\n });\n }\n\n if (obj === null) {\n if (strictNullHandling) {\n return encoder && !encodeValuesOnly ? encoder(prefix, defaults.encoder, charset, 'key', format) : prefix;\n }\n\n obj = '';\n }\n\n if (isNonNullishPrimitive(obj) || utils.isBuffer(obj)) {\n if (encoder) {\n var keyValue = encodeValuesOnly ? prefix : encoder(prefix, defaults.encoder, charset, 'key', format);\n return [formatter(keyValue) + '=' + formatter(encoder(obj, defaults.encoder, charset, 'value', format))];\n }\n return [formatter(prefix) + '=' + formatter(String(obj))];\n }\n\n var values = [];\n\n if (typeof obj === 'undefined') {\n return values;\n }\n\n var objKeys;\n if (generateArrayPrefix === 'comma' && isArray(obj)) {\n // we need to join elements in\n if (encodeValuesOnly && encoder) {\n obj = utils.maybeMap(obj, encoder);\n }\n objKeys = [{ value: obj.length > 0 ? obj.join(',') || null : void undefined }];\n } else if (isArray(filter)) {\n objKeys = filter;\n } else {\n var keys = Object.keys(obj);\n objKeys = sort ? keys.sort(sort) : keys;\n }\n\n var encodedPrefix = encodeDotInKeys ? String(prefix).replace(/\\./g, '%2E') : String(prefix);\n\n var adjustedPrefix = commaRoundTrip && isArray(obj) && obj.length === 1 ? encodedPrefix + '[]' : encodedPrefix;\n\n if (allowEmptyArrays && isArray(obj) && obj.length === 0) {\n return adjustedPrefix + '[]';\n }\n\n for (var j = 0; j < objKeys.length; ++j) {\n var key = objKeys[j];\n var value = typeof key === 'object' && key && typeof key.value !== 'undefined'\n ? key.value\n : obj[key];\n\n if (skipNulls && value === null) {\n continue;\n }\n\n var encodedKey = allowDots && encodeDotInKeys ? String(key).replace(/\\./g, '%2E') : String(key);\n var keyPrefix = isArray(obj)\n ? typeof generateArrayPrefix === 'function' ? generateArrayPrefix(adjustedPrefix, encodedKey) : adjustedPrefix\n : adjustedPrefix + (allowDots ? '.' + encodedKey : '[' + encodedKey + ']');\n\n sideChannel.set(object, step);\n var valueSideChannel = getSideChannel();\n valueSideChannel.set(sentinel, sideChannel);\n pushToArray(values, stringify(\n value,\n keyPrefix,\n generateArrayPrefix,\n commaRoundTrip,\n allowEmptyArrays,\n strictNullHandling,\n skipNulls,\n encodeDotInKeys,\n generateArrayPrefix === 'comma' && encodeValuesOnly && isArray(obj) ? null : encoder,\n filter,\n sort,\n allowDots,\n serializeDate,\n format,\n formatter,\n encodeValuesOnly,\n charset,\n valueSideChannel\n ));\n }\n\n return values;\n};\n\nvar normalizeStringifyOptions = function normalizeStringifyOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.encodeDotInKeys !== 'undefined' && typeof opts.encodeDotInKeys !== 'boolean') {\n throw new TypeError('`encodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.encoder !== null && typeof opts.encoder !== 'undefined' && typeof opts.encoder !== 'function') {\n throw new TypeError('Encoder has to be a function.');\n }\n\n var charset = opts.charset || defaults.charset;\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n\n var format = formats['default'];\n if (typeof opts.format !== 'undefined') {\n if (!has.call(formats.formatters, opts.format)) {\n throw new TypeError('Unknown format option provided.');\n }\n format = opts.format;\n }\n var formatter = formats.formatters[format];\n\n var filter = defaults.filter;\n if (typeof opts.filter === 'function' || isArray(opts.filter)) {\n filter = opts.filter;\n }\n\n var arrayFormat;\n if (opts.arrayFormat in arrayPrefixGenerators) {\n arrayFormat = opts.arrayFormat;\n } else if ('indices' in opts) {\n arrayFormat = opts.indices ? 'indices' : 'repeat';\n } else {\n arrayFormat = defaults.arrayFormat;\n }\n\n if ('commaRoundTrip' in opts && typeof opts.commaRoundTrip !== 'boolean') {\n throw new TypeError('`commaRoundTrip` must be a boolean, or absent');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.encodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n addQueryPrefix: typeof opts.addQueryPrefix === 'boolean' ? opts.addQueryPrefix : defaults.addQueryPrefix,\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n arrayFormat: arrayFormat,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n commaRoundTrip: !!opts.commaRoundTrip,\n delimiter: typeof opts.delimiter === 'undefined' ? defaults.delimiter : opts.delimiter,\n encode: typeof opts.encode === 'boolean' ? opts.encode : defaults.encode,\n encodeDotInKeys: typeof opts.encodeDotInKeys === 'boolean' ? opts.encodeDotInKeys : defaults.encodeDotInKeys,\n encoder: typeof opts.encoder === 'function' ? opts.encoder : defaults.encoder,\n encodeValuesOnly: typeof opts.encodeValuesOnly === 'boolean' ? opts.encodeValuesOnly : defaults.encodeValuesOnly,\n filter: filter,\n format: format,\n formatter: formatter,\n serializeDate: typeof opts.serializeDate === 'function' ? opts.serializeDate : defaults.serializeDate,\n skipNulls: typeof opts.skipNulls === 'boolean' ? opts.skipNulls : defaults.skipNulls,\n sort: typeof opts.sort === 'function' ? opts.sort : null,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (object, opts) {\n var obj = object;\n var options = normalizeStringifyOptions(opts);\n\n var objKeys;\n var filter;\n\n if (typeof options.filter === 'function') {\n filter = options.filter;\n obj = filter('', obj);\n } else if (isArray(options.filter)) {\n filter = options.filter;\n objKeys = filter;\n }\n\n var keys = [];\n\n if (typeof obj !== 'object' || obj === null) {\n return '';\n }\n\n var generateArrayPrefix = arrayPrefixGenerators[options.arrayFormat];\n var commaRoundTrip = generateArrayPrefix === 'comma' && options.commaRoundTrip;\n\n if (!objKeys) {\n objKeys = Object.keys(obj);\n }\n\n if (options.sort) {\n objKeys.sort(options.sort);\n }\n\n var sideChannel = getSideChannel();\n for (var i = 0; i < objKeys.length; ++i) {\n var key = objKeys[i];\n var value = obj[key];\n\n if (options.skipNulls && value === null) {\n continue;\n }\n pushToArray(keys, stringify(\n value,\n key,\n generateArrayPrefix,\n commaRoundTrip,\n options.allowEmptyArrays,\n options.strictNullHandling,\n options.skipNulls,\n options.encodeDotInKeys,\n options.encode ? options.encoder : null,\n options.filter,\n options.sort,\n options.allowDots,\n options.serializeDate,\n options.format,\n options.formatter,\n options.encodeValuesOnly,\n options.charset,\n sideChannel\n ));\n }\n\n var joined = keys.join(options.delimiter);\n var prefix = options.addQueryPrefix === true ? '?' : '';\n\n if (options.charsetSentinel) {\n if (options.charset === 'iso-8859-1') {\n // encodeURIComponent('✓'), the \"numeric entity\" representation of a checkmark\n prefix += 'utf8=%26%2310003%3B&';\n } else {\n // encodeURIComponent('✓')\n prefix += 'utf8=%E2%9C%93&';\n }\n }\n\n return joined.length > 0 ? prefix + joined : '';\n};\n","'use strict';\n\nvar utils = require('./utils');\n\nvar has = Object.prototype.hasOwnProperty;\nvar isArray = Array.isArray;\n\nvar defaults = {\n allowDots: false,\n allowEmptyArrays: false,\n allowPrototypes: false,\n allowSparse: false,\n arrayLimit: 20,\n charset: 'utf-8',\n charsetSentinel: false,\n comma: false,\n decodeDotInKeys: false,\n decoder: utils.decode,\n delimiter: '&',\n depth: 5,\n duplicates: 'combine',\n ignoreQueryPrefix: false,\n interpretNumericEntities: false,\n parameterLimit: 1000,\n parseArrays: true,\n plainObjects: false,\n strictDepth: false,\n strictNullHandling: false\n};\n\nvar interpretNumericEntities = function (str) {\n return str.replace(/&#(\\d+);/g, function ($0, numberStr) {\n return String.fromCharCode(parseInt(numberStr, 10));\n });\n};\n\nvar parseArrayValue = function (val, options) {\n if (val && typeof val === 'string' && options.comma && val.indexOf(',') > -1) {\n return val.split(',');\n }\n\n return val;\n};\n\n// This is what browsers will submit when the ✓ character occurs in an\n// application/x-www-form-urlencoded body and the encoding of the page containing\n// the form is iso-8859-1, or when the submitted form has an accept-charset\n// attribute of iso-8859-1. Presumably also with other charsets that do not contain\n// the ✓ character, such as us-ascii.\nvar isoSentinel = 'utf8=%26%2310003%3B'; // encodeURIComponent('✓')\n\n// These are the percent-encoded utf-8 octets representing a checkmark, indicating that the request actually is utf-8 encoded.\nvar charsetSentinel = 'utf8=%E2%9C%93'; // encodeURIComponent('✓')\n\nvar parseValues = function parseQueryStringValues(str, options) {\n var obj = { __proto__: null };\n\n var cleanStr = options.ignoreQueryPrefix ? str.replace(/^\\?/, '') : str;\n cleanStr = cleanStr.replace(/%5B/gi, '[').replace(/%5D/gi, ']');\n var limit = options.parameterLimit === Infinity ? undefined : options.parameterLimit;\n var parts = cleanStr.split(options.delimiter, limit);\n var skipIndex = -1; // Keep track of where the utf8 sentinel was found\n var i;\n\n var charset = options.charset;\n if (options.charsetSentinel) {\n for (i = 0; i < parts.length; ++i) {\n if (parts[i].indexOf('utf8=') === 0) {\n if (parts[i] === charsetSentinel) {\n charset = 'utf-8';\n } else if (parts[i] === isoSentinel) {\n charset = 'iso-8859-1';\n }\n skipIndex = i;\n i = parts.length; // The eslint settings do not allow break;\n }\n }\n }\n\n for (i = 0; i < parts.length; ++i) {\n if (i === skipIndex) {\n continue;\n }\n var part = parts[i];\n\n var bracketEqualsPos = part.indexOf(']=');\n var pos = bracketEqualsPos === -1 ? part.indexOf('=') : bracketEqualsPos + 1;\n\n var key;\n var val;\n if (pos === -1) {\n key = options.decoder(part, defaults.decoder, charset, 'key');\n val = options.strictNullHandling ? null : '';\n } else {\n key = options.decoder(part.slice(0, pos), defaults.decoder, charset, 'key');\n val = utils.maybeMap(\n parseArrayValue(part.slice(pos + 1), options),\n function (encodedVal) {\n return options.decoder(encodedVal, defaults.decoder, charset, 'value');\n }\n );\n }\n\n if (val && options.interpretNumericEntities && charset === 'iso-8859-1') {\n val = interpretNumericEntities(String(val));\n }\n\n if (part.indexOf('[]=') > -1) {\n val = isArray(val) ? [val] : val;\n }\n\n var existing = has.call(obj, key);\n if (existing && options.duplicates === 'combine') {\n obj[key] = utils.combine(obj[key], val);\n } else if (!existing || options.duplicates === 'last') {\n obj[key] = val;\n }\n }\n\n return obj;\n};\n\nvar parseObject = function (chain, val, options, valuesParsed) {\n var leaf = valuesParsed ? val : parseArrayValue(val, options);\n\n for (var i = chain.length - 1; i >= 0; --i) {\n var obj;\n var root = chain[i];\n\n if (root === '[]' && options.parseArrays) {\n obj = options.allowEmptyArrays && (leaf === '' || (options.strictNullHandling && leaf === null))\n ? []\n : [].concat(leaf);\n } else {\n obj = options.plainObjects ? { __proto__: null } : {};\n var cleanRoot = root.charAt(0) === '[' && root.charAt(root.length - 1) === ']' ? root.slice(1, -1) : root;\n var decodedRoot = options.decodeDotInKeys ? cleanRoot.replace(/%2E/g, '.') : cleanRoot;\n var index = parseInt(decodedRoot, 10);\n if (!options.parseArrays && decodedRoot === '') {\n obj = { 0: leaf };\n } else if (\n !isNaN(index)\n && root !== decodedRoot\n && String(index) === decodedRoot\n && index >= 0\n && (options.parseArrays && index <= options.arrayLimit)\n ) {\n obj = [];\n obj[index] = leaf;\n } else if (decodedRoot !== '__proto__') {\n obj[decodedRoot] = leaf;\n }\n }\n\n leaf = obj;\n }\n\n return leaf;\n};\n\nvar parseKeys = function parseQueryStringKeys(givenKey, val, options, valuesParsed) {\n if (!givenKey) {\n return;\n }\n\n // Transform dot notation to bracket notation\n var key = options.allowDots ? givenKey.replace(/\\.([^.[]+)/g, '[$1]') : givenKey;\n\n // The regex chunks\n\n var brackets = /(\\[[^[\\]]*])/;\n var child = /(\\[[^[\\]]*])/g;\n\n // Get the parent\n\n var segment = options.depth > 0 && brackets.exec(key);\n var parent = segment ? key.slice(0, segment.index) : key;\n\n // Stash the parent if it exists\n\n var keys = [];\n if (parent) {\n // If we aren't using plain objects, optionally prefix keys that would overwrite object prototype properties\n if (!options.plainObjects && has.call(Object.prototype, parent)) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n\n keys.push(parent);\n }\n\n // Loop through children appending to the array until we hit depth\n\n var i = 0;\n while (options.depth > 0 && (segment = child.exec(key)) !== null && i < options.depth) {\n i += 1;\n if (!options.plainObjects && has.call(Object.prototype, segment[1].slice(1, -1))) {\n if (!options.allowPrototypes) {\n return;\n }\n }\n keys.push(segment[1]);\n }\n\n // If there's a remainder, check strictDepth option for throw, else just add whatever is left\n\n if (segment) {\n if (options.strictDepth === true) {\n throw new RangeError('Input depth exceeded depth option of ' + options.depth + ' and strictDepth is true');\n }\n keys.push('[' + key.slice(segment.index) + ']');\n }\n\n return parseObject(keys, val, options, valuesParsed);\n};\n\nvar normalizeParseOptions = function normalizeParseOptions(opts) {\n if (!opts) {\n return defaults;\n }\n\n if (typeof opts.allowEmptyArrays !== 'undefined' && typeof opts.allowEmptyArrays !== 'boolean') {\n throw new TypeError('`allowEmptyArrays` option can only be `true` or `false`, when provided');\n }\n\n if (typeof opts.decodeDotInKeys !== 'undefined' && typeof opts.decodeDotInKeys !== 'boolean') {\n throw new TypeError('`decodeDotInKeys` option can only be `true` or `false`, when provided');\n }\n\n if (opts.decoder !== null && typeof opts.decoder !== 'undefined' && typeof opts.decoder !== 'function') {\n throw new TypeError('Decoder has to be a function.');\n }\n\n if (typeof opts.charset !== 'undefined' && opts.charset !== 'utf-8' && opts.charset !== 'iso-8859-1') {\n throw new TypeError('The charset option must be either utf-8, iso-8859-1, or undefined');\n }\n var charset = typeof opts.charset === 'undefined' ? defaults.charset : opts.charset;\n\n var duplicates = typeof opts.duplicates === 'undefined' ? defaults.duplicates : opts.duplicates;\n\n if (duplicates !== 'combine' && duplicates !== 'first' && duplicates !== 'last') {\n throw new TypeError('The duplicates option must be either combine, first, or last');\n }\n\n var allowDots = typeof opts.allowDots === 'undefined' ? opts.decodeDotInKeys === true ? true : defaults.allowDots : !!opts.allowDots;\n\n return {\n allowDots: allowDots,\n allowEmptyArrays: typeof opts.allowEmptyArrays === 'boolean' ? !!opts.allowEmptyArrays : defaults.allowEmptyArrays,\n allowPrototypes: typeof opts.allowPrototypes === 'boolean' ? opts.allowPrototypes : defaults.allowPrototypes,\n allowSparse: typeof opts.allowSparse === 'boolean' ? opts.allowSparse : defaults.allowSparse,\n arrayLimit: typeof opts.arrayLimit === 'number' ? opts.arrayLimit : defaults.arrayLimit,\n charset: charset,\n charsetSentinel: typeof opts.charsetSentinel === 'boolean' ? opts.charsetSentinel : defaults.charsetSentinel,\n comma: typeof opts.comma === 'boolean' ? opts.comma : defaults.comma,\n decodeDotInKeys: typeof opts.decodeDotInKeys === 'boolean' ? opts.decodeDotInKeys : defaults.decodeDotInKeys,\n decoder: typeof opts.decoder === 'function' ? opts.decoder : defaults.decoder,\n delimiter: typeof opts.delimiter === 'string' || utils.isRegExp(opts.delimiter) ? opts.delimiter : defaults.delimiter,\n // eslint-disable-next-line no-implicit-coercion, no-extra-parens\n depth: (typeof opts.depth === 'number' || opts.depth === false) ? +opts.depth : defaults.depth,\n duplicates: duplicates,\n ignoreQueryPrefix: opts.ignoreQueryPrefix === true,\n interpretNumericEntities: typeof opts.interpretNumericEntities === 'boolean' ? opts.interpretNumericEntities : defaults.interpretNumericEntities,\n parameterLimit: typeof opts.parameterLimit === 'number' ? opts.parameterLimit : defaults.parameterLimit,\n parseArrays: opts.parseArrays !== false,\n plainObjects: typeof opts.plainObjects === 'boolean' ? opts.plainObjects : defaults.plainObjects,\n strictDepth: typeof opts.strictDepth === 'boolean' ? !!opts.strictDepth : defaults.strictDepth,\n strictNullHandling: typeof opts.strictNullHandling === 'boolean' ? opts.strictNullHandling : defaults.strictNullHandling\n };\n};\n\nmodule.exports = function (str, opts) {\n var options = normalizeParseOptions(opts);\n\n if (str === '' || str === null || typeof str === 'undefined') {\n return options.plainObjects ? { __proto__: null } : {};\n }\n\n var tempObj = typeof str === 'string' ? parseValues(str, options) : str;\n var obj = options.plainObjects ? { __proto__: null } : {};\n\n // Iterate over the keys and setup the new object\n\n var keys = Object.keys(tempObj);\n for (var i = 0; i < keys.length; ++i) {\n var key = keys[i];\n var newObj = parseKeys(key, tempObj[key], options, typeof str === 'string');\n obj = utils.merge(obj, newObj, options);\n }\n\n if (options.allowSparse === true) {\n return obj;\n }\n\n return utils.compact(obj);\n};\n","'use strict';\n\nvar stringify = require('./stringify');\nvar parse = require('./parse');\nvar formats = require('./formats');\n\nmodule.exports = {\n formats: formats,\n parse: parse,\n stringify: stringify\n};\n","/*\n * Copyright Joyent, Inc. and other Node contributors.\n *\n * Permission is hereby granted, free of charge, to any person obtaining a\n * copy of this software and associated documentation files (the\n * \"Software\"), to deal in the Software without restriction, including\n * without limitation the rights to use, copy, modify, merge, publish,\n * distribute, sublicense, and/or sell copies of the Software, and to permit\n * persons to whom the Software is furnished to do so, subject to the\n * following conditions:\n *\n * The above copyright notice and this permission notice shall be included\n * in all copies or substantial portions of the Software.\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n * NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n * USE OR OTHER DEALINGS IN THE SOFTWARE.\n */\n\n'use strict';\n\nvar punycode = require('punycode/');\n\nfunction Url() {\n this.protocol = null;\n this.slashes = null;\n this.auth = null;\n this.host = null;\n this.port = null;\n this.hostname = null;\n this.hash = null;\n this.search = null;\n this.query = null;\n this.pathname = null;\n this.path = null;\n this.href = null;\n}\n\n// Reference: RFC 3986, RFC 1808, RFC 2396\n\n/*\n * define these here so at least they only have to be\n * compiled once on the first module load.\n */\nvar protocolPattern = /^([a-z0-9.+-]+:)/i,\n portPattern = /:[0-9]*$/,\n\n // Special case for a simple path URL\n simplePathPattern = /^(\\/\\/?(?!\\/)[^?\\s]*)(\\?[^\\s]*)?$/,\n\n /*\n * RFC 2396: characters reserved for delimiting URLs.\n * We actually just auto-escape these.\n */\n delims = [\n '<', '>', '\"', '`', ' ', '\\r', '\\n', '\\t'\n ],\n\n // RFC 2396: characters not allowed for various reasons.\n unwise = [\n '{', '}', '|', '\\\\', '^', '`'\n ].concat(delims),\n\n // Allowed by RFCs, but cause of XSS attacks. Always escape these.\n autoEscape = ['\\''].concat(unwise),\n /*\n * Characters that are never ever allowed in a hostname.\n * Note that any invalid chars are also handled, but these\n * are the ones that are *expected* to be seen, so we fast-path\n * them.\n */\n nonHostChars = [\n '%', '/', '?', ';', '#'\n ].concat(autoEscape),\n hostEndingChars = [\n '/', '?', '#'\n ],\n hostnameMaxLen = 255,\n hostnamePartPattern = /^[+a-z0-9A-Z_-]{0,63}$/,\n hostnamePartStart = /^([+a-z0-9A-Z_-]{0,63})(.*)$/,\n // protocols that can allow \"unsafe\" and \"unwise\" chars.\n unsafeProtocol = {\n javascript: true,\n 'javascript:': true\n },\n // protocols that never have a hostname.\n hostlessProtocol = {\n javascript: true,\n 'javascript:': true\n },\n // protocols that always contain a // bit.\n slashedProtocol = {\n http: true,\n https: true,\n ftp: true,\n gopher: true,\n file: true,\n 'http:': true,\n 'https:': true,\n 'ftp:': true,\n 'gopher:': true,\n 'file:': true\n },\n querystring = require('qs');\n\nfunction urlParse(url, parseQueryString, slashesDenoteHost) {\n if (url && typeof url === 'object' && url instanceof Url) { return url; }\n\n var u = new Url();\n u.parse(url, parseQueryString, slashesDenoteHost);\n return u;\n}\n\nUrl.prototype.parse = function (url, parseQueryString, slashesDenoteHost) {\n if (typeof url !== 'string') {\n throw new TypeError(\"Parameter 'url' must be a string, not \" + typeof url);\n }\n\n /*\n * Copy chrome, IE, opera backslash-handling behavior.\n * Back slashes before the query string get converted to forward slashes\n * See: https://code.google.com/p/chromium/issues/detail?id=25916\n */\n var queryIndex = url.indexOf('?'),\n splitter = queryIndex !== -1 && queryIndex < url.indexOf('#') ? '?' : '#',\n uSplit = url.split(splitter),\n slashRegex = /\\\\/g;\n uSplit[0] = uSplit[0].replace(slashRegex, '/');\n url = uSplit.join(splitter);\n\n var rest = url;\n\n /*\n * trim before proceeding.\n * This is to support parse stuff like \" http://foo.com \\n\"\n */\n rest = rest.trim();\n\n if (!slashesDenoteHost && url.split('#').length === 1) {\n // Try fast path regexp\n var simplePath = simplePathPattern.exec(rest);\n if (simplePath) {\n this.path = rest;\n this.href = rest;\n this.pathname = simplePath[1];\n if (simplePath[2]) {\n this.search = simplePath[2];\n if (parseQueryString) {\n this.query = querystring.parse(this.search.substr(1));\n } else {\n this.query = this.search.substr(1);\n }\n } else if (parseQueryString) {\n this.search = '';\n this.query = {};\n }\n return this;\n }\n }\n\n var proto = protocolPattern.exec(rest);\n if (proto) {\n proto = proto[0];\n var lowerProto = proto.toLowerCase();\n this.protocol = lowerProto;\n rest = rest.substr(proto.length);\n }\n\n /*\n * figure out if it's got a host\n * user@server is *always* interpreted as a hostname, and url\n * resolution will treat //foo/bar as host=foo,path=bar because that's\n * how the browser resolves relative URLs.\n */\n if (slashesDenoteHost || proto || rest.match(/^\\/\\/[^@/]+@[^@/]+/)) {\n var slashes = rest.substr(0, 2) === '//';\n if (slashes && !(proto && hostlessProtocol[proto])) {\n rest = rest.substr(2);\n this.slashes = true;\n }\n }\n\n if (!hostlessProtocol[proto] && (slashes || (proto && !slashedProtocol[proto]))) {\n\n /*\n * there's a hostname.\n * the first instance of /, ?, ;, or # ends the host.\n *\n * If there is an @ in the hostname, then non-host chars *are* allowed\n * to the left of the last @ sign, unless some host-ending character\n * comes *before* the @-sign.\n * URLs are obnoxious.\n *\n * ex:\n * http://a@b@c/ => user:a@b host:c\n * http://a@b?@c => user:a host:c path:/?@c\n */\n\n /*\n * v0.12 TODO(isaacs): This is not quite how Chrome does things.\n * Review our test case against browsers more comprehensively.\n */\n\n // find the first instance of any hostEndingChars\n var hostEnd = -1;\n for (var i = 0; i < hostEndingChars.length; i++) {\n var hec = rest.indexOf(hostEndingChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { hostEnd = hec; }\n }\n\n /*\n * at this point, either we have an explicit point where the\n * auth portion cannot go past, or the last @ char is the decider.\n */\n var auth, atSign;\n if (hostEnd === -1) {\n // atSign can be anywhere.\n atSign = rest.lastIndexOf('@');\n } else {\n /*\n * atSign must be in auth portion.\n * http://a@b/c@d => host:b auth:a path:/c@d\n */\n atSign = rest.lastIndexOf('@', hostEnd);\n }\n\n /*\n * Now we have a portion which is definitely the auth.\n * Pull that off.\n */\n if (atSign !== -1) {\n auth = rest.slice(0, atSign);\n rest = rest.slice(atSign + 1);\n this.auth = decodeURIComponent(auth);\n }\n\n // the host is the remaining to the left of the first non-host char\n hostEnd = -1;\n for (var i = 0; i < nonHostChars.length; i++) {\n var hec = rest.indexOf(nonHostChars[i]);\n if (hec !== -1 && (hostEnd === -1 || hec < hostEnd)) { hostEnd = hec; }\n }\n // if we still have not hit it, then the entire thing is a host.\n if (hostEnd === -1) { hostEnd = rest.length; }\n\n this.host = rest.slice(0, hostEnd);\n rest = rest.slice(hostEnd);\n\n // pull out port.\n this.parseHost();\n\n /*\n * we've indicated that there is a hostname,\n * so even if it's empty, it has to be present.\n */\n this.hostname = this.hostname || '';\n\n /*\n * if hostname begins with [ and ends with ]\n * assume that it's an IPv6 address.\n */\n var ipv6Hostname = this.hostname[0] === '[' && this.hostname[this.hostname.length - 1] === ']';\n\n // validate a little.\n if (!ipv6Hostname) {\n var hostparts = this.hostname.split(/\\./);\n for (var i = 0, l = hostparts.length; i < l; i++) {\n var part = hostparts[i];\n if (!part) { continue; }\n if (!part.match(hostnamePartPattern)) {\n var newpart = '';\n for (var j = 0, k = part.length; j < k; j++) {\n if (part.charCodeAt(j) > 127) {\n /*\n * we replace non-ASCII char with a temporary placeholder\n * we need this to make sure size of hostname is not\n * broken by replacing non-ASCII by nothing\n */\n newpart += 'x';\n } else {\n newpart += part[j];\n }\n }\n // we test again with ASCII char only\n if (!newpart.match(hostnamePartPattern)) {\n var validParts = hostparts.slice(0, i);\n var notHost = hostparts.slice(i + 1);\n var bit = part.match(hostnamePartStart);\n if (bit) {\n validParts.push(bit[1]);\n notHost.unshift(bit[2]);\n }\n if (notHost.length) {\n rest = '/' + notHost.join('.') + rest;\n }\n this.hostname = validParts.join('.');\n break;\n }\n }\n }\n }\n\n if (this.hostname.length > hostnameMaxLen) {\n this.hostname = '';\n } else {\n // hostnames are always lower case.\n this.hostname = this.hostname.toLowerCase();\n }\n\n if (!ipv6Hostname) {\n /*\n * IDNA Support: Returns a punycoded representation of \"domain\".\n * It only converts parts of the domain name that\n * have non-ASCII characters, i.e. it doesn't matter if\n * you call it with a domain that already is ASCII-only.\n */\n this.hostname = punycode.toASCII(this.hostname);\n }\n\n var p = this.port ? ':' + this.port : '';\n var h = this.hostname || '';\n this.host = h + p;\n this.href += this.host;\n\n /*\n * strip [ and ] from the hostname\n * the host field still retains them, though\n */\n if (ipv6Hostname) {\n this.hostname = this.hostname.substr(1, this.hostname.length - 2);\n if (rest[0] !== '/') {\n rest = '/' + rest;\n }\n }\n }\n\n /*\n * now rest is set to the post-host stuff.\n * chop off any delim chars.\n */\n if (!unsafeProtocol[lowerProto]) {\n\n /*\n * First, make 100% sure that any \"autoEscape\" chars get\n * escaped, even if encodeURIComponent doesn't think they\n * need to be.\n */\n for (var i = 0, l = autoEscape.length; i < l; i++) {\n var ae = autoEscape[i];\n if (rest.indexOf(ae) === -1) { continue; }\n var esc = encodeURIComponent(ae);\n if (esc === ae) {\n esc = escape(ae);\n }\n rest = rest.split(ae).join(esc);\n }\n }\n\n // chop off from the tail first.\n var hash = rest.indexOf('#');\n if (hash !== -1) {\n // got a fragment string.\n this.hash = rest.substr(hash);\n rest = rest.slice(0, hash);\n }\n var qm = rest.indexOf('?');\n if (qm !== -1) {\n this.search = rest.substr(qm);\n this.query = rest.substr(qm + 1);\n if (parseQueryString) {\n this.query = querystring.parse(this.query);\n }\n rest = rest.slice(0, qm);\n } else if (parseQueryString) {\n // no query string, but parseQueryString still requested\n this.search = '';\n this.query = {};\n }\n if (rest) { this.pathname = rest; }\n if (slashedProtocol[lowerProto] && this.hostname && !this.pathname) {\n this.pathname = '/';\n }\n\n // to support http.request\n if (this.pathname || this.search) {\n var p = this.pathname || '';\n var s = this.search || '';\n this.path = p + s;\n }\n\n // finally, reconstruct the href based on what has been validated.\n this.href = this.format();\n return this;\n};\n\n// format a parsed object into a url string\nfunction urlFormat(obj) {\n /*\n * ensure it's an object, and not a string url.\n * If it's an obj, this is a no-op.\n * this way, you can call url_format() on strings\n * to clean up potentially wonky urls.\n */\n if (typeof obj === 'string') { obj = urlParse(obj); }\n if (!(obj instanceof Url)) { return Url.prototype.format.call(obj); }\n return obj.format();\n}\n\nUrl.prototype.format = function () {\n var auth = this.auth || '';\n if (auth) {\n auth = encodeURIComponent(auth);\n auth = auth.replace(/%3A/i, ':');\n auth += '@';\n }\n\n var protocol = this.protocol || '',\n pathname = this.pathname || '',\n hash = this.hash || '',\n host = false,\n query = '';\n\n if (this.host) {\n host = auth + this.host;\n } else if (this.hostname) {\n host = auth + (this.hostname.indexOf(':') === -1 ? this.hostname : '[' + this.hostname + ']');\n if (this.port) {\n host += ':' + this.port;\n }\n }\n\n if (this.query && typeof this.query === 'object' && Object.keys(this.query).length) {\n query = querystring.stringify(this.query, {\n arrayFormat: 'repeat',\n addQueryPrefix: false\n });\n }\n\n var search = this.search || (query && ('?' + query)) || '';\n\n if (protocol && protocol.substr(-1) !== ':') { protocol += ':'; }\n\n /*\n * only the slashedProtocols get the //. Not mailto:, xmpp:, etc.\n * unless they had them to begin with.\n */\n if (this.slashes || (!protocol || slashedProtocol[protocol]) && host !== false) {\n host = '//' + (host || '');\n if (pathname && pathname.charAt(0) !== '/') { pathname = '/' + pathname; }\n } else if (!host) {\n host = '';\n }\n\n if (hash && hash.charAt(0) !== '#') { hash = '#' + hash; }\n if (search && search.charAt(0) !== '?') { search = '?' + search; }\n\n pathname = pathname.replace(/[?#]/g, function (match) {\n return encodeURIComponent(match);\n });\n search = search.replace('#', '%23');\n\n return protocol + host + pathname + search + hash;\n};\n\nfunction urlResolve(source, relative) {\n return urlParse(source, false, true).resolve(relative);\n}\n\nUrl.prototype.resolve = function (relative) {\n return this.resolveObject(urlParse(relative, false, true)).format();\n};\n\nfunction urlResolveObject(source, relative) {\n if (!source) { return relative; }\n return urlParse(source, false, true).resolveObject(relative);\n}\n\nUrl.prototype.resolveObject = function (relative) {\n if (typeof relative === 'string') {\n var rel = new Url();\n rel.parse(relative, false, true);\n relative = rel;\n }\n\n var result = new Url();\n var tkeys = Object.keys(this);\n for (var tk = 0; tk < tkeys.length; tk++) {\n var tkey = tkeys[tk];\n result[tkey] = this[tkey];\n }\n\n /*\n * hash is always overridden, no matter what.\n * even href=\"\" will remove it.\n */\n result.hash = relative.hash;\n\n // if the relative url is empty, then there's nothing left to do here.\n if (relative.href === '') {\n result.href = result.format();\n return result;\n }\n\n // hrefs like //foo/bar always cut to the protocol.\n if (relative.slashes && !relative.protocol) {\n // take everything except the protocol from relative\n var rkeys = Object.keys(relative);\n for (var rk = 0; rk < rkeys.length; rk++) {\n var rkey = rkeys[rk];\n if (rkey !== 'protocol') { result[rkey] = relative[rkey]; }\n }\n\n // urlParse appends trailing / to urls like http://www.example.com\n if (slashedProtocol[result.protocol] && result.hostname && !result.pathname) {\n result.pathname = '/';\n result.path = result.pathname;\n }\n\n result.href = result.format();\n return result;\n }\n\n if (relative.protocol && relative.protocol !== result.protocol) {\n /*\n * if it's a known url protocol, then changing\n * the protocol does weird things\n * first, if it's not file:, then we MUST have a host,\n * and if there was a path\n * to begin with, then we MUST have a path.\n * if it is file:, then the host is dropped,\n * because that's known to be hostless.\n * anything else is assumed to be absolute.\n */\n if (!slashedProtocol[relative.protocol]) {\n var keys = Object.keys(relative);\n for (var v = 0; v < keys.length; v++) {\n var k = keys[v];\n result[k] = relative[k];\n }\n result.href = result.format();\n return result;\n }\n\n result.protocol = relative.protocol;\n if (!relative.host && !hostlessProtocol[relative.protocol]) {\n var relPath = (relative.pathname || '').split('/');\n while (relPath.length && !(relative.host = relPath.shift())) { }\n if (!relative.host) { relative.host = ''; }\n if (!relative.hostname) { relative.hostname = ''; }\n if (relPath[0] !== '') { relPath.unshift(''); }\n if (relPath.length < 2) { relPath.unshift(''); }\n result.pathname = relPath.join('/');\n } else {\n result.pathname = relative.pathname;\n }\n result.search = relative.search;\n result.query = relative.query;\n result.host = relative.host || '';\n result.auth = relative.auth;\n result.hostname = relative.hostname || relative.host;\n result.port = relative.port;\n // to support http.request\n if (result.pathname || result.search) {\n var p = result.pathname || '';\n var s = result.search || '';\n result.path = p + s;\n }\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n }\n\n var isSourceAbs = result.pathname && result.pathname.charAt(0) === '/',\n isRelAbs = relative.host || relative.pathname && relative.pathname.charAt(0) === '/',\n mustEndAbs = isRelAbs || isSourceAbs || (result.host && relative.pathname),\n removeAllDots = mustEndAbs,\n srcPath = result.pathname && result.pathname.split('/') || [],\n relPath = relative.pathname && relative.pathname.split('/') || [],\n psychotic = result.protocol && !slashedProtocol[result.protocol];\n\n /*\n * if the url is a non-slashed url, then relative\n * links like ../.. should be able\n * to crawl up to the hostname, as well. This is strange.\n * result.protocol has already been set by now.\n * Later on, put the first path part into the host field.\n */\n if (psychotic) {\n result.hostname = '';\n result.port = null;\n if (result.host) {\n if (srcPath[0] === '') { srcPath[0] = result.host; } else { srcPath.unshift(result.host); }\n }\n result.host = '';\n if (relative.protocol) {\n relative.hostname = null;\n relative.port = null;\n if (relative.host) {\n if (relPath[0] === '') { relPath[0] = relative.host; } else { relPath.unshift(relative.host); }\n }\n relative.host = null;\n }\n mustEndAbs = mustEndAbs && (relPath[0] === '' || srcPath[0] === '');\n }\n\n if (isRelAbs) {\n // it's absolute.\n result.host = relative.host || relative.host === '' ? relative.host : result.host;\n result.hostname = relative.hostname || relative.hostname === '' ? relative.hostname : result.hostname;\n result.search = relative.search;\n result.query = relative.query;\n srcPath = relPath;\n // fall through to the dot-handling below.\n } else if (relPath.length) {\n /*\n * it's relative\n * throw away the existing file, and take the new path instead.\n */\n if (!srcPath) { srcPath = []; }\n srcPath.pop();\n srcPath = srcPath.concat(relPath);\n result.search = relative.search;\n result.query = relative.query;\n } else if (relative.search != null) {\n /*\n * just pull out the search.\n * like href='?foo'.\n * Put this after the other two cases because it simplifies the booleans\n */\n if (psychotic) {\n result.host = srcPath.shift();\n result.hostname = result.host;\n /*\n * occationaly the auth can get stuck only in host\n * this especially happens in cases like\n * url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n */\n var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.hostname = authInHost.shift();\n result.host = result.hostname;\n }\n }\n result.search = relative.search;\n result.query = relative.query;\n // to support http.request\n if (result.pathname !== null || result.search !== null) {\n result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : '');\n }\n result.href = result.format();\n return result;\n }\n\n if (!srcPath.length) {\n /*\n * no path at all. easy.\n * we've already handled the other stuff above.\n */\n result.pathname = null;\n // to support http.request\n if (result.search) {\n result.path = '/' + result.search;\n } else {\n result.path = null;\n }\n result.href = result.format();\n return result;\n }\n\n /*\n * if a url ENDs in . or .., then it must get a trailing slash.\n * however, if it ends in anything else non-slashy,\n * then it must NOT get a trailing slash.\n */\n var last = srcPath.slice(-1)[0];\n var hasTrailingSlash = (result.host || relative.host || srcPath.length > 1) && (last === '.' || last === '..') || last === '';\n\n /*\n * strip single dots, resolve double dots to parent dir\n * if the path tries to go above the root, `up` ends up > 0\n */\n var up = 0;\n for (var i = srcPath.length; i >= 0; i--) {\n last = srcPath[i];\n if (last === '.') {\n srcPath.splice(i, 1);\n } else if (last === '..') {\n srcPath.splice(i, 1);\n up++;\n } else if (up) {\n srcPath.splice(i, 1);\n up--;\n }\n }\n\n // if the path is allowed to go above the root, restore leading ..s\n if (!mustEndAbs && !removeAllDots) {\n for (; up--; up) {\n srcPath.unshift('..');\n }\n }\n\n if (mustEndAbs && srcPath[0] !== '' && (!srcPath[0] || srcPath[0].charAt(0) !== '/')) {\n srcPath.unshift('');\n }\n\n if (hasTrailingSlash && (srcPath.join('/').substr(-1) !== '/')) {\n srcPath.push('');\n }\n\n var isAbsolute = srcPath[0] === '' || (srcPath[0] && srcPath[0].charAt(0) === '/');\n\n // put the host back\n if (psychotic) {\n result.hostname = isAbsolute ? '' : srcPath.length ? srcPath.shift() : '';\n result.host = result.hostname;\n /*\n * occationaly the auth can get stuck only in host\n * this especially happens in cases like\n * url.resolveObject('mailto:local1@domain1', 'local2@domain2')\n */\n var authInHost = result.host && result.host.indexOf('@') > 0 ? result.host.split('@') : false;\n if (authInHost) {\n result.auth = authInHost.shift();\n result.hostname = authInHost.shift();\n result.host = result.hostname;\n }\n }\n\n mustEndAbs = mustEndAbs || (result.host && srcPath.length);\n\n if (mustEndAbs && !isAbsolute) {\n srcPath.unshift('');\n }\n\n if (srcPath.length > 0) {\n result.pathname = srcPath.join('/');\n } else {\n result.pathname = null;\n result.path = null;\n }\n\n // to support request.http\n if (result.pathname !== null || result.search !== null) {\n result.path = (result.pathname ? result.pathname : '') + (result.search ? result.search : '');\n }\n result.auth = relative.auth || result.auth;\n result.slashes = result.slashes || relative.slashes;\n result.href = result.format();\n return result;\n};\n\nUrl.prototype.parseHost = function () {\n var host = this.host;\n var port = portPattern.exec(host);\n if (port) {\n port = port[0];\n if (port !== ':') {\n this.port = port.substr(1);\n }\n host = host.substr(0, host.length - port.length);\n }\n if (host) { this.hostname = host; }\n};\n\nexports.parse = urlParse;\nexports.resolve = urlResolve;\nexports.resolveObject = urlResolveObject;\nexports.format = urlFormat;\n\nexports.Url = Url;\n","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nvar SELF = '_self';\nexport var launchUri = function (url) {\n var windowProxy = window.open(url, SELF);\n if (windowProxy) {\n return Promise.resolve(windowProxy);\n }\n else {\n return Promise.reject();\n }\n};\n//# sourceMappingURL=urlOpener.js.map","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nexport var setState = function (state) {\n window.sessionStorage.setItem('oauth_state', state);\n};\nexport var getState = function () {\n var oauth_state = window.sessionStorage.getItem('oauth_state');\n window.sessionStorage.removeItem('oauth_state');\n return oauth_state;\n};\nexport var setPKCE = function (private_key) {\n window.sessionStorage.setItem('ouath_pkce_key', private_key);\n};\nexport var getPKCE = function () {\n var ouath_pkce_key = window.sessionStorage.getItem('ouath_pkce_key');\n window.sessionStorage.removeItem('ouath_pkce_key');\n return ouath_pkce_key;\n};\nexport var clearAll = function () {\n window.sessionStorage.removeItem('ouath_pkce_key');\n window.sessionStorage.removeItem('oauth_state');\n};\n//# sourceMappingURL=oauthStorage.js.map","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { __assign, __awaiter, __generator, __read } from \"tslib\";\nimport { parse } from 'url'; // Used for OAuth parsing of Cognito Hosted UI\nimport { launchUri } from './urlOpener';\nimport * as oAuthStorage from './oauthStorage';\nimport { Buffer } from 'buffer';\nimport { isCognitoHostedOpts, CognitoHostedUIIdentityProvider, } from '../types/Auth';\nimport { ConsoleLogger as Logger, Hub, urlSafeEncode } from '@aws-amplify/core';\nimport { Sha256 } from '@aws-crypto/sha256-js';\nvar AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'\n ? Symbol.for('amplify_default')\n : '@@amplify_default');\nvar dispatchAuthEvent = function (event, data, message) {\n Hub.dispatch('auth', { event: event, data: data, message: message }, 'Auth', AMPLIFY_SYMBOL);\n};\nvar logger = new Logger('OAuth');\nvar OAuth = /** @class */ (function () {\n function OAuth(_a) {\n var config = _a.config, cognitoClientId = _a.cognitoClientId, _b = _a.scopes, scopes = _b === void 0 ? [] : _b;\n this._urlOpener = config.urlOpener || launchUri;\n this._config = config;\n this._cognitoClientId = cognitoClientId;\n if (!this.isValidScopes(scopes))\n throw Error('scopes must be a String Array');\n this._scopes = scopes;\n }\n OAuth.prototype.isValidScopes = function (scopes) {\n return (Array.isArray(scopes) && scopes.every(function (scope) { return typeof scope === 'string'; }));\n };\n OAuth.prototype.oauthSignIn = function (responseType, domain, redirectSignIn, clientId, provider, customState) {\n if (responseType === void 0) { responseType = 'code'; }\n if (provider === void 0) { provider = CognitoHostedUIIdentityProvider.Cognito; }\n var generatedState = this._generateState(32);\n /* encodeURIComponent is not URL safe, use urlSafeEncode instead. Cognito\n single-encodes/decodes url on first sign in and double-encodes/decodes url\n when user already signed in. Using encodeURIComponent, Base32, Base64 add\n characters % or = which on further encoding becomes unsafe. '=' create issue\n for parsing query params.\n Refer: https://github.com/aws-amplify/amplify-js/issues/5218 */\n var state = customState\n ? generatedState + \"-\" + urlSafeEncode(customState)\n : generatedState;\n oAuthStorage.setState(state);\n var pkce_key = this._generateRandom(128);\n oAuthStorage.setPKCE(pkce_key);\n var code_challenge = this._generateChallenge(pkce_key);\n var code_challenge_method = 'S256';\n var scopesString = this._scopes.join(' ');\n var queryString = Object.entries(__assign(__assign({ redirect_uri: redirectSignIn, response_type: responseType, client_id: clientId, identity_provider: provider, scope: scopesString, state: state }, (responseType === 'code' ? { code_challenge: code_challenge } : {})), (responseType === 'code' ? { code_challenge_method: code_challenge_method } : {})))\n .map(function (_a) {\n var _b = __read(_a, 2), k = _b[0], v = _b[1];\n return encodeURIComponent(k) + \"=\" + encodeURIComponent(v);\n })\n .join('&');\n var URL = \"https://\" + domain + \"/oauth2/authorize?\" + queryString;\n logger.debug(\"Redirecting to \" + URL);\n this._urlOpener(URL, redirectSignIn);\n };\n OAuth.prototype._handleCodeFlow = function (currentUrl) {\n return __awaiter(this, void 0, void 0, function () {\n var code, currentUrlPathname, redirectSignInPathname, oAuthTokenEndpoint, client_id, redirect_uri, code_verifier, oAuthTokenBody, body, _a, access_token, refresh_token, id_token, error;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n code = (parse(currentUrl).query || '')\n .split('&')\n .map(function (pairings) { return pairings.split('='); })\n .reduce(function (accum, _a) {\n var _b;\n var _c = __read(_a, 2), k = _c[0], v = _c[1];\n return (__assign(__assign({}, accum), (_b = {}, _b[k] = v, _b)));\n }, { code: undefined }).code;\n currentUrlPathname = parse(currentUrl).pathname || '/';\n redirectSignInPathname = parse(this._config.redirectSignIn).pathname || '/';\n if (!code || currentUrlPathname !== redirectSignInPathname) {\n return [2 /*return*/];\n }\n oAuthTokenEndpoint = 'https://' + this._config.domain + '/oauth2/token';\n dispatchAuthEvent('codeFlow', {}, \"Retrieving tokens from \" + oAuthTokenEndpoint);\n client_id = isCognitoHostedOpts(this._config)\n ? this._cognitoClientId\n : this._config.clientID;\n redirect_uri = isCognitoHostedOpts(this._config)\n ? this._config.redirectSignIn\n : this._config.redirectUri;\n code_verifier = oAuthStorage.getPKCE();\n oAuthTokenBody = __assign({ grant_type: 'authorization_code', code: code,\n client_id: client_id,\n redirect_uri: redirect_uri }, (code_verifier ? { code_verifier: code_verifier } : {}));\n logger.debug(\"Calling token endpoint: \" + oAuthTokenEndpoint + \" with\", oAuthTokenBody);\n body = Object.entries(oAuthTokenBody)\n .map(function (_a) {\n var _b = __read(_a, 2), k = _b[0], v = _b[1];\n return encodeURIComponent(k) + \"=\" + encodeURIComponent(v);\n })\n .join('&');\n return [4 /*yield*/, fetch(oAuthTokenEndpoint, {\n method: 'POST',\n headers: {\n 'Content-Type': 'application/x-www-form-urlencoded',\n },\n body: body,\n })];\n case 1: return [4 /*yield*/, (_b.sent()).json()];\n case 2:\n _a = _b.sent(), access_token = _a.access_token, refresh_token = _a.refresh_token, id_token = _a.id_token, error = _a.error;\n if (error) {\n throw new Error(error);\n }\n return [2 /*return*/, {\n accessToken: access_token,\n refreshToken: refresh_token,\n idToken: id_token,\n }];\n }\n });\n });\n };\n OAuth.prototype._handleImplicitFlow = function (currentUrl) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, id_token, access_token;\n return __generator(this, function (_b) {\n _a = (parse(currentUrl).hash || '#')\n .substr(1) // Remove # from returned code\n .split('&')\n .map(function (pairings) { return pairings.split('='); })\n .reduce(function (accum, _a) {\n var _b;\n var _c = __read(_a, 2), k = _c[0], v = _c[1];\n return (__assign(__assign({}, accum), (_b = {}, _b[k] = v, _b)));\n }, {\n id_token: undefined,\n access_token: undefined,\n }), id_token = _a.id_token, access_token = _a.access_token;\n dispatchAuthEvent('implicitFlow', {}, \"Got tokens from \" + currentUrl);\n logger.debug(\"Retrieving implicit tokens from \" + currentUrl + \" with\");\n return [2 /*return*/, {\n accessToken: access_token,\n idToken: id_token,\n refreshToken: null,\n }];\n });\n });\n };\n OAuth.prototype.handleAuthResponse = function (currentUrl) {\n return __awaiter(this, void 0, void 0, function () {\n var urlParams, error, error_description, state, _a, _b, e_1;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n _c.trys.push([0, 5, , 6]);\n urlParams = currentUrl\n ? __assign(__assign({}, (parse(currentUrl).hash || '#')\n .substr(1)\n .split('&')\n .map(function (entry) { return entry.split('='); })\n .reduce(function (acc, _a) {\n var _b = __read(_a, 2), k = _b[0], v = _b[1];\n return ((acc[k] = v), acc);\n }, {})), (parse(currentUrl).query || '')\n .split('&')\n .map(function (entry) { return entry.split('='); })\n .reduce(function (acc, _a) {\n var _b = __read(_a, 2), k = _b[0], v = _b[1];\n return ((acc[k] = v), acc);\n }, {}))\n : {};\n error = urlParams.error, error_description = urlParams.error_description;\n if (error) {\n throw new Error(error_description);\n }\n state = this._validateState(urlParams);\n logger.debug(\"Starting \" + this._config.responseType + \" flow with \" + currentUrl);\n if (!(this._config.responseType === 'code')) return [3 /*break*/, 2];\n _a = [{}];\n return [4 /*yield*/, this._handleCodeFlow(currentUrl)];\n case 1: return [2 /*return*/, __assign.apply(void 0, [__assign.apply(void 0, _a.concat([(_c.sent())])), { state: state }])];\n case 2:\n _b = [{}];\n return [4 /*yield*/, this._handleImplicitFlow(currentUrl)];\n case 3: return [2 /*return*/, __assign.apply(void 0, [__assign.apply(void 0, _b.concat([(_c.sent())])), { state: state }])];\n case 4: return [3 /*break*/, 6];\n case 5:\n e_1 = _c.sent();\n logger.debug(\"Error handling auth response.\", e_1);\n throw e_1;\n case 6: return [2 /*return*/];\n }\n });\n });\n };\n OAuth.prototype._validateState = function (urlParams) {\n if (!urlParams) {\n return;\n }\n var savedState = oAuthStorage.getState();\n var returnedState = urlParams.state;\n // This is because savedState only exists if the flow was initiated by Amplify\n if (savedState && savedState !== returnedState) {\n throw new Error('Invalid state in OAuth flow');\n }\n return returnedState;\n };\n OAuth.prototype.signOut = function () {\n return __awaiter(this, void 0, void 0, function () {\n var oAuthLogoutEndpoint, client_id, signout_uri;\n return __generator(this, function (_a) {\n oAuthLogoutEndpoint = 'https://' + this._config.domain + '/logout?';\n client_id = isCognitoHostedOpts(this._config)\n ? this._cognitoClientId\n : this._config.oauth.clientID;\n signout_uri = isCognitoHostedOpts(this._config)\n ? this._config.redirectSignOut\n : this._config.returnTo;\n oAuthLogoutEndpoint += Object.entries({\n client_id: client_id,\n logout_uri: encodeURIComponent(signout_uri),\n })\n .map(function (_a) {\n var _b = __read(_a, 2), k = _b[0], v = _b[1];\n return k + \"=\" + v;\n })\n .join('&');\n dispatchAuthEvent('oAuthSignOut', { oAuth: 'signOut' }, \"Signing out from \" + oAuthLogoutEndpoint);\n logger.debug(\"Signing out from \" + oAuthLogoutEndpoint);\n return [2 /*return*/, this._urlOpener(oAuthLogoutEndpoint, signout_uri)];\n });\n });\n };\n OAuth.prototype._generateState = function (length) {\n var result = '';\n var i = length;\n var chars = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';\n for (; i > 0; --i)\n result += chars[Math.round(Math.random() * (chars.length - 1))];\n return result;\n };\n OAuth.prototype._generateChallenge = function (code) {\n var awsCryptoHash = new Sha256();\n awsCryptoHash.update(code);\n var resultFromAWSCrypto = awsCryptoHash.digestSync();\n var b64 = Buffer.from(resultFromAWSCrypto).toString('base64');\n var base64URLFromAWSCrypto = this._base64URL(b64);\n return base64URLFromAWSCrypto;\n };\n OAuth.prototype._base64URL = function (string) {\n return string.replace(/=/g, '').replace(/\\+/g, '-').replace(/\\//g, '_');\n };\n OAuth.prototype._generateRandom = function (size) {\n var CHARSET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~';\n var buffer = new Uint8Array(size);\n if (typeof window !== 'undefined' && !!window.crypto) {\n window.crypto.getRandomValues(buffer);\n }\n else {\n for (var i = 0; i < size; i += 1) {\n buffer[i] = (Math.random() * CHARSET.length) | 0;\n }\n }\n return this._bufferToString(buffer);\n };\n OAuth.prototype._bufferToString = function (buffer) {\n var CHARSET = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';\n var state = [];\n for (var i = 0; i < buffer.byteLength; i += 1) {\n var index = buffer[i] % CHARSET.length;\n state.push(CHARSET[index]);\n }\n return state.join('');\n };\n return OAuth;\n}());\nexport default OAuth;\n//# sourceMappingURL=OAuth.js.map","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { browserOrNode } from '@aws-amplify/core';\nexport default (function (callback) {\n if (browserOrNode().isBrowser && window.location) {\n var url = window.location.href;\n callback({ url: url });\n }\n else if (browserOrNode().isNode) {\n // continue building on ssr\n (function () { }); // noop\n }\n else {\n throw new Error('Not supported');\n }\n});\n//# sourceMappingURL=urlListener.js.map","export var AuthErrorStrings;\n(function (AuthErrorStrings) {\n AuthErrorStrings[\"DEFAULT_MSG\"] = \"Authentication Error\";\n AuthErrorStrings[\"EMPTY_EMAIL\"] = \"Email cannot be empty\";\n AuthErrorStrings[\"EMPTY_PHONE\"] = \"Phone number cannot be empty\";\n AuthErrorStrings[\"EMPTY_USERNAME\"] = \"Username cannot be empty\";\n AuthErrorStrings[\"INVALID_USERNAME\"] = \"The username should either be a string or one of the sign in types\";\n AuthErrorStrings[\"EMPTY_PASSWORD\"] = \"Password cannot be empty\";\n AuthErrorStrings[\"EMPTY_CODE\"] = \"Confirmation code cannot be empty\";\n AuthErrorStrings[\"SIGN_UP_ERROR\"] = \"Error creating account\";\n AuthErrorStrings[\"NO_MFA\"] = \"No valid MFA method provided\";\n AuthErrorStrings[\"INVALID_MFA\"] = \"Invalid MFA type\";\n AuthErrorStrings[\"EMPTY_CHALLENGE\"] = \"Challenge response cannot be empty\";\n AuthErrorStrings[\"NO_USER_SESSION\"] = \"Failed to get the session because the user is empty\";\n AuthErrorStrings[\"NETWORK_ERROR\"] = \"Network Error\";\n AuthErrorStrings[\"DEVICE_CONFIG\"] = \"Device tracking has not been configured in this User Pool\";\n AuthErrorStrings[\"AUTOSIGNIN_ERROR\"] = \"Please use your credentials to sign in\";\n})(AuthErrorStrings || (AuthErrorStrings = {}));\n//# sourceMappingURL=AuthErrorStrings.js.map","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { __extends } from \"tslib\";\nimport { ConsoleLogger as Logger } from '@aws-amplify/core';\nimport { AuthErrorStrings } from './common/AuthErrorStrings';\nvar logger = new Logger('AuthError');\nvar AuthError = /** @class */ (function (_super) {\n __extends(AuthError, _super);\n function AuthError(type) {\n var _this = this;\n var _a = authErrorMessages[type], message = _a.message, log = _a.log;\n _this = _super.call(this, message) || this;\n // Hack for making the custom error class work when transpiled to es5\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n _this.constructor = AuthError;\n Object.setPrototypeOf(_this, AuthError.prototype);\n _this.name = 'AuthError';\n _this.log = log || message;\n logger.error(_this.log);\n return _this;\n }\n return AuthError;\n}(Error));\nexport { AuthError };\nvar NoUserPoolError = /** @class */ (function (_super) {\n __extends(NoUserPoolError, _super);\n function NoUserPoolError(type) {\n var _this = _super.call(this, type) || this;\n // Hack for making the custom error class work when transpiled to es5\n // TODO: Delete the following 2 lines after we change the build target to >= es2015\n _this.constructor = NoUserPoolError;\n Object.setPrototypeOf(_this, NoUserPoolError.prototype);\n _this.name = 'NoUserPoolError';\n return _this;\n }\n return NoUserPoolError;\n}(AuthError));\nexport { NoUserPoolError };\nexport var authErrorMessages = {\n noConfig: {\n message: AuthErrorStrings.DEFAULT_MSG,\n log: \"\\n Error: Amplify has not been configured correctly.\\n This error is typically caused by one of the following scenarios:\\n\\n 1. Make sure you're passing the awsconfig object to Amplify.configure() in your app's entry point\\n See https://aws-amplify.github.io/docs/js/authentication#configure-your-app for more information\\n \\n 2. There might be multiple conflicting versions of amplify packages in your node_modules.\\n\\t\\t\\t\\tRefer to our docs site for help upgrading Amplify packages (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js)\\n \",\n },\n missingAuthConfig: {\n message: AuthErrorStrings.DEFAULT_MSG,\n log: \"\\n Error: Amplify has not been configured correctly. \\n The configuration object is missing required auth properties.\\n This error is typically caused by one of the following scenarios:\\n\\n 1. Did you run `amplify push` after adding auth via `amplify add auth`?\\n See https://aws-amplify.github.io/docs/js/authentication#amplify-project-setup for more information\\n\\n 2. This could also be caused by multiple conflicting versions of amplify packages, see (https://docs.amplify.aws/lib/troubleshooting/upgrading/q/platform/js) for help upgrading Amplify packages.\\n \",\n },\n emptyUsername: {\n message: AuthErrorStrings.EMPTY_USERNAME,\n },\n // TODO: should include a list of valid sign-in types\n invalidUsername: {\n message: AuthErrorStrings.INVALID_USERNAME,\n },\n emptyPassword: {\n message: AuthErrorStrings.EMPTY_PASSWORD,\n },\n emptyCode: {\n message: AuthErrorStrings.EMPTY_CODE,\n },\n signUpError: {\n message: AuthErrorStrings.SIGN_UP_ERROR,\n log: 'The first parameter should either be non-null string or object',\n },\n noMFA: {\n message: AuthErrorStrings.NO_MFA,\n },\n invalidMFA: {\n message: AuthErrorStrings.INVALID_MFA,\n },\n emptyChallengeResponse: {\n message: AuthErrorStrings.EMPTY_CHALLENGE,\n },\n noUserSession: {\n message: AuthErrorStrings.NO_USER_SESSION,\n },\n deviceConfig: {\n message: AuthErrorStrings.DEVICE_CONFIG,\n },\n networkError: {\n message: AuthErrorStrings.NETWORK_ERROR,\n },\n autoSignInError: {\n message: AuthErrorStrings.AUTOSIGNIN_ERROR,\n },\n default: {\n message: AuthErrorStrings.DEFAULT_MSG,\n },\n};\n//# sourceMappingURL=Errors.js.map","// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.\n// SPDX-License-Identifier: Apache-2.0\nimport { __assign, __awaiter, __generator, __read } from \"tslib\";\nimport { isUsernamePasswordOpts, isCognitoHostedOpts, isFederatedSignInOptions, isFederatedSignInOptionsCustom, hasCustomState, } from './types';\nimport { Amplify, ConsoleLogger as Logger, Credentials, Hub, StorageHelper, browserOrNode, parseAWSExports, UniversalStorage, urlSafeDecode, } from '@aws-amplify/core';\nimport { CookieStorage, CognitoUserPool, AuthenticationDetails, CognitoUser, CognitoUserSession, CognitoUserAttribute, CognitoIdToken, CognitoRefreshToken, CognitoAccessToken, } from 'amazon-cognito-identity-js';\nimport { parse } from 'url';\nimport OAuth from './OAuth/OAuth';\nimport { default as urlListener } from './urlListener';\nimport { AuthError, NoUserPoolError } from './Errors';\nimport { AuthErrorTypes, CognitoHostedUIIdentityProvider, } from './types/Auth';\nvar logger = new Logger('AuthClass');\nvar USER_ADMIN_SCOPE = 'aws.cognito.signin.user.admin';\n// 10 sec, following this guide https://www.nngroup.com/articles/response-times-3-important-limits/\nvar OAUTH_FLOW_MS_TIMEOUT = 10 * 1000;\nvar AMPLIFY_SYMBOL = (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function'\n ? Symbol.for('amplify_default')\n : '@@amplify_default');\nvar dispatchAuthEvent = function (event, data, message) {\n Hub.dispatch('auth', { event: event, data: data, message: message }, 'Auth', AMPLIFY_SYMBOL);\n};\n// Cognito Documentation for max device\n// tslint:disable-next-line:max-line-length\n// https://docs.aws.amazon.com/cognito-user-identity-pools/latest/APIReference/API_ListDevices.html#API_ListDevices_RequestSyntax\nvar MAX_DEVICES = 60;\nvar MAX_AUTOSIGNIN_POLLING_MS = 3 * 60 * 1000;\n/**\n * Provide authentication steps\n */\nvar AuthClass = /** @class */ (function () {\n /**\n * Initialize Auth with AWS configurations\n * @param {Object} config - Configuration of the Auth\n */\n function AuthClass(config) {\n var _this = this;\n this.userPool = null;\n this.user = null;\n this.oAuthFlowInProgress = false;\n this.autoSignInInitiated = false;\n this.inflightSessionPromise = null;\n this.inflightSessionPromiseCounter = 0;\n this.Credentials = Credentials;\n this.wrapRefreshSessionCallback = function (callback) {\n var wrapped = function (error, data) {\n if (data) {\n dispatchAuthEvent('tokenRefresh', undefined, \"New token retrieved\");\n }\n else {\n dispatchAuthEvent('tokenRefresh_failure', error, \"Failed to retrieve new token\");\n }\n return callback(error, data);\n };\n return wrapped;\n }; // prettier-ignore\n this.configure(config);\n this.currentCredentials = this.currentCredentials.bind(this);\n this.currentUserCredentials = this.currentUserCredentials.bind(this);\n Hub.listen('auth', function (_a) {\n var payload = _a.payload;\n var event = payload.event;\n switch (event) {\n case 'verify':\n case 'signIn':\n _this._storage.setItem('amplify-signin-with-hostedUI', 'false');\n break;\n case 'signOut':\n _this._storage.removeItem('amplify-signin-with-hostedUI');\n break;\n case 'cognitoHostedUI':\n _this._storage.setItem('amplify-signin-with-hostedUI', 'true');\n break;\n }\n });\n }\n AuthClass.prototype.getModuleName = function () {\n return 'Auth';\n };\n AuthClass.prototype.configure = function (config) {\n var _this = this;\n if (!config)\n return this._config || {};\n logger.debug('configure Auth');\n var conf = Object.assign({}, this._config, parseAWSExports(config).Auth, config);\n this._config = conf;\n var _a = this._config, userPoolId = _a.userPoolId, userPoolWebClientId = _a.userPoolWebClientId, cookieStorage = _a.cookieStorage, oauth = _a.oauth, region = _a.region, identityPoolId = _a.identityPoolId, mandatorySignIn = _a.mandatorySignIn, refreshHandlers = _a.refreshHandlers, identityPoolRegion = _a.identityPoolRegion, clientMetadata = _a.clientMetadata, endpoint = _a.endpoint, storage = _a.storage;\n if (!storage) {\n // backward compatability\n if (cookieStorage)\n this._storage = new CookieStorage(cookieStorage);\n else {\n this._storage = config.ssr\n ? new UniversalStorage()\n : new StorageHelper().getStorage();\n }\n }\n else {\n if (!this._isValidAuthStorage(storage)) {\n logger.error('The storage in the Auth config is not valid!');\n throw new Error('Empty storage object');\n }\n this._storage = storage;\n }\n this._storageSync = Promise.resolve();\n if (typeof this._storage['sync'] === 'function') {\n this._storageSync = this._storage['sync']();\n }\n if (userPoolId) {\n var userPoolData = {\n UserPoolId: userPoolId,\n ClientId: userPoolWebClientId,\n endpoint: endpoint,\n };\n userPoolData.Storage = this._storage;\n this.userPool = new CognitoUserPool(userPoolData, this.wrapRefreshSessionCallback);\n }\n this.Credentials.configure({\n mandatorySignIn: mandatorySignIn,\n region: region,\n userPoolId: userPoolId,\n identityPoolId: identityPoolId,\n refreshHandlers: refreshHandlers,\n storage: this._storage,\n identityPoolRegion: identityPoolRegion,\n });\n // initialize cognitoauth client if hosted ui options provided\n // to keep backward compatibility:\n var cognitoHostedUIConfig = oauth\n ? isCognitoHostedOpts(this._config.oauth)\n ? oauth\n : oauth.awsCognito\n : undefined;\n if (cognitoHostedUIConfig) {\n var cognitoAuthParams = Object.assign({\n cognitoClientId: userPoolWebClientId,\n UserPoolId: userPoolId,\n domain: cognitoHostedUIConfig['domain'],\n scopes: cognitoHostedUIConfig['scope'],\n redirectSignIn: cognitoHostedUIConfig['redirectSignIn'],\n redirectSignOut: cognitoHostedUIConfig['redirectSignOut'],\n responseType: cognitoHostedUIConfig['responseType'],\n Storage: this._storage,\n urlOpener: cognitoHostedUIConfig['urlOpener'],\n clientMetadata: clientMetadata,\n }, cognitoHostedUIConfig['options']);\n this._oAuthHandler = new OAuth({\n scopes: cognitoAuthParams.scopes,\n config: cognitoAuthParams,\n cognitoClientId: cognitoAuthParams.cognitoClientId,\n });\n // **NOTE** - Remove this in a future major release as it is a breaking change\n // Prevents _handleAuthResponse from being called multiple times in Expo\n // See https://github.com/aws-amplify/amplify-js/issues/4388\n var usedResponseUrls_1 = {};\n urlListener(function (_a) {\n var url = _a.url;\n if (usedResponseUrls_1[url]) {\n return;\n }\n usedResponseUrls_1[url] = true;\n _this._handleAuthResponse(url);\n });\n }\n dispatchAuthEvent('configured', null, \"The Auth category has been configured successfully\");\n if (!this.autoSignInInitiated &&\n typeof this._storage['getItem'] === 'function') {\n var pollingInitiated = this.isTrueStorageValue('amplify-polling-started');\n if (pollingInitiated) {\n dispatchAuthEvent('autoSignIn_failure', null, AuthErrorTypes.AutoSignInError);\n this._storage.removeItem('amplify-auto-sign-in');\n }\n this._storage.removeItem('amplify-polling-started');\n }\n return this._config;\n };\n /**\n * Sign up with username, password and other attributes like phone, email\n * @param {String | object} params - The user attributes used for signin\n * @param {String[]} restOfAttrs - for the backward compatability\n * @return - A promise resolves callback data if success\n */\n AuthClass.prototype.signUp = function (params) {\n var _this = this;\n var restOfAttrs = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n restOfAttrs[_i - 1] = arguments[_i];\n }\n var _a, _b, _c;\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n var username = null;\n var password = null;\n var attributes = [];\n var validationData = null;\n var clientMetadata;\n var autoSignIn = { enabled: false };\n var autoSignInValidationData = {};\n var autoSignInClientMetaData = {};\n if (params && typeof params === 'string') {\n username = params;\n password = restOfAttrs ? restOfAttrs[0] : null;\n var email = restOfAttrs ? restOfAttrs[1] : null;\n var phone_number = restOfAttrs ? restOfAttrs[2] : null;\n if (email)\n attributes.push(new CognitoUserAttribute({ Name: 'email', Value: email }));\n if (phone_number)\n attributes.push(new CognitoUserAttribute({\n Name: 'phone_number',\n Value: phone_number,\n }));\n }\n else if (params && typeof params === 'object') {\n username = params['username'];\n password = params['password'];\n if (params && params.clientMetadata) {\n clientMetadata = params.clientMetadata;\n }\n else if (this._config.clientMetadata) {\n clientMetadata = this._config.clientMetadata;\n }\n var attrs_1 = params['attributes'];\n if (attrs_1) {\n Object.keys(attrs_1).map(function (key) {\n attributes.push(new CognitoUserAttribute({ Name: key, Value: attrs_1[key] }));\n });\n }\n var validationDataObject_1 = params['validationData'];\n if (validationDataObject_1) {\n validationData = [];\n Object.keys(validationDataObject_1).map(function (key) {\n validationData.push(new CognitoUserAttribute({\n Name: key,\n Value: validationDataObject_1[key],\n }));\n });\n }\n autoSignIn = (_a = params.autoSignIn) !== null && _a !== void 0 ? _a : { enabled: false };\n if (autoSignIn.enabled) {\n this._storage.setItem('amplify-auto-sign-in', 'true');\n autoSignInValidationData = (_b = autoSignIn.validationData) !== null && _b !== void 0 ? _b : {};\n autoSignInClientMetaData = (_c = autoSignIn.clientMetaData) !== null && _c !== void 0 ? _c : {};\n }\n }\n else {\n return this.rejectAuthError(AuthErrorTypes.SignUpError);\n }\n if (!username) {\n return this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n }\n if (!password) {\n return this.rejectAuthError(AuthErrorTypes.EmptyPassword);\n }\n logger.debug('signUp attrs:', attributes);\n logger.debug('signUp validation data:', validationData);\n return new Promise(function (resolve, reject) {\n _this.userPool.signUp(username, password, attributes, validationData, function (err, data) {\n if (err) {\n dispatchAuthEvent('signUp_failure', err, username + \" failed to signup\");\n reject(err);\n }\n else {\n dispatchAuthEvent('signUp', data, username + \" has signed up successfully\");\n if (autoSignIn.enabled) {\n _this.handleAutoSignIn(username, password, autoSignInValidationData, autoSignInClientMetaData, data);\n }\n resolve(data);\n }\n }, clientMetadata);\n });\n };\n AuthClass.prototype.handleAutoSignIn = function (username, password, validationData, clientMetadata, data) {\n this.autoSignInInitiated = true;\n var authDetails = new AuthenticationDetails({\n Username: username,\n Password: password,\n ValidationData: validationData,\n ClientMetadata: clientMetadata,\n });\n if (data.userConfirmed) {\n this.signInAfterUserConfirmed(authDetails);\n }\n else if (this._config.signUpVerificationMethod === 'link') {\n this.handleLinkAutoSignIn(authDetails);\n }\n else {\n this.handleCodeAutoSignIn(authDetails);\n }\n };\n AuthClass.prototype.handleCodeAutoSignIn = function (authDetails) {\n var _this = this;\n var listenEvent = function (_a) {\n var payload = _a.payload;\n if (payload.event === 'confirmSignUp') {\n _this.signInAfterUserConfirmed(authDetails, listenEvent);\n }\n };\n Hub.listen('auth', listenEvent);\n };\n AuthClass.prototype.handleLinkAutoSignIn = function (authDetails) {\n var _this = this;\n this._storage.setItem('amplify-polling-started', 'true');\n var start = Date.now();\n var autoSignInPollingIntervalId = setInterval(function () {\n if (Date.now() - start > MAX_AUTOSIGNIN_POLLING_MS) {\n clearInterval(autoSignInPollingIntervalId);\n dispatchAuthEvent('autoSignIn_failure', null, 'Please confirm your account and use your credentials to sign in.');\n _this._storage.removeItem('amplify-auto-sign-in');\n }\n else {\n _this.signInAfterUserConfirmed(authDetails, null, autoSignInPollingIntervalId);\n }\n }, 5000);\n };\n AuthClass.prototype.signInAfterUserConfirmed = function (authDetails, listenEvent, autoSignInPollingIntervalId) {\n return __awaiter(this, void 0, void 0, function () {\n var user, error_1;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n user = this.createCognitoUser(authDetails.getUsername());\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, user.authenticateUser(authDetails, this.authCallbacks(user, function (value) {\n dispatchAuthEvent('autoSignIn', value, authDetails.getUsername() + \" has signed in successfully\");\n if (listenEvent) {\n Hub.remove('auth', listenEvent);\n }\n if (autoSignInPollingIntervalId) {\n clearInterval(autoSignInPollingIntervalId);\n _this._storage.removeItem('amplify-polling-started');\n }\n _this._storage.removeItem('amplify-auto-sign-in');\n }, function (error) {\n logger.error(error);\n _this._storage.removeItem('amplify-auto-sign-in');\n }))];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n error_1 = _a.sent();\n logger.error(error_1);\n return [3 /*break*/, 4];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Send the verification code to confirm sign up\n * @param {String} username - The username to be confirmed\n * @param {String} code - The verification code\n * @param {ConfirmSignUpOptions} options - other options for confirm signup\n * @return - A promise resolves callback data if success\n */\n AuthClass.prototype.confirmSignUp = function (username, code, options) {\n var _this = this;\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n if (!username) {\n return this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n }\n if (!code) {\n return this.rejectAuthError(AuthErrorTypes.EmptyCode);\n }\n var user = this.createCognitoUser(username);\n var forceAliasCreation = options && typeof options.forceAliasCreation === 'boolean'\n ? options.forceAliasCreation\n : true;\n var clientMetadata;\n if (options && options.clientMetadata) {\n clientMetadata = options.clientMetadata;\n }\n else if (this._config.clientMetadata) {\n clientMetadata = this._config.clientMetadata;\n }\n return new Promise(function (resolve, reject) {\n user.confirmRegistration(code, forceAliasCreation, function (err, data) {\n if (err) {\n reject(err);\n }\n else {\n dispatchAuthEvent('confirmSignUp', data, username + \" has been confirmed successfully\");\n var autoSignIn = _this.isTrueStorageValue('amplify-auto-sign-in');\n if (autoSignIn && !_this.autoSignInInitiated) {\n dispatchAuthEvent('autoSignIn_failure', null, AuthErrorTypes.AutoSignInError);\n _this._storage.removeItem('amplify-auto-sign-in');\n }\n resolve(data);\n }\n }, clientMetadata);\n });\n };\n AuthClass.prototype.isTrueStorageValue = function (value) {\n var item = this._storage.getItem(value);\n return item ? item === 'true' : false;\n };\n /**\n * Resend the verification code\n * @param {String} username - The username to be confirmed\n * @param {ClientMetadata} clientMetadata - Metadata to be passed to Cognito Lambda triggers\n * @return - A promise resolves code delivery details if successful\n */\n AuthClass.prototype.resendSignUp = function (username, clientMetadata) {\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n if (!username) {\n return this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n }\n var user = this.createCognitoUser(username);\n return new Promise(function (resolve, reject) {\n user.resendConfirmationCode(function (err, data) {\n if (err) {\n reject(err);\n }\n else {\n resolve(data);\n }\n }, clientMetadata);\n });\n };\n /**\n * Sign in\n * @param {String | SignInOpts} usernameOrSignInOpts - The username to be signed in or the sign in options\n * @param {String} pw - The password of the username\n * @param {ClientMetaData} clientMetadata - Client metadata for custom workflows\n * @return - A promise resolves the CognitoUser\n */\n AuthClass.prototype.signIn = function (usernameOrSignInOpts, pw, clientMetadata) {\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n var username = null;\n var password = null;\n var validationData = {};\n // for backward compatibility\n if (typeof usernameOrSignInOpts === 'string') {\n username = usernameOrSignInOpts;\n password = pw;\n }\n else if (isUsernamePasswordOpts(usernameOrSignInOpts)) {\n if (typeof pw !== 'undefined') {\n logger.warn('The password should be defined under the first parameter object!');\n }\n username = usernameOrSignInOpts.username;\n password = usernameOrSignInOpts.password;\n validationData = usernameOrSignInOpts.validationData;\n }\n else {\n return this.rejectAuthError(AuthErrorTypes.InvalidUsername);\n }\n if (!username) {\n return this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n }\n var authDetails = new AuthenticationDetails({\n Username: username,\n Password: password,\n ValidationData: validationData,\n ClientMetadata: clientMetadata,\n });\n if (password) {\n return this.signInWithPassword(authDetails);\n }\n else {\n return this.signInWithoutPassword(authDetails);\n }\n };\n /**\n * Return an object with the authentication callbacks\n * @param {CognitoUser} user - the cognito user object\n * @param {} resolve - function called when resolving the current step\n * @param {} reject - function called when rejecting the current step\n * @return - an object with the callback methods for user authentication\n */\n AuthClass.prototype.authCallbacks = function (user, resolve, reject) {\n var _this = this;\n var that = this;\n return {\n onSuccess: function (session) { return __awaiter(_this, void 0, void 0, function () {\n var cred, e_1, currentUser, e_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n logger.debug(session);\n delete user['challengeName'];\n delete user['challengeParam'];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, 5, 9]);\n return [4 /*yield*/, this.Credentials.clear()];\n case 2:\n _a.sent();\n return [4 /*yield*/, this.Credentials.set(session, 'session')];\n case 3:\n cred = _a.sent();\n logger.debug('succeed to get cognito credentials', cred);\n return [3 /*break*/, 9];\n case 4:\n e_1 = _a.sent();\n logger.debug('cannot get cognito credentials', e_1);\n return [3 /*break*/, 9];\n case 5:\n _a.trys.push([5, 7, , 8]);\n return [4 /*yield*/, this.currentUserPoolUser()];\n case 6:\n currentUser = _a.sent();\n that.user = currentUser;\n dispatchAuthEvent('signIn', currentUser, \"A user \" + user.getUsername() + \" has been signed in\");\n resolve(currentUser);\n return [3 /*break*/, 8];\n case 7:\n e_2 = _a.sent();\n logger.error('Failed to get the signed in user', e_2);\n reject(e_2);\n return [3 /*break*/, 8];\n case 8: return [7 /*endfinally*/];\n case 9: return [2 /*return*/];\n }\n });\n }); },\n onFailure: function (err) {\n logger.debug('signIn failure', err);\n dispatchAuthEvent('signIn_failure', err, user.getUsername() + \" failed to signin\");\n reject(err);\n },\n customChallenge: function (challengeParam) {\n logger.debug('signIn custom challenge answer required');\n user['challengeName'] = 'CUSTOM_CHALLENGE';\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n mfaRequired: function (challengeName, challengeParam) {\n logger.debug('signIn MFA required');\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n mfaSetup: function (challengeName, challengeParam) {\n logger.debug('signIn mfa setup', challengeName);\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n newPasswordRequired: function (userAttributes, requiredAttributes) {\n logger.debug('signIn new password');\n user['challengeName'] = 'NEW_PASSWORD_REQUIRED';\n user['challengeParam'] = {\n userAttributes: userAttributes,\n requiredAttributes: requiredAttributes,\n };\n resolve(user);\n },\n totpRequired: function (challengeName, challengeParam) {\n logger.debug('signIn totpRequired');\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n selectMFAType: function (challengeName, challengeParam) {\n logger.debug('signIn selectMFAType', challengeName);\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n };\n };\n /**\n * Sign in with a password\n * @private\n * @param {AuthenticationDetails} authDetails - the user sign in data\n * @return - A promise resolves the CognitoUser object if success or mfa required\n */\n AuthClass.prototype.signInWithPassword = function (authDetails) {\n var _this = this;\n if (this.pendingSignIn) {\n throw new Error('Pending sign-in attempt already in progress');\n }\n var user = this.createCognitoUser(authDetails.getUsername());\n this.pendingSignIn = new Promise(function (resolve, reject) {\n user.authenticateUser(authDetails, _this.authCallbacks(user, function (value) {\n _this.pendingSignIn = null;\n resolve(value);\n }, function (error) {\n _this.pendingSignIn = null;\n reject(error);\n }));\n });\n return this.pendingSignIn;\n };\n /**\n * Sign in without a password\n * @private\n * @param {AuthenticationDetails} authDetails - the user sign in data\n * @return - A promise resolves the CognitoUser object if success or mfa required\n */\n AuthClass.prototype.signInWithoutPassword = function (authDetails) {\n var _this = this;\n var user = this.createCognitoUser(authDetails.getUsername());\n user.setAuthenticationFlowType('CUSTOM_AUTH');\n return new Promise(function (resolve, reject) {\n user.initiateAuth(authDetails, _this.authCallbacks(user, resolve, reject));\n });\n };\n /**\n * This was previously used by an authenticated user to get MFAOptions,\n * but no longer returns a meaningful response. Refer to the documentation for\n * how to setup and use MFA: https://docs.amplify.aws/lib/auth/mfa/q/platform/js\n * @deprecated\n * @param {CognitoUser} user - the current user\n * @return - A promise resolves the current preferred mfa option if success\n */\n AuthClass.prototype.getMFAOptions = function (user) {\n return new Promise(function (res, rej) {\n user.getMFAOptions(function (err, mfaOptions) {\n if (err) {\n logger.debug('get MFA Options failed', err);\n rej(err);\n return;\n }\n logger.debug('get MFA options success', mfaOptions);\n res(mfaOptions);\n return;\n });\n });\n };\n /**\n * get preferred mfa method\n * @param {CognitoUser} user - the current cognito user\n * @param {GetPreferredMFAOpts} params - options for getting the current user preferred MFA\n */\n AuthClass.prototype.getPreferredMFA = function (user, params) {\n var _this = this;\n var that = this;\n return new Promise(function (res, rej) {\n var clientMetadata = _this._config.clientMetadata; // TODO: verify behavior if this is override during signIn\n var bypassCache = params ? params.bypassCache : false;\n user.getUserData(function (err, data) { return __awaiter(_this, void 0, void 0, function () {\n var cleanUpError_1, mfaType;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!err) return [3 /*break*/, 5];\n logger.debug('getting preferred mfa failed', err);\n if (!this.isSessionInvalid(err)) return [3 /*break*/, 4];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.cleanUpInvalidSession(user)];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n cleanUpError_1 = _a.sent();\n rej(new Error(\"Session is invalid due to: \" + err.message + \" and failed to clean up invalid session: \" + cleanUpError_1.message));\n return [2 /*return*/];\n case 4:\n rej(err);\n return [2 /*return*/];\n case 5:\n mfaType = that._getMfaTypeFromUserData(data);\n if (!mfaType) {\n rej('invalid MFA Type');\n return [2 /*return*/];\n }\n else {\n res(mfaType);\n return [2 /*return*/];\n }\n return [2 /*return*/];\n }\n });\n }); }, { bypassCache: bypassCache, clientMetadata: clientMetadata });\n });\n };\n AuthClass.prototype._getMfaTypeFromUserData = function (data) {\n var ret = null;\n var preferredMFA = data.PreferredMfaSetting;\n // if the user has used Auth.setPreferredMFA() to setup the mfa type\n // then the \"PreferredMfaSetting\" would exist in the response\n if (preferredMFA) {\n ret = preferredMFA;\n }\n else {\n // if mfaList exists but empty, then its noMFA\n var mfaList = data.UserMFASettingList;\n if (!mfaList) {\n // if SMS was enabled by using Auth.enableSMS(),\n // the response would contain MFAOptions\n // as for now Cognito only supports for SMS, so we will say it is 'SMS_MFA'\n // if it does not exist, then it should be NOMFA\n var MFAOptions = data.MFAOptions;\n if (MFAOptions) {\n ret = 'SMS_MFA';\n }\n else {\n ret = 'NOMFA';\n }\n }\n else if (mfaList.length === 0) {\n ret = 'NOMFA';\n }\n else {\n logger.debug('invalid case for getPreferredMFA', data);\n }\n }\n return ret;\n };\n AuthClass.prototype._getUserData = function (user, params) {\n var _this = this;\n return new Promise(function (res, rej) {\n user.getUserData(function (err, data) { return __awaiter(_this, void 0, void 0, function () {\n var cleanUpError_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!err) return [3 /*break*/, 5];\n logger.debug('getting user data failed', err);\n if (!this.isSessionInvalid(err)) return [3 /*break*/, 4];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.cleanUpInvalidSession(user)];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n cleanUpError_2 = _a.sent();\n rej(new Error(\"Session is invalid due to: \" + err.message + \" and failed to clean up invalid session: \" + cleanUpError_2.message));\n return [2 /*return*/];\n case 4:\n rej(err);\n return [2 /*return*/];\n case 5:\n res(data);\n _a.label = 6;\n case 6: return [2 /*return*/];\n }\n });\n }); }, params);\n });\n };\n /**\n * set preferred MFA method\n * @param {CognitoUser} user - the current Cognito user\n * @param {string} mfaMethod - preferred mfa method\n * @return - A promise resolve if success\n */\n AuthClass.prototype.setPreferredMFA = function (user, mfaMethod) {\n return __awaiter(this, void 0, void 0, function () {\n var clientMetadata, userData, smsMfaSettings, totpMfaSettings, _a, mfaList, currentMFAType, that;\n var _this = this;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n clientMetadata = this._config.clientMetadata;\n return [4 /*yield*/, this._getUserData(user, {\n bypassCache: true,\n clientMetadata: clientMetadata,\n })];\n case 1:\n userData = _b.sent();\n smsMfaSettings = null;\n totpMfaSettings = null;\n _a = mfaMethod;\n switch (_a) {\n case 'TOTP': return [3 /*break*/, 2];\n case 'SOFTWARE_TOKEN_MFA': return [3 /*break*/, 2];\n case 'SMS': return [3 /*break*/, 3];\n case 'SMS_MFA': return [3 /*break*/, 3];\n case 'NOMFA': return [3 /*break*/, 4];\n }\n return [3 /*break*/, 6];\n case 2:\n totpMfaSettings = {\n PreferredMfa: true,\n Enabled: true,\n };\n return [3 /*break*/, 7];\n case 3:\n smsMfaSettings = {\n PreferredMfa: true,\n Enabled: true,\n };\n return [3 /*break*/, 7];\n case 4:\n mfaList = userData['UserMFASettingList'];\n return [4 /*yield*/, this._getMfaTypeFromUserData(userData)];\n case 5:\n currentMFAType = _b.sent();\n if (currentMFAType === 'NOMFA') {\n return [2 /*return*/, Promise.resolve('No change for mfa type')];\n }\n else if (currentMFAType === 'SMS_MFA') {\n smsMfaSettings = {\n PreferredMfa: false,\n Enabled: false,\n };\n }\n else if (currentMFAType === 'SOFTWARE_TOKEN_MFA') {\n totpMfaSettings = {\n PreferredMfa: false,\n Enabled: false,\n };\n }\n else {\n return [2 /*return*/, this.rejectAuthError(AuthErrorTypes.InvalidMFA)];\n }\n // if there is a UserMFASettingList in the response\n // we need to disable every mfa type in that list\n if (mfaList && mfaList.length !== 0) {\n // to disable SMS or TOTP if exists in that list\n mfaList.forEach(function (mfaType) {\n if (mfaType === 'SMS_MFA') {\n smsMfaSettings = {\n PreferredMfa: false,\n Enabled: false,\n };\n }\n else if (mfaType === 'SOFTWARE_TOKEN_MFA') {\n totpMfaSettings = {\n PreferredMfa: false,\n Enabled: false,\n };\n }\n });\n }\n return [3 /*break*/, 7];\n case 6:\n logger.debug('no validmfa method provided');\n return [2 /*return*/, this.rejectAuthError(AuthErrorTypes.NoMFA)];\n case 7:\n that = this;\n return [2 /*return*/, new Promise(function (res, rej) {\n user.setUserMfaPreference(smsMfaSettings, totpMfaSettings, function (err, result) {\n if (err) {\n logger.debug('Set user mfa preference error', err);\n return rej(err);\n }\n logger.debug('Set user mfa success', result);\n logger.debug('Caching the latest user data into local');\n // cache the latest result into user data\n user.getUserData(function (err, data) { return __awaiter(_this, void 0, void 0, function () {\n var cleanUpError_3;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!err) return [3 /*break*/, 5];\n logger.debug('getting user data failed', err);\n if (!this.isSessionInvalid(err)) return [3 /*break*/, 4];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.cleanUpInvalidSession(user)];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n cleanUpError_3 = _a.sent();\n rej(new Error(\"Session is invalid due to: \" + err.message + \" and failed to clean up invalid session: \" + cleanUpError_3.message));\n return [2 /*return*/];\n case 4: return [2 /*return*/, rej(err)];\n case 5: return [2 /*return*/, res(result)];\n }\n });\n }); }, {\n bypassCache: true,\n clientMetadata: clientMetadata,\n });\n });\n })];\n }\n });\n });\n };\n /**\n * disable SMS\n * @deprecated\n * @param {CognitoUser} user - the current user\n * @return - A promise resolves is success\n */\n AuthClass.prototype.disableSMS = function (user) {\n return new Promise(function (res, rej) {\n user.disableMFA(function (err, data) {\n if (err) {\n logger.debug('disable mfa failed', err);\n rej(err);\n return;\n }\n logger.debug('disable mfa succeed', data);\n res(data);\n return;\n });\n });\n };\n /**\n * enable SMS\n * @deprecated\n * @param {CognitoUser} user - the current user\n * @return - A promise resolves is success\n */\n AuthClass.prototype.enableSMS = function (user) {\n return new Promise(function (res, rej) {\n user.enableMFA(function (err, data) {\n if (err) {\n logger.debug('enable mfa failed', err);\n rej(err);\n return;\n }\n logger.debug('enable mfa succeed', data);\n res(data);\n return;\n });\n });\n };\n /**\n * Setup TOTP\n * @param {CognitoUser} user - the current user\n * @return - A promise resolves with the secret code if success\n */\n AuthClass.prototype.setupTOTP = function (user) {\n return new Promise(function (res, rej) {\n user.associateSoftwareToken({\n onFailure: function (err) {\n logger.debug('associateSoftwareToken failed', err);\n rej(err);\n return;\n },\n associateSecretCode: function (secretCode) {\n logger.debug('associateSoftwareToken success', secretCode);\n res(secretCode);\n return;\n },\n });\n });\n };\n /**\n * verify TOTP setup\n * @param {CognitoUser} user - the current user\n * @param {string} challengeAnswer - challenge answer\n * @return - A promise resolves is success\n */\n AuthClass.prototype.verifyTotpToken = function (user, challengeAnswer) {\n logger.debug('verification totp token', user, challengeAnswer);\n var signInUserSession;\n if (user && typeof user.getSignInUserSession === 'function') {\n signInUserSession = user.getSignInUserSession();\n }\n var isLoggedIn = signInUserSession === null || signInUserSession === void 0 ? void 0 : signInUserSession.isValid();\n return new Promise(function (res, rej) {\n user.verifySoftwareToken(challengeAnswer, 'My TOTP device', {\n onFailure: function (err) {\n logger.debug('verifyTotpToken failed', err);\n rej(err);\n return;\n },\n onSuccess: function (data) {\n if (!isLoggedIn) {\n dispatchAuthEvent('signIn', user, \"A user \" + user.getUsername() + \" has been signed in\");\n }\n dispatchAuthEvent('verify', user, \"A user \" + user.getUsername() + \" has been verified\");\n logger.debug('verifyTotpToken success', data);\n res(data);\n return;\n },\n });\n });\n };\n /**\n * Send MFA code to confirm sign in\n * @param {Object} user - The CognitoUser object\n * @param {String} code - The confirmation code\n */\n AuthClass.prototype.confirmSignIn = function (user, code, mfaType, clientMetadata) {\n var _this = this;\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!code) {\n return this.rejectAuthError(AuthErrorTypes.EmptyCode);\n }\n var that = this;\n return new Promise(function (resolve, reject) {\n user.sendMFACode(code, {\n onSuccess: function (session) { return __awaiter(_this, void 0, void 0, function () {\n var cred, e_3, currentUser, e_4;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n logger.debug(session);\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, 5, 10]);\n return [4 /*yield*/, this.Credentials.clear()];\n case 2:\n _a.sent();\n return [4 /*yield*/, this.Credentials.set(session, 'session')];\n case 3:\n cred = _a.sent();\n logger.debug('succeed to get cognito credentials', cred);\n return [3 /*break*/, 10];\n case 4:\n e_3 = _a.sent();\n logger.debug('cannot get cognito credentials', e_3);\n return [3 /*break*/, 10];\n case 5:\n that.user = user;\n _a.label = 6;\n case 6:\n _a.trys.push([6, 8, , 9]);\n return [4 /*yield*/, this.currentUserPoolUser()];\n case 7:\n currentUser = _a.sent();\n user.attributes = currentUser.attributes;\n return [3 /*break*/, 9];\n case 8:\n e_4 = _a.sent();\n logger.debug('cannot get updated Cognito User', e_4);\n return [3 /*break*/, 9];\n case 9:\n dispatchAuthEvent('signIn', user, \"A user \" + user.getUsername() + \" has been signed in\");\n resolve(user);\n return [7 /*endfinally*/];\n case 10: return [2 /*return*/];\n }\n });\n }); },\n onFailure: function (err) {\n logger.debug('confirm signIn failure', err);\n reject(err);\n },\n }, mfaType, clientMetadata);\n });\n };\n AuthClass.prototype.completeNewPassword = function (user, password, requiredAttributes, clientMetadata) {\n var _this = this;\n if (requiredAttributes === void 0) { requiredAttributes = {}; }\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!password) {\n return this.rejectAuthError(AuthErrorTypes.EmptyPassword);\n }\n var that = this;\n return new Promise(function (resolve, reject) {\n user.completeNewPasswordChallenge(password, requiredAttributes, {\n onSuccess: function (session) { return __awaiter(_this, void 0, void 0, function () {\n var cred, e_5;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n logger.debug(session);\n _a.label = 1;\n case 1:\n _a.trys.push([1, 4, 5, 6]);\n return [4 /*yield*/, this.Credentials.clear()];\n case 2:\n _a.sent();\n return [4 /*yield*/, this.Credentials.set(session, 'session')];\n case 3:\n cred = _a.sent();\n logger.debug('succeed to get cognito credentials', cred);\n return [3 /*break*/, 6];\n case 4:\n e_5 = _a.sent();\n logger.debug('cannot get cognito credentials', e_5);\n return [3 /*break*/, 6];\n case 5:\n that.user = user;\n dispatchAuthEvent('signIn', user, \"A user \" + user.getUsername() + \" has been signed in\");\n resolve(user);\n return [7 /*endfinally*/];\n case 6: return [2 /*return*/];\n }\n });\n }); },\n onFailure: function (err) {\n logger.debug('completeNewPassword failure', err);\n dispatchAuthEvent('completeNewPassword_failure', err, _this.user + \" failed to complete the new password flow\");\n reject(err);\n },\n mfaRequired: function (challengeName, challengeParam) {\n logger.debug('signIn MFA required');\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n mfaSetup: function (challengeName, challengeParam) {\n logger.debug('signIn mfa setup', challengeName);\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n totpRequired: function (challengeName, challengeParam) {\n logger.debug('signIn mfa setup', challengeName);\n user['challengeName'] = challengeName;\n user['challengeParam'] = challengeParam;\n resolve(user);\n },\n }, clientMetadata);\n });\n };\n /**\n * Send the answer to a custom challenge\n * @param {CognitoUser} user - The CognitoUser object\n * @param {String} challengeResponses - The confirmation code\n */\n AuthClass.prototype.sendCustomChallengeAnswer = function (user, challengeResponses, clientMetadata) {\n var _this = this;\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n if (!challengeResponses) {\n return this.rejectAuthError(AuthErrorTypes.EmptyChallengeResponse);\n }\n var that = this;\n return new Promise(function (resolve, reject) {\n user.sendCustomChallengeAnswer(challengeResponses, _this.authCallbacks(user, resolve, reject), clientMetadata);\n });\n };\n /**\n * Delete an authenticated users' attributes\n * @param {CognitoUser} - The currently logged in user object\n * @return {Promise}\n **/\n AuthClass.prototype.deleteUserAttributes = function (user, attributeNames) {\n var that = this;\n return new Promise(function (resolve, reject) {\n that.userSession(user).then(function (session) {\n user.deleteAttributes(attributeNames, function (err, result) {\n if (err) {\n return reject(err);\n }\n else {\n return resolve(result);\n }\n });\n });\n });\n };\n /**\n * Delete the current authenticated user\n * @return {Promise}\n **/\n // TODO: Check return type void\n AuthClass.prototype.deleteUser = function () {\n return __awaiter(this, void 0, void 0, function () {\n var e_6, isSignedInHostedUI;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, this._storageSync];\n case 1:\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n e_6 = _a.sent();\n logger.debug('Failed to sync cache info into memory', e_6);\n throw new Error(e_6);\n case 3:\n isSignedInHostedUI = this._oAuthHandler &&\n this._storage.getItem('amplify-signin-with-hostedUI') === 'true';\n return [2 /*return*/, new Promise(function (res, rej) { return __awaiter(_this, void 0, void 0, function () {\n var user_1;\n var _this = this;\n return __generator(this, function (_a) {\n if (this.userPool) {\n user_1 = this.userPool.getCurrentUser();\n if (!user_1) {\n logger.debug('Failed to get user from user pool');\n return [2 /*return*/, rej(new Error('No current user.'))];\n }\n else {\n user_1.getSession(function (err, session) { return __awaiter(_this, void 0, void 0, function () {\n var cleanUpError_4;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!err) return [3 /*break*/, 5];\n logger.debug('Failed to get the user session', err);\n if (!this.isSessionInvalid(err)) return [3 /*break*/, 4];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.cleanUpInvalidSession(user_1)];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n cleanUpError_4 = _a.sent();\n rej(new Error(\"Session is invalid due to: \" + err.message + \" and failed to clean up invalid session: \" + cleanUpError_4.message));\n return [2 /*return*/];\n case 4: return [2 /*return*/, rej(err)];\n case 5:\n user_1.deleteUser(function (err, result) {\n if (err) {\n rej(err);\n }\n else {\n dispatchAuthEvent('userDeleted', result, 'The authenticated user has been deleted.');\n user_1.signOut();\n _this.user = null;\n try {\n _this.cleanCachedItems(); // clean aws credentials\n }\n catch (e) {\n // TODO: change to rejects in refactor\n logger.debug('failed to clear cached items');\n }\n if (isSignedInHostedUI) {\n _this.oAuthSignOutRedirect(res, rej);\n }\n else {\n dispatchAuthEvent('signOut', _this.user, \"A user has been signed out\");\n res(result);\n }\n }\n });\n _a.label = 6;\n case 6: return [2 /*return*/];\n }\n });\n }); });\n }\n }\n else {\n logger.debug('no Congito User pool');\n rej(new Error('Cognito User pool does not exist'));\n }\n return [2 /*return*/];\n });\n }); })];\n }\n });\n });\n };\n /**\n * Update an authenticated users' attributes\n * @param {CognitoUser} - The currently logged in user object\n * @return {Promise}\n **/\n AuthClass.prototype.updateUserAttributes = function (user, attributes, clientMetadata) {\n var _this = this;\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n var attributeList = [];\n var that = this;\n return new Promise(function (resolve, reject) {\n that.userSession(user).then(function (session) {\n for (var key in attributes) {\n if (key !== 'sub' && key.indexOf('_verified') < 0) {\n var attr = {\n Name: key,\n Value: attributes[key],\n };\n attributeList.push(attr);\n }\n }\n user.updateAttributes(attributeList, function (err, result, details) {\n if (err) {\n dispatchAuthEvent('updateUserAttributes_failure', err, 'Failed to update attributes');\n return reject(err);\n }\n else {\n var attrs = _this.createUpdateAttributesResultList(attributes, details === null || details === void 0 ? void 0 : details.CodeDeliveryDetailsList);\n dispatchAuthEvent('updateUserAttributes', attrs, 'Attributes successfully updated');\n return resolve(result);\n }\n }, clientMetadata);\n });\n });\n };\n AuthClass.prototype.createUpdateAttributesResultList = function (attributes, codeDeliveryDetailsList) {\n var attrs = {};\n Object.keys(attributes).forEach(function (key) {\n attrs[key] = {\n isUpdated: true,\n };\n var codeDeliveryDetails = codeDeliveryDetailsList === null || codeDeliveryDetailsList === void 0 ? void 0 : codeDeliveryDetailsList.find(function (value) { return value.AttributeName === key; });\n if (codeDeliveryDetails) {\n attrs[key].isUpdated = false;\n attrs[key].codeDeliveryDetails = codeDeliveryDetails;\n }\n });\n return attrs;\n };\n /**\n * Return user attributes\n * @param {Object} user - The CognitoUser object\n * @return - A promise resolves to user attributes if success\n */\n AuthClass.prototype.userAttributes = function (user) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n _this.userSession(user).then(function (session) {\n user.getUserAttributes(function (err, attributes) {\n if (err) {\n reject(err);\n }\n else {\n resolve(attributes);\n }\n });\n });\n });\n };\n AuthClass.prototype.verifiedContact = function (user) {\n var that = this;\n return this.userAttributes(user).then(function (attributes) {\n var attrs = that.attributesToObject(attributes);\n var unverified = {};\n var verified = {};\n if (attrs['email']) {\n if (attrs['email_verified']) {\n verified['email'] = attrs['email'];\n }\n else {\n unverified['email'] = attrs['email'];\n }\n }\n if (attrs['phone_number']) {\n if (attrs['phone_number_verified']) {\n verified['phone_number'] = attrs['phone_number'];\n }\n else {\n unverified['phone_number'] = attrs['phone_number'];\n }\n }\n return {\n verified: verified,\n unverified: unverified,\n };\n });\n };\n AuthClass.prototype.isErrorWithMessage = function (err) {\n return (typeof err === 'object' &&\n Object.prototype.hasOwnProperty.call(err, 'message'));\n };\n // Session revoked by another app\n AuthClass.prototype.isTokenRevokedError = function (err) {\n return (this.isErrorWithMessage(err) &&\n err.message === 'Access Token has been revoked');\n };\n AuthClass.prototype.isRefreshTokenRevokedError = function (err) {\n return (this.isErrorWithMessage(err) &&\n err.message === 'Refresh Token has been revoked');\n };\n AuthClass.prototype.isUserDisabledError = function (err) {\n return this.isErrorWithMessage(err) && err.message === 'User is disabled.';\n };\n AuthClass.prototype.isUserDoesNotExistError = function (err) {\n return (this.isErrorWithMessage(err) && err.message === 'User does not exist.');\n };\n AuthClass.prototype.isRefreshTokenExpiredError = function (err) {\n return (this.isErrorWithMessage(err) &&\n err.message === 'Refresh Token has expired');\n };\n AuthClass.prototype.isSignedInHostedUI = function () {\n return (this._oAuthHandler &&\n this._storage.getItem('amplify-signin-with-hostedUI') === 'true');\n };\n AuthClass.prototype.isSessionInvalid = function (err) {\n return (this.isUserDisabledError(err) ||\n this.isUserDoesNotExistError(err) ||\n this.isTokenRevokedError(err) ||\n this.isRefreshTokenRevokedError(err) ||\n this.isRefreshTokenExpiredError(err));\n };\n AuthClass.prototype.cleanUpInvalidSession = function (user) {\n return __awaiter(this, void 0, void 0, function () {\n var e_7;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n user.signOut();\n this.user = null;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.cleanCachedItems()];\n case 2:\n _a.sent(); // clean aws credentials\n return [3 /*break*/, 4];\n case 3:\n e_7 = _a.sent();\n logger.debug('failed to clear cached items');\n return [3 /*break*/, 4];\n case 4:\n if (this.isSignedInHostedUI()) {\n return [2 /*return*/, new Promise(function (res, rej) {\n _this.oAuthSignOutRedirect(res, rej);\n })];\n }\n else {\n dispatchAuthEvent('signOut', this.user, \"A user has been signed out\");\n }\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Get current authenticated user\n * @return - A promise resolves to current authenticated CognitoUser if success\n */\n AuthClass.prototype.currentUserPoolUser = function (params) {\n var _this = this;\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n return new Promise(function (res, rej) {\n _this._storageSync\n .then(function () { return __awaiter(_this, void 0, void 0, function () {\n var user, session, bypassCache, clientMetadata, _a, scope, err_1;\n var _this = this;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (!this.isOAuthInProgress()) return [3 /*break*/, 2];\n logger.debug('OAuth signIn in progress, waiting for resolution...');\n return [4 /*yield*/, new Promise(function (res) {\n var timeoutId = setTimeout(function () {\n logger.debug('OAuth signIn in progress timeout');\n Hub.remove('auth', hostedUISignCallback);\n res();\n }, OAUTH_FLOW_MS_TIMEOUT);\n Hub.listen('auth', hostedUISignCallback);\n function hostedUISignCallback(_a) {\n var payload = _a.payload;\n var event = payload.event;\n if (event === 'cognitoHostedUI' ||\n event === 'cognitoHostedUI_failure') {\n logger.debug(\"OAuth signIn resolved: \" + event);\n clearTimeout(timeoutId);\n Hub.remove('auth', hostedUISignCallback);\n res();\n }\n }\n })];\n case 1:\n _b.sent();\n _b.label = 2;\n case 2:\n user = this.userPool.getCurrentUser();\n if (!user) {\n logger.debug('Failed to get user from user pool');\n rej('No current user');\n return [2 /*return*/];\n }\n _b.label = 3;\n case 3:\n _b.trys.push([3, 7, , 8]);\n return [4 /*yield*/, this._userSession(user)];\n case 4:\n session = _b.sent();\n bypassCache = params ? params.bypassCache : false;\n if (!bypassCache) return [3 /*break*/, 6];\n return [4 /*yield*/, this.Credentials.clear()];\n case 5:\n _b.sent();\n _b.label = 6;\n case 6:\n clientMetadata = this._config.clientMetadata;\n _a = session.getAccessToken().decodePayload().scope, scope = _a === void 0 ? '' : _a;\n if (scope.split(' ').includes(USER_ADMIN_SCOPE)) {\n user.getUserData(function (err, data) { return __awaiter(_this, void 0, void 0, function () {\n var cleanUpError_5, preferredMFA, attributeList, i, attribute, userAttribute, attributes;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!err) return [3 /*break*/, 7];\n logger.debug('getting user data failed', err);\n if (!this.isSessionInvalid(err)) return [3 /*break*/, 5];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.cleanUpInvalidSession(user)];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n cleanUpError_5 = _a.sent();\n rej(new Error(\"Session is invalid due to: \" + err.message + \" and failed to clean up invalid session: \" + cleanUpError_5.message));\n return [2 /*return*/];\n case 4:\n rej(err);\n return [3 /*break*/, 6];\n case 5:\n res(user);\n _a.label = 6;\n case 6: return [2 /*return*/];\n case 7:\n preferredMFA = data.PreferredMfaSetting || 'NOMFA';\n attributeList = [];\n for (i = 0; i < data.UserAttributes.length; i++) {\n attribute = {\n Name: data.UserAttributes[i].Name,\n Value: data.UserAttributes[i].Value,\n };\n userAttribute = new CognitoUserAttribute(attribute);\n attributeList.push(userAttribute);\n }\n attributes = this.attributesToObject(attributeList);\n Object.assign(user, { attributes: attributes, preferredMFA: preferredMFA });\n return [2 /*return*/, res(user)];\n }\n });\n }); }, { bypassCache: bypassCache, clientMetadata: clientMetadata });\n }\n else {\n logger.debug(\"Unable to get the user data because the \" + USER_ADMIN_SCOPE + \" \" +\n \"is not in the scopes of the access token\");\n return [2 /*return*/, res(user)];\n }\n return [3 /*break*/, 8];\n case 7:\n err_1 = _b.sent();\n rej(err_1);\n return [3 /*break*/, 8];\n case 8: return [2 /*return*/];\n }\n });\n }); })\n .catch(function (e) {\n logger.debug('Failed to sync cache info into memory', e);\n return rej(e);\n });\n });\n };\n AuthClass.prototype.isOAuthInProgress = function () {\n return this.oAuthFlowInProgress;\n };\n /**\n * Get current authenticated user\n * @param {CurrentUserOpts} - options for getting the current user\n * @return - A promise resolves to current authenticated CognitoUser if success\n */\n AuthClass.prototype.currentAuthenticatedUser = function (params) {\n return __awaiter(this, void 0, void 0, function () {\n var federatedUser, e_8, federatedInfo, user, e_9;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n logger.debug('getting current authenticated user');\n federatedUser = null;\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this._storageSync];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n e_8 = _a.sent();\n logger.debug('Failed to sync cache info into memory', e_8);\n throw e_8;\n case 4:\n try {\n federatedInfo = JSON.parse(this._storage.getItem('aws-amplify-federatedInfo'));\n if (federatedInfo) {\n federatedUser = __assign(__assign({}, federatedInfo.user), { token: federatedInfo.token });\n }\n }\n catch (e) {\n logger.debug('cannot load federated user from auth storage');\n }\n if (!federatedUser) return [3 /*break*/, 5];\n this.user = federatedUser;\n logger.debug('get current authenticated federated user', this.user);\n return [2 /*return*/, this.user];\n case 5:\n logger.debug('get current authenticated userpool user');\n user = null;\n _a.label = 6;\n case 6:\n _a.trys.push([6, 8, , 9]);\n return [4 /*yield*/, this.currentUserPoolUser(params)];\n case 7:\n user = _a.sent();\n return [3 /*break*/, 9];\n case 8:\n e_9 = _a.sent();\n if (e_9 === 'No userPool') {\n logger.error('Cannot get the current user because the user pool is missing. ' +\n 'Please make sure the Auth module is configured with a valid Cognito User Pool ID');\n }\n logger.debug('The user is not authenticated by the error', e_9);\n return [2 /*return*/, Promise.reject('The user is not authenticated')];\n case 9:\n this.user = user;\n return [2 /*return*/, this.user];\n }\n });\n });\n };\n /**\n * Get current user's session\n * @return - A promise resolves to session object if success\n */\n AuthClass.prototype.currentSession = function () {\n var that = this;\n logger.debug('Getting current session');\n // Purposely not calling the reject method here because we don't need a console error\n if (!this.userPool) {\n return Promise.reject(new Error('No User Pool in the configuration.'));\n }\n return new Promise(function (res, rej) {\n that\n .currentUserPoolUser()\n .then(function (user) {\n that\n .userSession(user)\n .then(function (session) {\n res(session);\n return;\n })\n .catch(function (e) {\n logger.debug('Failed to get the current session', e);\n rej(e);\n return;\n });\n })\n .catch(function (e) {\n logger.debug('Failed to get the current user', e);\n rej(e);\n return;\n });\n });\n };\n AuthClass.prototype._userSession = function (user) {\n return __awaiter(this, void 0, void 0, function () {\n var clientMetadata, userSession;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!user) {\n logger.debug('the user is null');\n return [2 /*return*/, this.rejectAuthError(AuthErrorTypes.NoUserSession)];\n }\n clientMetadata = this._config.clientMetadata;\n // Debouncing the concurrent userSession calls by caching the promise.\n // This solution assumes users will always call this function with the same CognitoUser instance.\n if (this.inflightSessionPromiseCounter === 0) {\n this.inflightSessionPromise = new Promise(function (res, rej) {\n user.getSession(function (err, session) { return __awaiter(_this, void 0, void 0, function () {\n var cleanUpError_6;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!err) return [3 /*break*/, 5];\n logger.debug('Failed to get the session from user', user);\n if (!this.isSessionInvalid(err)) return [3 /*break*/, 4];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.cleanUpInvalidSession(user)];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n cleanUpError_6 = _a.sent();\n rej(new Error(\"Session is invalid due to: \" + err.message + \" and failed to clean up invalid session: \" + cleanUpError_6.message));\n return [2 /*return*/];\n case 4:\n rej(err);\n return [2 /*return*/];\n case 5:\n logger.debug('Succeed to get the user session', session);\n res(session);\n return [2 /*return*/];\n }\n });\n }); }, { clientMetadata: clientMetadata });\n });\n }\n this.inflightSessionPromiseCounter++;\n _a.label = 1;\n case 1:\n _a.trys.push([1, , 3, 4]);\n return [4 /*yield*/, this.inflightSessionPromise];\n case 2:\n userSession = _a.sent();\n // Set private member. Avoid user.setSignInUserSession() to prevent excessive localstorage refresh.\n // @ts-ignore\n user.signInUserSession = userSession;\n return [2 /*return*/, userSession];\n case 3:\n this.inflightSessionPromiseCounter--;\n return [7 /*endfinally*/];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Get the corresponding user session\n * @param {Object} user - The CognitoUser object\n * @return - A promise resolves to the session\n */\n AuthClass.prototype.userSession = function (user) {\n return this._userSession(user);\n };\n /**\n * Get authenticated credentials of current user.\n * @return - A promise resolves to be current user's credentials\n */\n AuthClass.prototype.currentUserCredentials = function () {\n return __awaiter(this, void 0, void 0, function () {\n var e_10, federatedInfo;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n logger.debug('Getting current user credentials');\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this._storageSync];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n e_10 = _a.sent();\n logger.debug('Failed to sync cache info into memory', e_10);\n throw e_10;\n case 4:\n federatedInfo = null;\n try {\n federatedInfo = JSON.parse(this._storage.getItem('aws-amplify-federatedInfo'));\n }\n catch (e) {\n logger.debug('failed to get or parse item aws-amplify-federatedInfo', e);\n }\n if (federatedInfo) {\n // refresh the jwt token here if necessary\n return [2 /*return*/, this.Credentials.refreshFederatedToken(federatedInfo)];\n }\n else {\n return [2 /*return*/, this.currentSession()\n .then(function (session) {\n logger.debug('getting session success', session);\n return _this.Credentials.set(session, 'session');\n })\n .catch(function () {\n logger.debug('getting guest credentials');\n return _this.Credentials.set(null, 'guest');\n })];\n }\n return [2 /*return*/];\n }\n });\n });\n };\n AuthClass.prototype.currentCredentials = function () {\n logger.debug('getting current credentials');\n return this.Credentials.get();\n };\n /**\n * Initiate an attribute confirmation request\n * @param {Object} user - The CognitoUser\n * @param {Object} attr - The attributes to be verified\n * @return - A promise resolves to callback data if success\n */\n AuthClass.prototype.verifyUserAttribute = function (user, attr, clientMetadata) {\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n return new Promise(function (resolve, reject) {\n user.getAttributeVerificationCode(attr, {\n onSuccess: function (success) {\n return resolve(success);\n },\n onFailure: function (err) {\n return reject(err);\n },\n }, clientMetadata);\n });\n };\n /**\n * Confirm an attribute using a confirmation code\n * @param {Object} user - The CognitoUser\n * @param {Object} attr - The attribute to be verified\n * @param {String} code - The confirmation code\n * @return - A promise resolves to callback data if success\n */\n AuthClass.prototype.verifyUserAttributeSubmit = function (user, attr, code) {\n if (!code) {\n return this.rejectAuthError(AuthErrorTypes.EmptyCode);\n }\n return new Promise(function (resolve, reject) {\n user.verifyAttribute(attr, code, {\n onSuccess: function (data) {\n resolve(data);\n return;\n },\n onFailure: function (err) {\n reject(err);\n return;\n },\n });\n });\n };\n AuthClass.prototype.verifyCurrentUserAttribute = function (attr) {\n var that = this;\n return that\n .currentUserPoolUser()\n .then(function (user) { return that.verifyUserAttribute(user, attr); });\n };\n /**\n * Confirm current user's attribute using a confirmation code\n * @param {Object} attr - The attribute to be verified\n * @param {String} code - The confirmation code\n * @return - A promise resolves to callback data if success\n */\n AuthClass.prototype.verifyCurrentUserAttributeSubmit = function (attr, code) {\n var that = this;\n return that\n .currentUserPoolUser()\n .then(function (user) { return that.verifyUserAttributeSubmit(user, attr, code); });\n };\n AuthClass.prototype.cognitoIdentitySignOut = function (opts, user) {\n return __awaiter(this, void 0, void 0, function () {\n var e_11, isSignedInHostedUI;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, this._storageSync];\n case 1:\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n e_11 = _a.sent();\n logger.debug('Failed to sync cache info into memory', e_11);\n throw e_11;\n case 3:\n isSignedInHostedUI = this._oAuthHandler &&\n this._storage.getItem('amplify-signin-with-hostedUI') === 'true';\n return [2 /*return*/, new Promise(function (res, rej) {\n if (opts && opts.global) {\n logger.debug('user global sign out', user);\n // in order to use global signout\n // we must validate the user as an authenticated user by using getSession\n var clientMetadata = _this._config.clientMetadata; // TODO: verify behavior if this is override during signIn\n user.getSession(function (err, result) { return __awaiter(_this, void 0, void 0, function () {\n var cleanUpError_7;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!err) return [3 /*break*/, 5];\n logger.debug('failed to get the user session', err);\n if (!this.isSessionInvalid(err)) return [3 /*break*/, 4];\n _a.label = 1;\n case 1:\n _a.trys.push([1, 3, , 4]);\n return [4 /*yield*/, this.cleanUpInvalidSession(user)];\n case 2:\n _a.sent();\n return [3 /*break*/, 4];\n case 3:\n cleanUpError_7 = _a.sent();\n rej(new Error(\"Session is invalid due to: \" + err.message + \" and failed to clean up invalid session: \" + cleanUpError_7.message));\n return [2 /*return*/];\n case 4: return [2 /*return*/, rej(err)];\n case 5:\n user.globalSignOut({\n onSuccess: function (data) {\n logger.debug('global sign out success');\n if (isSignedInHostedUI) {\n _this.oAuthSignOutRedirect(res, rej);\n }\n else {\n return res();\n }\n },\n onFailure: function (err) {\n logger.debug('global sign out failed', err);\n return rej(err);\n },\n });\n return [2 /*return*/];\n }\n });\n }); }, { clientMetadata: clientMetadata });\n }\n else {\n logger.debug('user sign out', user);\n user.signOut(function () {\n if (isSignedInHostedUI) {\n _this.oAuthSignOutRedirect(res, rej);\n }\n else {\n return res();\n }\n });\n }\n })];\n }\n });\n });\n };\n AuthClass.prototype.oAuthSignOutRedirect = function (resolve, reject) {\n var isBrowser = browserOrNode().isBrowser;\n if (isBrowser) {\n this.oAuthSignOutRedirectOrReject(reject);\n }\n else {\n this.oAuthSignOutAndResolve(resolve);\n }\n };\n AuthClass.prototype.oAuthSignOutAndResolve = function (resolve) {\n this._oAuthHandler.signOut();\n resolve();\n };\n AuthClass.prototype.oAuthSignOutRedirectOrReject = function (reject) {\n this._oAuthHandler.signOut(); // this method redirects url\n // App should be redirected to another url otherwise it will reject\n setTimeout(function () { return reject(Error('Signout timeout fail')); }, 3000);\n };\n /**\n * Sign out method\n * @\n * @return - A promise resolved if success\n */\n AuthClass.prototype.signOut = function (opts) {\n return __awaiter(this, void 0, void 0, function () {\n var e_12, user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, this.cleanCachedItems()];\n case 1:\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n e_12 = _a.sent();\n logger.debug('failed to clear cached items');\n return [3 /*break*/, 3];\n case 3:\n if (!this.userPool) return [3 /*break*/, 7];\n user = this.userPool.getCurrentUser();\n if (!user) return [3 /*break*/, 5];\n return [4 /*yield*/, this.cognitoIdentitySignOut(opts, user)];\n case 4:\n _a.sent();\n return [3 /*break*/, 6];\n case 5:\n logger.debug('no current Cognito user');\n _a.label = 6;\n case 6: return [3 /*break*/, 8];\n case 7:\n logger.debug('no Cognito User pool');\n _a.label = 8;\n case 8:\n /**\n * Note for future refactor - no reliable way to get username with\n * Cognito User Pools vs Identity when federating with Social Providers\n * This is why we need a well structured session object that can be inspected\n * and information passed back in the message below for Hub dispatch\n */\n dispatchAuthEvent('signOut', this.user, \"A user has been signed out\");\n this.user = null;\n return [2 /*return*/];\n }\n });\n });\n };\n AuthClass.prototype.cleanCachedItems = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: \n // clear cognito cached item\n return [4 /*yield*/, this.Credentials.clear()];\n case 1:\n // clear cognito cached item\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Change a password for an authenticated user\n * @param {Object} user - The CognitoUser object\n * @param {String} oldPassword - the current password\n * @param {String} newPassword - the requested new password\n * @return - A promise resolves if success\n */\n AuthClass.prototype.changePassword = function (user, oldPassword, newPassword, clientMetadata) {\n var _this = this;\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n return new Promise(function (resolve, reject) {\n _this.userSession(user).then(function (session) {\n user.changePassword(oldPassword, newPassword, function (err, data) {\n if (err) {\n logger.debug('change password failure', err);\n return reject(err);\n }\n else {\n return resolve(data);\n }\n }, clientMetadata);\n });\n });\n };\n /**\n * Initiate a forgot password request\n * @param {String} username - the username to change password\n * @return - A promise resolves if success\n */\n AuthClass.prototype.forgotPassword = function (username, clientMetadata) {\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n if (!username) {\n return this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n }\n var user = this.createCognitoUser(username);\n return new Promise(function (resolve, reject) {\n user.forgotPassword({\n onSuccess: function () {\n resolve();\n return;\n },\n onFailure: function (err) {\n logger.debug('forgot password failure', err);\n dispatchAuthEvent('forgotPassword_failure', err, username + \" forgotPassword failed\");\n reject(err);\n return;\n },\n inputVerificationCode: function (data) {\n dispatchAuthEvent('forgotPassword', user, username + \" has initiated forgot password flow\");\n resolve(data);\n return;\n },\n }, clientMetadata);\n });\n };\n /**\n * Confirm a new password using a confirmation Code\n * @param {String} username - The username\n * @param {String} code - The confirmation code\n * @param {String} password - The new password\n * @return - A promise that resolves if success\n */\n AuthClass.prototype.forgotPasswordSubmit = function (username, code, password, clientMetadata) {\n if (clientMetadata === void 0) { clientMetadata = this._config.clientMetadata; }\n if (!this.userPool) {\n return this.rejectNoUserPool();\n }\n if (!username) {\n return this.rejectAuthError(AuthErrorTypes.EmptyUsername);\n }\n if (!code) {\n return this.rejectAuthError(AuthErrorTypes.EmptyCode);\n }\n if (!password) {\n return this.rejectAuthError(AuthErrorTypes.EmptyPassword);\n }\n var user = this.createCognitoUser(username);\n return new Promise(function (resolve, reject) {\n user.confirmPassword(code, password, {\n onSuccess: function (success) {\n dispatchAuthEvent('forgotPasswordSubmit', user, username + \" forgotPasswordSubmit successful\");\n resolve(success);\n return;\n },\n onFailure: function (err) {\n dispatchAuthEvent('forgotPasswordSubmit_failure', err, username + \" forgotPasswordSubmit failed\");\n reject(err);\n return;\n },\n }, clientMetadata);\n });\n };\n /**\n * Get user information\n * @async\n * @return {Object }- current User's information\n */\n AuthClass.prototype.currentUserInfo = function () {\n return __awaiter(this, void 0, void 0, function () {\n var source, user, attributes, userAttrs, credentials, e_13, info, err_2, user;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n source = this.Credentials.getCredSource();\n if (!(!source || source === 'aws' || source === 'userPool')) return [3 /*break*/, 9];\n return [4 /*yield*/, this.currentUserPoolUser().catch(function (err) {\n return logger.error(err);\n })];\n case 1:\n user = _a.sent();\n if (!user) {\n return [2 /*return*/, null];\n }\n _a.label = 2;\n case 2:\n _a.trys.push([2, 8, , 9]);\n return [4 /*yield*/, this.userAttributes(user)];\n case 3:\n attributes = _a.sent();\n userAttrs = this.attributesToObject(attributes);\n credentials = null;\n _a.label = 4;\n case 4:\n _a.trys.push([4, 6, , 7]);\n return [4 /*yield*/, this.currentCredentials()];\n case 5:\n credentials = _a.sent();\n return [3 /*break*/, 7];\n case 6:\n e_13 = _a.sent();\n logger.debug('Failed to retrieve credentials while getting current user info', e_13);\n return [3 /*break*/, 7];\n case 7:\n info = {\n id: credentials ? credentials.identityId : undefined,\n username: user.getUsername(),\n attributes: userAttrs,\n };\n return [2 /*return*/, info];\n case 8:\n err_2 = _a.sent();\n logger.error('currentUserInfo error', err_2);\n return [2 /*return*/, {}];\n case 9:\n if (source === 'federated') {\n user = this.user;\n return [2 /*return*/, user ? user : {}];\n }\n return [2 /*return*/];\n }\n });\n });\n };\n AuthClass.prototype.federatedSignIn = function (providerOrOptions, response, user) {\n return __awaiter(this, void 0, void 0, function () {\n var options, provider, customState, client_id, redirect_uri, provider, loggedInUser, token, identity_id, expires_at, credentials, currentUser;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this._config.identityPoolId && !this._config.userPoolId) {\n throw new Error(\"Federation requires either a User Pool or Identity Pool in config\");\n }\n // Ensure backwards compatability\n if (typeof providerOrOptions === 'undefined') {\n if (this._config.identityPoolId && !this._config.userPoolId) {\n throw new Error(\"Federation with Identity Pools requires tokens passed as arguments\");\n }\n }\n if (!(isFederatedSignInOptions(providerOrOptions) ||\n isFederatedSignInOptionsCustom(providerOrOptions) ||\n hasCustomState(providerOrOptions) ||\n typeof providerOrOptions === 'undefined')) return [3 /*break*/, 1];\n options = providerOrOptions || {\n provider: CognitoHostedUIIdentityProvider.Cognito,\n };\n provider = isFederatedSignInOptions(options)\n ? options.provider\n : options.customProvider;\n customState = isFederatedSignInOptions(options)\n ? options.customState\n : options.customState;\n if (this._config.userPoolId) {\n client_id = isCognitoHostedOpts(this._config.oauth)\n ? this._config.userPoolWebClientId\n : this._config.oauth.clientID;\n redirect_uri = isCognitoHostedOpts(this._config.oauth)\n ? this._config.oauth.redirectSignIn\n : this._config.oauth.redirectUri;\n this._oAuthHandler.oauthSignIn(this._config.oauth.responseType, this._config.oauth.domain, redirect_uri, client_id, provider, customState);\n }\n return [3 /*break*/, 4];\n case 1:\n provider = providerOrOptions;\n // To check if the user is already logged in\n try {\n loggedInUser = JSON.stringify(JSON.parse(this._storage.getItem('aws-amplify-federatedInfo')).user);\n if (loggedInUser) {\n logger.warn(\"There is already a signed in user: \" + loggedInUser + \" in your app.\\n\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\t\\tYou should not call Auth.federatedSignIn method again as it may cause unexpected behavior.\");\n }\n }\n catch (e) { }\n token = response.token, identity_id = response.identity_id, expires_at = response.expires_at;\n return [4 /*yield*/, this.Credentials.set({ provider: provider, token: token, identity_id: identity_id, user: user, expires_at: expires_at }, 'federation')];\n case 2:\n credentials = _a.sent();\n return [4 /*yield*/, this.currentAuthenticatedUser()];\n case 3:\n currentUser = _a.sent();\n dispatchAuthEvent('signIn', currentUser, \"A user \" + currentUser.username + \" has been signed in\");\n logger.debug('federated sign in credentials', credentials);\n return [2 /*return*/, credentials];\n case 4: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Used to complete the OAuth flow with or without the Cognito Hosted UI\n * @param {String} URL - optional parameter for customers to pass in the response URL\n */\n AuthClass.prototype._handleAuthResponse = function (URL) {\n return __awaiter(this, void 0, void 0, function () {\n var currentUrl, hasCodeOrError, hasTokenOrError, _a, accessToken, idToken, refreshToken, state, session, credentials, isCustomStateIncluded, currentUser, customState, err_3;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n if (this.oAuthFlowInProgress) {\n logger.debug(\"Skipping URL \" + URL + \" current flow in progress\");\n return [2 /*return*/];\n }\n _b.label = 1;\n case 1:\n _b.trys.push([1, , 8, 9]);\n this.oAuthFlowInProgress = true;\n if (!this._config.userPoolId) {\n throw new Error(\"OAuth responses require a User Pool defined in config\");\n }\n dispatchAuthEvent('parsingCallbackUrl', { url: URL }, \"The callback url is being parsed\");\n currentUrl = URL || (browserOrNode().isBrowser ? window.location.href : '');\n hasCodeOrError = !!(parse(currentUrl).query || '')\n .split('&')\n .map(function (entry) { return entry.split('='); })\n .find(function (_a) {\n var _b = __read(_a, 1), k = _b[0];\n return k === 'code' || k === 'error';\n });\n hasTokenOrError = !!(parse(currentUrl).hash || '#')\n .substr(1)\n .split('&')\n .map(function (entry) { return entry.split('='); })\n .find(function (_a) {\n var _b = __read(_a, 1), k = _b[0];\n return k === 'access_token' || k === 'error';\n });\n if (!(hasCodeOrError || hasTokenOrError)) return [3 /*break*/, 7];\n this._storage.setItem('amplify-redirected-from-hosted-ui', 'true');\n _b.label = 2;\n case 2:\n _b.trys.push([2, 6, , 7]);\n return [4 /*yield*/, this._oAuthHandler.handleAuthResponse(currentUrl)];\n case 3:\n _a = _b.sent(), accessToken = _a.accessToken, idToken = _a.idToken, refreshToken = _a.refreshToken, state = _a.state;\n session = new CognitoUserSession({\n IdToken: new CognitoIdToken({ IdToken: idToken }),\n RefreshToken: new CognitoRefreshToken({\n RefreshToken: refreshToken,\n }),\n AccessToken: new CognitoAccessToken({\n AccessToken: accessToken,\n }),\n });\n credentials = void 0;\n if (!this._config.identityPoolId) return [3 /*break*/, 5];\n return [4 /*yield*/, this.Credentials.set(session, 'session')];\n case 4:\n credentials = _b.sent();\n logger.debug('AWS credentials', credentials);\n _b.label = 5;\n case 5:\n isCustomStateIncluded = /-/.test(state);\n currentUser = this.createCognitoUser(session.getIdToken().decodePayload()['cognito:username']);\n // This calls cacheTokens() in Cognito SDK\n currentUser.setSignInUserSession(session);\n if (window && typeof window.history !== 'undefined') {\n window.history.replaceState({}, null, this._config.oauth.redirectSignIn);\n }\n dispatchAuthEvent('signIn', currentUser, \"A user \" + currentUser.getUsername() + \" has been signed in\");\n dispatchAuthEvent('cognitoHostedUI', currentUser, \"A user \" + currentUser.getUsername() + \" has been signed in via Cognito Hosted UI\");\n if (isCustomStateIncluded) {\n customState = state.split('-').splice(1).join('-');\n dispatchAuthEvent('customOAuthState', urlSafeDecode(customState), \"State for user \" + currentUser.getUsername());\n }\n //#endregion\n return [2 /*return*/, credentials];\n case 6:\n err_3 = _b.sent();\n logger.debug('Error in cognito hosted auth response', err_3);\n // Just like a successful handling of `?code`, replace the window history to \"dispose\" of the `code`.\n // Otherwise, reloading the page will throw errors as the `code` has already been spent.\n if (window && typeof window.history !== 'undefined') {\n window.history.replaceState({}, null, this._config.oauth.redirectSignIn);\n }\n dispatchAuthEvent('signIn_failure', err_3, \"The OAuth response flow failed\");\n dispatchAuthEvent('cognitoHostedUI_failure', err_3, \"A failure occurred when returning to the Cognito Hosted UI\");\n dispatchAuthEvent('customState_failure', err_3, \"A failure occurred when returning state\");\n return [3 /*break*/, 7];\n case 7: return [3 /*break*/, 9];\n case 8:\n this.oAuthFlowInProgress = false;\n return [7 /*endfinally*/];\n case 9: return [2 /*return*/];\n }\n });\n });\n };\n /**\n * Compact version of credentials\n * @param {Object} credentials\n * @return {Object} - Credentials\n */\n AuthClass.prototype.essentialCredentials = function (credentials) {\n return {\n accessKeyId: credentials.accessKeyId,\n sessionToken: credentials.sessionToken,\n secretAccessKey: credentials.secretAccessKey,\n identityId: credentials.identityId,\n authenticated: credentials.authenticated,\n };\n };\n AuthClass.prototype.attributesToObject = function (attributes) {\n var _this = this;\n var obj = {};\n if (attributes) {\n attributes.map(function (attribute) {\n if (attribute.Name === 'email_verified' ||\n attribute.Name === 'phone_number_verified') {\n obj[attribute.Name] =\n _this.isTruthyString(attribute.Value) || attribute.Value === true;\n }\n else {\n obj[attribute.Name] = attribute.Value;\n }\n });\n }\n return obj;\n };\n AuthClass.prototype.isTruthyString = function (value) {\n return (typeof value.toLowerCase === 'function' && value.toLowerCase() === 'true');\n };\n AuthClass.prototype.createCognitoUser = function (username) {\n var userData = {\n Username: username,\n Pool: this.userPool,\n };\n userData.Storage = this._storage;\n var authenticationFlowType = this._config.authenticationFlowType;\n var user = new CognitoUser(userData);\n if (authenticationFlowType) {\n user.setAuthenticationFlowType(authenticationFlowType);\n }\n return user;\n };\n AuthClass.prototype._isValidAuthStorage = function (obj) {\n // We need to check if the obj has the functions of Storage\n return (!!obj &&\n typeof obj.getItem === 'function' &&\n typeof obj.setItem === 'function' &&\n typeof obj.removeItem === 'function' &&\n typeof obj.clear === 'function');\n };\n AuthClass.prototype.noUserPoolErrorHandler = function (config) {\n if (config) {\n if (!config.userPoolId || !config.identityPoolId) {\n return AuthErrorTypes.MissingAuthConfig;\n }\n }\n return AuthErrorTypes.NoConfig;\n };\n AuthClass.prototype.rejectAuthError = function (type) {\n return Promise.reject(new AuthError(type));\n };\n AuthClass.prototype.rejectNoUserPool = function () {\n var type = this.noUserPoolErrorHandler(this._config);\n return Promise.reject(new NoUserPoolError(type));\n };\n AuthClass.prototype.rememberDevice = function () {\n return __awaiter(this, void 0, void 0, function () {\n var currUser, error_2;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, this.currentUserPoolUser()];\n case 1:\n currUser = _a.sent();\n return [3 /*break*/, 3];\n case 2:\n error_2 = _a.sent();\n logger.debug('The user is not authenticated by the error', error_2);\n return [2 /*return*/, Promise.reject('The user is not authenticated')];\n case 3:\n currUser.getCachedDeviceKeyAndPassword();\n return [2 /*return*/, new Promise(function (res, rej) {\n currUser.setDeviceStatusRemembered({\n onSuccess: function (data) {\n res(data);\n },\n onFailure: function (err) {\n if (err.code === 'InvalidParameterException') {\n rej(new AuthError(AuthErrorTypes.DeviceConfig));\n }\n else if (err.code === 'NetworkError') {\n rej(new AuthError(AuthErrorTypes.NetworkError));\n }\n else {\n rej(err);\n }\n },\n });\n })];\n }\n });\n });\n };\n AuthClass.prototype.forgetDevice = function () {\n return __awaiter(this, void 0, void 0, function () {\n var currUser, error_3;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, this.currentUserPoolUser()];\n case 1:\n currUser = _a.sent();\n return [3 /*break*/, 3];\n case 2:\n error_3 = _a.sent();\n logger.debug('The user is not authenticated by the error', error_3);\n return [2 /*return*/, Promise.reject('The user is not authenticated')];\n case 3:\n currUser.getCachedDeviceKeyAndPassword();\n return [2 /*return*/, new Promise(function (res, rej) {\n currUser.forgetDevice({\n onSuccess: function (data) {\n res(data);\n },\n onFailure: function (err) {\n if (err.code === 'InvalidParameterException') {\n rej(new AuthError(AuthErrorTypes.DeviceConfig));\n }\n else if (err.code === 'NetworkError') {\n rej(new AuthError(AuthErrorTypes.NetworkError));\n }\n else {\n rej(err);\n }\n },\n });\n })];\n }\n });\n });\n };\n AuthClass.prototype.fetchDevices = function () {\n return __awaiter(this, void 0, void 0, function () {\n var currUser, error_4;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n _a.trys.push([0, 2, , 3]);\n return [4 /*yield*/, this.currentUserPoolUser()];\n case 1:\n currUser = _a.sent();\n return [3 /*break*/, 3];\n case 2:\n error_4 = _a.sent();\n logger.debug('The user is not authenticated by the error', error_4);\n throw new Error('The user is not authenticated');\n case 3:\n currUser.getCachedDeviceKeyAndPassword();\n return [2 /*return*/, new Promise(function (res, rej) {\n var cb = {\n onSuccess: function (data) {\n var deviceList = data.Devices.map(function (device) {\n var deviceName = device.DeviceAttributes.find(function (_a) {\n var Name = _a.Name;\n return Name === 'device_name';\n }) || {};\n var deviceInfo = {\n id: device.DeviceKey,\n name: deviceName.Value,\n };\n return deviceInfo;\n });\n res(deviceList);\n },\n onFailure: function (err) {\n if (err.code === 'InvalidParameterException') {\n rej(new AuthError(AuthErrorTypes.DeviceConfig));\n }\n else if (err.code === 'NetworkError') {\n rej(new AuthError(AuthErrorTypes.NetworkError));\n }\n else {\n rej(err);\n }\n },\n };\n currUser.listDevices(MAX_DEVICES, null, cb);\n })];\n }\n });\n });\n };\n return AuthClass;\n}());\nexport { AuthClass };\nexport var Auth = new AuthClass(null);\nAmplify.register(Auth);\n//# sourceMappingURL=Auth.js.map","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Checks if `value` is likely a prototype object.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a prototype, else `false`.\n */\nfunction isPrototype(value) {\n var Ctor = value && value.constructor,\n proto = (typeof Ctor == 'function' && Ctor.prototype) || objectProto;\n\n return value === proto;\n}\n\nmodule.exports = isPrototype;\n","/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n","var overArg = require('./_overArg');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeKeys = overArg(Object.keys, Object);\n\nmodule.exports = nativeKeys;\n","var isPrototype = require('./_isPrototype'),\n nativeKeys = require('./_nativeKeys');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keys` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeys(object) {\n if (!isPrototype(object)) {\n return nativeKeys(object);\n }\n var result = [];\n for (var key in Object(object)) {\n if (hasOwnProperty.call(object, key) && key != 'constructor') {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeys;\n","/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n","var Symbol = require('./_Symbol');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n","/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n","var Symbol = require('./_Symbol'),\n getRawTag = require('./_getRawTag'),\n objectToString = require('./_objectToString');\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n","/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return value != null && (type == 'object' || type == 'function');\n}\n\nmodule.exports = isObject;\n","var baseGetTag = require('./_baseGetTag'),\n isObject = require('./isObject');\n\n/** `Object#toString` result references. */\nvar asyncTag = '[object AsyncFunction]',\n funcTag = '[object Function]',\n genTag = '[object GeneratorFunction]',\n proxyTag = '[object Proxy]';\n\n/**\n * Checks if `value` is classified as a `Function` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a function, else `false`.\n * @example\n *\n * _.isFunction(_);\n * // => true\n *\n * _.isFunction(/abc/);\n * // => false\n */\nfunction isFunction(value) {\n if (!isObject(value)) {\n return false;\n }\n // The use of `Object#toString` avoids issues with the `typeof` operator\n // in Safari 9 which returns 'object' for typed arrays and other constructors.\n var tag = baseGetTag(value);\n return tag == funcTag || tag == genTag || tag == asyncTag || tag == proxyTag;\n}\n\nmodule.exports = isFunction;\n","var root = require('./_root');\n\n/** Used to detect overreaching core-js shims. */\nvar coreJsData = root['__core-js_shared__'];\n\nmodule.exports = coreJsData;\n","var coreJsData = require('./_coreJsData');\n\n/** Used to detect methods masquerading as native. */\nvar maskSrcKey = (function() {\n var uid = /[^.]+$/.exec(coreJsData && coreJsData.keys && coreJsData.keys.IE_PROTO || '');\n return uid ? ('Symbol(src)_1.' + uid) : '';\n}());\n\n/**\n * Checks if `func` has its source masked.\n *\n * @private\n * @param {Function} func The function to check.\n * @returns {boolean} Returns `true` if `func` is masked, else `false`.\n */\nfunction isMasked(func) {\n return !!maskSrcKey && (maskSrcKey in func);\n}\n\nmodule.exports = isMasked;\n","/** Used for built-in method references. */\nvar funcProto = Function.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/**\n * Converts `func` to its source code.\n *\n * @private\n * @param {Function} func The function to convert.\n * @returns {string} Returns the source code.\n */\nfunction toSource(func) {\n if (func != null) {\n try {\n return funcToString.call(func);\n } catch (e) {}\n try {\n return (func + '');\n } catch (e) {}\n }\n return '';\n}\n\nmodule.exports = toSource;\n","var isFunction = require('./isFunction'),\n isMasked = require('./_isMasked'),\n isObject = require('./isObject'),\n toSource = require('./_toSource');\n\n/**\n * Used to match `RegExp`\n * [syntax characters](http://ecma-international.org/ecma-262/7.0/#sec-patterns).\n */\nvar reRegExpChar = /[\\\\^$.*+?()[\\]{}|]/g;\n\n/** Used to detect host constructors (Safari). */\nvar reIsHostCtor = /^\\[object .+?Constructor\\]$/;\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to detect if a method is native. */\nvar reIsNative = RegExp('^' +\n funcToString.call(hasOwnProperty).replace(reRegExpChar, '\\\\$&')\n .replace(/hasOwnProperty|(function).*?(?=\\\\\\()| for .+?(?=\\\\\\])/g, '$1.*?') + '$'\n);\n\n/**\n * The base implementation of `_.isNative` without bad shim checks.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a native function,\n * else `false`.\n */\nfunction baseIsNative(value) {\n if (!isObject(value) || isMasked(value)) {\n return false;\n }\n var pattern = isFunction(value) ? reIsNative : reIsHostCtor;\n return pattern.test(toSource(value));\n}\n\nmodule.exports = baseIsNative;\n","/**\n * Gets the value at `key` of `object`.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction getValue(object, key) {\n return object == null ? undefined : object[key];\n}\n\nmodule.exports = getValue;\n","var baseIsNative = require('./_baseIsNative'),\n getValue = require('./_getValue');\n\n/**\n * Gets the native function at `key` of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the method to get.\n * @returns {*} Returns the function if it's native, else `undefined`.\n */\nfunction getNative(object, key) {\n var value = getValue(object, key);\n return baseIsNative(value) ? value : undefined;\n}\n\nmodule.exports = getNative;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar DataView = getNative(root, 'DataView');\n\nmodule.exports = DataView;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Map = getNative(root, 'Map');\n\nmodule.exports = Map;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Promise = getNative(root, 'Promise');\n\nmodule.exports = Promise;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar Set = getNative(root, 'Set');\n\nmodule.exports = Set;\n","var getNative = require('./_getNative'),\n root = require('./_root');\n\n/* Built-in method references that are verified to be native. */\nvar WeakMap = getNative(root, 'WeakMap');\n\nmodule.exports = WeakMap;\n","var DataView = require('./_DataView'),\n Map = require('./_Map'),\n Promise = require('./_Promise'),\n Set = require('./_Set'),\n WeakMap = require('./_WeakMap'),\n baseGetTag = require('./_baseGetTag'),\n toSource = require('./_toSource');\n\n/** `Object#toString` result references. */\nvar mapTag = '[object Map]',\n objectTag = '[object Object]',\n promiseTag = '[object Promise]',\n setTag = '[object Set]',\n weakMapTag = '[object WeakMap]';\n\nvar dataViewTag = '[object DataView]';\n\n/** Used to detect maps, sets, and weakmaps. */\nvar dataViewCtorString = toSource(DataView),\n mapCtorString = toSource(Map),\n promiseCtorString = toSource(Promise),\n setCtorString = toSource(Set),\n weakMapCtorString = toSource(WeakMap);\n\n/**\n * Gets the `toStringTag` of `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nvar getTag = baseGetTag;\n\n// Fallback for data views, maps, sets, and weak maps in IE 11 and promises in Node.js < 6.\nif ((DataView && getTag(new DataView(new ArrayBuffer(1))) != dataViewTag) ||\n (Map && getTag(new Map) != mapTag) ||\n (Promise && getTag(Promise.resolve()) != promiseTag) ||\n (Set && getTag(new Set) != setTag) ||\n (WeakMap && getTag(new WeakMap) != weakMapTag)) {\n getTag = function(value) {\n var result = baseGetTag(value),\n Ctor = result == objectTag ? value.constructor : undefined,\n ctorString = Ctor ? toSource(Ctor) : '';\n\n if (ctorString) {\n switch (ctorString) {\n case dataViewCtorString: return dataViewTag;\n case mapCtorString: return mapTag;\n case promiseCtorString: return promiseTag;\n case setCtorString: return setTag;\n case weakMapCtorString: return weakMapTag;\n }\n }\n return result;\n };\n}\n\nmodule.exports = getTag;\n","/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]';\n\n/**\n * The base implementation of `_.isArguments`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n */\nfunction baseIsArguments(value) {\n return isObjectLike(value) && baseGetTag(value) == argsTag;\n}\n\nmodule.exports = baseIsArguments;\n","var baseIsArguments = require('./_baseIsArguments'),\n isObjectLike = require('./isObjectLike');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/**\n * Checks if `value` is likely an `arguments` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an `arguments` object,\n * else `false`.\n * @example\n *\n * _.isArguments(function() { return arguments; }());\n * // => true\n *\n * _.isArguments([1, 2, 3]);\n * // => false\n */\nvar isArguments = baseIsArguments(function() { return arguments; }()) ? baseIsArguments : function(value) {\n return isObjectLike(value) && hasOwnProperty.call(value, 'callee') &&\n !propertyIsEnumerable.call(value, 'callee');\n};\n\nmodule.exports = isArguments;\n","/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n","var isFunction = require('./isFunction'),\n isLength = require('./isLength');\n\n/**\n * Checks if `value` is array-like. A value is considered array-like if it's\n * not a function and has a `value.length` that's an integer greater than or\n * equal to `0` and less than or equal to `Number.MAX_SAFE_INTEGER`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is array-like, else `false`.\n * @example\n *\n * _.isArrayLike([1, 2, 3]);\n * // => true\n *\n * _.isArrayLike(document.body.children);\n * // => true\n *\n * _.isArrayLike('abc');\n * // => true\n *\n * _.isArrayLike(_.noop);\n * // => false\n */\nfunction isArrayLike(value) {\n return value != null && isLength(value.length) && !isFunction(value);\n}\n\nmodule.exports = isArrayLike;\n","/**\n * This method returns `false`.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {boolean} Returns `false`.\n * @example\n *\n * _.times(2, _.stubFalse);\n * // => [false, false]\n */\nfunction stubFalse() {\n return false;\n}\n\nmodule.exports = stubFalse;\n","var root = require('./_root'),\n stubFalse = require('./stubFalse');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeIsBuffer = Buffer ? Buffer.isBuffer : undefined;\n\n/**\n * Checks if `value` is a buffer.\n *\n * @static\n * @memberOf _\n * @since 4.3.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a buffer, else `false`.\n * @example\n *\n * _.isBuffer(new Buffer(2));\n * // => true\n *\n * _.isBuffer(new Uint8Array(2));\n * // => false\n */\nvar isBuffer = nativeIsBuffer || stubFalse;\n\nmodule.exports = isBuffer;\n","var baseGetTag = require('./_baseGetTag'),\n isLength = require('./isLength'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n","/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n","var freeGlobal = require('./_freeGlobal');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n","var baseIsTypedArray = require('./_baseIsTypedArray'),\n baseUnary = require('./_baseUnary'),\n nodeUtil = require('./_nodeUtil');\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n","/**\n * Removes all key-value entries from the list cache.\n *\n * @private\n * @name clear\n * @memberOf ListCache\n */\nfunction listCacheClear() {\n this.__data__ = [];\n this.size = 0;\n}\n\nmodule.exports = listCacheClear;\n","/**\n * Performs a\n * [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * comparison between two values to determine if they are equivalent.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.eq(object, object);\n * // => true\n *\n * _.eq(object, other);\n * // => false\n *\n * _.eq('a', 'a');\n * // => true\n *\n * _.eq('a', Object('a'));\n * // => false\n *\n * _.eq(NaN, NaN);\n * // => true\n */\nfunction eq(value, other) {\n return value === other || (value !== value && other !== other);\n}\n\nmodule.exports = eq;\n","var eq = require('./eq');\n\n/**\n * Gets the index at which the `key` is found in `array` of key-value pairs.\n *\n * @private\n * @param {Array} array The array to inspect.\n * @param {*} key The key to search for.\n * @returns {number} Returns the index of the matched value, else `-1`.\n */\nfunction assocIndexOf(array, key) {\n var length = array.length;\n while (length--) {\n if (eq(array[length][0], key)) {\n return length;\n }\n }\n return -1;\n}\n\nmodule.exports = assocIndexOf;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/** Used for built-in method references. */\nvar arrayProto = Array.prototype;\n\n/** Built-in value references. */\nvar splice = arrayProto.splice;\n\n/**\n * Removes `key` and its value from the list cache.\n *\n * @private\n * @name delete\n * @memberOf ListCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction listCacheDelete(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n return false;\n }\n var lastIndex = data.length - 1;\n if (index == lastIndex) {\n data.pop();\n } else {\n splice.call(data, index, 1);\n }\n --this.size;\n return true;\n}\n\nmodule.exports = listCacheDelete;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Gets the list cache value for `key`.\n *\n * @private\n * @name get\n * @memberOf ListCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction listCacheGet(key) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n return index < 0 ? undefined : data[index][1];\n}\n\nmodule.exports = listCacheGet;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Checks if a list cache value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf ListCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction listCacheHas(key) {\n return assocIndexOf(this.__data__, key) > -1;\n}\n\nmodule.exports = listCacheHas;\n","var assocIndexOf = require('./_assocIndexOf');\n\n/**\n * Sets the list cache `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf ListCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the list cache instance.\n */\nfunction listCacheSet(key, value) {\n var data = this.__data__,\n index = assocIndexOf(data, key);\n\n if (index < 0) {\n ++this.size;\n data.push([key, value]);\n } else {\n data[index][1] = value;\n }\n return this;\n}\n\nmodule.exports = listCacheSet;\n","var listCacheClear = require('./_listCacheClear'),\n listCacheDelete = require('./_listCacheDelete'),\n listCacheGet = require('./_listCacheGet'),\n listCacheHas = require('./_listCacheHas'),\n listCacheSet = require('./_listCacheSet');\n\n/**\n * Creates an list cache object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction ListCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `ListCache`.\nListCache.prototype.clear = listCacheClear;\nListCache.prototype['delete'] = listCacheDelete;\nListCache.prototype.get = listCacheGet;\nListCache.prototype.has = listCacheHas;\nListCache.prototype.set = listCacheSet;\n\nmodule.exports = ListCache;\n","var ListCache = require('./_ListCache');\n\n/**\n * Removes all key-value entries from the stack.\n *\n * @private\n * @name clear\n * @memberOf Stack\n */\nfunction stackClear() {\n this.__data__ = new ListCache;\n this.size = 0;\n}\n\nmodule.exports = stackClear;\n","/**\n * Removes `key` and its value from the stack.\n *\n * @private\n * @name delete\n * @memberOf Stack\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction stackDelete(key) {\n var data = this.__data__,\n result = data['delete'](key);\n\n this.size = data.size;\n return result;\n}\n\nmodule.exports = stackDelete;\n","/**\n * Gets the stack value for `key`.\n *\n * @private\n * @name get\n * @memberOf Stack\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction stackGet(key) {\n return this.__data__.get(key);\n}\n\nmodule.exports = stackGet;\n","/**\n * Checks if a stack value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Stack\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction stackHas(key) {\n return this.__data__.has(key);\n}\n\nmodule.exports = stackHas;\n","var getNative = require('./_getNative');\n\n/* Built-in method references that are verified to be native. */\nvar nativeCreate = getNative(Object, 'create');\n\nmodule.exports = nativeCreate;\n","var nativeCreate = require('./_nativeCreate');\n\n/**\n * Removes all key-value entries from the hash.\n *\n * @private\n * @name clear\n * @memberOf Hash\n */\nfunction hashClear() {\n this.__data__ = nativeCreate ? nativeCreate(null) : {};\n this.size = 0;\n}\n\nmodule.exports = hashClear;\n","/**\n * Removes `key` and its value from the hash.\n *\n * @private\n * @name delete\n * @memberOf Hash\n * @param {Object} hash The hash to modify.\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction hashDelete(key) {\n var result = this.has(key) && delete this.__data__[key];\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = hashDelete;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Gets the hash value for `key`.\n *\n * @private\n * @name get\n * @memberOf Hash\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction hashGet(key) {\n var data = this.__data__;\n if (nativeCreate) {\n var result = data[key];\n return result === HASH_UNDEFINED ? undefined : result;\n }\n return hasOwnProperty.call(data, key) ? data[key] : undefined;\n}\n\nmodule.exports = hashGet;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Checks if a hash value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf Hash\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction hashHas(key) {\n var data = this.__data__;\n return nativeCreate ? (data[key] !== undefined) : hasOwnProperty.call(data, key);\n}\n\nmodule.exports = hashHas;\n","var nativeCreate = require('./_nativeCreate');\n\n/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Sets the hash `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Hash\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the hash instance.\n */\nfunction hashSet(key, value) {\n var data = this.__data__;\n this.size += this.has(key) ? 0 : 1;\n data[key] = (nativeCreate && value === undefined) ? HASH_UNDEFINED : value;\n return this;\n}\n\nmodule.exports = hashSet;\n","var hashClear = require('./_hashClear'),\n hashDelete = require('./_hashDelete'),\n hashGet = require('./_hashGet'),\n hashHas = require('./_hashHas'),\n hashSet = require('./_hashSet');\n\n/**\n * Creates a hash object.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Hash(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `Hash`.\nHash.prototype.clear = hashClear;\nHash.prototype['delete'] = hashDelete;\nHash.prototype.get = hashGet;\nHash.prototype.has = hashHas;\nHash.prototype.set = hashSet;\n\nmodule.exports = Hash;\n","var Hash = require('./_Hash'),\n ListCache = require('./_ListCache'),\n Map = require('./_Map');\n\n/**\n * Removes all key-value entries from the map.\n *\n * @private\n * @name clear\n * @memberOf MapCache\n */\nfunction mapCacheClear() {\n this.size = 0;\n this.__data__ = {\n 'hash': new Hash,\n 'map': new (Map || ListCache),\n 'string': new Hash\n };\n}\n\nmodule.exports = mapCacheClear;\n","/**\n * Checks if `value` is suitable for use as unique object key.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is suitable, else `false`.\n */\nfunction isKeyable(value) {\n var type = typeof value;\n return (type == 'string' || type == 'number' || type == 'symbol' || type == 'boolean')\n ? (value !== '__proto__')\n : (value === null);\n}\n\nmodule.exports = isKeyable;\n","var isKeyable = require('./_isKeyable');\n\n/**\n * Gets the data for `map`.\n *\n * @private\n * @param {Object} map The map to query.\n * @param {string} key The reference key.\n * @returns {*} Returns the map data.\n */\nfunction getMapData(map, key) {\n var data = map.__data__;\n return isKeyable(key)\n ? data[typeof key == 'string' ? 'string' : 'hash']\n : data.map;\n}\n\nmodule.exports = getMapData;\n","var getMapData = require('./_getMapData');\n\n/**\n * Removes `key` and its value from the map.\n *\n * @private\n * @name delete\n * @memberOf MapCache\n * @param {string} key The key of the value to remove.\n * @returns {boolean} Returns `true` if the entry was removed, else `false`.\n */\nfunction mapCacheDelete(key) {\n var result = getMapData(this, key)['delete'](key);\n this.size -= result ? 1 : 0;\n return result;\n}\n\nmodule.exports = mapCacheDelete;\n","var getMapData = require('./_getMapData');\n\n/**\n * Gets the map value for `key`.\n *\n * @private\n * @name get\n * @memberOf MapCache\n * @param {string} key The key of the value to get.\n * @returns {*} Returns the entry value.\n */\nfunction mapCacheGet(key) {\n return getMapData(this, key).get(key);\n}\n\nmodule.exports = mapCacheGet;\n","var getMapData = require('./_getMapData');\n\n/**\n * Checks if a map value for `key` exists.\n *\n * @private\n * @name has\n * @memberOf MapCache\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction mapCacheHas(key) {\n return getMapData(this, key).has(key);\n}\n\nmodule.exports = mapCacheHas;\n","var getMapData = require('./_getMapData');\n\n/**\n * Sets the map `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf MapCache\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the map cache instance.\n */\nfunction mapCacheSet(key, value) {\n var data = getMapData(this, key),\n size = data.size;\n\n data.set(key, value);\n this.size += data.size == size ? 0 : 1;\n return this;\n}\n\nmodule.exports = mapCacheSet;\n","var mapCacheClear = require('./_mapCacheClear'),\n mapCacheDelete = require('./_mapCacheDelete'),\n mapCacheGet = require('./_mapCacheGet'),\n mapCacheHas = require('./_mapCacheHas'),\n mapCacheSet = require('./_mapCacheSet');\n\n/**\n * Creates a map cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction MapCache(entries) {\n var index = -1,\n length = entries == null ? 0 : entries.length;\n\n this.clear();\n while (++index < length) {\n var entry = entries[index];\n this.set(entry[0], entry[1]);\n }\n}\n\n// Add methods to `MapCache`.\nMapCache.prototype.clear = mapCacheClear;\nMapCache.prototype['delete'] = mapCacheDelete;\nMapCache.prototype.get = mapCacheGet;\nMapCache.prototype.has = mapCacheHas;\nMapCache.prototype.set = mapCacheSet;\n\nmodule.exports = MapCache;\n","var ListCache = require('./_ListCache'),\n Map = require('./_Map'),\n MapCache = require('./_MapCache');\n\n/** Used as the size to enable large array optimizations. */\nvar LARGE_ARRAY_SIZE = 200;\n\n/**\n * Sets the stack `key` to `value`.\n *\n * @private\n * @name set\n * @memberOf Stack\n * @param {string} key The key of the value to set.\n * @param {*} value The value to set.\n * @returns {Object} Returns the stack cache instance.\n */\nfunction stackSet(key, value) {\n var data = this.__data__;\n if (data instanceof ListCache) {\n var pairs = data.__data__;\n if (!Map || (pairs.length < LARGE_ARRAY_SIZE - 1)) {\n pairs.push([key, value]);\n this.size = ++data.size;\n return this;\n }\n data = this.__data__ = new MapCache(pairs);\n }\n data.set(key, value);\n this.size = data.size;\n return this;\n}\n\nmodule.exports = stackSet;\n","var ListCache = require('./_ListCache'),\n stackClear = require('./_stackClear'),\n stackDelete = require('./_stackDelete'),\n stackGet = require('./_stackGet'),\n stackHas = require('./_stackHas'),\n stackSet = require('./_stackSet');\n\n/**\n * Creates a stack cache object to store key-value pairs.\n *\n * @private\n * @constructor\n * @param {Array} [entries] The key-value pairs to cache.\n */\nfunction Stack(entries) {\n var data = this.__data__ = new ListCache(entries);\n this.size = data.size;\n}\n\n// Add methods to `Stack`.\nStack.prototype.clear = stackClear;\nStack.prototype['delete'] = stackDelete;\nStack.prototype.get = stackGet;\nStack.prototype.has = stackHas;\nStack.prototype.set = stackSet;\n\nmodule.exports = Stack;\n","/** Used to stand-in for `undefined` hash values. */\nvar HASH_UNDEFINED = '__lodash_hash_undefined__';\n\n/**\n * Adds `value` to the array cache.\n *\n * @private\n * @name add\n * @memberOf SetCache\n * @alias push\n * @param {*} value The value to cache.\n * @returns {Object} Returns the cache instance.\n */\nfunction setCacheAdd(value) {\n this.__data__.set(value, HASH_UNDEFINED);\n return this;\n}\n\nmodule.exports = setCacheAdd;\n","/**\n * Checks if `value` is in the array cache.\n *\n * @private\n * @name has\n * @memberOf SetCache\n * @param {*} value The value to search for.\n * @returns {number} Returns `true` if `value` is found, else `false`.\n */\nfunction setCacheHas(value) {\n return this.__data__.has(value);\n}\n\nmodule.exports = setCacheHas;\n","var MapCache = require('./_MapCache'),\n setCacheAdd = require('./_setCacheAdd'),\n setCacheHas = require('./_setCacheHas');\n\n/**\n *\n * Creates an array cache object to store unique values.\n *\n * @private\n * @constructor\n * @param {Array} [values] The values to cache.\n */\nfunction SetCache(values) {\n var index = -1,\n length = values == null ? 0 : values.length;\n\n this.__data__ = new MapCache;\n while (++index < length) {\n this.add(values[index]);\n }\n}\n\n// Add methods to `SetCache`.\nSetCache.prototype.add = SetCache.prototype.push = setCacheAdd;\nSetCache.prototype.has = setCacheHas;\n\nmodule.exports = SetCache;\n","/**\n * A specialized version of `_.some` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {boolean} Returns `true` if any element passes the predicate check,\n * else `false`.\n */\nfunction arraySome(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (predicate(array[index], index, array)) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arraySome;\n","/**\n * Checks if a `cache` value for `key` exists.\n *\n * @private\n * @param {Object} cache The cache to query.\n * @param {string} key The key of the entry to check.\n * @returns {boolean} Returns `true` if an entry for `key` exists, else `false`.\n */\nfunction cacheHas(cache, key) {\n return cache.has(key);\n}\n\nmodule.exports = cacheHas;\n","var SetCache = require('./_SetCache'),\n arraySome = require('./_arraySome'),\n cacheHas = require('./_cacheHas');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * A specialized version of `baseIsEqualDeep` for arrays with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Array} array The array to compare.\n * @param {Array} other The other array to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `array` and `other` objects.\n * @returns {boolean} Returns `true` if the arrays are equivalent, else `false`.\n */\nfunction equalArrays(array, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n arrLength = array.length,\n othLength = other.length;\n\n if (arrLength != othLength && !(isPartial && othLength > arrLength)) {\n return false;\n }\n // Check that cyclic values are equal.\n var arrStacked = stack.get(array);\n var othStacked = stack.get(other);\n if (arrStacked && othStacked) {\n return arrStacked == other && othStacked == array;\n }\n var index = -1,\n result = true,\n seen = (bitmask & COMPARE_UNORDERED_FLAG) ? new SetCache : undefined;\n\n stack.set(array, other);\n stack.set(other, array);\n\n // Ignore non-index properties.\n while (++index < arrLength) {\n var arrValue = array[index],\n othValue = other[index];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, arrValue, index, other, array, stack)\n : customizer(arrValue, othValue, index, array, other, stack);\n }\n if (compared !== undefined) {\n if (compared) {\n continue;\n }\n result = false;\n break;\n }\n // Recursively compare arrays (susceptible to call stack limits).\n if (seen) {\n if (!arraySome(other, function(othValue, othIndex) {\n if (!cacheHas(seen, othIndex) &&\n (arrValue === othValue || equalFunc(arrValue, othValue, bitmask, customizer, stack))) {\n return seen.push(othIndex);\n }\n })) {\n result = false;\n break;\n }\n } else if (!(\n arrValue === othValue ||\n equalFunc(arrValue, othValue, bitmask, customizer, stack)\n )) {\n result = false;\n break;\n }\n }\n stack['delete'](array);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalArrays;\n","var root = require('./_root');\n\n/** Built-in value references. */\nvar Uint8Array = root.Uint8Array;\n\nmodule.exports = Uint8Array;\n","/**\n * Converts `map` to its key-value pairs.\n *\n * @private\n * @param {Object} map The map to convert.\n * @returns {Array} Returns the key-value pairs.\n */\nfunction mapToArray(map) {\n var index = -1,\n result = Array(map.size);\n\n map.forEach(function(value, key) {\n result[++index] = [key, value];\n });\n return result;\n}\n\nmodule.exports = mapToArray;\n","/**\n * Converts `set` to an array of its values.\n *\n * @private\n * @param {Object} set The set to convert.\n * @returns {Array} Returns the values.\n */\nfunction setToArray(set) {\n var index = -1,\n result = Array(set.size);\n\n set.forEach(function(value) {\n result[++index] = value;\n });\n return result;\n}\n\nmodule.exports = setToArray;\n","var Symbol = require('./_Symbol'),\n Uint8Array = require('./_Uint8Array'),\n eq = require('./eq'),\n equalArrays = require('./_equalArrays'),\n mapToArray = require('./_mapToArray'),\n setToArray = require('./_setToArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/** `Object#toString` result references. */\nvar boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n symbolTag = '[object Symbol]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]';\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolValueOf = symbolProto ? symbolProto.valueOf : undefined;\n\n/**\n * A specialized version of `baseIsEqualDeep` for comparing objects of\n * the same `toStringTag`.\n *\n * **Note:** This function only supports comparing values with tags of\n * `Boolean`, `Date`, `Error`, `Number`, `RegExp`, or `String`.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {string} tag The `toStringTag` of the objects to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalByTag(object, other, tag, bitmask, customizer, equalFunc, stack) {\n switch (tag) {\n case dataViewTag:\n if ((object.byteLength != other.byteLength) ||\n (object.byteOffset != other.byteOffset)) {\n return false;\n }\n object = object.buffer;\n other = other.buffer;\n\n case arrayBufferTag:\n if ((object.byteLength != other.byteLength) ||\n !equalFunc(new Uint8Array(object), new Uint8Array(other))) {\n return false;\n }\n return true;\n\n case boolTag:\n case dateTag:\n case numberTag:\n // Coerce booleans to `1` or `0` and dates to milliseconds.\n // Invalid dates are coerced to `NaN`.\n return eq(+object, +other);\n\n case errorTag:\n return object.name == other.name && object.message == other.message;\n\n case regexpTag:\n case stringTag:\n // Coerce regexes to strings and treat strings, primitives and objects,\n // as equal. See http://www.ecma-international.org/ecma-262/7.0/#sec-regexp.prototype.tostring\n // for more details.\n return object == (other + '');\n\n case mapTag:\n var convert = mapToArray;\n\n case setTag:\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG;\n convert || (convert = setToArray);\n\n if (object.size != other.size && !isPartial) {\n return false;\n }\n // Assume cyclic values are equal.\n var stacked = stack.get(object);\n if (stacked) {\n return stacked == other;\n }\n bitmask |= COMPARE_UNORDERED_FLAG;\n\n // Recursively compare objects (susceptible to call stack limits).\n stack.set(object, other);\n var result = equalArrays(convert(object), convert(other), bitmask, customizer, equalFunc, stack);\n stack['delete'](object);\n return result;\n\n case symbolTag:\n if (symbolValueOf) {\n return symbolValueOf.call(object) == symbolValueOf.call(other);\n }\n }\n return false;\n}\n\nmodule.exports = equalByTag;\n","/**\n * Appends the elements of `values` to `array`.\n *\n * @private\n * @param {Array} array The array to modify.\n * @param {Array} values The values to append.\n * @returns {Array} Returns `array`.\n */\nfunction arrayPush(array, values) {\n var index = -1,\n length = values.length,\n offset = array.length;\n\n while (++index < length) {\n array[offset + index] = values[index];\n }\n return array;\n}\n\nmodule.exports = arrayPush;\n","var arrayPush = require('./_arrayPush'),\n isArray = require('./isArray');\n\n/**\n * The base implementation of `getAllKeys` and `getAllKeysIn` which uses\n * `keysFunc` and `symbolsFunc` to get the enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @param {Function} symbolsFunc The function to get the symbols of `object`.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction baseGetAllKeys(object, keysFunc, symbolsFunc) {\n var result = keysFunc(object);\n return isArray(object) ? result : arrayPush(result, symbolsFunc(object));\n}\n\nmodule.exports = baseGetAllKeys;\n","/**\n * A specialized version of `_.filter` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} predicate The function invoked per iteration.\n * @returns {Array} Returns the new filtered array.\n */\nfunction arrayFilter(array, predicate) {\n var index = -1,\n length = array == null ? 0 : array.length,\n resIndex = 0,\n result = [];\n\n while (++index < length) {\n var value = array[index];\n if (predicate(value, index, array)) {\n result[resIndex++] = value;\n }\n }\n return result;\n}\n\nmodule.exports = arrayFilter;\n","/**\n * This method returns a new empty array.\n *\n * @static\n * @memberOf _\n * @since 4.13.0\n * @category Util\n * @returns {Array} Returns the new empty array.\n * @example\n *\n * var arrays = _.times(2, _.stubArray);\n *\n * console.log(arrays);\n * // => [[], []]\n *\n * console.log(arrays[0] === arrays[1]);\n * // => false\n */\nfunction stubArray() {\n return [];\n}\n\nmodule.exports = stubArray;\n","var arrayFilter = require('./_arrayFilter'),\n stubArray = require('./stubArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Built-in value references. */\nvar propertyIsEnumerable = objectProto.propertyIsEnumerable;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbols = !nativeGetSymbols ? stubArray : function(object) {\n if (object == null) {\n return [];\n }\n object = Object(object);\n return arrayFilter(nativeGetSymbols(object), function(symbol) {\n return propertyIsEnumerable.call(object, symbol);\n });\n};\n\nmodule.exports = getSymbols;\n","/**\n * The base implementation of `_.times` without support for iteratee shorthands\n * or max array length checks.\n *\n * @private\n * @param {number} n The number of times to invoke `iteratee`.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the array of results.\n */\nfunction baseTimes(n, iteratee) {\n var index = -1,\n result = Array(n);\n\n while (++index < n) {\n result[index] = iteratee(index);\n }\n return result;\n}\n\nmodule.exports = baseTimes;\n","/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/** Used to detect unsigned integer values. */\nvar reIsUint = /^(?:0|[1-9]\\d*)$/;\n\n/**\n * Checks if `value` is a valid array-like index.\n *\n * @private\n * @param {*} value The value to check.\n * @param {number} [length=MAX_SAFE_INTEGER] The upper bounds of a valid index.\n * @returns {boolean} Returns `true` if `value` is a valid index, else `false`.\n */\nfunction isIndex(value, length) {\n var type = typeof value;\n length = length == null ? MAX_SAFE_INTEGER : length;\n\n return !!length &&\n (type == 'number' ||\n (type != 'symbol' && reIsUint.test(value))) &&\n (value > -1 && value % 1 == 0 && value < length);\n}\n\nmodule.exports = isIndex;\n","var baseTimes = require('./_baseTimes'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isIndex = require('./_isIndex'),\n isTypedArray = require('./isTypedArray');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Creates an array of the enumerable property names of the array-like `value`.\n *\n * @private\n * @param {*} value The value to query.\n * @param {boolean} inherited Specify returning inherited property names.\n * @returns {Array} Returns the array of property names.\n */\nfunction arrayLikeKeys(value, inherited) {\n var isArr = isArray(value),\n isArg = !isArr && isArguments(value),\n isBuff = !isArr && !isArg && isBuffer(value),\n isType = !isArr && !isArg && !isBuff && isTypedArray(value),\n skipIndexes = isArr || isArg || isBuff || isType,\n result = skipIndexes ? baseTimes(value.length, String) : [],\n length = result.length;\n\n for (var key in value) {\n if ((inherited || hasOwnProperty.call(value, key)) &&\n !(skipIndexes && (\n // Safari 9 has enumerable `arguments.length` in strict mode.\n key == 'length' ||\n // Node.js 0.10 has enumerable non-index properties on buffers.\n (isBuff && (key == 'offset' || key == 'parent')) ||\n // PhantomJS 2 has enumerable non-index properties on typed arrays.\n (isType && (key == 'buffer' || key == 'byteLength' || key == 'byteOffset')) ||\n // Skip index properties.\n isIndex(key, length)\n ))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = arrayLikeKeys;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeys = require('./_baseKeys'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects. See the\n * [ES spec](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * for more details.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keys(new Foo);\n * // => ['a', 'b'] (iteration order is not guaranteed)\n *\n * _.keys('hi');\n * // => ['0', '1']\n */\nfunction keys(object) {\n return isArrayLike(object) ? arrayLikeKeys(object) : baseKeys(object);\n}\n\nmodule.exports = keys;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbols = require('./_getSymbols'),\n keys = require('./keys');\n\n/**\n * Creates an array of own enumerable property names and symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeys(object) {\n return baseGetAllKeys(object, keys, getSymbols);\n}\n\nmodule.exports = getAllKeys;\n","var getAllKeys = require('./_getAllKeys');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqualDeep` for objects with support for\n * partial deep comparisons.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} stack Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction equalObjects(object, other, bitmask, customizer, equalFunc, stack) {\n var isPartial = bitmask & COMPARE_PARTIAL_FLAG,\n objProps = getAllKeys(object),\n objLength = objProps.length,\n othProps = getAllKeys(other),\n othLength = othProps.length;\n\n if (objLength != othLength && !isPartial) {\n return false;\n }\n var index = objLength;\n while (index--) {\n var key = objProps[index];\n if (!(isPartial ? key in other : hasOwnProperty.call(other, key))) {\n return false;\n }\n }\n // Check that cyclic values are equal.\n var objStacked = stack.get(object);\n var othStacked = stack.get(other);\n if (objStacked && othStacked) {\n return objStacked == other && othStacked == object;\n }\n var result = true;\n stack.set(object, other);\n stack.set(other, object);\n\n var skipCtor = isPartial;\n while (++index < objLength) {\n key = objProps[index];\n var objValue = object[key],\n othValue = other[key];\n\n if (customizer) {\n var compared = isPartial\n ? customizer(othValue, objValue, key, other, object, stack)\n : customizer(objValue, othValue, key, object, other, stack);\n }\n // Recursively compare objects (susceptible to call stack limits).\n if (!(compared === undefined\n ? (objValue === othValue || equalFunc(objValue, othValue, bitmask, customizer, stack))\n : compared\n )) {\n result = false;\n break;\n }\n skipCtor || (skipCtor = key == 'constructor');\n }\n if (result && !skipCtor) {\n var objCtor = object.constructor,\n othCtor = other.constructor;\n\n // Non `Object` object instances with different constructors are not equal.\n if (objCtor != othCtor &&\n ('constructor' in object && 'constructor' in other) &&\n !(typeof objCtor == 'function' && objCtor instanceof objCtor &&\n typeof othCtor == 'function' && othCtor instanceof othCtor)) {\n result = false;\n }\n }\n stack['delete'](object);\n stack['delete'](other);\n return result;\n}\n\nmodule.exports = equalObjects;\n","var Stack = require('./_Stack'),\n equalArrays = require('./_equalArrays'),\n equalByTag = require('./_equalByTag'),\n equalObjects = require('./_equalObjects'),\n getTag = require('./_getTag'),\n isArray = require('./isArray'),\n isBuffer = require('./isBuffer'),\n isTypedArray = require('./isTypedArray');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1;\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * A specialized version of `baseIsEqual` for arrays and objects which performs\n * deep comparisons and tracks traversed objects enabling objects with circular\n * references to be compared.\n *\n * @private\n * @param {Object} object The object to compare.\n * @param {Object} other The other object to compare.\n * @param {number} bitmask The bitmask flags. See `baseIsEqual` for more details.\n * @param {Function} customizer The function to customize comparisons.\n * @param {Function} equalFunc The function to determine equivalents of values.\n * @param {Object} [stack] Tracks traversed `object` and `other` objects.\n * @returns {boolean} Returns `true` if the objects are equivalent, else `false`.\n */\nfunction baseIsEqualDeep(object, other, bitmask, customizer, equalFunc, stack) {\n var objIsArr = isArray(object),\n othIsArr = isArray(other),\n objTag = objIsArr ? arrayTag : getTag(object),\n othTag = othIsArr ? arrayTag : getTag(other);\n\n objTag = objTag == argsTag ? objectTag : objTag;\n othTag = othTag == argsTag ? objectTag : othTag;\n\n var objIsObj = objTag == objectTag,\n othIsObj = othTag == objectTag,\n isSameTag = objTag == othTag;\n\n if (isSameTag && isBuffer(object)) {\n if (!isBuffer(other)) {\n return false;\n }\n objIsArr = true;\n objIsObj = false;\n }\n if (isSameTag && !objIsObj) {\n stack || (stack = new Stack);\n return (objIsArr || isTypedArray(object))\n ? equalArrays(object, other, bitmask, customizer, equalFunc, stack)\n : equalByTag(object, other, objTag, bitmask, customizer, equalFunc, stack);\n }\n if (!(bitmask & COMPARE_PARTIAL_FLAG)) {\n var objIsWrapped = objIsObj && hasOwnProperty.call(object, '__wrapped__'),\n othIsWrapped = othIsObj && hasOwnProperty.call(other, '__wrapped__');\n\n if (objIsWrapped || othIsWrapped) {\n var objUnwrapped = objIsWrapped ? object.value() : object,\n othUnwrapped = othIsWrapped ? other.value() : other;\n\n stack || (stack = new Stack);\n return equalFunc(objUnwrapped, othUnwrapped, bitmask, customizer, stack);\n }\n }\n if (!isSameTag) {\n return false;\n }\n stack || (stack = new Stack);\n return equalObjects(object, other, bitmask, customizer, equalFunc, stack);\n}\n\nmodule.exports = baseIsEqualDeep;\n","var baseIsEqualDeep = require('./_baseIsEqualDeep'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * The base implementation of `_.isEqual` which supports partial comparisons\n * and tracks traversed objects.\n *\n * @private\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {boolean} bitmask The bitmask flags.\n * 1 - Unordered comparison\n * 2 - Partial comparison\n * @param {Function} [customizer] The function to customize comparisons.\n * @param {Object} [stack] Tracks traversed `value` and `other` objects.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n */\nfunction baseIsEqual(value, other, bitmask, customizer, stack) {\n if (value === other) {\n return true;\n }\n if (value == null || other == null || (!isObjectLike(value) && !isObjectLike(other))) {\n return value !== value && other !== other;\n }\n return baseIsEqualDeep(value, other, bitmask, customizer, baseIsEqual, stack);\n}\n\nmodule.exports = baseIsEqual;\n","var baseIsEqual = require('./_baseIsEqual');\n\n/**\n * Performs a deep comparison between two values to determine if they are\n * equivalent.\n *\n * **Note:** This method supports comparing arrays, array buffers, booleans,\n * date objects, error objects, maps, numbers, `Object` objects, regexes,\n * sets, strings, symbols, and typed arrays. `Object` objects are compared\n * by their own, not inherited, enumerable properties. Functions and DOM\n * nodes are compared by strict equality, i.e. `===`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * var object = { 'a': 1 };\n * var other = { 'a': 1 };\n *\n * _.isEqual(object, other);\n * // => true\n *\n * object === other;\n * // => false\n */\nfunction isEqual(value, other) {\n return baseIsEqual(value, other);\n}\n\nmodule.exports = isEqual;\n","var baseGetTag = require('./_baseGetTag'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && baseGetTag(value) == symbolTag);\n}\n\nmodule.exports = isSymbol;\n","var isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used to match property names within property paths. */\nvar reIsDeepProp = /\\.|\\[(?:[^[\\]]*|([\"'])(?:(?!\\1)[^\\\\]|\\\\.)*?\\1)\\]/,\n reIsPlainProp = /^\\w*$/;\n\n/**\n * Checks if `value` is a property name and not a property path.\n *\n * @private\n * @param {*} value The value to check.\n * @param {Object} [object] The object to query keys on.\n * @returns {boolean} Returns `true` if `value` is a property name, else `false`.\n */\nfunction isKey(value, object) {\n if (isArray(value)) {\n return false;\n }\n var type = typeof value;\n if (type == 'number' || type == 'symbol' || type == 'boolean' ||\n value == null || isSymbol(value)) {\n return true;\n }\n return reIsPlainProp.test(value) || !reIsDeepProp.test(value) ||\n (object != null && value in Object(object));\n}\n\nmodule.exports = isKey;\n","var MapCache = require('./_MapCache');\n\n/** Error message constants. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/**\n * Creates a function that memoizes the result of `func`. If `resolver` is\n * provided, it determines the cache key for storing the result based on the\n * arguments provided to the memoized function. By default, the first argument\n * provided to the memoized function is used as the map cache key. The `func`\n * is invoked with the `this` binding of the memoized function.\n *\n * **Note:** The cache is exposed as the `cache` property on the memoized\n * function. Its creation may be customized by replacing the `_.memoize.Cache`\n * constructor with one whose instances implement the\n * [`Map`](http://ecma-international.org/ecma-262/7.0/#sec-properties-of-the-map-prototype-object)\n * method interface of `clear`, `delete`, `get`, `has`, and `set`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to have its output memoized.\n * @param {Function} [resolver] The function to resolve the cache key.\n * @returns {Function} Returns the new memoized function.\n * @example\n *\n * var object = { 'a': 1, 'b': 2 };\n * var other = { 'c': 3, 'd': 4 };\n *\n * var values = _.memoize(_.values);\n * values(object);\n * // => [1, 2]\n *\n * values(other);\n * // => [3, 4]\n *\n * object.a = 2;\n * values(object);\n * // => [1, 2]\n *\n * // Modify the result cache.\n * values.cache.set(object, ['a', 'b']);\n * values(object);\n * // => ['a', 'b']\n *\n * // Replace `_.memoize.Cache`.\n * _.memoize.Cache = WeakMap;\n */\nfunction memoize(func, resolver) {\n if (typeof func != 'function' || (resolver != null && typeof resolver != 'function')) {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n var memoized = function() {\n var args = arguments,\n key = resolver ? resolver.apply(this, args) : args[0],\n cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = func.apply(this, args);\n memoized.cache = cache.set(key, result) || cache;\n return result;\n };\n memoized.cache = new (memoize.Cache || MapCache);\n return memoized;\n}\n\n// Expose `MapCache`.\nmemoize.Cache = MapCache;\n\nmodule.exports = memoize;\n","var memoize = require('./memoize');\n\n/** Used as the maximum memoize cache size. */\nvar MAX_MEMOIZE_SIZE = 500;\n\n/**\n * A specialized version of `_.memoize` which clears the memoized function's\n * cache when it exceeds `MAX_MEMOIZE_SIZE`.\n *\n * @private\n * @param {Function} func The function to have its output memoized.\n * @returns {Function} Returns the new memoized function.\n */\nfunction memoizeCapped(func) {\n var result = memoize(func, function(key) {\n if (cache.size === MAX_MEMOIZE_SIZE) {\n cache.clear();\n }\n return key;\n });\n\n var cache = result.cache;\n return result;\n}\n\nmodule.exports = memoizeCapped;\n","var memoizeCapped = require('./_memoizeCapped');\n\n/** Used to match property names within property paths. */\nvar rePropName = /[^.[\\]]+|\\[(?:(-?\\d+(?:\\.\\d+)?)|([\"'])((?:(?!\\2)[^\\\\]|\\\\.)*?)\\2)\\]|(?=(?:\\.|\\[\\])(?:\\.|\\[\\]|$))/g;\n\n/** Used to match backslashes in property paths. */\nvar reEscapeChar = /\\\\(\\\\)?/g;\n\n/**\n * Converts `string` to a property path array.\n *\n * @private\n * @param {string} string The string to convert.\n * @returns {Array} Returns the property path array.\n */\nvar stringToPath = memoizeCapped(function(string) {\n var result = [];\n if (string.charCodeAt(0) === 46 /* . */) {\n result.push('');\n }\n string.replace(rePropName, function(match, number, quote, subString) {\n result.push(quote ? subString.replace(reEscapeChar, '$1') : (number || match));\n });\n return result;\n});\n\nmodule.exports = stringToPath;\n","/**\n * A specialized version of `_.map` for arrays without support for iteratee\n * shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @returns {Array} Returns the new mapped array.\n */\nfunction arrayMap(array, iteratee) {\n var index = -1,\n length = array == null ? 0 : array.length,\n result = Array(length);\n\n while (++index < length) {\n result[index] = iteratee(array[index], index, array);\n }\n return result;\n}\n\nmodule.exports = arrayMap;\n","var Symbol = require('./_Symbol'),\n arrayMap = require('./_arrayMap'),\n isArray = require('./isArray'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isArray(value)) {\n // Recursively convert values (susceptible to call stack limits).\n return arrayMap(value, baseToString) + '';\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = baseToString;\n","var baseToString = require('./_baseToString');\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\nmodule.exports = toString;\n","var isArray = require('./isArray'),\n isKey = require('./_isKey'),\n stringToPath = require('./_stringToPath'),\n toString = require('./toString');\n\n/**\n * Casts `value` to a path array if it's not one.\n *\n * @private\n * @param {*} value The value to inspect.\n * @param {Object} [object] The object to query keys on.\n * @returns {Array} Returns the cast property path array.\n */\nfunction castPath(value, object) {\n if (isArray(value)) {\n return value;\n }\n return isKey(value, object) ? [value] : stringToPath(toString(value));\n}\n\nmodule.exports = castPath;\n","var isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/**\n * Converts `value` to a string key if it's not a string or symbol.\n *\n * @private\n * @param {*} value The value to inspect.\n * @returns {string|symbol} Returns the key.\n */\nfunction toKey(value) {\n if (typeof value == 'string' || isSymbol(value)) {\n return value;\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\nmodule.exports = toKey;\n","var castPath = require('./_castPath'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.get` without support for default values.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @returns {*} Returns the resolved value.\n */\nfunction baseGet(object, path) {\n path = castPath(path, object);\n\n var index = 0,\n length = path.length;\n\n while (object != null && index < length) {\n object = object[toKey(path[index++])];\n }\n return (index && index == length) ? object : undefined;\n}\n\nmodule.exports = baseGet;\n","var baseGet = require('./_baseGet');\n\n/**\n * Gets the value at `path` of `object`. If the resolved value is\n * `undefined`, the `defaultValue` is returned in its place.\n *\n * @static\n * @memberOf _\n * @since 3.7.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path of the property to get.\n * @param {*} [defaultValue] The value returned for `undefined` resolved values.\n * @returns {*} Returns the resolved value.\n * @example\n *\n * var object = { 'a': [{ 'b': { 'c': 3 } }] };\n *\n * _.get(object, 'a[0].b.c');\n * // => 3\n *\n * _.get(object, ['a', '0', 'b', 'c']);\n * // => 3\n *\n * _.get(object, 'a.b.c', 'default');\n * // => 'default'\n */\nfunction get(object, path, defaultValue) {\n var result = object == null ? undefined : baseGet(object, path);\n return result === undefined ? defaultValue : result;\n}\n\nmodule.exports = get;\n","var Symbol = require('./_Symbol'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray');\n\n/** Built-in value references. */\nvar spreadableSymbol = Symbol ? Symbol.isConcatSpreadable : undefined;\n\n/**\n * Checks if `value` is a flattenable `arguments` object or array.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is flattenable, else `false`.\n */\nfunction isFlattenable(value) {\n return isArray(value) || isArguments(value) ||\n !!(spreadableSymbol && value && value[spreadableSymbol]);\n}\n\nmodule.exports = isFlattenable;\n","var arrayPush = require('./_arrayPush'),\n isFlattenable = require('./_isFlattenable');\n\n/**\n * The base implementation of `_.flatten` with support for restricting flattening.\n *\n * @private\n * @param {Array} array The array to flatten.\n * @param {number} depth The maximum recursion depth.\n * @param {boolean} [predicate=isFlattenable] The function invoked per iteration.\n * @param {boolean} [isStrict] Restrict to values that pass `predicate` checks.\n * @param {Array} [result=[]] The initial result value.\n * @returns {Array} Returns the new flattened array.\n */\nfunction baseFlatten(array, depth, predicate, isStrict, result) {\n var index = -1,\n length = array.length;\n\n predicate || (predicate = isFlattenable);\n result || (result = []);\n\n while (++index < length) {\n var value = array[index];\n if (depth > 0 && predicate(value)) {\n if (depth > 1) {\n // Recursively flatten arrays (susceptible to call stack limits).\n baseFlatten(value, depth - 1, predicate, isStrict, result);\n } else {\n arrayPush(result, value);\n }\n } else if (!isStrict) {\n result[result.length] = value;\n }\n }\n return result;\n}\n\nmodule.exports = baseFlatten;\n","var baseFlatten = require('./_baseFlatten');\n\n/**\n * Flattens `array` a single level deep.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Array\n * @param {Array} array The array to flatten.\n * @returns {Array} Returns the new flattened array.\n * @example\n *\n * _.flatten([1, [2, [3, [4]], 5]]);\n * // => [1, 2, [3, [4]], 5]\n */\nfunction flatten(array) {\n var length = array == null ? 0 : array.length;\n return length ? baseFlatten(array, 1) : [];\n}\n\nmodule.exports = flatten;\n","!function(t,e){\"object\"==typeof exports&&\"undefined\"!=typeof module?module.exports=e():\"function\"==typeof define&&define.amd?define(e):(t=\"undefined\"!=typeof globalThis?globalThis:t||self).dayjs=e()}(this,(function(){\"use strict\";var t=1e3,e=6e4,n=36e5,r=\"millisecond\",i=\"second\",s=\"minute\",u=\"hour\",a=\"day\",o=\"week\",c=\"month\",f=\"quarter\",h=\"year\",d=\"date\",l=\"Invalid Date\",$=/^(\\d{4})[-/]?(\\d{1,2})?[-/]?(\\d{0,2})[Tt\\s]*(\\d{1,2})?:?(\\d{1,2})?:?(\\d{1,2})?[.:]?(\\d+)?$/,y=/\\[([^\\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,M={name:\"en\",weekdays:\"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday\".split(\"_\"),months:\"January_February_March_April_May_June_July_August_September_October_November_December\".split(\"_\"),ordinal:function(t){var e=[\"th\",\"st\",\"nd\",\"rd\"],n=t%100;return\"[\"+t+(e[(n-20)%10]||e[n]||e[0])+\"]\"}},m=function(t,e,n){var r=String(t);return!r||r.length>=e?t:\"\"+Array(e+1-r.length).join(n)+t},v={s:m,z:function(t){var e=-t.utcOffset(),n=Math.abs(e),r=Math.floor(n/60),i=n%60;return(e<=0?\"+\":\"-\")+m(r,2,\"0\")+\":\"+m(i,2,\"0\")},m:function t(e,n){if(e.date()1)return t(u[0])}else{var a=e.name;D[a]=e,i=a}return!r&&i&&(g=i),i||!r&&g},O=function(t,e){if(S(t))return t.clone();var n=\"object\"==typeof e?e:{};return n.date=t,n.args=arguments,new _(n)},b=v;b.l=w,b.i=S,b.w=function(t,e){return O(t,{locale:e.$L,utc:e.$u,x:e.$x,$offset:e.$offset})};var _=function(){function M(t){this.$L=w(t.locale,null,!0),this.parse(t),this.$x=this.$x||t.x||{},this[p]=!0}var m=M.prototype;return m.parse=function(t){this.$d=function(t){var e=t.date,n=t.utc;if(null===e)return new Date(NaN);if(b.u(e))return new Date;if(e instanceof Date)return new Date(e);if(\"string\"==typeof e&&!/Z$/i.test(e)){var r=e.match($);if(r){var i=r[2]-1||0,s=(r[7]||\"0\").substring(0,3);return n?new Date(Date.UTC(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)):new Date(r[1],i,r[3]||1,r[4]||0,r[5]||0,r[6]||0,s)}}return new Date(e)}(t),this.init()},m.init=function(){var t=this.$d;this.$y=t.getFullYear(),this.$M=t.getMonth(),this.$D=t.getDate(),this.$W=t.getDay(),this.$H=t.getHours(),this.$m=t.getMinutes(),this.$s=t.getSeconds(),this.$ms=t.getMilliseconds()},m.$utils=function(){return b},m.isValid=function(){return!(this.$d.toString()===l)},m.isSame=function(t,e){var n=O(t);return this.startOf(e)<=n&&n<=this.endOf(e)},m.isAfter=function(t,e){return O(t) thing => {\n const str = toString.call(thing);\n return cache[str] || (cache[str] = str.slice(8, -1).toLowerCase());\n})(Object.create(null));\n\nconst kindOfTest = (type) => {\n type = type.toLowerCase();\n return (thing) => kindOf(thing) === type\n}\n\nconst typeOfTest = type => thing => typeof thing === type;\n\n/**\n * Determine if a value is an Array\n *\n * @param {Object} val The value to test\n *\n * @returns {boolean} True if value is an Array, otherwise false\n */\nconst {isArray} = Array;\n\n/**\n * Determine if a value is undefined\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if the value is undefined, otherwise false\n */\nconst isUndefined = typeOfTest('undefined');\n\n/**\n * Determine if a value is a Buffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Buffer, otherwise false\n */\nfunction isBuffer(val) {\n return val !== null && !isUndefined(val) && val.constructor !== null && !isUndefined(val.constructor)\n && isFunction(val.constructor.isBuffer) && val.constructor.isBuffer(val);\n}\n\n/**\n * Determine if a value is an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is an ArrayBuffer, otherwise false\n */\nconst isArrayBuffer = kindOfTest('ArrayBuffer');\n\n\n/**\n * Determine if a value is a view on an ArrayBuffer\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a view on an ArrayBuffer, otherwise false\n */\nfunction isArrayBufferView(val) {\n let result;\n if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) {\n result = ArrayBuffer.isView(val);\n } else {\n result = (val) && (val.buffer) && (isArrayBuffer(val.buffer));\n }\n return result;\n}\n\n/**\n * Determine if a value is a String\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a String, otherwise false\n */\nconst isString = typeOfTest('string');\n\n/**\n * Determine if a value is a Function\n *\n * @param {*} val The value to test\n * @returns {boolean} True if value is a Function, otherwise false\n */\nconst isFunction = typeOfTest('function');\n\n/**\n * Determine if a value is a Number\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Number, otherwise false\n */\nconst isNumber = typeOfTest('number');\n\n/**\n * Determine if a value is an Object\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an Object, otherwise false\n */\nconst isObject = (thing) => thing !== null && typeof thing === 'object';\n\n/**\n * Determine if a value is a Boolean\n *\n * @param {*} thing The value to test\n * @returns {boolean} True if value is a Boolean, otherwise false\n */\nconst isBoolean = thing => thing === true || thing === false;\n\n/**\n * Determine if a value is a plain Object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a plain Object, otherwise false\n */\nconst isPlainObject = (val) => {\n if (kindOf(val) !== 'object') {\n return false;\n }\n\n const prototype = getPrototypeOf(val);\n return (prototype === null || prototype === Object.prototype || Object.getPrototypeOf(prototype) === null) && !(Symbol.toStringTag in val) && !(Symbol.iterator in val);\n}\n\n/**\n * Determine if a value is a Date\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Date, otherwise false\n */\nconst isDate = kindOfTest('Date');\n\n/**\n * Determine if a value is a File\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFile = kindOfTest('File');\n\n/**\n * Determine if a value is a Blob\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Blob, otherwise false\n */\nconst isBlob = kindOfTest('Blob');\n\n/**\n * Determine if a value is a FileList\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a File, otherwise false\n */\nconst isFileList = kindOfTest('FileList');\n\n/**\n * Determine if a value is a Stream\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a Stream, otherwise false\n */\nconst isStream = (val) => isObject(val) && isFunction(val.pipe);\n\n/**\n * Determine if a value is a FormData\n *\n * @param {*} thing The value to test\n *\n * @returns {boolean} True if value is an FormData, otherwise false\n */\nconst isFormData = (thing) => {\n let kind;\n return thing && (\n (typeof FormData === 'function' && thing instanceof FormData) || (\n isFunction(thing.append) && (\n (kind = kindOf(thing)) === 'formdata' ||\n // detect form-data instance\n (kind === 'object' && isFunction(thing.toString) && thing.toString() === '[object FormData]')\n )\n )\n )\n}\n\n/**\n * Determine if a value is a URLSearchParams object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a URLSearchParams object, otherwise false\n */\nconst isURLSearchParams = kindOfTest('URLSearchParams');\n\nconst [isReadableStream, isRequest, isResponse, isHeaders] = ['ReadableStream', 'Request', 'Response', 'Headers'].map(kindOfTest);\n\n/**\n * Trim excess whitespace off the beginning and end of a string\n *\n * @param {String} str The String to trim\n *\n * @returns {String} The String freed of excess whitespace\n */\nconst trim = (str) => str.trim ?\n str.trim() : str.replace(/^[\\s\\uFEFF\\xA0]+|[\\s\\uFEFF\\xA0]+$/g, '');\n\n/**\n * Iterate over an Array or an Object invoking a function for each item.\n *\n * If `obj` is an Array callback will be called passing\n * the value, index, and complete array for each item.\n *\n * If 'obj' is an Object callback will be called passing\n * the value, key, and complete object for each property.\n *\n * @param {Object|Array} obj The object to iterate\n * @param {Function} fn The callback to invoke for each item\n *\n * @param {Boolean} [allOwnKeys = false]\n * @returns {any}\n */\nfunction forEach(obj, fn, {allOwnKeys = false} = {}) {\n // Don't bother if no value provided\n if (obj === null || typeof obj === 'undefined') {\n return;\n }\n\n let i;\n let l;\n\n // Force an array if not already something iterable\n if (typeof obj !== 'object') {\n /*eslint no-param-reassign:0*/\n obj = [obj];\n }\n\n if (isArray(obj)) {\n // Iterate over array values\n for (i = 0, l = obj.length; i < l; i++) {\n fn.call(null, obj[i], i, obj);\n }\n } else {\n // Iterate over object keys\n const keys = allOwnKeys ? Object.getOwnPropertyNames(obj) : Object.keys(obj);\n const len = keys.length;\n let key;\n\n for (i = 0; i < len; i++) {\n key = keys[i];\n fn.call(null, obj[key], key, obj);\n }\n }\n}\n\nfunction findKey(obj, key) {\n key = key.toLowerCase();\n const keys = Object.keys(obj);\n let i = keys.length;\n let _key;\n while (i-- > 0) {\n _key = keys[i];\n if (key === _key.toLowerCase()) {\n return _key;\n }\n }\n return null;\n}\n\nconst _global = (() => {\n /*eslint no-undef:0*/\n if (typeof globalThis !== \"undefined\") return globalThis;\n return typeof self !== \"undefined\" ? self : (typeof window !== 'undefined' ? window : global)\n})();\n\nconst isContextDefined = (context) => !isUndefined(context) && context !== _global;\n\n/**\n * Accepts varargs expecting each argument to be an object, then\n * immutably merges the properties of each object and returns result.\n *\n * When multiple objects contain the same key the later object in\n * the arguments list will take precedence.\n *\n * Example:\n *\n * ```js\n * var result = merge({foo: 123}, {foo: 456});\n * console.log(result.foo); // outputs 456\n * ```\n *\n * @param {Object} obj1 Object to merge\n *\n * @returns {Object} Result of all merge properties\n */\nfunction merge(/* obj1, obj2, obj3, ... */) {\n const {caseless} = isContextDefined(this) && this || {};\n const result = {};\n const assignValue = (val, key) => {\n const targetKey = caseless && findKey(result, key) || key;\n if (isPlainObject(result[targetKey]) && isPlainObject(val)) {\n result[targetKey] = merge(result[targetKey], val);\n } else if (isPlainObject(val)) {\n result[targetKey] = merge({}, val);\n } else if (isArray(val)) {\n result[targetKey] = val.slice();\n } else {\n result[targetKey] = val;\n }\n }\n\n for (let i = 0, l = arguments.length; i < l; i++) {\n arguments[i] && forEach(arguments[i], assignValue);\n }\n return result;\n}\n\n/**\n * Extends object a by mutably adding to it the properties of object b.\n *\n * @param {Object} a The object to be extended\n * @param {Object} b The object to copy properties from\n * @param {Object} thisArg The object to bind function to\n *\n * @param {Boolean} [allOwnKeys]\n * @returns {Object} The resulting value of object a\n */\nconst extend = (a, b, thisArg, {allOwnKeys}= {}) => {\n forEach(b, (val, key) => {\n if (thisArg && isFunction(val)) {\n a[key] = bind(val, thisArg);\n } else {\n a[key] = val;\n }\n }, {allOwnKeys});\n return a;\n}\n\n/**\n * Remove byte order marker. This catches EF BB BF (the UTF-8 BOM)\n *\n * @param {string} content with BOM\n *\n * @returns {string} content value without BOM\n */\nconst stripBOM = (content) => {\n if (content.charCodeAt(0) === 0xFEFF) {\n content = content.slice(1);\n }\n return content;\n}\n\n/**\n * Inherit the prototype methods from one constructor into another\n * @param {function} constructor\n * @param {function} superConstructor\n * @param {object} [props]\n * @param {object} [descriptors]\n *\n * @returns {void}\n */\nconst inherits = (constructor, superConstructor, props, descriptors) => {\n constructor.prototype = Object.create(superConstructor.prototype, descriptors);\n constructor.prototype.constructor = constructor;\n Object.defineProperty(constructor, 'super', {\n value: superConstructor.prototype\n });\n props && Object.assign(constructor.prototype, props);\n}\n\n/**\n * Resolve object with deep prototype chain to a flat object\n * @param {Object} sourceObj source object\n * @param {Object} [destObj]\n * @param {Function|Boolean} [filter]\n * @param {Function} [propFilter]\n *\n * @returns {Object}\n */\nconst toFlatObject = (sourceObj, destObj, filter, propFilter) => {\n let props;\n let i;\n let prop;\n const merged = {};\n\n destObj = destObj || {};\n // eslint-disable-next-line no-eq-null,eqeqeq\n if (sourceObj == null) return destObj;\n\n do {\n props = Object.getOwnPropertyNames(sourceObj);\n i = props.length;\n while (i-- > 0) {\n prop = props[i];\n if ((!propFilter || propFilter(prop, sourceObj, destObj)) && !merged[prop]) {\n destObj[prop] = sourceObj[prop];\n merged[prop] = true;\n }\n }\n sourceObj = filter !== false && getPrototypeOf(sourceObj);\n } while (sourceObj && (!filter || filter(sourceObj, destObj)) && sourceObj !== Object.prototype);\n\n return destObj;\n}\n\n/**\n * Determines whether a string ends with the characters of a specified string\n *\n * @param {String} str\n * @param {String} searchString\n * @param {Number} [position= 0]\n *\n * @returns {boolean}\n */\nconst endsWith = (str, searchString, position) => {\n str = String(str);\n if (position === undefined || position > str.length) {\n position = str.length;\n }\n position -= searchString.length;\n const lastIndex = str.indexOf(searchString, position);\n return lastIndex !== -1 && lastIndex === position;\n}\n\n\n/**\n * Returns new array from array like object or null if failed\n *\n * @param {*} [thing]\n *\n * @returns {?Array}\n */\nconst toArray = (thing) => {\n if (!thing) return null;\n if (isArray(thing)) return thing;\n let i = thing.length;\n if (!isNumber(i)) return null;\n const arr = new Array(i);\n while (i-- > 0) {\n arr[i] = thing[i];\n }\n return arr;\n}\n\n/**\n * Checking if the Uint8Array exists and if it does, it returns a function that checks if the\n * thing passed in is an instance of Uint8Array\n *\n * @param {TypedArray}\n *\n * @returns {Array}\n */\n// eslint-disable-next-line func-names\nconst isTypedArray = (TypedArray => {\n // eslint-disable-next-line func-names\n return thing => {\n return TypedArray && thing instanceof TypedArray;\n };\n})(typeof Uint8Array !== 'undefined' && getPrototypeOf(Uint8Array));\n\n/**\n * For each entry in the object, call the function with the key and value.\n *\n * @param {Object} obj - The object to iterate over.\n * @param {Function} fn - The function to call for each entry.\n *\n * @returns {void}\n */\nconst forEachEntry = (obj, fn) => {\n const generator = obj && obj[Symbol.iterator];\n\n const iterator = generator.call(obj);\n\n let result;\n\n while ((result = iterator.next()) && !result.done) {\n const pair = result.value;\n fn.call(obj, pair[0], pair[1]);\n }\n}\n\n/**\n * It takes a regular expression and a string, and returns an array of all the matches\n *\n * @param {string} regExp - The regular expression to match against.\n * @param {string} str - The string to search.\n *\n * @returns {Array}\n */\nconst matchAll = (regExp, str) => {\n let matches;\n const arr = [];\n\n while ((matches = regExp.exec(str)) !== null) {\n arr.push(matches);\n }\n\n return arr;\n}\n\n/* Checking if the kindOfTest function returns true when passed an HTMLFormElement. */\nconst isHTMLForm = kindOfTest('HTMLFormElement');\n\nconst toCamelCase = str => {\n return str.toLowerCase().replace(/[-_\\s]([a-z\\d])(\\w*)/g,\n function replacer(m, p1, p2) {\n return p1.toUpperCase() + p2;\n }\n );\n};\n\n/* Creating a function that will check if an object has a property. */\nconst hasOwnProperty = (({hasOwnProperty}) => (obj, prop) => hasOwnProperty.call(obj, prop))(Object.prototype);\n\n/**\n * Determine if a value is a RegExp object\n *\n * @param {*} val The value to test\n *\n * @returns {boolean} True if value is a RegExp object, otherwise false\n */\nconst isRegExp = kindOfTest('RegExp');\n\nconst reduceDescriptors = (obj, reducer) => {\n const descriptors = Object.getOwnPropertyDescriptors(obj);\n const reducedDescriptors = {};\n\n forEach(descriptors, (descriptor, name) => {\n let ret;\n if ((ret = reducer(descriptor, name, obj)) !== false) {\n reducedDescriptors[name] = ret || descriptor;\n }\n });\n\n Object.defineProperties(obj, reducedDescriptors);\n}\n\n/**\n * Makes all methods read-only\n * @param {Object} obj\n */\n\nconst freezeMethods = (obj) => {\n reduceDescriptors(obj, (descriptor, name) => {\n // skip restricted props in strict mode\n if (isFunction(obj) && ['arguments', 'caller', 'callee'].indexOf(name) !== -1) {\n return false;\n }\n\n const value = obj[name];\n\n if (!isFunction(value)) return;\n\n descriptor.enumerable = false;\n\n if ('writable' in descriptor) {\n descriptor.writable = false;\n return;\n }\n\n if (!descriptor.set) {\n descriptor.set = () => {\n throw Error('Can not rewrite read-only method \\'' + name + '\\'');\n };\n }\n });\n}\n\nconst toObjectSet = (arrayOrString, delimiter) => {\n const obj = {};\n\n const define = (arr) => {\n arr.forEach(value => {\n obj[value] = true;\n });\n }\n\n isArray(arrayOrString) ? define(arrayOrString) : define(String(arrayOrString).split(delimiter));\n\n return obj;\n}\n\nconst noop = () => {}\n\nconst toFiniteNumber = (value, defaultValue) => {\n return value != null && Number.isFinite(value = +value) ? value : defaultValue;\n}\n\nconst ALPHA = 'abcdefghijklmnopqrstuvwxyz'\n\nconst DIGIT = '0123456789';\n\nconst ALPHABET = {\n DIGIT,\n ALPHA,\n ALPHA_DIGIT: ALPHA + ALPHA.toUpperCase() + DIGIT\n}\n\nconst generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {\n let str = '';\n const {length} = alphabet;\n while (size--) {\n str += alphabet[Math.random() * length|0]\n }\n\n return str;\n}\n\n/**\n * If the thing is a FormData object, return true, otherwise return false.\n *\n * @param {unknown} thing - The thing to check.\n *\n * @returns {boolean}\n */\nfunction isSpecCompliantForm(thing) {\n return !!(thing && isFunction(thing.append) && thing[Symbol.toStringTag] === 'FormData' && thing[Symbol.iterator]);\n}\n\nconst toJSONObject = (obj) => {\n const stack = new Array(10);\n\n const visit = (source, i) => {\n\n if (isObject(source)) {\n if (stack.indexOf(source) >= 0) {\n return;\n }\n\n if(!('toJSON' in source)) {\n stack[i] = source;\n const target = isArray(source) ? [] : {};\n\n forEach(source, (value, key) => {\n const reducedValue = visit(value, i + 1);\n !isUndefined(reducedValue) && (target[key] = reducedValue);\n });\n\n stack[i] = undefined;\n\n return target;\n }\n }\n\n return source;\n }\n\n return visit(obj, 0);\n}\n\nconst isAsyncFn = kindOfTest('AsyncFunction');\n\nconst isThenable = (thing) =>\n thing && (isObject(thing) || isFunction(thing)) && isFunction(thing.then) && isFunction(thing.catch);\n\n// original code\n// https://github.com/DigitalBrainJS/AxiosPromise/blob/16deab13710ec09779922131f3fa5954320f83ab/lib/utils.js#L11-L34\n\nconst _setImmediate = ((setImmediateSupported, postMessageSupported) => {\n if (setImmediateSupported) {\n return setImmediate;\n }\n\n return postMessageSupported ? ((token, callbacks) => {\n _global.addEventListener(\"message\", ({source, data}) => {\n if (source === _global && data === token) {\n callbacks.length && callbacks.shift()();\n }\n }, false);\n\n return (cb) => {\n callbacks.push(cb);\n _global.postMessage(token, \"*\");\n }\n })(`axios@${Math.random()}`, []) : (cb) => setTimeout(cb);\n})(\n typeof setImmediate === 'function',\n isFunction(_global.postMessage)\n);\n\nconst asap = typeof queueMicrotask !== 'undefined' ?\n queueMicrotask.bind(_global) : ( typeof process !== 'undefined' && process.nextTick || _setImmediate);\n\n// *********************\n\nexport default {\n isArray,\n isArrayBuffer,\n isBuffer,\n isFormData,\n isArrayBufferView,\n isString,\n isNumber,\n isBoolean,\n isObject,\n isPlainObject,\n isReadableStream,\n isRequest,\n isResponse,\n isHeaders,\n isUndefined,\n isDate,\n isFile,\n isBlob,\n isRegExp,\n isFunction,\n isStream,\n isURLSearchParams,\n isTypedArray,\n isFileList,\n forEach,\n merge,\n extend,\n trim,\n stripBOM,\n inherits,\n toFlatObject,\n kindOf,\n kindOfTest,\n endsWith,\n toArray,\n forEachEntry,\n matchAll,\n isHTMLForm,\n hasOwnProperty,\n hasOwnProp: hasOwnProperty, // an alias to avoid ESLint no-prototype-builtins detection\n reduceDescriptors,\n freezeMethods,\n toObjectSet,\n toCamelCase,\n noop,\n toFiniteNumber,\n findKey,\n global: _global,\n isContextDefined,\n ALPHABET,\n generateString,\n isSpecCompliantForm,\n toJSONObject,\n isAsyncFn,\n isThenable,\n setImmediate: _setImmediate,\n asap\n};\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * Create an Error with the specified message, config, error code, request and response.\n *\n * @param {string} message The error message.\n * @param {string} [code] The error code (for example, 'ECONNABORTED').\n * @param {Object} [config] The config.\n * @param {Object} [request] The request.\n * @param {Object} [response] The response.\n *\n * @returns {Error} The created error.\n */\nfunction AxiosError(message, code, config, request, response) {\n Error.call(this);\n\n if (Error.captureStackTrace) {\n Error.captureStackTrace(this, this.constructor);\n } else {\n this.stack = (new Error()).stack;\n }\n\n this.message = message;\n this.name = 'AxiosError';\n code && (this.code = code);\n config && (this.config = config);\n request && (this.request = request);\n if (response) {\n this.response = response;\n this.status = response.status ? response.status : null;\n }\n}\n\nutils.inherits(AxiosError, Error, {\n toJSON: function toJSON() {\n return {\n // Standard\n message: this.message,\n name: this.name,\n // Microsoft\n description: this.description,\n number: this.number,\n // Mozilla\n fileName: this.fileName,\n lineNumber: this.lineNumber,\n columnNumber: this.columnNumber,\n stack: this.stack,\n // Axios\n config: utils.toJSONObject(this.config),\n code: this.code,\n status: this.status\n };\n }\n});\n\nconst prototype = AxiosError.prototype;\nconst descriptors = {};\n\n[\n 'ERR_BAD_OPTION_VALUE',\n 'ERR_BAD_OPTION',\n 'ECONNABORTED',\n 'ETIMEDOUT',\n 'ERR_NETWORK',\n 'ERR_FR_TOO_MANY_REDIRECTS',\n 'ERR_DEPRECATED',\n 'ERR_BAD_RESPONSE',\n 'ERR_BAD_REQUEST',\n 'ERR_CANCELED',\n 'ERR_NOT_SUPPORT',\n 'ERR_INVALID_URL'\n// eslint-disable-next-line func-names\n].forEach(code => {\n descriptors[code] = {value: code};\n});\n\nObject.defineProperties(AxiosError, descriptors);\nObject.defineProperty(prototype, 'isAxiosError', {value: true});\n\n// eslint-disable-next-line func-names\nAxiosError.from = (error, code, config, request, response, customProps) => {\n const axiosError = Object.create(prototype);\n\n utils.toFlatObject(error, axiosError, function filter(obj) {\n return obj !== Error.prototype;\n }, prop => {\n return prop !== 'isAxiosError';\n });\n\n AxiosError.call(axiosError, error.message, code, config, request, response);\n\n axiosError.cause = error;\n\n axiosError.name = error.name;\n\n customProps && Object.assign(axiosError, customProps);\n\n return axiosError;\n};\n\nexport default AxiosError;\n","// eslint-disable-next-line strict\nexport default null;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\n// temporary hotfix to avoid circular references until AxiosURLSearchParams is refactored\nimport PlatformFormData from '../platform/node/classes/FormData.js';\n\n/**\n * Determines if the given thing is a array or js object.\n *\n * @param {string} thing - The object or array to be visited.\n *\n * @returns {boolean}\n */\nfunction isVisitable(thing) {\n return utils.isPlainObject(thing) || utils.isArray(thing);\n}\n\n/**\n * It removes the brackets from the end of a string\n *\n * @param {string} key - The key of the parameter.\n *\n * @returns {string} the key without the brackets.\n */\nfunction removeBrackets(key) {\n return utils.endsWith(key, '[]') ? key.slice(0, -2) : key;\n}\n\n/**\n * It takes a path, a key, and a boolean, and returns a string\n *\n * @param {string} path - The path to the current key.\n * @param {string} key - The key of the current object being iterated over.\n * @param {string} dots - If true, the key will be rendered with dots instead of brackets.\n *\n * @returns {string} The path to the current key.\n */\nfunction renderKey(path, key, dots) {\n if (!path) return key;\n return path.concat(key).map(function each(token, i) {\n // eslint-disable-next-line no-param-reassign\n token = removeBrackets(token);\n return !dots && i ? '[' + token + ']' : token;\n }).join(dots ? '.' : '');\n}\n\n/**\n * If the array is an array and none of its elements are visitable, then it's a flat array.\n *\n * @param {Array} arr - The array to check\n *\n * @returns {boolean}\n */\nfunction isFlatArray(arr) {\n return utils.isArray(arr) && !arr.some(isVisitable);\n}\n\nconst predicates = utils.toFlatObject(utils, {}, null, function filter(prop) {\n return /^is[A-Z]/.test(prop);\n});\n\n/**\n * Convert a data object to FormData\n *\n * @param {Object} obj\n * @param {?Object} [formData]\n * @param {?Object} [options]\n * @param {Function} [options.visitor]\n * @param {Boolean} [options.metaTokens = true]\n * @param {Boolean} [options.dots = false]\n * @param {?Boolean} [options.indexes = false]\n *\n * @returns {Object}\n **/\n\n/**\n * It converts an object into a FormData object\n *\n * @param {Object} obj - The object to convert to form data.\n * @param {string} formData - The FormData object to append to.\n * @param {Object} options\n *\n * @returns\n */\nfunction toFormData(obj, formData, options) {\n if (!utils.isObject(obj)) {\n throw new TypeError('target must be an object');\n }\n\n // eslint-disable-next-line no-param-reassign\n formData = formData || new (PlatformFormData || FormData)();\n\n // eslint-disable-next-line no-param-reassign\n options = utils.toFlatObject(options, {\n metaTokens: true,\n dots: false,\n indexes: false\n }, false, function defined(option, source) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n return !utils.isUndefined(source[option]);\n });\n\n const metaTokens = options.metaTokens;\n // eslint-disable-next-line no-use-before-define\n const visitor = options.visitor || defaultVisitor;\n const dots = options.dots;\n const indexes = options.indexes;\n const _Blob = options.Blob || typeof Blob !== 'undefined' && Blob;\n const useBlob = _Blob && utils.isSpecCompliantForm(formData);\n\n if (!utils.isFunction(visitor)) {\n throw new TypeError('visitor must be a function');\n }\n\n function convertValue(value) {\n if (value === null) return '';\n\n if (utils.isDate(value)) {\n return value.toISOString();\n }\n\n if (!useBlob && utils.isBlob(value)) {\n throw new AxiosError('Blob is not supported. Use a Buffer instead.');\n }\n\n if (utils.isArrayBuffer(value) || utils.isTypedArray(value)) {\n return useBlob && typeof Blob === 'function' ? new Blob([value]) : Buffer.from(value);\n }\n\n return value;\n }\n\n /**\n * Default visitor.\n *\n * @param {*} value\n * @param {String|Number} key\n * @param {Array} path\n * @this {FormData}\n *\n * @returns {boolean} return true to visit the each prop of the value recursively\n */\n function defaultVisitor(value, key, path) {\n let arr = value;\n\n if (value && !path && typeof value === 'object') {\n if (utils.endsWith(key, '{}')) {\n // eslint-disable-next-line no-param-reassign\n key = metaTokens ? key : key.slice(0, -2);\n // eslint-disable-next-line no-param-reassign\n value = JSON.stringify(value);\n } else if (\n (utils.isArray(value) && isFlatArray(value)) ||\n ((utils.isFileList(value) || utils.endsWith(key, '[]')) && (arr = utils.toArray(value))\n )) {\n // eslint-disable-next-line no-param-reassign\n key = removeBrackets(key);\n\n arr.forEach(function each(el, index) {\n !(utils.isUndefined(el) || el === null) && formData.append(\n // eslint-disable-next-line no-nested-ternary\n indexes === true ? renderKey([key], index, dots) : (indexes === null ? key : key + '[]'),\n convertValue(el)\n );\n });\n return false;\n }\n }\n\n if (isVisitable(value)) {\n return true;\n }\n\n formData.append(renderKey(path, key, dots), convertValue(value));\n\n return false;\n }\n\n const stack = [];\n\n const exposedHelpers = Object.assign(predicates, {\n defaultVisitor,\n convertValue,\n isVisitable\n });\n\n function build(value, path) {\n if (utils.isUndefined(value)) return;\n\n if (stack.indexOf(value) !== -1) {\n throw Error('Circular reference detected in ' + path.join('.'));\n }\n\n stack.push(value);\n\n utils.forEach(value, function each(el, key) {\n const result = !(utils.isUndefined(el) || el === null) && visitor.call(\n formData, el, utils.isString(key) ? key.trim() : key, path, exposedHelpers\n );\n\n if (result === true) {\n build(el, path ? path.concat(key) : [key]);\n }\n });\n\n stack.pop();\n }\n\n if (!utils.isObject(obj)) {\n throw new TypeError('data must be an object');\n }\n\n build(obj);\n\n return formData;\n}\n\nexport default toFormData;\n","'use strict';\n\nimport toFormData from './toFormData.js';\n\n/**\n * It encodes a string by replacing all characters that are not in the unreserved set with\n * their percent-encoded equivalents\n *\n * @param {string} str - The string to encode.\n *\n * @returns {string} The encoded string.\n */\nfunction encode(str) {\n const charMap = {\n '!': '%21',\n \"'\": '%27',\n '(': '%28',\n ')': '%29',\n '~': '%7E',\n '%20': '+',\n '%00': '\\x00'\n };\n return encodeURIComponent(str).replace(/[!'()~]|%20|%00/g, function replacer(match) {\n return charMap[match];\n });\n}\n\n/**\n * It takes a params object and converts it to a FormData object\n *\n * @param {Object} params - The parameters to be converted to a FormData object.\n * @param {Object} options - The options object passed to the Axios constructor.\n *\n * @returns {void}\n */\nfunction AxiosURLSearchParams(params, options) {\n this._pairs = [];\n\n params && toFormData(params, this, options);\n}\n\nconst prototype = AxiosURLSearchParams.prototype;\n\nprototype.append = function append(name, value) {\n this._pairs.push([name, value]);\n};\n\nprototype.toString = function toString(encoder) {\n const _encode = encoder ? function(value) {\n return encoder.call(this, value, encode);\n } : encode;\n\n return this._pairs.map(function each(pair) {\n return _encode(pair[0]) + '=' + _encode(pair[1]);\n }, '').join('&');\n};\n\nexport default AxiosURLSearchParams;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosURLSearchParams from '../helpers/AxiosURLSearchParams.js';\n\n/**\n * It replaces all instances of the characters `:`, `$`, `,`, `+`, `[`, and `]` with their\n * URI encoded counterparts\n *\n * @param {string} val The value to be encoded.\n *\n * @returns {string} The encoded value.\n */\nfunction encode(val) {\n return encodeURIComponent(val).\n replace(/%3A/gi, ':').\n replace(/%24/g, '$').\n replace(/%2C/gi, ',').\n replace(/%20/g, '+').\n replace(/%5B/gi, '[').\n replace(/%5D/gi, ']');\n}\n\n/**\n * Build a URL by appending params to the end\n *\n * @param {string} url The base of the url (e.g., http://www.google.com)\n * @param {object} [params] The params to be appended\n * @param {?(object|Function)} options\n *\n * @returns {string} The formatted url\n */\nexport default function buildURL(url, params, options) {\n /*eslint no-param-reassign:0*/\n if (!params) {\n return url;\n }\n \n const _encode = options && options.encode || encode;\n\n if (utils.isFunction(options)) {\n options = {\n serialize: options\n };\n } \n\n const serializeFn = options && options.serialize;\n\n let serializedParams;\n\n if (serializeFn) {\n serializedParams = serializeFn(params, options);\n } else {\n serializedParams = utils.isURLSearchParams(params) ?\n params.toString() :\n new AxiosURLSearchParams(params, options).toString(_encode);\n }\n\n if (serializedParams) {\n const hashmarkIndex = url.indexOf(\"#\");\n\n if (hashmarkIndex !== -1) {\n url = url.slice(0, hashmarkIndex);\n }\n url += (url.indexOf('?') === -1 ? '?' : '&') + serializedParams;\n }\n\n return url;\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\nclass InterceptorManager {\n constructor() {\n this.handlers = [];\n }\n\n /**\n * Add a new interceptor to the stack\n *\n * @param {Function} fulfilled The function to handle `then` for a `Promise`\n * @param {Function} rejected The function to handle `reject` for a `Promise`\n *\n * @return {Number} An ID used to remove interceptor later\n */\n use(fulfilled, rejected, options) {\n this.handlers.push({\n fulfilled,\n rejected,\n synchronous: options ? options.synchronous : false,\n runWhen: options ? options.runWhen : null\n });\n return this.handlers.length - 1;\n }\n\n /**\n * Remove an interceptor from the stack\n *\n * @param {Number} id The ID that was returned by `use`\n *\n * @returns {Boolean} `true` if the interceptor was removed, `false` otherwise\n */\n eject(id) {\n if (this.handlers[id]) {\n this.handlers[id] = null;\n }\n }\n\n /**\n * Clear all interceptors from the stack\n *\n * @returns {void}\n */\n clear() {\n if (this.handlers) {\n this.handlers = [];\n }\n }\n\n /**\n * Iterate over all the registered interceptors\n *\n * This method is particularly useful for skipping over any\n * interceptors that may have become `null` calling `eject`.\n *\n * @param {Function} fn The function to call for each interceptor\n *\n * @returns {void}\n */\n forEach(fn) {\n utils.forEach(this.handlers, function forEachHandler(h) {\n if (h !== null) {\n fn(h);\n }\n });\n }\n}\n\nexport default InterceptorManager;\n","'use strict';\n\nexport default {\n silentJSONParsing: true,\n forcedJSONParsing: true,\n clarifyTimeoutError: false\n};\n","'use strict';\n\nimport AxiosURLSearchParams from '../../../helpers/AxiosURLSearchParams.js';\nexport default typeof URLSearchParams !== 'undefined' ? URLSearchParams : AxiosURLSearchParams;\n","'use strict';\n\nexport default typeof FormData !== 'undefined' ? FormData : null;\n","'use strict'\n\nexport default typeof Blob !== 'undefined' ? Blob : null\n","import URLSearchParams from './classes/URLSearchParams.js'\nimport FormData from './classes/FormData.js'\nimport Blob from './classes/Blob.js'\n\nexport default {\n isBrowser: true,\n classes: {\n URLSearchParams,\n FormData,\n Blob\n },\n protocols: ['http', 'https', 'file', 'blob', 'url', 'data']\n};\n","const hasBrowserEnv = typeof window !== 'undefined' && typeof document !== 'undefined';\n\nconst _navigator = typeof navigator === 'object' && navigator || undefined;\n\n/**\n * Determine if we're running in a standard browser environment\n *\n * This allows axios to run in a web worker, and react-native.\n * Both environments support XMLHttpRequest, but not fully standard globals.\n *\n * web workers:\n * typeof window -> undefined\n * typeof document -> undefined\n *\n * react-native:\n * navigator.product -> 'ReactNative'\n * nativescript\n * navigator.product -> 'NativeScript' or 'NS'\n *\n * @returns {boolean}\n */\nconst hasStandardBrowserEnv = hasBrowserEnv &&\n (!_navigator || ['ReactNative', 'NativeScript', 'NS'].indexOf(_navigator.product) < 0);\n\n/**\n * Determine if we're running in a standard browser webWorker environment\n *\n * Although the `isStandardBrowserEnv` method indicates that\n * `allows axios to run in a web worker`, the WebWorker will still be\n * filtered out due to its judgment standard\n * `typeof window !== 'undefined' && typeof document !== 'undefined'`.\n * This leads to a problem when axios post `FormData` in webWorker\n */\nconst hasStandardBrowserWebWorkerEnv = (() => {\n return (\n typeof WorkerGlobalScope !== 'undefined' &&\n // eslint-disable-next-line no-undef\n self instanceof WorkerGlobalScope &&\n typeof self.importScripts === 'function'\n );\n})();\n\nconst origin = hasBrowserEnv && window.location.href || 'http://localhost';\n\nexport {\n hasBrowserEnv,\n hasStandardBrowserWebWorkerEnv,\n hasStandardBrowserEnv,\n _navigator as navigator,\n origin\n}\n","import platform from './node/index.js';\nimport * as utils from './common/utils.js';\n\nexport default {\n ...utils,\n ...platform\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport toFormData from './toFormData.js';\nimport platform from '../platform/index.js';\n\nexport default function toURLEncodedForm(data, options) {\n return toFormData(data, new platform.classes.URLSearchParams(), Object.assign({\n visitor: function(value, key, path, helpers) {\n if (platform.isNode && utils.isBuffer(value)) {\n this.append(key, value.toString('base64'));\n return false;\n }\n\n return helpers.defaultVisitor.apply(this, arguments);\n }\n }, options));\n}\n","'use strict';\n\nimport utils from '../utils.js';\n\n/**\n * It takes a string like `foo[x][y][z]` and returns an array like `['foo', 'x', 'y', 'z']\n *\n * @param {string} name - The name of the property to get.\n *\n * @returns An array of strings.\n */\nfunction parsePropPath(name) {\n // foo[x][y][z]\n // foo.x.y.z\n // foo-x-y-z\n // foo x y z\n return utils.matchAll(/\\w+|\\[(\\w*)]/g, name).map(match => {\n return match[0] === '[]' ? '' : match[1] || match[0];\n });\n}\n\n/**\n * Convert an array to an object.\n *\n * @param {Array} arr - The array to convert to an object.\n *\n * @returns An object with the same keys and values as the array.\n */\nfunction arrayToObject(arr) {\n const obj = {};\n const keys = Object.keys(arr);\n let i;\n const len = keys.length;\n let key;\n for (i = 0; i < len; i++) {\n key = keys[i];\n obj[key] = arr[key];\n }\n return obj;\n}\n\n/**\n * It takes a FormData object and returns a JavaScript object\n *\n * @param {string} formData The FormData object to convert to JSON.\n *\n * @returns {Object | null} The converted object.\n */\nfunction formDataToJSON(formData) {\n function buildPath(path, value, target, index) {\n let name = path[index++];\n\n if (name === '__proto__') return true;\n\n const isNumericKey = Number.isFinite(+name);\n const isLast = index >= path.length;\n name = !name && utils.isArray(target) ? target.length : name;\n\n if (isLast) {\n if (utils.hasOwnProp(target, name)) {\n target[name] = [target[name], value];\n } else {\n target[name] = value;\n }\n\n return !isNumericKey;\n }\n\n if (!target[name] || !utils.isObject(target[name])) {\n target[name] = [];\n }\n\n const result = buildPath(path, value, target[name], index);\n\n if (result && utils.isArray(target[name])) {\n target[name] = arrayToObject(target[name]);\n }\n\n return !isNumericKey;\n }\n\n if (utils.isFormData(formData) && utils.isFunction(formData.entries)) {\n const obj = {};\n\n utils.forEachEntry(formData, (name, value) => {\n buildPath(parsePropPath(name), value, obj, 0);\n });\n\n return obj;\n }\n\n return null;\n}\n\nexport default formDataToJSON;\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosError from '../core/AxiosError.js';\nimport transitionalDefaults from './transitional.js';\nimport toFormData from '../helpers/toFormData.js';\nimport toURLEncodedForm from '../helpers/toURLEncodedForm.js';\nimport platform from '../platform/index.js';\nimport formDataToJSON from '../helpers/formDataToJSON.js';\n\n/**\n * It takes a string, tries to parse it, and if it fails, it returns the stringified version\n * of the input\n *\n * @param {any} rawValue - The value to be stringified.\n * @param {Function} parser - A function that parses a string into a JavaScript object.\n * @param {Function} encoder - A function that takes a value and returns a string.\n *\n * @returns {string} A stringified version of the rawValue.\n */\nfunction stringifySafely(rawValue, parser, encoder) {\n if (utils.isString(rawValue)) {\n try {\n (parser || JSON.parse)(rawValue);\n return utils.trim(rawValue);\n } catch (e) {\n if (e.name !== 'SyntaxError') {\n throw e;\n }\n }\n }\n\n return (encoder || JSON.stringify)(rawValue);\n}\n\nconst defaults = {\n\n transitional: transitionalDefaults,\n\n adapter: ['xhr', 'http', 'fetch'],\n\n transformRequest: [function transformRequest(data, headers) {\n const contentType = headers.getContentType() || '';\n const hasJSONContentType = contentType.indexOf('application/json') > -1;\n const isObjectPayload = utils.isObject(data);\n\n if (isObjectPayload && utils.isHTMLForm(data)) {\n data = new FormData(data);\n }\n\n const isFormData = utils.isFormData(data);\n\n if (isFormData) {\n return hasJSONContentType ? JSON.stringify(formDataToJSON(data)) : data;\n }\n\n if (utils.isArrayBuffer(data) ||\n utils.isBuffer(data) ||\n utils.isStream(data) ||\n utils.isFile(data) ||\n utils.isBlob(data) ||\n utils.isReadableStream(data)\n ) {\n return data;\n }\n if (utils.isArrayBufferView(data)) {\n return data.buffer;\n }\n if (utils.isURLSearchParams(data)) {\n headers.setContentType('application/x-www-form-urlencoded;charset=utf-8', false);\n return data.toString();\n }\n\n let isFileList;\n\n if (isObjectPayload) {\n if (contentType.indexOf('application/x-www-form-urlencoded') > -1) {\n return toURLEncodedForm(data, this.formSerializer).toString();\n }\n\n if ((isFileList = utils.isFileList(data)) || contentType.indexOf('multipart/form-data') > -1) {\n const _FormData = this.env && this.env.FormData;\n\n return toFormData(\n isFileList ? {'files[]': data} : data,\n _FormData && new _FormData(),\n this.formSerializer\n );\n }\n }\n\n if (isObjectPayload || hasJSONContentType ) {\n headers.setContentType('application/json', false);\n return stringifySafely(data);\n }\n\n return data;\n }],\n\n transformResponse: [function transformResponse(data) {\n const transitional = this.transitional || defaults.transitional;\n const forcedJSONParsing = transitional && transitional.forcedJSONParsing;\n const JSONRequested = this.responseType === 'json';\n\n if (utils.isResponse(data) || utils.isReadableStream(data)) {\n return data;\n }\n\n if (data && utils.isString(data) && ((forcedJSONParsing && !this.responseType) || JSONRequested)) {\n const silentJSONParsing = transitional && transitional.silentJSONParsing;\n const strictJSONParsing = !silentJSONParsing && JSONRequested;\n\n try {\n return JSON.parse(data);\n } catch (e) {\n if (strictJSONParsing) {\n if (e.name === 'SyntaxError') {\n throw AxiosError.from(e, AxiosError.ERR_BAD_RESPONSE, this, null, this.response);\n }\n throw e;\n }\n }\n }\n\n return data;\n }],\n\n /**\n * A timeout in milliseconds to abort a request. If set to 0 (default) a\n * timeout is not created.\n */\n timeout: 0,\n\n xsrfCookieName: 'XSRF-TOKEN',\n xsrfHeaderName: 'X-XSRF-TOKEN',\n\n maxContentLength: -1,\n maxBodyLength: -1,\n\n env: {\n FormData: platform.classes.FormData,\n Blob: platform.classes.Blob\n },\n\n validateStatus: function validateStatus(status) {\n return status >= 200 && status < 300;\n },\n\n headers: {\n common: {\n 'Accept': 'application/json, text/plain, */*',\n 'Content-Type': undefined\n }\n }\n};\n\nutils.forEach(['delete', 'get', 'head', 'post', 'put', 'patch'], (method) => {\n defaults.headers[method] = {};\n});\n\nexport default defaults;\n","'use strict';\n\nimport utils from './../utils.js';\n\n// RawAxiosHeaders whose duplicates are ignored by node\n// c.f. https://nodejs.org/api/http.html#http_message_headers\nconst ignoreDuplicateOf = utils.toObjectSet([\n 'age', 'authorization', 'content-length', 'content-type', 'etag',\n 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since',\n 'last-modified', 'location', 'max-forwards', 'proxy-authorization',\n 'referer', 'retry-after', 'user-agent'\n]);\n\n/**\n * Parse headers into an object\n *\n * ```\n * Date: Wed, 27 Aug 2014 08:58:49 GMT\n * Content-Type: application/json\n * Connection: keep-alive\n * Transfer-Encoding: chunked\n * ```\n *\n * @param {String} rawHeaders Headers needing to be parsed\n *\n * @returns {Object} Headers parsed into an object\n */\nexport default rawHeaders => {\n const parsed = {};\n let key;\n let val;\n let i;\n\n rawHeaders && rawHeaders.split('\\n').forEach(function parser(line) {\n i = line.indexOf(':');\n key = line.substring(0, i).trim().toLowerCase();\n val = line.substring(i + 1).trim();\n\n if (!key || (parsed[key] && ignoreDuplicateOf[key])) {\n return;\n }\n\n if (key === 'set-cookie') {\n if (parsed[key]) {\n parsed[key].push(val);\n } else {\n parsed[key] = [val];\n }\n } else {\n parsed[key] = parsed[key] ? parsed[key] + ', ' + val : val;\n }\n });\n\n return parsed;\n};\n","'use strict';\n\nimport utils from '../utils.js';\nimport parseHeaders from '../helpers/parseHeaders.js';\n\nconst $internals = Symbol('internals');\n\nfunction normalizeHeader(header) {\n return header && String(header).trim().toLowerCase();\n}\n\nfunction normalizeValue(value) {\n if (value === false || value == null) {\n return value;\n }\n\n return utils.isArray(value) ? value.map(normalizeValue) : String(value);\n}\n\nfunction parseTokens(str) {\n const tokens = Object.create(null);\n const tokensRE = /([^\\s,;=]+)\\s*(?:=\\s*([^,;]+))?/g;\n let match;\n\n while ((match = tokensRE.exec(str))) {\n tokens[match[1]] = match[2];\n }\n\n return tokens;\n}\n\nconst isValidHeaderName = (str) => /^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(str.trim());\n\nfunction matchHeaderValue(context, value, header, filter, isHeaderNameFilter) {\n if (utils.isFunction(filter)) {\n return filter.call(this, value, header);\n }\n\n if (isHeaderNameFilter) {\n value = header;\n }\n\n if (!utils.isString(value)) return;\n\n if (utils.isString(filter)) {\n return value.indexOf(filter) !== -1;\n }\n\n if (utils.isRegExp(filter)) {\n return filter.test(value);\n }\n}\n\nfunction formatHeader(header) {\n return header.trim()\n .toLowerCase().replace(/([a-z\\d])(\\w*)/g, (w, char, str) => {\n return char.toUpperCase() + str;\n });\n}\n\nfunction buildAccessors(obj, header) {\n const accessorName = utils.toCamelCase(' ' + header);\n\n ['get', 'set', 'has'].forEach(methodName => {\n Object.defineProperty(obj, methodName + accessorName, {\n value: function(arg1, arg2, arg3) {\n return this[methodName].call(this, header, arg1, arg2, arg3);\n },\n configurable: true\n });\n });\n}\n\nclass AxiosHeaders {\n constructor(headers) {\n headers && this.set(headers);\n }\n\n set(header, valueOrRewrite, rewrite) {\n const self = this;\n\n function setHeader(_value, _header, _rewrite) {\n const lHeader = normalizeHeader(_header);\n\n if (!lHeader) {\n throw new Error('header name must be a non-empty string');\n }\n\n const key = utils.findKey(self, lHeader);\n\n if(!key || self[key] === undefined || _rewrite === true || (_rewrite === undefined && self[key] !== false)) {\n self[key || _header] = normalizeValue(_value);\n }\n }\n\n const setHeaders = (headers, _rewrite) =>\n utils.forEach(headers, (_value, _header) => setHeader(_value, _header, _rewrite));\n\n if (utils.isPlainObject(header) || header instanceof this.constructor) {\n setHeaders(header, valueOrRewrite)\n } else if(utils.isString(header) && (header = header.trim()) && !isValidHeaderName(header)) {\n setHeaders(parseHeaders(header), valueOrRewrite);\n } else if (utils.isHeaders(header)) {\n for (const [key, value] of header.entries()) {\n setHeader(value, key, rewrite);\n }\n } else {\n header != null && setHeader(valueOrRewrite, header, rewrite);\n }\n\n return this;\n }\n\n get(header, parser) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n if (key) {\n const value = this[key];\n\n if (!parser) {\n return value;\n }\n\n if (parser === true) {\n return parseTokens(value);\n }\n\n if (utils.isFunction(parser)) {\n return parser.call(this, value, key);\n }\n\n if (utils.isRegExp(parser)) {\n return parser.exec(value);\n }\n\n throw new TypeError('parser must be boolean|regexp|function');\n }\n }\n }\n\n has(header, matcher) {\n header = normalizeHeader(header);\n\n if (header) {\n const key = utils.findKey(this, header);\n\n return !!(key && this[key] !== undefined && (!matcher || matchHeaderValue(this, this[key], key, matcher)));\n }\n\n return false;\n }\n\n delete(header, matcher) {\n const self = this;\n let deleted = false;\n\n function deleteHeader(_header) {\n _header = normalizeHeader(_header);\n\n if (_header) {\n const key = utils.findKey(self, _header);\n\n if (key && (!matcher || matchHeaderValue(self, self[key], key, matcher))) {\n delete self[key];\n\n deleted = true;\n }\n }\n }\n\n if (utils.isArray(header)) {\n header.forEach(deleteHeader);\n } else {\n deleteHeader(header);\n }\n\n return deleted;\n }\n\n clear(matcher) {\n const keys = Object.keys(this);\n let i = keys.length;\n let deleted = false;\n\n while (i--) {\n const key = keys[i];\n if(!matcher || matchHeaderValue(this, this[key], key, matcher, true)) {\n delete this[key];\n deleted = true;\n }\n }\n\n return deleted;\n }\n\n normalize(format) {\n const self = this;\n const headers = {};\n\n utils.forEach(this, (value, header) => {\n const key = utils.findKey(headers, header);\n\n if (key) {\n self[key] = normalizeValue(value);\n delete self[header];\n return;\n }\n\n const normalized = format ? formatHeader(header) : String(header).trim();\n\n if (normalized !== header) {\n delete self[header];\n }\n\n self[normalized] = normalizeValue(value);\n\n headers[normalized] = true;\n });\n\n return this;\n }\n\n concat(...targets) {\n return this.constructor.concat(this, ...targets);\n }\n\n toJSON(asStrings) {\n const obj = Object.create(null);\n\n utils.forEach(this, (value, header) => {\n value != null && value !== false && (obj[header] = asStrings && utils.isArray(value) ? value.join(', ') : value);\n });\n\n return obj;\n }\n\n [Symbol.iterator]() {\n return Object.entries(this.toJSON())[Symbol.iterator]();\n }\n\n toString() {\n return Object.entries(this.toJSON()).map(([header, value]) => header + ': ' + value).join('\\n');\n }\n\n get [Symbol.toStringTag]() {\n return 'AxiosHeaders';\n }\n\n static from(thing) {\n return thing instanceof this ? thing : new this(thing);\n }\n\n static concat(first, ...targets) {\n const computed = new this(first);\n\n targets.forEach((target) => computed.set(target));\n\n return computed;\n }\n\n static accessor(header) {\n const internals = this[$internals] = (this[$internals] = {\n accessors: {}\n });\n\n const accessors = internals.accessors;\n const prototype = this.prototype;\n\n function defineAccessor(_header) {\n const lHeader = normalizeHeader(_header);\n\n if (!accessors[lHeader]) {\n buildAccessors(prototype, _header);\n accessors[lHeader] = true;\n }\n }\n\n utils.isArray(header) ? header.forEach(defineAccessor) : defineAccessor(header);\n\n return this;\n }\n}\n\nAxiosHeaders.accessor(['Content-Type', 'Content-Length', 'Accept', 'Accept-Encoding', 'User-Agent', 'Authorization']);\n\n// reserved names hotfix\nutils.reduceDescriptors(AxiosHeaders.prototype, ({value}, key) => {\n let mapped = key[0].toUpperCase() + key.slice(1); // map `set` => `Set`\n return {\n get: () => value,\n set(headerValue) {\n this[mapped] = headerValue;\n }\n }\n});\n\nutils.freezeMethods(AxiosHeaders);\n\nexport default AxiosHeaders;\n","'use strict';\n\nimport utils from './../utils.js';\nimport defaults from '../defaults/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\n\n/**\n * Transform the data for a request or a response\n *\n * @param {Array|Function} fns A single function or Array of functions\n * @param {?Object} response The response object\n *\n * @returns {*} The resulting transformed data\n */\nexport default function transformData(fns, response) {\n const config = this || defaults;\n const context = response || config;\n const headers = AxiosHeaders.from(context.headers);\n let data = context.data;\n\n utils.forEach(fns, function transform(fn) {\n data = fn.call(config, data, headers.normalize(), response ? response.status : undefined);\n });\n\n headers.normalize();\n\n return data;\n}\n","'use strict';\n\nexport default function isCancel(value) {\n return !!(value && value.__CANCEL__);\n}\n","'use strict';\n\nimport AxiosError from '../core/AxiosError.js';\nimport utils from '../utils.js';\n\n/**\n * A `CanceledError` is an object that is thrown when an operation is canceled.\n *\n * @param {string=} message The message.\n * @param {Object=} config The config.\n * @param {Object=} request The request.\n *\n * @returns {CanceledError} The created error.\n */\nfunction CanceledError(message, config, request) {\n // eslint-disable-next-line no-eq-null,eqeqeq\n AxiosError.call(this, message == null ? 'canceled' : message, AxiosError.ERR_CANCELED, config, request);\n this.name = 'CanceledError';\n}\n\nutils.inherits(CanceledError, AxiosError, {\n __CANCEL__: true\n});\n\nexport default CanceledError;\n","'use strict';\n\nimport AxiosError from './AxiosError.js';\n\n/**\n * Resolve or reject a Promise based on response status.\n *\n * @param {Function} resolve A function that resolves the promise.\n * @param {Function} reject A function that rejects the promise.\n * @param {object} response The response.\n *\n * @returns {object} The response.\n */\nexport default function settle(resolve, reject, response) {\n const validateStatus = response.config.validateStatus;\n if (!response.status || !validateStatus || validateStatus(response.status)) {\n resolve(response);\n } else {\n reject(new AxiosError(\n 'Request failed with status code ' + response.status,\n [AxiosError.ERR_BAD_REQUEST, AxiosError.ERR_BAD_RESPONSE][Math.floor(response.status / 100) - 4],\n response.config,\n response.request,\n response\n ));\n }\n}\n","'use strict';\n\nexport default function parseProtocol(url) {\n const match = /^([-+\\w]{1,25})(:?\\/\\/|:)/.exec(url);\n return match && match[1] || '';\n}\n","'use strict';\n\n/**\n * Calculate data maxRate\n * @param {Number} [samplesCount= 10]\n * @param {Number} [min= 1000]\n * @returns {Function}\n */\nfunction speedometer(samplesCount, min) {\n samplesCount = samplesCount || 10;\n const bytes = new Array(samplesCount);\n const timestamps = new Array(samplesCount);\n let head = 0;\n let tail = 0;\n let firstSampleTS;\n\n min = min !== undefined ? min : 1000;\n\n return function push(chunkLength) {\n const now = Date.now();\n\n const startedAt = timestamps[tail];\n\n if (!firstSampleTS) {\n firstSampleTS = now;\n }\n\n bytes[head] = chunkLength;\n timestamps[head] = now;\n\n let i = tail;\n let bytesCount = 0;\n\n while (i !== head) {\n bytesCount += bytes[i++];\n i = i % samplesCount;\n }\n\n head = (head + 1) % samplesCount;\n\n if (head === tail) {\n tail = (tail + 1) % samplesCount;\n }\n\n if (now - firstSampleTS < min) {\n return;\n }\n\n const passed = startedAt && now - startedAt;\n\n return passed ? Math.round(bytesCount * 1000 / passed) : undefined;\n };\n}\n\nexport default speedometer;\n","/**\n * Throttle decorator\n * @param {Function} fn\n * @param {Number} freq\n * @return {Function}\n */\nfunction throttle(fn, freq) {\n let timestamp = 0;\n let threshold = 1000 / freq;\n let lastArgs;\n let timer;\n\n const invoke = (args, now = Date.now()) => {\n timestamp = now;\n lastArgs = null;\n if (timer) {\n clearTimeout(timer);\n timer = null;\n }\n fn.apply(null, args);\n }\n\n const throttled = (...args) => {\n const now = Date.now();\n const passed = now - timestamp;\n if ( passed >= threshold) {\n invoke(args, now);\n } else {\n lastArgs = args;\n if (!timer) {\n timer = setTimeout(() => {\n timer = null;\n invoke(lastArgs)\n }, threshold - passed);\n }\n }\n }\n\n const flush = () => lastArgs && invoke(lastArgs);\n\n return [throttled, flush];\n}\n\nexport default throttle;\n","import speedometer from \"./speedometer.js\";\nimport throttle from \"./throttle.js\";\nimport utils from \"../utils.js\";\n\nexport const progressEventReducer = (listener, isDownloadStream, freq = 3) => {\n let bytesNotified = 0;\n const _speedometer = speedometer(50, 250);\n\n return throttle(e => {\n const loaded = e.loaded;\n const total = e.lengthComputable ? e.total : undefined;\n const progressBytes = loaded - bytesNotified;\n const rate = _speedometer(progressBytes);\n const inRange = loaded <= total;\n\n bytesNotified = loaded;\n\n const data = {\n loaded,\n total,\n progress: total ? (loaded / total) : undefined,\n bytes: progressBytes,\n rate: rate ? rate : undefined,\n estimated: rate && total && inRange ? (total - loaded) / rate : undefined,\n event: e,\n lengthComputable: total != null,\n [isDownloadStream ? 'download' : 'upload']: true\n };\n\n listener(data);\n }, freq);\n}\n\nexport const progressEventDecorator = (total, throttled) => {\n const lengthComputable = total != null;\n\n return [(loaded) => throttled[0]({\n lengthComputable,\n total,\n loaded\n }), throttled[1]];\n}\n\nexport const asyncDecorator = (fn) => (...args) => utils.asap(() => fn(...args));\n","import platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ? ((origin, isMSIE) => (url) => {\n url = new URL(url, platform.origin);\n\n return (\n origin.protocol === url.protocol &&\n origin.host === url.host &&\n (isMSIE || origin.port === url.port)\n );\n})(\n new URL(platform.origin),\n platform.navigator && /(msie|trident)/i.test(platform.navigator.userAgent)\n) : () => true;\n","import utils from './../utils.js';\nimport platform from '../platform/index.js';\n\nexport default platform.hasStandardBrowserEnv ?\n\n // Standard browser envs support document.cookie\n {\n write(name, value, expires, path, domain, secure) {\n const cookie = [name + '=' + encodeURIComponent(value)];\n\n utils.isNumber(expires) && cookie.push('expires=' + new Date(expires).toGMTString());\n\n utils.isString(path) && cookie.push('path=' + path);\n\n utils.isString(domain) && cookie.push('domain=' + domain);\n\n secure === true && cookie.push('secure');\n\n document.cookie = cookie.join('; ');\n },\n\n read(name) {\n const match = document.cookie.match(new RegExp('(^|;\\\\s*)(' + name + ')=([^;]*)'));\n return (match ? decodeURIComponent(match[3]) : null);\n },\n\n remove(name) {\n this.write(name, '', Date.now() - 86400000);\n }\n }\n\n :\n\n // Non-standard browser env (web workers, react-native) lack needed support.\n {\n write() {},\n read() {\n return null;\n },\n remove() {}\n };\n\n","'use strict';\n\n/**\n * Determines whether the specified URL is absolute\n *\n * @param {string} url The URL to test\n *\n * @returns {boolean} True if the specified URL is absolute, otherwise false\n */\nexport default function isAbsoluteURL(url) {\n // A URL is considered absolute if it begins with \"://\" or \"//\" (protocol-relative URL).\n // RFC 3986 defines scheme name as a sequence of characters beginning with a letter and followed\n // by any combination of letters, digits, plus, period, or hyphen.\n return /^([a-z][a-z\\d+\\-.]*:)?\\/\\//i.test(url);\n}\n","'use strict';\n\n/**\n * Creates a new URL by combining the specified URLs\n *\n * @param {string} baseURL The base URL\n * @param {string} relativeURL The relative URL\n *\n * @returns {string} The combined URL\n */\nexport default function combineURLs(baseURL, relativeURL) {\n return relativeURL\n ? baseURL.replace(/\\/?\\/$/, '') + '/' + relativeURL.replace(/^\\/+/, '')\n : baseURL;\n}\n","'use strict';\n\nimport isAbsoluteURL from '../helpers/isAbsoluteURL.js';\nimport combineURLs from '../helpers/combineURLs.js';\n\n/**\n * Creates a new URL by combining the baseURL with the requestedURL,\n * only when the requestedURL is not already an absolute URL.\n * If the requestURL is absolute, this function returns the requestedURL untouched.\n *\n * @param {string} baseURL The base URL\n * @param {string} requestedURL Absolute or relative URL to combine\n *\n * @returns {string} The combined full path\n */\nexport default function buildFullPath(baseURL, requestedURL) {\n if (baseURL && !isAbsoluteURL(requestedURL)) {\n return combineURLs(baseURL, requestedURL);\n }\n return requestedURL;\n}\n","'use strict';\n\nimport utils from '../utils.js';\nimport AxiosHeaders from \"./AxiosHeaders.js\";\n\nconst headersToObject = (thing) => thing instanceof AxiosHeaders ? { ...thing } : thing;\n\n/**\n * Config-specific merge-function which creates a new config-object\n * by merging two configuration objects together.\n *\n * @param {Object} config1\n * @param {Object} config2\n *\n * @returns {Object} New object resulting from merging config2 to config1\n */\nexport default function mergeConfig(config1, config2) {\n // eslint-disable-next-line no-param-reassign\n config2 = config2 || {};\n const config = {};\n\n function getMergedValue(target, source, prop, caseless) {\n if (utils.isPlainObject(target) && utils.isPlainObject(source)) {\n return utils.merge.call({caseless}, target, source);\n } else if (utils.isPlainObject(source)) {\n return utils.merge({}, source);\n } else if (utils.isArray(source)) {\n return source.slice();\n }\n return source;\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDeepProperties(a, b, prop , caseless) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(a, b, prop , caseless);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a, prop , caseless);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function valueFromConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function defaultToConfig2(a, b) {\n if (!utils.isUndefined(b)) {\n return getMergedValue(undefined, b);\n } else if (!utils.isUndefined(a)) {\n return getMergedValue(undefined, a);\n }\n }\n\n // eslint-disable-next-line consistent-return\n function mergeDirectKeys(a, b, prop) {\n if (prop in config2) {\n return getMergedValue(a, b);\n } else if (prop in config1) {\n return getMergedValue(undefined, a);\n }\n }\n\n const mergeMap = {\n url: valueFromConfig2,\n method: valueFromConfig2,\n data: valueFromConfig2,\n baseURL: defaultToConfig2,\n transformRequest: defaultToConfig2,\n transformResponse: defaultToConfig2,\n paramsSerializer: defaultToConfig2,\n timeout: defaultToConfig2,\n timeoutMessage: defaultToConfig2,\n withCredentials: defaultToConfig2,\n withXSRFToken: defaultToConfig2,\n adapter: defaultToConfig2,\n responseType: defaultToConfig2,\n xsrfCookieName: defaultToConfig2,\n xsrfHeaderName: defaultToConfig2,\n onUploadProgress: defaultToConfig2,\n onDownloadProgress: defaultToConfig2,\n decompress: defaultToConfig2,\n maxContentLength: defaultToConfig2,\n maxBodyLength: defaultToConfig2,\n beforeRedirect: defaultToConfig2,\n transport: defaultToConfig2,\n httpAgent: defaultToConfig2,\n httpsAgent: defaultToConfig2,\n cancelToken: defaultToConfig2,\n socketPath: defaultToConfig2,\n responseEncoding: defaultToConfig2,\n validateStatus: mergeDirectKeys,\n headers: (a, b , prop) => mergeDeepProperties(headersToObject(a), headersToObject(b),prop, true)\n };\n\n utils.forEach(Object.keys(Object.assign({}, config1, config2)), function computeConfigValue(prop) {\n const merge = mergeMap[prop] || mergeDeepProperties;\n const configValue = merge(config1[prop], config2[prop], prop);\n (utils.isUndefined(configValue) && merge !== mergeDirectKeys) || (config[prop] = configValue);\n });\n\n return config;\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport isURLSameOrigin from \"./isURLSameOrigin.js\";\nimport cookies from \"./cookies.js\";\nimport buildFullPath from \"../core/buildFullPath.js\";\nimport mergeConfig from \"../core/mergeConfig.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport buildURL from \"./buildURL.js\";\n\nexport default (config) => {\n const newConfig = mergeConfig({}, config);\n\n let {data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers, auth} = newConfig;\n\n newConfig.headers = headers = AxiosHeaders.from(headers);\n\n newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);\n\n // HTTP basic authentication\n if (auth) {\n headers.set('Authorization', 'Basic ' +\n btoa((auth.username || '') + ':' + (auth.password ? unescape(encodeURIComponent(auth.password)) : ''))\n );\n }\n\n let contentType;\n\n if (utils.isFormData(data)) {\n if (platform.hasStandardBrowserEnv || platform.hasStandardBrowserWebWorkerEnv) {\n headers.setContentType(undefined); // Let the browser set it\n } else if ((contentType = headers.getContentType()) !== false) {\n // fix semicolon duplication issue for ReactNative FormData implementation\n const [type, ...tokens] = contentType ? contentType.split(';').map(token => token.trim()).filter(Boolean) : [];\n headers.setContentType([type || 'multipart/form-data', ...tokens].join('; '));\n }\n }\n\n // Add xsrf header\n // This is only done if running in a standard browser environment.\n // Specifically not if we're in a web worker, or react-native.\n\n if (platform.hasStandardBrowserEnv) {\n withXSRFToken && utils.isFunction(withXSRFToken) && (withXSRFToken = withXSRFToken(newConfig));\n\n if (withXSRFToken || (withXSRFToken !== false && isURLSameOrigin(newConfig.url))) {\n // Add xsrf header\n const xsrfValue = xsrfHeaderName && xsrfCookieName && cookies.read(xsrfCookieName);\n\n if (xsrfValue) {\n headers.set(xsrfHeaderName, xsrfValue);\n }\n }\n }\n\n return newConfig;\n}\n\n","import utils from './../utils.js';\nimport settle from './../core/settle.js';\nimport transitionalDefaults from '../defaults/transitional.js';\nimport AxiosError from '../core/AxiosError.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport parseProtocol from '../helpers/parseProtocol.js';\nimport platform from '../platform/index.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport {progressEventReducer} from '../helpers/progressEventReducer.js';\nimport resolveConfig from \"../helpers/resolveConfig.js\";\n\nconst isXHRAdapterSupported = typeof XMLHttpRequest !== 'undefined';\n\nexport default isXHRAdapterSupported && function (config) {\n return new Promise(function dispatchXhrRequest(resolve, reject) {\n const _config = resolveConfig(config);\n let requestData = _config.data;\n const requestHeaders = AxiosHeaders.from(_config.headers).normalize();\n let {responseType, onUploadProgress, onDownloadProgress} = _config;\n let onCanceled;\n let uploadThrottled, downloadThrottled;\n let flushUpload, flushDownload;\n\n function done() {\n flushUpload && flushUpload(); // flush events\n flushDownload && flushDownload(); // flush events\n\n _config.cancelToken && _config.cancelToken.unsubscribe(onCanceled);\n\n _config.signal && _config.signal.removeEventListener('abort', onCanceled);\n }\n\n let request = new XMLHttpRequest();\n\n request.open(_config.method.toUpperCase(), _config.url, true);\n\n // Set the request timeout in MS\n request.timeout = _config.timeout;\n\n function onloadend() {\n if (!request) {\n return;\n }\n // Prepare the response\n const responseHeaders = AxiosHeaders.from(\n 'getAllResponseHeaders' in request && request.getAllResponseHeaders()\n );\n const responseData = !responseType || responseType === 'text' || responseType === 'json' ?\n request.responseText : request.response;\n const response = {\n data: responseData,\n status: request.status,\n statusText: request.statusText,\n headers: responseHeaders,\n config,\n request\n };\n\n settle(function _resolve(value) {\n resolve(value);\n done();\n }, function _reject(err) {\n reject(err);\n done();\n }, response);\n\n // Clean up request\n request = null;\n }\n\n if ('onloadend' in request) {\n // Use onloadend if available\n request.onloadend = onloadend;\n } else {\n // Listen for ready state to emulate onloadend\n request.onreadystatechange = function handleLoad() {\n if (!request || request.readyState !== 4) {\n return;\n }\n\n // The request errored out and we didn't get a response, this will be\n // handled by onerror instead\n // With one exception: request that using file: protocol, most browsers\n // will return status as 0 even though it's a successful request\n if (request.status === 0 && !(request.responseURL && request.responseURL.indexOf('file:') === 0)) {\n return;\n }\n // readystate handler is calling before onerror or ontimeout handlers,\n // so we should call onloadend on the next 'tick'\n setTimeout(onloadend);\n };\n }\n\n // Handle browser request cancellation (as opposed to a manual cancellation)\n request.onabort = function handleAbort() {\n if (!request) {\n return;\n }\n\n reject(new AxiosError('Request aborted', AxiosError.ECONNABORTED, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle low level network errors\n request.onerror = function handleError() {\n // Real errors are hidden from us by the browser\n // onerror should only fire if it's a network error\n reject(new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request));\n\n // Clean up request\n request = null;\n };\n\n // Handle timeout\n request.ontimeout = function handleTimeout() {\n let timeoutErrorMessage = _config.timeout ? 'timeout of ' + _config.timeout + 'ms exceeded' : 'timeout exceeded';\n const transitional = _config.transitional || transitionalDefaults;\n if (_config.timeoutErrorMessage) {\n timeoutErrorMessage = _config.timeoutErrorMessage;\n }\n reject(new AxiosError(\n timeoutErrorMessage,\n transitional.clarifyTimeoutError ? AxiosError.ETIMEDOUT : AxiosError.ECONNABORTED,\n config,\n request));\n\n // Clean up request\n request = null;\n };\n\n // Remove Content-Type if data is undefined\n requestData === undefined && requestHeaders.setContentType(null);\n\n // Add headers to the request\n if ('setRequestHeader' in request) {\n utils.forEach(requestHeaders.toJSON(), function setRequestHeader(val, key) {\n request.setRequestHeader(key, val);\n });\n }\n\n // Add withCredentials to request if needed\n if (!utils.isUndefined(_config.withCredentials)) {\n request.withCredentials = !!_config.withCredentials;\n }\n\n // Add responseType to request if needed\n if (responseType && responseType !== 'json') {\n request.responseType = _config.responseType;\n }\n\n // Handle progress if needed\n if (onDownloadProgress) {\n ([downloadThrottled, flushDownload] = progressEventReducer(onDownloadProgress, true));\n request.addEventListener('progress', downloadThrottled);\n }\n\n // Not all browsers support upload events\n if (onUploadProgress && request.upload) {\n ([uploadThrottled, flushUpload] = progressEventReducer(onUploadProgress));\n\n request.upload.addEventListener('progress', uploadThrottled);\n\n request.upload.addEventListener('loadend', flushUpload);\n }\n\n if (_config.cancelToken || _config.signal) {\n // Handle cancellation\n // eslint-disable-next-line func-names\n onCanceled = cancel => {\n if (!request) {\n return;\n }\n reject(!cancel || cancel.type ? new CanceledError(null, config, request) : cancel);\n request.abort();\n request = null;\n };\n\n _config.cancelToken && _config.cancelToken.subscribe(onCanceled);\n if (_config.signal) {\n _config.signal.aborted ? onCanceled() : _config.signal.addEventListener('abort', onCanceled);\n }\n }\n\n const protocol = parseProtocol(_config.url);\n\n if (protocol && platform.protocols.indexOf(protocol) === -1) {\n reject(new AxiosError('Unsupported protocol ' + protocol + ':', AxiosError.ERR_BAD_REQUEST, config));\n return;\n }\n\n\n // Send the request\n request.send(requestData || null);\n });\n}\n","import CanceledError from \"../cancel/CanceledError.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport utils from '../utils.js';\n\nconst composeSignals = (signals, timeout) => {\n const {length} = (signals = signals ? signals.filter(Boolean) : []);\n\n if (timeout || length) {\n let controller = new AbortController();\n\n let aborted;\n\n const onabort = function (reason) {\n if (!aborted) {\n aborted = true;\n unsubscribe();\n const err = reason instanceof Error ? reason : this.reason;\n controller.abort(err instanceof AxiosError ? err : new CanceledError(err instanceof Error ? err.message : err));\n }\n }\n\n let timer = timeout && setTimeout(() => {\n timer = null;\n onabort(new AxiosError(`timeout ${timeout} of ms exceeded`, AxiosError.ETIMEDOUT))\n }, timeout)\n\n const unsubscribe = () => {\n if (signals) {\n timer && clearTimeout(timer);\n timer = null;\n signals.forEach(signal => {\n signal.unsubscribe ? signal.unsubscribe(onabort) : signal.removeEventListener('abort', onabort);\n });\n signals = null;\n }\n }\n\n signals.forEach((signal) => signal.addEventListener('abort', onabort));\n\n const {signal} = controller;\n\n signal.unsubscribe = () => utils.asap(unsubscribe);\n\n return signal;\n }\n}\n\nexport default composeSignals;\n","\nexport const streamChunk = function* (chunk, chunkSize) {\n let len = chunk.byteLength;\n\n if (!chunkSize || len < chunkSize) {\n yield chunk;\n return;\n }\n\n let pos = 0;\n let end;\n\n while (pos < len) {\n end = pos + chunkSize;\n yield chunk.slice(pos, end);\n pos = end;\n }\n}\n\nexport const readBytes = async function* (iterable, chunkSize) {\n for await (const chunk of readStream(iterable)) {\n yield* streamChunk(chunk, chunkSize);\n }\n}\n\nconst readStream = async function* (stream) {\n if (stream[Symbol.asyncIterator]) {\n yield* stream;\n return;\n }\n\n const reader = stream.getReader();\n try {\n for (;;) {\n const {done, value} = await reader.read();\n if (done) {\n break;\n }\n yield value;\n }\n } finally {\n await reader.cancel();\n }\n}\n\nexport const trackStream = (stream, chunkSize, onProgress, onFinish) => {\n const iterator = readBytes(stream, chunkSize);\n\n let bytes = 0;\n let done;\n let _onFinish = (e) => {\n if (!done) {\n done = true;\n onFinish && onFinish(e);\n }\n }\n\n return new ReadableStream({\n async pull(controller) {\n try {\n const {done, value} = await iterator.next();\n\n if (done) {\n _onFinish();\n controller.close();\n return;\n }\n\n let len = value.byteLength;\n if (onProgress) {\n let loadedBytes = bytes += len;\n onProgress(loadedBytes);\n }\n controller.enqueue(new Uint8Array(value));\n } catch (err) {\n _onFinish(err);\n throw err;\n }\n },\n cancel(reason) {\n _onFinish(reason);\n return iterator.return();\n }\n }, {\n highWaterMark: 2\n })\n}\n","import platform from \"../platform/index.js\";\nimport utils from \"../utils.js\";\nimport AxiosError from \"../core/AxiosError.js\";\nimport composeSignals from \"../helpers/composeSignals.js\";\nimport {trackStream} from \"../helpers/trackStream.js\";\nimport AxiosHeaders from \"../core/AxiosHeaders.js\";\nimport {progressEventReducer, progressEventDecorator, asyncDecorator} from \"../helpers/progressEventReducer.js\";\nimport resolveConfig from \"../helpers/resolveConfig.js\";\nimport settle from \"../core/settle.js\";\n\nconst isFetchSupported = typeof fetch === 'function' && typeof Request === 'function' && typeof Response === 'function';\nconst isReadableStreamSupported = isFetchSupported && typeof ReadableStream === 'function';\n\n// used only inside the fetch adapter\nconst encodeText = isFetchSupported && (typeof TextEncoder === 'function' ?\n ((encoder) => (str) => encoder.encode(str))(new TextEncoder()) :\n async (str) => new Uint8Array(await new Response(str).arrayBuffer())\n);\n\nconst test = (fn, ...args) => {\n try {\n return !!fn(...args);\n } catch (e) {\n return false\n }\n}\n\nconst supportsRequestStream = isReadableStreamSupported && test(() => {\n let duplexAccessed = false;\n\n const hasContentType = new Request(platform.origin, {\n body: new ReadableStream(),\n method: 'POST',\n get duplex() {\n duplexAccessed = true;\n return 'half';\n },\n }).headers.has('Content-Type');\n\n return duplexAccessed && !hasContentType;\n});\n\nconst DEFAULT_CHUNK_SIZE = 64 * 1024;\n\nconst supportsResponseStream = isReadableStreamSupported &&\n test(() => utils.isReadableStream(new Response('').body));\n\n\nconst resolvers = {\n stream: supportsResponseStream && ((res) => res.body)\n};\n\nisFetchSupported && (((res) => {\n ['text', 'arrayBuffer', 'blob', 'formData', 'stream'].forEach(type => {\n !resolvers[type] && (resolvers[type] = utils.isFunction(res[type]) ? (res) => res[type]() :\n (_, config) => {\n throw new AxiosError(`Response type '${type}' is not supported`, AxiosError.ERR_NOT_SUPPORT, config);\n })\n });\n})(new Response));\n\nconst getBodyLength = async (body) => {\n if (body == null) {\n return 0;\n }\n\n if(utils.isBlob(body)) {\n return body.size;\n }\n\n if(utils.isSpecCompliantForm(body)) {\n const _request = new Request(platform.origin, {\n method: 'POST',\n body,\n });\n return (await _request.arrayBuffer()).byteLength;\n }\n\n if(utils.isArrayBufferView(body) || utils.isArrayBuffer(body)) {\n return body.byteLength;\n }\n\n if(utils.isURLSearchParams(body)) {\n body = body + '';\n }\n\n if(utils.isString(body)) {\n return (await encodeText(body)).byteLength;\n }\n}\n\nconst resolveBodyLength = async (headers, body) => {\n const length = utils.toFiniteNumber(headers.getContentLength());\n\n return length == null ? getBodyLength(body) : length;\n}\n\nexport default isFetchSupported && (async (config) => {\n let {\n url,\n method,\n data,\n signal,\n cancelToken,\n timeout,\n onDownloadProgress,\n onUploadProgress,\n responseType,\n headers,\n withCredentials = 'same-origin',\n fetchOptions\n } = resolveConfig(config);\n\n responseType = responseType ? (responseType + '').toLowerCase() : 'text';\n\n let composedSignal = composeSignals([signal, cancelToken && cancelToken.toAbortSignal()], timeout);\n\n let request;\n\n const unsubscribe = composedSignal && composedSignal.unsubscribe && (() => {\n composedSignal.unsubscribe();\n });\n\n let requestContentLength;\n\n try {\n if (\n onUploadProgress && supportsRequestStream && method !== 'get' && method !== 'head' &&\n (requestContentLength = await resolveBodyLength(headers, data)) !== 0\n ) {\n let _request = new Request(url, {\n method: 'POST',\n body: data,\n duplex: \"half\"\n });\n\n let contentTypeHeader;\n\n if (utils.isFormData(data) && (contentTypeHeader = _request.headers.get('content-type'))) {\n headers.setContentType(contentTypeHeader)\n }\n\n if (_request.body) {\n const [onProgress, flush] = progressEventDecorator(\n requestContentLength,\n progressEventReducer(asyncDecorator(onUploadProgress))\n );\n\n data = trackStream(_request.body, DEFAULT_CHUNK_SIZE, onProgress, flush);\n }\n }\n\n if (!utils.isString(withCredentials)) {\n withCredentials = withCredentials ? 'include' : 'omit';\n }\n\n // Cloudflare Workers throws when credentials are defined\n // see https://github.com/cloudflare/workerd/issues/902\n const isCredentialsSupported = \"credentials\" in Request.prototype;\n request = new Request(url, {\n ...fetchOptions,\n signal: composedSignal,\n method: method.toUpperCase(),\n headers: headers.normalize().toJSON(),\n body: data,\n duplex: \"half\",\n credentials: isCredentialsSupported ? withCredentials : undefined\n });\n\n let response = await fetch(request);\n\n const isStreamResponse = supportsResponseStream && (responseType === 'stream' || responseType === 'response');\n\n if (supportsResponseStream && (onDownloadProgress || (isStreamResponse && unsubscribe))) {\n const options = {};\n\n ['status', 'statusText', 'headers'].forEach(prop => {\n options[prop] = response[prop];\n });\n\n const responseContentLength = utils.toFiniteNumber(response.headers.get('content-length'));\n\n const [onProgress, flush] = onDownloadProgress && progressEventDecorator(\n responseContentLength,\n progressEventReducer(asyncDecorator(onDownloadProgress), true)\n ) || [];\n\n response = new Response(\n trackStream(response.body, DEFAULT_CHUNK_SIZE, onProgress, () => {\n flush && flush();\n unsubscribe && unsubscribe();\n }),\n options\n );\n }\n\n responseType = responseType || 'text';\n\n let responseData = await resolvers[utils.findKey(resolvers, responseType) || 'text'](response, config);\n\n !isStreamResponse && unsubscribe && unsubscribe();\n\n return await new Promise((resolve, reject) => {\n settle(resolve, reject, {\n data: responseData,\n headers: AxiosHeaders.from(response.headers),\n status: response.status,\n statusText: response.statusText,\n config,\n request\n })\n })\n } catch (err) {\n unsubscribe && unsubscribe();\n\n if (err && err.name === 'TypeError' && /fetch/i.test(err.message)) {\n throw Object.assign(\n new AxiosError('Network Error', AxiosError.ERR_NETWORK, config, request),\n {\n cause: err.cause || err\n }\n )\n }\n\n throw AxiosError.from(err, err && err.code, config, request);\n }\n});\n\n\n","import utils from '../utils.js';\nimport httpAdapter from './http.js';\nimport xhrAdapter from './xhr.js';\nimport fetchAdapter from './fetch.js';\nimport AxiosError from \"../core/AxiosError.js\";\n\nconst knownAdapters = {\n http: httpAdapter,\n xhr: xhrAdapter,\n fetch: fetchAdapter\n}\n\nutils.forEach(knownAdapters, (fn, value) => {\n if (fn) {\n try {\n Object.defineProperty(fn, 'name', {value});\n } catch (e) {\n // eslint-disable-next-line no-empty\n }\n Object.defineProperty(fn, 'adapterName', {value});\n }\n});\n\nconst renderReason = (reason) => `- ${reason}`;\n\nconst isResolvedHandle = (adapter) => utils.isFunction(adapter) || adapter === null || adapter === false;\n\nexport default {\n getAdapter: (adapters) => {\n adapters = utils.isArray(adapters) ? adapters : [adapters];\n\n const {length} = adapters;\n let nameOrAdapter;\n let adapter;\n\n const rejectedReasons = {};\n\n for (let i = 0; i < length; i++) {\n nameOrAdapter = adapters[i];\n let id;\n\n adapter = nameOrAdapter;\n\n if (!isResolvedHandle(nameOrAdapter)) {\n adapter = knownAdapters[(id = String(nameOrAdapter)).toLowerCase()];\n\n if (adapter === undefined) {\n throw new AxiosError(`Unknown adapter '${id}'`);\n }\n }\n\n if (adapter) {\n break;\n }\n\n rejectedReasons[id || '#' + i] = adapter;\n }\n\n if (!adapter) {\n\n const reasons = Object.entries(rejectedReasons)\n .map(([id, state]) => `adapter ${id} ` +\n (state === false ? 'is not supported by the environment' : 'is not available in the build')\n );\n\n let s = length ?\n (reasons.length > 1 ? 'since :\\n' + reasons.map(renderReason).join('\\n') : ' ' + renderReason(reasons[0])) :\n 'as no adapter specified';\n\n throw new AxiosError(\n `There is no suitable adapter to dispatch the request ` + s,\n 'ERR_NOT_SUPPORT'\n );\n }\n\n return adapter;\n },\n adapters: knownAdapters\n}\n","'use strict';\n\nimport transformData from './transformData.js';\nimport isCancel from '../cancel/isCancel.js';\nimport defaults from '../defaults/index.js';\nimport CanceledError from '../cancel/CanceledError.js';\nimport AxiosHeaders from '../core/AxiosHeaders.js';\nimport adapters from \"../adapters/adapters.js\";\n\n/**\n * Throws a `CanceledError` if cancellation has been requested.\n *\n * @param {Object} config The config that is to be used for the request\n *\n * @returns {void}\n */\nfunction throwIfCancellationRequested(config) {\n if (config.cancelToken) {\n config.cancelToken.throwIfRequested();\n }\n\n if (config.signal && config.signal.aborted) {\n throw new CanceledError(null, config);\n }\n}\n\n/**\n * Dispatch a request to the server using the configured adapter.\n *\n * @param {object} config The config that is to be used for the request\n *\n * @returns {Promise} The Promise to be fulfilled\n */\nexport default function dispatchRequest(config) {\n throwIfCancellationRequested(config);\n\n config.headers = AxiosHeaders.from(config.headers);\n\n // Transform request data\n config.data = transformData.call(\n config,\n config.transformRequest\n );\n\n if (['post', 'put', 'patch'].indexOf(config.method) !== -1) {\n config.headers.setContentType('application/x-www-form-urlencoded', false);\n }\n\n const adapter = adapters.getAdapter(config.adapter || defaults.adapter);\n\n return adapter(config).then(function onAdapterResolution(response) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n response.data = transformData.call(\n config,\n config.transformResponse,\n response\n );\n\n response.headers = AxiosHeaders.from(response.headers);\n\n return response;\n }, function onAdapterRejection(reason) {\n if (!isCancel(reason)) {\n throwIfCancellationRequested(config);\n\n // Transform response data\n if (reason && reason.response) {\n reason.response.data = transformData.call(\n config,\n config.transformResponse,\n reason.response\n );\n reason.response.headers = AxiosHeaders.from(reason.response.headers);\n }\n }\n\n return Promise.reject(reason);\n });\n}\n","export const VERSION = \"1.7.8\";","'use strict';\n\nimport {VERSION} from '../env/data.js';\nimport AxiosError from '../core/AxiosError.js';\n\nconst validators = {};\n\n// eslint-disable-next-line func-names\n['object', 'boolean', 'number', 'function', 'string', 'symbol'].forEach((type, i) => {\n validators[type] = function validator(thing) {\n return typeof thing === type || 'a' + (i < 1 ? 'n ' : ' ') + type;\n };\n});\n\nconst deprecatedWarnings = {};\n\n/**\n * Transitional option validator\n *\n * @param {function|boolean?} validator - set to false if the transitional option has been removed\n * @param {string?} version - deprecated version / removed since version\n * @param {string?} message - some message with additional info\n *\n * @returns {function}\n */\nvalidators.transitional = function transitional(validator, version, message) {\n function formatMessage(opt, desc) {\n return '[Axios v' + VERSION + '] Transitional option \\'' + opt + '\\'' + desc + (message ? '. ' + message : '');\n }\n\n // eslint-disable-next-line func-names\n return (value, opt, opts) => {\n if (validator === false) {\n throw new AxiosError(\n formatMessage(opt, ' has been removed' + (version ? ' in ' + version : '')),\n AxiosError.ERR_DEPRECATED\n );\n }\n\n if (version && !deprecatedWarnings[opt]) {\n deprecatedWarnings[opt] = true;\n // eslint-disable-next-line no-console\n console.warn(\n formatMessage(\n opt,\n ' has been deprecated since v' + version + ' and will be removed in the near future'\n )\n );\n }\n\n return validator ? validator(value, opt, opts) : true;\n };\n};\n\nvalidators.spelling = function spelling(correctSpelling) {\n return (value, opt) => {\n // eslint-disable-next-line no-console\n console.warn(`${opt} is likely a misspelling of ${correctSpelling}`);\n return true;\n }\n};\n\n/**\n * Assert object's properties type\n *\n * @param {object} options\n * @param {object} schema\n * @param {boolean?} allowUnknown\n *\n * @returns {object}\n */\n\nfunction assertOptions(options, schema, allowUnknown) {\n if (typeof options !== 'object') {\n throw new AxiosError('options must be an object', AxiosError.ERR_BAD_OPTION_VALUE);\n }\n const keys = Object.keys(options);\n let i = keys.length;\n while (i-- > 0) {\n const opt = keys[i];\n const validator = schema[opt];\n if (validator) {\n const value = options[opt];\n const result = value === undefined || validator(value, opt, options);\n if (result !== true) {\n throw new AxiosError('option ' + opt + ' must be ' + result, AxiosError.ERR_BAD_OPTION_VALUE);\n }\n continue;\n }\n if (allowUnknown !== true) {\n throw new AxiosError('Unknown option ' + opt, AxiosError.ERR_BAD_OPTION);\n }\n }\n}\n\nexport default {\n assertOptions,\n validators\n};\n","'use strict';\n\nimport utils from './../utils.js';\nimport buildURL from '../helpers/buildURL.js';\nimport InterceptorManager from './InterceptorManager.js';\nimport dispatchRequest from './dispatchRequest.js';\nimport mergeConfig from './mergeConfig.js';\nimport buildFullPath from './buildFullPath.js';\nimport validator from '../helpers/validator.js';\nimport AxiosHeaders from './AxiosHeaders.js';\n\nconst validators = validator.validators;\n\n/**\n * Create a new instance of Axios\n *\n * @param {Object} instanceConfig The default config for the instance\n *\n * @return {Axios} A new instance of Axios\n */\nclass Axios {\n constructor(instanceConfig) {\n this.defaults = instanceConfig;\n this.interceptors = {\n request: new InterceptorManager(),\n response: new InterceptorManager()\n };\n }\n\n /**\n * Dispatch a request\n *\n * @param {String|Object} configOrUrl The config specific for this request (merged with this.defaults)\n * @param {?Object} config\n *\n * @returns {Promise} The Promise to be fulfilled\n */\n async request(configOrUrl, config) {\n try {\n return await this._request(configOrUrl, config);\n } catch (err) {\n if (err instanceof Error) {\n let dummy = {};\n\n Error.captureStackTrace ? Error.captureStackTrace(dummy) : (dummy = new Error());\n\n // slice off the Error: ... line\n const stack = dummy.stack ? dummy.stack.replace(/^.+\\n/, '') : '';\n try {\n if (!err.stack) {\n err.stack = stack;\n // match without the 2 top stack lines\n } else if (stack && !String(err.stack).endsWith(stack.replace(/^.+\\n.+\\n/, ''))) {\n err.stack += '\\n' + stack\n }\n } catch (e) {\n // ignore the case where \"stack\" is an un-writable property\n }\n }\n\n throw err;\n }\n }\n\n _request(configOrUrl, config) {\n /*eslint no-param-reassign:0*/\n // Allow for axios('example/url'[, config]) a la fetch API\n if (typeof configOrUrl === 'string') {\n config = config || {};\n config.url = configOrUrl;\n } else {\n config = configOrUrl || {};\n }\n\n config = mergeConfig(this.defaults, config);\n\n const {transitional, paramsSerializer, headers} = config;\n\n if (transitional !== undefined) {\n validator.assertOptions(transitional, {\n silentJSONParsing: validators.transitional(validators.boolean),\n forcedJSONParsing: validators.transitional(validators.boolean),\n clarifyTimeoutError: validators.transitional(validators.boolean)\n }, false);\n }\n\n if (paramsSerializer != null) {\n if (utils.isFunction(paramsSerializer)) {\n config.paramsSerializer = {\n serialize: paramsSerializer\n }\n } else {\n validator.assertOptions(paramsSerializer, {\n encode: validators.function,\n serialize: validators.function\n }, true);\n }\n }\n\n validator.assertOptions(config, {\n baseUrl: validators.spelling('baseURL'),\n withXsrfToken: validators.spelling('withXSRFToken')\n }, true);\n\n // Set config.method\n config.method = (config.method || this.defaults.method || 'get').toLowerCase();\n\n // Flatten headers\n let contextHeaders = headers && utils.merge(\n headers.common,\n headers[config.method]\n );\n\n headers && utils.forEach(\n ['delete', 'get', 'head', 'post', 'put', 'patch', 'common'],\n (method) => {\n delete headers[method];\n }\n );\n\n config.headers = AxiosHeaders.concat(contextHeaders, headers);\n\n // filter out skipped interceptors\n const requestInterceptorChain = [];\n let synchronousRequestInterceptors = true;\n this.interceptors.request.forEach(function unshiftRequestInterceptors(interceptor) {\n if (typeof interceptor.runWhen === 'function' && interceptor.runWhen(config) === false) {\n return;\n }\n\n synchronousRequestInterceptors = synchronousRequestInterceptors && interceptor.synchronous;\n\n requestInterceptorChain.unshift(interceptor.fulfilled, interceptor.rejected);\n });\n\n const responseInterceptorChain = [];\n this.interceptors.response.forEach(function pushResponseInterceptors(interceptor) {\n responseInterceptorChain.push(interceptor.fulfilled, interceptor.rejected);\n });\n\n let promise;\n let i = 0;\n let len;\n\n if (!synchronousRequestInterceptors) {\n const chain = [dispatchRequest.bind(this), undefined];\n chain.unshift.apply(chain, requestInterceptorChain);\n chain.push.apply(chain, responseInterceptorChain);\n len = chain.length;\n\n promise = Promise.resolve(config);\n\n while (i < len) {\n promise = promise.then(chain[i++], chain[i++]);\n }\n\n return promise;\n }\n\n len = requestInterceptorChain.length;\n\n let newConfig = config;\n\n i = 0;\n\n while (i < len) {\n const onFulfilled = requestInterceptorChain[i++];\n const onRejected = requestInterceptorChain[i++];\n try {\n newConfig = onFulfilled(newConfig);\n } catch (error) {\n onRejected.call(this, error);\n break;\n }\n }\n\n try {\n promise = dispatchRequest.call(this, newConfig);\n } catch (error) {\n return Promise.reject(error);\n }\n\n i = 0;\n len = responseInterceptorChain.length;\n\n while (i < len) {\n promise = promise.then(responseInterceptorChain[i++], responseInterceptorChain[i++]);\n }\n\n return promise;\n }\n\n getUri(config) {\n config = mergeConfig(this.defaults, config);\n const fullPath = buildFullPath(config.baseURL, config.url);\n return buildURL(fullPath, config.params, config.paramsSerializer);\n }\n}\n\n// Provide aliases for supported request methods\nutils.forEach(['delete', 'get', 'head', 'options'], function forEachMethodNoData(method) {\n /*eslint func-names:0*/\n Axios.prototype[method] = function(url, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n url,\n data: (config || {}).data\n }));\n };\n});\n\nutils.forEach(['post', 'put', 'patch'], function forEachMethodWithData(method) {\n /*eslint func-names:0*/\n\n function generateHTTPMethod(isForm) {\n return function httpMethod(url, data, config) {\n return this.request(mergeConfig(config || {}, {\n method,\n headers: isForm ? {\n 'Content-Type': 'multipart/form-data'\n } : {},\n url,\n data\n }));\n };\n }\n\n Axios.prototype[method] = generateHTTPMethod();\n\n Axios.prototype[method + 'Form'] = generateHTTPMethod(true);\n});\n\nexport default Axios;\n","'use strict';\n\nimport CanceledError from './CanceledError.js';\n\n/**\n * A `CancelToken` is an object that can be used to request cancellation of an operation.\n *\n * @param {Function} executor The executor function.\n *\n * @returns {CancelToken}\n */\nclass CancelToken {\n constructor(executor) {\n if (typeof executor !== 'function') {\n throw new TypeError('executor must be a function.');\n }\n\n let resolvePromise;\n\n this.promise = new Promise(function promiseExecutor(resolve) {\n resolvePromise = resolve;\n });\n\n const token = this;\n\n // eslint-disable-next-line func-names\n this.promise.then(cancel => {\n if (!token._listeners) return;\n\n let i = token._listeners.length;\n\n while (i-- > 0) {\n token._listeners[i](cancel);\n }\n token._listeners = null;\n });\n\n // eslint-disable-next-line func-names\n this.promise.then = onfulfilled => {\n let _resolve;\n // eslint-disable-next-line func-names\n const promise = new Promise(resolve => {\n token.subscribe(resolve);\n _resolve = resolve;\n }).then(onfulfilled);\n\n promise.cancel = function reject() {\n token.unsubscribe(_resolve);\n };\n\n return promise;\n };\n\n executor(function cancel(message, config, request) {\n if (token.reason) {\n // Cancellation has already been requested\n return;\n }\n\n token.reason = new CanceledError(message, config, request);\n resolvePromise(token.reason);\n });\n }\n\n /**\n * Throws a `CanceledError` if cancellation has been requested.\n */\n throwIfRequested() {\n if (this.reason) {\n throw this.reason;\n }\n }\n\n /**\n * Subscribe to the cancel signal\n */\n\n subscribe(listener) {\n if (this.reason) {\n listener(this.reason);\n return;\n }\n\n if (this._listeners) {\n this._listeners.push(listener);\n } else {\n this._listeners = [listener];\n }\n }\n\n /**\n * Unsubscribe from the cancel signal\n */\n\n unsubscribe(listener) {\n if (!this._listeners) {\n return;\n }\n const index = this._listeners.indexOf(listener);\n if (index !== -1) {\n this._listeners.splice(index, 1);\n }\n }\n\n toAbortSignal() {\n const controller = new AbortController();\n\n const abort = (err) => {\n controller.abort(err);\n };\n\n this.subscribe(abort);\n\n controller.signal.unsubscribe = () => this.unsubscribe(abort);\n\n return controller.signal;\n }\n\n /**\n * Returns an object that contains a new `CancelToken` and a function that, when called,\n * cancels the `CancelToken`.\n */\n static source() {\n let cancel;\n const token = new CancelToken(function executor(c) {\n cancel = c;\n });\n return {\n token,\n cancel\n };\n }\n}\n\nexport default CancelToken;\n","'use strict';\n\n/**\n * Syntactic sugar for invoking a function and expanding an array for arguments.\n *\n * Common use case would be to use `Function.prototype.apply`.\n *\n * ```js\n * function f(x, y, z) {}\n * var args = [1, 2, 3];\n * f.apply(null, args);\n * ```\n *\n * With `spread` this example can be re-written.\n *\n * ```js\n * spread(function(x, y, z) {})([1, 2, 3]);\n * ```\n *\n * @param {Function} callback\n *\n * @returns {Function}\n */\nexport default function spread(callback) {\n return function wrap(arr) {\n return callback.apply(null, arr);\n };\n}\n","'use strict';\n\nimport utils from './../utils.js';\n\n/**\n * Determines whether the payload is an error thrown by Axios\n *\n * @param {*} payload The value to test\n *\n * @returns {boolean} True if the payload is an error thrown by Axios, otherwise false\n */\nexport default function isAxiosError(payload) {\n return utils.isObject(payload) && (payload.isAxiosError === true);\n}\n","const HttpStatusCode = {\n Continue: 100,\n SwitchingProtocols: 101,\n Processing: 102,\n EarlyHints: 103,\n Ok: 200,\n Created: 201,\n Accepted: 202,\n NonAuthoritativeInformation: 203,\n NoContent: 204,\n ResetContent: 205,\n PartialContent: 206,\n MultiStatus: 207,\n AlreadyReported: 208,\n ImUsed: 226,\n MultipleChoices: 300,\n MovedPermanently: 301,\n Found: 302,\n SeeOther: 303,\n NotModified: 304,\n UseProxy: 305,\n Unused: 306,\n TemporaryRedirect: 307,\n PermanentRedirect: 308,\n BadRequest: 400,\n Unauthorized: 401,\n PaymentRequired: 402,\n Forbidden: 403,\n NotFound: 404,\n MethodNotAllowed: 405,\n NotAcceptable: 406,\n ProxyAuthenticationRequired: 407,\n RequestTimeout: 408,\n Conflict: 409,\n Gone: 410,\n LengthRequired: 411,\n PreconditionFailed: 412,\n PayloadTooLarge: 413,\n UriTooLong: 414,\n UnsupportedMediaType: 415,\n RangeNotSatisfiable: 416,\n ExpectationFailed: 417,\n ImATeapot: 418,\n MisdirectedRequest: 421,\n UnprocessableEntity: 422,\n Locked: 423,\n FailedDependency: 424,\n TooEarly: 425,\n UpgradeRequired: 426,\n PreconditionRequired: 428,\n TooManyRequests: 429,\n RequestHeaderFieldsTooLarge: 431,\n UnavailableForLegalReasons: 451,\n InternalServerError: 500,\n NotImplemented: 501,\n BadGateway: 502,\n ServiceUnavailable: 503,\n GatewayTimeout: 504,\n HttpVersionNotSupported: 505,\n VariantAlsoNegotiates: 506,\n InsufficientStorage: 507,\n LoopDetected: 508,\n NotExtended: 510,\n NetworkAuthenticationRequired: 511,\n};\n\nObject.entries(HttpStatusCode).forEach(([key, value]) => {\n HttpStatusCode[value] = key;\n});\n\nexport default HttpStatusCode;\n","'use strict';\n\nimport utils from './utils.js';\nimport bind from './helpers/bind.js';\nimport Axios from './core/Axios.js';\nimport mergeConfig from './core/mergeConfig.js';\nimport defaults from './defaults/index.js';\nimport formDataToJSON from './helpers/formDataToJSON.js';\nimport CanceledError from './cancel/CanceledError.js';\nimport CancelToken from './cancel/CancelToken.js';\nimport isCancel from './cancel/isCancel.js';\nimport {VERSION} from './env/data.js';\nimport toFormData from './helpers/toFormData.js';\nimport AxiosError from './core/AxiosError.js';\nimport spread from './helpers/spread.js';\nimport isAxiosError from './helpers/isAxiosError.js';\nimport AxiosHeaders from \"./core/AxiosHeaders.js\";\nimport adapters from './adapters/adapters.js';\nimport HttpStatusCode from './helpers/HttpStatusCode.js';\n\n/**\n * Create an instance of Axios\n *\n * @param {Object} defaultConfig The default config for the instance\n *\n * @returns {Axios} A new instance of Axios\n */\nfunction createInstance(defaultConfig) {\n const context = new Axios(defaultConfig);\n const instance = bind(Axios.prototype.request, context);\n\n // Copy axios.prototype to instance\n utils.extend(instance, Axios.prototype, context, {allOwnKeys: true});\n\n // Copy context to instance\n utils.extend(instance, context, null, {allOwnKeys: true});\n\n // Factory for creating new instances\n instance.create = function create(instanceConfig) {\n return createInstance(mergeConfig(defaultConfig, instanceConfig));\n };\n\n return instance;\n}\n\n// Create the default instance to be exported\nconst axios = createInstance(defaults);\n\n// Expose Axios class to allow class inheritance\naxios.Axios = Axios;\n\n// Expose Cancel & CancelToken\naxios.CanceledError = CanceledError;\naxios.CancelToken = CancelToken;\naxios.isCancel = isCancel;\naxios.VERSION = VERSION;\naxios.toFormData = toFormData;\n\n// Expose AxiosError class\naxios.AxiosError = AxiosError;\n\n// alias for CanceledError for backward compatibility\naxios.Cancel = axios.CanceledError;\n\n// Expose all/spread\naxios.all = function all(promises) {\n return Promise.all(promises);\n};\n\naxios.spread = spread;\n\n// Expose isAxiosError\naxios.isAxiosError = isAxiosError;\n\n// Expose mergeConfig\naxios.mergeConfig = mergeConfig;\n\naxios.AxiosHeaders = AxiosHeaders;\n\naxios.formToJSON = thing => formDataToJSON(utils.isHTMLForm(thing) ? new FormData(thing) : thing);\n\naxios.getAdapter = adapters.getAdapter;\n\naxios.HttpStatusCode = HttpStatusCode;\n\naxios.default = axios;\n\n// this module should only have a default export\nexport default axios\n","//\n// Main\n//\nexport function memoize(fn, options) {\n var cache = options && options.cache ? options.cache : cacheDefault;\n var serializer = options && options.serializer ? options.serializer : serializerDefault;\n var strategy = options && options.strategy ? options.strategy : strategyDefault;\n return strategy(fn, {\n cache: cache,\n serializer: serializer,\n });\n}\n//\n// Strategy\n//\nfunction isPrimitive(value) {\n return (value == null || typeof value === 'number' || typeof value === 'boolean'); // || typeof value === \"string\" 'unsafe' primitive for our needs\n}\nfunction monadic(fn, cache, serializer, arg) {\n var cacheKey = isPrimitive(arg) ? arg : serializer(arg);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.call(this, arg);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction variadic(fn, cache, serializer) {\n var args = Array.prototype.slice.call(arguments, 3);\n var cacheKey = serializer(args);\n var computedValue = cache.get(cacheKey);\n if (typeof computedValue === 'undefined') {\n computedValue = fn.apply(this, args);\n cache.set(cacheKey, computedValue);\n }\n return computedValue;\n}\nfunction assemble(fn, context, strategy, cache, serialize) {\n return strategy.bind(context, fn, cache, serialize);\n}\nfunction strategyDefault(fn, options) {\n var strategy = fn.length === 1 ? monadic : variadic;\n return assemble(fn, this, strategy, options.cache.create(), options.serializer);\n}\nfunction strategyVariadic(fn, options) {\n return assemble(fn, this, variadic, options.cache.create(), options.serializer);\n}\nfunction strategyMonadic(fn, options) {\n return assemble(fn, this, monadic, options.cache.create(), options.serializer);\n}\n//\n// Serializer\n//\nvar serializerDefault = function () {\n return JSON.stringify(arguments);\n};\n//\n// Cache\n//\nfunction ObjectWithoutPrototypeCache() {\n this.cache = Object.create(null);\n}\nObjectWithoutPrototypeCache.prototype.get = function (key) {\n return this.cache[key];\n};\nObjectWithoutPrototypeCache.prototype.set = function (key, value) {\n this.cache[key] = value;\n};\nvar cacheDefault = {\n create: function create() {\n // @ts-ignore\n return new ObjectWithoutPrototypeCache();\n },\n};\nexport var strategies = {\n variadic: strategyVariadic,\n monadic: strategyMonadic,\n};\n//# sourceMappingURL=index.js.map","import { __spreadArray } from \"tslib\";\nimport { memoize, strategies } from '@formatjs/fast-memoize';\n/**\n * Cannot do Math.log(x) / Math.log(10) bc if IEEE floating point issue\n * @param x number\n */\nexport function getMagnitude(x) {\n // Cannot count string length via Number.toString because it may use scientific notation\n // for very small or very large numbers.\n return Math.floor(Math.log(x) * Math.LOG10E);\n}\nexport function repeat(s, times) {\n if (typeof s.repeat === 'function') {\n return s.repeat(times);\n }\n var arr = new Array(times);\n for (var i = 0; i < arr.length; i++) {\n arr[i] = s;\n }\n return arr.join('');\n}\nexport function setInternalSlot(map, pl, field, value) {\n if (!map.get(pl)) {\n map.set(pl, Object.create(null));\n }\n var slots = map.get(pl);\n slots[field] = value;\n}\nexport function setMultiInternalSlots(map, pl, props) {\n for (var _i = 0, _a = Object.keys(props); _i < _a.length; _i++) {\n var k = _a[_i];\n setInternalSlot(map, pl, k, props[k]);\n }\n}\nexport function getInternalSlot(map, pl, field) {\n return getMultiInternalSlots(map, pl, field)[field];\n}\nexport function getMultiInternalSlots(map, pl) {\n var fields = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n fields[_i - 2] = arguments[_i];\n }\n var slots = map.get(pl);\n if (!slots) {\n throw new TypeError(\"\".concat(pl, \" InternalSlot has not been initialized\"));\n }\n return fields.reduce(function (all, f) {\n all[f] = slots[f];\n return all;\n }, Object.create(null));\n}\nexport function isLiteralPart(patternPart) {\n return patternPart.type === 'literal';\n}\n/*\n 17 ECMAScript Standard Built-in Objects:\n Every built-in Function object, including constructors, that is not\n identified as an anonymous function has a name property whose value\n is a String.\n\n Unless otherwise specified, the name property of a built-in Function\n object, if it exists, has the attributes { [[Writable]]: false,\n [[Enumerable]]: false, [[Configurable]]: true }.\n*/\nexport function defineProperty(target, name, _a) {\n var value = _a.value;\n Object.defineProperty(target, name, {\n configurable: true,\n enumerable: false,\n writable: true,\n value: value,\n });\n}\n/**\n * 7.3.5 CreateDataProperty\n * @param target\n * @param name\n * @param value\n */\nexport function createDataProperty(target, name, value) {\n Object.defineProperty(target, name, {\n configurable: true,\n enumerable: true,\n writable: true,\n value: value,\n });\n}\nexport var UNICODE_EXTENSION_SEQUENCE_REGEX = /-u(?:-[0-9a-z]{2,8})+/gi;\nexport function invariant(condition, message, Err) {\n if (Err === void 0) { Err = Error; }\n if (!condition) {\n throw new Err(message);\n }\n}\nexport var createMemoizedNumberFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n}, {\n strategy: strategies.variadic,\n});\nexport var createMemoizedDateTimeFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n}, {\n strategy: strategies.variadic,\n});\nexport var createMemoizedPluralRules = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n}, {\n strategy: strategies.variadic,\n});\nexport var createMemoizedLocale = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.Locale).bind.apply(_a, __spreadArray([void 0], args, false)))();\n}, {\n strategy: strategies.variadic,\n});\nexport var createMemoizedListFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.ListFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n}, {\n strategy: strategies.variadic,\n});\n","export var ErrorKind;\n(function (ErrorKind) {\n /** Argument is unclosed (e.g. `{0`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_CLOSING_BRACE\"] = 1] = \"EXPECT_ARGUMENT_CLOSING_BRACE\";\n /** Argument is empty (e.g. `{}`). */\n ErrorKind[ErrorKind[\"EMPTY_ARGUMENT\"] = 2] = \"EMPTY_ARGUMENT\";\n /** Argument is malformed (e.g. `{foo!}``) */\n ErrorKind[ErrorKind[\"MALFORMED_ARGUMENT\"] = 3] = \"MALFORMED_ARGUMENT\";\n /** Expect an argument type (e.g. `{foo,}`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_TYPE\"] = 4] = \"EXPECT_ARGUMENT_TYPE\";\n /** Unsupported argument type (e.g. `{foo,foo}`) */\n ErrorKind[ErrorKind[\"INVALID_ARGUMENT_TYPE\"] = 5] = \"INVALID_ARGUMENT_TYPE\";\n /** Expect an argument style (e.g. `{foo, number, }`) */\n ErrorKind[ErrorKind[\"EXPECT_ARGUMENT_STYLE\"] = 6] = \"EXPECT_ARGUMENT_STYLE\";\n /** The number skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_NUMBER_SKELETON\"] = 7] = \"INVALID_NUMBER_SKELETON\";\n /** The date time skeleton is invalid. */\n ErrorKind[ErrorKind[\"INVALID_DATE_TIME_SKELETON\"] = 8] = \"INVALID_DATE_TIME_SKELETON\";\n /** Exepct a number skeleton following the `::` (e.g. `{foo, number, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_NUMBER_SKELETON\"] = 9] = \"EXPECT_NUMBER_SKELETON\";\n /** Exepct a date time skeleton following the `::` (e.g. `{foo, date, ::}`) */\n ErrorKind[ErrorKind[\"EXPECT_DATE_TIME_SKELETON\"] = 10] = \"EXPECT_DATE_TIME_SKELETON\";\n /** Unmatched apostrophes in the argument style (e.g. `{foo, number, 'test`) */\n ErrorKind[ErrorKind[\"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\"] = 11] = \"UNCLOSED_QUOTE_IN_ARGUMENT_STYLE\";\n /** Missing select argument options (e.g. `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_OPTIONS\"] = 12] = \"EXPECT_SELECT_ARGUMENT_OPTIONS\";\n /** Expecting an offset value in `plural` or `selectordinal` argument (e.g `{foo, plural, offset}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 13] = \"EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Offset value in `plural` or `selectordinal` is invalid (e.g. `{foo, plural, offset: x}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\"] = 14] = \"INVALID_PLURAL_ARGUMENT_OFFSET_VALUE\";\n /** Expecting a selector in `select` argument (e.g `{foo, select}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR\"] = 15] = \"EXPECT_SELECT_ARGUMENT_SELECTOR\";\n /** Expecting a selector in `plural` or `selectordinal` argument (e.g `{foo, plural}`) */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR\"] = 16] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR\";\n /** Expecting a message fragment after the `select` selector (e.g. `{foo, select, apple}`) */\n ErrorKind[ErrorKind[\"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\"] = 17] = \"EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\";\n /**\n * Expecting a message fragment after the `plural` or `selectordinal` selector\n * (e.g. `{foo, plural, one}`)\n */\n ErrorKind[ErrorKind[\"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\"] = 18] = \"EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT\";\n /** Selector in `plural` or `selectordinal` is malformed (e.g. `{foo, plural, =x {#}}`) */\n ErrorKind[ErrorKind[\"INVALID_PLURAL_ARGUMENT_SELECTOR\"] = 19] = \"INVALID_PLURAL_ARGUMENT_SELECTOR\";\n /**\n * Duplicate selectors in `plural` or `selectordinal` argument.\n * (e.g. {foo, plural, one {#} one {#}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\"] = 20] = \"DUPLICATE_PLURAL_ARGUMENT_SELECTOR\";\n /** Duplicate selectors in `select` argument.\n * (e.g. {foo, select, apple {apple} apple {apple}})\n */\n ErrorKind[ErrorKind[\"DUPLICATE_SELECT_ARGUMENT_SELECTOR\"] = 21] = \"DUPLICATE_SELECT_ARGUMENT_SELECTOR\";\n /** Plural or select argument option must have `other` clause. */\n ErrorKind[ErrorKind[\"MISSING_OTHER_CLAUSE\"] = 22] = \"MISSING_OTHER_CLAUSE\";\n /** The tag is malformed. (e.g. `foo) */\n ErrorKind[ErrorKind[\"INVALID_TAG\"] = 23] = \"INVALID_TAG\";\n /** The tag name is invalid. (e.g. `<123>foo`) */\n ErrorKind[ErrorKind[\"INVALID_TAG_NAME\"] = 25] = \"INVALID_TAG_NAME\";\n /** The closing tag does not match the opening tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNMATCHED_CLOSING_TAG\"] = 26] = \"UNMATCHED_CLOSING_TAG\";\n /** The opening tag has unmatched closing tag. (e.g. `foo`) */\n ErrorKind[ErrorKind[\"UNCLOSED_TAG\"] = 27] = \"UNCLOSED_TAG\";\n})(ErrorKind || (ErrorKind = {}));\n","export var TYPE;\n(function (TYPE) {\n /**\n * Raw text\n */\n TYPE[TYPE[\"literal\"] = 0] = \"literal\";\n /**\n * Variable w/o any format, e.g `var` in `this is a {var}`\n */\n TYPE[TYPE[\"argument\"] = 1] = \"argument\";\n /**\n * Variable w/ number format\n */\n TYPE[TYPE[\"number\"] = 2] = \"number\";\n /**\n * Variable w/ date format\n */\n TYPE[TYPE[\"date\"] = 3] = \"date\";\n /**\n * Variable w/ time format\n */\n TYPE[TYPE[\"time\"] = 4] = \"time\";\n /**\n * Variable w/ select format\n */\n TYPE[TYPE[\"select\"] = 5] = \"select\";\n /**\n * Variable w/ plural format\n */\n TYPE[TYPE[\"plural\"] = 6] = \"plural\";\n /**\n * Only possible within plural argument.\n * This is the `#` symbol that will be substituted with the count.\n */\n TYPE[TYPE[\"pound\"] = 7] = \"pound\";\n /**\n * XML-like tag\n */\n TYPE[TYPE[\"tag\"] = 8] = \"tag\";\n})(TYPE || (TYPE = {}));\nexport var SKELETON_TYPE;\n(function (SKELETON_TYPE) {\n SKELETON_TYPE[SKELETON_TYPE[\"number\"] = 0] = \"number\";\n SKELETON_TYPE[SKELETON_TYPE[\"dateTime\"] = 1] = \"dateTime\";\n})(SKELETON_TYPE || (SKELETON_TYPE = {}));\n/**\n * Type Guards\n */\nexport function isLiteralElement(el) {\n return el.type === TYPE.literal;\n}\nexport function isArgumentElement(el) {\n return el.type === TYPE.argument;\n}\nexport function isNumberElement(el) {\n return el.type === TYPE.number;\n}\nexport function isDateElement(el) {\n return el.type === TYPE.date;\n}\nexport function isTimeElement(el) {\n return el.type === TYPE.time;\n}\nexport function isSelectElement(el) {\n return el.type === TYPE.select;\n}\nexport function isPluralElement(el) {\n return el.type === TYPE.plural;\n}\nexport function isPoundElement(el) {\n return el.type === TYPE.pound;\n}\nexport function isTagElement(el) {\n return el.type === TYPE.tag;\n}\nexport function isNumberSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.number);\n}\nexport function isDateTimeSkeleton(el) {\n return !!(el && typeof el === 'object' && el.type === SKELETON_TYPE.dateTime);\n}\nexport function createLiteralElement(value) {\n return {\n type: TYPE.literal,\n value: value,\n };\n}\nexport function createNumberElement(value, style) {\n return {\n type: TYPE.number,\n value: value,\n style: style,\n };\n}\n","// @generated from regex-gen.ts\nexport var SPACE_SEPARATOR_REGEX = /[ \\xA0\\u1680\\u2000-\\u200A\\u202F\\u205F\\u3000]/;\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/;\n","/**\n * https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * Credit: https://github.com/caridy/intl-datetimeformat-pattern/blob/master/index.js\n * with some tweaks\n */\nvar DATE_TIME_REGEX = /(?:[Eec]{1,6}|G{1,5}|[Qq]{1,5}|(?:[yYur]+|U{1,5})|[ML]{1,5}|d{1,2}|D{1,3}|F{1}|[abB]{1,5}|[hkHK]{1,2}|w{1,2}|W{1}|m{1,2}|s{1,2}|[zZOvVxX]{1,4})(?=([^']*'[^']*')*[^']*$)/g;\n/**\n * Parse Date time skeleton into Intl.DateTimeFormatOptions\n * Ref: https://unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table\n * @public\n * @param skeleton skeleton string\n */\nexport function parseDateTimeSkeleton(skeleton) {\n var result = {};\n skeleton.replace(DATE_TIME_REGEX, function (match) {\n var len = match.length;\n switch (match[0]) {\n // Era\n case 'G':\n result.era = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n // Year\n case 'y':\n result.year = len === 2 ? '2-digit' : 'numeric';\n break;\n case 'Y':\n case 'u':\n case 'U':\n case 'r':\n throw new RangeError('`Y/u/U/r` (year) patterns are not supported, use `y` instead');\n // Quarter\n case 'q':\n case 'Q':\n throw new RangeError('`q/Q` (quarter) patterns are not supported');\n // Month\n case 'M':\n case 'L':\n result.month = ['numeric', '2-digit', 'short', 'long', 'narrow'][len - 1];\n break;\n // Week\n case 'w':\n case 'W':\n throw new RangeError('`w/W` (week) patterns are not supported');\n case 'd':\n result.day = ['numeric', '2-digit'][len - 1];\n break;\n case 'D':\n case 'F':\n case 'g':\n throw new RangeError('`D/F/g` (day) patterns are not supported, use `d` instead');\n // Weekday\n case 'E':\n result.weekday = len === 4 ? 'long' : len === 5 ? 'narrow' : 'short';\n break;\n case 'e':\n if (len < 4) {\n throw new RangeError('`e..eee` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n case 'c':\n if (len < 4) {\n throw new RangeError('`c..ccc` (weekday) patterns are not supported');\n }\n result.weekday = ['short', 'long', 'narrow', 'short'][len - 4];\n break;\n // Period\n case 'a': // AM, PM\n result.hour12 = true;\n break;\n case 'b': // am, pm, noon, midnight\n case 'B': // flexible day periods\n throw new RangeError('`b/B` (period) patterns are not supported, use `a` instead');\n // Hour\n case 'h':\n result.hourCycle = 'h12';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'H':\n result.hourCycle = 'h23';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'K':\n result.hourCycle = 'h11';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'k':\n result.hourCycle = 'h24';\n result.hour = ['numeric', '2-digit'][len - 1];\n break;\n case 'j':\n case 'J':\n case 'C':\n throw new RangeError('`j/J/C` (hour) patterns are not supported, use `h/H/K/k` instead');\n // Minute\n case 'm':\n result.minute = ['numeric', '2-digit'][len - 1];\n break;\n // Second\n case 's':\n result.second = ['numeric', '2-digit'][len - 1];\n break;\n case 'S':\n case 'A':\n throw new RangeError('`S/A` (second) patterns are not supported, use `s` instead');\n // Zone\n case 'z': // 1..3, 4: specific non-location format\n result.timeZoneName = len < 4 ? 'short' : 'long';\n break;\n case 'Z': // 1..3, 4, 5: The ISO8601 varios formats\n case 'O': // 1, 4: milliseconds in day short, long\n case 'v': // 1, 4: generic non-location format\n case 'V': // 1, 2, 3, 4: time zone ID or city\n case 'X': // 1, 2, 3, 4: The ISO8601 varios formats\n case 'x': // 1, 2, 3, 4: The ISO8601 varios formats\n throw new RangeError('`Z/O/v/V/X/x` (timeZone) patterns are not supported, use `z` instead');\n }\n return '';\n });\n return result;\n}\n","// @generated from regex-gen.ts\nexport var WHITE_SPACE_REGEX = /[\\t-\\r \\x85\\u200E\\u200F\\u2028\\u2029]/i;\n","import { __assign } from \"tslib\";\nimport { WHITE_SPACE_REGEX } from './regex.generated';\nexport function parseNumberSkeletonFromString(skeleton) {\n if (skeleton.length === 0) {\n throw new Error('Number skeleton cannot be empty');\n }\n // Parse the skeleton\n var stringTokens = skeleton\n .split(WHITE_SPACE_REGEX)\n .filter(function (x) { return x.length > 0; });\n var tokens = [];\n for (var _i = 0, stringTokens_1 = stringTokens; _i < stringTokens_1.length; _i++) {\n var stringToken = stringTokens_1[_i];\n var stemAndOptions = stringToken.split('/');\n if (stemAndOptions.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n var stem = stemAndOptions[0], options = stemAndOptions.slice(1);\n for (var _a = 0, options_1 = options; _a < options_1.length; _a++) {\n var option = options_1[_a];\n if (option.length === 0) {\n throw new Error('Invalid number skeleton');\n }\n }\n tokens.push({ stem: stem, options: options });\n }\n return tokens;\n}\nfunction icuUnitToEcma(unit) {\n return unit.replace(/^(.*?)-/, '');\n}\nvar FRACTION_PRECISION_REGEX = /^\\.(?:(0+)(\\*)?|(#+)|(0+)(#+))$/g;\nvar SIGNIFICANT_PRECISION_REGEX = /^(@+)?(\\+|#+)?[rs]?$/g;\nvar INTEGER_WIDTH_REGEX = /(\\*)(0+)|(#+)(0+)|(0+)/g;\nvar CONCISE_INTEGER_WIDTH_REGEX = /^(0+)$/;\nfunction parseSignificantPrecision(str) {\n var result = {};\n if (str[str.length - 1] === 'r') {\n result.roundingPriority = 'morePrecision';\n }\n else if (str[str.length - 1] === 's') {\n result.roundingPriority = 'lessPrecision';\n }\n str.replace(SIGNIFICANT_PRECISION_REGEX, function (_, g1, g2) {\n // @@@ case\n if (typeof g2 !== 'string') {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits = g1.length;\n }\n // @@@+ case\n else if (g2 === '+') {\n result.minimumSignificantDigits = g1.length;\n }\n // .### case\n else if (g1[0] === '#') {\n result.maximumSignificantDigits = g1.length;\n }\n // .@@## or .@@@ case\n else {\n result.minimumSignificantDigits = g1.length;\n result.maximumSignificantDigits =\n g1.length + (typeof g2 === 'string' ? g2.length : 0);\n }\n return '';\n });\n return result;\n}\nfunction parseSign(str) {\n switch (str) {\n case 'sign-auto':\n return {\n signDisplay: 'auto',\n };\n case 'sign-accounting':\n case '()':\n return {\n currencySign: 'accounting',\n };\n case 'sign-always':\n case '+!':\n return {\n signDisplay: 'always',\n };\n case 'sign-accounting-always':\n case '()!':\n return {\n signDisplay: 'always',\n currencySign: 'accounting',\n };\n case 'sign-except-zero':\n case '+?':\n return {\n signDisplay: 'exceptZero',\n };\n case 'sign-accounting-except-zero':\n case '()?':\n return {\n signDisplay: 'exceptZero',\n currencySign: 'accounting',\n };\n case 'sign-never':\n case '+_':\n return {\n signDisplay: 'never',\n };\n }\n}\nfunction parseConciseScientificAndEngineeringStem(stem) {\n // Engineering\n var result;\n if (stem[0] === 'E' && stem[1] === 'E') {\n result = {\n notation: 'engineering',\n };\n stem = stem.slice(2);\n }\n else if (stem[0] === 'E') {\n result = {\n notation: 'scientific',\n };\n stem = stem.slice(1);\n }\n if (result) {\n var signDisplay = stem.slice(0, 2);\n if (signDisplay === '+!') {\n result.signDisplay = 'always';\n stem = stem.slice(2);\n }\n else if (signDisplay === '+?') {\n result.signDisplay = 'exceptZero';\n stem = stem.slice(2);\n }\n if (!CONCISE_INTEGER_WIDTH_REGEX.test(stem)) {\n throw new Error('Malformed concise eng/scientific notation');\n }\n result.minimumIntegerDigits = stem.length;\n }\n return result;\n}\nfunction parseNotationOptions(opt) {\n var result = {};\n var signOpts = parseSign(opt);\n if (signOpts) {\n return signOpts;\n }\n return result;\n}\n/**\n * https://github.com/unicode-org/icu/blob/master/docs/userguide/format_parse/numbers/skeletons.md#skeleton-stems-and-options\n */\nexport function parseNumberSkeleton(tokens) {\n var result = {};\n for (var _i = 0, tokens_1 = tokens; _i < tokens_1.length; _i++) {\n var token = tokens_1[_i];\n switch (token.stem) {\n case 'percent':\n case '%':\n result.style = 'percent';\n continue;\n case '%x100':\n result.style = 'percent';\n result.scale = 100;\n continue;\n case 'currency':\n result.style = 'currency';\n result.currency = token.options[0];\n continue;\n case 'group-off':\n case ',_':\n result.useGrouping = false;\n continue;\n case 'precision-integer':\n case '.':\n result.maximumFractionDigits = 0;\n continue;\n case 'measure-unit':\n case 'unit':\n result.style = 'unit';\n result.unit = icuUnitToEcma(token.options[0]);\n continue;\n case 'compact-short':\n case 'K':\n result.notation = 'compact';\n result.compactDisplay = 'short';\n continue;\n case 'compact-long':\n case 'KK':\n result.notation = 'compact';\n result.compactDisplay = 'long';\n continue;\n case 'scientific':\n result = __assign(__assign(__assign({}, result), { notation: 'scientific' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'engineering':\n result = __assign(__assign(__assign({}, result), { notation: 'engineering' }), token.options.reduce(function (all, opt) { return (__assign(__assign({}, all), parseNotationOptions(opt))); }, {}));\n continue;\n case 'notation-simple':\n result.notation = 'standard';\n continue;\n // https://github.com/unicode-org/icu/blob/master/icu4c/source/i18n/unicode/unumberformatter.h\n case 'unit-width-narrow':\n result.currencyDisplay = 'narrowSymbol';\n result.unitDisplay = 'narrow';\n continue;\n case 'unit-width-short':\n result.currencyDisplay = 'code';\n result.unitDisplay = 'short';\n continue;\n case 'unit-width-full-name':\n result.currencyDisplay = 'name';\n result.unitDisplay = 'long';\n continue;\n case 'unit-width-iso-code':\n result.currencyDisplay = 'symbol';\n continue;\n case 'scale':\n result.scale = parseFloat(token.options[0]);\n continue;\n case 'rounding-mode-floor':\n result.roundingMode = 'floor';\n continue;\n case 'rounding-mode-ceiling':\n result.roundingMode = 'ceil';\n continue;\n case 'rounding-mode-down':\n result.roundingMode = 'trunc';\n continue;\n case 'rounding-mode-up':\n result.roundingMode = 'expand';\n continue;\n case 'rounding-mode-half-even':\n result.roundingMode = 'halfEven';\n continue;\n case 'rounding-mode-half-down':\n result.roundingMode = 'halfTrunc';\n continue;\n case 'rounding-mode-half-up':\n result.roundingMode = 'halfExpand';\n continue;\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n case 'integer-width':\n if (token.options.length > 1) {\n throw new RangeError('integer-width stems only accept a single optional option');\n }\n token.options[0].replace(INTEGER_WIDTH_REGEX, function (_, g1, g2, g3, g4, g5) {\n if (g1) {\n result.minimumIntegerDigits = g2.length;\n }\n else if (g3 && g4) {\n throw new Error('We currently do not support maximum integer digits');\n }\n else if (g5) {\n throw new Error('We currently do not support exact integer digits');\n }\n return '';\n });\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#integer-width\n if (CONCISE_INTEGER_WIDTH_REGEX.test(token.stem)) {\n result.minimumIntegerDigits = token.stem.length;\n continue;\n }\n if (FRACTION_PRECISION_REGEX.test(token.stem)) {\n // Precision\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#fraction-precision\n // precision-integer case\n if (token.options.length > 1) {\n throw new RangeError('Fraction-precision stems only accept a single optional option');\n }\n token.stem.replace(FRACTION_PRECISION_REGEX, function (_, g1, g2, g3, g4, g5) {\n // .000* case (before ICU67 it was .000+)\n if (g2 === '*') {\n result.minimumFractionDigits = g1.length;\n }\n // .### case\n else if (g3 && g3[0] === '#') {\n result.maximumFractionDigits = g3.length;\n }\n // .00## case\n else if (g4 && g5) {\n result.minimumFractionDigits = g4.length;\n result.maximumFractionDigits = g4.length + g5.length;\n }\n else {\n result.minimumFractionDigits = g1.length;\n result.maximumFractionDigits = g1.length;\n }\n return '';\n });\n var opt = token.options[0];\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#trailing-zero-display\n if (opt === 'w') {\n result = __assign(__assign({}, result), { trailingZeroDisplay: 'stripIfInteger' });\n }\n else if (opt) {\n result = __assign(__assign({}, result), parseSignificantPrecision(opt));\n }\n continue;\n }\n // https://unicode-org.github.io/icu/userguide/format_parse/numbers/skeletons.html#significant-digits-precision\n if (SIGNIFICANT_PRECISION_REGEX.test(token.stem)) {\n result = __assign(__assign({}, result), parseSignificantPrecision(token.stem));\n continue;\n }\n var signOpts = parseSign(token.stem);\n if (signOpts) {\n result = __assign(__assign({}, result), signOpts);\n }\n var conciseScientificAndEngineeringOpts = parseConciseScientificAndEngineeringStem(token.stem);\n if (conciseScientificAndEngineeringOpts) {\n result = __assign(__assign({}, result), conciseScientificAndEngineeringOpts);\n }\n }\n return result;\n}\n","// @generated from time-data-gen.ts\n// prettier-ignore \nexport var timeData = {\n \"001\": [\n \"H\",\n \"h\"\n ],\n \"419\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AD\": [\n \"H\",\n \"hB\"\n ],\n \"AE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"AF\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"AG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"AL\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"AM\": [\n \"H\",\n \"hB\"\n ],\n \"AO\": [\n \"H\",\n \"hB\"\n ],\n \"AR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"AS\": [\n \"h\",\n \"H\"\n ],\n \"AT\": [\n \"H\",\n \"hB\"\n ],\n \"AU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"AW\": [\n \"H\",\n \"hB\"\n ],\n \"AX\": [\n \"H\"\n ],\n \"AZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BD\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"BE\": [\n \"H\",\n \"hB\"\n ],\n \"BF\": [\n \"H\",\n \"hB\"\n ],\n \"BG\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"BH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"BI\": [\n \"H\",\n \"h\"\n ],\n \"BJ\": [\n \"H\",\n \"hB\"\n ],\n \"BL\": [\n \"H\",\n \"hB\"\n ],\n \"BM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BN\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"BO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"BQ\": [\n \"H\"\n ],\n \"BR\": [\n \"H\",\n \"hB\"\n ],\n \"BS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"BT\": [\n \"h\",\n \"H\"\n ],\n \"BW\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"BY\": [\n \"H\",\n \"h\"\n ],\n \"BZ\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CA\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"CC\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CD\": [\n \"hB\",\n \"H\"\n ],\n \"CF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CG\": [\n \"H\",\n \"hB\"\n ],\n \"CH\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"CI\": [\n \"H\",\n \"hB\"\n ],\n \"CK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CL\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"CN\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"CO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CP\": [\n \"H\"\n ],\n \"CR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CU\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"CV\": [\n \"H\",\n \"hB\"\n ],\n \"CW\": [\n \"H\",\n \"hB\"\n ],\n \"CX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"CY\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"CZ\": [\n \"H\"\n ],\n \"DE\": [\n \"H\",\n \"hB\"\n ],\n \"DG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"DJ\": [\n \"h\",\n \"H\"\n ],\n \"DK\": [\n \"H\"\n ],\n \"DM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"DO\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"DZ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"EC\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"EE\": [\n \"H\",\n \"hB\"\n ],\n \"EG\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"EH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ER\": [\n \"h\",\n \"H\"\n ],\n \"ES\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"ET\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"FI\": [\n \"H\"\n ],\n \"FJ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"FM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"FO\": [\n \"H\",\n \"h\"\n ],\n \"FR\": [\n \"H\",\n \"hB\"\n ],\n \"GA\": [\n \"H\",\n \"hB\"\n ],\n \"GB\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GD\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GE\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"GF\": [\n \"H\",\n \"hB\"\n ],\n \"GG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GH\": [\n \"h\",\n \"H\"\n ],\n \"GI\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"GL\": [\n \"H\",\n \"h\"\n ],\n \"GM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GN\": [\n \"H\",\n \"hB\"\n ],\n \"GP\": [\n \"H\",\n \"hB\"\n ],\n \"GQ\": [\n \"H\",\n \"hB\",\n \"h\",\n \"hb\"\n ],\n \"GR\": [\n \"h\",\n \"H\",\n \"hb\",\n \"hB\"\n ],\n \"GT\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"GU\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"GW\": [\n \"H\",\n \"hB\"\n ],\n \"GY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"HK\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"HN\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"HR\": [\n \"H\",\n \"hB\"\n ],\n \"HU\": [\n \"H\",\n \"h\"\n ],\n \"IC\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ID\": [\n \"H\"\n ],\n \"IE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IL\": [\n \"H\",\n \"hB\"\n ],\n \"IM\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IN\": [\n \"h\",\n \"H\"\n ],\n \"IO\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"IQ\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"IR\": [\n \"hB\",\n \"H\"\n ],\n \"IS\": [\n \"H\"\n ],\n \"IT\": [\n \"H\",\n \"hB\"\n ],\n \"JE\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"JM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"JO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"JP\": [\n \"H\",\n \"K\",\n \"h\"\n ],\n \"KE\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"KG\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KH\": [\n \"hB\",\n \"h\",\n \"H\",\n \"hb\"\n ],\n \"KI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KM\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"KN\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KP\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"KW\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"KY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"KZ\": [\n \"H\",\n \"hB\"\n ],\n \"LA\": [\n \"H\",\n \"hb\",\n \"hB\",\n \"h\"\n ],\n \"LB\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"LC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LI\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"LK\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"LR\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"LS\": [\n \"h\",\n \"H\"\n ],\n \"LT\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"LU\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"LV\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"LY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"MC\": [\n \"H\",\n \"hB\"\n ],\n \"MD\": [\n \"H\",\n \"hB\"\n ],\n \"ME\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"MF\": [\n \"H\",\n \"hB\"\n ],\n \"MG\": [\n \"H\",\n \"h\"\n ],\n \"MH\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MK\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ML\": [\n \"H\"\n ],\n \"MM\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"MN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MO\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MP\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MQ\": [\n \"H\",\n \"hB\"\n ],\n \"MR\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"MS\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"MT\": [\n \"H\",\n \"h\"\n ],\n \"MU\": [\n \"H\",\n \"h\"\n ],\n \"MV\": [\n \"H\",\n \"h\"\n ],\n \"MW\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"MX\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"MY\": [\n \"hb\",\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"MZ\": [\n \"H\",\n \"hB\"\n ],\n \"NA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NC\": [\n \"H\",\n \"hB\"\n ],\n \"NE\": [\n \"H\"\n ],\n \"NF\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NG\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NI\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"NL\": [\n \"H\",\n \"hB\"\n ],\n \"NO\": [\n \"H\",\n \"h\"\n ],\n \"NP\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"NR\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NU\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"NZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"OM\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PA\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"PG\": [\n \"h\",\n \"H\"\n ],\n \"PH\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PK\": [\n \"h\",\n \"hB\",\n \"H\"\n ],\n \"PL\": [\n \"H\",\n \"h\"\n ],\n \"PM\": [\n \"H\",\n \"hB\"\n ],\n \"PN\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"PR\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"PS\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"PT\": [\n \"H\",\n \"hB\"\n ],\n \"PW\": [\n \"h\",\n \"H\"\n ],\n \"PY\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"QA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"RE\": [\n \"H\",\n \"hB\"\n ],\n \"RO\": [\n \"H\",\n \"hB\"\n ],\n \"RS\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"RU\": [\n \"H\"\n ],\n \"RW\": [\n \"H\",\n \"h\"\n ],\n \"SA\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SB\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SC\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SD\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SE\": [\n \"H\"\n ],\n \"SG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SH\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SI\": [\n \"H\",\n \"hB\"\n ],\n \"SJ\": [\n \"H\"\n ],\n \"SK\": [\n \"H\"\n ],\n \"SL\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"SM\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SN\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"SO\": [\n \"h\",\n \"H\"\n ],\n \"SR\": [\n \"H\",\n \"hB\"\n ],\n \"SS\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ST\": [\n \"H\",\n \"hB\"\n ],\n \"SV\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"SX\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"SY\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"SZ\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"TC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TD\": [\n \"h\",\n \"H\",\n \"hB\"\n ],\n \"TF\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"TG\": [\n \"H\",\n \"hB\"\n ],\n \"TH\": [\n \"H\",\n \"h\"\n ],\n \"TJ\": [\n \"H\",\n \"h\"\n ],\n \"TL\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ],\n \"TM\": [\n \"H\",\n \"h\"\n ],\n \"TN\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"TO\": [\n \"h\",\n \"H\"\n ],\n \"TR\": [\n \"H\",\n \"hB\"\n ],\n \"TT\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"TW\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"TZ\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UA\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"UG\": [\n \"hB\",\n \"hb\",\n \"H\",\n \"h\"\n ],\n \"UM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"US\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"UY\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"UZ\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"VA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"VC\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VE\": [\n \"h\",\n \"H\",\n \"hB\",\n \"hb\"\n ],\n \"VG\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VI\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"VN\": [\n \"H\",\n \"h\"\n ],\n \"VU\": [\n \"h\",\n \"H\"\n ],\n \"WF\": [\n \"H\",\n \"hB\"\n ],\n \"WS\": [\n \"h\",\n \"H\"\n ],\n \"XK\": [\n \"H\",\n \"hB\",\n \"h\"\n ],\n \"YE\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"YT\": [\n \"H\",\n \"hB\"\n ],\n \"ZA\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"ZM\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"ZW\": [\n \"H\",\n \"h\"\n ],\n \"af-ZA\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"ar-001\": [\n \"h\",\n \"hB\",\n \"hb\",\n \"H\"\n ],\n \"ca-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"en-001\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-HK\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"en-IL\": [\n \"H\",\n \"h\",\n \"hb\",\n \"hB\"\n ],\n \"en-MY\": [\n \"h\",\n \"hb\",\n \"H\",\n \"hB\"\n ],\n \"es-BR\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-ES\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"es-GQ\": [\n \"H\",\n \"h\",\n \"hB\",\n \"hb\"\n ],\n \"fr-CA\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gl-ES\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"gu-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"hi-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"it-CH\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"it-IT\": [\n \"H\",\n \"h\",\n \"hB\"\n ],\n \"kn-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"ml-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"mr-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"pa-IN\": [\n \"hB\",\n \"hb\",\n \"h\",\n \"H\"\n ],\n \"ta-IN\": [\n \"hB\",\n \"h\",\n \"hb\",\n \"H\"\n ],\n \"te-IN\": [\n \"hB\",\n \"h\",\n \"H\"\n ],\n \"zu-ZA\": [\n \"H\",\n \"hB\",\n \"hb\",\n \"h\"\n ]\n};\n","import { timeData } from './time-data.generated';\n/**\n * Returns the best matching date time pattern if a date time skeleton\n * pattern is provided with a locale. Follows the Unicode specification:\n * https://www.unicode.org/reports/tr35/tr35-dates.html#table-mapping-requested-time-skeletons-to-patterns\n * @param skeleton date time skeleton pattern that possibly includes j, J or C\n * @param locale\n */\nexport function getBestPattern(skeleton, locale) {\n var skeletonCopy = '';\n for (var patternPos = 0; patternPos < skeleton.length; patternPos++) {\n var patternChar = skeleton.charAt(patternPos);\n if (patternChar === 'j') {\n var extraLength = 0;\n while (patternPos + 1 < skeleton.length &&\n skeleton.charAt(patternPos + 1) === patternChar) {\n extraLength++;\n patternPos++;\n }\n var hourLen = 1 + (extraLength & 1);\n var dayPeriodLen = extraLength < 2 ? 1 : 3 + (extraLength >> 1);\n var dayPeriodChar = 'a';\n var hourChar = getDefaultHourSymbolFromLocale(locale);\n if (hourChar == 'H' || hourChar == 'k') {\n dayPeriodLen = 0;\n }\n while (dayPeriodLen-- > 0) {\n skeletonCopy += dayPeriodChar;\n }\n while (hourLen-- > 0) {\n skeletonCopy = hourChar + skeletonCopy;\n }\n }\n else if (patternChar === 'J') {\n skeletonCopy += 'H';\n }\n else {\n skeletonCopy += patternChar;\n }\n }\n return skeletonCopy;\n}\n/**\n * Maps the [hour cycle type](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/Locale/hourCycle)\n * of the given `locale` to the corresponding time pattern.\n * @param locale\n */\nfunction getDefaultHourSymbolFromLocale(locale) {\n var hourCycle = locale.hourCycle;\n if (hourCycle === undefined &&\n // @ts-ignore hourCycle(s) is not identified yet\n locale.hourCycles &&\n // @ts-ignore\n locale.hourCycles.length) {\n // @ts-ignore\n hourCycle = locale.hourCycles[0];\n }\n if (hourCycle) {\n switch (hourCycle) {\n case 'h24':\n return 'k';\n case 'h23':\n return 'H';\n case 'h12':\n return 'h';\n case 'h11':\n return 'K';\n default:\n throw new Error('Invalid hourCycle');\n }\n }\n // TODO: Once hourCycle is fully supported remove the following with data generation\n var languageTag = locale.language;\n var regionTag;\n if (languageTag !== 'root') {\n regionTag = locale.maximize().region;\n }\n var hourCycles = timeData[regionTag || ''] ||\n timeData[languageTag || ''] ||\n timeData[\"\".concat(languageTag, \"-001\")] ||\n timeData['001'];\n return hourCycles[0];\n}\n","var _a;\nimport { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { SKELETON_TYPE, TYPE, } from './types';\nimport { SPACE_SEPARATOR_REGEX } from './regex.generated';\nimport { parseNumberSkeleton, parseNumberSkeletonFromString, parseDateTimeSkeleton, } from '@formatjs/icu-skeleton-parser';\nimport { getBestPattern } from './date-time-pattern-generator';\nvar SPACE_SEPARATOR_START_REGEX = new RegExp(\"^\".concat(SPACE_SEPARATOR_REGEX.source, \"*\"));\nvar SPACE_SEPARATOR_END_REGEX = new RegExp(\"\".concat(SPACE_SEPARATOR_REGEX.source, \"*$\"));\nfunction createLocation(start, end) {\n return { start: start, end: end };\n}\n// #region Ponyfills\n// Consolidate these variables up top for easier toggling during debugging\nvar hasNativeStartsWith = !!String.prototype.startsWith && '_a'.startsWith('a', 1);\nvar hasNativeFromCodePoint = !!String.fromCodePoint;\nvar hasNativeFromEntries = !!Object.fromEntries;\nvar hasNativeCodePointAt = !!String.prototype.codePointAt;\nvar hasTrimStart = !!String.prototype.trimStart;\nvar hasTrimEnd = !!String.prototype.trimEnd;\nvar hasNativeIsSafeInteger = !!Number.isSafeInteger;\nvar isSafeInteger = hasNativeIsSafeInteger\n ? Number.isSafeInteger\n : function (n) {\n return (typeof n === 'number' &&\n isFinite(n) &&\n Math.floor(n) === n &&\n Math.abs(n) <= 0x1fffffffffffff);\n };\n// IE11 does not support y and u.\nvar REGEX_SUPPORTS_U_AND_Y = true;\ntry {\n var re = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n /**\n * legacy Edge or Xbox One browser\n * Unicode flag support: supported\n * Pattern_Syntax support: not supported\n * See https://github.com/formatjs/formatjs/issues/2822\n */\n REGEX_SUPPORTS_U_AND_Y = ((_a = re.exec('a')) === null || _a === void 0 ? void 0 : _a[0]) === 'a';\n}\ncatch (_) {\n REGEX_SUPPORTS_U_AND_Y = false;\n}\nvar startsWith = hasNativeStartsWith\n ? // Native\n function startsWith(s, search, position) {\n return s.startsWith(search, position);\n }\n : // For IE11\n function startsWith(s, search, position) {\n return s.slice(position, position + search.length) === search;\n };\nvar fromCodePoint = hasNativeFromCodePoint\n ? String.fromCodePoint\n : // IE11\n function fromCodePoint() {\n var codePoints = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n codePoints[_i] = arguments[_i];\n }\n var elements = '';\n var length = codePoints.length;\n var i = 0;\n var code;\n while (length > i) {\n code = codePoints[i++];\n if (code > 0x10ffff)\n throw RangeError(code + ' is not a valid code point');\n elements +=\n code < 0x10000\n ? String.fromCharCode(code)\n : String.fromCharCode(((code -= 0x10000) >> 10) + 0xd800, (code % 0x400) + 0xdc00);\n }\n return elements;\n };\nvar fromEntries = \n// native\nhasNativeFromEntries\n ? Object.fromEntries\n : // Ponyfill\n function fromEntries(entries) {\n var obj = {};\n for (var _i = 0, entries_1 = entries; _i < entries_1.length; _i++) {\n var _a = entries_1[_i], k = _a[0], v = _a[1];\n obj[k] = v;\n }\n return obj;\n };\nvar codePointAt = hasNativeCodePointAt\n ? // Native\n function codePointAt(s, index) {\n return s.codePointAt(index);\n }\n : // IE 11\n function codePointAt(s, index) {\n var size = s.length;\n if (index < 0 || index >= size) {\n return undefined;\n }\n var first = s.charCodeAt(index);\n var second;\n return first < 0xd800 ||\n first > 0xdbff ||\n index + 1 === size ||\n (second = s.charCodeAt(index + 1)) < 0xdc00 ||\n second > 0xdfff\n ? first\n : ((first - 0xd800) << 10) + (second - 0xdc00) + 0x10000;\n };\nvar trimStart = hasTrimStart\n ? // Native\n function trimStart(s) {\n return s.trimStart();\n }\n : // Ponyfill\n function trimStart(s) {\n return s.replace(SPACE_SEPARATOR_START_REGEX, '');\n };\nvar trimEnd = hasTrimEnd\n ? // Native\n function trimEnd(s) {\n return s.trimEnd();\n }\n : // Ponyfill\n function trimEnd(s) {\n return s.replace(SPACE_SEPARATOR_END_REGEX, '');\n };\n// Prevent minifier to translate new RegExp to literal form that might cause syntax error on IE11.\nfunction RE(s, flag) {\n return new RegExp(s, flag);\n}\n// #endregion\nvar matchIdentifierAtIndex;\nif (REGEX_SUPPORTS_U_AND_Y) {\n // Native\n var IDENTIFIER_PREFIX_RE_1 = RE('([^\\\\p{White_Space}\\\\p{Pattern_Syntax}]*)', 'yu');\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var _a;\n IDENTIFIER_PREFIX_RE_1.lastIndex = index;\n var match = IDENTIFIER_PREFIX_RE_1.exec(s);\n return (_a = match[1]) !== null && _a !== void 0 ? _a : '';\n };\n}\nelse {\n // IE11\n matchIdentifierAtIndex = function matchIdentifierAtIndex(s, index) {\n var match = [];\n while (true) {\n var c = codePointAt(s, index);\n if (c === undefined || _isWhiteSpace(c) || _isPatternSyntax(c)) {\n break;\n }\n match.push(c);\n index += c >= 0x10000 ? 2 : 1;\n }\n return fromCodePoint.apply(void 0, match);\n };\n}\nvar Parser = /** @class */ (function () {\n function Parser(message, options) {\n if (options === void 0) { options = {}; }\n this.message = message;\n this.position = { offset: 0, line: 1, column: 1 };\n this.ignoreTag = !!options.ignoreTag;\n this.locale = options.locale;\n this.requiresOtherClause = !!options.requiresOtherClause;\n this.shouldParseSkeletons = !!options.shouldParseSkeletons;\n }\n Parser.prototype.parse = function () {\n if (this.offset() !== 0) {\n throw Error('parser can only be used once');\n }\n return this.parseMessage(0, '', false);\n };\n Parser.prototype.parseMessage = function (nestingLevel, parentArgType, expectingCloseTag) {\n var elements = [];\n while (!this.isEOF()) {\n var char = this.char();\n if (char === 123 /* `{` */) {\n var result = this.parseArgument(nestingLevel, expectingCloseTag);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else if (char === 125 /* `}` */ && nestingLevel > 0) {\n break;\n }\n else if (char === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) {\n var position = this.clonePosition();\n this.bump();\n elements.push({\n type: TYPE.pound,\n location: createLocation(position, this.clonePosition()),\n });\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n this.peek() === 47 // char code for '/'\n ) {\n if (expectingCloseTag) {\n break;\n }\n else {\n return this.error(ErrorKind.UNMATCHED_CLOSING_TAG, createLocation(this.clonePosition(), this.clonePosition()));\n }\n }\n else if (char === 60 /* `<` */ &&\n !this.ignoreTag &&\n _isAlpha(this.peek() || 0)) {\n var result = this.parseTag(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n else {\n var result = this.parseLiteral(nestingLevel, parentArgType);\n if (result.err) {\n return result;\n }\n elements.push(result.val);\n }\n }\n return { val: elements, err: null };\n };\n /**\n * A tag name must start with an ASCII lower/upper case letter. The grammar is based on the\n * [custom element name][] except that a dash is NOT always mandatory and uppercase letters\n * are accepted:\n *\n * ```\n * tag ::= \"<\" tagName (whitespace)* \"/>\" | \"<\" tagName (whitespace)* \">\" message \"\"\n * tagName ::= [a-z] (PENChar)*\n * PENChar ::=\n * \"-\" | \".\" | [0-9] | \"_\" | [a-z] | [A-Z] | #xB7 | [#xC0-#xD6] | [#xD8-#xF6] | [#xF8-#x37D] |\n * [#x37F-#x1FFF] | [#x200C-#x200D] | [#x203F-#x2040] | [#x2070-#x218F] | [#x2C00-#x2FEF] |\n * [#x3001-#xD7FF] | [#xF900-#xFDCF] | [#xFDF0-#xFFFD] | [#x10000-#xEFFFF]\n * ```\n *\n * [custom element name]: https://html.spec.whatwg.org/multipage/custom-elements.html#valid-custom-element-name\n * NOTE: We're a bit more lax here since HTML technically does not allow uppercase HTML element but we do\n * since other tag-based engines like React allow it\n */\n Parser.prototype.parseTag = function (nestingLevel, parentArgType) {\n var startPosition = this.clonePosition();\n this.bump(); // `<`\n var tagName = this.parseTagName();\n this.bumpSpace();\n if (this.bumpIf('/>')) {\n // Self closing tag\n return {\n val: {\n type: TYPE.literal,\n value: \"<\".concat(tagName, \"/>\"),\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else if (this.bumpIf('>')) {\n var childrenResult = this.parseMessage(nestingLevel + 1, parentArgType, true);\n if (childrenResult.err) {\n return childrenResult;\n }\n var children = childrenResult.val;\n // Expecting a close tag\n var endTagStartPosition = this.clonePosition();\n if (this.bumpIf('')) {\n return this.error(ErrorKind.INVALID_TAG, createLocation(endTagStartPosition, this.clonePosition()));\n }\n return {\n val: {\n type: TYPE.tag,\n value: tagName,\n children: children,\n location: createLocation(startPosition, this.clonePosition()),\n },\n err: null,\n };\n }\n else {\n return this.error(ErrorKind.UNCLOSED_TAG, createLocation(startPosition, this.clonePosition()));\n }\n }\n else {\n return this.error(ErrorKind.INVALID_TAG, createLocation(startPosition, this.clonePosition()));\n }\n };\n /**\n * This method assumes that the caller has peeked ahead for the first tag character.\n */\n Parser.prototype.parseTagName = function () {\n var startOffset = this.offset();\n this.bump(); // the first tag name character\n while (!this.isEOF() && _isPotentialElementNameChar(this.char())) {\n this.bump();\n }\n return this.message.slice(startOffset, this.offset());\n };\n Parser.prototype.parseLiteral = function (nestingLevel, parentArgType) {\n var start = this.clonePosition();\n var value = '';\n while (true) {\n var parseQuoteResult = this.tryParseQuote(parentArgType);\n if (parseQuoteResult) {\n value += parseQuoteResult;\n continue;\n }\n var parseUnquotedResult = this.tryParseUnquoted(nestingLevel, parentArgType);\n if (parseUnquotedResult) {\n value += parseUnquotedResult;\n continue;\n }\n var parseLeftAngleResult = this.tryParseLeftAngleBracket();\n if (parseLeftAngleResult) {\n value += parseLeftAngleResult;\n continue;\n }\n break;\n }\n var location = createLocation(start, this.clonePosition());\n return {\n val: { type: TYPE.literal, value: value, location: location },\n err: null,\n };\n };\n Parser.prototype.tryParseLeftAngleBracket = function () {\n if (!this.isEOF() &&\n this.char() === 60 /* `<` */ &&\n (this.ignoreTag ||\n // If at the opening tag or closing tag position, bail.\n !_isAlphaOrSlash(this.peek() || 0))) {\n this.bump(); // `<`\n return '<';\n }\n return null;\n };\n /**\n * Starting with ICU 4.8, an ASCII apostrophe only starts quoted text if it immediately precedes\n * a character that requires quoting (that is, \"only where needed\"), and works the same in\n * nested messages as on the top level of the pattern. The new behavior is otherwise compatible.\n */\n Parser.prototype.tryParseQuote = function (parentArgType) {\n if (this.isEOF() || this.char() !== 39 /* `'` */) {\n return null;\n }\n // Parse escaped char following the apostrophe, or early return if there is no escaped char.\n // Check if is valid escaped character\n switch (this.peek()) {\n case 39 /* `'` */:\n // double quote, should return as a single quote.\n this.bump();\n this.bump();\n return \"'\";\n // '{', '<', '>', '}'\n case 123:\n case 60:\n case 62:\n case 125:\n break;\n case 35: // '#'\n if (parentArgType === 'plural' || parentArgType === 'selectordinal') {\n break;\n }\n return null;\n default:\n return null;\n }\n this.bump(); // apostrophe\n var codePoints = [this.char()]; // escaped char\n this.bump();\n // read chars until the optional closing apostrophe is found\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch === 39 /* `'` */) {\n if (this.peek() === 39 /* `'` */) {\n codePoints.push(39);\n // Bump one more time because we need to skip 2 characters.\n this.bump();\n }\n else {\n // Optional closing apostrophe.\n this.bump();\n break;\n }\n }\n else {\n codePoints.push(ch);\n }\n this.bump();\n }\n return fromCodePoint.apply(void 0, codePoints);\n };\n Parser.prototype.tryParseUnquoted = function (nestingLevel, parentArgType) {\n if (this.isEOF()) {\n return null;\n }\n var ch = this.char();\n if (ch === 60 /* `<` */ ||\n ch === 123 /* `{` */ ||\n (ch === 35 /* `#` */ &&\n (parentArgType === 'plural' || parentArgType === 'selectordinal')) ||\n (ch === 125 /* `}` */ && nestingLevel > 0)) {\n return null;\n }\n else {\n this.bump();\n return fromCodePoint(ch);\n }\n };\n Parser.prototype.parseArgument = function (nestingLevel, expectingCloseTag) {\n var openingBracePosition = this.clonePosition();\n this.bump(); // `{`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n if (this.char() === 125 /* `}` */) {\n this.bump();\n return this.error(ErrorKind.EMPTY_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n // argument name\n var value = this.parseIdentifierIfPossible().value;\n if (!value) {\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n switch (this.char()) {\n // Simple argument: `{name}`\n case 125 /* `}` */: {\n this.bump(); // `}`\n return {\n val: {\n type: TYPE.argument,\n // value does not include the opening and closing braces.\n value: value,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n err: null,\n };\n }\n // Argument with options: `{name, format, ...}`\n case 44 /* `,` */: {\n this.bump(); // `,`\n this.bumpSpace();\n if (this.isEOF()) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n return this.parseArgumentOptions(nestingLevel, expectingCloseTag, value, openingBracePosition);\n }\n default:\n return this.error(ErrorKind.MALFORMED_ARGUMENT, createLocation(openingBracePosition, this.clonePosition()));\n }\n };\n /**\n * Advance the parser until the end of the identifier, if it is currently on\n * an identifier character. Return an empty string otherwise.\n */\n Parser.prototype.parseIdentifierIfPossible = function () {\n var startingPosition = this.clonePosition();\n var startOffset = this.offset();\n var value = matchIdentifierAtIndex(this.message, startOffset);\n var endOffset = startOffset + value.length;\n this.bumpTo(endOffset);\n var endPosition = this.clonePosition();\n var location = createLocation(startingPosition, endPosition);\n return { value: value, location: location };\n };\n Parser.prototype.parseArgumentOptions = function (nestingLevel, expectingCloseTag, value, openingBracePosition) {\n var _a;\n // Parse this range:\n // {name, type, style}\n // ^---^\n var typeStartPosition = this.clonePosition();\n var argType = this.parseIdentifierIfPossible().value;\n var typeEndPosition = this.clonePosition();\n switch (argType) {\n case '':\n // Expecting a style string number, date, time, plural, selectordinal, or select.\n return this.error(ErrorKind.EXPECT_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n case 'number':\n case 'date':\n case 'time': {\n // Parse this range:\n // {name, number, style}\n // ^-------^\n this.bumpSpace();\n var styleAndLocation = null;\n if (this.bumpIf(',')) {\n this.bumpSpace();\n var styleStartPosition = this.clonePosition();\n var result = this.parseSimpleArgStyleIfPossible();\n if (result.err) {\n return result;\n }\n var style = trimEnd(result.val);\n if (style.length === 0) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_STYLE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var styleLocation = createLocation(styleStartPosition, this.clonePosition());\n styleAndLocation = { style: style, styleLocation: styleLocation };\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_1 = createLocation(openingBracePosition, this.clonePosition());\n // Extract style or skeleton\n if (styleAndLocation && startsWith(styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style, '::', 0)) {\n // Skeleton starts with `::`.\n var skeleton = trimStart(styleAndLocation.style.slice(2));\n if (argType === 'number') {\n var result = this.parseNumberSkeletonFromString(skeleton, styleAndLocation.styleLocation);\n if (result.err) {\n return result;\n }\n return {\n val: { type: TYPE.number, value: value, location: location_1, style: result.val },\n err: null,\n };\n }\n else {\n if (skeleton.length === 0) {\n return this.error(ErrorKind.EXPECT_DATE_TIME_SKELETON, location_1);\n }\n var dateTimePattern = skeleton;\n // Get \"best match\" pattern only if locale is passed, if not, let it\n // pass as-is where `parseDateTimeSkeleton()` will throw an error\n // for unsupported patterns.\n if (this.locale) {\n dateTimePattern = getBestPattern(skeleton, this.locale);\n }\n var style = {\n type: SKELETON_TYPE.dateTime,\n pattern: dateTimePattern,\n location: styleAndLocation.styleLocation,\n parsedOptions: this.shouldParseSkeletons\n ? parseDateTimeSkeleton(dateTimePattern)\n : {},\n };\n var type = argType === 'date' ? TYPE.date : TYPE.time;\n return {\n val: { type: type, value: value, location: location_1, style: style },\n err: null,\n };\n }\n }\n // Regular style or no style.\n return {\n val: {\n type: argType === 'number'\n ? TYPE.number\n : argType === 'date'\n ? TYPE.date\n : TYPE.time,\n value: value,\n location: location_1,\n style: (_a = styleAndLocation === null || styleAndLocation === void 0 ? void 0 : styleAndLocation.style) !== null && _a !== void 0 ? _a : null,\n },\n err: null,\n };\n }\n case 'plural':\n case 'selectordinal':\n case 'select': {\n // Parse this range:\n // {name, plural, options}\n // ^---------^\n var typeEndPosition_1 = this.clonePosition();\n this.bumpSpace();\n if (!this.bumpIf(',')) {\n return this.error(ErrorKind.EXPECT_SELECT_ARGUMENT_OPTIONS, createLocation(typeEndPosition_1, __assign({}, typeEndPosition_1)));\n }\n this.bumpSpace();\n // Parse offset:\n // {name, plural, offset:1, options}\n // ^-----^\n //\n // or the first option:\n //\n // {name, plural, one {...} other {...}}\n // ^--^\n var identifierAndLocation = this.parseIdentifierIfPossible();\n var pluralOffset = 0;\n if (argType !== 'select' && identifierAndLocation.value === 'offset') {\n if (!this.bumpIf(':')) {\n return this.error(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n this.bumpSpace();\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_OFFSET_VALUE, ErrorKind.INVALID_PLURAL_ARGUMENT_OFFSET_VALUE);\n if (result.err) {\n return result;\n }\n // Parse another identifier for option parsing\n this.bumpSpace();\n identifierAndLocation = this.parseIdentifierIfPossible();\n pluralOffset = result.val;\n }\n var optionsResult = this.tryParsePluralOrSelectOptions(nestingLevel, argType, expectingCloseTag, identifierAndLocation);\n if (optionsResult.err) {\n return optionsResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n var location_2 = createLocation(openingBracePosition, this.clonePosition());\n if (argType === 'select') {\n return {\n val: {\n type: TYPE.select,\n value: value,\n options: fromEntries(optionsResult.val),\n location: location_2,\n },\n err: null,\n };\n }\n else {\n return {\n val: {\n type: TYPE.plural,\n value: value,\n options: fromEntries(optionsResult.val),\n offset: pluralOffset,\n pluralType: argType === 'plural' ? 'cardinal' : 'ordinal',\n location: location_2,\n },\n err: null,\n };\n }\n }\n default:\n return this.error(ErrorKind.INVALID_ARGUMENT_TYPE, createLocation(typeStartPosition, typeEndPosition));\n }\n };\n Parser.prototype.tryParseArgumentClose = function (openingBracePosition) {\n // Parse: {value, number, ::currency/GBP }\n //\n if (this.isEOF() || this.char() !== 125 /* `}` */) {\n return this.error(ErrorKind.EXPECT_ARGUMENT_CLOSING_BRACE, createLocation(openingBracePosition, this.clonePosition()));\n }\n this.bump(); // `}`\n return { val: true, err: null };\n };\n /**\n * See: https://github.com/unicode-org/icu/blob/af7ed1f6d2298013dc303628438ec4abe1f16479/icu4c/source/common/messagepattern.cpp#L659\n */\n Parser.prototype.parseSimpleArgStyleIfPossible = function () {\n var nestedBraces = 0;\n var startPosition = this.clonePosition();\n while (!this.isEOF()) {\n var ch = this.char();\n switch (ch) {\n case 39 /* `'` */: {\n // Treat apostrophe as quoting but include it in the style part.\n // Find the end of the quoted literal text.\n this.bump();\n var apostrophePosition = this.clonePosition();\n if (!this.bumpUntil(\"'\")) {\n return this.error(ErrorKind.UNCLOSED_QUOTE_IN_ARGUMENT_STYLE, createLocation(apostrophePosition, this.clonePosition()));\n }\n this.bump();\n break;\n }\n case 123 /* `{` */: {\n nestedBraces += 1;\n this.bump();\n break;\n }\n case 125 /* `}` */: {\n if (nestedBraces > 0) {\n nestedBraces -= 1;\n }\n else {\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n }\n break;\n }\n default:\n this.bump();\n break;\n }\n }\n return {\n val: this.message.slice(startPosition.offset, this.offset()),\n err: null,\n };\n };\n Parser.prototype.parseNumberSkeletonFromString = function (skeleton, location) {\n var tokens = [];\n try {\n tokens = parseNumberSkeletonFromString(skeleton);\n }\n catch (e) {\n return this.error(ErrorKind.INVALID_NUMBER_SKELETON, location);\n }\n return {\n val: {\n type: SKELETON_TYPE.number,\n tokens: tokens,\n location: location,\n parsedOptions: this.shouldParseSkeletons\n ? parseNumberSkeleton(tokens)\n : {},\n },\n err: null,\n };\n };\n /**\n * @param nesting_level The current nesting level of messages.\n * This can be positive when parsing message fragment in select or plural argument options.\n * @param parent_arg_type The parent argument's type.\n * @param parsed_first_identifier If provided, this is the first identifier-like selector of\n * the argument. It is a by-product of a previous parsing attempt.\n * @param expecting_close_tag If true, this message is directly or indirectly nested inside\n * between a pair of opening and closing tags. The nested message will not parse beyond\n * the closing tag boundary.\n */\n Parser.prototype.tryParsePluralOrSelectOptions = function (nestingLevel, parentArgType, expectCloseTag, parsedFirstIdentifier) {\n var _a;\n var hasOtherClause = false;\n var options = [];\n var parsedSelectors = new Set();\n var selector = parsedFirstIdentifier.value, selectorLocation = parsedFirstIdentifier.location;\n // Parse:\n // one {one apple}\n // ^--^\n while (true) {\n if (selector.length === 0) {\n var startPosition = this.clonePosition();\n if (parentArgType !== 'select' && this.bumpIf('=')) {\n // Try parse `={number}` selector\n var result = this.tryParseDecimalInteger(ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, ErrorKind.INVALID_PLURAL_ARGUMENT_SELECTOR);\n if (result.err) {\n return result;\n }\n selectorLocation = createLocation(startPosition, this.clonePosition());\n selector = this.message.slice(startPosition.offset, this.offset());\n }\n else {\n break;\n }\n }\n // Duplicate selector clauses\n if (parsedSelectors.has(selector)) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.DUPLICATE_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.DUPLICATE_PLURAL_ARGUMENT_SELECTOR, selectorLocation);\n }\n if (selector === 'other') {\n hasOtherClause = true;\n }\n // Parse:\n // one {one apple}\n // ^----------^\n this.bumpSpace();\n var openingBracePosition = this.clonePosition();\n if (!this.bumpIf('{')) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR_FRAGMENT\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR_FRAGMENT, createLocation(this.clonePosition(), this.clonePosition()));\n }\n var fragmentResult = this.parseMessage(nestingLevel + 1, parentArgType, expectCloseTag);\n if (fragmentResult.err) {\n return fragmentResult;\n }\n var argCloseResult = this.tryParseArgumentClose(openingBracePosition);\n if (argCloseResult.err) {\n return argCloseResult;\n }\n options.push([\n selector,\n {\n value: fragmentResult.val,\n location: createLocation(openingBracePosition, this.clonePosition()),\n },\n ]);\n // Keep track of the existing selectors\n parsedSelectors.add(selector);\n // Prep next selector clause.\n this.bumpSpace();\n (_a = this.parseIdentifierIfPossible(), selector = _a.value, selectorLocation = _a.location);\n }\n if (options.length === 0) {\n return this.error(parentArgType === 'select'\n ? ErrorKind.EXPECT_SELECT_ARGUMENT_SELECTOR\n : ErrorKind.EXPECT_PLURAL_ARGUMENT_SELECTOR, createLocation(this.clonePosition(), this.clonePosition()));\n }\n if (this.requiresOtherClause && !hasOtherClause) {\n return this.error(ErrorKind.MISSING_OTHER_CLAUSE, createLocation(this.clonePosition(), this.clonePosition()));\n }\n return { val: options, err: null };\n };\n Parser.prototype.tryParseDecimalInteger = function (expectNumberError, invalidNumberError) {\n var sign = 1;\n var startingPosition = this.clonePosition();\n if (this.bumpIf('+')) {\n }\n else if (this.bumpIf('-')) {\n sign = -1;\n }\n var hasDigits = false;\n var decimal = 0;\n while (!this.isEOF()) {\n var ch = this.char();\n if (ch >= 48 /* `0` */ && ch <= 57 /* `9` */) {\n hasDigits = true;\n decimal = decimal * 10 + (ch - 48);\n this.bump();\n }\n else {\n break;\n }\n }\n var location = createLocation(startingPosition, this.clonePosition());\n if (!hasDigits) {\n return this.error(expectNumberError, location);\n }\n decimal *= sign;\n if (!isSafeInteger(decimal)) {\n return this.error(invalidNumberError, location);\n }\n return { val: decimal, err: null };\n };\n Parser.prototype.offset = function () {\n return this.position.offset;\n };\n Parser.prototype.isEOF = function () {\n return this.offset() === this.message.length;\n };\n Parser.prototype.clonePosition = function () {\n // This is much faster than `Object.assign` or spread.\n return {\n offset: this.position.offset,\n line: this.position.line,\n column: this.position.column,\n };\n };\n /**\n * Return the code point at the current position of the parser.\n * Throws if the index is out of bound.\n */\n Parser.prototype.char = function () {\n var offset = this.position.offset;\n if (offset >= this.message.length) {\n throw Error('out of bound');\n }\n var code = codePointAt(this.message, offset);\n if (code === undefined) {\n throw Error(\"Offset \".concat(offset, \" is at invalid UTF-16 code unit boundary\"));\n }\n return code;\n };\n Parser.prototype.error = function (kind, location) {\n return {\n val: null,\n err: {\n kind: kind,\n message: this.message,\n location: location,\n },\n };\n };\n /** Bump the parser to the next UTF-16 code unit. */\n Parser.prototype.bump = function () {\n if (this.isEOF()) {\n return;\n }\n var code = this.char();\n if (code === 10 /* '\\n' */) {\n this.position.line += 1;\n this.position.column = 1;\n this.position.offset += 1;\n }\n else {\n this.position.column += 1;\n // 0 ~ 0x10000 -> unicode BMP, otherwise skip the surrogate pair.\n this.position.offset += code < 0x10000 ? 1 : 2;\n }\n };\n /**\n * If the substring starting at the current position of the parser has\n * the given prefix, then bump the parser to the character immediately\n * following the prefix and return true. Otherwise, don't bump the parser\n * and return false.\n */\n Parser.prototype.bumpIf = function (prefix) {\n if (startsWith(this.message, prefix, this.offset())) {\n for (var i = 0; i < prefix.length; i++) {\n this.bump();\n }\n return true;\n }\n return false;\n };\n /**\n * Bump the parser until the pattern character is found and return `true`.\n * Otherwise bump to the end of the file and return `false`.\n */\n Parser.prototype.bumpUntil = function (pattern) {\n var currentOffset = this.offset();\n var index = this.message.indexOf(pattern, currentOffset);\n if (index >= 0) {\n this.bumpTo(index);\n return true;\n }\n else {\n this.bumpTo(this.message.length);\n return false;\n }\n };\n /**\n * Bump the parser to the target offset.\n * If target offset is beyond the end of the input, bump the parser to the end of the input.\n */\n Parser.prototype.bumpTo = function (targetOffset) {\n if (this.offset() > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" must be greater than or equal to the current offset \").concat(this.offset()));\n }\n targetOffset = Math.min(targetOffset, this.message.length);\n while (true) {\n var offset = this.offset();\n if (offset === targetOffset) {\n break;\n }\n if (offset > targetOffset) {\n throw Error(\"targetOffset \".concat(targetOffset, \" is at invalid UTF-16 code unit boundary\"));\n }\n this.bump();\n if (this.isEOF()) {\n break;\n }\n }\n };\n /** advance the parser through all whitespace to the next non-whitespace code unit. */\n Parser.prototype.bumpSpace = function () {\n while (!this.isEOF() && _isWhiteSpace(this.char())) {\n this.bump();\n }\n };\n /**\n * Peek at the *next* Unicode codepoint in the input without advancing the parser.\n * If the input has been exhausted, then this returns null.\n */\n Parser.prototype.peek = function () {\n if (this.isEOF()) {\n return null;\n }\n var code = this.char();\n var offset = this.offset();\n var nextCode = this.message.charCodeAt(offset + (code >= 0x10000 ? 2 : 1));\n return nextCode !== null && nextCode !== void 0 ? nextCode : null;\n };\n return Parser;\n}());\nexport { Parser };\n/**\n * This check if codepoint is alphabet (lower & uppercase)\n * @param codepoint\n * @returns\n */\nfunction _isAlpha(codepoint) {\n return ((codepoint >= 97 && codepoint <= 122) ||\n (codepoint >= 65 && codepoint <= 90));\n}\nfunction _isAlphaOrSlash(codepoint) {\n return _isAlpha(codepoint) || codepoint === 47; /* '/' */\n}\n/** See `parseTag` function docs. */\nfunction _isPotentialElementNameChar(c) {\n return (c === 45 /* '-' */ ||\n c === 46 /* '.' */ ||\n (c >= 48 && c <= 57) /* 0..9 */ ||\n c === 95 /* '_' */ ||\n (c >= 97 && c <= 122) /** a..z */ ||\n (c >= 65 && c <= 90) /* A..Z */ ||\n c == 0xb7 ||\n (c >= 0xc0 && c <= 0xd6) ||\n (c >= 0xd8 && c <= 0xf6) ||\n (c >= 0xf8 && c <= 0x37d) ||\n (c >= 0x37f && c <= 0x1fff) ||\n (c >= 0x200c && c <= 0x200d) ||\n (c >= 0x203f && c <= 0x2040) ||\n (c >= 0x2070 && c <= 0x218f) ||\n (c >= 0x2c00 && c <= 0x2fef) ||\n (c >= 0x3001 && c <= 0xd7ff) ||\n (c >= 0xf900 && c <= 0xfdcf) ||\n (c >= 0xfdf0 && c <= 0xfffd) ||\n (c >= 0x10000 && c <= 0xeffff));\n}\n/**\n * Code point equivalent of regex `\\p{White_Space}`.\n * From: https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isWhiteSpace(c) {\n return ((c >= 0x0009 && c <= 0x000d) ||\n c === 0x0020 ||\n c === 0x0085 ||\n (c >= 0x200e && c <= 0x200f) ||\n c === 0x2028 ||\n c === 0x2029);\n}\n/**\n * Code point equivalent of regex `\\p{Pattern_Syntax}`.\n * See https://www.unicode.org/Public/UCD/latest/ucd/PropList.txt\n */\nfunction _isPatternSyntax(c) {\n return ((c >= 0x0021 && c <= 0x0023) ||\n c === 0x0024 ||\n (c >= 0x0025 && c <= 0x0027) ||\n c === 0x0028 ||\n c === 0x0029 ||\n c === 0x002a ||\n c === 0x002b ||\n c === 0x002c ||\n c === 0x002d ||\n (c >= 0x002e && c <= 0x002f) ||\n (c >= 0x003a && c <= 0x003b) ||\n (c >= 0x003c && c <= 0x003e) ||\n (c >= 0x003f && c <= 0x0040) ||\n c === 0x005b ||\n c === 0x005c ||\n c === 0x005d ||\n c === 0x005e ||\n c === 0x0060 ||\n c === 0x007b ||\n c === 0x007c ||\n c === 0x007d ||\n c === 0x007e ||\n c === 0x00a1 ||\n (c >= 0x00a2 && c <= 0x00a5) ||\n c === 0x00a6 ||\n c === 0x00a7 ||\n c === 0x00a9 ||\n c === 0x00ab ||\n c === 0x00ac ||\n c === 0x00ae ||\n c === 0x00b0 ||\n c === 0x00b1 ||\n c === 0x00b6 ||\n c === 0x00bb ||\n c === 0x00bf ||\n c === 0x00d7 ||\n c === 0x00f7 ||\n (c >= 0x2010 && c <= 0x2015) ||\n (c >= 0x2016 && c <= 0x2017) ||\n c === 0x2018 ||\n c === 0x2019 ||\n c === 0x201a ||\n (c >= 0x201b && c <= 0x201c) ||\n c === 0x201d ||\n c === 0x201e ||\n c === 0x201f ||\n (c >= 0x2020 && c <= 0x2027) ||\n (c >= 0x2030 && c <= 0x2038) ||\n c === 0x2039 ||\n c === 0x203a ||\n (c >= 0x203b && c <= 0x203e) ||\n (c >= 0x2041 && c <= 0x2043) ||\n c === 0x2044 ||\n c === 0x2045 ||\n c === 0x2046 ||\n (c >= 0x2047 && c <= 0x2051) ||\n c === 0x2052 ||\n c === 0x2053 ||\n (c >= 0x2055 && c <= 0x205e) ||\n (c >= 0x2190 && c <= 0x2194) ||\n (c >= 0x2195 && c <= 0x2199) ||\n (c >= 0x219a && c <= 0x219b) ||\n (c >= 0x219c && c <= 0x219f) ||\n c === 0x21a0 ||\n (c >= 0x21a1 && c <= 0x21a2) ||\n c === 0x21a3 ||\n (c >= 0x21a4 && c <= 0x21a5) ||\n c === 0x21a6 ||\n (c >= 0x21a7 && c <= 0x21ad) ||\n c === 0x21ae ||\n (c >= 0x21af && c <= 0x21cd) ||\n (c >= 0x21ce && c <= 0x21cf) ||\n (c >= 0x21d0 && c <= 0x21d1) ||\n c === 0x21d2 ||\n c === 0x21d3 ||\n c === 0x21d4 ||\n (c >= 0x21d5 && c <= 0x21f3) ||\n (c >= 0x21f4 && c <= 0x22ff) ||\n (c >= 0x2300 && c <= 0x2307) ||\n c === 0x2308 ||\n c === 0x2309 ||\n c === 0x230a ||\n c === 0x230b ||\n (c >= 0x230c && c <= 0x231f) ||\n (c >= 0x2320 && c <= 0x2321) ||\n (c >= 0x2322 && c <= 0x2328) ||\n c === 0x2329 ||\n c === 0x232a ||\n (c >= 0x232b && c <= 0x237b) ||\n c === 0x237c ||\n (c >= 0x237d && c <= 0x239a) ||\n (c >= 0x239b && c <= 0x23b3) ||\n (c >= 0x23b4 && c <= 0x23db) ||\n (c >= 0x23dc && c <= 0x23e1) ||\n (c >= 0x23e2 && c <= 0x2426) ||\n (c >= 0x2427 && c <= 0x243f) ||\n (c >= 0x2440 && c <= 0x244a) ||\n (c >= 0x244b && c <= 0x245f) ||\n (c >= 0x2500 && c <= 0x25b6) ||\n c === 0x25b7 ||\n (c >= 0x25b8 && c <= 0x25c0) ||\n c === 0x25c1 ||\n (c >= 0x25c2 && c <= 0x25f7) ||\n (c >= 0x25f8 && c <= 0x25ff) ||\n (c >= 0x2600 && c <= 0x266e) ||\n c === 0x266f ||\n (c >= 0x2670 && c <= 0x2767) ||\n c === 0x2768 ||\n c === 0x2769 ||\n c === 0x276a ||\n c === 0x276b ||\n c === 0x276c ||\n c === 0x276d ||\n c === 0x276e ||\n c === 0x276f ||\n c === 0x2770 ||\n c === 0x2771 ||\n c === 0x2772 ||\n c === 0x2773 ||\n c === 0x2774 ||\n c === 0x2775 ||\n (c >= 0x2794 && c <= 0x27bf) ||\n (c >= 0x27c0 && c <= 0x27c4) ||\n c === 0x27c5 ||\n c === 0x27c6 ||\n (c >= 0x27c7 && c <= 0x27e5) ||\n c === 0x27e6 ||\n c === 0x27e7 ||\n c === 0x27e8 ||\n c === 0x27e9 ||\n c === 0x27ea ||\n c === 0x27eb ||\n c === 0x27ec ||\n c === 0x27ed ||\n c === 0x27ee ||\n c === 0x27ef ||\n (c >= 0x27f0 && c <= 0x27ff) ||\n (c >= 0x2800 && c <= 0x28ff) ||\n (c >= 0x2900 && c <= 0x2982) ||\n c === 0x2983 ||\n c === 0x2984 ||\n c === 0x2985 ||\n c === 0x2986 ||\n c === 0x2987 ||\n c === 0x2988 ||\n c === 0x2989 ||\n c === 0x298a ||\n c === 0x298b ||\n c === 0x298c ||\n c === 0x298d ||\n c === 0x298e ||\n c === 0x298f ||\n c === 0x2990 ||\n c === 0x2991 ||\n c === 0x2992 ||\n c === 0x2993 ||\n c === 0x2994 ||\n c === 0x2995 ||\n c === 0x2996 ||\n c === 0x2997 ||\n c === 0x2998 ||\n (c >= 0x2999 && c <= 0x29d7) ||\n c === 0x29d8 ||\n c === 0x29d9 ||\n c === 0x29da ||\n c === 0x29db ||\n (c >= 0x29dc && c <= 0x29fb) ||\n c === 0x29fc ||\n c === 0x29fd ||\n (c >= 0x29fe && c <= 0x2aff) ||\n (c >= 0x2b00 && c <= 0x2b2f) ||\n (c >= 0x2b30 && c <= 0x2b44) ||\n (c >= 0x2b45 && c <= 0x2b46) ||\n (c >= 0x2b47 && c <= 0x2b4c) ||\n (c >= 0x2b4d && c <= 0x2b73) ||\n (c >= 0x2b74 && c <= 0x2b75) ||\n (c >= 0x2b76 && c <= 0x2b95) ||\n c === 0x2b96 ||\n (c >= 0x2b97 && c <= 0x2bff) ||\n (c >= 0x2e00 && c <= 0x2e01) ||\n c === 0x2e02 ||\n c === 0x2e03 ||\n c === 0x2e04 ||\n c === 0x2e05 ||\n (c >= 0x2e06 && c <= 0x2e08) ||\n c === 0x2e09 ||\n c === 0x2e0a ||\n c === 0x2e0b ||\n c === 0x2e0c ||\n c === 0x2e0d ||\n (c >= 0x2e0e && c <= 0x2e16) ||\n c === 0x2e17 ||\n (c >= 0x2e18 && c <= 0x2e19) ||\n c === 0x2e1a ||\n c === 0x2e1b ||\n c === 0x2e1c ||\n c === 0x2e1d ||\n (c >= 0x2e1e && c <= 0x2e1f) ||\n c === 0x2e20 ||\n c === 0x2e21 ||\n c === 0x2e22 ||\n c === 0x2e23 ||\n c === 0x2e24 ||\n c === 0x2e25 ||\n c === 0x2e26 ||\n c === 0x2e27 ||\n c === 0x2e28 ||\n c === 0x2e29 ||\n (c >= 0x2e2a && c <= 0x2e2e) ||\n c === 0x2e2f ||\n (c >= 0x2e30 && c <= 0x2e39) ||\n (c >= 0x2e3a && c <= 0x2e3b) ||\n (c >= 0x2e3c && c <= 0x2e3f) ||\n c === 0x2e40 ||\n c === 0x2e41 ||\n c === 0x2e42 ||\n (c >= 0x2e43 && c <= 0x2e4f) ||\n (c >= 0x2e50 && c <= 0x2e51) ||\n c === 0x2e52 ||\n (c >= 0x2e53 && c <= 0x2e7f) ||\n (c >= 0x3001 && c <= 0x3003) ||\n c === 0x3008 ||\n c === 0x3009 ||\n c === 0x300a ||\n c === 0x300b ||\n c === 0x300c ||\n c === 0x300d ||\n c === 0x300e ||\n c === 0x300f ||\n c === 0x3010 ||\n c === 0x3011 ||\n (c >= 0x3012 && c <= 0x3013) ||\n c === 0x3014 ||\n c === 0x3015 ||\n c === 0x3016 ||\n c === 0x3017 ||\n c === 0x3018 ||\n c === 0x3019 ||\n c === 0x301a ||\n c === 0x301b ||\n c === 0x301c ||\n c === 0x301d ||\n (c >= 0x301e && c <= 0x301f) ||\n c === 0x3020 ||\n c === 0x3030 ||\n c === 0xfd3e ||\n c === 0xfd3f ||\n (c >= 0xfe45 && c <= 0xfe46));\n}\n","import { __assign } from \"tslib\";\nimport { ErrorKind } from './error';\nimport { Parser } from './parser';\nimport { isDateElement, isDateTimeSkeleton, isNumberElement, isNumberSkeleton, isPluralElement, isSelectElement, isTagElement, isTimeElement, } from './types';\nfunction pruneLocation(els) {\n els.forEach(function (el) {\n delete el.location;\n if (isSelectElement(el) || isPluralElement(el)) {\n for (var k in el.options) {\n delete el.options[k].location;\n pruneLocation(el.options[k].value);\n }\n }\n else if (isNumberElement(el) && isNumberSkeleton(el.style)) {\n delete el.style.location;\n }\n else if ((isDateElement(el) || isTimeElement(el)) &&\n isDateTimeSkeleton(el.style)) {\n delete el.style.location;\n }\n else if (isTagElement(el)) {\n pruneLocation(el.children);\n }\n });\n}\nexport function parse(message, opts) {\n if (opts === void 0) { opts = {}; }\n opts = __assign({ shouldParseSkeletons: true, requiresOtherClause: true }, opts);\n var result = new Parser(message, opts).parse();\n if (result.err) {\n var error = SyntaxError(ErrorKind[result.err.kind]);\n // @ts-expect-error Assign to error object\n error.location = result.err.location;\n // @ts-expect-error Assign to error object\n error.originalMessage = result.err.message;\n throw error;\n }\n if (!(opts === null || opts === void 0 ? void 0 : opts.captureLocation)) {\n pruneLocation(result.val);\n }\n return result.val;\n}\nexport * from './types';\n// only for testing\nexport var _Parser = Parser;\n","import { __extends } from \"tslib\";\nexport var ErrorCode;\n(function (ErrorCode) {\n // When we have a placeholder but no value to format\n ErrorCode[\"MISSING_VALUE\"] = \"MISSING_VALUE\";\n // When value supplied is invalid\n ErrorCode[\"INVALID_VALUE\"] = \"INVALID_VALUE\";\n // When we need specific Intl API but it's not available\n ErrorCode[\"MISSING_INTL_API\"] = \"MISSING_INTL_API\";\n})(ErrorCode || (ErrorCode = {}));\nvar FormatError = /** @class */ (function (_super) {\n __extends(FormatError, _super);\n function FormatError(msg, code, originalMessage) {\n var _this = _super.call(this, msg) || this;\n _this.code = code;\n _this.originalMessage = originalMessage;\n return _this;\n }\n FormatError.prototype.toString = function () {\n return \"[formatjs Error: \".concat(this.code, \"] \").concat(this.message);\n };\n return FormatError;\n}(Error));\nexport { FormatError };\nvar InvalidValueError = /** @class */ (function (_super) {\n __extends(InvalidValueError, _super);\n function InvalidValueError(variableId, value, options, originalMessage) {\n return _super.call(this, \"Invalid values for \\\"\".concat(variableId, \"\\\": \\\"\").concat(value, \"\\\". Options are \\\"\").concat(Object.keys(options).join('\", \"'), \"\\\"\"), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueError;\n}(FormatError));\nexport { InvalidValueError };\nvar InvalidValueTypeError = /** @class */ (function (_super) {\n __extends(InvalidValueTypeError, _super);\n function InvalidValueTypeError(value, type, originalMessage) {\n return _super.call(this, \"Value for \\\"\".concat(value, \"\\\" must be of type \").concat(type), ErrorCode.INVALID_VALUE, originalMessage) || this;\n }\n return InvalidValueTypeError;\n}(FormatError));\nexport { InvalidValueTypeError };\nvar MissingValueError = /** @class */ (function (_super) {\n __extends(MissingValueError, _super);\n function MissingValueError(variableId, originalMessage) {\n return _super.call(this, \"The intl string context variable \\\"\".concat(variableId, \"\\\" was not provided to the string \\\"\").concat(originalMessage, \"\\\"\"), ErrorCode.MISSING_VALUE, originalMessage) || this;\n }\n return MissingValueError;\n}(FormatError));\nexport { MissingValueError };\n","import { isArgumentElement, isDateElement, isDateTimeSkeleton, isLiteralElement, isNumberElement, isNumberSkeleton, isPluralElement, isPoundElement, isSelectElement, isTagElement, isTimeElement, } from '@formatjs/icu-messageformat-parser';\nimport { ErrorCode, FormatError, InvalidValueError, InvalidValueTypeError, MissingValueError, } from './error';\nexport var PART_TYPE;\n(function (PART_TYPE) {\n PART_TYPE[PART_TYPE[\"literal\"] = 0] = \"literal\";\n PART_TYPE[PART_TYPE[\"object\"] = 1] = \"object\";\n})(PART_TYPE || (PART_TYPE = {}));\nfunction mergeLiteral(parts) {\n if (parts.length < 2) {\n return parts;\n }\n return parts.reduce(function (all, part) {\n var lastPart = all[all.length - 1];\n if (!lastPart ||\n lastPart.type !== PART_TYPE.literal ||\n part.type !== PART_TYPE.literal) {\n all.push(part);\n }\n else {\n lastPart.value += part.value;\n }\n return all;\n }, []);\n}\nexport function isFormatXMLElementFn(el) {\n return typeof el === 'function';\n}\n// TODO(skeleton): add skeleton support\nexport function formatToParts(els, locales, formatters, formats, values, currentPluralValue, \n// For debugging\noriginalMessage) {\n // Hot path for straight simple msg translations\n if (els.length === 1 && isLiteralElement(els[0])) {\n return [\n {\n type: PART_TYPE.literal,\n value: els[0].value,\n },\n ];\n }\n var result = [];\n for (var _i = 0, els_1 = els; _i < els_1.length; _i++) {\n var el = els_1[_i];\n // Exit early for string parts.\n if (isLiteralElement(el)) {\n result.push({\n type: PART_TYPE.literal,\n value: el.value,\n });\n continue;\n }\n // TODO: should this part be literal type?\n // Replace `#` in plural rules with the actual numeric value.\n if (isPoundElement(el)) {\n if (typeof currentPluralValue === 'number') {\n result.push({\n type: PART_TYPE.literal,\n value: formatters.getNumberFormat(locales).format(currentPluralValue),\n });\n }\n continue;\n }\n var varName = el.value;\n // Enforce that all required values are provided by the caller.\n if (!(values && varName in values)) {\n throw new MissingValueError(varName, originalMessage);\n }\n var value = values[varName];\n if (isArgumentElement(el)) {\n if (!value || typeof value === 'string' || typeof value === 'number') {\n value =\n typeof value === 'string' || typeof value === 'number'\n ? String(value)\n : '';\n }\n result.push({\n type: typeof value === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: value,\n });\n continue;\n }\n // Recursively format plural and select parts' option — which can be a\n // nested pattern structure. The choosing of the option to use is\n // abstracted-by and delegated-to the part helper object.\n if (isDateElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.date[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTimeElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.time[el.style]\n : isDateTimeSkeleton(el.style)\n ? el.style.parsedOptions\n : formats.time.medium;\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getDateTimeFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isNumberElement(el)) {\n var style = typeof el.style === 'string'\n ? formats.number[el.style]\n : isNumberSkeleton(el.style)\n ? el.style.parsedOptions\n : undefined;\n if (style && style.scale) {\n value =\n value *\n (style.scale || 1);\n }\n result.push({\n type: PART_TYPE.literal,\n value: formatters\n .getNumberFormat(locales, style)\n .format(value),\n });\n continue;\n }\n if (isTagElement(el)) {\n var children = el.children, value_1 = el.value;\n var formatFn = values[value_1];\n if (!isFormatXMLElementFn(formatFn)) {\n throw new InvalidValueTypeError(value_1, 'function', originalMessage);\n }\n var parts = formatToParts(children, locales, formatters, formats, values, currentPluralValue);\n var chunks = formatFn(parts.map(function (p) { return p.value; }));\n if (!Array.isArray(chunks)) {\n chunks = [chunks];\n }\n result.push.apply(result, chunks.map(function (c) {\n return {\n type: typeof c === 'string' ? PART_TYPE.literal : PART_TYPE.object,\n value: c,\n };\n }));\n }\n if (isSelectElement(el)) {\n var opt = el.options[value] || el.options.other;\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values));\n continue;\n }\n if (isPluralElement(el)) {\n var opt = el.options[\"=\".concat(value)];\n if (!opt) {\n if (!Intl.PluralRules) {\n throw new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API, originalMessage);\n }\n var rule = formatters\n .getPluralRules(locales, { type: el.pluralType })\n .select(value - (el.offset || 0));\n opt = el.options[rule] || el.options.other;\n }\n if (!opt) {\n throw new InvalidValueError(el.value, value, Object.keys(el.options), originalMessage);\n }\n result.push.apply(result, formatToParts(opt.value, locales, formatters, formats, values, value - (el.offset || 0)));\n continue;\n }\n }\n return mergeLiteral(result);\n}\n","/*\nCopyright (c) 2014, Yahoo! Inc. All rights reserved.\nCopyrights licensed under the New BSD License.\nSee the accompanying LICENSE file for terms.\n*/\nimport { __assign, __rest, __spreadArray } from \"tslib\";\nimport { memoize, strategies } from '@formatjs/fast-memoize';\nimport { parse, } from '@formatjs/icu-messageformat-parser';\nimport { formatToParts, PART_TYPE, } from './formatters';\n// -- MessageFormat --------------------------------------------------------\nfunction mergeConfig(c1, c2) {\n if (!c2) {\n return c1;\n }\n return __assign(__assign(__assign({}, (c1 || {})), (c2 || {})), Object.keys(c1).reduce(function (all, k) {\n all[k] = __assign(__assign({}, c1[k]), (c2[k] || {}));\n return all;\n }, {}));\n}\nfunction mergeConfigs(defaultConfig, configs) {\n if (!configs) {\n return defaultConfig;\n }\n return Object.keys(defaultConfig).reduce(function (all, k) {\n all[k] = mergeConfig(defaultConfig[k], configs[k]);\n return all;\n }, __assign({}, defaultConfig));\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\nfunction createDefaultFormatters(cache) {\n if (cache === void 0) { cache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n }; }\n return {\n getNumberFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n }),\n getDateTimeFormat: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n }),\n };\n}\nvar IntlMessageFormat = /** @class */ (function () {\n function IntlMessageFormat(message, locales, overrideFormats, opts) {\n if (locales === void 0) { locales = IntlMessageFormat.defaultLocale; }\n var _this = this;\n this.formatterCache = {\n number: {},\n dateTime: {},\n pluralRules: {},\n };\n this.format = function (values) {\n var parts = _this.formatToParts(values);\n // Hot path for straight simple msg translations\n if (parts.length === 1) {\n return parts[0].value;\n }\n var result = parts.reduce(function (all, part) {\n if (!all.length ||\n part.type !== PART_TYPE.literal ||\n typeof all[all.length - 1] !== 'string') {\n all.push(part.value);\n }\n else {\n all[all.length - 1] += part.value;\n }\n return all;\n }, []);\n if (result.length <= 1) {\n return result[0] || '';\n }\n return result;\n };\n this.formatToParts = function (values) {\n return formatToParts(_this.ast, _this.locales, _this.formatters, _this.formats, values, undefined, _this.message);\n };\n this.resolvedOptions = function () {\n var _a;\n return ({\n locale: ((_a = _this.resolvedLocale) === null || _a === void 0 ? void 0 : _a.toString()) ||\n Intl.NumberFormat.supportedLocalesOf(_this.locales)[0],\n });\n };\n this.getAst = function () { return _this.ast; };\n // Defined first because it's used to build the format pattern.\n this.locales = locales;\n this.resolvedLocale = IntlMessageFormat.resolveLocale(locales);\n if (typeof message === 'string') {\n this.message = message;\n if (!IntlMessageFormat.__parse) {\n throw new TypeError('IntlMessageFormat.__parse must be set to process `message` of type `string`');\n }\n var _a = opts || {}, formatters = _a.formatters, parseOpts = __rest(_a, [\"formatters\"]);\n // Parse string messages into an AST.\n this.ast = IntlMessageFormat.__parse(message, __assign(__assign({}, parseOpts), { locale: this.resolvedLocale }));\n }\n else {\n this.ast = message;\n }\n if (!Array.isArray(this.ast)) {\n throw new TypeError('A message must be provided as a String or AST.');\n }\n // Creates a new object with the specified `formats` merged with the default\n // formats.\n this.formats = mergeConfigs(IntlMessageFormat.formats, overrideFormats);\n this.formatters =\n (opts && opts.formatters) || createDefaultFormatters(this.formatterCache);\n }\n Object.defineProperty(IntlMessageFormat, \"defaultLocale\", {\n get: function () {\n if (!IntlMessageFormat.memoizedDefaultLocale) {\n IntlMessageFormat.memoizedDefaultLocale =\n new Intl.NumberFormat().resolvedOptions().locale;\n }\n return IntlMessageFormat.memoizedDefaultLocale;\n },\n enumerable: false,\n configurable: true\n });\n IntlMessageFormat.memoizedDefaultLocale = null;\n IntlMessageFormat.resolveLocale = function (locales) {\n if (typeof Intl.Locale === 'undefined') {\n return;\n }\n var supportedLocales = Intl.NumberFormat.supportedLocalesOf(locales);\n if (supportedLocales.length > 0) {\n return new Intl.Locale(supportedLocales[0]);\n }\n return new Intl.Locale(typeof locales === 'string' ? locales : locales[0]);\n };\n IntlMessageFormat.__parse = parse;\n // Default format options used as the prototype of the `formats` provided to the\n // constructor. These are used when constructing the internal Intl.NumberFormat\n // and Intl.DateTimeFormat instances.\n IntlMessageFormat.formats = {\n number: {\n integer: {\n maximumFractionDigits: 0,\n },\n currency: {\n style: 'currency',\n },\n percent: {\n style: 'percent',\n },\n },\n date: {\n short: {\n month: 'numeric',\n day: 'numeric',\n year: '2-digit',\n },\n medium: {\n month: 'short',\n day: 'numeric',\n year: 'numeric',\n },\n long: {\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n full: {\n weekday: 'long',\n month: 'long',\n day: 'numeric',\n year: 'numeric',\n },\n },\n time: {\n short: {\n hour: 'numeric',\n minute: 'numeric',\n },\n medium: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n },\n long: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n full: {\n hour: 'numeric',\n minute: 'numeric',\n second: 'numeric',\n timeZoneName: 'short',\n },\n },\n };\n return IntlMessageFormat;\n}());\nexport { IntlMessageFormat };\n","import { __extends } from \"tslib\";\nexport var IntlErrorCode;\n(function (IntlErrorCode) {\n IntlErrorCode[\"FORMAT_ERROR\"] = \"FORMAT_ERROR\";\n IntlErrorCode[\"UNSUPPORTED_FORMATTER\"] = \"UNSUPPORTED_FORMATTER\";\n IntlErrorCode[\"INVALID_CONFIG\"] = \"INVALID_CONFIG\";\n IntlErrorCode[\"MISSING_DATA\"] = \"MISSING_DATA\";\n IntlErrorCode[\"MISSING_TRANSLATION\"] = \"MISSING_TRANSLATION\";\n})(IntlErrorCode || (IntlErrorCode = {}));\nvar IntlError = /** @class */ (function (_super) {\n __extends(IntlError, _super);\n function IntlError(code, message, exception) {\n var _this = this;\n var err = exception\n ? exception instanceof Error\n ? exception\n : new Error(String(exception))\n : undefined;\n _this = _super.call(this, \"[@formatjs/intl Error \".concat(code, \"] \").concat(message, \"\\n\").concat(err ? \"\\n\".concat(err.message, \"\\n\").concat(err.stack) : '')) || this;\n _this.code = code;\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (typeof Error.captureStackTrace === 'function') {\n // @ts-ignore just so we don't need to declare dep on @types/node\n Error.captureStackTrace(_this, IntlError);\n }\n return _this;\n }\n return IntlError;\n}(Error));\nexport { IntlError };\nvar UnsupportedFormatterError = /** @class */ (function (_super) {\n __extends(UnsupportedFormatterError, _super);\n function UnsupportedFormatterError(message, exception) {\n return _super.call(this, IntlErrorCode.UNSUPPORTED_FORMATTER, message, exception) || this;\n }\n return UnsupportedFormatterError;\n}(IntlError));\nexport { UnsupportedFormatterError };\nvar InvalidConfigError = /** @class */ (function (_super) {\n __extends(InvalidConfigError, _super);\n function InvalidConfigError(message, exception) {\n return _super.call(this, IntlErrorCode.INVALID_CONFIG, message, exception) || this;\n }\n return InvalidConfigError;\n}(IntlError));\nexport { InvalidConfigError };\nvar MissingDataError = /** @class */ (function (_super) {\n __extends(MissingDataError, _super);\n function MissingDataError(message, exception) {\n return _super.call(this, IntlErrorCode.MISSING_DATA, message, exception) || this;\n }\n return MissingDataError;\n}(IntlError));\nexport { MissingDataError };\nvar IntlFormatError = /** @class */ (function (_super) {\n __extends(IntlFormatError, _super);\n function IntlFormatError(message, locale, exception) {\n var _this = _super.call(this, IntlErrorCode.FORMAT_ERROR, \"\".concat(message, \"\\nLocale: \").concat(locale, \"\\n\"), exception) || this;\n _this.locale = locale;\n return _this;\n }\n return IntlFormatError;\n}(IntlError));\nexport { IntlFormatError };\nvar MessageFormatError = /** @class */ (function (_super) {\n __extends(MessageFormatError, _super);\n function MessageFormatError(message, locale, descriptor, exception) {\n var _this = _super.call(this, \"\".concat(message, \"\\nMessageID: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.id, \"\\nDefault Message: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.defaultMessage, \"\\nDescription: \").concat(descriptor === null || descriptor === void 0 ? void 0 : descriptor.description, \"\\n\"), locale, exception) || this;\n _this.descriptor = descriptor;\n _this.locale = locale;\n return _this;\n }\n return MessageFormatError;\n}(IntlFormatError));\nexport { MessageFormatError };\nvar MissingTranslationError = /** @class */ (function (_super) {\n __extends(MissingTranslationError, _super);\n function MissingTranslationError(descriptor, locale) {\n var _this = _super.call(this, IntlErrorCode.MISSING_TRANSLATION, \"Missing message: \\\"\".concat(descriptor.id, \"\\\" for locale \\\"\").concat(locale, \"\\\", using \").concat(descriptor.defaultMessage\n ? \"default message (\".concat(typeof descriptor.defaultMessage === 'string'\n ? descriptor.defaultMessage\n : descriptor.defaultMessage\n .map(function (e) { var _a; return (_a = e.value) !== null && _a !== void 0 ? _a : JSON.stringify(e); })\n .join(), \")\")\n : 'id', \" as fallback.\")) || this;\n _this.descriptor = descriptor;\n return _this;\n }\n return MissingTranslationError;\n}(IntlError));\nexport { MissingTranslationError };\n","import { __assign, __spreadArray } from \"tslib\";\nimport { IntlMessageFormat } from 'intl-messageformat';\nimport { memoize, strategies } from '@formatjs/fast-memoize';\nimport { UnsupportedFormatterError } from './error';\nexport function filterProps(props, allowlist, defaults) {\n if (defaults === void 0) { defaults = {}; }\n return allowlist.reduce(function (filtered, name) {\n if (name in props) {\n filtered[name] = props[name];\n }\n else if (name in defaults) {\n filtered[name] = defaults[name];\n }\n return filtered;\n }, {});\n}\nvar defaultErrorHandler = function (error) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.error(error);\n }\n};\nvar defaultWarnHandler = function (warning) {\n // @ts-ignore just so we don't need to declare dep on @types/node\n if (process.env.NODE_ENV !== 'production') {\n console.warn(warning);\n }\n};\nexport var DEFAULT_INTL_CONFIG = {\n formats: {},\n messages: {},\n timeZone: undefined,\n defaultLocale: 'en',\n defaultFormats: {},\n fallbackOnEmptyString: true,\n onError: defaultErrorHandler,\n onWarn: defaultWarnHandler,\n};\nexport function createIntlCache() {\n return {\n dateTime: {},\n number: {},\n message: {},\n relativeTime: {},\n pluralRules: {},\n list: {},\n displayNames: {},\n };\n}\nfunction createFastMemoizeCache(store) {\n return {\n create: function () {\n return {\n get: function (key) {\n return store[key];\n },\n set: function (key, value) {\n store[key] = value;\n },\n };\n },\n };\n}\n/**\n * Create intl formatters and populate cache\n * @param cache explicit cache to prevent leaking memory\n */\nexport function createFormatters(cache) {\n if (cache === void 0) { cache = createIntlCache(); }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n var ListFormat = Intl.ListFormat;\n var DisplayNames = Intl.DisplayNames;\n var getDateTimeFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.DateTimeFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.dateTime),\n strategy: strategies.variadic,\n });\n var getNumberFormat = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.NumberFormat).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.number),\n strategy: strategies.variadic,\n });\n var getPluralRules = memoize(function () {\n var _a;\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new ((_a = Intl.PluralRules).bind.apply(_a, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.pluralRules),\n strategy: strategies.variadic,\n });\n return {\n getDateTimeFormat: getDateTimeFormat,\n getNumberFormat: getNumberFormat,\n getMessageFormat: memoize(function (message, locales, overrideFormats, opts) {\n return new IntlMessageFormat(message, locales, overrideFormats, __assign({ formatters: {\n getNumberFormat: getNumberFormat,\n getDateTimeFormat: getDateTimeFormat,\n getPluralRules: getPluralRules,\n } }, (opts || {})));\n }, {\n cache: createFastMemoizeCache(cache.message),\n strategy: strategies.variadic,\n }),\n getRelativeTimeFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (RelativeTimeFormat.bind.apply(RelativeTimeFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.relativeTime),\n strategy: strategies.variadic,\n }),\n getPluralRules: getPluralRules,\n getListFormat: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (ListFormat.bind.apply(ListFormat, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.list),\n strategy: strategies.variadic,\n }),\n getDisplayNames: memoize(function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n return new (DisplayNames.bind.apply(DisplayNames, __spreadArray([void 0], args, false)))();\n }, {\n cache: createFastMemoizeCache(cache.displayNames),\n strategy: strategies.variadic,\n }),\n };\n}\nexport function getNamedFormat(formats, type, name, onError) {\n var formatType = formats && formats[type];\n var format;\n if (formatType) {\n format = formatType[name];\n }\n if (format) {\n return format;\n }\n onError(new UnsupportedFormatterError(\"No \".concat(type, \" format named: \").concat(name)));\n}\n","import { __assign } from \"tslib\";\nimport { invariant } from '@formatjs/ecma402-abstract';\nimport { IntlMessageFormat, } from 'intl-messageformat';\nimport { MissingTranslationError, MessageFormatError } from './error';\nimport { TYPE } from '@formatjs/icu-messageformat-parser';\nfunction setTimeZoneInOptions(opts, timeZone) {\n return Object.keys(opts).reduce(function (all, k) {\n all[k] = __assign({ timeZone: timeZone }, opts[k]);\n return all;\n }, {});\n}\nfunction deepMergeOptions(opts1, opts2) {\n var keys = Object.keys(__assign(__assign({}, opts1), opts2));\n return keys.reduce(function (all, k) {\n all[k] = __assign(__assign({}, (opts1[k] || {})), (opts2[k] || {}));\n return all;\n }, {});\n}\nfunction deepMergeFormatsAndSetTimeZone(f1, timeZone) {\n if (!timeZone) {\n return f1;\n }\n var mfFormats = IntlMessageFormat.formats;\n return __assign(__assign(__assign({}, mfFormats), f1), { date: deepMergeOptions(setTimeZoneInOptions(mfFormats.date, timeZone), setTimeZoneInOptions(f1.date || {}, timeZone)), time: deepMergeOptions(setTimeZoneInOptions(mfFormats.time, timeZone), setTimeZoneInOptions(f1.time || {}, timeZone)) });\n}\nexport var formatMessage = function (_a, state, messageDescriptor, values, opts) {\n var locale = _a.locale, formats = _a.formats, messages = _a.messages, defaultLocale = _a.defaultLocale, defaultFormats = _a.defaultFormats, fallbackOnEmptyString = _a.fallbackOnEmptyString, onError = _a.onError, timeZone = _a.timeZone, defaultRichTextElements = _a.defaultRichTextElements;\n if (messageDescriptor === void 0) { messageDescriptor = { id: '' }; }\n var msgId = messageDescriptor.id, defaultMessage = messageDescriptor.defaultMessage;\n // `id` is a required field of a Message Descriptor.\n invariant(!!msgId, \"[@formatjs/intl] An `id` must be provided to format a message. You can either:\\n1. Configure your build toolchain with [babel-plugin-formatjs](https://formatjs.io/docs/tooling/babel-plugin)\\nor [@formatjs/ts-transformer](https://formatjs.io/docs/tooling/ts-transformer) OR\\n2. Configure your `eslint` config to include [eslint-plugin-formatjs](https://formatjs.io/docs/tooling/linter#enforce-id)\\nto autofix this issue\");\n var id = String(msgId);\n var message = \n // In case messages is Object.create(null)\n // e.g import('foo.json') from webpack)\n // See https://github.com/formatjs/formatjs/issues/1914\n messages &&\n Object.prototype.hasOwnProperty.call(messages, id) &&\n messages[id];\n // IMPORTANT: Hot path if `message` is AST with a single literal node\n if (Array.isArray(message) &&\n message.length === 1 &&\n message[0].type === TYPE.literal) {\n return message[0].value;\n }\n // IMPORTANT: Hot path straight lookup for performance\n if (!values &&\n message &&\n typeof message === 'string' &&\n !defaultRichTextElements) {\n return message.replace(/'\\{(.*?)\\}'/gi, \"{$1}\");\n }\n values = __assign(__assign({}, defaultRichTextElements), (values || {}));\n formats = deepMergeFormatsAndSetTimeZone(formats, timeZone);\n defaultFormats = deepMergeFormatsAndSetTimeZone(defaultFormats, timeZone);\n if (!message) {\n if (fallbackOnEmptyString === false && message === '') {\n return message;\n }\n if (!defaultMessage ||\n (locale && locale.toLowerCase() !== defaultLocale.toLowerCase())) {\n // This prevents warnings from littering the console in development\n // when no `messages` are passed into the for the\n // default locale.\n onError(new MissingTranslationError(messageDescriptor, locale));\n }\n if (defaultMessage) {\n try {\n var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting default message for: \\\"\".concat(id, \"\\\", rendering default message verbatim\"), locale, messageDescriptor, e));\n return typeof defaultMessage === 'string' ? defaultMessage : id;\n }\n }\n return id;\n }\n // We have the translated message\n try {\n var formatter = state.getMessageFormat(message, locale, formats, __assign({ formatters: state }, (opts || {})));\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting message: \\\"\".concat(id, \"\\\", using \").concat(defaultMessage ? 'default message' : 'id', \" as fallback.\"), locale, messageDescriptor, e));\n }\n if (defaultMessage) {\n try {\n var formatter = state.getMessageFormat(defaultMessage, defaultLocale, defaultFormats, opts);\n return formatter.format(values);\n }\n catch (e) {\n onError(new MessageFormatError(\"Error formatting the default message for: \\\"\".concat(id, \"\\\", rendering message verbatim\"), locale, messageDescriptor, e));\n }\n }\n if (typeof message === 'string') {\n return message;\n }\n if (typeof defaultMessage === 'string') {\n return defaultMessage;\n }\n return id;\n};\n","import { __assign } from \"tslib\";\nimport { filterProps, getNamedFormat } from './utils';\nimport { IntlFormatError } from './error';\nvar DATE_TIME_FORMAT_OPTIONS = [\n 'formatMatcher',\n 'timeZone',\n 'hour12',\n 'weekday',\n 'era',\n 'year',\n 'month',\n 'day',\n 'hour',\n 'minute',\n 'second',\n 'timeZoneName',\n 'hourCycle',\n 'dateStyle',\n 'timeStyle',\n 'calendar',\n // 'dayPeriod',\n 'numberingSystem',\n 'fractionalSecondDigits',\n];\nexport function getFormatter(_a, type, getDateTimeFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError, timeZone = _a.timeZone;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = __assign(__assign({}, (timeZone && { timeZone: timeZone })), (format && getNamedFormat(formats, type, format, onError)));\n var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, defaults);\n if (type === 'time' &&\n !filteredOptions.hour &&\n !filteredOptions.minute &&\n !filteredOptions.second &&\n !filteredOptions.timeStyle &&\n !filteredOptions.dateStyle) {\n // Add default formatting options if hour, minute, or second isn't defined.\n filteredOptions = __assign(__assign({}, filteredOptions), { hour: 'numeric', minute: 'numeric' });\n }\n return getDateTimeFormat(locale, filteredOptions);\n}\nexport function formatDate(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'date', getDateTimeFormat, options).format(date);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting date.', config.locale, e));\n }\n return String(date);\n}\nexport function formatTime(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'time', getDateTimeFormat, options).format(date);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting time.', config.locale, e));\n }\n return String(date);\n}\nexport function formatDateTimeRange(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var from = _a[0], to = _a[1], _b = _a[2], options = _b === void 0 ? {} : _b;\n var timeZone = config.timeZone, locale = config.locale, onError = config.onError;\n var filteredOptions = filterProps(options, DATE_TIME_FORMAT_OPTIONS, timeZone ? { timeZone: timeZone } : {});\n try {\n return getDateTimeFormat(locale, filteredOptions).formatRange(from, to);\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting date time range.', config.locale, e));\n }\n return String(from);\n}\nexport function formatDateToParts(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'date', getDateTimeFormat, options).formatToParts(date); // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting date.', config.locale, e));\n }\n return [];\n}\nexport function formatTimeToParts(config, getDateTimeFormat) {\n var _a = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n _a[_i - 2] = arguments[_i];\n }\n var value = _a[0], _b = _a[1], options = _b === void 0 ? {} : _b;\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n try {\n return getFormatter(config, 'time', getDateTimeFormat, options).formatToParts(date); // TODO: remove this when https://github.com/microsoft/TypeScript/pull/50402 is merged\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting time.', config.locale, e));\n }\n return [];\n}\n","import { filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlFormatError } from './error';\nvar DISPLAY_NAMES_OPTONS = [\n 'style',\n 'type',\n 'fallback',\n 'languageDisplay',\n];\nexport function formatDisplayName(_a, getDisplayNames, value, options) {\n var locale = _a.locale, onError = _a.onError;\n var DisplayNames = Intl.DisplayNames;\n if (!DisplayNames) {\n onError(new FormatError(\"Intl.DisplayNames is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-displaynames\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, DISPLAY_NAMES_OPTONS);\n try {\n return getDisplayNames(locale, filteredOptions).of(value);\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting display name.', locale, e));\n }\n}\n","import { __assign } from \"tslib\";\nimport { filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlFormatError } from './error';\nvar LIST_FORMAT_OPTIONS = [\n 'type',\n 'style',\n];\nvar now = Date.now();\nfunction generateToken(i) {\n return \"\".concat(now, \"_\").concat(i, \"_\").concat(now);\n}\nexport function formatList(opts, getListFormat, values, options) {\n if (options === void 0) { options = {}; }\n var results = formatListToParts(opts, getListFormat, values, options).reduce(function (all, el) {\n var val = el.value;\n if (typeof val !== 'string') {\n all.push(val);\n }\n else if (typeof all[all.length - 1] === 'string') {\n all[all.length - 1] += val;\n }\n else {\n all.push(val);\n }\n return all;\n }, []);\n return results.length === 1 ? results[0] : results.length === 0 ? '' : results;\n}\nexport function formatListToParts(_a, getListFormat, values, options) {\n var locale = _a.locale, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var ListFormat = Intl.ListFormat;\n if (!ListFormat) {\n onError(new FormatError(\"Intl.ListFormat is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-listformat\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, LIST_FORMAT_OPTIONS);\n try {\n var richValues_1 = {};\n var serializedValues = values.map(function (v, i) {\n if (typeof v === 'object') {\n var id = generateToken(i);\n richValues_1[id] = v;\n return id;\n }\n return String(v);\n });\n return getListFormat(locale, filteredOptions)\n .formatToParts(serializedValues)\n .map(function (part) {\n return part.type === 'literal'\n ? part\n : __assign(__assign({}, part), { value: richValues_1[part.value] || part.value });\n });\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting list.', locale, e));\n }\n // @ts-ignore\n return values;\n}\n","import { filterProps } from './utils';\nimport { IntlFormatError } from './error';\nimport { ErrorCode, FormatError } from 'intl-messageformat';\nvar PLURAL_FORMAT_OPTIONS = ['type'];\nexport function formatPlural(_a, getPluralRules, value, options) {\n var locale = _a.locale, onError = _a.onError;\n if (options === void 0) { options = {}; }\n if (!Intl.PluralRules) {\n onError(new FormatError(\"Intl.PluralRules is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-pluralrules\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n var filteredOptions = filterProps(options, PLURAL_FORMAT_OPTIONS);\n try {\n return getPluralRules(locale, filteredOptions).select(value);\n }\n catch (e) {\n onError(new IntlFormatError('Error formatting plural.', locale, e));\n }\n return 'other';\n}\n","import { getNamedFormat, filterProps } from './utils';\nimport { FormatError, ErrorCode } from 'intl-messageformat';\nimport { IntlFormatError } from './error';\nvar RELATIVE_TIME_FORMAT_OPTIONS = ['numeric', 'style'];\nfunction getFormatter(_a, getRelativeTimeFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = (!!format && getNamedFormat(formats, 'relative', format, onError)) || {};\n var filteredOptions = filterProps(options, RELATIVE_TIME_FORMAT_OPTIONS, defaults);\n return getRelativeTimeFormat(locale, filteredOptions);\n}\nexport function formatRelativeTime(config, getRelativeTimeFormat, value, unit, options) {\n if (options === void 0) { options = {}; }\n if (!unit) {\n unit = 'second';\n }\n var RelativeTimeFormat = Intl.RelativeTimeFormat;\n if (!RelativeTimeFormat) {\n config.onError(new FormatError(\"Intl.RelativeTimeFormat is not available in this environment.\\nTry polyfilling it using \\\"@formatjs/intl-relativetimeformat\\\"\\n\", ErrorCode.MISSING_INTL_API));\n }\n try {\n return getFormatter(config, getRelativeTimeFormat, options).format(value, unit);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting relative time.', config.locale, e));\n }\n return String(value);\n}\n","import { IntlFormatError } from './error';\nimport { filterProps, getNamedFormat } from './utils';\nvar NUMBER_FORMAT_OPTIONS = [\n 'style',\n 'currency',\n 'unit',\n 'unitDisplay',\n 'useGrouping',\n 'minimumIntegerDigits',\n 'minimumFractionDigits',\n 'maximumFractionDigits',\n 'minimumSignificantDigits',\n 'maximumSignificantDigits',\n // ES2020 NumberFormat\n 'compactDisplay',\n 'currencyDisplay',\n 'currencySign',\n 'notation',\n 'signDisplay',\n 'unit',\n 'unitDisplay',\n 'numberingSystem',\n // ES2023 NumberFormat\n 'trailingZeroDisplay',\n 'roundingPriority',\n 'roundingIncrement',\n 'roundingMode',\n];\nexport function getFormatter(_a, getNumberFormat, options) {\n var locale = _a.locale, formats = _a.formats, onError = _a.onError;\n if (options === void 0) { options = {}; }\n var format = options.format;\n var defaults = ((format &&\n getNamedFormat(formats, 'number', format, onError)) ||\n {});\n var filteredOptions = filterProps(options, NUMBER_FORMAT_OPTIONS, defaults);\n return getNumberFormat(locale, filteredOptions);\n}\nexport function formatNumber(config, getNumberFormat, value, options) {\n if (options === void 0) { options = {}; }\n try {\n return getFormatter(config, getNumberFormat, options).format(value);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting number.', config.locale, e));\n }\n return String(value);\n}\nexport function formatNumberToParts(config, getNumberFormat, value, options) {\n if (options === void 0) { options = {}; }\n try {\n return getFormatter(config, getNumberFormat, options).formatToParts(value);\n }\n catch (e) {\n config.onError(new IntlFormatError('Error formatting number.', config.locale, e));\n }\n return [];\n}\n","import { __assign } from \"tslib\";\nimport { createFormatters, DEFAULT_INTL_CONFIG } from './utils';\nimport { InvalidConfigError, MissingDataError } from './error';\nimport { formatNumber, formatNumberToParts } from './number';\nimport { formatRelativeTime } from './relativeTime';\nimport { formatDate, formatDateToParts, formatTime, formatTimeToParts, formatDateTimeRange, } from './dateTime';\nimport { formatPlural } from './plural';\nimport { formatMessage } from './message';\nimport { formatList, formatListToParts } from './list';\nimport { formatDisplayName } from './displayName';\nfunction messagesContainString(messages) {\n var firstMessage = messages ? messages[Object.keys(messages)[0]] : undefined;\n return typeof firstMessage === 'string';\n}\nfunction verifyConfigMessages(config) {\n if (config.onWarn &&\n config.defaultRichTextElements &&\n messagesContainString(config.messages || {})) {\n config.onWarn(\"[@formatjs/intl] \\\"defaultRichTextElements\\\" was specified but \\\"message\\\" was not pre-compiled. \\nPlease consider using \\\"@formatjs/cli\\\" to pre-compile your messages for performance.\\nFor more details see https://formatjs.io/docs/getting-started/message-distribution\");\n }\n}\n/**\n * Create intl object\n * @param config intl config\n * @param cache cache for formatter instances to prevent memory leak\n */\nexport function createIntl(config, cache) {\n var formatters = createFormatters(cache);\n var resolvedConfig = __assign(__assign({}, DEFAULT_INTL_CONFIG), config);\n var locale = resolvedConfig.locale, defaultLocale = resolvedConfig.defaultLocale, onError = resolvedConfig.onError;\n if (!locale) {\n if (onError) {\n onError(new InvalidConfigError(\"\\\"locale\\\" was not configured, using \\\"\".concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl/api#intlshape for more details\")));\n }\n // Since there's no registered locale data for `locale`, this will\n // fallback to the `defaultLocale` to make sure things can render.\n // The `messages` are overridden to the `defaultProps` empty object\n // to maintain referential equality across re-renders. It's assumed\n // each contains a `defaultMessage` prop.\n resolvedConfig.locale = resolvedConfig.defaultLocale || 'en';\n }\n else if (!Intl.NumberFormat.supportedLocalesOf(locale).length && onError) {\n onError(new MissingDataError(\"Missing locale data for locale: \\\"\".concat(locale, \"\\\" in Intl.NumberFormat. Using default locale: \\\"\").concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details\")));\n }\n else if (!Intl.DateTimeFormat.supportedLocalesOf(locale).length &&\n onError) {\n onError(new MissingDataError(\"Missing locale data for locale: \\\"\".concat(locale, \"\\\" in Intl.DateTimeFormat. Using default locale: \\\"\").concat(defaultLocale, \"\\\" as fallback. See https://formatjs.io/docs/react-intl#runtime-requirements for more details\")));\n }\n verifyConfigMessages(resolvedConfig);\n return __assign(__assign({}, resolvedConfig), { formatters: formatters, formatNumber: formatNumber.bind(null, resolvedConfig, formatters.getNumberFormat), formatNumberToParts: formatNumberToParts.bind(null, resolvedConfig, formatters.getNumberFormat), formatRelativeTime: formatRelativeTime.bind(null, resolvedConfig, formatters.getRelativeTimeFormat), formatDate: formatDate.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateToParts: formatDateToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTime: formatTime.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatDateTimeRange: formatDateTimeRange.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatTimeToParts: formatTimeToParts.bind(null, resolvedConfig, formatters.getDateTimeFormat), formatPlural: formatPlural.bind(null, resolvedConfig, formatters.getPluralRules), \n // @ts-expect-error TODO: will get to this later\n formatMessage: formatMessage.bind(null, resolvedConfig, formatters), \n // @ts-expect-error TODO: will get to this later\n $t: formatMessage.bind(null, resolvedConfig, formatters), formatList: formatList.bind(null, resolvedConfig, formatters.getListFormat), formatListToParts: formatListToParts.bind(null, resolvedConfig, formatters.getListFormat), formatDisplayName: formatDisplayName.bind(null, resolvedConfig, formatters.getDisplayNames) });\n}\n","import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport { invariant } from '@formatjs/ecma402-abstract';\nimport { DEFAULT_INTL_CONFIG as CORE_DEFAULT_INTL_CONFIG } from '@formatjs/intl';\nexport function invariantIntlContext(intl) {\n invariant(intl, '[React Intl] Could not find required `intl` object. ' +\n ' needs to exist in the component ancestry.');\n}\nexport var DEFAULT_INTL_CONFIG = __assign(__assign({}, CORE_DEFAULT_INTL_CONFIG), { textComponent: React.Fragment });\n/**\n * Takes a `formatXMLElementFn`, and composes it in function, which passes\n * argument `parts` through, assigning unique key to each part, to prevent\n * \"Each child in a list should have a unique \"key\"\" React error.\n * @param formatXMLElementFn\n */\nexport function assignUniqueKeysToParts(formatXMLElementFn) {\n return function (parts) {\n // eslint-disable-next-line prefer-rest-params\n return formatXMLElementFn(React.Children.toArray(parts));\n };\n}\nexport function shallowEqual(objA, objB) {\n if (objA === objB) {\n return true;\n }\n if (!objA || !objB) {\n return false;\n }\n var aKeys = Object.keys(objA);\n var bKeys = Object.keys(objB);\n var len = aKeys.length;\n if (bKeys.length !== len) {\n return false;\n }\n for (var i = 0; i < len; i++) {\n var key = aKeys[i];\n if (objA[key] !== objB[key] ||\n !Object.prototype.hasOwnProperty.call(objB, key)) {\n return false;\n }\n }\n return true;\n}\n","import { __assign } from \"tslib\";\nimport hoistNonReactStatics from 'hoist-non-react-statics';\nimport * as React from 'react';\nimport { invariantIntlContext } from '../utils';\nfunction getDisplayName(Component) {\n return Component.displayName || Component.name || 'Component';\n}\n// This is primarily dealing with packaging systems where multiple copies of react-intl\n// might exist\nvar IntlContext = typeof window !== 'undefined' && !window.__REACT_INTL_BYPASS_GLOBAL_CONTEXT__\n ? window.__REACT_INTL_CONTEXT__ ||\n (window.__REACT_INTL_CONTEXT__ = React.createContext(null))\n : React.createContext(null);\nvar IntlConsumer = IntlContext.Consumer, IntlProvider = IntlContext.Provider;\nexport var Provider = IntlProvider;\nexport var Context = IntlContext;\nexport default function injectIntl(WrappedComponent, options) {\n var _a = options || {}, _b = _a.intlPropName, intlPropName = _b === void 0 ? 'intl' : _b, _c = _a.forwardRef, forwardRef = _c === void 0 ? false : _c, _d = _a.enforceContext, enforceContext = _d === void 0 ? true : _d;\n var WithIntl = function (props) { return (React.createElement(IntlConsumer, null, function (intl) {\n var _a;\n if (enforceContext) {\n invariantIntlContext(intl);\n }\n var intlProp = (_a = {}, _a[intlPropName] = intl, _a);\n return (React.createElement(WrappedComponent, __assign({}, props, intlProp, { ref: forwardRef ? props.forwardedRef : null })));\n })); };\n WithIntl.displayName = \"injectIntl(\".concat(getDisplayName(WrappedComponent), \")\");\n WithIntl.WrappedComponent = WrappedComponent;\n if (forwardRef) {\n return hoistNonReactStatics(\n // @ts-expect-error\n React.forwardRef(function (props, ref) { return (React.createElement(WithIntl, __assign({}, props, { forwardedRef: ref }))); }), WrappedComponent);\n }\n return hoistNonReactStatics(WithIntl, WrappedComponent);\n}\n","import * as React from 'react';\nimport { invariantIntlContext } from '../utils';\nimport { Context } from './injectIntl';\nexport default function useIntl() {\n var intl = React.useContext(Context);\n invariantIntlContext(intl);\n return intl;\n}\n","import { __rest } from \"tslib\";\nimport * as React from 'react';\nimport useIntl from './useIntl';\nvar DisplayName;\n(function (DisplayName) {\n DisplayName[\"formatDate\"] = \"FormattedDate\";\n DisplayName[\"formatTime\"] = \"FormattedTime\";\n DisplayName[\"formatNumber\"] = \"FormattedNumber\";\n DisplayName[\"formatList\"] = \"FormattedList\";\n // Note that this DisplayName is the locale display name, not to be confused with\n // the name of the enum, which is for React component display name in dev tools.\n DisplayName[\"formatDisplayName\"] = \"FormattedDisplayName\";\n})(DisplayName || (DisplayName = {}));\nvar DisplayNameParts;\n(function (DisplayNameParts) {\n DisplayNameParts[\"formatDate\"] = \"FormattedDateParts\";\n DisplayNameParts[\"formatTime\"] = \"FormattedTimeParts\";\n DisplayNameParts[\"formatNumber\"] = \"FormattedNumberParts\";\n DisplayNameParts[\"formatList\"] = \"FormattedListParts\";\n})(DisplayNameParts || (DisplayNameParts = {}));\nexport var FormattedNumberParts = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props, [\"value\", \"children\"]);\n return children(intl.formatNumberToParts(value, formatProps));\n};\nFormattedNumberParts.displayName = 'FormattedNumberParts';\nexport var FormattedListParts = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props, [\"value\", \"children\"]);\n return children(intl.formatListToParts(value, formatProps));\n};\nFormattedNumberParts.displayName = 'FormattedNumberParts';\nexport function createFormattedDateTimePartsComponent(name) {\n var ComponentParts = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props, [\"value\", \"children\"]);\n var date = typeof value === 'string' ? new Date(value || 0) : value;\n var formattedParts = name === 'formatDate'\n ? intl.formatDateToParts(date, formatProps)\n : intl.formatTimeToParts(date, formatProps);\n return children(formattedParts);\n };\n ComponentParts.displayName = DisplayNameParts[name];\n return ComponentParts;\n}\nexport function createFormattedComponent(name) {\n var Component = function (props) {\n var intl = useIntl();\n var value = props.value, children = props.children, formatProps = __rest(props\n // TODO: fix TS type definition for localeMatcher upstream\n , [\"value\", \"children\"]);\n // TODO: fix TS type definition for localeMatcher upstream\n var formattedValue = intl[name](value, formatProps);\n if (typeof children === 'function') {\n return children(formattedValue);\n }\n var Text = intl.textComponent || React.Fragment;\n return React.createElement(Text, null, formattedValue);\n };\n Component.displayName = DisplayName[name];\n return Component;\n}\n","/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\nimport { __assign, __rest, __spreadArray } from \"tslib\";\nimport { createIntl as coreCreateIntl, formatMessage as coreFormatMessage, } from '@formatjs/intl';\nimport * as React from 'react';\nimport { DEFAULT_INTL_CONFIG, assignUniqueKeysToParts } from '../utils';\nimport { isFormatXMLElementFn, } from 'intl-messageformat';\nfunction assignUniqueKeysToFormatXMLElementFnArgument(values) {\n if (!values) {\n return values;\n }\n return Object.keys(values).reduce(function (acc, k) {\n var v = values[k];\n acc[k] = isFormatXMLElementFn(v)\n ? assignUniqueKeysToParts(v)\n : v;\n return acc;\n }, {});\n}\nvar formatMessage = function (config, formatters, descriptor, rawValues) {\n var rest = [];\n for (var _i = 4; _i < arguments.length; _i++) {\n rest[_i - 4] = arguments[_i];\n }\n var values = assignUniqueKeysToFormatXMLElementFnArgument(rawValues);\n var chunks = coreFormatMessage.apply(void 0, __spreadArray([config,\n formatters,\n descriptor,\n values], rest, false));\n if (Array.isArray(chunks)) {\n return React.Children.toArray(chunks);\n }\n return chunks;\n};\n/**\n * Create intl object\n * @param config intl config\n * @param cache cache for formatter instances to prevent memory leak\n */\nexport var createIntl = function (_a, cache) {\n var rawDefaultRichTextElements = _a.defaultRichTextElements, config = __rest(_a, [\"defaultRichTextElements\"]);\n var defaultRichTextElements = assignUniqueKeysToFormatXMLElementFnArgument(rawDefaultRichTextElements);\n var coreIntl = coreCreateIntl(__assign(__assign(__assign({}, DEFAULT_INTL_CONFIG), config), { defaultRichTextElements: defaultRichTextElements }), cache);\n var resolvedConfig = {\n locale: coreIntl.locale,\n timeZone: coreIntl.timeZone,\n fallbackOnEmptyString: coreIntl.fallbackOnEmptyString,\n formats: coreIntl.formats,\n defaultLocale: coreIntl.defaultLocale,\n defaultFormats: coreIntl.defaultFormats,\n messages: coreIntl.messages,\n onError: coreIntl.onError,\n defaultRichTextElements: defaultRichTextElements,\n };\n return __assign(__assign({}, coreIntl), { formatMessage: formatMessage.bind(null, resolvedConfig, \n // @ts-expect-error fix this\n coreIntl.formatters), \n // @ts-expect-error fix this\n $t: formatMessage.bind(null, resolvedConfig, coreIntl.formatters) });\n};\n","/*\n * Copyright 2015, Yahoo Inc.\n * Copyrights licensed under the New BSD License.\n * See the accompanying LICENSE file for terms.\n */\nimport { __extends } from \"tslib\";\nimport { createIntlCache } from '@formatjs/intl';\nimport * as React from 'react';\nimport { DEFAULT_INTL_CONFIG, invariantIntlContext, shallowEqual } from '../utils';\nimport { Provider } from './injectIntl';\nimport { createIntl } from './createIntl';\nfunction processIntlConfig(config) {\n return {\n locale: config.locale,\n timeZone: config.timeZone,\n fallbackOnEmptyString: config.fallbackOnEmptyString,\n formats: config.formats,\n textComponent: config.textComponent,\n messages: config.messages,\n defaultLocale: config.defaultLocale,\n defaultFormats: config.defaultFormats,\n onError: config.onError,\n onWarn: config.onWarn,\n wrapRichTextChunksInFragment: config.wrapRichTextChunksInFragment,\n defaultRichTextElements: config.defaultRichTextElements,\n };\n}\nvar IntlProvider = /** @class */ (function (_super) {\n __extends(IntlProvider, _super);\n function IntlProvider() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.cache = createIntlCache();\n _this.state = {\n cache: _this.cache,\n intl: createIntl(processIntlConfig(_this.props), _this.cache),\n prevConfig: processIntlConfig(_this.props),\n };\n return _this;\n }\n IntlProvider.getDerivedStateFromProps = function (props, _a) {\n var prevConfig = _a.prevConfig, cache = _a.cache;\n var config = processIntlConfig(props);\n if (!shallowEqual(prevConfig, config)) {\n return {\n intl: createIntl(config, cache),\n prevConfig: config,\n };\n }\n return null;\n };\n IntlProvider.prototype.render = function () {\n invariantIntlContext(this.state.intl);\n return React.createElement(Provider, { value: this.state.intl }, this.props.children);\n };\n IntlProvider.displayName = 'IntlProvider';\n IntlProvider.defaultProps = DEFAULT_INTL_CONFIG;\n return IntlProvider;\n}(React.PureComponent));\nexport default IntlProvider;\n","import { createFormattedComponent, createFormattedDateTimePartsComponent, } from './src/components/createFormattedComponent';\nimport injectIntl, { Provider as RawIntlProvider, Context as IntlContext, } from './src/components/injectIntl';\nimport useIntl from './src/components/useIntl';\nimport IntlProvider from './src/components/provider';\nimport { createIntl } from './src/components/createIntl';\nimport FormattedRelativeTime from './src/components/relative';\nimport FormattedPlural from './src/components/plural';\nimport FormattedMessage from './src/components/message';\nimport FormattedDateTimeRange from './src/components/dateTimeRange';\nexport { FormattedDateTimeRange, FormattedMessage, FormattedPlural, FormattedRelativeTime, IntlContext, IntlProvider, RawIntlProvider, createIntl, injectIntl, useIntl, };\nexport { createIntlCache, UnsupportedFormatterError, InvalidConfigError, MissingDataError, MessageFormatError, MissingTranslationError, IntlErrorCode as ReactIntlErrorCode, IntlError as ReactIntlError, } from '@formatjs/intl';\nexport function defineMessages(msgs) {\n return msgs;\n}\nexport function defineMessage(msg) {\n return msg;\n}\n// IMPORTANT: Explicit here to prevent api-extractor from outputing `import('./src/types').CustomFormatConfig`\nexport var FormattedDate = createFormattedComponent('formatDate');\nexport var FormattedTime = createFormattedComponent('formatTime');\nexport var FormattedNumber = createFormattedComponent('formatNumber');\nexport var FormattedList = createFormattedComponent('formatList');\nexport var FormattedDisplayName = createFormattedComponent('formatDisplayName');\nexport var FormattedDateParts = createFormattedDateTimePartsComponent('formatDate');\nexport var FormattedTimeParts = createFormattedDateTimePartsComponent('formatTime');\nexport { FormattedNumberParts, FormattedListParts, } from './src/components/createFormattedComponent';\n","/******************************************************************************\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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\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 (g && (g = 0, op[0] && (_ = 0)), _) 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 var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(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, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, 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\n/** @deprecated */\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\n/** @deprecated */\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 __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\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\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\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 (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, 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, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","const t=t=>{var o;return null===(o=t.context.actorRef)||void 0===o?void 0:o.getSnapshot()},o=o=>{var n;return null===(n=t(o))||void 0===n?void 0:n.context};export{o as getActorContext,t as getActorState};\n","var o,e;!function(o){o.Apple=\"SignInWithApple\",o.Amazon=\"LoginWithAmazon\",o.Facebook=\"Facebook\",o.Google=\"Google\"}(o||(o={})),function(o){o.Email=\"email\",o.PhoneNumber=\"phone_number\"}(e||(e={}));export{o as FederatedIdentityProviders,e as UnverifiedContactMethodType};\n","const e=[\"birthdate\",\"email\",\"family_name\",\"given_name\",\"middle_name\",\"name\",\"nickname\",\"phone_number\",\"preferred_username\",\"profile\",\"website\"],n=[\"address\",\"gender\",\"locale\",\"picture\",\"updated_at\",\"zoneinfo\"],a=[\"username\",\"email\",\"phone_number\"],r=[...a,...e,\"confirmation_code\",\"password\",\"confirm_password\"],i=e=>r.includes(e);export{a as LoginMechanismArray,r as authFieldsWithDefaults,i as isAuthFieldsWithDefaults,e as signUpFieldsWithDefault,n as signUpFieldsWithoutDefault};\n","var e;!function(e){e.Alert=\"amplify-alert\",e.AlertIcon=\"amplify-alert__icon\",e.AlertHeading=\"amplify-alert__heading\",e.AlertBody=\"amplify-alert__body\",e.AlertDismiss=\"amplify-alert__dismiss\",e.Autocomplete=\"amplify-autocomplete\",e.AutocompleteMenu=\"amplify-autocomplete__menu\",e.AutocompleteMenuEmpty=\"amplify-autocomplete__menu--empty\",e.AutocompleteMenuFooter=\"amplify-autocomplete__menu__footer\",e.AutocompleteMenuHeader=\"amplify-autocomplete__menu__header\",e.AutocompleteMenuLoading=\"amplify-autocomplete__menu--loading\",e.AutocompleteMenuOption=\"amplify-autocomplete__menu__option\",e.AutocompleteMenuOptions=\"amplify-autocomplete__menu__options\",e.Badge=\"amplify-badge\",e.Button=\"amplify-button\",e.ButtonGroup=\"amplify-buttongroup\",e.ButtonLoaderWrapper=\"amplify-button__loader-wrapper\",e.Card=\"amplify-card\",e.Checkbox=\"amplify-checkbox\",e.CheckboxButton=\"amplify-checkbox__button\",e.CheckboxIcon=\"amplify-checkbox__icon\",e.CheckboxInput=\"amplify-checkbox__input\",e.CheckboxLabel=\"amplify-checkbox__label\",e.CheckboxField=\"amplify-checkboxfield\",e.Collection=\"amplify-collection\",e.CollectionItems=\"amplify-collection-items\",e.CollectionSearch=\"amplify-collection-search\",e.CollectionPagination=\"amplify-collection-pagination\",e.CountryCodeSelect=\"amplify-countrycodeselect\",e.DialCodeSelect=\"amplify-dialcodeselect\",e.Divider=\"amplify-divider\",e.DividerLabel=\"amplify-divider--label\",e.Expander=\"amplify-expander\",e.ExpanderContent=\"amplify-expander__content\",e.ExpanderContentText=\"amplify-expander__content__text\",e.ExpanderHeader=\"amplify-expander__header\",e.ExpanderIcon=\"amplify-expander__icon\",e.ExpanderItem=\"amplify-expander__item\",e.ExpanderTrigger=\"amplify-expander__trigger\",e.Field=\"amplify-field\",e.FieldDescription=\"amplify-field__description\",e.FieldErrorMessage=\"amplify-field__error-message\",e.FieldGroup=\"amplify-field-group\",e.FieldGroupControl=\"amplify-field-group__control\",e.FieldGroupOuterEnd=\"amplify-field-group__outer-end\",e.FieldGroupOuterStart=\"amplify-field-group__outer-start\",e.FieldGroupInnerEnd=\"amplify-field-group__inner-end\",e.FieldGroupInnerStart=\"amplify-field-group__inner-start\",e.FieldGroupIcon=\"amplify-field-group__icon\",e.FieldGroupIconButton=\"amplify-field-group__icon-button\",e.FieldGroupHasInnerEnd=\"amplify-field-group--has-inner-end\",e.FieldGroupHasInnerStart=\"amplify-field-group--has-inner-start\",e.FieldShowPassword=\"amplify-field__show-password\",e.FieldGroupFieldWrapper=\"amplify-field-group__field-wrapper\",e.FileUploaderDropZone=\"amplify-fileuploader__dropzone\",e.FileUploaderDropZoneIcon=\"amplify-fileuploader__dropzone__icon\",e.FileUploaderDropZoneText=\"amplify-fileuploader__dropzone__text\",e.FileUploaderDropZoneButton=\"amplify-fileuploader__dropzone__button\",e.FileUploaderFile=\"amplify-fileuploader__file\",e.FileUploaderFileWrapper=\"amplify-fileuploader__file__wrapper\",e.FileUploaderFileName=\"amplify-fileuploader__file__name\",e.FileUploaderFileSize=\"amplify-fileuploader__file__size\",e.FileUploaderFileInfo=\"amplify-fileuploader__file__info\",e.FileUploaderFileImage=\"amplify-fileuploader__file__image\",e.FileUploaderFileMain=\"amplify-fileuploader__file__main\",e.FileUploaderFileStatus=\"amplify-fileuploader__file__status\",e.FileUploaderLoader=\"amplify-fileuploader__loader\",e.FileUploaderPreviewer=\"amplify-fileuploader__previewer\",e.FileUploaderPreviewerText=\"amplify-fileuploader__previewer__text\",e.FileUploaderPreviewerBody=\"amplify-fileuploader__previewer__body\",e.FileUploaderPreviewerFooter=\"amplify-fileuploader__previewer__footer\",e.FileUploaderPreviewerFooterActions=\"amplify-fileuploader__previewer__footer__actions\",e.Flex=\"amplify-flex\",e.Grid=\"amplify-grid\",e.Heading=\"amplify-heading\",e.HighlightMatch=\"amplify-highlightmatch\",e.HighlightMatchHighlighted=\"amplify-highlightmatch__highlighted\",e.Icon=\"amplify-icon\",e.Image=\"amplify-image\",e.Input=\"amplify-input\",e.Label=\"amplify-label\",e.Link=\"amplify-link\",e.Loader=\"amplify-loader\",e.LoaderDeterminate=\"amplify-loader--determinate\",e.LoaderPercentageText=\"amplify-loader__percentage-text\",e.MenuContent=\"amplify-menu-content\",e.MenuContentWrapper=\"amplify-menu-content-wrapper\",e.MenuItem=\"amplify-menu-content__item\",e.MenuTrigger=\"amplify-menu-trigger\",e.Pagination=\"amplify-pagination\",e.PaginationItemButton=\"amplify-pagination__item-button\",e.PaginationItemCurrent=\"amplify-pagination__item-current\",e.PaginationItemEllipsis=\"amplify-pagination__item-ellipsis\",e.PasswordField=\"amplify-passwordfield\",e.PhoneNumberField=\"amplify-phonenumberfield\",e.Placeholder=\"amplify-placeholder\",e.Radio=\"amplify-radio\",e.RadioButton=\"amplify-radio__button\",e.RadioInput=\"amplify-radio__input\",e.RadioLabel=\"amplify-radio__label\",e.RadioGroupField=\"amplify-radiogroupfield\",e.RadioGroup=\"amplify-radiogroup\",e.Rating=\"amplify-rating\",e.ScrollView=\"amplify-scrollview\",e.SearchField=\"amplify-searchfield\",e.SearchFieldClear=\"amplify-searchfield__clear\",e.SearchFieldSearch=\"amplify-searchfield__search\",e.Select=\"amplify-select\",e.SelectField=\"amplify-selectfield\",e.SelectWrapper=\"amplify-select__wrapper\",e.SelectIconWrapper=\"amplify-select__icon-wrapper\",e.SliderField=\"amplify-sliderfield\",e.SliderFieldGroup=\"amplify-sliderfield__group\",e.SliderFieldLabel=\"amplify-sliderfield__label\",e.SliderFieldRange=\"amplify-sliderfield__range\",e.SliderFieldRoot=\"amplify-sliderfield__root\",e.SliderFieldThumb=\"amplify-sliderfield__thumb\",e.SliderFieldTrack=\"amplify-sliderfield__track\",e.StepperField=\"amplify-stepperfield\",e.StepperFieldButtonDecrease=\"amplify-stepperfield__button--decrease\",e.StepperFieldButtonIncrease=\"amplify-stepperfield__button--increase\",e.StepperFieldInput=\"amplify-stepperfield__input\",e.StorageManager=\"amplify-storagemanager\",e.StorageManagerDropZone=\"amplify-storagemanager__dropzone\",e.StorageManagerDropZoneIcon=\"amplify-storagemanager__dropzone__icon\",e.StorageManagerDropZoneText=\"amplify-storagemanager__dropzone__text\",e.StorageManagerFilePicker=\"amplify-storagemanager__file__picker\",e.StorageManagerFile=\"amplify-storagemanager__file\",e.StorageManagerFileWrapper=\"amplify-storagemanager__file__wrapper\",e.StorageManagerFileList=\"amplify-storagemanager__file__list\",e.StorageManagerFileName=\"amplify-storagemanager__file__name\",e.StorageManagerFileSize=\"amplify-storagemanager__file__size\",e.StorageManagerFileInfo=\"amplify-storagemanager__file__info\",e.StorageManagerFileImage=\"amplify-storagemanager__file__image\",e.StorageManagerFileMain=\"amplify-storagemanager__file__main\",e.StorageManagerFileStatus=\"amplify-storagemanager__file__status\",e.StorageManagerLoader=\"amplify-storagemanager__loader\",e.StorageManagerPreviewer=\"amplify-storagemanager__previewer\",e.StorageManagerPreviewerText=\"amplify-storagemanager__previewer__text\",e.SwitchField=\"amplify-switchfield\",e.SwitchLabel=\"amplify-switch-label\",e.SwitchThumb=\"amplify-switch-thumb\",e.SwitchTrack=\"amplify-switch-track\",e.SwitchWrapper=\"amplify-switch__wrapper\",e.Table=\"amplify-table\",e.TableCaption=\"amplify-table__caption\",e.TableBody=\"amplify-table__body\",e.TableTd=\"amplify-table__td\",e.TableTh=\"amplify-table__th\",e.TableFoot=\"amplify-table__foot\",e.TableHead=\"amplify-table__head\",e.TableRow=\"amplify-table__row\",e.Tabs=\"amplify-tabs\",e.TabItems=\"amplify-tabs-item\",e.Text=\"amplify-text\",e.Textarea=\"amplify-textarea\",e.TextAreaField=\"amplify-textareafield\",e.TextField=\"amplify-textfield\",e.ToggleButton=\"amplify-togglebutton\",e.ToggleButtonGroup=\"amplify-togglebuttongroup\",e.VisuallyHidden=\"amplify-visually-hidden\"}(e||(e={}));export{e as ComponentClassName};\n","import\"../../types/authenticator/user.mjs\";import{LoginMechanismArray as t}from\"../../types/authenticator/attributes.mjs\";import\"../../types/primitives/componentClassName.mjs\";const i=t=>{var i;const s=null===(i=null==t?void 0:t.context.config)||void 0===i?void 0:i.loginMechanisms,[n]=null!=s?s:[\"username\"];return n},s=i=>{var s;const n=(null===(s=i.config)||void 0===s?void 0:s.loginMechanisms).filter((i=>t.includes(i))),[o,...e]=n;return{primaryAlias:o,secondaryAliases:e}};export{s as getConfiguredAliases,i as getPrimaryAlias};\n","import{getActorContext as e,getActorState as t}from\"./actor.mjs\";const r=e=>{const t=t=>r=>e({type:t,data:r});return{initializeMachine:t(\"INIT\"),resendCode:t(\"RESEND\"),signOut:t(\"SIGN_OUT\"),submitForm:t(\"SUBMIT\"),updateForm:t(\"CHANGE\"),updateBlur:t(\"BLUR\"),toFederatedSignIn:t(\"FEDERATED_SIGN_IN\"),toResetPassword:t(\"RESET_PASSWORD\"),toSignIn:t(\"SIGN_IN\"),toSignUp:t(\"SIGN_UP\"),skipVerification:t(\"SKIP\")}},n=r=>{var n,s,i,a,o;const c=null!==(n=e(r))&&void 0!==n?n:{},{codeDeliveryDetails:u,remoteError:d,unverifiedContactMethods:l,validationError:m,totpSecretCode:h=null}=c,{socialProviders:v}=null!==(i=null===(s=r.context)||void 0===s?void 0:s.config)&&void 0!==i?i:{},g=null!==(a=null==c?void 0:c.user)&&void 0!==a?a:null===(o=r.context)||void 0===o?void 0:o.user,f=m&&Object.keys(m).length>0,p=t(r),S=r.hasTag(\"pending\")||(null==p?void 0:p.hasTag(\"pending\")),I=(()=>{switch(!0){case r.matches(\"idle\"):return\"idle\";case r.matches(\"setup\"):return\"setup\";case r.matches(\"signOut\"):return\"signOut\";case r.matches(\"authenticated\"):return\"authenticated\";case null==p?void 0:p.matches(\"confirmSignUp\"):return\"confirmSignUp\";case null==p?void 0:p.matches(\"confirmSignIn\"):return\"confirmSignIn\";case null==p?void 0:p.matches(\"setupTOTP.edit\"):case null==p?void 0:p.matches(\"setupTOTP.submit\"):return\"setupTOTP\";case null==p?void 0:p.matches(\"signIn\"):return\"signIn\";case null==p?void 0:p.matches(\"signUp\"):return\"signUp\";case null==p?void 0:p.matches(\"forceNewPassword\"):return\"forceNewPassword\";case null==p?void 0:p.matches(\"resetPassword\"):return\"resetPassword\";case null==p?void 0:p.matches(\"confirmResetPassword\"):return\"confirmResetPassword\";case null==p?void 0:p.matches(\"verifyUser\"):return\"verifyUser\";case null==p?void 0:p.matches(\"confirmVerifyUser\"):return\"confirmVerifyUser\";case null==p?void 0:p.matches(\"setupTOTP.getTotpSecretCode\"):case r.matches(\"signIn.runActor\"):return\"transition\";default:return console.debug(\"Cannot infer `route` from Authenticator state:\",r.value),null}})(),P=(e=>{switch(e){case\"idle\":case\"setup\":return\"configuring\";case\"authenticated\":return\"authenticated\";default:return\"unauthenticated\"}})(I);return{authStatus:P,codeDeliveryDetails:u,error:d,hasValidationErrors:f,isPending:S,route:I,socialProviders:v,totpSecretCode:h,unverifiedContactMethods:l,user:g,validationErrors:m}},s=({send:e,state:t})=>{const s=r(e),i=n(t);return Object.assign(Object.assign({},s),i)};export{r as getSendEventAliases,n as getServiceContextFacade,s as getServiceFacade};\n","const o=[\"+1\",\"+7\",\"+20\",\"+27\",\"+30\",\"+31\",\"+32\",\"+33\",\"+34\",\"+36\",\"+39\",\"+40\",\"+41\",\"+43\",\"+44\",\"+45\",\"+46\",\"+47\",\"+48\",\"+49\",\"+51\",\"+52\",\"+53\",\"+54\",\"+55\",\"+56\",\"+57\",\"+58\",\"+60\",\"+61\",\"+62\",\"+63\",\"+64\",\"+65\",\"+66\",\"+81\",\"+82\",\"+84\",\"+86\",\"+90\",\"+91\",\"+92\",\"+93\",\"+94\",\"+95\",\"+98\",\"+212\",\"+213\",\"+216\",\"+218\",\"+220\",\"+221\",\"+222\",\"+223\",\"+224\",\"+225\",\"+226\",\"+227\",\"+228\",\"+229\",\"+230\",\"+231\",\"+232\",\"+233\",\"+234\",\"+235\",\"+236\",\"+237\",\"+238\",\"+239\",\"+240\",\"+241\",\"+242\",\"+243\",\"+244\",\"+245\",\"+246\",\"+248\",\"+249\",\"+250\",\"+251\",\"+252\",\"+253\",\"+254\",\"+255\",\"+256\",\"+257\",\"+258\",\"+260\",\"+261\",\"+262\",\"+263\",\"+264\",\"+265\",\"+266\",\"+267\",\"+268\",\"+269\",\"+290\",\"+291\",\"+297\",\"+298\",\"+299\",\"+345\",\"+350\",\"+351\",\"+352\",\"+353\",\"+354\",\"+355\",\"+356\",\"+357\",\"+358\",\"+359\",\"+370\",\"+371\",\"+372\",\"+373\",\"+374\",\"+375\",\"+376\",\"+377\",\"+378\",\"+379\",\"+380\",\"+381\",\"+382\",\"+385\",\"+386\",\"+387\",\"+389\",\"+420\",\"+421\",\"+423\",\"+500\",\"+501\",\"+502\",\"+503\",\"+504\",\"+505\",\"+506\",\"+507\",\"+508\",\"+509\",\"+537\",\"+590\",\"+591\",\"+593\",\"+594\",\"+595\",\"+596\",\"+597\",\"+598\",\"+599\",\"+670\",\"+672\",\"+673\",\"+674\",\"+675\",\"+676\",\"+677\",\"+678\",\"+679\",\"+680\",\"+681\",\"+682\",\"+683\",\"+685\",\"+686\",\"+687\",\"+688\",\"+689\",\"+690\",\"+691\",\"+692\",\"+850\",\"+852\",\"+853\",\"+855\",\"+856\",\"+872\",\"+880\",\"+886\",\"+960\",\"+961\",\"+962\",\"+963\",\"+964\",\"+965\",\"+966\",\"+967\",\"+968\",\"+970\",\"+971\",\"+972\",\"+973\",\"+974\",\"+975\",\"+976\",\"+977\",\"+992\",\"+993\",\"+994\",\"+995\",\"+996\",\"+998\"];export{o as countryDialCodes};\n","const e={\"Account recovery requires verified contact information\":\"Zurücksetzen des Account benötigt einen verifizierten Account\",\"Back to Sign In\":\"Zurück zur Anmeldung\",\"Change Password\":\"Passwort ändern\",Changing:\"Ändern von\",Code:\"Code\",\"Confirm Password\":\"Passwort bestätigen\",\"Confirm Sign Up\":\"Registrierung bestätigen\",\"Confirm SMS Code\":\"SMS-Code bestätigen\",\"Confirm TOTP Code\":\"TOTP-Code bestätigen\",Confirm:\"Bestätigen\",\"Confirmation Code\":\"Bestätigungs-Code\",Confirming:\"Wird bestätigt\",\"Create a new account\":\"Einen neuen Account erstellen\",\"Create Account\":\"Account erstellen\",\"Creating Account\":\"Account wird erstellt\",\"Dismiss alert\":\"Warnung verwerfen\",Email:\"Email\",\"Enter your code\":\"Geben Sie Ihren Code ein\",\"Enter your Email\":\"Geben Sie Ihre E-Mail\",\"Enter your phone number\":\"Geben Sie Ihre Telefonnummer ein\",\"Enter your username\":\"Geben Sie Ihren Benutzernamen ein\",\"Forgot your password?\":\"Passwort vergessen? \",\"Hide password\":\"Passwort verbergen\",\"It may take a minute to arrive\":\"Es kann eine Minute dauern, bis er ankommt\",Loading:\"Wird geladen\",\"New password\":\"Neues Passwort\",or:\"oder\",Password:\"Passwort\",\"Phone Number\":\"Telefonnummer\",\"Resend Code\":\"Code erneut senden\",\"Reset your Password\":\"Zurücksetzen des Passwort\",\"Reset your password\":\"Zurücksetzen des passwort\",\"Send code\":\"Code senden\",\"Send Code\":\"Code senden\",Sending:\"Wird gesendet\",\"Setup TOTP\":\"TOTP einrichten\",\"Show password\":\"Passwort anzeigen\",\"Sign in to your account\":\"Melden Sie sich mit Ihrem Account an\",\"Sign In with Amazon\":\"Mit Amazon anmelden\",\"Sign In with Apple\":\"Mit Apple anmelden\",\"Sign In with Facebook\":\"Mit Facebook anmelden\",\"Sign In with Google\":\"Mit Google anmelden\",\"Sign in\":\"Anmelden\",\"Sign In\":\"Anmelden\",\"Signing in\":\"Wird angemeldet\",Skip:\"Überspringen\",Submit:\"Abschicken\",Submitting:\"Wird gesendet\",Username:\"Benutzername\",\"Verify Contact\":\"Kontakt verifizieren\",Verify:\"Verifizieren\",\"We Sent A Code\":\"Wir haben einen Code gesendet\",\"We Texted You\":\"Wir haben Ihnen eine SMS-Textur\",\"Your code is on the way. To log in, enter the code we sent you\":\"Ihr Code ist unterwegs. Um sich anzumelden, geben Sie den Code ein, den wir Ihnen gesendet haben\",\"An account with the given email already exists.\":\"Ein Account mit dieser Email existiert bereits.\",\"Confirm a Code\":\"Code bestätigen\",\"Confirm Sign In\":\"Anmeldung bestätigen\",\"Create account\":\"Hier registrieren\",\"Enter your password\":\"Geben Sie Ihr Passwort ein\",\"Enter your Password\":\"Geben Sie Ihre Passwort ein\",\"Sign Up with Facebook\":\"Mit Facebook registrieren\",\"Sign Up with Google\":\"Mit Google registrieren\",\"Forgot Password\":\"Passwort vergessen\",\"Have an account? \":\"Schon registriert? \",\"Incorrect username or password\":\"Falscher Benutzername oder falsches Passwort\",\"Invalid password format\":\"Ungültiges Passwort-Format\",\"Invalid phone number format\":\"Ungültiges Telefonummern-Format. Benutze eine Nummer im Format: +12345678900\",\"It may take a minute to arrive.\":\"Es könnte eine Minute dauern, bis der Code eintrifft.\",\"Lost your code? \":\"Code verloren? \",\"New Password\":\"Neues Passwort\",\"No account? \":\"Kein Account? \",\"Password attempts exceeded\":\"Die maximale Anzahl der fehlerhaften Anmeldeversuche wurde erreicht\",\"Reset password\":\"Passwort zurücksetzen\",\"Sign Out\":\"Abmelden\",\"Sign Up\":\"Registrieren\",\"User already exists\":\"Dieser Benutzer existiert bereits\",\"User does not exist\":\"Dieser Benutzer existiert nicht\",\"Username cannot be empty\":\"Benutzername darf nicht leer sein\",\"We Emailed You\":\"Email wurde versendet\",\"Your code is on the way. To log in, enter the code we emailed to\":\"Ihr Bestätigungscode ist unterwegs. Um sich einzuloggen geben Sie den Code ein, den wir verschickt haben an\",\"Your code is on the way. To log in, enter the code we texted to\":\"Ihr Bestätigungscode ist unterwegs. Um sich einzuloggen geben Sie den Code ein, den wir verschickt haben an\"};export{e as deDict};\n","const e={\"Account recovery requires verified contact information\":\"Account recovery requires verified contact information\",\"Add your Profile\":\"Add your Profile\",\"Add your Website\":\"Add your Website\",\"Back to Sign In\":\"Back to Sign In\",\"Change Password\":\"Change Password\",Changing:\"Changing\",Code:\"Code\",\"Confirm Password\":\"Confirm Password\",\"Confirm Sign Up\":\"Confirm Sign Up\",\"Confirm SMS Code\":\"Confirm SMS Code\",\"Confirm TOTP Code\":\"Confirm TOTP Code\",Confirm:\"Confirm\",\"Confirmation Code\":\"Confirmation Code\",Confirming:\"Confirming\",\"Create a new account\":\"Create a new account\",\"Create Account\":\"Create Account\",\"Creating Account\":\"Creating Account\",\"Dismiss alert\":\"Dismiss alert\",Email:\"Email\",\"Enter your Birthdate\":\"Enter your Birthdate\",\"Enter your code\":\"Enter your code\",\"Enter your Confirmation Code\":\"Enter your Confirmation Code\",\"Enter your Email\":\"Enter your Email\",\"Enter your Family Name\":\"Enter your Family Name\",\"Enter your Given Name\":\"Enter your Given Name\",\"Enter your Middle Name\":\"Enter your Middle Name\",\"Enter your Name\":\"Enter your Name\",\"Enter your Nickname\":\"Enter your Nickname\",\"Enter your Password\":\"Enter your Password\",\"Enter your phone number\":\"Enter your phone number\",\"Enter your Preferred Username\":\"Enter your Preferred Username\",\"Enter your username\":\"Enter your username\",\"Forgot password?\":\"Forgot password?\",\"Forgot your password?\":\"Forgot your password?\",\"Hide password\":\"Hide password\",\"It may take a minute to arrive\":\"It may take a minute to arrive\",Loading:\"Loading\",\"New password\":\"New password\",or:\"or\",Password:\"Password\",\"Phone Number\":\"Phone Number\",\"Please confirm your Password\":\"Please confirm your Password\",\"Resend Code\":\"Resend Code\",\"Reset your password\":\"Reset your password\",\"Reset your Password\":\"Reset your Password\",\"Send code\":\"Send code\",\"Send Code\":\"Send Code\",Sending:\"Sending\",\"Setup TOTP\":\"Setup TOTP\",\"Show password\":\"Show password\",\"Sign in to your account\":\"Sign in to your account\",\"Sign In with Amazon\":\"Sign In with Amazon\",\"Sign In with Apple\":\"Sign In with Apple\",\"Sign In with Facebook\":\"Sign In with Facebook\",\"Sign In with Google\":\"Sign In with Google\",\"Sign in\":\"Sign in\",\"Sign In\":\"Sign In\",\"Signing in\":\"Signing in\",Skip:\"Skip\",Submit:\"Submit\",Submitting:\"Submitting\",Username:\"Username\",\"Verify Contact\":\"Verify Contact\",Verify:\"Verify\",\"We Emailed You\":\"We Emailed You\",\"We Sent A Code\":\"We Sent A Code\",\"We Texted You\":\"We Texted You\",\"Your code is on the way. To log in, enter the code we emailed to\":\"Your code is on the way. To log in, enter the code we emailed to\",\"Your code is on the way. To log in, enter the code we sent you\":\"Your code is on the way. To log in, enter the code we sent you\",\"Your code is on the way. To log in, enter the code we texted to\":\"Your code is on the way. To log in, enter the code we texted to\"};export{e as enDict};\n","const e={\"Account recovery requires verified contact information\":\"La recuperación de la cuenta requiere información de contacto verificada\",\"Back to Sign In\":\"Volver a inicio de sesión\",\"Change Password\":\"Cambiar contraseña\",Changing:\"Cambiando\",Code:\"Código\",\"Confirm Password\":\"Confirmar contraseña\",\"Confirm Sign Up\":\"Confirmar registro\",\"Confirm SMS Code\":\"Confirmar el código de SMS\",\"Confirm TOTP Code\":\"Confirmar código TOTP\",Confirm:\"Confirmar\",\"Confirmation Code\":\"Código de confirmación\",Confirming:\"Confirmando\",\"Create a new account\":\"Crear una cuenta nueva\",\"Create Account\":\"Crear cuenta\",\"Creating Account\":\"Creando cuenta\",\"Dismiss alert\":\"Descartar alerta\",Email:\"Email\",\"Enter your code\":\"Ingrese el código\",\"Enter your Email\":\"Escriba su Email\",\"Enter your Password\":\"Escriba su Contraseña\",\"Enter your phone number\":\"Ingrese el número de teléfono\",\"Enter your username\":\"Ingrese el nombre de usuario\",\"Forgot your password?\":\"¿Olvidó su contraseña?\",\"Hide password\":\"Ocultar contraseña\",\"It may take a minute to arrive\":\"Es posible que tarde un minuto en llegar\",Loading:\"Cargando\",\"New password\":\"Nueva contraseña\",or:\"o\",Password:\"Contraseña\",\"Phone Number\":\"Número de teléfono\",\"Resend Code\":\"Reenviar código\",\"Reset your password\":\"Restablecer su contraseña\",\"Reset your Password\":\"Restablecer su Contraseña\",\"Send code\":\"Enviar código\",\"Send Code\":\"Enviar código\",Sending:\"Enviando\",\"Setup TOTP\":\"Configurar TOTP\",\"Show password\":\"Mostrar contraseña\",\"Sign in to your account\":\"Iniciar sesión en tu cuenta\",\"Sign In with Amazon\":\"Iniciar Sesión con Amazon\",\"Sign In with Apple\":\"Iniciar Sesión con Apple\",\"Sign In with Facebook\":\"Iniciar Sesión con Facebook\",\"Sign In with Google\":\"Iniciar Sesión con Google\",\"Sign in\":\"Iniciar sesión\",\"Sign In\":\"Iniciar Sesión\",\"Signing in\":\"Iniciando sesión\",Skip:\"Omitir\",Submit:\"Enviar\",Submitting:\"Enviando\",Username:\"Nombre de usuario\",\"Verify Contact\":\"Verificar contacto\",Verify:\"Verificar\",\"We Emailed You\":\"Le hemos enviado un correo electrónico\",\"We Sent A Code\":\"Hemos enviado un código\",\"We Texted You\":\"Le hemos enviado un mensaje de texto\",\"Your code is on the way. To log in, enter the code we emailed to\":\"El código está en camino. Para iniciar sesión, escriba el código que hemos enviado por correo electrónico a\",\"Your code is on the way. To log in, enter the code we sent you\":\"El código está en camino. Para iniciar sesión, escriba el código que le hemos enviado\",\"Your code is on the way. To log in, enter the code we texted to\":\"El código está en camino. Para iniciar sesión, escriba el código que hemos enviado por mensaje de texto a\",\"An account with the given email already exists.\":\"Ya existe una cuenta con el correo ingresado.\",\"Confirm a Code\":\"Confirmar un código\",\"Confirm Sign In\":\"Confirmar inicio de sesión\",\"Forgot Password\":\"Olvidé mi contraseña\",\"Incorrect username or password.\":\"Nombre de usuario o contraseña incorrecta\",\"Invalid password format\":\"Formato de contraseña inválido\",\"Invalid phone number format\":\"Formato de número de teléfono inválido\",\"Loading...\":\"Cargando...\",\"New Password\":\"Nueva contraseña\",\"Resend a Code\":\"Reenviar un código\",\"Sign Out\":\"Cerrar sesión\",\"Sign Up with Amazon\":\"Crear cuenta con Amazon\",\"Sign Up with Apple\":\"Crear cuenta con Apple\",\"Sign Up with Facebook\":\"Crear cuenta con Facebook\",\"Sign Up with Google\":\"Crear cuenta con Google\",\"Sign Up\":\"Crear cuenta\",\"User already exists\":\"El usuario ya existe\",\"User does not exist\":\"El usuario no existe\",\"Username cannot be empty\":\"El nombre de usuario no puede estar vacío\",\"Your passwords must match\":\"Las contraseñas deben coincidir\"};export{e as esDict};\n","const e={\"Account recovery requires verified contact information\":\"La récupération du compte nécessite des informations de contact vérifiées\",\"Back to Sign In\":\"Retour à la connexion\",\"Change Password\":\"Modifier le mot de passe\",Changing:\"Modification en cours\",Code:\"Code\",\"Confirm Password\":\"Confirmez le mot de passe\",\"Confirm Sign Up\":\"Confirmer l'inscription\",\"Confirm SMS Code\":\"Confirmer le code SMS\",\"Confirm TOTP Code\":\"Confirmer le code TOTP\",Confirm:\"Confirmer\",\"Confirmation Code\":\"Code de confirmation\",Confirming:\"Confirmation\",\"Create a new account\":\"Créer un nouveau compte\",\"Create Account\":\"Créer un compte\",\"Creating Account\":\"Création d'un compte\",\"Dismiss alert\":\"Supprimer l'alerte\",Email:\"Email\",\"Enter your code\":\"Saisissez cotre code de confirmation\",\"Enter your Email\":\"Saisissez votre adresse email\",\"Enter your phone number\":\"Saisissez votre numéro de téléphone\",\"Enter your username\":\"Saisissez votre nom d'utilisateur\",\"Forgot your password?\":\"Mot de passe oublié ? \",\"Hide password\":\"Masquer le mot de passe\",\"It may take a minute to arrive\":\"Cela peut prendre une minute\",Loading:\"Chargement en cours\",\"New password\":\"Nouveau mot de passe\",or:\"ou\",Password:\"Mot de passe\",\"Phone Number\":\"Numéro de téléphone\",\"Resend Code\":\"Renvoyer le code\",\"Reset your Password\":\"Réinitialiser votre mot de passe\",\"Reset your password\":\"Réinitialisez votre mot de passe\",\"Send code\":\"Envoyer le code\",\"Send Code\":\"M'envoyer un code\",Sending:\"Envoi en cours\",\"Setup TOTP\":\"Configuration de TOTP\",\"Show password\":\"Afficher le mot de passe\",\"Sign in to your account\":\"Connexion à votre compte\",\"Sign In with Amazon\":\"Se connecter avec Amazon\",\"Sign In with Apple\":\"Se connecter avec Apple\",\"Sign In with Facebook\":\"Se connecter avec Facebook\",\"Sign In with Google\":\"Se connecter avec Google\",\"Sign in\":\"Se connecter\",\"Sign In\":\"Se connecter\",\"Signing in\":\"Connexion en cours\",Skip:\"Passer\",Submit:\"Soumettre\",Submitting:\"Envoi en cours\",Username:\"Nom d'utilisateur\",\"Verify Contact\":\"Vérifier le contact\",Verify:\"Vérifier\",\"We Sent A Code\":\"Nous avons envoyé un code\",\"We Texted You\":\"Nous vous avons envoyé un SMS\",\"Your code is on the way. To log in, enter the code we sent you\":\"Votre code est en cours d'envoi. Pour vous connecter, saisissez le code que nous vous avons envoyé\",\"An account with the given email already exists.\":\"Un utilisateur avec cette adresse email existe déjà.\",Change:\"Modifier\",\"Confirm a Code\":\"Confirmer un code\",\"Confirm Sign In\":\"Confirmer la connexion\",\"Create account\":\"Créer un compte\",\"Enter your password\":\"Saisissez votre mot de passe\",\"Forgot Password\":\"Mot de passe oublié\",\"Have an account? \":\"Déjà un compte ? \",Hello:\"Bonjour\",\"Incorrect username or password\":\"Identifiant ou mot de passe incorrect\",\"Invalid password format\":\"Format de mot de passe invalide\",\"Invalid phone number format\":\"Format de numéro de téléphone invalide. Veuillez utiliser un format +12345678900\",\"Loading...\":\"Chargement...\",\"Lost your code? \":\"Vous avez perdu votre code ? \",\"Network error\":\"Erreur réseau\",\"New Password\":\"Nouveau mot de passe\",\"No account? \":\"Pas de compte ? \",\"Resend a Code\":\"Renvoyer un code\",\"Reset password\":\"Réinitialisez votre mot de passe\",Send:\"Envoyer\",\"Sign In with AWS\":\"Se connecter avec AWS\",\"Sign Out\":\"Déconnexion\",\"Sign Up\":\"S'inscrire\",SMS:\"SMS\",\"User already exists\":\"L'utilisateur existe déjà\",\"User does not exist\":\"L'utilisateur n'existe pas\",\"Username cannot be empty\":\"Le nom d'utilisateur doit être renseigné\",\"Username/client id combination not found.\":\"L'utilisateur n'existe pas\",\"We Emailed You\":\"Nous vous avons envoyé un code\",\"Your code is on the way. To log in, enter the code we emailed to\":\"Votre code est en route. Pour vous connecter entrez le code reçu sur cette adresse email\",\"Your code is on the way. To log in, enter the code we texted to\":\"Votre code est en route. Pour vous connecter entrez le code reçu sur ce numéro de téléphone\",\"It may take a minute to arrive.\":\"Cela peut prendre quelques minutes.\"};export{e as frDict};\n","const o={\"Account recovery requires verified contact information\":\"Il ripristino dell'account richiede informazioni di contatto verificate\",\"Back to Sign In\":\"Torna alla schermata di accesso\",\"Change Password\":\"Cambia la password\",Changing:\"Modifica in corso\",Code:\"Codice\",\"Confirm Password\":\"Conferma la password\",\"Confirm Sign Up\":\"Conferma registrazione\",\"Confirm SMS Code\":\"Conferma codice SMS\",\"Confirm TOTP Code\":\"Conferma codice TOTP\",Confirm:\"Conferma\",\"Confirmation Code\":\"Codice di verifica\",Confirming:\"Conferma in corso\",\"Create a new account\":\"Crea un nuovo account\",\"Create Account\":\"Crea Account\",\"Creating Account\":\"Creazione account in corso\",\"Dismiss alert\":\"Ignora l'avviso\",Email:\"Email\",\"Enter your code\":\"Inserisci il tuo codice\",\"Enter your Email\":\"Inserisci la tua e-mail\",\"Enter your phone number\":'Inserisci il tuo numero di telefono\"',\"Enter your username\":\"Inserisci il tuo nome utente\",\"Forgot your password?\":\"Password dimenticata?\",\"Hide password\":\"Nascondi password\",\"It may take a minute to arrive\":\"L'arrivo potrebbe richiedere qualche minuto\",Loading:\"Caricamento in corso\",\"New password\":\"Nuova password\",or:\"oppure\",Password:\"Password\",\"Phone Number\":\"Numero di telefono\",\"Resend Code\":\"Invia nuovamente il codice\",\"Reset your Password\":\"Reimposta la tua Password\",\"Reset your password\":\"Reimposta la tua password\",\"Send code\":\"Invia codice\",\"Send Code\":\"Invia codice\",Sending:\"Invio in corso\",\"Setup TOTP\":\"Configura TOTP\",\"Show password\":\"Mostra password\",\"Sign in to your account\":\"Accedi al tuo account\",\"Sign In with Amazon\":\"Accedi con Amazon\",\"Sign In with Apple\":\"Accedi con Apple\",\"Sign In with Facebook\":\"Accedi con Facebook\",\"Sign In with Google\":\"Accedi con Google\",\"Sign in\":\"Accedi\",\"Sign In\":\"Accedi\",\"Signing in\":\"Accesso in corso\",Skip:\"Salta\",Submit:\"Invia\",Submitting:\"Invio in corso\",Username:\"Nome utente\",\"Verify Contact\":\"Verifica contatto\",Verify:\"Verifica\",\"We Emailed You\":\"Ti abbiamo inviato un'e-mail\",\"We Sent A Code\":\"Ti abbiamo inviato un codice\",\"We Texted You\":\"Ti abbiamo inviato un SMS\",\"Your code is on the way. To log in, enter the code we emailed to\":\"Il codice è in arrivo. Per effettuare l'accesso, immetti il codice che ti abbiamo inviato via e-mail\",\"Your code is on the way. To log in, enter the code we sent you\":\"Il codice è in arrivo. Per accedere, immetti il codice che ti abbiamo inviato\",\"Your code is on the way. To log in, enter the code we texted to\":\"Il codice è in arrivo. Per accedere, immetti il codice che abbiamo inviato tramite SMS\",\"An account with the given email already exists.\":\"Questa email è già utilizzata da un altro account.\",\"Confirm a Code\":\"Conferma un codice\",\"Confirm Sign In\":\"Conferma l'accesso\",\"Create account\":\"Crea account\",\"Enter your password\":\"Inserisci la tua password\",\"Forgot Password?\":\"Password dimenticata?\",\"Have an account? \":\"Già registrato?\",\"Incorrect username or password\":\"Nome utente o password errati\",\"Invalid password format\":\"Formato della password non valido\",\"Invalid phone number format\":\"Formato del numero di telefono non valido\",\"Lost your code?\":\"Codice smarrito?\",\"New Password\":\"Nuova password\",\"No account? \":\"Non hai un account?\",\"Password attempts exceeded\":\"Il numero massimo di tentativi di accesso falliti è stato raggiunto\",\"Reset password\":\"Reimposta password\",\"Sign Out\":\"Esci\",\"Sign Up\":\"Registrati\",\"User already exists\":\"Utente già esistente\",\"User does not exist\":\"Utente inesistente\",\"Username cannot be empty\":\"Il nome utente non può essere vuoto\"};export{o as itDict};\n","const e={\"Account recovery requires verified contact information\":\"アカウントの復旧には確認済みの連絡先が必要です\",\"Back to Sign In\":\"サインインに戻る\",\"Change Password\":\"パスワードを変える \",Changing:\"変更中\",Code:\"コード\",\"Confirm Password\":\"パスワードの確認\",\"Confirm Sign Up\":\"登録する\",\"Confirm SMS Code\":\"SMS コードを確認\",\"Confirm TOTP Code\":\"TOTP コードを確認\",Confirm:\"確定\",\"Confirmation Code\":\"確認コード\",Confirming:\"確認中\",\"Create a new account\":\"新しいアカウントを作る\",\"Create Account\":\"アカウントを作る\",\"Creating Account\":\"アカウントの作成中\",\"Dismiss alert\":\"アラートを閉じる\",Email:\"メールアドレス\",\"Enter your code\":\"コードを入力\",\"Enter your Email\":\"メールアドレスを入力\",\"Enter your phone number\":\"電話番号を入力\",\"Enter your username\":\"ユーザー名を入力 \",\"Forgot your password?\":\"パスワードを忘れましたか? \",\"Hide password\":\"パスワードを非表示\",\"It may take a minute to arrive\":\"到着するまでに 1 分かかることがあります。\",Loading:\"ロード中\",\"New password\":\"新しいパスワード\",or:\"又は\",Password:\"パスワード \",\"Phone Number\":\"電話番号\",\"Resend Code\":\"コードを再送信\",\"Reset your Password\":\"パスワードをリセット\",\"Reset your password\":\"パスワードをリセットする\",\"Send code\":\"コードを送信\",\"Send Code\":\"コードを送信\",Sending:\"送信中\",\"Setup TOTP\":\"TOTP をセットアップ\",\"Show password\":\"パスワードを表示\",\"Sign in to your account\":\"アカウントにサインイン \",\"Sign In with Amazon\":\"Amazonでサインイン\",\"Sign In with Apple\":\"Apple でサインイン\",\"Sign In with Facebook\":\"Facebookでサインイン\",\"Sign In with Google\":\"Googleでサインイン\",\"Sign In\":\"サインイン \",\"Sign in\":\"サインイン\",\"Signing in\":\"サインイン中\",Skip:\"スキップ\",Submit:\"送信\",Submitting:\"送信中\",Username:\"ユーザー名 \",\"Verify Contact\":\"連絡先を確認\",Verify:\"確認\",\"We Sent A Code\":\"コードが送信されました\",\"We Texted You\":\"テキストが送信されました\",\"Your code is on the way. To log in, enter the code we sent you\":\"コードが途中です。ログインするには、送信したコードを入力してください。\",\"An account with the given email already exists.\":\"入力されたメールアドレスのアカウントが既に存在します\",\"Confirm a Code\":\"コードを確認\",\"Confirm Sign In\":\"サインインする\",\"Create account\":\"アカウントを作る \",\"Enter your password\":\"パスワードを入力 \",\"Enter your Password\":\"パスワードを入力\",\"Please confirm your Password\":\"パスワードを入力\",\"Forgot Password\":\"パスワードを忘れた \",\"Have an account? \":\"アカウントを持っていますか?\",\"Incorrect username or password\":\"ユーザー名かパスワードが異なります \",\"Invalid password format\":\"パスワードの形式が無効です \",\"Invalid phone number format\":\"不正な電話番号の形式です。\\n+12345678900 の形式で入力してください\",\"It may take a minute to arrive.\":\"コードを受信するまで数分かかる場合があります。\",\"Lost your code? \":\"コードを失くしましたか?\",\"New Password\":\"新しいパスワード\",\"No account? \":\"アカウントが無いとき \",\"Password attempts exceeded\":\"サインインの試行回数が上限に達しました\",\"Reset password\":\"パスワードをリセット \",\"Reset Password\":\"パスワードをリセット\",\"Sign Out\":\"サインアウト \",\"Sign Up\":\"登録 \",\"User already exists\":\"既にユーザーが存在しています \",\"User does not exist\":\"ユーザーが存在しません \",\"Username cannot be empty\":\"ユーザー名は入力必須です\",\"We Emailed You\":\"コードを送信しました\",\"Your code is on the way. To log in, enter the code we emailed to\":\"ログインするには、メールに記載されたコードを入力してください。送信先:\",\"Your code is on the way. To log in, enter the code we texted to\":\"ログインするには、テキストメッセージに記載されたコードを入力してください。送信先:\"};export{e as jaDict};\n","const e={\"Account recovery requires verified contact information\":\"계정 복구를 위해 연락처 확인이 필요합니다\",\"Back to Sign In\":\"로그인으로 돌아가기\",\"Change Password\":\"비밀번호 변경하기\",Changing:\"변경중\",Code:\"코드\",\"Confirm Password\":\"비밀번호 재확인\",\"Confirm Sign Up\":\"회원가입 확인\",\"Confirm SMS Code\":\"휴대폰 본인 확인\",\"Confirm TOTP Code\":\"TOTP 인증번호 확인\",Confirm:\"확인\",\"Confirmation Code\":\"인증번호\",Confirming:\"확인중\",\"Create a new account\":\"회원가입\",\"Create Account\":\"회원가입\",\"Creating Account\":\"회원가입중\",\"Dismiss alert\":\"알림 무시\",Email:\"이메일\",\"Enter your code\":\"인증번호를 입력해주세요\",\"Enter your Email\":\"이메일 입력\",\"Enter your phone number\":\"전화번호 입력\",\"Enter your username\":\"아이디를 입력해주세요\",\"Hide password\":\"비밀번호 숨기기\",\"It may take a minute to arrive\":\"도착하는 데 1분 정도 걸릴 수 있습니다\",Loading:\"로딩중\",\"New password\":\"새 비밀번호\",or:\"또는\",Password:\"비밀번호\",\"Phone Number\":\"전화번호\",\"Resend Code\":\"인증번호 재전송\",\"Reset your password\":\"비밀번호 재설정\",\"Reset your Password\":\"비밀번호 재설정\",\"Send code\":\"인증코드 보내기\",\"Send Code\":\"코드 전송\",Sending:\"전송중\",\"Setup TOTP\":\"TOTP 설정하기\",\"Show password\":\"비밀번호 보이기\",\"Sign in to your account\":\"로그인\",\"Sign In with Amazon\":\"Amazon 로그인\",\"Sign In with Apple\":\"Apple 로그인\",\"Sign In with Facebook\":\"Facebook 로그인\",\"Sign In with Google\":\"Google 로그인\",\"Sign in\":\"로그인\",\"Sign In\":\"로그인\",\"Signing in\":\"로그인중\",Skip:\"다음에 하기\",Submit:\"확인\",Submitting:\"확인중\",Username:\"아이디\",\"Verify Contact\":\"연락처 확인\",Verify:\"인증\",\"We Emailed You\":\"이메일을 보냄\",\"We Sent A Code\":\"코드를 보냄\",\"We Texted You\":\"문자 메시지를 보냄\",\"Your code is on the way. To log in, enter the code we emailed to\":\"코드가 전송 중입니다. 로그인하려면 이메일로 전송한 코드를 입력하세요\",\"Your code is on the way. To log in, enter the code we sent you\":\"코드가 전송 중입니다. 로그인하려면 전송한 코드를 입력하세요\",\"Your code is on the way. To log in, enter the code we texted to\":\"코드가 전송 중입니다. 로그인하려면 문자 메시지로 전송한 코드를 입력하세요\",Birthdate:\"생년월일\",\"Family Name\":\"성\",\"Forgot your password?\":\"비밀번호를 잊으셨나요?\",\"Given Name\":\"이름\",Name:\"성함\",Nickname:\"닉네임\",\"Preferred Username\":\"닉네임\",Profile:\"프로필\",\"Reset Password\":\"비밀번호 재설정\",Website:\"웹사이트\"};export{e as krDict};\n","const e={\"Account recovery requires verified contact information\":\"Gjenoppretting av konto krever verifisert kontaktinformajson\",\"Add your Profile\":\"Legg til profilen din\",\"Add your Website\":\"Legg til nettsiden din\",\"Back to Sign In\":\"Tilbake til innlogging\",\"Change Password\":\"Bytt passord\",Changing:\"Endre\",Code:\"Kode\",\"Confirm Password\":\"Bekreft passordet\",\"Confirm Sign Up\":\"Bekreft registrering\",\"Confirm SMS Code\":\"Bekreft SMS-kode\",\"Confirm TOTP Code\":\"Bekreft TOTP-kode\",Confirm:\"Bekreft\",\"Confirmation Code\":\"Bekreftelseskode\",Confirming:\"Bekrefter\",\"Create a new account\":\"Opprett en ny konto\",\"Create Account\":\"Opprett konto\",\"Creating Account\":\"Oppretter konto\",\"Dismiss alert\":\"Avvis varsel\",Email:\"E-post\",\"Enter your Birthdate\":\"Skriv inn fødselsdatoen din\",\"Enter your code\":\"Skriv inn koden din\",\"Enter your Confirmation Code\":\"Skriv inn bekreftelseskoden din\",\"Enter your Email\":\"Skriv inn e-postadressen din\",\"Enter your Family Name\":\"Skriv inn etternavnet ditt\",\"Enter your Given Name\":\"Skriv inn fornavnet ditt\",\"Enter your Middle Name\":\"Skriv inn mellomnavnet ditt\",\"Enter your Name\":\"Skriv inn navnet ditt\",\"Enter your Nickname\":\"Skriv inn kallenavnet ditt\",\"Enter your Password\":\"Skriv inn passordet ditt\",\"Enter your phone number\":\"Skriv inn telefonnummeret ditt\",\"Enter your Preferred Username\":\"Skriv inn det foretrukne brukernavnet ditt\",\"Enter your username\":\"Skriv inn brukernavnet ditt\",\"Forgot password?\":\"Glemt passord?\",\"Forgot your password?\":\"Glemt passordet ditt?\",\"Hide password\":\"Skjul passordet\",\"It may take a minute to arrive\":\"Det kan ta et minutt for å komme frem\",Loading:\"Laster inn\",\"New password\":\"Nytt passord\",or:\"eller\",Password:\"Passord\",\"Phone Number\":\"Telefonnummer\",\"Please confirm your Password\":\"Vennligst bekreft passordet ditt\",\"Resend Code\":\"Send koden på nytt\",\"Reset your password\":\"Nullstill passordet ditt\",\"Reset your Password\":\"Nullstill passordet ditt\",\"Send code\":\"Send kode\",\"Send Code\":\"Send kode\",Sending:\"Sender\",\"Setup TOTP\":\"Konfigurer TOTP\",\"Show password\":\"Vis passordet\",\"Sign in to your account\":\"Logg inn på kontoen din\",\"Sign In with Amazon\":\"Logg inn med Amazon\",\"Sign In with Apple\":\"Logg inn med Apple\",\"Sign In with Facebook\":\"Logg inn med Facebook\",\"Sign In with Google\":\"Logg inn med Google\",\"Sign in\":\"Logg inn\",\"Sign In\":\"Logg inn\",\"Signing in\":\"Logger inn\",Skip:\"Hopp over\",Submit:\"Send inn\",Submitting:\"Sender inn\",Username:\"Brukernavn\",\"Verify Contact\":\"Bekreft kontakt\",Verify:\"Bekreft\",\"We Emailed You\":\"Vi sendte deg en e-post\",\"We Sent A Code\":\"Vi sendte en kode\",\"We Texted You\":\"Vi sendte deg en tekstmelding\",\"Your code is on the way. To log in, enter the code we emailed to\":\"Koden din er på vei. For å logge inn, skriv inn koden vi sendte e-post til\",\"Your code is on the way. To log in, enter the code we sent you\":\"Koden din er på vei. For å logge inn, skriv inn koden vi sendte deg\",\"Your code is on the way. To log in, enter the code we texted to\":\"Koden din er på vei. For å logge inn, skriv inn koden vi sendte tekstmelding til\",\"An account with the given email already exists.\":\"Det finnes allerede en konto med denne e-postadressen\",\"Confirm a Code\":\"Bekreft koden\",\"Confirm Sign In\":\"Bekreft innlogging\",\"Create account\":\"Opprett konto\",\"Enter your password\":\"Skriv inn passordet ditt\",\"Forgot Password\":\"Glemt passordet\",\"Have an account? \":\"Har en konto allerede? \",\"Incorrect username or password\":\"Feil brukernavn eller passord\",\"Invalid password format\":\"Ugyldig passordformat\",\"Invalid phone number format\":\"Ugyldig telefonnummerformat\",\"Lost your code? \":\"Mistet koden? \",\"New Password\":\"Nytt passord\",\"No account? \":\"Ingen konto? \",\"Password attempts exceeded\":\"For mange mislykkede passordforsøk\",\"Reset password\":\"Nullstill passord\",\"Sign Out\":\"Logg ut\",\"Sign Up\":\"Registrering\",\"User already exists\":\"Brukeren finnes allerede\",\"User does not exist\":\"Brukeren finnes ikke\",\"Username cannot be empty\":\"Brukernavnet kan ikke være tomt\"};export{e as nbDict};\n","const e={\"Account recovery requires verified contact information\":\"Accountherstel vereist geverifieerde contactgegevens\",\"Back to Sign In\":\"Terug naar inloggen\",\"Change Password\":\"Wachtwoord wijzigen\",Changing:\"Wordt aangepast\",Code:\"Code\",\"Confirm Password\":\"Bevestig Wachtwoord\",\"Confirm Sign Up\":\"Bevestig inschrijving\",\"Confirm SMS Code\":\"Bevestig SMS Code\",\"Confirm TOTP Code\":\"Bevestig TOTP Code\",Confirm:\"Bevestig\",\"Confirmation Code\":\"Bevestigingscode\",Confirming:\"Bevestigen\",\"Create a new account\":\"Nieuw account aanmaken\",\"Create Account\":\"Account aanmaken\",\"Creating Account\":\"Account wordt aangemaakt\",\"Dismiss alert\":\"Waarschuwing sluiten\",Email:\"E-mail\",\"Enter your code\":\"Vul je code in\",\"Enter your Email\":\"Vul je e-mail in\",\"Enter your Password\":\"Vul je wachtwoord in\",\"Enter your phone number\":\"Vul je telefoonnummer in\",\"Enter your username\":\"Vul je gebruikersnaam in\",\"Enter your Username\":\"Vul je gebruikersnaam in\",\"Forgot your password?\":\"Wachtwoord vergeten? \",\"Hide password\":\"Verberg wachtwoord\",\"It may take a minute to arrive\":\"Het kan even duren voordat deze aankomt\",Loading:\"Laden\",\"New password\":\"Nieuw wachtwoord\",\"New Password\":\"Nieuw Wachtwoord\",or:\"of\",Password:\"Wachtwoord\",\"Phone Number\":\"Telefoonnummer\",\"Please confirm your Password\":\"Bevestig je wachtwoord\",\"Resend Code\":\"Verstuur code nogmaals\",\"Reset Password\":\"Wachtwoord resetten\",\"Reset your password\":\"Reset je wachtwoord\",\"Reset your Password\":\"Wachtwoord resetten\",\"Send code\":\"Verstuur code\",\"Send Code\":\"Verstuur Code\",Sending:\"Versturen\",\"Setup TOTP\":\"TOTP Instellingen\",\"Show password\":\"Toon wachtwoord\",\"Sign in to your account\":\"Inloggen op je account\",\"Sign In with Amazon\":\"Inloggen met Amazon\",\"Sign In with Apple\":\"Inloggen met Apple\",\"Sign In with Facebook\":\"Inloggen met Facebook\",\"Sign In with Google\":\"Inloggen met Google\",\"Sign in\":\"Inloggen\",\"Sign In\":\"Inloggen\",\"Signing in\":\"Inloggen\",Skip:\"Overslaan\",Submit:\"Versturen\",Submitting:\"Wordt verstuurd\",Username:\"Gebruikersnaam\",\"Verify Contact\":\"Verifieer Contact\",Verify:\"Verifieer\",\"We Emailed You\":\"We hebben u een e-mail gestuurd\",\"We Sent A Code\":\"We hebben een code gestuurd\",\"We Texted You\":\"We hebben u een sms gestuurd\",\"Your code is on the way. To log in, enter the code we emailed to\":\"Uw code is onderweg. Om in te loggen, voer de code in die we gemaild hebben naar\",\"Your code is on the way. To log in, enter the code we sent you\":\"Uw code is onderweg. Om in te loggen, voer de code in die we u hebben gestuurd\",\"Your code is on the way. To log in, enter the code we texted to\":\"Uw code is onderweg. Om in te loggen, voer de code in die we hebben gestuurd naar\",\"Your passwords must match\":\"Je wachtwoorden moeten overeenkomen\"};export{e as nlDict};\n","const o={\"Account recovery requires verified contact information\":\"Odzyskanie konta wymaga zweryfikowanych danych kontaktowych\",\"Back to Sign In\":\"Powrót do logowania\",\"Change Password\":\"Zmień hasło\",Changing:\"Zmienianie\",Code:\"Kod\",\"Confirm Password\":\"Potwierdź Hasło\",\"Confirm Sign Up\":\"Potwierdź rejestrację\",\"Confirm SMS Code\":\"Potwierdź kod SMS\",\"Confirm TOTP Code\":\"Potwierdź hasło jednorazowe\",Confirm:\"Potwierdź\",\"Confirmation Code\":\"Kod potwierdzenia\",Confirming:\"Potwierdzanie\",\"Create a new account\":\"Utwórz nowe konto\",\"Create Account\":\"Utwórz konto\",\"Creating Account\":\"Tworzenie konta\",\"Dismiss alert\":\"Odrzuć alert\",Email:\"E-mail\",\"Enter your code\":\"Wprowadź swój kod\",\"Enter your Email\":\"Wpisz swój adres e-mail\",\"Enter your phone number\":\"Wpisz swój numer telefonu\",\"Enter your username\":\"Wprowadź swoją nazwę użytkownika\",\"Forgot your password?\":\"Zapomniałeś hasła? \",\"Hide password\":\"Ukryj hasło\",\"It may take a minute to arrive\":\"Może to chwilę potrwać\",Loading:\"Ładowanie\",\"New password\":\"Nowe hasło\",or:\"albo\",Password:\"Hasło\",\"Phone Number\":\"Numer telefonu\",\"Resend Code\":\"Wyślij kod ponownie\",\"Reset your password\":\"Zresetuj swoje hasło\",\"Reset your Password\":\"Zresetuj swoje hasło\",\"Send code\":\"Wyślij kod\",\"Send Code\":\"Zresetuj hasło\",Sending:\"Wysyłanie\",\"Setup TOTP\":\"Konfiguruj TOTP\",\"Show password\":\"Pokaż hasło\",\"Sign in to your account\":\"Zaloguj się na swoje konto\",\"Sign In with Amazon\":\"Zaloguj z Amazon\",\"Sign In with Apple\":\"Zaloguj z Apple\",\"Sign In with Facebook\":\"Zaloguj z Facebook\",\"Sign In with Google\":\"Zaloguj z Google\",\"Sign In\":\"Logowanie\",\"Sign in\":\"Zaloguj\",\"Signing in\":\"Logowanie\",Skip:\"Pomiń\",Submit:\"Wyślij\",Submitting:\"Wysyłanie\",Username:\"Nazwa użytkownika\",\"Verify Contact\":\"Weryfikacja danych kontaktowych\",Verify:\"Zweryfikuj\",Birthdate:\"Data urodzenia\",\"Family Name\":\"Nazwisko\",\"Given Name\":\"Pierwsze imię\",\"Middle Name\":\"Drugie imię\",Name:\"Imię i nazwisko\",Nickname:\"Pseudonim\",\"Preferred Username\":\"Preferowana nazwa użytkownika\",Profile:\"Profil\",Website:\"Strona internetowa\",\"We Emailed You\":\"Wysłaliśmy Ci wiadomość e-mail\",\"We Sent A Code\":\"Wysłaliśmy kod\",\"We Texted You\":\"Wysłaliśmy Ci wiadomość SMS\",\"Your code is on the way. To log in, enter the code we emailed to\":\"Twój kod został wysłany. Aby się zalogować, wprowadź kod wysłany na adres e-mail\",\"Your code is on the way. To log in, enter the code we sent you\":\"Twój kod został wysłany. Aby się zalogować, wprowadź wysłany do Ciebie kod\",\"Your code is on the way. To log in, enter the code we texted to\":\"Twój kod został wysłany. Aby się zalogować, wprowadź kod wysłany do Ciebie w wiadomości SMS pod numer\"};export{o as plDict};\n","const o={\"Account recovery requires verified contact information\":\"A recuperação da conta requer informações de contato verificadas\",\"Back to Sign In\":\"Voltar para Entrar\",\"Change Password\":\"Mudar senha\",Changing:\"Mudando\",Code:\"Código\",\"Confirm Password\":\"Confirme a Senha\",\"Confirm Sign Up\":\"Confirmar inscrição\",\"Confirm SMS Code\":\"Confirme o código SMS\",\"Confirm TOTP Code\":\"Confirme o código TOTP\",Confirm:\"confirme\",\"Confirmation Code\":\"Código de confirmação\",Confirming:\"Confirmando\",\"Create a new account\":\"Criar uma nova conta\",\"Create Account\":\"Criar Conta\",\"Creating Account\":\"Criando conta\",\"Dismiss alert\":\"Descartar alerta\",Email:\"O email\",\"Enter your code\":\"Insira seu código\",\"Enter your Email\":\"Digite seu e-mail\",\"Enter your phone number\":\"Digite seu número de telefone\",\"Enter your username\":\"entre com seu nome de usuário\",\"Forgot your password?\":\"Esqueceu sua senha? \",\"Hide password\":\"Esconder a senha\",\"It may take a minute to arrive\":\"Pode levar um minuto para chegar\",Loading:\"Carregando\",\"New password\":\"Nova Senha\",or:\"ou\",Password:\"Senha\",\"Phone Number\":\"Número de telefone\",\"Resend Code\":\"Reenviar código\",\"Reset your password\":\"Redefina sua senha\",\"Reset your Password\":\"Redefina sua senha\",\"Send code\":\"Enviar código\",\"Send Code\":\"Enviar código\",Sending:\"Enviando\",\"Setup TOTP\":\"Configurar TOTP\",\"Show password\":\"Mostrar senha\",\"Sign in to your account\":\"Faça login em sua conta\",\"Sign In with Amazon\":\"Entrar com a Amazon\",\"Sign In with Apple\":\"Entrar com a Apple\",\"Sign In with Facebook\":\"Entrar com o Facebook\",\"Sign In with Google\":\"Faça login no Google\",\"Sign in\":\"Entrar\",\"Sign In\":\"Entrar\",\"Signing in\":\"Entrando\",Skip:\"Pular\",Submit:\"Enviar\",Submitting:\"Enviando\",Username:\"Nome do usuário\",\"Verify Contact\":\"Verificar contato\",Verify:\"Verificar\",\"We Emailed You\":\"Enviamos um e-mail para você\",\"We Sent A Code\":\"Enviamos um código\",\"We Texted You\":\"Enviamos um SMS para você\",\"Your code is on the way. To log in, enter the code we emailed to\":\"Seu código está a caminho. Para fazer login, insira o código para o qual enviamos um e-mail\",\"Your code is on the way. To log in, enter the code we sent you\":\"Seu código está a caminho. Para fazer login, insira o código que enviamos para você\",\"Your code is on the way. To log in, enter the code we texted to\":\"Seu código está a caminho. Para fazer login, insira o código para o qual enviamos uma mensagem de texto\"};export{o as ptDict};\n","const e={\"Account recovery requires verified contact information\":\"账户恢复需要验证过的联系方式\",\"Back to Sign In\":\"回到登录\",\"Change Password\":\"更改密码\",Changing:\"正在修改\",Code:\"确认码\",\"Confirm Password\":\"确认密码\",\"Confirm Sign Up\":\"确认注册\",\"Confirm SMS Code\":\"确认短信验证码\",\"Confirm TOTP Code\":\"确认 TOTP 代码\",Confirm:\"确认\",\"Confirmation Code\":\"确认码\",Confirming:\"正在确认\",\"Create a new account\":\"创建新账户\",\"Create Account\":\"创建账户\",\"Creating Account\":\"正在创建账户\",\"Dismiss alert\":\"关闭警报\",Email:\"邮箱\",\"Enter your code\":\"输入验证码\",\"Enter your Email\":\"输入电子邮件\",\"Enter your phone number\":\"输入电话号码\",\"Enter your username\":\"输入用户名\",\"Forgot your password?\":\"忘记密码了?\",\"Hide password\":\"隐藏密码\",\"It may take a minute to arrive\":\"可能需要一分钟才能到达\",Loading:\"正在加载\",\"New password\":\"新密码\",or:\"或者\",Password:\"密码\",\"Phone Number\":\"电话\",\"Resend Code\":\"重发验证码\",\"Reset your password\":\"重置密码\",\"Reset your Password\":\"重置密码\",\"Send Code\":\"发送确认码\",\"Send code\":\"发送验证码\",Sending:\"正在发送\",\"Setup TOTP\":\"设置 TOTP\",\"Show password\":\"显示密码\",\"Sign in to your account\":\"登录账户\",\"Sign In with Amazon\":\"通过 Amazon 登录\",\"Sign In with Apple\":\"通过 Apple 登录\",\"Sign In with Facebook\":\"通过 Facebook 登录\",\"Sign In with Google\":\"通过 Google 登录\",\"Sign in\":\"登录\",\"Sign In\":\"登录\",\"Signing in\":\"正在登录\",Skip:\"跳过\",Submit:\"提交\",Submitting:\"正在提交\",Username:\"用户名\",\"Verify Contact\":\"验证联系方式\",Verify:\"验证\",\"We Emailed You\":\"我们给您发送了电子邮件\",\"We Sent A Code\":\"我们发送了代码\",\"We Texted You\":\"我们给您发送了短信\",\"Your code is on the way. To log in, enter the code we emailed to\":\"您的代码正在发送中。要登录,请输入我们通过电子邮件发送给以下人员的代码:\",\"Your code is on the way. To log in, enter the code we sent you\":\"您的代码正在发送中。要登录,请输入我们发送给您的代码\",\"Your code is on the way. To log in, enter the code we texted to\":\"您的代码正在发送中。要登录,请输入我们通过短信发送给以下人员的代码:\",\"Confirm a Code\":\"确认码\",\"Confirm Sign In\":\"确认登录\",\"Forgot Password\":\"忘记密码\",\"Incorrect username or password\":\"用户名或密码错误\",\"Invalid password format\":\"密码格式错误\",\"Invalid phone number format\":\"电话格式错误,请使用格式 +12345678900\",\"New Password\":\"新密码\",\"Resend a Code\":\"重发确认码\",\"Sign Out\":\"退出\",\"Sign Up\":\"注册\",\"User already exists\":\"用户已经存在\",\"User does not exist\":\"用户不存在\"};export{e as zhDict};\n","const e={\"Account recovery requires verified contact information\":\"För att återställa kontot behöver du ett verifierat konto\",\"Back to Sign In\":\"Tillbaka till inloggningen\",\"Change Password\":\"Byt lösenord\",Changing:\"Ändra\",Code:\"Kod\",\"Confirm Password\":\"Bekräfta lösenord\",\"Confirm Sign Up\":\"Bekräfta registrering\",\"Confirm SMS Code\":\"Bekräfta SMS-kod\",\"Confirm TOTP Code\":\"Bekräfta TOTP-kod\",Confirm:\"Bekräfta\",\"Confirmation Code\":\"Verifikationskod\",Confirming:\"Bekräftar\",\"Create a new account\":\"Skapa ett nytt konto\",\"Create Account\":\"Skapa konto\",\"Creating Account\":\"Skapar konto\",\"Dismiss alert\":\"Avvisa varning\",Email:\"E-post\",\"Enter your code\":\"Skriv din kod\",\"Enter your Email\":\"Fyll i din e-post\",\"Enter your phone number\":\"Ange ditt telefonnummer\",\"Enter your username\":\"Ange ditt användarnamn\",\"Forgot your password?\":\"Glömt ditt lösenord? \",\"Hide password\":\"Dölj lösenord\",\"It may take a minute to arrive\":\"Det kan ta en minut att komma fram\",Loading:\"Laddar\",\"New password\":\"Nytt lösenord\",or:\"eller\",Password:\"Lösenord\",\"Phone Number\":\"Telefonnummer\",\"Resend Code\":\"Skicka koden igen\",\"Reset your password\":\"Återställ ditt lösenord\",\"Reset your Password\":\"Återställ ditt lösenord\",\"Send code\":\"Skicka kod\",\"Send Code\":\"Skicka kod\",Sending:\"Skickar\",\"Setup TOTP\":\"Konfigurera TOTP\",\"Show password\":\"Visa lösenord\",\"Sign in to your account\":\"Logga in till ditt konto\",\"Sign In with Amazon\":\"Logga in med Amazon\",\"Sign In with Apple\":\"Logga in med Apple\",\"Sign In with Facebook\":\"Logga in med Facebook\",\"Sign In with Google\":\"Logga in med Google\",\"Sign in\":\"Logga in\",\"Sign In\":\"Logga in\",\"Signing in\":\"Loggar in\",Skip:\"Hoppa över\",Submit:\"Skicka\",Submitting:\"Skickar in\",Username:\"Användarnamn\",\"Verify Contact\":\"Verifiera kontakt\",Verify:\"Verifiera\",\"We Sent A Code\":\"Vi skickade en kod\",\"We Texted You\":\"Vi sms:ade dig\",\"Your code is on the way. To log in, enter the code we emailed to\":\"Din kod är på väg. För att logga in, ange koden vi mejlade till\",\"Your code is on the way. To log in, enter the code we sent you\":\"Din kod är på väg. För att logga in, ange koden vi skickade till dig\",\"Your code is on the way. To log in, enter the code we texted to\":\"Din kod är på väg. För att logga in, ange koden vi sms:ade till\",\"An account with the given email already exists.\":\"Det finns redan ett konto med denna e-postadress\",\"Confirm a Code\":\"Bekräfta koden\",\"Confirm Sign In\":\"Bekräfta inloggning\",\"Create account\":\"Skapa konto\",\"Enter your password\":\"Ange ditt lösenord\",\"Forgot Password\":\"Glömt lösenordet\",\"Have an account? \":\"Redan registrerad? \",\"Incorrect username or password\":\"Felaktigt användarnamn eller lösenord\",\"Invalid password format\":\"Ogiltigt lösenordsformat\",\"Invalid phone number format\":\"Ogiltigt format för telefonnummer\",\"Lost your code? \":\"Förlorat koden? \",\"New Password\":\"Nytt lösenord\",\"No account? \":\"Inget konto? \",\"Password attempts exceeded\":\"Maximalt antal felaktiga inloggningsförsök har uppnåtts\",\"Reset password\":\"Återställ lösenord\",\"Sign Out\":\"Logga ut\",\"Sign Up\":\"Registrering\",\"User already exists\":\"Användaren finns redan\",\"User does not exist\":\"Användaren finns inte\",\"Username cannot be empty\":\"Användarnamnet kan inte vara tomt\",\"We Emailed You\":\"Vi har skickat e-post till dig\"};export{e as svDict};\n","const a={\"Account recovery requires verified contact information\":\"Pemulihan akun memerlukan informasi kontak terverifikasi\",\"Back to Sign In\":\"Kembali ke Masuk\",\"Change Password\":\"Ubah kata sandi\",Changing:\"Mengubah\",Code:\"Kode\",\"Confirm Password\":\"Konfirmasi kata sandi\",\"Confirm Sign Up\":\"Konfirmasi Pendaftaran\",\"Confirm SMS Code\":\"Konfirmasi Kode SMS\",\"Confirm TOTP Code\":\"Konfirmasi Kode TOTP\",Confirm:\"Konfirmasi\",\"Confirmation Code\":\"Kode Konfirmasi\",Confirming:\"Mengkonfirmasi\",\"Create a new account\":\"Buat akun baru\",\"Create Account\":\"Buat Akun\",\"Creating Account\":\"Membuat Akun\",\"Dismiss alert\":\"Hentikan pemberitahuan\",Email:\"Email\",\"Enter your code\":\"Masukkan kode anda\",\"Enter your Email\":\"Masukkan email anda\",\"Enter your phone number\":\"Masukkan nomor telepon anda\",\"Enter your username\":\"Masukkan nama akun anda\",\"Forgot your password?\":\"Lupa kata sandi? \",\"Hide password\":\"Sembunyikan kata sandi\",\"It may take a minute to arrive\":\"Mungkin perlu waktu satu menit untuk tiba\",Loading:\"Memuat\",\"New password\":\"Kata sandi baru\",or:\"atau\",Password:\"Kata sandi\",\"Phone Number\":\"Nomor telepon\",\"Resend Code\":\"Kirim ulang kodenya\",\"Reset your Password\":\"Reset Kata Sandi\",\"Reset your password\":\"Ubah kata sandi anda\",\"Send code\":\"Kirim kode\",\"Send Code\":\"Kirim Kode\",Sending:\"Mengirim\",\"Setup TOTP\":\"Siapkan TOTP\",\"Show password\":\"Tampilkan kata sandi\",\"Sign in to your account\":\"Masuk akun anda\",\"Sign In with Amazon\":\"Masuk dengan Amazon\",\"Sign In with Apple\":\"Masuk dengan Apple\",\"Sign In with Facebook\":\"Masuk dengan Facebook\",\"Sign In with Google\":\"Masuk dengan Google\",\"Sign in\":\"Masuk\",\"Sign In\":\"Masuk\",\"Signing in\":\"Memasuki\",Skip:\"Lewati\",Submit:\"Ajukan\",Submitting:\"Mengajukan\",Username:\"Nama akun\",\"Verify Contact\":\"Verifikasi Kontak\",Verify:\"Verifikasi\",\"We Sent A Code\":\"Kami Mengirim Kode\",\"We Texted You\":\"Kami mengirim SMS kepada Anda\",\"Your code is on the way. To log in, enter the code we sent you\":\"Kode Anda segera hadir. Untuk masuk, masukkan kode yang kami kirimkan kepada Anda\",\"An account with the given email already exists.\":\"Akun dengan email tersebut sudah terdaftar.\",\"Attempt limit exceeded, please try after some time.\":\"Batas percobaan terlampaui, mohon coba lagi setelah beberapa waktu.\",\"Cannot reset password for the user as there is no registered/verified email or phone_number\":\"Tidak dapat mengatur ulang kata sandi karena tidak ada email terdaftar / terverifikasi atau nomor telepon\",Change:\"Ubah\",\"Confirm a Code\":\"Konfirmasi kode\",\"Create account\":\"Buat akun\",\"Enter your password\":\"Masukkan kata sandi anda\",\"Forgot Password\":\"Lupa kata sandi\",\"Have an account? \":\"Sudah punya akun? \",Hello:\"Halo\",\"Incorrect username or password.\":\"Nama akun atau kata sandi salah.\",\"Invalid phone number format\":\"Nomor telepon tidak sesuai dengan format.\",\"Invalid verification code provided, please try again.\":\"Kode verifikasi tidak sesuai, mohon coba lagi.\",\"It may take a minute to arrive.\":\"Mungkin perlu beberapa waktu untuk tiba.\",\"Lost your code? \":\"Kode anda hilang?\",Name:\"Nama\",\"Network error\":\"Galat jaringan\",\"No account? \":\"Tidak ada akun?\",\"Password did not conform with policy: Password not long enough\":\"Kata sandi tidak sesuai dengan aturan: Kata sandi kurang panjang\",\"Resend a Code\":\"Renvoyer un code\",\"Reset password\":\"Ubah kata sandi anda\",Send:\"Kirim\",\"Sign In with AWS\":\"Masuk dengan AWS\",\"Sign Up with Amazon\":\"Daftar dengan Amazon\",\"Sign Up with AWS\":\"Daftar dengan AWS\",\"Sign Up with Facebook\":\"Daftar dengan Facebook\",\"Sign Up with Google\":\"Daftar dengan Google\",SMS:\"SMS\",\"User already exists\":\"Akun sudah terdaftar\",\"User does not exist.\":\"Akun tidak terdaftar.\",\"User is disabled.\":\"Akun dinonaktifkan.\",\"Username cannot be empty\":\"Nama akun tidak boleh kosong\",\"Username/client id combination not found.\":\"Nama akun atau id tidak ditemukan.\",\"We Emailed You\":\"Kami mengirimkanmu email\",\"Your code is on the way. To log in, enter the code we emailed to\":\"Kode anda dalam pengiriman. Untuk masuk, masukkan kode yang kami emailkan ke\",\"Your code is on the way. To log in, enter the code we texted to\":\"Kode anda dalam pengiriman. Untuk masuk, masukkan kode yang kami tuliskan ke\",\"Your passwords must match\":\"Kata sandi harus sama\"};export{a as idDict};\n","const e={\"Account recovery requires verified contact information\":\"Hesap kurtarma, doğrulanmış iletişim bilgilerini gerektirir\",\"Back to Sign In\":\"Oturum Açmaya Geri Dön\",\"Change Password\":\"Şifreyi Değiştir\",Changing:\"Değiştiriliyor\",Code:\"Kod\",\"Confirm Password\":\"Şifreyi Doğrula\",\"Confirm Sign Up\":\"Kayıt İşlemini Doğrula\",\"Confirm SMS Code\":\"SMS Kodunu Doğrula\",\"Confirm TOTP Code\":\"Tek Kullanımlık Şifreyi Doğrula\",Confirm:\"Doğrula\",\"Confirmation Code\":\"Doğrulama Kodu\",Confirming:\"Doğrulanıyor\",\"Create a new account\":\"Yeni bir hesap oluştur\",\"Create Account\":\"Hesap Oluştur\",\"Creating Account\":\"Hesap Oluşturuluyor\",\"Dismiss alert\":\"Uyarıyı reddet\",Email:\"E-posta\",\"Enter your code\":\"Kodu girin\",\"Enter your Email\":\"E-posta adresinizi girin\",\"Enter your phone number\":\"Telefon numaranızı girin\",\"Enter your username\":\"Kullanıcı adınızı girin\",\"Forgot your password?\":\"Şifrenizi mi unuttunuz?\",\"Hide password\":\"Şifreyi gizle\",\"It may take a minute to arrive\":\"Kodun gelmesi bir dakika sürebilir\",Loading:\"Yükleniyor\",\"New password\":\"Yeni şifre\",or:\"veya\",Password:\"Şifre\",\"Phone Number\":\"Telefon Numarası\",\"Resend Code\":\"Kodu Yeniden Gönder\",\"Reset your password\":\"Şifrenizi sıfırlayın\",\"Reset your Password\":\"Şifrenizi Sıfırlayın\",\"Send code\":\"Kod gönder\",\"Send Code\":\"Kod Gönder\",Sending:\"Gönderiliyor\",\"Setup TOTP\":\"Tek kullanımlık şifre kurulumu yap\",\"Show password\":\"Şifreyi göster\",\"Sign in to your account\":\"Hesabınızda oturum açın\",\"Sign In with Amazon\":\"Amazon ile Oturum Aç\",\"Sign In with Apple\":\"Apple ile Oturum Aç\",\"Sign In with Facebook\":\"Facebook ile Oturum Aç\",\"Sign In with Google\":\"Google ile Oturum Aç\",\"Sign in\":\"Oturum aç\",\"Sign In\":\"Oturum Aç\",\"Signing in\":\"Oturum açılıyor\",Skip:\"Atla\",Submit:\"Gönder\",Submitting:\"Gönderiliyor\",Username:\"Kullanıcı adı\",\"Verify Contact\":\"Kişiyi Doğrula\",Verify:\"Doğrula\",\"We Emailed You\":\"Size E-posta Gönderdik\",\"We Sent A Code\":\"Bir Kod Gönderdik\",\"We Texted You\":\"Size Mesaj Gönderdik\",\"Your code is on the way. To log in, enter the code we emailed to\":\"Kodunuz yolda. Oturum açmak için, gönderdiğimiz e-postadaki kodu girin\",\"Your code is on the way. To log in, enter the code we sent you\":\"Kodunuz yolda. Oturum açmak için, size gönderdiğimiz kodu girin\",\"Your code is on the way. To log in, enter the code we texted to\":\"Kodunuz yolda. Oturum açmak için, gönderdiğimiz mesajdaki kodu girin\",\"An account with the given email already exists.\":\"Bu e-postaya ait zaten bir hesap var.\",\"Confirm Sign In\":\"Oturum Açmayı Doğrula\",\"Have an account? \":\"Hesabınız var mı? \",\"Incorrect username or password\":\"Yanlış kullanıcı adı ya da şifre\",\"Invalid password format\":\"Geçersiz parola formatı\",\"Invalid phone number format\":\"Geçersiz telefon numarası formatı\",\"Lost your code? \":\"Kodu mu kaybettiniz? \",\"No account? \":\"Hesabınız yok mu? \",\"Password attempts exceeded\":\"Maksimum oturum açma girişimi aşıldı\",\"Sign Out\":\"Çıkış yap\",\"Sign Up\":\"Kayıt Ol\",\"User already exists\":\"Bu kullanıcı zaten var\",\"User does not exist\":\"Böyle bir kullanıcı mevcut değil\",\"Username cannot be empty\":\"Kullanıcı adı boş olamaz\"};export{e as trDict};\n","const e={\"Account recovery requires verified contact information\":\"Восстановление учетной записи требует проверки контактной информации\",\"Back to Sign In\":\"Назад, чтобы войти\",\"Change Password\":\"изменять пароль\",Changing:\"Изменение\",Code:\"Код\",\"Confirm Password\":\"Подтверждение пароля\",\"Confirm Sign Up\":\"Подтверждение зарегистрироваться\",\"Confirm SMS Code\":\"Подтверждение CMC-Код\",\"Confirm TOTP Code\":\"Подтверждение TOTP-Код\",Confirm:\"Подтверждать\",\"Confirmation Code\":\"код подтверждения\",Confirming:\"подтверждение\",\"Create a new account\":\"Создавать новую учетную запись\",\"Create Account\":\"Создать учетную запись\",\"Creating Account\":\"создание учетная запись\",\"Dismiss alert\":\"Закрыть оповещение\",Email:\"электронная почта\",\"Enter your code\":\"ввести ваш Код\",\"Enter your Email\":\"ввести ваш электронная почта\",\"Enter your phone number\":\"ввести ваш номер телефона\",\"Enter your username\":\"ввести ваш имя пользователя\",\"Forgot your password?\":\"Забыли ваш пароль?\",\"Hide password\":\"Скрывать пароль\",\"It may take a minute to arrive\":\"Доставка может занять некоторое время\",Loading:\"Загрузка\",\"New password\":\"Новый пароль\",or:\"или\",Password:\"Пароль\",\"Phone Number\":\"Номер телефона\",\"Resend Code\":\"Отправь еще раз Код\",\"Reset your password\":\"сброс ваш пароль\",\"Reset your Password\":\"сброс ваш Пароль\",\"Send code\":\"Отправлять Код\",\"Send Code\":\"Отправлять Код\",Sending:\"отправка\",\"Setup TOTP\":\"Настраивать TOTP\",\"Show password\":\"Показывать пароль\",\"Sign in to your account\":\"знак в свой аккаунт\",\"Sign In with Amazon\":\"знак в с Amazon\",\"Sign In with Apple\":\"знак в с Apple\",\"Sign In with Facebook\":\"знак в с Facebook\",\"Sign In with Google\":\"знак в с Google\",\"Sign in\":\"знак в\",\"Sign In\":\"знак в\",\"Signing in\":\"подписание в\",Skip:\"Пропускать\",Submit:\"Представлять на рассмотрение\",Submitting:\"Представив\",Username:\"Имя пользователя\",\"Verify Contact\":\"Проверить контакт\",Verify:\"Проверить\",\"We Emailed You\":\"Мы отправили вам электронное письмо\",\"We Sent A Code\":\"Мы отправили код\",\"We Texted You\":\"Мы отправили вам текстовое сообщение\",\"Your code is on the way. To log in, enter the code we emailed to\":\"Ваш код отправлен. Чтобы войти в систему, введите код, который мы отправили по электронной почте\",\"Your code is on the way. To log in, enter the code we sent you\":\"Ваш код отправлен. Чтобы войти в систему, введите код, который мы послали вам\",\"Your code is on the way. To log in, enter the code we texted to\":\"Ваш код отправлен. Чтобы войти в систему, введите код, который мы отправили текстовым сообщением\"};export{e as ruDict};\n","const n={\"Account recovery requires verified contact information\":\"שחזור לקוח דורש עוד מידע\",\"Back to Sign In\":\"חזור להרשמה\",\"Change Password\":\"עדכון סיסמא\",Changing:\"מעדכן\",Code:\"קוד\",\"Confirm Password\":\"אשר סיסמא\",\"Confirm Sign Up\":\"אשר הרשמה\",\"Confirm SMS Code\":\"אשר sms קוד\",\"Confirm TOTP Code\":\"אשר totp קוד\",Confirm:\"אישור\",\"Confirmation Code\":\"אישור קוד\",Confirming:\"מאשר\",\"Create a new account\":\"צור משתמש חדש\",\"Create Account\":\"צור משתמש\",\"Creating Account\":\"יצירת משתמש\",\"Dismiss alert\":\"הסר התראה\",Email:\"אימייל\",\"Enter your code\":\"הכנס את הקוד\",\"Enter your Email\":\"הכנס את המייל שלך\",\"Enter your phone number\":\"הכנס את מספר הטלפון שלך\",\"Enter your username\":\"הכנס את שם המתמש שלך\",\"Forgot your password?\":\"שחכת סיסמא ?\",\"Hide password\":\"הסתר סיסמא\",Loading:\"טוען\",\"New password\":\"סיסמא חדשה\",or:\"אוֹ\",Password:\"סיסמא\",\"Phone Number\":\"מספר טלפון\",\"Resend Code\":\"שלח קוד שוב\",\"Reset your password\":\"אפס סיסמא\",\"Reset your Password\":\"אפס סיסמא\",\"Send code\":\"שלח קוד\",\"Send Code\":\"שלח קוד\",Sending:\"שולח\",\"Setup TOTP\":\"Setup TOTP\",\"Show password\":\"הצג סיסמא\",\"Sign in to your account\":\"התחבר לחשבון שלך\",\"Sign In with Amazon\":\"Sign In with Amazon\",\"Sign In with Apple\":\"Sign In with Apple\",\"Sign In with Facebook\":\"Sign In with Facebook\",\"Sign In with Google\":\"Sign In with Google\",\"Sign in\":\"התחבר\",\"Sign In\":\"התחבר\",\"Signing in\":\"מתחבר\",Skip:\"דלג\",Submit:\"שלח\",Submitting:\"שולח\",Username:\"שם משתמש\",\"Verify Contact\":\"אמת איש קשר\",Verify:\"אמת\"};export{n as heDict};\n","const e={\"Account recovery requires verified contact information\":\"Відновлення облікового запису потребує контактної інформації\",\"Back to Sign In\":\"Назад на сторінку входу\",\"Change Password\":\"Змінити пароль\",Changing:\"Змінюємо\",Code:\"Код\",\"Confirm Password\":\"Підтвердіть пароль\",\"Confirm Sign Up\":\"Підтвердіть реєстрацію\",\"Confirm SMS Code\":\"Підтвердіть SMS код\",\"Confirm TOTP Code\":\"Підтвердіть TOTP код\",Confirm:\"Підтвердити\",\"Confirmation Code\":\"Код підтвердження\",Confirming:\"Підтверджуємо\",\"Create a new account\":\"Зареєструватися\",\"Create Account\":\"Зареєструватися\",\"Creating Account\":\"Реєструємо\",\"Dismiss alert\":\"Відхилити сповіщення\",Email:\"Email\",\"Enter your code\":\"Введіть код\",\"Enter your Email\":\"Введіть ваш email\",\"Enter your phone number\":\"Введіть ваш номер телефону\",\"Enter your username\":\"Введіть ваше імʼя користувача\",\"Forgot password?\":\"Забули пароль?\",\"Forgot your password?\":\"Забули ваш пароль?\",\"Hide password\":\"Сховати пароль\",\"It may take a minute to arrive\":\"Доставка може тривати хвилину\",Loading:\"Загружаємо\",\"New password\":\"Новий пароль\",or:\"або\",Password:\"Пароль\",\"Phone Number\":\"Номер Телефону\",\"Resend Code\":\"Відправити код повторно\",\"Reset your password\":\"Скинути пароль\",\"Reset your Password\":\"Скинути пароль\",\"Send code\":\"Відправити код\",\"Send Code\":\"Відправити код\",Sending:\"Відправляємо\",\"Setup TOTP\":\"Налаштувати TOTP\",\"Show password\":\"Показати пароль\",\"Sign in to your account\":\"Увійти у ваш обліковий запис\",\"Sign In with Amazon\":\"Увійти з Amazon\",\"Sign In with Apple\":\"Увійти з Apple\",\"Sign In with Facebook\":\"Увійти з Facebook\",\"Sign In with Google\":\"Увійти з Google\",\"Sign in\":\"Увійти\",\"Sign In\":\"Увійти\",\"Signing in\":\"Входимо\",Skip:\"Пропустити\",Submit:\"Відправити\",Submitting:\"Відправляємо\",Username:\"Імʼя користувача\",\"Verify Contact\":\"Підтвердити Контакт\",Verify:\"Підтвердити\",\"We Emailed You\":\"Ми відправили вам Email\",\"We Sent A Code\":\"Ми відправили код\",\"We Texted You\":\"Ми відправили вам текстове повідомлення\",\"Your code is on the way. To log in, enter the code we emailed to\":\"Ваш код вже в дорозі. Щоб увійти, введіть код, що ми відправили вам на Email\",\"Your code is on the way. To log in, enter the code we sent you\":\"Ваш код вже в дорозі. Щоб увійти, введіть код, що ми вам відправили\",\"Your code is on the way. To log in, enter the code we texted to\":\"Ваш код вже в дорозі. Щоб увійти, введіть код, що ми відправили вам текстовим повідомленням\",\"An account with the given email already exists.\":\"Обліковий запис з цим Email вже існує.\",\"Confirm a Code\":\"Підтвердіть код\",\"Confirm Sign In\":\"Підтвердіть вхід\",\"Forgot Password\":\"Забули пароль\",\"Incorrect username or password.\":\"Невірне імʼя користувача або пароль\",\"Invalid password format\":\"Невірний формат паролю\",\"Invalid phone number format\":\"Невірний формат номеру телефону\",\"Loading...\":\"Загружаємо...\",\"New Password\":\"Новий пароль\",\"Resend a Code\":\"Відправити код повторно\",\"Reset Password\":\"Скинути пароль\",\"Sign Out\":\"Вийти\",\"Sign Up with Amazon\":\"Зареєструватися з Amazon\",\"Sign Up with Apple\":\"Зареєструватися з Apple\",\"Sign Up with Facebook\":\"Зареєструватися з Facebook\",\"Sign Up with Google\":\"Зареєструватися з Google\",\"Sign Up\":\"Зареєструватися\",\"User already exists\":\"Користувач вже існує\",\"User does not exist\":\"Такий користувач не існує\",\"Username cannot be empty\":\"Імʼя користувача не може бути пустим\",\"Your passwords must match\":\"Паролі мають збігатися\"};export{e as uaDict};\n","const E={ADD_PROFILE:\"Add your Profile\",ADD_WEBSITE:\"Add your Website\",BACK_SIGN_IN:\"Back to Sign In\",BIRTHDATE:\"Birthdate\",CHANGE_PASSWORD:\"Change Password\",CHANGING_PASSWORD:\"Changing\",CODE:\"Code\",CODE_ARRIVAL:\"It may take a minute to arrive\",CODE_EMAILED:\"Your code is on the way. To log in, enter the code we emailed to\",CODE_SENT:\"Your code is on the way. To log in, enter the code we sent you\",CODE_TEXTED:\"Your code is on the way. To log in, enter the code we texted to\",CONFIRM_PASSWORD:\"Confirm Password\",CONFIRM_PASSWORD_PLACEHOLDER:\"Please confirm your Password\",CONFIRM_RESET_PASSWORD_HEADING:\"Reset your Password\",CONFIRM_SIGNUP_HEADING:\"Confirm Sign Up\",CONFIRM_SMS:\"Confirm SMS Code\",CONFIRM_TOTP:\"Confirm TOTP Code\",CONFIRM:\"Confirm\",CONFIRMATION_CODE:\"Confirmation Code\",CONFIRMING:\"Confirming\",CREATE_ACCOUNT:\"Create Account\",CREATING_ACCOUNT:\"Creating Account\",EMAIL_ADDRESS:\"Email\",ENTER_BIRTHDATE:\"Enter your Birthdate\",ENTER_CODE:\"Enter your code\",ENTER_CONFIRMATION_CODE:\"Enter your Confirmation Code\",ENTER_EMAIL:\"Enter your Email\",ENTER_FAMILY_NAME:\"Enter your Family Name\",ENTER_GIVEN_NAME:\"Enter your Given Name\",ENTER_MIDDLE_NAME:\"Enter your Middle Name\",ENTER_NAME:\"Enter your Name\",ENTER_NICK_NAME:\"Enter your Nickname\",ENTER_PASSWORD:\"Enter your Password\",ENTER_PHONE_NUMBER:\"Enter your Phone Number\",ENTER_PREFERRED_USERNAME:\"Enter your Preferred Username\",ENTER_USERNAME:\"Enter your username\",FAMILY_NAME:\"Family Name\",GIVEN_NAME:\"Given Name\",FORGOT_PASSWORD:\"Forgot Password?\",FORGOT_YOUR_PASSWORD:\"Forgot your password?\",HIDE_PASSWORD:\"Hide password\",LOADING:\"Loading\",LOGIN_NAME:\"Username\",MIDDLE_NAME:\"Middle Name\",NAME:\"Name\",NICKNAME:\"Nickname\",NEW_PASSWORD:\"New password\",OR:\"or\",PASSWORD:\"Password\",PHONE_NUMBER:\"Phone Number\",PREFERRED_USERNAME:\"Preferred Username\",PROFILE:\"Profile\",RESEND_CODE:\"Resend Code\",RESET_PASSWORD_HEADING:\"Reset your password\",RESET_PASSWORD:\"Reset Password\",SEND_CODE:\"Send code\",SENDING:\"Sending\",SETUP_TOTP:\"Setup TOTP\",SHOW_PASSWORD:\"Show password\",SIGN_IN_BUTTON:\"Sign in\",SIGN_IN_TAB:\"Sign In\",SIGN_IN_WITH_AMAZON:\"Sign In with Amazon\",SIGN_IN_WITH_APPLE:\"Sign In with Apple\",SIGN_IN_WITH_FACEBOOK:\"Sign In with Facebook\",SIGN_IN_WITH_GOOGLE:\"Sign In with Google\",SIGN_IN:\"Sign in to your account\",SIGN_UP_BUTTON:\"Create a new account\",SIGNING_IN_BUTTON:\"Signing in\",SKIP:\"Skip\",SUBMIT:\"Submit\",SUBMITTING:\"Submitting\",UPPERCASE_COPY:\"COPY\",VERIFY_CONTACT:\"Verify Contact\",VERIFY_HEADING:\"Account recovery requires verified contact information\",VERIFY:\"Verify\",WE_EMAILED:\"We Emailed You\",WE_SENT_CODE:\"We Sent A Code\",WE_TEXTED:\"We Texted You\",WEBSITE:\"Website\"};export{E as defaultTexts};\n","import{deDict as t}from\"./authenticator/de.mjs\";import{enDict as s}from\"./authenticator/en.mjs\";import{esDict as a}from\"./authenticator/es.mjs\";import{frDict as i}from\"./authenticator/fr.mjs\";import{itDict as r}from\"./authenticator/it.mjs\";import{jaDict as o}from\"./authenticator/ja.mjs\";import{krDict as c}from\"./authenticator/kr.mjs\";import{nbDict as m}from\"./authenticator/nb.mjs\";import{nlDict as e}from\"./authenticator/nl.mjs\";import{plDict as n}from\"./authenticator/pl.mjs\";import{ptDict as j}from\"./authenticator/pt.mjs\";import{zhDict as u}from\"./authenticator/zh.mjs\";import{svDict as p}from\"./authenticator/sv.mjs\";import{idDict as f}from\"./authenticator/id.mjs\";import{trDict as h}from\"./authenticator/tr.mjs\";import{ruDict as b}from\"./authenticator/ru.mjs\";import{heDict as g}from\"./authenticator/he.mjs\";import{uaDict as O}from\"./authenticator/ua.mjs\";import{defaultTexts as D}from\"./authenticator/defaultTexts.mjs\";const d=Object.assign({},t),l=Object.assign({},s),x=Object.assign({},a),k=Object.assign({},i),v=Object.assign({},r),z=Object.assign({},o),T=Object.assign({},c),q=Object.assign({},m),w=Object.assign({},e),y=Object.assign({},n),A=Object.assign({},j),B=Object.assign({},u),C=Object.assign({},p),E=Object.assign({},f),F=Object.assign({},h),G=Object.assign({},b),H=Object.assign({},g),I=Object.assign({},O),J=Object.assign({},D);export{d as deDict,J as defaultTexts,l as enDict,x as esDict,k as frDict,H as heDict,E as idDict,v as itDict,z as jaDict,T as krDict,q as nbDict,w as nlDict,y as plDict,A as ptDict,G as ruDict,C as svDict,F as trDict,I as uaDict,B as zhDict};\n","import{I18n as t}from\"aws-amplify\";import{defaultTexts as n,deDict as r,enDict as e,esDict as i,frDict as o,idDict as s,itDict as a,jaDict as c,krDict as f,nbDict as m,nlDict as p,plDict as u,ptDict as d,zhDict as g,svDict as j,trDict as l,ruDict as b,heDict as h,uaDict as k}from\"./dictionaries/index.mjs\";const x=Object.assign({},n);function v(n){return t.get(n)}function w(n){return t.get(n)!==n}const y={de:r,en:e,es:i,fr:o,id:s,it:a,ja:c,kr:f,ko:f,nb:m,nl:p,pl:u,pt:d,zh:g,sv:j,tr:l,ru:b,he:h,ua:k};export{x as DefaultTexts,w as hasTranslation,v as translate,y as translations};\n","import{countryDialCodes as e}from\"../../i18n/country-dial-codes.mjs\";import\"../../i18n/translations.mjs\";const r={birthdate:{label:\"Birthdate\",placeholder:\"Enter your Birthdate\",type:\"date\",autocomplete:\"bday\",isRequired:!0},confirmation_code:{label:\"Confirmation Code\",placeholder:\"Enter your Confirmation Code\",type:\"number\",autocomplete:\"one-time-code\",isRequired:!0},confirm_password:{label:\"Confirm Password\",placeholder:\"Please confirm your Password\",type:\"password\",autocomplete:\"new-password\",isRequired:!0},email:{label:\"Email\",placeholder:\"Enter your Email\",type:\"email\",autocomplete:\"username\",isRequired:!0},family_name:{label:\"Family Name\",placeholder:\"Enter your Family Name\",type:\"text\",autocomplete:\"family-name\",isRequired:!0},given_name:{label:\"Given Name\",placeholder:\"Enter your Given Name\",type:\"text\",autocomplete:\"given-name\",isRequired:!0},middle_name:{label:\"Middle Name\",placeholder:\"Enter your Middle Name\",type:\"text\",autocomplete:\"additional-name\",isRequired:!0},name:{label:\"Name\",placeholder:\"Enter your Name\",type:\"text\",autocomplete:\"name\",isRequired:!0},nickname:{label:\"Nickname\",placeholder:\"Enter your Nickname\",type:\"text\",autocomplete:\"tel\",isRequired:!0},password:{label:\"Password\",placeholder:\"Enter your Password\",type:\"password\",autocomplete:\"new-password\",isRequired:!0},phone_number:{label:\"Phone Number\",placeholder:\"Enter your Phone Number\",type:\"tel\",autocomplete:\"tel\",dialCode:\"+1\",dialCodeList:e,isRequired:!0},preferred_username:{label:\"Preferred Username\",placeholder:\"Enter your Preferred Username\",type:\"text\",isRequired:!0},profile:{label:\"Profile\",placeholder:\"Add your Profile\",type:\"url\",autocomplete:\"url\",isRequired:!0},website:{label:\"Website\",placeholder:\"Add your Website\",type:\"url\",autocomplete:\"url\",isRequired:!0},username:{label:\"Username\",placeholder:\"Enter your Username\",type:\"text\",autocomplete:\"username\",isRequired:!0}},a=[\"^\",\"$\",\"*\",\".\",\"[\",\"]\",\"{\",\"}\",\"(\",\")\",\"?\",'\"',\"!\",\"@\",\"#\",\"%\",\"&\",\"/\",\"\\\\\",\",\",\">\",\"<\",\"'\",\":\",\";\",\"|\",\"_\",\"~\",\"`\",\"=\",\"+\",\"-\",\" \"];export{a as ALLOWED_SPECIAL_CHARACTERS,r as defaultFormFieldOptions};\n","import\"../../types/authenticator/user.mjs\";import{authFieldsWithDefaults as r}from\"../../types/authenticator/attributes.mjs\";import\"../../types/primitives/componentClassName.mjs\";const t=r=>{const t=new FormData(r.target);return Object.fromEntries(t)},e=(r,t)=>{let e=[];return r&&(e=Object.keys(r).reduce(((t,e)=>{var o;return t.push([e,null===(o=r[e])||void 0===o?void 0:o.order]),t}),[]).sort(((r,t)=>r[1]-t[1])).filter((r=>void 0!==r[1])).map((r=>r[0]))),Array.from(new Set([...e,...t]))},o=t=>r.includes(t),s=r=>{return r?(t=r,Array.isArray(t)?r:[r]):null;var t};export{s as getErrors,t as getFormDataFromEvent,o as isAuthFieldWithDefaults,e as setFormOrder};\n","/******************************************************************************\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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nexport function __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\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 (g && (g = 0, op[0] && (_ = 0)), _) 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 var __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(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, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, 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\n/** @deprecated */\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\n/** @deprecated */\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 __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\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\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\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 (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, 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, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nexport function __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nexport function __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\n/*! *****************************************************************************\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\r\nexports.__assign = function() {\r\n exports.__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 exports.__assign.apply(this, arguments);\r\n};\r\n\r\nfunction __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\nfunction __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\nfunction __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\nfunction __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\n\nexports.__read = __read;\nexports.__rest = __rest;\nexports.__spreadArray = __spreadArray;\nexports.__values = __values;\n","'use strict';\n\nObject.defineProperty(exports, '__esModule', { value: true });\n\nvar _tslib = require('./_virtual/_tslib.js');\n\nvar defaultWaitForOptions = {\n timeout: 10000 // 10 seconds\n\n};\n/**\r\n * Subscribes to an actor ref and waits for its emitted value to satisfy\r\n * a predicate, and then resolves with that value.\r\n * Will throw if the desired state is not reached after a timeout\r\n * (defaults to 10 seconds).\r\n *\r\n * @example\r\n * ```js\r\n * const state = await waitFor(someService, state => {\r\n * return state.hasTag('loaded');\r\n * });\r\n *\r\n * state.hasTag('loaded'); // true\r\n * ```\r\n *\r\n * @param actorRef The actor ref to subscribe to\r\n * @param predicate Determines if a value matches the condition to wait for\r\n * @param options\r\n * @returns A promise that eventually resolves to the emitted value\r\n * that matches the condition\r\n */\n\nfunction waitFor(actorRef, predicate, options) {\n var resolvedOptions = _tslib.__assign(_tslib.__assign({}, defaultWaitForOptions), options);\n\n return new Promise(function (res, rej) {\n var done = false;\n\n if (process.env.NODE_ENV !== 'production' && resolvedOptions.timeout < 0) {\n console.error('`timeout` passed to `waitFor` is negative and it will reject its internal promise immediately.');\n }\n\n var handle = resolvedOptions.timeout === Infinity ? undefined : setTimeout(function () {\n sub.unsubscribe();\n rej(new Error(\"Timeout of \".concat(resolvedOptions.timeout, \" ms exceeded\")));\n }, resolvedOptions.timeout);\n\n var dispose = function () {\n clearTimeout(handle);\n done = true;\n sub === null || sub === void 0 ? void 0 : sub.unsubscribe();\n };\n\n var sub = actorRef.subscribe({\n next: function (emitted) {\n if (predicate(emitted)) {\n dispose();\n res(emitted);\n }\n },\n error: function (err) {\n dispose();\n rej(err);\n },\n complete: function () {\n dispose();\n rej(new Error(\"Actor terminated without satisfying predicate\"));\n }\n });\n\n if (done) {\n sub.unsubscribe();\n }\n });\n}\n\nexports.waitFor = waitFor;\n","const t=t=>{var r;const n=Object.assign({default:void 0},t);return null!==(r=n.default)&&void 0!==r?r:n};function r(t){return null!=t&&!Array.isArray(t)&&\"object\"==typeof t}function n(t){return\"string\"==typeof t||\"object\"==typeof t&&\"[object String]\"===Object.prototype.toString.call(t)}function e(t){return r(t)&&\"[object Map]\"===Object.prototype.toString.call(t)}function o(t){return r(t)&&\"[object Set]\"===Object.prototype.toString.call(t)}function u(t){return void 0===t}function c(t){return null==t}function i(t){if(null==t)return!0;if(r(t)&&(e(t)||o(t)))return!t.size;if(r(t)&&(n(t)||Array.isArray(t)))return!t.length;for(const r in t)if(s(t,r))return!1;return!0}function f(t){return Array.isArray(t)&&i(t)}function l(...t){return t.every(f)}function a(t){return r(t)&&i(t)}function p(...t){return t.every(a)}function y(t){return n(t)?t.charAt(0).toUpperCase()+t.slice(1):\"\"}function s(t,r){return null!=t&&Object.prototype.hasOwnProperty.call(t,r)}function b(t){return\"function\"==typeof t}const j=(t,r)=>r?`${t}--${r}`:\"\",g=(t,r,n)=>n?`${t}--${r}`:\"\";export{l as areEmptyArrays,p as areEmptyObjects,y as capitalize,j as classNameModifier,g as classNameModifierByFlag,s as has,i as isEmpty,b as isFunction,e as isMap,c as isNil,r as isObject,o as isSet,n as isString,u as isUndefined,t as sanitizeNamespaceImport};\n","import{__awaiter as t}from\"tslib\";import{Hub as e}from\"aws-amplify\";import{appendToCognitoUserAgent as n}from\"@aws-amplify/auth\";import{waitFor as i}from\"xstate/lib/waitFor.js\";import{ALLOWED_SPECIAL_CHARACTERS as a}from\"./constants.mjs\";import{getActorState as o}from\"./actor.mjs\";import{isFunction as s}from\"../../utils/index.mjs\";const r=({packageName:t,version:e})=>{n(`${t}/${e}`)},c=t=>{const e=t.trim().split(\"\");for(let t=0;t0&&t{if(t.length<4)return t;const e=t.split(\"\");for(let t=0;tt(void 0,void 0,void 0,(function*(){try{yield i(e,(t=>o(t).matches(\"autoSignIn\")))}catch(t){}})),m=({payload:{data:e,event:n}},i,a)=>t(void 0,void 0,void 0,(function*(){const{send:t}=i,r=i.getSnapshot(),{onSignIn:c,onSignOut:l}=null!=a?a:{};switch(n){case\"tokenRefresh\":r.matches(\"authenticated.idle\")&&t(\"TOKEN_REFRESH\");break;case\"autoSignIn\":if(!r.matches(\"authenticated\")){yield u(i);const n=o(i.getSnapshot());(null==n?void 0:n.matches(\"autoSignIn\"))&&t({type:\"AUTO_SIGN_IN\",data:e})}break;case\"autoSignIn_failure\":{yield u(i);const n=o(i.getSnapshot());(null==n?void 0:n.matches(\"autoSignIn\"))&&t({type:\"AUTO_SIGN_IN_FAILURE\",data:e});break}case\"signIn\":s(c)&&c();break;case\"signOut\":case\"tokenRefresh_failure\":s(l)&&l(),r.matches(\"authenticated.idle\")&&t(\"SIGN_OUT\")}})),d=(t,n=m)=>e.listen(\"auth\",((t,e)=>n=>{e(n,t)})(t,n),\"authenticator-hub-handler\"),h=t=>a.some((e=>t.includes(e))),p=(t,e,n)=>encodeURI(`otpauth://totp/${t}:${e}?secret=${n}&issuer=${t}`);function f(t,...e){return Object.entries(t).reduce(((t,[n,i])=>Object.assign(Object.assign({},t),{[n]:e.includes(n)?i:null==i?void 0:i.trim()})),{})}export{c as censorAllButFirstAndLast,l as censorPhoneNumber,r as configureComponent,m as defaultAuthHubHandler,p as getTotpCodeURL,h as hasSpecialChars,d as listenToAuthHub,f as trimValues};\n","import{getActorContext as o,getActorState as s}from\"../actor.mjs\";import{defaultFormFieldOptions as e}from\"../constants.mjs\";import{getPrimaryAlias as r}from\"../context.mjs\";import{isAuthFieldWithDefaults as t}from\"../form.mjs\";const n=(s,r)=>{const{country_code:t}=o(s);let n=e[r];const{type:a}=n;return\"tel\"===a&&(n=Object.assign(Object.assign({},n),{dialCode:t})),n},a=o=>{const s=r(o);return Object.assign(Object.assign({},n(o,s)),{autocomplete:\"username\"})},c=o=>({confirmation_code:Object.assign(Object.assign({},n(o,\"confirmation_code\")),{label:\"Code *\",placeholder:\"Code\"})}),i={signIn:o=>({username:Object.assign({},a(o)),password:Object.assign(Object.assign({},n(o,\"password\")),{autocomplete:\"current-password\"})}),signUp:o=>{const{loginMechanisms:s,signUpAttributes:e}=o.context.config,c=r(o),i=Array.from(new Set([...s,\"password\",\"confirm_password\",...e])),d={};for(const s of i)if(t(s)){const e=s===c?a(o):n(o,s);d[s]=Object.assign({},e)}else console.debug(`Authenticator does not have a default implementation for ${s}. Customize SignUp FormFields to add your own.`);return d},confirmSignUp:o=>({confirmation_code:Object.assign(Object.assign({},n(o,\"confirmation_code\")),{placeholder:\"Enter your code\"})}),confirmSignIn:c,forceNewPassword:o=>{const e=s(o),{requiredAttributes:r}=e.context,a=Array.from(new Set([\"password\",\"confirm_password\",...r])),c={};for(const s of a)t(s)?c[s]=Object.assign({},n(o,s)):console.debug(`Authenticator does not have a default implementation for ${s}. Customize ForceNewPassword FormFields to add your own.`);return c},resetPassword:o=>{const s=r(o),{label:t}=e[s];return{username:Object.assign(Object.assign({},a(o)),{label:`Enter your ${t.toLowerCase()}`,placeholder:`Enter your ${t.toLowerCase()}`})}},confirmResetPassword:o=>Object.assign(Object.assign({},c(o)),{password:Object.assign(Object.assign({},n(o,\"password\")),{label:\"New Password\",placeholder:\"New Password\"}),confirm_password:Object.assign(Object.assign({},n(o,\"confirm_password\")),{label:\"Confirm Password\",placeholder:\"Confirm Password\"})}),confirmVerifyUser:c,setupTOTP:c};export{i as defaultFormFieldsGetters,a as getAliasDefaultFormField};\n","import{translate as e}from\"../../../i18n/translations.mjs\";const r=r=>{const o=Object.assign({},r);for(const[t,s]of Object.entries(r)){const{label:r,placeholder:n}=s;o[t]=Object.assign(Object.assign({},s),{label:r?e(r):void 0,placeholder:n?e(n):void 0})}return o},o=e=>Object.entries(e).sort(((e,r)=>(e[1].order||Number.MAX_VALUE)-(r[1].order||Number.MAX_VALUE))).filter((e=>void 0!==e[1]));export{r as applyTranslation,o as sortFormFields};\n","import\"../../../types/authenticator/user.mjs\";import{isAuthFieldsWithDefaults as s}from\"../../../types/authenticator/attributes.mjs\";import\"../../../types/primitives/componentClassName.mjs\";import{getActorContext as t}from\"../actor.mjs\";import{defaultFormFieldOptions as e}from\"../constants.mjs\";import{defaultFormFieldsGetters as r,getAliasDefaultFormField as n}from\"./defaults.mjs\";import{applyTranslation as i,sortFormFields as o}from\"./util.mjs\";const a=(s,t)=>(0,r[s])(t),c=(r,i)=>{var o,a;const c=null===(a=null===(o=t(i))||void 0===o?void 0:o.formFields)||void 0===a?void 0:a[r];return c&&0!==Object.keys(c).length?Object.entries(c).reduce(((t,[o,a])=>{if(\"signIn\"!==r&&\"resetPassword\"!==r||\"username\"!==o){if(s(o)){const s=e[o],r=Object.assign(Object.assign({},s),a);return Object.assign(Object.assign({},t),{[o]:r})}return Object.assign(Object.assign({},t),{[o]:a})}{const s=n(i),e=Object.assign(Object.assign({},s),a);return Object.assign(Object.assign({},t),{[o]:e})}}),{}):{}},m=(s,t)=>{const e=a(s,t),r=c(s,t),n=Object.assign(Object.assign({},e),r);return delete n.QR,i(n)},j=s=>s.map((s=>[s[0],Object.assign(Object.assign({},s[1]),{order:void 0})])),b=(s,t)=>{const e=m(s,t);return j(o(e))};export{c as getCustomFormFields,a as getDefaultFormFields,m as getFormFields,b as getSortedFormFields,j as removeOrderKeys};\n","import{translate as e,DefaultTexts as t}from\"../../i18n/translations.mjs\";const T={amazon:\"Amazon\",apple:\"Apple\",facebook:\"Facebook\",google:\"Google\"},n={getBackToSignInText:()=>e(t.BACK_SIGN_IN),getChangePasswordText:()=>e(t.CHANGE_PASSWORD),getChangingText:()=>e(t.CHANGING_PASSWORD),getConfirmText:()=>e(t.CONFIRM),getConfirmingText:()=>e(t.CONFIRMING),getCopyText:()=>e(t.UPPERCASE_COPY),getHidePasswordText:()=>e(t.HIDE_PASSWORD),getLoadingText:()=>e(t.LOADING),getOrText:()=>e(t.OR),getResendCodeText:()=>e(t.RESEND_CODE),getSendCodeText:()=>e(t.SEND_CODE),getSendingText:()=>e(t.SENDING),getShowPasswordText:()=>e(t.SHOW_PASSWORD),getSubmitText:()=>e(t.SUBMIT),getSubmittingText:()=>e(t.SUBMITTING),getSignInTabText:()=>e(t.SIGN_IN_TAB),getSignUpTabText:()=>e(t.CREATE_ACCOUNT),getForgotPasswordText:T=>e(T?t.FORGOT_PASSWORD:t.FORGOT_YOUR_PASSWORD),getSigningInText:()=>e(t.SIGNING_IN_BUTTON),getSignInText:()=>e(t.SIGN_IN_BUTTON),getCreatingAccountText:()=>e(t.CREATING_ACCOUNT),getCreateAccountText:()=>e(t.CREATE_ACCOUNT),getDeliveryMessageText:T=>{const{DeliveryMedium:n,Destination:g}=null!=T?T:{},S=\"EMAIL\"===n,o=\"SMS\"===n,i=e(t.CODE_ARRIVAL);if(!S&&!o)return`${e(t.CODE_SENT)}. ${i}.`;return`${e(S?t.CODE_EMAILED:t.CODE_TEXTED)} ${g}. ${i}.`},getDeliveryMethodText:T=>{const{DeliveryMedium:n}=null!=T?T:{},g=\"EMAIL\"===n;return e(g||\"SMS\"!==n?g?t.WE_EMAILED:t.WE_TEXTED:t.WE_SENT_CODE)},getChallengeText:T=>{switch(T){case\"SMS_MFA\":return e(t.CONFIRM_SMS);case\"SOFTWARE_TOKEN_MFA\":return e(t.CONFIRM_TOTP);default:throw new Error(`${e(\"Unexpected challengeName encountered in ConfirmSignIn:\")} ${T}`)}},getResetYourPasswordText:()=>e(t.RESET_PASSWORD),getSetupTOTPText:()=>e(t.SETUP_TOTP),getSetupTOTPInstructionsText:()=>e(\"Copy and paste the secret key below into an authenticator app and then enter the code in the text field below.\"),getCopiedText:()=>e(\"COPIED\"),getSignInWithFederationText:(t,n)=>e(`Sign ${\"signIn\"===t?\"In\":\"Up\"} with ${T[n]}`),getSkipText:()=>e(t.SKIP),getVerifyText:()=>e(t.VERIFY),getVerifyContactText:()=>e(t.VERIFY_CONTACT),getAccountRecoveryInfoText:()=>e(t.VERIFY_HEADING)};export{n as authenticatorTextUtil};\n","/*! *****************************************************************************\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\r\nvar __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\nfunction __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\nfunction __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\nfunction __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\nfunction __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\n\nexport { __assign, __read, __rest, __spreadArray, __values };\n","var ActionTypes;\n\n(function (ActionTypes) {\n ActionTypes[\"Start\"] = \"xstate.start\";\n ActionTypes[\"Stop\"] = \"xstate.stop\";\n ActionTypes[\"Raise\"] = \"xstate.raise\";\n ActionTypes[\"Send\"] = \"xstate.send\";\n ActionTypes[\"Cancel\"] = \"xstate.cancel\";\n ActionTypes[\"NullEvent\"] = \"\";\n ActionTypes[\"Assign\"] = \"xstate.assign\";\n ActionTypes[\"After\"] = \"xstate.after\";\n ActionTypes[\"DoneState\"] = \"done.state\";\n ActionTypes[\"DoneInvoke\"] = \"done.invoke\";\n ActionTypes[\"Log\"] = \"xstate.log\";\n ActionTypes[\"Init\"] = \"xstate.init\";\n ActionTypes[\"Invoke\"] = \"xstate.invoke\";\n ActionTypes[\"ErrorExecution\"] = \"error.execution\";\n ActionTypes[\"ErrorCommunication\"] = \"error.communication\";\n ActionTypes[\"ErrorPlatform\"] = \"error.platform\";\n ActionTypes[\"ErrorCustom\"] = \"xstate.error\";\n ActionTypes[\"Update\"] = \"xstate.update\";\n ActionTypes[\"Pure\"] = \"xstate.pure\";\n ActionTypes[\"Choose\"] = \"xstate.choose\";\n})(ActionTypes || (ActionTypes = {}));\n\nvar SpecialTargets;\n\n(function (SpecialTargets) {\n SpecialTargets[\"Parent\"] = \"#_parent\";\n SpecialTargets[\"Internal\"] = \"#_internal\";\n})(SpecialTargets || (SpecialTargets = {}));\n\nexport { ActionTypes, SpecialTargets };\n","import { ActionTypes } from './types.js';\n\nvar start = ActionTypes.Start;\nvar stop = ActionTypes.Stop;\nvar raise = ActionTypes.Raise;\nvar send = ActionTypes.Send;\nvar cancel = ActionTypes.Cancel;\nvar nullEvent = ActionTypes.NullEvent;\nvar assign = ActionTypes.Assign;\nvar after = ActionTypes.After;\nvar doneState = ActionTypes.DoneState;\nvar log = ActionTypes.Log;\nvar init = ActionTypes.Init;\nvar invoke = ActionTypes.Invoke;\nvar errorExecution = ActionTypes.ErrorExecution;\nvar errorPlatform = ActionTypes.ErrorPlatform;\nvar error = ActionTypes.ErrorCustom;\nvar update = ActionTypes.Update;\nvar choose = ActionTypes.Choose;\nvar pure = ActionTypes.Pure;\n\nexport { after, assign, cancel, choose, doneState, error, errorExecution, errorPlatform, init, invoke, log, nullEvent, pure, raise, send, start, stop, update };\n","var STATE_DELIMITER = '.';\nvar EMPTY_ACTIVITY_MAP = {};\nvar DEFAULT_GUARD_TYPE = 'xstate.guard';\nvar TARGETLESS_KEY = '';\n\nexport { DEFAULT_GUARD_TYPE, EMPTY_ACTIVITY_MAP, STATE_DELIMITER, TARGETLESS_KEY };\n","import { __values, __spreadArray, __read, __assign } from './_virtual/_tslib.js';\nimport { SpecialTargets } from './types.js';\nimport { raise, send } from './actionTypes.js';\nimport { DEFAULT_GUARD_TYPE, TARGETLESS_KEY, STATE_DELIMITER } from './constants.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nvar _a;\nfunction keys(value) {\n return Object.keys(value);\n}\nfunction matchesState(parentStateId, childStateId, delimiter) {\n if (delimiter === void 0) {\n delimiter = STATE_DELIMITER;\n }\n\n var parentStateValue = toStateValue(parentStateId, delimiter);\n var childStateValue = toStateValue(childStateId, delimiter);\n\n if (isString(childStateValue)) {\n if (isString(parentStateValue)) {\n return childStateValue === parentStateValue;\n } // Parent more specific than child\n\n\n return false;\n }\n\n if (isString(parentStateValue)) {\n return parentStateValue in childStateValue;\n }\n\n return Object.keys(parentStateValue).every(function (key) {\n if (!(key in childStateValue)) {\n return false;\n }\n\n return matchesState(parentStateValue[key], childStateValue[key]);\n });\n}\nfunction getEventType(event) {\n try {\n return isString(event) || typeof event === 'number' ? \"\".concat(event) : event.type;\n } catch (e) {\n throw new Error('Events must be strings or objects with a string event.type property.');\n }\n}\nfunction getActionType(action) {\n try {\n return isString(action) || typeof action === 'number' ? \"\".concat(action) : isFunction(action) ? action.name : action.type;\n } catch (e) {\n throw new Error('Actions must be strings or objects with a string action.type property.');\n }\n}\nfunction toStatePath(stateId, delimiter) {\n try {\n if (isArray(stateId)) {\n return stateId;\n }\n\n return stateId.toString().split(delimiter);\n } catch (e) {\n throw new Error(\"'\".concat(stateId, \"' is not a valid state path.\"));\n }\n}\nfunction isStateLike(state) {\n return typeof state === 'object' && 'value' in state && 'context' in state && 'event' in state && '_event' in state;\n}\nfunction toStateValue(stateValue, delimiter) {\n if (isStateLike(stateValue)) {\n return stateValue.value;\n }\n\n if (isArray(stateValue)) {\n return pathToStateValue(stateValue);\n }\n\n if (typeof stateValue !== 'string') {\n return stateValue;\n }\n\n var statePath = toStatePath(stateValue, delimiter);\n return pathToStateValue(statePath);\n}\nfunction pathToStateValue(statePath) {\n if (statePath.length === 1) {\n return statePath[0];\n }\n\n var value = {};\n var marker = value;\n\n for (var i = 0; i < statePath.length - 1; i++) {\n if (i === statePath.length - 2) {\n marker[statePath[i]] = statePath[i + 1];\n } else {\n marker[statePath[i]] = {};\n marker = marker[statePath[i]];\n }\n }\n\n return value;\n}\nfunction mapValues(collection, iteratee) {\n var result = {};\n var collectionKeys = Object.keys(collection);\n\n for (var i = 0; i < collectionKeys.length; i++) {\n var key = collectionKeys[i];\n result[key] = iteratee(collection[key], key, collection, i);\n }\n\n return result;\n}\nfunction mapFilterValues(collection, iteratee, predicate) {\n var e_1, _a;\n\n var result = {};\n\n try {\n for (var _b = __values(Object.keys(collection)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n var item = collection[key];\n\n if (!predicate(item)) {\n continue;\n }\n\n result[key] = iteratee(item, key, collection);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return result;\n}\n/**\r\n * Retrieves a value at the given path.\r\n * @param props The deep path to the prop of the desired value\r\n */\n\nvar path = function (props) {\n return function (object) {\n var e_2, _a;\n\n var result = object;\n\n try {\n for (var props_1 = __values(props), props_1_1 = props_1.next(); !props_1_1.done; props_1_1 = props_1.next()) {\n var prop = props_1_1.value;\n result = result[prop];\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (props_1_1 && !props_1_1.done && (_a = props_1.return)) _a.call(props_1);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n return result;\n };\n};\n/**\r\n * Retrieves a value at the given path via the nested accessor prop.\r\n * @param props The deep path to the prop of the desired value\r\n */\n\nfunction nestedPath(props, accessorProp) {\n return function (object) {\n var e_3, _a;\n\n var result = object;\n\n try {\n for (var props_2 = __values(props), props_2_1 = props_2.next(); !props_2_1.done; props_2_1 = props_2.next()) {\n var prop = props_2_1.value;\n result = result[accessorProp][prop];\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (props_2_1 && !props_2_1.done && (_a = props_2.return)) _a.call(props_2);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n\n return result;\n };\n}\nfunction toStatePaths(stateValue) {\n if (!stateValue) {\n return [[]];\n }\n\n if (isString(stateValue)) {\n return [[stateValue]];\n }\n\n var result = flatten(Object.keys(stateValue).map(function (key) {\n var subStateValue = stateValue[key];\n\n if (typeof subStateValue !== 'string' && (!subStateValue || !Object.keys(subStateValue).length)) {\n return [[key]];\n }\n\n return toStatePaths(stateValue[key]).map(function (subPath) {\n return [key].concat(subPath);\n });\n }));\n return result;\n}\nfunction pathsToStateValue(paths) {\n var e_4, _a;\n\n var result = {};\n\n if (paths && paths.length === 1 && paths[0].length === 1) {\n return paths[0][0];\n }\n\n try {\n for (var paths_1 = __values(paths), paths_1_1 = paths_1.next(); !paths_1_1.done; paths_1_1 = paths_1.next()) {\n var currentPath = paths_1_1.value;\n var marker = result; // tslint:disable-next-line:prefer-for-of\n\n for (var i = 0; i < currentPath.length; i++) {\n var subPath = currentPath[i];\n\n if (i === currentPath.length - 2) {\n marker[subPath] = currentPath[i + 1];\n break;\n }\n\n marker[subPath] = marker[subPath] || {};\n marker = marker[subPath];\n }\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (paths_1_1 && !paths_1_1.done && (_a = paths_1.return)) _a.call(paths_1);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n return result;\n}\nfunction flatten(array) {\n var _a;\n\n return (_a = []).concat.apply(_a, __spreadArray([], __read(array), false));\n}\nfunction toArrayStrict(value) {\n if (isArray(value)) {\n return value;\n }\n\n return [value];\n}\nfunction toArray(value) {\n if (value === undefined) {\n return [];\n }\n\n return toArrayStrict(value);\n}\nfunction mapContext(mapper, context, _event) {\n var e_5, _a;\n\n if (isFunction(mapper)) {\n return mapper(context, _event.data);\n }\n\n var result = {};\n\n try {\n for (var _b = __values(Object.keys(mapper)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n var subMapper = mapper[key];\n\n if (isFunction(subMapper)) {\n result[key] = subMapper(context, _event.data);\n } else {\n result[key] = subMapper;\n }\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n return result;\n}\nfunction isBuiltInEvent(eventType) {\n return /^(done|error)\\./.test(eventType);\n}\nfunction isPromiseLike(value) {\n if (value instanceof Promise) {\n return true;\n } // Check if shape matches the Promise/A+ specification for a \"thenable\".\n\n\n if (value !== null && (isFunction(value) || typeof value === 'object') && isFunction(value.then)) {\n return true;\n }\n\n return false;\n}\nfunction isBehavior(value) {\n return value !== null && typeof value === 'object' && 'transition' in value && typeof value.transition === 'function';\n}\nfunction partition(items, predicate) {\n var e_6, _a;\n\n var _b = __read([[], []], 2),\n truthy = _b[0],\n falsy = _b[1];\n\n try {\n for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {\n var item = items_1_1.value;\n\n if (predicate(item)) {\n truthy.push(item);\n } else {\n falsy.push(item);\n }\n }\n } catch (e_6_1) {\n e_6 = {\n error: e_6_1\n };\n } finally {\n try {\n if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);\n } finally {\n if (e_6) throw e_6.error;\n }\n }\n\n return [truthy, falsy];\n}\nfunction updateHistoryStates(hist, stateValue) {\n return mapValues(hist.states, function (subHist, key) {\n if (!subHist) {\n return undefined;\n }\n\n var subStateValue = (isString(stateValue) ? undefined : stateValue[key]) || (subHist ? subHist.current : undefined);\n\n if (!subStateValue) {\n return undefined;\n }\n\n return {\n current: subStateValue,\n states: updateHistoryStates(subHist, subStateValue)\n };\n });\n}\nfunction updateHistoryValue(hist, stateValue) {\n return {\n current: stateValue,\n states: updateHistoryStates(hist, stateValue)\n };\n}\nfunction updateContext(context, _event, assignActions, state) {\n if (!IS_PRODUCTION) {\n warn(!!context, 'Attempting to update undefined context');\n }\n\n var updatedContext = context ? assignActions.reduce(function (acc, assignAction) {\n var e_7, _a;\n\n var assignment = assignAction.assignment;\n var meta = {\n state: state,\n action: assignAction,\n _event: _event\n };\n var partialUpdate = {};\n\n if (isFunction(assignment)) {\n partialUpdate = assignment(acc, _event.data, meta);\n } else {\n try {\n for (var _b = __values(Object.keys(assignment)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var key = _c.value;\n var propAssignment = assignment[key];\n partialUpdate[key] = isFunction(propAssignment) ? propAssignment(acc, _event.data, meta) : propAssignment;\n }\n } catch (e_7_1) {\n e_7 = {\n error: e_7_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_7) throw e_7.error;\n }\n }\n }\n\n return Object.assign({}, acc, partialUpdate);\n }, context) : context;\n return updatedContext;\n} // tslint:disable-next-line:no-empty\n\nvar warn = function () {};\n\nif (!IS_PRODUCTION) {\n warn = function (condition, message) {\n var error = condition instanceof Error ? condition : undefined;\n\n if (!error && condition) {\n return;\n }\n\n if (console !== undefined) {\n var args = [\"Warning: \".concat(message)];\n\n if (error) {\n args.push(error);\n } // tslint:disable-next-line:no-console\n\n\n console.warn.apply(console, args);\n }\n };\n}\nfunction isArray(value) {\n return Array.isArray(value);\n} // tslint:disable-next-line:ban-types\n\nfunction isFunction(value) {\n return typeof value === 'function';\n}\nfunction isString(value) {\n return typeof value === 'string';\n}\nfunction toGuard(condition, guardMap) {\n if (!condition) {\n return undefined;\n }\n\n if (isString(condition)) {\n return {\n type: DEFAULT_GUARD_TYPE,\n name: condition,\n predicate: guardMap ? guardMap[condition] : undefined\n };\n }\n\n if (isFunction(condition)) {\n return {\n type: DEFAULT_GUARD_TYPE,\n name: condition.name,\n predicate: condition\n };\n }\n\n return condition;\n}\nfunction isObservable(value) {\n try {\n return 'subscribe' in value && isFunction(value.subscribe);\n } catch (e) {\n return false;\n }\n}\nvar symbolObservable = /*#__PURE__*/function () {\n return typeof Symbol === 'function' && Symbol.observable || '@@observable';\n}(); // TODO: to be removed in v5, left it out just to minimize the scope of the change and maintain compatibility with older versions of integration paackages\n\nvar interopSymbols = (_a = {}, _a[symbolObservable] = function () {\n return this;\n}, _a[Symbol.observable] = function () {\n return this;\n}, _a);\nfunction isMachine(value) {\n return !!value && '__xstatenode' in value;\n}\nfunction isActor(value) {\n return !!value && typeof value.send === 'function';\n}\nvar uniqueId = /*#__PURE__*/function () {\n var currentId = 0;\n return function () {\n currentId++;\n return currentId.toString(16);\n };\n}();\nfunction toEventObject(event, payload // id?: TEvent['type']\n) {\n if (isString(event) || typeof event === 'number') {\n return __assign({\n type: event\n }, payload);\n }\n\n return event;\n}\nfunction toSCXMLEvent(event, scxmlEvent) {\n if (!isString(event) && '$$type' in event && event.$$type === 'scxml') {\n return event;\n }\n\n var eventObject = toEventObject(event);\n return __assign({\n name: eventObject.type,\n data: eventObject,\n $$type: 'scxml',\n type: 'external'\n }, scxmlEvent);\n}\nfunction toTransitionConfigArray(event, configLike) {\n var transitions = toArrayStrict(configLike).map(function (transitionLike) {\n if (typeof transitionLike === 'undefined' || typeof transitionLike === 'string' || isMachine(transitionLike)) {\n return {\n target: transitionLike,\n event: event\n };\n }\n\n return __assign(__assign({}, transitionLike), {\n event: event\n });\n });\n return transitions;\n}\nfunction normalizeTarget(target) {\n if (target === undefined || target === TARGETLESS_KEY) {\n return undefined;\n }\n\n return toArray(target);\n}\nfunction reportUnhandledExceptionOnInvocation(originalError, currentError, id) {\n if (!IS_PRODUCTION) {\n var originalStackTrace = originalError.stack ? \" Stacktrace was '\".concat(originalError.stack, \"'\") : '';\n\n if (originalError === currentError) {\n // tslint:disable-next-line:no-console\n console.error(\"Missing onError handler for invocation '\".concat(id, \"', error was '\").concat(originalError, \"'.\").concat(originalStackTrace));\n } else {\n var stackTrace = currentError.stack ? \" Stacktrace was '\".concat(currentError.stack, \"'\") : ''; // tslint:disable-next-line:no-console\n\n console.error(\"Missing onError handler and/or unhandled exception/promise rejection for invocation '\".concat(id, \"'. \") + \"Original error: '\".concat(originalError, \"'. \").concat(originalStackTrace, \" Current error is '\").concat(currentError, \"'.\").concat(stackTrace));\n }\n }\n}\nfunction evaluateGuard(machine, guard, context, _event, state) {\n var guards = machine.options.guards;\n var guardMeta = {\n state: state,\n cond: guard,\n _event: _event\n }; // TODO: do not hardcode!\n\n if (guard.type === DEFAULT_GUARD_TYPE) {\n return ((guards === null || guards === void 0 ? void 0 : guards[guard.name]) || guard.predicate)(context, _event.data, guardMeta);\n }\n\n var condFn = guards === null || guards === void 0 ? void 0 : guards[guard.type];\n\n if (!condFn) {\n throw new Error(\"Guard '\".concat(guard.type, \"' is not implemented on machine '\").concat(machine.id, \"'.\"));\n }\n\n return condFn(context, _event.data, guardMeta);\n}\nfunction toInvokeSource(src) {\n if (typeof src === 'string') {\n return {\n type: src\n };\n }\n\n return src;\n}\nfunction toObserver(nextHandler, errorHandler, completionHandler) {\n var noop = function () {};\n\n var isObserver = typeof nextHandler === 'object';\n var self = isObserver ? nextHandler : null;\n return {\n next: ((isObserver ? nextHandler.next : nextHandler) || noop).bind(self),\n error: ((isObserver ? nextHandler.error : errorHandler) || noop).bind(self),\n complete: ((isObserver ? nextHandler.complete : completionHandler) || noop).bind(self)\n };\n}\nfunction createInvokeId(stateNodeId, index) {\n return \"\".concat(stateNodeId, \":invocation[\").concat(index, \"]\");\n}\nfunction isRaisableAction(action) {\n return (action.type === raise || action.type === send && action.to === SpecialTargets.Internal) && typeof action.delay !== 'number';\n}\n\nexport { createInvokeId, evaluateGuard, flatten, getActionType, getEventType, interopSymbols, isActor, isArray, isBehavior, isBuiltInEvent, isFunction, isMachine, isObservable, isPromiseLike, isRaisableAction, isStateLike, isString, keys, mapContext, mapFilterValues, mapValues, matchesState, nestedPath, normalizeTarget, partition, path, pathToStateValue, pathsToStateValue, reportUnhandledExceptionOnInvocation, symbolObservable, toArray, toArrayStrict, toEventObject, toGuard, toInvokeSource, toObserver, toSCXMLEvent, toStatePath, toStatePaths, toStateValue, toTransitionConfigArray, uniqueId, updateContext, updateHistoryStates, updateHistoryValue, warn };\n","import { __assign, __spreadArray, __read, __values } from './_virtual/_tslib.js';\nimport { SpecialTargets, ActionTypes } from './types.js';\nimport { init, raise as raise$1, send as send$1, update, log as log$1, cancel as cancel$1, assign as assign$1, error as error$1, stop as stop$1, pure as pure$1, choose as choose$1 } from './actionTypes.js';\nimport * as actionTypes from './actionTypes.js';\nexport { actionTypes };\nimport { toSCXMLEvent, isString, isFunction, toEventObject, getEventType, updateContext, flatten, isArray, toArray, toGuard, evaluateGuard, warn } from './utils.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nvar initEvent = /*#__PURE__*/toSCXMLEvent({\n type: init\n});\nfunction getActionFunction(actionType, actionFunctionMap) {\n return actionFunctionMap ? actionFunctionMap[actionType] || undefined : undefined;\n}\nfunction toActionObject(action, actionFunctionMap) {\n var actionObject;\n\n if (isString(action) || typeof action === 'number') {\n var exec = getActionFunction(action, actionFunctionMap);\n\n if (isFunction(exec)) {\n actionObject = {\n type: action,\n exec: exec\n };\n } else if (exec) {\n actionObject = exec;\n } else {\n actionObject = {\n type: action,\n exec: undefined\n };\n }\n } else if (isFunction(action)) {\n actionObject = {\n // Convert action to string if unnamed\n type: action.name || action.toString(),\n exec: action\n };\n } else {\n var exec = getActionFunction(action.type, actionFunctionMap);\n\n if (isFunction(exec)) {\n actionObject = __assign(__assign({}, action), {\n exec: exec\n });\n } else if (exec) {\n var actionType = exec.type || action.type;\n actionObject = __assign(__assign(__assign({}, exec), action), {\n type: actionType\n });\n } else {\n actionObject = action;\n }\n }\n\n return actionObject;\n}\nvar toActionObjects = function (action, actionFunctionMap) {\n if (!action) {\n return [];\n }\n\n var actions = isArray(action) ? action : [action];\n return actions.map(function (subAction) {\n return toActionObject(subAction, actionFunctionMap);\n });\n};\nfunction toActivityDefinition(action) {\n var actionObject = toActionObject(action);\n return __assign(__assign({\n id: isString(action) ? action : actionObject.id\n }, actionObject), {\n type: actionObject.type\n });\n}\n/**\r\n * Raises an event. This places the event in the internal event queue, so that\r\n * the event is immediately consumed by the machine in the current step.\r\n *\r\n * @param eventType The event to raise.\r\n */\n\nfunction raise(event, options) {\n return {\n type: raise$1,\n event: typeof event === 'function' ? event : toEventObject(event),\n delay: options ? options.delay : undefined,\n id: options === null || options === void 0 ? void 0 : options.id\n };\n}\nfunction resolveRaise(action, ctx, _event, delaysMap) {\n var meta = {\n _event: _event\n };\n var resolvedEvent = toSCXMLEvent(isFunction(action.event) ? action.event(ctx, _event.data, meta) : action.event);\n var resolvedDelay;\n\n if (isString(action.delay)) {\n var configDelay = delaysMap && delaysMap[action.delay];\n resolvedDelay = isFunction(configDelay) ? configDelay(ctx, _event.data, meta) : configDelay;\n } else {\n resolvedDelay = isFunction(action.delay) ? action.delay(ctx, _event.data, meta) : action.delay;\n }\n\n return __assign(__assign({}, action), {\n type: raise$1,\n _event: resolvedEvent,\n delay: resolvedDelay\n });\n}\n/**\r\n * Sends an event. This returns an action that will be read by an interpreter to\r\n * send the event in the next step, after the current step is finished executing.\r\n *\r\n * @deprecated Use the `sendTo(...)` action creator instead.\r\n *\r\n * @param event The event to send.\r\n * @param options Options to pass into the send event:\r\n * - `id` - The unique send event identifier (used with `cancel()`).\r\n * - `delay` - The number of milliseconds to delay the sending of the event.\r\n * - `to` - The target of this event (by default, the machine the event was sent from).\r\n */\n\nfunction send(event, options) {\n return {\n to: options ? options.to : undefined,\n type: send$1,\n event: isFunction(event) ? event : toEventObject(event),\n delay: options ? options.delay : undefined,\n // TODO: don't auto-generate IDs here like that\n // there is too big chance of the ID collision\n id: options && options.id !== undefined ? options.id : isFunction(event) ? event.name : getEventType(event)\n };\n}\nfunction resolveSend(action, ctx, _event, delaysMap) {\n var meta = {\n _event: _event\n }; // TODO: helper function for resolving Expr\n\n var resolvedEvent = toSCXMLEvent(isFunction(action.event) ? action.event(ctx, _event.data, meta) : action.event);\n var resolvedDelay;\n\n if (isString(action.delay)) {\n var configDelay = delaysMap && delaysMap[action.delay];\n resolvedDelay = isFunction(configDelay) ? configDelay(ctx, _event.data, meta) : configDelay;\n } else {\n resolvedDelay = isFunction(action.delay) ? action.delay(ctx, _event.data, meta) : action.delay;\n }\n\n var resolvedTarget = isFunction(action.to) ? action.to(ctx, _event.data, meta) : action.to;\n return __assign(__assign({}, action), {\n to: resolvedTarget,\n _event: resolvedEvent,\n event: resolvedEvent.data,\n delay: resolvedDelay\n });\n}\n/**\r\n * Sends an event to this machine's parent.\r\n *\r\n * @param event The event to send to the parent machine.\r\n * @param options Options to pass into the send event.\r\n */\n\nfunction sendParent(event, options) {\n return send(event, __assign(__assign({}, options), {\n to: SpecialTargets.Parent\n }));\n}\n/**\r\n * Sends an event to an actor.\r\n *\r\n * @param actor The `ActorRef` to send the event to.\r\n * @param event The event to send, or an expression that evaluates to the event to send\r\n * @param options Send action options\r\n * @returns An XState send action object\r\n */\n\nfunction sendTo(actor, event, options) {\n return send(event, __assign(__assign({}, options), {\n to: actor\n }));\n}\n/**\r\n * Sends an update event to this machine's parent.\r\n */\n\nfunction sendUpdate() {\n return sendParent(update);\n}\n/**\r\n * Sends an event back to the sender of the original event.\r\n *\r\n * @param event The event to send back to the sender\r\n * @param options Options to pass into the send event\r\n */\n\nfunction respond(event, options) {\n return send(event, __assign(__assign({}, options), {\n to: function (_, __, _a) {\n var _event = _a._event;\n return _event.origin; // TODO: handle when _event.origin is undefined\n }\n }));\n}\n\nvar defaultLogExpr = function (context, event) {\n return {\n context: context,\n event: event\n };\n};\n/**\r\n *\r\n * @param expr The expression function to evaluate which will be logged.\r\n * Takes in 2 arguments:\r\n * - `ctx` - the current state context\r\n * - `event` - the event that caused this action to be executed.\r\n * @param label The label to give to the logged expression.\r\n */\n\n\nfunction log(expr, label) {\n if (expr === void 0) {\n expr = defaultLogExpr;\n }\n\n return {\n type: log$1,\n label: label,\n expr: expr\n };\n}\nvar resolveLog = function (action, ctx, _event) {\n return __assign(__assign({}, action), {\n value: isString(action.expr) ? action.expr : action.expr(ctx, _event.data, {\n _event: _event\n })\n });\n};\n/**\r\n * Cancels an in-flight `send(...)` action. A canceled sent action will not\r\n * be executed, nor will its event be sent, unless it has already been sent\r\n * (e.g., if `cancel(...)` is called after the `send(...)` action's `delay`).\r\n *\r\n * @param sendId The `id` of the `send(...)` action to cancel.\r\n */\n\nvar cancel = function (sendId) {\n return {\n type: cancel$1,\n sendId: sendId\n };\n};\n/**\r\n * Starts an activity.\r\n *\r\n * @param activity The activity to start.\r\n */\n\nfunction start(activity) {\n var activityDef = toActivityDefinition(activity);\n return {\n type: ActionTypes.Start,\n activity: activityDef,\n exec: undefined\n };\n}\n/**\r\n * Stops an activity.\r\n *\r\n * @param actorRef The activity to stop.\r\n */\n\nfunction stop(actorRef) {\n var activity = isFunction(actorRef) ? actorRef : toActivityDefinition(actorRef);\n return {\n type: ActionTypes.Stop,\n activity: activity,\n exec: undefined\n };\n}\nfunction resolveStop(action, context, _event) {\n var actorRefOrString = isFunction(action.activity) ? action.activity(context, _event.data) : action.activity;\n var resolvedActorRef = typeof actorRefOrString === 'string' ? {\n id: actorRefOrString\n } : actorRefOrString;\n var actionObject = {\n type: ActionTypes.Stop,\n activity: resolvedActorRef\n };\n return actionObject;\n}\n/**\r\n * Updates the current context of the machine.\r\n *\r\n * @param assignment An object that represents the partial context to update.\r\n */\n\nvar assign = function (assignment) {\n return {\n type: assign$1,\n assignment: assignment\n };\n};\nfunction isActionObject(action) {\n return typeof action === 'object' && 'type' in action;\n}\n/**\r\n * Returns an event type that represents an implicit event that\r\n * is sent after the specified `delay`.\r\n *\r\n * @param delayRef The delay in milliseconds\r\n * @param id The state node ID where this event is handled\r\n */\n\nfunction after(delayRef, id) {\n var idSuffix = id ? \"#\".concat(id) : '';\n return \"\".concat(ActionTypes.After, \"(\").concat(delayRef, \")\").concat(idSuffix);\n}\n/**\r\n * Returns an event that represents that a final state node\r\n * has been reached in the parent state node.\r\n *\r\n * @param id The final state node's parent state node `id`\r\n * @param data The data to pass into the event\r\n */\n\nfunction done(id, data) {\n var type = \"\".concat(ActionTypes.DoneState, \".\").concat(id);\n var eventObject = {\n type: type,\n data: data\n };\n\n eventObject.toString = function () {\n return type;\n };\n\n return eventObject;\n}\n/**\r\n * Returns an event that represents that an invoked service has terminated.\r\n *\r\n * An invoked service is terminated when it has reached a top-level final state node,\r\n * but not when it is canceled.\r\n *\r\n * @param id The final state node ID\r\n * @param data The data to pass into the event\r\n */\n\nfunction doneInvoke(id, data) {\n var type = \"\".concat(ActionTypes.DoneInvoke, \".\").concat(id);\n var eventObject = {\n type: type,\n data: data\n };\n\n eventObject.toString = function () {\n return type;\n };\n\n return eventObject;\n}\nfunction error(id, data) {\n var type = \"\".concat(ActionTypes.ErrorPlatform, \".\").concat(id);\n var eventObject = {\n type: type,\n data: data\n };\n\n eventObject.toString = function () {\n return type;\n };\n\n return eventObject;\n}\nfunction pure(getActions) {\n return {\n type: ActionTypes.Pure,\n get: getActions\n };\n}\n/**\r\n * Forwards (sends) an event to a specified service.\r\n *\r\n * @param target The target service to forward the event to.\r\n * @param options Options to pass into the send action creator.\r\n */\n\nfunction forwardTo(target, options) {\n if (!IS_PRODUCTION && (!target || typeof target === 'function')) {\n var originalTarget_1 = target;\n\n target = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var resolvedTarget = typeof originalTarget_1 === 'function' ? originalTarget_1.apply(void 0, __spreadArray([], __read(args), false)) : originalTarget_1;\n\n if (!resolvedTarget) {\n throw new Error(\"Attempted to forward event to undefined actor. This risks an infinite loop in the sender.\");\n }\n\n return resolvedTarget;\n };\n }\n\n return send(function (_, event) {\n return event;\n }, __assign(__assign({}, options), {\n to: target\n }));\n}\n/**\r\n * Escalates an error by sending it as an event to this machine's parent.\r\n *\r\n * @param errorData The error data to send, or the expression function that\r\n * takes in the `context`, `event`, and `meta`, and returns the error data to send.\r\n * @param options Options to pass into the send action creator.\r\n */\n\nfunction escalate(errorData, options) {\n return sendParent(function (context, event, meta) {\n return {\n type: error$1,\n data: isFunction(errorData) ? errorData(context, event, meta) : errorData\n };\n }, __assign(__assign({}, options), {\n to: SpecialTargets.Parent\n }));\n}\nfunction choose(conds) {\n return {\n type: ActionTypes.Choose,\n conds: conds\n };\n}\n\nvar pluckAssigns = function (actionBlocks) {\n var e_1, _a;\n\n var assignActions = [];\n\n try {\n for (var actionBlocks_1 = __values(actionBlocks), actionBlocks_1_1 = actionBlocks_1.next(); !actionBlocks_1_1.done; actionBlocks_1_1 = actionBlocks_1.next()) {\n var block = actionBlocks_1_1.value;\n var i = 0;\n\n while (i < block.actions.length) {\n if (block.actions[i].type === assign$1) {\n assignActions.push(block.actions[i]);\n block.actions.splice(i, 1);\n continue;\n }\n\n i++;\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (actionBlocks_1_1 && !actionBlocks_1_1.done && (_a = actionBlocks_1.return)) _a.call(actionBlocks_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n return assignActions;\n};\n\nfunction resolveActions(machine, currentState, currentContext, _event, actionBlocks, predictableExec, preserveActionOrder) {\n if (preserveActionOrder === void 0) {\n preserveActionOrder = false;\n }\n\n var assignActions = preserveActionOrder ? [] : pluckAssigns(actionBlocks);\n var updatedContext = assignActions.length ? updateContext(currentContext, _event, assignActions, currentState) : currentContext;\n var preservedContexts = preserveActionOrder ? [currentContext] : undefined;\n var deferredToBlockEnd = [];\n\n function handleAction(blockType, actionObject) {\n var _a;\n\n switch (actionObject.type) {\n case raise$1:\n {\n var raisedAction = resolveRaise(actionObject, updatedContext, _event, machine.options.delays);\n\n if (predictableExec && typeof raisedAction.delay === 'number') {\n predictableExec(raisedAction, updatedContext, _event);\n }\n\n return raisedAction;\n }\n\n case send$1:\n var sendAction = resolveSend(actionObject, updatedContext, _event, machine.options.delays); // TODO: fix ActionTypes.Init\n\n if (!IS_PRODUCTION) {\n var configuredDelay = actionObject.delay; // warn after resolving as we can create better contextual message here\n\n warn(!isString(configuredDelay) || typeof sendAction.delay === 'number', // tslint:disable-next-line:max-line-length\n \"No delay reference for delay expression '\".concat(configuredDelay, \"' was found on machine '\").concat(machine.id, \"'\"));\n }\n\n if (predictableExec && sendAction.to !== SpecialTargets.Internal) {\n if (blockType === 'entry') {\n deferredToBlockEnd.push(sendAction);\n } else {\n predictableExec(sendAction, updatedContext, _event);\n }\n }\n\n return sendAction;\n\n case log$1:\n {\n var resolved = resolveLog(actionObject, updatedContext, _event);\n predictableExec === null || predictableExec === void 0 ? void 0 : predictableExec(resolved, updatedContext, _event);\n return resolved;\n }\n\n case choose$1:\n {\n var chooseAction = actionObject;\n var matchedActions = (_a = chooseAction.conds.find(function (condition) {\n var guard = toGuard(condition.cond, machine.options.guards);\n return !guard || evaluateGuard(machine, guard, updatedContext, _event, !predictableExec ? currentState : undefined);\n })) === null || _a === void 0 ? void 0 : _a.actions;\n\n if (!matchedActions) {\n return [];\n }\n\n var _b = __read(resolveActions(machine, currentState, updatedContext, _event, [{\n type: blockType,\n actions: toActionObjects(toArray(matchedActions), machine.options.actions)\n }], predictableExec, preserveActionOrder), 2),\n resolvedActionsFromChoose = _b[0],\n resolvedContextFromChoose = _b[1];\n\n updatedContext = resolvedContextFromChoose;\n preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n return resolvedActionsFromChoose;\n }\n\n case pure$1:\n {\n var matchedActions = actionObject.get(updatedContext, _event.data);\n\n if (!matchedActions) {\n return [];\n }\n\n var _c = __read(resolveActions(machine, currentState, updatedContext, _event, [{\n type: blockType,\n actions: toActionObjects(toArray(matchedActions), machine.options.actions)\n }], predictableExec, preserveActionOrder), 2),\n resolvedActionsFromPure = _c[0],\n resolvedContext = _c[1];\n\n updatedContext = resolvedContext;\n preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n return resolvedActionsFromPure;\n }\n\n case stop$1:\n {\n var resolved = resolveStop(actionObject, updatedContext, _event);\n predictableExec === null || predictableExec === void 0 ? void 0 : predictableExec(resolved, currentContext, _event);\n return resolved;\n }\n\n case assign$1:\n {\n updatedContext = updateContext(updatedContext, _event, [actionObject], !predictableExec ? currentState : undefined);\n preservedContexts === null || preservedContexts === void 0 ? void 0 : preservedContexts.push(updatedContext);\n break;\n }\n\n default:\n var resolvedActionObject = toActionObject(actionObject, machine.options.actions);\n var exec_1 = resolvedActionObject.exec;\n\n if (predictableExec) {\n predictableExec(resolvedActionObject, updatedContext, _event);\n } else if (exec_1 && preservedContexts) {\n var contextIndex_1 = preservedContexts.length - 1;\n\n var wrapped = __assign(__assign({}, resolvedActionObject), {\n exec: function (_ctx) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n exec_1.apply(void 0, __spreadArray([preservedContexts[contextIndex_1]], __read(args), false));\n }\n });\n\n resolvedActionObject = wrapped;\n }\n\n return resolvedActionObject;\n }\n }\n\n function processBlock(block) {\n var e_2, _a;\n\n var resolvedActions = [];\n\n try {\n for (var _b = __values(block.actions), _c = _b.next(); !_c.done; _c = _b.next()) {\n var action = _c.value;\n var resolved = handleAction(block.type, action);\n\n if (resolved) {\n resolvedActions = resolvedActions.concat(resolved);\n }\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n deferredToBlockEnd.forEach(function (action) {\n predictableExec(action, updatedContext, _event);\n });\n deferredToBlockEnd.length = 0;\n return resolvedActions;\n }\n\n var resolvedActions = flatten(actionBlocks.map(processBlock));\n return [resolvedActions, updatedContext];\n}\n\nexport { after, assign, cancel, choose, done, doneInvoke, error, escalate, forwardTo, getActionFunction, initEvent, isActionObject, log, pure, raise, resolveActions, resolveLog, resolveRaise, resolveSend, resolveStop, respond, send, sendParent, sendTo, sendUpdate, start, stop, toActionObject, toActionObjects, toActivityDefinition };\n","/**\r\n * Maintains a stack of the current service in scope.\r\n * This is used to provide the correct service to spawn().\r\n */\nvar serviceStack = [];\nvar provide = function (service, fn) {\n serviceStack.push(service);\n var result = fn(service);\n serviceStack.pop();\n return result;\n};\nvar consume = function (fn) {\n return fn(serviceStack[serviceStack.length - 1]);\n};\n\nexport { consume, provide };\n","import { __assign } from './_virtual/_tslib.js';\nimport { symbolObservable, toInvokeSource, mapContext, isMachine } from './utils.js';\nimport { provide } from './serviceScope.js';\n\nfunction createNullActor(id) {\n var _a;\n\n return _a = {\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function () {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n },\n getSnapshot: function () {\n return undefined;\n },\n toJSON: function () {\n return {\n id: id\n };\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a;\n}\n/**\r\n * Creates a deferred actor that is able to be invoked given the provided\r\n * invocation information in its `.meta` value.\r\n *\r\n * @param invokeDefinition The meta information needed to invoke the actor.\r\n */\n\nfunction createInvocableActor(invokeDefinition, machine, context, _event) {\n var _a;\n\n var invokeSrc = toInvokeSource(invokeDefinition.src);\n var serviceCreator = (_a = machine === null || machine === void 0 ? void 0 : machine.options.services) === null || _a === void 0 ? void 0 : _a[invokeSrc.type];\n var resolvedData = invokeDefinition.data ? mapContext(invokeDefinition.data, context, _event) : undefined;\n var tempActor = serviceCreator ? createDeferredActor(serviceCreator, invokeDefinition.id, resolvedData) : createNullActor(invokeDefinition.id); // @ts-ignore\n\n tempActor.meta = invokeDefinition;\n return tempActor;\n}\nfunction createDeferredActor(entity, id, data) {\n var tempActor = createNullActor(id); // @ts-ignore\n\n tempActor.deferred = true;\n\n if (isMachine(entity)) {\n // \"mute\" the existing service scope so potential spawned actors within the `.initialState` stay deferred here\n var initialState_1 = tempActor.state = provide(undefined, function () {\n return (data ? entity.withContext(data) : entity).initialState;\n });\n\n tempActor.getSnapshot = function () {\n return initialState_1;\n };\n }\n\n return tempActor;\n}\nfunction isActor(item) {\n try {\n return typeof item.send === 'function';\n } catch (e) {\n return false;\n }\n}\nfunction isSpawnedActor(item) {\n return isActor(item) && 'id' in item;\n} // TODO: refactor the return type, this could be written in a better way but it's best to avoid unneccessary breaking changes now\n\nfunction toActorRef(actorRefLike) {\n var _a;\n\n return __assign((_a = {\n subscribe: function () {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n },\n id: 'anonymous',\n getSnapshot: function () {\n return undefined;\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a), actorRefLike);\n}\n\nexport { createDeferredActor, createInvocableActor, createNullActor, isActor, isSpawnedActor, toActorRef };\n","import { __values, __spreadArray, __read } from './_virtual/_tslib.js';\nimport { flatten } from './utils.js';\n\nvar isLeafNode = function (stateNode) {\n return stateNode.type === 'atomic' || stateNode.type === 'final';\n};\nfunction getAllChildren(stateNode) {\n return Object.keys(stateNode.states).map(function (key) {\n return stateNode.states[key];\n });\n}\nfunction getChildren(stateNode) {\n return getAllChildren(stateNode).filter(function (sn) {\n return sn.type !== 'history';\n });\n}\nfunction getAllStateNodes(stateNode) {\n var stateNodes = [stateNode];\n\n if (isLeafNode(stateNode)) {\n return stateNodes;\n }\n\n return stateNodes.concat(flatten(getChildren(stateNode).map(getAllStateNodes)));\n}\nfunction getConfiguration(prevStateNodes, stateNodes) {\n var e_1, _a, e_2, _b, e_3, _c, e_4, _d;\n\n var prevConfiguration = new Set(prevStateNodes);\n var prevAdjList = getAdjList(prevConfiguration);\n var configuration = new Set(stateNodes);\n\n try {\n // add all ancestors\n for (var configuration_1 = __values(configuration), configuration_1_1 = configuration_1.next(); !configuration_1_1.done; configuration_1_1 = configuration_1.next()) {\n var s = configuration_1_1.value;\n var m = s.parent;\n\n while (m && !configuration.has(m)) {\n configuration.add(m);\n m = m.parent;\n }\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (configuration_1_1 && !configuration_1_1.done && (_a = configuration_1.return)) _a.call(configuration_1);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n\n var adjList = getAdjList(configuration);\n\n try {\n // add descendants\n for (var configuration_2 = __values(configuration), configuration_2_1 = configuration_2.next(); !configuration_2_1.done; configuration_2_1 = configuration_2.next()) {\n var s = configuration_2_1.value; // if previously active, add existing child nodes\n\n if (s.type === 'compound' && (!adjList.get(s) || !adjList.get(s).length)) {\n if (prevAdjList.get(s)) {\n prevAdjList.get(s).forEach(function (sn) {\n return configuration.add(sn);\n });\n } else {\n s.initialStateNodes.forEach(function (sn) {\n return configuration.add(sn);\n });\n }\n } else {\n if (s.type === 'parallel') {\n try {\n for (var _e = (e_3 = void 0, __values(getChildren(s))), _f = _e.next(); !_f.done; _f = _e.next()) {\n var child = _f.value;\n\n if (!configuration.has(child)) {\n configuration.add(child);\n\n if (prevAdjList.get(child)) {\n prevAdjList.get(child).forEach(function (sn) {\n return configuration.add(sn);\n });\n } else {\n child.initialStateNodes.forEach(function (sn) {\n return configuration.add(sn);\n });\n }\n }\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_c = _e.return)) _c.call(_e);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n }\n }\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (configuration_2_1 && !configuration_2_1.done && (_b = configuration_2.return)) _b.call(configuration_2);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n try {\n // add all ancestors\n for (var configuration_3 = __values(configuration), configuration_3_1 = configuration_3.next(); !configuration_3_1.done; configuration_3_1 = configuration_3.next()) {\n var s = configuration_3_1.value;\n var m = s.parent;\n\n while (m && !configuration.has(m)) {\n configuration.add(m);\n m = m.parent;\n }\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (configuration_3_1 && !configuration_3_1.done && (_d = configuration_3.return)) _d.call(configuration_3);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n return configuration;\n}\n\nfunction getValueFromAdj(baseNode, adjList) {\n var childStateNodes = adjList.get(baseNode);\n\n if (!childStateNodes) {\n return {}; // todo: fix?\n }\n\n if (baseNode.type === 'compound') {\n var childStateNode = childStateNodes[0];\n\n if (childStateNode) {\n if (isLeafNode(childStateNode)) {\n return childStateNode.key;\n }\n } else {\n return {};\n }\n }\n\n var stateValue = {};\n childStateNodes.forEach(function (csn) {\n stateValue[csn.key] = getValueFromAdj(csn, adjList);\n });\n return stateValue;\n}\n\nfunction getAdjList(configuration) {\n var e_5, _a;\n\n var adjList = new Map();\n\n try {\n for (var configuration_4 = __values(configuration), configuration_4_1 = configuration_4.next(); !configuration_4_1.done; configuration_4_1 = configuration_4.next()) {\n var s = configuration_4_1.value;\n\n if (!adjList.has(s)) {\n adjList.set(s, []);\n }\n\n if (s.parent) {\n if (!adjList.has(s.parent)) {\n adjList.set(s.parent, []);\n }\n\n adjList.get(s.parent).push(s);\n }\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (configuration_4_1 && !configuration_4_1.done && (_a = configuration_4.return)) _a.call(configuration_4);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n return adjList;\n}\nfunction getValue(rootNode, configuration) {\n var config = getConfiguration([rootNode], configuration);\n return getValueFromAdj(rootNode, getAdjList(config));\n}\nfunction has(iterable, item) {\n if (Array.isArray(iterable)) {\n return iterable.some(function (member) {\n return member === item;\n });\n }\n\n if (iterable instanceof Set) {\n return iterable.has(item);\n }\n\n return false; // TODO: fix\n}\nfunction nextEvents(configuration) {\n return __spreadArray([], __read(new Set(flatten(__spreadArray([], __read(configuration.map(function (sn) {\n return sn.ownEvents;\n })), false)))), false);\n}\nfunction isInFinalState(configuration, stateNode) {\n if (stateNode.type === 'compound') {\n return getChildren(stateNode).some(function (s) {\n return s.type === 'final' && has(configuration, s);\n });\n }\n\n if (stateNode.type === 'parallel') {\n return getChildren(stateNode).every(function (sn) {\n return isInFinalState(configuration, sn);\n });\n }\n\n return false;\n}\nfunction getMeta(configuration) {\n if (configuration === void 0) {\n configuration = [];\n }\n\n return configuration.reduce(function (acc, stateNode) {\n if (stateNode.meta !== undefined) {\n acc[stateNode.id] = stateNode.meta;\n }\n\n return acc;\n }, {});\n}\nfunction getTagsFromConfiguration(configuration) {\n return new Set(flatten(configuration.map(function (sn) {\n return sn.tags;\n })));\n}\n\nexport { getAdjList, getAllChildren, getAllStateNodes, getChildren, getConfiguration, getMeta, getTagsFromConfiguration, getValue, has, isInFinalState, isLeafNode, nextEvents };\n","import { __assign, __spreadArray, __read, __rest } from './_virtual/_tslib.js';\nimport { EMPTY_ACTIVITY_MAP } from './constants.js';\nimport { isString, matchesState, warn } from './utils.js';\nimport { getMeta, nextEvents } from './stateUtils.js';\nimport { initEvent } from './actions.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nfunction stateValuesEqual(a, b) {\n if (a === b) {\n return true;\n }\n\n if (a === undefined || b === undefined) {\n return false;\n }\n\n if (isString(a) || isString(b)) {\n return a === b;\n }\n\n var aKeys = Object.keys(a);\n var bKeys = Object.keys(b);\n return aKeys.length === bKeys.length && aKeys.every(function (key) {\n return stateValuesEqual(a[key], b[key]);\n });\n}\nfunction isStateConfig(state) {\n if (typeof state !== 'object' || state === null) {\n return false;\n }\n\n return 'value' in state && '_event' in state;\n}\n/**\r\n * @deprecated Use `isStateConfig(object)` or `state instanceof State` instead.\r\n */\n\nvar isState = isStateConfig;\nfunction bindActionToState(action, state) {\n var exec = action.exec;\n\n var boundAction = __assign(__assign({}, action), {\n exec: exec !== undefined ? function () {\n return exec(state.context, state.event, {\n action: action,\n state: state,\n _event: state._event\n });\n } : undefined\n });\n\n return boundAction;\n}\n\nvar State =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n /**\r\n * Creates a new State instance.\r\n * @param value The state value\r\n * @param context The extended state\r\n * @param historyValue The tree representing historical values of the state nodes\r\n * @param history The previous state\r\n * @param actions An array of action objects to execute as side-effects\r\n * @param activities A mapping of activities and whether they are started (`true`) or stopped (`false`).\r\n * @param meta\r\n * @param events Internal event queue. Should be empty with run-to-completion semantics.\r\n * @param configuration\r\n */\n function State(config) {\n var _this = this;\n\n var _a;\n\n this.actions = [];\n this.activities = EMPTY_ACTIVITY_MAP;\n this.meta = {};\n this.events = [];\n this.value = config.value;\n this.context = config.context;\n this._event = config._event;\n this._sessionid = config._sessionid;\n this.event = this._event.data;\n this.historyValue = config.historyValue;\n this.history = config.history;\n this.actions = config.actions || [];\n this.activities = config.activities || EMPTY_ACTIVITY_MAP;\n this.meta = getMeta(config.configuration);\n this.events = config.events || [];\n this.matches = this.matches.bind(this);\n this.toStrings = this.toStrings.bind(this);\n this.configuration = config.configuration;\n this.transitions = config.transitions;\n this.children = config.children;\n this.done = !!config.done;\n this.tags = (_a = Array.isArray(config.tags) ? new Set(config.tags) : config.tags) !== null && _a !== void 0 ? _a : new Set();\n this.machine = config.machine;\n Object.defineProperty(this, 'nextEvents', {\n get: function () {\n return nextEvents(_this.configuration);\n }\n });\n }\n /**\r\n * Creates a new State instance for the given `stateValue` and `context`.\r\n * @param stateValue\r\n * @param context\r\n */\n\n\n State.from = function (stateValue, context) {\n if (stateValue instanceof State) {\n if (stateValue.context !== context) {\n return new State({\n value: stateValue.value,\n context: context,\n _event: stateValue._event,\n _sessionid: null,\n historyValue: stateValue.historyValue,\n history: stateValue.history,\n actions: [],\n activities: stateValue.activities,\n meta: {},\n events: [],\n configuration: [],\n transitions: [],\n children: {}\n });\n }\n\n return stateValue;\n }\n\n var _event = initEvent;\n return new State({\n value: stateValue,\n context: context,\n _event: _event,\n _sessionid: null,\n historyValue: undefined,\n history: undefined,\n actions: [],\n activities: undefined,\n meta: undefined,\n events: [],\n configuration: [],\n transitions: [],\n children: {}\n });\n };\n /**\r\n * Creates a new State instance for the given `config`.\r\n * @param config The state config\r\n */\n\n\n State.create = function (config) {\n return new State(config);\n };\n /**\r\n * Creates a new `State` instance for the given `stateValue` and `context` with no actions (side-effects).\r\n * @param stateValue\r\n * @param context\r\n */\n\n\n State.inert = function (stateValue, context) {\n if (stateValue instanceof State) {\n if (!stateValue.actions.length) {\n return stateValue;\n }\n\n var _event = initEvent;\n return new State({\n value: stateValue.value,\n context: context,\n _event: _event,\n _sessionid: null,\n historyValue: stateValue.historyValue,\n history: stateValue.history,\n activities: stateValue.activities,\n configuration: stateValue.configuration,\n transitions: [],\n children: {}\n });\n }\n\n return State.from(stateValue, context);\n };\n /**\r\n * Returns an array of all the string leaf state node paths.\r\n * @param stateValue\r\n * @param delimiter The character(s) that separate each subpath in the string state node path.\r\n */\n\n\n State.prototype.toStrings = function (stateValue, delimiter) {\n var _this = this;\n\n if (stateValue === void 0) {\n stateValue = this.value;\n }\n\n if (delimiter === void 0) {\n delimiter = '.';\n }\n\n if (isString(stateValue)) {\n return [stateValue];\n }\n\n var valueKeys = Object.keys(stateValue);\n return valueKeys.concat.apply(valueKeys, __spreadArray([], __read(valueKeys.map(function (key) {\n return _this.toStrings(stateValue[key], delimiter).map(function (s) {\n return key + delimiter + s;\n });\n })), false));\n };\n\n State.prototype.toJSON = function () {\n var _a = this;\n _a.configuration;\n _a.transitions;\n var tags = _a.tags;\n _a.machine;\n var jsonValues = __rest(_a, [\"configuration\", \"transitions\", \"tags\", \"machine\"]);\n\n return __assign(__assign({}, jsonValues), {\n tags: Array.from(tags)\n });\n };\n\n State.prototype.matches = function (parentStateValue) {\n return matchesState(parentStateValue, this.value);\n };\n /**\r\n * Whether the current state configuration has a state node with the specified `tag`.\r\n * @param tag\r\n */\n\n\n State.prototype.hasTag = function (tag) {\n return this.tags.has(tag);\n };\n /**\r\n * Determines whether sending the `event` will cause a non-forbidden transition\r\n * to be selected, even if the transitions have no actions nor\r\n * change the state value.\r\n *\r\n * @param event The event to test\r\n * @returns Whether the event will cause a transition\r\n */\n\n\n State.prototype.can = function (event) {\n var _a;\n\n if (IS_PRODUCTION) {\n warn(!!this.machine, \"state.can(...) used outside of a machine-created State object; this will always return false.\");\n }\n\n var transitionData = (_a = this.machine) === null || _a === void 0 ? void 0 : _a.getTransitionData(this, event);\n return !!(transitionData === null || transitionData === void 0 ? void 0 : transitionData.transitions.length) && // Check that at least one transition is not forbidden\n transitionData.transitions.some(function (t) {\n return t.target !== undefined || t.actions.length;\n });\n };\n\n return State;\n}();\n\nexport { State, bindActionToState, isState, isStateConfig, stateValuesEqual };\n","import { __assign } from './_virtual/_tslib.js';\n\nvar defaultOptions = {\n deferEvents: false\n};\n\nvar Scheduler =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n function Scheduler(options) {\n this.processingEvent = false;\n this.queue = [];\n this.initialized = false;\n this.options = __assign(__assign({}, defaultOptions), options);\n }\n\n Scheduler.prototype.initialize = function (callback) {\n this.initialized = true;\n\n if (callback) {\n if (!this.options.deferEvents) {\n this.schedule(callback);\n return;\n }\n\n this.process(callback);\n }\n\n this.flushEvents();\n };\n\n Scheduler.prototype.schedule = function (task) {\n if (!this.initialized || this.processingEvent) {\n this.queue.push(task);\n return;\n }\n\n if (this.queue.length !== 0) {\n throw new Error('Event queue should be empty when it is not processing events');\n }\n\n this.process(task);\n this.flushEvents();\n };\n\n Scheduler.prototype.clear = function () {\n this.queue = [];\n };\n\n Scheduler.prototype.flushEvents = function () {\n var nextCallback = this.queue.shift();\n\n while (nextCallback) {\n this.process(nextCallback);\n nextCallback = this.queue.shift();\n }\n };\n\n Scheduler.prototype.process = function (callback) {\n this.processingEvent = true;\n\n try {\n callback();\n } catch (e) {\n // there is no use to keep the future events\n // as the situation is not anymore the same\n this.clear();\n throw e;\n } finally {\n this.processingEvent = false;\n }\n };\n\n return Scheduler;\n}();\n\nexport { Scheduler };\n","var children = /*#__PURE__*/new Map();\nvar sessionIdIndex = 0;\nvar registry = {\n bookId: function () {\n return \"x:\".concat(sessionIdIndex++);\n },\n register: function (id, actor) {\n children.set(id, actor);\n return id;\n },\n get: function (id) {\n return children.get(id);\n },\n free: function (id) {\n children.delete(id);\n }\n};\n\nexport { registry };\n","import { IS_PRODUCTION } from './environment.js';\n\nfunction getGlobal() {\n if (typeof globalThis !== 'undefined') {\n return globalThis;\n }\n\n if (typeof self !== 'undefined') {\n return self;\n }\n\n if (typeof window !== 'undefined') {\n return window;\n }\n\n if (typeof global !== 'undefined') {\n return global;\n }\n\n if (!IS_PRODUCTION) {\n console.warn('XState could not find a global object in this environment. Please let the maintainers know and raise an issue here: https://github.com/statelyai/xstate/issues');\n }\n}\n\nfunction getDevTools() {\n var global = getGlobal();\n\n if (global && '__xstate__' in global) {\n return global.__xstate__;\n }\n\n return undefined;\n}\n\nfunction registerService(service) {\n if (!getGlobal()) {\n return;\n }\n\n var devTools = getDevTools();\n\n if (devTools) {\n devTools.register(service);\n }\n}\n\nexport { getGlobal, registerService };\n","import { error, doneInvoke } from './actions.js';\nimport { toActorRef } from './Actor.js';\nimport { toObserver } from './utils.js';\n\n/**\r\n * Returns an actor behavior from a reducer and its initial state.\r\n *\r\n * @param transition The pure reducer that returns the next state given the current state and event.\r\n * @param initialState The initial state of the reducer.\r\n * @returns An actor behavior\r\n */\n\nfunction fromReducer(transition, initialState) {\n return {\n transition: transition,\n initialState: initialState\n };\n}\nfunction fromPromise(promiseFn) {\n var initialState = {\n error: undefined,\n data: undefined,\n status: 'pending'\n };\n return {\n transition: function (state, event, _a) {\n var parent = _a.parent,\n id = _a.id,\n observers = _a.observers;\n\n switch (event.type) {\n case 'fulfill':\n parent === null || parent === void 0 ? void 0 : parent.send(doneInvoke(id, event.data));\n return {\n error: undefined,\n data: event.data,\n status: 'fulfilled'\n };\n\n case 'reject':\n parent === null || parent === void 0 ? void 0 : parent.send(error(id, event.error));\n observers.forEach(function (observer) {\n observer.error(event.error);\n });\n return {\n error: event.error,\n data: undefined,\n status: 'rejected'\n };\n\n default:\n return state;\n }\n },\n initialState: initialState,\n start: function (_a) {\n var self = _a.self;\n promiseFn().then(function (data) {\n self.send({\n type: 'fulfill',\n data: data\n });\n }, function (reason) {\n self.send({\n type: 'reject',\n error: reason\n });\n });\n return initialState;\n }\n };\n}\nfunction spawnBehavior(behavior, options) {\n if (options === void 0) {\n options = {};\n }\n\n var state = behavior.initialState;\n var observers = new Set();\n var mailbox = [];\n var flushing = false;\n\n var flush = function () {\n if (flushing) {\n return;\n }\n\n flushing = true;\n\n while (mailbox.length > 0) {\n var event_1 = mailbox.shift();\n state = behavior.transition(state, event_1, actorCtx);\n observers.forEach(function (observer) {\n return observer.next(state);\n });\n }\n\n flushing = false;\n };\n\n var actor = toActorRef({\n id: options.id,\n send: function (event) {\n mailbox.push(event);\n flush();\n },\n getSnapshot: function () {\n return state;\n },\n subscribe: function (next, handleError, complete) {\n var observer = toObserver(next, handleError, complete);\n observers.add(observer);\n observer.next(state);\n return {\n unsubscribe: function () {\n observers.delete(observer);\n }\n };\n }\n });\n var actorCtx = {\n parent: options.parent,\n self: actor,\n id: options.id || 'anonymous',\n observers: observers\n };\n state = behavior.start ? behavior.start(actorCtx) : state;\n return actor;\n}\n\nexport { fromPromise, fromReducer, spawnBehavior };\n","import { __values, __spreadArray, __read, __assign } from './_virtual/_tslib.js';\nimport { SpecialTargets, ActionTypes } from './types.js';\nimport { isStateConfig, State, bindActionToState } from './State.js';\nimport { errorPlatform, update, error as error$1, log, stop, start, cancel, send, raise } from './actionTypes.js';\nimport { initEvent, doneInvoke, toActionObjects, resolveActions, error, getActionFunction } from './actions.js';\nimport { IS_PRODUCTION } from './environment.js';\nimport { warn, mapContext, toObserver, isFunction, toSCXMLEvent, flatten, isRaisableAction, isPromiseLike, isObservable, isMachine, isBehavior, reportUnhandledExceptionOnInvocation, symbolObservable, isArray, toEventObject, isString, isActor, toInvokeSource, uniqueId } from './utils.js';\nimport { Scheduler } from './scheduler.js';\nimport { createDeferredActor, isSpawnedActor } from './Actor.js';\nimport { registry } from './registry.js';\nimport { getGlobal, registerService } from './devTools.js';\nimport { provide, consume } from './serviceScope.js';\nimport { spawnBehavior } from './behaviors.js';\n\nvar DEFAULT_SPAWN_OPTIONS = {\n sync: false,\n autoForward: false\n};\nvar InterpreterStatus;\n\n(function (InterpreterStatus) {\n InterpreterStatus[InterpreterStatus[\"NotStarted\"] = 0] = \"NotStarted\";\n InterpreterStatus[InterpreterStatus[\"Running\"] = 1] = \"Running\";\n InterpreterStatus[InterpreterStatus[\"Stopped\"] = 2] = \"Stopped\";\n})(InterpreterStatus || (InterpreterStatus = {}));\n\nvar Interpreter =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n /**\r\n * Creates a new Interpreter instance (i.e., service) for the given machine with the provided options, if any.\r\n *\r\n * @param machine The machine to be interpreted\r\n * @param options Interpreter options\r\n */\n function Interpreter(machine, options) {\n if (options === void 0) {\n options = Interpreter.defaultOptions;\n }\n\n var _this = this;\n\n this.machine = machine;\n this.delayedEventsMap = {};\n this.listeners = new Set();\n this.contextListeners = new Set();\n this.stopListeners = new Set();\n this.doneListeners = new Set();\n this.eventListeners = new Set();\n this.sendListeners = new Set();\n /**\r\n * Whether the service is started.\r\n */\n\n this.initialized = false;\n this.status = InterpreterStatus.NotStarted;\n this.children = new Map();\n this.forwardTo = new Set();\n this._outgoingQueue = [];\n /**\r\n * Alias for Interpreter.prototype.start\r\n */\n\n this.init = this.start;\n /**\r\n * Sends an event to the running interpreter to trigger a transition.\r\n *\r\n * An array of events (batched) can be sent as well, which will send all\r\n * batched events to the running interpreter. The listeners will be\r\n * notified only **once** when all events are processed.\r\n *\r\n * @param event The event(s) to send\r\n */\n\n this.send = function (event, payload) {\n if (isArray(event)) {\n _this.batch(event);\n\n return _this.state;\n }\n\n var _event = toSCXMLEvent(toEventObject(event, payload));\n\n if (_this.status === InterpreterStatus.Stopped) {\n // do nothing\n if (!IS_PRODUCTION) {\n warn(false, \"Event \\\"\".concat(_event.name, \"\\\" was sent to stopped service \\\"\").concat(_this.machine.id, \"\\\". This service has already reached its final state, and will not transition.\\nEvent: \").concat(JSON.stringify(_event.data)));\n }\n\n return _this.state;\n }\n\n if (_this.status !== InterpreterStatus.Running && !_this.options.deferEvents) {\n throw new Error(\"Event \\\"\".concat(_event.name, \"\\\" was sent to uninitialized service \\\"\").concat(_this.machine.id // tslint:disable-next-line:max-line-length\n , \"\\\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\\nEvent: \").concat(JSON.stringify(_event.data)));\n }\n\n _this.scheduler.schedule(function () {\n // Forward copy of event to child actors\n _this.forward(_event);\n\n var nextState = _this._nextState(_event);\n\n _this.update(nextState, _event);\n });\n\n return _this._state; // TODO: deprecate (should return void)\n // tslint:disable-next-line:semicolon\n };\n\n this.sendTo = function (event, to, immediate) {\n var isParent = _this.parent && (to === SpecialTargets.Parent || _this.parent.id === to);\n var target = isParent ? _this.parent : isString(to) ? to === SpecialTargets.Internal ? _this : _this.children.get(to) || registry.get(to) : isActor(to) ? to : undefined;\n\n if (!target) {\n if (!isParent) {\n throw new Error(\"Unable to send event to child '\".concat(to, \"' from service '\").concat(_this.id, \"'.\"));\n } // tslint:disable-next-line:no-console\n\n\n if (!IS_PRODUCTION) {\n warn(false, \"Service '\".concat(_this.id, \"' has no parent: unable to send event \").concat(event.type));\n }\n\n return;\n }\n\n if ('machine' in target) {\n // perhaps those events should be rejected in the parent\n // but atm it doesn't have easy access to all of the information that is required to do it reliably\n if (_this.status !== InterpreterStatus.Stopped || _this.parent !== target || // we need to send events to the parent from exit handlers of a machine that reached its final state\n _this.state.done) {\n // Send SCXML events to machines\n var scxmlEvent = __assign(__assign({}, event), {\n name: event.name === error$1 ? \"\".concat(error(_this.id)) : event.name,\n origin: _this.sessionId\n });\n\n if (!immediate && _this.machine.config.predictableActionArguments) {\n _this._outgoingQueue.push([target, scxmlEvent]);\n } else {\n target.send(scxmlEvent);\n }\n }\n } else {\n // Send normal events to other targets\n if (!immediate && _this.machine.config.predictableActionArguments) {\n _this._outgoingQueue.push([target, event.data]);\n } else {\n target.send(event.data);\n }\n }\n };\n\n this._exec = function (action, context, _event, actionFunctionMap) {\n if (actionFunctionMap === void 0) {\n actionFunctionMap = _this.machine.options.actions;\n }\n\n var actionOrExec = action.exec || getActionFunction(action.type, actionFunctionMap);\n var exec = isFunction(actionOrExec) ? actionOrExec : actionOrExec ? actionOrExec.exec : action.exec;\n\n if (exec) {\n try {\n return exec(context, _event.data, !_this.machine.config.predictableActionArguments ? {\n action: action,\n state: _this.state,\n _event: _event\n } : {\n action: action,\n _event: _event\n });\n } catch (err) {\n if (_this.parent) {\n _this.parent.send({\n type: 'xstate.error',\n data: err\n });\n }\n\n throw err;\n }\n }\n\n switch (action.type) {\n case raise:\n {\n // if raise action reached the interpreter then it's a delayed one\n var sendAction_1 = action;\n\n _this.defer(sendAction_1);\n\n break;\n }\n\n case send:\n var sendAction = action;\n\n if (typeof sendAction.delay === 'number') {\n _this.defer(sendAction);\n\n return;\n } else {\n if (sendAction.to) {\n _this.sendTo(sendAction._event, sendAction.to, _event === initEvent);\n } else {\n _this.send(sendAction._event);\n }\n }\n\n break;\n\n case cancel:\n _this.cancel(action.sendId);\n\n break;\n\n case start:\n {\n if (_this.status !== InterpreterStatus.Running) {\n return;\n }\n\n var activity = action.activity; // If the activity will be stopped right after it's started\n // (such as in transient states)\n // don't bother starting the activity.\n\n if ( // in v4 with `predictableActionArguments` invokes are called eagerly when the `this.state` still points to the previous state\n !_this.machine.config.predictableActionArguments && !_this.state.activities[activity.id || activity.type]) {\n break;\n } // Invoked services\n\n\n if (activity.type === ActionTypes.Invoke) {\n var invokeSource = toInvokeSource(activity.src);\n var serviceCreator = _this.machine.options.services ? _this.machine.options.services[invokeSource.type] : undefined;\n var id = activity.id,\n data = activity.data;\n\n if (!IS_PRODUCTION) {\n warn(!('forward' in activity), // tslint:disable-next-line:max-line-length\n \"`forward` property is deprecated (found in invocation of '\".concat(activity.src, \"' in in machine '\").concat(_this.machine.id, \"'). \") + \"Please use `autoForward` instead.\");\n }\n\n var autoForward = 'autoForward' in activity ? activity.autoForward : !!activity.forward;\n\n if (!serviceCreator) {\n // tslint:disable-next-line:no-console\n if (!IS_PRODUCTION) {\n warn(false, \"No service found for invocation '\".concat(activity.src, \"' in machine '\").concat(_this.machine.id, \"'.\"));\n }\n\n return;\n }\n\n var resolvedData = data ? mapContext(data, context, _event) : undefined;\n\n if (typeof serviceCreator === 'string') {\n // TODO: warn\n return;\n }\n\n var source = isFunction(serviceCreator) ? serviceCreator(context, _event.data, {\n data: resolvedData,\n src: invokeSource,\n meta: activity.meta\n }) : serviceCreator;\n\n if (!source) {\n // TODO: warn?\n return;\n }\n\n var options = void 0;\n\n if (isMachine(source)) {\n source = resolvedData ? source.withContext(resolvedData) : source;\n options = {\n autoForward: autoForward\n };\n }\n\n _this.spawn(source, id, options);\n } else {\n _this.spawnActivity(activity);\n }\n\n break;\n }\n\n case stop:\n {\n _this.stopChild(action.activity.id);\n\n break;\n }\n\n case log:\n var _a = action,\n label = _a.label,\n value = _a.value;\n\n if (label) {\n _this.logger(label, value);\n } else {\n _this.logger(value);\n }\n\n break;\n\n default:\n if (!IS_PRODUCTION) {\n warn(false, \"No implementation found for action type '\".concat(action.type, \"'\"));\n }\n\n break;\n }\n };\n\n var resolvedOptions = __assign(__assign({}, Interpreter.defaultOptions), options);\n\n var clock = resolvedOptions.clock,\n logger = resolvedOptions.logger,\n parent = resolvedOptions.parent,\n id = resolvedOptions.id;\n var resolvedId = id !== undefined ? id : machine.id;\n this.id = resolvedId;\n this.logger = logger;\n this.clock = clock;\n this.parent = parent;\n this.options = resolvedOptions;\n this.scheduler = new Scheduler({\n deferEvents: this.options.deferEvents\n });\n this.sessionId = registry.bookId();\n }\n\n Object.defineProperty(Interpreter.prototype, \"initialState\", {\n get: function () {\n var _this = this;\n\n if (this._initialState) {\n return this._initialState;\n }\n\n return provide(this, function () {\n _this._initialState = _this.machine.initialState;\n return _this._initialState;\n });\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(Interpreter.prototype, \"state\", {\n /**\r\n * @deprecated Use `.getSnapshot()` instead.\r\n */\n get: function () {\n if (!IS_PRODUCTION) {\n warn(this.status !== InterpreterStatus.NotStarted, \"Attempted to read state from uninitialized service '\".concat(this.id, \"'. Make sure the service is started first.\"));\n }\n\n return this._state;\n },\n enumerable: false,\n configurable: true\n });\n /**\r\n * Executes the actions of the given state, with that state's `context` and `event`.\r\n *\r\n * @param state The state whose actions will be executed\r\n * @param actionsConfig The action implementations to use\r\n */\n\n Interpreter.prototype.execute = function (state, actionsConfig) {\n var e_1, _a;\n\n try {\n for (var _b = __values(state.actions), _c = _b.next(); !_c.done; _c = _b.next()) {\n var action = _c.value;\n this.exec(action, state, actionsConfig);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n };\n\n Interpreter.prototype.update = function (state, _event) {\n var e_2, _a, e_3, _b, e_4, _c, e_5, _d;\n\n var _this = this; // Attach session ID to state\n\n\n state._sessionid = this.sessionId; // Update state\n\n this._state = state; // Execute actions\n\n if ((!this.machine.config.predictableActionArguments || // this is currently required to execute initial actions as the `initialState` gets cached\n // we can't just recompute it (and execute actions while doing so) because we try to preserve identity of actors created within initial assigns\n _event === initEvent) && this.options.execute) {\n this.execute(this.state);\n } else {\n var item = void 0;\n\n while (item = this._outgoingQueue.shift()) {\n item[0].send(item[1]);\n }\n } // Update children\n\n\n this.children.forEach(function (child) {\n _this.state.children[child.id] = child;\n }); // Dev tools\n\n if (this.devTools) {\n this.devTools.send(_event.data, state);\n } // Execute listeners\n\n\n if (state.event) {\n try {\n for (var _e = __values(this.eventListeners), _f = _e.next(); !_f.done; _f = _e.next()) {\n var listener = _f.value;\n listener(state.event);\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_a = _e.return)) _a.call(_e);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n }\n\n try {\n for (var _g = __values(this.listeners), _h = _g.next(); !_h.done; _h = _g.next()) {\n var listener = _h.value;\n listener(state, state.event);\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (_h && !_h.done && (_b = _g.return)) _b.call(_g);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n\n try {\n for (var _j = __values(this.contextListeners), _k = _j.next(); !_k.done; _k = _j.next()) {\n var contextListener = _k.value;\n contextListener(this.state.context, this.state.history ? this.state.history.context : undefined);\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (_k && !_k.done && (_c = _j.return)) _c.call(_j);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n if (this.state.done) {\n // get final child state node\n var finalChildStateNode = state.configuration.find(function (sn) {\n return sn.type === 'final' && sn.parent === _this.machine;\n });\n var doneData = finalChildStateNode && finalChildStateNode.doneData ? mapContext(finalChildStateNode.doneData, state.context, _event) : undefined;\n this._doneEvent = doneInvoke(this.id, doneData);\n\n try {\n for (var _l = __values(this.doneListeners), _m = _l.next(); !_m.done; _m = _l.next()) {\n var listener = _m.value;\n listener(this._doneEvent);\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (_m && !_m.done && (_d = _l.return)) _d.call(_l);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n this._stop();\n\n this._stopChildren();\n\n registry.free(this.sessionId);\n }\n };\n /*\r\n * Adds a listener that is notified whenever a state transition happens. The listener is called with\r\n * the next state and the event object that caused the state transition.\r\n *\r\n * @param listener The state listener\r\n */\n\n\n Interpreter.prototype.onTransition = function (listener) {\n this.listeners.add(listener); // Send current state to listener\n\n if (this.status === InterpreterStatus.Running) {\n listener(this.state, this.state.event);\n }\n\n return this;\n };\n\n Interpreter.prototype.subscribe = function (nextListenerOrObserver, _, // TODO: error listener\n completeListener) {\n var _this = this;\n\n var observer = toObserver(nextListenerOrObserver, _, completeListener);\n this.listeners.add(observer.next); // Send current state to listener\n\n if (this.status !== InterpreterStatus.NotStarted) {\n observer.next(this.state);\n }\n\n var completeOnce = function () {\n _this.doneListeners.delete(completeOnce);\n\n _this.stopListeners.delete(completeOnce);\n\n observer.complete();\n };\n\n if (this.status === InterpreterStatus.Stopped) {\n observer.complete();\n } else {\n this.onDone(completeOnce);\n this.onStop(completeOnce);\n }\n\n return {\n unsubscribe: function () {\n _this.listeners.delete(observer.next);\n\n _this.doneListeners.delete(completeOnce);\n\n _this.stopListeners.delete(completeOnce);\n }\n };\n };\n /**\r\n * Adds an event listener that is notified whenever an event is sent to the running interpreter.\r\n * @param listener The event listener\r\n */\n\n\n Interpreter.prototype.onEvent = function (listener) {\n this.eventListeners.add(listener);\n return this;\n };\n /**\r\n * Adds an event listener that is notified whenever a `send` event occurs.\r\n * @param listener The event listener\r\n */\n\n\n Interpreter.prototype.onSend = function (listener) {\n this.sendListeners.add(listener);\n return this;\n };\n /**\r\n * Adds a context listener that is notified whenever the state context changes.\r\n * @param listener The context listener\r\n */\n\n\n Interpreter.prototype.onChange = function (listener) {\n this.contextListeners.add(listener);\n return this;\n };\n /**\r\n * Adds a listener that is notified when the machine is stopped.\r\n * @param listener The listener\r\n */\n\n\n Interpreter.prototype.onStop = function (listener) {\n this.stopListeners.add(listener);\n return this;\n };\n /**\r\n * Adds a state listener that is notified when the statechart has reached its final state.\r\n * @param listener The state listener\r\n */\n\n\n Interpreter.prototype.onDone = function (listener) {\n if (this.status === InterpreterStatus.Stopped && this._doneEvent) {\n listener(this._doneEvent);\n } else {\n this.doneListeners.add(listener);\n }\n\n return this;\n };\n /**\r\n * Removes a listener.\r\n * @param listener The listener to remove\r\n */\n\n\n Interpreter.prototype.off = function (listener) {\n this.listeners.delete(listener);\n this.eventListeners.delete(listener);\n this.sendListeners.delete(listener);\n this.stopListeners.delete(listener);\n this.doneListeners.delete(listener);\n this.contextListeners.delete(listener);\n return this;\n };\n /**\r\n * Starts the interpreter from the given state, or the initial state.\r\n * @param initialState The state to start the statechart from\r\n */\n\n\n Interpreter.prototype.start = function (initialState) {\n var _this = this;\n\n if (this.status === InterpreterStatus.Running) {\n // Do not restart the service if it is already started\n return this;\n } // yes, it's a hack but we need the related cache to be populated for some things to work (like delayed transitions)\n // this is usually called by `machine.getInitialState` but if we rehydrate from a state we might bypass this call\n // we also don't want to call this method here as it resolves the full initial state which might involve calling assign actions\n // and that could potentially lead to some unwanted side-effects (even such as creating some rogue actors)\n\n\n this.machine._init();\n\n registry.register(this.sessionId, this);\n this.initialized = true;\n this.status = InterpreterStatus.Running;\n var resolvedState = initialState === undefined ? this.initialState : provide(this, function () {\n return isStateConfig(initialState) ? _this.machine.resolveState(initialState) : _this.machine.resolveState(State.from(initialState, _this.machine.context));\n });\n\n if (this.options.devTools) {\n this.attachDev();\n }\n\n this.scheduler.initialize(function () {\n _this.update(resolvedState, initEvent);\n });\n return this;\n };\n\n Interpreter.prototype._stopChildren = function () {\n // TODO: think about converting those to actions\n this.children.forEach(function (child) {\n if (isFunction(child.stop)) {\n child.stop();\n }\n });\n this.children.clear();\n };\n\n Interpreter.prototype._stop = function () {\n var e_6, _a, e_7, _b, e_8, _c, e_9, _d, e_10, _e;\n\n try {\n for (var _f = __values(this.listeners), _g = _f.next(); !_g.done; _g = _f.next()) {\n var listener = _g.value;\n this.listeners.delete(listener);\n }\n } catch (e_6_1) {\n e_6 = {\n error: e_6_1\n };\n } finally {\n try {\n if (_g && !_g.done && (_a = _f.return)) _a.call(_f);\n } finally {\n if (e_6) throw e_6.error;\n }\n }\n\n try {\n for (var _h = __values(this.stopListeners), _j = _h.next(); !_j.done; _j = _h.next()) {\n var listener = _j.value; // call listener, then remove\n\n listener();\n this.stopListeners.delete(listener);\n }\n } catch (e_7_1) {\n e_7 = {\n error: e_7_1\n };\n } finally {\n try {\n if (_j && !_j.done && (_b = _h.return)) _b.call(_h);\n } finally {\n if (e_7) throw e_7.error;\n }\n }\n\n try {\n for (var _k = __values(this.contextListeners), _l = _k.next(); !_l.done; _l = _k.next()) {\n var listener = _l.value;\n this.contextListeners.delete(listener);\n }\n } catch (e_8_1) {\n e_8 = {\n error: e_8_1\n };\n } finally {\n try {\n if (_l && !_l.done && (_c = _k.return)) _c.call(_k);\n } finally {\n if (e_8) throw e_8.error;\n }\n }\n\n try {\n for (var _m = __values(this.doneListeners), _o = _m.next(); !_o.done; _o = _m.next()) {\n var listener = _o.value;\n this.doneListeners.delete(listener);\n }\n } catch (e_9_1) {\n e_9 = {\n error: e_9_1\n };\n } finally {\n try {\n if (_o && !_o.done && (_d = _m.return)) _d.call(_m);\n } finally {\n if (e_9) throw e_9.error;\n }\n }\n\n if (!this.initialized) {\n // Interpreter already stopped; do nothing\n return this;\n }\n\n this.initialized = false;\n this.status = InterpreterStatus.Stopped;\n this._initialState = undefined;\n\n try {\n // we are going to stop within the current sync frame\n // so we can safely just cancel this here as nothing async should be fired anyway\n for (var _p = __values(Object.keys(this.delayedEventsMap)), _q = _p.next(); !_q.done; _q = _p.next()) {\n var key = _q.value;\n this.clock.clearTimeout(this.delayedEventsMap[key]);\n }\n } catch (e_10_1) {\n e_10 = {\n error: e_10_1\n };\n } finally {\n try {\n if (_q && !_q.done && (_e = _p.return)) _e.call(_p);\n } finally {\n if (e_10) throw e_10.error;\n }\n } // clear everything that might be enqueued\n\n\n this.scheduler.clear();\n this.scheduler = new Scheduler({\n deferEvents: this.options.deferEvents\n });\n };\n /**\r\n * Stops the interpreter and unsubscribe all listeners.\r\n *\r\n * This will also notify the `onStop` listeners.\r\n */\n\n\n Interpreter.prototype.stop = function () {\n // TODO: add warning for stopping non-root interpreters\n var _this = this; // grab the current scheduler as it will be replaced in _stop\n\n\n var scheduler = this.scheduler;\n\n this._stop(); // let what is currently processed to be finished\n\n\n scheduler.schedule(function () {\n var _a;\n\n if ((_a = _this._state) === null || _a === void 0 ? void 0 : _a.done) {\n return;\n } // it feels weird to handle this here but we need to handle this even slightly \"out of band\"\n\n\n var _event = toSCXMLEvent({\n type: 'xstate.stop'\n });\n\n var nextState = provide(_this, function () {\n var exitActions = flatten(__spreadArray([], __read(_this.state.configuration), false).sort(function (a, b) {\n return b.order - a.order;\n }).map(function (stateNode) {\n return toActionObjects(stateNode.onExit, _this.machine.options.actions);\n }));\n\n var _a = __read(resolveActions(_this.machine, _this.state, _this.state.context, _event, [{\n type: 'exit',\n actions: exitActions\n }], _this.machine.config.predictableActionArguments ? _this._exec : undefined, _this.machine.config.predictableActionArguments || _this.machine.config.preserveActionOrder), 2),\n resolvedActions = _a[0],\n updatedContext = _a[1];\n\n var newState = new State({\n value: _this.state.value,\n context: updatedContext,\n _event: _event,\n _sessionid: _this.sessionId,\n historyValue: undefined,\n history: _this.state,\n actions: resolvedActions.filter(function (action) {\n return !isRaisableAction(action);\n }),\n activities: {},\n events: [],\n configuration: [],\n transitions: [],\n children: {},\n done: _this.state.done,\n tags: _this.state.tags,\n machine: _this.machine\n });\n newState.changed = true;\n return newState;\n });\n\n _this.update(nextState, _event);\n\n _this._stopChildren();\n\n registry.free(_this.sessionId);\n });\n return this;\n };\n\n Interpreter.prototype.batch = function (events) {\n var _this = this;\n\n if (this.status === InterpreterStatus.NotStarted && this.options.deferEvents) {\n // tslint:disable-next-line:no-console\n if (!IS_PRODUCTION) {\n warn(false, \"\".concat(events.length, \" event(s) were sent to uninitialized service \\\"\").concat(this.machine.id, \"\\\" and are deferred. Make sure .start() is called for this service.\\nEvent: \").concat(JSON.stringify(event)));\n }\n } else if (this.status !== InterpreterStatus.Running) {\n throw new Error( // tslint:disable-next-line:max-line-length\n \"\".concat(events.length, \" event(s) were sent to uninitialized service \\\"\").concat(this.machine.id, \"\\\". Make sure .start() is called for this service, or set { deferEvents: true } in the service options.\"));\n }\n\n if (!events.length) {\n return;\n }\n\n var exec = !!this.machine.config.predictableActionArguments && this._exec;\n this.scheduler.schedule(function () {\n var e_11, _a;\n\n var nextState = _this.state;\n var batchChanged = false;\n var batchedActions = [];\n\n var _loop_1 = function (event_1) {\n var _event = toSCXMLEvent(event_1);\n\n _this.forward(_event);\n\n nextState = provide(_this, function () {\n return _this.machine.transition(nextState, _event, undefined, exec || undefined);\n });\n batchedActions.push.apply(batchedActions, __spreadArray([], __read(_this.machine.config.predictableActionArguments ? nextState.actions : nextState.actions.map(function (a) {\n return bindActionToState(a, nextState);\n })), false));\n batchChanged = batchChanged || !!nextState.changed;\n };\n\n try {\n for (var events_1 = __values(events), events_1_1 = events_1.next(); !events_1_1.done; events_1_1 = events_1.next()) {\n var event_1 = events_1_1.value;\n\n _loop_1(event_1);\n }\n } catch (e_11_1) {\n e_11 = {\n error: e_11_1\n };\n } finally {\n try {\n if (events_1_1 && !events_1_1.done && (_a = events_1.return)) _a.call(events_1);\n } finally {\n if (e_11) throw e_11.error;\n }\n }\n\n nextState.changed = batchChanged;\n nextState.actions = batchedActions;\n\n _this.update(nextState, toSCXMLEvent(events[events.length - 1]));\n });\n };\n /**\r\n * Returns a send function bound to this interpreter instance.\r\n *\r\n * @param event The event to be sent by the sender.\r\n */\n\n\n Interpreter.prototype.sender = function (event) {\n return this.send.bind(this, event);\n };\n\n Interpreter.prototype._nextState = function (event, exec) {\n var _this = this;\n\n if (exec === void 0) {\n exec = !!this.machine.config.predictableActionArguments && this._exec;\n }\n\n var _event = toSCXMLEvent(event);\n\n if (_event.name.indexOf(errorPlatform) === 0 && !this.state.nextEvents.some(function (nextEvent) {\n return nextEvent.indexOf(errorPlatform) === 0;\n })) {\n throw _event.data.data;\n }\n\n var nextState = provide(this, function () {\n return _this.machine.transition(_this.state, _event, undefined, exec || undefined);\n });\n return nextState;\n };\n /**\r\n * Returns the next state given the interpreter's current state and the event.\r\n *\r\n * This is a pure method that does _not_ update the interpreter's state.\r\n *\r\n * @param event The event to determine the next state\r\n */\n\n\n Interpreter.prototype.nextState = function (event) {\n return this._nextState(event, false);\n };\n\n Interpreter.prototype.forward = function (event) {\n var e_12, _a;\n\n try {\n for (var _b = __values(this.forwardTo), _c = _b.next(); !_c.done; _c = _b.next()) {\n var id = _c.value;\n var child = this.children.get(id);\n\n if (!child) {\n throw new Error(\"Unable to forward event '\".concat(event, \"' from interpreter '\").concat(this.id, \"' to nonexistant child '\").concat(id, \"'.\"));\n }\n\n child.send(event);\n }\n } catch (e_12_1) {\n e_12 = {\n error: e_12_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_12) throw e_12.error;\n }\n }\n };\n\n Interpreter.prototype.defer = function (sendAction) {\n var _this = this;\n\n var timerId = this.clock.setTimeout(function () {\n if ('to' in sendAction && sendAction.to) {\n _this.sendTo(sendAction._event, sendAction.to, true);\n } else {\n _this.send(sendAction._event);\n }\n }, sendAction.delay);\n\n if (sendAction.id) {\n this.delayedEventsMap[sendAction.id] = timerId;\n }\n };\n\n Interpreter.prototype.cancel = function (sendId) {\n this.clock.clearTimeout(this.delayedEventsMap[sendId]);\n delete this.delayedEventsMap[sendId];\n };\n\n Interpreter.prototype.exec = function (action, state, actionFunctionMap) {\n if (actionFunctionMap === void 0) {\n actionFunctionMap = this.machine.options.actions;\n }\n\n this._exec(action, state.context, state._event, actionFunctionMap);\n };\n\n Interpreter.prototype.removeChild = function (childId) {\n var _a;\n\n this.children.delete(childId);\n this.forwardTo.delete(childId); // this.state might not exist at the time this is called,\n // such as when a child is added then removed while initializing the state\n\n (_a = this.state) === null || _a === void 0 ? true : delete _a.children[childId];\n };\n\n Interpreter.prototype.stopChild = function (childId) {\n var child = this.children.get(childId);\n\n if (!child) {\n return;\n }\n\n this.removeChild(childId);\n\n if (isFunction(child.stop)) {\n child.stop();\n }\n };\n\n Interpreter.prototype.spawn = function (entity, name, options) {\n if (this.status !== InterpreterStatus.Running) {\n return createDeferredActor(entity, name);\n }\n\n if (isPromiseLike(entity)) {\n return this.spawnPromise(Promise.resolve(entity), name);\n } else if (isFunction(entity)) {\n return this.spawnCallback(entity, name);\n } else if (isSpawnedActor(entity)) {\n return this.spawnActor(entity, name);\n } else if (isObservable(entity)) {\n return this.spawnObservable(entity, name);\n } else if (isMachine(entity)) {\n return this.spawnMachine(entity, __assign(__assign({}, options), {\n id: name\n }));\n } else if (isBehavior(entity)) {\n return this.spawnBehavior(entity, name);\n } else {\n throw new Error(\"Unable to spawn entity \\\"\".concat(name, \"\\\" of type \\\"\").concat(typeof entity, \"\\\".\"));\n }\n };\n\n Interpreter.prototype.spawnMachine = function (machine, options) {\n var _this = this;\n\n if (options === void 0) {\n options = {};\n }\n\n var childService = new Interpreter(machine, __assign(__assign({}, this.options), {\n parent: this,\n id: options.id || machine.id\n }));\n\n var resolvedOptions = __assign(__assign({}, DEFAULT_SPAWN_OPTIONS), options);\n\n if (resolvedOptions.sync) {\n childService.onTransition(function (state) {\n _this.send(update, {\n state: state,\n id: childService.id\n });\n });\n }\n\n var actor = childService;\n this.children.set(childService.id, actor);\n\n if (resolvedOptions.autoForward) {\n this.forwardTo.add(childService.id);\n }\n\n childService.onDone(function (doneEvent) {\n _this.removeChild(childService.id);\n\n _this.send(toSCXMLEvent(doneEvent, {\n origin: childService.id\n }));\n }).start();\n return actor;\n };\n\n Interpreter.prototype.spawnBehavior = function (behavior, id) {\n var actorRef = spawnBehavior(behavior, {\n id: id,\n parent: this\n });\n this.children.set(id, actorRef);\n return actorRef;\n };\n\n Interpreter.prototype.spawnPromise = function (promise, id) {\n var _a;\n\n var _this = this;\n\n var canceled = false;\n var resolvedData;\n promise.then(function (response) {\n if (!canceled) {\n resolvedData = response;\n\n _this.removeChild(id);\n\n _this.send(toSCXMLEvent(doneInvoke(id, response), {\n origin: id\n }));\n }\n }, function (errorData) {\n if (!canceled) {\n _this.removeChild(id);\n\n var errorEvent = error(id, errorData);\n\n try {\n // Send \"error.platform.id\" to this (parent).\n _this.send(toSCXMLEvent(errorEvent, {\n origin: id\n }));\n } catch (error) {\n reportUnhandledExceptionOnInvocation(errorData, error, id);\n\n if (_this.devTools) {\n _this.devTools.send(errorEvent, _this.state);\n }\n\n if (_this.machine.strict) {\n // it would be better to always stop the state machine if unhandled\n // exception/promise rejection happens but because we don't want to\n // break existing code so enforce it on strict mode only especially so\n // because documentation says that onError is optional\n _this.stop();\n }\n }\n }\n });\n var actor = (_a = {\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function (next, handleError, complete) {\n var observer = toObserver(next, handleError, complete);\n var unsubscribed = false;\n promise.then(function (response) {\n if (unsubscribed) {\n return;\n }\n\n observer.next(response);\n\n if (unsubscribed) {\n return;\n }\n\n observer.complete();\n }, function (err) {\n if (unsubscribed) {\n return;\n }\n\n observer.error(err);\n });\n return {\n unsubscribe: function () {\n return unsubscribed = true;\n }\n };\n },\n stop: function () {\n canceled = true;\n },\n toJSON: function () {\n return {\n id: id\n };\n },\n getSnapshot: function () {\n return resolvedData;\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a);\n this.children.set(id, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnCallback = function (callback, id) {\n var _a;\n\n var _this = this;\n\n var canceled = false;\n var receivers = new Set();\n var listeners = new Set();\n var emitted;\n\n var receive = function (e) {\n emitted = e;\n listeners.forEach(function (listener) {\n return listener(e);\n });\n\n if (canceled) {\n return;\n }\n\n _this.send(toSCXMLEvent(e, {\n origin: id\n }));\n };\n\n var callbackStop;\n\n try {\n callbackStop = callback(receive, function (newListener) {\n receivers.add(newListener);\n });\n } catch (err) {\n this.send(error(id, err));\n }\n\n if (isPromiseLike(callbackStop)) {\n // it turned out to be an async function, can't reliably check this before calling `callback`\n // because transpiled async functions are not recognizable\n return this.spawnPromise(callbackStop, id);\n }\n\n var actor = (_a = {\n id: id,\n send: function (event) {\n return receivers.forEach(function (receiver) {\n return receiver(event);\n });\n },\n subscribe: function (next) {\n var observer = toObserver(next);\n listeners.add(observer.next);\n return {\n unsubscribe: function () {\n listeners.delete(observer.next);\n }\n };\n },\n stop: function () {\n canceled = true;\n\n if (isFunction(callbackStop)) {\n callbackStop();\n }\n },\n toJSON: function () {\n return {\n id: id\n };\n },\n getSnapshot: function () {\n return emitted;\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a);\n this.children.set(id, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnObservable = function (source, id) {\n var _a;\n\n var _this = this;\n\n var emitted;\n var subscription = source.subscribe(function (value) {\n emitted = value;\n\n _this.send(toSCXMLEvent(value, {\n origin: id\n }));\n }, function (err) {\n _this.removeChild(id);\n\n _this.send(toSCXMLEvent(error(id, err), {\n origin: id\n }));\n }, function () {\n _this.removeChild(id);\n\n _this.send(toSCXMLEvent(doneInvoke(id), {\n origin: id\n }));\n });\n var actor = (_a = {\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function (next, handleError, complete) {\n return source.subscribe(next, handleError, complete);\n },\n stop: function () {\n return subscription.unsubscribe();\n },\n getSnapshot: function () {\n return emitted;\n },\n toJSON: function () {\n return {\n id: id\n };\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a);\n this.children.set(id, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnActor = function (actor, name) {\n this.children.set(name, actor);\n return actor;\n };\n\n Interpreter.prototype.spawnActivity = function (activity) {\n var implementation = this.machine.options && this.machine.options.activities ? this.machine.options.activities[activity.type] : undefined;\n\n if (!implementation) {\n if (!IS_PRODUCTION) {\n warn(false, \"No implementation found for activity '\".concat(activity.type, \"'\"));\n } // tslint:disable-next-line:no-console\n\n\n return;\n } // Start implementation\n\n\n var dispose = implementation(this.state.context, activity);\n this.spawnEffect(activity.id, dispose);\n };\n\n Interpreter.prototype.spawnEffect = function (id, dispose) {\n var _a;\n\n this.children.set(id, (_a = {\n id: id,\n send: function () {\n return void 0;\n },\n subscribe: function () {\n return {\n unsubscribe: function () {\n return void 0;\n }\n };\n },\n stop: dispose || undefined,\n getSnapshot: function () {\n return undefined;\n },\n toJSON: function () {\n return {\n id: id\n };\n }\n }, _a[symbolObservable] = function () {\n return this;\n }, _a));\n };\n\n Interpreter.prototype.attachDev = function () {\n var global = getGlobal();\n\n if (this.options.devTools && global) {\n if (global.__REDUX_DEVTOOLS_EXTENSION__) {\n var devToolsOptions = typeof this.options.devTools === 'object' ? this.options.devTools : undefined;\n this.devTools = global.__REDUX_DEVTOOLS_EXTENSION__.connect(__assign(__assign({\n name: this.id,\n autoPause: true,\n stateSanitizer: function (state) {\n return {\n value: state.value,\n context: state.context,\n actions: state.actions\n };\n }\n }, devToolsOptions), {\n features: __assign({\n jump: false,\n skip: false\n }, devToolsOptions ? devToolsOptions.features : undefined)\n }), this.machine);\n this.devTools.init(this.state);\n } // add XState-specific dev tooling hook\n\n\n registerService(this);\n }\n };\n\n Interpreter.prototype.toJSON = function () {\n return {\n id: this.id\n };\n };\n\n Interpreter.prototype[symbolObservable] = function () {\n return this;\n };\n\n Interpreter.prototype.getSnapshot = function () {\n if (this.status === InterpreterStatus.NotStarted) {\n return this.initialState;\n }\n\n return this._state;\n };\n /**\r\n * The default interpreter options:\r\n *\r\n * - `clock` uses the global `setTimeout` and `clearTimeout` functions\r\n * - `logger` uses the global `console.log()` method\r\n */\n\n\n Interpreter.defaultOptions = {\n execute: true,\n deferEvents: true,\n clock: {\n setTimeout: function (fn, ms) {\n return setTimeout(fn, ms);\n },\n clearTimeout: function (id) {\n return clearTimeout(id);\n }\n },\n logger: /*#__PURE__*/console.log.bind(console),\n devTools: false\n };\n Interpreter.interpret = interpret;\n return Interpreter;\n}();\n\nvar resolveSpawnOptions = function (nameOrOptions) {\n if (isString(nameOrOptions)) {\n return __assign(__assign({}, DEFAULT_SPAWN_OPTIONS), {\n name: nameOrOptions\n });\n }\n\n return __assign(__assign(__assign({}, DEFAULT_SPAWN_OPTIONS), {\n name: uniqueId()\n }), nameOrOptions);\n};\n\nfunction spawn(entity, nameOrOptions) {\n var resolvedOptions = resolveSpawnOptions(nameOrOptions);\n return consume(function (service) {\n if (!IS_PRODUCTION) {\n var isLazyEntity = isMachine(entity) || isFunction(entity);\n warn(!!service || isLazyEntity, \"Attempted to spawn an Actor (ID: \\\"\".concat(isMachine(entity) ? entity.id : 'undefined', \"\\\") outside of a service. This will have no effect.\"));\n }\n\n if (service) {\n return service.spawn(entity, resolvedOptions.name, resolvedOptions);\n } else {\n return createDeferredActor(entity, resolvedOptions.name);\n }\n });\n}\n/**\r\n * Creates a new Interpreter instance for the given machine with the provided options, if any.\r\n *\r\n * @param machine The machine to interpret\r\n * @param options Interpreter options\r\n */\n\nfunction interpret(machine, options) {\n var interpreter = new Interpreter(machine, options);\n return interpreter;\n}\n\nexport { Interpreter, InterpreterStatus, interpret, spawn };\n","import { __assign, __rest } from './_virtual/_tslib.js';\nimport './types.js';\nimport { invoke } from './actionTypes.js';\nimport './utils.js';\nimport './environment.js';\n\nfunction toInvokeSource(src) {\n if (typeof src === 'string') {\n var simpleSrc = {\n type: src\n };\n\n simpleSrc.toString = function () {\n return src;\n }; // v4 compat - TODO: remove in v5\n\n\n return simpleSrc;\n }\n\n return src;\n}\nfunction toInvokeDefinition(invokeConfig) {\n return __assign(__assign({\n type: invoke\n }, invokeConfig), {\n toJSON: function () {\n invokeConfig.onDone;\n invokeConfig.onError;\n var invokeDef = __rest(invokeConfig, [\"onDone\", \"onError\"]);\n\n return __assign(__assign({}, invokeDef), {\n type: invoke,\n src: toInvokeSource(invokeConfig.src)\n });\n }\n });\n}\n\nexport { toInvokeDefinition, toInvokeSource };\n","import { __assign, __spreadArray, __read, __values, __rest } from './_virtual/_tslib.js';\nimport { isFunction, mapValues, isArray, flatten, toArray, toStateValue, isString, getEventType, toSCXMLEvent, matchesState, path, evaluateGuard, mapContext, isRaisableAction, pathToStateValue, isBuiltInEvent, partition, updateHistoryValue, toStatePath, mapFilterValues, warn, toStatePaths, nestedPath, normalizeTarget, toGuard, toTransitionConfigArray, isMachine, createInvokeId } from './utils.js';\nimport { State, stateValuesEqual } from './State.js';\nimport { start as start$1, stop as stop$1, invoke, update, nullEvent } from './actionTypes.js';\nimport { done, start, toActionObjects, raise, stop, resolveActions, doneInvoke, error, toActionObject, toActivityDefinition, after, send, cancel, initEvent } from './actions.js';\nimport { IS_PRODUCTION } from './environment.js';\nimport { STATE_DELIMITER } from './constants.js';\nimport { getAllStateNodes, getConfiguration, isInFinalState, getTagsFromConfiguration, has, getChildren, getValue, isLeafNode, getAllChildren } from './stateUtils.js';\nimport { createInvocableActor } from './Actor.js';\nimport { toInvokeDefinition } from './invokeUtils.js';\n\nvar NULL_EVENT = '';\nvar STATE_IDENTIFIER = '#';\nvar WILDCARD = '*';\nvar EMPTY_OBJECT = {};\n\nvar isStateId = function (str) {\n return str[0] === STATE_IDENTIFIER;\n};\n\nvar createDefaultOptions = function () {\n return {\n actions: {},\n guards: {},\n services: {},\n activities: {},\n delays: {}\n };\n};\n\nvar validateArrayifiedTransitions = function (stateNode, event, transitions) {\n var hasNonLastUnguardedTarget = transitions.slice(0, -1).some(function (transition) {\n return !('cond' in transition) && !('in' in transition) && (isString(transition.target) || isMachine(transition.target));\n });\n var eventText = event === NULL_EVENT ? 'the transient event' : \"event '\".concat(event, \"'\");\n warn(!hasNonLastUnguardedTarget, \"One or more transitions for \".concat(eventText, \" on state '\").concat(stateNode.id, \"' are unreachable. \") + \"Make sure that the default transition is the last one defined.\");\n};\n\nvar StateNode =\n/*#__PURE__*/\n\n/** @class */\nfunction () {\n function StateNode(\n /**\r\n * The raw config used to create the machine.\r\n */\n config, options,\n /**\r\n * The initial extended state\r\n */\n _context, // TODO: this is unsafe, but we're removing it in v5 anyway\n _stateInfo) {\n if (_context === void 0) {\n _context = 'context' in config ? config.context : undefined;\n }\n\n var _this = this;\n\n var _a;\n\n this.config = config;\n this._context = _context;\n /**\r\n * The order this state node appears. Corresponds to the implicit SCXML document order.\r\n */\n\n this.order = -1;\n this.__xstatenode = true;\n this.__cache = {\n events: undefined,\n relativeValue: new Map(),\n initialStateValue: undefined,\n initialState: undefined,\n on: undefined,\n transitions: undefined,\n candidates: {},\n delayedTransitions: undefined\n };\n this.idMap = {};\n this.tags = [];\n this.options = Object.assign(createDefaultOptions(), options);\n this.parent = _stateInfo === null || _stateInfo === void 0 ? void 0 : _stateInfo.parent;\n this.key = this.config.key || (_stateInfo === null || _stateInfo === void 0 ? void 0 : _stateInfo.key) || this.config.id || '(machine)';\n this.machine = this.parent ? this.parent.machine : this;\n this.path = this.parent ? this.parent.path.concat(this.key) : [];\n this.delimiter = this.config.delimiter || (this.parent ? this.parent.delimiter : STATE_DELIMITER);\n this.id = this.config.id || __spreadArray([this.machine.key], __read(this.path), false).join(this.delimiter);\n this.version = this.parent ? this.parent.version : this.config.version;\n this.type = this.config.type || (this.config.parallel ? 'parallel' : this.config.states && Object.keys(this.config.states).length ? 'compound' : this.config.history ? 'history' : 'atomic');\n this.schema = this.parent ? this.machine.schema : (_a = this.config.schema) !== null && _a !== void 0 ? _a : {};\n this.description = this.config.description;\n\n if (!IS_PRODUCTION) {\n warn(!('parallel' in this.config), \"The \\\"parallel\\\" property is deprecated and will be removed in version 4.1. \".concat(this.config.parallel ? \"Replace with `type: 'parallel'`\" : \"Use `type: '\".concat(this.type, \"'`\"), \" in the config for state node '\").concat(this.id, \"' instead.\"));\n }\n\n this.initial = this.config.initial;\n this.states = this.config.states ? mapValues(this.config.states, function (stateConfig, key) {\n var _a;\n\n var stateNode = new StateNode(stateConfig, {}, undefined, {\n parent: _this,\n key: key\n });\n Object.assign(_this.idMap, __assign((_a = {}, _a[stateNode.id] = stateNode, _a), stateNode.idMap));\n return stateNode;\n }) : EMPTY_OBJECT; // Document order\n\n var order = 0;\n\n function dfs(stateNode) {\n var e_1, _a;\n\n stateNode.order = order++;\n\n try {\n for (var _b = __values(getAllChildren(stateNode)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var child = _c.value;\n dfs(child);\n }\n } catch (e_1_1) {\n e_1 = {\n error: e_1_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_1) throw e_1.error;\n }\n }\n }\n\n dfs(this); // History config\n\n this.history = this.config.history === true ? 'shallow' : this.config.history || false;\n this._transient = !!this.config.always || (!this.config.on ? false : Array.isArray(this.config.on) ? this.config.on.some(function (_a) {\n var event = _a.event;\n return event === NULL_EVENT;\n }) : NULL_EVENT in this.config.on);\n this.strict = !!this.config.strict; // TODO: deprecate (entry)\n\n this.onEntry = toArray(this.config.entry || this.config.onEntry).map(function (action) {\n return toActionObject(action);\n }); // TODO: deprecate (exit)\n\n this.onExit = toArray(this.config.exit || this.config.onExit).map(function (action) {\n return toActionObject(action);\n });\n this.meta = this.config.meta;\n this.doneData = this.type === 'final' ? this.config.data : undefined;\n this.invoke = toArray(this.config.invoke).map(function (invokeConfig, i) {\n var _a, _b;\n\n if (isMachine(invokeConfig)) {\n var invokeId = createInvokeId(_this.id, i);\n _this.machine.options.services = __assign((_a = {}, _a[invokeId] = invokeConfig, _a), _this.machine.options.services);\n return toInvokeDefinition({\n src: invokeId,\n id: invokeId\n });\n } else if (isString(invokeConfig.src)) {\n var invokeId = invokeConfig.id || createInvokeId(_this.id, i);\n return toInvokeDefinition(__assign(__assign({}, invokeConfig), {\n id: invokeId,\n src: invokeConfig.src\n }));\n } else if (isMachine(invokeConfig.src) || isFunction(invokeConfig.src)) {\n var invokeId = invokeConfig.id || createInvokeId(_this.id, i);\n _this.machine.options.services = __assign((_b = {}, _b[invokeId] = invokeConfig.src, _b), _this.machine.options.services);\n return toInvokeDefinition(__assign(__assign({\n id: invokeId\n }, invokeConfig), {\n src: invokeId\n }));\n } else {\n var invokeSource = invokeConfig.src;\n return toInvokeDefinition(__assign(__assign({\n id: createInvokeId(_this.id, i)\n }, invokeConfig), {\n src: invokeSource\n }));\n }\n });\n this.activities = toArray(this.config.activities).concat(this.invoke).map(function (activity) {\n return toActivityDefinition(activity);\n });\n this.transition = this.transition.bind(this);\n this.tags = toArray(this.config.tags); // TODO: this is the real fix for initialization once\n // state node getters are deprecated\n // if (!this.parent) {\n // this._init();\n // }\n }\n\n StateNode.prototype._init = function () {\n if (this.__cache.transitions) {\n return;\n }\n\n getAllStateNodes(this).forEach(function (stateNode) {\n return stateNode.on;\n });\n };\n /**\r\n * Clones this state machine with custom options and context.\r\n *\r\n * @param options Options (actions, guards, activities, services) to recursively merge with the existing options.\r\n * @param context Custom context (will override predefined context)\r\n */\n\n\n StateNode.prototype.withConfig = function (options, context) {\n var _a = this.options,\n actions = _a.actions,\n activities = _a.activities,\n guards = _a.guards,\n services = _a.services,\n delays = _a.delays;\n return new StateNode(this.config, {\n actions: __assign(__assign({}, actions), options.actions),\n activities: __assign(__assign({}, activities), options.activities),\n guards: __assign(__assign({}, guards), options.guards),\n services: __assign(__assign({}, services), options.services),\n delays: __assign(__assign({}, delays), options.delays)\n }, context !== null && context !== void 0 ? context : this.context);\n };\n /**\r\n * Clones this state machine with custom context.\r\n *\r\n * @param context Custom context (will override predefined context, not recursive)\r\n */\n\n\n StateNode.prototype.withContext = function (context) {\n return new StateNode(this.config, this.options, context);\n };\n\n Object.defineProperty(StateNode.prototype, \"context\", {\n get: function () {\n return isFunction(this._context) ? this._context() : this._context;\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"definition\", {\n /**\r\n * The well-structured state node definition.\r\n */\n get: function () {\n return {\n id: this.id,\n key: this.key,\n version: this.version,\n context: this.context,\n type: this.type,\n initial: this.initial,\n history: this.history,\n states: mapValues(this.states, function (state) {\n return state.definition;\n }),\n on: this.on,\n transitions: this.transitions,\n entry: this.onEntry,\n exit: this.onExit,\n activities: this.activities || [],\n meta: this.meta,\n order: this.order || -1,\n data: this.doneData,\n invoke: this.invoke,\n description: this.description,\n tags: this.tags\n };\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.toJSON = function () {\n return this.definition;\n };\n\n Object.defineProperty(StateNode.prototype, \"on\", {\n /**\r\n * The mapping of events to transitions.\r\n */\n get: function () {\n if (this.__cache.on) {\n return this.__cache.on;\n }\n\n var transitions = this.transitions;\n return this.__cache.on = transitions.reduce(function (map, transition) {\n map[transition.eventType] = map[transition.eventType] || [];\n map[transition.eventType].push(transition);\n return map;\n }, {});\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"after\", {\n get: function () {\n return this.__cache.delayedTransitions || (this.__cache.delayedTransitions = this.getDelayedTransitions(), this.__cache.delayedTransitions);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"transitions\", {\n /**\r\n * All the transitions that can be taken from this state node.\r\n */\n get: function () {\n return this.__cache.transitions || (this.__cache.transitions = this.formatTransitions(), this.__cache.transitions);\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.getCandidates = function (eventName) {\n if (this.__cache.candidates[eventName]) {\n return this.__cache.candidates[eventName];\n }\n\n var transient = eventName === NULL_EVENT;\n var candidates = this.transitions.filter(function (transition) {\n var sameEventType = transition.eventType === eventName; // null events should only match against eventless transitions\n\n return transient ? sameEventType : sameEventType || transition.eventType === WILDCARD;\n });\n this.__cache.candidates[eventName] = candidates;\n return candidates;\n };\n /**\r\n * All delayed transitions from the config.\r\n */\n\n\n StateNode.prototype.getDelayedTransitions = function () {\n var _this = this;\n\n var afterConfig = this.config.after;\n\n if (!afterConfig) {\n return [];\n }\n\n var mutateEntryExit = function (delay, i) {\n var delayRef = isFunction(delay) ? \"\".concat(_this.id, \":delay[\").concat(i, \"]\") : delay;\n var eventType = after(delayRef, _this.id);\n\n _this.onEntry.push(send(eventType, {\n delay: delay\n }));\n\n _this.onExit.push(cancel(eventType));\n\n return eventType;\n };\n\n var delayedTransitions = isArray(afterConfig) ? afterConfig.map(function (transition, i) {\n var eventType = mutateEntryExit(transition.delay, i);\n return __assign(__assign({}, transition), {\n event: eventType\n });\n }) : flatten(Object.keys(afterConfig).map(function (delay, i) {\n var configTransition = afterConfig[delay];\n var resolvedTransition = isString(configTransition) ? {\n target: configTransition\n } : configTransition;\n var resolvedDelay = !isNaN(+delay) ? +delay : delay;\n var eventType = mutateEntryExit(resolvedDelay, i);\n return toArray(resolvedTransition).map(function (transition) {\n return __assign(__assign({}, transition), {\n event: eventType,\n delay: resolvedDelay\n });\n });\n }));\n return delayedTransitions.map(function (delayedTransition) {\n var delay = delayedTransition.delay;\n return __assign(__assign({}, _this.formatTransition(delayedTransition)), {\n delay: delay\n });\n });\n };\n /**\r\n * Returns the state nodes represented by the current state value.\r\n *\r\n * @param state The state value or State instance\r\n */\n\n\n StateNode.prototype.getStateNodes = function (state) {\n var _a;\n\n var _this = this;\n\n if (!state) {\n return [];\n }\n\n var stateValue = state instanceof State ? state.value : toStateValue(state, this.delimiter);\n\n if (isString(stateValue)) {\n var initialStateValue = this.getStateNode(stateValue).initial;\n return initialStateValue !== undefined ? this.getStateNodes((_a = {}, _a[stateValue] = initialStateValue, _a)) : [this, this.states[stateValue]];\n }\n\n var subStateKeys = Object.keys(stateValue);\n var subStateNodes = [this];\n subStateNodes.push.apply(subStateNodes, __spreadArray([], __read(flatten(subStateKeys.map(function (subStateKey) {\n return _this.getStateNode(subStateKey).getStateNodes(stateValue[subStateKey]);\n }))), false));\n return subStateNodes;\n };\n /**\r\n * Returns `true` if this state node explicitly handles the given event.\r\n *\r\n * @param event The event in question\r\n */\n\n\n StateNode.prototype.handles = function (event) {\n var eventType = getEventType(event);\n return this.events.includes(eventType);\n };\n /**\r\n * Resolves the given `state` to a new `State` instance relative to this machine.\r\n *\r\n * This ensures that `.events` and `.nextEvents` represent the correct values.\r\n *\r\n * @param state The state to resolve\r\n */\n\n\n StateNode.prototype.resolveState = function (state) {\n var stateFromConfig = state instanceof State ? state : State.create(state);\n var configuration = Array.from(getConfiguration([], this.getStateNodes(stateFromConfig.value)));\n return new State(__assign(__assign({}, stateFromConfig), {\n value: this.resolve(stateFromConfig.value),\n configuration: configuration,\n done: isInFinalState(configuration, this),\n tags: getTagsFromConfiguration(configuration),\n machine: this.machine\n }));\n };\n\n StateNode.prototype.transitionLeafNode = function (stateValue, state, _event) {\n var stateNode = this.getStateNode(stateValue);\n var next = stateNode.next(state, _event);\n\n if (!next || !next.transitions.length) {\n return this.next(state, _event);\n }\n\n return next;\n };\n\n StateNode.prototype.transitionCompoundNode = function (stateValue, state, _event) {\n var subStateKeys = Object.keys(stateValue);\n var stateNode = this.getStateNode(subStateKeys[0]);\n\n var next = stateNode._transition(stateValue[subStateKeys[0]], state, _event);\n\n if (!next || !next.transitions.length) {\n return this.next(state, _event);\n }\n\n return next;\n };\n\n StateNode.prototype.transitionParallelNode = function (stateValue, state, _event) {\n var e_2, _a;\n\n var transitionMap = {};\n\n try {\n for (var _b = __values(Object.keys(stateValue)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var subStateKey = _c.value;\n var subStateValue = stateValue[subStateKey];\n\n if (!subStateValue) {\n continue;\n }\n\n var subStateNode = this.getStateNode(subStateKey);\n\n var next = subStateNode._transition(subStateValue, state, _event);\n\n if (next) {\n transitionMap[subStateKey] = next;\n }\n }\n } catch (e_2_1) {\n e_2 = {\n error: e_2_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_2) throw e_2.error;\n }\n }\n\n var stateTransitions = Object.keys(transitionMap).map(function (key) {\n return transitionMap[key];\n });\n var enabledTransitions = flatten(stateTransitions.map(function (st) {\n return st.transitions;\n }));\n var willTransition = stateTransitions.some(function (st) {\n return st.transitions.length > 0;\n });\n\n if (!willTransition) {\n return this.next(state, _event);\n }\n\n var configuration = flatten(Object.keys(transitionMap).map(function (key) {\n return transitionMap[key].configuration;\n }));\n return {\n transitions: enabledTransitions,\n exitSet: flatten(stateTransitions.map(function (t) {\n return t.exitSet;\n })),\n configuration: configuration,\n source: state,\n actions: flatten(Object.keys(transitionMap).map(function (key) {\n return transitionMap[key].actions;\n }))\n };\n };\n\n StateNode.prototype._transition = function (stateValue, state, _event) {\n // leaf node\n if (isString(stateValue)) {\n return this.transitionLeafNode(stateValue, state, _event);\n } // hierarchical node\n\n\n if (Object.keys(stateValue).length === 1) {\n return this.transitionCompoundNode(stateValue, state, _event);\n } // orthogonal node\n\n\n return this.transitionParallelNode(stateValue, state, _event);\n };\n\n StateNode.prototype.getTransitionData = function (state, event) {\n return this._transition(state.value, state, toSCXMLEvent(event));\n };\n\n StateNode.prototype.next = function (state, _event) {\n var e_3, _a;\n\n var _this = this;\n\n var eventName = _event.name;\n var actions = [];\n var nextStateNodes = [];\n var selectedTransition;\n\n try {\n for (var _b = __values(this.getCandidates(eventName)), _c = _b.next(); !_c.done; _c = _b.next()) {\n var candidate = _c.value;\n var cond = candidate.cond,\n stateIn = candidate.in;\n var resolvedContext = state.context;\n var isInState = stateIn ? isString(stateIn) && isStateId(stateIn) ? // Check if in state by ID\n state.matches(toStateValue(this.getStateNodeById(stateIn).path, this.delimiter)) : // Check if in state by relative grandparent\n matchesState(toStateValue(stateIn, this.delimiter), path(this.path.slice(0, -2))(state.value)) : true;\n var guardPassed = false;\n\n try {\n guardPassed = !cond || evaluateGuard(this.machine, cond, resolvedContext, _event, state);\n } catch (err) {\n throw new Error(\"Unable to evaluate guard '\".concat(cond.name || cond.type, \"' in transition for event '\").concat(eventName, \"' in state node '\").concat(this.id, \"':\\n\").concat(err.message));\n }\n\n if (guardPassed && isInState) {\n if (candidate.target !== undefined) {\n nextStateNodes = candidate.target;\n }\n\n actions.push.apply(actions, __spreadArray([], __read(candidate.actions), false));\n selectedTransition = candidate;\n break;\n }\n }\n } catch (e_3_1) {\n e_3 = {\n error: e_3_1\n };\n } finally {\n try {\n if (_c && !_c.done && (_a = _b.return)) _a.call(_b);\n } finally {\n if (e_3) throw e_3.error;\n }\n }\n\n if (!selectedTransition) {\n return undefined;\n }\n\n if (!nextStateNodes.length) {\n return {\n transitions: [selectedTransition],\n exitSet: [],\n configuration: state.value ? [this] : [],\n source: state,\n actions: actions\n };\n }\n\n var allNextStateNodes = flatten(nextStateNodes.map(function (stateNode) {\n return _this.getRelativeStateNodes(stateNode, state.historyValue);\n }));\n var isInternal = !!selectedTransition.internal;\n return {\n transitions: [selectedTransition],\n exitSet: isInternal ? [] : flatten(nextStateNodes.map(function (targetNode) {\n return _this.getPotentiallyReenteringNodes(targetNode);\n })),\n configuration: allNextStateNodes,\n source: state,\n actions: actions\n };\n }; // even though the name of this function mentions reentry nodes\n // we are pushing its result into `exitSet`\n // that's because what we exit might be reentered (it's an invariant of reentrancy)\n\n\n StateNode.prototype.getPotentiallyReenteringNodes = function (targetNode) {\n if (this.order < targetNode.order) {\n return [this];\n }\n\n var nodes = [];\n var marker = this;\n var possibleAncestor = targetNode;\n\n while (marker && marker !== possibleAncestor) {\n nodes.push(marker);\n marker = marker.parent;\n }\n\n if (marker !== possibleAncestor) {\n // we never got to `possibleAncestor`, therefore the initial `marker` \"escapes\" it\n // it's in a different part of the tree so no states will be reentered for such an external transition\n return [];\n }\n\n nodes.push(possibleAncestor);\n return nodes;\n };\n\n StateNode.prototype.getActions = function (resolvedConfig, isDone, transition, currentContext, _event, prevState, predictableExec) {\n var e_4, _a, e_5, _b;\n\n var _this = this;\n\n var prevConfig = prevState ? getConfiguration([], this.getStateNodes(prevState.value)) : [];\n var entrySet = new Set();\n\n try {\n for (var _c = __values(Array.from(resolvedConfig).sort(function (a, b) {\n return a.order - b.order;\n })), _d = _c.next(); !_d.done; _d = _c.next()) {\n var sn = _d.value;\n\n if (!has(prevConfig, sn) || has(transition.exitSet, sn) || sn.parent && entrySet.has(sn.parent)) {\n entrySet.add(sn);\n }\n }\n } catch (e_4_1) {\n e_4 = {\n error: e_4_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n } finally {\n if (e_4) throw e_4.error;\n }\n }\n\n try {\n for (var prevConfig_1 = __values(prevConfig), prevConfig_1_1 = prevConfig_1.next(); !prevConfig_1_1.done; prevConfig_1_1 = prevConfig_1.next()) {\n var sn = prevConfig_1_1.value;\n\n if (!has(resolvedConfig, sn) || has(transition.exitSet, sn.parent)) {\n transition.exitSet.push(sn);\n }\n }\n } catch (e_5_1) {\n e_5 = {\n error: e_5_1\n };\n } finally {\n try {\n if (prevConfig_1_1 && !prevConfig_1_1.done && (_b = prevConfig_1.return)) _b.call(prevConfig_1);\n } finally {\n if (e_5) throw e_5.error;\n }\n }\n\n transition.exitSet.sort(function (a, b) {\n return b.order - a.order;\n });\n var entryStates = Array.from(entrySet).sort(function (a, b) {\n return a.order - b.order;\n });\n var exitStates = new Set(transition.exitSet);\n var doneEvents = flatten(entryStates.map(function (sn) {\n var events = [];\n\n if (sn.type !== 'final') {\n return events;\n }\n\n var parent = sn.parent;\n\n if (!parent.parent) {\n return events;\n }\n\n events.push(done(sn.id, sn.doneData), // TODO: deprecate - final states should not emit done events for their own state.\n done(parent.id, sn.doneData ? mapContext(sn.doneData, currentContext, _event) : undefined));\n var grandparent = parent.parent;\n\n if (grandparent.type === 'parallel') {\n if (getChildren(grandparent).every(function (parentNode) {\n return isInFinalState(transition.configuration, parentNode);\n })) {\n events.push(done(grandparent.id));\n }\n }\n\n return events;\n }));\n var entryActions = entryStates.map(function (stateNode) {\n var entryActions = stateNode.onEntry;\n var invokeActions = stateNode.activities.map(function (activity) {\n return start(activity);\n });\n return {\n type: 'entry',\n actions: toActionObjects(predictableExec ? __spreadArray(__spreadArray([], __read(entryActions), false), __read(invokeActions), false) : __spreadArray(__spreadArray([], __read(invokeActions), false), __read(entryActions), false), _this.machine.options.actions)\n };\n }).concat({\n type: 'state_done',\n actions: doneEvents.map(function (event) {\n return raise(event);\n })\n });\n var exitActions = Array.from(exitStates).map(function (stateNode) {\n return {\n type: 'exit',\n actions: toActionObjects(__spreadArray(__spreadArray([], __read(stateNode.onExit), false), __read(stateNode.activities.map(function (activity) {\n return stop(activity);\n })), false), _this.machine.options.actions)\n };\n });\n var actions = exitActions.concat({\n type: 'transition',\n actions: toActionObjects(transition.actions, this.machine.options.actions)\n }).concat(entryActions);\n\n if (isDone) {\n var stopActions = toActionObjects(flatten(__spreadArray([], __read(resolvedConfig), false).sort(function (a, b) {\n return b.order - a.order;\n }).map(function (stateNode) {\n return stateNode.onExit;\n })), this.machine.options.actions).filter(function (action) {\n return !isRaisableAction(action);\n });\n return actions.concat({\n type: 'stop',\n actions: stopActions\n });\n }\n\n return actions;\n };\n /**\r\n * Determines the next state given the current `state` and sent `event`.\r\n *\r\n * @param state The current State instance or state value\r\n * @param event The event that was sent at the current state\r\n * @param context The current context (extended state) of the current state\r\n */\n\n\n StateNode.prototype.transition = function (state, event, context, exec) {\n if (state === void 0) {\n state = this.initialState;\n }\n\n var _event = toSCXMLEvent(event);\n\n var currentState;\n\n if (state instanceof State) {\n currentState = context === undefined ? state : this.resolveState(State.from(state, context));\n } else {\n var resolvedStateValue = isString(state) ? this.resolve(pathToStateValue(this.getResolvedPath(state))) : this.resolve(state);\n var resolvedContext = context !== null && context !== void 0 ? context : this.machine.context;\n currentState = this.resolveState(State.from(resolvedStateValue, resolvedContext));\n }\n\n if (!IS_PRODUCTION && _event.name === WILDCARD) {\n throw new Error(\"An event cannot have the wildcard type ('\".concat(WILDCARD, \"')\"));\n }\n\n if (this.strict) {\n if (!this.events.includes(_event.name) && !isBuiltInEvent(_event.name)) {\n throw new Error(\"Machine '\".concat(this.id, \"' does not accept event '\").concat(_event.name, \"'\"));\n }\n }\n\n var stateTransition = this._transition(currentState.value, currentState, _event) || {\n transitions: [],\n configuration: [],\n exitSet: [],\n source: currentState,\n actions: []\n };\n var prevConfig = getConfiguration([], this.getStateNodes(currentState.value));\n var resolvedConfig = stateTransition.configuration.length ? getConfiguration(prevConfig, stateTransition.configuration) : prevConfig;\n stateTransition.configuration = __spreadArray([], __read(resolvedConfig), false);\n return this.resolveTransition(stateTransition, currentState, currentState.context, exec, _event);\n };\n\n StateNode.prototype.resolveRaisedTransition = function (state, _event, originalEvent, predictableExec) {\n var _a;\n\n var currentActions = state.actions;\n state = this.transition(state, _event, undefined, predictableExec); // Save original event to state\n // TODO: this should be the raised event! Delete in V5 (breaking)\n\n state._event = originalEvent;\n state.event = originalEvent.data;\n\n (_a = state.actions).unshift.apply(_a, __spreadArray([], __read(currentActions), false));\n\n return state;\n };\n\n StateNode.prototype.resolveTransition = function (stateTransition, currentState, context, predictableExec, _event) {\n var e_6, _a, e_7, _b;\n\n var _this = this;\n\n if (_event === void 0) {\n _event = initEvent;\n }\n\n var configuration = stateTransition.configuration; // Transition will \"apply\" if:\n // - this is the initial state (there is no current state)\n // - OR there are transitions\n\n var willTransition = !currentState || stateTransition.transitions.length > 0;\n var resolvedConfiguration = willTransition ? stateTransition.configuration : currentState ? currentState.configuration : [];\n var isDone = isInFinalState(resolvedConfiguration, this);\n var resolvedStateValue = willTransition ? getValue(this.machine, configuration) : undefined;\n var historyValue = currentState ? currentState.historyValue ? currentState.historyValue : stateTransition.source ? this.machine.historyValue(currentState.value) : undefined : undefined;\n var actionBlocks = this.getActions(new Set(resolvedConfiguration), isDone, stateTransition, context, _event, currentState, predictableExec);\n var activities = currentState ? __assign({}, currentState.activities) : {};\n\n try {\n for (var actionBlocks_1 = __values(actionBlocks), actionBlocks_1_1 = actionBlocks_1.next(); !actionBlocks_1_1.done; actionBlocks_1_1 = actionBlocks_1.next()) {\n var block = actionBlocks_1_1.value;\n\n try {\n for (var _c = (e_7 = void 0, __values(block.actions)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var action = _d.value;\n\n if (action.type === start$1) {\n activities[action.activity.id || action.activity.type] = action;\n } else if (action.type === stop$1) {\n activities[action.activity.id || action.activity.type] = false;\n }\n }\n } catch (e_7_1) {\n e_7 = {\n error: e_7_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_b = _c.return)) _b.call(_c);\n } finally {\n if (e_7) throw e_7.error;\n }\n }\n }\n } catch (e_6_1) {\n e_6 = {\n error: e_6_1\n };\n } finally {\n try {\n if (actionBlocks_1_1 && !actionBlocks_1_1.done && (_a = actionBlocks_1.return)) _a.call(actionBlocks_1);\n } finally {\n if (e_6) throw e_6.error;\n }\n }\n\n var _e = __read(resolveActions(this, currentState, context, _event, actionBlocks, predictableExec, this.machine.config.predictableActionArguments || this.machine.config.preserveActionOrder), 2),\n resolvedActions = _e[0],\n updatedContext = _e[1];\n\n var _f = __read(partition(resolvedActions, isRaisableAction), 2),\n raisedEvents = _f[0],\n nonRaisedActions = _f[1];\n\n var invokeActions = resolvedActions.filter(function (action) {\n var _a;\n\n return action.type === start$1 && ((_a = action.activity) === null || _a === void 0 ? void 0 : _a.type) === invoke;\n });\n var children = invokeActions.reduce(function (acc, action) {\n acc[action.activity.id] = createInvocableActor(action.activity, _this.machine, updatedContext, _event);\n return acc;\n }, currentState ? __assign({}, currentState.children) : {});\n var nextState = new State({\n value: resolvedStateValue || currentState.value,\n context: updatedContext,\n _event: _event,\n // Persist _sessionid between states\n _sessionid: currentState ? currentState._sessionid : null,\n historyValue: resolvedStateValue ? historyValue ? updateHistoryValue(historyValue, resolvedStateValue) : undefined : currentState ? currentState.historyValue : undefined,\n history: !resolvedStateValue || stateTransition.source ? currentState : undefined,\n actions: resolvedStateValue ? nonRaisedActions : [],\n activities: resolvedStateValue ? activities : currentState ? currentState.activities : {},\n events: [],\n configuration: resolvedConfiguration,\n transitions: stateTransition.transitions,\n children: children,\n done: isDone,\n tags: getTagsFromConfiguration(resolvedConfiguration),\n machine: this\n });\n var didUpdateContext = context !== updatedContext;\n nextState.changed = _event.name === update || didUpdateContext; // Dispose of penultimate histories to prevent memory leaks\n\n var history = nextState.history;\n\n if (history) {\n delete history.history;\n } // There are transient transitions if the machine is not in a final state\n // and if some of the state nodes have transient (\"always\") transitions.\n\n\n var hasAlwaysTransitions = !isDone && (this._transient || configuration.some(function (stateNode) {\n return stateNode._transient;\n })); // If there are no enabled transitions, check if there are transient transitions.\n // If there are transient transitions, continue checking for more transitions\n // because an transient transition should be triggered even if there are no\n // enabled transitions.\n //\n // If we're already working on an transient transition then stop to prevent an infinite loop.\n //\n // Otherwise, if there are no enabled nor transient transitions, we are done.\n\n if (!willTransition && (!hasAlwaysTransitions || _event.name === NULL_EVENT)) {\n return nextState;\n }\n\n var maybeNextState = nextState;\n\n if (!isDone) {\n if (hasAlwaysTransitions) {\n maybeNextState = this.resolveRaisedTransition(maybeNextState, {\n type: nullEvent\n }, _event, predictableExec);\n }\n\n while (raisedEvents.length) {\n var raisedEvent = raisedEvents.shift();\n maybeNextState = this.resolveRaisedTransition(maybeNextState, raisedEvent._event, _event, predictableExec);\n }\n } // Detect if state changed\n\n\n var changed = maybeNextState.changed || (history ? !!maybeNextState.actions.length || didUpdateContext || typeof history.value !== typeof maybeNextState.value || !stateValuesEqual(maybeNextState.value, history.value) : undefined);\n maybeNextState.changed = changed; // Preserve original history after raised events\n\n maybeNextState.history = history;\n return maybeNextState;\n };\n /**\r\n * Returns the child state node from its relative `stateKey`, or throws.\r\n */\n\n\n StateNode.prototype.getStateNode = function (stateKey) {\n if (isStateId(stateKey)) {\n return this.machine.getStateNodeById(stateKey);\n }\n\n if (!this.states) {\n throw new Error(\"Unable to retrieve child state '\".concat(stateKey, \"' from '\").concat(this.id, \"'; no child states exist.\"));\n }\n\n var result = this.states[stateKey];\n\n if (!result) {\n throw new Error(\"Child state '\".concat(stateKey, \"' does not exist on '\").concat(this.id, \"'\"));\n }\n\n return result;\n };\n /**\r\n * Returns the state node with the given `stateId`, or throws.\r\n *\r\n * @param stateId The state ID. The prefix \"#\" is removed.\r\n */\n\n\n StateNode.prototype.getStateNodeById = function (stateId) {\n var resolvedStateId = isStateId(stateId) ? stateId.slice(STATE_IDENTIFIER.length) : stateId;\n\n if (resolvedStateId === this.id) {\n return this;\n }\n\n var stateNode = this.machine.idMap[resolvedStateId];\n\n if (!stateNode) {\n throw new Error(\"Child state node '#\".concat(resolvedStateId, \"' does not exist on machine '\").concat(this.id, \"'\"));\n }\n\n return stateNode;\n };\n /**\r\n * Returns the relative state node from the given `statePath`, or throws.\r\n *\r\n * @param statePath The string or string array relative path to the state node.\r\n */\n\n\n StateNode.prototype.getStateNodeByPath = function (statePath) {\n if (typeof statePath === 'string' && isStateId(statePath)) {\n try {\n return this.getStateNodeById(statePath.slice(1));\n } catch (e) {// try individual paths\n // throw e;\n }\n }\n\n var arrayStatePath = toStatePath(statePath, this.delimiter).slice();\n var currentStateNode = this;\n\n while (arrayStatePath.length) {\n var key = arrayStatePath.shift();\n\n if (!key.length) {\n break;\n }\n\n currentStateNode = currentStateNode.getStateNode(key);\n }\n\n return currentStateNode;\n };\n /**\r\n * Resolves a partial state value with its full representation in this machine.\r\n *\r\n * @param stateValue The partial state value to resolve.\r\n */\n\n\n StateNode.prototype.resolve = function (stateValue) {\n var _a;\n\n var _this = this;\n\n if (!stateValue) {\n return this.initialStateValue || EMPTY_OBJECT; // TODO: type-specific properties\n }\n\n switch (this.type) {\n case 'parallel':\n return mapValues(this.initialStateValue, function (subStateValue, subStateKey) {\n return subStateValue ? _this.getStateNode(subStateKey).resolve(stateValue[subStateKey] || subStateValue) : EMPTY_OBJECT;\n });\n\n case 'compound':\n if (isString(stateValue)) {\n var subStateNode = this.getStateNode(stateValue);\n\n if (subStateNode.type === 'parallel' || subStateNode.type === 'compound') {\n return _a = {}, _a[stateValue] = subStateNode.initialStateValue, _a;\n }\n\n return stateValue;\n }\n\n if (!Object.keys(stateValue).length) {\n return this.initialStateValue || {};\n }\n\n return mapValues(stateValue, function (subStateValue, subStateKey) {\n return subStateValue ? _this.getStateNode(subStateKey).resolve(subStateValue) : EMPTY_OBJECT;\n });\n\n default:\n return stateValue || EMPTY_OBJECT;\n }\n };\n\n StateNode.prototype.getResolvedPath = function (stateIdentifier) {\n if (isStateId(stateIdentifier)) {\n var stateNode = this.machine.idMap[stateIdentifier.slice(STATE_IDENTIFIER.length)];\n\n if (!stateNode) {\n throw new Error(\"Unable to find state node '\".concat(stateIdentifier, \"'\"));\n }\n\n return stateNode.path;\n }\n\n return toStatePath(stateIdentifier, this.delimiter);\n };\n\n Object.defineProperty(StateNode.prototype, \"initialStateValue\", {\n get: function () {\n var _a;\n\n if (this.__cache.initialStateValue) {\n return this.__cache.initialStateValue;\n }\n\n var initialStateValue;\n\n if (this.type === 'parallel') {\n initialStateValue = mapFilterValues(this.states, function (state) {\n return state.initialStateValue || EMPTY_OBJECT;\n }, function (stateNode) {\n return !(stateNode.type === 'history');\n });\n } else if (this.initial !== undefined) {\n if (!this.states[this.initial]) {\n throw new Error(\"Initial state '\".concat(this.initial, \"' not found on '\").concat(this.key, \"'\"));\n }\n\n initialStateValue = isLeafNode(this.states[this.initial]) ? this.initial : (_a = {}, _a[this.initial] = this.states[this.initial].initialStateValue, _a);\n } else {\n // The finite state value of a machine without child states is just an empty object\n initialStateValue = {};\n }\n\n this.__cache.initialStateValue = initialStateValue;\n return this.__cache.initialStateValue;\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.getInitialState = function (stateValue, context) {\n this._init(); // TODO: this should be in the constructor (see note in constructor)\n\n\n var configuration = this.getStateNodes(stateValue);\n return this.resolveTransition({\n configuration: configuration,\n exitSet: [],\n transitions: [],\n source: undefined,\n actions: []\n }, undefined, context !== null && context !== void 0 ? context : this.machine.context, undefined);\n };\n\n Object.defineProperty(StateNode.prototype, \"initialState\", {\n /**\r\n * The initial State instance, which includes all actions to be executed from\r\n * entering the initial state.\r\n */\n get: function () {\n var initialStateValue = this.initialStateValue;\n\n if (!initialStateValue) {\n throw new Error(\"Cannot retrieve initial state from simple state '\".concat(this.id, \"'.\"));\n }\n\n return this.getInitialState(initialStateValue);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"target\", {\n /**\r\n * The target state value of the history state node, if it exists. This represents the\r\n * default state value to transition to if no history value exists yet.\r\n */\n get: function () {\n var target;\n\n if (this.type === 'history') {\n var historyConfig = this.config;\n\n if (isString(historyConfig.target)) {\n target = isStateId(historyConfig.target) ? pathToStateValue(this.machine.getStateNodeById(historyConfig.target).path.slice(this.path.length - 1)) : historyConfig.target;\n } else {\n target = historyConfig.target;\n }\n }\n\n return target;\n },\n enumerable: false,\n configurable: true\n });\n /**\r\n * Returns the leaf nodes from a state path relative to this state node.\r\n *\r\n * @param relativeStateId The relative state path to retrieve the state nodes\r\n * @param history The previous state to retrieve history\r\n * @param resolve Whether state nodes should resolve to initial child state nodes\r\n */\n\n StateNode.prototype.getRelativeStateNodes = function (relativeStateId, historyValue, resolve) {\n if (resolve === void 0) {\n resolve = true;\n }\n\n return resolve ? relativeStateId.type === 'history' ? relativeStateId.resolveHistory(historyValue) : relativeStateId.initialStateNodes : [relativeStateId];\n };\n\n Object.defineProperty(StateNode.prototype, \"initialStateNodes\", {\n get: function () {\n var _this = this;\n\n if (isLeafNode(this)) {\n return [this];\n } // Case when state node is compound but no initial state is defined\n\n\n if (this.type === 'compound' && !this.initial) {\n if (!IS_PRODUCTION) {\n warn(false, \"Compound state node '\".concat(this.id, \"' has no initial state.\"));\n }\n\n return [this];\n }\n\n var initialStateNodePaths = toStatePaths(this.initialStateValue);\n return flatten(initialStateNodePaths.map(function (initialPath) {\n return _this.getFromRelativePath(initialPath);\n }));\n },\n enumerable: false,\n configurable: true\n });\n /**\r\n * Retrieves state nodes from a relative path to this state node.\r\n *\r\n * @param relativePath The relative path from this state node\r\n * @param historyValue\r\n */\n\n StateNode.prototype.getFromRelativePath = function (relativePath) {\n if (!relativePath.length) {\n return [this];\n }\n\n var _a = __read(relativePath),\n stateKey = _a[0],\n childStatePath = _a.slice(1);\n\n if (!this.states) {\n throw new Error(\"Cannot retrieve subPath '\".concat(stateKey, \"' from node with no states\"));\n }\n\n var childStateNode = this.getStateNode(stateKey);\n\n if (childStateNode.type === 'history') {\n return childStateNode.resolveHistory();\n }\n\n if (!this.states[stateKey]) {\n throw new Error(\"Child state '\".concat(stateKey, \"' does not exist on '\").concat(this.id, \"'\"));\n }\n\n return this.states[stateKey].getFromRelativePath(childStatePath);\n };\n\n StateNode.prototype.historyValue = function (relativeStateValue) {\n if (!Object.keys(this.states).length) {\n return undefined;\n }\n\n return {\n current: relativeStateValue || this.initialStateValue,\n states: mapFilterValues(this.states, function (stateNode, key) {\n if (!relativeStateValue) {\n return stateNode.historyValue();\n }\n\n var subStateValue = isString(relativeStateValue) ? undefined : relativeStateValue[key];\n return stateNode.historyValue(subStateValue || stateNode.initialStateValue);\n }, function (stateNode) {\n return !stateNode.history;\n })\n };\n };\n /**\r\n * Resolves to the historical value(s) of the parent state node,\r\n * represented by state nodes.\r\n *\r\n * @param historyValue\r\n */\n\n\n StateNode.prototype.resolveHistory = function (historyValue) {\n var _this = this;\n\n if (this.type !== 'history') {\n return [this];\n }\n\n var parent = this.parent;\n\n if (!historyValue) {\n var historyTarget = this.target;\n return historyTarget ? flatten(toStatePaths(historyTarget).map(function (relativeChildPath) {\n return parent.getFromRelativePath(relativeChildPath);\n })) : parent.initialStateNodes;\n }\n\n var subHistoryValue = nestedPath(parent.path, 'states')(historyValue).current;\n\n if (isString(subHistoryValue)) {\n return [parent.getStateNode(subHistoryValue)];\n }\n\n return flatten(toStatePaths(subHistoryValue).map(function (subStatePath) {\n return _this.history === 'deep' ? parent.getFromRelativePath(subStatePath) : [parent.states[subStatePath[0]]];\n }));\n };\n\n Object.defineProperty(StateNode.prototype, \"stateIds\", {\n /**\r\n * All the state node IDs of this state node and its descendant state nodes.\r\n */\n get: function () {\n var _this = this;\n\n var childStateIds = flatten(Object.keys(this.states).map(function (stateKey) {\n return _this.states[stateKey].stateIds;\n }));\n return [this.id].concat(childStateIds);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"events\", {\n /**\r\n * All the event types accepted by this state node and its descendants.\r\n */\n get: function () {\n var e_8, _a, e_9, _b;\n\n if (this.__cache.events) {\n return this.__cache.events;\n }\n\n var states = this.states;\n var events = new Set(this.ownEvents);\n\n if (states) {\n try {\n for (var _c = __values(Object.keys(states)), _d = _c.next(); !_d.done; _d = _c.next()) {\n var stateId = _d.value;\n var state = states[stateId];\n\n if (state.states) {\n try {\n for (var _e = (e_9 = void 0, __values(state.events)), _f = _e.next(); !_f.done; _f = _e.next()) {\n var event_1 = _f.value;\n events.add(\"\".concat(event_1));\n }\n } catch (e_9_1) {\n e_9 = {\n error: e_9_1\n };\n } finally {\n try {\n if (_f && !_f.done && (_b = _e.return)) _b.call(_e);\n } finally {\n if (e_9) throw e_9.error;\n }\n }\n }\n }\n } catch (e_8_1) {\n e_8 = {\n error: e_8_1\n };\n } finally {\n try {\n if (_d && !_d.done && (_a = _c.return)) _a.call(_c);\n } finally {\n if (e_8) throw e_8.error;\n }\n }\n }\n\n return this.__cache.events = Array.from(events);\n },\n enumerable: false,\n configurable: true\n });\n Object.defineProperty(StateNode.prototype, \"ownEvents\", {\n /**\r\n * All the events that have transitions directly from this state node.\r\n *\r\n * Excludes any inert events.\r\n */\n get: function () {\n var events = new Set(this.transitions.filter(function (transition) {\n return !(!transition.target && !transition.actions.length && transition.internal);\n }).map(function (transition) {\n return transition.eventType;\n }));\n return Array.from(events);\n },\n enumerable: false,\n configurable: true\n });\n\n StateNode.prototype.resolveTarget = function (_target) {\n var _this = this;\n\n if (_target === undefined) {\n // an undefined target signals that the state node should not transition from that state when receiving that event\n return undefined;\n }\n\n return _target.map(function (target) {\n if (!isString(target)) {\n return target;\n }\n\n var isInternalTarget = target[0] === _this.delimiter; // If internal target is defined on machine,\n // do not include machine key on target\n\n if (isInternalTarget && !_this.parent) {\n return _this.getStateNodeByPath(target.slice(1));\n }\n\n var resolvedTarget = isInternalTarget ? _this.key + target : target;\n\n if (_this.parent) {\n try {\n var targetStateNode = _this.parent.getStateNodeByPath(resolvedTarget);\n\n return targetStateNode;\n } catch (err) {\n throw new Error(\"Invalid transition definition for state node '\".concat(_this.id, \"':\\n\").concat(err.message));\n }\n } else {\n return _this.getStateNodeByPath(resolvedTarget);\n }\n });\n };\n\n StateNode.prototype.formatTransition = function (transitionConfig) {\n var _this = this;\n\n var normalizedTarget = normalizeTarget(transitionConfig.target);\n var internal = 'internal' in transitionConfig ? transitionConfig.internal : normalizedTarget ? normalizedTarget.some(function (_target) {\n return isString(_target) && _target[0] === _this.delimiter;\n }) : true;\n var guards = this.machine.options.guards;\n var target = this.resolveTarget(normalizedTarget);\n\n var transition = __assign(__assign({}, transitionConfig), {\n actions: toActionObjects(toArray(transitionConfig.actions)),\n cond: toGuard(transitionConfig.cond, guards),\n target: target,\n source: this,\n internal: internal,\n eventType: transitionConfig.event,\n toJSON: function () {\n return __assign(__assign({}, transition), {\n target: transition.target ? transition.target.map(function (t) {\n return \"#\".concat(t.id);\n }) : undefined,\n source: \"#\".concat(_this.id)\n });\n }\n });\n\n return transition;\n };\n\n StateNode.prototype.formatTransitions = function () {\n var e_10, _a;\n\n var _this = this;\n\n var onConfig;\n\n if (!this.config.on) {\n onConfig = [];\n } else if (Array.isArray(this.config.on)) {\n onConfig = this.config.on;\n } else {\n var _b = this.config.on,\n _c = WILDCARD,\n _d = _b[_c],\n wildcardConfigs = _d === void 0 ? [] : _d,\n strictTransitionConfigs_1 = __rest(_b, [typeof _c === \"symbol\" ? _c : _c + \"\"]);\n\n onConfig = flatten(Object.keys(strictTransitionConfigs_1).map(function (key) {\n if (!IS_PRODUCTION && key === NULL_EVENT) {\n warn(false, \"Empty string transition configs (e.g., `{ on: { '': ... }}`) for transient transitions are deprecated. Specify the transition in the `{ always: ... }` property instead. \" + \"Please check the `on` configuration for \\\"#\".concat(_this.id, \"\\\".\"));\n }\n\n var transitionConfigArray = toTransitionConfigArray(key, strictTransitionConfigs_1[key]);\n\n if (!IS_PRODUCTION) {\n validateArrayifiedTransitions(_this, key, transitionConfigArray);\n }\n\n return transitionConfigArray;\n }).concat(toTransitionConfigArray(WILDCARD, wildcardConfigs)));\n }\n\n var eventlessConfig = this.config.always ? toTransitionConfigArray('', this.config.always) : [];\n var doneConfig = this.config.onDone ? toTransitionConfigArray(String(done(this.id)), this.config.onDone) : [];\n\n if (!IS_PRODUCTION) {\n warn(!(this.config.onDone && !this.parent), \"Root nodes cannot have an \\\".onDone\\\" transition. Please check the config of \\\"\".concat(this.id, \"\\\".\"));\n }\n\n var invokeConfig = flatten(this.invoke.map(function (invokeDef) {\n var settleTransitions = [];\n\n if (invokeDef.onDone) {\n settleTransitions.push.apply(settleTransitions, __spreadArray([], __read(toTransitionConfigArray(String(doneInvoke(invokeDef.id)), invokeDef.onDone)), false));\n }\n\n if (invokeDef.onError) {\n settleTransitions.push.apply(settleTransitions, __spreadArray([], __read(toTransitionConfigArray(String(error(invokeDef.id)), invokeDef.onError)), false));\n }\n\n return settleTransitions;\n }));\n var delayedTransitions = this.after;\n var formattedTransitions = flatten(__spreadArray(__spreadArray(__spreadArray(__spreadArray([], __read(doneConfig), false), __read(invokeConfig), false), __read(onConfig), false), __read(eventlessConfig), false).map(function (transitionConfig) {\n return toArray(transitionConfig).map(function (transition) {\n return _this.formatTransition(transition);\n });\n }));\n\n try {\n for (var delayedTransitions_1 = __values(delayedTransitions), delayedTransitions_1_1 = delayedTransitions_1.next(); !delayedTransitions_1_1.done; delayedTransitions_1_1 = delayedTransitions_1.next()) {\n var delayedTransition = delayedTransitions_1_1.value;\n formattedTransitions.push(delayedTransition);\n }\n } catch (e_10_1) {\n e_10 = {\n error: e_10_1\n };\n } finally {\n try {\n if (delayedTransitions_1_1 && !delayedTransitions_1_1.done && (_a = delayedTransitions_1.return)) _a.call(delayedTransitions_1);\n } finally {\n if (e_10) throw e_10.error;\n }\n }\n\n return formattedTransitions;\n };\n\n return StateNode;\n}();\n\nexport { StateNode };\n","import { StateNode } from './StateNode.js';\nimport { IS_PRODUCTION } from './environment.js';\n\nvar warned = false;\nfunction Machine(config, options, initialContext) {\n if (initialContext === void 0) {\n initialContext = config.context;\n }\n\n return new StateNode(config, options, initialContext);\n}\nfunction createMachine(config, options) {\n if (!IS_PRODUCTION && !('predictableActionArguments' in config) && !warned) {\n warned = true;\n console.warn('It is highly recommended to set `predictableActionArguments` to `true` when using `createMachine`. https://xstate.js.org/docs/guides/actions.html');\n }\n\n return new StateNode(config, options);\n}\n\nexport { Machine, createMachine };\n","import { assign as assign$1, cancel as cancel$1, send as send$1, sendTo as sendTo$1, sendParent as sendParent$1, sendUpdate as sendUpdate$1, forwardTo as forwardTo$1, doneInvoke as doneInvoke$1, raise as raise$1, log as log$1, pure as pure$1, choose as choose$1, stop as stop$1 } from './actions.js';\nimport * as actions from './actions.js';\nexport { actions };\nexport { toActorRef } from './Actor.js';\nexport { Interpreter, InterpreterStatus, interpret, spawn } from './interpreter.js';\nexport { Machine, createMachine } from './Machine.js';\nexport { mapState } from './mapState.js';\nexport { matchState } from './match.js';\nexport { createSchema, t } from './schema.js';\nexport { State } from './State.js';\nexport { StateNode } from './StateNode.js';\nexport { spawnBehavior } from './behaviors.js';\nexport { ActionTypes, SpecialTargets } from './types.js';\nexport { matchesState, toEventObject, toObserver, toSCXMLEvent } from './utils.js';\n\nvar assign = assign$1,\n cancel = cancel$1,\n send = send$1,\n sendTo = sendTo$1,\n sendParent = sendParent$1,\n sendUpdate = sendUpdate$1,\n forwardTo = forwardTo$1,\n doneInvoke = doneInvoke$1,\n raise = raise$1,\n log = log$1,\n pure = pure$1,\n choose = choose$1,\n stop = stop$1;\n\nexport { assign, cancel, choose, doneInvoke, forwardTo, log, pure, raise, send, sendParent, sendTo, sendUpdate, stop };\n","import{__awaiter as e}from\"tslib\";import{Auth as r}from\"aws-amplify\";import{actions as t}from\"xstate\";import\"../../types/authenticator/user.mjs\";import\"../../types/authenticator/attributes.mjs\";import\"../../types/primitives/componentClassName.mjs\";import\"../../i18n/translations.mjs\";import{trimValues as a}from\"../../helpers/authenticator/utils.mjs\";import\"../../helpers/accountSettings/utils.mjs\";const{assign:o,stop:s}=t,n=e=>s(e),i=o({attributeToVerify:e=>{}}),u=o({challengeName:e=>{}}),m=o({requiredAttributes:e=>{}}),l=o({remoteError:e=>\"\"}),d=o({formValues:e=>({})}),c=o({touched:e=>({})}),p=o({unverifiedContactMethods:e=>{}}),f=o({username:e=>{}}),v=o({validationError:e=>({})}),h=o({totpSecretCode:(e,r)=>r.data}),g=o({challengeName:(e,r)=>{var t;return null===(t=r.data)||void 0===t?void 0:t.challengeName}}),b=o({requiredAttributes:(e,r)=>{var t,a;return null===(a=null===(t=r.data)||void 0===t?void 0:t.challengeParam)||void 0===a?void 0:a.requiredAttributes}}),V=o({redirectIntent:e=>\"confirmPasswordReset\"}),j=o({redirectIntent:e=>\"confirmSignUp\"}),y=o({authAttributes:(e,r)=>{var t,a;const[o]=e.loginMechanisms;return{username:null!==(t=e.formValues[o])&&void 0!==t?t:e.formValues.username,password:null===(a=e.formValues)||void 0===a?void 0:a.password}}}),O=o({validationError:(e,r)=>r.data}),_=o({remoteError:(e,r)=>{var t;return\"NoUserPoolError\"===r.data.name?\"Configuration error (see console) – please contact the administrator\":(null===(t=r.data)||void 0===t?void 0:t.message)||r.data}}),w=o({unverifiedContactMethods:(e,r)=>r.data.unverified}),A=o({user:(e,r)=>r.data.user||r.data}),C=o({username:(e,r)=>{let{formValues:{username:t,country_code:a}}=e;return a&&(t=`${a}${t}`),t}}),E=o({codeDeliveryDetails:(e,r)=>r.data.codeDeliveryDetails}),N=o({authAttributes:(e,r)=>({username:e.formValues.username})}),$=o({formValues:(e,r)=>{const{name:t,value:a}=r.data;return Object.assign(Object.assign({},e.formValues),{[t]:a})}}),D=o({formValues:(e,r)=>{const t=Object.assign(Object.assign({},e.formValues),r.data);return a(t,\"password\")}}),M=o({touched:(e,r)=>{const{name:t}=r.data;return Object.assign(Object.assign({},e.touched),{[`${t}`]:!0})}}),P=t=>e(void 0,void 0,void 0,(function*(){const{username:e}=t;return yield r.forgotPassword(e)})),q=o({formValues:(e,r)=>{var t;const[a=\"username\"]=e.loginMechanisms;if(!e.formValues.phone_number&&\"phone_number\"!==a)return e.formValues;const{formValues:o,country_code:s}=e,n=o.phone_number?\"phone_number\":\"username\",i=`${null!==(t=o.country_code)&&void 0!==t?t:s}${o[n]}`.replace(/[^A-Z0-9+]/gi,\"\"),u=Object.assign(Object.assign({},o),{[n]:i});return delete u.country_code,u}});export{i as clearAttributeToVerify,u as clearChallengeName,l as clearError,d as clearFormValues,m as clearRequiredAttributes,c as clearTouched,p as clearUnverifiedContactMethods,f as clearUsername,v as clearValidationError,M as handleBlur,$ as handleInput,D as handleSubmit,q as parsePhoneNumber,P as resendCode,g as setChallengeName,E as setCodeDeliveryDetails,V as setConfirmResetPasswordIntent,j as setConfirmSignUpIntent,y as setCredentials,O as setFieldErrors,_ as setRemoteError,b as setRequiredAttributes,h as setTotpSecretCode,w as setUnverifiedContactMethods,A as setUser,C as setUsername,N as setUsernameAuthAttributes,n as stopActor};\n","var getNative = require('./_getNative');\n\nvar defineProperty = (function() {\n try {\n var func = getNative(Object, 'defineProperty');\n func({}, '', {});\n return func;\n } catch (e) {}\n}());\n\nmodule.exports = defineProperty;\n","var defineProperty = require('./_defineProperty');\n\n/**\n * The base implementation of `assignValue` and `assignMergeValue` without\n * value checks.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction baseAssignValue(object, key, value) {\n if (key == '__proto__' && defineProperty) {\n defineProperty(object, key, {\n 'configurable': true,\n 'enumerable': true,\n 'value': value,\n 'writable': true\n });\n } else {\n object[key] = value;\n }\n}\n\nmodule.exports = baseAssignValue;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/**\n * This function is like `assignValue` except that it doesn't assign\n * `undefined` values.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignMergeValue(object, key, value) {\n if ((value !== undefined && !eq(object[key], value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignMergeValue;\n","/**\n * Creates a base function for methods like `_.forIn` and `_.forOwn`.\n *\n * @private\n * @param {boolean} [fromRight] Specify iterating from right to left.\n * @returns {Function} Returns the new base function.\n */\nfunction createBaseFor(fromRight) {\n return function(object, iteratee, keysFunc) {\n var index = -1,\n iterable = Object(object),\n props = keysFunc(object),\n length = props.length;\n\n while (length--) {\n var key = props[fromRight ? length : ++index];\n if (iteratee(iterable[key], key, iterable) === false) {\n break;\n }\n }\n return object;\n };\n}\n\nmodule.exports = createBaseFor;\n","var createBaseFor = require('./_createBaseFor');\n\n/**\n * The base implementation of `baseForOwn` which iterates over `object`\n * properties returned by `keysFunc` and invokes `iteratee` for each property.\n * Iteratee functions may exit iteration early by explicitly returning `false`.\n *\n * @private\n * @param {Object} object The object to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {Function} keysFunc The function to get the keys of `object`.\n * @returns {Object} Returns `object`.\n */\nvar baseFor = createBaseFor();\n\nmodule.exports = baseFor;\n","var root = require('./_root');\n\n/** Detect free variable `exports`. */\nvar freeExports = typeof exports == 'object' && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Built-in value references. */\nvar Buffer = moduleExports ? root.Buffer : undefined,\n allocUnsafe = Buffer ? Buffer.allocUnsafe : undefined;\n\n/**\n * Creates a clone of `buffer`.\n *\n * @private\n * @param {Buffer} buffer The buffer to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Buffer} Returns the cloned buffer.\n */\nfunction cloneBuffer(buffer, isDeep) {\n if (isDeep) {\n return buffer.slice();\n }\n var length = buffer.length,\n result = allocUnsafe ? allocUnsafe(length) : new buffer.constructor(length);\n\n buffer.copy(result);\n return result;\n}\n\nmodule.exports = cloneBuffer;\n","var Uint8Array = require('./_Uint8Array');\n\n/**\n * Creates a clone of `arrayBuffer`.\n *\n * @private\n * @param {ArrayBuffer} arrayBuffer The array buffer to clone.\n * @returns {ArrayBuffer} Returns the cloned array buffer.\n */\nfunction cloneArrayBuffer(arrayBuffer) {\n var result = new arrayBuffer.constructor(arrayBuffer.byteLength);\n new Uint8Array(result).set(new Uint8Array(arrayBuffer));\n return result;\n}\n\nmodule.exports = cloneArrayBuffer;\n","var cloneArrayBuffer = require('./_cloneArrayBuffer');\n\n/**\n * Creates a clone of `typedArray`.\n *\n * @private\n * @param {Object} typedArray The typed array to clone.\n * @param {boolean} [isDeep] Specify a deep clone.\n * @returns {Object} Returns the cloned typed array.\n */\nfunction cloneTypedArray(typedArray, isDeep) {\n var buffer = isDeep ? cloneArrayBuffer(typedArray.buffer) : typedArray.buffer;\n return new typedArray.constructor(buffer, typedArray.byteOffset, typedArray.length);\n}\n\nmodule.exports = cloneTypedArray;\n","/**\n * Copies the values of `source` to `array`.\n *\n * @private\n * @param {Array} source The array to copy values from.\n * @param {Array} [array=[]] The array to copy values to.\n * @returns {Array} Returns `array`.\n */\nfunction copyArray(source, array) {\n var index = -1,\n length = source.length;\n\n array || (array = Array(length));\n while (++index < length) {\n array[index] = source[index];\n }\n return array;\n}\n\nmodule.exports = copyArray;\n","var isObject = require('./isObject');\n\n/** Built-in value references. */\nvar objectCreate = Object.create;\n\n/**\n * The base implementation of `_.create` without support for assigning\n * properties to the created object.\n *\n * @private\n * @param {Object} proto The object to inherit from.\n * @returns {Object} Returns the new object.\n */\nvar baseCreate = (function() {\n function object() {}\n return function(proto) {\n if (!isObject(proto)) {\n return {};\n }\n if (objectCreate) {\n return objectCreate(proto);\n }\n object.prototype = proto;\n var result = new object;\n object.prototype = undefined;\n return result;\n };\n}());\n\nmodule.exports = baseCreate;\n","var overArg = require('./_overArg');\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n","var baseCreate = require('./_baseCreate'),\n getPrototype = require('./_getPrototype'),\n isPrototype = require('./_isPrototype');\n\n/**\n * Initializes an object clone.\n *\n * @private\n * @param {Object} object The object to clone.\n * @returns {Object} Returns the initialized clone.\n */\nfunction initCloneObject(object) {\n return (typeof object.constructor == 'function' && !isPrototype(object))\n ? baseCreate(getPrototype(object))\n : {};\n}\n\nmodule.exports = initCloneObject;\n","var isArrayLike = require('./isArrayLike'),\n isObjectLike = require('./isObjectLike');\n\n/**\n * This method is like `_.isArrayLike` except that it also checks if `value`\n * is an object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array-like object,\n * else `false`.\n * @example\n *\n * _.isArrayLikeObject([1, 2, 3]);\n * // => true\n *\n * _.isArrayLikeObject(document.body.children);\n * // => true\n *\n * _.isArrayLikeObject('abc');\n * // => false\n *\n * _.isArrayLikeObject(_.noop);\n * // => false\n */\nfunction isArrayLikeObject(value) {\n return isObjectLike(value) && isArrayLike(value);\n}\n\nmodule.exports = isArrayLikeObject;\n","var baseGetTag = require('./_baseGetTag'),\n getPrototype = require('./_getPrototype'),\n isObjectLike = require('./isObjectLike');\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n","/**\n * Gets the value at `key`, unless `key` is \"__proto__\" or \"constructor\".\n *\n * @private\n * @param {Object} object The object to query.\n * @param {string} key The key of the property to get.\n * @returns {*} Returns the property value.\n */\nfunction safeGet(object, key) {\n if (key === 'constructor' && typeof object[key] === 'function') {\n return;\n }\n\n if (key == '__proto__') {\n return;\n }\n\n return object[key];\n}\n\nmodule.exports = safeGet;\n","var baseAssignValue = require('./_baseAssignValue'),\n eq = require('./eq');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Assigns `value` to `key` of `object` if the existing value is not equivalent\n * using [`SameValueZero`](http://ecma-international.org/ecma-262/7.0/#sec-samevaluezero)\n * for equality comparisons.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {string} key The key of the property to assign.\n * @param {*} value The value to assign.\n */\nfunction assignValue(object, key, value) {\n var objValue = object[key];\n if (!(hasOwnProperty.call(object, key) && eq(objValue, value)) ||\n (value === undefined && !(key in object))) {\n baseAssignValue(object, key, value);\n }\n}\n\nmodule.exports = assignValue;\n","var assignValue = require('./_assignValue'),\n baseAssignValue = require('./_baseAssignValue');\n\n/**\n * Copies properties of `source` to `object`.\n *\n * @private\n * @param {Object} source The object to copy properties from.\n * @param {Array} props The property identifiers to copy.\n * @param {Object} [object={}] The object to copy properties to.\n * @param {Function} [customizer] The function to customize copied values.\n * @returns {Object} Returns `object`.\n */\nfunction copyObject(source, props, object, customizer) {\n var isNew = !object;\n object || (object = {});\n\n var index = -1,\n length = props.length;\n\n while (++index < length) {\n var key = props[index];\n\n var newValue = customizer\n ? customizer(object[key], source[key], key, object, source)\n : undefined;\n\n if (newValue === undefined) {\n newValue = source[key];\n }\n if (isNew) {\n baseAssignValue(object, key, newValue);\n } else {\n assignValue(object, key, newValue);\n }\n }\n return object;\n}\n\nmodule.exports = copyObject;\n","/**\n * This function is like\n * [`Object.keys`](http://ecma-international.org/ecma-262/7.0/#sec-object.keys)\n * except that it includes inherited enumerable properties.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction nativeKeysIn(object) {\n var result = [];\n if (object != null) {\n for (var key in Object(object)) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = nativeKeysIn;\n","var isObject = require('./isObject'),\n isPrototype = require('./_isPrototype'),\n nativeKeysIn = require('./_nativeKeysIn');\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * The base implementation of `_.keysIn` which doesn't treat sparse arrays as dense.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n */\nfunction baseKeysIn(object) {\n if (!isObject(object)) {\n return nativeKeysIn(object);\n }\n var isProto = isPrototype(object),\n result = [];\n\n for (var key in object) {\n if (!(key == 'constructor' && (isProto || !hasOwnProperty.call(object, key)))) {\n result.push(key);\n }\n }\n return result;\n}\n\nmodule.exports = baseKeysIn;\n","var arrayLikeKeys = require('./_arrayLikeKeys'),\n baseKeysIn = require('./_baseKeysIn'),\n isArrayLike = require('./isArrayLike');\n\n/**\n * Creates an array of the own and inherited enumerable property names of `object`.\n *\n * **Note:** Non-object values are coerced to objects.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.keysIn(new Foo);\n * // => ['a', 'b', 'c'] (iteration order is not guaranteed)\n */\nfunction keysIn(object) {\n return isArrayLike(object) ? arrayLikeKeys(object, true) : baseKeysIn(object);\n}\n\nmodule.exports = keysIn;\n","var copyObject = require('./_copyObject'),\n keysIn = require('./keysIn');\n\n/**\n * Converts `value` to a plain object flattening inherited enumerable string\n * keyed properties of `value` to own properties of the plain object.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to convert.\n * @returns {Object} Returns the converted plain object.\n * @example\n *\n * function Foo() {\n * this.b = 2;\n * }\n *\n * Foo.prototype.c = 3;\n *\n * _.assign({ 'a': 1 }, new Foo);\n * // => { 'a': 1, 'b': 2 }\n *\n * _.assign({ 'a': 1 }, _.toPlainObject(new Foo));\n * // => { 'a': 1, 'b': 2, 'c': 3 }\n */\nfunction toPlainObject(value) {\n return copyObject(value, keysIn(value));\n}\n\nmodule.exports = toPlainObject;\n","var assignMergeValue = require('./_assignMergeValue'),\n cloneBuffer = require('./_cloneBuffer'),\n cloneTypedArray = require('./_cloneTypedArray'),\n copyArray = require('./_copyArray'),\n initCloneObject = require('./_initCloneObject'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isArrayLikeObject = require('./isArrayLikeObject'),\n isBuffer = require('./isBuffer'),\n isFunction = require('./isFunction'),\n isObject = require('./isObject'),\n isPlainObject = require('./isPlainObject'),\n isTypedArray = require('./isTypedArray'),\n safeGet = require('./_safeGet'),\n toPlainObject = require('./toPlainObject');\n\n/**\n * A specialized version of `baseMerge` for arrays and objects which performs\n * deep merges and tracks traversed objects enabling objects with circular\n * references to be merged.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {string} key The key of the value to merge.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} mergeFunc The function to merge values.\n * @param {Function} [customizer] The function to customize assigned values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMergeDeep(object, source, key, srcIndex, mergeFunc, customizer, stack) {\n var objValue = safeGet(object, key),\n srcValue = safeGet(source, key),\n stacked = stack.get(srcValue);\n\n if (stacked) {\n assignMergeValue(object, key, stacked);\n return;\n }\n var newValue = customizer\n ? customizer(objValue, srcValue, (key + ''), object, source, stack)\n : undefined;\n\n var isCommon = newValue === undefined;\n\n if (isCommon) {\n var isArr = isArray(srcValue),\n isBuff = !isArr && isBuffer(srcValue),\n isTyped = !isArr && !isBuff && isTypedArray(srcValue);\n\n newValue = srcValue;\n if (isArr || isBuff || isTyped) {\n if (isArray(objValue)) {\n newValue = objValue;\n }\n else if (isArrayLikeObject(objValue)) {\n newValue = copyArray(objValue);\n }\n else if (isBuff) {\n isCommon = false;\n newValue = cloneBuffer(srcValue, true);\n }\n else if (isTyped) {\n isCommon = false;\n newValue = cloneTypedArray(srcValue, true);\n }\n else {\n newValue = [];\n }\n }\n else if (isPlainObject(srcValue) || isArguments(srcValue)) {\n newValue = objValue;\n if (isArguments(objValue)) {\n newValue = toPlainObject(objValue);\n }\n else if (!isObject(objValue) || isFunction(objValue)) {\n newValue = initCloneObject(srcValue);\n }\n }\n else {\n isCommon = false;\n }\n }\n if (isCommon) {\n // Recursively merge objects and arrays (susceptible to call stack limits).\n stack.set(srcValue, newValue);\n mergeFunc(newValue, srcValue, srcIndex, customizer, stack);\n stack['delete'](srcValue);\n }\n assignMergeValue(object, key, newValue);\n}\n\nmodule.exports = baseMergeDeep;\n","var Stack = require('./_Stack'),\n assignMergeValue = require('./_assignMergeValue'),\n baseFor = require('./_baseFor'),\n baseMergeDeep = require('./_baseMergeDeep'),\n isObject = require('./isObject'),\n keysIn = require('./keysIn'),\n safeGet = require('./_safeGet');\n\n/**\n * The base implementation of `_.merge` without support for multiple sources.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @param {number} srcIndex The index of `source`.\n * @param {Function} [customizer] The function to customize merged values.\n * @param {Object} [stack] Tracks traversed source values and their merged\n * counterparts.\n */\nfunction baseMerge(object, source, srcIndex, customizer, stack) {\n if (object === source) {\n return;\n }\n baseFor(source, function(srcValue, key) {\n stack || (stack = new Stack);\n if (isObject(srcValue)) {\n baseMergeDeep(object, source, key, srcIndex, baseMerge, customizer, stack);\n }\n else {\n var newValue = customizer\n ? customizer(safeGet(object, key), srcValue, (key + ''), object, source, stack)\n : undefined;\n\n if (newValue === undefined) {\n newValue = srcValue;\n }\n assignMergeValue(object, key, newValue);\n }\n }, keysIn);\n}\n\nmodule.exports = baseMerge;\n","/**\n * This method returns the first argument it receives.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {*} value Any value.\n * @returns {*} Returns `value`.\n * @example\n *\n * var object = { 'a': 1 };\n *\n * console.log(_.identity(object) === object);\n * // => true\n */\nfunction identity(value) {\n return value;\n}\n\nmodule.exports = identity;\n","/**\n * A faster alternative to `Function#apply`, this function invokes `func`\n * with the `this` binding of `thisArg` and the arguments of `args`.\n *\n * @private\n * @param {Function} func The function to invoke.\n * @param {*} thisArg The `this` binding of `func`.\n * @param {Array} args The arguments to invoke `func` with.\n * @returns {*} Returns the result of `func`.\n */\nfunction apply(func, thisArg, args) {\n switch (args.length) {\n case 0: return func.call(thisArg);\n case 1: return func.call(thisArg, args[0]);\n case 2: return func.call(thisArg, args[0], args[1]);\n case 3: return func.call(thisArg, args[0], args[1], args[2]);\n }\n return func.apply(thisArg, args);\n}\n\nmodule.exports = apply;\n","var apply = require('./_apply');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max;\n\n/**\n * A specialized version of `baseRest` which transforms the rest array.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @param {Function} transform The rest array transform.\n * @returns {Function} Returns the new function.\n */\nfunction overRest(func, start, transform) {\n start = nativeMax(start === undefined ? (func.length - 1) : start, 0);\n return function() {\n var args = arguments,\n index = -1,\n length = nativeMax(args.length - start, 0),\n array = Array(length);\n\n while (++index < length) {\n array[index] = args[start + index];\n }\n index = -1;\n var otherArgs = Array(start + 1);\n while (++index < start) {\n otherArgs[index] = args[index];\n }\n otherArgs[start] = transform(array);\n return apply(func, this, otherArgs);\n };\n}\n\nmodule.exports = overRest;\n","/**\n * Creates a function that returns `value`.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {*} value The value to return from the new function.\n * @returns {Function} Returns the new constant function.\n * @example\n *\n * var objects = _.times(2, _.constant({ 'a': 1 }));\n *\n * console.log(objects);\n * // => [{ 'a': 1 }, { 'a': 1 }]\n *\n * console.log(objects[0] === objects[1]);\n * // => true\n */\nfunction constant(value) {\n return function() {\n return value;\n };\n}\n\nmodule.exports = constant;\n","var constant = require('./constant'),\n defineProperty = require('./_defineProperty'),\n identity = require('./identity');\n\n/**\n * The base implementation of `setToString` without support for hot loop shorting.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar baseSetToString = !defineProperty ? identity : function(func, string) {\n return defineProperty(func, 'toString', {\n 'configurable': true,\n 'enumerable': false,\n 'value': constant(string),\n 'writable': true\n });\n};\n\nmodule.exports = baseSetToString;\n","/** Used to detect hot functions by number of calls within a span of milliseconds. */\nvar HOT_COUNT = 800,\n HOT_SPAN = 16;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeNow = Date.now;\n\n/**\n * Creates a function that'll short out and invoke `identity` instead\n * of `func` when it's called `HOT_COUNT` or more times in `HOT_SPAN`\n * milliseconds.\n *\n * @private\n * @param {Function} func The function to restrict.\n * @returns {Function} Returns the new shortable function.\n */\nfunction shortOut(func) {\n var count = 0,\n lastCalled = 0;\n\n return function() {\n var stamp = nativeNow(),\n remaining = HOT_SPAN - (stamp - lastCalled);\n\n lastCalled = stamp;\n if (remaining > 0) {\n if (++count >= HOT_COUNT) {\n return arguments[0];\n }\n } else {\n count = 0;\n }\n return func.apply(undefined, arguments);\n };\n}\n\nmodule.exports = shortOut;\n","var baseSetToString = require('./_baseSetToString'),\n shortOut = require('./_shortOut');\n\n/**\n * Sets the `toString` method of `func` to return `string`.\n *\n * @private\n * @param {Function} func The function to modify.\n * @param {Function} string The `toString` result.\n * @returns {Function} Returns `func`.\n */\nvar setToString = shortOut(baseSetToString);\n\nmodule.exports = setToString;\n","var identity = require('./identity'),\n overRest = require('./_overRest'),\n setToString = require('./_setToString');\n\n/**\n * The base implementation of `_.rest` which doesn't validate or coerce arguments.\n *\n * @private\n * @param {Function} func The function to apply a rest parameter to.\n * @param {number} [start=func.length-1] The start position of the rest parameter.\n * @returns {Function} Returns the new function.\n */\nfunction baseRest(func, start) {\n return setToString(overRest(func, start, identity), func + '');\n}\n\nmodule.exports = baseRest;\n","var eq = require('./eq'),\n isArrayLike = require('./isArrayLike'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject');\n\n/**\n * Checks if the given arguments are from an iteratee call.\n *\n * @private\n * @param {*} value The potential iteratee value argument.\n * @param {*} index The potential iteratee index or key argument.\n * @param {*} object The potential iteratee object argument.\n * @returns {boolean} Returns `true` if the arguments are from an iteratee call,\n * else `false`.\n */\nfunction isIterateeCall(value, index, object) {\n if (!isObject(object)) {\n return false;\n }\n var type = typeof index;\n if (type == 'number'\n ? (isArrayLike(object) && isIndex(index, object.length))\n : (type == 'string' && index in object)\n ) {\n return eq(object[index], value);\n }\n return false;\n}\n\nmodule.exports = isIterateeCall;\n","var baseRest = require('./_baseRest'),\n isIterateeCall = require('./_isIterateeCall');\n\n/**\n * Creates a function like `_.assign`.\n *\n * @private\n * @param {Function} assigner The function to assign values.\n * @returns {Function} Returns the new assigner function.\n */\nfunction createAssigner(assigner) {\n return baseRest(function(object, sources) {\n var index = -1,\n length = sources.length,\n customizer = length > 1 ? sources[length - 1] : undefined,\n guard = length > 2 ? sources[2] : undefined;\n\n customizer = (assigner.length > 3 && typeof customizer == 'function')\n ? (length--, customizer)\n : undefined;\n\n if (guard && isIterateeCall(sources[0], sources[1], guard)) {\n customizer = length < 3 ? undefined : customizer;\n length = 1;\n }\n object = Object(object);\n while (++index < length) {\n var source = sources[index];\n if (source) {\n assigner(object, source, index, customizer);\n }\n }\n return object;\n });\n}\n\nmodule.exports = createAssigner;\n","var baseMerge = require('./_baseMerge'),\n createAssigner = require('./_createAssigner');\n\n/**\n * This method is like `_.assign` except that it recursively merges own and\n * inherited enumerable string keyed properties of source objects into the\n * destination object. Source properties that resolve to `undefined` are\n * skipped if a destination value exists. Array and plain object properties\n * are merged recursively. Other objects and value types are overridden by\n * assignment. Source objects are applied from left to right. Subsequent\n * sources overwrite property assignments of previous sources.\n *\n * **Note:** This method mutates `object`.\n *\n * @static\n * @memberOf _\n * @since 0.5.0\n * @category Object\n * @param {Object} object The destination object.\n * @param {...Object} [sources] The source objects.\n * @returns {Object} Returns `object`.\n * @example\n *\n * var object = {\n * 'a': [{ 'b': 2 }, { 'd': 4 }]\n * };\n *\n * var other = {\n * 'a': [{ 'c': 3 }, { 'e': 5 }]\n * };\n *\n * _.merge(object, other);\n * // => { 'a': [{ 'b': 2, 'c': 3 }, { 'd': 4, 'e': 5 }] }\n */\nvar merge = createAssigner(function(object, source, srcIndex) {\n baseMerge(object, source, srcIndex);\n});\n\nmodule.exports = merge;\n","import{__awaiter as o}from\"tslib\";import r from\"lodash/merge.js\";import{isEmpty as i}from\"../utils/index.mjs\";const e=(e,m,s,t)=>o(void 0,void 0,void 0,(function*(){const o=yield Promise.all(t.map((o=>o(e,m,s)))),l=r({},...o);return i(l)?Promise.resolve():Promise.reject(l)}));export{e as runValidators};\n","import{__awaiter as r}from\"tslib\";import{Amplify as t,Auth as s}from\"aws-amplify\";import\"../../types/authenticator/user.mjs\";import\"../../types/authenticator/attributes.mjs\";import\"../../types/primitives/componentClassName.mjs\";import\"../../i18n/translations.mjs\";import{hasSpecialChars as n}from\"../../helpers/authenticator/utils.mjs\";import\"../../helpers/accountSettings/utils.mjs\";const o={getAmplifyConfig(){return r(this,void 0,void 0,(function*(){return t.configure()}))},getCurrentUser(){return r(this,void 0,void 0,(function*(){return s.currentAuthenticatedUser()}))},handleSignUp(t){return r(this,void 0,void 0,(function*(){return s.signUp(Object.assign(Object.assign({},t),{autoSignIn:{enabled:!0}}))}))},handleSignIn({username:t,password:n}){return r(this,void 0,void 0,(function*(){return s.signIn(t,n)}))},handleConfirmSignIn({user:t,code:n,mfaType:o}){return r(this,void 0,void 0,(function*(){return s.confirmSignIn(t,n,o)}))},handleConfirmSignUp({username:t,code:n}){return r(this,void 0,void 0,(function*(){return yield s.confirmSignUp(t,n)}))},handleForgotPasswordSubmit({username:t,code:n,password:o}){return r(this,void 0,void 0,(function*(){return s.forgotPasswordSubmit(t,n,o)}))},handleForgotPassword(t){return r(this,void 0,void 0,(function*(){return s.forgotPassword(t)}))},validateCustomSignUp(t,s){return r(this,void 0,void 0,(function*(){}))},validateFormPassword(t,s,o){return r(this,void 0,void 0,(function*(){const{password:r}=t,{password:e}=s;if(!e||!o)return null;const i=[],a=+(null==o?void 0:o.passwordPolicyMinLength);r.length{switch(t){case\"REQUIRES_LOWERCASE\":/[a-z]/.test(r)||i.push(\"Password must have lower case letters\");break;case\"REQUIRES_UPPERCASE\":/[A-Z]/.test(r)||i.push(\"Password must have upper case letters\");break;case\"REQUIRES_NUMBERS\":/[0-9]/.test(r)||i.push(\"Password must have numbers\");break;case\"REQUIRES_SYMBOLS\":n(r)||i.push(\"Password must have special characters\")}})),0!==i.length?{password:i}:null}))},validateConfirmPassword(t,s){return r(this,void 0,void 0,(function*(){const{password:r,confirm_password:n}=t,{confirm_password:o,password:e}=s;return r||n?(r||n)&&r!==n&&(o&&e||(null==r?void 0:r.length)>=6&&(null==n?void 0:n.length)>=6)?{confirm_password:\"Your passwords must match\"}:void 0:null}))},validatePreferredUsername(t,s){return r(this,void 0,void 0,(function*(){}))}};export{o as defaultServices};\n","import{__awaiter as e,__rest as t}from\"tslib\";import{Auth as r}from\"aws-amplify\";import n from\"lodash/get.js\";import{createMachine as o,sendUpdate as i}from\"xstate\";import{runValidators as s}from\"../../../validators/index.mjs\";import{clearAttributeToVerify as a,clearChallengeName as d,clearRequiredAttributes as c,clearError as l,clearFormValues as u,clearTouched as g,clearUnverifiedContactMethods as m,clearValidationError as f,handleInput as p,handleSubmit as h,handleBlur as I,parsePhoneNumber as v,setChallengeName as S,setConfirmResetPasswordIntent as A,setConfirmSignUpIntent as U,setRequiredAttributes as E,setCredentials as y,setFieldErrors as T,setRemoteError as C,setTotpSecretCode as b,setUnverifiedContactMethods as N,setUser as w,setUsernameAuthAttributes as R}from\"../actions.mjs\";import{defaultServices as P}from\"../defaultServices.mjs\";import{isEmpty as V}from\"../../../utils/index.mjs\";const _=[\"SMS_MFA\",\"SOFTWARE_TOKEN_MFA\"],F=e=>n(e,\"data.challengeName\"),O=(e,t)=>e===t,j=e=>_.includes(e);function k({services:n}){return o({initial:\"init\",id:\"signInActor\",predictableActionArguments:!0,states:{init:{always:[{target:\"autoSignIn.submit\",cond:\"shouldAutoSubmit\"},{target:\"autoSignIn\",cond:\"shouldAutoSignIn\"},{target:\"signIn\"}]},signIn:{initial:\"edit\",exit:[\"clearFormValues\",\"clearTouched\"],states:{edit:{entry:\"sendUpdate\",on:{SUBMIT:{actions:\"handleSubmit\",target:\"submit\"},CHANGE:{actions:\"handleInput\"},FEDERATED_SIGN_IN:\"federatedSignIn\"}},federatedSignIn:{tags:[\"pending\"],entry:[\"sendUpdate\",\"clearError\"],invoke:{src:\"federatedSignIn\",onError:{actions:\"setRemoteError\"}}},submit:{tags:[\"pending\"],entry:[\"parsePhoneNumber\",\"clearError\",\"sendUpdate\"],invoke:{src:\"signIn\",onDone:[{cond:\"shouldSetupTOTP\",actions:[\"setUser\",\"setChallengeName\"],target:\"#signInActor.setupTOTP\"},{cond:\"shouldConfirmSignIn\",actions:[\"setUser\",\"setChallengeName\"],target:\"#signInActor.confirmSignIn\"},{cond:\"shouldForceChangePassword\",actions:[\"setUser\",\"setChallengeName\",\"setRequiredAttributes\"],target:\"#signInActor.forceNewPassword\"},{actions:\"setUser\",target:\"verifying\"}],onError:[{cond:\"shouldRedirectToConfirmSignUp\",actions:[\"setCredentials\",\"setConfirmSignUpIntent\"],target:\"rejected\"},{cond:\"shouldRedirectToConfirmResetPassword\",actions:[\"setUsernameAuthAttributes\",\"setConfirmResetPasswordIntent\"],target:\"rejected\"},{actions:\"setRemoteError\",target:\"edit\"}]}},verifying:{tags:[\"pending\"],entry:[\"clearError\",\"sendUpdate\"],invoke:{src:\"checkVerifiedContact\",onDone:[{cond:\"shouldRequestVerification\",target:\"#signInActor.verifyUser\",actions:\"setUnverifiedContactMethods\"},{target:\"resolved\"}],onError:{actions:\"setRemoteError\",target:\"edit\"}}},resolved:{always:\"#signInActor.resolved\"},rejected:{always:\"#signInActor.rejected\"}}},autoSignIn:{initial:\"pending\",states:{pending:{tags:[\"pending\"],entry:[\"clearError\",\"sendUpdate\"],on:{AUTO_SIGN_IN:[{cond:\"shouldSetupTOTP\",actions:[\"setUser\",\"setChallengeName\"],target:\"#signInActor.setupTOTP\"},{cond:\"shouldConfirmSignIn\",actions:[\"setUser\",\"setChallengeName\"],target:\"#signInActor.confirmSignIn\"},{cond:\"shouldForceChangePassword\",actions:[\"setUser\",\"setChallengeName\",\"setRequiredAttributes\"],target:\"#signInActor.forceNewPassword\"},{actions:\"setUser\",target:\"#signInActor.resolved\"}],AUTO_SIGN_IN_FAILURE:{actions:\"setRemoteError\",target:\"pending\"}}},submit:{tags:[\"pending\"],entry:[\"clearError\",\"sendUpdate\"],invoke:{src:\"signIn\",onDone:[{cond:\"shouldSetupTOTP\",actions:[\"setUser\",\"setChallengeName\"],target:\"#signInActor.setupTOTP\"},{cond:\"shouldConfirmSignIn\",actions:[\"setUser\",\"setChallengeName\"],target:\"#signInActor.confirmSignIn\"},{cond:\"shouldForceChangePassword\",actions:[\"setUser\",\"setChallengeName\",\"setRequiredAttributes\"],target:\"#signInActor.forceNewPassword\"},{actions:\"setUser\",target:\"#signInActor.resolved\"}],onError:{actions:\"setRemoteError\",target:\"#signInActor.signIn\"}}},resolved:{always:\"#signInActor.resolved\"},rejected:{always:\"#signInActor.rejected\"}}},confirmSignIn:{initial:\"edit\",exit:[\"clearFormValues\",\"clearError\",\"clearTouched\"],states:{edit:{entry:\"sendUpdate\",on:{SUBMIT:{actions:\"handleSubmit\",target:\"submit\"},SIGN_IN:\"#signInActor.signIn\",CHANGE:{actions:\"handleInput\"}}},submit:{tags:[\"pending\"],entry:[\"clearError\",\"sendUpdate\"],invoke:{src:\"confirmSignIn\",onDone:{target:\"#signInActor.resolved\",actions:[\"setUser\",\"clearChallengeName\",\"clearRequiredAttributes\"]},onError:{target:\"edit\",actions:\"setRemoteError\"}}}}},forceNewPassword:{type:\"parallel\",exit:[\"clearFormValues\",\"clearError\",\"clearTouched\"],states:{validation:{initial:\"pending\",states:{pending:{invoke:{src:\"validateFields\",onDone:{target:\"valid\",actions:\"clearValidationError\"},onError:{target:\"invalid\",actions:\"setFieldErrors\"}}},valid:{entry:\"sendUpdate\"},invalid:{entry:\"sendUpdate\"}},on:{SIGN_IN:\"#signInActor.signIn\",CHANGE:{actions:\"handleInput\",target:\".pending\"},BLUR:{actions:\"handleBlur\",target:\".pending\"}}},submit:{initial:\"idle\",entry:\"clearError\",states:{idle:{entry:\"sendUpdate\",on:{SUBMIT:{actions:\"handleSubmit\",target:\"validate\"}}},validate:{entry:\"sendUpdate\",invoke:{src:\"validateFields\",onDone:{target:\"pending\",actions:\"clearValidationError\"},onError:{target:\"idle\",actions:\"setFieldErrors\"}}},pending:{tags:[\"pending\"],entry:[\"sendUpdate\",\"clearError\"],invoke:{src:\"forceNewPassword\",onDone:[{cond:\"shouldConfirmSignIn\",actions:[\"setUser\",\"setChallengeName\"],target:\"#signInActor.confirmSignIn\"},{cond:\"shouldSetupTOTP\",actions:[\"setUser\",\"setChallengeName\"],target:\"#signInActor.setupTOTP\"},{target:\"resolved\",actions:[\"setUser\",\"setCredentials\"]}],onError:{target:\"idle\",actions:\"setRemoteError\"}}},resolved:{type:\"final\",always:\"#signInActor.resolved\"}}}}},setupTOTP:{initial:\"getTotpSecretCode\",exit:[\"clearFormValues\",\"clearError\",\"clearTouched\"],states:{getTotpSecretCode:{invoke:{src:\"getTotpSecretCode\",onDone:{target:\"edit\",actions:\"setTotpSecretCode\"},onError:{target:\"edit\",actions:\"setRemoteError\"}}},edit:{entry:\"sendUpdate\",on:{SUBMIT:{actions:\"handleSubmit\",target:\"submit\"},SIGN_IN:\"#signInActor.signIn\",CHANGE:{actions:\"handleInput\"}}},submit:{tags:[\"pending\"],entry:[\"sendUpdate\",\"clearError\"],invoke:{src:\"verifyTotpToken\",onDone:{actions:[\"clearChallengeName\",\"clearRequiredAttributes\"],target:\"#signInActor.resolved\"},onError:{actions:\"setRemoteError\",target:\"edit\"}}}}},verifyUser:{initial:\"edit\",exit:[\"clearFormValues\",\"clearError\",\"clearTouched\"],states:{edit:{entry:\"sendUpdate\",on:{SUBMIT:{actions:\"handleSubmit\",target:\"submit\"},SKIP:\"#signInActor.resolved\",CHANGE:{actions:\"handleInput\"}}},submit:{tags:[\"pending\"],entry:\"clearError\",invoke:{src:\"verifyUser\",onDone:{target:\"#signInActor.confirmVerifyUser\"},onError:{actions:\"setRemoteError\",target:\"edit\"}}}}},confirmVerifyUser:{initial:\"edit\",exit:[\"clearFormValues\",\"clearError\",\"clearUnverifiedContactMethods\",\"clearAttributeToVerify\",\"clearTouched\"],states:{edit:{entry:\"sendUpdate\",on:{SUBMIT:{actions:\"handleSubmit\",target:\"submit\"},SKIP:\"#signInActor.resolved\",CHANGE:{actions:\"handleInput\"}}},submit:{tags:[\"pending\"],entry:\"clearError\",invoke:{src:\"confirmVerifyUser\",onDone:{target:\"#signInActor.resolved\"},onError:{actions:\"setRemoteError\",target:\"edit\"}}}}},resolved:{type:\"final\",data:e=>({user:e.user})},rejected:{type:\"final\",data:(e,t)=>({intent:e.redirectIntent,authAttributes:e.authAttributes})}}},{actions:{clearAttributeToVerify:a,clearChallengeName:d,clearRequiredAttributes:c,clearError:l,clearFormValues:u,clearTouched:g,clearUnverifiedContactMethods:m,clearValidationError:f,handleInput:p,handleSubmit:h,handleBlur:I,parsePhoneNumber:v,setChallengeName:S,setConfirmResetPasswordIntent:A,setConfirmSignUpIntent:U,setRequiredAttributes:E,setCredentials:y,setFieldErrors:T,setRemoteError:C,setTotpSecretCode:b,setUnverifiedContactMethods:N,setUser:w,setUsernameAuthAttributes:R,sendUpdate:i()},guards:{shouldAutoSignIn:e=>\"autoSignIn\"===(null==e?void 0:e.intent),shouldAutoSubmit:e=>\"autoSignInSubmit\"===(null==e?void 0:e.intent),shouldConfirmSignIn:(e,t)=>j(F(t)),shouldForceChangePassword:(e,t)=>O(F(t),\"NEW_PASSWORD_REQUIRED\"),shouldRedirectToConfirmResetPassword:(e,t)=>\"PasswordResetRequiredException\"===t.data.code,shouldRedirectToConfirmSignUp:(e,t)=>\"UserNotConfirmedException\"===t.data.code,shouldRequestVerification:(e,t)=>{const{unverified:r,verified:n}=t.data;return V(n)&&!V(r)},shouldSetupTOTP:(e,t)=>O(F(t),\"MFA_SETUP\")},services:{signIn(t){return e(this,void 0,void 0,(function*(){const{authAttributes:e={},formValues:r={}}=t,o=Object.assign(Object.assign({},e),r),{username:i,password:s}=o;return yield n.handleSignIn({username:i,password:s})}))},confirmSignIn(t){return e(this,void 0,void 0,(function*(){const{challengeName:e,user:o}=t,{confirmation_code:i}=t.formValues,s=j(e)?e:void 0;return yield n.handleConfirmSignIn({user:o,code:i,mfaType:s}),yield r.currentAuthenticatedUser()}))},forceNewPassword(n){return e(this,void 0,void 0,(function*(){const{user:e,formValues:o}=n;let i,{password:s,confirm_password:a,phone_number:d,country_code:c}=o,l=t(o,[\"password\",\"confirm_password\",\"phone_number\",\"country_code\"]);d&&(i=`${c}${d}`.replace(/[^A-Z0-9+]/gi,\"\"),l=Object.assign(Object.assign({},l),{phone_number:i}));try{const t=yield r.completeNewPassword(e,s,l);return t.challengeName?t:r.currentAuthenticatedUser()}catch(e){return Promise.reject(e)}}))},getTotpSecretCode(t){return e(this,void 0,void 0,(function*(){const{user:e}=t;return r.setupTOTP(e)}))},verifyTotpToken(t){return e(this,void 0,void 0,(function*(){const{formValues:e,user:n}=t,{confirmation_code:o}=e;return r.verifyTotpToken(n,o)}))},federatedSignIn(t,n){return e(this,void 0,void 0,(function*(){const{provider:e}=n.data;return yield r.federatedSignIn({provider:e})}))},checkVerifiedContact(t){return e(this,void 0,void 0,(function*(){const{user:e}=t;return yield r.verifiedContact(e)}))},verifyUser(t){return e(this,void 0,void 0,(function*(){const{unverifiedAttr:e}=t.formValues,n=yield r.verifyCurrentUserAttribute(e);return t.attributeToVerify=e,n}))},confirmVerifyUser(t){return e(this,void 0,void 0,(function*(){const{attributeToVerify:e}=t,{confirmation_code:n}=t.formValues;return yield r.verifyCurrentUserAttributeSubmit(e,n)}))},validateFields(t){return e(this,void 0,void 0,(function*(){return s(t.formValues,t.touched,t.passwordSettings,[P.validateFormPassword,P.validateConfirmPassword])}))}}})}export{k as signInActor};\n","import{createMachine as e}from\"xstate\";import{Auth as t}from\"aws-amplify\";const i=e({initial:\"pending\",id:\"signOutActor\",predictableActionArguments:!0,states:{pending:{tags:[\"pending\"],invoke:{src:\"signOut\",onDone:\"resolved\",onError:\"rejected\"}},resolved:{type:\"final\"},rejected:{type:\"final\"}}},{services:{signOut:()=>t.signOut()}});export{i as signOutActor};\n","import{__awaiter as e}from\"tslib\";import{createMachine as r,sendUpdate as t}from\"xstate\";import{runValidators as s}from\"../../../validators/index.mjs\";import{clearError as a,clearFormValues as o,clearTouched as n,clearUsername as i,clearValidationError as d,handleInput as l,handleSubmit as c,handleBlur as m,resendCode as u,setFieldErrors as p,setRemoteError as g,setUsername as v}from\"../actions.mjs\";import{defaultServices as E}from\"../defaultServices.mjs\";function f({services:f}){return r({id:\"resetPasswordActor\",initial:\"init\",predictableActionArguments:!0,states:{init:{always:[{target:\"confirmResetPassword\",cond:\"shouldAutoConfirmReset\",actions:\"resendCode\"},{target:\"resetPassword\"}]},resetPassword:{initial:\"edit\",exit:[\"clearFormValues\",\"clearError\",\"clearTouched\"],states:{edit:{entry:\"sendUpdate\",on:{SUBMIT:{actions:\"handleSubmit\",target:\"submit\"},CHANGE:{actions:\"handleInput\"},BLUR:{actions:\"handleBlur\"}}},submit:{tags:[\"pending\"],entry:[\"sendUpdate\",\"setUsername\",\"clearError\"],invoke:{src:\"resetPassword\",onDone:{target:\"#resetPasswordActor.confirmResetPassword\"},onError:{actions:[\"setRemoteError\"],target:\"edit\"}}}}},confirmResetPassword:{type:\"parallel\",exit:[\"clearFormValues\",\"clearError\",\"clearUsername\",\"clearTouched\"],states:{validation:{initial:\"pending\",states:{pending:{invoke:{src:\"validateFields\",onDone:{target:\"valid\",actions:\"clearValidationError\"},onError:{target:\"invalid\",actions:\"setFieldErrors\"}}},valid:{entry:\"sendUpdate\"},invalid:{entry:\"sendUpdate\"}},on:{CHANGE:{actions:\"handleInput\",target:\".pending\"},BLUR:{actions:\"handleBlur\",target:\".pending\"}}},submission:{initial:\"idle\",states:{idle:{entry:\"sendUpdate\",on:{SUBMIT:{actions:\"handleSubmit\",target:\"validate\"},RESEND:\"resendCode\",CHANGE:{actions:\"handleInput\"},BLUR:{actions:\"handleBlur\"}}},validate:{entry:\"sendUpdate\",invoke:{src:\"validateFields\",onDone:{target:\"pending\",actions:\"clearValidationError\"},onError:{target:\"idle\",actions:\"setFieldErrors\"}}},resendCode:{tags:[\"pending\"],entry:[\"clearError\",\"sendUpdate\"],invoke:{src:\"resetPassword\",onDone:{target:\"idle\"},onError:{actions:\"setRemoteError\",target:\"idle\"}}},pending:{tags:[\"pending\"],entry:[\"clearError\",\"sendUpdate\"],invoke:{src:\"confirmResetPassword\",onDone:{actions:\"clearUsername\",target:\"#resetPasswordActor.resolved\"},onError:{actions:\"setRemoteError\",target:\"idle\"}}}}}}},resolved:{type:\"final\"}}},{actions:{clearError:a,clearFormValues:o,clearTouched:n,clearUsername:i,clearValidationError:d,handleInput:l,handleSubmit:c,handleBlur:m,resendCode:u,setFieldErrors:p,setRemoteError:g,setUsername:v,sendUpdate:t()},guards:{shouldAutoConfirmReset:(e,r)=>!(!e.intent||\"confirmPasswordReset\"!==e.intent)},services:{resetPassword(r){return e(this,void 0,void 0,(function*(){const{username:e}=r;return f.handleForgotPassword(e)}))},confirmResetPassword(r){return e(this,void 0,void 0,(function*(){const{username:e}=r,{confirmation_code:t,password:s}=r.formValues;return f.handleForgotPasswordSubmit({username:e,code:t,password:s})}))},validateFields(r,t){return e(this,void 0,void 0,(function*(){return s(r.formValues,r.touched,r.passwordSettings,[E.validateFormPassword,E.validateConfirmPassword])}))}}})}export{f as resetPasswordActor};\n","var Stack = require('./_Stack'),\n baseIsEqual = require('./_baseIsEqual');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.isMatch` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The object to inspect.\n * @param {Object} source The object of property values to match.\n * @param {Array} matchData The property names, values, and compare flags to match.\n * @param {Function} [customizer] The function to customize comparisons.\n * @returns {boolean} Returns `true` if `object` is a match, else `false`.\n */\nfunction baseIsMatch(object, source, matchData, customizer) {\n var index = matchData.length,\n length = index,\n noCustomizer = !customizer;\n\n if (object == null) {\n return !length;\n }\n object = Object(object);\n while (index--) {\n var data = matchData[index];\n if ((noCustomizer && data[2])\n ? data[1] !== object[data[0]]\n : !(data[0] in object)\n ) {\n return false;\n }\n }\n while (++index < length) {\n data = matchData[index];\n var key = data[0],\n objValue = object[key],\n srcValue = data[1];\n\n if (noCustomizer && data[2]) {\n if (objValue === undefined && !(key in object)) {\n return false;\n }\n } else {\n var stack = new Stack;\n if (customizer) {\n var result = customizer(objValue, srcValue, key, object, source, stack);\n }\n if (!(result === undefined\n ? baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG, customizer, stack)\n : result\n )) {\n return false;\n }\n }\n }\n return true;\n}\n\nmodule.exports = baseIsMatch;\n","var isObject = require('./isObject');\n\n/**\n * Checks if `value` is suitable for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` if suitable for strict\n * equality comparisons, else `false`.\n */\nfunction isStrictComparable(value) {\n return value === value && !isObject(value);\n}\n\nmodule.exports = isStrictComparable;\n","var isStrictComparable = require('./_isStrictComparable'),\n keys = require('./keys');\n\n/**\n * Gets the property names, values, and compare flags of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the match data of `object`.\n */\nfunction getMatchData(object) {\n var result = keys(object),\n length = result.length;\n\n while (length--) {\n var key = result[length],\n value = object[key];\n\n result[length] = [key, value, isStrictComparable(value)];\n }\n return result;\n}\n\nmodule.exports = getMatchData;\n","/**\n * A specialized version of `matchesProperty` for source values suitable\n * for strict equality comparisons, i.e. `===`.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction matchesStrictComparable(key, srcValue) {\n return function(object) {\n if (object == null) {\n return false;\n }\n return object[key] === srcValue &&\n (srcValue !== undefined || (key in Object(object)));\n };\n}\n\nmodule.exports = matchesStrictComparable;\n","var baseIsMatch = require('./_baseIsMatch'),\n getMatchData = require('./_getMatchData'),\n matchesStrictComparable = require('./_matchesStrictComparable');\n\n/**\n * The base implementation of `_.matches` which doesn't clone `source`.\n *\n * @private\n * @param {Object} source The object of property values to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatches(source) {\n var matchData = getMatchData(source);\n if (matchData.length == 1 && matchData[0][2]) {\n return matchesStrictComparable(matchData[0][0], matchData[0][1]);\n }\n return function(object) {\n return object === source || baseIsMatch(object, source, matchData);\n };\n}\n\nmodule.exports = baseMatches;\n","/**\n * The base implementation of `_.hasIn` without support for deep paths.\n *\n * @private\n * @param {Object} [object] The object to query.\n * @param {Array|string} key The key to check.\n * @returns {boolean} Returns `true` if `key` exists, else `false`.\n */\nfunction baseHasIn(object, key) {\n return object != null && key in Object(object);\n}\n\nmodule.exports = baseHasIn;\n","var castPath = require('./_castPath'),\n isArguments = require('./isArguments'),\n isArray = require('./isArray'),\n isIndex = require('./_isIndex'),\n isLength = require('./isLength'),\n toKey = require('./_toKey');\n\n/**\n * Checks if `path` exists on `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @param {Function} hasFunc The function to check properties.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n */\nfunction hasPath(object, path, hasFunc) {\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n result = false;\n\n while (++index < length) {\n var key = toKey(path[index]);\n if (!(result = object != null && hasFunc(object, key))) {\n break;\n }\n object = object[key];\n }\n if (result || ++index != length) {\n return result;\n }\n length = object == null ? 0 : object.length;\n return !!length && isLength(length) && isIndex(key, length) &&\n (isArray(object) || isArguments(object));\n}\n\nmodule.exports = hasPath;\n","var baseHasIn = require('./_baseHasIn'),\n hasPath = require('./_hasPath');\n\n/**\n * Checks if `path` is a direct or inherited property of `object`.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The object to query.\n * @param {Array|string} path The path to check.\n * @returns {boolean} Returns `true` if `path` exists, else `false`.\n * @example\n *\n * var object = _.create({ 'a': _.create({ 'b': 2 }) });\n *\n * _.hasIn(object, 'a');\n * // => true\n *\n * _.hasIn(object, 'a.b');\n * // => true\n *\n * _.hasIn(object, ['a', 'b']);\n * // => true\n *\n * _.hasIn(object, 'b');\n * // => false\n */\nfunction hasIn(object, path) {\n return object != null && hasPath(object, path, baseHasIn);\n}\n\nmodule.exports = hasIn;\n","var baseIsEqual = require('./_baseIsEqual'),\n get = require('./get'),\n hasIn = require('./hasIn'),\n isKey = require('./_isKey'),\n isStrictComparable = require('./_isStrictComparable'),\n matchesStrictComparable = require('./_matchesStrictComparable'),\n toKey = require('./_toKey');\n\n/** Used to compose bitmasks for value comparisons. */\nvar COMPARE_PARTIAL_FLAG = 1,\n COMPARE_UNORDERED_FLAG = 2;\n\n/**\n * The base implementation of `_.matchesProperty` which doesn't clone `srcValue`.\n *\n * @private\n * @param {string} path The path of the property to get.\n * @param {*} srcValue The value to match.\n * @returns {Function} Returns the new spec function.\n */\nfunction baseMatchesProperty(path, srcValue) {\n if (isKey(path) && isStrictComparable(srcValue)) {\n return matchesStrictComparable(toKey(path), srcValue);\n }\n return function(object) {\n var objValue = get(object, path);\n return (objValue === undefined && objValue === srcValue)\n ? hasIn(object, path)\n : baseIsEqual(srcValue, objValue, COMPARE_PARTIAL_FLAG | COMPARE_UNORDERED_FLAG);\n };\n}\n\nmodule.exports = baseMatchesProperty;\n","/**\n * The base implementation of `_.property` without support for deep paths.\n *\n * @private\n * @param {string} key The key of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction baseProperty(key) {\n return function(object) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = baseProperty;\n","var baseGet = require('./_baseGet');\n\n/**\n * A specialized version of `baseProperty` which supports deep paths.\n *\n * @private\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyDeep(path) {\n return function(object) {\n return baseGet(object, path);\n };\n}\n\nmodule.exports = basePropertyDeep;\n","var baseProperty = require('./_baseProperty'),\n basePropertyDeep = require('./_basePropertyDeep'),\n isKey = require('./_isKey'),\n toKey = require('./_toKey');\n\n/**\n * Creates a function that returns the value at `path` of a given object.\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Util\n * @param {Array|string} path The path of the property to get.\n * @returns {Function} Returns the new accessor function.\n * @example\n *\n * var objects = [\n * { 'a': { 'b': 2 } },\n * { 'a': { 'b': 1 } }\n * ];\n *\n * _.map(objects, _.property('a.b'));\n * // => [2, 1]\n *\n * _.map(_.sortBy(objects, _.property(['a', 'b'])), 'a.b');\n * // => [1, 2]\n */\nfunction property(path) {\n return isKey(path) ? baseProperty(toKey(path)) : basePropertyDeep(path);\n}\n\nmodule.exports = property;\n","var baseMatches = require('./_baseMatches'),\n baseMatchesProperty = require('./_baseMatchesProperty'),\n identity = require('./identity'),\n isArray = require('./isArray'),\n property = require('./property');\n\n/**\n * The base implementation of `_.iteratee`.\n *\n * @private\n * @param {*} [value=_.identity] The value to convert to an iteratee.\n * @returns {Function} Returns the iteratee.\n */\nfunction baseIteratee(value) {\n // Don't store the `typeof` result in a variable to avoid a JIT bug in Safari 9.\n // See https://bugs.webkit.org/show_bug.cgi?id=156034 for more details.\n if (typeof value == 'function') {\n return value;\n }\n if (value == null) {\n return identity;\n }\n if (typeof value == 'object') {\n return isArray(value)\n ? baseMatchesProperty(value[0], value[1])\n : baseMatches(value);\n }\n return property(value);\n}\n\nmodule.exports = baseIteratee;\n","var assignValue = require('./_assignValue'),\n castPath = require('./_castPath'),\n isIndex = require('./_isIndex'),\n isObject = require('./isObject'),\n toKey = require('./_toKey');\n\n/**\n * The base implementation of `_.set`.\n *\n * @private\n * @param {Object} object The object to modify.\n * @param {Array|string} path The path of the property to set.\n * @param {*} value The value to set.\n * @param {Function} [customizer] The function to customize path creation.\n * @returns {Object} Returns `object`.\n */\nfunction baseSet(object, path, value, customizer) {\n if (!isObject(object)) {\n return object;\n }\n path = castPath(path, object);\n\n var index = -1,\n length = path.length,\n lastIndex = length - 1,\n nested = object;\n\n while (nested != null && ++index < length) {\n var key = toKey(path[index]),\n newValue = value;\n\n if (key === '__proto__' || key === 'constructor' || key === 'prototype') {\n return object;\n }\n\n if (index != lastIndex) {\n var objValue = nested[key];\n newValue = customizer ? customizer(objValue, key, nested) : undefined;\n if (newValue === undefined) {\n newValue = isObject(objValue)\n ? objValue\n : (isIndex(path[index + 1]) ? [] : {});\n }\n }\n assignValue(nested, key, newValue);\n nested = nested[key];\n }\n return object;\n}\n\nmodule.exports = baseSet;\n","var baseGet = require('./_baseGet'),\n baseSet = require('./_baseSet'),\n castPath = require('./_castPath');\n\n/**\n * The base implementation of `_.pickBy` without support for iteratee shorthands.\n *\n * @private\n * @param {Object} object The source object.\n * @param {string[]} paths The property paths to pick.\n * @param {Function} predicate The function invoked per property.\n * @returns {Object} Returns the new object.\n */\nfunction basePickBy(object, paths, predicate) {\n var index = -1,\n length = paths.length,\n result = {};\n\n while (++index < length) {\n var path = paths[index],\n value = baseGet(object, path);\n\n if (predicate(value, path)) {\n baseSet(result, castPath(path, object), value);\n }\n }\n return result;\n}\n\nmodule.exports = basePickBy;\n","var arrayPush = require('./_arrayPush'),\n getPrototype = require('./_getPrototype'),\n getSymbols = require('./_getSymbols'),\n stubArray = require('./stubArray');\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeGetSymbols = Object.getOwnPropertySymbols;\n\n/**\n * Creates an array of the own and inherited enumerable symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of symbols.\n */\nvar getSymbolsIn = !nativeGetSymbols ? stubArray : function(object) {\n var result = [];\n while (object) {\n arrayPush(result, getSymbols(object));\n object = getPrototype(object);\n }\n return result;\n};\n\nmodule.exports = getSymbolsIn;\n","var baseGetAllKeys = require('./_baseGetAllKeys'),\n getSymbolsIn = require('./_getSymbolsIn'),\n keysIn = require('./keysIn');\n\n/**\n * Creates an array of own and inherited enumerable property names and\n * symbols of `object`.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Array} Returns the array of property names and symbols.\n */\nfunction getAllKeysIn(object) {\n return baseGetAllKeys(object, keysIn, getSymbolsIn);\n}\n\nmodule.exports = getAllKeysIn;\n","var arrayMap = require('./_arrayMap'),\n baseIteratee = require('./_baseIteratee'),\n basePickBy = require('./_basePickBy'),\n getAllKeysIn = require('./_getAllKeysIn');\n\n/**\n * Creates an object composed of the `object` properties `predicate` returns\n * truthy for. The predicate is invoked with two arguments: (value, key).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Object\n * @param {Object} object The source object.\n * @param {Function} [predicate=_.identity] The function invoked per property.\n * @returns {Object} Returns the new object.\n * @example\n *\n * var object = { 'a': 1, 'b': '2', 'c': 3 };\n *\n * _.pickBy(object, _.isNumber);\n * // => { 'a': 1, 'c': 3 }\n */\nfunction pickBy(object, predicate) {\n if (object == null) {\n return {};\n }\n var props = arrayMap(getAllKeysIn(object), function(prop) {\n return [prop];\n });\n predicate = baseIteratee(predicate);\n return basePickBy(object, props, function(value, path) {\n return predicate(value, path[0]);\n });\n}\n\nmodule.exports = pickBy;\n","import{__awaiter as e}from\"tslib\";import{Auth as t}from\"aws-amplify\";import n from\"lodash/get.js\";import r from\"lodash/pickBy.js\";import{createMachine as i,sendUpdate as a,assign as s}from\"xstate\";import{runValidators as o}from\"../../validators/index.mjs\";import{clearError as d,clearFormValues as l,clearTouched as c,clearValidationError as u,handleInput as m,handleSubmit as p,handleBlur as g,parsePhoneNumber as f,setCredentials as U,setFieldErrors as v,setRemoteError as S,setCodeDeliveryDetails as h,setUser as E}from\"./actions.mjs\";function y({services:y}){return i({id:\"signUpActor\",initial:\"init\",predictableActionArguments:!0,states:{init:{always:[{target:\"confirmSignUp\",cond:\"shouldInitConfirmSignUp\"},{target:\"signUp\"}]},signUp:{type:\"parallel\",exit:[\"clearError\",\"clearFormValues\",\"clearTouched\"],states:{validation:{initial:\"pending\",states:{pending:{invoke:{src:\"validateSignUp\",onDone:{target:\"valid\",actions:\"clearValidationError\"},onError:{target:\"invalid\",actions:\"setFieldErrors\"}}},valid:{entry:\"sendUpdate\"},invalid:{entry:\"sendUpdate\"}},on:{CHANGE:{actions:\"handleInput\",target:\".pending\"},BLUR:{actions:\"handleBlur\",target:\".pending\"}}},submission:{initial:\"idle\",states:{idle:{entry:\"sendUpdate\",on:{SUBMIT:{actions:\"handleSubmit\",target:\"validate\"},FEDERATED_SIGN_IN:\"federatedSignIn\"}},federatedSignIn:{tags:[\"pending\"],entry:[\"sendUpdate\",\"clearError\"],invoke:{src:\"federatedSignIn\",onDone:\"#signUpActor.resolved\",onError:{actions:\"setRemoteError\"}}},validate:{entry:\"sendUpdate\",invoke:{src:\"validateSignUp\",onDone:{target:\"pending\",actions:\"clearValidationError\"},onError:{target:\"idle\",actions:\"setFieldErrors\"}}},pending:{tags:[\"pending\"],entry:[\"parsePhoneNumber\",\"sendUpdate\",\"clearError\"],invoke:{src:\"signUp\",onDone:[{cond:\"shouldSkipConfirm\",target:\"skipConfirm\",actions:[\"setUser\",\"setCredentials\"]},{target:\"resolved\",actions:[\"setUser\",\"setCredentials\",\"setCodeDeliveryDetails\"]}],onError:{target:\"idle\",actions:\"setRemoteError\"}}},skipConfirm:{always:{target:\"#signUpActor.resolved\",actions:\"setAutoSignInIntent\"}},resolved:{type:\"final\",always:\"#signUpActor.confirmSignUp\"}}}}},confirmSignUp:{initial:\"edit\",states:{edit:{entry:\"sendUpdate\",on:{SUBMIT:{actions:\"handleSubmit\",target:\"submit\"},CHANGE:{actions:\"handleInput\"},BLUR:{actions:\"handleBlur\"},RESEND:\"resend\"}},resend:{tags:[\"pending\"],entry:\"sendUpdate\",invoke:{src:\"resendConfirmationCode\",onDone:{target:\"edit\"},onError:[{target:\"#signUpActor.resolved\",actions:\"setAutoSignInIntent\",cond:\"isUserAlreadyConfirmed\"},{target:\"edit\",actions:\"setRemoteError\"}]}},submit:{tags:[\"pending\"],entry:[\"sendUpdate\",\"clearError\"],invoke:{src:\"confirmSignUp\",onDone:{target:\"#signUpActor.resolved\",actions:\"setAutoSignInIntent\"},onError:{target:\"edit\",actions:\"setRemoteError\"}}}}},resolved:{type:\"final\",data:(e,t)=>{const{username:r,password:i}=e.authAttributes;return{user:n(t,\"data.user\")||e.user,authAttributes:{username:r,password:i},intent:e.intent}}}}},{guards:{isUserAlreadyConfirmed:(e,t)=>\"User is already confirmed.\"===t.data.message,shouldInitConfirmSignUp:e=>e.intent&&\"confirmSignUp\"===e.intent,shouldSkipConfirm:(e,t)=>t.data.userConfirmed},actions:{clearError:d,clearFormValues:l,clearTouched:c,clearValidationError:u,handleInput:m,handleSubmit:p,handleBlur:g,parsePhoneNumber:f,setCredentials:U,setFieldErrors:v,setRemoteError:S,setCodeDeliveryDetails:h,setUser:E,sendUpdate:a(),setAutoSignInIntent:s({intent:e=>\"confirmSignUp\"===(null==e?void 0:e.intent)?\"autoSignInSubmit\":\"autoSignIn\"})},services:{confirmSignUp(t,r){return e(this,void 0,void 0,(function*(){const{user:e,authAttributes:r,formValues:i}=t,{confirmation_code:a}=i,s=n(e,\"username\")||n(r,\"username\");return yield y.handleConfirmSignUp({username:s,code:a})}))},resendConfirmationCode(r,i){return e(this,void 0,void 0,(function*(){const{user:e,authAttributes:i}=r,a=n(e,\"username\")||n(i,\"username\");return t.resendSignUp(a)}))},federatedSignIn(n,r){return e(this,void 0,void 0,(function*(){const{provider:e}=r.data;return yield t.federatedSignIn({provider:e})}))},signUp(t,n){return e(this,void 0,void 0,(function*(){const{formValues:e,loginMechanisms:n}=t,[i=\"username\"]=n,{[i]:a,password:s}=e,o=r(e,((e,t)=>{switch(t){case\"address\":case\"birthdate\":case\"email\":case\"family_name\":case\"gender\":case\"given_name\":case\"locale\":case\"middle_name\":case\"name\":case\"nickname\":case\"phone_number\":case\"picture\":case\"preferred_username\":case\"profile\":case\"updated_at\":case\"website\":case\"zoneinfo\":return!0;default:return t.startsWith(\"custom:\")}}));return yield y.handleSignUp({username:a,password:s,attributes:o})}))},validateSignUp(t,n){return e(this,void 0,void 0,(function*(){return o(t.formValues,t.touched,t.passwordSettings,[y.validateFormPassword,y.validateConfirmPassword,y.validatePreferredUsername,y.validateCustomSignUp])}))}}})}export{y as createSignUpMachine};\n","import{__rest as t}from\"tslib\";import{createMachine as o,forwardTo as i,assign as n,spawn as e,actions as r}from\"xstate\";import{stopActor as s}from\"./actions.mjs\";import{signInActor as a}from\"./actors/signIn.mjs\";import{signOutActor as c}from\"./actors/signOut.mjs\";import{resetPasswordActor as d}from\"./actors/resetPassword.mjs\";import{defaultServices as u}from\"./defaultServices.mjs\";import{createSignUpMachine as l}from\"./signUp.mjs\";const{choose:g}=r;function v(){return o({id:\"authenticator\",initial:\"idle\",context:{user:void 0,config:{},services:u,actorRef:void 0,hasSetup:!1},predictableActionArguments:!0,states:{idle:{invoke:{src:\"getCurrentUser\",onDone:{actions:\"setUser\",target:\"authenticated\"},onError:{target:\"setup\"}}},setup:{initial:\"waitConfig\",states:{waitConfig:{on:{INIT:{actions:[\"configure\",\"setHasSetup\"],target:\"applyConfig\"}}},applyConfig:{invoke:{src:\"getAmplifyConfig\",onDone:{actions:\"applyAmplifyConfig\",target:\"goToInitialState\"}}},goToInitialState:{always:[{target:\"#authenticator.signUp\",cond:\"isInitialStateSignUp\"},{target:\"#authenticator.resetPassword\",cond:\"isInitialStateResetPassword\"},{target:\"#authenticator.signIn\"}]}}},signIn:{initial:\"spawnActor\",states:{spawnActor:{always:{actions:\"spawnSignInActor\",target:\"runActor\"}},runActor:{entry:\"clearActorDoneData\",exit:\"stopSignInActor\"}},on:{SIGN_UP:\"signUp\",RESET_PASSWORD:\"resetPassword\",\"done.invoke.signInActor\":[{target:\"signUp\",actions:\"setActorDoneData\",cond:\"shouldRedirectToSignUp\"},{target:\"resetPassword\",actions:\"setActorDoneData\",cond:\"shouldRedirectToResetPassword\"},{target:\"authenticated\",actions:\"setActorDoneData\"}]}},signUp:{initial:\"spawnActor\",states:{spawnActor:{always:{actions:\"spawnSignUpActor\",target:\"runActor\"}},runActor:{entry:\"clearActorDoneData\",exit:\"stopSignUpActor\"},autoSignIn:{invoke:{src:\"getCurrentUser\",onDone:\"#authenticator.authenticated\",onError:\"#authenticator.setup.goToInitialState\"}}},on:{SIGN_IN:\"signIn\",\"done.invoke.signUpActor\":{target:\"#authenticator.signIn\",actions:\"setActorDoneData\",cond:\"shouldAutoSignIn\"}}},resetPassword:{initial:\"spawnActor\",states:{spawnActor:{always:{actions:\"spawnResetPasswordActor\",target:\"runActor\"}},runActor:{entry:\"clearActorDoneData\",exit:\"stopResetPasswordActor\"}},on:{SIGN_IN:\"signIn\",\"done.invoke.resetPasswordActor\":{target:\"signIn\",actions:\"setActorDoneData\"}}},signOut:{initial:\"spawnActor\",states:{spawnActor:{always:{actions:\"spawnSignOutActor\",target:\"runActor\"}},runActor:{entry:\"clearActorDoneData\",exit:[\"stopSignOutActor\",\"clearUser\"]}},on:{\"done.invoke.signOutActor\":[{target:\"setup\",cond:\"shouldSetup\"},{target:\"setup.goToInitialState\"}]}},authenticated:{initial:\"idle\",states:{idle:{on:{TOKEN_REFRESH:\"refreshUser\"}},refreshUser:{invoke:{src:\"getCurrentUser\",onDone:{actions:\"setUser\",target:\"idle\"},onError:{target:\"#authenticator.signOut\"}}}},on:{SIGN_OUT:\"signOut\"}}},on:{CHANGE:{actions:\"forwardToActor\"},BLUR:{actions:\"forwardToActor\"},SUBMIT:{actions:\"forwardToActor\"},FEDERATED_SIGN_IN:{actions:\"forwardToActor\"},AUTO_SIGN_IN:{actions:\"forwardToActor\"},RESEND:{actions:\"forwardToActor\"},SIGN_IN:{actions:\"forwardToActor\"},SKIP:{actions:\"forwardToActor\"}}},{actions:{forwardToActor:g([{cond:\"hasActor\",actions:i((t=>t.actorRef))}]),setUser:n({user:(t,o)=>o.data}),setActorDoneData:n({actorDoneData:(t,o)=>{var i,n;return{authAttributes:Object.assign({},null===(i=o.data)||void 0===i?void 0:i.authAttributes),intent:null===(n=o.data)||void 0===n?void 0:n.intent}},user:(t,o)=>{var i;return null===(i=o.data)||void 0===i?void 0:i.user}}),clearUser:n({user:void 0}),clearActorDoneData:n({actorDoneData:void 0}),applyAmplifyConfig:n({config(t,o){var i,n,e,r,s,a,c,d,u;const l=null!==(n=null===(i=o.data.aws_cognito_username_attributes)||void 0===i?void 0:i.map((t=>t.toLowerCase())))&&void 0!==n?n:[],g=null!==(r=null===(e=o.data.aws_cognito_verification_mechanisms)||void 0===e?void 0:e.map((t=>t.toLowerCase())))&&void 0!==r?r:[],v=null!==(a=null===(s=o.data.aws_cognito_signup_attributes)||void 0===s?void 0:s.map((t=>t.toLowerCase())))&&void 0!==a?a:[],A=null!==(d=null===(c=o.data.aws_cognito_social_providers)||void 0===c?void 0:c.map((t=>t.toLowerCase())))&&void 0!==d?d:[],f=o.data.aws_cognito_password_protection_settings||{};0===l.length&&l.push(\"username\");const{loginMechanisms:w,signUpAttributes:S,socialProviders:m,initialState:h,formFields:D}=t.config;return{loginMechanisms:null!=w?w:l,formFields:null!==(u=p(D))&&void 0!==u?u:{},passwordSettings:f,signUpAttributes:null!=S?S:Array.from(new Set([...g,...v])),socialProviders:null!=m?m:A.sort(),initialState:h}}}),spawnSignInActor:n({actorRef:(t,o)=>{var i,n,r,s,c,d,u;const{services:l}=t,g=a({services:l}).withContext({authAttributes:null!==(n=null===(i=t.actorDoneData)||void 0===i?void 0:i.authAttributes)&&void 0!==n?n:{},user:t.user,intent:null===(r=t.actorDoneData)||void 0===r?void 0:r.intent,country_code:\"+1\",formValues:{},touched:{},validationError:{},passwordSettings:null===(s=t.config)||void 0===s?void 0:s.passwordSettings,loginMechanisms:null===(c=t.config)||void 0===c?void 0:c.loginMechanisms,socialProviders:null===(d=t.config)||void 0===d?void 0:d.socialProviders,formFields:null===(u=t.config)||void 0===u?void 0:u.formFields});return e(g,{name:\"signInActor\"})}}),spawnSignUpActor:n({actorRef:(t,o)=>{var i,n,r,s,a,c,d;const{services:u}=t,g=l({services:u}).withContext({authAttributes:null!==(n=null===(i=t.actorDoneData)||void 0===i?void 0:i.authAttributes)&&void 0!==n?n:{},country_code:\"+1\",intent:null===(r=t.actorDoneData)||void 0===r?void 0:r.intent,formValues:{},touched:{},validationError:{},loginMechanisms:null===(s=t.config)||void 0===s?void 0:s.loginMechanisms,socialProviders:null===(a=t.config)||void 0===a?void 0:a.socialProviders,formFields:null===(c=t.config)||void 0===c?void 0:c.formFields,passwordSettings:null===(d=t.config)||void 0===d?void 0:d.passwordSettings});return e(g,{name:\"signUpActor\"})}}),spawnResetPasswordActor:n({actorRef:(t,o)=>{var i,n,r,s,a;const{services:c}=t,u=d({services:c}).withContext({formValues:{},touched:{},intent:null===(i=t.actorDoneData)||void 0===i?void 0:i.intent,username:null===(r=null===(n=t.actorDoneData)||void 0===n?void 0:n.authAttributes)||void 0===r?void 0:r.username,formFields:null===(s=t.config)||void 0===s?void 0:s.formFields,validationError:{},passwordSettings:null===(a=t.config)||void 0===a?void 0:a.passwordSettings});return e(u,{name:\"resetPasswordActor\"})}}),spawnSignOutActor:n({actorRef:t=>{const o=c.withContext({user:t.user});return e(o,{name:\"signOutActor\"})}}),stopSignInActor:s(\"signInActor\"),stopSignUpActor:s(\"signUpActor\"),stopResetPasswordActor:s(\"resetPasswordActor\"),stopSignOutActor:s(\"signOutActor\"),configure:n(((o,i)=>{const n=i.data,{services:e}=n,r=t(n,[\"services\"]);return{services:Object.assign(Object.assign({},u),e),config:r}})),setHasSetup:n({hasSetup:!0})},guards:{isInitialStateSignUp:t=>\"signUp\"===t.config.initialState,isInitialStateResetPassword:t=>\"resetPassword\"===t.config.initialState,shouldRedirectToSignUp:(t,o)=>{var i;return\"confirmSignUp\"===(null===(i=o.data)||void 0===i?void 0:i.intent)},shouldRedirectToResetPassword:(t,o)=>{var i;return\"confirmPasswordReset\"===(null===(i=o.data)||void 0===i?void 0:i.intent)},shouldAutoSignIn:(t,o)=>{var i,n;return\"autoSignIn\"===(null===(i=o.data)||void 0===i?void 0:i.intent)||\"autoSignInSubmit\"===(null===(n=o.data)||void 0===n?void 0:n.intent)},shouldSetup:t=>!1===t.hasSetup,hasActor:t=>!!t.actorRef},services:{getCurrentUser:(t,o)=>t.services.getCurrentUser(),getAmplifyConfig:(t,o)=>t.services.getAmplifyConfig()}})}function p(t){return t&&Object.keys(t).forEach((o=>{Object.keys(t[o]).forEach((i=>{let n=t[o][i];n.required=n.isRequired}))})),t}export{v as createAuthenticatorMachine};\n","/**\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n */\nvar SUPPORTED_LOCALE = {\n tr: {\n regexp: /\\u0130|\\u0049|\\u0049\\u0307/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n az: {\n regexp: /\\u0130/g,\n map: {\n İ: \"\\u0069\",\n I: \"\\u0131\",\n İ: \"\\u0069\",\n },\n },\n lt: {\n regexp: /\\u0049|\\u004A|\\u012E|\\u00CC|\\u00CD|\\u0128/g,\n map: {\n I: \"\\u0069\\u0307\",\n J: \"\\u006A\\u0307\",\n Į: \"\\u012F\\u0307\",\n Ì: \"\\u0069\\u0307\\u0300\",\n Í: \"\\u0069\\u0307\\u0301\",\n Ĩ: \"\\u0069\\u0307\\u0303\",\n },\n },\n};\n/**\n * Localized lower case.\n */\nexport function localeLowerCase(str, locale) {\n var lang = SUPPORTED_LOCALE[locale.toLowerCase()];\n if (lang)\n return lowerCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));\n return lowerCase(str);\n}\n/**\n * Lower case as a function.\n */\nexport function lowerCase(str) {\n return str.toLowerCase();\n}\n//# sourceMappingURL=index.js.map","import { lowerCase } from \"lower-case\";\n// Support camel case (\"camelCase\" -> \"camel Case\" and \"CAMELCase\" -> \"CAMEL Case\").\nvar DEFAULT_SPLIT_REGEXP = [/([a-z0-9])([A-Z])/g, /([A-Z])([A-Z][a-z])/g];\n// Remove all non-word characters.\nvar DEFAULT_STRIP_REGEXP = /[^A-Z0-9]+/gi;\n/**\n * Normalize the string into something other libraries can manipulate easier.\n */\nexport function noCase(input, options) {\n if (options === void 0) { options = {}; }\n var _a = options.splitRegexp, splitRegexp = _a === void 0 ? DEFAULT_SPLIT_REGEXP : _a, _b = options.stripRegexp, stripRegexp = _b === void 0 ? DEFAULT_STRIP_REGEXP : _b, _c = options.transform, transform = _c === void 0 ? lowerCase : _c, _d = options.delimiter, delimiter = _d === void 0 ? \" \" : _d;\n var result = replace(replace(input, splitRegexp, \"$1\\0$2\"), stripRegexp, \"\\0\");\n var start = 0;\n var end = result.length;\n // Trim the delimiter from around the output string.\n while (result.charAt(start) === \"\\0\")\n start++;\n while (result.charAt(end - 1) === \"\\0\")\n end--;\n // Transform each token independently.\n return result.slice(start, end).split(\"\\0\").map(transform).join(delimiter);\n}\n/**\n * Replace `re` in the input string with the replacement value.\n */\nfunction replace(input, re, value) {\n if (re instanceof RegExp)\n return input.replace(re, value);\n return re.reduce(function (input, re) { return input.replace(re, value); }, input);\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { noCase } from \"no-case\";\nexport function pascalCaseTransform(input, index) {\n var firstChar = input.charAt(0);\n var lowerChars = input.substr(1).toLowerCase();\n if (index > 0 && firstChar >= \"0\" && firstChar <= \"9\") {\n return \"_\" + firstChar + lowerChars;\n }\n return \"\" + firstChar.toUpperCase() + lowerChars;\n}\nexport function pascalCaseTransformMerge(input) {\n return input.charAt(0).toUpperCase() + input.slice(1).toLowerCase();\n}\nexport function pascalCase(input, options) {\n if (options === void 0) { options = {}; }\n return noCase(input, __assign({ delimiter: \"\", transform: pascalCaseTransform }, options));\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { pascalCase, pascalCaseTransform, pascalCaseTransformMerge, } from \"pascal-case\";\nexport function camelCaseTransform(input, index) {\n if (index === 0)\n return input.toLowerCase();\n return pascalCaseTransform(input, index);\n}\nexport function camelCaseTransformMerge(input, index) {\n if (index === 0)\n return input.toLowerCase();\n return pascalCaseTransformMerge(input);\n}\nexport function camelCase(input, options) {\n if (options === void 0) { options = {}; }\n return pascalCase(input, __assign({ transform: camelCaseTransform }, options));\n}\n//# sourceMappingURL=index.js.map","/**\n * Upper case the first character of an input string.\n */\nexport function upperCaseFirst(input) {\n return input.charAt(0).toUpperCase() + input.substr(1);\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { noCase } from \"no-case\";\nimport { upperCaseFirst } from \"upper-case-first\";\nexport function capitalCaseTransform(input) {\n return upperCaseFirst(input.toLowerCase());\n}\nexport function capitalCase(input, options) {\n if (options === void 0) { options = {}; }\n return noCase(input, __assign({ delimiter: \" \", transform: capitalCaseTransform }, options));\n}\n//# sourceMappingURL=index.js.map","/**\n * Source: ftp://ftp.unicode.org/Public/UCD/latest/ucd/SpecialCasing.txt\n */\nvar SUPPORTED_LOCALE = {\n tr: {\n regexp: /[\\u0069]/g,\n map: {\n i: \"\\u0130\",\n },\n },\n az: {\n regexp: /[\\u0069]/g,\n map: {\n i: \"\\u0130\",\n },\n },\n lt: {\n regexp: /[\\u0069\\u006A\\u012F]\\u0307|\\u0069\\u0307[\\u0300\\u0301\\u0303]/g,\n map: {\n i̇: \"\\u0049\",\n j̇: \"\\u004A\",\n į̇: \"\\u012E\",\n i̇̀: \"\\u00CC\",\n i̇́: \"\\u00CD\",\n i̇̃: \"\\u0128\",\n },\n },\n};\n/**\n * Localized upper case.\n */\nexport function localeUpperCase(str, locale) {\n var lang = SUPPORTED_LOCALE[locale.toLowerCase()];\n if (lang)\n return upperCase(str.replace(lang.regexp, function (m) { return lang.map[m]; }));\n return upperCase(str);\n}\n/**\n * Upper case as a function.\n */\nexport function upperCase(str) {\n return str.toUpperCase();\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { noCase } from \"no-case\";\nimport { upperCase } from \"upper-case\";\nexport function constantCase(input, options) {\n if (options === void 0) { options = {}; }\n return noCase(input, __assign({ delimiter: \"_\", transform: upperCase }, options));\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { noCase } from \"no-case\";\nexport function dotCase(input, options) {\n if (options === void 0) { options = {}; }\n return noCase(input, __assign({ delimiter: \".\" }, options));\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { capitalCase } from \"capital-case\";\nexport function headerCase(input, options) {\n if (options === void 0) { options = {}; }\n return capitalCase(input, __assign({ delimiter: \"-\" }, options));\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { dotCase } from \"dot-case\";\nexport function paramCase(input, options) {\n if (options === void 0) { options = {}; }\n return dotCase(input, __assign({ delimiter: \"-\" }, options));\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { dotCase } from \"dot-case\";\nexport function pathCase(input, options) {\n if (options === void 0) { options = {}; }\n return dotCase(input, __assign({ delimiter: \"/\" }, options));\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { noCase } from \"no-case\";\nimport { upperCaseFirst } from \"upper-case-first\";\nexport function sentenceCaseTransform(input, index) {\n var result = input.toLowerCase();\n if (index === 0)\n return upperCaseFirst(result);\n return result;\n}\nexport function sentenceCase(input, options) {\n if (options === void 0) { options = {}; }\n return noCase(input, __assign({ delimiter: \" \", transform: sentenceCaseTransform }, options));\n}\n//# sourceMappingURL=index.js.map","import { __assign } from \"tslib\";\nimport { dotCase } from \"dot-case\";\nexport function snakeCase(input, options) {\n if (options === void 0) { options = {}; }\n return dotCase(input, __assign({ delimiter: \"_\" }, options));\n}\n//# sourceMappingURL=index.js.map","/*\n * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nconst ChangeCase = require('change-case')\n\nconst reduce = function(obj, f, accumulator_init) {\n return Object.keys(obj || {}).reduce((accumulator, key) => {\n let value = obj[key]\n return f(accumulator, value, key, obj)\n }, accumulator_init)\n}\n\nconst forEach = function(obj, f) {\n Object.keys(obj || {}).forEach((key) => {\n let value = obj[key]\n f(value, key)\n });\n}\n\n// Note: This is a crappy version to a certain extent... don't use with Strings, for example...\nconst clone = function(object) {\n return Object.assign(new object.constructor(), object)\n}\n\nconst cloneDeep = function(obj) {\n if(obj === null || obj === undefined || typeof obj !== 'object') {\n return obj\n }\n\n if(obj instanceof Array) {\n return obj.reduce((arr, item, i) => {\n arr[i] = cloneDeep(item)\n return arr\n }, [])\n }\n\n if(obj instanceof Object) {\n return Object.keys(obj || {}).reduce((cpObj, key) => {\n cpObj[key] = cloneDeep(obj[key])\n return cpObj\n }, {})\n }\n}\n\nconst isObject = function(value) {\n const type = typeof value\n return value != null && (type === 'object' || type === 'function')\n}\n\nconst isString = function(obj) {\n return typeof obj === 'string' || obj instanceof String\n}\n\nconst isArray = function(obj) {\n return Array.isArray(obj)\n}\n\nconst isEmpty = function(obj) {\n return [Object, Array].includes((obj || {}).constructor) && !Object.entries((obj || {})).length\n}\n\nfunction isPlainObject(value) {\n if (typeof value !== 'object' || value === null || Object.prototype.toString.call(value) !== '[object Object]') {\n return false\n }\n if (Object.getPrototypeOf(value) === null) {\n return true\n }\n let proto = value\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto)\n }\n return Object.getPrototypeOf(value) === proto\n}\n\nconst filter = function (arr, filter) {\n if (typeof(filter) !== 'function') {\n throw(\"filter is not a function\")\n }\n if (typeof arr === 'undefined') {\n return []\n }\n return arr.filter(filter)\n}\n\nconst assign = function () {\n let args = Array.prototype.slice.call(arguments)\n args.unshift({})\n return Object.assign(...args)\n}\n\n/* global Set */\nconst pull = function (arr, ...removeList){\n var removeSet = new Set(removeList)\n for (let i=arr.length-1;i>=0;i--) {\n if (removeSet.has(arr[i])) {\n arr.splice(i, 1)\n }\n }\n}\n\nconst unique = function (arr){\n return [...new Set(arr)]\n}\n\nconst upperFirst = function (str) {\n return str ? str[0].toUpperCase() + str.substr(1) : ''\n}\n\nconst matchFn = function(inputObj, testObj) {\n if (isObject(testObj)) {\n return Object.keys(testObj).every((key) => matchFn(inputObj[key], testObj[key]))\n }\n else {\n return inputObj == testObj\n }\n}\n\nconst matches = function (matchObj) {\n let cloneObj = cloneDeep(matchObj)\n let matchesFn = (inputObj) => matchFn(inputObj, cloneObj)\n return matchesFn\n}\n\nconst DEFAULT_OPTIONS = {\n transform: ChangeCase.camelCaseTransformMerge\n}\nconst changeDefaultCaseTransform = function (caseFunction, default_options) {\n return (caseToChange, options) => caseFunction(caseToChange, Object.assign({}, DEFAULT_OPTIONS, default_options, options))\n}\n\nmodule.exports = {\n each: forEach,\n forEach: forEach,\n forIn: forEach,\n keys: Object.keys,\n clone: clone,\n cloneDeep: cloneDeep,\n extend: Object.assign,\n isString: isString,\n isArray: isArray,\n isObject: isObject,\n isPlainObject: isPlainObject,\n isEmpty: isEmpty,\n filter: filter,\n reduce: reduce,\n assign: assign,\n upperFirst: upperFirst,\n camelCase: changeDefaultCaseTransform(ChangeCase.camelCase),\n snakeCase: ChangeCase.snakeCase,\n kebabCase: ChangeCase.paramCase,\n pull: pull,\n matches: matches,\n unique: unique,\n}\n","/*\n * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nvar _ = require('./es6_');\n\n/**\n * Performs an deep extend on the objects, from right to left.\n * @private\n * @param {Object[]} objects - An array of JS objects\n * @param {Function} collision - A function to be called when a merge collision happens.\n * @param {string[]} path - (for internal use) An array of strings which is the current path down the object when this is called recursively.\n * @returns {Object}\n */\nfunction deepExtend(objects, collision, path) {\n if (objects == null)\n return {};\n\n var src, copyIsArray, copy, name, options, clone,\n target = objects[0] || {},\n i = 1,\n length = objects.length;\n\n path = path || [];\n\n // Handle case when target is a string or something (possible in deep copy)\n if ( typeof target !== 'object' ) {\n target = {};\n }\n\n for ( ; i < length; i++) {\n // Only deal with non-null/undefined values\n if ( (options = objects[ i ]) != null ) {\n // Extend the base object\n for (name in options) {\n if (!options.hasOwnProperty(name))\n continue;\n if (name === '__proto__')\n continue;\n\n src = target[name];\n copy = options[name];\n\n // Prevent never-ending loop\n if (target === copy) {\n continue;\n }\n\n // Recurse if we're merging plain objects or arrays\n if ( copy && ( _.isPlainObject(copy) || (copyIsArray = _.isArray(copy)) ) ) {\n if ( copyIsArray ) {\n copyIsArray = false;\n clone = src && _.isArray(src) ? src : [];\n } else {\n clone = src && _.isPlainObject(src) ? src : {};\n }\n\n var nextPath = path.slice(0);\n nextPath.push(name);\n\n // Never move original objects, clone them\n target[ name ] = deepExtend( [clone, copy], collision, nextPath );\n\n // Don't bring in undefined values\n } else if ( copy !== undefined ) {\n if (src != null && typeof collision == 'function') {\n collision({target: target, copy: options, path: path, key: name});\n }\n target[ name ] = copy;\n }\n }\n }\n }\n\n return target;\n}\n\nmodule.exports = deepExtend;\n","/*\n * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nvar _ = require('./es6_');\n\n/**\n * Takes an plain javascript object and will make a flat array of all the leaf nodes.\n * A leaf node in this context has a 'value' property. Potentially refactor this to\n * be more generic.\n * @private\n * @param {Object} properties - The plain object you want flattened into an array.\n * @param {Array} [to_ret=[]] - Properties array. This function is recursive therefore this is what gets passed along.\n * @return {Array}\n */\nfunction flattenProperties(properties, to_ret) {\n to_ret = to_ret || [];\n\n for(var name in properties) {\n if (properties.hasOwnProperty(name)) {\n // TODO: this is a bit fragile and arbitrary to stop when we get to a 'value' property.\n if (_.isPlainObject(properties[name]) && ('value' in properties[name])) {\n to_ret.push( properties[name] );\n } else if (_.isPlainObject(properties[name])) {\n flattenProperties(properties[name], to_ret);\n }\n }\n }\n\n return to_ret;\n}\n\n\nmodule.exports = flattenProperties;\n","const e={small:{value:\"1px\"},medium:{value:\"2px\"},large:{value:\"3px\"}};export{e as borderWidths};\n","const l={red:{10:{value:\"hsl(0, 75%, 95%)\"},20:{value:\"hsl(0, 75%, 85%)\"},40:{value:\"hsl(0, 75%, 75%)\"},60:{value:\"hsl(0, 50%, 50%)\"},80:{value:\"hsl(0, 95%, 30%)\"},90:{value:\"hsl(0, 100%, 20%)\"},100:{value:\"hsl(0, 100%, 15%)\"}},orange:{10:{value:\"hsl(30, 75%, 95%)\"},20:{value:\"hsl(30, 75%, 85%)\"},40:{value:\"hsl(30, 75%, 75%)\"},60:{value:\"hsl(30, 50%, 50%)\"},80:{value:\"hsl(30, 95%, 30%)\"},90:{value:\"hsl(30, 100%, 20%)\"},100:{value:\"hsl(30, 100%, 15%)\"}},yellow:{10:{value:\"hsl(60, 75%, 95%)\"},20:{value:\"hsl(60, 75%, 85%)\"},40:{value:\"hsl(60, 75%, 75%)\"},60:{value:\"hsl(60, 50%, 50%)\"},80:{value:\"hsl(60, 95%, 30%)\"},90:{value:\"hsl(60, 100%, 20%)\"},100:{value:\"hsl(60, 100%, 15%)\"}},green:{10:{value:\"hsl(130, 60%, 95%)\"},20:{value:\"hsl(130, 60%, 90%)\"},40:{value:\"hsl(130, 44%, 63%)\"},60:{value:\"hsl(130, 43%, 46%)\"},80:{value:\"hsl(130, 33%, 37%)\"},90:{value:\"hsl(130, 27%, 29%)\"},100:{value:\"hsl(130, 22%, 23%)\"}},teal:{10:{value:\"hsl(190, 75%, 95%)\"},20:{value:\"hsl(190, 75%, 85%)\"},40:{value:\"hsl(190, 70%, 70%)\"},60:{value:\"hsl(190, 50%, 50%)\"},80:{value:\"hsl(190, 95%, 30%)\"},90:{value:\"hsl(190, 100%, 20%)\"},100:{value:\"hsl(190, 100%, 15%)\"}},blue:{10:{value:\"hsl(220, 95%, 95%)\"},20:{value:\"hsl(220, 85%, 85%)\"},40:{value:\"hsl(220, 70%, 70%)\"},60:{value:\"hsl(220, 50%, 50%)\"},80:{value:\"hsl(220, 95%, 30%)\"},90:{value:\"hsl(220, 100%, 20%)\"},100:{value:\"hsl(220, 100%, 15%)\"}},purple:{10:{value:\"hsl(300, 95%, 95%)\"},20:{value:\"hsl(300, 85%, 85%)\"},40:{value:\"hsl(300, 70%, 70%)\"},60:{value:\"hsl(300, 50%, 50%)\"},80:{value:\"hsl(300, 95%, 30%)\"},90:{value:\"hsl(300, 100%, 20%)\"},100:{value:\"hsl(300, 100%, 15%)\"}},pink:{10:{value:\"hsl(340, 95%, 95%)\"},20:{value:\"hsl(340, 90%, 85%)\"},40:{value:\"hsl(340, 70%, 70%)\"},60:{value:\"hsl(340, 50%, 50%)\"},80:{value:\"hsl(340, 95%, 30%)\"},90:{value:\"hsl(340, 100%, 20%)\"},100:{value:\"hsl(340, 100%, 15%)\"}},neutral:{10:{value:\"hsl(210, 5%, 98%)\"},20:{value:\"hsl(210, 5%, 94%)\"},40:{value:\"hsl(210, 5%, 87%)\"},60:{value:\"hsl(210, 10%, 58%)\"},80:{value:\"hsl(210, 10%, 40%)\"},90:{value:\"hsl(210, 25%, 25%)\"},100:{value:\"hsl(210, 50%, 10%)\"}},brand:{primary:{10:{value:\"{colors.teal.10.value}\"},20:{value:\"{colors.teal.20.value}\"},40:{value:\"{colors.teal.40.value}\"},60:{value:\"{colors.teal.60.value}\"},80:{value:\"{colors.teal.80.value}\"},90:{value:\"{colors.teal.90.value}\"},100:{value:\"{colors.teal.100.value}\"}},secondary:{10:{value:\"{colors.purple.10.value}\"},20:{value:\"{colors.purple.20.value}\"},40:{value:\"{colors.purple.40.value}\"},60:{value:\"{colors.purple.60.value}\"},80:{value:\"{colors.purple.80.value}\"},90:{value:\"{colors.purple.90.value}\"},100:{value:\"{colors.purple.100.value}\"}}},font:{primary:{value:\"{colors.neutral.100.value}\"},secondary:{value:\"{colors.neutral.90.value}\"},tertiary:{value:\"{colors.neutral.80.value}\"},disabled:{value:\"{colors.neutral.60.value}\"},inverse:{value:\"{colors.white.value}\"},interactive:{value:\"{colors.brand.primary.80.value}\"},hover:{value:\"{colors.brand.primary.90.value}\"},focus:{value:\"{colors.brand.primary.100.value}\"},active:{value:\"{colors.brand.primary.100.value}\"},info:{value:\"{colors.blue.90.value}\"},warning:{value:\"{colors.orange.90.value}\"},error:{value:\"{colors.red.90.value}\"},success:{value:\"{colors.green.90.value}\"}},background:{primary:{value:\"{colors.white.value}\"},secondary:{value:\"{colors.neutral.10.value}\"},tertiary:{value:\"{colors.neutral.20.value}\"},quaternary:{value:\"{colors.neutral.60.value}\"},disabled:{value:\"{colors.background.tertiary.value}\"},info:{value:\"{colors.blue.20.value}\"},warning:{value:\"{colors.orange.20.value}\"},error:{value:\"{colors.red.20.value}\"},success:{value:\"{colors.green.20.value}\"}},border:{primary:{value:\"{colors.neutral.60.value}\"},secondary:{value:\"{colors.neutral.40.value}\"},tertiary:{value:\"{colors.neutral.20.value}\"},disabled:{value:\"{colors.border.tertiary.value}\"},pressed:{value:\"{colors.brand.primary.100.value}\"},focus:{value:\"{colors.brand.primary.100.value}\"},error:{value:\"{colors.red.80.value}\"}},shadow:{primary:{value:\"hsla(210, 50%, 10%, 0.25)\"},secondary:{value:\"hsla(210, 50%, 10%, 0.15)\"},tertiary:{value:\"hsla(210, 50%, 10%, 0.05)\"}},overlay:{10:{value:\"hsla(0, 0%, 0%, 0.1)\"},20:{value:\"hsla(0, 0%, 0%, 0.2)\"},30:{value:\"hsla(0, 0%, 0%, 0.3)\"},40:{value:\"hsla(0, 0%, 0%, 0.4)\"},50:{value:\"hsla(0, 0%, 0%, 0.5)\"},60:{value:\"hsla(0, 0%, 0%, 0.6)\"},70:{value:\"hsla(0, 0%, 0%, 0.7)\"},80:{value:\"hsla(0, 0%, 0%, 0.8)\"},90:{value:\"hsla(0, 0%, 0%, 0.9)\"}},black:{value:\"hsl(0, 0%, 0%)\"},white:{value:\"hsl(0, 0%, 100%)\"},transparent:{value:\"transparent\"}};export{l as colors};\n","const o={alignItems:{value:\"center\"},justifyContent:{value:\"space-between\"},color:{value:\"{colors.font.primary.value}\"},backgroundColor:{value:\"{colors.background.tertiary.value}\"},paddingBlock:{value:\"{space.small.value}\"},paddingInline:{value:\"{space.medium.value}\"},icon:{size:{value:\"{fontSizes.xl.value}\"}},heading:{fontSize:{value:\"{fontSizes.medium.value}\"},fontWeight:{value:\"{fontWeights.bold.value}\"}},info:{color:{value:\"{colors.font.info.value}\"},backgroundColor:{value:\"{colors.background.info.value}\"}},error:{color:{value:\"{colors.font.error.value}\"},backgroundColor:{value:\"{colors.background.error.value}\"}},warning:{color:{value:\"{colors.font.warning.value}\"},backgroundColor:{value:\"{colors.background.warning.value}\"}},success:{color:{value:\"{colors.font.success.value}\"},backgroundColor:{value:\"{colors.background.success.value}\"}}};export{o as alert};\n","const a={menu:{width:{value:\"100%\"},marginBlockStart:{value:\"{space.xxxs}\"},backgroundColor:{value:\"{colors.background.primary}\"},borderColor:{value:\"{colors.border.primary}\"},borderWidth:{value:\"{borderWidths.small}\"},borderStyle:{value:\"solid\"},borderRadius:{value:\"{radii.small}\"},options:{display:{value:\"flex\"},flexDirection:{value:\"column\"},maxHeight:{value:\"300px\"}},option:{backgroundColor:{value:\"{colors.background.primary}\"},color:{value:\"currentcolor\"},cursor:{value:\"pointer\"},transitionDuration:{value:\"{time.short}\"},transitionProperty:{value:\"background-color, color\"},transitionTimingFunction:{value:\"ease\"},_active:{backgroundColor:{value:\"{colors.brand.primary.80}\"},color:{value:\"{colors.white}\"}}},_empty:{display:{value:\"flex\"}},_loading:{alignItems:{value:\"center\"},display:{value:\"flex\"},gap:{value:\"{space.xxxs}\"}},spaceShared:{paddingBlock:{value:\"{space.xs}\"},paddingInline:{value:\"{space.small}\"}}}};export{a as autocomplete};\n","const e={maxWidth:{value:\"60rem\"},modal:{width:{value:\"{space.relative.full}\"},height:{value:\"{space.relative.full}\"},backgroundColor:{value:\"{colors.overlay.50.value}\"},top:{value:\"{space.zero}\"},left:{value:\"{space.zero}\"}},container:{widthMax:{value:\"30rem\"}},router:{borderWidth:{value:\"{borderWidths.small.value}\"},borderStyle:{value:\"solid\"},borderColor:{value:\"{colors.border.primary.value}\"},backgroundColor:{value:\"{colors.background.primary.value}\"},boxShadow:{value:\"{shadows.medium.value}\"}},footer:{paddingBottom:{value:\"{space.medium.value}\"}},form:{padding:{value:\"{space.xl.value}\"}},state:{inactive:{backgroundColor:{value:\"{colors.background.secondary.value}\"}}},orContainer:{color:{value:\"{colors.neutral.80.value}\"},orLine:{backgroundColor:{value:\"{colors.background.primary.value}\"}}}};export{e as authenticator};\n","const a={color:{value:\"{colors.font.primary.value}\"},lineHeight:{value:1},fontWeight:{value:\"{fontWeights.semibold.value}\"},fontSize:{value:\"{fontSizes.small.value}\"},textAlign:{value:\"center\"},paddingVertical:{value:\"{space.xs.value}\"},paddingHorizontal:{value:\"{space.small.value}\"},backgroundColor:{value:\"{colors.background.tertiary.value}\"},borderRadius:{value:\"{radii.xl.value}\"},info:{color:{value:\"{colors.font.info.value}\"},backgroundColor:{value:\"{colors.background.info.value}\"}},warning:{color:{value:\"{colors.font.warning.value}\"},backgroundColor:{value:\"{colors.background.warning.value}\"}},success:{color:{value:\"{colors.font.success.value}\"},backgroundColor:{value:\"{colors.background.success.value}\"}},error:{color:{value:\"{colors.font.error.value}\"},backgroundColor:{value:\"{colors.background.error.value}\"}},small:{fontSize:{value:\"{fontSizes.xs.value}\"},paddingVertical:{value:\"{space.xxs.value}\"},paddingHorizontal:{value:\"{space.xs.value}\"}},large:{fontSize:{value:\"{fontSizes.medium.value}\"},paddingVertical:{value:\"{space.small.value}\"},paddingHorizontal:{value:\"{space.medium.value}\"}}};export{a as badge};\n","const o={fontWeight:{value:\"{fontWeights.bold.value}\"},transitionDuration:{value:\"{components.fieldcontrol.transitionDuration.value}\"},fontSize:{value:\"{components.fieldcontrol.fontSize.value}\"},lineHeight:{value:\"{components.fieldcontrol.lineHeight.value}\"},paddingBlockStart:{value:\"{components.fieldcontrol.paddingBlockStart.value}\"},paddingBlockEnd:{value:\"{components.fieldcontrol.paddingBlockEnd.value}\"},paddingInlineStart:{value:\"{components.fieldcontrol.paddingInlineStart.value}\"},paddingInlineEnd:{value:\"{components.fieldcontrol.paddingInlineEnd.value}\"},borderColor:{value:\"{components.fieldcontrol.borderColor.value}\"},borderWidth:{value:\"{components.fieldcontrol.borderWidth.value}\"},borderStyle:{value:\"{components.fieldcontrol.borderStyle.value}\"},borderRadius:{value:\"{components.fieldcontrol.borderRadius.value}\"},color:{value:\"{colors.font.primary.value}\"},_hover:{color:{value:\"{colors.font.focus.value}\"},backgroundColor:{value:\"{colors.brand.primary.10.value}\"},borderColor:{value:\"{colors.brand.primary.60.value}\"}},_focus:{color:{value:\"{colors.font.focus.value}\"},backgroundColor:{value:\"{colors.brand.primary.10.value}\"},borderColor:{value:\"{colors.border.focus.value}\"},boxShadow:{value:\"{components.fieldcontrol._focus.boxShadow.value}\"}},_active:{color:{value:\"{colors.font.active.value}\"},backgroundColor:{value:\"{colors.brand.primary.20.value}\"},borderColor:{value:\"{colors.brand.primary.100.value}\"}},_loading:{color:{value:\"{colors.font.disabled.value}\"},backgroundColor:{value:\"transparent\"},borderColor:{value:\"{colors.border.tertiary.value}\"}},_disabled:{color:{value:\"{colors.font.disabled.value}\"},backgroundColor:{value:\"transparent\"},borderColor:{value:\"{colors.border.tertiary.value}\"}},primary:{borderColor:{value:\"transparent\"},borderWidth:{value:\"{borderWidths.small.value}\"},borderStyle:{value:\"solid\"},backgroundColor:{value:\"{colors.brand.primary.80.value}\"},color:{value:\"{colors.font.inverse.value}\"},_disabled:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"{colors.background.disabled.value}\"},color:{value:\"{colors.font.disabled.value}\"}},_loading:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"{colors.background.disabled.value}\"},color:{value:\"{colors.font.disabled.value}\"}},_hover:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"{colors.brand.primary.90.value}\"},color:{value:\"{colors.font.inverse.value}\"}},_focus:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"{colors.brand.primary.90.value}\"},color:{value:\"{colors.font.inverse.value}\"},boxShadow:{value:\"{components.fieldcontrol._focus.boxShadow.value}\"}},_active:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"{colors.brand.primary.100.value}\"},color:{value:\"{colors.font.inverse.value}\"}}},menu:{borderWidth:{value:\"{space.zero.value}\"},backgroundColor:{value:\"transparent\"},justifyContent:{value:\"start\"},_hover:{color:{value:\"{colors.font.inverse.value}\"},backgroundColor:{value:\"{colors.brand.primary.80.value}\"}},_focus:{color:{value:\"{colors.font.inverse.value}\"},backgroundColor:{value:\"{colors.brand.primary.80.value}\"}},_active:{color:{value:\"{colors.font.inverse.value}\"},backgroundColor:{value:\"{colors.brand.primary.90.value}\"}},_disabled:{color:{value:\"{colors.font.disabled.value}\"}}},link:{backgroundColor:{value:\"transparent\"},borderColor:{value:\"transparent\"},borderWidth:{value:\"{space.zero.value}\"},color:{value:\"{colors.font.interactive.value}\"},_hover:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"{colors.brand.primary.10.value}\"},color:{value:\"{colors.font.hover.value}\"}},_focus:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"{colors.brand.primary.10.value}\"},color:{value:\"{colors.font.focus.value}\"},boxShadow:{value:\"{components.fieldcontrol._focus.boxShadow.value}\"}},_active:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"{colors.brand.primary.20.value}\"},color:{value:\"{colors.font.active.value}\"}},_disabled:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"transparent\"},color:{value:\"{colors.font.disabled.value}\"}},_loading:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"transparent\"},color:{value:\"{colors.font.disabled.value}\"}}},warning:{backgroundColor:{value:\"transparent\"},borderColor:{value:\"{colors.red.60}\"},borderWidth:{value:\"{borderWidths.small}\"},color:{value:\"{colors.red.60}\"},_hover:{borderColor:{value:\"{colors.red.80}\"},backgroundColor:{value:\"{colors.red.10}\"},color:{value:\"{colors.font.error}\"}},_focus:{borderColor:{value:\"{colors.red.80}\"},backgroundColor:{value:\"{colors.red.10}\"},color:{value:\"{colors.red.80}\"},boxShadow:{value:\"{components.fieldcontrol._error._focus.boxShadow}\"}},_active:{borderColor:{value:\"{colors.red.100}\"},backgroundColor:{value:\"{colors.red.20}\"},color:{value:\"{colors.red.100}\"}},_disabled:{borderColor:{value:\"{colors.border.tertiary}\"},backgroundColor:{value:\"transparent\"},color:{value:\"{colors.font.disabled}\"}},_loading:{borderColor:{value:\"{colors.border.tertiary}\"},backgroundColor:{value:\"transparent\"},color:{value:\"{colors.font.disabled}\"}}},destructive:{borderColor:{value:\"transparent\"},borderWidth:{value:\"{borderWidths.small}\"},borderStyle:{value:\"solid\"},backgroundColor:{value:\"{colors.red.60}\"},color:{value:\"{colors.font.inverse}\"},_disabled:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"{colors.background.disabled}\"},color:{value:\"{colors.font.disabled}\"}},_loading:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"{colors.background.disabled}\"},color:{value:\"{colors.font.disabled}\"}},_hover:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"{colors.red.80}\"},color:{value:\"{colors.font.inverse}\"}},_focus:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"{colors.red.80}\"},color:{value:\"{colors.font.inverse}\"},boxShadow:{value:\"{components.fieldcontrol._error._focus.boxShadow}\"}},_active:{borderColor:{value:\"transparent\"},backgroundColor:{value:\"{colors.red.100}\"},color:{value:\"{colors.font.inverse}\"}}},small:{fontSize:{value:\"{components.fieldcontrol.small.fontSize.value}\"},paddingBlockStart:{value:\"{components.fieldcontrol.small.paddingBlockStart.value}\"},paddingBlockEnd:{value:\"{components.fieldcontrol.small.paddingBlockEnd.value}\"},paddingInlineStart:{value:\"{components.fieldcontrol.small.paddingInlineStart.value}\"},paddingInlineEnd:{value:\"{components.fieldcontrol.small.paddingInlineEnd.value}\"}},large:{fontSize:{value:\"{components.fieldcontrol.large.fontSize.value}\"},paddingBlockStart:{value:\"{components.fieldcontrol.large.paddingBlockStart.value}\"},paddingBlockEnd:{value:\"{components.fieldcontrol.large.paddingBlockEnd.value}\"},paddingInlineStart:{value:\"{components.fieldcontrol.large.paddingInlineStart.value}\"},paddingInlineEnd:{value:\"{components.fieldcontrol.large.paddingInlineEnd.value}\"}},loaderWrapper:{alignItems:{value:\"center\"},gap:{value:\"{space.xs.value}\"}}};export{o as button};\n","const o={backgroundColor:{value:\"{colors.background.primary.value}\"},borderRadius:{value:\"{radii.xs.value}\"},borderWidth:{value:\"0\"},borderStyle:{value:\"solid\"},borderColor:{value:\"transparent\"},boxShadow:{value:\"none\"},padding:{value:\"{space.medium.value}\"},outlined:{backgroundColor:{value:\"{components.card.backgroundColor.value}\"},borderRadius:{value:\"{radii.xs.value}\"},borderWidth:{value:\"{borderWidths.small.value}\"},borderStyle:{value:\"solid\"},borderColor:{value:\"{colors.border.primary.value}\"},boxShadow:{value:\"{components.card.boxShadow.value}\"}},elevated:{backgroundColor:{value:\"{components.card.backgroundColor.value}\"},borderRadius:{value:\"{radii.xs.value}\"},borderWidth:{value:\"0\"},borderStyle:{value:\"solid\"},borderColor:{value:\"transparent\"},boxShadow:{value:\"{shadows.medium.value}\"}}};export{o as card};\n","const e={cursor:{value:\"pointer\"},alignItems:{value:\"center\"},_disabled:{cursor:{value:\"not-allowed\"}},button:{position:{value:\"relative\"},alignItems:{value:\"center\"},justifyContent:{value:\"center\"},color:{value:\"{colors.font.inverse.value}\"},before:{width:{value:\"100%\"},height:{value:\"100%\"},borderWidth:{value:\"{borderWidths.medium.value}\"},borderRadius:{value:\"20%\"},borderStyle:{value:\"solid\"},borderColor:{value:\"{colors.border.primary.value}\"}},_focus:{outlineColor:{value:\"{colors.transparent.value}\"},outlineStyle:{value:\"solid\"},outlineWidth:{value:\"{outlineWidths.medium.value}\"},outlineOffset:{value:\"{outlineOffsets.medium.value}\"},borderColor:{value:\"{colors.transparent.value}\"},boxShadow:{value:{offsetX:\"0px\",offsetY:\"0px\",blurRadius:\"0px\",spreadRadius:\"2px\",color:\"{colors.border.focus.value}\"}}},_disabled:{borderColor:{value:\"{colors.border.disabled.value}\"}},_error:{borderColor:{value:\"{colors.border.error.value}\"},_focus:{borderColor:{value:\"{colors.transparent.value}\"},boxShadow:{value:{offsetX:\"0px\",offsetY:\"0px\",blurRadius:\"0px\",spreadRadius:\"2px\",color:\"{colors.border.error.value}\"}}}}},icon:{backgroundColor:{value:\"{colors.brand.primary.80.value}\"},borderRadius:{value:\"20%\"},opacity:{value:\"{opacities.0.value}\"},transform:{value:\"scale(0)\"},transitionProperty:{value:\"all\"},transitionDuration:{value:\"{time.short.value}\"},transitionTimingFunction:{value:\"ease-in-out\"},_checked:{opacity:{value:\"{opacities.100.value}\"},transform:{value:\"scale(1)\"},_disabled:{backgroundColor:{value:\"{colors.background.disabled.value}\"}}},_indeterminate:{opacity:{value:\"{opacities.100.value}\"},transform:{value:\"scale(1)\"},_disabled:{backgroundColor:{value:\"{colors.background.disabled.value}\"}}}},label:{_disabled:{color:{value:\"{colors.font.disabled.value}\"}}}};export{e as checkbox};\n","const e={alignItems:{value:\"flex-start\"},alignContent:{value:\"center\"},flexDirection:{value:\"column\"},justifyContent:{value:\"center\"}};export{e as checkboxfield};\n","const o={pagination:{current:{color:{value:\"{components.pagination.current.color}\"},backgroundColor:{value:\"{components.pagination.current.backgroundColor}\"}},button:{color:{value:\"{components.pagination.button.color}\"},_hover:{backgroundColor:{value:\"{components.pagination.button.hover.backgroundColor}\"},color:{value:\"{components.pagination.button.hover.color}\"}},_disabled:{color:{value:\"{components.pagination.button.disabled.color}\"}}}},search:{input:{color:{value:\"{components.searchfield.color}\"}},button:{color:{value:\"{components.searchfield.button.color}\"},_active:{backgroundColor:{value:\"{components.searchfield.button._active.backgroundColor}\"},borderColor:{value:\"{components.searchfield.button._active.borderColor}\"},color:{value:\"{components.searchfield.button._active.color}\"}},_disabled:{backgroundColor:{value:\"{components.searchfield.button._disabled.backgroundColor}\"},borderColor:{value:\"{components.searchfield.button._disabled.borderColor}\"},color:{value:\"{components.searchfield.button._disabled.color}\"}},_focus:{backgroundColor:{value:\"{components.searchfield.button._focus.backgroundColor}\"},borderColor:{value:\"{components.searchfield.button._focus.borderColor}\"},color:{value:\"{components.searchfield.button._focus.color}\"}},_hover:{backgroundColor:{value:\"{components.searchfield.button._hover.backgroundColor}\"},borderColor:{value:\"{components.searchfield.button._hover.borderColor}\"},color:{value:\"{components.searchfield.button._hover.color}\"}}}}};export{o as collection};\n","const e={fontSize:{value:\"{fontSizes.xs}\"},gap:{value:\"{space.relative.medium}\"},svg:{path:{fill:{value:\"{colors.font.primary}\"}}},toolTip:{bottom:{value:\"{space.large}\"},color:{value:\"{colors.teal.100}\"},fontSize:{value:\"{fontSizes.xxs}\"}}};export{e as copy};\n","const e={height:{value:\"{space.relative.full.value}\"}};export{e as dialcodeselect};\n","const e={borderStyle:{value:\"solid\"},borderColor:{value:\"{colors.border.primary.value}\"},borderWidth:{value:\"{borderWidths.medium.value}\"},label:{color:{value:\"{colors.font.tertiary.value}\"},paddingInline:{value:\"{space.medium.value}\"},fontSize:{value:\"{fontSizes.small.value}\"},backgroundColor:{value:\"{colors.background.primary.value}\"}},small:{borderWidth:{value:\"{borderWidths.small.value}\"}},large:{borderWidth:{value:\"{borderWidths.large.value}\"}},opacity:{value:\"{opacities.60.value}\"}};export{e as divider};\n","const a={display:{value:\"block\"},backgroundColor:{value:\"{colors.background.primary.value}\"},borderRadius:{value:\"{radii.medium.value}\"},boxShadow:{value:\"{shadows.large.value}\"},width:{value:\"100%\"},item:{marginTop:{value:\"1px\"},boxShadow:{value:\"{shadows.small.value}\"},borderBottomLeftRadius:{value:\"{radii.medium.value}\"},borderBottomRightRadius:{value:\"{radii.medium.value}\"},borderTopLeftRadius:{value:\"{radii.medium.value}\"},borderTopRightRadius:{value:\"{radii.medium.value}\"},borderStartStartRadius:{value:\"{radii.medium.value}\"},borderStartEndRadius:{value:\"{radii.medium.value}\"},borderEndStartRadius:{value:\"{radii.medium.value}\"},borderEndEndRadius:{value:\"{radii.medium.value}\"},_focus:{boxShadow:{value:{offsetX:\"0\",offsetY:\"0\",blurRadius:\"0\",spreadRadius:\"2px\",color:\"{colors.border.focus.value}\"}}}},header:{boxShadow:{value:{offsetX:\"0\",offsetY:\"1px\",blurRadius:\"0\",color:\"{colors.overlay.20.value}\"}}},trigger:{minHeight:{value:\"3rem\"},paddingInlineStart:{value:\"{space.large.value}\"},paddingInlineEnd:{value:\"{space.large.value}\"},alignItems:{value:\"center\"},justifyContent:{value:\"space-between\"},_hover:{backgroundColor:{value:\"{colors.overlay.10.value}\"}}},content:{paddingInlineStart:{value:\"{space.large.value}\"},paddingInlineEnd:{value:\"{space.large.value}\"},text:{color:{value:\"{colors.font.secondary.value}\"},paddingBlockStart:{value:\"{space.medium.value}\"},paddingBlockEnd:{value:\"{space.medium.value}\"}},_open:{animationDuration:{value:\"{time.medium.value}\"},animationTimingFunction:{value:\"cubic-bezier(0.87, 0, 0.13, 1)\"}},_closed:{animationDuration:{value:\"{time.medium.value}\"},animationTimingFunction:{value:\"cubic-bezier(0.87, 0, 0.13, 1)\"}}},icon:{transitionDuration:{value:\"{time.medium.value}\"},transitionTimingFunction:{value:\"cubic-bezier(0.87, 0, 0.13, 1)\"}}};export{a as expander};\n","const e={gap:{value:\"{space.xs.value}\"},fontSize:{value:\"{fontSizes.medium.value}\"},flexDirection:{value:\"column\"},small:{gap:{value:\"{space.xxxs.value}\"},fontSize:{value:\"{fontSizes.small.value}\"}},large:{gap:{value:\"{space.small.value}\"},fontSize:{value:\"{fontSizes.large.value}\"}},label:{color:{value:\"{colors.font.secondary.value}\"}}};export{e as field};\n","const e={borderStyle:{value:\"solid\"},borderColor:{value:\"{colors.border.primary.value}\"},borderWidth:{value:\"{borderWidths.small.value}\"},borderRadius:{value:\"{radii.small.value}\"},color:{value:\"{colors.font.primary.value}\"},paddingBlockStart:{value:\"{space.xs.value}\"},paddingBlockEnd:{value:\"{space.xs.value}\"},paddingInlineStart:{value:\"{space.medium.value}\"},paddingInlineEnd:{value:\"{space.medium.value}\"},fontSize:{value:\"{components.field.fontSize.value}\"},lineHeight:{value:\"{lineHeights.medium.value}\"},transitionDuration:{value:\"{time.medium.value}\"},outlineColor:{value:\"{colors.transparent.value}\"},outlineStyle:{value:\"solid\"},outlineWidth:{value:\"{outlineWidths.medium.value}\"},outlineOffset:{value:\"{outlineOffsets.medium.value}\"},small:{fontSize:{value:\"{components.field.small.fontSize.value}\"},paddingBlockStart:{value:\"{space.xxs.value}\"},paddingBlockEnd:{value:\"{space.xxs.value}\"},paddingInlineStart:{value:\"{space.small.value}\"},paddingInlineEnd:{value:\"{space.small.value}\"}},large:{fontSize:{value:\"{components.field.large.fontSize.value}\"},paddingBlockStart:{value:\"{space.xs.value}\"},paddingBlockEnd:{value:\"{space.xs.value}\"},paddingInlineStart:{value:\"{space.medium.value}\"},paddingInlineEnd:{value:\"{space.medium.value}\"}},quiet:{borderStyle:{value:\"none\"},borderInlineStart:{value:\"none\"},borderInlineEnd:{value:\"none\"},borderBlockStart:{value:\"none\"},borderRadius:{value:\"0\"},_focus:{borderBlockEndColor:{value:\"{colors.border.focus.value}\"},boxShadow:{value:{offsetX:\"0px\",offsetY:\"1px\",color:\"{colors.border.focus.value}\",blurRadius:\"0px\"}}},_error:{borderBlockEndColor:{value:\"{colors.border.error.value}\"},_focus:{boxShadow:{value:{offsetX:\"0px\",offsetY:\"1px\",color:\"{colors.border.error.value}\",blurRadius:\"0px\"}}}}},_focus:{borderColor:{value:\"{colors.border.focus.value}\"},boxShadow:{value:{offsetX:\"0px\",offsetY:\"0px\",blurRadius:\"0px\",spreadRadius:\"1px\",color:\"{colors.border.focus.value}\"}}},_disabled:{color:{value:\"{colors.font.disabled.value}\"},cursor:{value:\"not-allowed\"},borderColor:{value:\"{colors.transparent.value}\"},backgroundColor:{value:\"{colors.background.disabled.value}\"}},_error:{borderColor:{value:\"{colors.border.error.value}\"},_focus:{boxShadow:{value:{offsetX:\"0px\",offsetY:\"0px\",blurRadius:\"0px\",spreadRadius:\"1px\",color:\"{colors.border.error.value}\"}}}}};export{e as fieldcontrol};\n","const e={gap:{value:\"{space.zero.value}\"},vertical:{alignItems:{value:\"center\"}},outer:{alignItems:{value:\"center\"}}};export{e as fieldgroup};\n","const o={error:{color:{value:\"{colors.font.error.value}\"},fontSize:{value:\"{fontSizes.small.value}\"}},description:{color:{value:\"{colors.font.secondary.value}\"},fontStyle:{value:\"italic\"},fontSize:{value:\"{fontSizes.small.value}\"}}};export{o as fieldmessages};\n","const e={dropzone:{backgroundColor:{value:\"{colors.background.primary}\"},borderRadius:{value:\"{radii.small}\"},borderColor:{value:\"{colors.border.primary}\"},borderStyle:{value:\"dashed\"},borderWidth:{value:\"{borderWidths.small}\"},gap:{value:\"{space.small}\"},paddingBlock:{value:\"{space.xl}\"},paddingInline:{value:\"{space.large}\"},textAlign:{value:\"center\"},_active:{backgroundColor:{value:\"{colors.brand.primary.10}\"},borderRadius:{value:\"{components.fileuploader.dropzone.borderRadius}\"},borderColor:{value:\"{colors.border.pressed}\"},borderStyle:{value:\"{components.fileuploader.dropzone.borderStyle}\"},borderWidth:{value:\"{borderWidths.medium}\"}},icon:{color:{value:\"{colors.border.primary}\"},fontSize:{value:\"{fontSizes.xxl}\"}},text:{color:{value:\"{colors.font.tertiary}\"},fontSize:{value:\"{fontSizes.medium}\"},fontWeight:{value:\"{fontWeights.bold}\"}}},file:{backgroundColor:{value:\"{colors.background.primary}\"},borderRadius:{value:\"{radii.small}\"},borderColor:{value:\"{colors.border.primary}\"},borderStyle:{value:\"solid\"},borderWidth:{value:\"{borderWidths.small}\"},paddingBlock:{value:\"{space.xs}\"},paddingInline:{value:\"{space.small}\"},gap:{value:\"{space.small}\"},alignItems:{value:\"baseline\"},name:{fontSize:{value:\"{fontSizes.medium}\"},fontWeight:{value:\"{fontWeights.bold}\"},color:{value:\"{colors.font.primary}\"}},size:{fontSize:{value:\"{fontSizes.small}\"},fontWeight:{value:\"{fontWeights.normal}\"},color:{value:\"{colors.font.tertiary}\"}},image:{width:{value:\"{space.xxl}\"},height:{value:\"{space.xxl}\"},backgroundColor:{value:\"{colors.background.secondary}\"},color:{value:\"{colors.font.tertiary}\"},borderRadius:{value:\"{radii.small}\"}}},loader:{strokeLinecap:{value:\"round\"},strokeEmpty:{value:\"{colors.border.secondary}\"},strokeFilled:{value:\"{components.loader.strokeFilled}\"},strokeWidth:{value:\"{borderWidths.large}\"}},previewer:{backgroundColor:{value:\"{colors.background.primary}\"},borderColor:{value:\"{colors.border.primary}\"},borderStyle:{value:\"solid\"},borderWidth:{value:\"{borderWidths.small}\"},borderRadius:{value:\"{radii.small}\"},paddingBlock:{value:\"{space.zero}\"},paddingInline:{value:\"{space.zero}\"},maxHeight:{value:\"40rem\"},maxWidth:{value:\"auto\"},text:{fontSize:{value:\"{fontSizes.medium}\"},fontWeight:{value:\"{fontWeights.bold}\"},color:{value:\"{colors.font.primary}\"}},body:{paddingBlock:{value:\"{space.medium}\"},paddingInline:{value:\"{space.medium}\"},gap:{value:\"{space.small}\"}},footer:{borderColor:{value:\"{colors.border.secondary}\"},borderStyle:{value:\"solid\"},borderWidth:{value:\"{borderWidths.small}\"},paddingBlock:{value:\"{space.medium}\"},paddingInline:{value:\"{space.medium}\"},justifyContent:{value:\"space-between\"}}}};export{e as fileuploader};\n","const a={gap:{value:\"{space.medium.value}\"},justifyContent:{value:\"normal\"},alignItems:{value:\"stretch\"},alignContent:{value:\"normal\"},flexWrap:{value:\"nowrap\"}};export{a as flex};\n","const e={color:{value:\"{colors.font.primary.value}\"},lineHeight:{value:\"{lineHeights.small.value}\"},1:{fontSize:{value:\"{fontSizes.xxxxl.value}\"},fontWeight:{value:\"{fontWeights.light.value}\"}},2:{fontSize:{value:\"{fontSizes.xxxl.value}\"},fontWeight:{value:\"{fontWeights.normal.value}\"}},3:{fontSize:{value:\"{fontSizes.xxl.value}\"},fontWeight:{value:\"{fontWeights.medium.value}\"}},4:{fontSize:{value:\"{fontSizes.xl.value}\"},fontWeight:{value:\"{fontWeights.semibold.value}\"}},5:{fontSize:{value:\"{fontSizes.large.value}\"},fontWeight:{value:\"{fontWeights.bold.value}\"}},6:{fontSize:{value:\"{fontSizes.medium.value}\"},fontWeight:{value:\"{fontWeights.extrabold.value}\"}}};export{e as heading};\n","const t={highlighted:{fontWeight:{value:\"{fontWeights.bold}\"}}};export{t as highlightmatch};\n","const e={lineHeight:{value:1},height:{value:\"1em\"}};export{e as icon};\n","const i={maxWidth:{value:\"100%\"},height:{value:\"auto\"},objectFit:{value:\"initial\"},objectPosition:{value:\"initial\"}};export{i as image};\n","const e={banner:{height:{value:\"150px \"},width:{value:\"400px \"}},button:{backgroundColor:{value:\"#e8e8e8\"},borderRadius:{value:\"5px\"},color:{value:\"black\"}},dialog:{height:{value:\"50vh\"},minHeight:{value:\"400px\"},minWidth:{value:\"400px\"},width:{value:\"30vw\"}},header:{fontSize:{value:\"{fontSizes.medium.value}\"},fontWeight:{value:\"{fontWeights.extrabold.value}\"}}};export{e as inappmessaging};\n","const o={active:{color:{value:\"{colors.font.active.value}\"}},color:{value:\"{colors.font.interactive.value}\"},focus:{color:{value:\"{colors.font.focus.value}\"}},hover:{color:{value:\"{colors.font.hover.value}\"}},visited:{color:{value:\"{colors.font.interactive.value}\"}}};export{o as link};\n","const o={cameraModule:{backgroundColor:{value:\"{colors.black}\"}}};export{o as liveness};\n","const e={width:{value:\"{fontSizes.medium.value}\"},height:{value:\"{fontSizes.medium.value}\"},fontSize:{value:\"{fontSizes.xs.value}\"},strokeEmpty:{value:\"{colors.neutral.20.value}\"},strokeFilled:{value:\"{colors.brand.primary.80.value}\"},strokeLinecap:{value:\"round\"},animationDuration:{value:\"1s\"},small:{width:{value:\"{fontSizes.small.value}\"},height:{value:\"{fontSizes.small.value}\"},fontSize:{value:\"{fontSizes.xxs.value}\"}},large:{width:{value:\"{fontSizes.large.value}\"},height:{value:\"{fontSizes.large.value}\"},fontSize:{value:\"{fontSizes.small.value}\"}},linear:{width:{value:\"100%\"},minWidth:{value:\"5rem\"},fontSize:{value:\"{fontSizes.medium.value}\"},strokeWidth:{value:\"{fontSizes.medium.value}\"},strokeFilled:{value:\"{colors.brand.primary.80.value}\"},strokeEmpty:{value:\"{colors.neutral.20.value}\"},strokeLinecap:{value:\"round\"},animationDuration:{value:\"1s\"},small:{strokeWidth:{value:\"{fontSizes.small.value}\"},fontSize:{value:\"{fontSizes.small.value}\"}},large:{strokeWidth:{value:\"{fontSizes.large.value}\"},fontSize:{value:\"{fontSizes.large.value}\"}}},text:{fill:{value:\"{colors.font.primary.value}\"}}};export{e as loader};\n","const e={backgroundColor:{value:\"{colors.background.primary.value}\"},borderRadius:{value:\"{radii.medium.value}\"},borderWidth:{value:\"{borderWidths.small.value}\"},borderStyle:{value:\"solid\"},borderColor:{value:\"{colors.border.primary.value}\"},boxShadow:{value:\"{shadows.large.value}\"},flexDirection:{value:\"column\"},gap:{value:\"{space.zero.value}\"},maxWidth:{value:\"30rem\"},minWidth:{value:\"14rem\"},small:{width:{value:\"{fontSizes.medium.value}\"},height:{value:\"{fontSizes.medium.value}\"}},large:{width:{value:\"{fontSizes.xxxl.value}\"},height:{value:\"{fontSizes.xxxl.value}\"}},item:{minHeight:{value:\"2.5rem\"},paddingInlineStart:{value:\"{space.medium.value}\"},paddingInlineEnd:{value:\"{space.medium.value}\"}}};export{e as menu};\n","const e={current:{alignItems:{value:\"center\"},justifyContent:{value:\"center\"},color:{value:\"{colors.font.inverse.value}\"},fontSize:{value:\"{fontSizes.small.value}\"},backgroundColor:{value:\"{colors.overlay.40.value}\"}},button:{color:{value:\"{colors.font.primary.value}\"},paddingInlineStart:{value:\"{space.xxs.value}\"},paddingInlineEnd:{value:\"{space.xxs.value}\"},transitionProperty:{value:\"background-color\"},transitionDuration:{value:\"{time.medium.value}\"},hover:{backgroundColor:{value:\"{colors.overlay.10.value}\"},color:{value:\"{colors.font.primary.value}\"}},disabled:{color:{value:\"{colors.font.disabled.value}\"}}},ellipsis:{alignItems:{value:\"baseline\"},justifyContent:{value:\"center\"},paddingInlineStart:{value:\"{space.xs.value}\"},paddingInlineEnd:{value:\"{space.xs.value}\"}},itemContainer:{marginLeft:{value:\"{space.xxxs.value}\"},marginRight:{value:\"{space.xxxs.value}\"}},itemShared:{height:{value:\"{fontSizes.xxl.value}\"},minWidth:{value:\"{fontSizes.xxl.value}\"},borderRadius:{value:\"{fontSizes.medium.value}\"}}};export{e as pagination};\n","const o={color:{value:\"{components.fieldcontrol.color.value}\"},button:{color:{value:\"{components.button.color.value}\"},_active:{backgroundColor:{value:\"{components.button._active.backgroundColor.value}\"},borderColor:{value:\"{components.button._active.borderColor.value}\"},color:{value:\"{components.button._active.color.value}\"}},_disabled:{backgroundColor:{value:\"{components.button._disabled.backgroundColor.value}\"},borderColor:{value:\"{components.button._disabled.borderColor.value}\"},color:{value:\"{components.button._disabled.color.value}\"}},_focus:{backgroundColor:{value:\"{components.button._focus.backgroundColor.value}\"},borderColor:{value:\"{components.button._focus.borderColor.value}\"},color:{value:\"{components.button._focus.color.value}\"}},_hover:{backgroundColor:{value:\"{components.button._hover.backgroundColor.value}\"},borderColor:{value:\"{components.button._hover.borderColor.value}\"},color:{value:\"{components.button._hover.color.value}\"}}}};export{o as passwordfield};\n","const o={color:{value:\"{components.fieldcontrol.color}\"},borderColor:{value:\"{components.fieldcontrol.borderColor}\"},fontSize:{value:\"{components.fieldcontrol.fontSize}\"},_focus:{borderColor:{value:\"{components.fieldcontrol._focus.borderColor}\"}}};export{o as phonenumberfield};\n","const a={borderRadius:{value:\"{radii.small.value}\"},transitionDuration:{value:\"{time.long.value}\"},startColor:{value:\"{colors.background.secondary.value}\"},endColor:{value:\"{colors.background.tertiary.value}\"},small:{height:{value:\"{space.small.value}\"}},default:{height:{value:\"{space.medium.value}\"}},large:{height:{value:\"{space.large.value}\"}}};export{a as placeholder};\n","const e={alignItems:{value:\"center\"},justifyContent:{value:\"flex-start\"},gap:{value:\"inherit\"},_disabled:{cursor:{value:\"not-allowed\"}},button:{alignItems:{value:\"center\"},justifyContent:{value:\"center\"},width:{value:\"{fontSizes.medium.value}\"},height:{value:\"{fontSizes.medium.value}\"},boxSizing:{value:\"border-box\"},borderWidth:{value:\"{borderWidths.medium.value}\"},borderStyle:{value:\"solid\"},borderRadius:{value:\"50%\"},borderColor:{value:\"{colors.border.primary.value}\"},color:{value:\"{colors.background.primary.value}\"},backgroundColor:{value:\"{colors.background.primary.value}\"},transitionProperty:{value:\"all\"},transitionDuration:{value:\"{time.medium.value}\"},outlineColor:{value:\"{colors.transparent.value}\"},outlineStyle:{value:\"solid\"},outlineWidth:{value:\"{outlineWidths.medium.value}\"},outlineOffset:{value:\"{outlineOffsets.medium.value}\"},padding:{value:\"{borderWidths.medium.value}\"},small:{width:{value:\"{fontSizes.small.value}\"},height:{value:\"{fontSizes.small.value}\"}},large:{width:{value:\"{fontSizes.large.value}\"},height:{value:\"{fontSizes.large.value}\"}},_checked:{color:{value:\"{colors.brand.primary.80.value}\"},_disabled:{color:{value:\"{colors.background.disabled.value}\"}}},_focus:{borderColor:{value:\"{colors.border.focus.value}\"},boxShadow:{value:\"{components.fieldcontrol._focus.boxShadow.value}\"}},_error:{borderColor:{value:\"{colors.border.error.value}\"},_focus:{boxShadow:{value:\"{components.fieldcontrol._error._focus.boxShadow.value}\"}}},_disabled:{borderColor:{value:\"{colors.border.disabled.value}\"},backgroundColor:{value:\"{colors.background.primary.value}\"}}},label:{color:{value:\"{components.text.color.value}\"},_disabled:{color:{value:\"{colors.font.disabled.value}\"}}}};export{e as radio};\n","const o={radio:{borderWidth:{value:\"{components.radio.button.borderWidth}\"},borderColor:{value:\"{components.radio.button.borderColor}\"},backgroundColor:{value:\"{components.radio.button.backgroundColor}\"},_checked:{color:{value:\"{components.radio.button._checked.color}\"}},label:{color:{value:\"{components.radio.label.color}\"}}},label:{color:{value:\"{components.field.label.color}\"}}};export{o as radiogroup};\n","const l={large:{size:{value:\"{fontSizes.xxxl.value}\"}},default:{size:{value:\"{fontSizes.xl.value}\"}},small:{size:{value:\"{fontSizes.small.value}\"}},filled:{color:{value:\"{colors.brand.secondary.80.value}\"}},empty:{color:{value:\"{colors.background.tertiary.value}\"}}};export{l as rating};\n","const o={color:{value:\"{components.fieldcontrol.color.value}\"},button:{color:{value:\"{components.button.color.value}\"},backgroundColor:{value:\"{colors.background.primary.value}\"},_active:{backgroundColor:{value:\"{components.button._active.backgroundColor.value}\"},borderColor:{value:\"{components.button._active.borderColor.value}\"},color:{value:\"{components.button._active.color.value}\"}},_disabled:{backgroundColor:{value:\"{components.button._disabled.backgroundColor.value}\"},borderColor:{value:\"{components.button._disabled.borderColor.value}\"},color:{value:\"{components.button._disabled.color.value}\"}},_focus:{backgroundColor:{value:\"{components.button._focus.backgroundColor.value}\"},borderColor:{value:\"{components.button._focus.borderColor.value}\"},color:{value:\"{components.button._focus.color.value}\"}},_hover:{backgroundColor:{value:\"{components.button._hover.backgroundColor.value}\"},borderColor:{value:\"{components.button._hover.borderColor.value}\"},color:{value:\"{components.button._hover.color.value}\"}}}};export{o as searchfield};\n","const e={paddingInlineEnd:{value:\"{space.xxl.value}\"},wrapper:{flex:{value:\"1\"},display:{value:\"block\"},position:{value:\"relative\"},cursor:{value:\"pointer\"}},iconWrapper:{alignItems:{value:\"center\"},position:{value:\"absolute\"},top:{value:\"50%\"},right:{value:\"{space.medium.value}\"},transform:{value:\"translateY(-50%)\"},pointerEvents:{value:\"none\"}},option:{backgroundColor:{value:\"{colors.background.primary.value}\"},color:{value:\"{colors.font.primary.value}\"},_disabled:{color:{value:\"{colors.font.disabled.value}\"}}},whiteSpace:{value:\"nowrap\"},minWidth:{value:\"6.5rem\"},small:{minWidth:{value:\"5.5rem\"}},large:{minWidth:{value:\"7.5rem\"}}};export{e as select};\n","const o={borderColor:{value:\"{components.fieldcontrol.borderColor}\"},color:{value:\"{components.fieldcontrol.color}\"},flexDirection:{value:\"column\"},fontSize:{value:\"{components.fieldcontrol.fontSize}\"},_focus:{borderColor:{value:\"{components.fieldcontrol._focus.borderColor}\"}},label:{color:{value:\"{components.field.label.color}\"}}};export{o as selectfield};\n","const r={paddingBlock:{value:\"{space.xs.value}\"},track:{backgroundColor:{value:\"{colors.background.quaternary.value}\"},borderRadius:{value:\"9999px\"},height:{value:\"0.375rem\"},minWidth:{value:\"10rem\"}},range:{backgroundColor:{value:\"{colors.brand.primary.80.value}\"},borderRadius:{value:\"9999px\"},_disabled:{backgroundColor:{value:\"{colors.background.disabled.value}\"}}},thumb:{width:{value:\"1.25rem\"},height:{value:\"1.25rem\"},backgroundColor:{value:\"{colors.background.primary.value}\"},boxShadow:{value:\"{shadows.small.value}\"},borderRadius:{value:\"50%\"},borderWidth:{value:\"{borderWidths.medium.value}\"},borderColor:{value:\"{colors.border.primary.value}\"},borderStyle:{value:\"solid\"},_disabled:{backgroundColor:{value:\"{colors.background.disabled.value}\"},borderColor:{value:\"transparent\"},boxShadow:{value:\"none\"}},_hover:{backgroundColor:{value:\"{colors.background.primary.value}\"},borderColor:{value:\"{colors.border.focus.value}\"}},_focus:{borderColor:{value:\"{colors.border.focus.value}\"},boxShadow:{value:{offsetX:\"0\",offsetY:\"0\",blurRadius:\"0\",spreadRadius:\"2px\",color:\"{colors.border.focus.value}\"}}}},small:{track:{height:{value:\"0.25rem\"}},thumb:{width:{value:\"1rem\"},height:{value:\"1rem\"}}},large:{track:{height:{value:\"0.625rem\"}},thumb:{width:{value:\"1.5rem\"},height:{value:\"1.5rem\"}}}};export{r as sliderfield};\n","const o={borderColor:{value:\"{components.fieldcontrol.borderColor}\"},flexDirection:{value:\"column\"},input:{color:{value:\"{components.fieldcontrol.color}\"},fontSize:{value:\"{components.fieldcontrol.fontSize}\"},textAlign:{value:\"center\"}},button:{color:{value:\"{components.button.color}\"},backgroundColor:{value:\"{colors.transparent}\"},_active:{color:{value:\"{components.button._active.color}\"},backgroundColor:{value:\"{components.button._active.backgroundColor}\"}},_focus:{color:{value:\"{components.button._focus.color}\"},backgroundColor:{value:\"{components.button._focus.backgroundColor}\"}},_disabled:{color:{value:\"{components.button._disabled.color}\"},backgroundColor:{value:\"{components.fieldcontrol._disabled.backgroundColor}\"}},_hover:{color:{value:\"{components.button._hover.color}\"},backgroundColor:{value:\"{components.button._hover.backgroundColor}\"}}}};export{o as stepperfield};\n","import{fileuploader as e}from\"./fileUploader.mjs\";const s=Object.assign(Object.assign({},e),{filelist:{flexDirection:\"column\",gap:\"{space.small}\"}});export{s as storagemanager};\n","const e={_disabled:{opacity:{value:\"{opacities.60.value}\"}},_focused:{shadow:{value:{offsetX:\"0px\",offsetY:\"0px\",blurRadius:\"0px\",spreadRadius:\"2px\",color:\"{colors.border.focus.value}\"}}},fontSize:{value:\"{fontSizes.medium.value}\"},large:{fontSize:{value:\"{fontSizes.large.value}\"}},small:{fontSize:{value:\"{fontSizes.small.value}\"}},label:{padding:{value:\"{space.xs.value}\"}},thumb:{backgroundColor:{value:\"{colors.background.primary.value}\"},borderColor:{value:\"{colors.border.tertiary.value}\"},borderRadius:{value:\"{radii.xxxl.value}\"},checked:{transform:{value:\"{transforms.slideX.medium.value}\"}},transition:{duration:{value:\"{time.medium.value}\"}},width:{value:\"{space.relative.medium.value}\"}},track:{backgroundColor:{value:\"{colors.background.quaternary.value}\"},borderRadius:{value:\"{radii.xxxl.value}\"},checked:{backgroundColor:{value:\"{colors.brand.primary.80.value}\"}},height:{value:\"{space.relative.medium.value}\"},padding:{value:\"{outlineWidths.medium.value}\"},transition:{duration:{value:\"{time.short.value}\"}},width:{value:\"{space.relative.xl.value}\"},_error:{backgroundColor:{value:\"{colors.background.error.value}\"}}}};export{e as switchfield};\n","const e={borderCollapse:{value:\"collapse\"},display:{value:\"table\"},width:{value:\"100%\"},head:{display:{value:\"table-header-group\"},verticalAlign:{value:\"middle\"}},body:{display:{value:\"table-row-group\"},verticalAlign:{value:\"middle\"}},foot:{display:{value:\"table-footer-group\"},verticalAlign:{value:\"middle\"}},row:{display:{value:\"table-row\"},verticalAlign:{value:\"middle\"},hover:{backgroundColor:{value:\"{colors.background.tertiary.value}\"}},striped:{backgroundColor:{value:\"{colors.background.secondary.value}\"}}},header:{borderColor:{value:\"{colors.border.tertiary.value}\"},borderStyle:{value:\"solid\"},borderWidth:{value:\"{borderWidths.small.value}\"},color:{value:\"{colors.font.primary.value}\"},display:{value:\"table-cell\"},fontSize:{value:\"{fontSizes.medium.value}\"},fontWeight:{value:\"{fontWeights.bold.value}\"},padding:{value:\"{space.medium.value}\"},verticalAlign:{value:\"middle\"},large:{fontSize:{value:\"{fontSizes.large.value}\"},padding:{value:\"{space.large.value}\"}},small:{fontSize:{value:\"{fontSizes.small.value}\"},padding:{value:\"{space.xs.value}\"}}},data:{borderColor:{value:\"{colors.border.tertiary.value}\"},borderStyle:{value:\"solid\"},borderWidth:{value:\"{borderWidths.small.value}\"},color:{value:\"{colors.font.primary.value}\"},display:{value:\"table-cell\"},fontSize:{value:\"{fontSizes.medium.value}\"},fontWeight:{value:\"{fontWeights.normal.value}\"},padding:{value:\"{space.medium.value}\"},verticalAlign:{value:\"middle\"},large:{fontSize:{value:\"{fontSizes.large.value}\"},padding:{value:\"{space.large.value}\"}},small:{fontSize:{value:\"{fontSizes.small.value}\"},padding:{value:\"{space.xs.value}\"}}},caption:{captionSide:{value:\"bottom\"},color:{value:\"{colors.font.primary.value}\"},display:{value:\"table-caption\"},fontSize:{value:\"{fontSizes.medium.value}\"},textAlign:{value:\"center\"},wordBreak:{value:\"break-all\"},large:{fontSize:{value:\"{fontSizes.large.value}\"}},small:{fontSize:{value:\"{fontSizes.small.value}\"}}}};export{e as table};\n","const e={backgroundColor:{value:\"transparent\"},borderColor:{value:\"{colors.border.secondary.value}\"},borderStyle:{value:\"solid\"},borderWidth:{value:\"{borderWidths.medium.value}\"},gap:{value:\"0\"},item:{backgroundColor:{value:\"transparent\"},borderColor:{value:\"{colors.border.secondary.value}\"},borderStyle:{value:\"solid\"},borderWidth:{value:\"{borderWidths.medium.value}\"},color:{value:\"{colors.font.secondary.value}\"},fontSize:{value:\"{fontSizes.medium.value}\"},fontWeight:{value:\"{fontWeights.bold.value}\"},paddingVertical:{value:\"{space.small.value}\"},paddingHorizontal:{value:\"{space.medium.value}\"},textAlign:{value:\"center\"},transitionDuration:{value:\"{time.medium.value}\"},_hover:{color:{value:\"{colors.font.hover.value}\"}},_focus:{color:{value:\"{colors.font.focus.value}\"}},_active:{color:{value:\"{colors.font.interactive.value}\"},borderColor:{value:\"{colors.font.interactive.value}\"},backgroundColor:{value:\"transparent\"}},_disabled:{color:{value:\"{colors.font.disabled.value}\"},backgroundColor:{value:\"transparent\"},borderColor:{value:\"{colors.border.tertiary.value}\"}}}};export{e as tabs};\n","const o={color:{value:\"{colors.font.primary.value}\"},primary:{color:{value:\"{colors.font.primary.value}\"}},secondary:{color:{value:\"{colors.font.secondary.value}\"}},tertiary:{color:{value:\"{colors.font.tertiary.value}\"}},error:{color:{value:\"{colors.font.error.value}\"}},warning:{color:{value:\"{colors.font.warning.value}\"}},success:{color:{value:\"{colors.font.success.value}\"}},info:{color:{value:\"{colors.font.info.value}\"}}};export{o as text};\n","const o={color:{value:\"{components.fieldcontrol.color.value}\"},borderColor:{value:\"{components.fieldcontrol.borderColor.value}\"},_focus:{borderColor:{value:\"{components.fieldcontrol._focus.borderColor.value}\"}}};export{o as textareafield};\n","const o={color:{value:\"{components.fieldcontrol.color.value}\"},borderColor:{value:\"{components.fieldcontrol.borderColor.value}\"},fontSize:{value:\"{components.fieldcontrol.fontSize.value}\"},_focus:{borderColor:{value:\"{components.fieldcontrol._focus.borderColor.value}\"}}};export{o as textfield};\n","const o={borderColor:{value:\"{colors.border.primary.value}\"},color:{value:\"{colors.font.primary.value}\"},_hover:{backgroundColor:{value:\"{colors.overlay.10.value}\"}},_focus:{borderColor:{value:\"{colors.border.focus.value}\"},color:{value:\"{colors.font.primary.value}\"}},_active:{backgroundColor:{value:\"{colors.transparent.value}\"}},_disabled:{backgroundColor:{value:\"{colors.transparent.value}\"},borderColor:{value:\"{colors.border.disabled.value}\"},color:{value:\"{colors.font.disabled.value}\"}},_pressed:{borderColor:{value:\"{colors.border.pressed.value}\"},color:{value:\"{colors.font.primary.value}\"},backgroundColor:{value:\"{colors.overlay.20.value}\"},_hover:{backgroundColor:{value:\"{colors.overlay.30.value}\"}}},primary:{backgroundColor:{value:\"{colors.transparent.value}\"},borderWidth:{value:\"{borderWidths.small.value}\"},_focus:{borderColor:{value:\"{colors.border.focus.value}\"},backgroundColor:{value:\"{colors.transparent.value}\"},boxShadow:{value:\"{components.fieldcontrol._focus.boxShadow.value}\"},color:{value:\"{colors.font.primary.value}\"}},_hover:{backgroundColor:{value:\"{colors.overlay.10.value}\"},color:{value:\"{colors.font.primary.value}\"}},_disabled:{borderColor:{value:\"{colors.border.disabled.value}\"},backgroundColor:{value:\"{colors.background.disabled.value}\"},color:{value:\"{colors.font.disabled.value}\"}},_pressed:{backgroundColor:{value:\"{colors.brand.primary.80.value}\"},borderColor:{value:\"{colors.brand.primary.80.value}\"},color:{value:\"{colors.background.primary.value}\"},_focus:{backgroundColor:{value:\"{colors.border.focus.value}\"},borderColor:{value:\"{colors.border.focus.value}\"},color:{value:\"{colors.background.primary.value}\"}},_hover:{borderColor:{value:\"{colors.brand.primary.60.value}\"},backgroundColor:{value:\"{colors.brand.primary.60.value}\"},boxShadow:{value:\"{colors.brand.primary.60.value}\"},color:{value:\"{colors.background.primary.value}\"}}}},link:{backgroundColor:{value:\"{colors.transparent.value}\"},color:{value:\"{colors.overlay.50.value}\"},_hover:{backgroundColor:{value:\"{colors.transparent.value}\"},color:{value:\"{colors.overlay.50.value}\"}},_focus:{backgroundColor:{value:\"{colors.transparent.value}\"},color:{value:\"{colors.overlay.50.value}\"}},_disabled:{backgroundColor:{value:\"{colors.transparent.value}\"},color:{value:\"{colors.font.disabled.value}\"}},_pressed:{backgroundColor:{value:\"{colors.transparent.value}\"},color:{value:\"{colors.overlay.90.value}\"},_focus:{backgroundColor:{value:\"{colors.transparent.value}\"},color:{value:\"{colors.overlay.90.value}\"}},_hover:{color:{value:\"{colors.overlay.90.value}\"},backgroundColor:{value:\"{colors.transparent.value}\"}}}}};export{o as togglebutton};\n","const e={alignItems:{value:\"center\"},alignContent:{value:\"center\"},justifyContent:{value:\"flex-start\"}};export{e as togglebuttongroup};\n","import{alert as m}from\"./alert.mjs\";import{autocomplete as o}from\"./autocomplete.mjs\";import{authenticator as r}from\"./authenticator.mjs\";import{badge as e}from\"./badge.mjs\";import{button as i}from\"./button.mjs\";import{card as t}from\"./card.mjs\";import{checkbox as s}from\"./checkbox.mjs\";import{checkboxfield as p}from\"./checkboxField.mjs\";import{collection as f}from\"./collection.mjs\";import{copy as l}from\"./copy.mjs\";import{dialcodeselect as a}from\"./dialCodeSelect.mjs\";import{divider as d}from\"./divider.mjs\";import{expander as j}from\"./expander.mjs\";import{field as n}from\"./field.mjs\";import{fieldcontrol as c}from\"./fieldControl.mjs\";import{fieldgroup as g}from\"./fieldGroup.mjs\";import{fieldmessages as h}from\"./fieldMessages.mjs\";import{fileuploader as u}from\"./fileUploader.mjs\";import{flex as b}from\"./flex.mjs\";import{heading as x}from\"./heading.mjs\";import{highlightmatch as F}from\"./highlightMatch.mjs\";import{icon as k}from\"./icon.mjs\";import{image as v}from\"./image.mjs\";import{inappmessaging as w}from\"./inAppMessaging.mjs\";import{link as y}from\"./link.mjs\";import{liveness as G}from\"./liveness.mjs\";import{loader as M}from\"./loader.mjs\";import{menu as A}from\"./menu.mjs\";import{pagination as B}from\"./pagination.mjs\";import{passwordfield as C}from\"./passwordField.mjs\";import{phonenumberfield as N}from\"./phoneNumberField.mjs\";import{placeholder as S}from\"./placeholder.mjs\";import{radio as U}from\"./radio.mjs\";import{radiogroup as q}from\"./radioGroup.mjs\";import{rating as z}from\"./rating.mjs\";import{searchfield as D}from\"./searchField.mjs\";import{select as E}from\"./select.mjs\";import{selectfield as H}from\"./selectField.mjs\";import{sliderfield as I}from\"./sliderField.mjs\";import{stepperfield as J}from\"./stepperField.mjs\";import{storagemanager as K}from\"./storagemanager.mjs\";import{switchfield as L}from\"./switchField.mjs\";import{table as O}from\"./table.mjs\";import{tabs as P}from\"./tabs.mjs\";import{text as Q}from\"./text.mjs\";import{textareafield as R}from\"./textAreaField.mjs\";import{textfield as T}from\"./textField.mjs\";import{togglebutton as V}from\"./toggleButton.mjs\";import{togglebuttongroup as W}from\"./toggleButtonGroup.mjs\";const X={alert:m,authenticator:r,autocomplete:o,badge:e,button:i,card:t,checkbox:s,checkboxfield:p,collection:f,copy:l,countrycodeselect:a,divider:d,expander:j,field:n,fieldcontrol:c,fieldgroup:g,fieldmessages:h,fileuploader:u,flex:b,heading:x,icon:k,highlightmatch:F,image:v,inappmessaging:w,link:y,liveness:G,loader:M,menu:A,pagination:B,passwordfield:C,phonenumberfield:N,placeholder:S,radio:U,radiogroup:q,rating:z,searchfield:D,select:E,selectfield:H,sliderfield:I,stepperfield:J,storagemanager:K,switchfield:L,table:O,tabs:P,text:Q,textareafield:R,textfield:T,togglebutton:V,togglebuttongroup:W};export{X as components};\n","const e={default:{variable:{value:\"'InterVariable', 'Inter var', 'Inter', -apple-system, BlinkMacSystemFont,\\n 'Helvetica Neue', 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans',\\n sans-serif\"},static:{value:\"'Inter', -apple-system, BlinkMacSystemFont, 'Helvetica Neue',\\n 'Segoe UI', Oxygen, Ubuntu, Cantarell, 'Open Sans', sans-serif\"}}};export{e as fonts};\n","const e={xxxs:{value:\"0.375rem\"},xxs:{value:\"0.5rem\"},xs:{value:\"0.75rem\"},small:{value:\"0.875rem\"},medium:{value:\"1rem\"},large:{value:\"1.25rem\"},xl:{value:\"1.5rem\"},xxl:{value:\"2rem\"},xxxl:{value:\"2.5rem\"},xxxxl:{value:\"3rem\"}};export{e as fontSizes};\n","const l={hairline:{value:100},thin:{value:200},light:{value:300},normal:{value:400},medium:{value:500},semibold:{value:600},bold:{value:700},extrabold:{value:800},black:{value:900}};export{l as fontWeights};\n","const e={small:{value:\"1.25\"},medium:{value:\"1.5\"},large:{value:\"2\"}};export{e as lineHeights};\n","const e={0:{value:\"0\"},10:{value:\"0.1\"},20:{value:\"0.2\"},30:{value:\"0.3\"},40:{value:\"0.4\"},50:{value:\"0.5\"},60:{value:\"0.6\"},70:{value:\"0.7\"},80:{value:\"0.8\"},90:{value:\"0.9\"},100:{value:\"1\"}};export{e as opacities};\n","const e={small:{value:\"1px\"},medium:{value:\"2px\"},large:{value:\"3px\"}};export{e as outlineOffsets};\n","const e={small:{value:\"1px\"},medium:{value:\"2px\"},large:{value:\"3px\"}};export{e as outlineWidths};\n","const e={xs:{value:\"0.125rem\"},small:{value:\"0.25rem\"},medium:{value:\"0.5rem\"},large:{value:\"1rem\"},xl:{value:\"2rem\"},xxl:{value:\"4rem\"},xxxl:{value:\"8rem\"}};export{e as radii};\n","const o={small:{value:{offsetX:\"0px\",offsetY:\"2px\",blurRadius:\"4px\",color:\"{colors.shadow.tertiary.value}\"}},medium:{value:{offsetX:\"0px\",offsetY:\"2px\",blurRadius:\"6px\",color:\"{colors.shadow.secondary.value}\"}},large:{value:{offsetX:\"0px\",offsetY:\"4px\",blurRadius:\"12px\",color:\"{colors.shadow.primary.value}\"}}};export{o as shadows};\n","const e={zero:{value:\"0\"},xxxs:{value:\"0.25rem\"},xxs:{value:\"0.375rem\"},xs:{value:\"0.5rem\"},small:{value:\"0.75rem\"},medium:{value:\"1rem\"},large:{value:\"1.5rem\"},xl:{value:\"2.0rem\"},xxl:{value:\"3.0rem\"},xxxl:{value:\"4.5rem\"},relative:{xxxs:{value:\"0.25em\"},xxs:{value:\"0.375em\"},xs:{value:\"0.5em\"},small:{value:\"0.75em\"},medium:{value:\"1em\"},large:{value:\"1.5em\"},xl:{value:\"2.0em\"},xxl:{value:\"3.0em\"},xxxl:{value:\"4.5em\"},full:{value:\"100%\"}}};export{e as space};\n","const e={short:{value:\"100ms\"},medium:{value:\"250ms\"},long:{value:\"500ms\"}};export{e as time};\n","const e={slideX:{small:{value:\"translateX(0.5em)\"},medium:{value:\"translateX(1em)\"},large:{value:\"translateX(2em)\"}}};export{e as transforms};\n","import{borderWidths as s}from\"./borderWidths.mjs\";import{colors as m}from\"./colors.mjs\";import{components as o}from\"./components/index.mjs\";import{fonts as i}from\"./fonts.mjs\";import{fontSizes as r}from\"./fontSizes.mjs\";import{fontWeights as t}from\"./fontWeights.mjs\";import{lineHeights as e}from\"./lineHeights.mjs\";import{opacities as x}from\"./opacities.mjs\";import{outlineOffsets as l}from\"./outlineOffsets.mjs\";import{outlineWidths as f}from\"./outlineWidths.mjs\";import{radii as p}from\"./radii.mjs\";import{shadows as n}from\"./shadows.mjs\";import{space as a}from\"./space.mjs\";import{time as d}from\"./time.mjs\";import{transforms as j}from\"./transforms.mjs\";const c={components:o,borderWidths:s,colors:m,fonts:i,fontSizes:r,fontWeights:t,lineHeights:e,opacities:x,outlineOffsets:l,outlineWidths:f,radii:p,shadows:n,space:a,time:d,transforms:j},h={colors:m,borderWidths:s,fontSizes:{xxs:r.xxs,xs:r.xs,small:r.small,medium:r.medium,large:r.large,xl:r.xl,xxl:r.xxl,xxxl:r.xxxl},fontWeights:t,opacities:x,space:{xxs:a.xxxs,xs:a.xs,small:a.small,medium:a.medium,large:a.large,xl:a.xl,xxl:a.xxl,xxxl:a.xxxl},radii:p,time:d};export{h as reactNativeTokens,c as tokens};\n","const e={values:{base:0,small:480,medium:768,large:992,xl:1280,xxl:1536},defaultBreakpoint:\"base\"};export{e as breakpoints};\n","import{tokens as e}from\"./tokens/index.mjs\";import{breakpoints as o}from\"./breakpoints.mjs\";const t={tokens:e,breakpoints:o,name:\"default-theme\"};export{t as defaultTheme};\n","/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\nmodule.exports = arrayReduce;\n","/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n\nmodule.exports = basePropertyOf;\n","var basePropertyOf = require('./_basePropertyOf');\n\n/** Used to map Latin Unicode letters to basic Latin letters. */\nvar deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 's'\n};\n\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\nvar deburrLetter = basePropertyOf(deburredLetters);\n\nmodule.exports = deburrLetter;\n","var deburrLetter = require('./_deburrLetter'),\n toString = require('./toString');\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */\nvar reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n/** Used to compose unicode character classes. */\nvar rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange;\n\n/** Used to compose unicode capture groups. */\nvar rsCombo = '[' + rsComboRange + ']';\n\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\nvar reComboMark = RegExp(rsCombo, 'g');\n\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\nfunction deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n}\n\nmodule.exports = deburr;\n","/** Used to match words composed of alphanumeric characters. */\nvar reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction asciiWords(string) {\n return string.match(reAsciiWord) || [];\n}\n\nmodule.exports = asciiWords;\n","/** Used to detect strings that need a more robust regexp to match words. */\nvar reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\nfunction hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n}\n\nmodule.exports = hasUnicodeWord;\n","/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f',\n reComboHalfMarksRange = '\\\\ufe20-\\\\ufe2f',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20ff',\n rsComboRange = rsComboMarksRange + reComboHalfMarksRange + rsComboSymbolsRange,\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\",\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar rsMiscLower = '(?:' + rsLower + '|' + rsMisc + ')',\n rsMiscUpper = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptContrLower = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptContrUpper = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsOrdLower = '\\\\d*(?:1st|2nd|3rd|(?![123])\\\\dth)(?=\\\\b|[A-Z_])',\n rsOrdUpper = '\\\\d*(?:1ST|2ND|3RD|(?![123])\\\\dTH)(?=\\\\b|[a-z_])',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;\n\n/** Used to match complex or compound words. */\nvar reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptContrLower + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsMiscUpper + '+' + rsOptContrUpper + '(?=' + [rsBreak, rsUpper + rsMiscLower, '$'].join('|') + ')',\n rsUpper + '?' + rsMiscLower + '+' + rsOptContrLower,\n rsUpper + '+' + rsOptContrUpper,\n rsOrdUpper,\n rsOrdLower,\n rsDigits,\n rsEmoji\n].join('|'), 'g');\n\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n}\n\nmodule.exports = unicodeWords;\n","var asciiWords = require('./_asciiWords'),\n hasUnicodeWord = require('./_hasUnicodeWord'),\n toString = require('./toString'),\n unicodeWords = require('./_unicodeWords');\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\nfunction words(string, pattern, guard) {\n string = toString(string);\n pattern = guard ? undefined : pattern;\n\n if (pattern === undefined) {\n return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);\n }\n return string.match(pattern) || [];\n}\n\nmodule.exports = words;\n","var arrayReduce = require('./_arrayReduce'),\n deburr = require('./deburr'),\n words = require('./words');\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\";\n\n/** Used to match apostrophes. */\nvar reApos = RegExp(rsApos, 'g');\n\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\nfunction createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n}\n\nmodule.exports = createCompounder;\n","var createCompounder = require('./_createCompounder');\n\n/**\n * Converts `string` to\n * [kebab case](https://en.wikipedia.org/wiki/Letter_case#Special_case_styles).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the kebab cased string.\n * @example\n *\n * _.kebabCase('Foo Bar');\n * // => 'foo-bar'\n *\n * _.kebabCase('fooBar');\n * // => 'foo-bar'\n *\n * _.kebabCase('__FOO_BAR__');\n * // => 'foo-bar'\n */\nvar kebabCase = createCompounder(function(result, word, index) {\n return result + (index ? '-' : '') + word.toLowerCase();\n});\n\nmodule.exports = kebabCase;\n","/*\n * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nconst defaults = {\n opening_character: '{',\n closing_character: '}',\n separator: '.'\n};\n\nmodule.exports = defaults;\n","/*\n * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nconst defaults = require('./defaults');\n\nfunction createReferenceRegex(opts = {}) {\n const options = Object.assign({}, defaults, opts);\n\n return new RegExp(\n '\\\\' +\n options.opening_character +\n '([^' +\n options.closing_character +\n ']+)' +\n '\\\\' +\n options.closing_character, 'g'\n );\n}\n\nmodule.exports = createReferenceRegex;\n","/*\n * Copyright 2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\"). You may not use this file except in compliance with\n * the License. A copy of the License is located at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * or in the \"license\" file accompanying this file. This file is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR\n * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions\n * and limitations under the License.\n */\n\nconst createRegex = require('./createReferenceRegex');\n\n/**\n * Checks if the value uses a value reference.\n * @memberof Dictionary\n * @param {string} value\n * @param {Object|RegExp} regexOrOptions\n * @returns {boolean} - True, if the value uses a value reference\n */\nfunction usesReference(value, regexOrOptions = {}) {\n const regex = regexOrOptions instanceof RegExp ? regexOrOptions : createRegex(regexOrOptions);\n\n if (typeof value === 'string') {\n return regex.test(value);\n }\n\n if (typeof value === 'object') {\n let hasReference = false;\n // iterate over each property in the object,\n // if any element passes the regex test,\n // the whole thing should be true\n for (const key in value) {\n if (value.hasOwnProperty(key)) {\n const element = value[key];\n let reference = usesReference(element, regexOrOptions);\n if (reference) {\n hasReference = true;\n break;\n }\n }\n }\n return hasReference;\n }\n\n return false;\n}\n\nmodule.exports = usesReference;\n","import e from\"lodash/kebabCase.js\";import t from\"style-dictionary/lib/utils/references/usesReference.js\";import{isObject as n,has as r,isString as o}from\"../utils/index.mjs\";const u=\"amplify\",s=[\"offsetX\",\"offsetY\",\"blurRadius\",\"spreadRadius\",\"color\"];function i(e){if(!e)return\"\";if(t(e)){return`var(--${f({path:e.replace(/\\{|\\}/g,\"\").replace(\".value\",\"\").split(\".\")})})`}return e}function a(e){const{value:t}=e;return o(t)?i(t):p(t)?s.map((n=>i(p(e)?e[n]:t[n]))).join(\" \"):t}function f({path:t=[]}){return`${e([u,...t].join(\" \"))}`}function c(e){return n(e)&&r(e,\"value\")}function p(e){return n(e)&&r(e,\"offsetX\")}function l({tokens:e,path:t=[],setupToken:o}){if(r(e,\"value\"))return o({token:e,path:t});const u={};for(const s in e)if(r(e,s)){const r=e[s],i=n(r)?r:{value:r};u[s]=l({tokens:i,path:t.concat(s),setupToken:o})}return u}export{u as CSS_VARIABLE_PREFIX,f as cssNameTransform,a as cssValue,c as isDesignToken,p as isShadowTokenObject,l as setupTokens};\n","import e from\"style-dictionary/lib/utils/deepExtend.js\";import n from\"style-dictionary/lib/utils/flattenProperties.js\";import{defaultTheme as t}from\"./defaultTheme.mjs\";import{setupTokens as o,cssNameTransform as a,cssValue as i}from\"./utils.mjs\";const r=({token:e,path:n})=>{const t=`--${a({path:n})}`,{value:o}=e,r=i(e);return{name:t,original:o,path:n,value:r,toString:()=>`var(${t})`}};function s(a,i=t){const s=e([{},i,a]),m=o({tokens:s.tokens,setupToken:r}),{breakpoints:l,name:p}=s;let d=`[data-amplify-theme=\"${p}\"] {\\n`+n(m).map((e=>`${e.name}: ${e.value};`)).join(\"\\n\")+\"\\n}\\n\",$=[];return s.overrides&&($=s.overrides.map((e=>{const t=o({tokens:e.tokens,setupToken:r}),a=n(t).map((e=>`${e.name}: ${e.value};`)).join(\"\\n\");if(\"selector\"in e&&(d+=`\\n${e.selector} {\\n${a}\\n}\\n`),\"mediaQuery\"in e&&(d+=`\\n@media (${e.mediaQuery}) {\\n [data-amplify-theme=\"${p}\"] {\\n ${a}\\n }\\n}\\n`),\"breakpoint\"in e){const n=s.breakpoints.values[e.breakpoint];d+=`\\n@media (min-width: ${n}px) {\\n [data-amplify-theme=\"${p}\"] {\\n ${a}\\n }\\n}\\n`}return\"colorMode\"in e&&(d+=`\\n@media (prefers-color-scheme: ${e.colorMode}) {\\n [data-amplify-theme=\"${p}\"][data-amplify-color-mode=\"system\"] {\\n${a}\\n}\\n }\\n`,d+=`\\n[data-amplify-theme=\"${p}\"][data-amplify-color-mode=\"${e.colorMode}\"] {\\n${a}\\n}\\n`),Object.assign(Object.assign({},e),{tokens:t})}))),{tokens:m,breakpoints:l,name:p,cssText:d,overrides:$}}export{s as createTheme};\n","import*as t from\"react\";import{createTheme as e}from\"@aws-amplify/ui\";const o=t.createContext({theme:e()});export{o as AmplifyContext};\n","import{ComponentClassName as e}from\"@aws-amplify/ui\";const a={Alert:{className:e.Alert,components:[\"Alert\"],description:\"Top level element that wraps the Alert primitive\"},AlertIcon:{className:e.AlertIcon,components:[\"Alert\"],description:\"Class applied to Icon component within the Alert primitive\"},AlertHeading:{className:e.AlertHeading,components:[\"Alert\"],description:\"Class applied to the heading View\"},AlertBody:{className:e.AlertBody,components:[\"Alert\"],description:\"Class applied to the body View\"},AlertDismiss:{className:e.AlertDismiss,components:[\"Alert\"],description:\"Class applied to the close Button\"},Autocomplete:{className:e.Autocomplete,components:[\"Autocomplete\"],description:\"Top level element that wraps the Autocomplete primitive\"},AutocompleteMenu:{className:e.AutocompleteMenu,components:[\"Autocomplete\"],description:\"Top level element that wraps the dropdown menu\"},AutocompleteMenuEmpty:{className:e.AutocompleteMenuEmpty,components:[\"Autocomplete\"],description:\"Class applied to the no options slot of menu\"},AutocompleteMenuFooter:{className:e.AutocompleteMenuFooter,components:[\"Autocomplete\"],description:\"Class applied to menu footer\"},AutocompleteMenuHeader:{className:e.AutocompleteMenuHeader,components:[\"Autocomplete\"],description:\"Class applied to menu header\"},AutocompleteMenuLoading:{className:e.AutocompleteMenuLoading,components:[\"Autocomplete\"],description:\"Class applied to the loading slot of menu\"},AutocompleteMenuOption:{className:e.AutocompleteMenuOption,components:[\"Autocomplete\"],description:\"Class applied to each li option\"},AutocompleteMenuOptions:{className:e.AutocompleteMenuOptions,components:[\"Autocomplete\"],description:\"Class applied to ul container element\"},Badge:{className:e.Badge,components:[\"Badge\"],description:\"Top level element that wraps the Badge component\"},Button:{className:e.Button,components:[\"Button\"],description:\"Top level element that wraps the Button primitive\"},ButtonGroup:{className:e.ButtonGroup},ButtonLoaderWrapper:{className:e.ButtonLoaderWrapper,components:[\"Button\"],description:\"Class applied to the Loader component within the Button Loading state\"},Card:{className:e.Card,components:[\"Card\"],description:\"Top level element that wraps the Card primitive\"},Checkbox:{className:e.Checkbox,components:[\"Checkbox\"],description:\"Top level element that wraps the Checkbox primitive\"},CheckboxButton:{className:e.CheckboxButton,components:[\"Checkbox\"],description:\"Wrapper for the checked icon within the Checkbox primitive\"},CheckboxIcon:{className:e.CheckboxIcon,components:[\"Checkbox\"],description:\"Class applied to the checked icon within the Checkbox primitive\"},CheckboxInput:{className:e.CheckboxInput,components:[\"Checkbox\"],description:\"Class applied to the visually hidden checkbox input within the Checkbox primitive\"},CheckboxLabel:{className:e.CheckboxLabel,components:[\"Checkbox\"],description:\"Class applied to the label within the Checkbox primitive\"},CheckboxField:{className:e.CheckboxField,components:[\"CheckboxField\"],description:\"Top level element that wraps the CheckboxField primitive\"},Collection:{className:e.Collection,components:[\"Collection\"],description:\"Top level element that wraps the Collection primitive\"},CollectionItems:{className:e.CollectionItems,components:[\"Collection\"],description:\"Class applied to the element that wraps all the items in a collection\"},CollectionSearch:{className:e.CollectionSearch,components:[\"Collection\"],description:\"Class applied to the element that wraps the collection search box\"},CollectionPagination:{className:e.CollectionPagination,components:[\"Collection\"],description:\"Class applied to the element that wraps the pagination component in a collection\"},CountryCodeSelect:{className:e.CountryCodeSelect,components:[\"PhoneNumberField\"],description:\"Class applied to the Dial Code Select within the PhoneNumberField primitive\"},DialCodeSelect:{className:e.DialCodeSelect,components:[\"PhoneNumberField\"],description:\"Class applied to the Dial Code Select within the PhoneNumberField primitive\"},Divider:{className:e.Divider,components:[\"Divider\"],description:\"Top level element that wraps the Divider primitive\"},DividerLabel:{className:e.DividerLabel,components:[\"Divider\"],description:\"Class applied to the label of the Divider component\"},Expander:{className:e.Expander,components:[\"Expander\"],description:\"Top level element that wraps the Expander primitive\"},ExpanderContent:{className:e.ExpanderContent,components:[\"Expander\"],description:\"Expander content container\"},ExpanderContentText:{className:e.ExpanderContentText,components:[\"Expander\"],description:\"Expander content text\"},ExpanderHeader:{className:e.ExpanderHeader,components:[\"Expander\"],description:\"Expander item header\"},ExpanderIcon:{className:e.ExpanderIcon,components:[\"Expander\"],description:\"Icon to indicate whether an item is expanded or collapsed\"},ExpanderItem:{className:e.ExpanderItem,components:[\"Expander\"],description:\"Expander item(containier for header, trigger, and content)\"},ExpanderTrigger:{className:e.ExpanderTrigger,components:[\"Expander\"],description:\"Expander item trigger(button)\"},Field:{className:e.Field},FieldDescription:{className:e.FieldDescription},FieldErrorMessage:{className:e.FieldErrorMessage},FieldGroup:{className:e.FieldGroup},FieldGroupControl:{className:e.FieldGroupControl},FieldGroupOuterEnd:{className:e.FieldGroupOuterEnd},FieldGroupOuterStart:{className:e.FieldGroupOuterStart},FieldGroupInnerEnd:{className:e.FieldGroupInnerEnd},FieldGroupInnerStart:{className:e.FieldGroupInnerStart},FieldGroupIcon:{className:e.FieldGroupIcon},FieldGroupIconButton:{className:e.FieldGroupIconButton},FieldGroupHasInnerEnd:{className:e.FieldGroupHasInnerEnd},FieldGroupHasInnerStart:{className:e.FieldGroupHasInnerStart},FieldShowPassword:{className:e.FieldShowPassword},FieldGroupFieldWrapper:{className:e.FieldGroupFieldWrapper},FileUploaderDropZone:{className:e.FileUploaderDropZone,components:[\"FileUploader\"]},FileUploaderDropZoneIcon:{className:e.FileUploaderDropZoneIcon,components:[\"FileUploader\"]},FileUploaderDropZoneText:{className:e.FileUploaderDropZoneText,components:[\"FileUploader\"]},FileUploaderDropZoneButton:{className:e.FileUploaderDropZoneButton,components:[\"FileUploader\"]},FileUploaderFile:{className:e.FileUploaderFile,components:[\"FileUploader\"]},FileUploaderFileWrapper:{className:e.FileUploaderFileWrapper,components:[\"FileUploader\"]},FileUploaderFileName:{className:e.FileUploaderFileName,components:[\"FileUploader\"]},FileUploaderLoader:{className:e.FileUploaderLoader,components:[\"FileUploader\"]},FileUploaderFileSize:{className:e.FileUploaderFileSize,components:[\"FileUploader\"]},FileUploaderFileInfo:{className:e.FileUploaderFileInfo,components:[\"FileUploader\"]},FileUploaderFileImage:{className:e.FileUploaderFileImage,components:[\"FileUploader\"]},FileUploaderFileMain:{className:e.FileUploaderFileMain,components:[\"FileUploader\"]},FileUploaderFileStatus:{className:e.FileUploaderFileStatus,components:[\"FileUploader\"]},FileUploaderPreviewer:{className:e.FileUploaderPreviewer,components:[\"FileUploader\"]},FileUploaderPreviewerText:{className:e.FileUploaderPreviewerText,components:[\"FileUploader\"]},FileUploaderPreviewerBody:{className:e.FileUploaderPreviewerBody,components:[\"FileUploader\"]},FileUploaderPreviewerFooter:{className:e.FileUploaderPreviewerFooter,components:[\"FileUploader\"]},FileUploaderPreviewerFooterActions:{className:e.FileUploaderPreviewerFooterActions,components:[\"FileUploader\"]},Flex:{className:e.Flex,components:[\"Flex\"],description:\"Top level element that wraps the Flex primitive\"},Grid:{className:e.Grid,components:[\"Grid\"],description:\"Top level element that wraps the Grid primitive\"},Heading:{className:e.Heading,components:[\"Heading\"],description:\"Top level element that wraps the Heading primitive\"},HighlightMatch:{className:e.HighlightMatch,components:[\"HighlightMatch\"],description:\"Top level element that wraps the HighlightMatch primitive\"},HighlightMatchHighlighted:{className:e.HighlightMatchHighlighted,components:[\"HighlightMatch\"],description:\"Class applied to the highlighted text of the HighlightMatch primitive\"},Icon:{className:e.Icon,components:[\"Icon\"],description:\"Top level element that wraps the Icon primitive\"},Image:{className:e.Image,components:[\"Image\"],description:\"Top level element that wraps the Image primitive\"},Input:{className:e.Input},Label:{className:e.Label},Link:{className:e.Link,components:[\"Link\"],description:\"Top level element that wraps the Link primitive\"},Loader:{className:e.Loader,components:[\"Loader\"],description:\"Top level element that wraps the Loader primitive\"},LoaderDeterminate:{className:e.LoaderDeterminate,components:[\"Loader\"],description:\"Class applied to a determinate loader\"},LoaderPercentageText:{className:e.LoaderPercentageText,components:[\"Loader\"],description:\"Class applied to the percentage text of loader\"},MenuContent:{className:e.MenuContent,components:[\"Menu\"],description:\"Menu content container (Flex)\"},MenuContentWrapper:{className:e.MenuContentWrapper,components:[\"Menu\"],description:\"Menu content wrapper\"},MenuItem:{className:e.MenuItem,components:[\"Menu\"],description:\"Menu item button (MenuButton, wrapped in amplify-menu-content class)\"},MenuTrigger:{className:e.MenuTrigger,components:[\"Menu\"],description:\"Menu trigger button (MenuButton, not wrapped in amplify-menu-content class)\"},Pagination:{className:e.Pagination,components:[\"Pagination\"],description:\"Top level element that wraps the Pagination primitive\"},PaginationItemButton:{className:e.PaginationItemButton,components:[\"Pagination\"],description:\"Class applied to the pagination buttons\"},PaginationItemCurrent:{className:e.PaginationItemCurrent,components:[\"Pagination\"],description:\"Class applied to the currently selected pagination button\"},PaginationItemEllipsis:{className:e.PaginationItemEllipsis,components:[\"Pagination\"],description:\"Class applied to the ellipsis within the Pagination primitive\"},PasswordField:{className:e.PasswordField,components:[\"PasswordField\"],description:\"Top level element that wraps the PasswordField primitive\"},PhoneNumberField:{className:e.PhoneNumberField,components:[\"PhoneNumberField\"],description:\"Top level element that wraps the PhoneNumberField primitive\"},Placeholder:{className:e.Placeholder,components:[\"Placeholder\"],description:\"Top level element that wraps the Placeholder primitive\"},Radio:{className:e.Radio,components:[\"RadioGroupField\",\"Radio\"],description:\"Top level element that wraps the Radio primitive\"},RadioButton:{className:e.RadioButton,components:[\"RadioGroupField\",\"Radio\"],description:\"Class applied to the displayed radio button\"},RadioInput:{className:e.RadioInput,components:[\"RadioGroupField\",\"Radio\"],description:\"Class applied to the visually hidden radio input\"},RadioLabel:{className:e.RadioLabel,components:[\"RadioGroupField\",\"Radio\"],description:\"Class applied to the radio label\"},RadioGroupField:{className:e.RadioGroupField,components:[\"RadioGroupField\"],description:\"Top level element that wraps the RadioGroupField primitive\"},RadioGroup:{className:e.RadioGroup,components:[\"RadioGroupField\"],description:\"Class applied to the radio group wrapper\"},Rating:{className:e.Rating,components:[\"Rating\"],description:\"Top level element that wraps the Rating primitive\"},ScrollView:{className:e.ScrollView,components:[\"ScrollView\"],description:\"Top level element that wraps the ScrollView primitive\"},SearchField:{className:e.SearchField,components:[\"SearchField\"],description:\"Top level element that wraps the SearchField primitive\"},SearchFieldClear:{className:e.SearchFieldClear,components:[\"SearchField\"],description:\"Class applied to the search field clear button\"},SearchFieldSearch:{className:e.SearchFieldSearch,components:[\"SearchField\"],description:\"Class applied to the search button\"},Select:{className:e.Select,components:[\"Select\",\"SelectField\"],description:\"Class applied to the select element\"},SelectField:{className:e.SelectField,components:[\"SelectField\"],description:\"Top level element that wraps the SelectField primitive\"},SelectWrapper:{className:e.SelectWrapper,components:[\"Select\",\"SelectField\"],description:\"Class applied to the select wrapper\"},SelectIconWrapper:{className:e.SelectIconWrapper,components:[\"Select\",\"SelectField\"],description:\"Class applied to the select icon wrapper\"},SliderField:{className:e.SliderField,components:[\"SliderField\"],description:\"Top level element that wraps the SliderField primitive\"},SliderFieldGroup:{className:e.SliderFieldGroup,components:[\"SliderField\"],description:\"Class applied to the element that wraps the slider root\"},SliderFieldLabel:{className:e.SliderFieldLabel,components:[\"SliderField\"],description:\"Class applied to the slider label\"},SliderFieldRange:{className:e.SliderFieldRange,components:[\"SliderField\"],description:\"Class applied to the filled in portion of the slider track\"},SliderFieldRoot:{className:e.SliderFieldRoot,components:[\"SliderField\"],description:\"Class applied to the slider root which wraps the track and thumb\"},SliderFieldThumb:{className:e.SliderFieldThumb,components:[\"SliderField\"],description:\"Class applied to the slider thumb\"},SliderFieldTrack:{className:e.SliderFieldTrack,components:[\"SliderField\"],description:\"Class applied to the slider track\"},StepperField:{className:e.StepperField,components:[\"StepperField\"],description:\"Top level element that wraps the StepperField primitive\"},StepperFieldButtonDecrease:{className:e.StepperFieldButtonDecrease,components:[\"StepperField\"],description:\"Class applied to the decrease button\"},StepperFieldButtonIncrease:{className:e.StepperFieldButtonIncrease,components:[\"StepperField\"],description:\"Class applied to the increase button\"},StepperFieldInput:{className:e.StepperFieldInput,components:[\"StepperField\"],description:\"Class applied to the StepperField input\"},StorageManager:{className:e.StorageManager,components:[\"StorageManager\"]},StorageManagerDropZone:{className:e.StorageManagerDropZone,components:[\"StorageManager\"]},StorageManagerDropZoneIcon:{className:e.StorageManagerDropZoneIcon,components:[\"StorageManager\"]},StorageManagerDropZoneText:{className:e.StorageManagerDropZoneText,components:[\"StorageManager\"]},StorageManagerFilePicker:{className:e.StorageManagerFilePicker,components:[\"StorageManager\"]},StorageManagerFile:{className:e.StorageManagerFile,components:[\"StorageManager\"]},StorageManagerFileWrapper:{className:e.StorageManagerFileWrapper,components:[\"StorageManager\"]},StorageManagerFileList:{className:e.StorageManagerFileList,components:[\"StorageManager\"]},StorageManagerFileName:{className:e.StorageManagerFileName,components:[\"StorageManager\"]},StorageManagerLoader:{className:e.StorageManagerLoader,components:[\"StorageManager\"]},StorageManagerFileSize:{className:e.StorageManagerFileSize,components:[\"StorageManager\"]},StorageManagerFileInfo:{className:e.StorageManagerFileInfo,components:[\"StorageManager\"]},StorageManagerFileImage:{className:e.StorageManagerFileImage,components:[\"StorageManager\"]},StorageManagerFileMain:{className:e.StorageManagerFileMain,components:[\"StorageManager\"]},StorageManagerFileStatus:{className:e.StorageManagerFileStatus,components:[\"StorageManager\"]},StorageManagerPreviewer:{className:e.StorageManagerPreviewer,components:[\"StorageManager\"]},StorageManagerPreviewerText:{className:e.StorageManagerPreviewerText,components:[\"StorageManager\"]},SwitchField:{className:e.SwitchField,components:[\"SwitchField\"],description:\"Top level element that wraps the SwitchField primitive\"},SwitchLabel:{className:e.SwitchLabel,components:[\"SwitchField\"],description:\"Class applied to the SwitchField label text\"},SwitchThumb:{className:e.SwitchThumb,components:[\"SwitchField\"],description:\"Class applied to the SwitchField thumb\"},SwitchTrack:{className:e.SwitchTrack,components:[\"SwitchField\"],description:\"Class applied to the SwitchField track\"},SwitchWrapper:{className:e.SwitchWrapper,components:[\"SwitchField\"],description:\"Class applied to the label element that wraps the SwitchField label and track\"},Table:{className:e.Table,components:[\"Table\"],description:\"Top level element that wraps the Table primitive\"},TableCaption:{className:e.TableCaption,components:[\"Table\"],description:\"Class applied to the content provided as the caption prop\"},TableBody:{className:e.TableBody,components:[\"Table\"],description:\"Class applied to TableBody component\"},TableTd:{className:e.TableTd,components:[\"Table\"],description:'Class applied to TableCell component rendered as a element ()'},TableTh:{className:e.TableTh,components:[\"Table\"],description:'Class applied to TableCell comopnent rendered as a element ()'},TableFoot:{className:e.TableFoot,components:[\"Table\"],description:\"Class applied to TableFoot component\"},TableHead:{className:e.TableHead,components:[\"Table\"],description:\"Class applied to TableHead component\"},TableRow:{className:e.TableRow,components:[\"Table\"],description:\"Class applied to TableRow component\"},Tabs:{className:e.Tabs,components:[\"Tabs\"],description:\"Top level element that wraps the Tabs primitive\"},TabItems:{className:e.TabItems,components:[\"Tabs\"],description:\"Top level element that wraps the TabItem primitive\"},Text:{className:e.Text,components:[\"Text\"],description:\"Top level element that wraps the Text primitive\"},Textarea:{className:e.Textarea,components:[\"TextAreaField\"],description:\"Class applied to the text area\"},TextAreaField:{className:e.TextAreaField,components:[\"TextAreaField\"],description:\"Top level element that wraps the TextAreaField primitive\"},TextField:{className:e.TextField,components:[\"TextField\"],description:\"Top level element that wraps the TextField primitive\"},ToggleButton:{className:e.ToggleButton,components:[\"ToggleButton\"],description:\"Top level element that wraps the ToggleButton primitive\"},ToggleButtonGroup:{className:e.ToggleButtonGroup,components:[\"ToggleButton\",\"ToggleButtonGroup\"],description:\"Top level element that wraps the ToggleButtonGroup primitive\"},VisuallyHidden:{className:e.VisuallyHidden,components:[\"VisuallyHidden\"],description:\"Top level element that wraps the VisuallyHidden primitive\"}},t={Alert:a.Alert.className,AlertIcon:a.AlertIcon.className,AlertHeading:a.AlertHeading.className,AlertBody:a.AlertBody.className,AlertDismiss:a.AlertDismiss.className,Autocomplete:a.Autocomplete.className,AutocompleteMenu:a.AutocompleteMenu.className,AutocompleteMenuEmpty:a.AutocompleteMenuEmpty.className,AutocompleteMenuFooter:a.AutocompleteMenuFooter.className,AutocompleteMenuHeader:a.AutocompleteMenuHeader.className,AutocompleteMenuLoading:a.AutocompleteMenuLoading.className,AutocompleteMenuOption:a.AutocompleteMenuOption.className,AutocompleteMenuOptions:a.AutocompleteMenuOptions.className,Badge:a.Badge.className,Button:a.Button.className,ButtonGroup:a.ButtonGroup.className,ButtonLoaderWrapper:a.ButtonLoaderWrapper.className,Card:a.Card.className,Checkbox:a.Checkbox.className,CheckboxButton:a.CheckboxButton.className,CheckboxIcon:a.CheckboxIcon.className,CheckboxInput:a.CheckboxInput.className,CheckboxLabel:a.CheckboxLabel.className,CheckboxField:a.CheckboxField.className,Collection:a.Collection.className,CollectionItems:a.CollectionItems.className,CollectionSearch:a.CollectionSearch.className,CollectionPagination:a.CollectionPagination.className,CountryCodeSelect:a.CountryCodeSelect.className,DialCodeSelect:a.DialCodeSelect.className,Divider:a.Divider.className,DividerLabel:a.DividerLabel.className,Expander:a.Expander.className,ExpanderContent:a.ExpanderContent.className,ExpanderContentText:a.ExpanderContentText.className,ExpanderHeader:a.ExpanderHeader.className,ExpanderIcon:a.ExpanderIcon.className,ExpanderItem:a.ExpanderItem.className,ExpanderTrigger:a.ExpanderTrigger.className,Field:a.Field.className,FieldDescription:a.FieldDescription.className,FieldErrorMessage:a.FieldErrorMessage.className,FieldGroup:a.FieldGroup.className,FieldGroupControl:a.FieldGroupControl.className,FieldGroupOuterEnd:a.FieldGroupOuterEnd.className,FieldGroupOuterStart:a.FieldGroupOuterStart.className,FieldGroupInnerEnd:a.FieldGroupInnerEnd.className,FieldGroupInnerStart:a.FieldGroupInnerStart.className,FieldGroupIcon:a.FieldGroupIcon.className,FieldGroupIconButton:a.FieldGroupIconButton.className,FieldGroupHasInnerEnd:a.FieldGroupHasInnerEnd.className,FieldGroupHasInnerStart:a.FieldGroupHasInnerStart.className,FieldShowPassword:a.FieldShowPassword.className,FieldGroupFieldWrapper:a.FieldGroupFieldWrapper.className,FileUploaderDropZone:a.FileUploaderDropZone.className,FileUploaderDropZoneIcon:a.FileUploaderDropZoneIcon.className,FileUploaderDropZoneText:a.FileUploaderDropZoneText.className,FileUploaderDropZoneButton:a.FileUploaderDropZoneButton.className,FileUploaderFile:a.FileUploaderFile.className,FileUploaderFileWrapper:a.FileUploaderFileWrapper.className,FileUploaderFileName:a.FileUploaderFileName.className,FileUploaderLoader:a.FileUploaderLoader.className,FileUploaderFileSize:a.FileUploaderFileSize.className,FileUploaderFileInfo:a.FileUploaderFileInfo.className,FileUploaderFileImage:a.FileUploaderFileImage.className,FileUploaderFileMain:a.FileUploaderFileMain.className,FileUploaderFileStatus:a.FileUploaderFileStatus.className,FileUploaderPreviewer:a.FileUploaderPreviewer.className,FileUploaderPreviewerText:a.FileUploaderPreviewerText.className,FileUploaderPreviewerBody:a.FileUploaderPreviewerBody.className,FileUploaderPreviewerFooter:a.FileUploaderPreviewerFooter.className,FileUploaderPreviewerFooterActions:a.FileUploaderPreviewerFooterActions.className,Flex:a.Flex.className,Grid:a.Grid.className,Heading:a.Heading.className,HighlightMatch:a.HighlightMatch.className,HighlightMatchHighlighted:a.HighlightMatchHighlighted.className,Icon:a.Icon.className,Image:a.Image.className,Input:a.Input.className,Label:a.Label.className,Link:a.Link.className,Loader:a.Loader.className,LoaderDeterminate:a.LoaderDeterminate.className,LoaderPercentageText:a.LoaderPercentageText.className,MenuContent:a.MenuContent.className,MenuContentWrapper:a.MenuContentWrapper.className,MenuItem:a.MenuItem.className,MenuTrigger:a.MenuTrigger.className,Pagination:a.Pagination.className,PaginationItemButton:a.PaginationItemButton.className,PaginationItemCurrent:a.PaginationItemCurrent.className,PaginationItemEllipsis:a.PaginationItemEllipsis.className,PasswordField:a.PasswordField.className,PhoneNumberField:a.PhoneNumberField.className,Placeholder:a.Placeholder.className,Radio:a.Radio.className,RadioButton:a.RadioButton.className,RadioInput:a.RadioInput.className,RadioLabel:a.RadioLabel.className,RadioGroupField:a.RadioGroupField.className,RadioGroup:a.RadioGroup.className,Rating:a.Rating.className,ScrollView:a.ScrollView.className,SearchField:a.SearchField.className,SearchFieldClear:a.SearchFieldClear.className,SearchFieldSearch:a.SearchFieldSearch.className,Select:a.Select.className,SelectField:a.SelectField.className,SelectWrapper:a.SelectWrapper.className,SelectIconWrapper:a.SelectIconWrapper.className,SliderField:a.SliderField.className,SliderFieldGroup:a.SliderFieldGroup.className,SliderFieldLabel:a.SliderFieldLabel.className,SliderFieldRange:a.SliderFieldRange.className,SliderFieldRoot:a.SliderFieldRoot.className,SliderFieldThumb:a.SliderFieldThumb.className,SliderFieldTrack:a.SliderFieldTrack.className,StepperField:a.StepperField.className,StepperFieldButtonDecrease:a.StepperFieldButtonDecrease.className,StepperFieldButtonIncrease:a.StepperFieldButtonIncrease.className,StepperFieldInput:a.StepperFieldInput.className,StorageManager:a.StorageManager.className,StorageManagerDropZone:a.StorageManagerDropZone.className,StorageManagerDropZoneIcon:a.StorageManagerDropZoneIcon.className,StorageManagerDropZoneText:a.StorageManagerDropZoneText.className,StorageManagerFilePicker:a.StorageManagerFilePicker.className,StorageManagerFile:a.StorageManagerFile.className,StorageManagerFileWrapper:a.StorageManagerFileWrapper.className,StorageManagerFileList:a.StorageManagerFileList.className,StorageManagerFileName:a.StorageManagerFileName.className,StorageManagerLoader:a.StorageManagerLoader.className,StorageManagerFileSize:a.StorageManagerFileSize.className,StorageManagerFileInfo:a.StorageManagerFileInfo.className,StorageManagerFileImage:a.StorageManagerFileImage.className,StorageManagerFileMain:a.StorageManagerFileMain.className,StorageManagerFileStatus:a.StorageManagerFileStatus.className,StorageManagerPreviewer:a.StorageManagerPreviewer.className,StorageManagerPreviewerText:a.StorageManagerPreviewerText.className,SwitchField:a.SwitchField.className,SwitchLabel:a.SwitchLabel.className,SwitchThumb:a.SwitchThumb.className,SwitchTrack:a.SwitchTrack.className,SwitchWrapper:a.SwitchWrapper.className,Table:a.Table.className,TableCaption:a.TableCaption.className,TableBody:a.TableBody.className,TableTd:a.TableTd.className,TableTh:a.TableTh.className,TableFoot:a.TableFoot.className,TableHead:a.TableHead.className,TableRow:a.TableRow.className,Tabs:a.Tabs.className,TabItems:a.TabItems.className,Text:a.Text.className,Textarea:a.Textarea.className,TextAreaField:a.TextAreaField.className,TextField:a.TextField.className,ToggleButton:a.ToggleButton.className,ToggleButtonGroup:a.ToggleButtonGroup.className,VisuallyHidden:a.VisuallyHidden.className},o={Alert:{dismissButtonLabel:\"Dismiss alert\"},Autocomplete:{emptyText:\"No options found\",loadingText:\"Loading options...\"},Collection:{searchButtonLabel:\"Search\",searchNoResultsFound:\"No results found\"},Fields:{clearButtonLabel:\"Clear input\"},PaginationItem:{currentPageLabel:\"Page\",nextLabel:\"Go to next page\",pageLabel:\"Go to page\",previousLabel:\"Go to previous page\"},PhoneNumberField:{countryCodeLabel:\"Country code\"},SearchField:{searchButtonLabel:\"Search\"},PasswordField:{passwordIsHidden:\"Password is hidden\",passwordIsShown:\"Password is shown\",showPassword:\"Show password\"},StepperField:{increaseButtonLabel:\"Increase to\",decreaseButtonLabel:\"Decrease to\"}},l={backgroundColor:\"colors\",color:\"colors\",borderRadius:\"radii\",fontSize:\"fontSizes\",fontWeight:\"fontWeights\",fontFamily:\"fonts\",lineHeight:\"lineHeights\",opacity:\"opacities\",boxShadow:\"shadows\",transform:\"transforms\",left:\"space\",right:\"space\",top:\"space\",bottom:\"space\",height:\"space\",width:\"space\",letterSpacing:\"space\",margin:\"space\",marginBlock:\"space\",marginBlockEnd:\"space\",marginBlockStart:\"space\",marginInline:\"space\",marginInlineEnd:\"space\",marginInlineStart:\"space\",marginLeft:\"space\",marginRight:\"space\",marginTop:\"space\",marginBottom:\"space\",maxHeight:\"space\",maxWidth:\"space\",minHeight:\"space\",minWidth:\"space\",padding:\"space\",paddingBlock:\"space\",paddingBlockEnd:\"space\",paddingBlockStart:\"space\",paddingInline:\"space\",paddingInlineEnd:\"space\",paddingInlineStart:\"space\",paddingLeft:\"space\",paddingRight:\"space\",paddingTop:\"space\",paddingBottom:\"space\",gap:\"space\",columnGap:\"space\",rowGap:\"space\"},i=\"Escape\",s=\"Enter\",n=\"ArrowUp\",r=\"ArrowDown\";export{r as ARROW_DOWN,n as ARROW_UP,t as ComponentClassNames,a as ComponentClassObject,o as ComponentText,s as ENTER_KEY,i as ESCAPE_KEY,l as stylePropsToThemeKeys};\n","/*!\n Copyright (c) 2018 Jed Watson.\n Licensed under the MIT License (MIT), see\n http://jedwatson.github.io/classnames\n*/\n/* global define */\n\n(function () {\n\t'use strict';\n\n\tvar hasOwn = {}.hasOwnProperty;\n\n\tfunction classNames() {\n\t\tvar classes = [];\n\n\t\tfor (var i = 0; i < arguments.length; i++) {\n\t\t\tvar arg = arguments[i];\n\t\t\tif (!arg) continue;\n\n\t\t\tvar argType = typeof arg;\n\n\t\t\tif (argType === 'string' || argType === 'number') {\n\t\t\t\tclasses.push(arg);\n\t\t\t} else if (Array.isArray(arg)) {\n\t\t\t\tif (arg.length) {\n\t\t\t\t\tvar inner = classNames.apply(null, arg);\n\t\t\t\t\tif (inner) {\n\t\t\t\t\t\tclasses.push(inner);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (argType === 'object') {\n\t\t\t\tif (arg.toString === Object.prototype.toString) {\n\t\t\t\t\tfor (var key in arg) {\n\t\t\t\t\t\tif (hasOwn.call(arg, key) && arg[key]) {\n\t\t\t\t\t\t\tclasses.push(key);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tclasses.push(arg.toString());\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\treturn classes.join(' ');\n\t}\n\n\tif (typeof module !== 'undefined' && module.exports) {\n\t\tclassNames.default = classNames;\n\t\tmodule.exports = classNames;\n\t} else if (typeof define === 'function' && typeof define.amd === 'object' && define.amd) {\n\t\t// register as 'classnames', consistent with npm package name\n\t\tdefine('classnames', [], function () {\n\t\t\treturn classNames;\n\t\t});\n\t} else {\n\t\twindow.classNames = classNames;\n\t}\n}());\n","const n={alignContent:\"alignContent\",alignItems:\"alignItems\",alignSelf:\"alignSelf\",area:\"gridArea\",autoColumns:\"gridAutoColumns\",autoFlow:\"gridAutoFlow\",autoRows:\"gridAutoRows\",backgroundColor:\"backgroundColor\",backgroundImage:\"backgroundImage\",basis:\"flexBasis\",border:\"border\",borderRadius:\"borderRadius\",bottom:\"bottom\",boxShadow:\"boxShadow\",color:\"color\",column:\"gridColumn\",columnEnd:\"gridColumnEnd\",columnGap:\"columnGap\",columnSpan:\"gridColumn\",columnStart:\"gridColumnStart\",direction:\"flexDirection\",display:\"display\",flex:\"flex\",fontFamily:\"fontFamily\",fontSize:\"fontSize\",fontStyle:\"fontStyle\",fontWeight:\"fontWeight\",gap:\"gap\",grow:\"flexGrow\",height:\"height\",justifyContent:\"justifyContent\",left:\"left\",letterSpacing:\"letterSpacing\",lineHeight:\"lineHeight\",margin:\"margin\",marginBlock:\"marginBlock\",marginBlockEnd:\"marginBlockEnd\",marginBlockStart:\"marginBlockStart\",marginBottom:\"marginBlockEnd\",marginInline:\"marginInline\",marginInlineEnd:\"marginInlineEnd\",marginInlineStart:\"marginInlineStart\",marginLeft:\"marginInlineStart\",marginRight:\"marginInlineEnd\",marginTop:\"marginBlockStart\",maxHeight:\"maxHeight\",maxWidth:\"maxWidth\",minHeight:\"minHeight\",minWidth:\"minWidth\",objectFit:\"objectFit\",objectPosition:\"objectPosition\",opacity:\"opacity\",order:\"order\",overflow:\"overflow\",padding:\"padding\",paddingBlock:\"paddingBlock\",paddingBlockEnd:\"paddingBlockEnd\",paddingBlockStart:\"paddingBlockStart\",paddingBottom:\"paddingBlockEnd\",paddingInline:\"paddingInline\",paddingInlineEnd:\"paddingInlineEnd\",paddingInlineStart:\"paddingInlineStart\",paddingLeft:\"paddingInlineStart\",paddingRight:\"paddingInlineEnd\",paddingTop:\"paddingBlockStart\",position:\"position\",resize:\"resize\",right:\"right\",row:\"gridRow\",rowEnd:\"gridRowEnd\",rowGap:\"rowGap\",rowSpan:\"gridRow\",rowStart:\"gridRowStart\",shrink:\"flexShrink\",templateAreas:\"gridTemplateAreas\",templateColumns:\"gridTemplateColumns\",templateRows:\"gridTemplateRows\",textAlign:\"textAlign\",textDecoration:\"textDecoration\",textTransform:\"textTransform\",top:\"top\",transform:\"transform\",transformOrigin:\"transformOrigin\",width:\"width\",whiteSpace:\"whiteSpace\",wrap:\"flexWrap\"},i=Object.keys(n);export{n as ComponentPropsToStylePropsMap,i as ComponentPropsToStylePropsMapKeys};\n","import{stylePropsToThemeKeys as o}from\"../shared/constants.mjs\";const s=s=>s in o;export{s as isThemeStylePropKey};\n","import{isDesignToken as t,cssNameTransform as r}from\"@aws-amplify/ui\";export{classNameModifier,classNameModifierByFlag}from\"@aws-amplify/ui\";import{isThemeStylePropKey as e}from\"../types/theme.mjs\";import{stylePropsToThemeKeys as i}from\"./constants.mjs\";const o=t=>\"string\"==typeof t&&t.length>0,s=t=>\"string\"==typeof t&&0===t.length,n=t=>null==t||s(t),f=(t,r)=>{const e=r-t+1;return Array.from({length:e},((r,e)=>e+t))},l=t=>Object.keys(t),m=(o,s,n)=>{if(\"string\"!=typeof s)return s;if(s.includes(\" \"))return s.split(\" \").map((t=>m(o,t,n))).join(\" \");if(e(o)){const e=s.split(\".\"),f=i[o];let l=n[f];for(let t=0;t{let i={};const n=t(e).sort(((r,t)=>e[r]-e[t]));var a;return Array.isArray(s)?s.forEach(((r,t)=>{i[n[t]]=r})):\"object\"==typeof s&&(i=t(a=s).reduce(((t,o)=>o in r.breakpoints.values?Object.assign(Object.assign({},t),{[o]:a[o]}):t),{})),(({breakpoint:r,breakpoints:o,values:e})=>{const s=e[r];if(void 0!==s)return s;const i=t(o).sort(((r,t)=>o[t]-o[r])),n=i.slice(i.indexOf(r));for(const r of n){const t=e[r];if(void 0!==t)return t}return null})({breakpoint:o,breakpoints:e,values:i})};export{o as getValueAtCurrentBreakpoint};\n","import{objectKeys as t}from\"../utils.mjs\";const n=({breakpoints:n})=>{const r=t(n).sort(((t,r)=>n[r]-n[t]));return r.map(((t,i)=>{let o=\"\";const m=n[t],e=r[i-1],p=e?n[e]-1:null;return m>=0&&(o=`(min-width: ${m}px)`),null!==p&&(o&&(o+=\" and \"),o+=`(max-width: ${p}px)`),{breakpoint:t,query:o,maxWidth:p,minWidth:m}}))};export{n as getMediaQueries};\n","import*as e from\"react\";import{getMediaQueries as t}from\"./getMediaQueries.mjs\";const n=\"undefined\"==typeof window?e.useEffect:e.useLayoutEffect,o=({breakpoints:o,defaultBreakpoint:a})=>{const r=\"undefined\"!=typeof window&&void 0!==window.matchMedia?window.matchMedia:null,i=e.useMemo((()=>t({breakpoints:o})),[o]),[s,u]=e.useState(a),c=e.useCallback(((e,t)=>{e&&u(t)}),[u]);return n((()=>{if(!r)return;const e=i.map((({query:e,breakpoint:t})=>{const n=r(e);c(n.matches,t);const o=e=>{e.matches&&u(t)};return n.addEventListener(\"change\",o),()=>n.removeEventListener(\"change\",o)}));return()=>{e.forEach((e=>e()))}}),[o,u,r,i]),e.useDebugValue(s,(e=>e)),s};export{o as useBreakpoint};\n","import*as o from\"react\";import{createTheme as t}from\"@aws-amplify/ui\";import{AmplifyContext as e}from\"../components/ThemeProvider/AmplifyContext.mjs\";const m=o=>void 0===o||void 0===o.theme?t():o.theme,r=()=>{const t=o.useContext(e);return m(t)};export{m as getThemeFromContext,r as useTheme};\n","import{isDesignToken as o,isString as t}from\"@aws-amplify/ui\";import{getCSSVariableIfValueIsThemeKey as r}from\"./utils.mjs\";const i=({value:i,propKey:m,tokens:p})=>o(i)?i.toString():t(i)?t(m)?r(m,i,p):i:null;export{i as getStyleValue};\n","import{__rest as o}from\"tslib\";import*as e from\"react\";import{isDesignToken as t}from\"@aws-amplify/ui\";import{ComponentPropsToStylePropsMap as r}from\"../types/style.mjs\";import{getValueAtCurrentBreakpoint as s}from\"./responsive/utils.mjs\";import{useBreakpoint as n}from\"./responsive/useBreakpoint.mjs\";import\"../../components/ThemeProvider/AmplifyContext.mjs\";import{useTheme as p}from\"../../hooks/useTheme.mjs\";import{getStyleValue as a}from\"./getStyleValue.mjs\";import{isNullOrEmptyString as i,isEmptyString as m,getCSSVariableIfValueIsThemeKey as l}from\"./utils.mjs\";const u=o=>\"auto\"===o||\"number\"==typeof o&&!isNaN(o)||\"string\"==typeof o&&!isNaN(parseFloat(o)),c=o=>\"auto\"===o?\"auto\":`span ${o}`,f=o=>u(o)?c(o):Array.isArray(o)?o.map((o=>c(o))):\"object\"==typeof o&&null!=o?Object.entries(o).reduce(((o,[e,t])=>Object.assign(Object.assign({},o),{[e]:c(t)})),{}):null,b=t=>{const{rowSpan:r,columnSpan:s,row:n,column:p}=t,a=o(t,[\"rowSpan\",\"columnSpan\",\"row\",\"column\"]),{rowFromSpanValue:m,columnFromSpanValue:l}=e.useMemo((()=>({rowFromSpanValue:f(r),columnFromSpanValue:f(s)})),[r,s]);return Object.assign({row:i(n)?m:n,column:i(p)?l:p},a)},y=({props:o={},style:e={},breakpoint:n,breakpoints:p,tokens:i})=>{const u={};return Object.keys(o).filter((e=>null!==o[e])).forEach((c=>{if(c in r){const u=o[c];if(!u||m(u))return;const f=r[c];let b=\"\";t(u)?b=u.toString():\"string\"==typeof u?b=l(c,u,i):\"number\"==typeof u?b=u:\"object\"==typeof u&&(b=a({propKey:c,tokens:i,value:s({values:u,breakpoint:n,breakpoints:p})})),e=Object.assign(Object.assign({},e),{[f]:b})}else void 0!==o[c]&&(u[c]=o[c])})),{propStyles:e,nonStyleProps:u}},k=(o,t)=>{const{breakpoints:{values:r,defaultBreakpoint:s},tokens:a}=p(),i=n({breakpoints:r,defaultBreakpoint:s}),m=b(o);return e.useMemo((()=>y({props:m,style:t,breakpoint:i,breakpoints:r,tokens:a})),[m,t,r,i,a])};export{f as convertGridSpan,y as convertStylePropsToStyleObj,c as getGridSpan,u as isSpanPrimitiveValue,k as useStyles,b as useTransformStyleProps};\n","import{__rest as e}from\"tslib\";import*as t from\"react\";import{useStyles as r}from\"../shared/styleUtils.mjs\";const s=t.forwardRef(((s,a)=>{var{as:i=\"div\",children:l,testId:d,ariaLabel:n,isDisabled:o,style:m,inert:b}=s,p=e(s,[\"as\",\"children\",\"testId\",\"ariaLabel\",\"isDisabled\",\"style\",\"inert\"]);const{propStyles:c,nonStyleProps:y}=r(p,m);return t.createElement(i,Object.assign({\"aria-label\":n,\"data-testid\":d,disabled:o,ref:a,inert:b?\"\":null,style:c},y),l)}));s.displayName=\"View\";export{s as View};\n","import{__rest as e}from\"tslib\";import*as t from\"react\";import s from\"classnames\";import{ComponentClassNames as m}from\"../../shared/constants.mjs\";import{View as r}from\"../../View/View.mjs\";const o=o=>{const{className:a}=o,i=e(o,[\"className\"]);return t.createElement(r,Object.assign({as:\"span\",width:\"1em\",height:\"1em\",className:s(m.Icon,a)},i),t.createElement(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\"},t.createElement(\"path\",{d:\"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20ZM16.59 7.58L10 14.17L7.41 11.59L6 13L10 17L18 9L16.59 7.58Z\",fill:\"currentColor\"})))};export{o as IconCheckCircle};\n","import{__rest as e}from\"tslib\";import t from\"classnames\";import*as s from\"react\";import{ComponentClassNames as m}from\"../../shared/constants.mjs\";import{View as r}from\"../../View/View.mjs\";const o=o=>{const{className:a}=o,i=e(o,[\"className\"]);return s.createElement(r,Object.assign({as:\"span\",width:\"1em\",height:\"1em\",className:t(m.Icon,a)},i),s.createElement(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\"},s.createElement(\"path\",{d:\"M12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM13 17H11V15H13V17ZM13 13H11V7H13V13Z\",fill:\"currentColor\"})))};export{o as IconError};\n","import{__rest as e}from\"tslib\";import t from\"classnames\";import*as s from\"react\";import{ComponentClassNames as m}from\"../../shared/constants.mjs\";import{View as r}from\"../../View/View.mjs\";const o=o=>{const{className:a}=o,i=e(o,[\"className\"]);return s.createElement(r,Object.assign({as:\"span\",width:\"1em\",height:\"1em\",className:t(m.Icon,a)},i),s.createElement(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\"},s.createElement(\"path\",{d:\"M11 7H13V9H11V7ZM11 11H13V17H11V11ZM12 2C6.48 2 2 6.48 2 12C2 17.52 6.48 22 12 22C17.52 22 22 17.52 22 12C22 6.48 17.52 2 12 2ZM12 20C7.59 20 4 16.41 4 12C4 7.59 7.59 4 12 4C16.41 4 20 7.59 20 12C20 16.41 16.41 20 12 20Z\",fill:\"currentColor\"})))};export{o as IconInfo};\n","import{__rest as e}from\"tslib\";import t from\"classnames\";import*as s from\"react\";import{ComponentClassNames as m}from\"../../shared/constants.mjs\";import{View as r}from\"../../View/View.mjs\";const o=o=>{const{className:a}=o,i=e(o,[\"className\"]);return s.createElement(r,Object.assign({as:\"span\",width:\"1em\",height:\"1em\",className:t(m.Icon,a)},i),s.createElement(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\"},s.createElement(\"path\",{d:\"M1 21H23L12 2L1 21ZM13 18H11V16H13V18ZM13 14H11V10H13V14Z\",fill:\"currentColor\"})))};export{o as IconWarning};\n","import*as r from\"react\";import{ComponentClassNames as e}from\"../shared/constants.mjs\";import\"tslib\";import\"classnames\";import\"../View/View.mjs\";import{IconCheckCircle as n}from\"../Icon/icons/IconCheckCircle.mjs\";import{IconError as o}from\"../Icon/icons/IconError.mjs\";import{IconInfo as a}from\"../Icon/icons/IconInfo.mjs\";import{IconWarning as c}from\"../Icon/icons/IconWarning.mjs\";const s=({variation:s,ariaHidden:t})=>{switch(s){case\"info\":return r.createElement(a,{\"aria-hidden\":t,className:e.AlertIcon});case\"error\":return r.createElement(o,{\"aria-hidden\":t,className:e.AlertIcon});case\"warning\":return r.createElement(c,{\"aria-hidden\":t,className:e.AlertIcon});case\"success\":return r.createElement(n,{\"aria-hidden\":t,className:e.AlertIcon});default:return null}};s.displayName=\"AlertIcon\";export{s as AlertIcon};\n","import{__rest as e}from\"tslib\";import*as r from\"react\";import s from\"classnames\";import{ComponentClassNames as a}from\"../shared/constants.mjs\";import{View as m}from\"../View/View.mjs\";const t=r.forwardRef(((t,o)=>{var{className:i,children:c}=t,l=e(t,[\"className\",\"children\"]);return r.createElement(m,Object.assign({className:s(a.Flex,i),ref:o},l),c)}));t.displayName=\"Flex\";export{t as Flex};\n","import{__rest as e}from\"tslib\";import*as t from\"react\";import a from\"classnames\";import{classNameModifier as r}from\"@aws-amplify/ui\";import{ComponentClassNames as i}from\"../shared/constants.mjs\";import{View as l}from\"../View/View.mjs\";const s=\"linear-empty\",n=\"linear-filled\",o=\"circular-empty\",m=\"circular-filled\",c=8,d=42,y=84*Math.PI,p=t.forwardRef(((c,d)=>{var{className:p,filledColor:f,emptyColor:x,size:g,variation:u,isDeterminate:v=!1,isPercentageTextHidden:E=!1,percentage:h=0}=c,k=e(c,[\"className\",\"filledColor\",\"emptyColor\",\"size\",\"variation\",\"isDeterminate\",\"isPercentageTextHidden\",\"percentage\"]);h=Math.min(h,100);const L=`${h=Math.max(h,0)}%`,N=a(i.Loader,r(i.Loader,g),r(i.Loader,u),v?i.LoaderDeterminate:null,p),D=t.createElement(\"g\",null,t.createElement(\"line\",{x1:\"0\",x2:\"100%\",y1:\"50%\",y2:\"50%\",style:{stroke:String(x)},\"data-testid\":s}),t.createElement(\"line\",{x1:\"0\",x2:v?L:\"100%\",y1:\"50%\",y2:\"50%\",style:{stroke:v&&0===h?\"none\":f?String(f):void 0},\"data-testid\":n}),v?t.createElement(\"text\",{\"aria-live\":\"polite\",className:a(i.LoaderPercentageText,E?i.VisuallyHidden:null),x:`${-1+h}%`,y:\"200%\"},L):null),P=t.createElement(\"g\",null,t.createElement(\"circle\",{cx:\"50%\",cy:\"50%\",r:\"42%\",strokeWidth:\"8%\",style:{stroke:String(x)},\"data-testid\":o}),t.createElement(\"circle\",{cx:\"50%\",cy:\"50%\",r:\"42%\",strokeWidth:\"8%\",style:{stroke:String(f),strokeDasharray:v?`${y}% ${y}%`:void 0,strokeDashoffset:v?y-y*h/100+\"%\":void 0},\"data-testid\":m}),v?t.createElement(\"text\",{\"aria-live\":\"polite\",className:a(i.LoaderPercentageText,E?i.VisuallyHidden:null),x:\"130%\",y:\"80%\"},L):null);return t.createElement(l,Object.assign({as:\"svg\",className:N,\"data-size\":g,\"data-variation\":u,ref:d,role:\"img\"},k),\"linear\"===u?D:P)}));p.displayName=\"Loader\";export{o as CIRCULAR_EMPTY,m as CIRCULAR_FILLED,c as CIRCULAR_STROKE_WIDTH,y as CIRCUMFERENCE,s as LINEAR_EMPTY,n as LINEAR_FILLED,p as Loader,d as RADIUS};\n","import{__rest as t}from\"tslib\";import a from\"classnames\";import*as i from\"react\";import{classNameModifier as e,classNameModifierByFlag as o}from\"@aws-amplify/ui\";import{ComponentClassNames as s}from\"../shared/constants.mjs\";import{Flex as l}from\"../Flex/Flex.mjs\";import{Loader as r}from\"../Loader/Loader.mjs\";import{View as n}from\"../View/View.mjs\";const d=i.forwardRef(((d,m)=>{var u,{className:p,children:c,isFullWidth:f=!1,isDisabled:b,isLoading:B,loadingText:g=\"\",size:h,type:w=\"button\",variation:j}=d,v=t(d,[\"className\",\"children\",\"isFullWidth\",\"isDisabled\",\"isLoading\",\"loadingText\",\"size\",\"type\",\"variation\"]);const x=a(s.Button,s.FieldGroupControl,e(s.Button,j),e(s.Button,h),o(s.Button,\"disabled\",null!==(u=null!=b?b:B)&&void 0!==u?u:v.disabled),o(s.Button,\"loading\",B),o(s.Button,\"fullwidth\",f),p);return i.createElement(n,Object.assign({ref:m,as:\"button\",className:x,\"data-fullwidth\":f,\"data-loading\":B,\"data-size\":h,\"data-variation\":j,isDisabled:null!=b?b:B,type:w},v),B?i.createElement(l,{as:\"span\",className:s.ButtonLoaderWrapper},i.createElement(r,{size:h}),g||null):c)}));d.displayName=\"Button\";export{d as Button};\n","import{__rest as e}from\"tslib\";import t from\"classnames\";import*as s from\"react\";import{ComponentClassNames as m}from\"../../shared/constants.mjs\";import{View as r}from\"../../View/View.mjs\";const i=i=>{const{className:o,size:a}=i,l=e(i,[\"className\",\"size\"]);return s.createElement(r,Object.assign({as:\"span\",width:null!=a?a:\"1em\",height:null!=a?a:\"1em\",className:t(m.Icon,o)},l),s.createElement(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\",style:a?{width:a,height:a}:void 0},s.createElement(\"path\",{d:\"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41Z\",fill:\"currentColor\"})))};export{i as IconClose};\n","import{__rest as a}from\"tslib\";import*as t from\"react\";import r from\"classnames\";import{classNameModifier as e,classNameModifierByFlag as s}from\"@aws-amplify/ui\";import{ComponentClassNames as i}from\"../shared/constants.mjs\";import{View as m}from\"../View/View.mjs\";const o=t.forwardRef(((o,n)=>{var{as:c=\"p\",className:d,children:f,isTruncated:l,variation:p}=o,u=a(o,[\"as\",\"className\",\"children\",\"isTruncated\",\"variation\"]);const T=r(i.Text,e(i.Text,p),s(i.Text,\"truncated\",l),d);return t.createElement(m,Object.assign({as:c,className:T,\"data-truncate\":l,\"data-variation\":p,ref:n},u),f)}));o.displayName=\"Text\";export{o as Text};\n","import{__rest as e}from\"tslib\";import*as t from\"react\";import i from\"classnames\";import{Text as s}from\"../Text/Text.mjs\";import{ComponentClassNames as r}from\"../shared/constants.mjs\";const a=\"qa-field-description\",d=d=>{var{descriptiveText:l,labelHidden:m}=d,o=e(d,[\"descriptiveText\",\"labelHidden\"]);return l?t.createElement(s,Object.assign({\"data-testid\":a,className:i(r.FieldDescription,{[r.VisuallyHidden]:m})},o),l):null};d.displayName=\"FieldDescription\";export{d as FieldDescription,a as QA_FIELD_DESCRIPTION};\n","import{__rest as r}from\"tslib\";import*as e from\"react\";import{Text as s}from\"../Text/Text.mjs\";import{ComponentClassNames as a}from\"../shared/constants.mjs\";const o=o=>{var{errorMessage:t,hasError:m}=o,i=r(o,[\"errorMessage\",\"hasError\"]);return m&&t?e.createElement(s,Object.assign({className:a.FieldErrorMessage},i),t):null};o.displayName=\"FieldErrorMessage\";export{o as FieldErrorMessage};\n","import{__rest as e}from\"tslib\";import*as a from\"react\";import s from\"classnames\";import{ComponentClassNames as r}from\"../shared/constants.mjs\";import{View as l}from\"../View/View.mjs\";const i=a.forwardRef(((i,m)=>{var{children:t,className:o,visuallyHidden:n}=i,c=e(i,[\"children\",\"className\",\"visuallyHidden\"]);return a.createElement(l,Object.assign({as:\"label\",className:s(r.Label,o,{[r.VisuallyHidden]:n}),ref:m},c),t)}));i.displayName=\"Label\";export{i as Label};\n","import{__rest as e}from\"tslib\";import*as t from\"react\";import s from\"classnames\";import{isFunction as a,classNameModifier as i}from\"@aws-amplify/ui\";import{ComponentClassNames as r,ComponentText as m}from\"../shared/constants.mjs\";import{View as o}from\"../View/View.mjs\";import{Flex as l}from\"../Flex/Flex.mjs\";import{Button as n}from\"../Button/Button.mjs\";import{AlertIcon as c}from\"./AlertIcon.mjs\";import{IconClose as f}from\"../Icon/icons/IconClose.mjs\";const d=t.forwardRef(((d,p)=>{var{buttonRef:u,children:b,className:h,dismissButtonLabel:A=m.Alert.dismissButtonLabel,hasIcon:j=!0,heading:E,isDismissible:N=!1,onDismiss:v,variation:B}=d,D=e(d,[\"buttonRef\",\"children\",\"className\",\"dismissButtonLabel\",\"hasIcon\",\"heading\",\"isDismissible\",\"onDismiss\",\"variation\"]);const[I,g]=t.useState(!1),w=t.useCallback((()=>{g(!I),a(v)&&v()}),[g,v,I]);return I?null:t.createElement(l,Object.assign({className:s(r.Alert,h,i(r.Alert,B)),\"data-variation\":B,ref:p,role:\"alert\"},D),j&&t.createElement(c,{variation:B,ariaHidden:!0}),t.createElement(o,{flex:\"1\"},E&&t.createElement(o,{className:r.AlertHeading},E),t.createElement(o,{className:r.AlertBody},b)),N&&t.createElement(n,{ariaLabel:A,variation:\"link\",className:r.AlertDismiss,onClick:w,ref:u},t.createElement(f,{\"aria-hidden\":\"true\"})))}));d.displayName=\"Alert\";export{d as Alert};\n","import*as o from\"react\";const l=(null===globalThis||void 0===globalThis?void 0:globalThis.document)?o.useLayoutEffect:()=>{};export{l as useLayoutEffect};\n","import*as t from\"react\";import{useLayoutEffect as o}from\"./useLayoutEffect.mjs\";const r=\"amplify-id\",e=t[\"useId\".toString()]||(()=>{});let n=0;const s=s=>{const[u,i]=t.useState(e());return o((()=>{s||i((t=>null!=t?t:String(n++)))}),[s]),null!=s?s:u?`${r}-${u}`:\"\"};export{r as AUTO_GENERATED_ID_PREFIX,s as useStableId};\n","const o=(o,t)=>o&&t?`${o}-${t}`:void 0;export{o as getTestId};\n","import{__rest as e}from\"tslib\";import*as r from\"react\";import t from\"classnames\";import{classNameModifier as n}from\"@aws-amplify/ui\";import{ComponentClassNames as o}from\"../shared/constants.mjs\";import{Flex as a}from\"../Flex/Flex.mjs\";import{View as i}from\"../View/View.mjs\";const l=r.forwardRef(((l,m)=>{var{children:p,className:s,innerEndComponent:d,innerStartComponent:u,orientation:c=\"horizontal\",outerEndComponent:F,outerStartComponent:E,variation:G}=l,f=e(l,[\"children\",\"className\",\"innerEndComponent\",\"innerStartComponent\",\"orientation\",\"outerEndComponent\",\"outerStartComponent\",\"variation\"]);const N=null!=d,C=null!=u?o.FieldGroupHasInnerStart:null,S=N?o.FieldGroupHasInnerEnd:null,O=t(o.FieldGroup,C,S,n(o.FieldGroup,c),s);return r.createElement(a,Object.assign({className:O,\"data-orientation\":c,ref:m},f),E&&r.createElement(i,{className:t(o.FieldGroupOuterStart,n(o.FieldGroupOuterStart,G))},E),r.createElement(i,{className:t(o.FieldGroupFieldWrapper,n(o.FieldGroupFieldWrapper,c)),\"data-orientation\":c},u&&r.createElement(i,{className:o.FieldGroupInnerStart},u),p,d&&r.createElement(i,{className:o.FieldGroupInnerEnd},d)),F&&r.createElement(i,{className:t(o.FieldGroupOuterEnd,n(o.FieldGroupOuterEnd,G))},F))}));l.displayName=\"FieldGroup\";export{l as FieldGroup};\n","import{__rest as e}from\"tslib\";import*as o from\"react\";import a from\"classnames\";import{classNameModifier as t,classNameModifierByFlag as n}from\"@aws-amplify/ui\";import{ComponentClassNames as r}from\"../shared/constants.mjs\";import{View as s}from\"../View/View.mjs\";const i=o.forwardRef(((i,l)=>{var{autoComplete:u,checked:d,className:p,defaultChecked:c,defaultValue:m,id:f,isDisabled:C,isReadOnly:h,isRequired:y,size:v,type:I=\"text\",hasError:k=!1,value:b,variation:R,onBlur:V,onChange:g,onCopy:w,onCut:F,onFocus:N,onInput:O,onPaste:j,onSelect:q,onWheel:z}=i,B=e(i,[\"autoComplete\",\"checked\",\"className\",\"defaultChecked\",\"defaultValue\",\"id\",\"isDisabled\",\"isReadOnly\",\"isRequired\",\"size\",\"type\",\"hasError\",\"value\",\"variation\",\"onBlur\",\"onChange\",\"onCopy\",\"onCut\",\"onFocus\",\"onInput\",\"onPaste\",\"onSelect\",\"onWheel\"]);const D=a(r.Input,r.FieldGroupControl,t(r.Input,R),n(r.Input,\"error\",k),t(r.Input,v),p);return o.createElement(s,Object.assign({\"aria-invalid\":k,as:\"input\",autoComplete:u,checked:d,className:D,\"data-size\":v,\"data-variation\":R,defaultChecked:c,defaultValue:m,isDisabled:C,id:f,onBlur:V,onChange:g,onCopy:w,onCut:F,onFocus:N,onInput:O,onPaste:j,onSelect:q,onWheel:z,readOnly:h,ref:l,required:y,type:I,value:b},B))}));i.displayName=\"Input\";export{i as Input};\n","import{ComponentPropsToStylePropsMap as s}from\"../types/style.mjs\";const t=t=>{const e={styleProps:{},rest:{}};return Object.keys(t).forEach((r=>{(t=>t in s)(r)?e.styleProps=Object.assign(Object.assign({},e.styleProps),{[r]:t[r]}):e.rest=Object.assign(Object.assign({},e.rest),{[r]:t[r]})})),e};export{t as splitPrimitiveProps};\n","import{__rest as e}from\"tslib\";import*as t from\"react\";import r from\"classnames\";import{classNameModifier as o}from\"@aws-amplify/ui\";import{ComponentClassNames as i}from\"../shared/constants.mjs\";import\"../Field/FieldClearButton.mjs\";import{FieldDescription as n}from\"../Field/FieldDescription.mjs\";import{FieldErrorMessage as s}from\"../Field/FieldErrorMessage.mjs\";import\"../Field/Field.mjs\";import{FieldGroup as m}from\"../FieldGroup/FieldGroup.mjs\";import{Flex as a}from\"../Flex/Flex.mjs\";import{Input as l}from\"../Input/Input.mjs\";import{Label as d}from\"../Label/Label.mjs\";import{splitPrimitiveProps as p}from\"../utils/splitPrimitiveProps.mjs\";import{useStableId as c}from\"../utils/useStableId.mjs\";const u=t.forwardRef(((u,f)=>{const{className:E,descriptiveText:F,errorMessage:b,hasError:j=!1,id:C,innerEndComponent:v,innerStartComponent:S,label:x,labelHidden:y=!1,outerEndComponent:g,outerStartComponent:h,size:I,testId:T,variation:z,inputStyles:H}=u,M=e(u,[\"className\",\"descriptiveText\",\"errorMessage\",\"hasError\",\"id\",\"innerEndComponent\",\"innerStartComponent\",\"label\",\"labelHidden\",\"outerEndComponent\",\"outerStartComponent\",\"size\",\"testId\",\"variation\",\"inputStyles\"]),N=c(C),P=c(),w=F?P:void 0,{styleProps:G,rest:L}=p(M);return t.createElement(a,Object.assign({className:r(i.Field,o(i.Field,I),i.TextField,E),\"data-size\":I,testId:T},G),t.createElement(d,{htmlFor:N,visuallyHidden:y},x),t.createElement(n,{id:P,labelHidden:y,descriptiveText:F}),t.createElement(m,{outerStartComponent:h,outerEndComponent:g,innerStartComponent:S,innerEndComponent:v,variation:z},t.createElement(l,Object.assign({\"aria-describedby\":w,hasError:j,id:N,ref:f,size:I,variation:z},H,L))),t.createElement(s,{hasError:j,errorMessage:b}))}));u.displayName=\"TextField\";export{u as TextField};\n","import{__rest as s}from\"tslib\";import*as a from\"react\";import e from\"classnames\";import{ComponentClassNames as r}from\"../shared/constants.mjs\";import{View as m}from\"../View/View.mjs\";const i=a.forwardRef(((i,t)=>{var{as:o=\"span\",children:l,className:n}=i,c=s(i,[\"as\",\"children\",\"className\"]);return a.createElement(m,Object.assign({as:o,className:e(r.VisuallyHidden,n),ref:t},c),l)}));i.displayName=\"VisuallyHidden\";export{i as VisuallyHidden};\n","/** Used to match a single whitespace character. */\nvar reWhitespace = /\\s/;\n\n/**\n * Used by `_.trim` and `_.trimEnd` to get the index of the last non-whitespace\n * character of `string`.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {number} Returns the index of the last non-whitespace character.\n */\nfunction trimmedEndIndex(string) {\n var index = string.length;\n\n while (index-- && reWhitespace.test(string.charAt(index))) {}\n return index;\n}\n\nmodule.exports = trimmedEndIndex;\n","var trimmedEndIndex = require('./_trimmedEndIndex');\n\n/** Used to match leading whitespace. */\nvar reTrimStart = /^\\s+/;\n\n/**\n * The base implementation of `_.trim`.\n *\n * @private\n * @param {string} string The string to trim.\n * @returns {string} Returns the trimmed string.\n */\nfunction baseTrim(string) {\n return string\n ? string.slice(0, trimmedEndIndex(string) + 1).replace(reTrimStart, '')\n : string;\n}\n\nmodule.exports = baseTrim;\n","var baseTrim = require('./_baseTrim'),\n isObject = require('./isObject'),\n isSymbol = require('./isSymbol');\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = baseTrim(value);\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = toNumber;\n","import{__rest as a}from\"tslib\";import i from\"classnames\";import*as e from\"react\";import{classNameModifier as r}from\"@aws-amplify/ui\";import{ComponentClassNames as s}from\"../shared/constants.mjs\";import{View as t}from\"../View/View.mjs\";const o=e.forwardRef(((o,m)=>{var{className:l,orientation:n=\"horizontal\",size:c,label:d}=o,f=a(o,[\"className\",\"orientation\",\"size\",\"label\"]);const p=i(s.Divider,r(s.Divider,n),r(s.Divider,c),d?s.DividerLabel:null,l);return e.createElement(t,Object.assign({\"aria-orientation\":n,as:\"hr\",className:p,\"data-size\":c,\"data-label\":d,ref:m},f))}));o.displayName=\"Divider\";export{o as Divider};\n","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 };","import {createContext as $3bkAK$createContext, useMemo as $3bkAK$useMemo, createElement as $3bkAK$createElement, useContext as $3bkAK$useContext} from \"react\";\n\n\nfunction $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {\n const Context = /*#__PURE__*/ $3bkAK$createContext(defaultContext);\n function Provider(props) {\n const { children: children , ...context } = props; // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = $3bkAK$useMemo(()=>context\n , Object.values(context));\n return /*#__PURE__*/ $3bkAK$createElement(Context.Provider, {\n value: value\n }, children);\n }\n function useContext(consumerName) {\n const context = $3bkAK$useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n Provider.displayName = rootComponentName + 'Provider';\n return [\n Provider,\n useContext\n ];\n}\n/* -------------------------------------------------------------------------------------------------\n * createContextScope\n * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$50c7b4e9d9f19c1(scopeName, createContextScopeDeps = []) {\n let defaultContexts = [];\n /* -----------------------------------------------------------------------------------------------\n * createContext\n * ---------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$export$fd42f52fd3ae1109(rootComponentName, defaultContext) {\n const BaseContext = /*#__PURE__*/ $3bkAK$createContext(defaultContext);\n const index = defaultContexts.length;\n defaultContexts = [\n ...defaultContexts,\n defaultContext\n ];\n function Provider(props) {\n const { scope: scope , children: children , ...context } = props;\n const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext; // Only re-memoize when prop values change\n // eslint-disable-next-line react-hooks/exhaustive-deps\n const value = $3bkAK$useMemo(()=>context\n , Object.values(context));\n return /*#__PURE__*/ $3bkAK$createElement(Context.Provider, {\n value: value\n }, children);\n }\n function useContext(consumerName, scope) {\n const Context = (scope === null || scope === void 0 ? void 0 : scope[scopeName][index]) || BaseContext;\n const context = $3bkAK$useContext(Context);\n if (context) return context;\n if (defaultContext !== undefined) return defaultContext; // if a defaultContext wasn't specified, it's a required context.\n throw new Error(`\\`${consumerName}\\` must be used within \\`${rootComponentName}\\``);\n }\n Provider.displayName = rootComponentName + 'Provider';\n return [\n Provider,\n useContext\n ];\n }\n /* -----------------------------------------------------------------------------------------------\n * createScope\n * ---------------------------------------------------------------------------------------------*/ const createScope = ()=>{\n const scopeContexts = defaultContexts.map((defaultContext)=>{\n return /*#__PURE__*/ $3bkAK$createContext(defaultContext);\n });\n return function useScope(scope) {\n const contexts = (scope === null || scope === void 0 ? void 0 : scope[scopeName]) || scopeContexts;\n return $3bkAK$useMemo(()=>({\n [`__scope${scopeName}`]: {\n ...scope,\n [scopeName]: contexts\n }\n })\n , [\n scope,\n contexts\n ]);\n };\n };\n createScope.scopeName = scopeName;\n return [\n $c512c27ab02ef895$export$fd42f52fd3ae1109,\n $c512c27ab02ef895$var$composeContextScopes(createScope, ...createContextScopeDeps)\n ];\n}\n/* -------------------------------------------------------------------------------------------------\n * composeContextScopes\n * -----------------------------------------------------------------------------------------------*/ function $c512c27ab02ef895$var$composeContextScopes(...scopes) {\n const baseScope = scopes[0];\n if (scopes.length === 1) return baseScope;\n const createScope1 = ()=>{\n const scopeHooks = scopes.map((createScope)=>({\n useScope: createScope(),\n scopeName: createScope.scopeName\n })\n );\n return function useComposedScopes(overrideScopes) {\n const nextScopes1 = scopeHooks.reduce((nextScopes, { useScope: useScope , scopeName: scopeName })=>{\n // We are calling a hook inside a callback which React warns against to avoid inconsistent\n // renders, however, scoping doesn't have render side effects so we ignore the rule.\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const scopeProps = useScope(overrideScopes);\n const currentScope = scopeProps[`__scope${scopeName}`];\n return {\n ...nextScopes,\n ...currentScope\n };\n }, {});\n return $3bkAK$useMemo(()=>({\n [`__scope${baseScope.scopeName}`]: nextScopes1\n })\n , [\n nextScopes1\n ]);\n };\n };\n createScope1.scopeName = baseScope.scopeName;\n return createScope1;\n}\n\n\n\n\nexport {$c512c27ab02ef895$export$fd42f52fd3ae1109 as createContext, $c512c27ab02ef895$export$50c7b4e9d9f19c1 as createContextScope};\n//# sourceMappingURL=index.module.js.map\n","import {useCallback as $3vqmr$useCallback} from \"react\";\n\n\n/**\n * Set a given ref to a given value\n * This utility takes care of different types of refs: callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$var$setRef(ref, value) {\n if (typeof ref === 'function') ref(value);\n else if (ref !== null && ref !== undefined) ref.current = value;\n}\n/**\n * A utility to compose multiple refs together\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$43e446d32b3d21af(...refs) {\n return (node)=>refs.forEach((ref)=>$6ed0406888f73fc4$var$setRef(ref, node)\n )\n ;\n}\n/**\n * A custom hook that composes multiple refs\n * Accepts callback refs and RefObject(s)\n */ function $6ed0406888f73fc4$export$c7b2cbe3552a0d05(...refs) {\n // eslint-disable-next-line react-hooks/exhaustive-deps\n return $3vqmr$useCallback($6ed0406888f73fc4$export$43e446d32b3d21af(...refs), refs);\n}\n\n\n\n\nexport {$6ed0406888f73fc4$export$43e446d32b3d21af as composeRefs, $6ed0406888f73fc4$export$c7b2cbe3552a0d05 as useComposedRefs};\n//# sourceMappingURL=index.module.js.map\n","import $9IrjX$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment} from \"react\";\nimport {composeRefs as $9IrjX$composeRefs} from \"@radix-ui/react-compose-refs\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n const childrenArray = $9IrjX$Children.toArray(children);\n const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child)=>{\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);\n return /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;\n } else return child;\n });\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? /*#__PURE__*/ $9IrjX$cloneElement(newElement, undefined, newChildren) : null);\n }\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), children);\n});\n$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n if (/*#__PURE__*/ $9IrjX$isValidElement(children)) return /*#__PURE__*/ $9IrjX$cloneElement(children, {\n ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),\n ref: $9IrjX$composeRefs(forwardedRef, children.ref)\n });\n return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;\n});\n$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{\n return /*#__PURE__*/ $9IrjX$createElement($9IrjX$Fragment, null, children);\n};\n/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {\n return /*#__PURE__*/ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;\n}\nfunction $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {\n // all child props should override\n const overrideProps = {\n ...childProps\n };\n for(const propName in childProps){\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName); // if it's a handler, modify the override by composing the base handler\n if (isHandler) overrideProps[propName] = (...args)=>{\n childPropValue === null || childPropValue === void 0 || childPropValue(...args);\n slotPropValue === null || slotPropValue === void 0 || slotPropValue(...args);\n };\n else if (propName === 'style') overrideProps[propName] = {\n ...slotPropValue,\n ...childPropValue\n };\n else if (propName === 'className') overrideProps[propName] = [\n slotPropValue,\n childPropValue\n ].filter(Boolean).join(' ');\n }\n return {\n ...slotProps,\n ...overrideProps\n };\n}\nconst $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = $5e63c961fc1ce211$export$8c6ed5c666ac1360;\n\n\n\n\nexport {$5e63c961fc1ce211$export$8c6ed5c666ac1360 as Slot, $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 as Slottable, $5e63c961fc1ce211$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.module.js.map\n","import $6vYhU$react from \"react\";\nimport {createContextScope as $6vYhU$createContextScope} from \"@radix-ui/react-context\";\nimport {useComposedRefs as $6vYhU$useComposedRefs} from \"@radix-ui/react-compose-refs\";\nimport {Slot as $6vYhU$Slot} from \"@radix-ui/react-slot\";\n\n\n\n\n\n// We have resorted to returning slots directly rather than exposing primitives that can then\n// be slotted like ``.\n// This is because we encountered issues with generic types that cannot be statically analysed\n// due to creating them dynamically via createCollection.\nfunction $e02a7d9cb1dc128c$export$c74125a8e3af6bb2(name) {\n /* -----------------------------------------------------------------------------------------------\n * CollectionProvider\n * ---------------------------------------------------------------------------------------------*/ const PROVIDER_NAME = name + 'CollectionProvider';\n const [createCollectionContext, createCollectionScope] = $6vYhU$createContextScope(PROVIDER_NAME);\n const [CollectionProviderImpl, useCollectionContext] = createCollectionContext(PROVIDER_NAME, {\n collectionRef: {\n current: null\n },\n itemMap: new Map()\n });\n const CollectionProvider = (props)=>{\n const { scope: scope , children: children } = props;\n const ref = $6vYhU$react.useRef(null);\n const itemMap = $6vYhU$react.useRef(new Map()).current;\n return /*#__PURE__*/ $6vYhU$react.createElement(CollectionProviderImpl, {\n scope: scope,\n itemMap: itemMap,\n collectionRef: ref\n }, children);\n };\n /*#__PURE__*/ Object.assign(CollectionProvider, {\n displayName: PROVIDER_NAME\n });\n /* -----------------------------------------------------------------------------------------------\n * CollectionSlot\n * ---------------------------------------------------------------------------------------------*/ const COLLECTION_SLOT_NAME = name + 'CollectionSlot';\n const CollectionSlot = /*#__PURE__*/ $6vYhU$react.forwardRef((props, forwardedRef)=>{\n const { scope: scope , children: children } = props;\n const context = useCollectionContext(COLLECTION_SLOT_NAME, scope);\n const composedRefs = $6vYhU$useComposedRefs(forwardedRef, context.collectionRef);\n return /*#__PURE__*/ $6vYhU$react.createElement($6vYhU$Slot, {\n ref: composedRefs\n }, children);\n });\n /*#__PURE__*/ Object.assign(CollectionSlot, {\n displayName: COLLECTION_SLOT_NAME\n });\n /* -----------------------------------------------------------------------------------------------\n * CollectionItem\n * ---------------------------------------------------------------------------------------------*/ const ITEM_SLOT_NAME = name + 'CollectionItemSlot';\n const ITEM_DATA_ATTR = 'data-radix-collection-item';\n const CollectionItemSlot = /*#__PURE__*/ $6vYhU$react.forwardRef((props, forwardedRef)=>{\n const { scope: scope , children: children , ...itemData } = props;\n const ref = $6vYhU$react.useRef(null);\n const composedRefs = $6vYhU$useComposedRefs(forwardedRef, ref);\n const context = useCollectionContext(ITEM_SLOT_NAME, scope);\n $6vYhU$react.useEffect(()=>{\n context.itemMap.set(ref, {\n ref: ref,\n ...itemData\n });\n return ()=>void context.itemMap.delete(ref)\n ;\n });\n return /*#__PURE__*/ $6vYhU$react.createElement($6vYhU$Slot, {\n [ITEM_DATA_ATTR]: '',\n ref: composedRefs\n }, children);\n });\n /*#__PURE__*/ Object.assign(CollectionItemSlot, {\n displayName: ITEM_SLOT_NAME\n });\n /* -----------------------------------------------------------------------------------------------\n * useCollection\n * ---------------------------------------------------------------------------------------------*/ function useCollection(scope) {\n const context = useCollectionContext(name + 'CollectionConsumer', scope);\n const getItems = $6vYhU$react.useCallback(()=>{\n const collectionNode = context.collectionRef.current;\n if (!collectionNode) return [];\n const orderedNodes = Array.from(collectionNode.querySelectorAll(`[${ITEM_DATA_ATTR}]`));\n const items = Array.from(context.itemMap.values());\n const orderedItems = items.sort((a, b)=>orderedNodes.indexOf(a.ref.current) - orderedNodes.indexOf(b.ref.current)\n );\n return orderedItems;\n }, [\n context.collectionRef,\n context.itemMap\n ]);\n return getItems;\n }\n return [\n {\n Provider: CollectionProvider,\n Slot: CollectionSlot,\n ItemSlot: CollectionItemSlot\n },\n useCollection,\n createCollectionScope\n ];\n}\n\n\n\n\nexport {$e02a7d9cb1dc128c$export$c74125a8e3af6bb2 as createCollection};\n//# sourceMappingURL=index.module.js.map\n","function $e42e1063c40fb3ef$export$b9ecd428b558ff10(originalEventHandler, ourEventHandler, { checkForDefaultPrevented: checkForDefaultPrevented = true } = {}) {\n return function handleEvent(event) {\n originalEventHandler === null || originalEventHandler === void 0 || originalEventHandler(event);\n if (checkForDefaultPrevented === false || !event.defaultPrevented) return ourEventHandler === null || ourEventHandler === void 0 ? void 0 : ourEventHandler(event);\n };\n}\n\n\n\n\nexport {$e42e1063c40fb3ef$export$b9ecd428b558ff10 as composeEventHandlers};\n//# sourceMappingURL=index.module.js.map\n","import {useRef as $lwiWj$useRef, useEffect as $lwiWj$useEffect, useMemo as $lwiWj$useMemo} from \"react\";\n\n\n/**\n * A custom hook that converts a callback to a ref to avoid triggering re-renders when passed as a\n * prop or avoid re-executing effects when passed as a dependency\n */ function $b1b2314f5f9a1d84$export$25bec8c6f54ee79a(callback) {\n const callbackRef = $lwiWj$useRef(callback);\n $lwiWj$useEffect(()=>{\n callbackRef.current = callback;\n }); // https://github.com/facebook/react/issues/19240\n return $lwiWj$useMemo(()=>(...args)=>{\n var _callbackRef$current;\n return (_callbackRef$current = callbackRef.current) === null || _callbackRef$current === void 0 ? void 0 : _callbackRef$current.call(callbackRef, ...args);\n }\n , []);\n}\n\n\n\n\nexport {$b1b2314f5f9a1d84$export$25bec8c6f54ee79a as useCallbackRef};\n//# sourceMappingURL=index.module.js.map\n","import {useCallback as $bnPw9$useCallback, useState as $bnPw9$useState, useRef as $bnPw9$useRef, useEffect as $bnPw9$useEffect} from \"react\";\nimport {useCallbackRef as $bnPw9$useCallbackRef} from \"@radix-ui/react-use-callback-ref\";\n\n\n\nfunction $71cd76cc60e0454e$export$6f32135080cb4c3({ prop: prop , defaultProp: defaultProp , onChange: onChange = ()=>{} }) {\n const [uncontrolledProp, setUncontrolledProp] = $71cd76cc60e0454e$var$useUncontrolledState({\n defaultProp: defaultProp,\n onChange: onChange\n });\n const isControlled = prop !== undefined;\n const value1 = isControlled ? prop : uncontrolledProp;\n const handleChange = $bnPw9$useCallbackRef(onChange);\n const setValue = $bnPw9$useCallback((nextValue)=>{\n if (isControlled) {\n const setter = nextValue;\n const value = typeof nextValue === 'function' ? setter(prop) : nextValue;\n if (value !== prop) handleChange(value);\n } else setUncontrolledProp(nextValue);\n }, [\n isControlled,\n prop,\n setUncontrolledProp,\n handleChange\n ]);\n return [\n value1,\n setValue\n ];\n}\nfunction $71cd76cc60e0454e$var$useUncontrolledState({ defaultProp: defaultProp , onChange: onChange }) {\n const uncontrolledState = $bnPw9$useState(defaultProp);\n const [value] = uncontrolledState;\n const prevValueRef = $bnPw9$useRef(value);\n const handleChange = $bnPw9$useCallbackRef(onChange);\n $bnPw9$useEffect(()=>{\n if (prevValueRef.current !== value) {\n handleChange(value);\n prevValueRef.current = value;\n }\n }, [\n value,\n prevValueRef,\n handleChange\n ]);\n return uncontrolledState;\n}\n\n\n\n\nexport {$71cd76cc60e0454e$export$6f32135080cb4c3 as useControllableState};\n//# sourceMappingURL=index.module.js.map\n","import $4q5Fq$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $4q5Fq$forwardRef, useEffect as $4q5Fq$useEffect, createElement as $4q5Fq$createElement} from \"react\";\nimport {flushSync as $4q5Fq$flushSync} from \"react-dom\";\nimport {Slot as $4q5Fq$Slot} from \"@radix-ui/react-slot\";\n\n\n\n\n\nconst $8927f6f2acc4f386$var$NODES = [\n 'a',\n 'button',\n 'div',\n 'h2',\n 'h3',\n 'img',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'span',\n 'svg',\n 'ul'\n]; // Temporary while we await merge of this fix:\n// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396\n// prettier-ignore\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{\n const Node = /*#__PURE__*/ $4q5Fq$forwardRef((props, forwardedRef)=>{\n const { asChild: asChild , ...primitiveProps } = props;\n const Comp = asChild ? $4q5Fq$Slot : node;\n $4q5Fq$useEffect(()=>{\n window[Symbol.for('radix-ui')] = true;\n }, []);\n return /*#__PURE__*/ $4q5Fq$createElement(Comp, $4q5Fq$babelruntimehelpersesmextends({}, primitiveProps, {\n ref: forwardedRef\n }));\n });\n Node.displayName = `Primitive.${node}`;\n return {\n ...primitive,\n [node]: Node\n };\n}, {});\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/ /**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click 👎\n * target.dispatchEvent(new Event(‘click’))\n *\n * dispatching a custom type within a non-discrete event 👎\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}\n *\n * dispatching a custom type within a `discrete` event 👍\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {\n if (target) $4q5Fq$flushSync(()=>target.dispatchEvent(event)\n );\n}\n/* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$be92b6f5f03c0fe9 = $8927f6f2acc4f386$export$250ffa63cdc0d034;\n\n\n\n\nexport {$8927f6f2acc4f386$export$250ffa63cdc0d034 as Primitive, $8927f6f2acc4f386$export$be92b6f5f03c0fe9 as Root, $8927f6f2acc4f386$export$6d1a0317bde7de7f as dispatchDiscreteCustomEvent};\n//# sourceMappingURL=index.module.js.map\n","import {useLayoutEffect as $dxlwH$useLayoutEffect} from \"react\";\n\n\n/**\n * On the server, React emits a warning when calling `useLayoutEffect`.\n * This is because neither `useLayoutEffect` nor `useEffect` run on the server.\n * We use this safe version which suppresses the warning by replacing it with a noop on the server.\n *\n * See: https://reactjs.org/docs/hooks-reference.html#uselayouteffect\n */ const $9f79659886946c16$export$e5c5a5f917a5871c = Boolean(globalThis === null || globalThis === void 0 ? void 0 : globalThis.document) ? $dxlwH$useLayoutEffect : ()=>{};\n\n\n\n\nexport {$9f79659886946c16$export$e5c5a5f917a5871c as useLayoutEffect};\n//# sourceMappingURL=index.module.js.map\n","import {Children as $iqq3r$Children, cloneElement as $iqq3r$cloneElement, useState as $iqq3r$useState, useRef as $iqq3r$useRef, useEffect as $iqq3r$useEffect, useCallback as $iqq3r$useCallback, useReducer as $iqq3r$useReducer} from \"react\";\nimport {flushSync as $iqq3r$flushSync} from \"react-dom\";\nimport {useComposedRefs as $iqq3r$useComposedRefs} from \"@radix-ui/react-compose-refs\";\nimport {useLayoutEffect as $iqq3r$useLayoutEffect} from \"@radix-ui/react-use-layout-effect\";\n\n\n\n\n\n\nfunction $fe963b355347cc68$export$3e6543de14f8614f(initialState, machine) {\n return $iqq3r$useReducer((state, event)=>{\n const nextState = machine[state][event];\n return nextState !== null && nextState !== void 0 ? nextState : state;\n }, initialState);\n}\n\n\nconst $921a889cee6df7e8$export$99c2b779aa4e8b8b = (props)=>{\n const { present: present , children: children } = props;\n const presence = $921a889cee6df7e8$var$usePresence(present);\n const child = typeof children === 'function' ? children({\n present: presence.isPresent\n }) : $iqq3r$Children.only(children);\n const ref = $iqq3r$useComposedRefs(presence.ref, child.ref);\n const forceMount = typeof children === 'function';\n return forceMount || presence.isPresent ? /*#__PURE__*/ $iqq3r$cloneElement(child, {\n ref: ref\n }) : null;\n};\n$921a889cee6df7e8$export$99c2b779aa4e8b8b.displayName = 'Presence';\n/* -------------------------------------------------------------------------------------------------\n * usePresence\n * -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$usePresence(present) {\n const [node1, setNode] = $iqq3r$useState();\n const stylesRef = $iqq3r$useRef({});\n const prevPresentRef = $iqq3r$useRef(present);\n const prevAnimationNameRef = $iqq3r$useRef('none');\n const initialState = present ? 'mounted' : 'unmounted';\n const [state, send] = $fe963b355347cc68$export$3e6543de14f8614f(initialState, {\n mounted: {\n UNMOUNT: 'unmounted',\n ANIMATION_OUT: 'unmountSuspended'\n },\n unmountSuspended: {\n MOUNT: 'mounted',\n ANIMATION_END: 'unmounted'\n },\n unmounted: {\n MOUNT: 'mounted'\n }\n });\n $iqq3r$useEffect(()=>{\n const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);\n prevAnimationNameRef.current = state === 'mounted' ? currentAnimationName : 'none';\n }, [\n state\n ]);\n $iqq3r$useLayoutEffect(()=>{\n const styles = stylesRef.current;\n const wasPresent = prevPresentRef.current;\n const hasPresentChanged = wasPresent !== present;\n if (hasPresentChanged) {\n const prevAnimationName = prevAnimationNameRef.current;\n const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(styles);\n if (present) send('MOUNT');\n else if (currentAnimationName === 'none' || (styles === null || styles === void 0 ? void 0 : styles.display) === 'none') // If there is no exit animation or the element is hidden, animations won't run\n // so we unmount instantly\n send('UNMOUNT');\n else {\n /**\n * When `present` changes to `false`, we check changes to animation-name to\n * determine whether an animation has started. We chose this approach (reading\n * computed styles) because there is no `animationrun` event and `animationstart`\n * fires after `animation-delay` has expired which would be too late.\n */ const isAnimating = prevAnimationName !== currentAnimationName;\n if (wasPresent && isAnimating) send('ANIMATION_OUT');\n else send('UNMOUNT');\n }\n prevPresentRef.current = present;\n }\n }, [\n present,\n send\n ]);\n $iqq3r$useLayoutEffect(()=>{\n if (node1) {\n /**\n * Triggering an ANIMATION_OUT during an ANIMATION_IN will fire an `animationcancel`\n * event for ANIMATION_IN after we have entered `unmountSuspended` state. So, we\n * make sure we only trigger ANIMATION_END for the currently active animation.\n */ const handleAnimationEnd = (event)=>{\n const currentAnimationName = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);\n const isCurrentAnimation = currentAnimationName.includes(event.animationName);\n if (event.target === node1 && isCurrentAnimation) // With React 18 concurrency this update is applied\n // a frame after the animation ends, creating a flash of visible content.\n // By manually flushing we ensure they sync within a frame, removing the flash.\n $iqq3r$flushSync(()=>send('ANIMATION_END')\n );\n };\n const handleAnimationStart = (event)=>{\n if (event.target === node1) // if animation occurred, store its name as the previous animation.\n prevAnimationNameRef.current = $921a889cee6df7e8$var$getAnimationName(stylesRef.current);\n };\n node1.addEventListener('animationstart', handleAnimationStart);\n node1.addEventListener('animationcancel', handleAnimationEnd);\n node1.addEventListener('animationend', handleAnimationEnd);\n return ()=>{\n node1.removeEventListener('animationstart', handleAnimationStart);\n node1.removeEventListener('animationcancel', handleAnimationEnd);\n node1.removeEventListener('animationend', handleAnimationEnd);\n };\n } else // Transition to the unmounted state if the node is removed prematurely.\n // We avoid doing so during cleanup as the node may change but still exist.\n send('ANIMATION_END');\n }, [\n node1,\n send\n ]);\n return {\n isPresent: [\n 'mounted',\n 'unmountSuspended'\n ].includes(state),\n ref: $iqq3r$useCallback((node)=>{\n if (node) stylesRef.current = getComputedStyle(node);\n setNode(node);\n }, [])\n };\n}\n/* -----------------------------------------------------------------------------------------------*/ function $921a889cee6df7e8$var$getAnimationName(styles) {\n return (styles === null || styles === void 0 ? void 0 : styles.animationName) || 'none';\n}\n\n\n\n\nexport {$921a889cee6df7e8$export$99c2b779aa4e8b8b as Presence};\n//# sourceMappingURL=index.module.js.map\n","import * as $2AODx$react from \"react\";\nimport {useLayoutEffect as $2AODx$useLayoutEffect} from \"@radix-ui/react-use-layout-effect\";\n\n\n\nconst $1746a345f3d73bb7$var$useReactId = $2AODx$react['useId'.toString()] || (()=>undefined\n);\nlet $1746a345f3d73bb7$var$count = 0;\nfunction $1746a345f3d73bb7$export$f680877a34711e37(deterministicId) {\n const [id, setId] = $2AODx$react.useState($1746a345f3d73bb7$var$useReactId()); // React versions older than 18 will have client-side ids only.\n $2AODx$useLayoutEffect(()=>{\n if (!deterministicId) setId((reactId)=>reactId !== null && reactId !== void 0 ? reactId : String($1746a345f3d73bb7$var$count++)\n );\n }, [\n deterministicId\n ]);\n return deterministicId || (id ? `radix-${id}` : '');\n}\n\n\n\n\nexport {$1746a345f3d73bb7$export$f680877a34711e37 as useId};\n//# sourceMappingURL=index.module.js.map\n","import{__rest as e}from\"tslib\";import t from\"classnames\";import*as s from\"react\";import{ComponentClassNames as m}from\"../../shared/constants.mjs\";import{View as r}from\"../../View/View.mjs\";const o=o=>{const{className:a}=o,i=e(o,[\"className\"]);return s.createElement(r,Object.assign({as:\"span\",width:\"1em\",height:\"1em\",className:t(m.Icon,a)},i),s.createElement(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\"},s.createElement(\"path\",{d:\"M16.59 8.58984L12 13.1698L7.41 8.58984L6 9.99984L12 15.9998L18 9.99984L16.59 8.58984Z\",fill:\"currentColor\"})))};export{o as IconExpandMore};\n","import{__rest as e}from\"tslib\";import*as a from\"react\";import r from\"classnames\";import{classNameModifier as s,classNameModifierByFlag as i}from\"@aws-amplify/ui\";import{ComponentClassNames as m}from\"../shared/constants.mjs\";import{View as t}from\"../View/View.mjs\";const n={1:\"h1\",2:\"h2\",3:\"h3\",4:\"h4\",5:\"h5\",6:\"h6\"},o=a.forwardRef(((o,c)=>{var{className:l,children:d,isTruncated:f,level:h=6}=o,p=e(o,[\"className\",\"children\",\"isTruncated\",\"level\"]);return a.createElement(t,Object.assign({as:n[h],className:r(m.Heading,s(m.Heading,h),i(m.Heading,\"truncated\",f),l),ref:c},p),d)}));o.displayName=\"Heading\";export{o as Heading};\n","import{__rest as e}from\"tslib\";import*as t from\"react\";import a from\"classnames\";import{ComponentClassNames as i}from\"../shared/constants.mjs\";import{View as m}from\"../View/View.mjs\";const s={minX:0,minY:0,width:24,height:24},r=t.forwardRef(((r,n)=>{var{className:o,as:h=\"svg\",fill:l=\"currentColor\",pathData:c,viewBox:p=s,children:f,paths:d}=r,w=e(r,[\"className\",\"as\",\"fill\",\"pathData\",\"viewBox\",\"children\",\"paths\"]);const g=p.minX?p.minX:s.minX,v=p.minY?p.minY:s.minY,j=p.width?p.width:s.width,x=p.height?p.height:s.height;let N;return f&&(N=f),d&&(N=d.map(((e,a)=>t.createElement(\"path\",Object.assign({},e,{key:a}))))),c&&(N=t.createElement(\"path\",{d:c,fill:l})),t.createElement(m,Object.assign({as:h,className:a(i.Icon,o),ref:n,viewBox:`${g} ${v} ${j} ${x}`},w),N)}));r.displayName=\"Icon\";export{r as Icon};\n","import {createContext as $7Gjcd$createContext, createElement as $7Gjcd$createElement, useContext as $7Gjcd$useContext} from \"react\";\n\n\nconst $f631663db3294ace$var$DirectionContext = /*#__PURE__*/ $7Gjcd$createContext(undefined);\n/* -------------------------------------------------------------------------------------------------\n * Direction\n * -----------------------------------------------------------------------------------------------*/ const $f631663db3294ace$export$c760c09fdd558351 = (props)=>{\n const { dir: dir , children: children } = props;\n return /*#__PURE__*/ $7Gjcd$createElement($f631663db3294ace$var$DirectionContext.Provider, {\n value: dir\n }, children);\n};\n/* -----------------------------------------------------------------------------------------------*/ function $f631663db3294ace$export$b39126d51d94e6f3(localDir) {\n const globalDir = $7Gjcd$useContext($f631663db3294ace$var$DirectionContext);\n return localDir || globalDir || 'ltr';\n}\nconst $f631663db3294ace$export$2881499e37b75b9a = $f631663db3294ace$export$c760c09fdd558351;\n\n\n\n\nexport {$f631663db3294ace$export$b39126d51d94e6f3 as useDirection, $f631663db3294ace$export$2881499e37b75b9a as Provider, $f631663db3294ace$export$c760c09fdd558351 as DirectionProvider};\n//# sourceMappingURL=index.module.js.map\n","import $98Iye$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $98Iye$forwardRef, createElement as $98Iye$createElement, useRef as $98Iye$useRef, useState as $98Iye$useState, useEffect as $98Iye$useEffect, useCallback as $98Iye$useCallback} from \"react\";\nimport {composeEventHandlers as $98Iye$composeEventHandlers} from \"@radix-ui/primitive\";\nimport {createCollection as $98Iye$createCollection} from \"@radix-ui/react-collection\";\nimport {useComposedRefs as $98Iye$useComposedRefs} from \"@radix-ui/react-compose-refs\";\nimport {createContextScope as $98Iye$createContextScope} from \"@radix-ui/react-context\";\nimport {useId as $98Iye$useId} from \"@radix-ui/react-id\";\nimport {Primitive as $98Iye$Primitive} from \"@radix-ui/react-primitive\";\nimport {useCallbackRef as $98Iye$useCallbackRef} from \"@radix-ui/react-use-callback-ref\";\nimport {useControllableState as $98Iye$useControllableState} from \"@radix-ui/react-use-controllable-state\";\nimport {useDirection as $98Iye$useDirection} from \"@radix-ui/react-direction\";\n\n\n\n\n\n\n\n\n\n\n\n\nconst $d7bdfb9eb0fdf311$var$ENTRY_FOCUS = 'rovingFocusGroup.onEntryFocus';\nconst $d7bdfb9eb0fdf311$var$EVENT_OPTIONS = {\n bubbles: false,\n cancelable: true\n};\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroup\n * -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$GROUP_NAME = 'RovingFocusGroup';\nconst [$d7bdfb9eb0fdf311$var$Collection, $d7bdfb9eb0fdf311$var$useCollection, $d7bdfb9eb0fdf311$var$createCollectionScope] = $98Iye$createCollection($d7bdfb9eb0fdf311$var$GROUP_NAME);\nconst [$d7bdfb9eb0fdf311$var$createRovingFocusGroupContext, $d7bdfb9eb0fdf311$export$c7109489551a4f4] = $98Iye$createContextScope($d7bdfb9eb0fdf311$var$GROUP_NAME, [\n $d7bdfb9eb0fdf311$var$createCollectionScope\n]);\nconst [$d7bdfb9eb0fdf311$var$RovingFocusProvider, $d7bdfb9eb0fdf311$var$useRovingFocusContext] = $d7bdfb9eb0fdf311$var$createRovingFocusGroupContext($d7bdfb9eb0fdf311$var$GROUP_NAME);\nconst $d7bdfb9eb0fdf311$export$8699f7c8af148338 = /*#__PURE__*/ $98Iye$forwardRef((props, forwardedRef)=>{\n return /*#__PURE__*/ $98Iye$createElement($d7bdfb9eb0fdf311$var$Collection.Provider, {\n scope: props.__scopeRovingFocusGroup\n }, /*#__PURE__*/ $98Iye$createElement($d7bdfb9eb0fdf311$var$Collection.Slot, {\n scope: props.__scopeRovingFocusGroup\n }, /*#__PURE__*/ $98Iye$createElement($d7bdfb9eb0fdf311$var$RovingFocusGroupImpl, $98Iye$babelruntimehelpersesmextends({}, props, {\n ref: forwardedRef\n }))));\n});\n/*#__PURE__*/ Object.assign($d7bdfb9eb0fdf311$export$8699f7c8af148338, {\n displayName: $d7bdfb9eb0fdf311$var$GROUP_NAME\n});\n/* -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$RovingFocusGroupImpl = /*#__PURE__*/ $98Iye$forwardRef((props, forwardedRef)=>{\n const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , orientation: orientation , loop: loop = false , dir: dir , currentTabStopId: currentTabStopIdProp , defaultCurrentTabStopId: defaultCurrentTabStopId , onCurrentTabStopIdChange: onCurrentTabStopIdChange , onEntryFocus: onEntryFocus , ...groupProps } = props;\n const ref = $98Iye$useRef(null);\n const composedRefs = $98Iye$useComposedRefs(forwardedRef, ref);\n const direction = $98Iye$useDirection(dir);\n const [currentTabStopId = null, setCurrentTabStopId] = $98Iye$useControllableState({\n prop: currentTabStopIdProp,\n defaultProp: defaultCurrentTabStopId,\n onChange: onCurrentTabStopIdChange\n });\n const [isTabbingBackOut, setIsTabbingBackOut] = $98Iye$useState(false);\n const handleEntryFocus = $98Iye$useCallbackRef(onEntryFocus);\n const getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);\n const isClickFocusRef = $98Iye$useRef(false);\n $98Iye$useEffect(()=>{\n const node = ref.current;\n if (node) {\n node.addEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus);\n return ()=>node.removeEventListener($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, handleEntryFocus)\n ;\n }\n }, [\n handleEntryFocus\n ]);\n return /*#__PURE__*/ $98Iye$createElement($d7bdfb9eb0fdf311$var$RovingFocusProvider, {\n scope: __scopeRovingFocusGroup,\n orientation: orientation,\n dir: direction,\n loop: loop,\n currentTabStopId: currentTabStopId,\n onItemFocus: $98Iye$useCallback((tabStopId)=>setCurrentTabStopId(tabStopId)\n , [\n setCurrentTabStopId\n ]),\n onItemShiftTab: $98Iye$useCallback(()=>setIsTabbingBackOut(true)\n , [])\n }, /*#__PURE__*/ $98Iye$createElement($98Iye$Primitive.div, $98Iye$babelruntimehelpersesmextends({\n tabIndex: isTabbingBackOut ? -1 : 0,\n \"data-orientation\": orientation\n }, groupProps, {\n ref: composedRefs,\n style: {\n outline: 'none',\n ...props.style\n },\n onMouseDown: $98Iye$composeEventHandlers(props.onMouseDown, ()=>{\n isClickFocusRef.current = true;\n }),\n onFocus: $98Iye$composeEventHandlers(props.onFocus, (event)=>{\n // We normally wouldn't need this check, because we already check\n // that the focus is on the current target and not bubbling to it.\n // We do this because Safari doesn't focus buttons when clicked, and\n // instead, the wrapper will get focused and not through a bubbling event.\n const isKeyboardFocus = !isClickFocusRef.current;\n if (event.target === event.currentTarget && isKeyboardFocus && !isTabbingBackOut) {\n const entryFocusEvent = new CustomEvent($d7bdfb9eb0fdf311$var$ENTRY_FOCUS, $d7bdfb9eb0fdf311$var$EVENT_OPTIONS);\n event.currentTarget.dispatchEvent(entryFocusEvent);\n if (!entryFocusEvent.defaultPrevented) {\n const items = getItems().filter((item)=>item.focusable\n );\n const activeItem = items.find((item)=>item.active\n );\n const currentItem = items.find((item)=>item.id === currentTabStopId\n );\n const candidateItems = [\n activeItem,\n currentItem,\n ...items\n ].filter(Boolean);\n const candidateNodes = candidateItems.map((item)=>item.ref.current\n );\n $d7bdfb9eb0fdf311$var$focusFirst(candidateNodes);\n }\n }\n isClickFocusRef.current = false;\n }),\n onBlur: $98Iye$composeEventHandlers(props.onBlur, ()=>setIsTabbingBackOut(false)\n )\n })));\n});\n/* -------------------------------------------------------------------------------------------------\n * RovingFocusGroupItem\n * -----------------------------------------------------------------------------------------------*/ const $d7bdfb9eb0fdf311$var$ITEM_NAME = 'RovingFocusGroupItem';\nconst $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 = /*#__PURE__*/ $98Iye$forwardRef((props, forwardedRef)=>{\n const { __scopeRovingFocusGroup: __scopeRovingFocusGroup , focusable: focusable = true , active: active = false , ...itemProps } = props;\n const id = $98Iye$useId();\n const context = $d7bdfb9eb0fdf311$var$useRovingFocusContext($d7bdfb9eb0fdf311$var$ITEM_NAME, __scopeRovingFocusGroup);\n const isCurrentTabStop = context.currentTabStopId === id;\n const getItems = $d7bdfb9eb0fdf311$var$useCollection(__scopeRovingFocusGroup);\n return /*#__PURE__*/ $98Iye$createElement($d7bdfb9eb0fdf311$var$Collection.ItemSlot, {\n scope: __scopeRovingFocusGroup,\n id: id,\n focusable: focusable,\n active: active\n }, /*#__PURE__*/ $98Iye$createElement($98Iye$Primitive.span, $98Iye$babelruntimehelpersesmextends({\n tabIndex: isCurrentTabStop ? 0 : -1,\n \"data-orientation\": context.orientation\n }, itemProps, {\n ref: forwardedRef,\n onMouseDown: $98Iye$composeEventHandlers(props.onMouseDown, (event)=>{\n // We prevent focusing non-focusable items on `mousedown`.\n // Even though the item has tabIndex={-1}, that only means take it out of the tab order.\n if (!focusable) event.preventDefault(); // Safari doesn't focus a button when clicked so we run our logic on mousedown also\n else context.onItemFocus(id);\n }),\n onFocus: $98Iye$composeEventHandlers(props.onFocus, ()=>context.onItemFocus(id)\n ),\n onKeyDown: $98Iye$composeEventHandlers(props.onKeyDown, (event)=>{\n if (event.key === 'Tab' && event.shiftKey) {\n context.onItemShiftTab();\n return;\n }\n if (event.target !== event.currentTarget) return;\n const focusIntent = $d7bdfb9eb0fdf311$var$getFocusIntent(event, context.orientation, context.dir);\n if (focusIntent !== undefined) {\n event.preventDefault();\n const items = getItems().filter((item)=>item.focusable\n );\n let candidateNodes = items.map((item)=>item.ref.current\n );\n if (focusIntent === 'last') candidateNodes.reverse();\n else if (focusIntent === 'prev' || focusIntent === 'next') {\n if (focusIntent === 'prev') candidateNodes.reverse();\n const currentIndex = candidateNodes.indexOf(event.currentTarget);\n candidateNodes = context.loop ? $d7bdfb9eb0fdf311$var$wrapArray(candidateNodes, currentIndex + 1) : candidateNodes.slice(currentIndex + 1);\n }\n /**\n * Imperative focus during keydown is risky so we prevent React's batching updates\n * to avoid potential bugs. See: https://github.com/facebook/react/issues/20332\n */ setTimeout(()=>$d7bdfb9eb0fdf311$var$focusFirst(candidateNodes)\n );\n }\n })\n })));\n});\n/*#__PURE__*/ Object.assign($d7bdfb9eb0fdf311$export$ab9df7c53fe8454, {\n displayName: $d7bdfb9eb0fdf311$var$ITEM_NAME\n});\n/* -----------------------------------------------------------------------------------------------*/ // prettier-ignore\nconst $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT = {\n ArrowLeft: 'prev',\n ArrowUp: 'prev',\n ArrowRight: 'next',\n ArrowDown: 'next',\n PageUp: 'first',\n Home: 'first',\n PageDown: 'last',\n End: 'last'\n};\nfunction $d7bdfb9eb0fdf311$var$getDirectionAwareKey(key, dir) {\n if (dir !== 'rtl') return key;\n return key === 'ArrowLeft' ? 'ArrowRight' : key === 'ArrowRight' ? 'ArrowLeft' : key;\n}\nfunction $d7bdfb9eb0fdf311$var$getFocusIntent(event, orientation, dir) {\n const key = $d7bdfb9eb0fdf311$var$getDirectionAwareKey(event.key, dir);\n if (orientation === 'vertical' && [\n 'ArrowLeft',\n 'ArrowRight'\n ].includes(key)) return undefined;\n if (orientation === 'horizontal' && [\n 'ArrowUp',\n 'ArrowDown'\n ].includes(key)) return undefined;\n return $d7bdfb9eb0fdf311$var$MAP_KEY_TO_FOCUS_INTENT[key];\n}\nfunction $d7bdfb9eb0fdf311$var$focusFirst(candidates) {\n const PREVIOUSLY_FOCUSED_ELEMENT = document.activeElement;\n for (const candidate of candidates){\n // if focus is already where we want to go, we don't want to keep going through the candidates\n if (candidate === PREVIOUSLY_FOCUSED_ELEMENT) return;\n candidate.focus();\n if (document.activeElement !== PREVIOUSLY_FOCUSED_ELEMENT) return;\n }\n}\n/**\n * Wraps an array around itself at a given start index\n * Example: `wrapArray(['a', 'b', 'c', 'd'], 2) === ['c', 'd', 'a', 'b']`\n */ function $d7bdfb9eb0fdf311$var$wrapArray(array, startIndex) {\n return array.map((_, index)=>array[(startIndex + index) % array.length]\n );\n}\nconst $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9 = $d7bdfb9eb0fdf311$export$8699f7c8af148338;\nconst $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 = $d7bdfb9eb0fdf311$export$ab9df7c53fe8454;\n\n\n\n\nexport {$d7bdfb9eb0fdf311$export$c7109489551a4f4 as createRovingFocusGroupScope, $d7bdfb9eb0fdf311$export$8699f7c8af148338 as RovingFocusGroup, $d7bdfb9eb0fdf311$export$ab9df7c53fe8454 as RovingFocusGroupItem, $d7bdfb9eb0fdf311$export$be92b6f5f03c0fe9 as Root, $d7bdfb9eb0fdf311$export$6d08773d2e66f8f2 as Item};\n//# sourceMappingURL=index.module.js.map\n","export var zeroRightClassName = 'right-scroll-bar-position';\nexport var fullWidthClassName = 'width-before-scroll-bar';\nexport var noScrollbarsClassName = 'with-scroll-bars-hidden';\n/**\n * Name of a CSS variable containing the amount of \"hidden\" scrollbar\n * ! might be undefined ! use will fallback!\n */\nexport var removedBarSizeVariable = '--removed-body-scroll-bar-size';\n","/**\n * Assigns a value for a given ref, no matter of the ref format\n * @param {RefObject} ref - a callback function or ref object\n * @param value - a new value\n *\n * @see https://github.com/theKashey/use-callback-ref#assignref\n * @example\n * const refObject = useRef();\n * const refFn = (ref) => {....}\n *\n * assignRef(refObject, \"refValue\");\n * assignRef(refFn, \"refValue\");\n */\nexport function assignRef(ref, value) {\n if (typeof ref === 'function') {\n ref(value);\n }\n else if (ref) {\n ref.current = value;\n }\n return ref;\n}\n","import { useState } from 'react';\n/**\n * creates a MutableRef with ref change callback\n * @param initialValue - initial ref value\n * @param {Function} callback - a callback to run when value changes\n *\n * @example\n * const ref = useCallbackRef(0, (newValue, oldValue) => console.log(oldValue, '->', newValue);\n * ref.current = 1;\n * // prints 0 -> 1\n *\n * @see https://reactjs.org/docs/hooks-reference.html#useref\n * @see https://github.com/theKashey/use-callback-ref#usecallbackref---to-replace-reactuseref\n * @returns {MutableRefObject}\n */\nexport function useCallbackRef(initialValue, callback) {\n var ref = useState(function () { return ({\n // value\n value: initialValue,\n // last callback\n callback: callback,\n // \"memoized\" public interface\n facade: {\n get current() {\n return ref.value;\n },\n set current(value) {\n var last = ref.value;\n if (last !== value) {\n ref.value = value;\n ref.callback(value, last);\n }\n },\n },\n }); })[0];\n // update callback\n ref.callback = callback;\n return ref.facade;\n}\n","import * as React from 'react';\nimport { assignRef } from './assignRef';\nimport { useCallbackRef } from './useRef';\nvar useIsomorphicLayoutEffect = typeof window !== 'undefined' ? React.useLayoutEffect : React.useEffect;\nvar currentValues = new WeakMap();\n/**\n * Merges two or more refs together providing a single interface to set their value\n * @param {RefObject|Ref} refs\n * @returns {MutableRefObject} - a new ref, which translates all changes to {refs}\n *\n * @see {@link mergeRefs} a version without buit-in memoization\n * @see https://github.com/theKashey/use-callback-ref#usemergerefs\n * @example\n * const Component = React.forwardRef((props, ref) => {\n * const ownRef = useRef();\n * const domRef = useMergeRefs([ref, ownRef]); // 👈 merge together\n * return
...
\n * }\n */\nexport function useMergeRefs(refs, defaultValue) {\n var callbackRef = useCallbackRef(defaultValue || null, function (newValue) {\n return refs.forEach(function (ref) { return assignRef(ref, newValue); });\n });\n // handle refs changes - added or removed\n useIsomorphicLayoutEffect(function () {\n var oldValue = currentValues.get(callbackRef);\n if (oldValue) {\n var prevRefs_1 = new Set(oldValue);\n var nextRefs_1 = new Set(refs);\n var current_1 = callbackRef.current;\n prevRefs_1.forEach(function (ref) {\n if (!nextRefs_1.has(ref)) {\n assignRef(ref, null);\n }\n });\n nextRefs_1.forEach(function (ref) {\n if (!prevRefs_1.has(ref)) {\n assignRef(ref, current_1);\n }\n });\n }\n currentValues.set(callbackRef, refs);\n }, [refs]);\n return callbackRef;\n}\n","import { __assign } from \"tslib\";\nfunction ItoI(a) {\n return a;\n}\nfunction innerCreateMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n var buffer = [];\n var assigned = false;\n var medium = {\n read: function () {\n if (assigned) {\n throw new Error('Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.');\n }\n if (buffer.length) {\n return buffer[buffer.length - 1];\n }\n return defaults;\n },\n useMedium: function (data) {\n var item = middleware(data, assigned);\n buffer.push(item);\n return function () {\n buffer = buffer.filter(function (x) { return x !== item; });\n };\n },\n assignSyncMedium: function (cb) {\n assigned = true;\n while (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n }\n buffer = {\n push: function (x) { return cb(x); },\n filter: function () { return buffer; },\n };\n },\n assignMedium: function (cb) {\n assigned = true;\n var pendingQueue = [];\n if (buffer.length) {\n var cbs = buffer;\n buffer = [];\n cbs.forEach(cb);\n pendingQueue = buffer;\n }\n var executeQueue = function () {\n var cbs = pendingQueue;\n pendingQueue = [];\n cbs.forEach(cb);\n };\n var cycle = function () { return Promise.resolve().then(executeQueue); };\n cycle();\n buffer = {\n push: function (x) {\n pendingQueue.push(x);\n cycle();\n },\n filter: function (filter) {\n pendingQueue = pendingQueue.filter(filter);\n return buffer;\n },\n };\n },\n };\n return medium;\n}\nexport function createMedium(defaults, middleware) {\n if (middleware === void 0) { middleware = ItoI; }\n return innerCreateMedium(defaults, middleware);\n}\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport function createSidecarMedium(options) {\n if (options === void 0) { options = {}; }\n var medium = innerCreateMedium(null);\n medium.options = __assign({ async: true, ssr: false }, options);\n return medium;\n}\n","import { __assign, __rest } from \"tslib\";\nimport * as React from 'react';\nvar SideCar = function (_a) {\n var sideCar = _a.sideCar, rest = __rest(_a, [\"sideCar\"]);\n if (!sideCar) {\n throw new Error('Sidecar: please provide `sideCar` property to import the right car');\n }\n var Target = sideCar.read();\n if (!Target) {\n throw new Error('Sidecar medium not found');\n }\n return React.createElement(Target, __assign({}, rest));\n};\nSideCar.isSideCarExport = true;\nexport function exportSidecar(medium, exported) {\n medium.useMedium(exported);\n return SideCar;\n}\n","var currentNonce;\nexport var setNonce = function (nonce) {\n currentNonce = nonce;\n};\nexport var getNonce = function () {\n if (currentNonce) {\n return currentNonce;\n }\n if (typeof __webpack_nonce__ !== 'undefined') {\n return __webpack_nonce__;\n }\n return undefined;\n};\n","import { getNonce } from 'get-nonce';\nfunction makeStyleTag() {\n if (!document)\n return null;\n var tag = document.createElement('style');\n tag.type = 'text/css';\n var nonce = getNonce();\n if (nonce) {\n tag.setAttribute('nonce', nonce);\n }\n return tag;\n}\nfunction injectStyles(tag, css) {\n // @ts-ignore\n if (tag.styleSheet) {\n // @ts-ignore\n tag.styleSheet.cssText = css;\n }\n else {\n tag.appendChild(document.createTextNode(css));\n }\n}\nfunction insertStyleTag(tag) {\n var head = document.head || document.getElementsByTagName('head')[0];\n head.appendChild(tag);\n}\nexport var stylesheetSingleton = function () {\n var counter = 0;\n var stylesheet = null;\n return {\n add: function (style) {\n if (counter == 0) {\n if ((stylesheet = makeStyleTag())) {\n injectStyles(stylesheet, style);\n insertStyleTag(stylesheet);\n }\n }\n counter++;\n },\n remove: function () {\n counter--;\n if (!counter && stylesheet) {\n stylesheet.parentNode && stylesheet.parentNode.removeChild(stylesheet);\n stylesheet = null;\n }\n },\n };\n};\n","import * as React from 'react';\nimport { stylesheetSingleton } from './singleton';\n/**\n * creates a hook to control style singleton\n * @see {@link styleSingleton} for a safer component version\n * @example\n * ```tsx\n * const useStyle = styleHookSingleton();\n * ///\n * useStyle('body { overflow: hidden}');\n */\nexport var styleHookSingleton = function () {\n var sheet = stylesheetSingleton();\n return function (styles, isDynamic) {\n React.useEffect(function () {\n sheet.add(styles);\n return function () {\n sheet.remove();\n };\n }, [styles && isDynamic]);\n };\n};\n","import { styleHookSingleton } from './hook';\n/**\n * create a Component to add styles on demand\n * - styles are added when first instance is mounted\n * - styles are removed when the last instance is unmounted\n * - changing styles in runtime does nothing unless dynamic is set. But with multiple components that can lead to the undefined behavior\n */\nexport var styleSingleton = function () {\n var useStyle = styleHookSingleton();\n var Sheet = function (_a) {\n var styles = _a.styles, dynamic = _a.dynamic;\n useStyle(styles, dynamic);\n return null;\n };\n return Sheet;\n};\n","export var zeroGap = {\n left: 0,\n top: 0,\n right: 0,\n gap: 0,\n};\nvar parse = function (x) { return parseInt(x || '', 10) || 0; };\nvar getOffset = function (gapMode) {\n var cs = window.getComputedStyle(document.body);\n var left = cs[gapMode === 'padding' ? 'paddingLeft' : 'marginLeft'];\n var top = cs[gapMode === 'padding' ? 'paddingTop' : 'marginTop'];\n var right = cs[gapMode === 'padding' ? 'paddingRight' : 'marginRight'];\n return [parse(left), parse(top), parse(right)];\n};\nexport var getGapWidth = function (gapMode) {\n if (gapMode === void 0) { gapMode = 'margin'; }\n if (typeof window === 'undefined') {\n return zeroGap;\n }\n var offsets = getOffset(gapMode);\n var documentWidth = document.documentElement.clientWidth;\n var windowWidth = window.innerWidth;\n return {\n left: offsets[0],\n top: offsets[1],\n right: offsets[2],\n gap: Math.max(0, windowWidth - documentWidth + offsets[2] - offsets[0]),\n };\n};\n","import * as React from 'react';\nimport { styleSingleton } from 'react-style-singleton';\nimport { fullWidthClassName, zeroRightClassName, noScrollbarsClassName, removedBarSizeVariable } from './constants';\nimport { getGapWidth } from './utils';\nvar Style = styleSingleton();\nexport var lockAttribute = 'data-scroll-locked';\n// important tip - once we measure scrollBar width and remove them\n// we could not repeat this operation\n// thus we are using style-singleton - only the first \"yet correct\" style will be applied.\nvar getStyles = function (_a, allowRelative, gapMode, important) {\n var left = _a.left, top = _a.top, right = _a.right, gap = _a.gap;\n if (gapMode === void 0) { gapMode = 'margin'; }\n return \"\\n .\".concat(noScrollbarsClassName, \" {\\n overflow: hidden \").concat(important, \";\\n padding-right: \").concat(gap, \"px \").concat(important, \";\\n }\\n body[\").concat(lockAttribute, \"] {\\n overflow: hidden \").concat(important, \";\\n overscroll-behavior: contain;\\n \").concat([\n allowRelative && \"position: relative \".concat(important, \";\"),\n gapMode === 'margin' &&\n \"\\n padding-left: \".concat(left, \"px;\\n padding-top: \").concat(top, \"px;\\n padding-right: \").concat(right, \"px;\\n margin-left:0;\\n margin-top:0;\\n margin-right: \").concat(gap, \"px \").concat(important, \";\\n \"),\n gapMode === 'padding' && \"padding-right: \".concat(gap, \"px \").concat(important, \";\"),\n ]\n .filter(Boolean)\n .join(''), \"\\n }\\n \\n .\").concat(zeroRightClassName, \" {\\n right: \").concat(gap, \"px \").concat(important, \";\\n }\\n \\n .\").concat(fullWidthClassName, \" {\\n margin-right: \").concat(gap, \"px \").concat(important, \";\\n }\\n \\n .\").concat(zeroRightClassName, \" .\").concat(zeroRightClassName, \" {\\n right: 0 \").concat(important, \";\\n }\\n \\n .\").concat(fullWidthClassName, \" .\").concat(fullWidthClassName, \" {\\n margin-right: 0 \").concat(important, \";\\n }\\n \\n body[\").concat(lockAttribute, \"] {\\n \").concat(removedBarSizeVariable, \": \").concat(gap, \"px;\\n }\\n\");\n};\nvar getCurrentUseCounter = function () {\n var counter = parseInt(document.body.getAttribute(lockAttribute) || '0', 10);\n return isFinite(counter) ? counter : 0;\n};\nexport var useLockAttribute = function () {\n React.useEffect(function () {\n document.body.setAttribute(lockAttribute, (getCurrentUseCounter() + 1).toString());\n return function () {\n var newCounter = getCurrentUseCounter() - 1;\n if (newCounter <= 0) {\n document.body.removeAttribute(lockAttribute);\n }\n else {\n document.body.setAttribute(lockAttribute, newCounter.toString());\n }\n };\n }, []);\n};\n/**\n * Removes page scrollbar and blocks page scroll when mounted\n */\nexport var RemoveScrollBar = function (_a) {\n var noRelative = _a.noRelative, noImportant = _a.noImportant, _b = _a.gapMode, gapMode = _b === void 0 ? 'margin' : _b;\n useLockAttribute();\n /*\n gap will be measured on every component mount\n however it will be used only by the \"first\" invocation\n due to singleton nature of {const{className:o}=r,a=e(r,[\"className\"]);return s.createElement(m,Object.assign({as:\"span\",width:\"1em\",height:\"1em\",className:t(C.Icon,o)},a),s.createElement(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\"},s.createElement(\"path\",{d:\"M12 6.0002C15.79 6.0002 19.17 8.1302 20.82 11.5002C20.23 12.7202 19.4 13.7702 18.41 14.6202L19.82 16.0302C21.21 14.8002 22.31 13.2602 23 11.5002C21.27 7.1102 17 4.0002 12 4.0002C10.73 4.0002 9.51 4.2002 8.36 4.5702L10.01 6.2202C10.66 6.0902 11.32 6.0002 12 6.0002ZM10.93 7.14019L13 9.2102C13.57 9.4602 14.03 9.9202 14.28 10.4902L16.35 12.5602C16.43 12.2202 16.49 11.8602 16.49 11.4902C16.5 9.0102 14.48 7.0002 12 7.0002C11.63 7.0002 11.28 7.05019 10.93 7.14019ZM2.01 3.8702L4.69 6.5502C3.06 7.8302 1.77 9.5302 1 11.5002C2.73 15.8902 7 19.0002 12 19.0002C13.52 19.0002 14.98 18.7102 16.32 18.1802L19.74 21.6002L21.15 20.1902L3.42 2.4502L2.01 3.8702ZM9.51 11.3702L12.12 13.9802C12.08 13.9902 12.04 14.0002 12 14.0002C10.62 14.0002 9.5 12.8802 9.5 11.5002C9.5 11.4502 9.51 11.4202 9.51 11.3702V11.3702ZM6.11 7.97019L7.86 9.7202C7.63 10.2702 7.5 10.8702 7.5 11.5002C7.5 13.9802 9.52 16.0002 12 16.0002C12.63 16.0002 13.23 15.8702 13.77 15.6402L14.75 16.6202C13.87 16.8602 12.95 17.0002 12 17.0002C8.21 17.0002 4.83 14.8702 3.18 11.5002C3.88 10.0702 4.9 8.89019 6.11 7.97019Z\",fill:\"currentColor\"})))};export{r as IconVisibilityOff};\n","import{__rest as e}from\"tslib\";import t from\"classnames\";import*as s from\"react\";import{ComponentClassNames as m}from\"../../shared/constants.mjs\";import{View as r}from\"../../View/View.mjs\";const o=o=>{const{className:a}=o,C=e(o,[\"className\"]);return s.createElement(r,Object.assign({as:\"span\",width:\"1em\",height:\"1em\",className:t(m.Icon,a)},C),s.createElement(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",fill:\"none\",xmlns:\"http://www.w3.org/2000/svg\"},s.createElement(\"path\",{d:\"M12 6C15.79 6 19.17 8.13 20.82 11.5C19.17 14.87 15.79 17 12 17C8.21 17 4.83 14.87 3.18 11.5C4.83 8.13 8.21 6 12 6ZM12 4C7 4 2.73 7.11 1 11.5C2.73 15.89 7 19 12 19C17 19 21.27 15.89 23 11.5C21.27 7.11 17 4 12 4ZM12 9C13.38 9 14.5 10.12 14.5 11.5C14.5 12.88 13.38 14 12 14C10.62 14 9.5 12.88 9.5 11.5C9.5 10.12 10.62 9 12 9ZM12 7C9.52 7 7.5 9.02 7.5 11.5C7.5 13.98 9.52 16 12 16C14.48 16 16.5 13.98 16.5 11.5C16.5 9.02 14.48 7 12 7Z\",fill:\"currentColor\"})))};export{o as IconVisibility};\n","import{__rest as s}from\"tslib\";import*as e from\"react\";import{Button as o}from\"../Button/Button.mjs\";import{VisuallyHidden as r}from\"../VisuallyHidden/VisuallyHidden.mjs\";import{ComponentClassNames as a,ComponentText as i}from\"../shared/constants.mjs\";import\"classnames\";import\"../View/View.mjs\";import{IconVisibilityOff as t}from\"../Icon/icons/IconVisibilityOff.mjs\";import{IconVisibility as d}from\"../Icon/icons/IconVisibility.mjs\";const{passwordIsHidden:m,passwordIsShown:n,showPassword:l}=i.PasswordField,w=e.forwardRef(((i,w)=>{var{fieldType:p,passwordIsHiddenLabel:c=m,passwordIsShownLabel:f=n,showPasswordButtonLabel:b=l,size:h}=i,I=s(i,[\"fieldType\",\"passwordIsHiddenLabel\",\"passwordIsShownLabel\",\"showPasswordButtonLabel\",\"size\"]);return e.createElement(o,Object.assign({\"aria-checked\":\"password\"!==p,ariaLabel:b,className:a.FieldShowPassword,ref:w,role:\"switch\",size:h},I),e.createElement(r,{\"aria-live\":\"polite\"},\"password\"===p?c:f),\"password\"===p?e.createElement(d,{size:h}):e.createElement(t,{size:h}))}));w.displayName=\"ShowPasswordButton\";export{w as ShowPasswordButton};\n","import{__rest as s}from\"tslib\";import e from\"classnames\";import*as o from\"react\";import{ComponentClassNames as a}from\"../shared/constants.mjs\";import{ShowPasswordButton as r}from\"./ShowPasswordButton.mjs\";import{TextField as t}from\"../TextField/TextField.mjs\";const d=o.forwardRef(((d,l)=>{var{autoComplete:w=\"current-password\",label:n,className:m,hideShowPassword:i=!1,passwordIsHiddenLabel:p,passwordIsShownLabel:b,showPasswordButtonLabel:u,showPasswordButtonRef:c,size:h}=d,f=s(d,[\"autoComplete\",\"label\",\"className\",\"hideShowPassword\",\"passwordIsHiddenLabel\",\"passwordIsShownLabel\",\"showPasswordButtonLabel\",\"showPasswordButtonRef\",\"size\"]);const[P,L]=o.useState(\"password\"),S=o.useCallback((()=>{L(\"password\"===P?\"text\":\"password\")}),[L,P]);return o.createElement(t,Object.assign({autoComplete:w,outerEndComponent:i?null:o.createElement(r,{fieldType:P,onClick:S,passwordIsHiddenLabel:p,passwordIsShownLabel:b,ref:c,size:h,showPasswordButtonLabel:u}),size:h,type:P,label:n,className:e(a.PasswordField,m),ref:l},f))}));d.displayName=\"PasswordField\";export{d as PasswordField};\n","import{__rest as e}from\"tslib\";import*as a from\"react\";import r from\"classnames\";import{classNameModifier as o,classNameModifierByFlag as l}from\"@aws-amplify/ui\";import{ComponentClassNames as t}from\"../shared/constants.mjs\";import{Flex as i}from\"../Flex/Flex.mjs\";import{View as s}from\"../View/View.mjs\";import{IconExpandMore as c}from\"../Icon/icons/IconExpandMore.mjs\";const m=a.forwardRef(((m,n)=>{var{autoComplete:d,className:p,size:u,variation:f,value:v,defaultValue:E,hasError:h,icon:S=a.createElement(c,null),iconColor:C,children:N,placeholder:b,isDisabled:j,isRequired:V}=m,w=e(m,[\"autoComplete\",\"className\",\"size\",\"variation\",\"value\",\"defaultValue\",\"hasError\",\"icon\",\"iconColor\",\"children\",\"placeholder\",\"isDisabled\",\"isRequired\"]);const x=void 0===v&&void 0===E&&b,q=r(t.Select,t.FieldGroupControl,o(t.Select,u),o(t.Select,f),l(t.Select,\"error\",h),p);return a.createElement(s,{className:t.SelectWrapper},a.createElement(s,Object.assign({\"aria-invalid\":h,as:\"select\",autoComplete:d,value:v,defaultValue:x?\"\":E,isDisabled:j,required:V,\"data-size\":u,\"data-variation\":f,className:q,ref:n},w),b&&a.createElement(\"option\",{value:\"\"},b),N),a.createElement(i,{className:t.SelectIconWrapper,color:C},S))}));m.displayName=\"Select\";export{m as Select};\n","import{__rest as e}from\"tslib\";import*as r from\"react\";import i from\"classnames\";import{classNameModifier as t}from\"@aws-amplify/ui\";import{ComponentClassNames as s}from\"../shared/constants.mjs\";import\"../Field/FieldClearButton.mjs\";import{FieldDescription as l}from\"../Field/FieldDescription.mjs\";import{FieldErrorMessage as o}from\"../Field/FieldErrorMessage.mjs\";import\"../Field/Field.mjs\";import{Flex as m}from\"../Flex/Flex.mjs\";import{Label as a}from\"../Label/Label.mjs\";import{Select as d}from\"../Select/Select.mjs\";import{splitPrimitiveProps as n}from\"../utils/splitPrimitiveProps.mjs\";import{useStableId as p}from\"../utils/useStableId.mjs\";const c=r.forwardRef(((c,f)=>{const{children:F,className:h,descriptiveText:b,errorMessage:u,hasError:j=!1,id:E,label:v,labelHidden:g=!1,options:y,size:S,testId:x,inputStyles:I}=c,z=e(c,[\"children\",\"className\",\"descriptiveText\",\"errorMessage\",\"hasError\",\"id\",\"label\",\"labelHidden\",\"options\",\"size\",\"testId\",\"inputStyles\"]),H=p(E),M=p(),N=b?M:void 0,{styleProps:w,rest:P}=n(z);return r.createElement(m,Object.assign({className:i(s.Field,t(s.Field,S),s.SelectField,h),\"data-size\":S,testId:x},w),r.createElement(a,{htmlFor:H,visuallyHidden:g},v),r.createElement(l,{id:M,labelHidden:g,descriptiveText:b}),r.createElement(d,Object.assign({\"aria-describedby\":N,hasError:j,id:H,ref:f,size:S},P,I),(({children:e,options:i})=>e?((null==i?void 0:i.length)&&console.warn(\"Amplify UI: component defaults to rendering children over `options`. When using the `options` prop, omit children.\"),e):null==i?void 0:i.map(((e,i)=>r.createElement(\"option\",{label:e,value:e,key:`${e}-${i}`},e))))({children:F,options:y})),r.createElement(o,{hasError:j,errorMessage:u}))}));c.displayName=\"SelectField\";export{c as SelectField};\n","import{__rest as e}from\"tslib\";import*as a from\"react\";import t from\"classnames\";import{countryDialCodes as o}from\"@aws-amplify/ui\";import{ComponentClassNames as l}from\"../shared/constants.mjs\";import{SelectField as s}from\"../SelectField/SelectField.mjs\";const r=a.forwardRef(((r,i)=>{var{className:m,dialCodeList:d,isReadOnly:c}=r,n=e(r,[\"className\",\"dialCodeList\",\"isReadOnly\"]);const p=null!=d?d:o,f=a.useMemo((()=>p.map((e=>a.createElement(\"option\",{key:e,value:e,disabled:c},e)))),[p,c]);return a.createElement(s,Object.assign({\"aria-disabled\":c,autoComplete:\"tel-country-code\",className:t(l.CountryCodeSelect,l.DialCodeSelect,m),labelHidden:!0,ref:i},n),f)}));r.displayName=\"CountryCodeSelect\";export{r as CountryCodeSelect};\n","import{__rest as e}from\"tslib\";import*as o from\"react\";import a from\"classnames\";import{ComponentClassNames as l,ComponentText as t}from\"../shared/constants.mjs\";import{CountryCodeSelect as n}from\"./CountryCodeSelect.mjs\";import{TextField as r}from\"../TextField/TextField.mjs\";const d=o.forwardRef(((d,i)=>{var{autoComplete:s=\"tel-national\",className:C,countryCodeName:m,countryCodeLabel:u=t.PhoneNumberField.countryCodeLabel,countryCodeRef:c,defaultCountryCode:f,defaultDialCode:y,dialCodeLabel:b=t.PhoneNumberField.countryCodeLabel,dialCodeList:p,dialCodeName:h,dialCodeRef:N,hasError:L,isDisabled:R,isReadOnly:D,onCountryCodeChange:g,onDialCodeChange:E,onInput:F,size:v,variation:O}=d,j=e(d,[\"autoComplete\",\"className\",\"countryCodeName\",\"countryCodeLabel\",\"countryCodeRef\",\"defaultCountryCode\",\"defaultDialCode\",\"dialCodeLabel\",\"dialCodeList\",\"dialCodeName\",\"dialCodeRef\",\"hasError\",\"isDisabled\",\"isReadOnly\",\"onCountryCodeChange\",\"onDialCodeChange\",\"onInput\",\"size\",\"variation\"]);const z=null!=h?h:m,P=null!=b?b:u,x=null!=y?y:f,I=null!=E?E:g,S=null!=N?N:c;return o.createElement(r,Object.assign({outerStartComponent:o.createElement(n,{defaultValue:x,dialCodeList:p,className:C,hasError:L,isDisabled:R,isReadOnly:D,label:P,name:z,onChange:I,ref:S,size:v,variation:O}),autoComplete:s,className:a(l.PhoneNumberField,C),hasError:L,isDisabled:R,isReadOnly:D,onInput:F,ref:i,size:v,type:\"tel\",variation:O},j))}));d.displayName=\"PhoneNumberField\";export{d as PhoneNumberField};\n","import t,{useContext as e}from\"react\";const o=t.createContext({name:\"default\"}),r=()=>e(o);export{o as RadioGroupContext,r as useRadioGroupContext};\n","import{__rest as e}from\"tslib\";import*as a from\"react\";import i from\"classnames\";import{classNameModifierByFlag as t,classNameModifier as o}from\"@aws-amplify/ui\";import{ComponentClassNames as s}from\"../shared/constants.mjs\";import{Flex as d}from\"../Flex/Flex.mjs\";import{Input as l}from\"../Input/Input.mjs\";import{Text as r}from\"../Text/Text.mjs\";import{useRadioGroupContext as n}from\"../RadioGroupField/context.mjs\";const m=(m,p)=>{var{children:c,className:h,id:u,isDisabled:b,testId:f,value:R,labelPosition:g,height:v,width:N,bottom:j,left:x,position:y,padding:E,right:I,top:w}=m,D=e(m,[\"children\",\"className\",\"id\",\"isDisabled\",\"testId\",\"value\",\"labelPosition\",\"height\",\"width\",\"bottom\",\"left\",\"position\",\"padding\",\"right\",\"top\"]);const{currentValue:C,defaultValue:F,name:O,hasError:P,isGroupDisabled:V,isRequired:k,isReadOnly:q,onChange:z,size:B,labelPosition:G}=n(),T=V||b||q&&F!==R,H=void 0!==C?R===C:void 0,L=void 0!==F?R===F:void 0,A=g||G;return a.createElement(d,{as:\"label\",className:i(s.Radio,t(s.Radio,\"disabled\",T),h),\"data-disabled\":T,\"data-label-position\":A,height:v,width:N,bottom:j,top:w,right:I,left:x,position:y,padding:E},c&&a.createElement(r,{as:\"span\",className:s.RadioLabel,\"data-disabled\":T},c),a.createElement(l,Object.assign({checked:H,className:i(s.VisuallyHidden,s.RadioInput),defaultChecked:L,hasError:P,id:u,isDisabled:T,isReadOnly:q,isRequired:k,onChange:z,ref:p,type:\"radio\",name:O,value:R},D)),a.createElement(d,{\"aria-hidden\":\"true\",as:\"span\",className:i(s.RadioButton,o(s.RadioButton,B)),\"data-size\":B,testId:f}))},p=a.forwardRef(m);p.displayName=\"Radio\";export{p as Radio,m as RadioPrimitive};\n","import{__rest as e}from\"tslib\";import*as i from\"react\";import r from\"classnames\";import{classNameModifier as a}from\"@aws-amplify/ui\";import{ComponentClassNames as s}from\"../shared/constants.mjs\";import\"../Field/FieldClearButton.mjs\";import{FieldDescription as l}from\"../Field/FieldDescription.mjs\";import{FieldErrorMessage as t}from\"../Field/FieldErrorMessage.mjs\";import\"../Field/Field.mjs\";import{Flex as d}from\"../Flex/Flex.mjs\";import{Label as o}from\"../Label/Label.mjs\";import{VisuallyHidden as m}from\"../VisuallyHidden/VisuallyHidden.mjs\";import{RadioGroupContext as n}from\"./context.mjs\";import{getTestId as u}from\"../utils/getTestId.mjs\";import{useStableId as p}from\"../utils/useStableId.mjs\";const c=i.forwardRef(((c,f)=>{var{children:b,className:F,defaultValue:j,descriptiveText:E,errorMessage:g,hasError:h=!1,id:R,isDisabled:v,isRequired:y,isReadOnly:x,label:H,labelHidden:I=!1,labelPosition:V,onChange:G,name:M,size:N,testId:z,value:C}=c,D=e(c,[\"children\",\"className\",\"defaultValue\",\"descriptiveText\",\"errorMessage\",\"hasError\",\"id\",\"isDisabled\",\"isRequired\",\"isReadOnly\",\"label\",\"labelHidden\",\"labelPosition\",\"onChange\",\"name\",\"size\",\"testId\",\"value\"]);const O=p(R),P=p(),T=E?P:void 0,q=u(z,s.RadioGroup),w=i.useMemo((()=>({currentValue:C,defaultValue:j,hasError:h,isRequired:y,isReadOnly:x,isGroupDisabled:v,onChange:G,size:N,name:M,labelPosition:V})),[j,h,v,y,x,G,N,M,C,V]);return i.createElement(d,Object.assign({as:\"fieldset\",className:r(s.Field,a(s.Field,N),s.RadioGroupField,F),\"data-size\":N,ref:f,role:\"radiogroup\",testId:z},D),i.createElement(m,{as:\"legend\"},H),i.createElement(o,{\"aria-hidden\":!0,visuallyHidden:I},H),i.createElement(l,{id:P,labelHidden:I,descriptiveText:E}),i.createElement(d,{\"aria-describedby\":T,className:s.RadioGroup,id:O,testId:q},i.createElement(n.Provider,{value:w},b)),i.createElement(t,{hasError:h,errorMessage:g}))}));c.displayName=\"RadioGroupField\";export{c as RadioGroupField};\n","function $ae6933e535247d3d$export$7d15b64cf5a3a4c4(value, [min, max]) {\n return Math.min(max, Math.max(min, value));\n}\n\n\n\n\nexport {$ae6933e535247d3d$export$7d15b64cf5a3a4c4 as clamp};\n//# sourceMappingURL=index.module.js.map\n","import $1IHzk$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $1IHzk$forwardRef, createElement as $1IHzk$createElement, useRef as $1IHzk$useRef, useEffect as $1IHzk$useEffect} from \"react\";\nimport {composeEventHandlers as $1IHzk$composeEventHandlers} from \"@radix-ui/primitive\";\nimport {createContextScope as $1IHzk$createContextScope} from \"@radix-ui/react-context\";\nimport {createRovingFocusGroupScope as $1IHzk$createRovingFocusGroupScope, Root as $1IHzk$Root, Item as $1IHzk$Item} from \"@radix-ui/react-roving-focus\";\nimport {Presence as $1IHzk$Presence} from \"@radix-ui/react-presence\";\nimport {Primitive as $1IHzk$Primitive} from \"@radix-ui/react-primitive\";\nimport {useDirection as $1IHzk$useDirection} from \"@radix-ui/react-direction\";\nimport {useControllableState as $1IHzk$useControllableState} from \"@radix-ui/react-use-controllable-state\";\nimport {useId as $1IHzk$useId} from \"@radix-ui/react-id\";\n\n\n\n\n\n\n\n\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * Tabs\n * -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$TABS_NAME = 'Tabs';\nconst [$69cb30bb0017df05$var$createTabsContext, $69cb30bb0017df05$export$355f5bd209d7b13a] = $1IHzk$createContextScope($69cb30bb0017df05$var$TABS_NAME, [\n $1IHzk$createRovingFocusGroupScope\n]);\nconst $69cb30bb0017df05$var$useRovingFocusGroupScope = $1IHzk$createRovingFocusGroupScope();\nconst [$69cb30bb0017df05$var$TabsProvider, $69cb30bb0017df05$var$useTabsContext] = $69cb30bb0017df05$var$createTabsContext($69cb30bb0017df05$var$TABS_NAME);\nconst $69cb30bb0017df05$export$b2539bed5023c21c = /*#__PURE__*/ $1IHzk$forwardRef((props, forwardedRef)=>{\n const { __scopeTabs: __scopeTabs , value: valueProp , onValueChange: onValueChange , defaultValue: defaultValue , orientation: orientation = 'horizontal' , dir: dir , activationMode: activationMode = 'automatic' , ...tabsProps } = props;\n const direction = $1IHzk$useDirection(dir);\n const [value, setValue] = $1IHzk$useControllableState({\n prop: valueProp,\n onChange: onValueChange,\n defaultProp: defaultValue\n });\n return /*#__PURE__*/ $1IHzk$createElement($69cb30bb0017df05$var$TabsProvider, {\n scope: __scopeTabs,\n baseId: $1IHzk$useId(),\n value: value,\n onValueChange: setValue,\n orientation: orientation,\n dir: direction,\n activationMode: activationMode\n }, /*#__PURE__*/ $1IHzk$createElement($1IHzk$Primitive.div, $1IHzk$babelruntimehelpersesmextends({\n dir: direction,\n \"data-orientation\": orientation\n }, tabsProps, {\n ref: forwardedRef\n })));\n});\n/*#__PURE__*/ Object.assign($69cb30bb0017df05$export$b2539bed5023c21c, {\n displayName: $69cb30bb0017df05$var$TABS_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * TabsList\n * -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$TAB_LIST_NAME = 'TabsList';\nconst $69cb30bb0017df05$export$9712d22edc0d78c1 = /*#__PURE__*/ $1IHzk$forwardRef((props, forwardedRef)=>{\n const { __scopeTabs: __scopeTabs , loop: loop = true , ...listProps } = props;\n const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TAB_LIST_NAME, __scopeTabs);\n const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);\n return /*#__PURE__*/ $1IHzk$createElement($1IHzk$Root, $1IHzk$babelruntimehelpersesmextends({\n asChild: true\n }, rovingFocusGroupScope, {\n orientation: context.orientation,\n dir: context.dir,\n loop: loop\n }), /*#__PURE__*/ $1IHzk$createElement($1IHzk$Primitive.div, $1IHzk$babelruntimehelpersesmextends({\n role: \"tablist\",\n \"aria-orientation\": context.orientation\n }, listProps, {\n ref: forwardedRef\n })));\n});\n/*#__PURE__*/ Object.assign($69cb30bb0017df05$export$9712d22edc0d78c1, {\n displayName: $69cb30bb0017df05$var$TAB_LIST_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * TabsTrigger\n * -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$TRIGGER_NAME = 'TabsTrigger';\nconst $69cb30bb0017df05$export$8114b9fdfdf9f3ba = /*#__PURE__*/ $1IHzk$forwardRef((props, forwardedRef)=>{\n const { __scopeTabs: __scopeTabs , value: value , disabled: disabled = false , ...triggerProps } = props;\n const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$TRIGGER_NAME, __scopeTabs);\n const rovingFocusGroupScope = $69cb30bb0017df05$var$useRovingFocusGroupScope(__scopeTabs);\n const triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value);\n const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);\n const isSelected = value === context.value;\n return /*#__PURE__*/ $1IHzk$createElement($1IHzk$Item, $1IHzk$babelruntimehelpersesmextends({\n asChild: true\n }, rovingFocusGroupScope, {\n focusable: !disabled,\n active: isSelected\n }), /*#__PURE__*/ $1IHzk$createElement($1IHzk$Primitive.button, $1IHzk$babelruntimehelpersesmextends({\n type: \"button\",\n role: \"tab\",\n \"aria-selected\": isSelected,\n \"aria-controls\": contentId,\n \"data-state\": isSelected ? 'active' : 'inactive',\n \"data-disabled\": disabled ? '' : undefined,\n disabled: disabled,\n id: triggerId\n }, triggerProps, {\n ref: forwardedRef,\n onMouseDown: $1IHzk$composeEventHandlers(props.onMouseDown, (event)=>{\n // only call handler if it's the left button (mousedown gets triggered by all mouse buttons)\n // but not when the control key is pressed (avoiding MacOS right click)\n if (!disabled && event.button === 0 && event.ctrlKey === false) context.onValueChange(value);\n else // prevent focus to avoid accidental activation\n event.preventDefault();\n }),\n onKeyDown: $1IHzk$composeEventHandlers(props.onKeyDown, (event)=>{\n if ([\n ' ',\n 'Enter'\n ].includes(event.key)) context.onValueChange(value);\n }),\n onFocus: $1IHzk$composeEventHandlers(props.onFocus, ()=>{\n // handle \"automatic\" activation if necessary\n // ie. activate tab following focus\n const isAutomaticActivation = context.activationMode !== 'manual';\n if (!isSelected && !disabled && isAutomaticActivation) context.onValueChange(value);\n })\n })));\n});\n/*#__PURE__*/ Object.assign($69cb30bb0017df05$export$8114b9fdfdf9f3ba, {\n displayName: $69cb30bb0017df05$var$TRIGGER_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * TabsContent\n * -----------------------------------------------------------------------------------------------*/ const $69cb30bb0017df05$var$CONTENT_NAME = 'TabsContent';\nconst $69cb30bb0017df05$export$bd905d70e8fd2ebb = /*#__PURE__*/ $1IHzk$forwardRef((props, forwardedRef)=>{\n const { __scopeTabs: __scopeTabs , value: value , forceMount: forceMount , children: children , ...contentProps } = props;\n const context = $69cb30bb0017df05$var$useTabsContext($69cb30bb0017df05$var$CONTENT_NAME, __scopeTabs);\n const triggerId = $69cb30bb0017df05$var$makeTriggerId(context.baseId, value);\n const contentId = $69cb30bb0017df05$var$makeContentId(context.baseId, value);\n const isSelected = value === context.value;\n const isMountAnimationPreventedRef = $1IHzk$useRef(isSelected);\n $1IHzk$useEffect(()=>{\n const rAF = requestAnimationFrame(()=>isMountAnimationPreventedRef.current = false\n );\n return ()=>cancelAnimationFrame(rAF)\n ;\n }, []);\n return /*#__PURE__*/ $1IHzk$createElement($1IHzk$Presence, {\n present: forceMount || isSelected\n }, ({ present: present })=>/*#__PURE__*/ $1IHzk$createElement($1IHzk$Primitive.div, $1IHzk$babelruntimehelpersesmextends({\n \"data-state\": isSelected ? 'active' : 'inactive',\n \"data-orientation\": context.orientation,\n role: \"tabpanel\",\n \"aria-labelledby\": triggerId,\n hidden: !present,\n id: contentId,\n tabIndex: 0\n }, contentProps, {\n ref: forwardedRef,\n style: {\n ...props.style,\n animationDuration: isMountAnimationPreventedRef.current ? '0s' : undefined\n }\n }), present && children)\n );\n});\n/*#__PURE__*/ Object.assign($69cb30bb0017df05$export$bd905d70e8fd2ebb, {\n displayName: $69cb30bb0017df05$var$CONTENT_NAME\n});\n/* ---------------------------------------------------------------------------------------------- */ function $69cb30bb0017df05$var$makeTriggerId(baseId, value) {\n return `${baseId}-trigger-${value}`;\n}\nfunction $69cb30bb0017df05$var$makeContentId(baseId, value) {\n return `${baseId}-content-${value}`;\n}\nconst $69cb30bb0017df05$export$be92b6f5f03c0fe9 = $69cb30bb0017df05$export$b2539bed5023c21c;\nconst $69cb30bb0017df05$export$54c2e3dc7acea9f5 = $69cb30bb0017df05$export$9712d22edc0d78c1;\nconst $69cb30bb0017df05$export$41fb9f06171c75f4 = $69cb30bb0017df05$export$8114b9fdfdf9f3ba;\nconst $69cb30bb0017df05$export$7c6e2c02157bb7d2 = $69cb30bb0017df05$export$bd905d70e8fd2ebb;\n\n\n\n\nexport {$69cb30bb0017df05$export$355f5bd209d7b13a as createTabsScope, $69cb30bb0017df05$export$b2539bed5023c21c as Tabs, $69cb30bb0017df05$export$9712d22edc0d78c1 as TabsList, $69cb30bb0017df05$export$8114b9fdfdf9f3ba as TabsTrigger, $69cb30bb0017df05$export$bd905d70e8fd2ebb as TabsContent, $69cb30bb0017df05$export$be92b6f5f03c0fe9 as Root, $69cb30bb0017df05$export$54c2e3dc7acea9f5 as List, $69cb30bb0017df05$export$41fb9f06171c75f4 as Trigger, $69cb30bb0017df05$export$7c6e2c02157bb7d2 as Content};\n//# sourceMappingURL=index.module.js.map\n","import{__rest as e}from\"tslib\";import a from\"classnames\";import*as r from\"@radix-ui/react-tabs\";import*as t from\"react\";import{sanitizeNamespaceImport as i}from\"@aws-amplify/ui\";import{ComponentClassNames as n}from\"../shared/constants.mjs\";import{Flex as s}from\"../Flex/Flex.mjs\";import{View as l}from\"../View/View.mjs\";const{Root:o,List:m,Trigger:c,Content:d}=i(r),f=e=>t.isValidElement(e),p=t.forwardRef(((r,i)=>{var{ariaLabel:l,children:c,className:p,defaultIndex:u=0,currentIndex:g,onChange:b,indicatorPosition:h,spacing:x}=r,N=e(r,[\"ariaLabel\",\"children\",\"className\",\"defaultIndex\",\"currentIndex\",\"onChange\",\"indicatorPosition\",\"spacing\"]);const C={defaultValue:u.toString(),value:null!=g?g.toString():void 0,onValueChange:b},E=t.Children.toArray(c).filter((e=>!!e));return t.createElement(o,Object.assign({},C),t.createElement(m,{\"aria-label\":l},t.createElement(s,Object.assign({className:a(n.Tabs,p),\"data-indicator-position\":h,ref:i},N),t.Children.map(E,((e,a)=>{if(f(e))return t.cloneElement(e,{\"data-spacing\":x,key:a,value:`${a}`})})))),t.Children.map(E,((e,a)=>{if(f(e))return t.createElement(d,{key:a,value:`${a}`},e.props.children)})))})),u=t.forwardRef(((r,i)=>{var{className:s,title:o}=r,m=e(r,[\"className\",\"title\"]);return t.createElement(l,Object.assign({as:c,className:a(n.TabItems,s),ref:i},m),o)}));p.displayName=\"Tabs\",u.displayName=\"TabItem\";export{u as TabItem,p as Tabs};\n","import r from\"react\";import{translate as e}from\"@aws-amplify/ui\";import{View as t}from\"../../primitives/View/View.mjs\";import{Text as i}from\"../../primitives/Text/Text.mjs\";const m=({errors:m,id:o,dataAttr:a})=>{if(!((null==m?void 0:m.length)>0))return null;const n=a?{[a]:!0}:{};return r.createElement(t,Object.assign({},n,{id:o}),m.map((t=>r.createElement(i,{key:t,role:\"alert\",variation:\"error\"},e(t)))))};export{m as ValidationErrors};\n","/******************************************************************************\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\r\nfunction __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\nfunction __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}\n\nexport { __awaiter, __rest };\n","/**\n * @license React\n * use-sync-external-store-shim.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'use strict';var e=require(\"react\");function h(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var k=\"function\"===typeof Object.is?Object.is:h,l=e.useState,m=e.useEffect,n=e.useLayoutEffect,p=e.useDebugValue;function q(a,b){var d=b(),f=l({inst:{value:d,getSnapshot:b}}),c=f[0].inst,g=f[1];n(function(){c.value=d;c.getSnapshot=b;r(c)&&g({inst:c})},[a,d,b]);m(function(){r(c)&&g({inst:c});return a(function(){r(c)&&g({inst:c})})},[a]);p(d);return d}\nfunction r(a){var b=a.getSnapshot;a=a.value;try{var d=b();return!k(a,d)}catch(f){return!0}}function t(a,b){return b()}var u=\"undefined\"===typeof window||\"undefined\"===typeof window.document||\"undefined\"===typeof window.document.createElement?t:q;exports.useSyncExternalStore=void 0!==e.useSyncExternalStore?e.useSyncExternalStore:u;\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim.development.js');\n}\n","/**\n * @license React\n * use-sync-external-store-shim/with-selector.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'use strict';var h=require(\"react\"),n=require(\"use-sync-external-store/shim\");function p(a,b){return a===b&&(0!==a||1/a===1/b)||a!==a&&b!==b}var q=\"function\"===typeof Object.is?Object.is:p,r=n.useSyncExternalStore,t=h.useRef,u=h.useEffect,v=h.useMemo,w=h.useDebugValue;\nexports.useSyncExternalStoreWithSelector=function(a,b,e,l,g){var c=t(null);if(null===c.current){var f={hasValue:!1,value:null};c.current=f}else f=c.current;c=v(function(){function a(a){if(!c){c=!0;d=a;a=l(a);if(void 0!==g&&f.hasValue){var b=f.value;if(g(b,a))return k=b}return k=a}b=k;if(q(d,a))return b;var e=l(a);if(void 0!==g&&g(b,e))return b;d=a;return k=e}var c=!1,d,k,m=void 0===e?null:e;return[function(){return a(b())},null===m?void 0:function(){return a(m())}]},[b,e,l,g]);var d=r(a,c[0],c[1]);\nu(function(){f.hasValue=!0;f.value=d},[d]);w(d);return d};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.production.min.js');\n} else {\n module.exports = require('../cjs/use-sync-external-store-shim/with-selector.development.js');\n}\n","import { useLayoutEffect } from 'react';\n\nvar index = useLayoutEffect ;\n\nexport default index;\n","import * as React from 'react';\nexport default function useConstant(fn) {\n var ref = React.useRef();\n if (!ref.current) {\n ref.current = { v: fn() };\n }\n return ref.current.v;\n}\n","var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nimport { useEffect, useState } from 'react';\nimport useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';\nimport { interpret, InterpreterStatus, State, toObserver } from 'xstate';\nimport useConstant from './useConstant';\nexport function useIdleInterpreter(getMachine, options) {\n var machine = useConstant(function () {\n return typeof getMachine === 'function' ? getMachine() : getMachine;\n });\n if (process.env.NODE_ENV !== 'production' &&\n typeof getMachine !== 'function') {\n var _a = __read(useState(machine), 1), initialMachine = _a[0];\n if (getMachine !== initialMachine) {\n console.warn('Machine given to `useMachine` has changed between renders. This is not supported and might lead to unexpected results.\\n' +\n 'Please make sure that you pass the same Machine as argument each time.');\n }\n }\n var context = options.context, guards = options.guards, actions = options.actions, activities = options.activities, services = options.services, delays = options.delays, rehydratedState = options.state, interpreterOptions = __rest(options, [\"context\", \"guards\", \"actions\", \"activities\", \"services\", \"delays\", \"state\"]);\n var service = useConstant(function () {\n var machineConfig = {\n context: context,\n guards: guards,\n actions: actions,\n activities: activities,\n services: services,\n delays: delays\n };\n var machineWithConfig = machine.withConfig(machineConfig, function () { return (__assign(__assign({}, machine.context), context)); });\n return interpret(machineWithConfig, interpreterOptions);\n });\n // Make sure options are kept updated when they change.\n // This mutation assignment is safe because the service instance is only used\n // in one place -- this hook's caller.\n useIsomorphicLayoutEffect(function () {\n Object.assign(service.machine.options.actions, actions);\n Object.assign(service.machine.options.guards, guards);\n Object.assign(service.machine.options.activities, activities);\n Object.assign(service.machine.options.services, services);\n Object.assign(service.machine.options.delays, delays);\n }, [actions, guards, activities, services, delays]);\n return service;\n}\nexport function useInterpret(getMachine) {\n var _a = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n _a[_i - 1] = arguments[_i];\n }\n var _b = __read(_a, 2), _c = _b[0], options = _c === void 0 ? {} : _c, observerOrListener = _b[1];\n var service = useIdleInterpreter(getMachine, options);\n useEffect(function () {\n if (!observerOrListener) {\n return;\n }\n var sub = service.subscribe(toObserver(observerOrListener));\n return function () {\n sub.unsubscribe();\n };\n }, [observerOrListener]);\n useEffect(function () {\n var rehydratedState = options.state;\n service.start(rehydratedState ? State.create(rehydratedState) : undefined);\n return function () {\n service.stop();\n service.status = InterpreterStatus.NotStarted;\n };\n }, []);\n return service;\n}\n","import { useRef, useCallback } from 'react';\nimport useIsomorphicLayoutEffect from 'use-isomorphic-layout-effect';\nimport useConstant from './useConstant';\nimport { useSyncExternalStore } from 'use-sync-external-store/shim';\nexport function isActorWithState(actorRef) {\n return 'state' in actorRef;\n}\nfunction isDeferredActor(actorRef) {\n return 'deferred' in actorRef;\n}\nfunction defaultGetSnapshot(actorRef) {\n return 'getSnapshot' in actorRef\n ? actorRef.getSnapshot()\n : isActorWithState(actorRef)\n ? actorRef.state\n : undefined;\n}\nexport function useActor(actorRef, getSnapshot) {\n if (getSnapshot === void 0) { getSnapshot = defaultGetSnapshot; }\n var actorRefRef = useRef(actorRef);\n var deferredEventsRef = useRef([]);\n var subscribe = useCallback(function (handleStoreChange) {\n var unsubscribe = actorRef.subscribe(handleStoreChange).unsubscribe;\n return unsubscribe;\n }, [actorRef]);\n var boundGetSnapshot = useCallback(function () { return getSnapshot(actorRef); }, [\n actorRef,\n getSnapshot\n ]);\n var storeSnapshot = useSyncExternalStore(subscribe, boundGetSnapshot, boundGetSnapshot);\n var send = useConstant(function () { return function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var event = args[0];\n if (process.env.NODE_ENV !== 'production' && args.length > 1) {\n console.warn(\"Unexpected payload: \".concat(JSON.stringify(args[1]), \". Only a single event object can be sent to actor send() functions.\"));\n }\n var currentActorRef = actorRefRef.current;\n // If the previous actor is a deferred actor,\n // queue the events so that they can be replayed\n // on the non-deferred actor.\n if (isDeferredActor(currentActorRef) && currentActorRef.deferred) {\n deferredEventsRef.current.push(event);\n }\n else {\n currentActorRef.send(event);\n }\n }; });\n useIsomorphicLayoutEffect(function () {\n actorRefRef.current = actorRef;\n // Dequeue deferred events from the previous deferred actorRef\n while (deferredEventsRef.current.length > 0) {\n var deferredEvent = deferredEventsRef.current.shift();\n actorRef.send(deferredEvent);\n }\n }, [actorRef]);\n return [storeSnapshot, send];\n}\n","var __read = (this && this.__read) || function (o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o), r, ar = [], e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n }\n catch (error) { e = { error: error }; }\n finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n }\n finally { if (e) throw e.error; }\n }\n return ar;\n};\nvar __values = (this && this.__values) || function(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return { value: o && o[i++], done: !o };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n};\nexport function partition(items, predicate) {\n var e_1, _a;\n var _b = __read([[], []], 2), truthy = _b[0], falsy = _b[1];\n try {\n for (var items_1 = __values(items), items_1_1 = items_1.next(); !items_1_1.done; items_1_1 = items_1.next()) {\n var item = items_1_1.value;\n if (predicate(item)) {\n truthy.push(item);\n }\n else {\n falsy.push(item);\n }\n }\n }\n catch (e_1_1) { e_1 = { error: e_1_1 }; }\n finally {\n try {\n if (items_1_1 && !items_1_1.done && (_a = items_1.return)) _a.call(items_1);\n }\n finally { if (e_1) throw e_1.error; }\n }\n return [truthy, falsy];\n}\nexport function getServiceSnapshot(service) {\n return service.status !== 0 ? service.state : service.machine.initialState;\n}\n// From https://github.com/reduxjs/react-redux/blob/master/src/utils/shallowEqual.ts\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n }\n else {\n return x !== x && y !== y;\n }\n}\nexport function shallowEqual(objA, objB) {\n if (is(objA, objB))\n return true;\n if (typeof objA !== 'object' ||\n objA === null ||\n typeof objB !== 'object' ||\n objB === null) {\n return false;\n }\n var keysA = Object.keys(objA);\n var keysB = Object.keys(objB);\n if (keysA.length !== keysB.length)\n return false;\n for (var i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) ||\n !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n return true;\n}\n","import { useCallback, useRef } from 'react';\nimport { useSyncExternalStoreWithSelector } from 'use-sync-external-store/shim/with-selector';\nimport { isActorWithState } from './useActor';\nimport { getServiceSnapshot } from './utils';\nfunction isService(actor) {\n return 'state' in actor && 'machine' in actor;\n}\nvar defaultCompare = function (a, b) { return a === b; };\nvar defaultGetSnapshot = function (a, initialStateCacheRef) {\n if (isService(a)) {\n // A status of 0 = interpreter not started\n if (a.status === 0 && initialStateCacheRef.current) {\n return initialStateCacheRef.current;\n }\n var snapshot = getServiceSnapshot(a);\n initialStateCacheRef.current = a.status === 0 ? snapshot : null;\n return snapshot;\n }\n return isActorWithState(a) ? a.state : undefined;\n};\nexport function useSelector(actor, selector, compare, getSnapshot) {\n if (compare === void 0) { compare = defaultCompare; }\n var initialStateCacheRef = useRef(null);\n var subscribe = useCallback(function (handleStoreChange) {\n var unsubscribe = actor.subscribe(handleStoreChange).unsubscribe;\n return unsubscribe;\n }, [actor]);\n var boundGetSnapshot = useCallback(function () {\n if (getSnapshot) {\n return getSnapshot(actor);\n }\n return defaultGetSnapshot(actor, initialStateCacheRef);\n }, [actor, getSnapshot]);\n var selectedSnapshot = useSyncExternalStoreWithSelector(subscribe, boundGetSnapshot, boundGetSnapshot, selector, compare);\n return selectedSnapshot;\n}\n","import React from 'react';\n\n/**\n * AuthenticatorContext serves static reference to the auth machine service.\n *\n * https://xstate.js.org/docs/recipes/react.html#context-provider\n */\nconst AuthenticatorContext = React.createContext(null);\n\nexport { AuthenticatorContext };\n","import { __awaiter } from '../../node_modules/tslib/tslib.es6.mjs';\nimport React, { useContext, useMemo, useEffect } from 'react';\nimport { useInterpret } from '@xstate/react';\nimport { Auth } from 'aws-amplify';\nimport { createAuthenticatorMachine, listenToAuthHub, defaultAuthHubHandler } from '@aws-amplify/ui';\nimport { AuthenticatorContext } from './AuthenticatorContext.mjs';\n\nconst createHubHandler = (options) => (data, service) => __awaiter(void 0, void 0, void 0, function* () {\n yield defaultAuthHubHandler(data, service, options);\n});\nfunction AuthenticatorProvider({ children, }) {\n // `authStatus` is exposed by `useAuthenticator` but should not be derived directly from the\n // state machine as the machine only updates on `Authenticator` initiated events, which\n // leads to scenarios where the state machine `authStatus` gets \"stuck\". For exmample,\n // if a user was to sign in using `Auth.signIn` directly rather than using `Authenticator`\n const [authStatus, setAuthStatus] = React.useState('configuring');\n // only run on first render\n React.useEffect(() => {\n Auth.currentAuthenticatedUser()\n .then(() => {\n setAuthStatus('authenticated');\n })\n .catch(() => {\n setAuthStatus('unauthenticated');\n });\n }, []);\n /**\n * Based on use cases, developer might already have added another Provider\n * outside Authenticator. In that case, we sync the two providers by just\n * passing the parent value.\n *\n * TODO(BREAKING): enforce only one provider in App tree\n */\n const parentProviderVal = useContext(AuthenticatorContext);\n const service = useInterpret(createAuthenticatorMachine);\n const value = useMemo(() => (!parentProviderVal ? { authStatus, service } : parentProviderVal), [authStatus, parentProviderVal, service]);\n const { service: activeService } = value;\n useEffect(() => {\n const onSignIn = () => {\n setAuthStatus('authenticated');\n };\n const onSignOut = () => {\n setAuthStatus('unauthenticated');\n };\n const unsubscribe = listenToAuthHub(activeService, createHubHandler({ onSignIn, onSignOut }));\n return unsubscribe;\n }, [activeService]);\n return (React.createElement(AuthenticatorContext.Provider, { value: value }, children));\n}\n\nexport { AuthenticatorProvider as default };\n","const USE_AUTHENTICATOR_ERROR = '`useAuthenticator` must be used inside an `Authenticator.Provider`.';\n\nexport { USE_AUTHENTICATOR_ERROR };\n","const COMPONENT_ROUTE_KEYS = [\n 'confirmResetPassword',\n 'confirmSignIn',\n 'confirmSignUp',\n 'confirmVerifyUser',\n 'forceNewPassword',\n 'resetPassword',\n 'setupTOTP',\n 'signIn',\n 'signUp',\n 'verifyUser',\n];\nconst COMPONENT_ROUTE_NAMES = [\n 'ConfirmResetPassword',\n 'ConfirmSignIn',\n 'ConfirmSignUp',\n 'ConfirmVerifyUser',\n 'ForceNewPassword',\n 'ResetPassword',\n 'SetupTOTP',\n 'SignIn',\n 'SignUp',\n 'VerifyUser',\n];\n\nexport { COMPONENT_ROUTE_KEYS, COMPONENT_ROUTE_NAMES };\n","import { COMPONENT_ROUTE_KEYS, COMPONENT_ROUTE_NAMES } from './constants.mjs';\n\nconst isComponentRouteKey = (route) => COMPONENT_ROUTE_KEYS.some((componentRoute) => componentRoute === route);\nfunction resolveAuthenticatorComponents(defaults, overrides) {\n if (!overrides) {\n return defaults;\n }\n return COMPONENT_ROUTE_NAMES.reduce((components, route) => {\n const Default = defaults[route];\n const Override = overrides[route];\n if (typeof Override !== 'function') {\n return Object.assign(Object.assign({}, components), { [route]: Default });\n }\n const { Footer, FormFields, Header } = Default;\n // cast to allow assigning of component slots\n const Component = Override;\n Component.Footer = Footer;\n Component.FormFields = FormFields;\n Component.Header = Header;\n return Object.assign(Object.assign({}, components), { [route]: Component });\n }, {});\n}\n\nexport { isComponentRouteKey, resolveAuthenticatorComponents };\n","import { __awaiter } from '../../../node_modules/tslib/tslib.es6.mjs';\nimport { Auth } from 'aws-amplify';\nimport { getActorContext, getSortedFormFields, isString, areEmptyArrays, areEmptyObjects } from '@aws-amplify/ui';\nimport { isComponentRouteKey } from '../utils.mjs';\n\nconst defaultComparator = () => false;\n/**\n * Does an ordering and shallow comparison of each array value,\n * plus a value equality check for empty objects and arrays.\n */\nfunction areSelectorDepsEqual(currentDeps, nextDeps) {\n if (currentDeps.length !== nextDeps.length) {\n return false;\n }\n return currentDeps.every((currentDep, index) => {\n const nextDep = nextDeps[index];\n if (areEmptyArrays(currentDep, nextDep) ||\n areEmptyObjects(currentDep, nextDep)) {\n return true;\n }\n return currentDep === nextDep;\n });\n}\nconst getComparator = (selector) => (currentFacade, nextFacade) => {\n const currentSelectorDeps = selector(currentFacade);\n const nextSelectorDeps = selector(nextFacade);\n // Shallow compare the array values\n return areSelectorDepsEqual(currentSelectorDeps, nextSelectorDeps);\n};\nconst getQRFields = (state) => {\n var _a, _b, _c;\n return (Object.assign({}, (_c = (_b = (_a = getActorContext(state)) === null || _a === void 0 ? void 0 : _a.formFields) === null || _b === void 0 ? void 0 : _b.setupTOTP) === null || _c === void 0 ? void 0 : _c.QR));\n};\nconst getTotpSecretCodeCallback = (user) => function getTotpSecretCode() {\n return __awaiter(this, void 0, void 0, function* () {\n return yield Auth.setupTOTP(user);\n });\n};\nconst flattenFormFields = (fields) => fields.flatMap(([name, options]) => (Object.assign({ name }, options)));\nconst convertContactMethodsToFields = (unverifiedContactMethods) => {\n return (unverifiedContactMethods &&\n Object.entries(unverifiedContactMethods).map(([name, value]) => {\n const valueIsString = isString(value);\n if (!valueIsString || !name) {\n return {};\n }\n return { name, label: value, type: 'radio', value };\n }));\n};\n/**\n * Retrieves default and custom (RWA only, to be updated) form field values from state machine\n * for subcomponent routes that render fields\n */\nconst getMachineFields = (route, state, unverifiedContactMethods) => {\n if (isComponentRouteKey(route)) {\n return route === 'verifyUser'\n ? convertContactMethodsToFields(unverifiedContactMethods)\n : flattenFormFields(getSortedFormFields(route, state));\n }\n return [];\n};\n\nexport { areSelectorDepsEqual, defaultComparator, getComparator, getMachineFields, getQRFields, getTotpSecretCodeCallback };\n","import { __rest } from '../../../node_modules/tslib/tslib.es6.mjs';\nimport React, { useCallback } from 'react';\nimport { useSelector } from '@xstate/react';\nimport { getServiceFacade } from '@aws-amplify/ui';\nimport 'aws-amplify';\nimport { AuthenticatorContext } from '../../context/AuthenticatorContext.mjs';\nimport { USE_AUTHENTICATOR_ERROR } from './constants.mjs';\nimport { getQRFields, getMachineFields, getTotpSecretCodeCallback, getComparator, defaultComparator } from './utils.mjs';\n\n/**\n * [📖 Docs](https://ui.docs.amplify.aws/react/connected-components/authenticator/headless#useauthenticator-hook)\n */\nfunction useAuthenticator(selector) {\n const context = React.useContext(AuthenticatorContext);\n if (!context) {\n throw new Error(USE_AUTHENTICATOR_ERROR);\n }\n const { service } = context;\n const { send } = service;\n const xstateSelector = useCallback((state) => (Object.assign({}, getServiceFacade({ send, state }))), [send]);\n const comparator = selector ? getComparator(selector) : defaultComparator;\n // the purpose of `context.authStatus`is to intentionally override `facade.authStatus`. `facade.authStatus` does\n // not update on external sign in events (for example when a user is not using the `Authenticator`).\n const { authStatus } = context;\n const facade = useSelector(service, xstateSelector, comparator);\n const { route, totpSecretCode, unverifiedContactMethods, user } = facade, rest = __rest(facade, [\"route\", \"totpSecretCode\", \"unverifiedContactMethods\", \"user\"]);\n // do not memoize output. `service.getSnapshot` reference remains stable preventing\n // `fields` from updating with current form state on value changes\n const serviceSnapshot = service.getSnapshot();\n // legacy `QRFields` values only used for SetupTOTP page to retrieve issuer information, will be removed in future\n const QRFields = route === 'setupTOTP' ? getQRFields(serviceSnapshot) : null;\n // legacy `formFields` values required until form state is removed from state machine\n const fields = getMachineFields(route, serviceSnapshot, unverifiedContactMethods);\n return Object.assign(Object.assign({}, rest), { authStatus,\n route,\n totpSecretCode,\n unverifiedContactMethods,\n user,\n /** @deprecated For internal use only */\n fields, getTotpSecretCode: getTotpSecretCodeCallback(user), QRFields });\n}\n\nexport { useAuthenticator as default };\n","import React from 'react';\nimport useAuthenticator from '../useAuthenticator/useAuthenticator.mjs';\n\n// only select `route` from machine context\nconst routeSelector = ({ route }) => [route];\nfunction useAuthenticatorInitMachine(data) {\n const { route, initializeMachine } = useAuthenticator(routeSelector);\n const hasInitialized = React.useRef(false);\n React.useEffect(() => {\n if (!hasInitialized.current && route === 'setup') {\n initializeMachine(data);\n hasInitialized.current = true;\n }\n }, [initializeMachine, route, data]);\n}\n\nexport { useAuthenticatorInitMachine as default, routeSelector };\n","import*as o from\"react\";const t=o.createContext(null),e=()=>{const e=o.useContext(t);if(!e)throw new Error(\"`useCustomComponents` cannot be used outside of a `CustomComponentsContext.Provider`\");return e};export{t as CustomComponentsContext,e as useCustomComponents};\n","const r=r=>\"object\"==typeof r&&null!==r&&\"message\"in r&&\"string\"==typeof r.message,e=e=>{if(r(e))return e;try{return new Error(JSON.stringify(e))}catch(r){return new Error(String(e))}},t=r=>e(r).message,n=r=>{const e=new FormData(r.target);return Object.fromEntries(e)};export{t as getErrorMessage,n as getFormDataFromEvent,r as isErrorWithMessage,e as toErrorWithMessage};\n","import{useCallback as e}from\"react\";import{getFormDataFromEvent as t}from\"../../../../helpers/utils.mjs\";import{useAuthenticator as r}from\"@aws-amplify/ui-react-core\";function a(){const{submitForm:a,updateBlur:m,updateForm:u}=r((e=>[e.submitForm,e.updateBlur,e.updateForm]));return{handleBlur:e((({target:{name:e}})=>{m({name:e})}),[m]),handleChange:e((({target:{checked:e,name:t,type:r,value:a}})=>{u({name:t,value:\"checkbox\"===r&&!e?void 0:a})}),[u]),handleSubmit:e((e=>{e.preventDefault(),a(t(e))}),[a])}}export{a as useFormHandlers};\n","import r from\"react\";import{translate as e}from\"@aws-amplify/ui\";import{useAuthenticator as t}from\"@aws-amplify/ui-react-core\";import{Alert as i}from\"../../../primitives/Alert/Alert.mjs\";const m=()=>{const{error:m}=t((r=>[r.error]));return r.createElement(r.Fragment,null,m?r.createElement(i,{variation:\"error\",isDismissible:!0},e(m)):null)};export{m as RemoteErrorMessage};\n","import{__rest as e}from\"tslib\";import*as r from\"react\";import{getErrors as t}from\"@aws-amplify/ui\";import{PasswordField as a}from\"../../../primitives/PasswordField/PasswordField.mjs\";import{PhoneNumberField as i}from\"../../../primitives/PhoneNumberField/PhoneNumberField.mjs\";import{TextField as o}from\"../../../primitives/TextField/TextField.mjs\";import{useAuthenticator as m}from\"@aws-amplify/ui-react-core\";import{useStableId as s}from\"../../../primitives/utils/useStableId.mjs\";import{ValidationErrors as l}from\"../../shared/ValidationErrors.mjs\";function d(d){var{autocomplete:n,dialCode:p,name:c,type:u}=d,f=e(d,[\"autocomplete\",\"dialCode\",\"name\",\"type\"]);const{validationErrors:E}=m((({validationErrors:e})=>[e])),b=r.useMemo((()=>t(E[c])),[c,E]),y=(null==b?void 0:b.length)>0,g=s(),v=y?g:void 0;return\"tel\"===u?r.createElement(r.Fragment,null,r.createElement(i,Object.assign({},f,{name:c,defaultDialCode:p,dialCodeName:\"country_code\",autoComplete:n,hasError:y,\"aria-describedby\":v})),r.createElement(l,{dataAttr:\"data-amplify-sign-up-errors\",errors:b,id:g})):\"password\"===u?r.createElement(r.Fragment,null,r.createElement(a,Object.assign({},f,{name:c,autoComplete:n,hasError:y,\"aria-describedby\":v})),r.createElement(l,{dataAttr:\"data-amplify-sign-up-errors\",errors:b,id:g})):r.createElement(r.Fragment,null,r.createElement(o,Object.assign({},f,{name:c,autoComplete:n,hasError:y,type:u,\"aria-describedby\":v})),r.createElement(l,{dataAttr:\"data-amplify-sign-up-errors\",errors:b,id:g}))}export{d as FormField};\n","import*as e from\"react\";import{FormField as r}from\"./FormField.mjs\";import{useAuthenticator as t}from\"@aws-amplify/ui-react-core\";function m(){const{fields:m}=t((({route:e})=>[e])),o=e.useRef(m.map(((t,m)=>e.createElement(r,Object.assign({key:m},t))))).current;return e.createElement(e.Fragment,null,o)}export{m as FormFields};\n","import e from\"react\";import{View as t}from\"../../../primitives/View/View.mjs\";import{useAuthenticator as a}from\"@aws-amplify/ui-react-core\";import{useCustomComponents as r}from\"../hooks/useCustomComponents/index.mjs\";const o=e=>\"signIn\"===e||\"signUp\";function n({children:n,className:i,variation:m=\"default\"}){const{route:c}=a((({route:e})=>[e])),{components:{Header:l,Footer:s}}=r();return e.createElement(t,{className:i,\"data-amplify-authenticator\":\"\",\"data-variation\":m},e.createElement(t,{\"data-amplify-container\":\"\"},e.createElement(l,null),e.createElement(t,{\"data-amplify-router\":\"\",\"data-amplify-router-content\":o(c)?void 0:\"\"},n),e.createElement(s,null)))}export{n as RouteContainer};\n","import e from\"react\";import{authenticatorTextUtil as t}from\"@aws-amplify/ui\";import{Button as r}from\"../../../primitives/Button/Button.mjs\";import{Flex as o}from\"../../../primitives/Flex/Flex.mjs\";import{Heading as i}from\"../../../primitives/Heading/Heading.mjs\";import{Text as m}from\"../../../primitives/Text/Text.mjs\";import{useAuthenticator as n}from\"@aws-amplify/ui-react-core\";import{useCustomComponents as a}from\"../hooks/useCustomComponents/index.mjs\";import{useFormHandlers as s}from\"../hooks/useFormHandlers/useFormHandlers.mjs\";import{RemoteErrorMessage as l}from\"../shared/RemoteErrorMessage.mjs\";import{FormFields as c}from\"../shared/FormFields.mjs\";import{RouteContainer as d}from\"../RouteContainer/RouteContainer.mjs\";const{getDeliveryMessageText:p,getDeliveryMethodText:u,getConfirmingText:f,getConfirmText:g,getResendCodeText:h}=t;function v({className:t,variation:i}){const{isPending:u,resendCode:y,codeDeliveryDetails:C}=n((e=>[e.isPending,e.resendCode,e.codeDeliveryDetails])),{handleChange:E,handleSubmit:x}=s(),{components:{ConfirmSignUp:{Header:D=v.Header,Footer:j=v.Footer}}}=a();return e.createElement(d,{className:t,variation:i},e.createElement(\"form\",{\"data-amplify-form\":\"\",\"data-amplify-authenticator-confirmsignup\":\"\",method:\"post\",onChange:E,onSubmit:x},e.createElement(o,{as:\"fieldset\",direction:\"column\",isDisabled:u},e.createElement(D,null),e.createElement(o,{direction:\"column\"},e.createElement(m,{className:\"amplify-authenticator__subtitle\"},p(C)),e.createElement(c,null),e.createElement(l,null),e.createElement(r,{variation:\"primary\",isDisabled:u,type:\"submit\",loadingText:f(),isLoading:u,fontWeight:\"normal\"},g()),e.createElement(r,{onClick:y,type:\"button\",fontWeight:\"normal\"},h())),e.createElement(j,null))))}v.Header=()=>{const{codeDeliveryDetails:t}=n((e=>[e.codeDeliveryDetails]));return e.createElement(i,{level:4},u(t))},v.Footer=function(){return null};export{v as ConfirmSignUp};\n","import e from\"react\";import{authenticatorTextUtil as t}from\"@aws-amplify/ui\";import{Button as o}from\"../../../primitives/Button/Button.mjs\";import{Flex as r}from\"../../../primitives/Flex/Flex.mjs\";import{Heading as i}from\"../../../primitives/Heading/Heading.mjs\";import{RemoteErrorMessage as n}from\"../shared/RemoteErrorMessage.mjs\";import{useAuthenticator as m}from\"@aws-amplify/ui-react-core\";import{useCustomComponents as a}from\"../hooks/useCustomComponents/index.mjs\";import{useFormHandlers as s}from\"../hooks/useFormHandlers/useFormHandlers.mjs\";import{FormFields as l}from\"../shared/FormFields.mjs\";import{RouteContainer as d}from\"../RouteContainer/RouteContainer.mjs\";const{getChangePasswordText:p,getChangingText:c,getBackToSignInText:u}=t,f=({className:t,variation:l})=>{const{isPending:g,toSignIn:h}=m((e=>[e.isPending,e.toSignIn])),{handleBlur:F,handleChange:E,handleSubmit:C}=s(),{components:{ForceNewPassword:{FormFields:j=f.FormFields}}}=a();return e.createElement(d,{className:t,variation:l},e.createElement(\"form\",{\"data-amplify-form\":\"\",\"data-amplify-authenticator-forcenewpassword\":\"\",method:\"post\",onChange:E,onSubmit:C,onBlur:F},e.createElement(r,{as:\"fieldset\",direction:\"column\",isDisabled:g},e.createElement(i,{level:3},p()),e.createElement(j,null),e.createElement(n,null),e.createElement(o,{isDisabled:g,type:\"submit\",variation:\"primary\",isLoading:g,loadingText:c(),fontWeight:\"normal\"},p()),e.createElement(o,{onClick:h,type:\"button\",fontWeight:\"normal\",variation:\"link\",size:\"small\"},u()))))};f.FormFields=function(){return e.createElement(l,null)};export{f as ForceNewPassword};\n","// can-promise has a crash in some versions of react native that dont have\n// standard global objects\n// https://github.com/soldair/node-qrcode/issues/157\n\nmodule.exports = function () {\n return typeof Promise === 'function' && Promise.prototype && Promise.prototype.then\n}\n","let toSJISFunction\nconst CODEWORDS_COUNT = [\n 0, // Not used\n 26, 44, 70, 100, 134, 172, 196, 242, 292, 346,\n 404, 466, 532, 581, 655, 733, 815, 901, 991, 1085,\n 1156, 1258, 1364, 1474, 1588, 1706, 1828, 1921, 2051, 2185,\n 2323, 2465, 2611, 2761, 2876, 3034, 3196, 3362, 3532, 3706\n]\n\n/**\n * Returns the QR Code size for the specified version\n *\n * @param {Number} version QR Code version\n * @return {Number} size of QR code\n */\nexports.getSymbolSize = function getSymbolSize (version) {\n if (!version) throw new Error('\"version\" cannot be null or undefined')\n if (version < 1 || version > 40) throw new Error('\"version\" should be in range from 1 to 40')\n return version * 4 + 17\n}\n\n/**\n * Returns the total number of codewords used to store data and EC information.\n *\n * @param {Number} version QR Code version\n * @return {Number} Data length in bits\n */\nexports.getSymbolTotalCodewords = function getSymbolTotalCodewords (version) {\n return CODEWORDS_COUNT[version]\n}\n\n/**\n * Encode data with Bose-Chaudhuri-Hocquenghem\n *\n * @param {Number} data Value to encode\n * @return {Number} Encoded value\n */\nexports.getBCHDigit = function (data) {\n let digit = 0\n\n while (data !== 0) {\n digit++\n data >>>= 1\n }\n\n return digit\n}\n\nexports.setToSJISFunction = function setToSJISFunction (f) {\n if (typeof f !== 'function') {\n throw new Error('\"toSJISFunc\" is not a valid function.')\n }\n\n toSJISFunction = f\n}\n\nexports.isKanjiModeEnabled = function () {\n return typeof toSJISFunction !== 'undefined'\n}\n\nexports.toSJIS = function toSJIS (kanji) {\n return toSJISFunction(kanji)\n}\n","exports.L = { bit: 1 }\nexports.M = { bit: 0 }\nexports.Q = { bit: 3 }\nexports.H = { bit: 2 }\n\nfunction fromString (string) {\n if (typeof string !== 'string') {\n throw new Error('Param is not a string')\n }\n\n const lcStr = string.toLowerCase()\n\n switch (lcStr) {\n case 'l':\n case 'low':\n return exports.L\n\n case 'm':\n case 'medium':\n return exports.M\n\n case 'q':\n case 'quartile':\n return exports.Q\n\n case 'h':\n case 'high':\n return exports.H\n\n default:\n throw new Error('Unknown EC Level: ' + string)\n }\n}\n\nexports.isValid = function isValid (level) {\n return level && typeof level.bit !== 'undefined' &&\n level.bit >= 0 && level.bit < 4\n}\n\nexports.from = function from (value, defaultValue) {\n if (exports.isValid(value)) {\n return value\n }\n\n try {\n return fromString(value)\n } catch (e) {\n return defaultValue\n }\n}\n","function BitBuffer () {\n this.buffer = []\n this.length = 0\n}\n\nBitBuffer.prototype = {\n\n get: function (index) {\n const bufIndex = Math.floor(index / 8)\n return ((this.buffer[bufIndex] >>> (7 - index % 8)) & 1) === 1\n },\n\n put: function (num, length) {\n for (let i = 0; i < length; i++) {\n this.putBit(((num >>> (length - i - 1)) & 1) === 1)\n }\n },\n\n getLengthInBits: function () {\n return this.length\n },\n\n putBit: function (bit) {\n const bufIndex = Math.floor(this.length / 8)\n if (this.buffer.length <= bufIndex) {\n this.buffer.push(0)\n }\n\n if (bit) {\n this.buffer[bufIndex] |= (0x80 >>> (this.length % 8))\n }\n\n this.length++\n }\n}\n\nmodule.exports = BitBuffer\n","/**\n * Helper class to handle QR Code symbol modules\n *\n * @param {Number} size Symbol size\n */\nfunction BitMatrix (size) {\n if (!size || size < 1) {\n throw new Error('BitMatrix size must be defined and greater than 0')\n }\n\n this.size = size\n this.data = new Uint8Array(size * size)\n this.reservedBit = new Uint8Array(size * size)\n}\n\n/**\n * Set bit value at specified location\n * If reserved flag is set, this bit will be ignored during masking process\n *\n * @param {Number} row\n * @param {Number} col\n * @param {Boolean} value\n * @param {Boolean} reserved\n */\nBitMatrix.prototype.set = function (row, col, value, reserved) {\n const index = row * this.size + col\n this.data[index] = value\n if (reserved) this.reservedBit[index] = true\n}\n\n/**\n * Returns bit value at specified location\n *\n * @param {Number} row\n * @param {Number} col\n * @return {Boolean}\n */\nBitMatrix.prototype.get = function (row, col) {\n return this.data[row * this.size + col]\n}\n\n/**\n * Applies xor operator at specified location\n * (used during masking process)\n *\n * @param {Number} row\n * @param {Number} col\n * @param {Boolean} value\n */\nBitMatrix.prototype.xor = function (row, col, value) {\n this.data[row * this.size + col] ^= value\n}\n\n/**\n * Check if bit at specified location is reserved\n *\n * @param {Number} row\n * @param {Number} col\n * @return {Boolean}\n */\nBitMatrix.prototype.isReserved = function (row, col) {\n return this.reservedBit[row * this.size + col]\n}\n\nmodule.exports = BitMatrix\n","/**\n * Alignment pattern are fixed reference pattern in defined positions\n * in a matrix symbology, which enables the decode software to re-synchronise\n * the coordinate mapping of the image modules in the event of moderate amounts\n * of distortion of the image.\n *\n * Alignment patterns are present only in QR Code symbols of version 2 or larger\n * and their number depends on the symbol version.\n */\n\nconst getSymbolSize = require('./utils').getSymbolSize\n\n/**\n * Calculate the row/column coordinates of the center module of each alignment pattern\n * for the specified QR Code version.\n *\n * The alignment patterns are positioned symmetrically on either side of the diagonal\n * running from the top left corner of the symbol to the bottom right corner.\n *\n * Since positions are simmetrical only half of the coordinates are returned.\n * Each item of the array will represent in turn the x and y coordinate.\n * @see {@link getPositions}\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinate\n */\nexports.getRowColCoords = function getRowColCoords (version) {\n if (version === 1) return []\n\n const posCount = Math.floor(version / 7) + 2\n const size = getSymbolSize(version)\n const intervals = size === 145 ? 26 : Math.ceil((size - 13) / (2 * posCount - 2)) * 2\n const positions = [size - 7] // Last coord is always (size - 7)\n\n for (let i = 1; i < posCount - 1; i++) {\n positions[i] = positions[i - 1] - intervals\n }\n\n positions.push(6) // First coord is always 6\n\n return positions.reverse()\n}\n\n/**\n * Returns an array containing the positions of each alignment pattern.\n * Each array's element represent the center point of the pattern as (x, y) coordinates\n *\n * Coordinates are calculated expanding the row/column coordinates returned by {@link getRowColCoords}\n * and filtering out the items that overlaps with finder pattern\n *\n * @example\n * For a Version 7 symbol {@link getRowColCoords} returns values 6, 22 and 38.\n * The alignment patterns, therefore, are to be centered on (row, column)\n * positions (6,22), (22,6), (22,22), (22,38), (38,22), (38,38).\n * Note that the coordinates (6,6), (6,38), (38,6) are occupied by finder patterns\n * and are not therefore used for alignment patterns.\n *\n * let pos = getPositions(7)\n * // [[6,22], [22,6], [22,22], [22,38], [38,22], [38,38]]\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinates\n */\nexports.getPositions = function getPositions (version) {\n const coords = []\n const pos = exports.getRowColCoords(version)\n const posLength = pos.length\n\n for (let i = 0; i < posLength; i++) {\n for (let j = 0; j < posLength; j++) {\n // Skip if position is occupied by finder patterns\n if ((i === 0 && j === 0) || // top-left\n (i === 0 && j === posLength - 1) || // bottom-left\n (i === posLength - 1 && j === 0)) { // top-right\n continue\n }\n\n coords.push([pos[i], pos[j]])\n }\n }\n\n return coords\n}\n","const getSymbolSize = require('./utils').getSymbolSize\nconst FINDER_PATTERN_SIZE = 7\n\n/**\n * Returns an array containing the positions of each finder pattern.\n * Each array's element represent the top-left point of the pattern as (x, y) coordinates\n *\n * @param {Number} version QR Code version\n * @return {Array} Array of coordinates\n */\nexports.getPositions = function getPositions (version) {\n const size = getSymbolSize(version)\n\n return [\n // top-left\n [0, 0],\n // top-right\n [size - FINDER_PATTERN_SIZE, 0],\n // bottom-left\n [0, size - FINDER_PATTERN_SIZE]\n ]\n}\n","/**\n * Data mask pattern reference\n * @type {Object}\n */\nexports.Patterns = {\n PATTERN000: 0,\n PATTERN001: 1,\n PATTERN010: 2,\n PATTERN011: 3,\n PATTERN100: 4,\n PATTERN101: 5,\n PATTERN110: 6,\n PATTERN111: 7\n}\n\n/**\n * Weighted penalty scores for the undesirable features\n * @type {Object}\n */\nconst PenaltyScores = {\n N1: 3,\n N2: 3,\n N3: 40,\n N4: 10\n}\n\n/**\n * Check if mask pattern value is valid\n *\n * @param {Number} mask Mask pattern\n * @return {Boolean} true if valid, false otherwise\n */\nexports.isValid = function isValid (mask) {\n return mask != null && mask !== '' && !isNaN(mask) && mask >= 0 && mask <= 7\n}\n\n/**\n * Returns mask pattern from a value.\n * If value is not valid, returns undefined\n *\n * @param {Number|String} value Mask pattern value\n * @return {Number} Valid mask pattern or undefined\n */\nexports.from = function from (value) {\n return exports.isValid(value) ? parseInt(value, 10) : undefined\n}\n\n/**\n* Find adjacent modules in row/column with the same color\n* and assign a penalty value.\n*\n* Points: N1 + i\n* i is the amount by which the number of adjacent modules of the same color exceeds 5\n*/\nexports.getPenaltyN1 = function getPenaltyN1 (data) {\n const size = data.size\n let points = 0\n let sameCountCol = 0\n let sameCountRow = 0\n let lastCol = null\n let lastRow = null\n\n for (let row = 0; row < size; row++) {\n sameCountCol = sameCountRow = 0\n lastCol = lastRow = null\n\n for (let col = 0; col < size; col++) {\n let module = data.get(row, col)\n if (module === lastCol) {\n sameCountCol++\n } else {\n if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n lastCol = module\n sameCountCol = 1\n }\n\n module = data.get(col, row)\n if (module === lastRow) {\n sameCountRow++\n } else {\n if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n lastRow = module\n sameCountRow = 1\n }\n }\n\n if (sameCountCol >= 5) points += PenaltyScores.N1 + (sameCountCol - 5)\n if (sameCountRow >= 5) points += PenaltyScores.N1 + (sameCountRow - 5)\n }\n\n return points\n}\n\n/**\n * Find 2x2 blocks with the same color and assign a penalty value\n *\n * Points: N2 * (m - 1) * (n - 1)\n */\nexports.getPenaltyN2 = function getPenaltyN2 (data) {\n const size = data.size\n let points = 0\n\n for (let row = 0; row < size - 1; row++) {\n for (let col = 0; col < size - 1; col++) {\n const last = data.get(row, col) +\n data.get(row, col + 1) +\n data.get(row + 1, col) +\n data.get(row + 1, col + 1)\n\n if (last === 4 || last === 0) points++\n }\n }\n\n return points * PenaltyScores.N2\n}\n\n/**\n * Find 1:1:3:1:1 ratio (dark:light:dark:light:dark) pattern in row/column,\n * preceded or followed by light area 4 modules wide\n *\n * Points: N3 * number of pattern found\n */\nexports.getPenaltyN3 = function getPenaltyN3 (data) {\n const size = data.size\n let points = 0\n let bitsCol = 0\n let bitsRow = 0\n\n for (let row = 0; row < size; row++) {\n bitsCol = bitsRow = 0\n for (let col = 0; col < size; col++) {\n bitsCol = ((bitsCol << 1) & 0x7FF) | data.get(row, col)\n if (col >= 10 && (bitsCol === 0x5D0 || bitsCol === 0x05D)) points++\n\n bitsRow = ((bitsRow << 1) & 0x7FF) | data.get(col, row)\n if (col >= 10 && (bitsRow === 0x5D0 || bitsRow === 0x05D)) points++\n }\n }\n\n return points * PenaltyScores.N3\n}\n\n/**\n * Calculate proportion of dark modules in entire symbol\n *\n * Points: N4 * k\n *\n * k is the rating of the deviation of the proportion of dark modules\n * in the symbol from 50% in steps of 5%\n */\nexports.getPenaltyN4 = function getPenaltyN4 (data) {\n let darkCount = 0\n const modulesCount = data.data.length\n\n for (let i = 0; i < modulesCount; i++) darkCount += data.data[i]\n\n const k = Math.abs(Math.ceil((darkCount * 100 / modulesCount) / 5) - 10)\n\n return k * PenaltyScores.N4\n}\n\n/**\n * Return mask value at given position\n *\n * @param {Number} maskPattern Pattern reference value\n * @param {Number} i Row\n * @param {Number} j Column\n * @return {Boolean} Mask value\n */\nfunction getMaskAt (maskPattern, i, j) {\n switch (maskPattern) {\n case exports.Patterns.PATTERN000: return (i + j) % 2 === 0\n case exports.Patterns.PATTERN001: return i % 2 === 0\n case exports.Patterns.PATTERN010: return j % 3 === 0\n case exports.Patterns.PATTERN011: return (i + j) % 3 === 0\n case exports.Patterns.PATTERN100: return (Math.floor(i / 2) + Math.floor(j / 3)) % 2 === 0\n case exports.Patterns.PATTERN101: return (i * j) % 2 + (i * j) % 3 === 0\n case exports.Patterns.PATTERN110: return ((i * j) % 2 + (i * j) % 3) % 2 === 0\n case exports.Patterns.PATTERN111: return ((i * j) % 3 + (i + j) % 2) % 2 === 0\n\n default: throw new Error('bad maskPattern:' + maskPattern)\n }\n}\n\n/**\n * Apply a mask pattern to a BitMatrix\n *\n * @param {Number} pattern Pattern reference number\n * @param {BitMatrix} data BitMatrix data\n */\nexports.applyMask = function applyMask (pattern, data) {\n const size = data.size\n\n for (let col = 0; col < size; col++) {\n for (let row = 0; row < size; row++) {\n if (data.isReserved(row, col)) continue\n data.xor(row, col, getMaskAt(pattern, row, col))\n }\n }\n}\n\n/**\n * Returns the best mask pattern for data\n *\n * @param {BitMatrix} data\n * @return {Number} Mask pattern reference number\n */\nexports.getBestMask = function getBestMask (data, setupFormatFunc) {\n const numPatterns = Object.keys(exports.Patterns).length\n let bestPattern = 0\n let lowerPenalty = Infinity\n\n for (let p = 0; p < numPatterns; p++) {\n setupFormatFunc(p)\n exports.applyMask(p, data)\n\n // Calculate penalty\n const penalty =\n exports.getPenaltyN1(data) +\n exports.getPenaltyN2(data) +\n exports.getPenaltyN3(data) +\n exports.getPenaltyN4(data)\n\n // Undo previously applied mask\n exports.applyMask(p, data)\n\n if (penalty < lowerPenalty) {\n lowerPenalty = penalty\n bestPattern = p\n }\n }\n\n return bestPattern\n}\n","const ECLevel = require('./error-correction-level')\r\n\r\nconst EC_BLOCKS_TABLE = [\r\n// L M Q H\r\n 1, 1, 1, 1,\r\n 1, 1, 1, 1,\r\n 1, 1, 2, 2,\r\n 1, 2, 2, 4,\r\n 1, 2, 4, 4,\r\n 2, 4, 4, 4,\r\n 2, 4, 6, 5,\r\n 2, 4, 6, 6,\r\n 2, 5, 8, 8,\r\n 4, 5, 8, 8,\r\n 4, 5, 8, 11,\r\n 4, 8, 10, 11,\r\n 4, 9, 12, 16,\r\n 4, 9, 16, 16,\r\n 6, 10, 12, 18,\r\n 6, 10, 17, 16,\r\n 6, 11, 16, 19,\r\n 6, 13, 18, 21,\r\n 7, 14, 21, 25,\r\n 8, 16, 20, 25,\r\n 8, 17, 23, 25,\r\n 9, 17, 23, 34,\r\n 9, 18, 25, 30,\r\n 10, 20, 27, 32,\r\n 12, 21, 29, 35,\r\n 12, 23, 34, 37,\r\n 12, 25, 34, 40,\r\n 13, 26, 35, 42,\r\n 14, 28, 38, 45,\r\n 15, 29, 40, 48,\r\n 16, 31, 43, 51,\r\n 17, 33, 45, 54,\r\n 18, 35, 48, 57,\r\n 19, 37, 51, 60,\r\n 19, 38, 53, 63,\r\n 20, 40, 56, 66,\r\n 21, 43, 59, 70,\r\n 22, 45, 62, 74,\r\n 24, 47, 65, 77,\r\n 25, 49, 68, 81\r\n]\r\n\r\nconst EC_CODEWORDS_TABLE = [\r\n// L M Q H\r\n 7, 10, 13, 17,\r\n 10, 16, 22, 28,\r\n 15, 26, 36, 44,\r\n 20, 36, 52, 64,\r\n 26, 48, 72, 88,\r\n 36, 64, 96, 112,\r\n 40, 72, 108, 130,\r\n 48, 88, 132, 156,\r\n 60, 110, 160, 192,\r\n 72, 130, 192, 224,\r\n 80, 150, 224, 264,\r\n 96, 176, 260, 308,\r\n 104, 198, 288, 352,\r\n 120, 216, 320, 384,\r\n 132, 240, 360, 432,\r\n 144, 280, 408, 480,\r\n 168, 308, 448, 532,\r\n 180, 338, 504, 588,\r\n 196, 364, 546, 650,\r\n 224, 416, 600, 700,\r\n 224, 442, 644, 750,\r\n 252, 476, 690, 816,\r\n 270, 504, 750, 900,\r\n 300, 560, 810, 960,\r\n 312, 588, 870, 1050,\r\n 336, 644, 952, 1110,\r\n 360, 700, 1020, 1200,\r\n 390, 728, 1050, 1260,\r\n 420, 784, 1140, 1350,\r\n 450, 812, 1200, 1440,\r\n 480, 868, 1290, 1530,\r\n 510, 924, 1350, 1620,\r\n 540, 980, 1440, 1710,\r\n 570, 1036, 1530, 1800,\r\n 570, 1064, 1590, 1890,\r\n 600, 1120, 1680, 1980,\r\n 630, 1204, 1770, 2100,\r\n 660, 1260, 1860, 2220,\r\n 720, 1316, 1950, 2310,\r\n 750, 1372, 2040, 2430\r\n]\r\n\r\n/**\r\n * Returns the number of error correction block that the QR Code should contain\r\n * for the specified version and error correction level.\r\n *\r\n * @param {Number} version QR Code version\r\n * @param {Number} errorCorrectionLevel Error correction level\r\n * @return {Number} Number of error correction blocks\r\n */\r\nexports.getBlocksCount = function getBlocksCount (version, errorCorrectionLevel) {\r\n switch (errorCorrectionLevel) {\r\n case ECLevel.L:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 0]\r\n case ECLevel.M:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 1]\r\n case ECLevel.Q:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 2]\r\n case ECLevel.H:\r\n return EC_BLOCKS_TABLE[(version - 1) * 4 + 3]\r\n default:\r\n return undefined\r\n }\r\n}\r\n\r\n/**\r\n * Returns the number of error correction codewords to use for the specified\r\n * version and error correction level.\r\n *\r\n * @param {Number} version QR Code version\r\n * @param {Number} errorCorrectionLevel Error correction level\r\n * @return {Number} Number of error correction codewords\r\n */\r\nexports.getTotalCodewordsCount = function getTotalCodewordsCount (version, errorCorrectionLevel) {\r\n switch (errorCorrectionLevel) {\r\n case ECLevel.L:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 0]\r\n case ECLevel.M:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 1]\r\n case ECLevel.Q:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 2]\r\n case ECLevel.H:\r\n return EC_CODEWORDS_TABLE[(version - 1) * 4 + 3]\r\n default:\r\n return undefined\r\n }\r\n}\r\n","const EXP_TABLE = new Uint8Array(512)\nconst LOG_TABLE = new Uint8Array(256)\n/**\n * Precompute the log and anti-log tables for faster computation later\n *\n * For each possible value in the galois field 2^8, we will pre-compute\n * the logarithm and anti-logarithm (exponential) of this value\n *\n * ref {@link https://en.wikiversity.org/wiki/Reed%E2%80%93Solomon_codes_for_coders#Introduction_to_mathematical_fields}\n */\n;(function initTables () {\n let x = 1\n for (let i = 0; i < 255; i++) {\n EXP_TABLE[i] = x\n LOG_TABLE[x] = i\n\n x <<= 1 // multiply by 2\n\n // The QR code specification says to use byte-wise modulo 100011101 arithmetic.\n // This means that when a number is 256 or larger, it should be XORed with 0x11D.\n if (x & 0x100) { // similar to x >= 256, but a lot faster (because 0x100 == 256)\n x ^= 0x11D\n }\n }\n\n // Optimization: double the size of the anti-log table so that we don't need to mod 255 to\n // stay inside the bounds (because we will mainly use this table for the multiplication of\n // two GF numbers, no more).\n // @see {@link mul}\n for (let i = 255; i < 512; i++) {\n EXP_TABLE[i] = EXP_TABLE[i - 255]\n }\n}())\n\n/**\n * Returns log value of n inside Galois Field\n *\n * @param {Number} n\n * @return {Number}\n */\nexports.log = function log (n) {\n if (n < 1) throw new Error('log(' + n + ')')\n return LOG_TABLE[n]\n}\n\n/**\n * Returns anti-log value of n inside Galois Field\n *\n * @param {Number} n\n * @return {Number}\n */\nexports.exp = function exp (n) {\n return EXP_TABLE[n]\n}\n\n/**\n * Multiplies two number inside Galois Field\n *\n * @param {Number} x\n * @param {Number} y\n * @return {Number}\n */\nexports.mul = function mul (x, y) {\n if (x === 0 || y === 0) return 0\n\n // should be EXP_TABLE[(LOG_TABLE[x] + LOG_TABLE[y]) % 255] if EXP_TABLE wasn't oversized\n // @see {@link initTables}\n return EXP_TABLE[LOG_TABLE[x] + LOG_TABLE[y]]\n}\n","const GF = require('./galois-field')\n\n/**\n * Multiplies two polynomials inside Galois Field\n *\n * @param {Uint8Array} p1 Polynomial\n * @param {Uint8Array} p2 Polynomial\n * @return {Uint8Array} Product of p1 and p2\n */\nexports.mul = function mul (p1, p2) {\n const coeff = new Uint8Array(p1.length + p2.length - 1)\n\n for (let i = 0; i < p1.length; i++) {\n for (let j = 0; j < p2.length; j++) {\n coeff[i + j] ^= GF.mul(p1[i], p2[j])\n }\n }\n\n return coeff\n}\n\n/**\n * Calculate the remainder of polynomials division\n *\n * @param {Uint8Array} divident Polynomial\n * @param {Uint8Array} divisor Polynomial\n * @return {Uint8Array} Remainder\n */\nexports.mod = function mod (divident, divisor) {\n let result = new Uint8Array(divident)\n\n while ((result.length - divisor.length) >= 0) {\n const coeff = result[0]\n\n for (let i = 0; i < divisor.length; i++) {\n result[i] ^= GF.mul(divisor[i], coeff)\n }\n\n // remove all zeros from buffer head\n let offset = 0\n while (offset < result.length && result[offset] === 0) offset++\n result = result.slice(offset)\n }\n\n return result\n}\n\n/**\n * Generate an irreducible generator polynomial of specified degree\n * (used by Reed-Solomon encoder)\n *\n * @param {Number} degree Degree of the generator polynomial\n * @return {Uint8Array} Buffer containing polynomial coefficients\n */\nexports.generateECPolynomial = function generateECPolynomial (degree) {\n let poly = new Uint8Array([1])\n for (let i = 0; i < degree; i++) {\n poly = exports.mul(poly, new Uint8Array([1, GF.exp(i)]))\n }\n\n return poly\n}\n","const Polynomial = require('./polynomial')\n\nfunction ReedSolomonEncoder (degree) {\n this.genPoly = undefined\n this.degree = degree\n\n if (this.degree) this.initialize(this.degree)\n}\n\n/**\n * Initialize the encoder.\n * The input param should correspond to the number of error correction codewords.\n *\n * @param {Number} degree\n */\nReedSolomonEncoder.prototype.initialize = function initialize (degree) {\n // create an irreducible generator polynomial\n this.degree = degree\n this.genPoly = Polynomial.generateECPolynomial(this.degree)\n}\n\n/**\n * Encodes a chunk of data\n *\n * @param {Uint8Array} data Buffer containing input data\n * @return {Uint8Array} Buffer containing encoded data\n */\nReedSolomonEncoder.prototype.encode = function encode (data) {\n if (!this.genPoly) {\n throw new Error('Encoder not initialized')\n }\n\n // Calculate EC for this data block\n // extends data size to data+genPoly size\n const paddedData = new Uint8Array(data.length + this.degree)\n paddedData.set(data)\n\n // The error correction codewords are the remainder after dividing the data codewords\n // by a generator polynomial\n const remainder = Polynomial.mod(paddedData, this.genPoly)\n\n // return EC data blocks (last n byte, where n is the degree of genPoly)\n // If coefficients number in remainder are less than genPoly degree,\n // pad with 0s to the left to reach the needed number of coefficients\n const start = this.degree - remainder.length\n if (start > 0) {\n const buff = new Uint8Array(this.degree)\n buff.set(remainder, start)\n\n return buff\n }\n\n return remainder\n}\n\nmodule.exports = ReedSolomonEncoder\n","/**\n * Check if QR Code version is valid\n *\n * @param {Number} version QR Code version\n * @return {Boolean} true if valid version, false otherwise\n */\nexports.isValid = function isValid (version) {\n return !isNaN(version) && version >= 1 && version <= 40\n}\n","const numeric = '[0-9]+'\nconst alphanumeric = '[A-Z $%*+\\\\-./:]+'\nlet kanji = '(?:[u3000-u303F]|[u3040-u309F]|[u30A0-u30FF]|' +\n '[uFF00-uFFEF]|[u4E00-u9FAF]|[u2605-u2606]|[u2190-u2195]|u203B|' +\n '[u2010u2015u2018u2019u2025u2026u201Cu201Du2225u2260]|' +\n '[u0391-u0451]|[u00A7u00A8u00B1u00B4u00D7u00F7])+'\nkanji = kanji.replace(/u/g, '\\\\u')\n\nconst byte = '(?:(?![A-Z0-9 $%*+\\\\-./:]|' + kanji + ')(?:.|[\\r\\n]))+'\n\nexports.KANJI = new RegExp(kanji, 'g')\nexports.BYTE_KANJI = new RegExp('[^A-Z0-9 $%*+\\\\-./:]+', 'g')\nexports.BYTE = new RegExp(byte, 'g')\nexports.NUMERIC = new RegExp(numeric, 'g')\nexports.ALPHANUMERIC = new RegExp(alphanumeric, 'g')\n\nconst TEST_KANJI = new RegExp('^' + kanji + '$')\nconst TEST_NUMERIC = new RegExp('^' + numeric + '$')\nconst TEST_ALPHANUMERIC = new RegExp('^[A-Z0-9 $%*+\\\\-./:]+$')\n\nexports.testKanji = function testKanji (str) {\n return TEST_KANJI.test(str)\n}\n\nexports.testNumeric = function testNumeric (str) {\n return TEST_NUMERIC.test(str)\n}\n\nexports.testAlphanumeric = function testAlphanumeric (str) {\n return TEST_ALPHANUMERIC.test(str)\n}\n","const VersionCheck = require('./version-check')\nconst Regex = require('./regex')\n\n/**\n * Numeric mode encodes data from the decimal digit set (0 - 9)\n * (byte values 30HEX to 39HEX).\n * Normally, 3 data characters are represented by 10 bits.\n *\n * @type {Object}\n */\nexports.NUMERIC = {\n id: 'Numeric',\n bit: 1 << 0,\n ccBits: [10, 12, 14]\n}\n\n/**\n * Alphanumeric mode encodes data from a set of 45 characters,\n * i.e. 10 numeric digits (0 - 9),\n * 26 alphabetic characters (A - Z),\n * and 9 symbols (SP, $, %, *, +, -, ., /, :).\n * Normally, two input characters are represented by 11 bits.\n *\n * @type {Object}\n */\nexports.ALPHANUMERIC = {\n id: 'Alphanumeric',\n bit: 1 << 1,\n ccBits: [9, 11, 13]\n}\n\n/**\n * In byte mode, data is encoded at 8 bits per character.\n *\n * @type {Object}\n */\nexports.BYTE = {\n id: 'Byte',\n bit: 1 << 2,\n ccBits: [8, 16, 16]\n}\n\n/**\n * The Kanji mode efficiently encodes Kanji characters in accordance with\n * the Shift JIS system based on JIS X 0208.\n * The Shift JIS values are shifted from the JIS X 0208 values.\n * JIS X 0208 gives details of the shift coded representation.\n * Each two-byte character value is compacted to a 13-bit binary codeword.\n *\n * @type {Object}\n */\nexports.KANJI = {\n id: 'Kanji',\n bit: 1 << 3,\n ccBits: [8, 10, 12]\n}\n\n/**\n * Mixed mode will contain a sequences of data in a combination of any of\n * the modes described above\n *\n * @type {Object}\n */\nexports.MIXED = {\n bit: -1\n}\n\n/**\n * Returns the number of bits needed to store the data length\n * according to QR Code specifications.\n *\n * @param {Mode} mode Data mode\n * @param {Number} version QR Code version\n * @return {Number} Number of bits\n */\nexports.getCharCountIndicator = function getCharCountIndicator (mode, version) {\n if (!mode.ccBits) throw new Error('Invalid mode: ' + mode)\n\n if (!VersionCheck.isValid(version)) {\n throw new Error('Invalid version: ' + version)\n }\n\n if (version >= 1 && version < 10) return mode.ccBits[0]\n else if (version < 27) return mode.ccBits[1]\n return mode.ccBits[2]\n}\n\n/**\n * Returns the most efficient mode to store the specified data\n *\n * @param {String} dataStr Input data string\n * @return {Mode} Best mode\n */\nexports.getBestModeForData = function getBestModeForData (dataStr) {\n if (Regex.testNumeric(dataStr)) return exports.NUMERIC\n else if (Regex.testAlphanumeric(dataStr)) return exports.ALPHANUMERIC\n else if (Regex.testKanji(dataStr)) return exports.KANJI\n else return exports.BYTE\n}\n\n/**\n * Return mode name as string\n *\n * @param {Mode} mode Mode object\n * @returns {String} Mode name\n */\nexports.toString = function toString (mode) {\n if (mode && mode.id) return mode.id\n throw new Error('Invalid mode')\n}\n\n/**\n * Check if input param is a valid mode object\n *\n * @param {Mode} mode Mode object\n * @returns {Boolean} True if valid mode, false otherwise\n */\nexports.isValid = function isValid (mode) {\n return mode && mode.bit && mode.ccBits\n}\n\n/**\n * Get mode object from its name\n *\n * @param {String} string Mode name\n * @returns {Mode} Mode object\n */\nfunction fromString (string) {\n if (typeof string !== 'string') {\n throw new Error('Param is not a string')\n }\n\n const lcStr = string.toLowerCase()\n\n switch (lcStr) {\n case 'numeric':\n return exports.NUMERIC\n case 'alphanumeric':\n return exports.ALPHANUMERIC\n case 'kanji':\n return exports.KANJI\n case 'byte':\n return exports.BYTE\n default:\n throw new Error('Unknown mode: ' + string)\n }\n}\n\n/**\n * Returns mode from a value.\n * If value is not a valid mode, returns defaultValue\n *\n * @param {Mode|String} value Encoding mode\n * @param {Mode} defaultValue Fallback value\n * @return {Mode} Encoding mode\n */\nexports.from = function from (value, defaultValue) {\n if (exports.isValid(value)) {\n return value\n }\n\n try {\n return fromString(value)\n } catch (e) {\n return defaultValue\n }\n}\n","const Utils = require('./utils')\nconst ECCode = require('./error-correction-code')\nconst ECLevel = require('./error-correction-level')\nconst Mode = require('./mode')\nconst VersionCheck = require('./version-check')\n\n// Generator polynomial used to encode version information\nconst G18 = (1 << 12) | (1 << 11) | (1 << 10) | (1 << 9) | (1 << 8) | (1 << 5) | (1 << 2) | (1 << 0)\nconst G18_BCH = Utils.getBCHDigit(G18)\n\nfunction getBestVersionForDataLength (mode, length, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, mode)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\nfunction getReservedBitsCount (mode, version) {\n // Character count indicator + mode indicator bits\n return Mode.getCharCountIndicator(mode, version) + 4\n}\n\nfunction getTotalBitsFromDataArray (segments, version) {\n let totalBits = 0\n\n segments.forEach(function (data) {\n const reservedBits = getReservedBitsCount(data.mode, version)\n totalBits += reservedBits + data.getBitsLength()\n })\n\n return totalBits\n}\n\nfunction getBestVersionForMixedData (segments, errorCorrectionLevel) {\n for (let currentVersion = 1; currentVersion <= 40; currentVersion++) {\n const length = getTotalBitsFromDataArray(segments, currentVersion)\n if (length <= exports.getCapacity(currentVersion, errorCorrectionLevel, Mode.MIXED)) {\n return currentVersion\n }\n }\n\n return undefined\n}\n\n/**\n * Returns version number from a value.\n * If value is not a valid version, returns defaultValue\n *\n * @param {Number|String} value QR Code version\n * @param {Number} defaultValue Fallback value\n * @return {Number} QR Code version number\n */\nexports.from = function from (value, defaultValue) {\n if (VersionCheck.isValid(value)) {\n return parseInt(value, 10)\n }\n\n return defaultValue\n}\n\n/**\n * Returns how much data can be stored with the specified QR code version\n * and error correction level\n *\n * @param {Number} version QR Code version (1-40)\n * @param {Number} errorCorrectionLevel Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} Quantity of storable data\n */\nexports.getCapacity = function getCapacity (version, errorCorrectionLevel, mode) {\n if (!VersionCheck.isValid(version)) {\n throw new Error('Invalid QR Code version')\n }\n\n // Use Byte mode as default\n if (typeof mode === 'undefined') mode = Mode.BYTE\n\n // Total codewords for this QR code version (Data + Error correction)\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n // Total number of error correction codewords\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n // Total number of data codewords\n const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n if (mode === Mode.MIXED) return dataTotalCodewordsBits\n\n const usableBits = dataTotalCodewordsBits - getReservedBitsCount(mode, version)\n\n // Return max number of storable codewords\n switch (mode) {\n case Mode.NUMERIC:\n return Math.floor((usableBits / 10) * 3)\n\n case Mode.ALPHANUMERIC:\n return Math.floor((usableBits / 11) * 2)\n\n case Mode.KANJI:\n return Math.floor(usableBits / 13)\n\n case Mode.BYTE:\n default:\n return Math.floor(usableBits / 8)\n }\n}\n\n/**\n * Returns the minimum version needed to contain the amount of data\n *\n * @param {Segment} data Segment of data\n * @param {Number} [errorCorrectionLevel=H] Error correction level\n * @param {Mode} mode Data mode\n * @return {Number} QR Code version\n */\nexports.getBestVersionForData = function getBestVersionForData (data, errorCorrectionLevel) {\n let seg\n\n const ecl = ECLevel.from(errorCorrectionLevel, ECLevel.M)\n\n if (Array.isArray(data)) {\n if (data.length > 1) {\n return getBestVersionForMixedData(data, ecl)\n }\n\n if (data.length === 0) {\n return 1\n }\n\n seg = data[0]\n } else {\n seg = data\n }\n\n return getBestVersionForDataLength(seg.mode, seg.getLength(), ecl)\n}\n\n/**\n * Returns version information with relative error correction bits\n *\n * The version information is included in QR Code symbols of version 7 or larger.\n * It consists of an 18-bit sequence containing 6 data bits,\n * with 12 error correction bits calculated using the (18, 6) Golay code.\n *\n * @param {Number} version QR Code version\n * @return {Number} Encoded version info bits\n */\nexports.getEncodedBits = function getEncodedBits (version) {\n if (!VersionCheck.isValid(version) || version < 7) {\n throw new Error('Invalid QR Code version')\n }\n\n let d = version << 12\n\n while (Utils.getBCHDigit(d) - G18_BCH >= 0) {\n d ^= (G18 << (Utils.getBCHDigit(d) - G18_BCH))\n }\n\n return (version << 12) | d\n}\n","const Utils = require('./utils')\n\nconst G15 = (1 << 10) | (1 << 8) | (1 << 5) | (1 << 4) | (1 << 2) | (1 << 1) | (1 << 0)\nconst G15_MASK = (1 << 14) | (1 << 12) | (1 << 10) | (1 << 4) | (1 << 1)\nconst G15_BCH = Utils.getBCHDigit(G15)\n\n/**\n * Returns format information with relative error correction bits\n *\n * The format information is a 15-bit sequence containing 5 data bits,\n * with 10 error correction bits calculated using the (15, 5) BCH code.\n *\n * @param {Number} errorCorrectionLevel Error correction level\n * @param {Number} mask Mask pattern\n * @return {Number} Encoded format information bits\n */\nexports.getEncodedBits = function getEncodedBits (errorCorrectionLevel, mask) {\n const data = ((errorCorrectionLevel.bit << 3) | mask)\n let d = data << 10\n\n while (Utils.getBCHDigit(d) - G15_BCH >= 0) {\n d ^= (G15 << (Utils.getBCHDigit(d) - G15_BCH))\n }\n\n // xor final data with mask pattern in order to ensure that\n // no combination of Error Correction Level and data mask pattern\n // will result in an all-zero data string\n return ((data << 10) | d) ^ G15_MASK\n}\n","const Mode = require('./mode')\n\nfunction NumericData (data) {\n this.mode = Mode.NUMERIC\n this.data = data.toString()\n}\n\nNumericData.getBitsLength = function getBitsLength (length) {\n return 10 * Math.floor(length / 3) + ((length % 3) ? ((length % 3) * 3 + 1) : 0)\n}\n\nNumericData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nNumericData.prototype.getBitsLength = function getBitsLength () {\n return NumericData.getBitsLength(this.data.length)\n}\n\nNumericData.prototype.write = function write (bitBuffer) {\n let i, group, value\n\n // The input data string is divided into groups of three digits,\n // and each group is converted to its 10-bit binary equivalent.\n for (i = 0; i + 3 <= this.data.length; i += 3) {\n group = this.data.substr(i, 3)\n value = parseInt(group, 10)\n\n bitBuffer.put(value, 10)\n }\n\n // If the number of input digits is not an exact multiple of three,\n // the final one or two digits are converted to 4 or 7 bits respectively.\n const remainingNum = this.data.length - i\n if (remainingNum > 0) {\n group = this.data.substr(i)\n value = parseInt(group, 10)\n\n bitBuffer.put(value, remainingNum * 3 + 1)\n }\n}\n\nmodule.exports = NumericData\n","const Mode = require('./mode')\n\n/**\n * Array of characters available in alphanumeric mode\n *\n * As per QR Code specification, to each character\n * is assigned a value from 0 to 44 which in this case coincides\n * with the array index\n *\n * @type {Array}\n */\nconst ALPHA_NUM_CHARS = [\n '0', '1', '2', '3', '4', '5', '6', '7', '8', '9',\n 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M',\n 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z',\n ' ', '$', '%', '*', '+', '-', '.', '/', ':'\n]\n\nfunction AlphanumericData (data) {\n this.mode = Mode.ALPHANUMERIC\n this.data = data\n}\n\nAlphanumericData.getBitsLength = function getBitsLength (length) {\n return 11 * Math.floor(length / 2) + 6 * (length % 2)\n}\n\nAlphanumericData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nAlphanumericData.prototype.getBitsLength = function getBitsLength () {\n return AlphanumericData.getBitsLength(this.data.length)\n}\n\nAlphanumericData.prototype.write = function write (bitBuffer) {\n let i\n\n // Input data characters are divided into groups of two characters\n // and encoded as 11-bit binary codes.\n for (i = 0; i + 2 <= this.data.length; i += 2) {\n // The character value of the first character is multiplied by 45\n let value = ALPHA_NUM_CHARS.indexOf(this.data[i]) * 45\n\n // The character value of the second digit is added to the product\n value += ALPHA_NUM_CHARS.indexOf(this.data[i + 1])\n\n // The sum is then stored as 11-bit binary number\n bitBuffer.put(value, 11)\n }\n\n // If the number of input data characters is not a multiple of two,\n // the character value of the final character is encoded as a 6-bit binary number.\n if (this.data.length % 2) {\n bitBuffer.put(ALPHA_NUM_CHARS.indexOf(this.data[i]), 6)\n }\n}\n\nmodule.exports = AlphanumericData\n","'use strict'\n\nmodule.exports = function encodeUtf8 (input) {\n var result = []\n var size = input.length\n\n for (var index = 0; index < size; index++) {\n var point = input.charCodeAt(index)\n\n if (point >= 0xD800 && point <= 0xDBFF && size > index + 1) {\n var second = input.charCodeAt(index + 1)\n\n if (second >= 0xDC00 && second <= 0xDFFF) {\n // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae\n point = (point - 0xD800) * 0x400 + second - 0xDC00 + 0x10000\n index += 1\n }\n }\n\n // US-ASCII\n if (point < 0x80) {\n result.push(point)\n continue\n }\n\n // 2-byte UTF-8\n if (point < 0x800) {\n result.push((point >> 6) | 192)\n result.push((point & 63) | 128)\n continue\n }\n\n // 3-byte UTF-8\n if (point < 0xD800 || (point >= 0xE000 && point < 0x10000)) {\n result.push((point >> 12) | 224)\n result.push(((point >> 6) & 63) | 128)\n result.push((point & 63) | 128)\n continue\n }\n\n // 4-byte UTF-8\n if (point >= 0x10000 && point <= 0x10FFFF) {\n result.push((point >> 18) | 240)\n result.push(((point >> 12) & 63) | 128)\n result.push(((point >> 6) & 63) | 128)\n result.push((point & 63) | 128)\n continue\n }\n\n // Invalid character\n result.push(0xEF, 0xBF, 0xBD)\n }\n\n return new Uint8Array(result).buffer\n}\n","const encodeUtf8 = require('encode-utf8')\nconst Mode = require('./mode')\n\nfunction ByteData (data) {\n this.mode = Mode.BYTE\n this.data = new Uint8Array(encodeUtf8(data))\n}\n\nByteData.getBitsLength = function getBitsLength (length) {\n return length * 8\n}\n\nByteData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nByteData.prototype.getBitsLength = function getBitsLength () {\n return ByteData.getBitsLength(this.data.length)\n}\n\nByteData.prototype.write = function (bitBuffer) {\n for (let i = 0, l = this.data.length; i < l; i++) {\n bitBuffer.put(this.data[i], 8)\n }\n}\n\nmodule.exports = ByteData\n","const Mode = require('./mode')\nconst Utils = require('./utils')\n\nfunction KanjiData (data) {\n this.mode = Mode.KANJI\n this.data = data\n}\n\nKanjiData.getBitsLength = function getBitsLength (length) {\n return length * 13\n}\n\nKanjiData.prototype.getLength = function getLength () {\n return this.data.length\n}\n\nKanjiData.prototype.getBitsLength = function getBitsLength () {\n return KanjiData.getBitsLength(this.data.length)\n}\n\nKanjiData.prototype.write = function (bitBuffer) {\n let i\n\n // In the Shift JIS system, Kanji characters are represented by a two byte combination.\n // These byte values are shifted from the JIS X 0208 values.\n // JIS X 0208 gives details of the shift coded representation.\n for (i = 0; i < this.data.length; i++) {\n let value = Utils.toSJIS(this.data[i])\n\n // For characters with Shift JIS values from 0x8140 to 0x9FFC:\n if (value >= 0x8140 && value <= 0x9FFC) {\n // Subtract 0x8140 from Shift JIS value\n value -= 0x8140\n\n // For characters with Shift JIS values from 0xE040 to 0xEBBF\n } else if (value >= 0xE040 && value <= 0xEBBF) {\n // Subtract 0xC140 from Shift JIS value\n value -= 0xC140\n } else {\n throw new Error(\n 'Invalid SJIS character: ' + this.data[i] + '\\n' +\n 'Make sure your charset is UTF-8')\n }\n\n // Multiply most significant byte of result by 0xC0\n // and add least significant byte to product\n value = (((value >>> 8) & 0xff) * 0xC0) + (value & 0xff)\n\n // Convert result to a 13-bit binary string\n bitBuffer.put(value, 13)\n }\n}\n\nmodule.exports = KanjiData\n","'use strict';\n\n/******************************************************************************\n * Created 2008-08-19.\n *\n * Dijkstra path-finding functions. Adapted from the Dijkstar Python project.\n *\n * Copyright (C) 2008\n * Wyatt Baldwin \n * All rights reserved\n *\n * Licensed under the MIT license.\n *\n * http://www.opensource.org/licenses/mit-license.php\n *\n * THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n * THE SOFTWARE.\n *****************************************************************************/\nvar dijkstra = {\n single_source_shortest_paths: function(graph, s, d) {\n // Predecessor map for each node that has been encountered.\n // node ID => predecessor node ID\n var predecessors = {};\n\n // Costs of shortest paths from s to all nodes encountered.\n // node ID => cost\n var costs = {};\n costs[s] = 0;\n\n // Costs of shortest paths from s to all nodes encountered; differs from\n // `costs` in that it provides easy access to the node that currently has\n // the known shortest path from s.\n // XXX: Do we actually need both `costs` and `open`?\n var open = dijkstra.PriorityQueue.make();\n open.push(s, 0);\n\n var closest,\n u, v,\n cost_of_s_to_u,\n adjacent_nodes,\n cost_of_e,\n cost_of_s_to_u_plus_cost_of_e,\n cost_of_s_to_v,\n first_visit;\n while (!open.empty()) {\n // In the nodes remaining in graph that have a known cost from s,\n // find the node, u, that currently has the shortest path from s.\n closest = open.pop();\n u = closest.value;\n cost_of_s_to_u = closest.cost;\n\n // Get nodes adjacent to u...\n adjacent_nodes = graph[u] || {};\n\n // ...and explore the edges that connect u to those nodes, updating\n // the cost of the shortest paths to any or all of those nodes as\n // necessary. v is the node across the current edge from u.\n for (v in adjacent_nodes) {\n if (adjacent_nodes.hasOwnProperty(v)) {\n // Get the cost of the edge running from u to v.\n cost_of_e = adjacent_nodes[v];\n\n // Cost of s to u plus the cost of u to v across e--this is *a*\n // cost from s to v that may or may not be less than the current\n // known cost to v.\n cost_of_s_to_u_plus_cost_of_e = cost_of_s_to_u + cost_of_e;\n\n // If we haven't visited v yet OR if the current known cost from s to\n // v is greater than the new cost we just found (cost of s to u plus\n // cost of u to v across e), update v's cost in the cost list and\n // update v's predecessor in the predecessor list (it's now u).\n cost_of_s_to_v = costs[v];\n first_visit = (typeof costs[v] === 'undefined');\n if (first_visit || cost_of_s_to_v > cost_of_s_to_u_plus_cost_of_e) {\n costs[v] = cost_of_s_to_u_plus_cost_of_e;\n open.push(v, cost_of_s_to_u_plus_cost_of_e);\n predecessors[v] = u;\n }\n }\n }\n }\n\n if (typeof d !== 'undefined' && typeof costs[d] === 'undefined') {\n var msg = ['Could not find a path from ', s, ' to ', d, '.'].join('');\n throw new Error(msg);\n }\n\n return predecessors;\n },\n\n extract_shortest_path_from_predecessor_list: function(predecessors, d) {\n var nodes = [];\n var u = d;\n var predecessor;\n while (u) {\n nodes.push(u);\n predecessor = predecessors[u];\n u = predecessors[u];\n }\n nodes.reverse();\n return nodes;\n },\n\n find_path: function(graph, s, d) {\n var predecessors = dijkstra.single_source_shortest_paths(graph, s, d);\n return dijkstra.extract_shortest_path_from_predecessor_list(\n predecessors, d);\n },\n\n /**\n * A very naive priority queue implementation.\n */\n PriorityQueue: {\n make: function (opts) {\n var T = dijkstra.PriorityQueue,\n t = {},\n key;\n opts = opts || {};\n for (key in T) {\n if (T.hasOwnProperty(key)) {\n t[key] = T[key];\n }\n }\n t.queue = [];\n t.sorter = opts.sorter || T.default_sorter;\n return t;\n },\n\n default_sorter: function (a, b) {\n return a.cost - b.cost;\n },\n\n /**\n * Add a new item to the queue and ensure the highest priority element\n * is at the front of the queue.\n */\n push: function (value, cost) {\n var item = {value: value, cost: cost};\n this.queue.push(item);\n this.queue.sort(this.sorter);\n },\n\n /**\n * Return the highest priority element in the queue.\n */\n pop: function () {\n return this.queue.shift();\n },\n\n empty: function () {\n return this.queue.length === 0;\n }\n }\n};\n\n\n// node.js module exports\nif (typeof module !== 'undefined') {\n module.exports = dijkstra;\n}\n","const Mode = require('./mode')\nconst NumericData = require('./numeric-data')\nconst AlphanumericData = require('./alphanumeric-data')\nconst ByteData = require('./byte-data')\nconst KanjiData = require('./kanji-data')\nconst Regex = require('./regex')\nconst Utils = require('./utils')\nconst dijkstra = require('dijkstrajs')\n\n/**\n * Returns UTF8 byte length\n *\n * @param {String} str Input string\n * @return {Number} Number of byte\n */\nfunction getStringByteLength (str) {\n return unescape(encodeURIComponent(str)).length\n}\n\n/**\n * Get a list of segments of the specified mode\n * from a string\n *\n * @param {Mode} mode Segment mode\n * @param {String} str String to process\n * @return {Array} Array of object with segments data\n */\nfunction getSegments (regex, mode, str) {\n const segments = []\n let result\n\n while ((result = regex.exec(str)) !== null) {\n segments.push({\n data: result[0],\n index: result.index,\n mode: mode,\n length: result[0].length\n })\n }\n\n return segments\n}\n\n/**\n * Extracts a series of segments with the appropriate\n * modes from a string\n *\n * @param {String} dataStr Input string\n * @return {Array} Array of object with segments data\n */\nfunction getSegmentsFromString (dataStr) {\n const numSegs = getSegments(Regex.NUMERIC, Mode.NUMERIC, dataStr)\n const alphaNumSegs = getSegments(Regex.ALPHANUMERIC, Mode.ALPHANUMERIC, dataStr)\n let byteSegs\n let kanjiSegs\n\n if (Utils.isKanjiModeEnabled()) {\n byteSegs = getSegments(Regex.BYTE, Mode.BYTE, dataStr)\n kanjiSegs = getSegments(Regex.KANJI, Mode.KANJI, dataStr)\n } else {\n byteSegs = getSegments(Regex.BYTE_KANJI, Mode.BYTE, dataStr)\n kanjiSegs = []\n }\n\n const segs = numSegs.concat(alphaNumSegs, byteSegs, kanjiSegs)\n\n return segs\n .sort(function (s1, s2) {\n return s1.index - s2.index\n })\n .map(function (obj) {\n return {\n data: obj.data,\n mode: obj.mode,\n length: obj.length\n }\n })\n}\n\n/**\n * Returns how many bits are needed to encode a string of\n * specified length with the specified mode\n *\n * @param {Number} length String length\n * @param {Mode} mode Segment mode\n * @return {Number} Bit length\n */\nfunction getSegmentBitsLength (length, mode) {\n switch (mode) {\n case Mode.NUMERIC:\n return NumericData.getBitsLength(length)\n case Mode.ALPHANUMERIC:\n return AlphanumericData.getBitsLength(length)\n case Mode.KANJI:\n return KanjiData.getBitsLength(length)\n case Mode.BYTE:\n return ByteData.getBitsLength(length)\n }\n}\n\n/**\n * Merges adjacent segments which have the same mode\n *\n * @param {Array} segs Array of object with segments data\n * @return {Array} Array of object with segments data\n */\nfunction mergeSegments (segs) {\n return segs.reduce(function (acc, curr) {\n const prevSeg = acc.length - 1 >= 0 ? acc[acc.length - 1] : null\n if (prevSeg && prevSeg.mode === curr.mode) {\n acc[acc.length - 1].data += curr.data\n return acc\n }\n\n acc.push(curr)\n return acc\n }, [])\n}\n\n/**\n * Generates a list of all possible nodes combination which\n * will be used to build a segments graph.\n *\n * Nodes are divided by groups. Each group will contain a list of all the modes\n * in which is possible to encode the given text.\n *\n * For example the text '12345' can be encoded as Numeric, Alphanumeric or Byte.\n * The group for '12345' will contain then 3 objects, one for each\n * possible encoding mode.\n *\n * Each node represents a possible segment.\n *\n * @param {Array} segs Array of object with segments data\n * @return {Array} Array of object with segments data\n */\nfunction buildNodes (segs) {\n const nodes = []\n for (let i = 0; i < segs.length; i++) {\n const seg = segs[i]\n\n switch (seg.mode) {\n case Mode.NUMERIC:\n nodes.push([seg,\n { data: seg.data, mode: Mode.ALPHANUMERIC, length: seg.length },\n { data: seg.data, mode: Mode.BYTE, length: seg.length }\n ])\n break\n case Mode.ALPHANUMERIC:\n nodes.push([seg,\n { data: seg.data, mode: Mode.BYTE, length: seg.length }\n ])\n break\n case Mode.KANJI:\n nodes.push([seg,\n { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n ])\n break\n case Mode.BYTE:\n nodes.push([\n { data: seg.data, mode: Mode.BYTE, length: getStringByteLength(seg.data) }\n ])\n }\n }\n\n return nodes\n}\n\n/**\n * Builds a graph from a list of nodes.\n * All segments in each node group will be connected with all the segments of\n * the next group and so on.\n *\n * At each connection will be assigned a weight depending on the\n * segment's byte length.\n *\n * @param {Array} nodes Array of object with segments data\n * @param {Number} version QR Code version\n * @return {Object} Graph of all possible segments\n */\nfunction buildGraph (nodes, version) {\n const table = {}\n const graph = { start: {} }\n let prevNodeIds = ['start']\n\n for (let i = 0; i < nodes.length; i++) {\n const nodeGroup = nodes[i]\n const currentNodeIds = []\n\n for (let j = 0; j < nodeGroup.length; j++) {\n const node = nodeGroup[j]\n const key = '' + i + j\n\n currentNodeIds.push(key)\n table[key] = { node: node, lastCount: 0 }\n graph[key] = {}\n\n for (let n = 0; n < prevNodeIds.length; n++) {\n const prevNodeId = prevNodeIds[n]\n\n if (table[prevNodeId] && table[prevNodeId].node.mode === node.mode) {\n graph[prevNodeId][key] =\n getSegmentBitsLength(table[prevNodeId].lastCount + node.length, node.mode) -\n getSegmentBitsLength(table[prevNodeId].lastCount, node.mode)\n\n table[prevNodeId].lastCount += node.length\n } else {\n if (table[prevNodeId]) table[prevNodeId].lastCount = node.length\n\n graph[prevNodeId][key] = getSegmentBitsLength(node.length, node.mode) +\n 4 + Mode.getCharCountIndicator(node.mode, version) // switch cost\n }\n }\n }\n\n prevNodeIds = currentNodeIds\n }\n\n for (let n = 0; n < prevNodeIds.length; n++) {\n graph[prevNodeIds[n]].end = 0\n }\n\n return { map: graph, table: table }\n}\n\n/**\n * Builds a segment from a specified data and mode.\n * If a mode is not specified, the more suitable will be used.\n *\n * @param {String} data Input data\n * @param {Mode | String} modesHint Data mode\n * @return {Segment} Segment\n */\nfunction buildSingleSegment (data, modesHint) {\n let mode\n const bestMode = Mode.getBestModeForData(data)\n\n mode = Mode.from(modesHint, bestMode)\n\n // Make sure data can be encoded\n if (mode !== Mode.BYTE && mode.bit < bestMode.bit) {\n throw new Error('\"' + data + '\"' +\n ' cannot be encoded with mode ' + Mode.toString(mode) +\n '.\\n Suggested mode is: ' + Mode.toString(bestMode))\n }\n\n // Use Mode.BYTE if Kanji support is disabled\n if (mode === Mode.KANJI && !Utils.isKanjiModeEnabled()) {\n mode = Mode.BYTE\n }\n\n switch (mode) {\n case Mode.NUMERIC:\n return new NumericData(data)\n\n case Mode.ALPHANUMERIC:\n return new AlphanumericData(data)\n\n case Mode.KANJI:\n return new KanjiData(data)\n\n case Mode.BYTE:\n return new ByteData(data)\n }\n}\n\n/**\n * Builds a list of segments from an array.\n * Array can contain Strings or Objects with segment's info.\n *\n * For each item which is a string, will be generated a segment with the given\n * string and the more appropriate encoding mode.\n *\n * For each item which is an object, will be generated a segment with the given\n * data and mode.\n * Objects must contain at least the property \"data\".\n * If property \"mode\" is not present, the more suitable mode will be used.\n *\n * @param {Array} array Array of objects with segments data\n * @return {Array} Array of Segments\n */\nexports.fromArray = function fromArray (array) {\n return array.reduce(function (acc, seg) {\n if (typeof seg === 'string') {\n acc.push(buildSingleSegment(seg, null))\n } else if (seg.data) {\n acc.push(buildSingleSegment(seg.data, seg.mode))\n }\n\n return acc\n }, [])\n}\n\n/**\n * Builds an optimized sequence of segments from a string,\n * which will produce the shortest possible bitstream.\n *\n * @param {String} data Input string\n * @param {Number} version QR Code version\n * @return {Array} Array of segments\n */\nexports.fromString = function fromString (data, version) {\n const segs = getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n\n const nodes = buildNodes(segs)\n const graph = buildGraph(nodes, version)\n const path = dijkstra.find_path(graph.map, 'start', 'end')\n\n const optimizedSegs = []\n for (let i = 1; i < path.length - 1; i++) {\n optimizedSegs.push(graph.table[path[i]].node)\n }\n\n return exports.fromArray(mergeSegments(optimizedSegs))\n}\n\n/**\n * Splits a string in various segments with the modes which\n * best represent their content.\n * The produced segments are far from being optimized.\n * The output of this function is only used to estimate a QR Code version\n * which may contain the data.\n *\n * @param {string} data Input string\n * @return {Array} Array of segments\n */\nexports.rawSplit = function rawSplit (data) {\n return exports.fromArray(\n getSegmentsFromString(data, Utils.isKanjiModeEnabled())\n )\n}\n","const Utils = require('./utils')\nconst ECLevel = require('./error-correction-level')\nconst BitBuffer = require('./bit-buffer')\nconst BitMatrix = require('./bit-matrix')\nconst AlignmentPattern = require('./alignment-pattern')\nconst FinderPattern = require('./finder-pattern')\nconst MaskPattern = require('./mask-pattern')\nconst ECCode = require('./error-correction-code')\nconst ReedSolomonEncoder = require('./reed-solomon-encoder')\nconst Version = require('./version')\nconst FormatInfo = require('./format-info')\nconst Mode = require('./mode')\nconst Segments = require('./segments')\n\n/**\n * QRCode for JavaScript\n *\n * modified by Ryan Day for nodejs support\n * Copyright (c) 2011 Ryan Day\n *\n * Licensed under the MIT license:\n * http://www.opensource.org/licenses/mit-license.php\n *\n//---------------------------------------------------------------------\n// QRCode for JavaScript\n//\n// Copyright (c) 2009 Kazuhiko Arase\n//\n// URL: http://www.d-project.com/\n//\n// Licensed under the MIT license:\n// http://www.opensource.org/licenses/mit-license.php\n//\n// The word \"QR Code\" is registered trademark of\n// DENSO WAVE INCORPORATED\n// http://www.denso-wave.com/qrcode/faqpatent-e.html\n//\n//---------------------------------------------------------------------\n*/\n\n/**\n * Add finder patterns bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupFinderPattern (matrix, version) {\n const size = matrix.size\n const pos = FinderPattern.getPositions(version)\n\n for (let i = 0; i < pos.length; i++) {\n const row = pos[i][0]\n const col = pos[i][1]\n\n for (let r = -1; r <= 7; r++) {\n if (row + r <= -1 || size <= row + r) continue\n\n for (let c = -1; c <= 7; c++) {\n if (col + c <= -1 || size <= col + c) continue\n\n if ((r >= 0 && r <= 6 && (c === 0 || c === 6)) ||\n (c >= 0 && c <= 6 && (r === 0 || r === 6)) ||\n (r >= 2 && r <= 4 && c >= 2 && c <= 4)) {\n matrix.set(row + r, col + c, true, true)\n } else {\n matrix.set(row + r, col + c, false, true)\n }\n }\n }\n }\n}\n\n/**\n * Add timing pattern bits to matrix\n *\n * Note: this function must be called before {@link setupAlignmentPattern}\n *\n * @param {BitMatrix} matrix Modules matrix\n */\nfunction setupTimingPattern (matrix) {\n const size = matrix.size\n\n for (let r = 8; r < size - 8; r++) {\n const value = r % 2 === 0\n matrix.set(r, 6, value, true)\n matrix.set(6, r, value, true)\n }\n}\n\n/**\n * Add alignment patterns bits to matrix\n *\n * Note: this function must be called after {@link setupTimingPattern}\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupAlignmentPattern (matrix, version) {\n const pos = AlignmentPattern.getPositions(version)\n\n for (let i = 0; i < pos.length; i++) {\n const row = pos[i][0]\n const col = pos[i][1]\n\n for (let r = -2; r <= 2; r++) {\n for (let c = -2; c <= 2; c++) {\n if (r === -2 || r === 2 || c === -2 || c === 2 ||\n (r === 0 && c === 0)) {\n matrix.set(row + r, col + c, true, true)\n } else {\n matrix.set(row + r, col + c, false, true)\n }\n }\n }\n }\n}\n\n/**\n * Add version info bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Number} version QR Code version\n */\nfunction setupVersionInfo (matrix, version) {\n const size = matrix.size\n const bits = Version.getEncodedBits(version)\n let row, col, mod\n\n for (let i = 0; i < 18; i++) {\n row = Math.floor(i / 3)\n col = i % 3 + size - 8 - 3\n mod = ((bits >> i) & 1) === 1\n\n matrix.set(row, col, mod, true)\n matrix.set(col, row, mod, true)\n }\n}\n\n/**\n * Add format info bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @param {Number} maskPattern Mask pattern reference value\n */\nfunction setupFormatInfo (matrix, errorCorrectionLevel, maskPattern) {\n const size = matrix.size\n const bits = FormatInfo.getEncodedBits(errorCorrectionLevel, maskPattern)\n let i, mod\n\n for (i = 0; i < 15; i++) {\n mod = ((bits >> i) & 1) === 1\n\n // vertical\n if (i < 6) {\n matrix.set(i, 8, mod, true)\n } else if (i < 8) {\n matrix.set(i + 1, 8, mod, true)\n } else {\n matrix.set(size - 15 + i, 8, mod, true)\n }\n\n // horizontal\n if (i < 8) {\n matrix.set(8, size - i - 1, mod, true)\n } else if (i < 9) {\n matrix.set(8, 15 - i - 1 + 1, mod, true)\n } else {\n matrix.set(8, 15 - i - 1, mod, true)\n }\n }\n\n // fixed module\n matrix.set(size - 8, 8, 1, true)\n}\n\n/**\n * Add encoded data bits to matrix\n *\n * @param {BitMatrix} matrix Modules matrix\n * @param {Uint8Array} data Data codewords\n */\nfunction setupData (matrix, data) {\n const size = matrix.size\n let inc = -1\n let row = size - 1\n let bitIndex = 7\n let byteIndex = 0\n\n for (let col = size - 1; col > 0; col -= 2) {\n if (col === 6) col--\n\n while (true) {\n for (let c = 0; c < 2; c++) {\n if (!matrix.isReserved(row, col - c)) {\n let dark = false\n\n if (byteIndex < data.length) {\n dark = (((data[byteIndex] >>> bitIndex) & 1) === 1)\n }\n\n matrix.set(row, col - c, dark)\n bitIndex--\n\n if (bitIndex === -1) {\n byteIndex++\n bitIndex = 7\n }\n }\n }\n\n row += inc\n\n if (row < 0 || size <= row) {\n row -= inc\n inc = -inc\n break\n }\n }\n }\n}\n\n/**\n * Create encoded codewords from data input\n *\n * @param {Number} version QR Code version\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @param {ByteData} data Data input\n * @return {Uint8Array} Buffer containing encoded codewords\n */\nfunction createData (version, errorCorrectionLevel, segments) {\n // Prepare data buffer\n const buffer = new BitBuffer()\n\n segments.forEach(function (data) {\n // prefix data with mode indicator (4 bits)\n buffer.put(data.mode.bit, 4)\n\n // Prefix data with character count indicator.\n // The character count indicator is a string of bits that represents the\n // number of characters that are being encoded.\n // The character count indicator must be placed after the mode indicator\n // and must be a certain number of bits long, depending on the QR version\n // and data mode\n // @see {@link Mode.getCharCountIndicator}.\n buffer.put(data.getLength(), Mode.getCharCountIndicator(data.mode, version))\n\n // add binary data sequence to buffer\n data.write(buffer)\n })\n\n // Calculate required number of bits\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n const dataTotalCodewordsBits = (totalCodewords - ecTotalCodewords) * 8\n\n // Add a terminator.\n // If the bit string is shorter than the total number of required bits,\n // a terminator of up to four 0s must be added to the right side of the string.\n // If the bit string is more than four bits shorter than the required number of bits,\n // add four 0s to the end.\n if (buffer.getLengthInBits() + 4 <= dataTotalCodewordsBits) {\n buffer.put(0, 4)\n }\n\n // If the bit string is fewer than four bits shorter, add only the number of 0s that\n // are needed to reach the required number of bits.\n\n // After adding the terminator, if the number of bits in the string is not a multiple of 8,\n // pad the string on the right with 0s to make the string's length a multiple of 8.\n while (buffer.getLengthInBits() % 8 !== 0) {\n buffer.putBit(0)\n }\n\n // Add pad bytes if the string is still shorter than the total number of required bits.\n // Extend the buffer to fill the data capacity of the symbol corresponding to\n // the Version and Error Correction Level by adding the Pad Codewords 11101100 (0xEC)\n // and 00010001 (0x11) alternately.\n const remainingByte = (dataTotalCodewordsBits - buffer.getLengthInBits()) / 8\n for (let i = 0; i < remainingByte; i++) {\n buffer.put(i % 2 ? 0x11 : 0xEC, 8)\n }\n\n return createCodewords(buffer, version, errorCorrectionLevel)\n}\n\n/**\n * Encode input data with Reed-Solomon and return codewords with\n * relative error correction bits\n *\n * @param {BitBuffer} bitBuffer Data to encode\n * @param {Number} version QR Code version\n * @param {ErrorCorrectionLevel} errorCorrectionLevel Error correction level\n * @return {Uint8Array} Buffer containing encoded codewords\n */\nfunction createCodewords (bitBuffer, version, errorCorrectionLevel) {\n // Total codewords for this QR code version (Data + Error correction)\n const totalCodewords = Utils.getSymbolTotalCodewords(version)\n\n // Total number of error correction codewords\n const ecTotalCodewords = ECCode.getTotalCodewordsCount(version, errorCorrectionLevel)\n\n // Total number of data codewords\n const dataTotalCodewords = totalCodewords - ecTotalCodewords\n\n // Total number of blocks\n const ecTotalBlocks = ECCode.getBlocksCount(version, errorCorrectionLevel)\n\n // Calculate how many blocks each group should contain\n const blocksInGroup2 = totalCodewords % ecTotalBlocks\n const blocksInGroup1 = ecTotalBlocks - blocksInGroup2\n\n const totalCodewordsInGroup1 = Math.floor(totalCodewords / ecTotalBlocks)\n\n const dataCodewordsInGroup1 = Math.floor(dataTotalCodewords / ecTotalBlocks)\n const dataCodewordsInGroup2 = dataCodewordsInGroup1 + 1\n\n // Number of EC codewords is the same for both groups\n const ecCount = totalCodewordsInGroup1 - dataCodewordsInGroup1\n\n // Initialize a Reed-Solomon encoder with a generator polynomial of degree ecCount\n const rs = new ReedSolomonEncoder(ecCount)\n\n let offset = 0\n const dcData = new Array(ecTotalBlocks)\n const ecData = new Array(ecTotalBlocks)\n let maxDataSize = 0\n const buffer = new Uint8Array(bitBuffer.buffer)\n\n // Divide the buffer into the required number of blocks\n for (let b = 0; b < ecTotalBlocks; b++) {\n const dataSize = b < blocksInGroup1 ? dataCodewordsInGroup1 : dataCodewordsInGroup2\n\n // extract a block of data from buffer\n dcData[b] = buffer.slice(offset, offset + dataSize)\n\n // Calculate EC codewords for this data block\n ecData[b] = rs.encode(dcData[b])\n\n offset += dataSize\n maxDataSize = Math.max(maxDataSize, dataSize)\n }\n\n // Create final data\n // Interleave the data and error correction codewords from each block\n const data = new Uint8Array(totalCodewords)\n let index = 0\n let i, r\n\n // Add data codewords\n for (i = 0; i < maxDataSize; i++) {\n for (r = 0; r < ecTotalBlocks; r++) {\n if (i < dcData[r].length) {\n data[index++] = dcData[r][i]\n }\n }\n }\n\n // Apped EC codewords\n for (i = 0; i < ecCount; i++) {\n for (r = 0; r < ecTotalBlocks; r++) {\n data[index++] = ecData[r][i]\n }\n }\n\n return data\n}\n\n/**\n * Build QR Code symbol\n *\n * @param {String} data Input string\n * @param {Number} version QR Code version\n * @param {ErrorCorretionLevel} errorCorrectionLevel Error level\n * @param {MaskPattern} maskPattern Mask pattern\n * @return {Object} Object containing symbol data\n */\nfunction createSymbol (data, version, errorCorrectionLevel, maskPattern) {\n let segments\n\n if (Array.isArray(data)) {\n segments = Segments.fromArray(data)\n } else if (typeof data === 'string') {\n let estimatedVersion = version\n\n if (!estimatedVersion) {\n const rawSegments = Segments.rawSplit(data)\n\n // Estimate best version that can contain raw splitted segments\n estimatedVersion = Version.getBestVersionForData(rawSegments, errorCorrectionLevel)\n }\n\n // Build optimized segments\n // If estimated version is undefined, try with the highest version\n segments = Segments.fromString(data, estimatedVersion || 40)\n } else {\n throw new Error('Invalid data')\n }\n\n // Get the min version that can contain data\n const bestVersion = Version.getBestVersionForData(segments, errorCorrectionLevel)\n\n // If no version is found, data cannot be stored\n if (!bestVersion) {\n throw new Error('The amount of data is too big to be stored in a QR Code')\n }\n\n // If not specified, use min version as default\n if (!version) {\n version = bestVersion\n\n // Check if the specified version can contain the data\n } else if (version < bestVersion) {\n throw new Error('\\n' +\n 'The chosen QR Code version cannot contain this amount of data.\\n' +\n 'Minimum version required to store current data is: ' + bestVersion + '.\\n'\n )\n }\n\n const dataBits = createData(version, errorCorrectionLevel, segments)\n\n // Allocate matrix buffer\n const moduleCount = Utils.getSymbolSize(version)\n const modules = new BitMatrix(moduleCount)\n\n // Add function modules\n setupFinderPattern(modules, version)\n setupTimingPattern(modules)\n setupAlignmentPattern(modules, version)\n\n // Add temporary dummy bits for format info just to set them as reserved.\n // This is needed to prevent these bits from being masked by {@link MaskPattern.applyMask}\n // since the masking operation must be performed only on the encoding region.\n // These blocks will be replaced with correct values later in code.\n setupFormatInfo(modules, errorCorrectionLevel, 0)\n\n if (version >= 7) {\n setupVersionInfo(modules, version)\n }\n\n // Add data codewords\n setupData(modules, dataBits)\n\n if (isNaN(maskPattern)) {\n // Find best mask pattern\n maskPattern = MaskPattern.getBestMask(modules,\n setupFormatInfo.bind(null, modules, errorCorrectionLevel))\n }\n\n // Apply mask pattern\n MaskPattern.applyMask(maskPattern, modules)\n\n // Replace format info bits with correct values\n setupFormatInfo(modules, errorCorrectionLevel, maskPattern)\n\n return {\n modules: modules,\n version: version,\n errorCorrectionLevel: errorCorrectionLevel,\n maskPattern: maskPattern,\n segments: segments\n }\n}\n\n/**\n * QR Code\n *\n * @param {String | Array} data Input data\n * @param {Object} options Optional configurations\n * @param {Number} options.version QR Code version\n * @param {String} options.errorCorrectionLevel Error correction level\n * @param {Function} options.toSJISFunc Helper func to convert utf8 to sjis\n */\nexports.create = function create (data, options) {\n if (typeof data === 'undefined' || data === '') {\n throw new Error('No input text')\n }\n\n let errorCorrectionLevel = ECLevel.M\n let version\n let mask\n\n if (typeof options !== 'undefined') {\n // Use higher error correction level as default\n errorCorrectionLevel = ECLevel.from(options.errorCorrectionLevel, ECLevel.M)\n version = Version.from(options.version)\n mask = MaskPattern.from(options.maskPattern)\n\n if (options.toSJISFunc) {\n Utils.setToSJISFunction(options.toSJISFunc)\n }\n }\n\n return createSymbol(data, version, errorCorrectionLevel, mask)\n}\n","function hex2rgba (hex) {\n if (typeof hex === 'number') {\n hex = hex.toString()\n }\n\n if (typeof hex !== 'string') {\n throw new Error('Color should be defined as hex string')\n }\n\n let hexCode = hex.slice().replace('#', '').split('')\n if (hexCode.length < 3 || hexCode.length === 5 || hexCode.length > 8) {\n throw new Error('Invalid hex color: ' + hex)\n }\n\n // Convert from short to long form (fff -> ffffff)\n if (hexCode.length === 3 || hexCode.length === 4) {\n hexCode = Array.prototype.concat.apply([], hexCode.map(function (c) {\n return [c, c]\n }))\n }\n\n // Add default alpha value\n if (hexCode.length === 6) hexCode.push('F', 'F')\n\n const hexValue = parseInt(hexCode.join(''), 16)\n\n return {\n r: (hexValue >> 24) & 255,\n g: (hexValue >> 16) & 255,\n b: (hexValue >> 8) & 255,\n a: hexValue & 255,\n hex: '#' + hexCode.slice(0, 6).join('')\n }\n}\n\nexports.getOptions = function getOptions (options) {\n if (!options) options = {}\n if (!options.color) options.color = {}\n\n const margin = typeof options.margin === 'undefined' ||\n options.margin === null ||\n options.margin < 0\n ? 4\n : options.margin\n\n const width = options.width && options.width >= 21 ? options.width : undefined\n const scale = options.scale || 4\n\n return {\n width: width,\n scale: width ? 4 : scale,\n margin: margin,\n color: {\n dark: hex2rgba(options.color.dark || '#000000ff'),\n light: hex2rgba(options.color.light || '#ffffffff')\n },\n type: options.type,\n rendererOpts: options.rendererOpts || {}\n }\n}\n\nexports.getScale = function getScale (qrSize, opts) {\n return opts.width && opts.width >= qrSize + opts.margin * 2\n ? opts.width / (qrSize + opts.margin * 2)\n : opts.scale\n}\n\nexports.getImageWidth = function getImageWidth (qrSize, opts) {\n const scale = exports.getScale(qrSize, opts)\n return Math.floor((qrSize + opts.margin * 2) * scale)\n}\n\nexports.qrToImageData = function qrToImageData (imgData, qr, opts) {\n const size = qr.modules.size\n const data = qr.modules.data\n const scale = exports.getScale(size, opts)\n const symbolSize = Math.floor((size + opts.margin * 2) * scale)\n const scaledMargin = opts.margin * scale\n const palette = [opts.color.light, opts.color.dark]\n\n for (let i = 0; i < symbolSize; i++) {\n for (let j = 0; j < symbolSize; j++) {\n let posDst = (i * symbolSize + j) * 4\n let pxColor = opts.color.light\n\n if (i >= scaledMargin && j >= scaledMargin &&\n i < symbolSize - scaledMargin && j < symbolSize - scaledMargin) {\n const iSrc = Math.floor((i - scaledMargin) / scale)\n const jSrc = Math.floor((j - scaledMargin) / scale)\n pxColor = palette[data[iSrc * size + jSrc] ? 1 : 0]\n }\n\n imgData[posDst++] = pxColor.r\n imgData[posDst++] = pxColor.g\n imgData[posDst++] = pxColor.b\n imgData[posDst] = pxColor.a\n }\n }\n}\n","const Utils = require('./utils')\n\nfunction clearCanvas (ctx, canvas, size) {\n ctx.clearRect(0, 0, canvas.width, canvas.height)\n\n if (!canvas.style) canvas.style = {}\n canvas.height = size\n canvas.width = size\n canvas.style.height = size + 'px'\n canvas.style.width = size + 'px'\n}\n\nfunction getCanvasElement () {\n try {\n return document.createElement('canvas')\n } catch (e) {\n throw new Error('You need to specify a canvas element')\n }\n}\n\nexports.render = function render (qrData, canvas, options) {\n let opts = options\n let canvasEl = canvas\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!canvas) {\n canvasEl = getCanvasElement()\n }\n\n opts = Utils.getOptions(opts)\n const size = Utils.getImageWidth(qrData.modules.size, opts)\n\n const ctx = canvasEl.getContext('2d')\n const image = ctx.createImageData(size, size)\n Utils.qrToImageData(image.data, qrData, opts)\n\n clearCanvas(ctx, canvasEl, size)\n ctx.putImageData(image, 0, 0)\n\n return canvasEl\n}\n\nexports.renderToDataURL = function renderToDataURL (qrData, canvas, options) {\n let opts = options\n\n if (typeof opts === 'undefined' && (!canvas || !canvas.getContext)) {\n opts = canvas\n canvas = undefined\n }\n\n if (!opts) opts = {}\n\n const canvasEl = exports.render(qrData, canvas, opts)\n\n const type = opts.type || 'image/png'\n const rendererOpts = opts.rendererOpts || {}\n\n return canvasEl.toDataURL(type, rendererOpts.quality)\n}\n","const Utils = require('./utils')\n\nfunction getColorAttrib (color, attrib) {\n const alpha = color.a / 255\n const str = attrib + '=\"' + color.hex + '\"'\n\n return alpha < 1\n ? str + ' ' + attrib + '-opacity=\"' + alpha.toFixed(2).slice(1) + '\"'\n : str\n}\n\nfunction svgCmd (cmd, x, y) {\n let str = cmd + x\n if (typeof y !== 'undefined') str += ' ' + y\n\n return str\n}\n\nfunction qrToPath (data, size, margin) {\n let path = ''\n let moveBy = 0\n let newRow = false\n let lineLength = 0\n\n for (let i = 0; i < data.length; i++) {\n const col = Math.floor(i % size)\n const row = Math.floor(i / size)\n\n if (!col && !newRow) newRow = true\n\n if (data[i]) {\n lineLength++\n\n if (!(i > 0 && col > 0 && data[i - 1])) {\n path += newRow\n ? svgCmd('M', col + margin, 0.5 + row + margin)\n : svgCmd('m', moveBy, 0)\n\n moveBy = 0\n newRow = false\n }\n\n if (!(col + 1 < size && data[i + 1])) {\n path += svgCmd('h', lineLength)\n lineLength = 0\n }\n } else {\n moveBy++\n }\n }\n\n return path\n}\n\nexports.render = function render (qrData, options, cb) {\n const opts = Utils.getOptions(options)\n const size = qrData.modules.size\n const data = qrData.modules.data\n const qrcodesize = size + opts.margin * 2\n\n const bg = !opts.color.light.a\n ? ''\n : ''\n\n const path =\n ''\n\n const viewBox = 'viewBox=\"' + '0 0 ' + qrcodesize + ' ' + qrcodesize + '\"'\n\n const width = !opts.width ? '' : 'width=\"' + opts.width + '\" height=\"' + opts.width + '\" '\n\n const svgTag = '' + bg + path + '\\n'\n\n if (typeof cb === 'function') {\n cb(null, svgTag)\n }\n\n return svgTag\n}\n","\nconst canPromise = require('./can-promise')\n\nconst QRCode = require('./core/qrcode')\nconst CanvasRenderer = require('./renderer/canvas')\nconst SvgRenderer = require('./renderer/svg-tag.js')\n\nfunction renderCanvas (renderFunc, canvas, text, opts, cb) {\n const args = [].slice.call(arguments, 1)\n const argsNum = args.length\n const isLastArgCb = typeof args[argsNum - 1] === 'function'\n\n if (!isLastArgCb && !canPromise()) {\n throw new Error('Callback required as last argument')\n }\n\n if (isLastArgCb) {\n if (argsNum < 2) {\n throw new Error('Too few arguments provided')\n }\n\n if (argsNum === 2) {\n cb = text\n text = canvas\n canvas = opts = undefined\n } else if (argsNum === 3) {\n if (canvas.getContext && typeof cb === 'undefined') {\n cb = opts\n opts = undefined\n } else {\n cb = opts\n opts = text\n text = canvas\n canvas = undefined\n }\n }\n } else {\n if (argsNum < 1) {\n throw new Error('Too few arguments provided')\n }\n\n if (argsNum === 1) {\n text = canvas\n canvas = opts = undefined\n } else if (argsNum === 2 && !canvas.getContext) {\n opts = text\n text = canvas\n canvas = undefined\n }\n\n return new Promise(function (resolve, reject) {\n try {\n const data = QRCode.create(text, opts)\n resolve(renderFunc(data, canvas, opts))\n } catch (e) {\n reject(e)\n }\n })\n }\n\n try {\n const data = QRCode.create(text, opts)\n cb(null, renderFunc(data, canvas, opts))\n } catch (e) {\n cb(e)\n }\n}\n\nexports.create = QRCode.create\nexports.toCanvas = renderCanvas.bind(null, CanvasRenderer.render)\nexports.toDataURL = renderCanvas.bind(null, CanvasRenderer.renderToDataURL)\n\n// only svg for now.\nexports.toString = renderCanvas.bind(null, function (data, _, opts) {\n return SvgRenderer.render(data, opts)\n})\n","import t from\"react\";import{authenticatorTextUtil as i}from\"@aws-amplify/ui\";import{useAuthenticator as e}from\"@aws-amplify/ui-react-core\";import{Button as n}from\"../../../primitives/Button/Button.mjs\";import{Flex as o}from\"../../../primitives/Flex/Flex.mjs\";const{getConfirmText:r,getConfirmingText:m,getBackToSignInText:a}=i,l=()=>{const{isPending:i,toSignIn:l}=e((t=>[t.isPending,t.toSignIn]));return t.createElement(o,{direction:\"column\"},t.createElement(n,{isDisabled:i,type:\"submit\",variation:\"primary\",fontWeight:\"normal\",isLoading:i,loadingText:m()},r()),t.createElement(n,{onClick:l,type:\"button\",variation:\"link\",fontWeight:\"normal\",size:\"small\"},a()))};export{l as ConfirmSignInFooter};\n","import{__awaiter as e}from\"tslib\";import t from\"qrcode\";import*as o from\"react\";import{Logger as r}from\"aws-amplify\";import{authenticatorTextUtil as a,getTotpCodeURL as m}from\"@aws-amplify/ui\";import{Flex as i}from\"../../../primitives/Flex/Flex.mjs\";import{Heading as n}from\"../../../primitives/Heading/Heading.mjs\";import{useAuthenticator as l}from\"@aws-amplify/ui-react-core\";import{useCustomComponents as s}from\"../hooks/useCustomComponents/index.mjs\";import{useFormHandlers as c}from\"../hooks/useFormHandlers/useFormHandlers.mjs\";import{ConfirmSignInFooter as d}from\"../shared/ConfirmSignInFooter.mjs\";import{RemoteErrorMessage as p}from\"../shared/RemoteErrorMessage.mjs\";import{FormFields as u}from\"../shared/FormFields.mjs\";import{RouteContainer as f}from\"../RouteContainer/RouteContainer.mjs\";const g=new r(\"SetupTOTP-logger\"),{getSetupTOTPText:h,getCopiedText:E,getLoadingText:v}=a,C=({className:r,variation:a})=>{var n;const{totpSecretCode:h,isPending:y,user:H,QRFields:w}=l((e=>[e.isPending,e.totpSecretCode])),{handleChange:S,handleSubmit:F}=c(),{components:{SetupTOTP:{Header:x=C.Header,Footer:T=C.Footer}}}=s(),[j,V]=o.useState(!0),[b,P]=o.useState(),[R,k]=o.useState(\"COPY\"),{totpIssuer:L=\"AWSCognito\",totpUsername:M=(null==H?void 0:H.username)}=null!==(n=w)&&void 0!==n?n:{},O=o.useCallback((()=>e(void 0,void 0,void 0,(function*(){try{const e=m(L,M,h),o=yield t.toDataURL(e);P(o)}catch(e){g.error(e)}finally{V(!1)}}))),[L,M,h]);o.useEffect((()=>{b||O()}),[O,b]);return o.createElement(f,{className:r,variation:a},o.createElement(\"form\",{\"data-amplify-form\":\"\",\"data-amplify-authenticator-setup-totp\":\"\",method:\"post\",onChange:S,onSubmit:F},o.createElement(i,{as:\"fieldset\",direction:\"column\",isDisabled:y},o.createElement(x,null),o.createElement(i,{direction:\"column\"},j?o.createElement(\"p\",null,v(),\"…\"):o.createElement(\"img\",{\"data-amplify-qrcode\":!0,src:b,alt:\"qr code\",width:\"228\",height:\"228\"}),o.createElement(i,{\"data-amplify-copy\":!0},o.createElement(\"div\",null,h),o.createElement(i,{\"data-amplify-copy-svg\":!0,onClick:()=>{navigator.clipboard.writeText(h),k(E())}},o.createElement(\"div\",{\"data-amplify-copy-tooltip\":!0},R),o.createElement(\"svg\",{width:\"24\",height:\"24\",viewBox:\"0 0 24 24\",xmlns:\"http://www.w3.org/2000/svg\"},o.createElement(\"path\",{d:\"M16 1H4C2.9 1 2 1.9 2 3V17H4V3H16V1ZM15 5H8C6.9 5 6.01 5.9 6.01 7L6 21C6 22.1 6.89 23 7.99 23H19C20.1 23 21 22.1 21 21V11L15 5ZM8 21V7H14V12H19V21H8Z\"})))),o.createElement(u,null),o.createElement(p,null)),o.createElement(d,null),o.createElement(T,null))))};C.Header=function(){return o.createElement(n,{level:3},h())},C.Footer=function(){return null};export{C as SetupTOTP};\n","import e from\"react\";import{useAuthenticator as t}from\"@aws-amplify/ui-react-core\";import{Button as l}from\"../../../../primitives/Button/Button.mjs\";import{Icon as i}from\"../../../../primitives/Icon/Icon.mjs\";import{Text as a}from\"../../../../primitives/Text/Text.mjs\";const n=()=>e.createElement(\"svg\",{\"aria-label\":\"Apple icon\",className:\"amplify-icon federated-sign-in-icon\",fill:\"#000\",preserveAspectRatio:\"xMidYMid\",stroke:\"#000\",strokeWidth:\"0\",viewBox:\"0 0 1024 1024\",xmlns:\"http://www.w3.org/2000/svg\"},e.createElement(\"path\",{d:\"M747.4 535.7c-.4-68.2 30.5-119.6 92.9-157.5-34.9-50-87.7-77.5-157.3-82.8-65.9-5.2-138 38.4-164.4 38.4-27.9 0-91.7-36.6-141.9-36.6C273.1 298.8 163 379.8 163 544.6c0 48.7 8.9 99 26.7 150.8 23.8 68.2 109.6 235.3 199.1 232.6 46.8-1.1 79.9-33.2 140.8-33.2 59.1 0 89.7 33.2 141.9 33.2 90.3-1.3 167.9-153.2 190.5-221.6-121.1-57.1-114.6-167.2-114.6-170.7zm-105.1-305c50.7-60.2 46.1-115 44.6-134.7-44.8 2.6-96.6 30.5-126.1 64.8-32.5 36.8-51.6 82.3-47.5 133.6 48.4 3.7 92.6-21.2 129-63.7z\"})),r=()=>e.createElement(\"svg\",{\"aria-label\":\"Google icon\",className:\"amplify-icon federated-sign-in-icon\",viewBox:\"0 0 256 262\",xmlns:\"http://www.w3.org/2000/svg\",preserveAspectRatio:\"xMidYMid\"},e.createElement(\"path\",{d:\"M255.878 133.451c0-10.734-.871-18.567-2.756-26.69H130.55v48.448h71.947c-1.45 12.04-9.283 30.172-26.69 42.356l-.244 1.622 38.755 30.023 2.685.268c24.659-22.774 38.875-56.282 38.875-96.027\",fill:\"#4285F4\"}),e.createElement(\"path\",{d:\"M130.55 261.1c35.248 0 64.839-11.605 86.453-31.622l-41.196-31.913c-11.024 7.688-25.82 13.055-45.257 13.055-34.523 0-63.824-22.773-74.269-54.25l-1.531.13-40.298 31.187-.527 1.465C35.393 231.798 79.49 261.1 130.55 261.1\",fill:\"#34A853\"}),e.createElement(\"path\",{d:\"M56.281 156.37c-2.756-8.123-4.351-16.827-4.351-25.82 0-8.994 1.595-17.697 4.206-25.82l-.073-1.73L15.26 71.312l-1.335.635C5.077 89.644 0 109.517 0 130.55s5.077 40.905 13.925 58.602l42.356-32.782\",fill:\"#FBBC05\"}),e.createElement(\"path\",{d:\"M130.55 50.479c24.514 0 41.05 10.589 50.479 19.438l36.844-35.974C195.245 12.91 165.798 0 130.55 0 79.49 0 35.393 29.301 13.925 71.947l42.211 32.783c10.59-31.477 39.891-54.251 74.414-54.251\",fill:\"#EB4335\"})),o=()=>e.createElement(i,{className:\"federated-sign-in-icon\",ariaLabel:\"Facebook icon\",viewBox:{minX:0,minY:0,width:279,height:538},pathData:\"M82.3409742,538 L82.3409742,292.936652 L0,292.936652 L0,196.990154 L82.2410458,196.990154 L82.2410458,126.4295 C82.2410458,44.575144 132.205229,0 205.252865,0 C240.227794,0 270.306232,2.59855099 279,3.79788222 L279,89.2502322 L228.536175,89.2502322 C188.964542,89.2502322 181.270057,108.139699 181.270057,135.824262 L181.270057,196.89021 L276.202006,196.89021 L263.810888,292.836708 L181.16913,292.836708 L181.16913,538 L82.3409742,538 Z\",fill:\"#1877F2\"}),c=()=>e.createElement(\"svg\",{\"aria-label\":\"Amazon icon\",className:\"amplify-icon federated-sign-in-icon\",viewBox:\"0 0 243 264\",xmlns:\"http://www.w3.org/2000/svg\",preserveAspectRatio:\"xMidYMid\"},e.createElement(\"path\",{d:\"M230.826 208.039C227.468 203.683 208.551 205.982 200.056 206.998C197.471 207.321 197.076 205.042 199.407 203.405C214.475 192.665 239.201 195.766 242.082 199.364C244.966 202.982 241.337 228.071 227.173 240.049C225.001 241.888 222.93 240.904 223.898 238.468C227.077 230.431 234.205 212.419 230.826 208.039ZM123.769 264C71.0234 264 39.0764 241.955 14.7853 217.542C9.97339 212.706 3.71799 206.296 0.311513 200.691C-1.09773 198.372 2.59096 195.022 5.04421 196.844C35.239 219.268 79.1012 239.538 122.53 239.538C151.82 239.538 188.046 227.47 217.669 214.868C222.147 212.966 222.147 219.18 221.512 221.061C221.183 222.032 206.515 236.221 186.247 247.047C167.304 257.166 143.397 264 123.769 264Z\",fill:\"#F2541B\"}),e.createElement(\"path\",{fillRule:\"evenodd\",clipRule:\"evenodd\",d:\"M142.943 111.185C142.943 124.756 143.268 136.054 136.406 148.123C130.856 157.913 122.027 163.95 112.222 163.95C98.8288 163.95 90.9806 153.772 90.9806 138.693C90.9806 109.036 117.677 103.647 142.943 103.647V111.185ZM178.166 196.081C175.858 198.15 171.635 198.22 169.914 196.894C157.974 187.684 149.89 173.688 149.89 173.688C130.706 193.156 117.127 199 92.2879 199C62.8772 199 40 180.905 40 144.729C40 116.461 55.3552 97.2408 77.2563 87.823C96.2094 79.5256 122.684 78.0173 142.943 75.7517C142.943 75.7517 144.633 53.933 138.699 45.9806C134.098 39.8163 126.272 36.9329 119.089 36.9329C106.127 36.8829 93.61 43.9051 91.1262 57.4188C90.4136 61.2829 87.5533 64.5261 84.54 64.206L51.0823 60.5922C48.5156 60.2951 45.0381 57.6639 45.8636 53.3081C53.644 12.3684 90.7373 0 123.989 0C140.983 0 163.21 4.51651 176.608 17.3349C193.597 33.1648 191.969 54.2755 191.969 77.2722V131.51C191.969 147.835 198.768 154.987 205.151 163.775C207.376 166.953 207.886 170.714 205.04 173.032C197.902 178.999 178.166 196.081 178.166 196.081Z\",fill:\"#F2541B\"})),m=i=>{const{icon:m,provider:s,text:C}=i,{toFederatedSignIn:p}=t();let d;return\"facebook\"===m?d=e.createElement(o,null):\"google\"===m?d=e.createElement(r,null):\"amazon\"===m?d=e.createElement(c,null):\"apple\"===m&&(d=e.createElement(n,null)),e.createElement(l,{onClick:e=>{e.preventDefault(),p({provider:s})},className:\"federated-sign-in-button\",fontWeight:\"normal\",gap:\"1rem\"},d,e.createElement(a,{as:\"span\"},C))};export{m as FederatedSignInButton};\n","import e from\"react\";import{FederatedIdentityProviders as t,authenticatorTextUtil as o}from\"@aws-amplify/ui\";import{Divider as r}from\"../../../primitives/Divider/Divider.mjs\";import{Flex as i}from\"../../../primitives/Flex/Flex.mjs\";import{useAuthenticator as a}from\"@aws-amplify/ui-react-core\";import{FederatedSignInButton as n}from\"./FederatedSignInButtons/FederatedSignInButton.mjs\";const{getSignInWithFederationText:m,getOrText:s}=o;function c(){const{route:o,socialProviders:c}=a((({route:e,socialProviders:t})=>[e,t]));return 0===c.length?null:e.createElement(i,{direction:\"column\",padding:\"0 0 1rem 0\",className:\"federated-sign-in-container\"},c.map((r=>{switch(r){case\"amazon\":return e.createElement(n,{icon:\"amazon\",key:r,provider:t.Amazon,text:m(o,r)});case\"apple\":return e.createElement(n,{icon:\"apple\",key:r,provider:t.Apple,text:m(o,r)});case\"facebook\":return e.createElement(n,{icon:\"facebook\",key:r,provider:t.Facebook,text:m(o,r)});case\"google\":return e.createElement(n,{icon:\"google\",key:r,provider:t.Google,text:m(o,r)});default:console.error(`Authenticator does not support ${r}. Please open an issue: https://github.com/aws-amplify/amplify-ui/issues/choose`)}})),e.createElement(r,{size:\"small\",label:s()}))}export{c as FederatedSignIn};\n","import e from\"react\";import{authenticatorTextUtil as t}from\"@aws-amplify/ui\";import{Button as r}from\"../../../primitives/Button/Button.mjs\";import{Flex as n}from\"../../../primitives/Flex/Flex.mjs\";import{View as i}from\"../../../primitives/View/View.mjs\";import{VisuallyHidden as o}from\"../../../primitives/VisuallyHidden/VisuallyHidden.mjs\";import{FederatedSignIn as m}from\"../FederatedSignIn/FederatedSignIn.mjs\";import{useAuthenticator as a}from\"@aws-amplify/ui-react-core\";import{useCustomComponents as l}from\"../hooks/useCustomComponents/index.mjs\";import{useFormHandlers as s}from\"../hooks/useFormHandlers/useFormHandlers.mjs\";import{RemoteErrorMessage as d}from\"../shared/RemoteErrorMessage.mjs\";import{FormFields as u}from\"../shared/FormFields.mjs\";const{getSignInText:c,getSigningInText:p,getForgotPasswordText:f}=t;function g(){const{isPending:t}=a((e=>[e.isPending])),{handleChange:f,handleSubmit:E}=s(),{components:{SignIn:{Header:F=g.Header,Footer:h=g.Footer}}}=l();return e.createElement(i,null,e.createElement(F,null),e.createElement(\"form\",{\"data-amplify-form\":\"\",\"data-amplify-authenticator-signin\":\"\",method:\"post\",onSubmit:E,onChange:f},e.createElement(m,null),e.createElement(n,{direction:\"column\"},e.createElement(n,{as:\"fieldset\",direction:\"column\",isDisabled:t},e.createElement(o,null,e.createElement(\"legend\",null,c())),e.createElement(u,null)),e.createElement(d,null),e.createElement(r,{isDisabled:t,isFullWidth:!0,type:\"submit\",variation:\"primary\",isLoading:t,loadingText:p()},c()))),e.createElement(h,null))}g.Footer=()=>{const{toResetPassword:t}=a((e=>[e.toResetPassword]));return e.createElement(i,{\"data-amplify-footer\":\"\"},e.createElement(r,{fontWeight:\"normal\",onClick:t,size:\"small\",variation:\"link\"},f()))},g.Header=function(){return null};export{g as SignIn};\n","import e from\"react\";import{authenticatorTextUtil as t}from\"@aws-amplify/ui\";import{Button as r}from\"../../../primitives/Button/Button.mjs\";import{Flex as o}from\"../../../primitives/Flex/Flex.mjs\";import{View as n}from\"../../../primitives/View/View.mjs\";import{FederatedSignIn as i}from\"../FederatedSignIn/FederatedSignIn.mjs\";import{useAuthenticator as m}from\"@aws-amplify/ui-react-core\";import{useCustomComponents as a}from\"../hooks/useCustomComponents/index.mjs\";import{useFormHandlers as l}from\"../hooks/useFormHandlers/useFormHandlers.mjs\";import{RemoteErrorMessage as s}from\"../shared/RemoteErrorMessage.mjs\";import{FormFields as u}from\"../shared/FormFields.mjs\";const{getCreateAccountText:d,getCreatingAccountText:c}=t;function p(){const{hasValidationErrors:t,isPending:u}=m((e=>[e.hasValidationErrors,e.isPending])),{handleChange:f,handleBlur:F,handleSubmit:g}=l(),{components:{SignUp:{Header:h=p.Header,FormFields:E=p.FormFields,Footer:j=p.Footer}}}=a();return e.createElement(n,null,e.createElement(h,null),e.createElement(\"form\",{\"data-amplify-form\":\"\",\"data-amplify-authenticator-signup\":\"\",method:\"post\",onChange:f,onSubmit:g,onBlur:F},e.createElement(i,null),e.createElement(o,{as:\"fieldset\",direction:\"column\",isDisabled:u},e.createElement(o,{direction:\"column\"},e.createElement(E,null),e.createElement(s,null)),e.createElement(r,{isDisabled:t||u,isFullWidth:!0,type:\"submit\",variation:\"primary\",isLoading:u,loadingText:c()},d()))),e.createElement(j,null))}p.Header=function(){return null},p.FormFields=function(){return e.createElement(u,null)},p.Footer=function(){return null};export{p as SignUp};\n","import e from\"react\";import{authenticatorTextUtil as t}from\"@aws-amplify/ui\";import{useAuthenticator as n}from\"@aws-amplify/ui-react-core\";import{Tabs as i,TabItem as r}from\"../../../primitives/Tabs/Tabs.mjs\";import{View as o}from\"../../../primitives/View/View.mjs\";import{SignIn as a}from\"../SignIn/SignIn.mjs\";import{SignUp as m}from\"../SignUp/SignUp.mjs\";import{RouteContainer as l}from\"../RouteContainer/RouteContainer.mjs\";const{getSignInTabText:p,getSignUpTabText:s}=t,c=({className:t,hideSignUp:c,variation:g})=>{const{route:u,toSignIn:f,toSignUp:S}=n((e=>[e.route,e.toSignIn,e.toSignUp]));return e.createElement(l,{className:t,variation:g},c?e.createElement(o,{\"data-amplify-router-content\":\"\"},\"signIn\"===u&&e.createElement(a,null)):e.createElement(i,{indicatorPosition:\"top\",currentIndex:\"signIn\"===u?0:1,spacing:\"equal\",justifyContent:\"center\",onChange:()=>\"signIn\"===u?S():f()},e.createElement(r,{title:p()},e.createElement(o,{\"data-amplify-router-content\":\"\"},\"signIn\"===u&&e.createElement(a,null))),e.createElement(r,{title:s()},e.createElement(o,{\"data-amplify-router-content\":\"\"},\"signUp\"===u&&e.createElement(m,null)))))};export{c as SignInSignUpTabs};\n","import e from\"react\";import{authenticatorTextUtil as t}from\"@aws-amplify/ui\";import{useAuthenticator as i}from\"@aws-amplify/ui-react-core\";import{Button as n}from\"../../../primitives/Button/Button.mjs\";import{Flex as r}from\"../../../primitives/Flex/Flex.mjs\";const{getSubmitText:a,getSubmittingText:m}=t,o=t=>{const{cancelButtonSendType:o,cancelButtonText:l,submitButtonText:c}=t,{isPending:s,resendCode:u,skipVerification:p,toSignIn:f}=i((e=>[e.isPending])),g=s?e.createElement(e.Fragment,null,m(),\"…\"):e.createElement(e.Fragment,null,a()),b=null!=c?c:g;return e.createElement(r,{direction:\"column\"},e.createElement(n,{fontWeight:\"normal\",variation:\"primary\",isDisabled:s,type:\"submit\"},b),e.createElement(n,{onClick:()=>{switch(o){case\"SKIP\":p();break;case\"RESEND\":u();break;case\"SIGN_IN\":f();break;default:return}},type:\"button\",variation:\"link\",fontWeight:\"normal\",size:\"small\"},l))};export{o as TwoButtonSubmitFooter};\n","import e from\"react\";import{authenticatorTextUtil as t}from\"@aws-amplify/ui\";import{Flex as r}from\"../../../primitives/Flex/Flex.mjs\";import{Heading as o}from\"../../../primitives/Heading/Heading.mjs\";import{useAuthenticator as m}from\"@aws-amplify/ui-react-core\";import{useCustomComponents as n}from\"../hooks/useCustomComponents/index.mjs\";import{useFormHandlers as i}from\"../hooks/useFormHandlers/useFormHandlers.mjs\";import{RemoteErrorMessage as a}from\"../shared/RemoteErrorMessage.mjs\";import{TwoButtonSubmitFooter as s}from\"../shared/TwoButtonSubmitFooter.mjs\";import{FormFields as l}from\"../shared/FormFields.mjs\";import{RouteContainer as c}from\"../RouteContainer/RouteContainer.mjs\";const{getAccountRecoveryInfoText:u,getSkipText:f}=t,d=({className:t,variation:o})=>{const{isPending:u}=m((e=>[e.isPending])),{handleChange:p,handleSubmit:h}=i(),{components:{ConfirmVerifyUser:{Header:E=d.Header,Footer:F=d.Footer}}}=n();return e.createElement(c,{className:t,variation:o},e.createElement(\"form\",{\"data-amplify-form\":\"\",\"data-amplify-authenticator-confirmverifyuser\":\"\",method:\"post\",onChange:p,onSubmit:h},e.createElement(r,{as:\"fieldset\",direction:\"column\",isDisabled:u},e.createElement(E,null),e.createElement(r,{direction:\"column\"},e.createElement(l,null)),e.createElement(a,null),e.createElement(s,{cancelButtonText:f(),cancelButtonSendType:\"SKIP\"}),e.createElement(F,null))))};d.Header=function(){return e.createElement(o,{level:3},u())},d.Footer=function(){return null};export{d as ConfirmVerifyUser};\n","import e from\"react\";import{authenticatorTextUtil as t,defaultFormFieldOptions as r,translate as o,censorPhoneNumber as i,censorAllButFirstAndLast as n}from\"@aws-amplify/ui\";import{Flex as m}from\"../../../primitives/Flex/Flex.mjs\";import{Heading as a}from\"../../../primitives/Heading/Heading.mjs\";import{Radio as l}from\"../../../primitives/Radio/Radio.mjs\";import{RadioGroupField as s}from\"../../../primitives/RadioGroupField/RadioGroupField.mjs\";import{useAuthenticator as c}from\"@aws-amplify/ui-react-core\";import{useCustomComponents as u}from\"../hooks/useCustomComponents/index.mjs\";import{useFormHandlers as d}from\"../hooks/useFormHandlers/useFormHandlers.mjs\";import{RemoteErrorMessage as f}from\"../shared/RemoteErrorMessage.mjs\";import{TwoButtonSubmitFooter as p}from\"../shared/TwoButtonSubmitFooter.mjs\";import{RouteContainer as g}from\"../RouteContainer/RouteContainer.mjs\";const{getSkipText:v,getVerifyText:E,getVerifyContactText:h,getAccountRecoveryInfoText:y}=t,F=t=>Object.entries(t).map((([t,m])=>e.createElement(l,{name:\"unverifiedAttr\",value:t,key:t},((e,t)=>{const r=o(e);let m=t;if(\"Phone Number\"===e)m=i(t);else if(\"Email\"===e){const e=t.split(\"@\");m=`${n(e[0])}@${e[1]}`}return`${r}: ${m}`})(r[t].label,m)))),b=({className:t,variation:r})=>{const{components:{VerifyUser:{Header:o=b.Header,Footer:i=b.Footer}}}=u(),{isPending:n,unverifiedContactMethods:a}=c((({isPending:e,unverifiedContactMethods:t})=>[e,t])),{handleChange:l,handleSubmit:y}=d(),x=n?e.createElement(e.Fragment,null,\"Verifying…\"):e.createElement(e.Fragment,null,E()),j=e.createElement(s,{label:h(),labelHidden:!0,name:\"verify_context\",isDisabled:n},F(a));return e.createElement(g,{className:t,variation:r},e.createElement(\"form\",{\"data-amplify-form\":\"\",\"data-amplify-authenticator-verifyuser\":\"\",method:\"post\",onChange:l,onSubmit:y},e.createElement(m,{as:\"fieldset\",direction:\"column\",isDisabled:n},e.createElement(o,null),j,e.createElement(f,null),e.createElement(p,{cancelButtonText:v(),cancelButtonSendType:\"SKIP\",submitButtonText:x}),e.createElement(i,null))))};b.Header=function(){return e.createElement(a,{level:3},y())},b.Footer=function(){return null};export{b as VerifyUser};\n","import e from\"react\";import{authenticatorTextUtil as r}from\"@aws-amplify/ui\";import{Flex as t}from\"../../../primitives/Flex/Flex.mjs\";import{Heading as o}from\"../../../primitives/Heading/Heading.mjs\";import{useAuthenticator as n}from\"@aws-amplify/ui-react-core\";import{useCustomComponents as m}from\"../hooks/useCustomComponents/index.mjs\";import{useFormHandlers as i}from\"../hooks/useFormHandlers/useFormHandlers.mjs\";import{FormFields as a}from\"../shared/FormFields.mjs\";import{ConfirmSignInFooter as l}from\"../shared/ConfirmSignInFooter.mjs\";import{RemoteErrorMessage as s}from\"../shared/RemoteErrorMessage.mjs\";import{RouteContainer as c}from\"../RouteContainer/RouteContainer.mjs\";const{getChallengeText:u}=r,d=({className:r,variation:o})=>{const{isPending:u}=n((e=>[e.isPending])),{handleChange:f,handleSubmit:p}=i(),{components:{ConfirmSignIn:{Header:g=d.Header,Footer:h=d.Footer}}}=m();return e.createElement(c,{className:r,variation:o},e.createElement(\"form\",{\"data-amplify-form\":\"\",\"data-amplify-authenticator-confirmsignin\":\"\",method:\"post\",onChange:f,onSubmit:p},e.createElement(t,{as:\"fieldset\",direction:\"column\",isDisabled:u},e.createElement(g,null),e.createElement(t,{direction:\"column\"},e.createElement(a,null),e.createElement(s,null)),e.createElement(l,null),e.createElement(h,null))))};d.Header=function(){const{user:{challengeName:r}}=n((({user:e})=>[e]));return e.createElement(o,{level:3},u(r))},d.Footer=function(){return null};export{d as ConfirmSignIn};\n","import e from\"react\";import{authenticatorTextUtil as t}from\"@aws-amplify/ui\";import{Flex as o}from\"../../../primitives/Flex/Flex.mjs\";import{Heading as r}from\"../../../primitives/Heading/Heading.mjs\";import{useAuthenticator as n}from\"@aws-amplify/ui-react-core\";import{useCustomComponents as m}from\"../hooks/useCustomComponents/index.mjs\";import{useFormHandlers as a}from\"../hooks/useFormHandlers/useFormHandlers.mjs\";import{RemoteErrorMessage as i}from\"../shared/RemoteErrorMessage.mjs\";import{TwoButtonSubmitFooter as s}from\"../shared/TwoButtonSubmitFooter.mjs\";import{FormFields as l}from\"../shared/FormFields.mjs\";import{RouteContainer as c}from\"../RouteContainer/RouteContainer.mjs\";const{getResendCodeText:d,getResetYourPasswordText:u}=t,p=({className:t,variation:r})=>{const{isPending:u}=n((e=>[e.isPending])),{handleBlur:f,handleChange:E,handleSubmit:h}=a(),{components:{ConfirmResetPassword:{Header:F=p.Header,Footer:g=p.Footer}}}=m();return e.createElement(c,{className:t,variation:r},e.createElement(\"form\",{\"data-amplify-form\":\"\",\"data-amplify-authenticator-confirmresetpassword\":\"\",method:\"post\",onSubmit:h,onChange:E,onBlur:f},e.createElement(o,{as:\"fieldset\",direction:\"column\",isDisabled:u},e.createElement(F,null),e.createElement(o,{direction:\"column\"},e.createElement(l,null)),e.createElement(i,null),e.createElement(s,{cancelButtonSendType:\"RESEND\",cancelButtonText:d()}),e.createElement(g,null))))};p.Header=function(){const t=u();return e.createElement(r,{level:3},t)},p.Footer=function(){return null};export{p as ConfirmResetPassword};\n","import e from\"react\";import{authenticatorTextUtil as t}from\"@aws-amplify/ui\";import{Flex as r}from\"../../../primitives/Flex/Flex.mjs\";import{Heading as o}from\"../../../primitives/Heading/Heading.mjs\";import{useAuthenticator as n}from\"@aws-amplify/ui-react-core\";import{useCustomComponents as m}from\"../hooks/useCustomComponents/index.mjs\";import{useFormHandlers as a}from\"../hooks/useFormHandlers/useFormHandlers.mjs\";import{RemoteErrorMessage as i}from\"../shared/RemoteErrorMessage.mjs\";import{TwoButtonSubmitFooter as s}from\"../shared/TwoButtonSubmitFooter.mjs\";import{FormFields as l}from\"../shared/FormFields.mjs\";import{RouteContainer as c}from\"../RouteContainer/RouteContainer.mjs\";const{getBackToSignInText:u,getSendingText:d,getSendCodeText:p,getResetYourPasswordText:f}=t,g=({className:t,variation:o})=>{const{isPending:f}=n((e=>[e.isPending])),{handleChange:E,handleSubmit:F}=a(),{components:{ResetPassword:{Header:h=g.Header,Footer:x=g.Footer}}}=m();return e.createElement(c,{className:t,variation:o},e.createElement(\"form\",{\"data-amplify-form\":\"\",\"data-amplify-authenticator-resetpassword\":\"\",method:\"post\",onChange:E,onSubmit:F},e.createElement(r,{as:\"fieldset\",direction:\"column\",isDisabled:f},e.createElement(h,null),e.createElement(r,{direction:\"column\"},e.createElement(l,null)),e.createElement(i,null),e.createElement(s,{cancelButtonText:u(),cancelButtonSendType:\"SIGN_IN\",submitButtonText:f?e.createElement(e.Fragment,null,d(),\"…\"):e.createElement(e.Fragment,null,p())}),e.createElement(x,null))))};g.Header=function(){return e.createElement(o,{level:3},f())},g.Footer=function(){return null};export{g as ResetPassword};\n","const n=n=>\"signIn\"===n||\"signUp\"===n;export{n as isSignInOrSignUpRoute};\n","import r,{useMemo as e}from\"react\";import{useAuthenticator as s}from\"@aws-amplify/ui-react-core\";import{ConfirmSignUp as i}from\"../ConfirmSignUp/ConfirmSignUp.mjs\";import{ForceNewPassword as t}from\"../ForceNewPassword/ForceNewPassword.mjs\";import{SetupTOTP as o}from\"../SetupTOTP/SetupTOTP.mjs\";import\"@aws-amplify/ui\";import\"../../../primitives/TextField/TextField.mjs\";import\"../../../primitives/Button/Button.mjs\";import\"../../../primitives/Flex/Flex.mjs\";import\"../../../primitives/Alert/Alert.mjs\";import{SignInSignUpTabs as m}from\"../shared/SignInSignUpTabs.mjs\";import{ConfirmVerifyUser as n}from\"../VerifyUser/ConfirmVerifyUser.mjs\";import{VerifyUser as a}from\"../VerifyUser/VerifyUser.mjs\";import{ConfirmSignIn as p}from\"../ConfirmSignIn/ConfirmSignIn.mjs\";import{ConfirmResetPassword as c}from\"../ResetPassword/ConfirmResetPassword.mjs\";import{ResetPassword as f}from\"../ResetPassword/ResetPassword.mjs\";import{isSignInOrSignUpRoute as u}from\"../utils.mjs\";function d(){return null}function l({className:l,hideSignUp:w,variation:j}){const{route:U}=s((({route:r})=>[r])),g=e((()=>(r=>{switch(r){case\"authenticated\":case\"idle\":case\"setup\":case\"transition\":return d;case\"confirmSignUp\":return i;case\"confirmSignIn\":return p;case\"setupTOTP\":return o;case\"signIn\":case\"signUp\":return m;case\"forceNewPassword\":return t;case\"resetPassword\":return f;case\"confirmResetPassword\":return c;case\"verifyUser\":return a;case\"confirmVerifyUser\":return n;default:return console.warn(`Unhandled Authenticator route - please open an issue: ${r}`),d}})(U)),[U]);return r.createElement(g,{className:l,hideSignUp:u(U)?w:void 0,variation:j})}export{l as Router};\n","import{SignIn as r}from\"../../SignIn/SignIn.mjs\";import{SignUp as e}from\"../../SignUp/SignUp.mjs\";import{ConfirmSignUp as o}from\"../../ConfirmSignUp/ConfirmSignUp.mjs\";import{ForceNewPassword as s}from\"../../ForceNewPassword/ForceNewPassword.mjs\";import{SetupTOTP as m}from\"../../SetupTOTP/SetupTOTP.mjs\";import{ConfirmSignIn as i}from\"../../ConfirmSignIn/ConfirmSignIn.mjs\";import{ConfirmVerifyUser as t}from\"../../VerifyUser/ConfirmVerifyUser.mjs\";import{VerifyUser as d}from\"../../VerifyUser/VerifyUser.mjs\";import{ConfirmResetPassword as n}from\"../../ResetPassword/ConfirmResetPassword.mjs\";import{ResetPassword as F}from\"../../ResetPassword/ResetPassword.mjs\";const a={Header:()=>null,SignIn:{Header:r.Header,Footer:r.Footer},SignUp:{Header:e.Header,FormFields:e.FormFields,Footer:e.Footer},ConfirmSignUp:{Header:o.Header,Footer:o.Footer},SetupTOTP:{Header:m.Header,Footer:m.Footer},ConfirmResetPassword:{Header:n.Header,Footer:n.Footer},ConfirmSignIn:{Header:i.Header,Footer:i.Footer},VerifyUser:{Header:d.Header,Footer:d.Footer},ConfirmVerifyUser:{Header:t.Header,Footer:t.Footer},ForceNewPassword:{FormFields:s.FormFields},ResetPassword:{Header:F.Header,Footer:F.Footer},Footer:()=>null};export{a as defaultComponents};\n","const o=\"4.6.5\";export{o as VERSION};\n","import*as e from\"react\";import{configureComponent as s,isFunction as t}from\"@aws-amplify/ui\";import{AuthenticatorProvider as r,useAuthenticator as o,useAuthenticatorInitMachine as i}from\"@aws-amplify/ui-react-core\";import{CustomComponentsContext as m}from\"./hooks/useCustomComponents/index.mjs\";import\"../../primitives/View/View.mjs\";import{Router as n}from\"./Router/Router.mjs\";import{SetupTOTP as a}from\"./SetupTOTP/SetupTOTP.mjs\";import{SignIn as p}from\"./SignIn/SignIn.mjs\";import{SignUp as u}from\"./SignUp/SignUp.mjs\";import{ForceNewPassword as c}from\"./ForceNewPassword/ForceNewPassword.mjs\";import\"./ResetPassword/ConfirmResetPassword.mjs\";import{ResetPassword as l}from\"./ResetPassword/ResetPassword.mjs\";import{defaultComponents as f}from\"./hooks/useCustomComponents/defaultComponents.mjs\";import{VERSION as g}from\"../../version.mjs\";function d({children:s,className:r,components:a,formFields:p,hideSignUp:u,initialState:c,loginMechanisms:l,signUpAttributes:g,services:d,socialProviders:w,variation:P}){const{route:j,signOut:S,user:v}=o((({route:e,signOut:s,user:t})=>[e,s,t]));i({initialState:c,loginMechanisms:l,services:d,signUpAttributes:g,socialProviders:w,formFields:p});const O=e.useMemo((()=>({components:Object.assign(Object.assign({},f),a)})),[a]);return\"authenticated\"===j||\"signOut\"===j?s?e.createElement(e.Fragment,null,t(s)?s({signOut:S,user:v}):s):null:e.createElement(m.Provider,{value:O},e.createElement(n,{className:r,hideSignUp:u,variation:P}))}function w(t){return e.useEffect((()=>{s({packageName:\"@aws-amplify/ui-react\",version:g})}),[]),e.createElement(r,null,e.createElement(d,Object.assign({},t)))}w.Provider=r,w.ResetPassword=l,w.SetupTOTP=a,w.SignIn=p,w.SignUp=u,w.ForceNewPassword=c;export{w as Authenticator,d as AuthenticatorInternal};\n","/**\n * Returns a function, that, as long as it continues to be invoked, will not\n * be triggered. The function will be called after it stops being called for\n * N milliseconds. If `immediate` is passed, trigger the function on the\n * leading edge, instead of the trailing. The function also has a property 'clear' \n * that is a function which will clear the timer to prevent previously scheduled executions. \n *\n * @source underscore.js\n * @see http://unscriptable.com/2009/03/20/debouncing-javascript-methods/\n * @param {Function} function to wrap\n * @param {Number} timeout in ms (`100`)\n * @param {Boolean} whether to execute at the beginning (`false`)\n * @api public\n */\nfunction debounce(func, wait, immediate){\n var timeout, args, context, timestamp, result;\n if (null == wait) wait = 100;\n\n function later() {\n var last = Date.now() - timestamp;\n\n if (last < wait && last >= 0) {\n timeout = setTimeout(later, wait - last);\n } else {\n timeout = null;\n if (!immediate) {\n result = func.apply(context, args);\n context = args = null;\n }\n }\n };\n\n var debounced = function(){\n context = this;\n args = arguments;\n timestamp = Date.now();\n var callNow = immediate && !timeout;\n if (!timeout) timeout = setTimeout(later, wait);\n if (callNow) {\n result = func.apply(context, args);\n context = args = null;\n }\n\n return result;\n };\n\n debounced.clear = function() {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n };\n \n debounced.flush = function() {\n if (timeout) {\n result = func.apply(context, args);\n context = args = null;\n \n clearTimeout(timeout);\n timeout = null;\n }\n };\n\n return debounced;\n};\n\n// Adds compatibility for ES modules\ndebounce.debounce = debounce;\n\nmodule.exports = debounce;\n","import { createSidecarMedium } from 'use-sidecar';\nexport var effectCar = createSidecarMedium();\n","import { __assign, __rest } from \"tslib\";\nimport * as React from 'react';\nimport { fullWidthClassName, zeroRightClassName } from 'react-remove-scroll-bar/constants';\nimport { useMergeRefs } from 'use-callback-ref';\nimport { effectCar } from './medium';\nvar nothing = function () {\n return;\n};\n/**\n * Removes scrollbar from the page and contain the scroll within the Lock\n */\nvar RemoveScroll = React.forwardRef(function (props, parentRef) {\n var ref = React.useRef(null);\n var _a = React.useState({\n onScrollCapture: nothing,\n onWheelCapture: nothing,\n onTouchMoveCapture: nothing,\n }), callbacks = _a[0], setCallbacks = _a[1];\n var forwardProps = props.forwardProps, children = props.children, className = props.className, removeScrollBar = props.removeScrollBar, enabled = props.enabled, shards = props.shards, sideCar = props.sideCar, noIsolation = props.noIsolation, inert = props.inert, allowPinchZoom = props.allowPinchZoom, _b = props.as, Container = _b === void 0 ? 'div' : _b, gapMode = props.gapMode, rest = __rest(props, [\"forwardProps\", \"children\", \"className\", \"removeScrollBar\", \"enabled\", \"shards\", \"sideCar\", \"noIsolation\", \"inert\", \"allowPinchZoom\", \"as\", \"gapMode\"]);\n var SideCar = sideCar;\n var containerRef = useMergeRefs([ref, parentRef]);\n var containerProps = __assign(__assign({}, rest), callbacks);\n return (React.createElement(React.Fragment, null,\n enabled && (React.createElement(SideCar, { sideCar: effectCar, removeScrollBar: removeScrollBar, shards: shards, noIsolation: noIsolation, inert: inert, setCallbacks: setCallbacks, allowPinchZoom: !!allowPinchZoom, lockRef: ref, gapMode: gapMode })),\n forwardProps ? (React.cloneElement(React.Children.only(children), __assign(__assign({}, containerProps), { ref: containerRef }))) : (React.createElement(Container, __assign({}, containerProps, { className: className, ref: containerRef }), children))));\n});\nRemoveScroll.defaultProps = {\n enabled: true,\n removeScrollBar: true,\n inert: false,\n};\nRemoveScroll.classNames = {\n fullWidth: fullWidthClassName,\n zeroRight: zeroRightClassName,\n};\nexport { RemoveScroll };\n","var passiveSupported = false;\nif (typeof window !== 'undefined') {\n try {\n var options = Object.defineProperty({}, 'passive', {\n get: function () {\n passiveSupported = true;\n return true;\n },\n });\n // @ts-ignore\n window.addEventListener('test', options, options);\n // @ts-ignore\n window.removeEventListener('test', options, options);\n }\n catch (err) {\n passiveSupported = false;\n }\n}\nexport var nonPassive = passiveSupported ? { passive: false } : false;\n","var alwaysContainsScroll = function (node) {\n // textarea will always _contain_ scroll inside self. It only can be hidden\n return node.tagName === 'TEXTAREA';\n};\nvar elementCanBeScrolled = function (node, overflow) {\n if (!(node instanceof Element)) {\n return false;\n }\n var styles = window.getComputedStyle(node);\n return (\n // not-not-scrollable\n styles[overflow] !== 'hidden' &&\n // contains scroll inside self\n !(styles.overflowY === styles.overflowX && !alwaysContainsScroll(node) && styles[overflow] === 'visible'));\n};\nvar elementCouldBeVScrolled = function (node) { return elementCanBeScrolled(node, 'overflowY'); };\nvar elementCouldBeHScrolled = function (node) { return elementCanBeScrolled(node, 'overflowX'); };\nexport var locationCouldBeScrolled = function (axis, node) {\n var ownerDocument = node.ownerDocument;\n var current = node;\n do {\n // Skip over shadow root\n if (typeof ShadowRoot !== 'undefined' && current instanceof ShadowRoot) {\n current = current.host;\n }\n var isScrollable = elementCouldBeScrolled(axis, current);\n if (isScrollable) {\n var _a = getScrollVariables(axis, current), scrollHeight = _a[1], clientHeight = _a[2];\n if (scrollHeight > clientHeight) {\n return true;\n }\n }\n current = current.parentNode;\n } while (current && current !== ownerDocument.body);\n return false;\n};\nvar getVScrollVariables = function (_a) {\n var scrollTop = _a.scrollTop, scrollHeight = _a.scrollHeight, clientHeight = _a.clientHeight;\n return [\n scrollTop,\n scrollHeight,\n clientHeight,\n ];\n};\nvar getHScrollVariables = function (_a) {\n var scrollLeft = _a.scrollLeft, scrollWidth = _a.scrollWidth, clientWidth = _a.clientWidth;\n return [\n scrollLeft,\n scrollWidth,\n clientWidth,\n ];\n};\nvar elementCouldBeScrolled = function (axis, node) {\n return axis === 'v' ? elementCouldBeVScrolled(node) : elementCouldBeHScrolled(node);\n};\nvar getScrollVariables = function (axis, node) {\n return axis === 'v' ? getVScrollVariables(node) : getHScrollVariables(node);\n};\nvar getDirectionFactor = function (axis, direction) {\n /**\n * If the element's direction is rtl (right-to-left), then scrollLeft is 0 when the scrollbar is at its rightmost position,\n * and then increasingly negative as you scroll towards the end of the content.\n * @see https://developer.mozilla.org/en-US/docs/Web/API/Element/scrollLeft\n */\n return axis === 'h' && direction === 'rtl' ? -1 : 1;\n};\nexport var handleScroll = function (axis, endTarget, event, sourceDelta, noOverscroll) {\n var directionFactor = getDirectionFactor(axis, window.getComputedStyle(endTarget).direction);\n var delta = directionFactor * sourceDelta;\n // find scrollable target\n var target = event.target;\n var targetInLock = endTarget.contains(target);\n var shouldCancelScroll = false;\n var isDeltaPositive = delta > 0;\n var availableScroll = 0;\n var availableScrollTop = 0;\n do {\n var _a = getScrollVariables(axis, target), position = _a[0], scroll_1 = _a[1], capacity = _a[2];\n var elementScroll = scroll_1 - capacity - directionFactor * position;\n if (position || elementScroll) {\n if (elementCouldBeScrolled(axis, target)) {\n availableScroll += elementScroll;\n availableScrollTop += position;\n }\n }\n if (target instanceof ShadowRoot) {\n target = target.host;\n }\n else {\n target = target.parentNode;\n }\n } while (\n // portaled content\n (!targetInLock && target !== document.body) ||\n // self content\n (targetInLock && (endTarget.contains(target) || endTarget === target)));\n // handle epsilon around 0 (non standard zoom levels)\n if (isDeltaPositive &&\n ((noOverscroll && Math.abs(availableScroll) < 1) || (!noOverscroll && delta > availableScroll))) {\n shouldCancelScroll = true;\n }\n else if (!isDeltaPositive &&\n ((noOverscroll && Math.abs(availableScrollTop) < 1) || (!noOverscroll && -delta > availableScrollTop))) {\n shouldCancelScroll = true;\n }\n return shouldCancelScroll;\n};\n","import { __spreadArray } from \"tslib\";\nimport * as React from 'react';\nimport { RemoveScrollBar } from 'react-remove-scroll-bar';\nimport { styleSingleton } from 'react-style-singleton';\nimport { nonPassive } from './aggresiveCapture';\nimport { handleScroll, locationCouldBeScrolled } from './handleScroll';\nexport var getTouchXY = function (event) {\n return 'changedTouches' in event ? [event.changedTouches[0].clientX, event.changedTouches[0].clientY] : [0, 0];\n};\nexport var getDeltaXY = function (event) { return [event.deltaX, event.deltaY]; };\nvar extractRef = function (ref) {\n return ref && 'current' in ref ? ref.current : ref;\n};\nvar deltaCompare = function (x, y) { return x[0] === y[0] && x[1] === y[1]; };\nvar generateStyle = function (id) { return \"\\n .block-interactivity-\".concat(id, \" {pointer-events: none;}\\n .allow-interactivity-\").concat(id, \" {pointer-events: all;}\\n\"); };\nvar idCounter = 0;\nvar lockStack = [];\nexport function RemoveScrollSideCar(props) {\n var shouldPreventQueue = React.useRef([]);\n var touchStartRef = React.useRef([0, 0]);\n var activeAxis = React.useRef();\n var id = React.useState(idCounter++)[0];\n var Style = React.useState(styleSingleton)[0];\n var lastProps = React.useRef(props);\n React.useEffect(function () {\n lastProps.current = props;\n }, [props]);\n React.useEffect(function () {\n if (props.inert) {\n document.body.classList.add(\"block-interactivity-\".concat(id));\n var allow_1 = __spreadArray([props.lockRef.current], (props.shards || []).map(extractRef), true).filter(Boolean);\n allow_1.forEach(function (el) { return el.classList.add(\"allow-interactivity-\".concat(id)); });\n return function () {\n document.body.classList.remove(\"block-interactivity-\".concat(id));\n allow_1.forEach(function (el) { return el.classList.remove(\"allow-interactivity-\".concat(id)); });\n };\n }\n return;\n }, [props.inert, props.lockRef.current, props.shards]);\n var shouldCancelEvent = React.useCallback(function (event, parent) {\n if (('touches' in event && event.touches.length === 2) || (event.type === 'wheel' && event.ctrlKey)) {\n return !lastProps.current.allowPinchZoom;\n }\n var touch = getTouchXY(event);\n var touchStart = touchStartRef.current;\n var deltaX = 'deltaX' in event ? event.deltaX : touchStart[0] - touch[0];\n var deltaY = 'deltaY' in event ? event.deltaY : touchStart[1] - touch[1];\n var currentAxis;\n var target = event.target;\n var moveDirection = Math.abs(deltaX) > Math.abs(deltaY) ? 'h' : 'v';\n // allow horizontal touch move on Range inputs. They will not cause any scroll\n if ('touches' in event && moveDirection === 'h' && target.type === 'range') {\n return false;\n }\n var canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);\n if (!canBeScrolledInMainDirection) {\n return true;\n }\n if (canBeScrolledInMainDirection) {\n currentAxis = moveDirection;\n }\n else {\n currentAxis = moveDirection === 'v' ? 'h' : 'v';\n canBeScrolledInMainDirection = locationCouldBeScrolled(moveDirection, target);\n // other axis might be not scrollable\n }\n if (!canBeScrolledInMainDirection) {\n return false;\n }\n if (!activeAxis.current && 'changedTouches' in event && (deltaX || deltaY)) {\n activeAxis.current = currentAxis;\n }\n if (!currentAxis) {\n return true;\n }\n var cancelingAxis = activeAxis.current || currentAxis;\n return handleScroll(cancelingAxis, parent, event, cancelingAxis === 'h' ? deltaX : deltaY, true);\n }, []);\n var shouldPrevent = React.useCallback(function (_event) {\n var event = _event;\n if (!lockStack.length || lockStack[lockStack.length - 1] !== Style) {\n // not the last active\n return;\n }\n var delta = 'deltaY' in event ? getDeltaXY(event) : getTouchXY(event);\n var sourceEvent = shouldPreventQueue.current.filter(function (e) { return e.name === event.type && (e.target === event.target || event.target === e.shadowParent) && deltaCompare(e.delta, delta); })[0];\n // self event, and should be canceled\n if (sourceEvent && sourceEvent.should) {\n if (event.cancelable) {\n event.preventDefault();\n }\n return;\n }\n // outside or shard event\n if (!sourceEvent) {\n var shardNodes = (lastProps.current.shards || [])\n .map(extractRef)\n .filter(Boolean)\n .filter(function (node) { return node.contains(event.target); });\n var shouldStop = shardNodes.length > 0 ? shouldCancelEvent(event, shardNodes[0]) : !lastProps.current.noIsolation;\n if (shouldStop) {\n if (event.cancelable) {\n event.preventDefault();\n }\n }\n }\n }, []);\n var shouldCancel = React.useCallback(function (name, delta, target, should) {\n var event = { name: name, delta: delta, target: target, should: should, shadowParent: getOutermostShadowParent(target) };\n shouldPreventQueue.current.push(event);\n setTimeout(function () {\n shouldPreventQueue.current = shouldPreventQueue.current.filter(function (e) { return e !== event; });\n }, 1);\n }, []);\n var scrollTouchStart = React.useCallback(function (event) {\n touchStartRef.current = getTouchXY(event);\n activeAxis.current = undefined;\n }, []);\n var scrollWheel = React.useCallback(function (event) {\n shouldCancel(event.type, getDeltaXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));\n }, []);\n var scrollTouchMove = React.useCallback(function (event) {\n shouldCancel(event.type, getTouchXY(event), event.target, shouldCancelEvent(event, props.lockRef.current));\n }, []);\n React.useEffect(function () {\n lockStack.push(Style);\n props.setCallbacks({\n onScrollCapture: scrollWheel,\n onWheelCapture: scrollWheel,\n onTouchMoveCapture: scrollTouchMove,\n });\n document.addEventListener('wheel', shouldPrevent, nonPassive);\n document.addEventListener('touchmove', shouldPrevent, nonPassive);\n document.addEventListener('touchstart', scrollTouchStart, nonPassive);\n return function () {\n lockStack = lockStack.filter(function (inst) { return inst !== Style; });\n document.removeEventListener('wheel', shouldPrevent, nonPassive);\n document.removeEventListener('touchmove', shouldPrevent, nonPassive);\n document.removeEventListener('touchstart', scrollTouchStart, nonPassive);\n };\n }, []);\n var removeScrollBar = props.removeScrollBar, inert = props.inert;\n return (React.createElement(React.Fragment, null,\n inert ? React.createElement(Style, { styles: generateStyle(id) }) : null,\n removeScrollBar ? React.createElement(RemoveScrollBar, { gapMode: props.gapMode }) : null));\n}\nfunction getOutermostShadowParent(node) {\n var shadowParent = null;\n while (node !== null) {\n if (node instanceof ShadowRoot) {\n shadowParent = node.host;\n node = node.host;\n }\n node = node.parentNode;\n }\n return shadowParent;\n}\n","import { exportSidecar } from 'use-sidecar';\nimport { RemoveScrollSideCar } from './SideEffect';\nimport { effectCar } from './medium';\nexport default exportSidecar(effectCar, RemoveScrollSideCar);\n","import { __assign } from \"tslib\";\nimport * as React from 'react';\nimport { RemoveScroll } from './UI';\nimport SideCar from './sidecar';\nvar ReactRemoveScroll = React.forwardRef(function (props, ref) { return (React.createElement(RemoveScroll, __assign({}, props, { ref: ref, sideCar: SideCar }))); });\nReactRemoveScroll.classNames = RemoveScroll.classNames;\nexport default ReactRemoveScroll;\n","function findElementAncestor(element, selector) {\n let _element = element;\n while ((_element = _element.parentElement) && !_element.matches(selector))\n ;\n return _element;\n}\n\nexport { findElementAncestor };\n//# sourceMappingURL=find-element-ancestor.js.map\n","import { findElementAncestor } from '../find-element-ancestor/find-element-ancestor.js';\n\nfunction getPreviousIndex(current, elements, loop) {\n for (let i = current - 1; i >= 0; i -= 1) {\n if (!elements[i].disabled) {\n return i;\n }\n }\n if (loop) {\n for (let i = elements.length - 1; i > -1; i -= 1) {\n if (!elements[i].disabled) {\n return i;\n }\n }\n }\n return current;\n}\nfunction getNextIndex(current, elements, loop) {\n for (let i = current + 1; i < elements.length; i += 1) {\n if (!elements[i].disabled) {\n return i;\n }\n }\n if (loop) {\n for (let i = 0; i < elements.length; i += 1) {\n if (!elements[i].disabled) {\n return i;\n }\n }\n }\n return current;\n}\nfunction onSameLevel(target, sibling, parentSelector) {\n return findElementAncestor(target, parentSelector) === findElementAncestor(sibling, parentSelector);\n}\nfunction createScopedKeydownHandler({\n parentSelector,\n siblingSelector,\n onKeyDown,\n loop = true,\n activateOnFocus = false,\n dir = \"rtl\",\n orientation\n}) {\n return (event) => {\n var _a;\n onKeyDown == null ? void 0 : onKeyDown(event);\n const elements = Array.from(((_a = findElementAncestor(event.currentTarget, parentSelector)) == null ? void 0 : _a.querySelectorAll(siblingSelector)) || []).filter((node) => onSameLevel(event.currentTarget, node, parentSelector));\n const current = elements.findIndex((el) => event.currentTarget === el);\n const _nextIndex = getNextIndex(current, elements, loop);\n const _previousIndex = getPreviousIndex(current, elements, loop);\n const nextIndex = dir === \"rtl\" ? _previousIndex : _nextIndex;\n const previousIndex = dir === \"rtl\" ? _nextIndex : _previousIndex;\n switch (event.key) {\n case \"ArrowRight\": {\n if (orientation === \"horizontal\") {\n event.stopPropagation();\n event.preventDefault();\n elements[nextIndex].focus();\n activateOnFocus && elements[nextIndex].click();\n }\n break;\n }\n case \"ArrowLeft\": {\n if (orientation === \"horizontal\") {\n event.stopPropagation();\n event.preventDefault();\n elements[previousIndex].focus();\n activateOnFocus && elements[previousIndex].click();\n }\n break;\n }\n case \"ArrowUp\": {\n if (orientation === \"vertical\") {\n event.stopPropagation();\n event.preventDefault();\n elements[_previousIndex].focus();\n activateOnFocus && elements[_previousIndex].click();\n }\n break;\n }\n case \"ArrowDown\": {\n if (orientation === \"vertical\") {\n event.stopPropagation();\n event.preventDefault();\n elements[_nextIndex].focus();\n activateOnFocus && elements[_nextIndex].click();\n }\n break;\n }\n case \"Home\": {\n event.stopPropagation();\n event.preventDefault();\n !elements[0].disabled && elements[0].focus();\n break;\n }\n case \"End\": {\n event.stopPropagation();\n event.preventDefault();\n const last = elements.length - 1;\n !elements[last].disabled && elements[last].focus();\n break;\n }\n }\n };\n}\n\nexport { createScopedKeydownHandler };\n//# sourceMappingURL=create-scoped-keydown-handler.js.map\n","import { findElementAncestor } from '../find-element-ancestor/find-element-ancestor.js';\n\nfunction getContextItemIndex(elementSelector, parentSelector, node) {\n var _a;\n if (!node) {\n return null;\n }\n return Array.from(((_a = findElementAncestor(node, parentSelector)) == null ? void 0 : _a.querySelectorAll(elementSelector)) || []).findIndex((element) => element === node);\n}\n\nexport { getContextItemIndex };\n//# sourceMappingURL=get-context-item-index.js.map\n","import React, { createContext, useContext } from 'react';\n\nfunction createSafeContext(errorMessage) {\n const Context = createContext(null);\n const useSafeContext = () => {\n const ctx = useContext(Context);\n if (ctx === null) {\n throw new Error(errorMessage);\n }\n return ctx;\n };\n const Provider = ({ children, value }) => /* @__PURE__ */ React.createElement(Context.Provider, {\n value\n }, children);\n return [Provider, useSafeContext];\n}\n\nexport { createSafeContext };\n//# sourceMappingURL=create-safe-context.js.map\n","function packSx(sx) {\n return Array.isArray(sx) ? sx : [sx];\n}\n\nexport { packSx };\n//# sourceMappingURL=pack-sx.js.map\n","function getSafeId(uid, errorMessage) {\n return (value) => {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new Error(errorMessage);\n }\n return `${uid}-${value}`;\n };\n}\n\nexport { getSafeId };\n//# sourceMappingURL=get-safe-id.js.map\n","const noop = () => {\n};\n\nexport { noop };\n//# sourceMappingURL=noop.js.map\n","import { noop } from '../noop/noop.js';\n\nfunction closeOnEscape(callback, options = { active: true }) {\n if (typeof callback !== \"function\" || !options.active) {\n return options.onKeyDown || noop;\n }\n return (event) => {\n var _a;\n if (event.key === \"Escape\") {\n callback(event);\n (_a = options.onTrigger) == null ? void 0 : _a.call(options);\n }\n };\n}\n\nexport { closeOnEscape };\n//# sourceMappingURL=close-on-escape.js.map\n","function createEventHandler(parentEventHandler, eventHandler) {\n return (event) => {\n parentEventHandler == null ? void 0 : parentEventHandler(event);\n eventHandler == null ? void 0 : eventHandler(event);\n };\n}\n\nexport { createEventHandler };\n//# sourceMappingURL=create-event-handler.js.map\n","import { useState } from 'react';\n\nfunction useHovered() {\n const [hovered, setHovered] = useState(-1);\n const resetHovered = () => setHovered(-1);\n return [hovered, { setHovered, resetHovered }];\n}\n\nexport { useHovered };\n//# sourceMappingURL=use-hovered.js.map\n","function groupOptions({ data }) {\n const sortedData = [];\n const unGroupedData = [];\n const groupedData = data.reduce((acc, item, index) => {\n if (item.group) {\n if (acc[item.group])\n acc[item.group].push(index);\n else\n acc[item.group] = [index];\n } else {\n unGroupedData.push(index);\n }\n return acc;\n }, {});\n Object.keys(groupedData).forEach((groupName) => {\n sortedData.push(...groupedData[groupName].map((index) => data[index]));\n });\n sortedData.push(...unGroupedData.map((itemIndex) => data[itemIndex]));\n return sortedData;\n}\nfunction getGroupedOptions(data) {\n const sorted = groupOptions({ data });\n const unGrouped = [];\n const grouped = [];\n let groupName = null;\n sorted.forEach((item, index) => {\n if (!item.group) {\n unGrouped.push({ type: \"item\", item, index });\n } else {\n if (groupName !== item.group) {\n groupName = item.group;\n grouped.push({ type: \"label\", label: groupName });\n }\n grouped.push({ type: \"item\", item, index });\n }\n });\n return {\n grouped,\n unGrouped,\n items: [...grouped, ...unGrouped],\n hasItems: grouped.length > 0 || unGrouped.length > 0\n };\n}\n\nexport { getGroupedOptions, groupOptions };\n//# sourceMappingURL=group-options.js.map\n","import { useLayoutEffect, useEffect } from 'react';\n\nfunction dispatchEvent(type, detail) {\n window.dispatchEvent(new CustomEvent(type, { detail }));\n}\nconst useIsomorphicEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\nfunction createUseExternalEvents(prefix) {\n function _useExternalEvents(events) {\n const handlers = Object.keys(events).reduce((acc, eventKey) => {\n acc[`${prefix}:${eventKey}`] = (event) => events[eventKey](event.detail);\n return acc;\n }, {});\n useIsomorphicEffect(() => {\n Object.keys(handlers).forEach((eventKey) => {\n window.removeEventListener(eventKey, handlers[eventKey]);\n window.addEventListener(eventKey, handlers[eventKey]);\n });\n return () => Object.keys(handlers).forEach((eventKey) => {\n window.removeEventListener(eventKey, handlers[eventKey]);\n });\n }, [handlers]);\n }\n function createEvent(event) {\n return (...payload) => dispatchEvent(`${prefix}:${String(event)}`, payload[0]);\n }\n return [_useExternalEvents, createEvent];\n}\n\nexport { createUseExternalEvents };\n//# sourceMappingURL=create-use-external-events.js.map\n","import React from 'react';\n\nfunction isElement(value) {\n if (Array.isArray(value) || value === null) {\n return false;\n }\n if (typeof value === \"object\") {\n if (value.type === React.Fragment) {\n return false;\n }\n return true;\n }\n return false;\n}\n\nexport { isElement };\n//# sourceMappingURL=is-element.js.map\n","function toVal(mix) {\n\tvar k, y, str='';\n\n\tif (typeof mix === 'string' || typeof mix === 'number') {\n\t\tstr += mix;\n\t} else if (typeof mix === 'object') {\n\t\tif (Array.isArray(mix)) {\n\t\t\tfor (k=0; k < mix.length; k++) {\n\t\t\t\tif (mix[k]) {\n\t\t\t\t\tif (y = toVal(mix[k])) {\n\t\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\t\tstr += y;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\tfor (k in mix) {\n\t\t\t\tif (mix[k]) {\n\t\t\t\t\tstr && (str += ' ');\n\t\t\t\t\tstr += k;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n\treturn str;\n}\n\nexport default function () {\n\tvar i=0, tmp, x, str='';\n\twhile (i < arguments.length) {\n\t\tif (tmp = arguments[i++]) {\n\t\t\tif (x = toVal(tmp)) {\n\t\t\t\tstr && (str += ' ');\n\t\t\t\tstr += x\n\t\t\t}\n\t\t}\n\t}\n\treturn str;\n}\n","const DEFAULT_COLORS = {\n dark: [\n \"#C1C2C5\",\n \"#A6A7AB\",\n \"#909296\",\n \"#5c5f66\",\n \"#373A40\",\n \"#2C2E33\",\n \"#25262b\",\n \"#1A1B1E\",\n \"#141517\",\n \"#101113\"\n ],\n gray: [\n \"#f8f9fa\",\n \"#f1f3f5\",\n \"#e9ecef\",\n \"#dee2e6\",\n \"#ced4da\",\n \"#adb5bd\",\n \"#868e96\",\n \"#495057\",\n \"#343a40\",\n \"#212529\"\n ],\n red: [\n \"#fff5f5\",\n \"#ffe3e3\",\n \"#ffc9c9\",\n \"#ffa8a8\",\n \"#ff8787\",\n \"#ff6b6b\",\n \"#fa5252\",\n \"#f03e3e\",\n \"#e03131\",\n \"#c92a2a\"\n ],\n pink: [\n \"#fff0f6\",\n \"#ffdeeb\",\n \"#fcc2d7\",\n \"#faa2c1\",\n \"#f783ac\",\n \"#f06595\",\n \"#e64980\",\n \"#d6336c\",\n \"#c2255c\",\n \"#a61e4d\"\n ],\n grape: [\n \"#f8f0fc\",\n \"#f3d9fa\",\n \"#eebefa\",\n \"#e599f7\",\n \"#da77f2\",\n \"#cc5de8\",\n \"#be4bdb\",\n \"#ae3ec9\",\n \"#9c36b5\",\n \"#862e9c\"\n ],\n violet: [\n \"#f3f0ff\",\n \"#e5dbff\",\n \"#d0bfff\",\n \"#b197fc\",\n \"#9775fa\",\n \"#845ef7\",\n \"#7950f2\",\n \"#7048e8\",\n \"#6741d9\",\n \"#5f3dc4\"\n ],\n indigo: [\n \"#edf2ff\",\n \"#dbe4ff\",\n \"#bac8ff\",\n \"#91a7ff\",\n \"#748ffc\",\n \"#5c7cfa\",\n \"#4c6ef5\",\n \"#4263eb\",\n \"#3b5bdb\",\n \"#364fc7\"\n ],\n blue: [\n \"#e7f5ff\",\n \"#d0ebff\",\n \"#a5d8ff\",\n \"#74c0fc\",\n \"#4dabf7\",\n \"#339af0\",\n \"#228be6\",\n \"#1c7ed6\",\n \"#1971c2\",\n \"#1864ab\"\n ],\n cyan: [\n \"#e3fafc\",\n \"#c5f6fa\",\n \"#99e9f2\",\n \"#66d9e8\",\n \"#3bc9db\",\n \"#22b8cf\",\n \"#15aabf\",\n \"#1098ad\",\n \"#0c8599\",\n \"#0b7285\"\n ],\n teal: [\n \"#e6fcf5\",\n \"#c3fae8\",\n \"#96f2d7\",\n \"#63e6be\",\n \"#38d9a9\",\n \"#20c997\",\n \"#12b886\",\n \"#0ca678\",\n \"#099268\",\n \"#087f5b\"\n ],\n green: [\n \"#ebfbee\",\n \"#d3f9d8\",\n \"#b2f2bb\",\n \"#8ce99a\",\n \"#69db7c\",\n \"#51cf66\",\n \"#40c057\",\n \"#37b24d\",\n \"#2f9e44\",\n \"#2b8a3e\"\n ],\n lime: [\n \"#f4fce3\",\n \"#e9fac8\",\n \"#d8f5a2\",\n \"#c0eb75\",\n \"#a9e34b\",\n \"#94d82d\",\n \"#82c91e\",\n \"#74b816\",\n \"#66a80f\",\n \"#5c940d\"\n ],\n yellow: [\n \"#fff9db\",\n \"#fff3bf\",\n \"#ffec99\",\n \"#ffe066\",\n \"#ffd43b\",\n \"#fcc419\",\n \"#fab005\",\n \"#f59f00\",\n \"#f08c00\",\n \"#e67700\"\n ],\n orange: [\n \"#fff4e6\",\n \"#ffe8cc\",\n \"#ffd8a8\",\n \"#ffc078\",\n \"#ffa94d\",\n \"#ff922b\",\n \"#fd7e14\",\n \"#f76707\",\n \"#e8590c\",\n \"#d9480f\"\n ]\n};\n\nexport { DEFAULT_COLORS };\n//# sourceMappingURL=default-colors.js.map\n","function fontStyles(theme) {\n return () => ({ fontFamily: theme.fontFamily || \"sans-serif\" });\n}\n\nexport { fontStyles };\n//# sourceMappingURL=font-styles.js.map\n","var __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nfunction focusStyles(theme) {\n return (selector) => ({\n WebkitTapHighlightColor: \"transparent\",\n [selector || \"&:focus\"]: __spreadValues({}, theme.focusRing === \"always\" || theme.focusRing === \"auto\" ? theme.focusRingStyles.styles(theme) : theme.focusRingStyles.resetStyles(theme)),\n [selector ? selector.replace(\":focus\", \":focus:not(:focus-visible)\") : \"&:focus:not(:focus-visible)\"]: __spreadValues({}, theme.focusRing === \"auto\" || theme.focusRing === \"never\" ? theme.focusRingStyles.resetStyles(theme) : null)\n });\n}\n\nexport { focusStyles };\n//# sourceMappingURL=focus-styles.js.map\n","function primaryShade(theme) {\n return (colorScheme) => {\n if (typeof theme.primaryShade === \"number\") {\n return theme.primaryShade;\n }\n return theme.primaryShade[colorScheme || theme.colorScheme];\n };\n}\n\nexport { primaryShade };\n//# sourceMappingURL=primary-shade.js.map\n","import { primaryShade } from '../primary-shade/primary-shade.js';\n\nfunction themeColor(theme) {\n const getPrimaryShade = primaryShade(theme);\n return (color, shade, primaryFallback = true, useSplittedShade = true) => {\n if (typeof color === \"string\" && color.includes(\".\")) {\n const [splitterColor, _splittedShade] = color.split(\".\");\n const splittedShade = parseInt(_splittedShade, 10);\n if (splitterColor in theme.colors && splittedShade >= 0 && splittedShade < 10) {\n return theme.colors[splitterColor][typeof shade === \"number\" && !useSplittedShade ? shade : splittedShade];\n }\n }\n const _shade = typeof shade === \"number\" ? shade : getPrimaryShade();\n return color in theme.colors ? theme.colors[color][_shade] : primaryFallback ? theme.colors[theme.primaryColor][_shade] : color;\n };\n}\n\nexport { themeColor };\n//# sourceMappingURL=theme-color.js.map\n","function getGradientColorStops(colors) {\n let stops = \"\";\n for (let i = 1; i < colors.length - 1; i += 1) {\n stops += `${colors[i]} ${i / (colors.length - 1) * 100}%, `;\n }\n return `${colors[0]} 0%, ${stops}${colors[colors.length - 1]} 100%`;\n}\n\nexport { getGradientColorStops };\n//# sourceMappingURL=get-gradient-color-stops.js.map\n","import { themeColor } from '../theme-color/theme-color.js';\nimport { primaryShade } from '../primary-shade/primary-shade.js';\nimport { getGradientColorStops } from './get-gradient-color-stops/get-gradient-color-stops.js';\n\nfunction linearGradient(deg, ...colors) {\n return `linear-gradient(${deg}deg, ${getGradientColorStops(colors)})`;\n}\nfunction radialGradient(...colors) {\n return `radial-gradient(circle, ${getGradientColorStops(colors)})`;\n}\nfunction gradient(theme) {\n const getThemeColor = themeColor(theme);\n const getPrimaryShade = primaryShade(theme);\n return (payload) => {\n const merged = {\n from: (payload == null ? void 0 : payload.from) || theme.defaultGradient.from,\n to: (payload == null ? void 0 : payload.to) || theme.defaultGradient.to,\n deg: (payload == null ? void 0 : payload.deg) || theme.defaultGradient.deg\n };\n return `linear-gradient(${merged.deg}deg, ${getThemeColor(merged.from, getPrimaryShade(), false)} 0%, ${getThemeColor(merged.to, getPrimaryShade(), false)} 100%)`;\n };\n}\n\nexport { gradient, linearGradient, radialGradient };\n//# sourceMappingURL=gradient.js.map\n","function createConverter(units) {\n return (px) => {\n if (typeof px === \"number\") {\n return `${px / 16}${units}`;\n }\n if (typeof px === \"string\") {\n const replaced = px.replace(\"px\", \"\");\n if (!Number.isNaN(Number(replaced))) {\n return `${Number(replaced) / 16}${units}`;\n }\n }\n return px;\n };\n}\nconst rem = createConverter(\"rem\");\nconst em = createConverter(\"em\");\n\nexport { em, rem };\n//# sourceMappingURL=rem.js.map\n","import { em, rem } from '../rem/rem.js';\n\nfunction getSize({\n size,\n sizes,\n units\n}) {\n if (size in sizes) {\n return sizes[size];\n }\n if (typeof size === \"number\") {\n return units === \"em\" ? em(size) : rem(size);\n }\n return size || sizes.md;\n}\n\nexport { getSize };\n//# sourceMappingURL=get-size.js.map\n","import { em } from '../../../utils/rem/rem.js';\nimport { getSize } from '../../../utils/get-size/get-size.js';\n\nfunction getBreakpointValue(value) {\n if (typeof value === \"number\") {\n return value;\n }\n if (typeof value === \"string\" && value.includes(\"rem\")) {\n return Number(value.replace(\"rem\", \"\")) * 16;\n }\n if (typeof value === \"string\" && value.includes(\"em\")) {\n return Number(value.replace(\"em\", \"\")) * 16;\n }\n return Number(value);\n}\nfunction largerThan(theme) {\n return (breakpoint) => `@media (min-width: ${em(getBreakpointValue(getSize({ size: breakpoint, sizes: theme.breakpoints })))})`;\n}\nfunction smallerThan(theme) {\n return (breakpoint) => `@media (max-width: ${em(getBreakpointValue(getSize({ size: breakpoint, sizes: theme.breakpoints })) - 1)})`;\n}\n\nexport { getBreakpointValue, largerThan, smallerThan };\n//# sourceMappingURL=breakpoints.js.map\n","function isHexColor(hex) {\n const HEX_REGEXP = /^#?([0-9A-F]{3}){1,2}$/i;\n return HEX_REGEXP.test(hex);\n}\nfunction hexToRgba(color) {\n let hexString = color.replace(\"#\", \"\");\n if (hexString.length === 3) {\n const shorthandHex = hexString.split(\"\");\n hexString = [\n shorthandHex[0],\n shorthandHex[0],\n shorthandHex[1],\n shorthandHex[1],\n shorthandHex[2],\n shorthandHex[2]\n ].join(\"\");\n }\n const parsed = parseInt(hexString, 16);\n const r = parsed >> 16 & 255;\n const g = parsed >> 8 & 255;\n const b = parsed & 255;\n return {\n r,\n g,\n b,\n a: 1\n };\n}\nfunction rgbStringToRgba(color) {\n const [r, g, b, a] = color.replace(/[^0-9,.]/g, \"\").split(\",\").map(Number);\n return { r, g, b, a: a || 1 };\n}\nfunction toRgba(color) {\n if (isHexColor(color)) {\n return hexToRgba(color);\n }\n if (color.startsWith(\"rgb\")) {\n return rgbStringToRgba(color);\n }\n return {\n r: 0,\n g: 0,\n b: 0,\n a: 1\n };\n}\n\nexport { toRgba };\n//# sourceMappingURL=to-rgba.js.map\n","import { toRgba } from '../../../utils/to-rgba/to-rgba.js';\n\nfunction rgba(color, alpha) {\n if (typeof color !== \"string\" || alpha > 1 || alpha < 0) {\n return \"rgba(0, 0, 0, 1)\";\n }\n if (color.startsWith(\"var(--\")) {\n return color;\n }\n const { r, g, b } = toRgba(color);\n return `rgba(${r}, ${g}, ${b}, ${alpha})`;\n}\n\nexport { rgba };\n//# sourceMappingURL=rgba.js.map\n","import { rem } from '../../../utils/rem/rem.js';\n\nfunction cover(offset = 0) {\n return {\n position: \"absolute\",\n top: rem(offset),\n right: rem(offset),\n left: rem(offset),\n bottom: rem(offset)\n };\n}\n\nexport { cover };\n//# sourceMappingURL=cover.js.map\n","import { toRgba } from '../../../utils/to-rgba/to-rgba.js';\n\nfunction darken(color, alpha) {\n if (typeof color === \"string\" && color.startsWith(\"var(--\")) {\n return color;\n }\n const { r, g, b, a } = toRgba(color);\n const f = 1 - alpha;\n const dark = (input) => Math.round(input * f);\n return `rgba(${dark(r)}, ${dark(g)}, ${dark(b)}, ${a})`;\n}\n\nexport { darken };\n//# sourceMappingURL=darken.js.map\n","import { toRgba } from '../../../utils/to-rgba/to-rgba.js';\n\nfunction lighten(color, alpha) {\n if (typeof color === \"string\" && color.startsWith(\"var(--\")) {\n return color;\n }\n const { r, g, b, a } = toRgba(color);\n const light = (input) => Math.round(input + (255 - input) * alpha);\n return `rgba(${light(r)}, ${light(g)}, ${light(b)}, ${a})`;\n}\n\nexport { lighten };\n//# sourceMappingURL=lighten.js.map\n","import { rem } from '../../../utils/rem/rem.js';\n\nfunction radius(theme) {\n return (size) => {\n if (typeof size === \"number\") {\n return rem(size);\n }\n const defaultRadius = typeof theme.defaultRadius === \"number\" ? theme.defaultRadius : theme.radius[theme.defaultRadius] || theme.defaultRadius;\n return theme.radius[size] || size || defaultRadius;\n };\n}\n\nexport { radius };\n//# sourceMappingURL=radius.js.map\n","import { rgba } from '../rgba/rgba.js';\nimport { themeColor } from '../theme-color/theme-color.js';\nimport { primaryShade } from '../primary-shade/primary-shade.js';\nimport { gradient } from '../gradient/gradient.js';\n\nfunction getColorIndexInfo(color, theme) {\n if (typeof color === \"string\" && color.includes(\".\")) {\n const [splittedColor, _splittedShade] = color.split(\".\");\n const splittedShade = parseInt(_splittedShade, 10);\n if (splittedColor in theme.colors && splittedShade >= 0 && splittedShade < 10) {\n return { isSplittedColor: true, key: splittedColor, shade: splittedShade };\n }\n }\n return { isSplittedColor: false };\n}\nfunction variant(theme) {\n const getThemeColor = themeColor(theme);\n const getPrimaryShade = primaryShade(theme);\n const getGradient = gradient(theme);\n return ({ variant: variant2, color, gradient: gradient2, primaryFallback }) => {\n const colorInfo = getColorIndexInfo(color, theme);\n switch (variant2) {\n case \"light\": {\n return {\n border: \"transparent\",\n background: rgba(getThemeColor(color, theme.colorScheme === \"dark\" ? 8 : 0, primaryFallback, false), theme.colorScheme === \"dark\" ? 0.2 : 1),\n color: color === \"dark\" ? theme.colorScheme === \"dark\" ? theme.colors.dark[0] : theme.colors.dark[9] : getThemeColor(color, theme.colorScheme === \"dark\" ? 2 : getPrimaryShade(\"light\")),\n hover: rgba(getThemeColor(color, theme.colorScheme === \"dark\" ? 7 : 1, primaryFallback, false), theme.colorScheme === \"dark\" ? 0.25 : 0.65)\n };\n }\n case \"subtle\": {\n return {\n border: \"transparent\",\n background: \"transparent\",\n color: color === \"dark\" ? theme.colorScheme === \"dark\" ? theme.colors.dark[0] : theme.colors.dark[9] : getThemeColor(color, theme.colorScheme === \"dark\" ? 2 : getPrimaryShade(\"light\")),\n hover: rgba(getThemeColor(color, theme.colorScheme === \"dark\" ? 8 : 0, primaryFallback, false), theme.colorScheme === \"dark\" ? 0.2 : 1)\n };\n }\n case \"outline\": {\n return {\n border: getThemeColor(color, theme.colorScheme === \"dark\" ? 5 : getPrimaryShade(\"light\")),\n background: \"transparent\",\n color: getThemeColor(color, theme.colorScheme === \"dark\" ? 5 : getPrimaryShade(\"light\")),\n hover: theme.colorScheme === \"dark\" ? rgba(getThemeColor(color, 5, primaryFallback, false), 0.05) : rgba(getThemeColor(color, 0, primaryFallback, false), 0.35)\n };\n }\n case \"default\": {\n return {\n border: theme.colorScheme === \"dark\" ? theme.colors.dark[4] : theme.colors.gray[4],\n background: theme.colorScheme === \"dark\" ? theme.colors.dark[6] : theme.white,\n color: theme.colorScheme === \"dark\" ? theme.white : theme.black,\n hover: theme.colorScheme === \"dark\" ? theme.colors.dark[5] : theme.colors.gray[0]\n };\n }\n case \"white\": {\n return {\n border: \"transparent\",\n background: theme.white,\n color: getThemeColor(color, getPrimaryShade()),\n hover: null\n };\n }\n case \"transparent\": {\n return {\n border: \"transparent\",\n color: color === \"dark\" ? theme.colorScheme === \"dark\" ? theme.colors.dark[0] : theme.colors.dark[9] : getThemeColor(color, theme.colorScheme === \"dark\" ? 2 : getPrimaryShade(\"light\")),\n background: \"transparent\",\n hover: null\n };\n }\n case \"gradient\": {\n return {\n background: getGradient(gradient2),\n color: theme.white,\n border: \"transparent\",\n hover: null\n };\n }\n default: {\n const _primaryShade = getPrimaryShade();\n const _shade = colorInfo.isSplittedColor ? colorInfo.shade : _primaryShade;\n const _color = colorInfo.isSplittedColor ? colorInfo.key : color;\n return {\n border: \"transparent\",\n background: getThemeColor(_color, _shade, primaryFallback),\n color: theme.white,\n hover: getThemeColor(_color, _shade === 9 ? 8 : _shade + 1)\n };\n }\n }\n };\n}\n\nexport { variant };\n//# sourceMappingURL=variant.js.map\n","import { primaryShade } from '../primary-shade/primary-shade.js';\n\nfunction primaryColor(theme) {\n return (colorScheme) => {\n const shade = primaryShade(theme)(colorScheme);\n return theme.colors[theme.primaryColor][shade];\n };\n}\n\nexport { primaryColor };\n//# sourceMappingURL=primary-color.js.map\n","function hover(hoverStyle) {\n return {\n \"@media (hover: hover)\": {\n \"&:hover\": hoverStyle\n },\n \"@media (hover: none)\": {\n \"&:active\": hoverStyle\n }\n };\n}\n\nexport { hover };\n//# sourceMappingURL=hover.js.map\n","function placeholderStyles(theme) {\n return () => ({\n userSelect: \"none\",\n color: theme.colorScheme === \"dark\" ? theme.colors.dark[3] : theme.colors.gray[5]\n });\n}\n\nexport { placeholderStyles };\n//# sourceMappingURL=placeholder-styles.js.map\n","function dimmed(theme) {\n return () => theme.colorScheme === \"dark\" ? theme.colors.dark[2] : theme.colors.gray[6];\n}\n\nexport { dimmed };\n//# sourceMappingURL=dimmed.js.map\n","import { fontStyles } from './font-styles/font-styles.js';\nimport { focusStyles } from './focus-styles/focus-styles.js';\nimport { themeColor } from './theme-color/theme-color.js';\nimport { linearGradient, radialGradient, gradient } from './gradient/gradient.js';\nimport { smallerThan, largerThan } from './breakpoints/breakpoints.js';\nimport { rgba } from './rgba/rgba.js';\nimport { cover } from './cover/cover.js';\nimport { darken } from './darken/darken.js';\nimport { lighten } from './lighten/lighten.js';\nimport { radius } from './radius/radius.js';\nimport { variant } from './variant/variant.js';\nimport { primaryShade } from './primary-shade/primary-shade.js';\nimport { primaryColor } from './primary-color/primary-color.js';\nimport { hover } from './hover/hover.js';\nimport { placeholderStyles } from './placeholder-styles/placeholder-styles.js';\nimport { dimmed } from './dimmed/dimmed.js';\n\nconst fns = {\n fontStyles,\n themeColor,\n focusStyles,\n linearGradient,\n radialGradient,\n smallerThan,\n largerThan,\n rgba,\n cover,\n darken,\n lighten,\n radius,\n variant,\n primaryShade,\n hover,\n gradient,\n primaryColor,\n placeholderStyles,\n dimmed\n};\n\nexport { fns };\n//# sourceMappingURL=index.js.map\n","import { fns } from './fns/index.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nfunction attachFunctions(themeBase) {\n return __spreadProps(__spreadValues({}, themeBase), {\n fn: {\n fontStyles: fns.fontStyles(themeBase),\n themeColor: fns.themeColor(themeBase),\n focusStyles: fns.focusStyles(themeBase),\n largerThan: fns.largerThan(themeBase),\n smallerThan: fns.smallerThan(themeBase),\n radialGradient: fns.radialGradient,\n linearGradient: fns.linearGradient,\n gradient: fns.gradient(themeBase),\n rgba: fns.rgba,\n cover: fns.cover,\n lighten: fns.lighten,\n darken: fns.darken,\n primaryShade: fns.primaryShade(themeBase),\n radius: fns.radius(themeBase),\n variant: fns.variant(themeBase),\n hover: fns.hover,\n primaryColor: fns.primaryColor(themeBase),\n placeholderStyles: fns.placeholderStyles(themeBase),\n dimmed: fns.dimmed(themeBase)\n }\n });\n}\n\nexport { attachFunctions };\n//# sourceMappingURL=attach-functions.js.map\n","import { DEFAULT_COLORS } from './default-colors.js';\nimport { attachFunctions } from './functions/attach-functions.js';\n\nconst MANTINE_COLORS = Object.keys(DEFAULT_COLORS);\nconst MANTINE_SIZES = [\"xs\", \"sm\", \"md\", \"lg\", \"xl\"];\nconst _DEFAULT_THEME = {\n dir: \"ltr\",\n primaryShade: {\n light: 6,\n dark: 8\n },\n focusRing: \"auto\",\n loader: \"oval\",\n colorScheme: \"light\",\n white: \"#fff\",\n black: \"#000\",\n defaultRadius: \"sm\",\n transitionTimingFunction: \"ease\",\n colors: DEFAULT_COLORS,\n lineHeight: 1.55,\n fontFamily: \"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji\",\n fontFamilyMonospace: \"ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, Liberation Mono, Courier New, monospace\",\n primaryColor: \"blue\",\n respectReducedMotion: true,\n cursorType: \"default\",\n defaultGradient: {\n from: \"indigo\",\n to: \"cyan\",\n deg: 45\n },\n shadows: {\n xs: \"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.1)\",\n sm: \"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 0.625rem 0.9375rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.4375rem 0.4375rem -0.3125rem\",\n md: \"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.25rem 1.5625rem -0.3125rem, rgba(0, 0, 0, 0.04) 0 0.625rem 0.625rem -0.3125rem\",\n lg: \"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 1.75rem 1.4375rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 0.75rem 0.75rem -0.4375rem\",\n xl: \"0 0.0625rem 0.1875rem rgba(0, 0, 0, 0.05), rgba(0, 0, 0, 0.05) 0 2.25rem 1.75rem -0.4375rem, rgba(0, 0, 0, 0.04) 0 1.0625rem 1.0625rem -0.4375rem\"\n },\n fontSizes: {\n xs: \"0.75rem\",\n sm: \"0.875rem\",\n md: \"1rem\",\n lg: \"1.125rem\",\n xl: \"1.25rem\"\n },\n radius: {\n xs: \"0.125rem\",\n sm: \"0.25rem\",\n md: \"0.5rem\",\n lg: \"1rem\",\n xl: \"2rem\"\n },\n spacing: {\n xs: \"0.625rem\",\n sm: \"0.75rem\",\n md: \"1rem\",\n lg: \"1.25rem\",\n xl: \"1.5rem\"\n },\n breakpoints: {\n xs: \"36em\",\n sm: \"48em\",\n md: \"62em\",\n lg: \"75em\",\n xl: \"88em\"\n },\n headings: {\n fontFamily: \"-apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Helvetica, Arial, sans-serif, Apple Color Emoji, Segoe UI Emoji\",\n fontWeight: 700,\n sizes: {\n h1: { fontSize: \"2.125rem\", lineHeight: 1.3, fontWeight: void 0 },\n h2: { fontSize: \"1.625rem\", lineHeight: 1.35, fontWeight: void 0 },\n h3: { fontSize: \"1.375rem\", lineHeight: 1.4, fontWeight: void 0 },\n h4: { fontSize: \"1.125rem\", lineHeight: 1.45, fontWeight: void 0 },\n h5: { fontSize: \"1rem\", lineHeight: 1.5, fontWeight: void 0 },\n h6: { fontSize: \"0.875rem\", lineHeight: 1.5, fontWeight: void 0 }\n }\n },\n other: {},\n components: {},\n activeStyles: { transform: \"translateY(0.0625rem)\" },\n datesLocale: \"en\",\n globalStyles: void 0,\n focusRingStyles: {\n styles: (theme) => ({\n outlineOffset: \"0.125rem\",\n outline: `0.125rem solid ${theme.colors[theme.primaryColor][theme.colorScheme === \"dark\" ? 7 : 5]}`\n }),\n resetStyles: () => ({ outline: \"none\" }),\n inputStyles: (theme) => ({\n outline: \"none\",\n borderColor: theme.colors[theme.primaryColor][typeof theme.primaryShade === \"object\" ? theme.primaryShade[theme.colorScheme] : theme.primaryShade]\n })\n }\n};\nconst DEFAULT_THEME = attachFunctions(_DEFAULT_THEME);\n\nexport { DEFAULT_THEME, MANTINE_COLORS, MANTINE_SIZES, _DEFAULT_THEME };\n//# sourceMappingURL=default-theme.js.map\n","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 '@emotion/weak-memoize';\nimport '@emotion/memoize';\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 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 defaultStylisPlugins = [prefixer];\n\nvar createCache = function\n /*: EmotionCache */\ncreateCache(options\n/*: Options */\n) {\n var key = options.key;\n\n if (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 /*: HTMLStyleElement */\n ) {\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 /* : Node */\n\n var nodesToHydrate = [];\n\n {\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 /*: HTMLStyleElement */\n ) {\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 selector: string,\n serialized: SerializedStyles,\n sheet: StyleSheet,\n shouldCache: boolean\n ) => string | void */\n\n\n var omnipresentPlugins = [compat, removeLabel];\n\n {\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\n /*: void */\n insert(selector\n /*: string */\n , serialized\n /*: SerializedStyles */\n , sheet\n /*: StyleSheet */\n , shouldCache\n /*: boolean */\n ) {\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 }\n\n var cache\n /*: EmotionCache */\n = {\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","var isBrowser = true;\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.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 current = serialized;\n\n do {\n cache.insert(serialized === current ? \".\" + className : '', current, cache.sheet, true);\n\n current = current.next;\n } while (current !== undefined);\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 syncFallback = function syncFallback(create) {\n return create();\n};\n\nvar useInsertionEffect = React['useInsertion' + 'Effect'] ? React['useInsertion' + 'Effect'] : false;\nvar useInsertionEffectAlwaysWithSyncFallback = 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.browser.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\n/* import { type EmotionCache } from '@emotion/utils' */\nvar EmotionCacheContext\n/*: React.Context */\n= /* #__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/*: EmotionCache | null*/\n{\n return useContext(EmotionCacheContext);\n};\n\nvar withEmotionCache = function withEmotionCache\n/* > */\n(func\n/*: (props: Props, cache: EmotionCache, ref: Ref) => React.Node */\n)\n/*: React.AbstractComponent */\n{\n return /*#__PURE__*/forwardRef(function (props\n /*: Props */\n , ref\n /*: Ref */\n ) {\n // the cache will never be null in the browser\n var cache = useContext(EmotionCacheContext);\n return func(props, cache, ref);\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\n/*: Object */\n, theme\n/*: Object | (Object => Object) */\n) {\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});\n/*\ntype ThemeProviderProps = {\n theme: Object | (Object => Object),\n children: React.Node\n}\n*/\n\nvar ThemeProvider = function ThemeProvider(props\n/*: ThemeProviderProps */\n) {\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\n/* */\n(Component\n/*: React.AbstractComponent */\n)\n/*: React.AbstractComponent<$Diff> */\n{\n var componentName = Component.displayName || Component.name || 'Component';\n\n var render = 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\n var WithTheme = /*#__PURE__*/React.forwardRef(render);\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\n/*: React.ElementType */\n, props\n/*: Object */\n) {\n\n var newProps\n /*: any */\n = {};\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 useInsertionEffectAlwaysWithSyncFallback(function () {\n return insertStyles(cache, serialized, isStringTag);\n });\n\n return null;\n};\n\nvar Emotion = /* #__PURE__ */withEmotionCache(\n/* */\nfunction (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 key in props) {\n if (hasOwn.call(props, key) && key !== 'css' && key !== typePropName && (!isDevelopment )) {\n newProps[key] = props[key];\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 _, ThemeProvider as a, withTheme as b, createEmotionProps as c, hasOwn as h, isDevelopment 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 isDevelopment } from './emotion-element-5486c51c.browser.esm.js';\nexport { C as CacheProvider, T as ThemeContext, a as ThemeProvider, _ as __unsafe_useEmotionCache, u as useTheme, w as withEmotionCache, b as withTheme } from './emotion-element-5486c51c.browser.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.browser.esm.js';\nimport 'hoist-non-react-statics';\n\nvar jsx\n/*: typeof React.createElement */\n= function jsx\n/*: typeof React.createElement */\n(type\n/*: React.ElementType */\n, props\n/*: Object */\n) {\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// 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\n/*: React.AbstractComponent<\nGlobalProps\n> */\n= /* #__PURE__ */withEmotionCache(function (props\n/*: GlobalProps */\n, cache) {\n\n var styles = props.styles;\n var serialized = serializeStyles([styles], undefined, React.useContext(ThemeContext));\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\n /*: HTMLStyleElement | null*/\n = 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\n/* import type { Interpolation, SerializedStyles } from '@emotion/utils' */\n\nfunction css()\n/*: SerializedStyles */\n{\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\n/*\ntype Keyframes = {|\n name: string,\n styles: string,\n anim: 1,\n toString: () => string\n|} & string\n*/\n\nvar keyframes = function\n /*: Keyframes */\nkeyframes() {\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\n/*\ntype ClassNameArg =\n | string\n | boolean\n | { [key: string]: boolean }\n | Array\n | null\n | void\n*/\n\nvar classnames = function\n /*: string */\nclassnames(args\n/*: Array */\n) {\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\n/*: Object */\n, css\n/*: (...args: Array) => string */\n, className\n/*: string */\n) {\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 useInsertionEffectAlwaysWithSyncFallback(function () {\n\n for (var i = 0; i < serializedArr.length; i++) {\n insertStyles(cache, serializedArr[i], false);\n }\n });\n\n return null;\n};\n/*\ntype Props = {\n children: ({\n css: (...args: any) => string,\n cx: (...args: Array) => string,\n theme: Object\n }) => React.Node\n} */\n\n\nvar ClassNames\n/*: React.AbstractComponent*/\n= /* #__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","import React from 'react';\nimport { Global } from '@emotion/react';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nfunction GlobalStyles({ theme }) {\n return /* @__PURE__ */ React.createElement(Global, {\n styles: {\n \"*, *::before, *::after\": {\n boxSizing: \"border-box\"\n },\n html: {\n colorScheme: theme.colorScheme === \"dark\" ? \"dark\" : \"light\"\n },\n body: __spreadProps(__spreadValues({}, theme.fn.fontStyles()), {\n backgroundColor: theme.colorScheme === \"dark\" ? theme.colors.dark[7] : theme.white,\n color: theme.colorScheme === \"dark\" ? theme.colors.dark[0] : theme.black,\n lineHeight: theme.lineHeight,\n fontSize: theme.fontSizes.md,\n WebkitFontSmoothing: \"antialiased\",\n MozOsxFontSmoothing: \"grayscale\"\n })\n }\n });\n}\n\nexport { GlobalStyles };\n//# sourceMappingURL=GlobalStyles.js.map\n","import React from 'react';\nimport { Global } from '@emotion/react';\nimport { rem, em } from './utils/rem/rem.js';\n\nfunction assignSizeVariables(variables, sizes, name, targetUnitConverter = rem) {\n Object.keys(sizes).forEach((size) => {\n variables[`--mantine-${name}-${size}`] = targetUnitConverter(sizes[size]);\n });\n}\nfunction MantineCssVariables({ theme }) {\n const variables = {\n \"--mantine-color-white\": theme.white,\n \"--mantine-color-black\": theme.black,\n \"--mantine-transition-timing-function\": theme.transitionTimingFunction,\n \"--mantine-line-height\": `${theme.lineHeight}`,\n \"--mantine-font-family\": theme.fontFamily,\n \"--mantine-font-family-monospace\": theme.fontFamilyMonospace,\n \"--mantine-font-family-headings\": theme.headings.fontFamily,\n \"--mantine-heading-font-weight\": `${theme.headings.fontWeight}`\n };\n assignSizeVariables(variables, theme.shadows, \"shadow\");\n assignSizeVariables(variables, theme.fontSizes, \"font-size\");\n assignSizeVariables(variables, theme.radius, \"radius\");\n assignSizeVariables(variables, theme.spacing, \"spacing\");\n assignSizeVariables(variables, theme.breakpoints, \"breakpoints\", em);\n Object.keys(theme.colors).forEach((color) => {\n theme.colors[color].forEach((shade, index) => {\n variables[`--mantine-color-${color}-${index}`] = shade;\n });\n });\n const headings = theme.headings.sizes;\n Object.keys(headings).forEach((heading) => {\n variables[`--mantine-${heading}-font-size`] = headings[heading].fontSize;\n variables[`--mantine-${heading}-line-height`] = `${headings[heading].lineHeight}`;\n });\n return /* @__PURE__ */ React.createElement(Global, {\n styles: {\n \":root\": variables\n }\n });\n}\n\nexport { MantineCssVariables };\n//# sourceMappingURL=MantineCssVariables.js.map\n","import { attachFunctions } from '../../functions/attach-functions.js';\nimport { getBreakpointValue } from '../../functions/fns/breakpoints/breakpoints.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nfunction mergeTheme(currentTheme, themeOverride) {\n var _a;\n if (!themeOverride) {\n return currentTheme;\n }\n const result = Object.keys(currentTheme).reduce((acc, key) => {\n if (key === \"headings\" && themeOverride.headings) {\n const sizes = themeOverride.headings.sizes ? Object.keys(currentTheme.headings.sizes).reduce((headingsAcc, h) => {\n headingsAcc[h] = __spreadValues(__spreadValues({}, currentTheme.headings.sizes[h]), themeOverride.headings.sizes[h]);\n return headingsAcc;\n }, {}) : currentTheme.headings.sizes;\n return __spreadProps(__spreadValues({}, acc), {\n headings: __spreadProps(__spreadValues(__spreadValues({}, currentTheme.headings), themeOverride.headings), {\n sizes\n })\n });\n }\n if (key === \"breakpoints\" && themeOverride.breakpoints) {\n const mergedBreakpoints = __spreadValues(__spreadValues({}, currentTheme.breakpoints), themeOverride.breakpoints);\n return __spreadProps(__spreadValues({}, acc), {\n breakpoints: Object.fromEntries(Object.entries(mergedBreakpoints).sort((a, b) => getBreakpointValue(a[1]) - getBreakpointValue(b[1])))\n });\n }\n acc[key] = typeof themeOverride[key] === \"object\" ? __spreadValues(__spreadValues({}, currentTheme[key]), themeOverride[key]) : typeof themeOverride[key] === \"number\" || typeof themeOverride[key] === \"boolean\" || typeof themeOverride[key] === \"function\" ? themeOverride[key] : themeOverride[key] || currentTheme[key];\n return acc;\n }, {});\n if ((themeOverride == null ? void 0 : themeOverride.fontFamily) && !((_a = themeOverride == null ? void 0 : themeOverride.headings) == null ? void 0 : _a.fontFamily)) {\n result.headings.fontFamily = themeOverride.fontFamily;\n }\n if (!(result.primaryColor in result.colors)) {\n throw new Error(\"MantineProvider: Invalid theme.primaryColor, it accepts only key of theme.colors, learn more \\u2013 https://mantine.dev/theming/colors/#primary-color\");\n }\n return result;\n}\nfunction mergeThemeWithFunctions(currentTheme, themeOverride) {\n return attachFunctions(mergeTheme(currentTheme, themeOverride));\n}\n\nexport { mergeTheme, mergeThemeWithFunctions };\n//# sourceMappingURL=merge-theme.js.map\n","function filterProps(props) {\n return Object.keys(props).reduce((acc, key) => {\n if (props[key] !== void 0) {\n acc[key] = props[key];\n }\n return acc;\n }, {});\n}\n\nexport { filterProps };\n//# sourceMappingURL=filter-props.js.map\n","import React from 'react';\nimport { Global } from '@emotion/react';\nimport { rem } from './utils/rem/rem.js';\n\nconst styles = {\n html: {\n fontFamily: \"sans-serif\",\n lineHeight: \"1.15\",\n textSizeAdjust: \"100%\"\n },\n body: {\n margin: 0\n },\n \"article, aside, footer, header, nav, section, figcaption, figure, main\": {\n display: \"block\"\n },\n h1: {\n fontSize: \"2em\"\n },\n hr: {\n boxSizing: \"content-box\",\n height: 0,\n overflow: \"visible\"\n },\n pre: {\n fontFamily: \"monospace, monospace\",\n fontSize: \"1em\"\n },\n a: {\n background: \"transparent\",\n textDecorationSkip: \"objects\"\n },\n \"a:active, a:hover\": {\n outlineWidth: 0\n },\n \"abbr[title]\": {\n borderBottom: \"none\",\n textDecoration: \"underline\"\n },\n \"b, strong\": {\n fontWeight: \"bolder\"\n },\n \"code, kbp, samp\": {\n fontFamily: \"monospace, monospace\",\n fontSize: \"1em\"\n },\n dfn: {\n fontStyle: \"italic\"\n },\n mark: {\n backgroundColor: \"#ff0\",\n color: \"#000\"\n },\n small: {\n fontSize: \"80%\"\n },\n \"sub, sup\": {\n fontSize: \"75%\",\n lineHeight: 0,\n position: \"relative\",\n verticalAlign: \"baseline\"\n },\n sup: {\n top: \"-0.5em\"\n },\n sub: {\n bottom: \"-0.25em\"\n },\n \"audio, video\": {\n display: \"inline-block\"\n },\n \"audio:not([controls])\": {\n display: \"none\",\n height: 0\n },\n img: {\n borderStyle: \"none\",\n verticalAlign: \"middle\"\n },\n \"svg:not(:root)\": {\n overflow: \"hidden\"\n },\n \"button, input, optgroup, select, textarea\": {\n fontFamily: \"sans-serif\",\n fontSize: \"100%\",\n lineHeight: \"1.15\",\n margin: 0\n },\n \"button, input\": {\n overflow: \"visible\"\n },\n \"button, select\": {\n textTransform: \"none\"\n },\n \"button, [type=reset], [type=submit]\": {\n WebkitAppearance: \"button\"\n },\n \"button::-moz-focus-inner, [type=button]::-moz-focus-inner, [type=reset]::-moz-focus-inner, [type=submit]::-moz-focus-inner\": {\n borderStyle: \"none\",\n padding: 0\n },\n \"button:-moz-focusring, [type=button]:-moz-focusring, [type=reset]:-moz-focusring, [type=submit]:-moz-focusring\": {\n outline: `${rem(1)} dotted ButtonText`\n },\n legend: {\n boxSizing: \"border-box\",\n color: \"inherit\",\n display: \"table\",\n maxWidth: \"100%\",\n padding: 0,\n whiteSpace: \"normal\"\n },\n progress: {\n display: \"inline-block\",\n verticalAlign: \"baseline\"\n },\n textarea: {\n overflow: \"auto\"\n },\n \"[type=checkbox], [type=radio]\": {\n boxSizing: \"border-box\",\n padding: 0\n },\n \"[type=number]::-webkit-inner-spin-button, [type=number]::-webkit-outer-spin-button\": {\n height: \"auto\"\n },\n \"[type=search]\": {\n appearance: \"none\"\n },\n \"[type=search]::-webkit-search-cancel-button, [type=search]::-webkit-search-decoration\": {\n appearance: \"none\"\n },\n \"::-webkit-file-upload-button\": {\n appearance: \"button\",\n font: \"inherit\"\n },\n \"details, menu\": {\n display: \"block\"\n },\n summary: {\n display: \"list-item\"\n },\n canvas: {\n display: \"inline-block\"\n },\n template: {\n display: \"none\"\n }\n};\nfunction NormalizeCSS() {\n return /* @__PURE__ */ React.createElement(Global, {\n styles\n });\n}\n\nexport { NormalizeCSS };\n//# sourceMappingURL=NormalizeCSS.js.map\n","import React, { createContext, useContext } from 'react';\nimport { ThemeProvider, Global } from '@emotion/react';\nimport { DEFAULT_THEME } from './default-theme.js';\nimport { GlobalStyles } from './GlobalStyles.js';\nimport { MantineCssVariables } from './MantineCssVariables.js';\nimport { mergeThemeWithFunctions } from './utils/merge-theme/merge-theme.js';\nimport { filterProps } from './utils/filter-props/filter-props.js';\nimport { NormalizeCSS } from './NormalizeCSS.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nconst MantineProviderContext = createContext({\n theme: DEFAULT_THEME\n});\nfunction useMantineTheme() {\n var _a;\n return ((_a = useContext(MantineProviderContext)) == null ? void 0 : _a.theme) || DEFAULT_THEME;\n}\nfunction useMantineProviderStyles(component) {\n const theme = useMantineTheme();\n const getStyles = (name) => {\n var _a, _b, _c, _d;\n return {\n styles: ((_a = theme.components[name]) == null ? void 0 : _a.styles) || {},\n classNames: ((_b = theme.components[name]) == null ? void 0 : _b.classNames) || {},\n variants: (_c = theme.components[name]) == null ? void 0 : _c.variants,\n sizes: (_d = theme.components[name]) == null ? void 0 : _d.sizes\n };\n };\n if (Array.isArray(component)) {\n return component.map(getStyles);\n }\n return [getStyles(component)];\n}\nfunction useMantineEmotionCache() {\n var _a;\n return (_a = useContext(MantineProviderContext)) == null ? void 0 : _a.emotionCache;\n}\nfunction useComponentDefaultProps(component, defaultProps, props) {\n var _a;\n const theme = useMantineTheme();\n const contextPropsPayload = (_a = theme.components[component]) == null ? void 0 : _a.defaultProps;\n const contextProps = typeof contextPropsPayload === \"function\" ? contextPropsPayload(theme) : contextPropsPayload;\n return __spreadValues(__spreadValues(__spreadValues({}, defaultProps), contextProps), filterProps(props));\n}\nfunction MantineProvider({\n theme,\n emotionCache,\n withNormalizeCSS = false,\n withGlobalStyles = false,\n withCSSVariables = false,\n inherit = false,\n children\n}) {\n const ctx = useContext(MantineProviderContext);\n const mergedTheme = mergeThemeWithFunctions(DEFAULT_THEME, inherit ? __spreadValues(__spreadValues({}, ctx.theme), theme) : theme);\n return /* @__PURE__ */ React.createElement(ThemeProvider, {\n theme: mergedTheme\n }, /* @__PURE__ */ React.createElement(MantineProviderContext.Provider, {\n value: { theme: mergedTheme, emotionCache }\n }, withNormalizeCSS && /* @__PURE__ */ React.createElement(NormalizeCSS, null), withGlobalStyles && /* @__PURE__ */ React.createElement(GlobalStyles, {\n theme: mergedTheme\n }), withCSSVariables && /* @__PURE__ */ React.createElement(MantineCssVariables, {\n theme: mergedTheme\n }), typeof mergedTheme.globalStyles === \"function\" && /* @__PURE__ */ React.createElement(Global, {\n styles: mergedTheme.globalStyles(mergedTheme)\n }), children));\n}\nMantineProvider.displayName = \"@mantine/core/MantineProvider\";\n\nexport { MantineProvider, useComponentDefaultProps, useMantineEmotionCache, useMantineProviderStyles, useMantineTheme };\n//# sourceMappingURL=MantineProvider.js.map\n","const elevations = {\n app: 100,\n modal: 200,\n popover: 300,\n overlay: 400,\n max: 9999\n};\nfunction getDefaultZIndex(level) {\n return elevations[level];\n}\n\nexport { getDefaultZIndex };\n//# sourceMappingURL=get-default-z-index.js.map\n","import { useRef } from 'react';\n\nfunction useGuaranteedMemo(fn, deps) {\n const ref = useRef();\n if (!ref.current || deps.length !== ref.current.prevDeps.length || ref.current.prevDeps.map((v, i) => v === deps[i]).indexOf(false) >= 0) {\n ref.current = {\n v: fn(),\n prevDeps: [...deps]\n };\n }\n return ref.current.v;\n}\n\nexport { useGuaranteedMemo };\n//# sourceMappingURL=use-guaranteed-memo.js.map\n","import createCache from '@emotion/cache';\n\nconst defaultMantineEmotionCache = createCache({ key: \"mantine\", prepend: true });\n\nexport { defaultMantineEmotionCache };\n//# sourceMappingURL=default-emotion-cache.js.map\n","import { defaultMantineEmotionCache } from './default-emotion-cache.js';\nimport { useMantineEmotionCache } from '../theme/MantineProvider.js';\n\nfunction useEmotionCache() {\n const cache = useMantineEmotionCache();\n return cache || defaultMantineEmotionCache;\n}\n\nexport { useEmotionCache };\n//# sourceMappingURL=use-emotion-cache.js.map\n","import clsx from 'clsx';\nimport { serializeStyles } from '@emotion/serialize';\nimport { insertStyles, getRegisteredStyles } from '@emotion/utils';\nimport { useGuaranteedMemo } from './utils/use-guaranteed-memo/use-guaranteed-memo.js';\nimport { useEmotionCache } from './use-emotion-cache.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nconst refPropertyName = \"ref\";\nfunction getRef(args) {\n let ref;\n if (args.length !== 1) {\n return { args, ref };\n }\n const [arg] = args;\n if (!(arg instanceof Object)) {\n return { args, ref };\n }\n if (!(refPropertyName in arg)) {\n return { args, ref };\n }\n ref = arg[refPropertyName];\n const argCopy = __spreadValues({}, arg);\n delete argCopy[refPropertyName];\n return { args: [argCopy], ref };\n}\nconst { cssFactory } = (() => {\n function merge(registered, css, className) {\n const registeredStyles = [];\n const rawClassName = getRegisteredStyles(registered, registeredStyles, className);\n if (registeredStyles.length < 2) {\n return className;\n }\n return rawClassName + css(registeredStyles);\n }\n function _cssFactory(params) {\n const { cache } = params;\n const css = (...styles) => {\n const { ref, args } = getRef(styles);\n const serialized = serializeStyles(args, cache.registered);\n insertStyles(cache, serialized, false);\n return `${cache.key}-${serialized.name}${ref === void 0 ? \"\" : ` ${ref}`}`;\n };\n const cx = (...args) => merge(cache.registered, css, clsx(args));\n return { css, cx };\n }\n return { cssFactory: _cssFactory };\n})();\nfunction useCss() {\n const cache = useEmotionCache();\n return useGuaranteedMemo(() => cssFactory({ cache }), [cache]);\n}\n\nexport { cssFactory, useCss };\n//# sourceMappingURL=use-css.js.map\n","function mergeClassNames({\n cx,\n classes,\n context,\n classNames,\n name,\n cache\n}) {\n const contextClassNames = context.reduce((acc, item) => {\n Object.keys(item.classNames).forEach((key) => {\n if (typeof acc[key] !== \"string\") {\n acc[key] = `${item.classNames[key]}`;\n } else {\n acc[key] = `${acc[key]} ${item.classNames[key]}`;\n }\n });\n return acc;\n }, {});\n return Object.keys(classes).reduce((acc, className) => {\n acc[className] = cx(classes[className], contextClassNames[className], classNames != null && classNames[className], Array.isArray(name) ? name.filter(Boolean).map((part) => `${(cache == null ? void 0 : cache.key) || \"mantine\"}-${part}-${className}`).join(\" \") : name ? `${(cache == null ? void 0 : cache.key) || \"mantine\"}-${name}-${className}` : null);\n return acc;\n }, {});\n}\n\nexport { mergeClassNames };\n//# sourceMappingURL=merge-class-names.js.map\n","import { useCss } from './use-css.js';\nimport { useMantineTheme, useMantineProviderStyles, useMantineEmotionCache } from '../theme/MantineProvider.js';\nimport { mergeClassNames } from './utils/merge-class-names/merge-class-names.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nfunction assignAccStyles(acc, styles) {\n if (styles) {\n Object.keys(styles).forEach((key) => {\n if (!acc[key]) {\n acc[key] = __spreadValues({}, styles[key]);\n } else {\n acc[key] = __spreadValues(__spreadValues({}, acc[key]), styles[key]);\n }\n });\n }\n return acc;\n}\nfunction getStyles(styles, theme, params, contextParams) {\n const extractStyles = (stylesPartial) => typeof stylesPartial === \"function\" ? stylesPartial(theme, params || {}, contextParams) : stylesPartial || {};\n if (Array.isArray(styles)) {\n return styles.map((item) => extractStyles(item.styles)).reduce((acc, item) => assignAccStyles(acc, item), {});\n }\n return extractStyles(styles);\n}\nfunction getContextVariation({ ctx, theme, params, variant, size }) {\n return ctx.reduce((acc, item) => {\n if (item.variants && variant in item.variants) {\n assignAccStyles(acc, item.variants[variant](theme, params, { variant, size }));\n }\n if (item.sizes && size in item.sizes) {\n assignAccStyles(acc, item.sizes[size](theme, params, { variant, size }));\n }\n return acc;\n }, {});\n}\nfunction createStyles(input) {\n const getCssObject = typeof input === \"function\" ? input : () => input;\n function useStyles(params, options) {\n const theme = useMantineTheme();\n const context = useMantineProviderStyles(options == null ? void 0 : options.name);\n const cache = useMantineEmotionCache();\n const contextParams = { variant: options == null ? void 0 : options.variant, size: options == null ? void 0 : options.size };\n const { css, cx } = useCss();\n const cssObject = getCssObject(theme, params, contextParams);\n const componentStyles = getStyles(options == null ? void 0 : options.styles, theme, params, contextParams);\n const providerStyles = getStyles(context, theme, params, contextParams);\n const contextVariations = getContextVariation({\n ctx: context,\n theme,\n params,\n variant: options == null ? void 0 : options.variant,\n size: options == null ? void 0 : options.size\n });\n const classes = Object.fromEntries(Object.keys(cssObject).map((key) => {\n const mergedStyles = cx({ [css(cssObject[key])]: !(options == null ? void 0 : options.unstyled) }, css(contextVariations[key]), css(providerStyles[key]), css(componentStyles[key]));\n return [key, mergedStyles];\n }));\n return {\n classes: mergeClassNames({\n cx,\n classes,\n context,\n classNames: options == null ? void 0 : options.classNames,\n name: options == null ? void 0 : options.name,\n cache\n }),\n cx,\n theme\n };\n }\n return useStyles;\n}\n\nexport { createStyles };\n//# sourceMappingURL=create-styles.js.map\n","function getStylesRef(refName) {\n return `___ref-${refName || \"\"}`;\n}\n\nexport { getStylesRef };\n//# sourceMappingURL=get-styles-ref.js.map\n","import React from 'react';\nimport { Global as Global$1, css } from '@emotion/react';\nimport { useMantineTheme } from '../theme/MantineProvider.js';\n\nfunction Global({ styles }) {\n const theme = useMantineTheme();\n return /* @__PURE__ */ React.createElement(Global$1, {\n styles: css(typeof styles === \"function\" ? styles(theme) : styles)\n });\n}\n\nexport { Global };\n//# sourceMappingURL=Global.js.map\n","import { rem } from '@mantine/styles';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nconst popIn = {\n in: { opacity: 1, transform: \"scale(1)\" },\n out: { opacity: 0, transform: `scale(.9) translateY(${rem(10)})` },\n transitionProperty: \"transform, opacity\"\n};\nconst transitions = {\n fade: {\n in: { opacity: 1 },\n out: { opacity: 0 },\n transitionProperty: \"opacity\"\n },\n scale: {\n in: { opacity: 1, transform: \"scale(1)\" },\n out: { opacity: 0, transform: \"scale(0)\" },\n common: { transformOrigin: \"top\" },\n transitionProperty: \"transform, opacity\"\n },\n \"scale-y\": {\n in: { opacity: 1, transform: \"scaleY(1)\" },\n out: { opacity: 0, transform: \"scaleY(0)\" },\n common: { transformOrigin: \"top\" },\n transitionProperty: \"transform, opacity\"\n },\n \"scale-x\": {\n in: { opacity: 1, transform: \"scaleX(1)\" },\n out: { opacity: 0, transform: \"scaleX(0)\" },\n common: { transformOrigin: \"left\" },\n transitionProperty: \"transform, opacity\"\n },\n \"skew-up\": {\n in: { opacity: 1, transform: \"translateY(0) skew(0deg, 0deg)\" },\n out: { opacity: 0, transform: `translateY(-${rem(20)}) skew(-10deg, -5deg)` },\n common: { transformOrigin: \"top\" },\n transitionProperty: \"transform, opacity\"\n },\n \"skew-down\": {\n in: { opacity: 1, transform: \"translateY(0) skew(0deg, 0deg)\" },\n out: { opacity: 0, transform: `translateY(${rem(20)}) skew(-10deg, -5deg)` },\n common: { transformOrigin: \"bottom\" },\n transitionProperty: \"transform, opacity\"\n },\n \"rotate-left\": {\n in: { opacity: 1, transform: \"translateY(0) rotate(0deg)\" },\n out: { opacity: 0, transform: `translateY(${rem(20)}) rotate(-5deg)` },\n common: { transformOrigin: \"bottom\" },\n transitionProperty: \"transform, opacity\"\n },\n \"rotate-right\": {\n in: { opacity: 1, transform: \"translateY(0) rotate(0deg)\" },\n out: { opacity: 0, transform: `translateY(${rem(20)}) rotate(5deg)` },\n common: { transformOrigin: \"top\" },\n transitionProperty: \"transform, opacity\"\n },\n \"slide-down\": {\n in: { opacity: 1, transform: \"translateY(0)\" },\n out: { opacity: 0, transform: \"translateY(-100%)\" },\n common: { transformOrigin: \"top\" },\n transitionProperty: \"transform, opacity\"\n },\n \"slide-up\": {\n in: { opacity: 1, transform: \"translateY(0)\" },\n out: { opacity: 0, transform: \"translateY(100%)\" },\n common: { transformOrigin: \"bottom\" },\n transitionProperty: \"transform, opacity\"\n },\n \"slide-left\": {\n in: { opacity: 1, transform: \"translateX(0)\" },\n out: { opacity: 0, transform: \"translateX(100%)\" },\n common: { transformOrigin: \"left\" },\n transitionProperty: \"transform, opacity\"\n },\n \"slide-right\": {\n in: { opacity: 1, transform: \"translateX(0)\" },\n out: { opacity: 0, transform: \"translateX(-100%)\" },\n common: { transformOrigin: \"right\" },\n transitionProperty: \"transform, opacity\"\n },\n pop: __spreadProps(__spreadValues({}, popIn), {\n common: { transformOrigin: \"center center\" }\n }),\n \"pop-bottom-left\": __spreadProps(__spreadValues({}, popIn), {\n common: { transformOrigin: \"bottom left\" }\n }),\n \"pop-bottom-right\": __spreadProps(__spreadValues({}, popIn), {\n common: { transformOrigin: \"bottom right\" }\n }),\n \"pop-top-left\": __spreadProps(__spreadValues({}, popIn), {\n common: { transformOrigin: \"top left\" }\n }),\n \"pop-top-right\": __spreadProps(__spreadValues({}, popIn), {\n common: { transformOrigin: \"top right\" }\n })\n};\n\nexport { transitions };\n//# sourceMappingURL=transitions.js.map\n","import { useRef, useEffect } from 'react';\n\nconst DEFAULT_EVENTS = [\"mousedown\", \"touchstart\"];\nfunction useClickOutside(handler, events, nodes) {\n const ref = useRef();\n useEffect(() => {\n const listener = (event) => {\n const { target } = event != null ? event : {};\n if (Array.isArray(nodes)) {\n const shouldIgnore = (target == null ? void 0 : target.hasAttribute(\"data-ignore-outside-clicks\")) || !document.body.contains(target) && target.tagName !== \"HTML\";\n const shouldTrigger = nodes.every((node) => !!node && !event.composedPath().includes(node));\n shouldTrigger && !shouldIgnore && handler();\n } else if (ref.current && !ref.current.contains(target)) {\n handler();\n }\n };\n (events || DEFAULT_EVENTS).forEach((fn) => document.addEventListener(fn, listener));\n return () => {\n (events || DEFAULT_EVENTS).forEach((fn) => document.removeEventListener(fn, listener));\n };\n }, [ref, handler, nodes]);\n return ref;\n}\n\nexport { useClickOutside };\n//# sourceMappingURL=use-click-outside.js.map\n","import { useState } from 'react';\n\nfunction useClipboard({ timeout = 2e3 } = {}) {\n const [error, setError] = useState(null);\n const [copied, setCopied] = useState(false);\n const [copyTimeout, setCopyTimeout] = useState(null);\n const handleCopyResult = (value) => {\n clearTimeout(copyTimeout);\n setCopyTimeout(setTimeout(() => setCopied(false), timeout));\n setCopied(value);\n };\n const copy = (valueToCopy) => {\n if (\"clipboard\" in navigator) {\n navigator.clipboard.writeText(valueToCopy).then(() => handleCopyResult(true)).catch((err) => setError(err));\n } else {\n setError(new Error(\"useClipboard: navigator.clipboard is not supported\"));\n }\n };\n const reset = () => {\n setCopied(false);\n setError(null);\n clearTimeout(copyTimeout);\n };\n return { copy, reset, error, copied };\n}\n\nexport { useClipboard };\n//# sourceMappingURL=use-clipboard.js.map\n","import { useState, useRef, useEffect } from 'react';\n\nfunction attachMediaListener(query, callback) {\n try {\n query.addEventListener(\"change\", callback);\n return () => query.removeEventListener(\"change\", callback);\n } catch (e) {\n query.addListener(callback);\n return () => query.removeListener(callback);\n }\n}\nfunction getInitialValue(query, initialValue) {\n if (typeof initialValue === \"boolean\") {\n return initialValue;\n }\n if (typeof window !== \"undefined\" && \"matchMedia\" in window) {\n return window.matchMedia(query).matches;\n }\n return false;\n}\nfunction useMediaQuery(query, initialValue, { getInitialValueInEffect } = {\n getInitialValueInEffect: true\n}) {\n const [matches, setMatches] = useState(getInitialValueInEffect ? initialValue : getInitialValue(query, initialValue));\n const queryRef = useRef();\n useEffect(() => {\n if (\"matchMedia\" in window) {\n queryRef.current = window.matchMedia(query);\n setMatches(queryRef.current.matches);\n return attachMediaListener(queryRef.current, (event) => setMatches(event.matches));\n }\n return void 0;\n }, [query]);\n return matches;\n}\n\nexport { useMediaQuery };\n//# sourceMappingURL=use-media-query.js.map\n","function clamp(value, min, max) {\n return Math.min(Math.max(value, min), max);\n}\n\nexport { clamp };\n//# sourceMappingURL=clamp.js.map\n","import { useLayoutEffect, useEffect } from 'react';\n\nconst useIsomorphicEffect = typeof document !== \"undefined\" ? useLayoutEffect : useEffect;\n\nexport { useIsomorphicEffect };\n//# sourceMappingURL=use-isomorphic-effect.js.map\n","import { useRef, useEffect } from 'react';\n\nfunction useDidUpdate(fn, dependencies) {\n const mounted = useRef(false);\n useEffect(() => () => {\n mounted.current = false;\n }, []);\n useEffect(() => {\n if (mounted.current) {\n return fn();\n }\n mounted.current = true;\n return void 0;\n }, dependencies);\n}\n\nexport { useDidUpdate };\n//# sourceMappingURL=use-did-update.js.map\n","import { useRef } from 'react';\nimport { useDidUpdate } from '../use-did-update/use-did-update.js';\n\nfunction useFocusReturn({ opened, shouldReturnFocus = true }) {\n const lastActiveElement = useRef();\n const returnFocus = () => {\n var _a;\n if (lastActiveElement.current && \"focus\" in lastActiveElement.current && typeof lastActiveElement.current.focus === \"function\") {\n (_a = lastActiveElement.current) == null ? void 0 : _a.focus({ preventScroll: true });\n }\n };\n useDidUpdate(() => {\n let timeout = -1;\n const clearFocusTimeout = (event) => {\n if (event.key === \"Tab\") {\n window.clearTimeout(timeout);\n }\n };\n document.addEventListener(\"keydown\", clearFocusTimeout);\n if (opened) {\n lastActiveElement.current = document.activeElement;\n } else if (shouldReturnFocus) {\n timeout = window.setTimeout(returnFocus, 10);\n }\n return () => {\n window.clearTimeout(timeout);\n document.removeEventListener(\"keydown\", clearFocusTimeout);\n };\n }, [opened, shouldReturnFocus]);\n return returnFocus;\n}\n\nexport { useFocusReturn };\n//# sourceMappingURL=use-focus-return.js.map\n","const TABBABLE_NODES = /input|select|textarea|button|object/;\nconst FOCUS_SELECTOR = \"a, input, select, textarea, button, object, [tabindex]\";\nfunction hidden(element) {\n if (process.env.NODE_ENV === \"test\") {\n return false;\n }\n return element.style.display === \"none\";\n}\nfunction visible(element) {\n const isHidden = element.getAttribute(\"aria-hidden\") || element.getAttribute(\"hidden\") || element.getAttribute(\"type\") === \"hidden\";\n if (isHidden) {\n return false;\n }\n let parentElement = element;\n while (parentElement) {\n if (parentElement === document.body || parentElement.nodeType === 11) {\n break;\n }\n if (hidden(parentElement)) {\n return false;\n }\n parentElement = parentElement.parentNode;\n }\n return true;\n}\nfunction getElementTabIndex(element) {\n let tabIndex = element.getAttribute(\"tabindex\");\n if (tabIndex === null) {\n tabIndex = void 0;\n }\n return parseInt(tabIndex, 10);\n}\nfunction focusable(element) {\n const nodeName = element.nodeName.toLowerCase();\n const isTabIndexNotNaN = !Number.isNaN(getElementTabIndex(element));\n const res = TABBABLE_NODES.test(nodeName) && !element.disabled || (element instanceof HTMLAnchorElement ? element.href || isTabIndexNotNaN : isTabIndexNotNaN);\n return res && visible(element);\n}\nfunction tabbable(element) {\n const tabIndex = getElementTabIndex(element);\n const isTabIndexNaN = Number.isNaN(tabIndex);\n return (isTabIndexNaN || tabIndex >= 0) && focusable(element);\n}\nfunction findTabbableDescendants(element) {\n return Array.from(element.querySelectorAll(FOCUS_SELECTOR)).filter(tabbable);\n}\n\nexport { FOCUS_SELECTOR, findTabbableDescendants, focusable, tabbable };\n//# sourceMappingURL=tabbable.js.map\n","import { findTabbableDescendants } from './tabbable.js';\n\nfunction scopeTab(node, event) {\n const tabbable = findTabbableDescendants(node);\n if (!tabbable.length) {\n event.preventDefault();\n return;\n }\n const finalTabbable = tabbable[event.shiftKey ? 0 : tabbable.length - 1];\n const root = node.getRootNode();\n const leavingFinalTabbable = finalTabbable === root.activeElement || node === root.activeElement;\n if (!leavingFinalTabbable) {\n return;\n }\n event.preventDefault();\n const target = tabbable[event.shiftKey ? tabbable.length - 1 : 0];\n if (target) {\n target.focus();\n }\n}\n\nexport { scopeTab };\n//# sourceMappingURL=scope-tab.js.map\n","function randomId() {\n return `mantine-${Math.random().toString(36).slice(2, 11)}`;\n}\n\nexport { randomId };\n//# sourceMappingURL=random-id.js.map\n","import { randomId } from '../utils/random-id/random-id.js';\n\nfunction createAriaHider(containerNode, selector = \"body > :not(script)\") {\n const id = randomId();\n const rootNodes = Array.from(document.querySelectorAll(selector)).map((node) => {\n var _a;\n if (((_a = node == null ? void 0 : node.shadowRoot) == null ? void 0 : _a.contains(containerNode)) || node.contains(containerNode)) {\n return void 0;\n }\n const ariaHidden = node.getAttribute(\"aria-hidden\");\n const prevAriaHidden = node.getAttribute(\"data-hidden\");\n const prevFocusId = node.getAttribute(\"data-focus-id\");\n node.setAttribute(\"data-focus-id\", id);\n if (ariaHidden === null || ariaHidden === \"false\") {\n node.setAttribute(\"aria-hidden\", \"true\");\n } else if (!prevAriaHidden && !prevFocusId) {\n node.setAttribute(\"data-hidden\", ariaHidden);\n }\n return {\n node,\n ariaHidden: prevAriaHidden || null\n };\n });\n return () => {\n rootNodes.forEach((item) => {\n if (!item || id !== item.node.getAttribute(\"data-focus-id\")) {\n return;\n }\n if (item.ariaHidden === null) {\n item.node.removeAttribute(\"aria-hidden\");\n } else {\n item.node.setAttribute(\"aria-hidden\", item.ariaHidden);\n }\n item.node.removeAttribute(\"data-focus-id\");\n item.node.removeAttribute(\"data-hidden\");\n });\n };\n}\n\nexport { createAriaHider };\n//# sourceMappingURL=create-aria-hider.js.map\n","import { useRef, useCallback, useEffect } from 'react';\nimport { FOCUS_SELECTOR, tabbable, focusable } from './tabbable.js';\nimport { scopeTab } from './scope-tab.js';\nimport { createAriaHider } from './create-aria-hider.js';\n\nfunction useFocusTrap(active = true) {\n const ref = useRef();\n const restoreAria = useRef(null);\n const focusNode = (node) => {\n let focusElement = node.querySelector(\"[data-autofocus]\");\n if (!focusElement) {\n const children = Array.from(node.querySelectorAll(FOCUS_SELECTOR));\n focusElement = children.find(tabbable) || children.find(focusable) || null;\n if (!focusElement && focusable(node))\n focusElement = node;\n }\n if (focusElement) {\n focusElement.focus({ preventScroll: true });\n } else if (process.env.NODE_ENV === \"development\") {\n console.warn(\"[@mantine/hooks/use-focus-trap] Failed to find focusable element within provided node\", node);\n }\n };\n const setRef = useCallback((node) => {\n if (!active) {\n return;\n }\n if (node === null) {\n if (restoreAria.current) {\n restoreAria.current();\n restoreAria.current = null;\n }\n return;\n }\n restoreAria.current = createAriaHider(node);\n if (ref.current === node) {\n return;\n }\n if (node) {\n setTimeout(() => {\n if (node.getRootNode()) {\n focusNode(node);\n } else if (process.env.NODE_ENV === \"development\") {\n console.warn(\"[@mantine/hooks/use-focus-trap] Ref node is not part of the dom\", node);\n }\n });\n ref.current = node;\n } else {\n ref.current = null;\n }\n }, [active]);\n useEffect(() => {\n if (!active) {\n return void 0;\n }\n ref.current && setTimeout(() => focusNode(ref.current));\n const handleKeyDown = (event) => {\n if (event.key === \"Tab\" && ref.current) {\n scopeTab(ref.current, event);\n }\n };\n document.addEventListener(\"keydown\", handleKeyDown);\n return () => {\n document.removeEventListener(\"keydown\", handleKeyDown);\n if (restoreAria.current) {\n restoreAria.current();\n }\n };\n }, [active]);\n return setRef;\n}\n\nexport { useFocusTrap };\n//# sourceMappingURL=use-focus-trap.js.map\n","import { useReducer } from 'react';\n\nconst reducer = (value) => (value + 1) % 1e6;\nfunction useForceUpdate() {\n const [, update] = useReducer(reducer, 0);\n return update;\n}\n\nexport { useForceUpdate };\n//# sourceMappingURL=use-force-update.js.map\n","import React from 'react';\n\nconst __useId = React[\"useId\".toString()] || (() => void 0);\nfunction useReactId() {\n const id = __useId();\n return id ? `mantine-${id.replace(/:/g, \"\")}` : \"\";\n}\n\nexport { useReactId };\n//# sourceMappingURL=use-react-id.js.map\n","import { useState } from 'react';\nimport { useIsomorphicEffect } from '../use-isomorphic-effect/use-isomorphic-effect.js';\nimport { useReactId } from './use-react-id.js';\nimport { randomId } from '../utils/random-id/random-id.js';\n\nfunction useId(staticId) {\n const reactId = useReactId();\n const [uuid, setUuid] = useState(reactId);\n useIsomorphicEffect(() => {\n setUuid(randomId());\n }, []);\n if (typeof staticId === \"string\") {\n return staticId;\n }\n if (typeof window === \"undefined\") {\n return reactId;\n }\n return uuid;\n}\n\nexport { useId };\n//# sourceMappingURL=use-id.js.map\n","import { useEffect } from 'react';\n\nfunction useWindowEvent(type, listener, options) {\n useEffect(() => {\n window.addEventListener(type, listener, options);\n return () => window.removeEventListener(type, listener, options);\n }, [type, listener]);\n}\n\nexport { useWindowEvent };\n//# sourceMappingURL=use-window-event.js.map\n","function assignRef(ref, value) {\n if (typeof ref === \"function\") {\n ref(value);\n } else if (typeof ref === \"object\" && ref !== null && \"current\" in ref) {\n ref.current = value;\n }\n}\n\nexport { assignRef };\n//# sourceMappingURL=assign-ref.js.map\n","import { useCallback } from 'react';\nimport { assignRef } from '../utils/assign-ref/assign-ref.js';\n\nfunction mergeRefs(...refs) {\n return (node) => {\n refs.forEach((ref) => assignRef(ref, node));\n };\n}\nfunction useMergedRef(...refs) {\n return useCallback(mergeRefs(...refs), refs);\n}\n\nexport { mergeRefs, useMergedRef };\n//# sourceMappingURL=use-merged-ref.js.map\n","import { useRef, useState, useEffect } from 'react';\nimport { clamp } from '../utils/clamp/clamp.js';\n\nconst clampUseMovePosition = (position) => ({\n x: clamp(position.x, 0, 1),\n y: clamp(position.y, 0, 1)\n});\nfunction useMove(onChange, handlers, dir = \"ltr\") {\n const ref = useRef();\n const mounted = useRef(false);\n const isSliding = useRef(false);\n const frame = useRef(0);\n const [active, setActive] = useState(false);\n useEffect(() => {\n mounted.current = true;\n }, []);\n useEffect(() => {\n const onScrub = ({ x, y }) => {\n cancelAnimationFrame(frame.current);\n frame.current = requestAnimationFrame(() => {\n if (mounted.current && ref.current) {\n ref.current.style.userSelect = \"none\";\n const rect = ref.current.getBoundingClientRect();\n if (rect.width && rect.height) {\n const _x = clamp((x - rect.left) / rect.width, 0, 1);\n onChange({\n x: dir === \"ltr\" ? _x : 1 - _x,\n y: clamp((y - rect.top) / rect.height, 0, 1)\n });\n }\n }\n });\n };\n const bindEvents = () => {\n document.addEventListener(\"mousemove\", onMouseMove);\n document.addEventListener(\"mouseup\", stopScrubbing);\n document.addEventListener(\"touchmove\", onTouchMove);\n document.addEventListener(\"touchend\", stopScrubbing);\n };\n const unbindEvents = () => {\n document.removeEventListener(\"mousemove\", onMouseMove);\n document.removeEventListener(\"mouseup\", stopScrubbing);\n document.removeEventListener(\"touchmove\", onTouchMove);\n document.removeEventListener(\"touchend\", stopScrubbing);\n };\n const startScrubbing = () => {\n if (!isSliding.current && mounted.current) {\n isSliding.current = true;\n typeof (handlers == null ? void 0 : handlers.onScrubStart) === \"function\" && handlers.onScrubStart();\n setActive(true);\n bindEvents();\n }\n };\n const stopScrubbing = () => {\n if (isSliding.current && mounted.current) {\n isSliding.current = false;\n setActive(false);\n unbindEvents();\n setTimeout(() => {\n typeof (handlers == null ? void 0 : handlers.onScrubEnd) === \"function\" && handlers.onScrubEnd();\n }, 0);\n }\n };\n const onMouseDown = (event) => {\n startScrubbing();\n event.preventDefault();\n onMouseMove(event);\n };\n const onMouseMove = (event) => onScrub({ x: event.clientX, y: event.clientY });\n const onTouchStart = (event) => {\n if (event.cancelable) {\n event.preventDefault();\n }\n startScrubbing();\n onTouchMove(event);\n };\n const onTouchMove = (event) => {\n if (event.cancelable) {\n event.preventDefault();\n }\n onScrub({ x: event.changedTouches[0].clientX, y: event.changedTouches[0].clientY });\n };\n ref.current.addEventListener(\"mousedown\", onMouseDown);\n ref.current.addEventListener(\"touchstart\", onTouchStart, { passive: false });\n return () => {\n if (ref.current) {\n ref.current.removeEventListener(\"mousedown\", onMouseDown);\n ref.current.removeEventListener(\"touchstart\", onTouchStart);\n }\n };\n }, [dir, onChange]);\n return { ref, active };\n}\n\nexport { clampUseMovePosition, useMove };\n//# sourceMappingURL=use-move.js.map\n","import { useState } from 'react';\n\nfunction useUncontrolled({\n value,\n defaultValue,\n finalValue,\n onChange = () => {\n }\n}) {\n const [uncontrolledValue, setUncontrolledValue] = useState(defaultValue !== void 0 ? defaultValue : finalValue);\n const handleUncontrolledChange = (val) => {\n setUncontrolledValue(val);\n onChange == null ? void 0 : onChange(val);\n };\n if (value !== void 0) {\n return [value, onChange, true];\n }\n return [uncontrolledValue, handleUncontrolledChange, false];\n}\n\nexport { useUncontrolled };\n//# sourceMappingURL=use-uncontrolled.js.map\n","import { useState } from 'react';\n\nfunction useQueue({ initialValues = [], limit }) {\n const [{ state, queue }, setState] = useState({\n state: initialValues.slice(0, limit),\n queue: initialValues.slice(limit)\n });\n const add = (...items) => setState((current) => {\n const results = [...current.state, ...current.queue, ...items];\n return {\n state: results.slice(0, limit),\n queue: results.slice(limit)\n };\n });\n const update = (fn) => setState((current) => {\n const results = fn([...current.state, ...current.queue]);\n return {\n state: results.slice(0, limit),\n queue: results.slice(limit)\n };\n });\n const cleanQueue = () => setState((current) => ({ state: current.state, queue: [] }));\n return {\n state,\n queue,\n add,\n update,\n cleanQueue\n };\n}\n\nexport { useQueue };\n//# sourceMappingURL=use-queue.js.map\n","import { useMediaQuery } from '../use-media-query/use-media-query.js';\n\nfunction useReducedMotion(initialValue, options) {\n return useMediaQuery(\"(prefers-reduced-motion: reduce)\", initialValue, options);\n}\n\nexport { useReducedMotion };\n//# sourceMappingURL=use-reduced-motion.js.map\n","const easeInOutQuad = (t) => t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;\n\nexport { easeInOutQuad };\n//# sourceMappingURL=ease-in-out-quad.js.map\n","const getRelativePosition = ({\n axis,\n target,\n parent,\n alignment,\n offset,\n isList\n}) => {\n if (!target || !parent && typeof document === \"undefined\") {\n return 0;\n }\n const isCustomParent = !!parent;\n const parentElement = parent || document.body;\n const parentPosition = parentElement.getBoundingClientRect();\n const targetPosition = target.getBoundingClientRect();\n const getDiff = (property) => targetPosition[property] - parentPosition[property];\n if (axis === \"y\") {\n const diff = getDiff(\"top\");\n if (diff === 0)\n return 0;\n if (alignment === \"start\") {\n const distance = diff - offset;\n const shouldScroll = distance <= targetPosition.height * (isList ? 0 : 1) || !isList;\n return shouldScroll ? distance : 0;\n }\n const parentHeight = isCustomParent ? parentPosition.height : window.innerHeight;\n if (alignment === \"end\") {\n const distance = diff + offset - parentHeight + targetPosition.height;\n const shouldScroll = distance >= -targetPosition.height * (isList ? 0 : 1) || !isList;\n return shouldScroll ? distance : 0;\n }\n if (alignment === \"center\") {\n return diff - parentHeight / 2 + targetPosition.height / 2;\n }\n return 0;\n }\n if (axis === \"x\") {\n const diff = getDiff(\"left\");\n if (diff === 0)\n return 0;\n if (alignment === \"start\") {\n const distance = diff - offset;\n const shouldScroll = distance <= targetPosition.width || !isList;\n return shouldScroll ? distance : 0;\n }\n const parentWidth = isCustomParent ? parentPosition.width : window.innerWidth;\n if (alignment === \"end\") {\n const distance = diff + offset - parentWidth + targetPosition.width;\n const shouldScroll = distance >= -targetPosition.width || !isList;\n return shouldScroll ? distance : 0;\n }\n if (alignment === \"center\") {\n return diff - parentWidth / 2 + targetPosition.width / 2;\n }\n return 0;\n }\n return 0;\n};\n\nexport { getRelativePosition };\n//# sourceMappingURL=get-relative-position.js.map\n","const getScrollStart = ({ axis, parent }) => {\n if (!parent && typeof document === \"undefined\") {\n return 0;\n }\n const method = axis === \"y\" ? \"scrollTop\" : \"scrollLeft\";\n if (parent) {\n return parent[method];\n }\n const { body, documentElement } = document;\n return body[method] + documentElement[method];\n};\n\nexport { getScrollStart };\n//# sourceMappingURL=get-scroll-start.js.map\n","const setScrollParam = ({ axis, parent, distance }) => {\n if (!parent && typeof document === \"undefined\") {\n return;\n }\n const method = axis === \"y\" ? \"scrollTop\" : \"scrollLeft\";\n if (parent) {\n parent[method] = distance;\n } else {\n const { body, documentElement } = document;\n body[method] = distance;\n documentElement[method] = distance;\n }\n};\n\nexport { setScrollParam };\n//# sourceMappingURL=set-scroll-param.js.map\n","import { useRef, useCallback, useEffect } from 'react';\nimport { useReducedMotion } from '../use-reduced-motion/use-reduced-motion.js';\nimport { useWindowEvent } from '../use-window-event/use-window-event.js';\nimport { easeInOutQuad } from './utils/ease-in-out-quad.js';\nimport { getRelativePosition } from './utils/get-relative-position.js';\nimport { getScrollStart } from './utils/get-scroll-start.js';\nimport { setScrollParam } from './utils/set-scroll-param.js';\n\nfunction useScrollIntoView({\n duration = 1250,\n axis = \"y\",\n onScrollFinish,\n easing = easeInOutQuad,\n offset = 0,\n cancelable = true,\n isList = false\n} = {}) {\n const frameID = useRef(0);\n const startTime = useRef(0);\n const shouldStop = useRef(false);\n const scrollableRef = useRef(null);\n const targetRef = useRef(null);\n const reducedMotion = useReducedMotion();\n const cancel = () => {\n if (frameID.current) {\n cancelAnimationFrame(frameID.current);\n }\n };\n const scrollIntoView = useCallback(({ alignment = \"start\" } = {}) => {\n var _a;\n shouldStop.current = false;\n if (frameID.current) {\n cancel();\n }\n const start = (_a = getScrollStart({ parent: scrollableRef.current, axis })) != null ? _a : 0;\n const change = getRelativePosition({\n parent: scrollableRef.current,\n target: targetRef.current,\n axis,\n alignment,\n offset,\n isList\n }) - (scrollableRef.current ? 0 : start);\n function animateScroll() {\n if (startTime.current === 0) {\n startTime.current = performance.now();\n }\n const now = performance.now();\n const elapsed = now - startTime.current;\n const t = reducedMotion || duration === 0 ? 1 : elapsed / duration;\n const distance = start + change * easing(t);\n setScrollParam({\n parent: scrollableRef.current,\n axis,\n distance\n });\n if (!shouldStop.current && t < 1) {\n frameID.current = requestAnimationFrame(animateScroll);\n } else {\n typeof onScrollFinish === \"function\" && onScrollFinish();\n startTime.current = 0;\n frameID.current = 0;\n cancel();\n }\n }\n animateScroll();\n }, [axis, duration, easing, isList, offset, onScrollFinish, reducedMotion]);\n const handleStop = () => {\n if (cancelable) {\n shouldStop.current = true;\n }\n };\n useWindowEvent(\"wheel\", handleStop, {\n passive: true\n });\n useWindowEvent(\"touchmove\", handleStop, {\n passive: true\n });\n useEffect(() => cancel, []);\n return {\n scrollableRef,\n targetRef,\n scrollIntoView,\n cancel\n };\n}\n\nexport { useScrollIntoView };\n//# sourceMappingURL=use-scroll-into-view.js.map\n","import { useState } from 'react';\nimport { useIsomorphicEffect } from '../use-isomorphic-effect/use-isomorphic-effect.js';\n\nfunction getOS() {\n if (typeof window === \"undefined\") {\n return \"undetermined\";\n }\n const { userAgent } = window.navigator;\n const macosPlatforms = /(Macintosh)|(MacIntel)|(MacPPC)|(Mac68K)/i;\n const windowsPlatforms = /(Win32)|(Win64)|(Windows)|(WinCE)/i;\n const iosPlatforms = /(iPhone)|(iPad)|(iPod)/i;\n if (macosPlatforms.test(userAgent)) {\n return \"macos\";\n }\n if (iosPlatforms.test(userAgent)) {\n return \"ios\";\n }\n if (windowsPlatforms.test(userAgent)) {\n return \"windows\";\n }\n if (/Android/i.test(userAgent)) {\n return \"android\";\n }\n if (/Linux/i.test(userAgent)) {\n return \"linux\";\n }\n return \"undetermined\";\n}\nfunction useOs(options = { getValueInEffect: true }) {\n const [value, setValue] = useState(options.getValueInEffect ? \"undetermined\" : getOS());\n useIsomorphicEffect(() => {\n if (options.getValueInEffect) {\n setValue(getOS);\n }\n }, []);\n return value;\n}\n\nexport { useOs };\n//# sourceMappingURL=use-os.js.map\n","import { useState, useCallback } from 'react';\n\nfunction useDisclosure(initialState = false, callbacks) {\n const { onOpen, onClose } = callbacks || {};\n const [opened, setOpened] = useState(initialState);\n const open = useCallback(() => {\n setOpened((isOpened) => {\n if (!isOpened) {\n onOpen == null ? void 0 : onOpen();\n return true;\n }\n return isOpened;\n });\n }, [onOpen]);\n const close = useCallback(() => {\n setOpened((isOpened) => {\n if (isOpened) {\n onClose == null ? void 0 : onClose();\n return false;\n }\n return isOpened;\n });\n }, [onClose]);\n const toggle = useCallback(() => {\n opened ? close() : open();\n }, [close, open, opened]);\n return [opened, { open, close, toggle }];\n}\n\nexport { useDisclosure };\n//# sourceMappingURL=use-disclosure.js.map\n","import { filterProps } from '@mantine/styles';\n\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction extractSystemStyles(others) {\n const _a = others, {\n m,\n mx,\n my,\n mt,\n mb,\n ml,\n mr,\n p,\n px,\n py,\n pt,\n pb,\n pl,\n pr,\n bg,\n c,\n opacity,\n ff,\n fz,\n fw,\n lts,\n ta,\n lh,\n fs,\n tt,\n td,\n w,\n miw,\n maw,\n h,\n mih,\n mah,\n bgsz,\n bgp,\n bgr,\n bga,\n pos,\n top,\n left,\n bottom,\n right,\n inset,\n display\n } = _a, rest = __objRest(_a, [\n \"m\",\n \"mx\",\n \"my\",\n \"mt\",\n \"mb\",\n \"ml\",\n \"mr\",\n \"p\",\n \"px\",\n \"py\",\n \"pt\",\n \"pb\",\n \"pl\",\n \"pr\",\n \"bg\",\n \"c\",\n \"opacity\",\n \"ff\",\n \"fz\",\n \"fw\",\n \"lts\",\n \"ta\",\n \"lh\",\n \"fs\",\n \"tt\",\n \"td\",\n \"w\",\n \"miw\",\n \"maw\",\n \"h\",\n \"mih\",\n \"mah\",\n \"bgsz\",\n \"bgp\",\n \"bgr\",\n \"bga\",\n \"pos\",\n \"top\",\n \"left\",\n \"bottom\",\n \"right\",\n \"inset\",\n \"display\"\n ]);\n const systemStyles = filterProps({\n m,\n mx,\n my,\n mt,\n mb,\n ml,\n mr,\n p,\n px,\n py,\n pt,\n pb,\n pl,\n pr,\n bg,\n c,\n opacity,\n ff,\n fz,\n fw,\n lts,\n ta,\n lh,\n fs,\n tt,\n td,\n w,\n miw,\n maw,\n h,\n mih,\n mah,\n bgsz,\n bgp,\n bgr,\n bga,\n pos,\n top,\n left,\n bottom,\n right,\n inset,\n display\n });\n return { systemStyles, rest };\n}\n\nexport { extractSystemStyles };\n//# sourceMappingURL=extract-system-styles.js.map\n","import { getBreakpointValue, getSize } from '@mantine/styles';\n\nfunction getSortedKeys(value, theme) {\n const sorted = Object.keys(value).filter((breakpoint) => breakpoint !== \"base\").sort((a, b) => getBreakpointValue(getSize({ size: a, sizes: theme.breakpoints })) - getBreakpointValue(getSize({ size: b, sizes: theme.breakpoints })));\n return \"base\" in value ? [\"base\", ...sorted] : sorted;\n}\nfunction getResponsiveValue({ value, theme, getValue, property }) {\n if (value == null) {\n return void 0;\n }\n if (typeof value === \"object\") {\n const result = getSortedKeys(value, theme).reduce((acc, breakpointKey) => {\n if (breakpointKey === \"base\" && value.base !== void 0) {\n const baseValue = getValue(value.base, theme);\n if (Array.isArray(property)) {\n property.forEach((prop) => {\n acc[prop] = baseValue;\n });\n return acc;\n }\n acc[property] = baseValue;\n return acc;\n }\n const breakpointValue = getValue(value[breakpointKey], theme);\n if (Array.isArray(property)) {\n acc[theme.fn.largerThan(breakpointKey)] = {};\n property.forEach((prop) => {\n acc[theme.fn.largerThan(breakpointKey)][prop] = breakpointValue;\n });\n return acc;\n }\n acc[theme.fn.largerThan(breakpointKey)] = {\n [property]: breakpointValue\n };\n return acc;\n }, {});\n return result;\n }\n const cssValue = getValue(value, theme);\n if (Array.isArray(property)) {\n return property.reduce((acc, prop) => {\n acc[prop] = cssValue;\n return acc;\n }, {});\n }\n return { [property]: cssValue };\n}\n\nexport { getResponsiveValue };\n//# sourceMappingURL=get-responsive-value.js.map\n","function getColorValue(color, theme) {\n if (color === \"dimmed\") {\n return theme.colorScheme === \"dark\" ? theme.colors.dark[2] : theme.colors.gray[6];\n }\n return theme.fn.variant({ variant: \"filled\", color, primaryFallback: false }).background;\n}\n\nexport { getColorValue };\n//# sourceMappingURL=get-color-value.js.map\n","import { rem } from '@mantine/styles';\n\nfunction getSizeValue(value) {\n return rem(value);\n}\nfunction identity(value) {\n return value;\n}\n\nexport { getSizeValue, identity };\n//# sourceMappingURL=get-default-value.js.map\n","import { getSize } from '@mantine/styles';\n\nfunction getFontSizeValue(size, theme) {\n return getSize({ size, sizes: theme.fontSizes });\n}\n\nexport { getFontSizeValue };\n//# sourceMappingURL=get-font-size-value.js.map\n","import { getSize } from '@mantine/styles';\n\nconst NEGATIVE_VALUES = [\"-xs\", \"-sm\", \"-md\", \"-lg\", \"-xl\"];\nfunction getSpacingValue(size, theme) {\n if (NEGATIVE_VALUES.includes(size)) {\n return `calc(${getSize({\n size: size.replace(\"-\", \"\"),\n sizes: theme.spacing\n })} * -1)`;\n }\n return getSize({ size, sizes: theme.spacing });\n}\n\nexport { getSpacingValue };\n//# sourceMappingURL=get-spacing-value.js.map\n","import { getColorValue } from './get-color-value.js';\nimport { identity, getSizeValue } from './get-default-value.js';\nimport { getFontSizeValue } from './get-font-size-value.js';\nimport { getSpacingValue } from './get-spacing-value.js';\n\nconst valueGetters = {\n identity,\n color: getColorValue,\n size: getSizeValue,\n fontSize: getFontSizeValue,\n spacing: getSpacingValue\n};\n\nexport { valueGetters };\n//# sourceMappingURL=value-getters.js.map\n","const SYSTEM_PROPS = {\n m: { type: \"spacing\", property: \"margin\" },\n mt: { type: \"spacing\", property: \"marginTop\" },\n mb: { type: \"spacing\", property: \"marginBottom\" },\n ml: { type: \"spacing\", property: \"marginLeft\" },\n mr: { type: \"spacing\", property: \"marginRight\" },\n mx: { type: \"spacing\", property: [\"marginRight\", \"marginLeft\"] },\n my: { type: \"spacing\", property: [\"marginTop\", \"marginBottom\"] },\n p: { type: \"spacing\", property: \"padding\" },\n pt: { type: \"spacing\", property: \"paddingTop\" },\n pb: { type: \"spacing\", property: \"paddingBottom\" },\n pl: { type: \"spacing\", property: \"paddingLeft\" },\n pr: { type: \"spacing\", property: \"paddingRight\" },\n px: { type: \"spacing\", property: [\"paddingRight\", \"paddingLeft\"] },\n py: { type: \"spacing\", property: [\"paddingTop\", \"paddingBottom\"] },\n bg: { type: \"color\", property: \"background\" },\n c: { type: \"color\", property: \"color\" },\n opacity: { type: \"identity\", property: \"opacity\" },\n ff: { type: \"identity\", property: \"fontFamily\" },\n fz: { type: \"fontSize\", property: \"fontSize\" },\n fw: { type: \"identity\", property: \"fontWeight\" },\n lts: { type: \"size\", property: \"letterSpacing\" },\n ta: { type: \"identity\", property: \"textAlign\" },\n lh: { type: \"identity\", property: \"lineHeight\" },\n fs: { type: \"identity\", property: \"fontStyle\" },\n tt: { type: \"identity\", property: \"textTransform\" },\n td: { type: \"identity\", property: \"textDecoration\" },\n w: { type: \"spacing\", property: \"width\" },\n miw: { type: \"spacing\", property: \"minWidth\" },\n maw: { type: \"spacing\", property: \"maxWidth\" },\n h: { type: \"spacing\", property: \"height\" },\n mih: { type: \"spacing\", property: \"minHeight\" },\n mah: { type: \"spacing\", property: \"maxHeight\" },\n bgsz: { type: \"size\", property: \"backgroundSize\" },\n bgp: { type: \"identity\", property: \"backgroundPosition\" },\n bgr: { type: \"identity\", property: \"backgroundRepeat\" },\n bga: { type: \"identity\", property: \"backgroundAttachment\" },\n pos: { type: \"identity\", property: \"position\" },\n top: { type: \"identity\", property: \"top\" },\n left: { type: \"size\", property: \"left\" },\n bottom: { type: \"size\", property: \"bottom\" },\n right: { type: \"size\", property: \"right\" },\n inset: { type: \"size\", property: \"inset\" },\n display: { type: \"identity\", property: \"display\" }\n};\n\nexport { SYSTEM_PROPS };\n//# sourceMappingURL=system-props.js.map\n","import { getResponsiveValue } from '../get-responsive-value/get-responsive-value.js';\nimport { valueGetters } from '../value-getters/value-getters.js';\nimport { SYSTEM_PROPS } from '../system-props/system-props.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nfunction getSystemStyles(systemStyles, theme, systemProps = SYSTEM_PROPS) {\n const styles = Object.keys(systemProps).reduce((acc, systemProp) => {\n if (systemProp in systemStyles && systemStyles[systemProp] !== void 0) {\n acc.push(getResponsiveValue({\n value: systemStyles[systemProp],\n getValue: valueGetters[systemProps[systemProp].type],\n property: systemProps[systemProp].property,\n theme\n }));\n }\n return acc;\n }, []);\n return styles.reduce((acc, stylesPartial) => {\n Object.keys(stylesPartial).forEach((property) => {\n if (typeof stylesPartial[property] === \"object\" && stylesPartial[property] !== null) {\n if (!(property in acc)) {\n acc[property] = stylesPartial[property];\n } else {\n acc[property] = __spreadValues(__spreadValues({}, acc[property]), stylesPartial[property]);\n }\n } else {\n acc[property] = stylesPartial[property];\n }\n });\n return acc;\n }, {});\n}\n\nexport { getSystemStyles };\n//# sourceMappingURL=get-system-styles.js.map\n","import { useMantineTheme, useCss } from '@mantine/styles';\nimport { getSystemStyles } from '../style-system-props/get-system-styles/get-system-styles.js';\n\nfunction extractSx(sx, theme) {\n return typeof sx === \"function\" ? sx(theme) : sx;\n}\nfunction useSx(sx, systemProps, className) {\n const theme = useMantineTheme();\n const { css, cx } = useCss();\n if (Array.isArray(sx)) {\n return cx(className, css(getSystemStyles(systemProps, theme)), sx.map((partial) => css(extractSx(partial, theme))));\n }\n return cx(className, css(extractSx(sx, theme)), css(getSystemStyles(systemProps, theme)));\n}\n\nexport { useSx };\n//# sourceMappingURL=use-sx.js.map\n","import React, { forwardRef } from 'react';\nimport { createPolymorphicComponent } from '@mantine/utils';\nimport { extractSystemStyles } from './style-system-props/extract-system-styles/extract-system-styles.js';\nimport { useSx } from './use-sx/use-sx.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst _Box = forwardRef((_a, ref) => {\n var _b = _a, { className, component, style, sx } = _b, others = __objRest(_b, [\"className\", \"component\", \"style\", \"sx\"]);\n const { systemStyles, rest } = extractSystemStyles(others);\n const Element = component || \"div\";\n return /* @__PURE__ */ React.createElement(Element, __spreadValues({\n ref,\n className: useSx(sx, systemStyles, className),\n style\n }, rest));\n});\n_Box.displayName = \"@mantine/core/Box\";\nconst Box = createPolymorphicComponent(_Box);\n\nexport { Box, _Box };\n//# sourceMappingURL=Box.js.map\n","import { createStyles } from '@mantine/styles';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar useStyles = createStyles((theme) => ({\n root: __spreadProps(__spreadValues(__spreadValues({}, theme.fn.focusStyles()), theme.fn.fontStyles()), {\n cursor: \"pointer\",\n border: 0,\n padding: 0,\n appearance: \"none\",\n fontSize: theme.fontSizes.md,\n backgroundColor: \"transparent\",\n textAlign: \"left\",\n color: theme.colorScheme === \"dark\" ? theme.colors.dark[0] : theme.black,\n textDecoration: \"none\",\n boxSizing: \"border-box\"\n })\n}));\n\nexport default useStyles;\n//# sourceMappingURL=UnstyledButton.styles.js.map\n","import React, { forwardRef } from 'react';\nimport { useComponentDefaultProps } from '@mantine/styles';\nimport { createPolymorphicComponent } from '@mantine/utils';\nimport useStyles from './UnstyledButton.styles.js';\nimport { Box } from '../Box/Box.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst _UnstyledButton = forwardRef((props, ref) => {\n const _a = useComponentDefaultProps(\"UnstyledButton\", {}, props), {\n className,\n component = \"button\",\n unstyled,\n variant\n } = _a, others = __objRest(_a, [\n \"className\",\n \"component\",\n \"unstyled\",\n \"variant\"\n ]);\n const { classes, cx } = useStyles(null, { name: \"UnstyledButton\", unstyled, variant });\n return /* @__PURE__ */ React.createElement(Box, __spreadValues({\n component,\n ref,\n className: cx(classes.root, className),\n type: component === \"button\" ? \"button\" : void 0\n }, others));\n});\n_UnstyledButton.displayName = \"@mantine/core/UnstyledButton\";\nconst UnstyledButton = createPolymorphicComponent(_UnstyledButton);\n\nexport { UnstyledButton, _UnstyledButton };\n//# sourceMappingURL=UnstyledButton.js.map\n","import { useRef, useState } from 'react';\nimport { flushSync } from 'react-dom';\nimport { mergeRefs, useDidUpdate } from '@mantine/hooks';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction getAutoHeightDuration(height) {\n if (!height || typeof height === \"string\") {\n return 0;\n }\n const constant = height / 36;\n return Math.round((4 + 15 * constant ** 0.25 + constant / 5) * 10);\n}\nfunction getElementHeight(el) {\n return (el == null ? void 0 : el.current) ? el.current.scrollHeight : \"auto\";\n}\nconst raf = typeof window !== \"undefined\" && window.requestAnimationFrame;\nfunction useCollapse({\n transitionDuration,\n transitionTimingFunction = \"ease\",\n onTransitionEnd = () => {\n },\n opened\n}) {\n const el = useRef(null);\n const collapsedHeight = 0;\n const collapsedStyles = {\n display: \"none\",\n height: 0,\n overflow: \"hidden\"\n };\n const [styles, setStylesRaw] = useState(opened ? {} : collapsedStyles);\n const setStyles = (newStyles) => {\n flushSync(() => setStylesRaw(newStyles));\n };\n const mergeStyles = (newStyles) => {\n setStyles((oldStyles) => __spreadValues(__spreadValues({}, oldStyles), newStyles));\n };\n function getTransitionStyles(height) {\n const _duration = transitionDuration || getAutoHeightDuration(height);\n return {\n transition: `height ${_duration}ms ${transitionTimingFunction}`\n };\n }\n useDidUpdate(() => {\n if (opened) {\n raf(() => {\n mergeStyles({ willChange: \"height\", display: \"block\", overflow: \"hidden\" });\n raf(() => {\n const height = getElementHeight(el);\n mergeStyles(__spreadProps(__spreadValues({}, getTransitionStyles(height)), { height }));\n });\n });\n } else {\n raf(() => {\n const height = getElementHeight(el);\n mergeStyles(__spreadProps(__spreadValues({}, getTransitionStyles(height)), { willChange: \"height\", height }));\n raf(() => mergeStyles({ height: collapsedHeight, overflow: \"hidden\" }));\n });\n }\n }, [opened]);\n const handleTransitionEnd = (e) => {\n if (e.target !== el.current || e.propertyName !== \"height\") {\n return;\n }\n if (opened) {\n const height = getElementHeight(el);\n if (height === styles.height) {\n setStyles({});\n } else {\n mergeStyles({ height });\n }\n onTransitionEnd();\n } else if (styles.height === collapsedHeight) {\n setStyles(collapsedStyles);\n onTransitionEnd();\n }\n };\n function getCollapseProps(_a = {}) {\n var _b = _a, { style = {}, refKey = \"ref\" } = _b, rest = __objRest(_b, [\"style\", \"refKey\"]);\n const theirRef = rest[refKey];\n return __spreadProps(__spreadValues({\n \"aria-hidden\": !opened\n }, rest), {\n [refKey]: mergeRefs(el, theirRef),\n onTransitionEnd: handleTransitionEnd,\n style: __spreadValues(__spreadValues({ boxSizing: \"border-box\" }, style), styles)\n });\n }\n return getCollapseProps;\n}\n\nexport { getElementHeight, useCollapse };\n//# sourceMappingURL=use-collapse.js.map\n","import React, { forwardRef } from 'react';\nimport { useReducedMotion } from '@mantine/hooks';\nimport { useComponentDefaultProps, useMantineTheme } from '@mantine/styles';\nimport { useCollapse } from './use-collapse.js';\nimport { extractSystemStyles } from '../Box/style-system-props/extract-system-styles/extract-system-styles.js';\nimport { Box } from '../Box/Box.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst defaultProps = {\n transitionDuration: 200,\n transitionTimingFunction: \"ease\",\n animateOpacity: true\n};\nconst Collapse = forwardRef((props, ref) => {\n const _a = useComponentDefaultProps(\"Collapse\", defaultProps, props), {\n children,\n in: opened,\n transitionDuration,\n transitionTimingFunction,\n style,\n onTransitionEnd,\n animateOpacity\n } = _a, others = __objRest(_a, [\n \"children\",\n \"in\",\n \"transitionDuration\",\n \"transitionTimingFunction\",\n \"style\",\n \"onTransitionEnd\",\n \"animateOpacity\"\n ]);\n const theme = useMantineTheme();\n const shouldReduceMotion = useReducedMotion();\n const reduceMotion = theme.respectReducedMotion ? shouldReduceMotion : false;\n const duration = reduceMotion ? 0 : transitionDuration;\n const { systemStyles, rest } = extractSystemStyles(others);\n const getCollapseProps = useCollapse({\n opened,\n transitionDuration: duration,\n transitionTimingFunction,\n onTransitionEnd\n });\n if (duration === 0) {\n return opened ? /* @__PURE__ */ React.createElement(Box, __spreadValues({}, rest), children) : null;\n }\n return /* @__PURE__ */ React.createElement(Box, __spreadValues({}, getCollapseProps(__spreadValues(__spreadValues({ style, ref }, rest), systemStyles))), /* @__PURE__ */ React.createElement(\"div\", {\n style: {\n opacity: opened || !animateOpacity ? 1 : 0,\n transition: animateOpacity ? `opacity ${duration}ms ${transitionTimingFunction}` : \"none\"\n }\n }, children));\n});\nCollapse.displayName = \"@mantine/core/Collapse\";\n\nexport { Collapse };\n//# sourceMappingURL=Collapse.js.map\n","import React from 'react';\nimport { rem } from '@mantine/styles';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction ChevronIcon(props) {\n const _a = props, { style } = _a, others = __objRest(_a, [\"style\"]);\n return /* @__PURE__ */ React.createElement(\"svg\", __spreadValues({\n viewBox: \"0 0 15 15\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n style: __spreadValues({ width: rem(16), height: rem(16) }, style)\n }, others), /* @__PURE__ */ React.createElement(\"path\", {\n d: \"M3.13523 6.15803C3.3241 5.95657 3.64052 5.94637 3.84197 6.13523L7.5 9.56464L11.158 6.13523C11.3595 5.94637 11.6759 5.95657 11.8648 6.15803C12.0536 6.35949 12.0434 6.67591 11.842 6.86477L7.84197 10.6148C7.64964 10.7951 7.35036 10.7951 7.15803 10.6148L3.15803 6.86477C2.95657 6.67591 2.94637 6.35949 3.13523 6.15803Z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }));\n}\n\nexport { ChevronIcon };\n//# sourceMappingURL=ChevronIcon.js.map\n","import { createStyles, rem, getSize } from '@mantine/styles';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nconst ACTION_ICON_VARIANTS = [\n \"subtle\",\n \"filled\",\n \"outline\",\n \"light\",\n \"default\",\n \"transparent\",\n \"gradient\"\n];\nconst sizes = {\n xs: rem(18),\n sm: rem(22),\n md: rem(28),\n lg: rem(34),\n xl: rem(44)\n};\nfunction getVariantStyles({ variant, theme, color, gradient }) {\n const colors = theme.fn.variant({ color, variant, gradient });\n if (variant === \"gradient\") {\n return {\n border: 0,\n backgroundImage: colors.background,\n color: colors.color,\n \"&:hover\": theme.fn.hover({\n backgroundSize: \"200%\"\n })\n };\n }\n if (ACTION_ICON_VARIANTS.includes(variant)) {\n return __spreadValues({\n border: `${rem(1)} solid ${colors.border}`,\n backgroundColor: colors.background,\n color: colors.color\n }, theme.fn.hover({\n backgroundColor: colors.hover\n }));\n }\n return null;\n}\nvar useStyles = createStyles((theme, { radius, color, gradient }, { variant, size }) => ({\n root: __spreadProps(__spreadValues({\n position: \"relative\",\n borderRadius: theme.fn.radius(radius),\n padding: 0,\n lineHeight: 1,\n display: \"flex\",\n alignItems: \"center\",\n justifyContent: \"center\",\n height: getSize({ size, sizes }),\n minHeight: getSize({ size, sizes }),\n width: getSize({ size, sizes }),\n minWidth: getSize({ size, sizes })\n }, getVariantStyles({ variant, theme, color, gradient })), {\n \"&:active\": theme.activeStyles,\n \"& [data-action-icon-loader]\": {\n maxWidth: \"70%\"\n },\n \"&:disabled, &[data-disabled]\": {\n color: theme.colors.gray[theme.colorScheme === \"dark\" ? 6 : 4],\n cursor: \"not-allowed\",\n backgroundColor: variant === \"transparent\" ? void 0 : theme.fn.themeColor(\"gray\", theme.colorScheme === \"dark\" ? 8 : 1),\n borderColor: variant === \"transparent\" ? void 0 : theme.fn.themeColor(\"gray\", theme.colorScheme === \"dark\" ? 8 : 1),\n backgroundImage: \"none\",\n pointerEvents: \"none\",\n \"&:active\": {\n transform: \"none\"\n }\n },\n \"&[data-loading]\": {\n pointerEvents: \"none\",\n \"&::before\": __spreadProps(__spreadValues({\n content: '\"\"'\n }, theme.fn.cover(rem(-1))), {\n backgroundColor: theme.colorScheme === \"dark\" ? theme.fn.rgba(theme.colors.dark[7], 0.5) : \"rgba(255, 255, 255, .5)\",\n borderRadius: theme.fn.radius(radius),\n cursor: \"not-allowed\"\n })\n }\n })\n}));\n\nexport default useStyles;\nexport { ACTION_ICON_VARIANTS, sizes };\n//# sourceMappingURL=ActionIcon.styles.js.map\n","import React from 'react';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction Bars(_a) {\n var _b = _a, { size, color } = _b, others = __objRest(_b, [\"size\", \"color\"]);\n const _a2 = others, { style } = _a2, rest = __objRest(_a2, [\"style\"]);\n return /* @__PURE__ */ React.createElement(\"svg\", __spreadValues({\n viewBox: \"0 0 135 140\",\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: color,\n style: __spreadValues({ width: size }, style)\n }, rest), /* @__PURE__ */ React.createElement(\"rect\", {\n y: \"10\",\n width: \"15\",\n height: \"120\",\n rx: \"6\"\n }, /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"height\",\n begin: \"0.5s\",\n dur: \"1s\",\n values: \"120;110;100;90;80;70;60;50;40;140;120\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n }), /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"y\",\n begin: \"0.5s\",\n dur: \"1s\",\n values: \"10;15;20;25;30;35;40;45;50;0;10\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n })), /* @__PURE__ */ React.createElement(\"rect\", {\n x: \"30\",\n y: \"10\",\n width: \"15\",\n height: \"120\",\n rx: \"6\"\n }, /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"height\",\n begin: \"0.25s\",\n dur: \"1s\",\n values: \"120;110;100;90;80;70;60;50;40;140;120\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n }), /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"y\",\n begin: \"0.25s\",\n dur: \"1s\",\n values: \"10;15;20;25;30;35;40;45;50;0;10\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n })), /* @__PURE__ */ React.createElement(\"rect\", {\n x: \"60\",\n width: \"15\",\n height: \"140\",\n rx: \"6\"\n }, /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"height\",\n begin: \"0s\",\n dur: \"1s\",\n values: \"120;110;100;90;80;70;60;50;40;140;120\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n }), /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"y\",\n begin: \"0s\",\n dur: \"1s\",\n values: \"10;15;20;25;30;35;40;45;50;0;10\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n })), /* @__PURE__ */ React.createElement(\"rect\", {\n x: \"90\",\n y: \"10\",\n width: \"15\",\n height: \"120\",\n rx: \"6\"\n }, /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"height\",\n begin: \"0.25s\",\n dur: \"1s\",\n values: \"120;110;100;90;80;70;60;50;40;140;120\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n }), /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"y\",\n begin: \"0.25s\",\n dur: \"1s\",\n values: \"10;15;20;25;30;35;40;45;50;0;10\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n })), /* @__PURE__ */ React.createElement(\"rect\", {\n x: \"120\",\n y: \"10\",\n width: \"15\",\n height: \"120\",\n rx: \"6\"\n }, /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"height\",\n begin: \"0.5s\",\n dur: \"1s\",\n values: \"120;110;100;90;80;70;60;50;40;140;120\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n }), /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"y\",\n begin: \"0.5s\",\n dur: \"1s\",\n values: \"10;15;20;25;30;35;40;45;50;0;10\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n })));\n}\n\nexport { Bars };\n//# sourceMappingURL=Bars.js.map\n","import React from 'react';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction Oval(_a) {\n var _b = _a, { size, color } = _b, others = __objRest(_b, [\"size\", \"color\"]);\n const _a2 = others, { style } = _a2, rest = __objRest(_a2, [\"style\"]);\n return /* @__PURE__ */ React.createElement(\"svg\", __spreadValues({\n viewBox: \"0 0 38 38\",\n xmlns: \"http://www.w3.org/2000/svg\",\n stroke: color,\n style: __spreadValues({ width: size, height: size }, style)\n }, rest), /* @__PURE__ */ React.createElement(\"g\", {\n fill: \"none\",\n fillRule: \"evenodd\"\n }, /* @__PURE__ */ React.createElement(\"g\", {\n transform: \"translate(2.5 2.5)\",\n strokeWidth: \"5\"\n }, /* @__PURE__ */ React.createElement(\"circle\", {\n strokeOpacity: \".5\",\n cx: \"16\",\n cy: \"16\",\n r: \"16\"\n }), /* @__PURE__ */ React.createElement(\"path\", {\n d: \"M32 16c0-9.94-8.06-16-16-16\"\n }, /* @__PURE__ */ React.createElement(\"animateTransform\", {\n attributeName: \"transform\",\n type: \"rotate\",\n from: \"0 16 16\",\n to: \"360 16 16\",\n dur: \"1s\",\n repeatCount: \"indefinite\"\n })))));\n}\n\nexport { Oval };\n//# sourceMappingURL=Oval.js.map\n","import React from 'react';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction Dots(_a) {\n var _b = _a, { size, color } = _b, others = __objRest(_b, [\"size\", \"color\"]);\n const _a2 = others, { style } = _a2, rest = __objRest(_a2, [\"style\"]);\n return /* @__PURE__ */ React.createElement(\"svg\", __spreadValues({\n viewBox: \"0 0 120 30\",\n xmlns: \"http://www.w3.org/2000/svg\",\n fill: color,\n style: __spreadValues({ width: size }, style)\n }, rest), /* @__PURE__ */ React.createElement(\"circle\", {\n cx: \"15\",\n cy: \"15\",\n r: \"15\"\n }, /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"r\",\n from: \"15\",\n to: \"15\",\n begin: \"0s\",\n dur: \"0.8s\",\n values: \"15;9;15\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n }), /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"fill-opacity\",\n from: \"1\",\n to: \"1\",\n begin: \"0s\",\n dur: \"0.8s\",\n values: \"1;.5;1\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n })), /* @__PURE__ */ React.createElement(\"circle\", {\n cx: \"60\",\n cy: \"15\",\n r: \"9\",\n fillOpacity: \"0.3\"\n }, /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"r\",\n from: \"9\",\n to: \"9\",\n begin: \"0s\",\n dur: \"0.8s\",\n values: \"9;15;9\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n }), /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"fill-opacity\",\n from: \"0.5\",\n to: \"0.5\",\n begin: \"0s\",\n dur: \"0.8s\",\n values: \".5;1;.5\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n })), /* @__PURE__ */ React.createElement(\"circle\", {\n cx: \"105\",\n cy: \"15\",\n r: \"15\"\n }, /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"r\",\n from: \"15\",\n to: \"15\",\n begin: \"0s\",\n dur: \"0.8s\",\n values: \"15;9;15\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n }), /* @__PURE__ */ React.createElement(\"animate\", {\n attributeName: \"fill-opacity\",\n from: \"1\",\n to: \"1\",\n begin: \"0s\",\n dur: \"0.8s\",\n values: \"1;.5;1\",\n calcMode: \"linear\",\n repeatCount: \"indefinite\"\n })));\n}\n\nexport { Dots };\n//# sourceMappingURL=Dots.js.map\n","import React from 'react';\nimport { rem, useComponentDefaultProps, useMantineTheme, getSize } from '@mantine/styles';\nimport { Bars } from './loaders/Bars.js';\nimport { Oval } from './loaders/Oval.js';\nimport { Dots } from './loaders/Dots.js';\nimport { Box } from '../Box/Box.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst LOADERS = {\n bars: Bars,\n oval: Oval,\n dots: Dots\n};\nconst sizes = {\n xs: rem(18),\n sm: rem(22),\n md: rem(36),\n lg: rem(44),\n xl: rem(58)\n};\nconst defaultProps = {\n size: \"md\"\n};\nfunction Loader(props) {\n const _a = useComponentDefaultProps(\"Loader\", defaultProps, props), { size, color, variant } = _a, others = __objRest(_a, [\"size\", \"color\", \"variant\"]);\n const theme = useMantineTheme();\n const defaultLoader = variant in LOADERS ? variant : theme.loader;\n return /* @__PURE__ */ React.createElement(Box, __spreadValues({\n role: \"presentation\",\n component: LOADERS[defaultLoader] || LOADERS.bars,\n size: getSize({ size, sizes }),\n color: theme.fn.variant({\n variant: \"filled\",\n primaryFallback: false,\n color: color || theme.primaryColor\n }).background\n }, others));\n}\nLoader.displayName = \"@mantine/core/Loader\";\n\nexport { Loader };\n//# sourceMappingURL=Loader.js.map\n","import React, { forwardRef } from 'react';\nimport { useComponentDefaultProps } from '@mantine/styles';\nimport { createPolymorphicComponent } from '@mantine/utils';\nimport useStyles from './ActionIcon.styles.js';\nimport { Loader } from '../Loader/Loader.js';\nimport { UnstyledButton } from '../UnstyledButton/UnstyledButton.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst defaultProps = {\n color: \"gray\",\n size: \"md\",\n variant: \"subtle\"\n};\nconst _ActionIcon = forwardRef((props, ref) => {\n const _a = useComponentDefaultProps(\"ActionIcon\", defaultProps, props), {\n className,\n color,\n children,\n radius,\n size,\n variant,\n gradient,\n disabled,\n loaderProps,\n loading,\n unstyled,\n __staticSelector\n } = _a, others = __objRest(_a, [\n \"className\",\n \"color\",\n \"children\",\n \"radius\",\n \"size\",\n \"variant\",\n \"gradient\",\n \"disabled\",\n \"loaderProps\",\n \"loading\",\n \"unstyled\",\n \"__staticSelector\"\n ]);\n const { classes, cx, theme } = useStyles({ radius, color, gradient }, { name: [\"ActionIcon\", __staticSelector], unstyled, size, variant });\n const loader = /* @__PURE__ */ React.createElement(Loader, __spreadValues({\n color: theme.fn.variant({ color, variant }).color,\n size: \"100%\",\n \"data-action-icon-loader\": true\n }, loaderProps));\n return /* @__PURE__ */ React.createElement(UnstyledButton, __spreadValues({\n className: cx(classes.root, className),\n ref,\n disabled,\n \"data-disabled\": disabled || void 0,\n \"data-loading\": loading || void 0,\n unstyled\n }, others), loading ? loader : children);\n});\n_ActionIcon.displayName = \"@mantine/core/ActionIcon\";\nconst ActionIcon = createPolymorphicComponent(_ActionIcon);\n\nexport { ActionIcon, _ActionIcon };\n//# sourceMappingURL=ActionIcon.js.map\n","import React, { useState, useRef } from 'react';\nimport { createPortal } from 'react-dom';\nimport { useIsomorphicEffect } from '@mantine/hooks';\nimport { useComponentDefaultProps, useMantineTheme } from '@mantine/styles';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction Portal(props) {\n const _a = useComponentDefaultProps(\"Portal\", {}, props), { children, target, className, innerRef } = _a, others = __objRest(_a, [\"children\", \"target\", \"className\", \"innerRef\"]);\n const theme = useMantineTheme();\n const [mounted, setMounted] = useState(false);\n const ref = useRef();\n useIsomorphicEffect(() => {\n setMounted(true);\n ref.current = !target ? document.createElement(\"div\") : typeof target === \"string\" ? document.querySelector(target) : target;\n if (!target) {\n document.body.appendChild(ref.current);\n }\n return () => {\n !target && document.body.removeChild(ref.current);\n };\n }, [target]);\n if (!mounted) {\n return null;\n }\n return createPortal(/* @__PURE__ */ React.createElement(\"div\", __spreadProps(__spreadValues({\n className,\n dir: theme.dir\n }, others), {\n ref: innerRef\n }), children), ref.current);\n}\nPortal.displayName = \"@mantine/core/Portal\";\n\nexport { Portal };\n//# sourceMappingURL=Portal.js.map\n","import React from 'react';\nimport { Portal } from './Portal.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction OptionalPortal(_a) {\n var _b = _a, { withinPortal = true, children } = _b, others = __objRest(_b, [\"withinPortal\", \"children\"]);\n if (withinPortal) {\n return /* @__PURE__ */ React.createElement(Portal, __spreadValues({}, others), children);\n }\n return /* @__PURE__ */ React.createElement(React.Fragment, null, children);\n}\nOptionalPortal.displayName = \"@mantine/core/OptionalPortal\";\n\nexport { OptionalPortal };\n//# sourceMappingURL=OptionalPortal.js.map\n","import React from 'react';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nfunction CloseIcon(props) {\n const _a = props, { width, height, style } = _a, others = __objRest(_a, [\"width\", \"height\", \"style\"]);\n return /* @__PURE__ */ React.createElement(\"svg\", __spreadValues({\n viewBox: \"0 0 15 15\",\n fill: \"none\",\n xmlns: \"http://www.w3.org/2000/svg\",\n style: __spreadValues({ width, height }, style)\n }, others), /* @__PURE__ */ React.createElement(\"path\", {\n d: \"M11.7816 4.03157C12.0062 3.80702 12.0062 3.44295 11.7816 3.2184C11.5571 2.99385 11.193 2.99385 10.9685 3.2184L7.50005 6.68682L4.03164 3.2184C3.80708 2.99385 3.44301 2.99385 3.21846 3.2184C2.99391 3.44295 2.99391 3.80702 3.21846 4.03157L6.68688 7.49999L3.21846 10.9684C2.99391 11.193 2.99391 11.557 3.21846 11.7816C3.44301 12.0061 3.80708 12.0061 4.03164 11.7816L7.50005 8.31316L10.9685 11.7816C11.193 12.0061 11.5571 12.0061 11.7816 11.7816C12.0062 11.557 12.0062 11.193 11.7816 10.9684L8.31322 7.49999L11.7816 4.03157Z\",\n fill: \"currentColor\",\n fillRule: \"evenodd\",\n clipRule: \"evenodd\"\n }));\n}\nCloseIcon.displayName = \"@mantine/core/CloseIcon\";\n\nexport { CloseIcon };\n//# sourceMappingURL=CloseIcon.js.map\n","import React, { forwardRef } from 'react';\nimport { rem, useComponentDefaultProps } from '@mantine/styles';\nimport { createPolymorphicComponent } from '@mantine/utils';\nimport { ActionIcon } from '../ActionIcon/ActionIcon.js';\nimport { CloseIcon } from './CloseIcon.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst iconSizes = {\n xs: rem(12),\n sm: rem(16),\n md: rem(20),\n lg: rem(28),\n xl: rem(34)\n};\nconst defaultProps = {\n size: \"sm\"\n};\nconst _CloseButton = forwardRef((props, ref) => {\n const _a = useComponentDefaultProps(\"CloseButton\", defaultProps, props), { iconSize, size, children } = _a, others = __objRest(_a, [\"iconSize\", \"size\", \"children\"]);\n const _iconSize = rem(iconSize || iconSizes[size]);\n return /* @__PURE__ */ React.createElement(ActionIcon, __spreadValues({\n ref,\n __staticSelector: \"CloseButton\",\n size\n }, others), children || /* @__PURE__ */ React.createElement(CloseIcon, {\n width: _iconSize,\n height: _iconSize\n }));\n});\n_CloseButton.displayName = \"@mantine/core/CloseButton\";\nconst CloseButton = createPolymorphicComponent(_CloseButton);\n\nexport { CloseButton, _CloseButton };\n//# sourceMappingURL=CloseButton.js.map\n","import { createStyles, getSize } from '@mantine/styles';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nfunction getTextDecoration({\n underline,\n strikethrough\n}) {\n const styles = [];\n if (underline) {\n styles.push(\"underline\");\n }\n if (strikethrough) {\n styles.push(\"line-through\");\n }\n return styles.length > 0 ? styles.join(\" \") : \"none\";\n}\nfunction getTextColor({ theme, color }) {\n if (color === \"dimmed\") {\n return theme.fn.dimmed();\n }\n return typeof color === \"string\" && (color in theme.colors || color.split(\".\")[0] in theme.colors) ? theme.fn.variant({ variant: \"filled\", color }).background : color || \"inherit\";\n}\nfunction getLineClamp(lineClamp) {\n if (typeof lineClamp === \"number\") {\n return {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n display: \"-webkit-box\",\n WebkitLineClamp: lineClamp,\n WebkitBoxOrient: \"vertical\"\n };\n }\n return null;\n}\nfunction getTruncate({ theme, truncate }) {\n if (truncate === \"start\") {\n return {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\",\n direction: theme.dir === \"ltr\" ? \"rtl\" : \"ltr\",\n textAlign: theme.dir === \"ltr\" ? \"right\" : \"left\"\n };\n }\n if (truncate) {\n return {\n overflow: \"hidden\",\n textOverflow: \"ellipsis\",\n whiteSpace: \"nowrap\"\n };\n }\n return null;\n}\nvar useStyles = createStyles((theme, {\n color,\n lineClamp,\n truncate,\n inline,\n inherit,\n underline,\n gradient,\n weight,\n transform,\n align,\n strikethrough,\n italic\n}, { size }) => {\n const colors = theme.fn.variant({ variant: \"gradient\", gradient });\n return {\n root: __spreadProps(__spreadValues(__spreadValues(__spreadValues(__spreadValues({}, theme.fn.fontStyles()), theme.fn.focusStyles()), getLineClamp(lineClamp)), getTruncate({ theme, truncate })), {\n color: getTextColor({ color, theme }),\n fontFamily: inherit ? \"inherit\" : theme.fontFamily,\n fontSize: inherit || size === void 0 ? \"inherit\" : getSize({ size, sizes: theme.fontSizes }),\n lineHeight: inherit ? \"inherit\" : inline ? 1 : theme.lineHeight,\n textDecoration: getTextDecoration({ underline, strikethrough }),\n WebkitTapHighlightColor: \"transparent\",\n fontWeight: inherit ? \"inherit\" : weight,\n textTransform: transform,\n textAlign: align,\n fontStyle: italic ? \"italic\" : void 0\n }),\n gradient: {\n backgroundImage: colors.background,\n WebkitBackgroundClip: \"text\",\n WebkitTextFillColor: \"transparent\"\n }\n };\n});\n\nexport default useStyles;\n//# sourceMappingURL=Text.styles.js.map\n","import React, { forwardRef } from 'react';\nimport { useComponentDefaultProps } from '@mantine/styles';\nimport { createPolymorphicComponent } from '@mantine/utils';\nimport useStyles from './Text.styles.js';\nimport { Box } from '../Box/Box.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst defaultProps = {\n variant: \"text\"\n};\nconst _Text = forwardRef((props, ref) => {\n const _a = useComponentDefaultProps(\"Text\", defaultProps, props), {\n className,\n size,\n weight,\n transform,\n color,\n align,\n variant,\n lineClamp,\n truncate,\n gradient,\n inline,\n inherit,\n underline,\n strikethrough,\n italic,\n classNames,\n styles,\n unstyled,\n span,\n __staticSelector\n } = _a, others = __objRest(_a, [\n \"className\",\n \"size\",\n \"weight\",\n \"transform\",\n \"color\",\n \"align\",\n \"variant\",\n \"lineClamp\",\n \"truncate\",\n \"gradient\",\n \"inline\",\n \"inherit\",\n \"underline\",\n \"strikethrough\",\n \"italic\",\n \"classNames\",\n \"styles\",\n \"unstyled\",\n \"span\",\n \"__staticSelector\"\n ]);\n const { classes, cx } = useStyles({\n color,\n lineClamp,\n truncate,\n inline,\n inherit,\n underline,\n strikethrough,\n italic,\n weight,\n transform,\n align,\n gradient\n }, { unstyled, name: __staticSelector || \"Text\", variant, size });\n return /* @__PURE__ */ React.createElement(Box, __spreadValues({\n ref,\n className: cx(classes.root, { [classes.gradient]: variant === \"gradient\" }, className),\n component: span ? \"span\" : \"div\"\n }, others));\n});\n_Text.displayName = \"@mantine/core/Text\";\nconst Text = createPolymorphicComponent(_Text);\n\nexport { Text, _Text };\n//# sourceMappingURL=Text.js.map\n","import { createContext, useContext } from 'react';\n\nconst AppShellContext = createContext({\n zIndex: 1e3,\n fixed: false,\n layout: \"default\"\n});\nconst AppShellProvider = AppShellContext.Provider;\nfunction useAppShellContext() {\n return useContext(AppShellContext);\n}\n\nexport { AppShellProvider, useAppShellContext };\n//# sourceMappingURL=AppShell.context.js.map\n","import { getSize, getBreakpointValue } from '@mantine/styles';\n\nfunction getSortedBreakpoints(breakpoints, theme) {\n if (!breakpoints) {\n return [];\n }\n const values = Object.keys(breakpoints).filter((breakpoint) => breakpoint !== \"base\").map((breakpoint) => [\n getSize({ size: breakpoint, sizes: theme.breakpoints, units: \"em\" }),\n breakpoints[breakpoint]\n ]);\n values.sort((a, b) => getBreakpointValue(a[0]) - getBreakpointValue(b[0]));\n return values;\n}\n\nexport { getSortedBreakpoints };\n//# sourceMappingURL=get-sorted-breakpoints.js.map\n","import { createStyles, em, rem, getBreakpointValue, getSize } from '@mantine/styles';\nimport { getSortedBreakpoints } from './get-sorted-breakpoints/get-sorted-breakpoints.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar useStyles = createStyles((theme, {\n height,\n width,\n fixed,\n position,\n hiddenBreakpoint,\n zIndex,\n section,\n withBorder,\n layout\n}) => {\n const breakpoints = typeof width === \"object\" && width !== null ? getSortedBreakpoints(width, theme).reduce((acc, [breakpoint, breakpointSize]) => {\n acc[`@media (min-width: ${em(breakpoint)})`] = {\n width: rem(breakpointSize),\n minWidth: rem(breakpointSize)\n };\n return acc;\n }, {}) : null;\n const borderStyles = withBorder ? {\n [section === \"navbar\" ? \"borderRight\" : \"borderLeft\"]: `${rem(1)} solid ${theme.colorScheme === \"dark\" ? theme.colors.dark[5] : theme.colors.gray[2]}`\n } : {};\n return {\n root: __spreadProps(__spreadValues(__spreadValues(__spreadProps(__spreadValues(__spreadValues({}, theme.fn.fontStyles()), position), {\n top: layout === \"alt\" ? 0 : (position == null ? void 0 : position.top) || \"var(--mantine-header-height)\",\n bottom: 0,\n zIndex,\n height: height ? rem(height) : layout === \"alt\" ? \"auto\" : \"calc(100vh - var(--mantine-header-height, 0rem) - var(--mantine-footer-height, 0rem))\",\n width: (width == null ? void 0 : width.base) ? rem(width == null ? void 0 : width.base) : \"100%\",\n position: fixed ? \"fixed\" : \"static\",\n boxSizing: \"border-box\",\n display: \"flex\",\n flexDirection: \"column\",\n backgroundColor: theme.colorScheme === \"dark\" ? theme.colors.dark[7] : theme.white\n }), borderStyles), breakpoints), {\n \"&[data-hidden]\": {\n [`@media (max-width: ${em(getBreakpointValue(getSize({\n size: hiddenBreakpoint,\n sizes: theme.breakpoints\n })) - 1)})`]: {\n display: \"none\"\n }\n }\n })\n };\n});\n\nexport default useStyles;\n//# sourceMappingURL=HorizontalSection.styles.js.map\n","import React, { forwardRef } from 'react';\nimport { getDefaultZIndex, em, rem, Global } from '@mantine/styles';\nimport { useAppShellContext } from '../AppShell.context.js';\nimport { getSortedBreakpoints } from './get-sorted-breakpoints/get-sorted-breakpoints.js';\nimport useStyles from './HorizontalSection.styles.js';\nimport { Box } from '../../Box/Box.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst HorizontalSection = forwardRef((_a, ref) => {\n var _b = _a, {\n width,\n height,\n fixed = false,\n position,\n zIndex,\n hiddenBreakpoint = \"md\",\n hidden = false,\n withBorder = true,\n className,\n classNames,\n styles,\n children,\n section,\n __staticSelector,\n unstyled,\n variant\n } = _b, others = __objRest(_b, [\n \"width\",\n \"height\",\n \"fixed\",\n \"position\",\n \"zIndex\",\n \"hiddenBreakpoint\",\n \"hidden\",\n \"withBorder\",\n \"className\",\n \"classNames\",\n \"styles\",\n \"children\",\n \"section\",\n \"__staticSelector\",\n \"unstyled\",\n \"variant\"\n ]);\n const ctx = useAppShellContext();\n const { classes, cx, theme } = useStyles({\n width,\n height,\n fixed: ctx.fixed || fixed,\n position,\n hiddenBreakpoint,\n zIndex: zIndex || ctx.zIndex || getDefaultZIndex(\"app\"),\n section,\n withBorder,\n layout: ctx.layout\n }, { classNames, styles, name: __staticSelector, unstyled, variant });\n const breakpoints = getSortedBreakpoints(width, theme).reduce((acc, [breakpoint, breakpointSize]) => {\n acc[`@media (min-width: ${em(breakpoint)})`] = {\n [`--mantine-${section}-width`]: rem(breakpointSize)\n };\n return acc;\n }, {});\n return /* @__PURE__ */ React.createElement(Box, __spreadValues({\n component: section === \"navbar\" ? \"nav\" : \"aside\",\n ref,\n \"data-hidden\": hidden || void 0,\n className: cx(classes.root, className)\n }, others), children, /* @__PURE__ */ React.createElement(Global, {\n styles: () => ({\n \":root\": __spreadValues({\n [`--mantine-${section}-width`]: (width == null ? void 0 : width.base) ? rem(width.base) : \"0rem\"\n }, breakpoints)\n })\n }));\n});\nHorizontalSection.displayName = \"@mantine/core/HorizontalSection\";\n\nexport { HorizontalSection };\n//# sourceMappingURL=HorizontalSection.js.map\n","import React, { forwardRef } from 'react';\nimport { packSx, createPolymorphicComponent } from '@mantine/utils';\nimport { Box } from '../../../Box/Box.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst _Section = forwardRef((_a, ref) => {\n var _b = _a, { children, grow = false, sx } = _b, others = __objRest(_b, [\"children\", \"grow\", \"sx\"]);\n return /* @__PURE__ */ React.createElement(Box, __spreadValues({\n ref,\n sx: [{ flex: grow ? 1 : 0, boxSizing: \"border-box\" }, ...packSx(sx)]\n }, others), children);\n});\n_Section.displayName = \"@mantine/core/Section\";\nconst Section = createPolymorphicComponent(_Section);\n\nexport { Section, _Section };\n//# sourceMappingURL=Section.js.map\n","import React, { forwardRef } from 'react';\nimport { useComponentDefaultProps } from '@mantine/styles';\nimport { HorizontalSection } from '../HorizontalSection/HorizontalSection.js';\nimport { Section } from '../HorizontalSection/Section/Section.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nconst defaultProps = {\n fixed: false,\n position: { top: 0, left: 0 },\n hiddenBreakpoint: \"md\",\n hidden: false\n};\nconst Navbar = forwardRef((props, ref) => {\n const _props = useComponentDefaultProps(\"Navbar\", defaultProps, props);\n return /* @__PURE__ */ React.createElement(HorizontalSection, __spreadValues({\n section: \"navbar\",\n __staticSelector: \"Navbar\",\n ref\n }, _props));\n});\nNavbar.Section = Section;\nNavbar.displayName = \"@mantine/core/Navbar\";\n\nexport { Navbar };\n//# sourceMappingURL=Navbar.js.map\n","import { createStyles, em, rem } from '@mantine/styles';\nimport { getSortedBreakpoints } from '../HorizontalSection/get-sorted-breakpoints/get-sorted-breakpoints.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar useStyles = createStyles((theme, { height, fixed, position, zIndex, borderPosition, layout }) => {\n const breakpoints = typeof height === \"object\" && height !== null ? getSortedBreakpoints(height, theme).reduce((acc, [breakpoint, breakpointSize]) => {\n acc[`@media (min-width: ${em(breakpoint)})`] = {\n height: rem(breakpointSize),\n minHeight: rem(breakpointSize)\n };\n return acc;\n }, {}) : null;\n return {\n root: __spreadProps(__spreadValues(__spreadProps(__spreadValues(__spreadValues({}, theme.fn.fontStyles()), position), {\n zIndex,\n left: layout === \"alt\" ? \"var(--mantine-navbar-width, 0)\" : 0,\n right: layout === \"alt\" ? \"var(--mantine-aside-width, 0)\" : 0,\n height: typeof height === \"object\" ? rem(height == null ? void 0 : height.base) || \"100%\" : rem(height),\n maxHeight: typeof height === \"object\" ? rem(height == null ? void 0 : height.base) || \"100%\" : rem(height),\n position: fixed ? \"fixed\" : \"static\",\n boxSizing: \"border-box\",\n backgroundColor: theme.colorScheme === \"dark\" ? theme.colors.dark[7] : theme.white\n }), breakpoints), {\n borderBottom: borderPosition === \"bottom\" ? `${rem(1)} solid ${theme.colorScheme === \"dark\" ? theme.colors.dark[5] : theme.colors.gray[2]}` : void 0,\n borderTop: borderPosition === \"top\" ? `${rem(1)} solid ${theme.colorScheme === \"dark\" ? theme.colors.dark[5] : theme.colors.gray[2]}` : void 0\n })\n };\n});\n\nexport default useStyles;\n//# sourceMappingURL=VerticalSection.styles.js.map\n","import React, { forwardRef } from 'react';\nimport { getDefaultZIndex, em, rem, Global } from '@mantine/styles';\nimport { useAppShellContext } from '../AppShell.context.js';\nimport useStyles from './VerticalSection.styles.js';\nimport { getSortedBreakpoints } from '../HorizontalSection/get-sorted-breakpoints/get-sorted-breakpoints.js';\nimport { Box } from '../../Box/Box.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst VerticalSection = forwardRef((_a, ref) => {\n var _b = _a, {\n children,\n className,\n classNames,\n styles,\n height,\n fixed = false,\n withBorder = true,\n position,\n zIndex,\n section,\n unstyled,\n __staticSelector,\n variant\n } = _b, others = __objRest(_b, [\n \"children\",\n \"className\",\n \"classNames\",\n \"styles\",\n \"height\",\n \"fixed\",\n \"withBorder\",\n \"position\",\n \"zIndex\",\n \"section\",\n \"unstyled\",\n \"__staticSelector\",\n \"variant\"\n ]);\n const ctx = useAppShellContext();\n const _zIndex = zIndex || ctx.zIndex || getDefaultZIndex(\"app\");\n const { classes, cx, theme } = useStyles({\n height,\n fixed: ctx.fixed || fixed,\n position,\n zIndex: typeof _zIndex === \"number\" && ctx.layout === \"default\" ? _zIndex + 1 : _zIndex,\n layout: ctx.layout,\n borderPosition: withBorder ? section === \"header\" ? \"bottom\" : \"top\" : \"none\"\n }, { name: __staticSelector, classNames, styles, unstyled, variant });\n const breakpoints = typeof height === \"object\" && height !== null ? getSortedBreakpoints(height, theme).reduce((acc, [breakpoint, breakpointSize]) => {\n acc[`@media (min-width: ${em(breakpoint)})`] = {\n [`--mantine-${section}-height`]: rem(breakpointSize)\n };\n return acc;\n }, {}) : null;\n return /* @__PURE__ */ React.createElement(Box, __spreadValues({\n component: section === \"header\" ? \"header\" : \"footer\",\n className: cx(classes.root, className),\n ref\n }, others), children, /* @__PURE__ */ React.createElement(Global, {\n styles: () => ({\n \":root\": __spreadValues({\n [`--mantine-${section}-height`]: typeof height === \"object\" ? rem(height == null ? void 0 : height.base) || \"100%\" : rem(height)\n }, breakpoints)\n })\n }));\n});\nVerticalSection.displayName = \"@mantine/core/VerticalSection\";\n\nexport { VerticalSection };\n//# sourceMappingURL=VerticalSection.js.map\n","import React, { forwardRef } from 'react';\nimport { useComponentDefaultProps } from '@mantine/styles';\nimport { VerticalSection } from '../VerticalSection/VerticalSection.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nconst defaultProps = {\n fixed: false,\n position: { top: 0, left: 0, right: 0 }\n};\nconst Header = forwardRef((props, ref) => {\n const _props = useComponentDefaultProps(\"Header\", defaultProps, props);\n return /* @__PURE__ */ React.createElement(VerticalSection, __spreadProps(__spreadValues({\n section: \"header\",\n __staticSelector: \"Header\"\n }, _props), {\n ref\n }));\n});\nHeader.displayName = \"@mantine/core/Header\";\n\nexport { Header };\n//# sourceMappingURL=Header.js.map\n","import { createStyles, getSize, getBreakpointValue, em } from '@mantine/styles';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nfunction getPositionStyles(props, theme) {\n const padding = getSize({ size: props.padding, sizes: theme.spacing });\n const navbarOffset = props.navbarOffsetBreakpoint ? getSize({ size: props.navbarOffsetBreakpoint, sizes: theme.breakpoints }) : null;\n const asideOffset = props.asideOffsetBreakpoint ? getSize({ size: props.asideOffsetBreakpoint, sizes: theme.breakpoints }) : null;\n if (!props.fixed) {\n return { padding };\n }\n const navbarBreakpointValue = getBreakpointValue(navbarOffset);\n const asideBreakpointValue = getBreakpointValue(asideOffset);\n return __spreadValues({\n minHeight: \"100vh\",\n paddingTop: `calc(var(--mantine-header-height, 0px) + ${padding})`,\n paddingBottom: `calc(var(--mantine-footer-height, 0px) + ${padding})`,\n paddingLeft: `calc(var(--mantine-navbar-width, 0px) + ${padding})`,\n paddingRight: `calc(var(--mantine-aside-width, 0px) + ${padding})`\n }, navbarBreakpointValue === asideBreakpointValue ? {\n [`@media (max-width: ${em(navbarBreakpointValue - 1)})`]: {\n paddingLeft: padding,\n paddingRight: padding\n }\n } : {\n [`@media (max-width: ${em(navbarBreakpointValue - 1)})`]: {\n paddingLeft: padding\n },\n [`@media (max-width: ${em(asideBreakpointValue - 1)})`]: {\n paddingRight: padding\n }\n });\n}\nvar useStyles = createStyles((theme, props) => ({\n root: {\n boxSizing: \"border-box\"\n },\n body: {\n display: \"flex\",\n boxSizing: \"border-box\"\n },\n main: __spreadValues({\n flex: 1,\n width: \"100vw\",\n boxSizing: \"border-box\"\n }, getPositionStyles(props, theme))\n}));\n\nexport default useStyles;\n//# sourceMappingURL=AppShell.styles.js.map\n","import React, { forwardRef } from 'react';\nimport { useComponentDefaultProps } from '@mantine/styles';\nimport { AppShellProvider } from './AppShell.context.js';\nimport useStyles from './AppShell.styles.js';\nimport { Box } from '../Box/Box.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst defaultProps = {\n fixed: true,\n padding: \"md\"\n};\nconst AppShell = forwardRef((props, ref) => {\n const _a = useComponentDefaultProps(\"AppShell\", defaultProps, props), {\n children,\n navbar,\n header,\n footer,\n aside,\n fixed,\n zIndex,\n padding,\n navbarOffsetBreakpoint,\n asideOffsetBreakpoint,\n className,\n styles,\n classNames,\n unstyled,\n hidden,\n layout,\n variant\n } = _a, others = __objRest(_a, [\n \"children\",\n \"navbar\",\n \"header\",\n \"footer\",\n \"aside\",\n \"fixed\",\n \"zIndex\",\n \"padding\",\n \"navbarOffsetBreakpoint\",\n \"asideOffsetBreakpoint\",\n \"className\",\n \"styles\",\n \"classNames\",\n \"unstyled\",\n \"hidden\",\n \"layout\",\n \"variant\"\n ]);\n const { classes, cx } = useStyles({ padding, fixed, navbarOffsetBreakpoint, asideOffsetBreakpoint }, { styles, classNames, unstyled, name: \"AppShell\", variant });\n if (hidden) {\n return /* @__PURE__ */ React.createElement(React.Fragment, null, children);\n }\n return /* @__PURE__ */ React.createElement(AppShellProvider, {\n value: { fixed, zIndex, layout }\n }, /* @__PURE__ */ React.createElement(Box, __spreadValues({\n className: cx(classes.root, className),\n ref\n }, others), header, /* @__PURE__ */ React.createElement(\"div\", {\n className: classes.body\n }, navbar, /* @__PURE__ */ React.createElement(\"main\", {\n className: classes.main\n }, children), aside), footer));\n});\nAppShell.displayName = \"@mantine/core/AppShell\";\n\nexport { AppShell };\n//# sourceMappingURL=AppShell.js.map\n","import { createStyles, rem, getSize } from '@mantine/styles';\n\nconst sizes = {\n xs: rem(1),\n sm: rem(2),\n md: rem(3),\n lg: rem(4),\n xl: rem(5)\n};\nfunction getColor(theme, color) {\n const themeColor = theme.fn.variant({ variant: \"outline\", color }).border;\n return typeof color === \"string\" && (color in theme.colors || color.split(\".\")[0] in theme.colors) ? themeColor : color === void 0 ? theme.colorScheme === \"dark\" ? theme.colors.dark[4] : theme.colors.gray[4] : color;\n}\nvar useStyles = createStyles((theme, { color }, { size, variant }) => ({\n root: {},\n withLabel: {\n borderTop: \"0 !important\"\n },\n left: {\n \"&::before\": {\n display: \"none\"\n }\n },\n right: {\n \"&::after\": {\n display: \"none\"\n }\n },\n label: {\n display: \"flex\",\n alignItems: \"center\",\n \"&::before\": {\n content: '\"\"',\n flex: 1,\n height: rem(1),\n borderTop: `${getSize({ size, sizes })} ${variant} ${getColor(theme, color)}`,\n marginRight: theme.spacing.xs\n },\n \"&::after\": {\n content: '\"\"',\n flex: 1,\n borderTop: `${getSize({ size, sizes })} ${variant} ${getColor(theme, color)}`,\n marginLeft: theme.spacing.xs\n }\n },\n labelDefaultStyles: {\n color: color === \"dark\" ? theme.colors.dark[1] : theme.fn.themeColor(color, theme.colorScheme === \"dark\" ? 5 : theme.fn.primaryShade(), false)\n },\n horizontal: {\n border: 0,\n borderTopWidth: rem(getSize({ size, sizes })),\n borderTopColor: getColor(theme, color),\n borderTopStyle: variant,\n margin: 0\n },\n vertical: {\n border: 0,\n alignSelf: \"stretch\",\n height: \"auto\",\n borderLeftWidth: rem(getSize({ size, sizes })),\n borderLeftColor: getColor(theme, color),\n borderLeftStyle: variant\n }\n}));\n\nexport default useStyles;\n//# sourceMappingURL=Divider.styles.js.map\n","import React, { forwardRef } from 'react';\nimport { useComponentDefaultProps, rem } from '@mantine/styles';\nimport useStyles from './Divider.styles.js';\nimport { Box } from '../Box/Box.js';\nimport { Text } from '../Text/Text.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst defaultProps = {\n orientation: \"horizontal\",\n size: \"xs\",\n labelPosition: \"left\",\n variant: \"solid\"\n};\nconst Divider = forwardRef((props, ref) => {\n const _a = useComponentDefaultProps(\"Divider\", defaultProps, props), {\n className,\n color,\n orientation,\n size,\n label,\n labelPosition,\n labelProps,\n variant,\n styles,\n classNames,\n unstyled\n } = _a, others = __objRest(_a, [\n \"className\",\n \"color\",\n \"orientation\",\n \"size\",\n \"label\",\n \"labelPosition\",\n \"labelProps\",\n \"variant\",\n \"styles\",\n \"classNames\",\n \"unstyled\"\n ]);\n const { classes, cx } = useStyles({ color }, { classNames, styles, unstyled, name: \"Divider\", variant, size });\n const vertical = orientation === \"vertical\";\n const horizontal = orientation === \"horizontal\";\n const withLabel = !!label && horizontal;\n const useLabelDefaultStyles = !(labelProps == null ? void 0 : labelProps.color);\n return /* @__PURE__ */ React.createElement(Box, __spreadValues({\n ref,\n className: cx(classes.root, {\n [classes.vertical]: vertical,\n [classes.horizontal]: horizontal,\n [classes.withLabel]: withLabel\n }, className),\n role: \"separator\"\n }, others), withLabel && /* @__PURE__ */ React.createElement(Text, __spreadProps(__spreadValues({}, labelProps), {\n size: (labelProps == null ? void 0 : labelProps.size) || \"xs\",\n mt: rem(2),\n className: cx(classes.label, classes[labelPosition], {\n [classes.labelDefaultStyles]: useLabelDefaultStyles\n })\n }), label));\n});\nDivider.displayName = \"@mantine/core/Divider\";\n\nexport { Divider };\n//# sourceMappingURL=Divider.js.map\n","import { createStyles, getSize } from '@mantine/styles';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar useStyles = createStyles((theme, _params, { size }) => ({\n item: __spreadProps(__spreadValues({}, theme.fn.fontStyles()), {\n boxSizing: \"border-box\",\n wordBreak: \"break-all\",\n textAlign: \"left\",\n width: \"100%\",\n padding: `calc(${getSize({ size, sizes: theme.spacing })} / 1.5) ${getSize({\n size,\n sizes: theme.spacing\n })}`,\n cursor: \"pointer\",\n fontSize: getSize({ size, sizes: theme.fontSizes }),\n color: theme.colorScheme === \"dark\" ? theme.colors.dark[0] : theme.black,\n borderRadius: theme.fn.radius(),\n \"&[data-hovered]\": {\n backgroundColor: theme.colorScheme === \"dark\" ? theme.colors.dark[4] : theme.colors.gray[1]\n },\n \"&[data-selected]\": __spreadValues({\n backgroundColor: theme.fn.variant({ variant: \"filled\" }).background,\n color: theme.fn.variant({ variant: \"filled\" }).color\n }, theme.fn.hover({ backgroundColor: theme.fn.variant({ variant: \"filled\" }).hover })),\n \"&[data-disabled]\": {\n cursor: \"default\",\n color: theme.colors.dark[2]\n }\n }),\n nothingFound: {\n boxSizing: \"border-box\",\n color: theme.colors.gray[6],\n paddingTop: `calc(${getSize({ size, sizes: theme.spacing })} / 2)`,\n paddingBottom: `calc(${getSize({ size, sizes: theme.spacing })} / 2)`,\n textAlign: \"center\"\n },\n separator: {\n boxSizing: \"border-box\",\n textAlign: \"left\",\n width: \"100%\",\n padding: `calc(${getSize({ size, sizes: theme.spacing })} / 1.5) ${getSize({\n size,\n sizes: theme.spacing\n })}`\n },\n separatorLabel: {\n color: theme.colorScheme === \"dark\" ? theme.colors.dark[3] : theme.colors.gray[5]\n }\n}));\n\nexport default useStyles;\n//# sourceMappingURL=SelectItems.styles.js.map\n","import React from 'react';\nimport { randomId } from '@mantine/hooks';\nimport { Text } from '../../Text/Text.js';\nimport { Divider } from '../../Divider/Divider.js';\nimport useStyles from './SelectItems.styles.js';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nfunction SelectItems({\n data,\n hovered,\n classNames,\n styles,\n isItemSelected,\n uuid,\n __staticSelector,\n onItemHover,\n onItemSelect,\n itemsRefs,\n itemComponent: Item,\n size,\n nothingFound,\n creatable,\n createLabel,\n unstyled,\n variant\n}) {\n const { classes } = useStyles(null, {\n classNames,\n styles,\n unstyled,\n name: __staticSelector,\n variant,\n size\n });\n const unGroupedItems = [];\n const groupedItems = [];\n let creatableDataIndex = null;\n const constructItemComponent = (item, index) => {\n const selected = typeof isItemSelected === \"function\" ? isItemSelected(item.value) : false;\n return /* @__PURE__ */ React.createElement(Item, __spreadValues({\n key: item.value,\n className: classes.item,\n \"data-disabled\": item.disabled || void 0,\n \"data-hovered\": !item.disabled && hovered === index || void 0,\n \"data-selected\": !item.disabled && selected || void 0,\n selected,\n onMouseEnter: () => onItemHover(index),\n id: `${uuid}-${index}`,\n role: \"option\",\n tabIndex: -1,\n \"aria-selected\": hovered === index,\n ref: (node) => {\n if (itemsRefs && itemsRefs.current) {\n itemsRefs.current[item.value] = node;\n }\n },\n onMouseDown: !item.disabled ? (event) => {\n event.preventDefault();\n onItemSelect(item);\n } : null,\n disabled: item.disabled,\n variant\n }, item));\n };\n let groupName = null;\n data.forEach((item, index) => {\n if (item.creatable) {\n creatableDataIndex = index;\n } else if (!item.group) {\n unGroupedItems.push(constructItemComponent(item, index));\n } else {\n if (groupName !== item.group) {\n groupName = item.group;\n groupedItems.push(/* @__PURE__ */ React.createElement(\"div\", {\n className: classes.separator,\n key: `__mantine-divider-${index}`\n }, /* @__PURE__ */ React.createElement(Divider, {\n classNames: { label: classes.separatorLabel },\n label: item.group\n })));\n }\n groupedItems.push(constructItemComponent(item, index));\n }\n });\n if (creatable) {\n const creatableDataItem = data[creatableDataIndex];\n unGroupedItems.push(/* @__PURE__ */ React.createElement(\"div\", {\n key: randomId(),\n className: classes.item,\n \"data-hovered\": hovered === creatableDataIndex || void 0,\n onMouseEnter: () => onItemHover(creatableDataIndex),\n onMouseDown: (event) => {\n event.preventDefault();\n onItemSelect(creatableDataItem);\n },\n tabIndex: -1,\n ref: (node) => {\n if (itemsRefs && itemsRefs.current) {\n itemsRefs.current[creatableDataItem.value] = node;\n }\n }\n }, createLabel));\n }\n if (groupedItems.length > 0 && unGroupedItems.length > 0) {\n unGroupedItems.unshift(/* @__PURE__ */ React.createElement(\"div\", {\n className: classes.separator,\n key: \"empty-group-separator\"\n }, /* @__PURE__ */ React.createElement(Divider, null)));\n }\n return groupedItems.length > 0 || unGroupedItems.length > 0 ? /* @__PURE__ */ React.createElement(React.Fragment, null, groupedItems, unGroupedItems) : /* @__PURE__ */ React.createElement(Text, {\n size,\n unstyled,\n className: classes.nothingFound\n }, nothingFound);\n}\nSelectItems.displayName = \"@mantine/core/SelectItems\";\n\nexport { SelectItems };\n//# sourceMappingURL=SelectItems.js.map\n","import React, { forwardRef } from 'react';\n\nvar __defProp = Object.defineProperty;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst DefaultItem = forwardRef((_a, ref) => {\n var _b = _a, { label, value } = _b, others = __objRest(_b, [\"label\", \"value\"]);\n return /* @__PURE__ */ React.createElement(\"div\", __spreadValues({\n ref\n }, others), label || value);\n});\nDefaultItem.displayName = \"@mantine/core/DefaultItem\";\n\nexport { DefaultItem };\n//# sourceMappingURL=DefaultItem.js.map\n","import $9IrjX$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $9IrjX$forwardRef, Children as $9IrjX$Children, isValidElement as $9IrjX$isValidElement, createElement as $9IrjX$createElement, cloneElement as $9IrjX$cloneElement, Fragment as $9IrjX$Fragment} from \"react\";\nimport {composeRefs as $9IrjX$composeRefs} from \"@radix-ui/react-compose-refs\";\n\n\n\n\n/* -------------------------------------------------------------------------------------------------\n * Slot\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$8c6ed5c666ac1360 = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n const childrenArray = $9IrjX$Children.toArray(children);\n const slottable = childrenArray.find($5e63c961fc1ce211$var$isSlottable);\n if (slottable) {\n // the new element to render is the one passed as a child of `Slottable`\n const newElement = slottable.props.children;\n const newChildren = childrenArray.map((child)=>{\n if (child === slottable) {\n // because the new element will be the one rendered, we are only interested\n // in grabbing its children (`newElement.props.children`)\n if ($9IrjX$Children.count(newElement) > 1) return $9IrjX$Children.only(null);\n return /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? newElement.props.children : null;\n } else return child;\n });\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), /*#__PURE__*/ $9IrjX$isValidElement(newElement) ? /*#__PURE__*/ $9IrjX$cloneElement(newElement, undefined, newChildren) : null);\n }\n return /*#__PURE__*/ $9IrjX$createElement($5e63c961fc1ce211$var$SlotClone, $9IrjX$babelruntimehelpersesmextends({}, slotProps, {\n ref: forwardedRef\n }), children);\n});\n$5e63c961fc1ce211$export$8c6ed5c666ac1360.displayName = 'Slot';\n/* -------------------------------------------------------------------------------------------------\n * SlotClone\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$var$SlotClone = /*#__PURE__*/ $9IrjX$forwardRef((props, forwardedRef)=>{\n const { children: children , ...slotProps } = props;\n if (/*#__PURE__*/ $9IrjX$isValidElement(children)) return /*#__PURE__*/ $9IrjX$cloneElement(children, {\n ...$5e63c961fc1ce211$var$mergeProps(slotProps, children.props),\n ref: $9IrjX$composeRefs(forwardedRef, children.ref)\n });\n return $9IrjX$Children.count(children) > 1 ? $9IrjX$Children.only(null) : null;\n});\n$5e63c961fc1ce211$var$SlotClone.displayName = 'SlotClone';\n/* -------------------------------------------------------------------------------------------------\n * Slottable\n * -----------------------------------------------------------------------------------------------*/ const $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 = ({ children: children })=>{\n return /*#__PURE__*/ $9IrjX$createElement($9IrjX$Fragment, null, children);\n};\n/* ---------------------------------------------------------------------------------------------- */ function $5e63c961fc1ce211$var$isSlottable(child) {\n return /*#__PURE__*/ $9IrjX$isValidElement(child) && child.type === $5e63c961fc1ce211$export$d9f1ccf0bdb05d45;\n}\nfunction $5e63c961fc1ce211$var$mergeProps(slotProps, childProps) {\n // all child props should override\n const overrideProps = {\n ...childProps\n };\n for(const propName in childProps){\n const slotPropValue = slotProps[propName];\n const childPropValue = childProps[propName];\n const isHandler = /^on[A-Z]/.test(propName);\n if (isHandler) {\n // if the handler exists on both, we compose them\n if (slotPropValue && childPropValue) overrideProps[propName] = (...args)=>{\n childPropValue(...args);\n slotPropValue(...args);\n };\n else if (slotPropValue) overrideProps[propName] = slotPropValue;\n } else if (propName === 'style') overrideProps[propName] = {\n ...slotPropValue,\n ...childPropValue\n };\n else if (propName === 'className') overrideProps[propName] = [\n slotPropValue,\n childPropValue\n ].filter(Boolean).join(' ');\n }\n return {\n ...slotProps,\n ...overrideProps\n };\n}\nconst $5e63c961fc1ce211$export$be92b6f5f03c0fe9 = $5e63c961fc1ce211$export$8c6ed5c666ac1360;\n\n\n\n\nexport {$5e63c961fc1ce211$export$8c6ed5c666ac1360 as Slot, $5e63c961fc1ce211$export$d9f1ccf0bdb05d45 as Slottable, $5e63c961fc1ce211$export$be92b6f5f03c0fe9 as Root};\n//# sourceMappingURL=index.module.js.map\n","import $4q5Fq$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $4q5Fq$forwardRef, useEffect as $4q5Fq$useEffect, createElement as $4q5Fq$createElement} from \"react\";\nimport {flushSync as $4q5Fq$flushSync} from \"react-dom\";\nimport {Slot as $4q5Fq$Slot} from \"@radix-ui/react-slot\";\n\n\n\n\n\nconst $8927f6f2acc4f386$var$NODES = [\n 'a',\n 'button',\n 'div',\n 'h2',\n 'h3',\n 'img',\n 'label',\n 'li',\n 'nav',\n 'ol',\n 'p',\n 'span',\n 'svg',\n 'ul'\n]; // Temporary while we await merge of this fix:\n// https://github.com/DefinitelyTyped/DefinitelyTyped/pull/55396\n// prettier-ignore\n/* -------------------------------------------------------------------------------------------------\n * Primitive\n * -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$250ffa63cdc0d034 = $8927f6f2acc4f386$var$NODES.reduce((primitive, node)=>{\n const Node = /*#__PURE__*/ $4q5Fq$forwardRef((props, forwardedRef)=>{\n const { asChild: asChild , ...primitiveProps } = props;\n const Comp = asChild ? $4q5Fq$Slot : node;\n $4q5Fq$useEffect(()=>{\n window[Symbol.for('radix-ui')] = true;\n }, []);\n return /*#__PURE__*/ $4q5Fq$createElement(Comp, $4q5Fq$babelruntimehelpersesmextends({}, primitiveProps, {\n ref: forwardedRef\n }));\n });\n Node.displayName = `Primitive.${node}`;\n return {\n ...primitive,\n [node]: Node\n };\n}, {});\n/* -------------------------------------------------------------------------------------------------\n * Utils\n * -----------------------------------------------------------------------------------------------*/ /**\n * Flush custom event dispatch\n * https://github.com/radix-ui/primitives/pull/1378\n *\n * React batches *all* event handlers since version 18, this introduces certain considerations when using custom event types.\n *\n * Internally, React prioritises events in the following order:\n * - discrete\n * - continuous\n * - default\n *\n * https://github.com/facebook/react/blob/a8a4742f1c54493df00da648a3f9d26e3db9c8b5/packages/react-dom/src/events/ReactDOMEventListener.js#L294-L350\n *\n * `discrete` is an important distinction as updates within these events are applied immediately.\n * React however, is not able to infer the priority of custom event types due to how they are detected internally.\n * Because of this, it's possible for updates from custom events to be unexpectedly batched when\n * dispatched by another `discrete` event.\n *\n * In order to ensure that updates from custom events are applied predictably, we need to manually flush the batch.\n * This utility should be used when dispatching a custom event from within another `discrete` event, this utility\n * is not nessesary when dispatching known event types, or if dispatching a custom type inside a non-discrete event.\n * For example:\n *\n * dispatching a known click 👎\n * target.dispatchEvent(new Event(‘click’))\n *\n * dispatching a custom type within a non-discrete event 👎\n * onScroll={(event) => event.target.dispatchEvent(new CustomEvent(‘customType’))}\n *\n * dispatching a custom type within a `discrete` event 👍\n * onPointerDown={(event) => dispatchDiscreteCustomEvent(event.target, new CustomEvent(‘customType’))}\n *\n * Note: though React classifies `focus`, `focusin` and `focusout` events as `discrete`, it's not recommended to use\n * this utility with them. This is because it's possible for those handlers to be called implicitly during render\n * e.g. when focus is within a component as it is unmounted, or when managing focus on mount.\n */ function $8927f6f2acc4f386$export$6d1a0317bde7de7f(target, event) {\n if (target) $4q5Fq$flushSync(()=>target.dispatchEvent(event)\n );\n}\n/* -----------------------------------------------------------------------------------------------*/ const $8927f6f2acc4f386$export$be92b6f5f03c0fe9 = $8927f6f2acc4f386$export$250ffa63cdc0d034;\n\n\n\n\nexport {$8927f6f2acc4f386$export$250ffa63cdc0d034 as Primitive, $8927f6f2acc4f386$export$be92b6f5f03c0fe9 as Root, $8927f6f2acc4f386$export$6d1a0317bde7de7f as dispatchDiscreteCustomEvent};\n//# sourceMappingURL=index.module.js.map\n","import $fnFM9$babelruntimehelpersesmextends from \"@babel/runtime/helpers/esm/extends\";\nimport {forwardRef as $fnFM9$forwardRef, useState as $fnFM9$useState, createElement as $fnFM9$createElement, useRef as $fnFM9$useRef, Fragment as $fnFM9$Fragment, useEffect as $fnFM9$useEffect, useCallback as $fnFM9$useCallback, useReducer as $fnFM9$useReducer} from \"react\";\nimport {Primitive as $fnFM9$Primitive} from \"@radix-ui/react-primitive\";\nimport {Presence as $fnFM9$Presence} from \"@radix-ui/react-presence\";\nimport {createContextScope as $fnFM9$createContextScope} from \"@radix-ui/react-context\";\nimport {useComposedRefs as $fnFM9$useComposedRefs} from \"@radix-ui/react-compose-refs\";\nimport {useCallbackRef as $fnFM9$useCallbackRef} from \"@radix-ui/react-use-callback-ref\";\nimport {useDirection as $fnFM9$useDirection} from \"@radix-ui/react-direction\";\nimport {useLayoutEffect as $fnFM9$useLayoutEffect} from \"@radix-ui/react-use-layout-effect\";\nimport {clamp as $fnFM9$clamp} from \"@radix-ui/number\";\nimport {composeEventHandlers as $fnFM9$composeEventHandlers} from \"@radix-ui/primitive\";\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction $6c2e24571c90391f$export$3e6543de14f8614f(initialState, machine) {\n return $fnFM9$useReducer((state, event)=>{\n const nextState = machine[state][event];\n return nextState !== null && nextState !== void 0 ? nextState : state;\n }, initialState);\n}\n\n\n/* -------------------------------------------------------------------------------------------------\n * ScrollArea\n * -----------------------------------------------------------------------------------------------*/ const $57acba87d6e25586$var$SCROLL_AREA_NAME = 'ScrollArea';\nconst [$57acba87d6e25586$var$createScrollAreaContext, $57acba87d6e25586$export$488468afe3a6f2b1] = $fnFM9$createContextScope($57acba87d6e25586$var$SCROLL_AREA_NAME);\nconst [$57acba87d6e25586$var$ScrollAreaProvider, $57acba87d6e25586$var$useScrollAreaContext] = $57acba87d6e25586$var$createScrollAreaContext($57acba87d6e25586$var$SCROLL_AREA_NAME);\nconst $57acba87d6e25586$export$ccf8d8d7bbf3c2cc = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const { __scopeScrollArea: __scopeScrollArea , type: type = 'hover' , dir: dir , scrollHideDelay: scrollHideDelay = 600 , ...scrollAreaProps } = props;\n const [scrollArea, setScrollArea] = $fnFM9$useState(null);\n const [viewport, setViewport] = $fnFM9$useState(null);\n const [content, setContent] = $fnFM9$useState(null);\n const [scrollbarX, setScrollbarX] = $fnFM9$useState(null);\n const [scrollbarY, setScrollbarY] = $fnFM9$useState(null);\n const [cornerWidth, setCornerWidth] = $fnFM9$useState(0);\n const [cornerHeight, setCornerHeight] = $fnFM9$useState(0);\n const [scrollbarXEnabled, setScrollbarXEnabled] = $fnFM9$useState(false);\n const [scrollbarYEnabled, setScrollbarYEnabled] = $fnFM9$useState(false);\n const composedRefs = $fnFM9$useComposedRefs(forwardedRef, (node)=>setScrollArea(node)\n );\n const direction = $fnFM9$useDirection(dir);\n return /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaProvider, {\n scope: __scopeScrollArea,\n type: type,\n dir: direction,\n scrollHideDelay: scrollHideDelay,\n scrollArea: scrollArea,\n viewport: viewport,\n onViewportChange: setViewport,\n content: content,\n onContentChange: setContent,\n scrollbarX: scrollbarX,\n onScrollbarXChange: setScrollbarX,\n scrollbarXEnabled: scrollbarXEnabled,\n onScrollbarXEnabledChange: setScrollbarXEnabled,\n scrollbarY: scrollbarY,\n onScrollbarYChange: setScrollbarY,\n scrollbarYEnabled: scrollbarYEnabled,\n onScrollbarYEnabledChange: setScrollbarYEnabled,\n onCornerWidthChange: setCornerWidth,\n onCornerHeightChange: setCornerHeight\n }, /*#__PURE__*/ $fnFM9$createElement($fnFM9$Primitive.div, $fnFM9$babelruntimehelpersesmextends({\n dir: direction\n }, scrollAreaProps, {\n ref: composedRefs,\n style: {\n position: 'relative',\n // Pass corner sizes as CSS vars to reduce re-renders of context consumers\n ['--radix-scroll-area-corner-width']: cornerWidth + 'px',\n ['--radix-scroll-area-corner-height']: cornerHeight + 'px',\n ...props.style\n }\n })));\n});\n/*#__PURE__*/ Object.assign($57acba87d6e25586$export$ccf8d8d7bbf3c2cc, {\n displayName: $57acba87d6e25586$var$SCROLL_AREA_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * ScrollAreaViewport\n * -----------------------------------------------------------------------------------------------*/ const $57acba87d6e25586$var$VIEWPORT_NAME = 'ScrollAreaViewport';\nconst $57acba87d6e25586$export$a21cbf9f11fca853 = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const { __scopeScrollArea: __scopeScrollArea , children: children , ...viewportProps } = props;\n const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$VIEWPORT_NAME, __scopeScrollArea);\n const ref = $fnFM9$useRef(null);\n const composedRefs = $fnFM9$useComposedRefs(forwardedRef, ref, context.onViewportChange);\n return /*#__PURE__*/ $fnFM9$createElement($fnFM9$Fragment, null, /*#__PURE__*/ $fnFM9$createElement(\"style\", {\n dangerouslySetInnerHTML: {\n __html: `[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}`\n }\n }), /*#__PURE__*/ $fnFM9$createElement($fnFM9$Primitive.div, $fnFM9$babelruntimehelpersesmextends({\n \"data-radix-scroll-area-viewport\": \"\"\n }, viewportProps, {\n ref: composedRefs,\n style: {\n /**\n * We don't support `visible` because the intention is to have at least one scrollbar\n * if this component is used and `visible` will behave like `auto` in that case\n * https://developer.mozilla.org/en-US/docs/Web/CSS/overflowed#description\n *\n * We don't handle `auto` because the intention is for the native implementation\n * to be hidden if using this component. We just want to ensure the node is scrollable\n * so could have used either `scroll` or `auto` here. We picked `scroll` to prevent\n * the browser from having to work out whether to render native scrollbars or not,\n * we tell it to with the intention of hiding them in CSS.\n */ overflowX: context.scrollbarXEnabled ? 'scroll' : 'hidden',\n overflowY: context.scrollbarYEnabled ? 'scroll' : 'hidden',\n ...props.style\n }\n }), /*#__PURE__*/ $fnFM9$createElement(\"div\", {\n ref: context.onContentChange,\n style: {\n minWidth: '100%',\n display: 'table'\n }\n }, children)));\n});\n/*#__PURE__*/ Object.assign($57acba87d6e25586$export$a21cbf9f11fca853, {\n displayName: $57acba87d6e25586$var$VIEWPORT_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * ScrollAreaScrollbar\n * -----------------------------------------------------------------------------------------------*/ const $57acba87d6e25586$var$SCROLLBAR_NAME = 'ScrollAreaScrollbar';\nconst $57acba87d6e25586$export$2fabd85d0eba3c57 = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const { forceMount: forceMount , ...scrollbarProps } = props;\n const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$SCROLLBAR_NAME, props.__scopeScrollArea);\n const { onScrollbarXEnabledChange: onScrollbarXEnabledChange , onScrollbarYEnabledChange: onScrollbarYEnabledChange } = context;\n const isHorizontal = props.orientation === 'horizontal';\n $fnFM9$useEffect(()=>{\n isHorizontal ? onScrollbarXEnabledChange(true) : onScrollbarYEnabledChange(true);\n return ()=>{\n isHorizontal ? onScrollbarXEnabledChange(false) : onScrollbarYEnabledChange(false);\n };\n }, [\n isHorizontal,\n onScrollbarXEnabledChange,\n onScrollbarYEnabledChange\n ]);\n return context.type === 'hover' ? /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaScrollbarHover, $fnFM9$babelruntimehelpersesmextends({}, scrollbarProps, {\n ref: forwardedRef,\n forceMount: forceMount\n })) : context.type === 'scroll' ? /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaScrollbarScroll, $fnFM9$babelruntimehelpersesmextends({}, scrollbarProps, {\n ref: forwardedRef,\n forceMount: forceMount\n })) : context.type === 'auto' ? /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, $fnFM9$babelruntimehelpersesmextends({}, scrollbarProps, {\n ref: forwardedRef,\n forceMount: forceMount\n })) : context.type === 'always' ? /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, $fnFM9$babelruntimehelpersesmextends({}, scrollbarProps, {\n ref: forwardedRef\n })) : null;\n});\n/*#__PURE__*/ Object.assign($57acba87d6e25586$export$2fabd85d0eba3c57, {\n displayName: $57acba87d6e25586$var$SCROLLBAR_NAME\n});\n/* -----------------------------------------------------------------------------------------------*/ const $57acba87d6e25586$var$ScrollAreaScrollbarHover = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const { forceMount: forceMount , ...scrollbarProps } = props;\n const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$SCROLLBAR_NAME, props.__scopeScrollArea);\n const [visible, setVisible] = $fnFM9$useState(false);\n $fnFM9$useEffect(()=>{\n const scrollArea = context.scrollArea;\n let hideTimer = 0;\n if (scrollArea) {\n const handlePointerEnter = ()=>{\n window.clearTimeout(hideTimer);\n setVisible(true);\n };\n const handlePointerLeave = ()=>{\n hideTimer = window.setTimeout(()=>setVisible(false)\n , context.scrollHideDelay);\n };\n scrollArea.addEventListener('pointerenter', handlePointerEnter);\n scrollArea.addEventListener('pointerleave', handlePointerLeave);\n return ()=>{\n window.clearTimeout(hideTimer);\n scrollArea.removeEventListener('pointerenter', handlePointerEnter);\n scrollArea.removeEventListener('pointerleave', handlePointerLeave);\n };\n }\n }, [\n context.scrollArea,\n context.scrollHideDelay\n ]);\n return /*#__PURE__*/ $fnFM9$createElement($fnFM9$Presence, {\n present: forceMount || visible\n }, /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaScrollbarAuto, $fnFM9$babelruntimehelpersesmextends({\n \"data-state\": visible ? 'visible' : 'hidden'\n }, scrollbarProps, {\n ref: forwardedRef\n })));\n});\nconst $57acba87d6e25586$var$ScrollAreaScrollbarScroll = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const { forceMount: forceMount , ...scrollbarProps } = props;\n const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$SCROLLBAR_NAME, props.__scopeScrollArea);\n const isHorizontal = props.orientation === 'horizontal';\n const debounceScrollEnd = $57acba87d6e25586$var$useDebounceCallback(()=>send('SCROLL_END')\n , 100);\n const [state, send] = $6c2e24571c90391f$export$3e6543de14f8614f('hidden', {\n hidden: {\n SCROLL: 'scrolling'\n },\n scrolling: {\n SCROLL_END: 'idle',\n POINTER_ENTER: 'interacting'\n },\n interacting: {\n SCROLL: 'interacting',\n POINTER_LEAVE: 'idle'\n },\n idle: {\n HIDE: 'hidden',\n SCROLL: 'scrolling',\n POINTER_ENTER: 'interacting'\n }\n });\n $fnFM9$useEffect(()=>{\n if (state === 'idle') {\n const hideTimer = window.setTimeout(()=>send('HIDE')\n , context.scrollHideDelay);\n return ()=>window.clearTimeout(hideTimer)\n ;\n }\n }, [\n state,\n context.scrollHideDelay,\n send\n ]);\n $fnFM9$useEffect(()=>{\n const viewport = context.viewport;\n const scrollDirection = isHorizontal ? 'scrollLeft' : 'scrollTop';\n if (viewport) {\n let prevScrollPos = viewport[scrollDirection];\n const handleScroll = ()=>{\n const scrollPos = viewport[scrollDirection];\n const hasScrollInDirectionChanged = prevScrollPos !== scrollPos;\n if (hasScrollInDirectionChanged) {\n send('SCROLL');\n debounceScrollEnd();\n }\n prevScrollPos = scrollPos;\n };\n viewport.addEventListener('scroll', handleScroll);\n return ()=>viewport.removeEventListener('scroll', handleScroll)\n ;\n }\n }, [\n context.viewport,\n isHorizontal,\n send,\n debounceScrollEnd\n ]);\n return /*#__PURE__*/ $fnFM9$createElement($fnFM9$Presence, {\n present: forceMount || state !== 'hidden'\n }, /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, $fnFM9$babelruntimehelpersesmextends({\n \"data-state\": state === 'hidden' ? 'hidden' : 'visible'\n }, scrollbarProps, {\n ref: forwardedRef,\n onPointerEnter: $fnFM9$composeEventHandlers(props.onPointerEnter, ()=>send('POINTER_ENTER')\n ),\n onPointerLeave: $fnFM9$composeEventHandlers(props.onPointerLeave, ()=>send('POINTER_LEAVE')\n )\n })));\n});\nconst $57acba87d6e25586$var$ScrollAreaScrollbarAuto = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$SCROLLBAR_NAME, props.__scopeScrollArea);\n const { forceMount: forceMount , ...scrollbarProps } = props;\n const [visible, setVisible] = $fnFM9$useState(false);\n const isHorizontal = props.orientation === 'horizontal';\n const handleResize = $57acba87d6e25586$var$useDebounceCallback(()=>{\n if (context.viewport) {\n const isOverflowX = context.viewport.offsetWidth < context.viewport.scrollWidth;\n const isOverflowY = context.viewport.offsetHeight < context.viewport.scrollHeight;\n setVisible(isHorizontal ? isOverflowX : isOverflowY);\n }\n }, 10);\n $57acba87d6e25586$var$useResizeObserver(context.viewport, handleResize);\n $57acba87d6e25586$var$useResizeObserver(context.content, handleResize);\n return /*#__PURE__*/ $fnFM9$createElement($fnFM9$Presence, {\n present: forceMount || visible\n }, /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaScrollbarVisible, $fnFM9$babelruntimehelpersesmextends({\n \"data-state\": visible ? 'visible' : 'hidden'\n }, scrollbarProps, {\n ref: forwardedRef\n })));\n});\n/* -----------------------------------------------------------------------------------------------*/ const $57acba87d6e25586$var$ScrollAreaScrollbarVisible = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const { orientation: orientation = 'vertical' , ...scrollbarProps } = props;\n const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$SCROLLBAR_NAME, props.__scopeScrollArea);\n const thumbRef = $fnFM9$useRef(null);\n const pointerOffsetRef = $fnFM9$useRef(0);\n const [sizes, setSizes] = $fnFM9$useState({\n content: 0,\n viewport: 0,\n scrollbar: {\n size: 0,\n paddingStart: 0,\n paddingEnd: 0\n }\n });\n const thumbRatio = $57acba87d6e25586$var$getThumbRatio(sizes.viewport, sizes.content);\n const commonProps = {\n ...scrollbarProps,\n sizes: sizes,\n onSizesChange: setSizes,\n hasThumb: Boolean(thumbRatio > 0 && thumbRatio < 1),\n onThumbChange: (thumb)=>thumbRef.current = thumb\n ,\n onThumbPointerUp: ()=>pointerOffsetRef.current = 0\n ,\n onThumbPointerDown: (pointerPos)=>pointerOffsetRef.current = pointerPos\n };\n function getScrollPosition(pointerPos, dir) {\n return $57acba87d6e25586$var$getScrollPositionFromPointer(pointerPos, pointerOffsetRef.current, sizes, dir);\n }\n if (orientation === 'horizontal') return /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaScrollbarX, $fnFM9$babelruntimehelpersesmextends({}, commonProps, {\n ref: forwardedRef,\n onThumbPositionChange: ()=>{\n if (context.viewport && thumbRef.current) {\n const scrollPos = context.viewport.scrollLeft;\n const offset = $57acba87d6e25586$var$getThumbOffsetFromScroll(scrollPos, sizes, context.dir);\n thumbRef.current.style.transform = `translate3d(${offset}px, 0, 0)`;\n }\n },\n onWheelScroll: (scrollPos)=>{\n if (context.viewport) context.viewport.scrollLeft = scrollPos;\n },\n onDragScroll: (pointerPos)=>{\n if (context.viewport) context.viewport.scrollLeft = getScrollPosition(pointerPos, context.dir);\n }\n }));\n if (orientation === 'vertical') return /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaScrollbarY, $fnFM9$babelruntimehelpersesmextends({}, commonProps, {\n ref: forwardedRef,\n onThumbPositionChange: ()=>{\n if (context.viewport && thumbRef.current) {\n const scrollPos = context.viewport.scrollTop;\n const offset = $57acba87d6e25586$var$getThumbOffsetFromScroll(scrollPos, sizes);\n thumbRef.current.style.transform = `translate3d(0, ${offset}px, 0)`;\n }\n },\n onWheelScroll: (scrollPos)=>{\n if (context.viewport) context.viewport.scrollTop = scrollPos;\n },\n onDragScroll: (pointerPos)=>{\n if (context.viewport) context.viewport.scrollTop = getScrollPosition(pointerPos);\n }\n }));\n return null;\n});\n/* -----------------------------------------------------------------------------------------------*/ const $57acba87d6e25586$var$ScrollAreaScrollbarX = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const { sizes: sizes , onSizesChange: onSizesChange , ...scrollbarProps } = props;\n const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$SCROLLBAR_NAME, props.__scopeScrollArea);\n const [computedStyle, setComputedStyle] = $fnFM9$useState();\n const ref = $fnFM9$useRef(null);\n const composeRefs = $fnFM9$useComposedRefs(forwardedRef, ref, context.onScrollbarXChange);\n $fnFM9$useEffect(()=>{\n if (ref.current) setComputedStyle(getComputedStyle(ref.current));\n }, [\n ref\n ]);\n return /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, $fnFM9$babelruntimehelpersesmextends({\n \"data-orientation\": \"horizontal\"\n }, scrollbarProps, {\n ref: composeRefs,\n sizes: sizes,\n style: {\n bottom: 0,\n left: context.dir === 'rtl' ? 'var(--radix-scroll-area-corner-width)' : 0,\n right: context.dir === 'ltr' ? 'var(--radix-scroll-area-corner-width)' : 0,\n ['--radix-scroll-area-thumb-width']: $57acba87d6e25586$var$getThumbSize(sizes) + 'px',\n ...props.style\n },\n onThumbPointerDown: (pointerPos)=>props.onThumbPointerDown(pointerPos.x)\n ,\n onDragScroll: (pointerPos)=>props.onDragScroll(pointerPos.x)\n ,\n onWheelScroll: (event, maxScrollPos)=>{\n if (context.viewport) {\n const scrollPos = context.viewport.scrollLeft + event.deltaX;\n props.onWheelScroll(scrollPos); // prevent window scroll when wheeling on scrollbar\n if ($57acba87d6e25586$var$isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) event.preventDefault();\n }\n },\n onResize: ()=>{\n if (ref.current && context.viewport && computedStyle) onSizesChange({\n content: context.viewport.scrollWidth,\n viewport: context.viewport.offsetWidth,\n scrollbar: {\n size: ref.current.clientWidth,\n paddingStart: $57acba87d6e25586$var$toInt(computedStyle.paddingLeft),\n paddingEnd: $57acba87d6e25586$var$toInt(computedStyle.paddingRight)\n }\n });\n }\n }));\n});\nconst $57acba87d6e25586$var$ScrollAreaScrollbarY = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const { sizes: sizes , onSizesChange: onSizesChange , ...scrollbarProps } = props;\n const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$SCROLLBAR_NAME, props.__scopeScrollArea);\n const [computedStyle, setComputedStyle] = $fnFM9$useState();\n const ref = $fnFM9$useRef(null);\n const composeRefs = $fnFM9$useComposedRefs(forwardedRef, ref, context.onScrollbarYChange);\n $fnFM9$useEffect(()=>{\n if (ref.current) setComputedStyle(getComputedStyle(ref.current));\n }, [\n ref\n ]);\n return /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaScrollbarImpl, $fnFM9$babelruntimehelpersesmextends({\n \"data-orientation\": \"vertical\"\n }, scrollbarProps, {\n ref: composeRefs,\n sizes: sizes,\n style: {\n top: 0,\n right: context.dir === 'ltr' ? 0 : undefined,\n left: context.dir === 'rtl' ? 0 : undefined,\n bottom: 'var(--radix-scroll-area-corner-height)',\n ['--radix-scroll-area-thumb-height']: $57acba87d6e25586$var$getThumbSize(sizes) + 'px',\n ...props.style\n },\n onThumbPointerDown: (pointerPos)=>props.onThumbPointerDown(pointerPos.y)\n ,\n onDragScroll: (pointerPos)=>props.onDragScroll(pointerPos.y)\n ,\n onWheelScroll: (event, maxScrollPos)=>{\n if (context.viewport) {\n const scrollPos = context.viewport.scrollTop + event.deltaY;\n props.onWheelScroll(scrollPos); // prevent window scroll when wheeling on scrollbar\n if ($57acba87d6e25586$var$isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos)) event.preventDefault();\n }\n },\n onResize: ()=>{\n if (ref.current && context.viewport && computedStyle) onSizesChange({\n content: context.viewport.scrollHeight,\n viewport: context.viewport.offsetHeight,\n scrollbar: {\n size: ref.current.clientHeight,\n paddingStart: $57acba87d6e25586$var$toInt(computedStyle.paddingTop),\n paddingEnd: $57acba87d6e25586$var$toInt(computedStyle.paddingBottom)\n }\n });\n }\n }));\n});\n/* -----------------------------------------------------------------------------------------------*/ const [$57acba87d6e25586$var$ScrollbarProvider, $57acba87d6e25586$var$useScrollbarContext] = $57acba87d6e25586$var$createScrollAreaContext($57acba87d6e25586$var$SCROLLBAR_NAME);\nconst $57acba87d6e25586$var$ScrollAreaScrollbarImpl = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const { __scopeScrollArea: __scopeScrollArea , sizes: sizes , hasThumb: hasThumb , onThumbChange: onThumbChange , onThumbPointerUp: onThumbPointerUp , onThumbPointerDown: onThumbPointerDown , onThumbPositionChange: onThumbPositionChange , onDragScroll: onDragScroll , onWheelScroll: onWheelScroll , onResize: onResize , ...scrollbarProps } = props;\n const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$SCROLLBAR_NAME, __scopeScrollArea);\n const [scrollbar, setScrollbar] = $fnFM9$useState(null);\n const composeRefs = $fnFM9$useComposedRefs(forwardedRef, (node)=>setScrollbar(node)\n );\n const rectRef = $fnFM9$useRef(null);\n const prevWebkitUserSelectRef = $fnFM9$useRef('');\n const viewport = context.viewport;\n const maxScrollPos = sizes.content - sizes.viewport;\n const handleWheelScroll = $fnFM9$useCallbackRef(onWheelScroll);\n const handleThumbPositionChange = $fnFM9$useCallbackRef(onThumbPositionChange);\n const handleResize = $57acba87d6e25586$var$useDebounceCallback(onResize, 10);\n function handleDragScroll(event) {\n if (rectRef.current) {\n const x = event.clientX - rectRef.current.left;\n const y = event.clientY - rectRef.current.top;\n onDragScroll({\n x: x,\n y: y\n });\n }\n }\n /**\n * We bind wheel event imperatively so we can switch off passive\n * mode for document wheel event to allow it to be prevented\n */ $fnFM9$useEffect(()=>{\n const handleWheel = (event)=>{\n const element = event.target;\n const isScrollbarWheel = scrollbar === null || scrollbar === void 0 ? void 0 : scrollbar.contains(element);\n if (isScrollbarWheel) handleWheelScroll(event, maxScrollPos);\n };\n document.addEventListener('wheel', handleWheel, {\n passive: false\n });\n return ()=>document.removeEventListener('wheel', handleWheel, {\n passive: false\n })\n ;\n }, [\n viewport,\n scrollbar,\n maxScrollPos,\n handleWheelScroll\n ]);\n /**\n * Update thumb position on sizes change\n */ $fnFM9$useEffect(handleThumbPositionChange, [\n sizes,\n handleThumbPositionChange\n ]);\n $57acba87d6e25586$var$useResizeObserver(scrollbar, handleResize);\n $57acba87d6e25586$var$useResizeObserver(context.content, handleResize);\n return /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollbarProvider, {\n scope: __scopeScrollArea,\n scrollbar: scrollbar,\n hasThumb: hasThumb,\n onThumbChange: $fnFM9$useCallbackRef(onThumbChange),\n onThumbPointerUp: $fnFM9$useCallbackRef(onThumbPointerUp),\n onThumbPositionChange: handleThumbPositionChange,\n onThumbPointerDown: $fnFM9$useCallbackRef(onThumbPointerDown)\n }, /*#__PURE__*/ $fnFM9$createElement($fnFM9$Primitive.div, $fnFM9$babelruntimehelpersesmextends({}, scrollbarProps, {\n ref: composeRefs,\n style: {\n position: 'absolute',\n ...scrollbarProps.style\n },\n onPointerDown: $fnFM9$composeEventHandlers(props.onPointerDown, (event)=>{\n const mainPointer = 0;\n if (event.button === mainPointer) {\n const element = event.target;\n element.setPointerCapture(event.pointerId);\n rectRef.current = scrollbar.getBoundingClientRect(); // pointer capture doesn't prevent text selection in Safari\n // so we remove text selection manually when scrolling\n prevWebkitUserSelectRef.current = document.body.style.webkitUserSelect;\n document.body.style.webkitUserSelect = 'none';\n handleDragScroll(event);\n }\n }),\n onPointerMove: $fnFM9$composeEventHandlers(props.onPointerMove, handleDragScroll),\n onPointerUp: $fnFM9$composeEventHandlers(props.onPointerUp, (event)=>{\n const element = event.target;\n if (element.hasPointerCapture(event.pointerId)) element.releasePointerCapture(event.pointerId);\n document.body.style.webkitUserSelect = prevWebkitUserSelectRef.current;\n rectRef.current = null;\n })\n })));\n});\n/* -------------------------------------------------------------------------------------------------\n * ScrollAreaThumb\n * -----------------------------------------------------------------------------------------------*/ const $57acba87d6e25586$var$THUMB_NAME = 'ScrollAreaThumb';\nconst $57acba87d6e25586$export$9fba1154677d7cd2 = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const { forceMount: forceMount , ...thumbProps } = props;\n const scrollbarContext = $57acba87d6e25586$var$useScrollbarContext($57acba87d6e25586$var$THUMB_NAME, props.__scopeScrollArea);\n return /*#__PURE__*/ $fnFM9$createElement($fnFM9$Presence, {\n present: forceMount || scrollbarContext.hasThumb\n }, /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaThumbImpl, $fnFM9$babelruntimehelpersesmextends({\n ref: forwardedRef\n }, thumbProps)));\n});\nconst $57acba87d6e25586$var$ScrollAreaThumbImpl = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const { __scopeScrollArea: __scopeScrollArea , style: style , ...thumbProps } = props;\n const scrollAreaContext = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$THUMB_NAME, __scopeScrollArea);\n const scrollbarContext = $57acba87d6e25586$var$useScrollbarContext($57acba87d6e25586$var$THUMB_NAME, __scopeScrollArea);\n const { onThumbPositionChange: onThumbPositionChange } = scrollbarContext;\n const composedRef = $fnFM9$useComposedRefs(forwardedRef, (node)=>scrollbarContext.onThumbChange(node)\n );\n const removeUnlinkedScrollListenerRef = $fnFM9$useRef();\n const debounceScrollEnd = $57acba87d6e25586$var$useDebounceCallback(()=>{\n if (removeUnlinkedScrollListenerRef.current) {\n removeUnlinkedScrollListenerRef.current();\n removeUnlinkedScrollListenerRef.current = undefined;\n }\n }, 100);\n $fnFM9$useEffect(()=>{\n const viewport = scrollAreaContext.viewport;\n if (viewport) {\n /**\n * We only bind to native scroll event so we know when scroll starts and ends.\n * When scroll starts we start a requestAnimationFrame loop that checks for\n * changes to scroll position. That rAF loop triggers our thumb position change\n * when relevant to avoid scroll-linked effects. We cancel the loop when scroll ends.\n * https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Scroll-linked_effects\n */ const handleScroll = ()=>{\n debounceScrollEnd();\n if (!removeUnlinkedScrollListenerRef.current) {\n const listener = $57acba87d6e25586$var$addUnlinkedScrollListener(viewport, onThumbPositionChange);\n removeUnlinkedScrollListenerRef.current = listener;\n onThumbPositionChange();\n }\n };\n onThumbPositionChange();\n viewport.addEventListener('scroll', handleScroll);\n return ()=>viewport.removeEventListener('scroll', handleScroll)\n ;\n }\n }, [\n scrollAreaContext.viewport,\n debounceScrollEnd,\n onThumbPositionChange\n ]);\n return /*#__PURE__*/ $fnFM9$createElement($fnFM9$Primitive.div, $fnFM9$babelruntimehelpersesmextends({\n \"data-state\": scrollbarContext.hasThumb ? 'visible' : 'hidden'\n }, thumbProps, {\n ref: composedRef,\n style: {\n width: 'var(--radix-scroll-area-thumb-width)',\n height: 'var(--radix-scroll-area-thumb-height)',\n ...style\n },\n onPointerDownCapture: $fnFM9$composeEventHandlers(props.onPointerDownCapture, (event)=>{\n const thumb = event.target;\n const thumbRect = thumb.getBoundingClientRect();\n const x = event.clientX - thumbRect.left;\n const y = event.clientY - thumbRect.top;\n scrollbarContext.onThumbPointerDown({\n x: x,\n y: y\n });\n }),\n onPointerUp: $fnFM9$composeEventHandlers(props.onPointerUp, scrollbarContext.onThumbPointerUp)\n }));\n});\n/*#__PURE__*/ Object.assign($57acba87d6e25586$export$9fba1154677d7cd2, {\n displayName: $57acba87d6e25586$var$THUMB_NAME\n});\n/* -------------------------------------------------------------------------------------------------\n * ScrollAreaCorner\n * -----------------------------------------------------------------------------------------------*/ const $57acba87d6e25586$var$CORNER_NAME = 'ScrollAreaCorner';\nconst $57acba87d6e25586$export$56969d565df7cc4b = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$CORNER_NAME, props.__scopeScrollArea);\n const hasBothScrollbarsVisible = Boolean(context.scrollbarX && context.scrollbarY);\n const hasCorner = context.type !== 'scroll' && hasBothScrollbarsVisible;\n return hasCorner ? /*#__PURE__*/ $fnFM9$createElement($57acba87d6e25586$var$ScrollAreaCornerImpl, $fnFM9$babelruntimehelpersesmextends({}, props, {\n ref: forwardedRef\n })) : null;\n});\n/*#__PURE__*/ Object.assign($57acba87d6e25586$export$56969d565df7cc4b, {\n displayName: $57acba87d6e25586$var$CORNER_NAME\n});\n/* -----------------------------------------------------------------------------------------------*/ const $57acba87d6e25586$var$ScrollAreaCornerImpl = /*#__PURE__*/ $fnFM9$forwardRef((props, forwardedRef)=>{\n const { __scopeScrollArea: __scopeScrollArea , ...cornerProps } = props;\n const context = $57acba87d6e25586$var$useScrollAreaContext($57acba87d6e25586$var$CORNER_NAME, __scopeScrollArea);\n const [width1, setWidth] = $fnFM9$useState(0);\n const [height1, setHeight] = $fnFM9$useState(0);\n const hasSize = Boolean(width1 && height1);\n $57acba87d6e25586$var$useResizeObserver(context.scrollbarX, ()=>{\n var _context$scrollbarX;\n const height = ((_context$scrollbarX = context.scrollbarX) === null || _context$scrollbarX === void 0 ? void 0 : _context$scrollbarX.offsetHeight) || 0;\n context.onCornerHeightChange(height);\n setHeight(height);\n });\n $57acba87d6e25586$var$useResizeObserver(context.scrollbarY, ()=>{\n var _context$scrollbarY;\n const width = ((_context$scrollbarY = context.scrollbarY) === null || _context$scrollbarY === void 0 ? void 0 : _context$scrollbarY.offsetWidth) || 0;\n context.onCornerWidthChange(width);\n setWidth(width);\n });\n return hasSize ? /*#__PURE__*/ $fnFM9$createElement($fnFM9$Primitive.div, $fnFM9$babelruntimehelpersesmextends({}, cornerProps, {\n ref: forwardedRef,\n style: {\n width: width1,\n height: height1,\n position: 'absolute',\n right: context.dir === 'ltr' ? 0 : undefined,\n left: context.dir === 'rtl' ? 0 : undefined,\n bottom: 0,\n ...props.style\n }\n })) : null;\n});\n/* -----------------------------------------------------------------------------------------------*/ function $57acba87d6e25586$var$toInt(value) {\n return value ? parseInt(value, 10) : 0;\n}\nfunction $57acba87d6e25586$var$getThumbRatio(viewportSize, contentSize) {\n const ratio = viewportSize / contentSize;\n return isNaN(ratio) ? 0 : ratio;\n}\nfunction $57acba87d6e25586$var$getThumbSize(sizes) {\n const ratio = $57acba87d6e25586$var$getThumbRatio(sizes.viewport, sizes.content);\n const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;\n const thumbSize = (sizes.scrollbar.size - scrollbarPadding) * ratio; // minimum of 18 matches macOS minimum\n return Math.max(thumbSize, 18);\n}\nfunction $57acba87d6e25586$var$getScrollPositionFromPointer(pointerPos, pointerOffset, sizes, dir = 'ltr') {\n const thumbSizePx = $57acba87d6e25586$var$getThumbSize(sizes);\n const thumbCenter = thumbSizePx / 2;\n const offset = pointerOffset || thumbCenter;\n const thumbOffsetFromEnd = thumbSizePx - offset;\n const minPointerPos = sizes.scrollbar.paddingStart + offset;\n const maxPointerPos = sizes.scrollbar.size - sizes.scrollbar.paddingEnd - thumbOffsetFromEnd;\n const maxScrollPos = sizes.content - sizes.viewport;\n const scrollRange = dir === 'ltr' ? [\n 0,\n maxScrollPos\n ] : [\n maxScrollPos * -1,\n 0\n ];\n const interpolate = $57acba87d6e25586$var$linearScale([\n minPointerPos,\n maxPointerPos\n ], scrollRange);\n return interpolate(pointerPos);\n}\nfunction $57acba87d6e25586$var$getThumbOffsetFromScroll(scrollPos, sizes, dir = 'ltr') {\n const thumbSizePx = $57acba87d6e25586$var$getThumbSize(sizes);\n const scrollbarPadding = sizes.scrollbar.paddingStart + sizes.scrollbar.paddingEnd;\n const scrollbar = sizes.scrollbar.size - scrollbarPadding;\n const maxScrollPos = sizes.content - sizes.viewport;\n const maxThumbPos = scrollbar - thumbSizePx;\n const scrollClampRange = dir === 'ltr' ? [\n 0,\n maxScrollPos\n ] : [\n maxScrollPos * -1,\n 0\n ];\n const scrollWithoutMomentum = $fnFM9$clamp(scrollPos, scrollClampRange);\n const interpolate = $57acba87d6e25586$var$linearScale([\n 0,\n maxScrollPos\n ], [\n 0,\n maxThumbPos\n ]);\n return interpolate(scrollWithoutMomentum);\n} // https://github.com/tmcw-up-for-adoption/simple-linear-scale/blob/master/index.js\nfunction $57acba87d6e25586$var$linearScale(input, output) {\n return (value)=>{\n if (input[0] === input[1] || output[0] === output[1]) return output[0];\n const ratio = (output[1] - output[0]) / (input[1] - input[0]);\n return output[0] + ratio * (value - input[0]);\n };\n}\nfunction $57acba87d6e25586$var$isScrollingWithinScrollbarBounds(scrollPos, maxScrollPos) {\n return scrollPos > 0 && scrollPos < maxScrollPos;\n} // Custom scroll handler to avoid scroll-linked effects\n// https://developer.mozilla.org/en-US/docs/Mozilla/Performance/Scroll-linked_effects\nconst $57acba87d6e25586$var$addUnlinkedScrollListener = (node, handler = ()=>{})=>{\n let prevPosition = {\n left: node.scrollLeft,\n top: node.scrollTop\n };\n let rAF = 0;\n (function loop() {\n const position = {\n left: node.scrollLeft,\n top: node.scrollTop\n };\n const isHorizontalScroll = prevPosition.left !== position.left;\n const isVerticalScroll = prevPosition.top !== position.top;\n if (isHorizontalScroll || isVerticalScroll) handler();\n prevPosition = position;\n rAF = window.requestAnimationFrame(loop);\n })();\n return ()=>window.cancelAnimationFrame(rAF)\n ;\n};\nfunction $57acba87d6e25586$var$useDebounceCallback(callback, delay) {\n const handleCallback = $fnFM9$useCallbackRef(callback);\n const debounceTimerRef = $fnFM9$useRef(0);\n $fnFM9$useEffect(()=>()=>window.clearTimeout(debounceTimerRef.current)\n , []);\n return $fnFM9$useCallback(()=>{\n window.clearTimeout(debounceTimerRef.current);\n debounceTimerRef.current = window.setTimeout(handleCallback, delay);\n }, [\n handleCallback,\n delay\n ]);\n}\nfunction $57acba87d6e25586$var$useResizeObserver(element, onResize) {\n const handleResize = $fnFM9$useCallbackRef(onResize);\n $fnFM9$useLayoutEffect(()=>{\n let rAF = 0;\n if (element) {\n /**\n * Resize Observer will throw an often benign error that says `ResizeObserver loop\n * completed with undelivered notifications`. This means that ResizeObserver was not\n * able to deliver all observations within a single animation frame, so we use\n * `requestAnimationFrame` to ensure we don't deliver unnecessary observations.\n * Further reading: https://github.com/WICG/resize-observer/issues/38\n */ const resizeObserver = new ResizeObserver(()=>{\n cancelAnimationFrame(rAF);\n rAF = window.requestAnimationFrame(handleResize);\n });\n resizeObserver.observe(element);\n return ()=>{\n window.cancelAnimationFrame(rAF);\n resizeObserver.unobserve(element);\n };\n }\n }, [\n element,\n handleResize\n ]);\n}\n/* -----------------------------------------------------------------------------------------------*/ const $57acba87d6e25586$export$be92b6f5f03c0fe9 = $57acba87d6e25586$export$ccf8d8d7bbf3c2cc;\nconst $57acba87d6e25586$export$d5c6c08dc2d3ca7 = $57acba87d6e25586$export$a21cbf9f11fca853;\nconst $57acba87d6e25586$export$9a4e88b92edfce6b = $57acba87d6e25586$export$2fabd85d0eba3c57;\nconst $57acba87d6e25586$export$6521433ed15a34db = $57acba87d6e25586$export$9fba1154677d7cd2;\nconst $57acba87d6e25586$export$ac61190d9fc311a9 = $57acba87d6e25586$export$56969d565df7cc4b;\n\n\n\n\nexport {$57acba87d6e25586$export$488468afe3a6f2b1 as createScrollAreaScope, $57acba87d6e25586$export$ccf8d8d7bbf3c2cc as ScrollArea, $57acba87d6e25586$export$a21cbf9f11fca853 as ScrollAreaViewport, $57acba87d6e25586$export$2fabd85d0eba3c57 as ScrollAreaScrollbar, $57acba87d6e25586$export$9fba1154677d7cd2 as ScrollAreaThumb, $57acba87d6e25586$export$56969d565df7cc4b as ScrollAreaCorner, $57acba87d6e25586$export$be92b6f5f03c0fe9 as Root, $57acba87d6e25586$export$d5c6c08dc2d3ca7 as Viewport, $57acba87d6e25586$export$9a4e88b92edfce6b as Scrollbar, $57acba87d6e25586$export$6521433ed15a34db as Thumb, $57acba87d6e25586$export$ac61190d9fc311a9 as Corner};\n//# sourceMappingURL=index.module.js.map\n","import { createStyles, rem, getStylesRef } from '@mantine/styles';\n\nvar useStyles = createStyles((theme, { scrollbarSize, offsetScrollbars, scrollbarHovered, hidden }) => ({\n root: {\n overflow: \"hidden\"\n },\n viewport: {\n width: \"100%\",\n height: \"100%\",\n paddingRight: offsetScrollbars ? rem(scrollbarSize) : void 0,\n paddingBottom: offsetScrollbars ? rem(scrollbarSize) : void 0\n },\n scrollbar: {\n display: hidden ? \"none\" : \"flex\",\n userSelect: \"none\",\n touchAction: \"none\",\n boxSizing: \"border-box\",\n padding: `calc(${rem(scrollbarSize)} / 5)`,\n transition: \"background-color 150ms ease, opacity 150ms ease\",\n \"&:hover\": {\n backgroundColor: theme.colorScheme === \"dark\" ? theme.colors.dark[8] : theme.colors.gray[0],\n [`& .${getStylesRef(\"thumb\")}`]: {\n backgroundColor: theme.colorScheme === \"dark\" ? theme.fn.rgba(theme.white, 0.5) : theme.fn.rgba(theme.black, 0.5)\n }\n },\n '&[data-orientation=\"vertical\"]': {\n width: rem(scrollbarSize)\n },\n '&[data-orientation=\"horizontal\"]': {\n flexDirection: \"column\",\n height: rem(scrollbarSize)\n },\n '&[data-state=\"hidden\"]': {\n display: \"none\",\n opacity: 0\n }\n },\n thumb: {\n ref: getStylesRef(\"thumb\"),\n flex: 1,\n backgroundColor: theme.colorScheme === \"dark\" ? theme.fn.rgba(theme.white, 0.4) : theme.fn.rgba(theme.black, 0.4),\n borderRadius: rem(scrollbarSize),\n position: \"relative\",\n transition: \"background-color 150ms ease\",\n display: hidden ? \"none\" : void 0,\n overflow: \"hidden\",\n \"&::before\": {\n content: '\"\"',\n position: \"absolute\",\n top: \"50%\",\n left: \"50%\",\n transform: \"translate(-50%, -50%)\",\n width: \"100%\",\n height: \"100%\",\n minWidth: rem(44),\n minHeight: rem(44)\n }\n },\n corner: {\n backgroundColor: theme.colorScheme === \"dark\" ? theme.colors.dark[6] : theme.colors.gray[0],\n transition: \"opacity 150ms ease\",\n opacity: scrollbarHovered ? 1 : 0,\n display: hidden ? \"none\" : void 0\n }\n}));\n\nexport default useStyles;\n//# sourceMappingURL=ScrollArea.styles.js.map\n","import React, { forwardRef, useState } from 'react';\nimport * as RadixScrollArea from '@radix-ui/react-scroll-area';\nimport { useComponentDefaultProps, useMantineTheme } from '@mantine/styles';\nimport { packSx } from '@mantine/utils';\nimport useStyles from './ScrollArea.styles.js';\nimport { Box } from '../Box/Box.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst defaultProps = {\n scrollbarSize: 12,\n scrollHideDelay: 1e3,\n type: \"hover\",\n offsetScrollbars: false\n};\nconst _ScrollArea = forwardRef((props, ref) => {\n const _a = useComponentDefaultProps(\"ScrollArea\", defaultProps, props), {\n children,\n className,\n classNames,\n styles,\n scrollbarSize,\n scrollHideDelay,\n type,\n dir,\n offsetScrollbars,\n viewportRef,\n onScrollPositionChange,\n unstyled,\n variant,\n viewportProps\n } = _a, others = __objRest(_a, [\n \"children\",\n \"className\",\n \"classNames\",\n \"styles\",\n \"scrollbarSize\",\n \"scrollHideDelay\",\n \"type\",\n \"dir\",\n \"offsetScrollbars\",\n \"viewportRef\",\n \"onScrollPositionChange\",\n \"unstyled\",\n \"variant\",\n \"viewportProps\"\n ]);\n const [scrollbarHovered, setScrollbarHovered] = useState(false);\n const theme = useMantineTheme();\n const { classes, cx } = useStyles({ scrollbarSize, offsetScrollbars, scrollbarHovered, hidden: type === \"never\" }, { name: \"ScrollArea\", classNames, styles, unstyled, variant });\n return /* @__PURE__ */ React.createElement(RadixScrollArea.Root, {\n type: type === \"never\" ? \"always\" : type,\n scrollHideDelay,\n dir: dir || theme.dir,\n ref,\n asChild: true\n }, /* @__PURE__ */ React.createElement(Box, __spreadValues({\n className: cx(classes.root, className)\n }, others), /* @__PURE__ */ React.createElement(RadixScrollArea.Viewport, __spreadProps(__spreadValues({}, viewportProps), {\n className: classes.viewport,\n ref: viewportRef,\n onScroll: typeof onScrollPositionChange === \"function\" ? ({ currentTarget }) => onScrollPositionChange({\n x: currentTarget.scrollLeft,\n y: currentTarget.scrollTop\n }) : void 0\n }), children), /* @__PURE__ */ React.createElement(RadixScrollArea.Scrollbar, {\n orientation: \"horizontal\",\n className: classes.scrollbar,\n forceMount: true,\n onMouseEnter: () => setScrollbarHovered(true),\n onMouseLeave: () => setScrollbarHovered(false)\n }, /* @__PURE__ */ React.createElement(RadixScrollArea.Thumb, {\n className: classes.thumb\n })), /* @__PURE__ */ React.createElement(RadixScrollArea.Scrollbar, {\n orientation: \"vertical\",\n className: classes.scrollbar,\n forceMount: true,\n onMouseEnter: () => setScrollbarHovered(true),\n onMouseLeave: () => setScrollbarHovered(false)\n }, /* @__PURE__ */ React.createElement(RadixScrollArea.Thumb, {\n className: classes.thumb\n })), /* @__PURE__ */ React.createElement(RadixScrollArea.Corner, {\n className: classes.corner\n })));\n});\nconst ScrollAreaAutosize = forwardRef((props, ref) => {\n const _a = useComponentDefaultProps(\"ScrollAreaAutosize\", defaultProps, props), {\n children,\n classNames,\n styles,\n scrollbarSize,\n scrollHideDelay,\n type,\n dir,\n offsetScrollbars,\n viewportRef,\n onScrollPositionChange,\n unstyled,\n sx,\n variant,\n viewportProps\n } = _a, others = __objRest(_a, [\n \"children\",\n \"classNames\",\n \"styles\",\n \"scrollbarSize\",\n \"scrollHideDelay\",\n \"type\",\n \"dir\",\n \"offsetScrollbars\",\n \"viewportRef\",\n \"onScrollPositionChange\",\n \"unstyled\",\n \"sx\",\n \"variant\",\n \"viewportProps\"\n ]);\n return /* @__PURE__ */ React.createElement(Box, __spreadProps(__spreadValues({}, others), {\n ref,\n sx: [{ display: \"flex\" }, ...packSx(sx)]\n }), /* @__PURE__ */ React.createElement(Box, {\n sx: { display: \"flex\", flexDirection: \"column\", flex: 1 }\n }, /* @__PURE__ */ React.createElement(_ScrollArea, {\n classNames,\n styles,\n scrollHideDelay,\n scrollbarSize,\n type,\n dir,\n offsetScrollbars,\n viewportRef,\n onScrollPositionChange,\n unstyled,\n variant,\n viewportProps\n }, children)));\n});\nScrollAreaAutosize.displayName = \"@mantine/core/ScrollAreaAutosize\";\n_ScrollArea.displayName = \"@mantine/core/ScrollArea\";\n_ScrollArea.Autosize = ScrollAreaAutosize;\nconst ScrollArea = _ScrollArea;\n\nexport { ScrollArea, _ScrollArea };\n//# sourceMappingURL=ScrollArea.js.map\n","import React, { forwardRef } from 'react';\nimport { ScrollArea } from '../../ScrollArea/ScrollArea.js';\n\nvar __defProp = Object.defineProperty;\nvar __defProps = Object.defineProperties;\nvar __getOwnPropDescs = Object.getOwnPropertyDescriptors;\nvar __getOwnPropSymbols = Object.getOwnPropertySymbols;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __propIsEnum = Object.prototype.propertyIsEnumerable;\nvar __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;\nvar __spreadValues = (a, b) => {\n for (var prop in b || (b = {}))\n if (__hasOwnProp.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n if (__getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(b)) {\n if (__propIsEnum.call(b, prop))\n __defNormalProp(a, prop, b[prop]);\n }\n return a;\n};\nvar __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));\nvar __objRest = (source, exclude) => {\n var target = {};\n for (var prop in source)\n if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)\n target[prop] = source[prop];\n if (source != null && __getOwnPropSymbols)\n for (var prop of __getOwnPropSymbols(source)) {\n if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))\n target[prop] = source[prop];\n }\n return target;\n};\nconst SelectScrollArea = forwardRef((_a, ref) => {\n var _b = _a, { style } = _b, others = __objRest(_b, [\"style\"]);\n return /* @__PURE__ */ React.createElement(ScrollArea, __spreadProps(__spreadValues({}, others), {\n style: __spreadValues({ width: \"100%\" }, style),\n viewportProps: { tabIndex: -1 },\n viewportRef: ref\n }), others.children);\n});\nSelectScrollArea.displayName = \"@mantine/core/SelectScrollArea\";\n\nexport { SelectScrollArea };\n//# sourceMappingURL=SelectScrollArea.js.map\n","import { createStyles, rem } from '@mantine/styles';\n\nvar useStyles = createStyles(() => ({\n dropdown: {},\n itemsWrapper: {\n padding: rem(4),\n display: \"flex\",\n width: \"100%\",\n boxSizing: \"border-box\"\n }\n}));\n\nexport default useStyles;\n//# sourceMappingURL=SelectPopover.styles.js.map\n","/**\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 return css.transform !== 'none' || css.perspective !== 'none' || (css.containerType ? css.containerType !== 'normal' : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== 'none' : false) || !webkit && (css.filter ? css.filter !== 'none' : false) || ['transform', '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\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 {\n left,\n top,\n width,\n height\n } = element.getBoundingClientRect();\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 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