@qonto/embed-sdk 0.64.2 → 0.64.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/index.js +1 -0
- package/dist/_virtual/index2.js +1 -0
- package/dist/auth-links/client/auth-links.client.d.ts +1 -1
- package/dist/beneficiaries/client/beneficiaries.client.d.ts.map +1 -1
- package/dist/cards/client/cards.client.d.ts.map +1 -1
- package/dist/cards/index.d.ts +1 -1
- package/dist/index.umd.js +5 -5
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/attribution/helpers.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/attribution/web-attribution.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/config/joined-config.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/config.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/cookie-migration/index.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/default-tracking.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/index.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/file-download-tracking.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/plugins/form-interaction-tracking.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/network-connectivity-checker.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/storage/local-storage.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/storage/session-storage.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/types.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/version.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/campaign/campaign-parser.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/core-client.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-client.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-storage.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/uncaught-sdk-errors.js +1 -0
- package/dist/{server/node_modules/.pnpm/@amplitude_analytics-core@2.34.1 → node_modules/.pnpm/@amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/identify.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/background-capture.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/base-window-messenger.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/constants.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/utils.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/network-request-event.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/observers/console.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/observers/network.js +1 -0
- package/dist/{server/node_modules/.pnpm/@amplitude_analytics-core@2.34.1 → node_modules/.pnpm/@amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js +1 -1
- package/dist/{server/node_modules/.pnpm/@amplitude_analytics-core@2.34.1 → node_modules/.pnpm/@amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/helpers.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/identity.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config.js +1 -1
- package/dist/{server/node_modules/.pnpm/@amplitude_analytics-core@2.34.1 → node_modules/.pnpm/@amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/revenue.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/browser-storage.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/memory.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/timeline.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/transports/fetch.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/types/frustration-interactions.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js +1 -1
- package/dist/{server/node_modules/.pnpm/@amplitude_analytics-core@2.34.1 → node_modules/.pnpm/@amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/json-query.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/utils/safe-stringify.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.18.2 → @amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-action-click.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-dead-click.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-error-click.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-rage-click.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-thrashed-cursor.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture-plugin.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/constants.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/data-extractor.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/frustration-plugin.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/helpers.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.18.2 → @amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/hierarchy.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/libs/messenger.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +1 -0
- package/dist/{server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2 → node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/triggers.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/version.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.8.2/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/network-capture-plugin.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_plugin-network-capture-browser@1.7.2 → @amplitude_plugin-network-capture-browser@1.8.2}/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/track-network-event.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_plugin-page-url-enrichment-browser@0.5.8 → @amplitude_plugin-page-url-enrichment-browser@0.6.2}/node_modules/@amplitude/plugin-page-url-enrichment-browser/lib/esm/page-url-enrichment.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_plugin-page-view-tracking-browser@2.6.5 → @amplitude_plugin-page-view-tracking-browser@2.7.2}/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_plugin-web-vitals-browser@1.1.2 → @amplitude_plugin-web-vitals-browser@1.1.13}/node_modules/@amplitude/plugin-web-vitals-browser/lib/esm/web-vitals-plugin.js +1 -1
- package/dist/node_modules/.pnpm/@lit_localize@0.12.2/node_modules/@lit/localize/internal/default-msg.js +2 -2
- package/dist/node_modules/.pnpm/@sentry-internal_browser-utils@10.39.0/node_modules/@sentry-internal/browser-utils/build/esm/getNativeImplementation.js +1 -0
- package/dist/node_modules/.pnpm/@sentry-internal_browser-utils@10.39.0/node_modules/@sentry-internal/browser-utils/build/esm/instrument/dom.js +1 -0
- package/dist/node_modules/.pnpm/@sentry-internal_browser-utils@10.39.0/node_modules/@sentry-internal/browser-utils/build/esm/instrument/history.js +1 -0
- package/dist/node_modules/.pnpm/@sentry-internal_browser-utils@10.39.0/node_modules/@sentry-internal/browser-utils/build/esm/instrument/xhr.js +1 -0
- package/dist/node_modules/.pnpm/@sentry-internal_browser-utils@10.39.0/node_modules/@sentry-internal/browser-utils/build/esm/types.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/client.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/eventbuilder.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/helpers.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/integrations/breadcrumbs.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/integrations/browserapierrors.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/integrations/browsersession.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/integrations/culturecontext.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/integrations/globalhandlers.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/integrations/httpcontext.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/integrations/linkederrors.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/sdk.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/stack-parsers.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/transports/fetch.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/utils/detectBrowserExtension.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/asyncContext/stackStrategy.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/breadcrumbs.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/carrier.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/client.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/currentScopes.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/defaultScopes.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/envelope.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/eventProcessors.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/exports.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/instrument/console.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/instrument/fetch.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/instrument/globalError.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/instrument/globalUnhandledRejection.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/instrument/handlers.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/integration.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/integrations/conversationId.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/integrations/dedupe.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/integrations/eventFilters.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/integrations/functiontostring.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/logs/envelope.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/logs/internal.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/metrics/envelope.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/metrics/internal.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/scope.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/sdk.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/semanticAttributes.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/session.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/tracing/utils.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/transports/base.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/aggregate-errors.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/baggage.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/browser.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/debug-ids.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/debug-logger.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/dsn.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/envelope.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/eventUtils.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/eventbuilder.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/hasSpansEnabled.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/ipAddress.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/is.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/merge.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/misc.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/normalize.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/object.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/parseSampleRate.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/prepareEvent.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/promisebuffer.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/randomSafeContext.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/ratelimit.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/scopeData.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/sdkMetadata.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/should-ignore-span.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/spanOnScope.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/spanUtils.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/stacktrace.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/string.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/supports.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/syncpromise.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/time.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/timer.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/transactionEvent.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/url.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/version.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/worldwide.js +1 -0
- package/dist/node_modules/.pnpm/lit-html@3.3.2/node_modules/lit-html/directives/unsafe-html.js +2 -2
- package/dist/node_modules/.pnpm/lottie-web@5.13.0/node_modules/lottie-web/build/player/lottie.js +1 -1
- package/dist/node_modules/.pnpm/safe-json-stringify@1.2.0/node_modules/safe-json-stringify/index.js +1 -0
- package/dist/node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/v4.js +1 -1
- package/dist/node_modules/.pnpm/web-vitals@5.1.0/node_modules/web-vitals/dist/web-vitals.js +1 -0
- package/dist/sepa-transfers/bulk-transfers/index.d.ts +1 -1
- package/dist/sepa-transfers/index.d.ts +1 -1
- package/dist/server/_virtual/_commonjsHelpers.js +1 -0
- package/dist/server/_virtual/index.js +1 -0
- package/dist/server/_virtual/index2.js +1 -0
- package/dist/server/auth-links/client/auth-links.client.d.ts +1 -1
- package/dist/server/beneficiaries/client/beneficiaries.client.d.ts.map +1 -1
- package/dist/server/cards/client/cards.client.d.ts.map +1 -1
- package/dist/server/cards/index.d.ts +1 -1
- package/dist/server/index.server.umd.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/attribution/helpers.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/attribution/web-attribution.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/config/joined-config.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/config.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/cookie-migration/index.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/default-tracking.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/index.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/file-download-tracking.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/plugins/form-interaction-tracking.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/network-connectivity-checker.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/storage/local-storage.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/storage/session-storage.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/types.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/version.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/campaign/campaign-parser.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/core-client.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-client.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-storage.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/uncaught-sdk-errors.js +1 -0
- package/dist/{node_modules/.pnpm/@amplitude_analytics-core@2.34.1 → server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/identify.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/background-capture.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/base-window-messenger.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/constants.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/messenger/utils.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/network-request-event.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/observers/console.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/observers/network.js +1 -0
- package/dist/{node_modules/.pnpm/@amplitude_analytics-core@2.34.1 → server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js +1 -1
- package/dist/{node_modules/.pnpm/@amplitude_analytics-core@2.34.1 → server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/helpers.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/identity.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config.js +1 -1
- package/dist/{node_modules/.pnpm/@amplitude_analytics-core@2.34.1 → server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/revenue.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/browser-storage.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/memory.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/timeline.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/transports/fetch.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/types/frustration-interactions.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js +1 -1
- package/dist/{node_modules/.pnpm/@amplitude_analytics-core@2.34.1 → server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/json-query.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/utils/safe-stringify.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.18.2 → @amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-action-click.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-dead-click.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-error-click.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-rage-click.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-thrashed-cursor.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture-plugin.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/constants.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/data-extractor.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/frustration-plugin.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/helpers.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.18.2 → @amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/hierarchy.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/libs/messenger.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +1 -0
- package/dist/{node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2 → server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/triggers.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/version.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.8.2/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/network-capture-plugin.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_plugin-network-capture-browser@1.7.2 → @amplitude_plugin-network-capture-browser@1.8.2}/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/track-network-event.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_plugin-page-url-enrichment-browser@0.5.8 → @amplitude_plugin-page-url-enrichment-browser@0.6.2}/node_modules/@amplitude/plugin-page-url-enrichment-browser/lib/esm/page-url-enrichment.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_plugin-page-view-tracking-browser@2.6.5 → @amplitude_plugin-page-view-tracking-browser@2.7.2}/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_plugin-web-vitals-browser@1.1.2 → @amplitude_plugin-web-vitals-browser@1.1.13}/node_modules/@amplitude/plugin-web-vitals-browser/lib/esm/web-vitals-plugin.js +1 -1
- package/dist/server/node_modules/.pnpm/safe-json-stringify@1.2.0/node_modules/safe-json-stringify/index.js +1 -0
- package/dist/server/node_modules/.pnpm/uuid@13.0.0/node_modules/uuid/dist/v4.js +1 -1
- package/dist/server/node_modules/.pnpm/web-vitals@5.1.0/node_modules/web-vitals/dist/web-vitals.js +1 -0
- package/dist/server/sepa-transfers/bulk-transfers/index.d.ts +1 -1
- package/dist/server/sepa-transfers/index.d.ts +1 -1
- package/dist/server/src/beneficiaries/beneficiaries.js +1 -1
- package/dist/server/src/common/analytics/amplitude-manager.js +1 -1
- package/dist/server/transactions/client/transactions.client.d.ts +3 -3
- package/dist/server/validation/operation-settings-validation.d.ts +2 -2
- package/dist/src/auth-links/client/auth-links.client.js +1 -1
- package/dist/src/beneficiaries/beneficiaries.js +1 -1
- package/dist/src/beneficiaries/client/beneficiaries.client.js +1 -1
- package/dist/src/cards/client/cards.client.js +1 -1
- package/dist/src/cards/shared/cards.validate.js +1 -1
- package/dist/src/common/analytics/amplitude-manager.js +1 -1
- package/dist/src/common/sentry/sentry-manager.js +1 -1
- package/dist/src/payment-links/client/payment-links.client.js +1 -1
- package/dist/src/sepa-transfers/bulk-transfers/client/bulk-transfers.client.js +1 -1
- package/dist/src/sepa-transfers/client/sepa-transfers.client.js +1 -1
- package/dist/src/transactions/client/transactions.client.js +1 -1
- package/dist/src/ui/customizable-components/amount-field/qonto-amount-field.js +1 -1
- package/dist/src/ui/customizable-components/badge-status/qonto-badge-status.js +1 -1
- package/dist/src/ui/customizable-components/beneficiary-card/qonto-beneficiary-card.js +1 -1
- package/dist/src/ui/customizable-components/button/qonto-button.js +1 -1
- package/dist/src/ui/customizable-components/lottie-player/qonto-lottie-player.js +1 -1
- package/dist/src/ui/customizable-components/select-field/qonto-option.js +1 -1
- package/dist/src/ui/customizable-components/select-field/qonto-select-field.js +1 -1
- package/dist/src/ui/customizable-components/skeleton-loader/qonto-skeleton-loader-line.js +1 -1
- package/dist/src/ui/customizable-components/styles/styles.css.js +1 -1
- package/dist/src/ui/customizable-components/text/qonto-text-body.js +1 -1
- package/dist/src/ui/customizable-components/text/qonto-text-heading.js +1 -1
- package/dist/src/ui/customizable-components/text-field/qonto-text-field.js +1 -1
- package/dist/src/ui/ui-elements/sca-passkey/qonto-sca-passkey-waiting.js +1 -1
- package/dist/src/ui/ui-elements/sepa-transfer-creation/pages/beneficiary-selection-page.js +1 -1
- package/dist/src/ui/ui-elements/sepa-transfer-creation/pages/transfer-details-page.js +1 -1
- package/dist/src/ui/ui-elements/sepa-transfer-creation/pages/transfer-error-page.js +1 -1
- package/dist/src/ui/ui-elements/sepa-transfer-creation/pages/transfer-success-page.js +1 -1
- package/dist/src/ui/ui-elements/sepa-transfer-creation/pages/transfer-summary-page.js +1 -1
- package/dist/src/ui/ui-elements/sepa-transfer-creation/sepa-transfer-creation.js +1 -1
- package/dist/src/ui/ui-elements/transaction-list/transaction-list.js +1 -1
- package/dist/src/ui/ui-elements/transfer-list/transfer-list.js +1 -1
- package/dist/transactions/client/transactions.client.d.ts +3 -3
- package/dist/validation/operation-settings-validation.d.ts +2 -2
- package/package.json +33 -34
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/attribution/web-attribution.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/config.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/index.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/plugins/form-interaction-tracking.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/types.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/version.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/core-client.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/uncaught-sdk-errors.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/network-observer.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/timeline.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/transports/fetch.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/types/frustration-interactions.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-dead-click.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-rage-click.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture-plugin.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/constants.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/data-extractor.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/frustration-plugin.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/helpers.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/libs/messenger.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/version.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.7.2/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/network-capture-plugin.js +0 -1
- package/dist/node_modules/.pnpm/@sentry-internal_browser-utils@8.55.0/node_modules/@sentry-internal/browser-utils/build/esm/getNativeImplementation.js +0 -1
- package/dist/node_modules/.pnpm/@sentry-internal_browser-utils@8.55.0/node_modules/@sentry-internal/browser-utils/build/esm/instrument/dom.js +0 -1
- package/dist/node_modules/.pnpm/@sentry-internal_browser-utils@8.55.0/node_modules/@sentry-internal/browser-utils/build/esm/instrument/history.js +0 -1
- package/dist/node_modules/.pnpm/@sentry-internal_browser-utils@8.55.0/node_modules/@sentry-internal/browser-utils/build/esm/instrument/xhr.js +0 -1
- package/dist/node_modules/.pnpm/@sentry-internal_browser-utils@8.55.0/node_modules/@sentry-internal/browser-utils/build/esm/types.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm/client.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm/eventbuilder.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm/helpers.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm/integrations/breadcrumbs.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm/integrations/browserapierrors.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm/integrations/browsersession.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm/integrations/globalhandlers.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm/integrations/httpcontext.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm/integrations/linkederrors.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm/sdk.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm/stack-parsers.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm/transports/fetch.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm/userfeedback.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/asyncContext/stackStrategy.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/baseclient.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/breadcrumbs.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/carrier.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/currentScopes.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/defaultScopes.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/envelope.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/eventProcessors.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/exports.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/integration.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/integrations/dedupe.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/integrations/functiontostring.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/integrations/inboundfilters.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/metrics/metric-summary.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/scope.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/sdk.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/semanticAttributes.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/session.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/transports/base.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils/applyScopeDataToEvent.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils/hasTracingEnabled.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils/merge.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils/parseSampleRate.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils/prepareEvent.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils/sdkMetadata.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils/spanOnScope.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils/spanUtils.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/aggregate-errors.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/baggage.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/browser.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/debug-build.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/debug-ids.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/dsn.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/envelope.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/error.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/instrument/console.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/instrument/fetch.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/instrument/globalError.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/instrument/globalUnhandledRejection.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/instrument/handlers.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/is.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/logger.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/memo.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/misc.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/normalize.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/object.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/promisebuffer.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/ratelimit.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/stacktrace.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/string.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/supports.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/syncpromise.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/time.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/url.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/vendor/supportsHistory.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/version.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist/worldwide.js +0 -1
- package/dist/node_modules/.pnpm/web-vitals@5.0.1/node_modules/web-vitals/dist/web-vitals.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/attribution/web-attribution.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/config.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/index.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/plugins/form-interaction-tracking.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/types.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.32.2/node_modules/@amplitude/analytics-browser/lib/esm/version.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/core-client.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/uncaught-sdk-errors.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/network-observer.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/timeline.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/transports/fetch.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.34.1/node_modules/@amplitude/analytics-core/lib/esm/types/frustration-interactions.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-dead-click.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-rage-click.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture-plugin.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/constants.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/data-extractor.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/frustration-plugin.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/helpers.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/libs/messenger.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.18.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/version.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.7.2/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/network-capture-plugin.js +0 -1
- package/dist/server/node_modules/.pnpm/web-vitals@5.0.1/node_modules/web-vitals/dist/web-vitals.js +0 -1
- package/dist/server/src/common/logger/logger.js +0 -1
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/det-notification.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/lib-prefix.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/utils/snippet-helper.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/analytics-connector.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/config.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/cookie-name.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/language.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/logger.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/query-params.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config-localstorage.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/session.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/helpers.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/element-interactions.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/status.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/sampling.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/url-utils.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.18.2 → @amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-change.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.18.2 → @amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-click.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.18.2 → @amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/actions.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.18.2 → @amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/matchEventToFilter.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_plugin-network-capture-browser@1.7.2 → @amplitude_plugin-network-capture-browser@1.8.2}/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_plugin-page-view-tracking-browser@2.6.5 → @amplitude_plugin-page-view-tracking-browser@2.7.2}/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/utils.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_plugin-web-vitals-browser@1.1.2 → @amplitude_plugin-web-vitals-browser@1.1.13}/node_modules/@amplitude/plugin-web-vitals-browser/lib/esm/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{@rollup_plugin-typescript@12.1.2_rollup@4.39.0_tslib@2.8.1_typescript@5.8.3 → @rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3}/node_modules/tslib/tslib.es6.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry-internal_browser-utils@8.55.0 → @sentry-internal_browser-utils@10.39.0}/node_modules/@sentry-internal/browser-utils/build/esm/debug-build.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_browser@8.55.0/node_modules/@sentry/browser/build/npm/esm → @sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod}/debug-build.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@8.55.0 → @sentry_core@10.39.0}/node_modules/@sentry/core/build/esm/api.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@8.55.0 → @sentry_core@10.39.0}/node_modules/@sentry/core/build/esm/asyncContext/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@8.55.0 → @sentry_core@10.39.0}/node_modules/@sentry/core/build/esm/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@8.55.0 → @sentry_core@10.39.0}/node_modules/@sentry/core/build/esm/debug-build.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@8.55.0 → @sentry_core@10.39.0}/node_modules/@sentry/core/build/esm/tracing/spanstatus.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist → @sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils}/breadcrumb-log-level.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist → @sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils}/clientreport.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist → @sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils}/env.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist → @sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils}/propagationContext.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@8.55.0/node_modules/@sentry/core/build/esm/utils-hoist → @sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils}/severity.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/constants.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/det-notification.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/lib-prefix.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.32.2 → @amplitude_analytics-browser@2.35.3}/node_modules/@amplitude/analytics-browser/lib/esm/utils/snippet-helper.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/analytics-connector.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/config.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/cookie-name.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/language.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/logger.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/query-params.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config-localstorage.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/session.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/helpers.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/element-interactions.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/types/status.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/sampling.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.34.1 → @amplitude_analytics-core@2.40.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/url-utils.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.18.2 → @amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-change.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.18.2 → @amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-click.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.18.2 → @amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/actions.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.18.2 → @amplitude_plugin-autocapture-browser@1.22.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/matchEventToFilter.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-network-capture-browser@1.7.2 → @amplitude_plugin-network-capture-browser@1.8.2}/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/constants.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-page-view-tracking-browser@2.6.5 → @amplitude_plugin-page-view-tracking-browser@2.7.2}/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/utils.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-web-vitals-browser@1.1.2 → @amplitude_plugin-web-vitals-browser@1.1.13}/node_modules/@amplitude/plugin-web-vitals-browser/lib/esm/constants.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@rollup_plugin-typescript@12.1.2_rollup@4.39.0_tslib@2.8.1_typescript@5.8.3 → @rollup_plugin-typescript@12.3.0_rollup@4.57.1_tslib@2.8.1_typescript@5.9.3}/node_modules/tslib/tslib.es6.js +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).QontoEmbedServer={})}(this,(function(e){"use strict";class t{constructor(){this.accessToken=null,this.stagingToken=null}static getInstance(){return t.instance||(t.instance=new t),t.instance}setAccessToken(e){this.accessToken=e}getAccessToken(){return this.accessToken}hasAccessToken(){return null!==this.accessToken&&""!==this.accessToken}clearAccessToken(){this.accessToken=null}setStagingToken(e){this.stagingToken=e}getStagingToken(){return this.stagingToken}hasStagingToken(){return null!==this.stagingToken&&""!==this.stagingToken}clearStagingToken(){this.stagingToken=null}}const n=t.getInstance();class r extends Error{constructor(){super(),this.stack=""}toString(){return`${this.name}: ${this.message}`}}class i extends r{constructor(){super(),this.name="AuthenticationError",this.message="Authentication failed due to missing or invalid authentication method. Provide either a proxyRequestFunction (recommended) or accessToken, either as parameters or by calling the initialize function first."}}function o(){if(!n.hasAccessToken())throw new i;return n.getAccessToken()}function a(){return!("undefined"!=typeof window&&"undefined"!=typeof document)}const s={PRODUCTION:"production",STAGING:"staging",LOCAL:"local"},c={MASTER:"master",SANDBOX:"sandbox",QA:"qa"},u={PASSKEY:"passkey",SMS_OTP:"sms-otp",PAIRED_DEVICE:"paired-device",MOCK:"mock"},l=3e4,d="REJECT",f={CARD_DISPLAY:"display_card",PAYMENT_LINK_CREATE:"create_payment_link",SEPA_TRANSFER_CREATE:"create_sepa_transfer"},p="https://embed.qonto.com",g="https://embed-js{branch}.staging.qonto.co",h="https://embed.dev.qonto.co",v={[s.PRODUCTION]:{EMBED_BASE_URL:p,EMBED_URL:`${p}/connect`,THIRD_PARTY_API_URL:"https://thirdparty.qonto.com"},[s.STAGING]:{EMBED_BASE_URL:g,EMBED_URL:`${g}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"},[s.LOCAL]:{EMBED_BASE_URL:h,EMBED_URL:`${h}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"}};class m{constructor(){let e,t;this.environment=s.PRODUCTION,this.branch=c.SANDBOX,"undefined"!=typeof process&&process.env&&(e=process.env.QONTO_EMBED_ENVIRONMENT,t=process.env.QONTO_EMBED_BRANCH),this.environment=Object.values(s).includes(e)?e:s.PRODUCTION,this.branch=Object.values(c).includes(t)?t:c.SANDBOX}static getInstance(){return m.instance||(m.instance=new m),m.instance}setEnvironment(e){this.environment=e}getEnvironment(){return this.environment}isProductionEnvironment(){return this.environment===s.PRODUCTION}setBranch(e){this.branch=e}getBranch(){return this.branch}clear(){this.environment=s.PRODUCTION,this.branch=c.MASTER}getEnvironmentUrls(){if(this.environment===s.PRODUCTION)return v.production;{const e=v[this.environment];return Object.entries(e).reduce(((e,[t,n])=>({...e,[t]:n.replace("{branch}",`-${this.branch}`)})),{})}}}const y=m.getInstance();class b{constructor(){this.currentLocale="en"}static getInstance(){return b.instance||(b.instance=new b),b.instance}setLocale(e){this.currentLocale=e}getLocale(){return this.currentLocale}setDefaultLocale(){this.currentLocale="en"}}const T=b.getInstance();class w{constructor(){this.mfaPreference=u.PASSKEY,this.debugMode=!1}static getInstance(){return w.instance||(w.instance=new w),w.instance}setSettings(e){e.uiParentElementId&&(this.uiParentElementId=e.uiParentElementId),e.mfaPreference&&(this.mfaPreference=e.mfaPreference),e.debugMode&&(this.debugMode=e.debugMode),e.proxyRequestFunction&&(this.proxyRequestFunction=e.proxyRequestFunction),e.proxyEndpointDescriptor&&(this.proxyEndpointDescriptor=e.proxyEndpointDescriptor)}getUIParentElementId(){return this.uiParentElementId}getMFAPreference(){return this.mfaPreference}getDebugMode(){return this.debugMode}getProxyRequestFunction(){return this.proxyRequestFunction}getProxyEndpointDescriptor(){return this.proxyEndpointDescriptor}clearSettings(){this.uiParentElementId=void 0,this.mfaPreference=u.PASSKEY,this.debugMode=!1,this.proxyRequestFunction=void 0,this.proxyEndpointDescriptor=void 0}getSettings(){return{uiParentElementId:this.uiParentElementId,mfaPreference:this.mfaPreference,debugMode:this.debugMode,proxyRequestFunction:this.proxyRequestFunction}}}const k=w.getInstance();class S extends r{constructor({message:e,data:t,code:n}){super(),this.code=500;const r=Array.isArray(e)?e.join("\n"):e;this.name="EmbedApiError",this.message=`The call to the Embed API failed with the following errors:\n${r}`,this.data=t||{},this.code=n||this.code}}function E({accessToken:e,stagingToken:t,idempotencyKey:r,mfaPreference:i,scaSessionToken:o}){const a=new Headers;a.append("Authorization",`Bearer ${e}`);const s=t||n.getStagingToken();s&&a.append("X-Qonto-Staging-Token",s),r&&a.append("X-Qonto-Idempotency-Key",r);const c=i||k.getMFAPreference();return c&&a.append("X-Qonto-2fa-Preference",c),o&&a.append("X-Qonto-SCA-Session-Token",o),a.append("Content-Type","application/json"),a.append("Accept-Language",T.getLocale()),a}async function _({path:e,options:t}){const n=`${y.getEnvironmentUrls().THIRD_PARTY_API_URL}${e}`,r=await fetch(n,{...t,headers:E(t.headers),body:t.body?JSON.stringify(t.body):void 0});if(204===r.status)return;const i=await r.json();if(!r.ok)throw i.errors?new S({code:r.status,message:i.errors.map((e=>`${e.code}: ${e.detail}`))}):new S({code:r.status,message:`${i.code}: ${i.detail}`,data:i});return i}function I(e){const t={method:e.options.method,headers:e.options.headers,path:e.path,payload:e.options?.body},n=JSON.stringify(t);return r=n,a()?Buffer.from(r).toString("base64"):btoa(r);var r}function P(e){return JSON.parse((t=e,a()?Buffer.from(t,"base64").toString("utf-8"):atob(t)));var t}function A({accessToken:e,stagingToken:t,action:n,callbackUrl:r}){const i={post_authn_action:n};return r&&(i.callback_url=r),{path:"/v1/embed_auth_links",options:{method:"POST",headers:{accessToken:e,stagingToken:t},body:{embed_auth_link:i}}}}async function O(e){const t=A({accessToken:e.accessToken,stagingToken:e.stagingToken,action:e.action,callbackUrl:e.callbackUrl}),{embed_auth_link:n}=await _(t);return{url:n.url,post_authn_action:n.post_authn_action,callback_url:n.callback_url,expired_at:n.expired_at,used_at:n.used_at}}function R(e){return{url:e.url,postAuthAction:e.post_authn_action,callbackUrl:e.callback_url,expiresAt:e.expired_at,usedAt:e.used_at}}class x extends r{constructor(e){super(),this.name="InvalidParametersError",this.invalidParameters=Array.isArray(e)?e:[e],this.message=`Invalid parameters were passed to the function:\n${this.invalidParameters.map((e=>e)).join("\n")}`}}function C(e,t){const n=t.filter((t=>t.requiredIfPresent?!e[t.name]&&e[t.requiredIfPresent]:void 0===e[t.name])).map((e=>e.name));if(n.length>0)throw new x(n.map((e=>`Missing required parameter: ${e}`)))}function D(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"string"!=typeof e)).map((([e])=>`${e} must be a string`))}function L(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"number"!=typeof e)).map((([e])=>`${e} must be a number`))}function N(e){if(!e||"object"!=typeof e)throw new x("requestSettings must be an object");const t=e,{action:n,callbackUrl:r}=e;C(t,[{name:"action"}]);const i=D(t),o=Object.values(f);if(o.includes(n)||i.push(`action must be one of ${o.join(", ")}`),i.length>0)throw new x(i);if(void 0!==r&&""===r.trim())throw new x("callbackUrl cannot be empty")}async function U({requestSettings:e,operationSettings:t}){N(e);const{accessToken:n,stagingToken:r}=t||{},i=n||o();return R(await O({accessToken:i,stagingToken:r,action:e.action,callbackUrl:e.callbackUrl}))}const j={request:U};function M(e){const t=new URLSearchParams;return e?.page&&t.append("page",e.page.toString()),e?.itemsPerPage&&t.append("per_page",e.itemsPerPage.toString()),t}function q(e){if(e)return{totalItems:e?.total_count,totalPages:e?.total_pages,currentPage:e?.current_page,itemsPerPage:e?.per_page,previousPage:e?.prev_page||null,nextPage:e?.next_page||null}}const F=[];for(let e=0;e<256;++e)F.push((e+256).toString(16).slice(1));let B;const $=new Uint8Array(16);var K={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function H(e,t,n){const r=(e=e||{}).random??e.rng?.()??function(){if(!B){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");B=crypto.getRandomValues.bind(crypto)}return B($)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(F[e[t+0]]+F[e[t+1]]+F[e[t+2]]+F[e[t+3]]+"-"+F[e[t+4]]+F[e[t+5]]+"-"+F[e[t+6]]+F[e[t+7]]+"-"+F[e[t+8]]+F[e[t+9]]+"-"+F[e[t+10]]+F[e[t+11]]+F[e[t+12]]+F[e[t+13]]+F[e[t+14]]+F[e[t+15]]).toLowerCase()}(r)}function z(e,t,n){return K.randomUUID?K.randomUUID():H(e)}function V(e){return{id:e.id,name:e.name,email:e.email,activityTag:e.activity_tag,iban:e.iban,bic:e.bic,currency:e.currency,status:e.status,trusted:e.trusted,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at)}}function G(e){return{name:e.name,...e.email&&{email:e.email},...e.activityTag&&{activity_tag:e.activityTag},iban:e.iban,...e.bic&&{bic:e.bic}}}const J="/v2/sepa/beneficiaries";async function W({paginationSettings:e,accessToken:t,stagingToken:n}){const r=function({paginationSettings:e,accessToken:t,stagingToken:n}){const r={method:"GET",headers:{accessToken:t,stagingToken:n}},i=M(e),o=i.size?`?${i.toString()}`:"";return{path:`${J}${o}`,options:r}}({paginationSettings:e,accessToken:t,stagingToken:n}),{beneficiaries:i,meta:o}=await _(r);return{beneficiaries:i,meta:o}}function Y({beneficiaryId:e,accessToken:t,stagingToken:n}){return{path:`${J}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}async function Q({accessToken:e,stagingToken:t,beneficiaryId:n}){const r=Y({beneficiaryId:n,accessToken:e,stagingToken:t}),{beneficiary:i}=await _(r);return i}async function X({beneficiary:e,accessToken:t,stagingToken:n,idempotencyKey:r=z()}){const i=function({beneficiary:e,accessToken:t,stagingToken:n,idempotencyKey:r=z()}){return{path:J,options:{method:"POST",headers:{accessToken:t,stagingToken:n,idempotencyKey:r},body:{beneficiary:G(e)}}}}({beneficiary:e,accessToken:t,stagingToken:n,idempotencyKey:r}),{beneficiary:o}=await _(i);return o}async function Z({beneficiaryIds:e,accessToken:t,stagingToken:n}){const r=function({beneficiaryIds:e,accessToken:t,stagingToken:n}){return{path:`${J}/untrust`,options:{method:"PATCH",headers:{accessToken:t,stagingToken:n},body:{ids:e}}}}({beneficiaryIds:e,accessToken:t,stagingToken:n}),{beneficiaries:i}=await _(r);return i}async function ee({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i}){const o=function({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i}){const{name:o,email:a,activityTag:s}=e,c={method:"PATCH",headers:{accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i},body:{beneficiary:{name:o,email:a,activity_tag:s}}};return{path:`${J}/${e.id}`,options:c}}({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i}),{beneficiary:a}=await _(o);return a}const te=[{name:"name"},{name:"iban"}];function ne(e){if(!e)throw new x("beneficiaryId parameter is required for the called function");if(e&&"string"!=typeof e)throw new x("beneficiaryId must be a string");return e}const re={getBeneficiaries:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i=t||o(),a=await W({accessToken:i,stagingToken:n,paginationSettings:r}),s=a.beneficiaries.map((e=>V(e))),c=q(a.meta);return{beneficiaries:s,...c?{meta:c}:{}}},getBeneficiary:async function({beneficiarySettings:e,operationSettings:t}){const n=ne(e?.beneficiaryId),{accessToken:r,stagingToken:i}=t||{},a=r||o();return V(await Q({beneficiaryId:n,accessToken:a,stagingToken:i}))},addBeneficiary:async function({beneficiarySettings:e,operationSettings:t}){const n=function(e){if(!e)throw new x("beneficiary parameter is required for the called function");if("object"!=typeof e)throw new x("beneficiary must be an object");C(e,te);const t=D({name:e.name,iban:e.iban,email:e.email,activityTag:e.activityTag,bic:e.bic});if(t.length>0)throw new x(t);return e}(e),{accessToken:r,stagingToken:i,idempotencyKey:a}=t||{},s=r||o();return V(await X({beneficiary:n,accessToken:s,stagingToken:i,idempotencyKey:a}))},updateBeneficiary:async function({beneficiarySettings:e,operationSettings:t}){const n=function(e){const{id:t,name:n,email:r,activityTag:i}=e||{};if(!t)throw new x("Invalid parameters were passed to the function:\nA beneficiary ID is required for the called function");if(!n&&!r&&!i)throw new x("Invalid parameters were passed to the function:\nAt least one of the following properties must be provided: name, email, activityTag");const o=D({name:n,email:r,activityTag:i});if(o.length>0)throw new x(o);return{id:t,name:n,email:r,activityTag:i}}(e),{accessToken:r,stagingToken:i,idempotencyKey:a,mfaPreference:s}=t||{},c={beneficiaryParamsBeingEdited:n,accessToken:r||o(),stagingToken:i,idempotencyKey:a,mfaPreference:s};return V(await ee(c))},untrustBeneficiaries:async function({beneficiarySettings:e,operationSettings:t}){const n=function(e){if(!e)throw new x("beneficiaryIds parameter is required for the called function");if(!Array.isArray(e)||!e.every((e=>"string"==typeof e)))throw new x("beneficiaryIds must be an array of strings");return e}(e?.beneficiaryIds),{accessToken:r,stagingToken:i}=t||{},a=r||o();return(await Z({beneficiaryIds:n,accessToken:a,stagingToken:i})).map(V)}},ie="SDK Initialized",oe="Cards List";var ae=function(e,t){return ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ae(e,t)};function se(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ae(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ce,ue,le=function(){return le=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},le.apply(this,arguments)};function de(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function fe(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function pe(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=s(0),a.throw=s(1),a.return=s(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function s(s){return function(c){return function(s){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,s[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&s[0]?r.return:s[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,s[1])).done)return i;switch(r=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return o.label++,{value:s[1],done:!1};case 5:o.label++,r=s[1],s=[0];continue;case 7:s=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){o=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){o.label=s[1];break}if(6===s[0]&&o.label<i[1]){o.label=i[1],i=s;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(s);break}i[2]&&o.ops.pop(),o.trys.pop();continue}s=t.call(e,o)}catch(e){s=[6,e],r=0}finally{n=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,c])}}}function ge(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function he(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function ve(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(ce||(ce={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(ue||(ue={}));var me,ye="AMP",be="".concat(ye,"_unsent"),Te="$default_instance",we="https://api2.amplitude.com/2/httpapi",ke="dclid",Se="fbclid",Ee="gbraid",_e="gclid",Ie="ko_click_id",Pe="li_fat_id",Ae="msclkid",Oe="rdt_cid",Re="ttclid",xe="twclid",Ce="wbraid",De={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Le=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],Ne=["authorization","cookie","set-cookie"],Ue=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!je(t,n))return!1}return!0},je=function(e,t){var n,r;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=ge(t),a=o.next();!a.done;a=o.next()){var s=a.value;if(Array.isArray(s))return!1;if("object"==typeof s)i=i&&Ue(s);else if(!["number","string"].includes(typeof s))return!1;if(!i)return!1}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(null==t)return!1;if("object"==typeof t)return Ue(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},Me=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return le({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(me.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(me.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(me.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(me.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(me.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(me.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(me.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(me.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(me.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[me.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return void 0===this._properties[me.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===me.ADD?"number"==typeof n:e===me.UNSET||e===me.REMOVE||je(t,n)))},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(me||(me={}));var qe,Fe=[me.CLEAR_ALL,me.UNSET,me.SET,me.SET_ONCE,me.ADD,me.APPEND,me.PREPEND,me.PREINSERT,me.POSTINSERT,me.REMOVE];!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(qe||(qe={}));var Be,$e=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=qe.Unknown),{event:e,code:t,message:n}},Ke=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},He=ve([],he(Array(256).keys()),!1).map((function(e){return e.toString(16).padStart(2,"0")})),ze=function(e){var t,n=Ke();if(!(null===(t=null==n?void 0:n.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,ze)}(e);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,ve([],he(r.entries()),!1).map((function(e){var t=he(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(He[r]):He[r]})).join("")},Ve=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[]}return e.prototype.register=function(e,t){var n,r;return fe(this,void 0,void 0,(function(){return pe(this,(function(i){switch(i.label){case 0:return this.plugins.some((function(t){return t.name===e.name}))?(this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2]):(void 0===e.name&&(e.name=ze(),this.loggerProvider.warn("Plugin name is undefined. \n Generating a random UUID for plugin name: ".concat(e.name,". \n Set a name for the plugin to prevent it from being added multiple times."))),e.type=null!==(n=e.type)&&void 0!==n?n:"enrichment",[4,null===(r=e.setup)||void 0===r?void 0:r.call(e,t,this.client)]);case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e,t){var n;return fe(this,void 0,void 0,(function(){var r,i;return pe(this,(function(o){switch(o.label){case 0:return r=this.plugins.findIndex((function(t){return t.name===e})),-1===r?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(i=this.plugins[r],this.plugins.splice(r,1),[4,null===(n=i.teardown)||void 0===n?void 0:n.call(i)]);case 1:return o.sent(),[2]}}))}))},e.prototype.reset=function(e){this.applying=!1,this.plugins.map((function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)})),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise((function(n){t.queue.push([e,n]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return fe(this,void 0,void 0,(function(){var t,n,r,i,o,a,s,c,u,l,d,f,p,g,h,v,m,y,b,T;return pe(this,(function(w){switch(w.label){case 0:if(!e)return[2];t=he(e,1),n=t[0],r=he(e,2),i=r[1],this.loggerProvider.log("Timeline.apply: Initial event",n),o=this.plugins.filter((function(e){return"before"===e.type})),w.label=1;case 1:w.trys.push([1,6,7,8]),a=ge(o),s=a.next(),w.label=2;case 2:return s.done?[3,5]:(f=s.value).execute?[4,f.execute(le({},n))]:[3,4];case 3:if(null===(p=w.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),i({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),w.label=4;case 4:return s=a.next(),[3,2];case 5:return[3,8];case 6:return c=w.sent(),m={error:c},[3,8];case 7:try{s&&!s.done&&(y=a.return)&&y.call(a)}finally{if(m)throw m.error}return[7];case 8:u=this.plugins.filter((function(e){return"enrichment"===e.type||void 0===e.type})),w.label=9;case 9:w.trys.push([9,14,15,16]),l=ge(u),d=l.next(),w.label=10;case 10:return d.done?[3,13]:(f=d.value).execute?[4,f.execute(le({},n))]:[3,12];case 11:if(null===(p=w.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),i({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),w.label=12;case 12:return d=l.next(),[3,10];case 13:return[3,16];case 14:return g=w.sent(),b={error:g},[3,16];case 15:try{d&&!d.done&&(T=l.return)&&T.call(l)}finally{if(b)throw b.error}return[7];case 16:return h=this.plugins.filter((function(e){return"destination"===e.type})),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(n))),v=h.map((function(e){var t=le({},n);return e.execute(t).catch((function(e){return $e(t,0,String(e))}))})),Promise.all(v).then((function(e){var t=he(e,1)[0]||$e(n,100,"Event not tracked, no destination plugins on the instance");i(t)})),[2]}}))}))},e.prototype.flush=function(){return fe(this,void 0,void 0,(function(){var e,t,n,r=this;return pe(this,(function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return r.apply(e)})))];case 1:return i.sent(),t=this.plugins.filter((function(e){return"destination"===e.type})),n=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(n)];case 2:return i.sent(),[2]}}))}))},e.prototype.onIdentityChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onIdentityChanged)||void 0===n||n.call(t,e)}))},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onSessionIdChanged)||void 0===n||n.call(t,e)}))},e.prototype.onOptOutChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onOptOutChanged)||void 0===n||n.call(t,e)}))},e.prototype.onReset=function(){this.plugins.forEach((function(e){var t;null===(t=e.onReset)||void 0===t||t.call(e)}))},e}(),Ge=function(e,t){return le(le({},t),{event_type:ue.IDENTIFY,user_properties:e.getUserProperties()})},Je=function(e){return{promise:e||Promise.resolve()}},We=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new Ve(this),this.name=e}return e.prototype._init=function(e){return fe(this,void 0,void 0,(function(){return pe(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return fe(this,void 0,void 0,(function(){var t,n,r,i,o,a,s,c;return pe(this,(function(u){switch(u.label){case 0:t=this[e],this[e]=[],u.label=1;case 1:u.trys.push([1,8,9,10]),n=ge(t),r=n.next(),u.label=2;case 2:return r.done?[3,7]:(i=r.value,(o=i())&&"promise"in o?[4,o.promise]:[3,4]);case 3:return u.sent(),[3,6];case 4:return[4,o];case 5:u.sent(),u.label=6;case 6:return r=n.next(),[3,2];case 7:return[3,10];case 8:return a=u.sent(),s={error:a},[3,10];case 9:try{r&&!r.done&&(c=n.return)&&c.call(n)}finally{if(s)throw s.error}return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:u.sent(),u.label=12;case 12:return[2]}}))}))},e.prototype.track=function(e,t,n){var r=function(e,t,n){return le(le(le({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t})}(e,t,n);return Je(this.dispatch(r))},e.prototype.identify=function(e,t){var n=Ge(e,t);return Je(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=function(e,t,n,r){var i;return le(le({},r),{event_type:ue.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)})}(e,t,n,r);return Je(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=function(e,t,n){var r,i=new Me;return i.set(e,t),le(le({},n),{event_type:ue.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,n);return Je(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=function(e,t){return le(le({},t),{event_type:ue.REVENUE,event_properties:e.getEventProperties()})}(e,t);return Je(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),Je())},e.prototype._addPlugin=function(e){return Je(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),Je())},e.prototype._removePlugin=function(e){return Je(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t($e(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return fe(this,void 0,void 0,(function(){var t=this;return pe(this,(function(n){return this.isReady?[2,this.process(e)]:[2,new Promise((function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))}))]}))}))},e.prototype.getOperationAppliedUserProperties=function(e){var t={};if(void 0===e)return t;var n={};return Object.keys(e).forEach((function(t){Object.values(ce).includes(t)||(n[t]=e[t])})),Fe.forEach((function(n){if(Object.keys(e).includes(n)){var r=e[n];switch(n){case ce.CLEAR_ALL:Object.keys(t).forEach((function(e){delete t[e]}));break;case ce.UNSET:Object.keys(r).forEach((function(e){delete t[e]}));break;case ce.SET:Object.assign(t,r)}}})),Object.assign(t,n),t},e.prototype.process=function(e){return fe(this,void 0,void 0,(function(){var t,n,r,i;return pe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),this.config.optOut?[2,$e(e,0,"Event skipped due to optOut config")]:(e.event_type===ue.IDENTIFY&&(t=this.getOperationAppliedUserProperties(e.user_properties),this.timeline.onIdentityChanged({userProperties:t})),[4,this.timeline.push(e)]);case 1:return 200===(i=o.sent()).code?this.config.loggerProvider.log(i.message):100===i.code?this.config.loggerProvider.warn(i.message):this.config.loggerProvider.error(i.message),[2,i];case 2:return n=o.sent(),r=String(n),this.config.loggerProvider.error(r),[2,i=$e(e,0,r)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,Boolean(e)))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.timeline.onOptOutChanged(e),this.config.optOut=Boolean(e))},e.prototype.flush=function(){return Je(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find((function(t){return t.name===e}));if(void 0!==t)return t;this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e))},e.prototype.plugins=function(e){return this.timeline.plugins.filter((function(t){return t instanceof e}))},e}(),Ye=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){return Ue(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?le({},this.properties):{};return e[Be.REVENUE_PRODUCT_ID]=this.productId,e[Be.REVENUE_QUANTITY]=this.quantity,e[Be.REVENUE_PRICE]=this.price,e[Be.REVENUE_TYPE]=this.revenueType,e[Be.REVENUE_CURRENCY]=this.currency,e[Be.REVENUE]=this.revenue,e[Be.RECEIPT]=this.receipt,e[Be.RECEIPT_SIG]=this.receiptSig,e},e}();!function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}(Be||(Be={}));var Qe;!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(Qe||(Qe={}));var Xe="Amplitude Logger ",Ze=function(){function e(){this.logLevel=Qe.None}return e.prototype.disable=function(){this.logLevel=Qe.None},e.prototype.enable=function(e){void 0===e&&(e=Qe.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Qe.Verbose||console.log("".concat(Xe,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Qe.Warn||console.warn("".concat(Xe,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Qe.Error||console.error("".concat(Xe,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Qe.Debug||console.log("".concat(Xe,"[Debug]: ").concat(e.join(" ")))},e}(),et=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:Te,logLevel:Qe.Warn,loggerProvider:new Ze,offline:!1,optOut:!1,serverUrl:we,serverZone:"US",useBatch:!1}},tt=function(){function e(e){var t,n,r,i;this._optOut=!1;var o=et();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(n=e.logLevel)&&void 0!==n?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(r=e.optOut)&&void 0!==r?r:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var a=rt(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=a.serverZone,this.serverUrl=a.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),nt=function(e,t){return"EU"===e?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":we},rt=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=et().serverZone),void 0===n&&(n=et().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=["US","EU"].includes(t)?t:et().serverZone;return{serverZone:r,serverUrl:nt(r,n)}},it=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function ot(e){return e>=200&&e<300}var at=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},st=function(e){return function(){var t=le({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},ct=function(e,t){var n,r;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=ge(t.split(".")),o=i.next();!o.done;o=i.next()){var a=o.value;if(!(a in e))return;e=e[a]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},ut=function(e,t){return function(){var n,r,i={};try{for(var o=ge(t),a=o.next();!a.done;a=o.next()){var s=a.value;i[s]=ct(e,s)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},lt=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],a=0;a<arguments.length;a++)o[a]=arguments[a];var s=n(),c=s.logger,u=s.logLevel;if(u&&u<Qe.Debug||!u||!c)return e.apply(i,o);var l={type:"invoke public method",name:t,args:o,stacktrace:at(1),time:{start:(new Date).toISOString()},states:{}};r&&l.states&&(l.states.before=r());var d=e.apply(i,o);return d&&d.promise?d.promise.then((function(){r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=(new Date).toISOString()),c.debug(JSON.stringify(l,null,2))})):(r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=(new Date).toISOString()),c.debug(JSON.stringify(l,null,2))),d}};function dt(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var ft=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return fe(this,void 0,void 0,(function(){var n,r=this;return pe(this,(function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(be,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(n=i.sent())&&n.length>0&&Promise.all(n.map((function(e){return r.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=ze()),new Promise((function(n){var r={event:e,attempts:0,callback:function(e){return n(e)},timeout:0};t.queue.push(r),t.schedule(t.config.flushIntervalMillis),t.saveEvents()}))},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter((function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)}))},e.prototype.scheduleEvents=function(e){var t=this;e.forEach((function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)}))},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout((function(){t.queue=t.queue.map((function(e){return e.timeout=0,e})),t.flush(!0)}),e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),fe(this,void 0,void 0,(function(){var t,n,r=this;return pe(this,(function(i){switch(i.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):n.push(e)})),o=t,a=this.config.flushQueueSize,s=Math.max(a,1),[4,o.reduce((function(e,t,n){var r=Math.floor(n/s);return e[r]||(e[r]=[]),e[r].push(t),e}),[]).reduce((function(t,n){return fe(r,void 0,void 0,(function(){return pe(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}}))}))}),Promise.resolve())]);case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}var o,a,s}))}))},e.prototype.send=function(e,t){var n;return void 0===t&&(t=!0),fe(this,void 0,void 0,(function(){var r,i,o,a,s;return pe(this,(function(c){switch(c.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,de(t,["extra"])})),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new it,c.label=1;case 1:return c.trys.push([1,3,,4]),i=rt(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,r)];case 2:return null===(o=c.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(o,e),[3,4]):("body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(dt(o))):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return a=c.sent(),s=(u=a)instanceof Error?u.message:String(u),this.config.loggerProvider.error(s),null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map((function(e){return e.event.event_type})),message:s,stack_trace:at()}),this.handleResponse({status:qe.Failed,statusCode:0},e),[3,4];case 4:return[2]}var u}))}))},e.prototype.handleResponse=function(e,t){var n;ot(e.statusCode)||null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful",{events:t.map((function(e){return e.event.event_type})),code:e.statusCode,status:e.status,body:dt(e),stack_trace:at()});var r=e.status;switch(r){case qe.Success:this.handleSuccessResponse(e,t);break;case qe.Invalid:this.handleInvalidResponse(e,t);break;case qe.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case qe.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var r=ve(ve(ve(ve([],he(Object.values(e.body.eventsWithInvalidFields)),!1),he(Object.values(e.body.eventsWithMissingFields)),!1),he(Object.values(e.body.eventsWithInvalidIdLengths)),!1),he(e.body.silencedEvents),!1).flat(),i=new Set(r),o=t.filter((function(t,r){if(!i.has(r))return!0;n.fulfillRequest([t],e.statusCode,e.body.error)}));o.length>0&&this.config.loggerProvider.warn(dt(e));var a=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(a)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(dt(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,a=new Set(r),s=new Set(i),c=new Set(o),u=t.filter((function(t,r){if(!(t.event.user_id&&a.has(t.event.user_id)||t.event.device_id&&s.has(t.event.device_id)))return c.has(r)&&(t.timeout=n.throttleTimeout),!0;n.fulfillRequest([t],e.statusCode,e.body.error)}));u.length>0&&this.config.loggerProvider.warn(dt(e));var l=this.removeEventsExceedFlushMaxRetries(u);this.scheduleEvents(l)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e})),r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.fulfillRequest=function(e,t,n){var r,i,o;ot(t)?null===(o=this.diagnosticsClient)||void 0===o||o.increment("analytics.events.sent",e.length):(null===(r=this.diagnosticsClient)||void 0===r||r.increment("analytics.events.dropped",e.length),null===(i=this.diagnosticsClient)||void 0===i||i.recordEvent("analytics.events.dropped",{events:e.map((function(e){return e.event.event_type})),code:t,message:n,stack_trace:at()})),this.removeEvents(e),e.forEach((function(e){return e.callback($e(e.event,t,n))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map((function(e){return e.event}));this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter((function(t){return!e.some((function(e){return e.event.insert_id===t.event.insert_id}))})),this.saveEvents()},e}(),pt=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:gt(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),gt=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},ht=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),vt=function(){return vt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},vt.apply(this,arguments)};function mt(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function yt(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}"function"==typeof SuppressedError&&SuppressedError;var bt=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=mt(["string","number","boolean","undefined"]),a=o.next();!a.done;a=o.next()){if(a.value===i)return e===t}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var s=Array.isArray(e),c=Array.isArray(t);if(s!==c)return!1;if(!s||!c){var u=Object.keys(e).sort(),l=Object.keys(t).sort();if(!bt(u,l))return!1;var d=!0;return Object.keys(e).forEach((function(n){bt(e[n],t[n])||(d=!1)})),d}for(var f=0;f<e.length;f++)if(!bt(e[f],t[f]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var Tt,wt=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=vt({},this.identity.userProperties),n=vt(vt({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,a,s,c=n.userProperties||{};try{for(var u=mt(Object.entries(e)),l=u.next();!l.done;l=u.next()){var d=yt(l.value,2),f=d[0],p=d[1];switch(f){case"$set":try{for(var g=(i=void 0,mt(Object.entries(p))),h=g.next();!h.done;h=g.next()){var v=yt(h.value,2),m=v[0],y=v[1];c[m]=y}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(a=void 0,mt(Object.keys(p))),T=b.next();!T.done;T=b.next()){delete c[m=T.value]}}catch(e){a={error:e}}finally{try{T&&!T.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}break;case"$clearAll":c={}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return n.userProperties=c,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return vt({},this.identity)},e.prototype.setIdentity=function(e){var t=vt({},this.identity);this.identity=vt({},e),bt(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),kt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,St=function(){function e(){this.identityStore=new wt,this.eventBridge=new ht,this.applicationContextProvider=new pt}return e.getInstance=function(t){return kt.analyticsConnectorInstances||(kt.analyticsConnectorInstances={}),kt.analyticsConnectorInstances[t]||(kt.analyticsConnectorInstances[t]=new e),kt.analyticsConnectorInstances[t]},e}(),Et=function(e){return void 0===e&&(e=Te),St.getInstance(e)},_t=function(){function e(){this.name="identity",this.type="before",this.identityStore=Et().identityStore}return e.prototype.execute=function(e){return fe(this,void 0,void 0,(function(){var t;return pe(this,(function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return fe(this,void 0,void 0,(function(){return pe(this,(function(t){return e.instanceName&&(this.identityStore=Et(e.instanceName).identityStore),[2]}))}))},e}(),It=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},Pt=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[ye,t,e.substring(0,n)].filter(Boolean).join("_")},At=function(){var e,t,n,r;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(r=null!==(n=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==n?n:i)&&void 0!==r?r:""},Ot=function(){var e,t=Ke();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var n=t.split("=",2),r=Rt(n[0]),i=Rt(n[1]);return i?(e[r]=i,e):e}),{}):{}},Rt=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},xt=function(e,t){return!t||!t.length||t.some((function(t){return"string"==typeof t?e===t:e.match(t)}))},Ct=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n},Dt=function(e,t){var n=function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}(e.toString());return 31*Math.abs(n)%1e5/1e5<t},Lt=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return fe(this,void 0,void 0,(function(){return pe(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return fe(this,void 0,void 0,(function(){return pe(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return fe(this,void 0,void 0,(function(){var t;return pe(this,(function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return fe(this,void 0,void 0,(function(){return pe(this,(function(n){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return fe(this,void 0,void 0,(function(){return pe(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return fe(this,void 0,void 0,(function(){return pe(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),Nt=function(){function e(e){this.options=le({},e)}return e.prototype.isEnabled=function(){return fe(this,void 0,void 0,(function(){var t,n;return pe(this,(function(r){switch(r.label){case 0:if(!Ke())return[2,!1];e.testValue=String(Date.now()),t=new e(this.options),n="AMP_TEST",r.label=1;case 1:return r.trys.push([1,4,5,7]),[4,t.set(n,e.testValue)];case 2:return r.sent(),[4,t.get(n)];case 3:return[2,r.sent()===e.testValue];case 4:return r.sent(),[2,!1];case 5:return[4,t.remove(n)];case 6:return r.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){var t;return fe(this,void 0,void 0,(function(){var n,r;return pe(this,(function(i){switch(i.label){case 0:return[4,this.getRaw(e)];case 1:if(!(n=i.sent()))return[2,void 0];try{return void 0===(r=null!==(t=Ut(n))&&void 0!==t?t:jt(n))?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(n)),[2,void 0]):[2,JSON.parse(r)]}catch(t){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(n)),[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t,n;return fe(this,void 0,void 0,(function(){var r,i,o;return pe(this,(function(a){return r=Ke(),i=null!==(n=null===(t=null==r?void 0:r.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==n?n:[],o=i.find((function(t){return 0===t.indexOf(e+"=")})),o?[2,o.substring(e.length+1)]:[2,void 0]}))}))},e.prototype.set=function(e,t){var n;return fe(this,void 0,void 0,(function(){var r,i,o,a,s,c,u;return pe(this,(function(l){try{r=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,o=void 0,(i=null!==t?r:-1)&&((a=new Date).setTime(a.getTime()+24*i*60*60*1e3),o=a),s="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(s+="; expires=".concat(o.toUTCString())),s+="; path=/",this.options.domain&&(s+="; domain=".concat(this.options.domain)),this.options.secure&&(s+="; Secure"),this.options.sameSite&&(s+="; SameSite=".concat(this.options.sameSite)),(c=Ke())&&(c.document.cookie=s)}catch(t){u=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(u))}return[2]}))}))},e.prototype.remove=function(e){return fe(this,void 0,void 0,(function(){return pe(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return fe(this,void 0,void 0,(function(){return pe(this,(function(e){return[2]}))}))},e}(),Ut=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},jt=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},Mt=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[ye,t,e.substring(0,n)].filter(Boolean).join("_")},qt=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return fe(this,void 0,void 0,(function(){var t,n,r;return pe(this,(function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return fe(this,void 0,void 0,(function(){var t;return pe(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=n.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return fe(this,void 0,void 0,(function(){return pe(this,(function(n){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var n;return fe(this,void 0,void 0,(function(){return pe(this,(function(r){try{null===(n=this.storage)||void 0===n||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return fe(this,void 0,void 0,(function(){return pe(this,(function(n){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return fe(this,void 0,void 0,(function(){return pe(this,(function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]}))}))},e}(),Ft="tags",Bt="counters",$t="histograms",Kt="events",Ht="internal",zt="last_flush_timestamp",Vt=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return void 0!==(null===(e=Ke())||void 0===e?void 0:e.indexedDB)},e.prototype.getDB=function(){return fe(this,void 0,void 0,(function(){return pe(this,(function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]}))}))},e.prototype.openDB=function(){var e=this;return new Promise((function(t,n){var r=indexedDB.open(e.dbName,1);r.onerror=function(){e.dbPromise=null,n(new Error("Failed to open IndexedDB"))},r.onsuccess=function(){var n=r.result;n.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},n.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),n.close()},t(n)},r.onupgradeneeded=function(t){var n=t.target.result;e.createTables(n)}}))},e.prototype.createTables=function(e){(e.objectStoreNames.contains(Ft)||e.createObjectStore(Ft,{keyPath:"key"}),e.objectStoreNames.contains(Bt)||e.createObjectStore(Bt,{keyPath:"key"}),e.objectStoreNames.contains($t)||e.createObjectStore($t,{keyPath:"key"}),e.objectStoreNames.contains(Kt))||e.createObjectStore(Kt,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains(Ht)||e.createObjectStore(Ht,{keyPath:"key"})},e.prototype.setTags=function(e){return fe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return pe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=a.sent(),n=t.transaction([Ft],"readwrite"),r=n.objectStore(Ft),[2,new Promise((function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},i.forEach((function(e){var t=he(e,2),n=t[0],i=t[1];r.put({key:n,value:i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tag",n,i,e)}}))}))];case 2:return i=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",i),[3,3];case 3:return[2]}}))}))},e.prototype.incrementCounters=function(e){return fe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return pe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=a.sent(),n=t.transaction([Bt],"readwrite"),r=n.objectStore(Bt),[2,new Promise((function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},i.forEach((function(e){var t=he(e,2),n=t[0],i=t[1],a=r.get(n);a.onsuccess=function(){var e=a.result,t=e?e.value:0;r.put({key:n,value:t+i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to update counter",n,e)}},a.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing counter",n,e)}}))}))];case 2:return i=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",i),[3,3];case 3:return[2]}}))}))},e.prototype.setHistogramStats=function(e){return fe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return pe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=a.sent(),n=t.transaction([$t],"readwrite"),r=n.objectStore($t),[2,new Promise((function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),t()},i.forEach((function(e){var t=he(e,2),n=t[0],i=t[1],a=r.get(n);a.onsuccess=function(){var e,t=a.result;e=t?{key:n,count:t.count+i.count,min:Math.min(t.min,i.min),max:Math.max(t.max,i.max),sum:t.sum+i.sum}:{key:n,count:i.count,min:i.min,max:i.max,sum:i.sum},r.put(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",n,e)}},a.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",n,e)}}))}))];case 2:return i=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",i),[3,3];case 3:return[2]}}))}))},e.prototype.addEventRecords=function(e){return fe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return pe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),0===e.length?[2]:[4,this.getDB()];case 1:return t=a.sent(),n=t.transaction([Kt],"readwrite"),r=n.objectStore(Kt),[2,new Promise((function(t){n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event records",e),t()};var i=r.count();i.onsuccess=function(){var t=i.result,n=Math.max(0,10-t);n<e.length&&o.logger.debug("DiagnosticsStorage: Only added ".concat(n," of ").concat(e.length," events due to storage limit")),e.slice(0,n).forEach((function(e){r.add(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event record",e)}}))},i.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}}))];case 2:return i=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",i),[3,3];case 3:return[2]}}))}))},e.prototype.setInternal=function(e,t){return fe(this,void 0,void 0,(function(){var n,r,i,o;return pe(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=a.sent(),r=n.transaction([Ht],"readwrite"),i=r.objectStore(Ht),[2,new Promise((function(n,o){r.onabort=function(){return o(new Error("Failed to set internal value"))};var a=i.put({key:e,value:t});a.onsuccess=function(){return n()},a.onerror=function(){return o(new Error("Failed to set internal value"))}}))];case 2:return o=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",o),[3,3];case 3:return[2]}}))}))},e.prototype.getInternal=function(e){return fe(this,void 0,void 0,(function(){var t,n,r,i;return pe(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return t=o.sent(),n=t.transaction([Ht],"readonly"),r=n.objectStore(Ht),[2,new Promise((function(t,i){n.onabort=function(){return i(new Error("Failed to get internal value"))};var o=r.get(e);o.onsuccess=function(){return t(o.result)},o.onerror=function(){return i(new Error("Failed to get internal value"))}}))];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",i),[2,void 0];case 3:return[2]}}))}))},e.prototype.getLastFlushTimestamp=function(){return fe(this,void 0,void 0,(function(){var e,t;return pe(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(zt)];case 1:return[2,(e=n.sent())?parseInt(e.value,10):void 0];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}}))}))},e.prototype.setLastFlushTimestamp=function(e){return fe(this,void 0,void 0,(function(){var t;return pe(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(zt,e.toString())];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}}))}))},e.prototype.clearTable=function(e,t){return new Promise((function(n,r){var i=e.objectStore(t).clear();i.onsuccess=function(){return n()},i.onerror=function(){return r(new Error("Failed to clear table ".concat(t)))}}))},e.prototype.getAllAndClear=function(){return fe(this,void 0,void 0,(function(){var e,t,n,r,i,o,a,s;return pe(this,(function(c){switch(c.label){case 0:return c.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=c.sent(),t=e.transaction([Ft,Bt,$t,Kt],"readwrite"),[4,Promise.all([this.getAllFromStore(t,Ft),this.getAllFromStore(t,Bt),this.getAllFromStore(t,$t),this.getAllFromStore(t,Kt)])];case 2:return n=he.apply(void 0,[c.sent(),4]),r=n[0],i=n[1],o=n[2],a=n[3],[4,Promise.all([this.clearTable(t,Bt),this.clearTable(t,$t),this.clearTable(t,Kt)])];case 3:return c.sent(),[2,{tags:r,counters:i,histogramStats:o,events:a}];case 4:return s=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",s),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}}))}))},e.prototype.getAllFromStore=function(e,t){return new Promise((function(n,r){var i=e.objectStore(t).getAll();i.onsuccess=function(){return n(i.result)},i.onerror=function(){return r(new Error("Failed to get all from ".concat(t)))}}))},e}(),Gt=function(e){var t,n=null==(t=Ke())?void 0:t.__AMPLITUDE_SCRIPT_URL__;if(n)return e.filename&&e.filename.includes(n)?"filename":e.stack&&e.stack.includes(n)?"stack":void 0},Jt=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},Wt=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},Yt=3e5,Qt=1e4,Xt=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===n?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(r,null,2)),this.config=le({enabled:!0,sampleRate:0},r),this.startTimestamp=Date.now(),this.shouldTrack=Dt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Vt.isSupported()?this.storage=new Vt(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),function(e){var t=Ke();if(t&&"function"==typeof t.addEventListener){var n=function(t){e.recordEvent("sdk.error.uncaught",le({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",(function(e){var t=e.error instanceof Error?e.error:void 0,r=null==t?void 0:t.stack,i=Gt({filename:e.filename,stack:r});i&&n({type:"error",message:e.message,stack:r,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})}),!0),t.addEventListener("unhandledrejection",(function(e){var t,r=e.reason instanceof Error?e.reason:void 0,i=null==r?void 0:r.stack,o=Jt(i),a=Gt({filename:o,stack:i});a&&n({type:"unhandledrejection",message:null!==(t=null==r?void 0:r.message)&&void 0!==t?t:Wt(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:a}})}),!0)}}(this))}return e.prototype.isStorageAndTrackEnabled=function(){return Boolean(this.storage)&&Boolean(this.shouldTrack)},e.prototype.setTag=function(e,t){this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryTags).length>=Qt?this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit"):(this.inMemoryTags[e]=t,this.startTimersIfNeeded()))},e.prototype.increment=function(e,t){void 0===t&&(t=1),this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryCounters).length>=Qt?this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit"):(this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()))},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled())if(Object.keys(this.inMemoryHistograms).length>=Qt)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var n=this.inMemoryHistograms[e];n?(n.count+=1,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){this.isStorageAndTrackEnabled()&&(this.inMemoryEvents.length>=10?this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit"):(this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()))},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout((function(){e.saveAllDataToStorage().catch((function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)})).finally((function(){e.saveTimer=null}))}),1e3)),this.flushTimer||(this.flushTimer=setTimeout((function(){e._flush().catch((function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)})).finally((function(){e.flushTimer=null}))}),Yt))},e.prototype.saveAllDataToStorage=function(){return fe(this,void 0,void 0,(function(){var e,t,n,r;return pe(this,(function(i){switch(i.label){case 0:return this.storage?(e=le({},this.inMemoryTags),t=le({},this.inMemoryCounters),n=le({},this.inMemoryHistograms),r=ve([],he(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(n),this.storage.addEventRecords(r)])]):[2];case 1:return i.sent(),[2]}}))}))},e.prototype._flush=function(){return fe(this,void 0,void 0,(function(){var e,t,n,r,i,o,a,s,c,u;return pe(this,(function(l){switch(l.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return l.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=l.sent(),t=e.tags,n=e.counters,r=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach((function(e){o[e.key]=e.value})),a={},n.forEach((function(e){a[e.key]=e.value})),s={},r.forEach((function(e){s[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}})),c=i.map((function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}})),0===Object.keys(a).length&&0===Object.keys(s).length&&0===c.length?[2]:(u={tags:o,histogram:s,counters:a,events:c},this.fetch(u),[2])}}))}))},e.prototype.fetch=function(e){return fe(this,void 0,void 0,(function(){var t;return pe(this,(function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!Ke())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:return n.sent().ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return t=n.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}}))}))},e.prototype.initializeFlushInterval=function(){return fe(this,void 0,void 0,(function(){var e,t,n;return pe(this,(function(r){switch(r.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return-1===(t=r.sent()||-1)?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(Yt),[2]):(n=e-t)>=Yt?(this._flush(),[2]):(this._setFlushTimer(Yt-n),[2])}}))}))},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout((function(){t._flush().catch((function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)})).finally((function(){t.flushTimer=null}))}),e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=Dt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),Zt=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,n,r,i,o,a,s,c,u,l,d,f,p,g,h,v,m,y,b,T,w,k;if("object"!=typeof e)return null;var S=e.code||0,E=this.buildStatus(S);switch(E){case qe.Success:return{status:E,statusCode:S,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(n=e.payload_size_bytes)&&void 0!==n?n:0,serverUploadTime:null!==(r=e.server_upload_time)&&void 0!==r?r:0}};case qe.Invalid:return{status:E,statusCode:S,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(a=e.events_with_invalid_fields)&&void 0!==a?a:{},eventsWithMissingFields:null!==(s=e.events_with_missing_fields)&&void 0!==s?s:{},eventsWithInvalidIdLengths:null!==(c=e.events_with_invalid_id_lengths)&&void 0!==c?c:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(l=e.exceeded_daily_quota_devices)&&void 0!==l?l:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(f=e.silenced_events)&&void 0!==f?f:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(g=e.throttled_events)&&void 0!==g?g:[]}};case qe.PayloadTooLarge:return{status:E,statusCode:S,body:{error:null!==(h=e.error)&&void 0!==h?h:""}};case qe.RateLimit:return{status:E,statusCode:S,body:{error:null!==(v=e.error)&&void 0!==v?v:"",epsThreshold:null!==(m=e.eps_threshold)&&void 0!==m?m:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(T=e.exceeded_daily_quota_devices)&&void 0!==T?T:{},exceededDailyQuotaUsers:null!==(w=e.exceeded_daily_quota_users)&&void 0!==w?w:{},throttledEvents:null!==(k=e.throttled_events)&&void 0!==k?k:[]}};case qe.Timeout:default:return{status:E,statusCode:S}}},e.prototype.buildStatus=function(e){return ot(e)?qe.Success:429===e?qe.RateLimit:413===e?qe.PayloadTooLarge:408===e?qe.Timeout:e>=400&&e<500?qe.Invalid:e>=500?qe.Failed:qe.Unknown},e}(),en=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return se(t,e),t.prototype.send=function(e,t){return fe(this,void 0,void 0,(function(){var n,r,i;return pe(this,(function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return n={headers:{"Content-Type":"application/json",Accept:"*/*"},body:JSON.stringify(t),method:"POST"},[4,fetch(e,n)];case 1:return[4,(r=o.sent()).text()];case 2:i=o.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch(e){return[2,this.buildResponse({code:r.status})]}return[2]}}))}))},t}(Zt),tn=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var n=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),nn=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.apiKey=e,this.serverUrl=r||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new tn(e,t)}return e.prototype.subscribe=function(e,t,n){var r=ze(),i={id:r,key:e,deliveryMode:t,callback:n};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),r},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex((function(t){return t.id===e}));return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return fe(this,void 0,void 0,(function(){var e,t=this;return pe(this,(function(n){switch(n.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=n.sent(),this.storage.setConfig(e),this.callbackInfos.forEach((function(n){t.sendCallback(n,e,"remote")})),[2]}}))}))},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise||(this.fetchPromise=this.fetch().then((function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t})).finally((function(){e.fetchPromise=null}))),this.fetchPromise},e.prototype.subscribeAll=function(e){return fe(this,void 0,void 0,(function(){var t,n,r,i=this;return pe(this,(function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then((function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)})),n=this.storage.fetchConfig().then((function(e){return e})),[4,Promise.race([t,n])];case 1:return void 0!==(r=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(r))),null!==r.remoteConfig?this.sendCallback(e,r,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}}))}))},e.prototype.subscribeWaitForRemote=function(e,t){return fe(this,void 0,void 0,(function(){var n,r;return pe(this,(function(i){switch(i.label){case 0:n=new Promise((function(e,n){setTimeout((function(){n("Timeout exceeded")}),t)})),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),n])];case 2:return r=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,r,"remote"),this.storage.setConfig(r),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(r=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,r,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,r,"remote")),[3,5];case 5:return[2]}}))}))},e.prototype.sendCallback=function(e,t,n){var r;e.lastCallback=new Date,r=e.key?e.key.split(".").reduce((function(e,t){return null===e?e:t in e?e[t]:null}),t.remoteConfig):t.remoteConfig,e.callback(r,n,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),fe(this,void 0,void 0,(function(){var n,r,i,o,a,s,c=this;return pe(this,(function(u){switch(u.label){case 0:n=t/e,r={remoteConfig:null,lastFetch:new Date},i=function(r){var i,a,s,u,l;return pe(this,(function(d){switch(d.label){case 0:i=new AbortController,a=setTimeout((function(){return i.abort()}),t),d.label=1;case 1:return d.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:return(s=d.sent()).ok?[3,4]:[4,s.text()];case 3:return u=d.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(s.status,": ").concat(u)),[3,6];case 4:return[4,s.json()];case 5:return[2,{value:{remoteConfig:d.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(l=d.sent())instanceof Error&&"AbortError"===l.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),l),[3,9];case 8:return clearTimeout(a),[7];case 9:return r<e-1?[4,new Promise((function(e){return setTimeout(e,c.getJitterDelay(n))}))]:[3,11];case 10:d.sent(),d.label=11;case 11:return[2]}}))},o=this,a=0,u.label=1;case 1:return a<e?[5,i(a)]:[3,4];case 2:if("object"==typeof(s=u.sent()))return[2,s.value];u.label=3;case 3:return a++,[3,1];case 4:return[2,r]}}))}))},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(n.toString())},e.CONFIG_GROUP="browser",e}();!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(Tt||(Tt={}));var rn=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],on="data-amp-track-",an=["div","span","h1","h2","h3","h4","h5","h6"],sn=ve(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],he(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),cn=["*"];function un(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function ln(e,t,n){e&&dn({json:e,allowlist:t.map(fn),excludelist:n.map(fn),ancestors:[]})}function dn(e){var t,n,r=e.json,i=e.targetObject,o=e.allowlist,a=e.excludelist,s=e.ancestors,c=e.parentObject,u=e.targetKey;i||(i=r);var l=Object.keys(i);try{for(var d=ge(l),f=d.next();!f.done;f=d.next()){var p=f.value,g=ve(ve([],he(s),!1),[p],!1);un(i[p])?gn(g,o)&&!gn(g,a)||delete i[p]:dn({json:r,targetObject:i[p],allowlist:o,excludelist:a,ancestors:g,parentObject:i,targetKey:p})}}catch(e){t={error:e}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}0===Object.keys(i).length&&c&&u&&delete c[u]}function fn(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map((function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")}))}function pn(e,t,n,r){if(void 0===n&&(n=0),void 0===r&&(r=0),r===t.length)return n===e.length;if(n===e.length){for(;r<t.length&&"**"===t[r];)r++;return r===t.length}var i=t[r];if("**"===i){if(r+1===t.length)return!0;for(var o=n;o<=e.length;o++)if(pn(e,t,o,r+1))return!0;return!1}return("*"===i||i===e[n])&&pn(e,t,n+1,r+1)}function gn(e,t){return t.some((function(t){return pn(e,t)}))}var hn=function(){function e(e){this.request=e}return e.prototype.headers=function(e){var t,n;void 0===e&&(e=[]);var r=this.request.headers,i={};if(Array.isArray(r))r.forEach((function(e){var t=he(e,2),n=t[0],r=t[1];i[n]=r}));else if(r instanceof Headers)r.forEach((function(e,t){i[t]=e}));else if("object"==typeof r&&null!==r)try{for(var o=ge(Object.entries(r)),a=o.next();!a.done;a=o.next()){var s=he(a.value,2),c=s[0],u=s[1];i[c]=u}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return Sn(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=Ke();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=mn(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),fe(this,void 0,void 0,(function(){return pe(this,(function(n){return 0===e.length?[2,null]:[2,wn(this.body,e,t)]}))}))},e}(),vn=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),Sn(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return mn(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),fe(this,void 0,void 0,(function(){return pe(this,(function(n){return 0===e.length?[2,null]:[2,wn(this.body,e,t)]}))}))},e}();function mn(e,t){var n,r,i,o=Ke(),a=null==o?void 0:o.TextEncoder;if(a){var s;if("string"==typeof e)s=e,i=(new a).encode(s).length;else if(e instanceof Blob)i=(s=e).size;else if(e instanceof URLSearchParams)s=e,i=(new a).encode(s.toString()).length;else if(ArrayBuffer.isView(e))i=(s=e).byteLength;else if(e instanceof ArrayBuffer)i=(s=e).byteLength;else if(e instanceof FormData){var c=e,u=0,l=0;try{for(var d=ge(c.entries()),f=d.next();!f.done;f=d.next()){var p=he(f.value,2),g=p[0],h=p[1];if(u+=g.length,"string"==typeof h)u+=(new a).encode(h).length;else{if(!(h instanceof Blob))return;u+=h.size}if(++l>=t)return}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}i=u}else if(e instanceof ReadableStream)return void(s=e);return i}}var yn,bn=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var n=this.response.headers,r={};return null===(t=null==n?void 0:n.forEach)||void 0===t||t.call(n,(function(e,t){r[t]=e})),Sn(r,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var e,t;if(void 0!==this._bodySize)return this._bodySize;var n=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),r=n?parseInt(n,10):void 0;return this._bodySize=r,r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return fe(this,void 0,void 0,(function(){var e,t;return pe(this,(function(n){switch(n.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),n.label=1;case 1:return n.trys.push([1,3,,4]),e=this.clonedResponse.text(),t=new Promise((function(e){return setTimeout((function(){return e(null)}),500)})),[4,Promise.race([e,t])];case 2:return[2,n.sent()];case 3:return n.sent(),[2,null];case 4:return[2]}}))}))},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),fe(this,void 0,void 0,(function(){return pe(this,(function(n){switch(n.label){case 0:return 0===e.length?[2,null]:[4,this.text()];case 1:return[2,wn(n.sent(),e,t)]}}))}))},e}(),Tn=function(){function e(e,t,n,r){this.statusCode=e,this.headersString=t,this.size=n,this.getJson=r}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(e){var t,n;if(void 0===e&&(e=[]),!this.headersString)return{};var r={},i=this.headersString.split("\r\n");try{for(var o=ge(i),a=o.next();!a.done;a=o.next()){var s=he(a.value.split(": "),2),c=s[0],u=s[1];c&&u&&(r[c]=u)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return Sn(r,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),fe(this,void 0,void 0,(function(){var n;return pe(this,(function(r){return 0===e.length?[2,null]:(n=this.getJson())?(ln(n,e,t),[2,n]):[2,null]}))}))},e}();function wn(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return ln(r,t,n),r}catch(e){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(yn||(yn={}));var kn="[REDACTED]",Sn=function(e,t){var n,r,i=t.allow,o=void 0===i?[]:i,a=t.strategy,s=void 0===a?yn.REMOVE:a,c=ve([],he(Ne),!1),u={},l=function(t){var n=t.toLowerCase();c.find((function(e){return e.toLowerCase()===n}))?s===yn.REDACT&&(u[t]=kn):o.find((function(e){return e.toLowerCase()===n}))?u[t]=e[t]:s===yn.REDACT&&(u[t]=kn)};try{for(var d=ge(Object.keys(e)),f=d.next();!f.done;f=d.next()){l(f.value)}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return u},En=function(){function e(e,t,n,r,i,o,a,s,c,u,l){void 0===a&&(a=0),this.type=e,this.method=t,this.timestamp=n,this.startTime=r,this.url=i,this.requestWrapper=o,this.status=a,this.duration=s,this.responseWrapper=c,this.error=u,this.endTime=l}return e.prototype.toSerializable=function(){var e,t,n,r,i={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null===(e=this.requestWrapper)||void 0===e?void 0:e.headers(ve([],he(Le),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(n=this.responseWrapper)||void 0===n?void 0:n.headers(ve([],he(Le),!1)),responseBodySize:null===(r=this.responseWrapper)||void 0===r?void 0:r.bodySize};return Object.fromEntries(Object.entries(i).filter((function(e){var t=he(e,2);return t[0],void 0!==t[1]})))},e}();var _n=function(e,t){void 0===t&&(t=ze()),this.callback=e,this.id=t},In=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=Ke();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var e=Ke();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var n,r,i,o,a,s,c,u,l,d;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var f=null===(i=null===(r=null===(n=this.globalScope)||void 0===n?void 0:n.XMLHttpRequest)||void 0===r?void 0:r.prototype)||void 0===i?void 0:i.open,p=null===(s=null===(a=null===(o=this.globalScope)||void 0===o?void 0:o.XMLHttpRequest)||void 0===a?void 0:a.prototype)||void 0===s?void 0:s.send,g=null===(l=null===(u=null===(c=this.globalScope)||void 0===c?void 0:c.XMLHttpRequest)||void 0===u?void 0:u.prototype)||void 0===l?void 0:l.setRequestHeader;f&&p&&g&&this.observeXhr(f,p,g);var h=null===(d=this.globalScope)||void 0===d?void 0:d.fetch;h&&this.observeFetch(h),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach((function(n){var r;try{n.callback(e)}catch(e){null===(r=t.logger)||void 0===r||r.debug("an unexpected error occurred while triggering event callbacks",e)}}))},e.prototype.handleNetworkRequestEvent=function(e,t,n,r,i,o,a){var s;if(void 0!==o&&void 0!==a){var c,u,l,d="GET";if(!function(e){return"object"==typeof e&&null!==e&&"url"in e&&"method"in e}(t)?c=null===(s=null==t?void 0:t.toString)||void 0===s?void 0:s.call(t):(c=t.url,d=t.method),c)try{var f=new URL(c);c="".concat(f.protocol,"//").concat(f.host).concat(f.pathname).concat(f.search).concat(f.hash)}catch(e){}d=(null==n?void 0:n.method)||d,r&&(u=r.status),i&&(l={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},u=0);var p=Math.floor(performance.now()-a),g=Math.floor(o+p),h=new En(e,d,o,o,c,n,u,p,r,l,g);this.triggerEventCallbacks(h)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null===(e=Date.now)||void 0===e?void 0:e.call(Date),durationStart:null===(t=null===performance||void 0===performance?void 0:performance.now)||void 0===t?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(n,r){return fe(t,void 0,void 0,(function(){var t,i,o,a,s,c;return pe(this,(function(u){switch(u.label){case 0:try{t=this.getTimestamps()}catch(e){null===(s=this.logger)||void 0===s||s.debug("an unexpected error occurred while retrieving timestamps",e)}u.label=1;case 1:return u.trys.push([1,3,,4]),[4,e(n,r)];case 2:return i=u.sent(),[3,4];case 3:return a=u.sent(),o=a,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,r?new hn(r):void 0,i?new bn(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){null===(c=this.logger)||void 0===c||c.debug("an unexpected error occurred while handling fetch",e)}if(i)return[2,i];throw o}}))}))})},e.createXhrJsonParser=function(e,t){return function(){var n,r;try{if("json"===e.responseType){if(null===(n=t.globalScope)||void 0===n?void 0:n.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(n){return n instanceof Error&&"InvalidStateError"===n.name&&(null===(r=t.logger)||void 0===r||r.error("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))),null}return null}},e.prototype.observeXhr=function(t,n,r){if(this.globalScope&&t&&n){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var e,n,r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];var a=he(r,2),s=a[0],c=a[1];try{this.$$AmplitudeAnalyticsEvent=le({method:s,url:null===(e=null==c?void 0:c.toString)||void 0===e?void 0:e.call(c),headers:{}},o.getTimestamps())}catch(e){null===(n=o.logger)||void 0===n||n.error("an unexpected error occurred while calling xhr open",e)}return t.apply(this,r)},i.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,a=e.createXhrJsonParser(this,o),s=t[0],c=i.$$AmplitudeAnalyticsEvent;return i.addEventListener("loadend",(function(){var e;try{var t=i.getAllResponseHeaders(),n=i.getResponseHeader("content-length"),r=new Tn(i.status,t,n?parseInt(n,10):void 0,a),u=i.$$AmplitudeAnalyticsEvent.headers,l=new vn(s,u);c.status=i.status,o.handleNetworkRequestEvent("xhr",{url:c.url,method:c.method},l,r,void 0,c.startTime,c.durationStart)}catch(t){null===(e=o.logger)||void 0===e||e.error("an unexpected error occurred while handling xhr send",t)}})),n.apply(i,t)},i.setRequestHeader=function(e,t){var n;try{this.$$AmplitudeAnalyticsEvent.headers[e]=t}catch(e){null===(n=o.logger)||void 0===n||n.error("an unexpected error occurred while calling xhr setRequestHeader",e)}r.apply(this,[e,t])}}},e}(),Pn=new In,An=function(){function e(){}return e.prototype.parse=function(){return fe(this,void 0,void 0,(function(){return pe(this,(function(e){return[2,le(le(le(le({},De),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=Ot();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=Ot();return(e={})[ke]=t[ke],e[Se]=t[Se],e[Ee]=t[Ee],e[_e]=t[_e],e[Ie]=t[Ie],e[Pe]=t[Pe],e[Ae]=t[Ae],e[Oe]=t[Oe],e[Re]=t[Re],e[xe]=t[xe],e[Ce]=t[Ce],e},e}(),On="data-amp-mask",Rn="*****",xn=/\b(?:\d[ -]*?){13,16}\b/,Cn=/(\d{3}-?\d{2}-?\d{4})/g,Dn=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Ln=function(e,t){var n,r;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var i=e;i=(i=(i=i.replace(xn,Rn)).replace(Cn,Rn)).replace(Dn,Rn);try{for(var o=ge(t),a=o.next();!a.done;a=o.next()){var s=a.value;try{i=i.replace(s,Rn)}catch(e){}}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},Nn=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(On)?Rn:e?e(document.title):document.title};function Un(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return jn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jn(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Mn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function qn(e,t,n){return t&&Mn(e.prototype,t),n&&Mn(e,n),e}var Fn=function(){return"function"==typeof Symbol},Bn=function(e){return Fn()&&Boolean(Symbol[e])},$n=function(e){return Bn(e)?Symbol[e]:"@@"+e};Fn()&&!Bn("observable")&&(Symbol.observable=Symbol("observable"));var Kn=$n("iterator"),Hn=$n("observable"),zn=$n("species");function Vn(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function Gn(e){var t=e.constructor;return void 0!==t&&null===(t=t[zn])&&(t=void 0),void 0!==t?t:rr}function Jn(e){return e instanceof rr}function Wn(e){Wn.log?Wn.log(e):setTimeout((function(){throw e}))}function Yn(e){Promise.resolve().then((function(){try{e()}catch(e){Wn(e)}}))}function Qn(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=Vn(t,"unsubscribe");n&&n.call(t)}}catch(e){Wn(e)}}function Xn(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function Zn(e,t,n){e._state="running";var r=e._observer;try{var i=Vn(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(Xn(e),!i)throw n;i.call(r,n);break;case"complete":Xn(e),i&&i.call(r)}}catch(e){Wn(e)}"closed"===e._state?Qn(e):"running"===e._state&&(e._state="ready")}function er(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void Yn((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(Zn(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void Zn(e,t,n);e._queue.push({type:t,value:n})}}var tr=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new nr(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(Xn(this),Qn(this))},qn(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),nr=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){er(this._subscription,"next",e)},t.error=function(e){er(this._subscription,"error",e)},t.complete=function(){er(this._subscription,"complete")},qn(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),rr=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new tr(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),n()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(Gn(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(Gn(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=Gn(this),r=arguments.length>1,i=!1,o=arguments[1];return new n((function(n){return t.subscribe({next:function(t){var a=!i;if(i=!0,!a||r)try{o=e(o,t)}catch(e){return n.error(e)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=Gn(this);return new i((function(t){var r,o=0;return function e(a){r=a.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===n.length?(r=void 0,t.complete()):e(i.from(n[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=Gn(this);return new n((function(r){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var o=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),a()}});i.push(o)},error:function(e){r.error(e)},complete:function(){a()}});function a(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[Hn]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=Vn(t,Hn);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return Jn(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(Bn("iterator")&&(r=Vn(t,Kn)))return new n((function(e){Yn((function(){if(!e.closed){for(var n,i=Un(r.call(t));!(n=i()).done;){var o=n.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){Yn((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new("function"==typeof this?this:e)((function(e){Yn((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},qn(e,null,[{key:zn,get:function(){return this}}]),e}();function ir(e,t){return new rr((function(n){e.subscribe({next:function(e){t(e).then((function(e){return n.next(e)})).catch((function(e){return n.error(e)}))},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}function or(e,t){return new rr((function(n){var r=!1,i=new Set,o=function(){var e,t;r=!0;try{for(var n=ge(i),o=n.next();!o.done;o=n.next()){var a=o.value;try{a.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}i.clear()},a=function(e){var t=e.subscribe({next:function(e){r||n.next(e)},error:function(e){r||(r=!0,n.error(e),o())},complete:function(){i.delete(t),r||0!==i.size||(n.complete(),o(),r=!0)}});i.add(t)};return a(e),a(t),o}))}function ar(e){var t=new Set,n=null;function r(){null==n||n.unsubscribe(),n=null,t.clear()}return new rr((function(i){return t.add(i),null===n&&(n=e.subscribe({next:function(e){var n,r,i;try{for(var o=ge(t),a=o.next();!a.done;a=o.next()){var s=a.value;null===(i=s.next)||void 0===i||i.call(s,e)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},error:function(e){var n,i,o;try{for(var a=ge(t),s=a.next();!s.done;s=a.next()){var c=s.value;null===(o=c.error)||void 0===o||o.call(c,e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(n)throw n.error}}r()},complete:function(){var e,n,i;try{for(var o=ge(t),a=o.next();!a.done;a=o.next()){var s=a.value;null===(i=s.complete)||void 0===i||i.call(s)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}r()}})),function(){t.delete(i),0===t.size&&n&&(n.unsubscribe(),n=null)}}))}Fn()&&Object.defineProperty(rr,Symbol("extensions"),{value:{symbol:Hn,hostReportError:Wn},configurable:!0});var sr=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},cr=function(e){return sr(e,"attribution")},ur=function(e){return sr(e,"pageViews")},lr=function(e){return sr(e,"sessions")},dr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},fr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},pr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},gr=function(e){if(fr(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},hr=function(e){if(pr(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},vr=function(e){var t;if(dr(e.autocapture)){var n=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?n=e.autocapture.networkTracking:e.networkTrackingOptions&&(n=e.networkTrackingOptions),le(le({},n),{captureRules:null===(t=null==n?void 0:n.captureRules)||void 0===t?void 0:t.map((function(t){var n,r,i;if((null===(n=t.urls)||void 0===n?void 0:n.length)&&(null===(r=t.hosts)||void 0===r?void 0:r.length)){var o=JSON.stringify(t.hosts),a=JSON.stringify(t.urls);return null===(i=e.loggerProvider)||void 0===i||i.warn("Found network capture rule with both urls='".concat(a,"' and hosts='").concat(o,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),le(le({},t),{hosts:void 0})}return t}))})}},mr=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return ur(e.defaultTracking)&&(n=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:t,pageCounter:i}},yr=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,a=r.resolve,s=e&&e[i];if("function"==typeof s){var c=s.apply(e,o);"function"==typeof a&&a(null==c?void 0:c.promise)}}return e},br=function(e){return e&&void 0!==e._q},Tr="2.32.2",wr="amplitude-ts",kr=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(wr,"/").concat(Tr),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,n;return fe(this,void 0,void 0,(function(){var r,i,o;return pe(this,(function(a){return r=(new Date).getTime(),i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,o=null!==(n=e.event_id)&&void 0!==n?n:i+1,this.config.lastEventId=o,e.time||(this.config.lastEventTime=r),[2,le(le(le(le(le(le(le(le({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:r},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:At()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:ze(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:o,library:this.library,user_agent:this.userAgent})]}))}))},e}(),Sr=1e3,Er=function(e){function t(t){var n,r,i,o=this;try{i=null===(n=Ke())||void 0===n?void 0:n.localStorage}catch(e){null===(r=null==t?void 0:t.loggerProvider)||void 0===r||r.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return se(t,e),t.prototype.set=function(t,n){var r;return fe(this,void 0,void 0,(function(){var i;return pe(this,(function(o){switch(o.label){case 0:return Array.isArray(n)&&n.length>Sr?(i=n.length-Sr,[4,e.prototype.set.call(this,t,n.slice(0,Sr))]):[3,2];case 1:return o.sent(),null===(r=this.loggerProvider)||void 0===r||r.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(Sr,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},t}(qt),_r=function(e){function t(){var t;return e.call(this,null===(t=Ke())||void 0===t?void 0:t.sessionStorage)||this}return se(t,e),t}(qt),Ir=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.state={done:4},t}return se(t,e),t.prototype.send=function(e,t){return fe(this,void 0,void 0,(function(){var n=this;return pe(this,(function(r){return[2,new Promise((function(r,i){"undefined"==typeof XMLHttpRequest&&i(new Error("XHRTransport is not supported."));var o=new XMLHttpRequest;o.open("POST",e,!0),o.onreadystatechange=function(){if(o.readyState===n.state.done){var e=o.responseText;try{r(n.buildResponse(JSON.parse(e)))}catch(e){r(n.buildResponse({code:o.status}))}}},o.setRequestHeader("Content-Type","application/json"),o.setRequestHeader("Accept","*/*"),o.send(JSON.stringify(t))}))]}))}))},t}(Zt),Pr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return se(t,e),t.prototype.send=function(e,t){return fe(this,void 0,void 0,(function(){var n=this;return pe(this,(function(r){return[2,new Promise((function(r,i){var o=Ke();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var a=JSON.stringify(t);return r(o.navigator.sendBeacon(e,JSON.stringify(t))?n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:a.length,server_upload_time:Date.now()}):n.buildResponse({code:500}))}catch(e){i(e)}}))]}))}))},t}(Zt),Ar=function(e,t,n){return void 0===n&&(n=!0),fe(void 0,void 0,void 0,(function(){var r,i,o,a,s,c,u,l,d;return pe(this,(function(f){switch(f.label){case 0:return r=function(e){return"".concat(ye.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,t.getRaw(r)];case 1:return(i=f.sent())?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:f.sent(),f.label=3;case 3:return o=he(i.split("."),6),a=o[0],s=o[1],c=o[2],u=o[3],l=o[4],d=o[5],[2,{deviceId:a,userId:Rr(s),sessionId:Or(u),lastEventId:Or(d),lastEventTime:Or(l),optOut:Boolean(c)}]}}))}))},Or=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},Rr=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},xr="[Amplitude]",Cr="".concat(xr," Form Started"),Dr="".concat(xr," Form Submitted"),Lr="".concat(xr," File Downloaded"),Nr="session_start",Ur="session_end",jr="".concat(xr," File Extension"),Mr="".concat(xr," File Name"),qr="".concat(xr," Link ID"),Fr="".concat(xr," Link Text"),Br="".concat(xr," Link URL"),$r="".concat(xr," Form ID"),Kr="".concat(xr," Form Name"),Hr="".concat(xr," Form Destination"),zr="cookie",Vr=function(e){function t(t,n,r,i,o,a,s,c,u,l,d,f,p,g,h,v,m,y,b,T,w,k,S,E,_,I,P,A,O,R,x,C,D,L,N,U,j,M,q,F){void 0===r&&(r=new Lt),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===c&&(c=1e3),void 0===u&&(u=5),void 0===l&&(l=30),void 0===d&&(d=zr),void 0===v&&(v=new Ze),void 0===m&&(m=Qe.Warn),void 0===b&&(b=!1),void 0===T&&(T=!1),void 0===S&&(S=""),void 0===E&&(E="US"),void 0===I&&(I=18e5),void 0===P&&(P=new Er({loggerProvider:v})),void 0===A&&(A={ipAddress:!0,language:!0,platform:!0}),void 0===O&&(O="fetch"),void 0===R&&(R=!1),void 0===x&&(x=!0),void 0===j&&(j=!0),void 0===M&&(M=0);var B,$=e.call(this,{apiKey:t,storageProvider:P,transportProvider:Wr(O)})||this;return $.apiKey=t,$.appVersion=n,$.cookieOptions=i,$.defaultTracking=o,$.autocapture=a,$.flushIntervalMillis=c,$.flushMaxRetries=u,$.flushQueueSize=l,$.identityStorage=d,$.ingestionMetadata=f,$.instanceName=p,$.loggerProvider=v,$.logLevel=m,$.minIdLength=y,$.offline=b,$.partnerId=w,$.plan=k,$.serverUrl=S,$.serverZone=E,$.sessionTimeout=I,$.storageProvider=P,$.trackingOptions=A,$.transport=O,$.useBatch=R,$.fetchRemoteConfig=x,$.networkTrackingOptions=N,$.identify=U,$.enableDiagnostics=j,$.diagnosticsSampleRate=M,$.diagnosticsClient=q,$.remoteConfig=F,$.version=Tr,$._optOut=!1,$._cookieStorage=r,$.deviceId=s,$.lastEventId=g,$.lastEventTime=h,$.optOut=T,$.sessionId=_,$.pageCounter=D,$.userId=C,$.debugLogsEnabled=L,$.loggerProvider.enable(L?Qe.Debug:$.logLevel),$.networkTrackingOptions=N,$.identify=U,$.enableDiagnostics=j,$.diagnosticsSampleRate=M,$.diagnosticsClient=q,B=!0===(null==F?void 0:F.fetchRemoteConfig)||!1!==(null==F?void 0:F.fetchRemoteConfig)&&!1!==x,$.remoteConfig=$.remoteConfig||{},$.remoteConfig.fetchRemoteConfig=B,$.fetchRemoteConfig=B,$}return se(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled};this.cookieStorage.set(Pt(this.apiKey),e)},t}(tt),Gr=function(e,t,n){return void 0===t&&(t={}),fe(void 0,void 0,void 0,(function(){var r,i,o,a,s,c,u,l,d,f,p,g,h,v,m,y,b,T,w,k,S,E,_,I,P,A,O,R,x,C,D,L,N,U,j,M,q,F,B,$,K,H,z,V,G;return pe(this,(function(J){switch(J.label){case 0:return r=t.identityStorage||zr,S={},r===zr?[3,1]:(o="",[3,5]);case 1:return null===(_=null===(E=t.cookieOptions)||void 0===E?void 0:E.domain)||void 0===_?[3,2]:(a=_,[3,4]);case 2:return[4,Yr()];case 3:a=J.sent(),J.label=4;case 4:o=a,J.label=5;case 5:return i=le.apply(void 0,[(S.domain=o,S.expiration=365,S.sameSite="Lax",S.secure=!1,S.upgrade=!0,S),t.cookieOptions]),s=Jr(t.identityStorage,i),[4,Ar(e,s,null===(P=null===(I=t.cookieOptions)||void 0===I?void 0:I.upgrade)||void 0===P||P)];case 6:return c=J.sent(),[4,s.get(Pt(e))];case 7:return u=J.sent(),l=Ot(),d=l.ampTimestamp?Number(l.ampTimestamp):void 0,f=!d||Date.now()<d,p=null!==(C=null!==(x=null!==(R=null!==(A=t.deviceId)&&void 0!==A?A:f?null!==(O=l.ampDeviceId)&&void 0!==O?O:l.deviceId:void 0)&&void 0!==R?R:null==u?void 0:u.deviceId)&&void 0!==x?x:c.deviceId)&&void 0!==C?C:ze(),g=null!==(D=null==u?void 0:u.lastEventId)&&void 0!==D?D:c.lastEventId,h=null!==(L=null==u?void 0:u.lastEventTime)&&void 0!==L?L:c.lastEventTime,v=null!==(U=null!==(N=t.optOut)&&void 0!==N?N:null==u?void 0:u.optOut)&&void 0!==U?U:c.optOut,m=null!==(j=null==u?void 0:u.sessionId)&&void 0!==j?j:c.sessionId,y=null!==(q=null!==(M=t.userId)&&void 0!==M?M:null==u?void 0:u.userId)&&void 0!==q?q:c.userId,n.previousSessionDeviceId=null!==(F=null==u?void 0:u.deviceId)&&void 0!==F?F:c.deviceId,n.previousSessionUserId=null!==(B=null==u?void 0:u.userId)&&void 0!==B?B:c.userId,b={ipAddress:null===(K=null===($=t.trackingOptions)||void 0===$?void 0:$.ipAddress)||void 0===K||K,language:null===(z=null===(H=t.trackingOptions)||void 0===H?void 0:H.language)||void 0===z||z,platform:null===(G=null===(V=t.trackingOptions)||void 0===V?void 0:V.platform)||void 0===G||G},T=null==u?void 0:u.pageCounter,w=null==u?void 0:u.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(k=new Vr(e,t.appVersion,s,i,t.defaultTracking,t.autocapture,p,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,r,t.ingestionMetadata,t.instanceName,g,h,t.loggerProvider,t.logLevel,t.minIdLength,t.offline,v,t.partnerId,t.plan,t.serverUrl,t.serverZone,m,t.sessionTimeout,t.storageProvider,b,t.transport,t.useBatch,t.fetchRemoteConfig,y,T,w,t.networkTrackingOptions,t.identify,t.enableDiagnostics,n._diagnosticsSampleRate,void 0,t.remoteConfig)).storageProvider.isEnabled()];case 8:return J.sent()||(k.loggerProvider.warn("Storage provider ".concat(k.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),k.storageProvider=new Lt),[2,k]}}))}))},Jr=function(e,t){switch(void 0===e&&(e=zr),void 0===t&&(t={}),e){case"localStorage":return new Er;case"sessionStorage":return new _r;case"none":return new Lt;default:return new Nt(le(le({},t),{expirationDays:t.expiration}))}},Wr=function(e){return"xhr"===e?new Ir:"beacon"===e?new Pr:new en},Yr=function(e){return fe(void 0,void 0,void 0,(function(){var e,t,n,r,i,o,a;return pe(this,(function(s){switch(s.label){case 0:return[4,(new Nt).isEnabled()];case 1:if(!s.sent()||"undefined"==typeof location||!location.hostname)return[2,""];for(e=location.hostname,t=e.split("."),n=[],r="AMP_TLDTEST",i=t.length-2;i>=0;--i)n.push(t.slice(i).join("."));i=0,s.label=2;case 2:return i<n.length?(o=n[i],[4,(a=new Nt({domain:"."+o})).set(r,1)]):[3,7];case 3:return s.sent(),[4,a.get(r)];case 4:return s.sent()?[4,a.remove(r)]:[3,6];case 5:return s.sent(),[2,"."+o];case 6:return i++,[3,2];case 7:return[2,""]}}))}))},Qr=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},Xr=function(e){var t;void 0===e&&(e={});var n,r=Ke(),i=void 0,o=!1,a=e.trackOn,s=e.trackHistoryChanges,c=e.eventType,u=void 0===c?"[Amplitude] Page Viewed":c,l=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==i||i.error("Malformed URI sequence: ",e)}return t},d=function(){return fe(void 0,void 0,void 0,(function(){var e,t,n;return pe(this,(function(r){switch(r.label){case 0:return e=l("undefined"!=typeof location&&location.href||""),n={event_type:u},t=[{}],[4,Zr()];case 1:return[2,(n.event_properties=le.apply(void 0,[le.apply(void 0,t.concat([r.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"undefined"!=typeof location&&l(location.pathname)||"","[Amplitude] Page Title":Nn(Ln),"[Amplitude] Page URL":e.split("?")[0]}]),n)]}}))}))},f=function(){return void 0===a||"function"==typeof a&&a()},p="undefined"!=typeof location?location.href:null,g=function(){return fe(void 0,void 0,void 0,(function(){var e,n,r,o;return pe(this,(function(a){switch(a.label){case 0:return e=location.href,n=ti(s,e,p||"")&&f(),p=e,n?(null==i||i.log("Tracking page view event"),null!=t?[3,1]:[3,3]):[3,4];case 1:return o=(r=t).track,[4,d()];case 2:o.apply(r,[a.sent()]),a.label=3;case 3:a.label=4;case 4:return[2]}}))}))},h=function(){g()},v={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,a){return fe(void 0,void 0,void 0,(function(){var s,c;return pe(this,(function(u){switch(u.label){case 0:return t=a,n=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),o=!0,r&&(r.addEventListener("popstate",h),r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=he(n,3),i=r[0],a=r[1],s=r[2];e.apply(t,[i,a,s]),o&&g()}})),f()?(i.log("Tracking page view event"),c=(s=t).track,[4,d()]):[3,2];case 1:c.apply(s,[u.sent()]),u.label=2;case 2:return[2]}}))}))},execute:function(e){return fe(void 0,void 0,void 0,(function(){var t;return pe(this,(function(r){switch(r.label){case 0:return"attribution"===a&&ei(e)?(null==i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,d()]):[3,2];case 1:t=r.sent(),e.event_type=t.event_type,e.event_properties=le(le({},e.event_properties),t.event_properties),r.label=2;case 2:return n&&e.event_type===u&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=le(le({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}}))}))},teardown:function(){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(e){return r&&(r.removeEventListener("popstate",h),o=!1),[2]}))}))}};return v},Zr=function(){return fe(void 0,void 0,void 0,(function(){var e;return pe(this,(function(t){switch(t.label){case 0:return e=Qr,[4,(new An).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},ei=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[ce.SET]||{},r=t[ce.UNSET]||{},i=ve(ve([],he(Object.keys(n)),!1),he(Object.keys(r)),!1);return Object.keys(De).every((function(e){return i.includes(e)}))}return!1},ti=function(e,t,n){if("pathOnly"===e){if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname}return t!==n},ni=function(){var e,t=[],n=function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(t,r){return fe(void 0,void 0,void 0,(function(){var i,o;return pe(this,(function(a){return i=function(){if(r){if("undefined"!=typeof document){var i=function(e){var t=!1;n(e,"change",(function(){var n,i=ii(e);t||r.track(Cr,((n={})[$r]=ri(e.id),n[Kr]=ri(e.name),n[Hr]=i,n)),t=!0})),n(e,"submit",(function(){var n,i,o=ii(e);t||r.track(Cr,((n={})[$r]=ri(e.id),n[Kr]=ri(e.name),n[Hr]=o,n)),r.track(Dr,((i={})[$r]=ri(e.id),i[Kr]=ri(e.name),i[Hr]=o,i)),t=!1}))};Array.from(document.getElementsByTagName("form")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"FORM"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(i)}))}))}))).observe(document.body,{subtree:!0,childList:!0})}}else t.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?i():(o=Ke())?o.addEventListener("load",i):t.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(t){return[2,e]}))}))},teardown:function(){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(n){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)})),t=[],[2]}))}))}}},ri=function(e){if("string"==typeof e)return e},ii=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},oi=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(n,r){return fe(void 0,void 0,void 0,(function(){var i,o;return pe(this,(function(a){return i=function(){if(r){if("undefined"!=typeof document){var i=function(e){var n;try{n=new URL(e.href,window.location.href)}catch(e){return}var i=o.exec(n.href),a=null==i?void 0:i[1];a&&function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})}(e,"click",(function(){var t;a&&r.track(Lr,((t={})[jr]=a,t[Mr]=n.pathname,t[qr]=e.id,t[Fr]=e.text,t[Br]=e.href,t))}))},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)}))}))}))).observe(document.body,{subtree:!0,childList:!0})}}else n.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")},"complete"===document.readyState?i():(o=Ke())?o.addEventListener("load",i):n.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(t){return[2,e]}))}))},teardown:function(){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(n){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)})),t=[],[2]}))}))}}},ai=!1,si=function(){var e=Ke(),t=[],n=function(n,r){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(n,r),t.push({type:n,handler:r}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(r){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1,[2]):(e.offline=!navigator.onLine,n("online",(function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout((function(){t.flush()}),e.flushIntervalMillis)})),n("offline",(function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2])}))}))},teardown:function(){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(n){return t.forEach((function(t){var n=t.type,r=t.handler;null==e||e.removeEventListener(n,r)})),t=[],[2]}))}))}}};function ci(e){var t,n,r,i,o,a,s,c,u,l,d;if("object"==typeof e&&null!==e&&!Array.isArray(e)){var f=Object.keys(e);try{for(var p=ge(f),g=p.next();!g.done;g=p.next()){var h=g.value;try{var v=e[h];"boolean"==typeof(null==v?void 0:v.enabled)&&(v.enabled?(delete v.enabled,0===Object.keys(v).length&&(e[h]=!0)):e[h]=!1),ci(v)}catch(e){}}}catch(e){t={error:e}}finally{try{g&&!g.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}try{if(null===(u=null===(c=null===(s=e.autocapture)||void 0===s?void 0:s.networkTracking)||void 0===c?void 0:c.captureRules)||void 0===u?void 0:u.length)try{for(var m=ge(e.autocapture.networkTracking.captureRules),y=m.next();!y.done;y=m.next()){var b=y.value;try{for(var T=(o=void 0,ge(["responseHeaders","requestHeaders"])),w=T.next();!w.done;w=T.next()){var k=w.value,S=null!==(l=b[k])&&void 0!==l?l:{},E=S.captureSafeHeaders,_=S.allowlist;(E||_)&&(void 0===_||Array.isArray(_)?b[k]=ve(ve([],he(E?Le:[]),!1),he(null!=_?_:[]),!1):delete b[k])}}catch(e){o={error:e}}finally{try{w&&!w.done&&(a=T.return)&&a.call(T)}finally{if(o)throw o.error}}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}}catch(e){}var I=null===(d=e.autocapture)||void 0===d?void 0:d.frustrationInteractions;I&&(I.rageClick&&(I.rageClicks=I.rageClick,delete I.rageClick),I.deadClick&&(I.deadClicks=I.deadClick,delete I.deadClick))}}function ui(e,t,n){var r,i,o=[];try{for(var a=ge(null!=t?t:[]),s=a.next();!s.done;s=a.next()){var c=s.value;try{o.push(new RegExp(c))}catch(e){n.loggerProvider.warn("Invalid regex pattern: ".concat(c),e)}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return e.concat(o)}function li(e,t){var n,r,i,o,a,s,c;if(e){ci(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var u=e;if(u&&"autocapture"in u){if("boolean"==typeof u.autocapture&&(t.autocapture=u.autocapture),"object"==typeof u.autocapture&&null!==u.autocapture){var l=le({},u.autocapture);if(void 0===t.autocapture&&(t.autocapture=u.autocapture),"object"==typeof u.autocapture.elementInteractions&&null!==u.autocapture.elementInteractions&&(null===(i=u.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===i?void 0:i.length)){l.elementInteractions=le({},u.autocapture.elementInteractions);var d=l.elementInteractions,f=null!==(o=d.pageUrlAllowlist)&&void 0!==o?o:[],p=u.autocapture.elementInteractions.pageUrlAllowlistRegex;d.pageUrlAllowlist=ui(f,p,t),delete d.pageUrlAllowlistRegex}if("object"==typeof u.autocapture.networkTracking&&null!==u.autocapture.networkTracking&&(null===(a=u.autocapture.networkTracking.captureRules)||void 0===a?void 0:a.length)){l.networkTracking=le({},u.autocapture.networkTracking);var g=null!==(s=l.networkTracking.captureRules)&&void 0!==s?s:[];try{for(var h=ge(g),v=h.next();!v.done;v=h.next()){var m=v.value;m.urls=ui(null!==(c=m.urls)&&void 0!==c?c:[],m.urlsRegex,t),delete m.urlsRegex}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=le({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},l)),"object"==typeof t.autocapture&&(t.autocapture=le(le({},t.autocapture),l))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}var di="1.18.2",fi="[Amplitude] Element Clicked",pi="[Amplitude] Element Tag",gi="[Amplitude] Element Text",hi="[Amplitude] Page URL",vi="https://app.amplitude.com",mi={US:vi,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"},yi="data-amp-mask-attributes",bi=["input","select","textarea"],Ti=function(e,t){var n,r=null===(n=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===n?void 0:n.call(window,e);return"pointer"===(null==r?void 0:r.getPropertyValue("cursor"))&&"click"===t},wi=function(e,t,n){return void 0===n&&(n=!1),function(r,i){var o,a,s=e.pageUrlAllowlist,c=e.pageUrlExcludelist,u=e.shouldTrackEventResolver,l=null===(a=null===(o=null==i?void 0:i.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===a?void 0:a.call(o);if(!l)return!1;if(u)return u(r,i);if(!xt(window.location.href,s))return!1;if(c&&c.length>0&&xt(window.location.href,c))return!1;var d=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof d)switch(d.toLowerCase()){case"hidden":case"password":return!1}var f=Ti(i,r);if(n&&f)return!0;if(t){var p=t.some((function(e){var t;return!!(null===(t=null==i?void 0:i.matches)||void 0===t?void 0:t.call(i,e))}));if(!p)return!1}switch(l){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:return!!f||"click"===r}}},ki=function(e){return Object.keys(e).reduce((function(t,n){var r=e[n];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(r)||(t[n]=r),t}),{})},Si=function(e,t){return e?t.some((function(t){var n;return null===(n=null==e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)}))?e:Si(null==e?void 0:e.parentElement,t):null};var Ei=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};var _i=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",yi,On]),Ii=["type"],Pi=["svg","path","g"],Ai=["password","hidden"];function Oi(e,t){var n,r,i,o,a,s;if(null===e)return null;var c=String(e.tagName).toLowerCase(),u={tag:c},l=Array.from(null!==(o=null===(i=e.parentElement)||void 0===i?void 0:i.children)&&void 0!==o?o:[]);l.length&&(u.index=l.indexOf(e),u.indexOfType=l.filter((function(t){return t.tagName===e.tagName})).indexOf(e));var d=null===(s=null===(a=e.previousElementSibling)||void 0===a?void 0:a.tagName)||void 0===s?void 0:s.toLowerCase();d&&(u.prevSib=String(d));var f=e.getAttribute("id");f&&(u.id=String(f));var p=Array.from(e.classList);p.length&&(u.classes=p);var g={},h=Array.from(e.attributes).filter((function(e){return!_i.has(e.name)})),v=!function(e){var t,n,r,i=null===(n=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t),o=e instanceof HTMLElement&&"true"===(null===(r=e.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!bi.includes(i)&&!o}(e);if(!Ai.includes(String(e.getAttribute("type")))&&!Pi.includes(c))try{for(var m=ge(h),y=m.next();!y.done;y=m.next()){var b=y.value;v&&!Ii.includes(b.name)||(t.has(b.name)?g[b.name]=Rn:g[b.name]=String(b.value).substring(0,128))}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}return Object.keys(g).length&&(u.attrs=g),u}var Ri=function(e,t,n){e.forEach((function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=n.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}}))},xi=function(e,t){var n,r,i,o=this;this.replaceSensitiveString=function(e){return Ln(e,o.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,n,r,i,a,s=performance.now();if(!e)return[];for(var c,u=function(e){var t=[];if(!e)return t;t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e),l=new Map,d=u.length-1;d>=0;d--){var f=u[d];if(f){var p=(c=f.getAttribute(yi))?c.split(",").map((function(e){return e.trim()})).filter((function(e){return e.length>0&&"id"!==e&&"class"!==e})):[],g=d===u.length-1?[]:null!==(r=l.get(u[d+1]))&&void 0!==r?r:new Set,h=new Set(ve(ve([],he(g),!1),he(p),!1));l.set(f,h)}}a=u.map((function(e){var t;return Oi(e,null!==(t=l.get(e))&&void 0!==t?t:new Set)}));var v=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach((function(t){var n=he(t,2),r=n[0],i=n[1];e.attrs&&(e.attrs[r]=o.replaceSensitiveString(i))}))};try{for(var m=ge(a),y=m.next();!y.done;y=m.next())v(y.value)}catch(e){t={error:e}}finally{try{y&&!y.done&&(n=m.return)&&n.call(m)}finally{if(t)throw t.error}}var b=performance.now();return null===(i=o.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",b-s),a},this.getNearestLabel=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?o.getText(t):o.getNearestLabel(n)},this.getEventProperties=function(e,t,n){var r,i,a,s,c,u,l=null===(a=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===a?void 0:a.call(i),d="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},f=o.getHierarchy(t),p=null===(s=f[0])||void 0===s?void 0:s.attrs,g=o.getNearestLabel(t),h=(c=null!=p?p:{},u=n,Object.entries(c).reduce((function(e,t){var n=he(t,2),r=n[0],i=n[1];if(r.startsWith(u)){var o=r.replace(u,"");o&&(e[o]=i||"")}return e}),{})),v=((r={})["[Amplitude] Element Hierarchy"]=f,r[pi]=l,r[gi]=o.getText(t),r["[Amplitude] Element Position Left"]=null==d.left?null:Math.round(d.left),r["[Amplitude] Element Position Top"]=null==d.top?null:Math.round(d.top),r["[Amplitude] Element Attributes"]=h,r["[Amplitude] Element Parent Label"]=g,r[hi]=Ct(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=Nn(o.replaceSensitiveString),r["[Amplitude] Viewport Height"]=window.innerHeight,r["[Amplitude] Viewport Width"]=window.innerWidth,r);if(v["[Amplitude] Element ID"]=t.getAttribute("id")||"",v["[Amplitude] Element Class"]=t.getAttribute("class"),v["[Amplitude] Element Aria Label"]=null==p?void 0:p["aria-label"],"a"===l&&"click"===e&&t instanceof HTMLAnchorElement){var m=t.href.substring(0,128);v["[Amplitude] Element Href"]=o.replaceSensitiveString(m)}return ki(v)},this.addAdditionalEventProperties=function(e,t,n,r,i){void 0===i&&(i=!1);var a={event:e,timestamp:Date.now(),type:t};if(function(e){return"click"===e.type||"change"===e.type}(a)&&null!==a.event.target){if(i&&Ti(a.event.target,a.type))return a.closestTrackedAncestor=a.event.target,a.targetElementProperties=o.getEventProperties(a.type,a.closestTrackedAncestor,r),a;var s=Si(a.event.target,n);return s&&(a.closestTrackedAncestor=s,a.targetElementProperties=o.getEventProperties(a.type,s,r)),a}return a},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;return e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector?n.querySelector(e.selector):n}}catch(e){return}}(e,t);if(!n)return;return"TEXT"===e.elementExtractType?o.getText(n):"ATTRIBUTE"===e.elementExtractType&&e.attribute?n.getAttribute(e.attribute):void 0}},this.getText=function(e){if(null!==e.closest("[".concat(On,"]")))return Rn;var t="";if(e.querySelector("[".concat(On,"], [contenteditable]"))){var n=e.cloneNode(!0);n.querySelectorAll("[".concat(On,"], [contenteditable]")).forEach((function(e){e.innerText=Rn})),t=n.innerText||""}else t=e.innerText||"";return o.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){var t,n,r;if(!e)return{};var i=null===(r=null===(n=null==e?void 0:e.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n),a=((t={})[pi]=i,t[gi]=o.getText(e),t[hi]=window.location.href.split("?")[0],t);return ki(a)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var a=null!==(i=e.maskTextRegex)&&void 0!==i?i:[],s=[];try{for(var c=ge(a),u=c.next();!u.done;u=c.next()){var l=u.value;if(s.length>=25)break;if(l instanceof RegExp)s.push(l);else if("pattern"in l&&"string"==typeof l.pattern)try{s.push(new RegExp(l.pattern,"i"))}catch(e){}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=s},Ci=function(){function e(e){var t=(void 0===e?{}:e).origin,n=void 0===t?vi:t,r=this;this.endpoint=vi,this.requestCallbacks={},this.onSelect=function(e){r.notify({action:"element-selected",data:e})},this.onTrack=function(e,t){"selector-mode-changed"===e?r.notify({action:"track-selector-mode-changed",data:t}):"selector-moved"===e&&r.notify({action:"track-selector-moved",data:t})},this.endpoint=n}return e.prototype.notify=function(e){var t,n,r,i;null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise((function(t,a){r.requestCallbacks[i]={resolve:t,reject:a},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout((function(){a(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]}),n.timeout)}))},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.setup=function(e){var t=this,n=void 0===e?{dataExtractor:new xi({})}:e,r=n.logger,i=n.endpoint,o=n.isElementSelectable,a=n.cssSelectorAllowlist,s=n.actionClickAllowlist,c=n.dataExtractor;this.logger=r,i&&this.endpoint===vi&&(this.endpoint=i);var u=null;window.addEventListener("message",(function(e){var n,r,i,l,d;if(null===(r=null===(n=t.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Message received: ",JSON.stringify(e)),t.endpoint===e.origin){var f,p=null==e?void 0:e.data,g=null==p?void 0:p.action;if(g)if("id"in p)null===(l=null===(i=t.logger)||void 0===i?void 0:i.debug)||void 0===l||l.call(i,"Received Response to previous request: ",JSON.stringify(e)),t.handleResponse(p);else if("ping"===g)t.notify({action:"pong"});else if("initialize-visual-tagging-selector"===g){var h=null==p?void 0:p.data;(f="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise((function(e,t){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=f,r.addEventListener("load",(function(){e({status:!0})}),{once:!0}),r.addEventListener("error",(function(){t({status:!1,message:"Failed to load the script ".concat(f)})})),null===(n=document.head)||void 0===n||n.appendChild(r)}catch(e){t(e)}}))).then((function(){var e;u=null===(e=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===e?void 0:e.call(window,{getEventTagProps:c.getEventTagProps,isElementSelectable:function(e){return!o||o((null==h?void 0:h.actionType)||"click",e)},onTrack:t.onTrack,onSelect:t.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:t,cssSelectorAllowlist:a,actionClickAllowlist:s,extractDataFromDataSource:c.extractDataFromDataSource,dataExtractor:c,diagnostics:{autocapture:{version:di}}}),t.notify({action:"selector-loaded"})})).catch((function(){var e;null===(e=t.logger)||void 0===e||e.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===g&&(null===(d=null==u?void 0:u.close)||void 0===d||d.call(u))}})),this.notify({action:"page-loaded"})},e}();var Di,Li=function(){return new rr((function(e){var t=new MutationObserver((function(t){e.next(t)}));return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}}))},Ni=function(e){return void 0===e&&(e="click"),new rr((function(t){var n,r=function(e){t.next(e)};return null===(n=Ke())||void 0===n||n.document.addEventListener(e,r,{capture:!0}),function(){var t;null===(t=Ke())||void 0===t||t.document.removeEventListener(e,r,{capture:!0})}}))},Ui={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},ji=function(e){var t,n,r,i,o=Object.values(Ui).reduce((function(e,t){return e[t]=new Set,e}),{});if(!e)return o;try{for(var a=ge(e),s=a.next();!s.done;s=a.next()){var c=s.value;try{try{for(var u=(r=void 0,ge(c.definition)),l=u.next();!l.done;l=u.next()){var d=l.value,f=Ui[d.event_type];f&&o[f].add(c.id)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==c?void 0:c.id,e)}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o},Mi=function(e){var t,n,r,i,o=new Map;try{for(var a=ge(e),s=a.next();!s.done;s=a.next()){var c=s.value;try{for(var u=(r=void 0,ge(c.conditions)),l=u.next();!l.done;l=u.next()){var d=l.value;if("LABELED_EVENT"===d.type){var f=d.match.eventId,p=o.get(f);p||(p=[],o.set(f,p)),p.push(c)}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return o},qi=function(e,t){return t.filter((function(t){return t.definition.some((function(t){return Ui[t.event_type]===e.type&&t.filters.every((function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){return console.error("Error matching event to filter",e),!1}return!1}(e,t)}))}))}))},Fi=function(){function e(e,t,n,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=n,this.options=r}return e.prototype.evaluate=function(e){var t,n,r=this.options.pageActions;if(!r)return e;var i=function(e,t){var n,r,i,o,a=new Set;try{for(var s=ge(e),c=s.next();!c.done;c=s.next()){var u=c.value,l=t.get(u.id);if(l)try{for(var d=(i=void 0,ge(l)),f=d.next();!f.done;f=d.next()){var p=f.value;a.add(p)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=s.return)&&r.call(s)}finally{if(n)throw n.error}}return Array.from(a)}(qi(e,Array.from(this.groupedLabeledEvents[e.type]).map((function(e){return r.labeledEvents[e]}))),this.labeledEventToTriggerMap);try{for(var o=ge(i),a=o.next();!a.done;a=o.next()){var s=a.value;Ri(s.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=n},e}();!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable"}(Di||(Di={}));var Bi=function(e,t){var n,r,i,o,a,s,c,u;void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",di);var l=e.dataAttributePrefix,d=void 0===l?on:l,f=e.visualTaggingOptions,p=void 0===f?{enabled:!0,messenger:new Ci}:f;e.cssSelectorAllowlist=null!==(n=e.cssSelectorAllowlist)&&void 0!==n?n:rn,e.actionClickAllowlist=null!==(r=e.actionClickAllowlist)&&void 0!==r?r:an,e.debounceTime=null!==(i=e.debounceTime)&&void 0!==i?i:0,e.pageUrlExcludelist=null===(o=e.pageUrlExcludelist)||void 0===o?void 0:o.reduce((function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(n){return console.warn("Invalid regex pattern: ".concat(t.pattern),n),e}return e}),[]);var g="@amplitude/plugin-autocapture-browser",h=[],v=new xi(e,t),m=ji(Object.values(null!==(s=null===(a=e.pageActions)||void 0===a?void 0:a.labeledEvents)&&void 0!==s?s:{})),y=Mi(null!==(u=null===(c=e.pageActions)||void 0===c?void 0:c.triggers)&&void 0!==u?u:[]),b=function(e,t,n,r){return new Fi(e,t,n,r)}(m,y,v,e);return{name:g,type:"enrichment",setup:function(t,n){return fe(void 0,void 0,void 0,(function(){var r,i,o,a,s,c,u,l,f,T;return pe(this,(function(w){return"undefined"==typeof document||(t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("analyticsSDK.pageActions","all",(function(t){!function(t){var n,r;t&&(e.pageActions=le(le({},e.pageActions),t),m=ji(Object.values(null!==(n=e.pageActions.labeledEvents)&&void 0!==n?n:{})),y=Mi(null!==(r=e.pageActions.triggers)&&void 0!==r?r:[]),b.update(m,y,e))}(t)})):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),r=wi(e,e.cssSelectorAllowlist),i=wi(e,e.actionClickAllowlist),o=function(){var t,n,r=ar(Ni().map((function(t){return v.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,d)}))),i=ar(new rr((function(t){var n,r=function(n){var r=v.addAdditionalEventProperties(n,"change",e.cssSelectorAllowlist,d);t.next(r)};return null===(n=Ke())||void 0===n||n.document.addEventListener("change",r,{capture:!0}),function(){var e;return null===(e=Ke())||void 0===e?void 0:e.document.removeEventListener("change",r)}})));window.navigation&&(n=ar(new rr((function(t){var n=function(n){var r=v.addAdditionalEventProperties(n,"navigate",e.cssSelectorAllowlist,d);t.next(r)};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}}))));var o=ar(Li().map((function(t){return v.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,d)})));return(t={})[Di.ChangeObservable]=i,t[Di.ClickObservable]=r,t[Di.MutationObservable]=o,t[Di.NavigateObservable]=n,t}(),a=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackEvent,i=e.evaluateTriggers;return n.clickObservable.filter(Ei).filter((function(e){return r("click",e.closestTrackedAncestor)})).map((function(e){return i(e)})).subscribe((function(e){null==t||t.track(fi,e.targetElementProperties)}))}({allObservables:o,amplitude:n,shouldTrackEvent:r,evaluateTriggers:b.evaluate.bind(b)}),h.push(a),s=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return n.changeObservable.filter(Ei).filter((function(e){return i("change",e.closestTrackedAncestor)})).map((function(e){return o(e)})).subscribe((function(e){null==t||t.track("[Amplitude] Element Changed",r("change",e.closestTrackedAncestor))}))}({allObservables:o,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return v.getEventProperties.apply(v,ve(ve([],he(e),!1),[d],!1))},amplitude:n,shouldTrackEvent:r,evaluateTriggers:b.evaluate.bind(b)}),h.push(s),c=function(e){var t=e.amplitude,n=e.allObservables,r=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,a=e.shouldTrackActionClick,s=n.clickObservable,c=n.mutationObservable,u=n.navigateObservable,l=s.filter((function(e){return!o("click",e.closestTrackedAncestor)})).map((function(e){var t=Si(e.event.target,r.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e})).filter(Ei).filter((function(e){return a("click",e.closestTrackedAncestor)})),d=u?or(c,u):c,f=or(l,d),p=null,g=null;return ir(f,(function(e){if(p&&(clearTimeout(p),p=null),"click"===e.type)return g=e,p=setTimeout((function(){p=null,g=null}),500),Promise.resolve(null);if(g){var t=g;return g=null,Promise.resolve(t)}return Promise.resolve(null)})).subscribe((function(e){e&&(null==t||t.track(fi,i("click",e.closestTrackedAncestor)))}))}({allObservables:o,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return v.getEventProperties.apply(v,ve(ve([],he(e),!1),[d],!1))},amplitude:n,shouldTrackEvent:r,shouldTrackActionClick:i}),c&&h.push(c),null===(f=null==t?void 0:t.loggerProvider)||void 0===f||f.log("".concat(g," has been successfully added.")),window.opener&&p.enabled&&(u=e.cssSelectorAllowlist,l=e.actionClickAllowlist,null===(T=p.messenger)||void 0===T||T.setup(le(le({dataExtractor:v,logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:mi[t.serverZone]}),{isElementSelectable:wi(e,ve(ve([],he(u),!1),he(l),!1)),cssSelectorAllowlist:u,actionClickAllowlist:l})))),[2]}))}))},execute:function(e){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(t){return[2,e]}))}))},teardown:function(){return fe(void 0,void 0,void 0,(function(){var e,t,n,r;return pe(this,(function(i){try{for(e=ge(h),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]}))}))}}},$i=["mutation","navigate"];function Ki(e,t){var n,r,i,o,a=t.event,s=a.clientX,c=a.clientY;e.yMin=Math.min(null!==(n=e.yMin)&&void 0!==n?n:c,c),e.yMax=Math.max(null!==(r=e.yMax)&&void 0!==r?r:c,c),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:s,s),e.xMax=Math.max(null!==(o=e.xMax)&&void 0!==o?o:s,s),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function Hi(e){if(0===e.length)return null;var t=e[0],n=e[e.length-1];return{rageClickEvent:le({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-t.timestamp,"[Amplitude] Clicks":e.map((function(e){return{X:e.event.clientX,Y:e.event.clientY,Time:e.timestamp}})),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}function zi(e){var t=this,n=e.amplitude,r=e.allObservables,i=e.shouldTrackRageClick,o=r.clickObservable,a=[],s={},c=null;return ir(o.filter((function(e){return i("click",e.closestTrackedAncestor)})),(function(e){return fe(t,void 0,void 0,(function(){var t;return pe(this,(function(n){return Ki(s,e),t=null,0===a.length||function(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}(a,e)||function(e,t){var n=e[Math.max(0,e.length-4+1)];return t.timestamp-n.timestamp>=1e3}(a,e)||s.isOutOfBounds?(c&&(t=Hi(a)),function(e){a=[],s={},e&&(Ki(s,e),a.push(e))}(e)):a.push(e),c&&(clearTimeout(c.timerId),c.resolve(t),c=null),a.length>=4?[2,new Promise((function(e){c={resolve:e,timerId:setTimeout((function(){e(Hi(a))}),1e3)}}))]:[2,null]}))}))})).subscribe((function(e){null!==e&&n.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})}))}var Vi,Gi,Ji=function(e){var t,n,r,i,o;void 0===e&&(e={});var a="@amplitude/plugin-frustration-browser",s=[],c=null!==(n=null===(t=e.rageClicks)||void 0===t?void 0:t.cssSelectorAllowlist)&&void 0!==n?n:cn,u=null!==(i=null===(r=e.deadClicks)||void 0===r?void 0:r.cssSelectorAllowlist)&&void 0!==i?i:sn,l=null!==(o=e.dataAttributePrefix)&&void 0!==o?o:on,d=new xi(e),f=ve([],he(new Set(ve(ve([],he(c),!1),he(u),!1))),!1);return{name:a,type:"enrichment",setup:function(t,n){return fe(void 0,void 0,void 0,(function(){var r,i,o,p,g,h;return pe(this,(function(v){return"undefined"==typeof document||(r=wi(e,c),i=wi(e,u),o=function(){var e,t,n=ar(Ni("pointerdown").map((function(e){return d.addAdditionalEventProperties(e,"click",f,l,!0)}))),r=ar(Li().map((function(e){return d.addAdditionalEventProperties(e,"mutation",f,l)})));return window.navigation&&(t=ar(new rr((function(e){var t=function(t){e.next(le(le({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}})).map((function(e){return d.addAdditionalEventProperties(e,"navigate",f,l)})))),(e={})[Di.ClickObservable]=n,e[Di.MutationObservable]=r,e[Di.NavigateObservable]=t,e}(),p=zi({allObservables:o,amplitude:n,shouldTrackRageClick:r}),s.push(p),g=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackDeadClick,o=n.clickObservable,a=n.mutationObservable,s=n.navigateObservable,c=o.filter((function(e){return Ei(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')})),u=s?or(a,s):a,l=or(c,u),d=null;return ir(l,(function(e){return d&&$i.includes(e.type)?(clearTimeout(d),d=null,Promise.resolve(null)):"click"===e.type?d?Promise.resolve(null):new Promise((function(t){d=setTimeout((function(){t(e),d=null}),3e3)})):Promise.resolve(null)})).subscribe((function(e){if(e){var n={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};t.track("[Amplitude] Dead Click",le(le({},r("click",e.closestTrackedAncestor)),n),{time:e.timestamp})}}))}({amplitude:n,allObservables:o,getEventProperties:function(e,t){return d.getEventProperties(e,t,l)},shouldTrackDeadClick:i}),s.push(g),null===(h=null==t?void 0:t.loggerProvider)||void 0===h||h.log("".concat(a," has been successfully added."))),[2]}))}))},execute:function(e){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(t){return[2,e]}))}))},teardown:function(){return fe(void 0,void 0,void 0,(function(){var e,t,n,r;return pe(this,(function(i){try{for(e=ge(s),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]}))}))}}},Wi="[Amplitude] Network Request",Yi="500-599";function Qi(e,t){var n="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(n).test(e)}function Xi(e,t){var n,r,i=t.split(",");try{for(var o=ge(i),a=o.next();!a.done;a=o.next()){var s=he(a.value.split("-").map(Number),2),c=s[0],u=s[1];if(e===c&&void 0===u)return!0;if(e>=c&&e<=u)return!0}}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}function Zi(e){var t;if(e)try{var n=null===(t=Ke())||void 0===t?void 0:t.location.href,r=new URL(e,n),i=r.searchParams.toString(),o=r.hash.replace("#",""),a=r.href,s=r.host;return r.hash="",r.search="",{query:i,fragment:o,href:a,hrefWithoutQueryOrHash:r.href,host:s}}catch(e){return}}function eo(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return ve([],he(Le),!1);if(void 0===e){return}}}function to(e){var t,n;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(n=null==e?void 0:e.blocklist)||void 0===n?void 0:n.length)}function no(e,t){var n;void 0===t&&(t={});var r=Zi(e.url);if(!r)return!1;var i,o=r.host;if(!1!==t.ignoreAmplitudeRequests&&(Qi(o,"*.amplitude.com")||Qi(o,"amplitude.com")))return!1;if(null===(n=t.ignoreHosts)||void 0===n?void 0:n.find((function(e){return Qi(o,e)})))return!1;if(!t.captureRules&&void 0!==e.status&&!Xi(e.status,Yi))return!1;if(t.captureRules&&(ve([],he(t.captureRules),!1).reverse().find((function(t){if(i=function(e,t,n,r,i){if((!e.hosts||e.hosts.find((function(e){return Qi(t,e)})))&&(!r||!e.urls||xt(r,e.urls))&&(!i||!e.methods||e.methods.find((function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e}))))return!((n||0===n)&&!Xi(n,e.statusCodeRange||Yi))}(t,o,e.status,e.url,e.method),i){var n=eo(t.responseHeaders);if(e.responseWrapper&&n){var r=e.responseWrapper.headers(n);r&&(e.responseHeaders=r)}var a=eo(t.requestHeaders);if(e.requestWrapper&&a){var s=e.requestWrapper.headers(a);s&&(e.requestHeaders=s)}e.responseWrapper&&t.responseBody&&!to(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!to(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}return void 0!==i})),!i))return!1;return!e.requestWrapper||!function(e,t){if(e.includes("amplitude.com"))try{var n=t.body;if("string"!=typeof n)return!1;if(JSON.parse(n).events.find((function(e){return e.event_type===Wi})))return!0}catch(e){}return!1}(o,e.requestWrapper)}function ro(e){var t=e.allObservables,n=e.networkTrackingOptions,r=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter((function(e){return no(e.event,n)})).subscribe((function(e){var t,n,o,a=e.event,s=Zi(a.url);if(s){var c=null===(n=a.responseWrapper)||void 0===n?void 0:n.bodySize,u=null===(o=a.requestWrapper)||void 0===o?void 0:o.bodySize;!function(e,t,n,r){fe(this,void 0,void 0,(function(){var i,o,a;return pe(this,(function(s){switch(s.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(i=he.apply(void 0,[s.sent(),2]),o=i[0],a=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==r||r.debug("Failed to stringify request body",e)}if(a)try{e["[Amplitude] Response Body"]=JSON.stringify(a)}catch(e){null==r||r.debug("Failed to stringify response body")}s.label=2;case 2:return null==n||n.track(Wi,e),[2]}}))}))}(((t={})["[Amplitude] URL"]=s.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=s.query,t["[Amplitude] URL Fragment"]=s.fragment,t["[Amplitude] Request Method"]=a.method,t["[Amplitude] Status Code"]=a.status,t["[Amplitude] Start Time"]=a.startTime,t["[Amplitude] Completion Time"]=a.endTime,t["[Amplitude] Duration"]=a.duration,t["[Amplitude] Request Body Size"]=u,t["[Amplitude] Response Body Size"]=c,t["[Amplitude] Request Type"]=a.type,t["[Amplitude] Request Headers"]=a.requestHeaders,t["[Amplitude] Response Headers"]=a.responseHeaders,t),a,r,i)}}))}!function(e){e.NetworkObservable="networkObservable"}(Vi||(Vi={}));var io=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-network-capture-browser",r=function(){var e,n=new rr((function(e){var n=new _n((function(t){var n=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(n)}));return Pn.subscribe(n,t),function(){Pn.unsubscribe(n)}}));return(e={})[Vi.NetworkObservable]=n,e};return{name:n,type:"enrichment",setup:function(i,o){return fe(void 0,void 0,void 0,(function(){var a;return pe(this,(function(s){return"undefined"==typeof document||(a=r(),t=null==i?void 0:i.loggerProvider,Gi=ro({allObservables:a,networkTrackingOptions:e,amplitude:o,loggerProvider:t}),null==t||t.log("".concat(n," has been successfully added."))),[2]}))}))},execute:function(e){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(t){return[2,e]}))}))},teardown:function(){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(e){return Gi.unsubscribe(),[2]}))}))}}};let oo=-1;const ao=e=>{addEventListener("pageshow",(t=>{t.persisted&&(oo=t.timeStamp,e(t))}),!0)},so=(e,t,n,r)=>{let i,o;return a=>{t.value>=0&&(a||r)&&(o=t.value-(i??0),(o||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},co=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},uo=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},lo=()=>{const e=uo();return e?.activationStart??0},fo=(e,t=-1)=>{const n=uo();let r="navigate";return oo>=0?r="back-forward-cache":n&&(document.prerendering||lo()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},po=new WeakMap;function go(e,t){return po.get(e)||po.set(e,new t),po.get(e)}class ho{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const vo=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return r.observe({type:e,buffered:!0,...n}),r}}catch{}},mo=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let yo=-1;const bo=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,To=e=>{"hidden"===document.visibilityState&&yo>-1&&(yo="visibilitychange"===e.type?e.timeStamp:0,ko())},wo=()=>{addEventListener("visibilitychange",To,!0),addEventListener("prerenderingchange",To,!0)},ko=()=>{removeEventListener("visibilitychange",To,!0),removeEventListener("prerenderingchange",To,!0)},So=()=>{if(yo<0){const e=lo(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0]?.startTime;yo=t??bo(),wo(),ao((()=>{setTimeout((()=>{yo=bo(),wo()}))}))}return{get firstHiddenTime(){return yo}}},Eo=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},_o=[1800,3e3],Io=(e,t={})=>{Eo((()=>{const n=So();let r,i=fo("FCP");const o=vo("paint",(e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-lo(),0),i.entries.push(t),r(!0)))}));o&&(r=so(e,i,_o,t.reportAllChanges),ao((n=>{i=fo("FCP"),r=so(e,i,_o,t.reportAllChanges),co((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},Po=[.1,.25];let Ao=0,Oo=1/0,Ro=0;const xo=e=>{for(const t of e)t.interactionId&&(Oo=Math.min(Oo,t.interactionId),Ro=Math.max(Ro,t.interactionId),Ao=Ro?(Ro-Oo)/7+1:0)};let Co;const Do=()=>Co?Ao:performance.interactionCount??0;let Lo=0;class No{u=[];l=new Map;m;p;v(){Lo=Do(),this.u.length=0,this.l.clear()}P(){const e=Math.min(this.u.length-1,Math.floor((Do()-Lo)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>t.T){if(n?e.duration>n.T?(n.entries=[e],n.T=e.duration):e.duration===n.T&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],T:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort(((e,t)=>t.T-e.T)),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(n)}}}const Uo=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(t(e=mo(e)),document.addEventListener("visibilitychange",e,{once:!0}))},jo=[200,500],Mo=(e,t={})=>{globalThis.PerformanceEventTiming&&"interactionId"in PerformanceEventTiming.prototype&&Eo((()=>{"interactionCount"in performance||Co||(Co=vo("event",xo,{type:"event",buffered:!0,durationThreshold:0}));let n,r=fo("INP");const i=go(t,No),o=e=>{Uo((()=>{for(const t of e)i.h(t);const t=i.P();t&&t.T!==r.value&&(r.value=t.T,r.entries=t.entries,n())}))},a=vo("event",o,{durationThreshold:t.durationThreshold??40});n=so(e,r,jo,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&(o(a.takeRecords()),n(!0))})),ao((()=>{i.v(),r=fo("INP"),n=so(e,r,jo,t.reportAllChanges)})))}))};class qo{m;h(e){this.m?.(e)}}const Fo=[2500,4e3],Bo=[800,1800],$o=e=>{document.prerendering?Eo((()=>$o(e))):"complete"!==document.readyState?addEventListener("load",(()=>$o(e)),!0):setTimeout(e)};function Ko(e){var t,n=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+n}function Ho(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(Ko(e)),navigationStart:Math.floor(performance.timeOrigin)}}var zo,Vo=function(){var e=null,t=Ke(),n=null==t?void 0:t.document,r=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,i){return fe(void 0,void 0,void 0,(function(){var o,a;return pe(this,(function(s){return void 0===n||(o=Ct((null==r?void 0:r.href)||"",t.loggerProvider),a={"[Amplitude] Page Domain":(null==r?void 0:r.hostname)||"","[Amplitude] Page Location":o,"[Amplitude] Page Path":Ct((null==r?void 0:r.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":Ct(o.split("?")[0],t.loggerProvider)},((e,t={})=>{Eo((()=>{const n=So();let r,i=fo("LCP");const o=go(t,qo),a=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)o.h(t),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-lo(),0),i.entries=[t],r())},s=vo("largest-contentful-paint",a);if(s){r=so(e,i,Fo,t.reportAllChanges);const n=mo((()=>{a(s.takeRecords()),s.disconnect(),r(!0)}));for(const e of["keydown","click","visibilitychange"])addEventListener(e,(()=>Uo(n)),{capture:!0,once:!0});ao((n=>{i=fo("LCP"),r=so(e,i,Fo,t.reportAllChanges),co((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))}))}}))})((function(e){a["[Amplitude] LCP"]=Ho(e)})),Io((function(e){a["[Amplitude] FCP"]=Ho(e)})),Mo((function(e){a["[Amplitude] INP"]=Ho(e)})),((e,t={})=>{Io(mo((()=>{let n,r=fo("CLS",0);const i=go(t,ho),o=e=>{for(const t of e)i.h(t);i.i>r.value&&(r.value=i.i,r.entries=i.o,n())},a=vo("layout-shift",o);a&&(n=so(e,r,Po,t.reportAllChanges),document.addEventListener("visibilitychange",(()=>{"hidden"===document.visibilityState&&(o(a.takeRecords()),n(!0))})),ao((()=>{i.i=0,r=fo("CLS",0),n=so(e,r,Po,t.reportAllChanges),co((()=>n()))})),setTimeout(n))})))})((function(e){a["[Amplitude] CLS"]=Ho(e)})),((e,t={})=>{let n=fo("TTFB"),r=so(e,n,Bo,t.reportAllChanges);$o((()=>{const i=uo();i&&(n.value=Math.max(i.responseStart-lo(),0),n.entries=[i],r(!0),ao((()=>{n=fo("TTFB",0),r=so(e,n,Bo,t.reportAllChanges),r(!0)})))}))})((function(e){a["[Amplitude] TTFB"]=Ho(e)})),e=function(){"hidden"===n.visibilityState&&e&&(i.track("[Amplitude] Web Vitals",a),n.removeEventListener("visibilitychange",e),e=null)},n.addEventListener("visibilitychange",e)),[2]}))}))},execute:function(e){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(t){return[2,e]}))}))},teardown:function(){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(t){return e&&(null==n||n.removeEventListener("visibilitychange",e)),[2]}))}))}}},Go=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},Jo=function(e,t,n,r,i){void 0===i&&(i=!0),e.referrer;var o=e.referring_domain,a=de(e,["referrer","referring_domain"]),s=t||{};s.referrer;var c=s.referring_domain,u=de(s,["referrer","referring_domain"]);if(Wo(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&function(e){return Object.values(e).every((function(e){return!e}))}(e)&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var l=JSON.stringify(a)!==JSON.stringify(u),d=Go(o||"")!==Go(c||""),f=!t||l||d;return f?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),f},Wo=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some((function(e){return e instanceof RegExp?e.test(t):e===t}))},Yo=function(){function e(e,t){var n,r,i;this.shouldTrackNewCampaign=!1,this.options=le({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:(r=null===(n=t.cookieOptions)||void 0===n?void 0:n.domain,i=r,i?(i.startsWith(".")&&(i=i.substring(1)),[new RegExp("".concat(i.replace(".","\\."),"$"))]):[])},e),this.storage=t.cookieStorage,this.storageKey=Mt(t.apiKey,"MKTG"),this.webExpStorageKey=Mt(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=De,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return fe(this,void 0,void 0,(function(){var e,t;return pe(this,(function(n){switch(n.label){case 0:return[4,this.fetchCampaign()];case 1:return t=he.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||It(this.sessionTimeout,this.lastEventTime),Jo(this.currentCampaign,this.previousCampaign,this.options,this.logger,e)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},e.prototype.fetchCampaign=function(){return fe(this,void 0,void 0,(function(){var e;return pe(this,(function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return(e=t.sent())?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||(new An).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}}))}))},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r,i,o=(t=this.currentCampaign,n=this.options,r=le(le({},De),t),i=Object.entries(r).reduce((function(e,t){var r,i=he(t,2),o=i[0],a=i[1];return e.setOnce("initial_".concat(o),null!==(r=null!=a?a:n.initialEmptyValue)&&void 0!==r?r:"EMPTY"),a?e.set(o,a):e.unset(o)}),new Me),Ge(i));return e&&(o.event_id=e),o},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),Qo="AMP_CURRENT_PAGE",Xo="AMP_PREVIOUS_PAGE",Zo="AMP_URL_INFO";!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(zo||(zo={}));var ea=new Set([ue.IDENTIFY,ue.GROUP_IDENTIFY,ue.REVENUE]),ta=function(e){var t={}.internalDomains,n=void 0===t?[]:t,r=Ke(),i=void 0,o=!1,a=void 0,s=!1,c=!1,u=function(e){var t="undefined"!=typeof location&&location.hostname||"",r=e?function(e){var t;try{var n=Ct(e,a);t=new URL(n).hostname}catch(e){null==a||a.error("Could not parse URL: ",e)}return t}(e):void 0;if(!r)return zo.Direct;var i=n.some((function(e){return-1!==t.indexOf(e)})),o=n.some((function(e){return-1!==r.indexOf(e)}));return t===r||o&&i?zo.Internal:zo.External},l=function(){fe(void 0,void 0,void 0,(function(){var e,t,n,r,a;return pe(this,(function(s){switch(s.label){case 0:return i&&o?[4,i.get(Zo)]:[3,3];case 1:return e=s.sent(),t=Ct("undefined"!=typeof location&&location.href||""),n=(null==e?void 0:e[Qo])||"",r=void 0,r=t===n?(null==e?void 0:e[Xo])||"":n||document.referrer||"",[4,i.set(Zo,(a={},a[Qo]=t,a[Xo]=r,a))];case 2:s.sent(),s.label=3;case 3:return[2]}}))}))},d={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(t){switch(t.label){case 0:return(a=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),c=!0,r?[4,(i=new qt(r.sessionStorage)).isEnabled()]:[3,2];case 1:o=t.sent(),r.addEventListener("popstate",l),s||(r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=he(n,3),i=r[0],o=r[1],a=r[2];e.apply(t,[i,o,a]),c&&l()}}),r.history.replaceState=new Proxy(r.history.replaceState,{apply:function(e,t,n){var r=he(n,3),i=r[0],o=r[1],a=r[2];e.apply(t,[i,o,a]),c&&l()}}),s=!0),t.label=2;case 2:return[2]}}))}))},execute:function(e){return fe(void 0,void 0,void 0,(function(){var t,n,r,a,s;return pe(this,(function(c){switch(c.label){case 0:return t=Ct("undefined"!=typeof location&&location.href||""),i&&o?[4,i.get(Zo)]:[3,5];case 1:return(null==(n=c.sent())?void 0:n[Qo])?[3,3]:[4,i.set(Zo,(s={},s[Qo]=t,s[Xo]=document.referrer||"",s))];case 2:c.sent(),c.label=3;case 3:return[4,i.get(Zo)];case 4:if(r=c.sent(),a="",r&&(a=r[Xo]||""),ea.has(e.event_type))return[2,e];e.event_properties=le(le({},e.event_properties||{}),{"[Amplitude] Page Domain":na(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":na(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":na(e,"[Amplitude] Page Path","undefined"!=typeof location&&Ct(location.pathname)||""),"[Amplitude] Page Title":na(e,"[Amplitude] Page Title",Nn(Ln)),"[Amplitude] Page URL":na(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":a,"[Amplitude] Previous Page Type":u(a)}),c.label=5;case 5:return[2,e]}}))}))},teardown:function(){return fe(void 0,void 0,void 0,(function(){return pe(this,(function(e){switch(e.label){case 0:return r&&(r.removeEventListener("popstate",l),c=!1),i&&o?[4,i.set(Zo,{})]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}};return d};function na(e,t,n){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?n:e.event_properties[t]}var ra=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return se(t,e),t.prototype.init=function(e,t,n){var r,i;return void 0===e&&(e=""),arguments.length>2?(r=t,i=n):"string"==typeof t?(r=t,i=void 0):(r=null==t?void 0:t.userId,i=t),Je(this._init(le(le({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i,o;return fe(this,void 0,void 0,(function(){var a,s,c,u,l,d,f,p,g,h=this;return pe(this,(function(v){switch(v.label){case 0:return this.initializing?[2]:(this.initializing=!0,[4,Gr(t.apiKey,t,this)]);case 1:return a=v.sent(),a.remoteConfig&&a.remoteConfig.fetchRemoteConfig?(s=new nn(a.apiKey,a.loggerProvider,a.serverZone,null===(n=a.remoteConfig)||void 0===n?void 0:n.serverUrl),[4,new Promise((function(e){null==s||s.subscribe("configs.analyticsSDK.browserSDK","all",(function(t,n,r){a.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t&&li(t,a),e()}))}))]):[3,4];case 2:return v.sent(),[4,new Promise((function(e){null==s||s.subscribe("configs.diagnostics.browserSDK","all",(function(t,n,r){if(a.loggerProvider.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(a.diagnosticsSampleRate=i);var o=t.enabled;"boolean"==typeof o&&(a.enableDiagnostics=o)}e()}))}))];case 3:v.sent(),v.label=4;case 4:return(c=new Xt(a.apiKey,a.loggerProvider,a.serverZone,{enabled:a.enableDiagnostics,sampleRate:a.diagnosticsSampleRate})).setTag("library","".concat(wr,"/").concat(Tr)),c.setTag("user_agent",navigator.userAgent),[4,e.prototype._init.call(this,a)];case 5:return v.sent(),this.logBrowserOptions(a),this.config.diagnosticsClient=c,this.config.remoteConfigClient=s,cr(this.config.defaultTracking)?(y=this.config,u=cr(y.defaultTracking)&&y.defaultTracking&&"object"==typeof y.defaultTracking&&y.defaultTracking.attribution&&"object"==typeof y.defaultTracking.attribution?le({},y.defaultTracking.attribution):{},this.webAttribution=new Yo(u,this.config),[4,this.webAttribution.init()]):[3,7];case 6:v.sent(),v.label=7;case 7:return l=Ot(),d=l.ampTimestamp?Number(l.ampTimestamp):void 0,f=!d||Date.now()<d,p=f&&!Number.isNaN(Number(l.ampSessionId))?Number(l.ampSessionId):void 0,this.setSessionId(null!==(o=null!==(i=null!==(r=t.sessionId)&&void 0!==r?r:p)&&void 0!==i?i:this.config.sessionId)&&void 0!==o?o:Date.now()),(g=Et(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline?[3,9]:[4,this.add(si()).promise];case 8:v.sent(),v.label=9;case 9:return[4,this.add(new ft({diagnosticsClient:c})).promise];case 10:return v.sent(),[4,this.add(new kr).promise];case 11:return v.sent(),[4,this.add(new _t).promise];case 12:return v.sent(),function(e){ai||void 0!==e.defaultTracking||(e.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),ai=!0)}(this.config),m=this.config.defaultTracking,sr(m,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(oi()).promise]):[3,14];case 13:v.sent(),v.label=14;case 14:return function(e){return sr(e,"formInteractions")}(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(ni()).promise]):[3,16];case 15:v.sent(),v.label=16;case 16:return ur(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Xr(mr(this.config))).promise]):[3,18];case 17:v.sent(),v.label=18;case 18:return fr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(Bi(gr(this.config),{diagnosticsClient:c})).promise]):[3,20];case 19:v.sent(),v.label=20;case 20:return pr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(Ji(hr(this.config))).promise]):[3,22];case 21:v.sent(),v.label=22;case 22:return dr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(io(vr(this.config))).promise]):[3,24];case 23:v.sent(),v.label=24;case 24:return function(e){return"boolean"==typeof e?e:"object"==typeof e&&!0===e.webVitals}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(Vo()).promise]):[3,26];case 25:v.sent(),v.label=26;case 26:return function(e){return sr(e,"pageUrlEnrichment")}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(ta()).promise]):[3,28];case 27:v.sent(),v.label=28;case 28:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 29:return v.sent(),g.eventBridge.setEventReceiver((function(e){var t=e.eventProperties||{},n=t.time,r=de(t,["time"]),i="number"==typeof n?{time:n}:void 0;h.track(e.eventType,r,i)})),[2]}var m,y}))}))},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),e===this.config.userId&&void 0!==e||(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),function(e,t){Et(t).identityStore.editIdentity().setUserId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),function(e,t){Et(t).identityStore.editIdentity().setDeviceId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(ze()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null===(e=this.config)||void 0===e?void 0:e.deviceId,userId:null===(t=this.config)||void 0===t?void 0:t.userId,userProperties:this.userProperties}},t.prototype.getOptOut=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,n=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),Je(Promise.resolve());if(e===this.config.sessionId)return Je(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var r=this.getSessionId();r!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,lr(this.config.defaultTracking)&&(r&&i&&n.push(this.track(Ur,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:r,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var a=this.trackCampaignEventIfNeeded(++o,n);return this.config.identify&&n.push(this.track(Ge(this.config.identify)).promise),lr(this.config.defaultTracking)&&n.push(this.track(Nr,void 0,{event_id:a?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,Je(Promise.all(n))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=Wr(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(br(t)){var r=t._q;t._q=[],t=yr(new Me,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(br(r)){var o=r._q;r._q=[],r=yr(new Me,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(br(t)){var r=t._q;t._q=[],t=yr(new Ye,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var n=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(n).promise):this.track(n),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return fe(this,void 0,void 0,(function(){var n,r,i;return pe(this,(function(o){return n=Date.now(),r=It(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===Nr||t.event_type===Ur||t.session_id&&t.session_id!==this.getSessionId()||(r||i?(this.setSessionId(n),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):r||this.trackCampaignEventIfNeeded()),t.event_type===ue.IDENTIFY&&t.user_properties&&(this.userProperties=this.getOperationAppliedUserProperties(t.user_properties)),[2,e.prototype.process.call(this,t)]}))}))},t.prototype.logBrowserOptions=function(e){try{var t=le(le({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",JSON.stringify(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t.prototype._setDiagnosticsSampleRate=function(e){e>1||e<0||this.config||(this._diagnosticsSampleRate=e)},t}(We),ia=function(){var e=new ra;return{init:lt(e.init.bind(e),"init",st(e),ut(e,["config"])),add:lt(e.add.bind(e),"add",st(e),ut(e,["config.apiKey","timeline.plugins"])),remove:lt(e.remove.bind(e),"remove",st(e),ut(e,["config.apiKey","timeline.plugins"])),track:lt(e.track.bind(e),"track",st(e),ut(e,["config.apiKey","timeline.queue.length"])),logEvent:lt(e.logEvent.bind(e),"logEvent",st(e),ut(e,["config.apiKey","timeline.queue.length"])),identify:lt(e.identify.bind(e),"identify",st(e),ut(e,["config.apiKey","timeline.queue.length"])),groupIdentify:lt(e.groupIdentify.bind(e),"groupIdentify",st(e),ut(e,["config.apiKey","timeline.queue.length"])),setGroup:lt(e.setGroup.bind(e),"setGroup",st(e),ut(e,["config.apiKey","timeline.queue.length"])),revenue:lt(e.revenue.bind(e),"revenue",st(e),ut(e,["config.apiKey","timeline.queue.length"])),flush:lt(e.flush.bind(e),"flush",st(e),ut(e,["config.apiKey","timeline.queue.length"])),getUserId:lt(e.getUserId.bind(e),"getUserId",st(e),ut(e,["config","config.userId"])),setUserId:lt(e.setUserId.bind(e),"setUserId",st(e),ut(e,["config","config.userId"])),getDeviceId:lt(e.getDeviceId.bind(e),"getDeviceId",st(e),ut(e,["config","config.deviceId"])),setDeviceId:lt(e.setDeviceId.bind(e),"setDeviceId",st(e),ut(e,["config","config.deviceId"])),reset:lt(e.reset.bind(e),"reset",st(e),ut(e,["config","config.userId","config.deviceId"])),getSessionId:lt(e.getSessionId.bind(e),"getSessionId",st(e),ut(e,["config"])),setSessionId:lt(e.setSessionId.bind(e),"setSessionId",st(e),ut(e,["config"])),extendSession:lt(e.extendSession.bind(e),"extendSession",st(e),ut(e,["config"])),setOptOut:lt(e.setOptOut.bind(e),"setOptOut",st(e),ut(e,["config"])),setTransport:lt(e.setTransport.bind(e),"setTransport",st(e),ut(e,["config"])),getIdentity:lt(e.getIdentity.bind(e),"getIdentity",st(e),ut(e,["config"])),getOptOut:lt(e.getOptOut.bind(e),"getOptOut",st(e),ut(e,["config"])),_setDiagnosticsSampleRate:lt(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",st(e),ut(e,["config"]))}},oa=ia(),aa=Object.freeze({__proto__:null,DEFAULT_ACTION_CLICK_ALLOWLIST:an,DEFAULT_CSS_SELECTOR_ALLOWLIST:rn,DEFAULT_DATA_ATTRIBUTE_PREFIX:on,get IdentifyOperation(){return ce},get LogLevel(){return Qe},OfflineDisabled:null,get RevenueProperty(){return Be},get ServerZone(){return Tt},get SpecialEventType(){return ue}}),sa=oa.add,ca=oa.extendSession,ua=oa.flush,la=oa.getDeviceId,da=oa.getIdentity,fa=oa.getOptOut,pa=oa.getSessionId,ga=oa.getUserId,ha=oa.groupIdentify,va=oa.identify,ma=oa.init,ya=oa.logEvent,ba=oa.remove,Ta=oa.reset,wa=oa.revenue,ka=oa.setDeviceId,Sa=oa.setGroup,Ea=oa.setOptOut,_a=oa.setSessionId,Ia=oa.setTransport,Pa=oa.setUserId,Aa=oa.track,Oa=oa._setDiagnosticsSampleRate,Ra=Object.freeze({__proto__:null,AmplitudeBrowser:ra,Identify:Me,Revenue:Ye,Types:aa,_setDiagnosticsSampleRate:Oa,add:sa,createInstance:ia,extendSession:ca,flush:ua,getDeviceId:la,getIdentity:da,getOptOut:fa,getSessionId:pa,getUserId:ga,groupIdentify:ha,identify:va,init:ma,logEvent:ya,remove:ba,reset:Ta,revenue:wa,runQueuedFunctions:function(e,t){yr(e,t)},setDeviceId:ka,setGroup:Sa,setOptOut:Ea,setSessionId:_a,setTransport:Ia,setUserId:Pa,track:Aa});function xa(e,t){if(!k.getDebugMode())return;const n=["[Qonto Embed SDK]",e];console.log(...n)}class Ca{constructor(){this.isInitialized=!1}static getInstance(){return Ca.instance||(Ca.instance=new Ca),Ca.instance}initialize(){if(this.isInitialized||a())return;const e=y.getEnvironment()||"production",t=e===s.PRODUCTION?"52c120d2f5c89ca646fae6649a1ce7ad":"373aa80c38e5bc2a55895a96c8447fef";if(t)try{if(!Ra||"function"!=typeof ma)throw new Error("Analytics SDK module not available");const n={defaultTracking:{sessions:!1,pageViews:!1,formInteractions:!1,fileDownloads:!1},logLevel:e!==s.PRODUCTION?Qe.Debug:Qe.None};ma(t,void 0,n),this.isInitialized=!0,this.track(ie)}catch(e){console.error("Failed to initialize analytics tracking:",e)}else xa("No tracking client will be initialized due to missing API key")}isEnabled(){return this.isInitialized}track(e,t){if(this.isInitialized)try{Aa(e,t)}catch(e){console.error("Failed to track analytics event:",e)}}reset(){if(this.isInitialized)try{Ta()}catch(e){console.error("Failed to reset analytics:",e)}}}const Da=Ca.getInstance();function La(e,t){Da.track(e,t)}const Na=e=>{La(oe,e)};class Ua extends r{constructor(e){super(),this.name="EmbedOperationError",this.message=e}}async function ja({proxyFunction:e,networkCallDescriptor:t,proxyEndpointDescriptor:n}){if(n){const e={...Object.fromEntries([...E(t.options?.headers)??{}])},r=I({...t,options:{...t.options,headers:e}}),i=await fetch(n.path,{method:n.method,headers:n.options.headers,body:r}),o=P(await i.text());if(!i.ok)throw new S({code:i.status,data:o,message:`Error from proxy endpoint: ${i.status} ${i.statusText}`});return o}if(e){const n=Object.fromEntries([...E(t.options?.headers)??{}]),r=I({...t,options:{...t.options,headers:n}});return P(await e(r))}throw new Ua("No proxy function or proxy endpoint descriptor provided for proxy call.")}var Ma;function qa(e){return{id:e.id,nickname:e.nickname,embossedName:e.embossed_name,status:e.status,maskPan:e.mask_pan,expMonth:parseInt(e.exp_month,10),expYear:parseInt(e.exp_year,10),lastActivityAt:new Date(e.last_activity_at),lastDigits:e.last_digits,shipToBusiness:e.ship_to_business,atmOption:e.atm_option,atmDailyLimitOption:e.atm_daily_limit_option,nfcOption:e.nfc_option,onlineOption:e.online_option,foreignOption:e.foreign_option,atmMonthlyLimit:e.atm_monthly_limit,atmMonthlySpent:e.atm_monthly_spent,atmDailyLimit:e.atm_daily_limit,atmDailySpent:e.atm_daily_spent,paymentMonthlyLimit:e.payment_monthly_limit,paymentMonthlySpent:e.payment_monthly_spent,paymentDailyLimit:e.payment_daily_limit,paymentDailySpent:e.payment_daily_spent,paymentDailyLimitOption:e.payment_daily_limit_option,paymentTransactionLimit:e.payment_transaction_limit,paymentTransactionLimitOption:e.payment_transaction_limit_option,activeDays:e.active_days,holderId:e.holder_id,bankAccountId:e.bank_account_id,organizationId:e.organization_id,updatedAt:new Date(e.updated_at),createdAt:new Date(e.created_at),shippedAt:new Date(e.shipped_at),cardType:e.card_type,cardLevel:e.card_level,paymentLifespanLimit:e.payment_lifespan_limit,paymentLifespanSpent:e.payment_lifespan_spent,preExpiresAt:new Date(e.pre_expires_at),categories:e.categories,renewed:e.renewed,renewal:e.renewal,...e.parent_card_summary&&{parentCardSummary:{id:e.parent_card_summary.id,lastDigits:e.parent_card_summary.last_digits}},hadOperation:e.had_operation,hadPinOperation:e.had_pin_operation,cardDesign:e.card_design,typeOfPrint:e.type_of_print,upsold:e.upsold,upsell:e.upsell,discardOn:new Date(e.discard_on),reordered:e.reordered}}!function(e){e.PENDING="pending",e.ONHOLD="onhold",e.ORDER_CANCELED="order_canceled",e.LIVE="live",e.PAUSED="paused",e.STOLEN="stolen",e.LOST="lost",e.PIN_BLOCKED="pin_blocked",e.DELETED="deleted",e.PRE_EXPIRED="pre_expired",e.EXPIRED="expired",e.DISCARDED="discarded",e.SHIPPED_LOST="shipped_lost",e.ABUSIVE="abusive"}(Ma||(Ma={}));const Fa={getCards:async function(e){Na();const t=e?.cardSettings?.membershipId;if(t&&"string"!=typeof t)throw new x("membershipId must be a string");const{accessToken:n,stagingToken:r}=e?.operationSettings||{},i=n||o(),a=await async function({membershipId:e,accessToken:t,stagingToken:n}){const r=function({membershipId:e,accessToken:t,stagingToken:n}){return{path:e?`/v2/cards?holder_ids[]=${e}`:"/v2/cards",options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({membershipId:e,accessToken:t,stagingToken:n}),{cards:i}=await _(r);return i}({membershipId:t,accessToken:i,stagingToken:r});return a.map((e=>qa(e)))},getCard:async function({cardSettings:e,operationSettings:t}){!function(e){if(!e)throw new x("cardSettings parameter is required for the called function");if(!e.cardId)throw new x("cardId parameter is required for the called function");const t=D({cardId:e.cardId});if(t.length>0)throw new x(t)}(e);const n=e.cardId,{accessToken:r,stagingToken:i}=t||{},a=r||o(),s=await async function({cardId:e,accessToken:t,stagingToken:n}){const r=function({cardId:e,accessToken:t,stagingToken:n}){return{path:`/v2/cards?ids[]=${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({cardId:e,accessToken:t,stagingToken:n}),{cards:i}=await _(r);return i[0]}({cardId:n,accessToken:a,stagingToken:i});return qa(s)}},Ba=e=>({id:e?.id,slug:e.slug,iban:e.iban,bic:e.bic,currency:e.currency,balance:parseFloat(e.balance),balanceCents:e.balance_cents,authorizedBalance:e.authorized_balance,authorizedBalanceCents:e.authorized_balance_cents,name:e.name,updatedAt:new Date(e.updated_at),status:e.status,main:e.main}),$a={getOrganization:async({operationSettings:e}={})=>{const{accessToken:t,stagingToken:n}=e||{},r=t||o(),i=await(async({accessToken:e,stagingToken:t})=>{const n=(({accessToken:e,stagingToken:t})=>({path:"/v2/organization/",options:{method:"GET",headers:{accessToken:e,stagingToken:t}}}))({accessToken:e,stagingToken:t});return await _(n)})({accessToken:r,stagingToken:n});return{id:(a=i.organization).id,slug:a.slug,legalName:a.legal_name,legalNumber:a.legal_number,legalSector:a.legal_sector,legalRegistrationDate:a.legal_registration_date,legalAddress:a.legal_address,legalForm:a.legal_form,legalCountry:a.legal_country,legalShareCapital:a.legal_share_capital,locale:a.locale,contractSignedAt:a.contract_signed_at,bankAccounts:a.bank_accounts.map(Ba)};var a},getBankAccounts:async({operationSettings:e}={})=>{const{accessToken:t,stagingToken:n}=e||{},r=t||o(),i=await(async({accessToken:e,stagingToken:t})=>{const n=(({accessToken:e,stagingToken:t})=>({path:"/v2/bank_accounts/",options:{method:"GET",headers:{accessToken:e,stagingToken:t}}}))({accessToken:e,stagingToken:t});return await _(n)})({accessToken:r,stagingToken:n});return i.bank_accounts.map(Ba)}},Ka={AED:"AED",AUD:"AUD",BGN:"BGN",CAD:"CAD",CHF:"CHF",CNY:"CNY",CZK:"CZK",DKK:"DKK",EUR:"EUR",GBP:"GBP",GHS:"GHS",HKD:"HKD",HUF:"HUF",ILS:"ILS",INR:"INR",MXN:"MXN",NOK:"NOK",NZD:"NZD",PEN:"PEN",PLN:"PLN",RON:"RON",RSD:"RSD",SAR:"SAR",SEK:"SEK",SGD:"SGD",TRY:"TRY",USD:"USD",ZAR:"ZAR",ZMW:"ZMW"},Ha=e=>{if(!(e=>Object.values(Ka).includes(e))(e))throw new x(`currency ${e} is not valid, valid currencies are ${Object.values(Ka).join(", ")}`)},za={GOOD:"good",SERVICE:"service"},Va={UNIT:"unit",HOUR:"hour",DAY:"day",MONTH:"month",GRAM:"gram",KILOGRAM:"kilogram",LITER:"liter",METER:"meter",SQUARE_METER:"square_meter",CUBIC_METER:"cubic_meter",AMPERE:"ampere",NUMBER_OF_ARTICLES:"number_of_articles",CENTIMETER:"centimeter",CUBIC_METER_PER_HOUR:"cubic_meter_per_hour",GIGAJOULE:"gigajoule",GIGAWATT:"gigawatt",GIGAWATT_HOUR:"gigawatt_hour",HALF_YEAR:"half_year",JOULE:"joule",KILOJOULE:"kilojoule",KILOVAR:"kilovar",KILOWATT:"kilowatt",KILOWATT_HOUR:"kilowatt_hour",MEGAJOULE:"megajoule",MEGAWATT:"megawatt",MEGAWATT_HOUR:"megawatt_hour",MILLIGRAM:"milligram",MILLILITER:"milliliter",MILLIMETER:"millimeter",MINUTE:"minute",PAIR:"pair",QUARTER:"quarter",SECOND:"second",SET:"set",TON:"ton",TWO_WEEK:"two_week",WATT_HOUR:"watt_hour",WEEK:"week",YEAR:"year"},Ga=e=>{if(!(e=>Object.values(Va).includes(e))(e))throw new x(`unit ${e} is not valid, valid units are ${Object.values(Va).join(", ")}`)},Ja=[{name:"id"},{name:"title"},{name:"type"},{name:"quantity"},{name:"measureUnit"},{name:"unitPrice"},{name:"vatRate"}],Wa=[{name:"currency"},{name:"value"}];const Ya=e=>{if(!Object.values(za).includes(e))throw new x(`type ${e} is not valid, valid types are ${Object.values(za).join(", ")}`)};const Qa={getPaymentLinkCreationFlowUrl:async({paymentLinkSettings:e,operationSettings:t})=>{const{items:n}=e;!function(e){if(!e||!Array.isArray(e))return[];e.forEach((e=>{C(e,Ja),C(e.unitPrice,Wa);const t=[...D({id:e.id,title:e.title,vatRate:e.vatRate,currency:e.unitPrice.currency,measureUnit:e.measureUnit,unitPrice:e.unitPrice.value,...e.description?{description:e.description}:{}}),...L({quantity:e.quantity})].flat();if(t.length>0)throw new x(t);Ya(e.type),Ha(e.unitPrice.currency),Ga(e.measureUnit)}))}(n);const r=function(e){if(!e?.callbackUrl)throw new x("callbackUrl parameter is required for the payment link creation flow");if("string"!=typeof e.callbackUrl)throw new x("callbackUrl must be a string");if(""===e.callbackUrl.trim())throw new x("callbackUrl cannot be empty");return e.callbackUrl}(e),i=await U({requestSettings:{action:f.PAYMENT_LINK_CREATE,callbackUrl:r},operationSettings:t}),o=new URLSearchParams({...n?{items:JSON.stringify(n)}:{}});return o.toString()?`${i.url}?${o.toString()}`:i.url}};function Xa(e){return{id:e.id,initiatorId:e.initiator_id,bankAccountId:e.bank_account_id,amount:Number(e.amount),amountCents:Number(e.amount_cents),amountCurrency:e.amount_currency,status:e.status,beneficiaryId:e.beneficiary_id,reference:e.reference,note:e.note,declinedReason:e.declined_reason,scheduledDate:new Date(e.scheduled_date),createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),processedAt:new Date(e.processed_at),completedAt:new Date(e.completed_at),transactionId:e.transaction_id}}function Za(e){return{name:e.name,iban:e.iban}}const es="/v2/sepa",ts=`${es}/transfers`;async function ns({accessToken:e,stagingToken:t,paginationSettings:n}){const r=function({paginationSettings:e,accessToken:t,stagingToken:n}){const r={method:"GET",headers:{accessToken:t,stagingToken:n}},i=M(e),o=i.size?`?${i.toString()}`:"";return{path:`${ts}${o}`,options:r}}({paginationSettings:n,accessToken:e,stagingToken:t}),{transfers:i,meta:o}=await _(r);return{transfers:i,meta:o}}async function rs({accessToken:e,stagingToken:t,sepaTransferId:n}){const r=function({sepaTransferId:e,accessToken:t,stagingToken:n}){return{path:`${ts}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({sepaTransferId:n,accessToken:e,stagingToken:t}),{transfer:i}=await _(r);return i}async function is({transfer:e,vopProofToken:t,accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}){const a=function({transfer:e,vopProofToken:t,accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}){const a=function(e){const t=e.beneficiaryId||e.beneficiary?.id;return{bank_account_id:e.bankAccountId,beneficiary_id:t,amount:e.amount.toString(),reference:e.reference,...e.note?{note:e.note}:{},...e.scheduledDate?{scheduled_date:e.scheduledDate.toISOString().split("T")[0]}:{},...e.attachmentIds?{attachment_ids:e.attachmentIds}:{}}}(e);return{path:ts,options:{method:"POST",headers:{accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o},body:{transfer:a,vop_proof_token:t}}}}({transfer:e,vopProofToken:t,accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}),{transfer:s}=await _(a);return s}async function os({sepaTransferId:e,accessToken:t,stagingToken:n}){const r=function({sepaTransferId:e,accessToken:t,stagingToken:n}){return{path:`${ts}/${e}/cancel`,options:{method:"POST",headers:{accessToken:t,stagingToken:n}}}}({sepaTransferId:e,accessToken:t,stagingToken:n});await _(r)}async function as({sepaPayee:e,accessToken:t,stagingToken:n}){const r=function({sepaPayee:e,accessToken:t,stagingToken:n}){return{path:`${es}/verify_payee`,options:{method:"POST",headers:{accessToken:t,stagingToken:n},body:{beneficiary_name:e.name,iban:e.iban}}}}({sepaPayee:e,accessToken:t,stagingToken:n});return await _(r)}function ss(e){return{id:e.id,initiatorId:e.initiator_id,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),totalCount:Number(e.total_count),completedCount:Number(e.completed_count),failedCount:Number(e.failed_count),pendingCount:Number(e.pending_count),results:e.results.map((e=>({clientTransferId:e.client_transfer_id,transferId:e.transfer_id??null,errors:e.errors||null,status:e.status})))}}function cs(e){return{id:e.id,response:{matchResult:e.response.match_result,matchedName:e.response.matched_name}}}const us="/v2/sepa/bulk_transfers";async function ls({accessToken:e,stagingToken:t,paginationSettings:n}){const r=function({paginationSettings:e,accessToken:t,stagingToken:n}){const r={method:"GET",headers:{accessToken:t,stagingToken:n}},i=M(e),o=i.size?`?${i.toString()}`:"";return{path:`${us}${o}`,options:r}}({paginationSettings:n,accessToken:e,stagingToken:t}),{bulk_transfers:i,meta:o}=await _(r);return{bulkTransfers:i,meta:o}}async function ds({accessToken:e,stagingToken:t,bulkTransferId:n}){const r=function({bulkTransferId:e,accessToken:t,stagingToken:n}){return{path:`${us}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({bulkTransferId:n,accessToken:e,stagingToken:t}),{bulk_transfer:i}=await _(r);return i}async function fs({sepaPayees:e,accessToken:t,stagingToken:n}){const r=function({sepaPayees:e,accessToken:t,stagingToken:n}){return{path:`${es}/bulk_verify_payee`,options:{method:"POST",headers:{accessToken:t,stagingToken:n},body:{requests:e.map(Za)}}}}({sepaPayees:e,accessToken:t,stagingToken:n});return await _(r)}function ps(e){if(!e)throw new x("bulkTransferSettings parameter is required for the called function.");if(!e.bankAccountId)throw new x("bankAccountId is required");if(!Array.isArray(e.bulkTransfers))throw new x("bulkTransfers must be an array");if(e.bulkTransfers.length>400)throw new x("Maximum of 400 bulk transfers allowed");return e.bulkTransfers.forEach(((e,t)=>{!function(e,t){if(!e)throw new x(`Invalid bulkTransfer at index ${t}: bulkTransfer object is required`);if(!e.beneficiary)throw new x(`Invalid bulkTransfer at index ${t}: Beneficiary details must be provided in the bulkTransferSettings.beneficiary field`);if(!e.beneficiary.iban)throw new x(`Invalid bulkTransfer at index ${t}: IBAN is required as part of the beneficiary details`);if(!e.beneficiary.name)throw new x(`Invalid bulkTransfer at index ${t}: Beneficiary name is required as part of the beneficiary details`);const n=D({reference:e.reference,clientTransferId:e.clientTransferId,note:e.note}),r=L({amount:e.amount}),i=[...n,...r].flat();if(i.length>0)throw new x(i);if(e.amount>l&&(!e.attachmentsIds||0===e.attachmentsIds.length))throw new x(`Invalid bulkTransfer at index ${t}: Attachments are required for transfers over €30000`)}(e,t)})),e}const gs={requiresUI:!1};function hs(e,{requiresUI:t}=gs){const n=e?.uiParentElementId||k.getUIParentElementId();if(t){if(!n)throw new x("operationSettings parameter must have a uiParentElementId for the called function.\nYou can pass it either to the initialize function or in a per function basis.");if(!["string","function"].includes(typeof n))throw new x("operationSettings.uiParentElementId must be a string or a function returning an HTMLElement")}const r=e?.mfaPreference||k.getMFAPreference();if(r){const e=(i=Object.values(u),y.isProductionEnvironment()?i.filter((e=>e!==u.MOCK)):i);if(!e.includes(r))throw new x(`operationSettings.mfaPreference must be one of ${e.join(", ")}`);if(y.isProductionEnvironment()&&r===u.MOCK)throw new x("operationSettings.mfaPreference cannot be set to mock in production environment.")}var i;const o=e?.debugMode||k.getDebugMode();if(void 0!==o&&"boolean"!=typeof o)throw new x("operationSettings.debugMode must be a boolean.");const a=e?.proxyRequestFunction||k.getProxyRequestFunction();if(a&&"function"!=typeof a)throw new x("operationSettings.proxyRequestFunction must be a function.");const s=e?.proxyEndpointDescriptor||k.getProxyEndpointDescriptor();if(s&&!s.path)throw new x("operationSettings.proxyEndpointDescriptor must have at least a string-formatted path property.");return{...e,uiParentElementId:n,mfaPreference:r,debugMode:o,proxyRequestFunction:a,proxyEndpointDescriptor:s}}async function vs({sepaTransferSettings:e,operationSettings:t}){return e?.beneficiary?e.beneficiary:await async function({beneficiarySettings:e,operationSettings:t}){const n=ne(e?.beneficiaryId),{proxyRequestFunction:r,proxyEndpointDescriptor:i,accessToken:a,stagingToken:s}=hs(t||{});if(r||i){const e=Y({beneficiaryId:n});return V((await ja({proxyFunction:r,proxyEndpointDescriptor:i,networkCallDescriptor:e})).body.beneficiary)}{const e=a||o();return V(await Q({beneficiaryId:n,accessToken:e,stagingToken:s}))}}({beneficiarySettings:{beneficiaryId:e?.beneficiaryId},operationSettings:t})}function ms(e,t){const n=t?.locale||T.getLocale(),r=new URL(e);return n&&r.searchParams.append("lang",n),t?.mfaPreference&&r.searchParams.append("mfaPreference",t.mfaPreference),t?.idempotencyKey&&r.searchParams.append("idempotencyKey",t.idempotencyKey),r.toString()}const ys=[{name:"bankAccountId"},{name:"reference"},{name:"amount"}];const bs={getSepaTransfers:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i=t||o(),a=await ns({accessToken:i,stagingToken:n,paginationSettings:r}),s=a.transfers.map(Xa),c=q(a.meta);return{transfers:s,...c?{meta:c}:{}}},getSepaTransfer:async function({sepaTransferSettings:e,operationSettings:t}){const n=function(e){if(!e)throw new x("sepaTransferId parameter is required for the called function");if(e&&"string"!=typeof e)throw new x("sepaTransferId must be a string");return e}(e?.sepaTransferId),{accessToken:r,stagingToken:i}=t||{},a=r||o();return Xa(await rs({sepaTransferId:n,accessToken:a,stagingToken:i}))},createSepaTransfer:async function*({sepaTransferSettings:e,operationSettings:t}){const{accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:a}=t||{},s=n||o(),c=a||z();!function(e){if(!e)throw new x("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new x("sepaTransferSettings must be an object");if(!e.beneficiaryId&&!e.beneficiary)throw new x("Either beneficiaryId or beneficiary must be provided");const t=D({beneficiaryId:e.beneficiaryId});if(t.length>0)throw new x(t)}(e);const u=e?.beneficiary?e.beneficiary:await vs({sepaTransferSettings:e,operationSettings:t}),f={name:u.name,iban:u.iban},p=await as({sepaPayee:f,accessToken:s,stagingToken:r}),g=yield(h=p,{matchResult:h.match_result,matchedName:h.matched_name});var h;let v;if("string"==typeof g){if(g===d)return}else{if(g.vopDecision===d)return;v=g.sepaTransferSettings}const m={...e,...v};!function(e){if(!e)throw new x("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new x("sepaTransferSettings must be an object");C(e,ys);const t=[...D({bankAccountId:e.bankAccountId,note:e.note,reference:e.reference}),...L({amount:e.amount})].flat();if(t.length>0)throw new x(t);if(e.amount>l&&(!e.attachmentIds||0===e.attachmentIds.length))throw new x("Attachments are required for transfers over €30,000")}(m);const y={...m,beneficiary:u};return{transfer:Xa(await is({transfer:y,vopProofToken:p.proof_token.token,accessToken:s,stagingToken:r,scaSessionToken:i,idempotencyKey:c})),meta:{idempotencyKey:c}}},cancelSepaTransfer:async function({sepaTransferSettings:e,operationSettings:t}){const n=function(e){if(!e)throw new x("sepaTransferId parameter is required for the called function");if("string"!=typeof e)throw new x("sepaTransferId must be a string");return e}(e?.sepaTransferId),{accessToken:r,stagingToken:i}=t||{},a=r||o();await os({sepaTransferId:n,accessToken:a,stagingToken:i})},getSepaTransferCreationFlowLink:async function({sepaTransferSettings:e,operationSettings:t}){const n=function(e){if(!e||!e.callbackUrl)throw new x("callbackUrl parameter is required for the getSepaTransferCreationFlowLink function");if("string"!=typeof e.callbackUrl)throw new x("callbackUrl must be a string");return e.callbackUrl}(e),{accessToken:r,stagingToken:i}=t||{},a=r||o(),s=await async function({requestSettings:e,operationSettings:t}){N(e);const{proxyRequestFunction:n,proxyEndpointDescriptor:r,stagingToken:i}=hs(t||{});if(n||r){const t=A({stagingToken:i,action:e.action,callbackUrl:e.callbackUrl});return R((await ja({proxyFunction:n,proxyEndpointDescriptor:r,networkCallDescriptor:t})).body)}{const n=t?.accessToken||o();return R(await O({accessToken:n,stagingToken:i,action:e.action,callbackUrl:e.callbackUrl}))}}({requestSettings:{action:f.SEPA_TRANSFER_CREATE,callbackUrl:n},operationSettings:{stagingToken:i,accessToken:a}});return{...s,url:ms(s.url,t)}},bulkTransfers:{getBulkTransfers:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i=t||o(),a=await ls({accessToken:i,stagingToken:n,paginationSettings:r}),s=a.bulkTransfers?.map(ss),c=q(a.meta);return{bulkTransfers:s,...c?{meta:c}:{}}},getBulkTransfer:async function({bulkTransferSettings:e,operationSettings:t}){const n=function(e){if(!e)throw new x("bulkTransferId parameter is required for the called function.");if("string"!=typeof e)throw new x("bulkTransferId must be a string.");return e}(e?.bulkTransferId),{accessToken:r,stagingToken:i}=t||{},a=r||o();return ss(await ds({accessToken:a,stagingToken:i,bulkTransferId:n}))},createBulkTransfer:async function*({bulkTransferSettings:e,operationSettings:t}){const{accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:a}=t||{},s=n||o(),c=a||z(),u=ps(e),l=new Map;for(const e of u.bulkTransfers){const t=e.beneficiary;if(t){const e=t.iban;e&&!l.has(e)&&l.set(e,{name:t.name,iban:e})}}const f=Array.from(l.values()),p=await fs({sepaPayees:f,accessToken:s,stagingToken:r});if((yield p.requests.map(cs))===d)return;const g=await async function({bulkTransfers:e,accessToken:t,stagingToken:n,scaSessionToken:r,bankAccountId:i,idempotencyKey:o}){const a={method:"POST",headers:{...E({accessToken:t,stagingToken:n,scaSessionToken:r,idempotencyKey:o})},body:JSON.stringify({bank_account_id:i,bulk_transfers:e.map((e=>function(e){return{beneficiary_id:e.beneficiaryId||e.beneficiary?.id,client_transfer_id:e.clientTransferId,amount:e.amount.toString(),reference:e.reference,...e.note?{note:e.note}:{},...e.scheduledDate?{scheduled_date:e.scheduledDate.toISOString().split("T")[0]}:{},...e.attachmentsIds?{attachment_ids:e.attachmentsIds}:{}}}(e)))})},s=new URL(`${y.getEnvironmentUrls().THIRD_PARTY_API_URL}${us}`),c=await fetch(s,a),u=await c.json();if(!c.ok||u.errors)throw new S({message:u.errors?u.errors.map((e=>`${e.code}: ${e.detail}`)).join(", "):"Failed to create SEPA bulk transfer"});return u.bulk_transfer}({bulkTransfers:u.bulkTransfers,bankAccountId:u.bankAccountId,accessToken:s,stagingToken:r,scaSessionToken:i,idempotencyKey:c});return{bulkTransfer:ss(g),meta:{idempotencyKey:c}}}}},Ts="/v2/transactions";async function ws(e){const t=function({bankAccountId:e,iban:t,status:n,updatedAtFrom:r,updatedAtTo:i,emittedAtFrom:o,emittedAtTo:a,settledAtFrom:s,settledAtTo:c,side:u,operationType:l,withAttachments:d,paginationSettings:f,accessToken:p,stagingToken:g}){const h={method:"GET",headers:{accessToken:p,stagingToken:g}},v=new URLSearchParams;e&&v.append("bank_account_id",e),t&&v.append("iban",t),n&&v.append("status",n),r&&v.append("updated_at_from",r),i&&v.append("updated_at_to",i),o&&v.append("emitted_at_from",o),a&&v.append("emitted_at_to",a),s&&v.append("settled_at_from",s),c&&v.append("settled_at_to",c),u&&v.append("side",u),l&&v.append("operation_type",l),void 0!==d&&v.append("with_attachments",String(d));const m=M(f);for(const[e,t]of m)v.append(e,t);const y=v.toString();return{path:`${Ts}${y?`?${y}`:""}`,options:h}}(e),{transactions:n,meta:r}=await _(t);return{transactions:n,meta:r}}async function ks(e){const t=function({transactionId:e,accessToken:t,stagingToken:n}){return{path:`${Ts}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}(e),{transaction:n}=await _(t);return n}function Ss(e){return{transactionId:e.transaction_id,amount:e.amount,amountCents:e.amount_cents,settledBalance:e.settled_balance,settledBalanceCents:e.settled_balance_cents,attachmentIds:e.attachment_ids,localAmount:e.local_amount,localAmountCents:e.local_amount_cents,side:e.side,operationType:e.operation_type,currency:e.currency,localCurrency:e.local_currency,label:e.label,settledAt:new Date(e.settled_at),emittedAt:new Date(e.emitted_at),updatedAt:new Date(e.updated_at),status:e.status,note:e.note,reference:e.reference,vatAmount:e.vat_amount,vatAmountCents:e.vat_amount_cents,vatRate:e.vat_rate,initiatorId:e.initiator_id,labelIds:e.label_ids,attachmentLost:e.attachment_lost,attachmentRequired:e.attachment_required,cardLastDigits:e.card_last_digits,category:e.category,cashflowCategory:{name:e.cashflow_category?.name||""},cashflowSubcategory:{name:e.cashflow_subcategory?.name||""},id:e.id,subjectType:e.subject_type,...e.transfer?{transfer:{counterpartyAccountNumber:e.transfer.counterparty_account_number,counterpartyName:e.transfer.counterparty_name,counterpartyBic:e.transfer.counterparty_bic,counterpartyIban:e.transfer.counterparty_iban}}:{}}}const Es={getTransactions:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i={...e?.transactionSettings||{},paginationSettings:r},a=t||o(),s=await ws({...i,accessToken:a,stagingToken:n});return{transactions:s.transactions.map(Ss),meta:q(s.meta)}},getTransaction:async function({transactionSettings:e,operationSettings:t}){const{accessToken:n,stagingToken:r}=t||{},{transactionId:i}=function(e){if(!e)throw new x("transactionSettings parameter is required for the called function");if(!e.transactionId)throw new x("transactionSettings.transactionId parameter is required for the called function");if(e.transactionId&&"string"!=typeof e.transactionId)throw new x("transactionSettings.transactionId must be a string.");return e}(e),a=n||o();return Ss(await ks({transactionId:i,accessToken:a,stagingToken:r}))}};e.authLinks=j,e.beneficiaries=re,e.cards=Fa,e.organizations=$a,e.paymentLinks=Qa,e.sepaTransfers=bs,e.transactions=Es}));
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).QontoEmbedServer={})}(this,(function(e){"use strict";function t(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(n){if("default"!==n&&!(n in e)){var r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:function(){return t[n]}})}}))})),Object.freeze(e)}class n{constructor(){this.accessToken=null,this.stagingToken=null}static getInstance(){return n.instance||(n.instance=new n),n.instance}setAccessToken(e){this.accessToken=e}getAccessToken(){return this.accessToken}hasAccessToken(){return null!==this.accessToken&&""!==this.accessToken}clearAccessToken(){this.accessToken=null}setStagingToken(e){this.stagingToken=e}getStagingToken(){return this.stagingToken}hasStagingToken(){return null!==this.stagingToken&&""!==this.stagingToken}clearStagingToken(){this.stagingToken=null}}const r=n.getInstance();class i extends Error{constructor(){super(),this.stack=""}toString(){return`${this.name}: ${this.message}`}}class o extends i{constructor(){super(),this.name="AuthenticationError",this.message="Authentication failed due to missing or invalid authentication method. Provide either a proxyRequestFunction (recommended) or accessToken, either as parameters or by calling the initialize function first."}}function s(){if(!r.hasAccessToken())throw new o;return r.getAccessToken()}function a(){return!("undefined"!=typeof window&&"undefined"!=typeof document)}const c={PRODUCTION:"production",STAGING:"staging",LOCAL:"local"},u={MASTER:"master",SANDBOX:"sandbox",QA:"qa"},l={PASSKEY:"passkey",SMS_OTP:"sms-otp",PAIRED_DEVICE:"paired-device",MOCK:"mock"},d=3e4,f="REJECT",p={CARD_DISPLAY:"display_card",PAYMENT_LINK_CREATE:"create_payment_link",SEPA_TRANSFER_CREATE:"create_sepa_transfer"},g="https://embed.qonto.com",h="https://embed-js{branch}.staging.qonto.co",v="https://embed.dev.qonto.co",m={[c.PRODUCTION]:{EMBED_BASE_URL:g,EMBED_URL:`${g}/connect`,THIRD_PARTY_API_URL:"https://thirdparty.qonto.com"},[c.STAGING]:{EMBED_BASE_URL:h,EMBED_URL:`${h}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"},[c.LOCAL]:{EMBED_BASE_URL:v,EMBED_URL:`${v}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"}};class y{constructor(){let e,t;this.environment=c.PRODUCTION,this.branch=u.SANDBOX,"undefined"!=typeof process&&process.env&&(e=process.env.QONTO_EMBED_ENVIRONMENT,t=process.env.QONTO_EMBED_BRANCH),this.environment=Object.values(c).includes(e)?e:c.PRODUCTION,this.branch=Object.values(u).includes(t)?t:u.SANDBOX}static getInstance(){return y.instance||(y.instance=new y),y.instance}setEnvironment(e){this.environment=e}getEnvironment(){return this.environment}isProductionEnvironment(){return this.environment===c.PRODUCTION}setBranch(e){this.branch=e}getBranch(){return this.branch}clear(){this.environment=c.PRODUCTION,this.branch=u.MASTER}getEnvironmentUrls(){if(this.environment===c.PRODUCTION)return m.production;{const e=m[this.environment];return Object.entries(e).reduce(((e,[t,n])=>({...e,[t]:n.replace("{branch}",`-${this.branch}`)})),{})}}}const b=y.getInstance();class T{constructor(){this.currentLocale="en"}static getInstance(){return T.instance||(T.instance=new T),T.instance}setLocale(e){this.currentLocale=e}getLocale(){return this.currentLocale}setDefaultLocale(){this.currentLocale="en"}}const w=T.getInstance();class k{constructor(){this.mfaPreference=l.PASSKEY,this.debugMode=!1}static getInstance(){return k.instance||(k.instance=new k),k.instance}setSettings(e){e.uiParentElementId&&(this.uiParentElementId=e.uiParentElementId),e.mfaPreference&&(this.mfaPreference=e.mfaPreference),e.debugMode&&(this.debugMode=e.debugMode),e.proxyRequestFunction&&(this.proxyRequestFunction=e.proxyRequestFunction),e.proxyEndpointDescriptor&&(this.proxyEndpointDescriptor=e.proxyEndpointDescriptor)}getUIParentElementId(){return this.uiParentElementId}getMFAPreference(){return this.mfaPreference}getDebugMode(){return this.debugMode}getProxyRequestFunction(){return this.proxyRequestFunction}getProxyEndpointDescriptor(){return this.proxyEndpointDescriptor}clearSettings(){this.uiParentElementId=void 0,this.mfaPreference=l.PASSKEY,this.debugMode=!1,this.proxyRequestFunction=void 0,this.proxyEndpointDescriptor=void 0}getSettings(){return{uiParentElementId:this.uiParentElementId,mfaPreference:this.mfaPreference,debugMode:this.debugMode,proxyRequestFunction:this.proxyRequestFunction}}}const S=k.getInstance();class E extends i{constructor({message:e,data:t,code:n}){super(),this.code=500;const r=Array.isArray(e)?e.join("\n"):e;this.name="EmbedApiError",this.message=`The call to the Embed API failed with the following errors:\n${r}`,this.data=t||{},this.code=n||this.code}}function _({accessToken:e,stagingToken:t,idempotencyKey:n,mfaPreference:i,scaSessionToken:o}){const s=new Headers;s.append("Authorization",`Bearer ${e}`);const a=t||r.getStagingToken();a&&s.append("X-Qonto-Staging-Token",a),n&&s.append("X-Qonto-Idempotency-Key",n);const c=i||S.getMFAPreference();return c&&s.append("X-Qonto-2fa-Preference",c),o&&s.append("X-Qonto-SCA-Session-Token",o),s.append("Content-Type","application/json"),s.append("Accept-Language",w.getLocale()),s}async function I({path:e,options:t}){const n=`${b.getEnvironmentUrls().THIRD_PARTY_API_URL}${e}`,r=await fetch(n,{...t,headers:_(t.headers),body:t.body?JSON.stringify(t.body):void 0});if(204===r.status)return;const i=await r.json();if(!r.ok)throw i.errors?new E({code:r.status,message:i.errors.map((e=>`${e.code}: ${e.detail}`))}):new E({code:r.status,message:`${i.code}: ${i.detail}`,data:i});return i}function P(e){const t={method:e.options.method,headers:e.options.headers,path:e.path,payload:e.options?.body},n=JSON.stringify(t);return r=n,a()?Buffer.from(r).toString("base64"):btoa(r);var r}function A(e){return JSON.parse((t=e,a()?Buffer.from(t,"base64").toString("utf-8"):atob(t)));var t}function O({accessToken:e,stagingToken:t,action:n,callbackUrl:r}){const i={post_authn_action:n};return r&&(i.callback_url=r),{path:"/v1/embed_auth_links",options:{method:"POST",headers:{accessToken:e,stagingToken:t},body:{embed_auth_link:i}}}}async function C(e){const t=O({accessToken:e.accessToken,stagingToken:e.stagingToken,action:e.action,callbackUrl:e.callbackUrl}),{embed_auth_link:n}=await I(t);return{url:n.url,post_authn_action:n.post_authn_action,callback_url:n.callback_url,expired_at:n.expired_at,used_at:n.used_at}}function x(e){return{url:e.url,postAuthAction:e.post_authn_action,callbackUrl:e.callback_url,expiresAt:e.expired_at,usedAt:e.used_at}}class R extends i{constructor(e){super(),this.name="InvalidParametersError",this.invalidParameters=Array.isArray(e)?e:[e],this.message=`Invalid parameters were passed to the function:\n${this.invalidParameters.map((e=>e)).join("\n")}`}}function D(e,t){const n=t.filter((t=>t.requiredIfPresent?!e[t.name]&&e[t.requiredIfPresent]:void 0===e[t.name])).map((e=>e.name));if(n.length>0)throw new R(n.map((e=>`Missing required parameter: ${e}`)))}function L(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"string"!=typeof e)).map((([e])=>`${e} must be a string`))}function N(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"number"!=typeof e)).map((([e])=>`${e} must be a number`))}function U(e){if(!e||"object"!=typeof e)throw new R("requestSettings must be an object");const t=e,{action:n,callbackUrl:r}=e;D(t,[{name:"action"}]);const i=L(t),o=Object.values(p);if(o.includes(n)||i.push(`action must be one of ${o.join(", ")}`),i.length>0)throw new R(i);if(void 0!==r&&""===r.trim())throw new R("callbackUrl cannot be empty")}async function M({requestSettings:e,operationSettings:t}){U(e);const{accessToken:n,stagingToken:r}=t||{},i=n||s();return x(await C({accessToken:i,stagingToken:r,action:e.action,callbackUrl:e.callbackUrl}))}const j={request:M};function q(e){const t=new URLSearchParams;return e?.page&&t.append("page",e.page.toString()),e?.itemsPerPage&&t.append("per_page",e.itemsPerPage.toString()),t}function F(e){if(e)return{totalItems:e?.total_count,totalPages:e?.total_pages,currentPage:e?.current_page,itemsPerPage:e?.per_page,previousPage:e?.prev_page||null,nextPage:e?.next_page||null}}const B=[];for(let e=0;e<256;++e)B.push((e+256).toString(16).slice(1));let $;const H=new Uint8Array(16);var K={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};function z(e,t,n){const r=(e=e||{}).random??e.rng?.()??function(){if(!$){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");$=crypto.getRandomValues.bind(crypto)}return $(H)}();if(r.length<16)throw new Error("Random bytes length must be >= 16");return r[6]=15&r[6]|64,r[8]=63&r[8]|128,function(e,t=0){return(B[e[t+0]]+B[e[t+1]]+B[e[t+2]]+B[e[t+3]]+"-"+B[e[t+4]]+B[e[t+5]]+"-"+B[e[t+6]]+B[e[t+7]]+"-"+B[e[t+8]]+B[e[t+9]]+"-"+B[e[t+10]]+B[e[t+11]]+B[e[t+12]]+B[e[t+13]]+B[e[t+14]]+B[e[t+15]]).toLowerCase()}(r)}function G(e,t,n){return K.randomUUID&&!e?K.randomUUID():z(e)}function J(e){return{id:e.id,name:e.name,email:e.email,activityTag:e.activity_tag,iban:e.iban,bic:e.bic,currency:e.currency,status:e.status,trusted:e.trusted,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at)}}function V(e){return{name:e.name,...e.email&&{email:e.email},...e.activityTag&&{activity_tag:e.activityTag},iban:e.iban,...e.bic&&{bic:e.bic}}}const W="/v2/sepa/beneficiaries";async function Y({paginationSettings:e,accessToken:t,stagingToken:n}){const r=function({paginationSettings:e,accessToken:t,stagingToken:n}){const r={method:"GET",headers:{accessToken:t,stagingToken:n}},i=q(e),o=i.size?`?${i.toString()}`:"";return{path:`${W}${o}`,options:r}}({paginationSettings:e,accessToken:t,stagingToken:n}),{beneficiaries:i,meta:o}=await I(r);return{beneficiaries:i,meta:o}}function Q({beneficiaryId:e,accessToken:t,stagingToken:n}){return{path:`${W}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}async function X({accessToken:e,stagingToken:t,beneficiaryId:n}){const r=Q({beneficiaryId:n,accessToken:e,stagingToken:t}),{beneficiary:i}=await I(r);return i}async function Z({beneficiary:e,accessToken:t,stagingToken:n,idempotencyKey:r=G()}){const i=function({beneficiary:e,accessToken:t,stagingToken:n,idempotencyKey:r=G()}){return{path:W,options:{method:"POST",headers:{accessToken:t,stagingToken:n,idempotencyKey:r},body:{beneficiary:V(e)}}}}({beneficiary:e,accessToken:t,stagingToken:n,idempotencyKey:r}),{beneficiary:o}=await I(i);return o}async function ee({beneficiaryIds:e,accessToken:t,stagingToken:n}){const r=function({beneficiaryIds:e,accessToken:t,stagingToken:n}){return{path:`${W}/untrust`,options:{method:"PATCH",headers:{accessToken:t,stagingToken:n},body:{ids:e}}}}({beneficiaryIds:e,accessToken:t,stagingToken:n}),{beneficiaries:i}=await I(r);return i}async function te({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i}){const o=function({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i}){const{name:o,email:s,activityTag:a}=e,c={method:"PATCH",headers:{accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i},body:{beneficiary:{name:o,email:s,activity_tag:a}}};return{path:`${W}/${e.id}`,options:c}}({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:n,idempotencyKey:r,mfaPreference:i}),{beneficiary:s}=await I(o);return s}const ne=[{name:"name"},{name:"iban"}];function re(e){if(!e)throw new R("beneficiaryId parameter is required for the called function");if(e&&"string"!=typeof e)throw new R("beneficiaryId must be a string");return e}const ie={getBeneficiaries:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i=t||s(),o=await Y({accessToken:i,stagingToken:n,paginationSettings:r}),a=o.beneficiaries.map((e=>J(e))),c=F(o.meta);return{beneficiaries:a,...c?{meta:c}:{}}},getBeneficiary:async function({beneficiarySettings:e,operationSettings:t}){const n=re(e?.beneficiaryId),{accessToken:r,stagingToken:i}=t||{},o=r||s();return J(await X({beneficiaryId:n,accessToken:o,stagingToken:i}))},addBeneficiary:async function({beneficiarySettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("beneficiary parameter is required for the called function");if("object"!=typeof e)throw new R("beneficiary must be an object");D(e,ne);const t=L({name:e.name,iban:e.iban,email:e.email,activityTag:e.activityTag,bic:e.bic});if(t.length>0)throw new R(t);return e}(e),{accessToken:r,stagingToken:i,idempotencyKey:o}=t||{},a=r||s();return J(await Z({beneficiary:n,accessToken:a,stagingToken:i,idempotencyKey:o}))},updateBeneficiary:async function({beneficiarySettings:e,operationSettings:t}){const n=function(e){const{id:t,name:n,email:r,activityTag:i}=e||{};if(!t)throw new R("Invalid parameters were passed to the function:\nA beneficiary ID is required for the called function");if(!n&&!r&&!i)throw new R("Invalid parameters were passed to the function:\nAt least one of the following properties must be provided: name, email, activityTag");const o=L({name:n,email:r,activityTag:i});if(o.length>0)throw new R(o);return{id:t,name:n,email:r,activityTag:i}}(e),{accessToken:r,stagingToken:i,idempotencyKey:o,mfaPreference:a}=t||{},c={beneficiaryParamsBeingEdited:n,accessToken:r||s(),stagingToken:i,idempotencyKey:o,mfaPreference:a};return J(await te(c))},untrustBeneficiaries:async function({beneficiarySettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("beneficiaryIds parameter is required for the called function");if(!Array.isArray(e)||!e.every((e=>"string"==typeof e)))throw new R("beneficiaryIds must be an array of strings");return e}(e?.beneficiaryIds),{accessToken:r,stagingToken:i}=t||{},o=r||s();return(await ee({beneficiaryIds:n,accessToken:o,stagingToken:i})).map(J)}},oe="SDK Initialized",se="Cards List";var ae=function(e,t){return ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},ae(e,t)};function ce(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function n(){this.constructor=e}ae(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}var ue,le,de=function(){return de=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},de.apply(this,arguments)};function fe(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]])}return n}function pe(e,t,n,r){return new(n||(n=Promise))((function(i,o){function s(e){try{c(r.next(e))}catch(e){o(e)}}function a(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(s,a)}c((r=r.apply(e,t||[])).next())}))}function ge(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(c){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&a[0]?r.return:a[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,a[1])).done)return i;switch(r=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,r=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],r=0}finally{n=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,c])}}}function he(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function ve(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}function me(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError,function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(ue||(ue={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(le||(le={}));var ye,be="AMP",Te="".concat(be,"_unsent"),we="$default_instance",ke="https://api2.amplitude.com/2/httpapi",Se="dclid",Ee="fbclid",_e="gbraid",Ie="gclid",Pe="ko_click_id",Ae="li_fat_id",Oe="msclkid",Ce="rdt_cid",xe="ttclid",Re="twclid",De="wbraid",Le={utm_campaign:void 0,utm_content:void 0,utm_id:void 0,utm_medium:void 0,utm_source:void 0,utm_term:void 0,referrer:void 0,referring_domain:void 0,dclid:void 0,gbraid:void 0,gclid:void 0,fbclid:void 0,ko_click_id:void 0,li_fat_id:void 0,msclkid:void 0,rdt_cid:void 0,ttclid:void 0,twclid:void 0,wbraid:void 0},Ne=["access-control-allow-origin","access-control-allow-credentials","access-control-expose-headers","access-control-max-age","access-control-allow-methods","access-control-allow-headers","accept-patch","accept-ranges","age","allow","alt-svc","cache-control","connection","content-disposition","content-encoding","content-language","content-length","content-location","content-md5","content-range","content-type","date","delta-base","etag","expires","im","last-modified","link","location","permanent","p3p","pragma","proxy-authenticate","public-key-pins","retry-after","server","status","strict-transport-security","trailer","transfer-encoding","tk","upgrade","vary","via","warning","www-authenticate","x-b3-traceid","x-frame-options"],Ue=["authorization","cookie","set-cookie"],Me=function(e){if(Object.keys(e).length>1e3)return!1;for(var t in e){var n=e[t];if(!je(t,n))return!1}return!0},je=function(e,t){var n,r;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;if(Array.isArray(a))return!1;if("object"==typeof a)i=i&&Me(a);else if(!["number","string"].includes(typeof a))return!1;if(!i)return!1}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}}else{if(null==t)return!1;if("object"==typeof t)return Me(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},qe=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return de({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(ye.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(ye.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(ye.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(ye.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(ye.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(ye.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(ye.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(ye.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(ye.UNSET,e,"-"),this},e.prototype.clearAll=function(){return this._properties={},this._properties[ye.CLEAR_ALL]="-",this},e.prototype._safeSet=function(e,t,n){if(this._validate(e,t,n)){var r=this._properties[e];return void 0===r&&(r={},this._properties[e]=r),r[t]=n,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,n){return void 0===this._properties[ye.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===ye.ADD?"number"==typeof n:e===ye.UNSET||e===ye.REMOVE||je(t,n)))},e}();!function(e){e.SET="$set",e.SET_ONCE="$setOnce",e.ADD="$add",e.APPEND="$append",e.PREPEND="$prepend",e.REMOVE="$remove",e.PREINSERT="$preInsert",e.POSTINSERT="$postInsert",e.UNSET="$unset",e.CLEAR_ALL="$clearAll"}(ye||(ye={}));var Fe,Be=[ye.CLEAR_ALL,ye.UNSET,ye.SET,ye.SET_ONCE,ye.ADD,ye.APPEND,ye.PREPEND,ye.PREINSERT,ye.POSTINSERT,ye.REMOVE];!function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.PayloadTooLarge="payload_too_large",e.Invalid="invalid",e.Failed="failed",e.Timeout="Timeout",e.SystemError="SystemError"}(Fe||(Fe={}));var $e,He=function(e,t,n){return void 0===t&&(t=0),void 0===n&&(n=Fe.Unknown),{event:e,code:t,message:n}},Ke=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},ze=me([],ve(Array(256).keys()),!1).map((function(e){return e.toString(16).padStart(2,"0")})),Ge=function(e){var t,n=Ke();if(!(null===(t=null==n?void 0:n.crypto)||void 0===t?void 0:t.getRandomValues))return function(e){return e?(e^16*Math.random()>>e/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,Ge)}(e);var r=n.crypto.getRandomValues(new Uint8Array(16));return r[6]=15&r[6]|64,r[8]=63&r[8]|128,me([],ve(r.entries()),!1).map((function(e){var t=ve(e,2),n=t[0],r=t[1];return[4,6,8,10].includes(n)?"-".concat(ze[r]):ze[r]})).join("")},Je=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this._optOutListeners=[]}return e.prototype.register=function(e,t){var n,r;return pe(this,void 0,void 0,(function(){return ge(this,(function(i){switch(i.label){case 0:return this.plugins.some((function(t){return t.name===e.name}))?(this.loggerProvider.warn("Plugin with name ".concat(e.name," already exists, skipping registration")),[2]):(void 0===e.name&&(e.name=Ge(),this.loggerProvider.warn("Plugin name is undefined. \n Generating a random UUID for plugin name: ".concat(e.name,". \n Set a name for the plugin to prevent it from being added multiple times."))),e.type=null!==(n=e.type)&&void 0!==n?n:"enrichment",[4,null===(r=e.setup)||void 0===r?void 0:r.call(e,t,this.client)]);case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e,t){var n;return pe(this,void 0,void 0,(function(){var r,i;return ge(this,(function(o){switch(o.label){case 0:return r=this.plugins.findIndex((function(t){return t.name===e})),-1===r?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(i=this.plugins[r],this.plugins.splice(r,1),[4,null===(n=i.teardown)||void 0===n?void 0:n.call(i)]);case 1:return o.sent(),[2]}}))}))},e.prototype.reset=function(e){this._clearOptOutListeners(),this.applying=!1,this.plugins.map((function(e){var t;return null===(t=e.teardown)||void 0===t?void 0:t.call(e)})),this.plugins=[],this.client=e},e.prototype.push=function(e){var t=this;return new Promise((function(n){t.queue.push([e,n]),t.scheduleApply(0)}))},e.prototype.scheduleApply=function(e){var t=this;this.applying||(this.applying=!0,setTimeout((function(){t.apply(t.queue.shift()).then((function(){t.applying=!1,t.queue.length>0&&t.scheduleApply(0)}))}),e))},e.prototype.apply=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c,u,l,d,f,p,g,h,v,m,y,b,T;return ge(this,(function(w){switch(w.label){case 0:if(!e)return[2];t=ve(e,1),n=t[0],r=ve(e,2),i=r[1],this.loggerProvider.log("Timeline.apply: Initial event",n),o=this.plugins.filter((function(e){return"before"===e.type})),w.label=1;case 1:w.trys.push([1,6,7,8]),s=he(o),a=s.next(),w.label=2;case 2:return a.done?[3,5]:(f=a.value).execute?[4,f.execute(de({},n))]:[3,4];case 3:if(null===(p=w.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),i({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),w.label=4;case 4:return a=s.next(),[3,2];case 5:return[3,8];case 6:return c=w.sent(),m={error:c},[3,8];case 7:try{a&&!a.done&&(y=s.return)&&y.call(s)}finally{if(m)throw m.error}return[7];case 8:u=this.plugins.filter((function(e){return"enrichment"===e.type||void 0===e.type})),w.label=9;case 9:w.trys.push([9,14,15,16]),l=he(u),d=l.next(),w.label=10;case 10:return d.done?[3,13]:(f=d.value).execute?[4,f.execute(de({},n))]:[3,12];case 11:if(null===(p=w.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),i({event:n,code:0,message:""}),[2];n=p,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(f.name),"', event: ").concat(JSON.stringify(n))),w.label=12;case 12:return d=l.next(),[3,10];case 13:return[3,16];case 14:return g=w.sent(),b={error:g},[3,16];case 15:try{d&&!d.done&&(T=l.return)&&T.call(l)}finally{if(b)throw b.error}return[7];case 16:return h=this.plugins.filter((function(e){return"destination"===e.type})),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(n))),v=h.map((function(e){var t=de({},n);return e.execute(t).catch((function(e){return He(t,0,String(e))}))})),Promise.all(v).then((function(e){var t=ve(e,1)[0]||He(n,100,"Event not tracked, no destination plugins on the instance");i(t)})),[2]}}))}))},e.prototype.flush=function(){return pe(this,void 0,void 0,(function(){var e,t,n,r=this;return ge(this,(function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return r.apply(e)})))];case 1:return i.sent(),t=this.plugins.filter((function(e){return"destination"===e.type})),n=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(n)];case 2:return i.sent(),[2]}}))}))},e.prototype.addOptOutListener=function(e){this._optOutListeners.push(e)},e.prototype._clearOptOutListeners=function(){this._optOutListeners=[]},e.prototype.onIdentityChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onIdentityChanged)||void 0===n||n.call(t,e)}))},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onSessionIdChanged)||void 0===n||n.call(t,e)}))},e.prototype.onOptOutChanged=function(e){this.plugins.forEach((function(t){var n;null===(n=t.onOptOutChanged)||void 0===n||n.call(t,e)})),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o,s,a;return ge(this,(function(c){switch(c.label){case 0:c.trys.push([0,7,8,9]),t=he(this._optOutListeners),n=t.next(),c.label=1;case 1:if(n.done)return[3,6];r=n.value,c.label=2;case 2:return c.trys.push([2,4,,5]),[4,r(e)];case 3:return c.sent(),[3,5];case 4:return i=c.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return n=t.next(),[3,1];case 6:return[3,9];case 7:return o=c.sent(),s={error:o},[3,9];case 8:try{n&&!n.done&&(a=t.return)&&a.call(t)}finally{if(s)throw s.error}return[7];case 9:return[2]}}))}))},e.prototype.onReset=function(){this.plugins.forEach((function(e){var t;null===(t=e.onReset)||void 0===t||t.call(e)}))},e}(),Ve=function(e,t){return de(de({},t),{event_type:le.IDENTIFY,user_properties:e.getUserProperties()})},We=function(e){return{promise:e||Promise.resolve()}},Ye=function(){function e(e){void 0===e&&(e="$default"),this.initializing=!1,this.isReady=!1,this.q=[],this.dispatchQ=[],this.logEvent=this.track.bind(this),this.timeline=new Je(this),this.name=e}return e.prototype._init=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){switch(t.label){case 0:return this.config=e,this.timeline.reset(this),this.timeline.loggerProvider=this.config.loggerProvider,[4,this.runQueuedFunctions("q")];case 1:return t.sent(),this.isReady=!0,[2]}}))}))},e.prototype.runQueuedFunctions=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o,s,a,c;return ge(this,(function(u){switch(u.label){case 0:t=this[e],this[e]=[],u.label=1;case 1:u.trys.push([1,8,9,10]),n=he(t),r=n.next(),u.label=2;case 2:return r.done?[3,7]:(i=r.value,(o=i())&&"promise"in o?[4,o.promise]:[3,4]);case 3:return u.sent(),[3,6];case 4:return[4,o];case 5:u.sent(),u.label=6;case 6:return r=n.next(),[3,2];case 7:return[3,10];case 8:return s=u.sent(),a={error:s},[3,10];case 9:try{r&&!r.done&&(c=n.return)&&c.call(n)}finally{if(a)throw a.error}return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:u.sent(),u.label=12;case 12:return[2]}}))}))},e.prototype.track=function(e,t,n){var r=function(e,t,n){return de(de(de({},"string"==typeof e?{event_type:e}:e),n),t&&{event_properties:t})}(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),We(this.dispatch(r))},e.prototype.identify=function(e,t){var n=Ve(e,t);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),We(this.dispatch(n))},e.prototype.groupIdentify=function(e,t,n,r){var i=function(e,t,n,r){var i;return de(de({},r),{event_type:le.GROUP_IDENTIFY,group_properties:n.getUserProperties(),groups:(i={},i[e]=t,i)})}(e,t,n,r);return We(this.dispatch(i))},e.prototype.setGroup=function(e,t,n){var r=function(e,t,n){var r,i=new qe;return i.set(e,t),de(de({},n),{event_type:le.IDENTIFY,user_properties:i.getUserProperties(),groups:(r={},r[e]=t,r)})}(e,t,n);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),We(this.dispatch(r))},e.prototype.revenue=function(e,t){var n=function(e,t){return de(de({},t),{event_type:le.REVENUE,event_properties:e.getEventProperties()})}(e,t);return We(this.dispatch(n))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),We())},e.prototype._addPlugin=function(e){return We(this.timeline.register(e,this.config))},e.prototype.remove=function(e){return this.isReady?this._removePlugin(e):(this.q.push(this._removePlugin.bind(this,e)),We())},e.prototype._removePlugin=function(e){return We(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(He(e,0,"Client not initialized"));this.process(e).then(t)},e.prototype.dispatch=function(e){return pe(this,void 0,void 0,(function(){var t=this;return ge(this,(function(n){return this.isReady?[2,this.process(e)]:[2,new Promise((function(n){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,n))}))]}))}))},e.prototype.getOperationAppliedUserProperties=function(e){var t,n=null!==(t=this.userProperties)&&void 0!==t?t:{},r=de({},n);if(void 0===e)return r;var i={};return Object.keys(e).forEach((function(t){Object.values(ue).includes(t)||(i[t]=e[t])})),Be.forEach((function(t){if(Object.keys(e).includes(t)){var n=e[t];switch(t){case ue.CLEAR_ALL:Object.keys(r).forEach((function(e){delete r[e]}));break;case ue.UNSET:Object.keys(n).forEach((function(e){delete r[e]}));break;case ue.SET:Object.assign(r,n)}}})),Object.assign(r,i),r},e.prototype.process=function(e){return pe(this,void 0,void 0,(function(){var t,n,r;return ge(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,He(e,0,"Event skipped due to optOut config")]:(e.event_type===le.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)]);case 1:return 200===(r=i.sent()).code?this.config.loggerProvider.log(r.message):100===r.code?this.config.loggerProvider.warn(r.message):this.config.loggerProvider.error(r.message),[2,r];case 2:return t=i.sent(),n=String(t),this.config.loggerProvider.error(n),[2,r=He(e,0,n)];case 3:return[2]}}))}))},e.prototype.setOptOut=function(e){this.isReady?this._setOptOut(e):this.q.push(this._setOptOut.bind(this,Boolean(e)))},e.prototype._setOptOut=function(e){this.config.optOut!==e&&(this.config.optOut=Boolean(e),this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return We(this.timeline.flush())},e.prototype.plugin=function(e){var t=this.timeline.plugins.find((function(t){return t.name===e}));if(void 0!==t)return t;this.config.loggerProvider.debug("Cannot find plugin with name ".concat(e))},e.prototype.plugins=function(e){return this.timeline.plugins.filter((function(t){return t instanceof e}))},e}(),Qe=function(){function e(){this.productId="",this.quantity=1,this.price=0}return e.prototype.setProductId=function(e){return this.productId=e,this},e.prototype.setQuantity=function(e){return e>0&&(this.quantity=e),this},e.prototype.setPrice=function(e){return this.price=e,this},e.prototype.setRevenueType=function(e){return this.revenueType=e,this},e.prototype.setCurrency=function(e){return this.currency=e,this},e.prototype.setRevenue=function(e){return this.revenue=e,this},e.prototype.setReceipt=function(e){return this.receipt=e,this},e.prototype.setReceiptSig=function(e){return this.receiptSig=e,this},e.prototype.setEventProperties=function(e){return Me(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?de({},this.properties):{};return e[$e.REVENUE_PRODUCT_ID]=this.productId,e[$e.REVENUE_QUANTITY]=this.quantity,e[$e.REVENUE_PRICE]=this.price,e[$e.REVENUE_TYPE]=this.revenueType,e[$e.REVENUE_CURRENCY]=this.currency,e[$e.REVENUE]=this.revenue,e[$e.RECEIPT]=this.receipt,e[$e.RECEIPT_SIG]=this.receiptSig,e},e}();!function(e){e.REVENUE_PRODUCT_ID="$productId",e.REVENUE_QUANTITY="$quantity",e.REVENUE_PRICE="$price",e.REVENUE_TYPE="$revenueType",e.REVENUE_CURRENCY="$currency",e.REVENUE="$revenue",e.RECEIPT="$receipt",e.RECEIPT_SIG="$receiptSig"}($e||($e={}));var Xe;!function(e){e[e.None=0]="None",e[e.Error=1]="Error",e[e.Warn=2]="Warn",e[e.Verbose=3]="Verbose",e[e.Debug=4]="Debug"}(Xe||(Xe={}));var Ze="Amplitude Logger ",et=function(){function e(){this.logLevel=Xe.None}return e.prototype.disable=function(){this.logLevel=Xe.None},e.prototype.enable=function(e){void 0===e&&(e=Xe.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Xe.Verbose||console.log("".concat(Ze,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Xe.Warn||console.warn("".concat(Ze,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Xe.Error||console.error("".concat(Ze,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<Xe.Debug||console.log("".concat(Ze,"[Debug]: ").concat(e.join(" ")))},e}(),tt=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:we,logLevel:Xe.Warn,loggerProvider:new et,offline:!1,optOut:!1,serverUrl:ke,serverZone:"US",useBatch:!1}},nt=function(){function e(e){var t,n,r,i;this._optOut=!1;var o=tt();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:o.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||o.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||o.flushQueueSize,this.instanceName=e.instanceName||o.instanceName,this.loggerProvider=e.loggerProvider||o.loggerProvider,this.logLevel=null!==(n=e.logLevel)&&void 0!==n?n:o.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:o.offline,this.optOut=null!==(r=e.optOut)&&void 0!==r?r:o.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||o.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:o.useBatch,this.loggerProvider.enable(this.logLevel);var s=it(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=s.serverZone,this.serverUrl=s.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),rt=function(e,t){return"EU"===e?t?"https://api.eu.amplitude.com/batch":"https://api.eu.amplitude.com/2/httpapi":t?"https://api2.amplitude.com/batch":ke},it=function(e,t,n){if(void 0===e&&(e=""),void 0===t&&(t=tt().serverZone),void 0===n&&(n=tt().useBatch),e)return{serverUrl:e,serverZone:void 0};var r=["US","EU"].includes(t)?t:tt().serverZone;return{serverZone:r,serverUrl:rt(r,n)}},ot=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function st(e){return e>=200&&e<300}var at=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},ct=function(e){return function(){var t=de({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},ut=function(e,t){var n,r;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=he(t.split(".")),o=i.next();!o.done;o=i.next()){var s=o.value;if(!(s in e))return;e=e[s]}}catch(e){n={error:e}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}return e},lt=function(e,t){return function(){var n,r,i={};try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;i[a]=ut(e,a)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i}},dt=function(e,t,n,r,i){return void 0===i&&(i=null),function(){for(var o=[],s=0;s<arguments.length;s++)o[s]=arguments[s];var a=n(),c=a.logger,u=a.logLevel;if(u&&u<Xe.Debug||!u||!c)return e.apply(i,o);var l={type:"invoke public method",name:t,args:o,stacktrace:at(1),time:{start:(new Date).toISOString()},states:{}};r&&l.states&&(l.states.before=r());var d=e.apply(i,o);return d&&d.promise?d.promise.then((function(){r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=(new Date).toISOString()),c.debug(JSON.stringify(l,null,2))})):(r&&l.states&&(l.states.after=r()),l.time&&(l.time.end=(new Date).toISOString()),c.debug(JSON.stringify(l,null,2))),d}};function ft(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var pt=function(){function e(e){this.name="amplitude",this.type="destination",this.retryTimeout=1e3,this.throttleTimeout=3e4,this.storageKey="",this.scheduleId=null,this.scheduledTimeout=0,this.flushId=null,this.queue=[],this.diagnosticsClient=null==e?void 0:e.diagnosticsClient}return e.prototype.setup=function(e){var t;return pe(this,void 0,void 0,(function(){var n,r=this;return ge(this,(function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(Te,"_").concat(this.config.apiKey.substring(0,10)),[4,null===(t=this.config.storageProvider)||void 0===t?void 0:t.get(this.storageKey)];case 1:return(n=i.sent())&&n.length>0&&Promise.all(n.map((function(e){return r.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=Ge()),new Promise((function(n){var r={event:e,attempts:0,callback:function(e){return n(e)},timeout:0};t.queue.push(r),t.schedule(t.config.flushIntervalMillis),t.saveEvents()}))},e.prototype.removeEventsExceedFlushMaxRetries=function(e){var t=this;return e.filter((function(e){return e.attempts+=1,e.attempts<t.config.flushMaxRetries||(t.fulfillRequest([e],500,"Event rejected due to exceeded retry count"),!1)}))},e.prototype.scheduleEvents=function(e){var t=this;e.forEach((function(e){t.schedule(0===e.timeout?t.config.flushIntervalMillis:e.timeout)}))},e.prototype.schedule=function(e){var t=this;if(!this.config.offline)return null===this.scheduleId||this.scheduleId&&e>this.scheduledTimeout?(this.scheduleId&&clearTimeout(this.scheduleId),this.scheduledTimeout=e,void(this.scheduleId=setTimeout((function(){t.queue=t.queue.map((function(e){return e.timeout=0,e})),t.flush(!0)}),e))):void 0},e.prototype.resetSchedule=function(){this.scheduleId=null,this.scheduledTimeout=0},e.prototype.flush=function(e){return void 0===e&&(e=!1),pe(this,void 0,void 0,(function(){var t,n,r,i=this;return ge(this,(function(o){switch(o.label){case 0:return this.config.offline?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush while offline."),[2]):this.flushId?(this.resetSchedule(),this.config.loggerProvider.debug("Skipping flush because previous flush has not resolved."),[2]):(this.flushId=this.scheduleId,this.resetSchedule(),t=[],n=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):n.push(e)})),s=t,a=this.config.flushQueueSize,c=Math.max(a,1),r=s.reduce((function(e,t,n){var r=Math.floor(n/c);return e[r]||(e[r]=[]),e[r].push(t),e}),[]),[4,r.reduce((function(t,n){return pe(i,void 0,void 0,(function(){return ge(this,(function(r){switch(r.label){case 0:return[4,t];case 1:return r.sent(),[4,this.send(n,e)];case 2:return[2,r.sent()]}}))}))}),Promise.resolve())]);case 1:return o.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}var s,a,c}))}))},e.prototype.send=function(e,t){var n;return void 0===t&&(t=!0),pe(this,void 0,void 0,(function(){var r,i,o,s,a;return ge(this,(function(c){switch(c.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,"Event rejected due to missing API key")];r={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,fe(t,["extra"])})),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new ot,c.label=1;case 1:return c.trys.push([1,3,,4]),i=it(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,r)];case 2:return null===(o=c.sent())?(this.fulfillRequest(e,0,"Unexpected error occurred"),[2]):t?(this.handleResponse(o,e),[3,4]):("body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(ft(o))):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return s=c.sent(),a=(u=s)instanceof Error?u.message:String(u),this.config.loggerProvider.error(a),null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map((function(e){return e.event.event_type})),message:a,stack_trace:at()}),this.handleResponse({status:Fe.Failed,statusCode:0},e),[3,4];case 4:return[2]}var u}))}))},e.prototype.handleResponse=function(e,t){var n;st(e.statusCode)||null===(n=this.diagnosticsClient)||void 0===n||n.recordEvent("analytics.events.unsuccessful",{events:t.map((function(e){return e.event.event_type})),code:e.statusCode,status:e.status,body:ft(e),stack_trace:at()});var r=e.status;switch(r){case Fe.Success:this.handleSuccessResponse(e,t);break;case Fe.Invalid:this.handleInvalidResponse(e,t);break;case Fe.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case Fe.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(r,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,"Event tracked successfully")},e.prototype.handleInvalidResponse=function(e,t){var n=this;if(e.body.missingField||e.body.error.startsWith("Invalid API key"))this.fulfillRequest(t,e.statusCode,e.body.error);else{var r=me(me(me(me([],ve(Object.values(e.body.eventsWithInvalidFields)),!1),ve(Object.values(e.body.eventsWithMissingFields)),!1),ve(Object.values(e.body.eventsWithInvalidIdLengths)),!1),ve(e.body.silencedEvents),!1).flat(),i=new Set(r),o=t.filter((function(t,r){if(!i.has(r))return!0;n.fulfillRequest([t],e.statusCode,e.body.error)}));o.length>0&&this.config.loggerProvider.warn(ft(e));var s=this.removeEventsExceedFlushMaxRetries(o);this.scheduleEvents(s)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(ft(e)),this.config.flushQueueSize/=2;var n=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(n)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var n=this,r=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),o=e.body.throttledEvents,s=new Set(r),a=new Set(i),c=new Set(o),u=t.filter((function(t,r){if(!(t.event.user_id&&s.has(t.event.user_id)||t.event.device_id&&a.has(t.event.device_id)))return c.has(r)&&(t.timeout=n.throttleTimeout),!0;n.fulfillRequest([t],e.statusCode,e.body.error)}));u.length>0&&this.config.loggerProvider.warn(ft(e));var l=this.removeEventsExceedFlushMaxRetries(u);this.scheduleEvents(l)},e.prototype.handleOtherResponse=function(e){var t=this,n=e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e})),r=this.removeEventsExceedFlushMaxRetries(n);this.scheduleEvents(r)},e.prototype.fulfillRequest=function(e,t,n){var r,i,o;st(t)?null===(o=this.diagnosticsClient)||void 0===o||o.increment("analytics.events.sent",e.length):(null===(r=this.diagnosticsClient)||void 0===r||r.increment("analytics.events.dropped",e.length),null===(i=this.diagnosticsClient)||void 0===i||i.recordEvent("analytics.events.dropped",{events:e.map((function(e){return e.event.event_type})),code:t,message:n,stack_trace:at()})),this.removeEvents(e),e.forEach((function(e){return e.callback(He(e.event,t,n))}))},e.prototype.saveEvents=function(){if(this.config.storageProvider){var e=this.queue.map((function(e){return e.event}));this.config.storageProvider.set(this.storageKey,e)}},e.prototype.removeEvents=function(e){this.queue=this.queue.filter((function(t){return!e.some((function(e){return e.event.insert_id===t.event.insert_id}))})),this.saveEvents()},e}(),gt=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:ht(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),ht=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},vt=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),mt=function(){return mt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},mt.apply(this,arguments)};function yt(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function bt(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)s.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return s}"function"==typeof SuppressedError&&SuppressedError;var Tt=function(e,t){var n,r,i=typeof e;if(i!==typeof t)return!1;try{for(var o=yt(["string","number","boolean","undefined"]),s=o.next();!s.done;s=o.next()){if(s.value===i)return e===t}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var a=Array.isArray(e),c=Array.isArray(t);if(a!==c)return!1;if(!a||!c){var u=Object.keys(e).sort(),l=Object.keys(t).sort();if(!Tt(u,l))return!1;var d=!0;return Object.keys(e).forEach((function(n){Tt(e[n],t[n])||(d=!1)})),d}for(var f=0;f<e.length;f++)if(!Tt(e[f],t[f]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),n=t.length,r=new Array(n);n--;)r[n]=[t[n],e[t[n]]];return r});var wt=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=mt({},this.identity.userProperties),n=mt(mt({},this.identity),{userProperties:t});return{setUserId:function(e){return n.userId=e,this},setDeviceId:function(e){return n.deviceId=e,this},setUserProperties:function(e){return n.userProperties=e,this},setOptOut:function(e){return n.optOut=e,this},updateUserProperties:function(e){var t,r,i,o,s,a,c=n.userProperties||{};try{for(var u=yt(Object.entries(e)),l=u.next();!l.done;l=u.next()){var d=bt(l.value,2),f=d[0],p=d[1];switch(f){case"$set":try{for(var g=(i=void 0,yt(Object.entries(p))),h=g.next();!h.done;h=g.next()){var v=bt(h.value,2),m=v[0],y=v[1];c[m]=y}}catch(e){i={error:e}}finally{try{h&&!h.done&&(o=g.return)&&o.call(g)}finally{if(i)throw i.error}}break;case"$unset":try{for(var b=(s=void 0,yt(Object.keys(p))),T=b.next();!T.done;T=b.next()){delete c[m=T.value]}}catch(e){s={error:e}}finally{try{T&&!T.done&&(a=b.return)&&a.call(b)}finally{if(s)throw s.error}}break;case"$clearAll":c={}}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return n.userProperties=c,this},commit:function(){return e.setIdentity(n),this}}},e.prototype.getIdentity=function(){return mt({},this.identity)},e.prototype.setIdentity=function(e){var t=mt({},this.identity);this.identity=mt({},e),Tt(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),kt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,St=function(){function e(){this.identityStore=new wt,this.eventBridge=new vt,this.applicationContextProvider=new gt}return e.getInstance=function(t){return kt.analyticsConnectorInstances||(kt.analyticsConnectorInstances={}),kt.analyticsConnectorInstances[t]||(kt.analyticsConnectorInstances[t]=new e),kt.analyticsConnectorInstances[t]},e}(),Et=function(e){return void 0===e&&(e=we),St.getInstance(e)},_t=function(){function e(){this.name="identity",this.type="before",this.identityStore=Et().identityStore}return e.prototype.execute=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){return e.instanceName&&(this.identityStore=Et(e.instanceName).identityStore),[2]}))}))},e}(),It=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},Pt=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[be,t,e.substring(0,n)].filter(Boolean).join("_")},At=function(){var e,t,n,r;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(r=null!==(n=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==n?n:i)&&void 0!==r?r:""},Ot=function(){var e,t=Ke();return(null===(e=null==t?void 0:t.location)||void 0===e?void 0:e.search)?t.location.search.substring(1).split("&").filter(Boolean).reduce((function(e,t){var n=t.split("=",2),r=Ct(n[0]),i=Ct(n[1]);return i?(e[r]=i,e):e}),{}):{}},Ct=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},xt=function(e,t){return!t||!t.length||t.some((function(t){return"string"==typeof t?e===t:e.match(t)}))},Rt=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n},Dt=function(e,t){var n=function(e){var t=0;if(0===e.length)return t;for(var n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return t}(e.toString());return 31*Math.abs(n)%1e5/1e5<t},Lt=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:return[4,this.get(e)];case 1:return[2,(t=n.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return pe(this,void 0,void 0,(function(){return ge(this,(function(n){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),Nt=function(){function e(e,t){void 0===t&&(t={}),this.options=de({},e),this.config=t}return e.prototype.isEnabled=function(){return pe(this,void 0,void 0,(function(){var t,n,r,i;return ge(this,(function(o){switch(o.label){case 0:if(!Ke())return[2,!1];t=String(Date.now()),n=de(de({},this.options),{expirationDays:.003}),r=new e(n),i="AMP_TEST_".concat(Ge().substring(0,8)),o.label=1;case 1:return o.trys.push([1,4,5,7]),[4,r.set(i,t)];case 2:return o.sent(),[4,r.get(i)];case 3:return[2,o.sent()===t];case 4:return o.sent(),[2,!1];case 5:return[4,r.remove(i)];case 6:return o.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return pe(this,void 0,void 0,(function(){var t,n;return ge(this,(function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=r.sent()))return[2,void 0];try{return void 0===(n=Ut(t))?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)),[2,void 0]):[2,JSON.parse(n)]}catch(n){return console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t)),[2,void 0]}return[2]}}))}))},e.prototype.getRaw=function(e){var t,n,r,i;return pe(this,void 0,void 0,(function(){var o,s,a,c,u,l,d,f,p,g,h,v,m=this;return ge(this,(function(y){switch(y.label){case 0:o=Ke(),s=o,y.label=1;case 1:return y.trys.push([1,4,,5]),(a=null==s?void 0:s.cookieStore)?[4,a.getAll(e)]:[3,3];case 2:if(c=y.sent()){c.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:c.map((function(e){return e.domain}))}),null===(n=this.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.cookieStore"));try{for(u=he(c),l=u.next();!l.done;l=u.next())if(d=l.value,Mt(d.domain,this.options.domain))return[2,d.value]}catch(e){h={error:e}}finally{try{l&&!l.done&&(v=u.return)&&v.call(u)}finally{if(h)throw h.error}}}y.label=3;case 3:return[3,5];case 4:return y.sent(),[3,5];case 5:return f=(null!==(i=null===(r=null==o?void 0:o.document)||void 0===r?void 0:r.cookie.split("; "))&&void 0!==i?i:[]).filter((function(t){return 0===t.indexOf(e+"=")})),p=void 0,"function"==typeof(g=this.config.duplicateResolverFn)&&f.length>1&&(p=f.find((function(t){var n;try{var r=g(t.substring(e.length+1));return r||null===(n=m.config.diagnosticsClient)||void 0===n||n.increment("cookies.duplicate.occurrence.document.cookie"),r}catch(e){return!1}}))),p||(p=f[0]),p?[2,p.substring(e.length+1)]:[2,void 0]}}))}))},e.prototype.set=function(e,t){var n;return pe(this,void 0,void 0,(function(){var r,i,o,s,a,c,u;return ge(this,(function(l){try{r=null!==(n=this.options.expirationDays)&&void 0!==n?n:0,o=void 0,(i=null!==t?r:-1)&&((s=new Date).setTime(s.getTime()+24*i*60*60*1e3),o=s),a="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),o&&(a+="; expires=".concat(o.toUTCString())),a+="; path=/",this.options.domain&&(a+="; domain=".concat(this.options.domain)),this.options.secure&&(a+="; Secure"),this.options.sameSite&&(a+="; SameSite=".concat(this.options.sameSite)),(c=Ke())&&(c.document.cookie=a)}catch(t){u=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(u))}return[2]}))}))},e.prototype.remove=function(e){return pe(this,void 0,void 0,(function(){return ge(this,(function(t){switch(t.label){case 0:return[4,this.set(e,null)];case 1:return t.sent(),[2]}}))}))},e.prototype.reset=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return[2]}))}))},e}(),Ut=function(e){var t;return null!==(t=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}}(e))&&void 0!==t?t:function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}}(e)},Mt=function(e,t){if(!e||!t)return!1;var n=e.startsWith(".")?e.substring(1):e,r=t.startsWith(".")?t.substring(1):t;return n.toLowerCase()===r.toLowerCase()},jt=function(e,t,n){return void 0===t&&(t=""),void 0===n&&(n=10),[be,t,e.substring(0,n)].filter(Boolean).join("_")},qt=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return pe(this,void 0,void 0,(function(){var t,n,r;return ge(this,(function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),n=new e(this.storage),r="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,n.set(r,t)];case 2:return i.sent(),[4,n.get(r)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,n.remove(r)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=n.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return n.sent(),console.error("[Amplitude] Error: Could not get value from storage"),[2,void 0];case 3:return[2]}}))}))},e.prototype.getRaw=function(e){var t;return pe(this,void 0,void 0,(function(){return ge(this,(function(n){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var n;return pe(this,void 0,void 0,(function(){return ge(this,(function(r){try{null===(n=this.storage)||void 0===n||n.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return pe(this,void 0,void 0,(function(){return ge(this,(function(n){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return pe(this,void 0,void 0,(function(){return ge(this,(function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]}))}))},e}(),Ft="tags",Bt="counters",$t="histograms",Ht="events",Kt="internal",zt="last_flush_timestamp",Gt=function(){function e(e,t){this.dbPromise=null,this.logger=t,this.dbName="AMP_diagnostics_".concat(e.substring(0,10))}return e.isSupported=function(){var e;return void 0!==(null===(e=Ke())||void 0===e?void 0:e.indexedDB)},e.prototype.getDB=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return this.dbPromise||(this.dbPromise=this.openDB()),[2,this.dbPromise]}))}))},e.prototype.openDB=function(){var e=this;return new Promise((function(t,n){var r=indexedDB.open(e.dbName,1);r.onerror=function(){e.dbPromise=null,n(new Error("Failed to open IndexedDB"))},r.onsuccess=function(){var n=r.result;n.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},n.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),n.close()},t(n)},r.onupgradeneeded=function(t){var n=t.target.result;e.createTables(n)}}))},e.prototype.createTables=function(e){(e.objectStoreNames.contains(Ft)||e.createObjectStore(Ft,{keyPath:"key"}),e.objectStoreNames.contains(Bt)||e.createObjectStore(Bt,{keyPath:"key"}),e.objectStoreNames.contains($t)||e.createObjectStore($t,{keyPath:"key"}),e.objectStoreNames.contains(Ht))||e.createObjectStore(Ht,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains(Kt)||e.createObjectStore(Kt,{keyPath:"key"})},e.prototype.setTags=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([Ft],"readwrite"),r=n.objectStore(Ft),[2,new Promise((function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},i.forEach((function(e){var t=ve(e,2),n=t[0],i=t[1];r.put({key:n,value:i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set tag",n,i,e)}}))}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",i),[3,3];case 3:return[2]}}))}))},e.prototype.incrementCounters=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([Bt],"readwrite"),r=n.objectStore(Bt),[2,new Promise((function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},i.forEach((function(e){var t=ve(e,2),n=t[0],i=t[1],s=r.get(n);s.onsuccess=function(){var e=s.result,t=e?e.value:0;r.put({key:n,value:t+i}).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to update counter",n,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing counter",n,e)}}))}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",i),[3,3];case 3:return[2]}}))}))},e.prototype.setHistogramStats=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([$t],"readwrite"),r=n.objectStore($t),[2,new Promise((function(t){var i=Object.entries(e);n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),t()},i.forEach((function(e){var t=ve(e,2),n=t[0],i=t[1],s=r.get(n);s.onsuccess=function(){var e,t=s.result;e=t?{key:n,count:t.count+i.count,min:Math.min(t.min,i.min),max:Math.max(t.max,i.max),sum:t.sum+i.sum}:{key:n,count:i.count,min:i.min,max:i.max,sum:i.sum},r.put(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to set histogram stats",n,e)}},s.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",n,e)}}))}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",i),[3,3];case 3:return[2]}}))}))},e.prototype.addEventRecords=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i,o=this;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),0===e.length?[2]:[4,this.getDB()];case 1:return t=s.sent(),n=t.transaction([Ht],"readwrite"),r=n.objectStore(Ht),[2,new Promise((function(t){n.oncomplete=function(){t()},n.onabort=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event records",e),t()};var i=r.count();i.onsuccess=function(){var t=i.result,n=Math.max(0,10-t);n<e.length&&o.logger.debug("DiagnosticsStorage: Only added ".concat(n," of ").concat(e.length," events due to storage limit")),e.slice(0,n).forEach((function(e){r.add(e).onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to add event record",e)}}))},i.onerror=function(e){o.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}}))];case 2:return i=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",i),[3,3];case 3:return[2]}}))}))},e.prototype.setInternal=function(e,t){return pe(this,void 0,void 0,(function(){var n,r,i,o;return ge(this,(function(s){switch(s.label){case 0:return s.trys.push([0,2,,3]),[4,this.getDB()];case 1:return n=s.sent(),r=n.transaction([Kt],"readwrite"),i=r.objectStore(Kt),[2,new Promise((function(n,o){r.onabort=function(){return o(new Error("Failed to set internal value"))};var s=i.put({key:e,value:t});s.onsuccess=function(){return n()},s.onerror=function(){return o(new Error("Failed to set internal value"))}}))];case 2:return o=s.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",o),[3,3];case 3:return[2]}}))}))},e.prototype.getInternal=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i;return ge(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return t=o.sent(),n=t.transaction([Kt],"readonly"),r=n.objectStore(Kt),[2,new Promise((function(t,i){n.onabort=function(){return i(new Error("Failed to get internal value"))};var o=r.get(e);o.onsuccess=function(){return t(o.result)},o.onerror=function(){return i(new Error("Failed to get internal value"))}}))];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",i),[2,void 0];case 3:return[2]}}))}))},e.prototype.getLastFlushTimestamp=function(){return pe(this,void 0,void 0,(function(){var e,t;return ge(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.getInternal(zt)];case 1:return[2,(e=n.sent())?parseInt(e.value,10):void 0];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to get last flush timestamp",t),[2,void 0];case 3:return[2]}}))}))},e.prototype.setLastFlushTimestamp=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.setInternal(zt,e.toString())];case 1:return n.sent(),[3,3];case 2:return t=n.sent(),this.logger.debug("DiagnosticsStorage: Failed to set last flush timestamp",t),[3,3];case 3:return[2]}}))}))},e.prototype.clearTable=function(e,t){return new Promise((function(n,r){var i=e.objectStore(t).clear();i.onsuccess=function(){return n()},i.onerror=function(){return r(new Error("Failed to clear table ".concat(t)))}}))},e.prototype.getAllAndClear=function(){return pe(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a;return ge(this,(function(c){switch(c.label){case 0:return c.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=c.sent(),t=e.transaction([Ft,Bt,$t,Ht],"readwrite"),[4,Promise.all([this.getAllFromStore(t,Ft),this.getAllFromStore(t,Bt),this.getAllFromStore(t,$t),this.getAllFromStore(t,Ht)])];case 2:return n=ve.apply(void 0,[c.sent(),4]),r=n[0],i=n[1],o=n[2],s=n[3],[4,Promise.all([this.clearTable(t,Bt),this.clearTable(t,$t),this.clearTable(t,Ht)])];case 3:return c.sent(),[2,{tags:r,counters:i,histogramStats:o,events:s}];case 4:return a=c.sent(),this.logger.debug("DiagnosticsStorage: Failed to get all and clear data",a),[2,{tags:[],counters:[],histogramStats:[],events:[]}];case 5:return[2]}}))}))},e.prototype.getAllFromStore=function(e,t){return new Promise((function(n,r){var i=e.objectStore(t).getAll();i.onsuccess=function(){return n(i.result)},i.onerror=function(){return r(new Error("Failed to get all from ".concat(t)))}}))},e}(),Jt=function(e){var t,n,r=function(){var e=Ke();if(!e)return[];var t=e.__AMPLITUDE_SCRIPT_URL__;return Array.isArray(t)?t:"string"==typeof t?[t]:[]}();if(0!==r.length)try{for(var i=he(r),o=i.next();!o.done;o=i.next()){var s=o.value;if(e.filename&&e.filename.includes(s))return"filename";if(e.stack&&e.stack.includes(s))return"stack"}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(t)throw t.error}}},Vt=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},Wt=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},Yt=3e5,Qt=1e4,Xt=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===n?"https://diagnostics.prod.us-west-2.amplitude.com/v1/capture":"https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(r,null,2)),this.config=de({enabled:!0,sampleRate:0},r),this.startTimestamp=Date.now(),this.shouldTrack=Dt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,Gt.isSupported()?this.storage=new Gt(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),function(e){var t=Ke();if(t&&"function"==typeof t.addEventListener){var n=function(t){e.recordEvent("sdk.error.uncaught",de({type:t.type,message:t.message,filename:t.filename,error_name:t.errorName,stack:t.stack},t.metadata))};t.addEventListener("error",(function(e){var t=e.error instanceof Error?e.error:void 0,r=null==t?void 0:t.stack,i=Jt({filename:e.filename,stack:r});i&&n({type:"error",message:e.message,stack:r,filename:e.filename,errorName:null==t?void 0:t.name,metadata:{colno:e.colno,lineno:e.lineno,isTrusted:e.isTrusted,matchReason:i}})}),!0),t.addEventListener("unhandledrejection",(function(e){var t,r=e.reason instanceof Error?e.reason:void 0,i=null==r?void 0:r.stack,o=Vt(i),s=Jt({filename:o,stack:i});s&&n({type:"unhandledrejection",message:null!==(t=null==r?void 0:r.message)&&void 0!==t?t:Wt(e.reason),stack:i,filename:o,errorName:null==r?void 0:r.name,metadata:{isTrusted:e.isTrusted,matchReason:s}})}),!0)}}(this))}return e.prototype.isStorageAndTrackEnabled=function(){return Boolean(this.storage)&&Boolean(this.shouldTrack)},e.prototype.setTag=function(e,t){this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryTags).length>=Qt?this.logger.debug("DiagnosticsClient: Early return setTags as reaching memory limit"):(this.inMemoryTags[e]=t,this.startTimersIfNeeded()))},e.prototype.increment=function(e,t){void 0===t&&(t=1),this.isStorageAndTrackEnabled()&&(Object.keys(this.inMemoryCounters).length>=Qt?this.logger.debug("DiagnosticsClient: Early return increment as reaching memory limit"):(this.inMemoryCounters[e]=(this.inMemoryCounters[e]||0)+t,this.startTimersIfNeeded()))},e.prototype.recordHistogram=function(e,t){if(this.isStorageAndTrackEnabled())if(Object.keys(this.inMemoryHistograms).length>=Qt)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var n=this.inMemoryHistograms[e];n?(n.count+=1,n.min=Math.min(n.min,t),n.max=Math.max(n.max,t),n.sum+=t):this.inMemoryHistograms[e]={count:1,min:t,max:t,sum:t},this.startTimersIfNeeded()}},e.prototype.recordEvent=function(e,t){this.isStorageAndTrackEnabled()&&(this.inMemoryEvents.length>=10?this.logger.debug("DiagnosticsClient: Early return recordEvent as reaching memory limit"):(this.inMemoryEvents.push({event_name:e,time:Date.now(),event_properties:t}),this.startTimersIfNeeded()))},e.prototype.startTimersIfNeeded=function(){var e=this;this.saveTimer||(this.saveTimer=setTimeout((function(){e.saveAllDataToStorage().catch((function(t){e.logger.debug("DiagnosticsClient: Failed to save all data to storage",t)})).finally((function(){e.saveTimer=null}))}),1e3)),this.flushTimer||(this.flushTimer=setTimeout((function(){e._flush().catch((function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)})).finally((function(){e.flushTimer=null}))}),Yt))},e.prototype.saveAllDataToStorage=function(){return pe(this,void 0,void 0,(function(){var e,t,n,r;return ge(this,(function(i){switch(i.label){case 0:return this.storage?(e=de({},this.inMemoryTags),t=de({},this.inMemoryCounters),n=de({},this.inMemoryHistograms),r=me([],ve(this.inMemoryEvents),!1),this.inMemoryEvents=[],this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},[4,Promise.all([this.storage.setTags(e),this.storage.incrementCounters(t),this.storage.setHistogramStats(n),this.storage.addEventRecords(r)])]):[2];case 1:return i.sent(),[2]}}))}))},e.prototype._flush=function(){return pe(this,void 0,void 0,(function(){var e,t,n,r,i,o,s,a,c,u;return ge(this,(function(l){switch(l.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return l.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=l.sent(),t=e.tags,n=e.counters,r=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),o={},t.forEach((function(e){o[e.key]=e.value})),s={},n.forEach((function(e){s[e.key]=e.value})),a={},r.forEach((function(e){a[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}})),c=i.map((function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}})),0===Object.keys(s).length&&0===Object.keys(a).length&&0===c.length?[2]:(u={tags:o,histogram:a,counters:s,events:c},this.fetch(u),[2])}}))}))},e.prototype.fetch=function(e){return pe(this,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:if(n.trys.push([0,2,,3]),!Ke())throw new Error("DiagnosticsClient: Fetch is not supported");return[4,fetch(this.serverUrl,{method:"POST",headers:{"X-ApiKey":this.apiKey,"Content-Type":"application/json"},body:JSON.stringify(e)})];case 1:return n.sent().ok?(this.logger.debug("DiagnosticsClient: Successfully sent diagnostics data"),[3,3]):(this.logger.debug("DiagnosticsClient: Failed to send diagnostics data."),[2]);case 2:return t=n.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}}))}))},e.prototype.initializeFlushInterval=function(){return pe(this,void 0,void 0,(function(){var e,t,n;return ge(this,(function(r){switch(r.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return-1===(t=r.sent()||-1)?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(Yt),[2]):(n=e-t)>=Yt?(this._flush(),[2]):(this._setFlushTimer(Yt-n),[2])}}))}))},e.prototype._setFlushTimer=function(e){var t=this;this.flushTimer=setTimeout((function(){t._flush().catch((function(e){t.logger.debug("DiagnosticsClient: Failed to flush",e)})).finally((function(){t.flushTimer=null}))}),e)},e.prototype._setSampleRate=function(e){this.logger.debug("DiagnosticsClient: Setting sample rate to",e),this.config.sampleRate=e,this.shouldTrack=Dt(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),Zt=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,n,r,i,o,s,a,c,u,l,d,f,p,g,h,v,m,y,b,T,w,k;if("object"!=typeof e)return null;var S=e.code||0,E=this.buildStatus(S);switch(E){case Fe.Success:return{status:E,statusCode:S,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(n=e.payload_size_bytes)&&void 0!==n?n:0,serverUploadTime:null!==(r=e.server_upload_time)&&void 0!==r?r:0}};case Fe.Invalid:return{status:E,statusCode:S,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(o=e.missing_field)&&void 0!==o?o:"",eventsWithInvalidFields:null!==(s=e.events_with_invalid_fields)&&void 0!==s?s:{},eventsWithMissingFields:null!==(a=e.events_with_missing_fields)&&void 0!==a?a:{},eventsWithInvalidIdLengths:null!==(c=e.events_with_invalid_id_lengths)&&void 0!==c?c:{},epsThreshold:null!==(u=e.eps_threshold)&&void 0!==u?u:0,exceededDailyQuotaDevices:null!==(l=e.exceeded_daily_quota_devices)&&void 0!==l?l:{},silencedDevices:null!==(d=e.silenced_devices)&&void 0!==d?d:[],silencedEvents:null!==(f=e.silenced_events)&&void 0!==f?f:[],throttledDevices:null!==(p=e.throttled_devices)&&void 0!==p?p:{},throttledEvents:null!==(g=e.throttled_events)&&void 0!==g?g:[]}};case Fe.PayloadTooLarge:return{status:E,statusCode:S,body:{error:null!==(h=e.error)&&void 0!==h?h:""}};case Fe.RateLimit:return{status:E,statusCode:S,body:{error:null!==(v=e.error)&&void 0!==v?v:"",epsThreshold:null!==(m=e.eps_threshold)&&void 0!==m?m:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(T=e.exceeded_daily_quota_devices)&&void 0!==T?T:{},exceededDailyQuotaUsers:null!==(w=e.exceeded_daily_quota_users)&&void 0!==w?w:{},throttledEvents:null!==(k=e.throttled_events)&&void 0!==k?k:[]}};case Fe.Timeout:default:return{status:E,statusCode:S}}},e.prototype.buildStatus=function(e){return st(e)?Fe.Success:429===e?Fe.RateLimit:413===e?Fe.PayloadTooLarge:408===e?Fe.Timeout:e>=400&&e<500?Fe.Invalid:e>=500?Fe.Failed:Fe.Unknown},e}(),en=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.customHeaders=t,n}return ce(t,e),t.prototype.send=function(e,t){return pe(this,void 0,void 0,(function(){var n,r,i;return ge(this,(function(o){switch(o.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return n={headers:de({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"},[4,fetch(e,n)];case 1:return[4,(r=o.sent()).text()];case 2:i=o.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch(e){return[2,this.buildResponse({code:r.status})]}return[2]}}))}))},t}(Zt),tn=function(){function e(e,t){this.key="AMP_remote_config_".concat(e.substring(0,10)),this.logger=t}return e.prototype.fetchConfig=function(){var e=null,t={remoteConfig:null,lastFetch:new Date};try{e=localStorage.getItem(this.key)}catch(e){return this.logger.debug("Remote config localstorage failed to access: ",e),Promise.resolve(t)}if(null===e)return this.logger.debug("Remote config localstorage gets null because the key does not exist"),Promise.resolve(t);try{var n=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(n))),Promise.resolve({remoteConfig:n.remoteConfig,lastFetch:new Date(n.lastFetch)})}catch(e){return this.logger.debug("Remote config localstorage failed to parse: ",e),localStorage.removeItem(this.key),Promise.resolve(t)}},e.prototype.setConfig=function(e){try{return localStorage.setItem(this.key,JSON.stringify(e)),this.logger.debug("Remote config localstorage set successfully."),Promise.resolve(!0)}catch(e){this.logger.debug("Remote config localstorage failed to set: ",e)}return Promise.resolve(!1)},e}(),nn=function(){function e(e,t,n,r){void 0===n&&(n="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.apiKey=e,this.serverUrl=r||("US"===n?"https://sr-client-cfg.amplitude.com/config":"https://sr-client-cfg.eu.amplitude.com/config"),this.logger=t,this.storage=new tn(e,t)}return e.prototype.subscribe=function(e,t,n){var r=Ge(),i={id:r,key:e,deliveryMode:t,callback:n};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),r},e.prototype.unsubscribe=function(e){var t=this.callbackInfos.findIndex((function(t){return t.id===e}));return-1===t?(this.logger.debug("Remote config client unsubscribe failed because callback with id ".concat(e," doesn't exist.")),!1):(this.callbackInfos.splice(t,1),this.logger.debug("Remote config client unsubscribe succeeded removing callback with id ".concat(e,".")),!0)},e.prototype.updateConfigs=function(){return pe(this,void 0,void 0,(function(){var e,t=this;return ge(this,(function(n){switch(n.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<3e5?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=n.sent(),this.storage.setConfig(e),this.callbackInfos.forEach((function(n){t.sendCallback(n,e,"remote")})),[2]}}))}))},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise||(this.fetchPromise=this.fetch().then((function(t){return null!==t.remoteConfig&&(e.lastSuccessfulFetch=Date.now()),t})).finally((function(){e.fetchPromise=null}))),this.fetchPromise},e.prototype.subscribeAll=function(e){return pe(this,void 0,void 0,(function(){var t,n,r,i=this;return ge(this,(function(o){switch(o.label){case 0:return t=this.getOrCreateFetchPromise().then((function(t){i.logger.debug("Remote config client subscription all mode fetched from remote: ".concat(JSON.stringify(t))),i.sendCallback(e,t,"remote"),i.storage.setConfig(t)})),n=this.storage.fetchConfig().then((function(e){return e})),[4,Promise.race([t,n])];case 1:return void 0!==(r=o.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(r))),null!==r.remoteConfig?this.sendCallback(e,r,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return o.sent(),[2]}}))}))},e.prototype.subscribeWaitForRemote=function(e,t){return pe(this,void 0,void 0,(function(){var n,r;return ge(this,(function(i){switch(i.label){case 0:n=new Promise((function(e,n){setTimeout((function(){n("Timeout exceeded")}),t)})),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),n])];case 2:return r=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,r,"remote"),this.storage.setConfig(r),[3,5];case 3:return i.sent(),this.logger.debug("Remote config client subscription wait for remote mode exceeded timeout. Try to fetch from cache."),[4,this.storage.fetchConfig()];case 4:return null!==(r=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,r,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,r,"remote")),[3,5];case 5:return[2]}}))}))},e.prototype.sendCallback=function(e,t,n){var r;e.lastCallback=new Date,r=e.key?e.key.split(".").reduce((function(e,t){return null===e?e:t in e?e[t]:null}),t.remoteConfig):t.remoteConfig,e.callback(r,n,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=3),void 0===t&&(t=1e3),pe(this,void 0,void 0,(function(){var n,r,i,o,s,a,c=this;return ge(this,(function(u){switch(u.label){case 0:n=t/e,r={remoteConfig:null,lastFetch:new Date},i=function(r){var i,s,a,u,l;return ge(this,(function(d){switch(d.label){case 0:i=new AbortController,s=setTimeout((function(){return i.abort()}),t),d.label=1;case 1:return d.trys.push([1,7,8,9]),[4,fetch(o.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:return(a=d.sent()).ok?[3,4]:[4,a.text()];case 3:return u=d.sent(),o.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(a.status,": ").concat(u)),[3,6];case 4:return[4,a.json()];case 5:return[2,{value:{remoteConfig:d.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(l=d.sent())instanceof Error&&"AbortError"===l.name?o.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):o.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),l),[3,9];case 8:return clearTimeout(s),[7];case 9:return r<e-1?[4,new Promise((function(e){return setTimeout(e,c.getJitterDelay(n))}))]:[3,11];case 10:d.sent(),d.label=11;case 11:return[2]}}))},o=this,s=0,u.label=1;case 1:return s<e?[5,i(s)]:[3,4];case 2:if("object"==typeof(a=u.sent()))return[2,a.value];u.label=3;case 3:return s++,[3,1];case 4:return[2,r]}}))}))},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),n=new URLSearchParams;return n.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(n.toString())},e.CONFIG_GROUP="browser",e}(),rn=Ke(),on=null==rn?void 0:rn.console,sn={},an={},cn=!1;var un,ln={addListener:function(e,t){var n,r=(n=e,!!on&&"function"==typeof on[n]&&(an[n]||(an[n]=on[n],on[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{if(sn[n]&&!cn){cn=!0;var r=sn[n];r&&r.forEach((function(t){try{t(n,e)}catch(e){}}))}}catch(e){}return cn=!1,an[n].apply(on,e)}),!0));if(!r)return new Error("Console override failed");sn[e]?sn[e].push(t):sn[e]=[t]},removeListener:function(e){var t,n;try{for(var r=he(Object.values(sn)),i=r.next();!i.done;i=r.next())for(var o=i.value,s=o.length-1;s>=0;s--)if(o[s]===e){o.splice(s,1);break}}catch(e){t={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},_restoreConsole:function(){var e,t;try{for(var n=he(Object.entries(an)),r=n.next();!r.done;r=n.next()){var i=ve(r.value,2),o=i[0],s=i[1];s&&(on[o]=s)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}an={},sn={}}};!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(un||(un={}));var dn=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],fn="data-amp-track-",pn=["div","span","h1","h2","h3","h4","h5","h6"],gn=me(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],ve(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),hn=gn,vn=gn,mn=["*"];function yn(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function bn(e,t,n){e&&Tn({json:e,allowlist:t.map(wn),excludelist:n.map(wn),ancestors:[]})}function Tn(e){var t,n,r=e.json,i=e.targetObject,o=e.allowlist,s=e.excludelist,a=e.ancestors,c=e.parentObject,u=e.targetKey;i||(i=r);var l=Object.keys(i);try{for(var d=he(l),f=d.next();!f.done;f=d.next()){var p=f.value,g=me(me([],ve(a),!1),[p],!1);yn(i[p])?Sn(g,o)&&!Sn(g,s)||delete i[p]:Tn({json:r,targetObject:i[p],allowlist:o,excludelist:s,ancestors:g,parentObject:i,targetKey:p})}}catch(e){t={error:e}}finally{try{f&&!f.done&&(n=d.return)&&n.call(d)}finally{if(t)throw t.error}}0===Object.keys(i).length&&c&&u&&delete c[u]}function wn(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map((function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")}))}function kn(e,t,n,r){if(void 0===n&&(n=0),void 0===r&&(r=0),r===t.length)return n===e.length;if(n===e.length){for(;r<t.length&&"**"===t[r];)r++;return r===t.length}var i=t[r];if("**"===i){if(r+1===t.length)return!0;for(var o=n;o<=e.length;o++)if(kn(e,t,o,r+1))return!0;return!1}return("*"===i||i===e[n])&&kn(e,t,n+1,r+1)}function Sn(e,t){return t.some((function(t){return kn(e,t)}))}var En=function(){function e(e){this.request=e}return e.prototype.headers=function(e){var t,n;void 0===e&&(e=[]);var r=this.request.headers,i={};if(Array.isArray(r))r.forEach((function(e){var t=ve(e,2),n=t[0],r=t[1];i[n]=r}));else if(r instanceof Headers)r.forEach((function(e,t){i[t]=e}));else if("object"==typeof r&&null!==r)try{for(var o=he(Object.entries(r)),s=o.next();!s.done;s=o.next()){var a=ve(s.value,2),c=a[0],u=a[1];i[c]=u}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return Rn(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=Ke();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=In(t,100),this._bodySize}},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"method",{get:function(){return this.request.method},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.request.body?this.request.body:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),pe(this,void 0,void 0,(function(){return ge(this,(function(n){return 0===e.length?[2,null]:[2,Cn(this.body,e,t)]}))}))},e}(),_n=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),Rn(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return In(this.bodyRaw,100)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"body",{get:function(){return"string"==typeof this.bodyRaw?this.bodyRaw:null},enumerable:!1,configurable:!0}),e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),pe(this,void 0,void 0,(function(){return ge(this,(function(n){return 0===e.length?[2,null]:[2,Cn(this.body,e,t)]}))}))},e}();function In(e,t){var n,r,i,o=Ke(),s=null==o?void 0:o.TextEncoder;if(s){var a;if("string"==typeof e)a=e,i=(new s).encode(a).length;else if(e instanceof Blob)i=(a=e).size;else if(e instanceof URLSearchParams)a=e,i=(new s).encode(a.toString()).length;else if(ArrayBuffer.isView(e))i=(a=e).byteLength;else if(e instanceof ArrayBuffer)i=(a=e).byteLength;else if(e instanceof FormData){var c=e,u=0,l=0;try{for(var d=he(c.entries()),f=d.next();!f.done;f=d.next()){var p=ve(f.value,2),g=p[0],h=p[1];if(u+=g.length,"string"==typeof h)u+=(new s).encode(h).length;else{if(!(h instanceof Blob))return;u+=h.size}if(++l>=t)return}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}i=u}else if(e instanceof ReadableStream)return void(a=e);return i}}var Pn,An=function(){function e(e){this.response=e}return e.prototype.headers=function(e){var t;if(void 0===e&&(e=[]),this.response.headers instanceof Headers){var n=this.response.headers,r={};return null===(t=null==n?void 0:n.forEach)||void 0===t||t.call(n,(function(e,t){r[t]=e})),Rn(r,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var e,t;if(void 0!==this._bodySize)return this._bodySize;var n=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),r=n?parseInt(n,10):void 0;return this._bodySize=r,r},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return pe(this,void 0,void 0,(function(){var e,t;return ge(this,(function(n){switch(n.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),n.label=1;case 1:return n.trys.push([1,3,,4]),e=this.clonedResponse.text(),t=new Promise((function(e){return setTimeout((function(){return e(null)}),500)})),[4,Promise.race([e,t])];case 2:return[2,n.sent()];case 3:return n.sent(),[2,null];case 4:return[2]}}))}))},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),pe(this,void 0,void 0,(function(){return ge(this,(function(n){switch(n.label){case 0:return 0===e.length?[2,null]:[4,this.text()];case 1:return[2,Cn(n.sent(),e,t)]}}))}))},e}(),On=function(){function e(e,t,n,r){this.statusCode=e,this.headersString=t,this.size=n,this.getJson=r}return Object.defineProperty(e.prototype,"bodySize",{get:function(){return this.size},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.statusCode},enumerable:!1,configurable:!0}),e.prototype.headers=function(e){var t,n;if(void 0===e&&(e=[]),!this.headersString)return{};var r={},i=this.headersString.split("\r\n");try{for(var o=he(i),s=o.next();!s.done;s=o.next()){var a=ve(s.value.split(": "),2),c=a[0],u=a[1];c&&u&&(r[c]=u)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return Rn(r,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),pe(this,void 0,void 0,(function(){var n;return ge(this,(function(r){return 0===e.length?[2,null]:(n=this.getJson())?(bn(n,e,t),[2,n]):[2,null]}))}))},e}();function Cn(e,t,n){if(!e)return null;try{var r=JSON.parse(e);return bn(r,t,n),r}catch(e){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(Pn||(Pn={}));var xn="[REDACTED]",Rn=function(e,t){var n,r,i=t.allow,o=void 0===i?[]:i,s=t.strategy,a=void 0===s?Pn.REMOVE:s,c=me([],ve(Ue),!1),u={},l=function(t){var n=t.toLowerCase();c.find((function(e){return e.toLowerCase()===n}))?a===Pn.REDACT&&(u[t]=xn):o.find((function(e){return e.toLowerCase()===n}))?u[t]=e[t]:a===Pn.REDACT&&(u[t]=xn)};try{for(var d=he(Object.keys(e)),f=d.next();!f.done;f=d.next()){l(f.value)}}catch(e){n={error:e}}finally{try{f&&!f.done&&(r=d.return)&&r.call(d)}finally{if(n)throw n.error}}return u},Dn=function(){function e(e,t,n,r,i,o,s,a,c,u,l){void 0===s&&(s=0),this.type=e,this.method=t,this.timestamp=n,this.startTime=r,this.url=i,this.requestWrapper=o,this.status=s,this.duration=a,this.responseWrapper=c,this.error=u,this.endTime=l}return e.prototype.toSerializable=function(){var e,t,n,r,i={type:this.type,method:this.method,url:this.url,timestamp:this.timestamp,status:this.status,duration:this.duration,error:this.error,startTime:this.startTime,endTime:this.endTime,requestHeaders:null===(e=this.requestWrapper)||void 0===e?void 0:e.headers(me([],ve(Ne),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(n=this.responseWrapper)||void 0===n?void 0:n.headers(me([],ve(Ne),!1)),responseBodySize:null===(r=this.responseWrapper)||void 0===r?void 0:r.bodySize};return Object.fromEntries(Object.entries(i).filter((function(e){var t=ve(e,2);return t[0],void 0!==t[1]})))},e}();var Ln=function(e,t){void 0===t&&(t=Ge()),this.callback=e,this.id=t};function Nn(e){try{e()}catch(e){}}var Un=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var n=Ke();e.isSupported()&&(this.globalScope=n)}return e.isSupported=function(){var e=Ke();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var n,r,i,o,s,a,c,u,l,d;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var f=null===(i=null===(r=null===(n=this.globalScope)||void 0===n?void 0:n.XMLHttpRequest)||void 0===r?void 0:r.prototype)||void 0===i?void 0:i.open,p=null===(a=null===(s=null===(o=this.globalScope)||void 0===o?void 0:o.XMLHttpRequest)||void 0===s?void 0:s.prototype)||void 0===a?void 0:a.send,g=null===(l=null===(u=null===(c=this.globalScope)||void 0===c?void 0:c.XMLHttpRequest)||void 0===u?void 0:u.prototype)||void 0===l?void 0:l.setRequestHeader;f&&p&&g&&this.observeXhr(f,p,g);var h=null===(d=this.globalScope)||void 0===d?void 0:d.fetch;h&&this.observeFetch(h),this.isObserving=!0}},e.prototype.unsubscribe=function(e){this.eventCallbacks.delete(e.id)},e.prototype.triggerEventCallbacks=function(e){var t=this;this.eventCallbacks.forEach((function(n){try{n.callback(e)}catch(e){Nn((function(){var n;null===(n=t.logger)||void 0===n||n.debug("an unexpected error occurred while triggering event callbacks",e)}))}}))},e.prototype.handleNetworkRequestEvent=function(e,t,n,r,i,o,s){var a;if(void 0!==o&&void 0!==s){var c,u,l,d="GET";if(!function(e){return"object"==typeof e&&null!==e&&"url"in e&&"method"in e}(t)?c=null===(a=null==t?void 0:t.toString)||void 0===a?void 0:a.call(t):(c=t.url,d=t.method),c)try{var f=new URL(c);c="".concat(f.protocol,"//").concat(f.host).concat(f.pathname).concat(f.search).concat(f.hash)}catch(e){}d=(null==n?void 0:n.method)||d,r&&(u=r.status),i&&(l={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},u=0);var p=Math.floor(performance.now()-s),g=Math.floor(o+p),h=new Dn(e,d,o,o,c,n,u,p,r,l,g);this.triggerEventCallbacks(h)}},e.prototype.getTimestamps=function(){var e,t;return{startTime:null===(e=Date.now)||void 0===e?void 0:e.call(Date),durationStart:null===(t=null===performance||void 0===performance?void 0:performance.now)||void 0===t?void 0:t.call(performance)}},e.prototype.observeFetch=function(e){var t=this;this.globalScope&&e&&(this.globalScope.fetch=function(n,r){return pe(t,void 0,void 0,(function(){var t,i,o,s,a=this;return ge(this,(function(c){switch(c.label){case 0:try{t=this.getTimestamps()}catch(e){Nn((function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)}))}c.label=1;case 1:return c.trys.push([1,3,,4]),[4,e(n,r)];case 2:return i=c.sent(),[3,4];case 3:return s=c.sent(),o=s,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",n,r?new En(r):void 0,i?new An(i):void 0,o,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){Nn((function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling fetch",e)}))}if(i)return[2,i];throw o}}))}))})},e.createXhrJsonParser=function(e,t){return function(){var n;try{if("json"===e.responseType){if(null===(n=t.globalScope)||void 0===n?void 0:n.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(n){return n instanceof Error&&"InvalidStateError"===n.name&&Nn((function(){var n;return null===(n=t.logger)||void 0===n?void 0:n.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))})),null}return null}},e.prototype.observeXhr=function(t,n,r){if(this.globalScope&&t&&n){var i=this.globalScope.XMLHttpRequest.prototype,o=this;i.open=function(){for(var e,n=[],r=0;r<arguments.length;r++)n[r]=arguments[r];var i=ve(n,2),s=i[0],a=i[1];try{this.$$AmplitudeAnalyticsEvent=de({method:s,url:null===(e=null==a?void 0:a.toString)||void 0===e?void 0:e.call(a),headers:{}},o.getTimestamps())}catch(e){Nn((function(){var t;return null===(t=o.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr open",e)}))}return t.apply(this,n)},i.send=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var i=this,s=e.createXhrJsonParser(this,o),a=t[0],c=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",(function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),n=new On(i.status,e,t?parseInt(t,10):void 0,s),r=i.$$AmplitudeAnalyticsEvent.headers,u=new _n(a,r);c.status=i.status,o.handleNetworkRequestEvent("xhr",{url:c.url,method:c.method},u,n,void 0,c.startTime,c.durationStart)}catch(e){Nn((function(){var t;return null===(t=o.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling xhr send",e)}))}})),n.apply(i,t)},i.setRequestHeader=function(e,t){try{var n=this.$$AmplitudeAnalyticsEvent;n&&(n.headers[e]=t)}catch(e){Nn((function(){var t;return null===(t=o.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)}))}r.apply(this,[e,t])}}},e}(),Mn=new Un,jn=function(){function e(){}return e.prototype.parse=function(){return pe(this,void 0,void 0,(function(){return ge(this,(function(e){return[2,de(de(de(de({},Le),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=Ot();return{utm_campaign:e.utm_campaign,utm_content:e.utm_content,utm_id:e.utm_id,utm_medium:e.utm_medium,utm_source:e.utm_source,utm_term:e.utm_term}},e.prototype.getReferrer=function(){var e,t,n={referrer:void 0,referring_domain:void 0};try{n.referrer=document.referrer||void 0,n.referring_domain=null!==(t=null===(e=n.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return n},e.prototype.getClickIds=function(){var e,t=Ot();return(e={})[Se]=t[Se],e[Ee]=t[Ee],e[_e]=t[_e],e[Ie]=t[Ie],e[Pe]=t[Pe],e[Ae]=t[Ae],e[Oe]=t[Oe],e[Ce]=t[Ce],e[xe]=t[xe],e[Re]=t[Re],e[De]=t[De],e},e}(),qn="data-amp-mask",Fn="*****",Bn=/\b(?:\d[ -]*?){13,16}\b/,$n=/(\d{3}-?\d{2}-?\d{4})/g,Hn=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,Kn=function(e,t){var n,r;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var i=e;i=(i=(i=i.replace(Bn,Fn)).replace($n,Fn)).replace(Hn,Fn);try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;try{i=i.replace(a,Fn)}catch(e){}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return i},zn=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(qn)?Fn:e?e(document.title):document.title};function Gn(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(n)return(n=n.call(e)).next.bind(n);if(Array.isArray(e)||(n=function(e,t){if(!e)return;if("string"==typeof e)return Jn(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Jn(e,t)}(e))||t){n&&(e=n);var r=0;return function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function Jn(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function Vn(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function Wn(e,t,n){return t&&Vn(e.prototype,t),n&&Vn(e,n),e}var Yn=function(){return"function"==typeof Symbol},Qn=function(e){return Yn()&&Boolean(Symbol[e])},Xn=function(e){return Qn(e)?Symbol[e]:"@@"+e};Yn()&&!Qn("observable")&&(Symbol.observable=Symbol("observable"));var Zn=Xn("iterator"),er=Xn("observable"),tr=Xn("species");function nr(e,t){var n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function rr(e){var t=e.constructor;return void 0!==t&&null===(t=t[tr])&&(t=void 0),void 0!==t?t:pr}function ir(e){return e instanceof pr}function or(e){or.log?or.log(e):setTimeout((function(){throw e}))}function sr(e){Promise.resolve().then((function(){try{e()}catch(e){or(e)}}))}function ar(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var n=nr(t,"unsubscribe");n&&n.call(t)}}catch(e){or(e)}}function cr(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function ur(e,t,n){e._state="running";var r=e._observer;try{var i=nr(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(cr(e),!i)throw n;i.call(r,n);break;case"complete":cr(e),i&&i.call(r)}}catch(e){or(e)}"closed"===e._state?ar(e):"running"===e._state&&(e._state="ready")}function lr(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void sr((function(){return function(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var n=0;n<t.length&&(ur(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e)}))):void ur(e,t,n);e._queue.push({type:t,value:n})}}var dr=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var n=new fr(this);try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(cr(this),ar(this))},Wn(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),fr=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){lr(this._subscription,"next",e)},t.error=function(e){lr(this._subscription,"error",e)},t.complete=function(){lr(this._subscription,"complete")},Wn(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),pr=function(){function e(t){if(!(this instanceof e))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof t)throw new TypeError("Observable initializer must be a function");this._subscriber=t}var t=e.prototype;return t.subscribe=function(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new dr(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(n,r){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,o)}catch(e){r(e),i.unsubscribe()}},error:r,complete:n});else r(new TypeError(e+" is not a function"));function o(){i.unsubscribe(),n()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(rr(this))((function(n){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(rr(this))((function(n){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return n.error(e)}n.next(t)},error:function(e){n.error(e)},complete:function(){n.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=rr(this),r=arguments.length>1,i=!1,o=arguments[1];return new n((function(n){return t.subscribe({next:function(t){var s=!i;if(i=!0,!s||r)try{o=e(o,t)}catch(e){return n.error(e)}else o=t},error:function(e){n.error(e)},complete:function(){if(!i&&!r)return n.error(new TypeError("Cannot reduce an empty sequence"));n.next(o),n.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];var i=rr(this);return new i((function(t){var r,o=0;return function e(s){r=s.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){o===n.length?(r=void 0,t.complete()):e(i.from(n[o++]))}})}(e),function(){r&&(r.unsubscribe(),r=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var n=rr(this);return new n((function(r){var i=[],o=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return r.error(e)}var o=n.from(t).subscribe({next:function(e){r.next(e)},error:function(e){r.error(e)},complete:function(){var e=i.indexOf(o);e>=0&&i.splice(e,1),s()}});i.push(o)},error:function(e){r.error(e)},complete:function(){s()}});function s(){o.closed&&0===i.length&&r.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),o.unsubscribe()}}))},t[er]=function(){return this},e.from=function(t){var n="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var r=nr(t,er);if(r){var i=r.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return ir(i)&&i.constructor===n?i:new n((function(e){return i.subscribe(e)}))}if(Qn("iterator")&&(r=nr(t,Zn)))return new n((function(e){sr((function(){if(!e.closed){for(var n,i=Gn(r.call(t));!(n=i()).done;){var o=n.value;if(e.next(o),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new n((function(e){sr((function(){if(!e.closed){for(var n=0;n<t.length;++n)if(e.next(t[n]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return new("function"==typeof this?this:e)((function(e){sr((function(){if(!e.closed){for(var t=0;t<n.length;++t)if(e.next(n[t]),e.closed)return;e.complete()}}))}))},Wn(e,null,[{key:tr,get:function(){return this}}]),e}();function gr(e,t){return new pr((function(n){e.subscribe({next:function(e){t(e).then((function(e){return n.next(e)})).catch((function(e){return n.error(e)}))},error:function(e){n.error(e)},complete:function(){n.complete()}})}))}function hr(e,t){return new pr((function(n){var r=!1,i=new Set,o=function(){var e,t;r=!0;try{for(var n=he(i),o=n.next();!o.done;o=n.next()){var s=o.value;try{s.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}i.clear()},s=function(e){var t=e.subscribe({next:function(e){r||n.next(e)},error:function(e){r||(r=!0,n.error(e),o())},complete:function(){i.delete(t),r||0!==i.size||(n.complete(),o(),r=!0)}});i.add(t)};return s(e),s(t),o}))}function vr(e){var t=new Set,n=null;function r(){null==n||n.unsubscribe(),n=null,t.clear()}return new pr((function(i){return t.add(i),null===n&&(n=e.subscribe({next:function(e){var n,r,i;try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.next)||void 0===i||i.call(a,e)}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}},error:function(e){var n,i,o;try{for(var s=he(t),a=s.next();!a.done;a=s.next()){var c=a.value;null===(o=c.error)||void 0===o||o.call(c,e)}}catch(e){n={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(n)throw n.error}}r()},complete:function(){var e,n,i;try{for(var o=he(t),s=o.next();!s.done;s=o.next()){var a=s.value;null===(i=a.complete)||void 0===i||i.call(a)}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}r()}})),function(){t.delete(i),0===t.size&&n&&(n.unsubscribe(),n=null)}}))}function mr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}Yn()&&Object.defineProperty(pr,Symbol("extensions"),{value:{symbol:er,hostReportError:or},configurable:!0});var yr,br={exports:{}};var Tr,wr=function(){if(yr)return br.exports;yr=1;var e=Object.prototype.hasOwnProperty;function t(e){return"[Throws: "+(e?e.message:"?")+"]"}function n(n){var r=[];return function n(i){if(null===i||"object"!=typeof i)return i;if(-1!==r.indexOf(i))return"[Circular]";if(r.push(i),"function"==typeof i.toJSON)try{var o=n(i.toJSON());return r.pop(),o}catch(e){return t(e)}if(Array.isArray(i)){var s=i.map(n);return r.pop(),s}var a=Object.keys(i).reduce((function(r,o){return r[o]=n(function(n,r){if(e.call(n,r))try{return n[r]}catch(e){return t(e)}return n[r]}(i,o)),r}),{});return r.pop(),a}(n)}return br.exports=function(e,t,r){return JSON.stringify(n(e),t,r)},br.exports.ensureProperties=n,br.exports}(),kr=mr(wr),Sr=kr||t({__proto__:null,default:kr},[wr]),Er="https://app.amplitude.com",_r={US:Er,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var Ir="__AMPLITUDE_MESSENGER_INSTANCE__",Pr="__AMPLITUDE_MESSENGER__",Ar=function(){function e(e){var t=(void 0===e?{}:e).origin,n=void 0===t?Er:t;this[Tr]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=n}return e.prototype.notify=function(e){var t,n,r,i;null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise((function(t,s){r.requestCallbacks[i]={resolve:t,reject:s},r.notify(o),n.timeout>0&&setTimeout((function(){s(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]}),n.timeout)}))},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.registerActionHandler=function(e,t){var n,r,i,o;this.actionHandlers.has(e)&&(null===(o=null===(i=this.logger)||void 0===i?void 0:i.warn)||void 0===o||o.call(i,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var s=this.pendingMessages.get(e);if(s){this.pendingMessages.delete(e);try{for(var a=he(s),c=a.next();!c.done;c=a.next()){t(c.value)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}}},e.prototype.loadScriptOnce=function(e){return pe(this,void 0,void 0,(function(){var t,n,r;return ge(this,(function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];n=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise((function(t,n){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",(function(){t({status:!0})}),{once:!0}),i.addEventListener("error",(function(){n({status:!1,message:"Failed to load the script ".concat(e)})})),null===(r=document.head)||void 0===r||r.appendChild(i)}catch(e){n(e)}}))}(e).then((function(){})),this.scriptLoadPromises.set(e,n),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n];case 2:return i.sent(),[3,4];case 3:throw r=i.sent(),this.scriptLoadPromises.delete(e),r;case 4:return[2]}}))}))},e.prototype.setup=function(e){var t,n,r=this,i=void 0===e?{}:e,o=i.logger,s=i.endpoint;o&&(this.logger=o),s&&this.endpoint===Er&&(this.endpoint=s),this.isSetup||(this.isSetup=!0,null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,n,i,o,s;if(null===(n=null===(t=r.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message received: ",JSON.stringify(e)),r.endpoint===e.origin){var a=e.data,c=null==a?void 0:a.action;if(c)if("id"in a&&a.id)null===(o=null===(i=r.logger)||void 0===i?void 0:i.debug)||void 0===o||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),r.handleResponse(a);else{if("ping"===c)return void r.notify({action:"pong"});var u=r.actionHandlers.get(c);if(u)u(a.data);else{var l=null!==(s=r.pendingMessages.get(c))&&void 0!==s?s:[];l.push(a.data),r.pendingMessages.set(c,l)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=Ke();(null==e?void 0:e[Pr])===this&&delete e[Pr]},e}();function Or(e){var t,n=Ke(),r=null==n?void 0:n[Pr];if("object"==typeof(t=r)&&null!==t&&Ir in t&&!0===t[Ir])return r;var i=new Ar(e);return n&&(n[Pr]=i),i}Tr=Ir;var Cr="__AMPLITUDE_BACKGROUND_CAPTURE__";var xr=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},Rr=function(e){return xr(e,"attribution")},Dr=function(e){return xr(e,"formInteractions")},Lr=function(e){return xr(e,"pageViews")},Nr=function(e){return xr(e,"sessions")},Ur=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},Mr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},jr=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},qr=function(e){if(Mr(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},Fr=function(e){if(jr(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},Br=function(e){var t;if(Ur(e.autocapture)){var n=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?n=e.autocapture.networkTracking:e.networkTrackingOptions&&(n=e.networkTrackingOptions),de(de({},n),{captureRules:null===(t=null==n?void 0:n.captureRules)||void 0===t?void 0:t.map((function(t){var n,r,i;if((null===(n=t.urls)||void 0===n?void 0:n.length)&&(null===(r=t.hosts)||void 0===r?void 0:r.length)){var o=JSON.stringify(t.hosts),s=JSON.stringify(t.urls);return null===(i=e.loggerProvider)||void 0===i||i.warn("Found network capture rule with both urls='".concat(s,"' and hosts='").concat(o,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),de(de({},t),{hosts:void 0})}return t}))})}},$r=function(e){var t,n=function(){return!1},r=void 0,i=e.pageCounter;return Lr(e.defaultTracking)&&(n=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:n,trackHistoryChanges:r,eventType:t,pageCounter:i}},Hr=function(e){return Rr(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.attribution&&"object"==typeof e.defaultTracking.attribution?de({},e.defaultTracking.attribution):{}},Kr=function(e,t){for(var n=0;n<t.length;n++){var r=t[n],i=r.name,o=r.args,s=r.resolve,a=e&&e[i];if("function"==typeof a){var c=a.apply(e,o);"function"==typeof s&&s(null==c?void 0:c.promise)}}return e},zr=function(e){return e&&void 0!==e._q},Gr="2.35.3",Jr="amplitude-ts",Vr=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(Jr,"/").concat(Gr),"undefined"!=typeof navigator&&(this.userAgent=navigator.userAgent)}return e.prototype.setup=function(e){return this.config=e,Promise.resolve(void 0)},e.prototype.execute=function(e){var t,n;return pe(this,void 0,void 0,(function(){var r,i,o;return ge(this,(function(s){return r=(new Date).getTime(),i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,o=null!==(n=e.event_id)&&void 0!==n?n:i+1,this.config.lastEventId=o,e.time||(this.config.lastEventTime=r),[2,de(de(de(de(de(de(de(de({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:r},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:"Web"}),this.config.trackingOptions.language&&{language:At()}),this.config.trackingOptions.ipAddress&&{ip:"$remote"}),{insert_id:Ge(),partner_id:this.config.partnerId,plan:this.config.plan}),this.config.ingestionMetadata&&{ingestion_metadata:{source_name:this.config.ingestionMetadata.sourceName,source_version:this.config.ingestionMetadata.sourceVersion}}),e),{event_id:o,library:this.library,user_agent:this.userAgent})]}))}))},e}(),Wr=1e3,Yr=function(e){function t(t){var n,r,i,o=this;try{i=null===(n=Ke())||void 0===n?void 0:n.localStorage}catch(e){null===(r=null==t?void 0:t.loggerProvider)||void 0===r||r.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(o=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,o}return ce(t,e),t.prototype.set=function(t,n){var r;return pe(this,void 0,void 0,(function(){var i;return ge(this,(function(o){switch(o.label){case 0:return Array.isArray(n)&&n.length>Wr?(i=n.length-Wr,[4,e.prototype.set.call(this,t,n.slice(0,Wr))]):[3,2];case 1:return o.sent(),null===(r=this.loggerProvider)||void 0===r||r.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(Wr,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,n)];case 3:o.sent(),o.label=4;case 4:return[2]}}))}))},t}(qt),Qr=function(e){function t(){var t;return e.call(this,null===(t=Ke())||void 0===t?void 0:t.sessionStorage)||this}return ce(t,e),t}(qt),Xr=function(e){function t(t){void 0===t&&(t={});var n=e.call(this)||this;return n.state={done:4},n.customHeaders=t,n}return ce(t,e),t.prototype.send=function(e,t){return pe(this,void 0,void 0,(function(){var n=this;return ge(this,(function(r){return[2,new Promise((function(r,i){var o,s;"undefined"==typeof XMLHttpRequest&&i(new Error("XHRTransport is not supported."));var a=new XMLHttpRequest;a.open("POST",e,!0),a.onreadystatechange=function(){if(a.readyState===n.state.done){var e=a.responseText;try{r(n.buildResponse(JSON.parse(e)))}catch(e){r(n.buildResponse({code:a.status}))}}};var c=de({"Content-Type":"application/json",Accept:"*/*"},n.customHeaders);try{for(var u=he(Object.entries(c)),l=u.next();!l.done;l=u.next()){var d=ve(l.value,2),f=d[0],p=d[1];a.setRequestHeader(f,p)}}catch(e){o={error:e}}finally{try{l&&!l.done&&(s=u.return)&&s.call(u)}finally{if(o)throw o.error}}a.send(JSON.stringify(t))}))]}))}))},t}(Zt),Zr=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return ce(t,e),t.prototype.send=function(e,t){return pe(this,void 0,void 0,(function(){var n=this;return ge(this,(function(r){return[2,new Promise((function(r,i){var o=Ke();if(!(null==o?void 0:o.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var s=JSON.stringify(t);return r(o.navigator.sendBeacon(e,JSON.stringify(t))?n.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:s.length,server_upload_time:Date.now()}):n.buildResponse({code:500}))}catch(e){i(e)}}))]}))}))},t}(Zt),ei=function(e,t,n){return void 0===n&&(n=!0),pe(void 0,void 0,void 0,(function(){var r,i,o,s,a,c,u,l,d;return ge(this,(function(f){switch(f.label){case 0:return r=function(e){return"".concat(be.toLowerCase(),"_").concat(e.substring(0,6))}(e),[4,t.getRaw(r)];case 1:return(i=f.sent())?n?[4,t.remove(r)]:[3,3]:[2,{optOut:!1}];case 2:f.sent(),f.label=3;case 3:return o=ve(i.split("."),6),s=o[0],a=o[1],c=o[2],u=o[3],l=o[4],d=o[5],[2,{deviceId:s,userId:ni(a),sessionId:ti(u),lastEventId:ti(d),lastEventTime:ti(l),optOut:Boolean(c)}]}}))}))},ti=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},ni=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},ri="[Amplitude]",ii="".concat(ri," Form Started"),oi="".concat(ri," Form Submitted"),si="".concat(ri," File Downloaded"),ai="session_start",ci="session_end",ui="".concat(ri," File Extension"),li="".concat(ri," File Name"),di="".concat(ri," Link ID"),fi="".concat(ri," Link Text"),pi="".concat(ri," Link URL"),gi="".concat(ri," Form ID"),hi="".concat(ri," Form Name"),vi="".concat(ri," Form Destination"),mi="cookie",yi=function(e){function t(t,n,r,i,o,s,a,c,u,l,d,f,p,g,h,v,m,y,b,T,w,k,S,E,_,I,P,A,O,C,x,R,D,L,N,U,M,j,q,F,B){void 0===r&&(r=new Lt),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===c&&(c=1e3),void 0===u&&(u=5),void 0===l&&(l=30),void 0===d&&(d=mi),void 0===v&&(v=new et),void 0===m&&(m=Xe.Warn),void 0===b&&(b=!1),void 0===T&&(T=!1),void 0===S&&(S=""),void 0===E&&(E="US"),void 0===P&&(P=18e5),void 0===A&&(A=new Yr({loggerProvider:v})),void 0===O&&(O={ipAddress:!0,language:!0,platform:!0}),void 0===C&&(C="fetch"),void 0===x&&(x=!1),void 0===R&&(R=!0),void 0===j&&(j=!0),void 0===q&&(q=0);var $,H=this;(H=e.call(this,{apiKey:t,storageProvider:A,transportProvider:wi(C)})||this).apiKey=t,H.appVersion=n,H.cookieOptions=i,H.defaultTracking=o,H.autocapture=s,H.flushIntervalMillis=c,H.flushMaxRetries=u,H.flushQueueSize=l,H.identityStorage=d,H.ingestionMetadata=f,H.instanceName=p,H.loggerProvider=v,H.logLevel=m,H.minIdLength=y,H.offline=b,H.partnerId=w,H.plan=k,H.serverUrl=S,H.serverZone=E,H.sessionTimeout=P,H.storageProvider=A,H.trackingOptions=O,H.transport=C,H.useBatch=x,H.fetchRemoteConfig=R,H.networkTrackingOptions=U,H.identify=M,H.enableDiagnostics=j,H.diagnosticsSampleRate=q,H.diagnosticsClient=F,H.remoteConfig=B,H.version=Gr,H._optOut=!1,H._cookieStorage=r,H.deviceId=a,H.lastEventId=g,H.lastEventTime=h,H.optOut=T,H.deferredSessionId=I,H.sessionId=_,H.pageCounter=L,H.userId=D,H.debugLogsEnabled=N,H.loggerProvider.enable(N?Xe.Debug:H.logLevel),H.networkTrackingOptions=U,H.identify=M,H.enableDiagnostics=j,H.diagnosticsSampleRate=q,H.diagnosticsClient=F;var K=null!==($=null==B?void 0:B.fetchRemoteConfig)&&void 0!==$?$:R;return H.remoteConfig=H.remoteConfig||{},H.remoteConfig.fetchRemoteConfig=K,H.fetchRemoteConfig=K,H}return ce(t,e),Object.defineProperty(t.prototype,"cookieStorage",{get:function(){return this._cookieStorage},set:function(e){this._cookieStorage!==e&&(this._cookieStorage=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deviceId",{get:function(){return this._deviceId},set:function(e){this._deviceId!==e&&(this._deviceId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"userId",{get:function(){return this._userId},set:function(e){this._userId!==e&&(this._userId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"sessionId",{get:function(){return this._sessionId},set:function(e){this._sessionId!==e&&(this._sessionId=e,void 0!==e&&void 0!==this._deferredSessionId&&(this._deferredSessionId=void 0),this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"deferredSessionId",{get:function(){return this._deferredSessionId},set:function(e){this._deferredSessionId!==e&&e!==this.sessionId&&(this._deferredSessionId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut!==e&&(this._optOut=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventTime",{get:function(){return this._lastEventTime},set:function(e){this._lastEventTime!==e&&(this._lastEventTime=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"lastEventId",{get:function(){return this._lastEventId},set:function(e){this._lastEventId!==e&&(this._lastEventId=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"pageCounter",{get:function(){return this._pageCounter},set:function(e){this._pageCounter!==e&&(this._pageCounter=e,this.updateStorage())},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"debugLogsEnabled",{set:function(e){this._debugLogsEnabled!==e&&(this._debugLogsEnabled=e,this.updateStorage())},enumerable:!1,configurable:!0}),t.prototype.updateStorage=function(){var e={deviceId:this._deviceId,userId:this._userId,sessionId:this._sessionId,deferredSessionId:this._deferredSessionId,optOut:this._optOut,lastEventTime:this._lastEventTime,lastEventId:this._lastEventId,pageCounter:this._pageCounter,debugLogsEnabled:this._debugLogsEnabled,cookieDomain:void 0};this.cookieStorage instanceof Nt&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(Pt(this.apiKey),e)},t}(nt),bi=function(e,t,n,r,i){return void 0===t&&(t={}),pe(void 0,void 0,void 0,(function(){var o,s,a,c,u,l,d,f,p,g,h,v,m,y,b,T,w,k,S,E,_,I,P,A,O,C,x,R,D,L,N,U,M,j,q,F,B,$,H,K,z,G,J,V,W,Y,Q,X,Z,ee,te;return ge(this,(function(ne){switch(ne.label){case 0:return o=t.identityStorage||mi,P={},o===mi?[3,1]:(a="",[3,5]);case 1:return null===(O=null===(A=t.cookieOptions)||void 0===A?void 0:A.domain)||void 0===O?[3,2]:(c=O,[3,4]);case 2:return[4,ki()];case 3:c=ne.sent(),ne.label=4;case 4:a=c,ne.label=5;case 5:return s=de.apply(void 0,[(P.domain=a,P.expiration=365,P.sameSite="Lax",P.secure=!1,P.upgrade=!0,P),t.cookieOptions]),u={duplicateResolverFn:function(e){var t=Ut(e);if(!t)return!1;var n=JSON.parse(t);return Mt(n.cookieDomain,s.domain)},diagnosticsClient:r},l=Ti(t.identityStorage,s,u),[4,ei(e,l,null===(x=null===(C=t.cookieOptions)||void 0===C?void 0:C.upgrade)||void 0===x||x)];case 6:return d=ne.sent(),[4,l.get(Pt(e))];case 7:return f=ne.sent(),p=Ot(),g=p.ampTimestamp?Number(p.ampTimestamp):void 0,h=!g||Date.now()<g,v=null!==(U=null!==(N=null!==(L=null!==(R=t.deviceId)&&void 0!==R?R:h?null!==(D=p.ampDeviceId)&&void 0!==D?D:p.deviceId:void 0)&&void 0!==L?L:null==f?void 0:f.deviceId)&&void 0!==N?N:d.deviceId)&&void 0!==U?U:Ge(),m=null!==(M=null==f?void 0:f.lastEventId)&&void 0!==M?M:d.lastEventId,y=null!==(j=null==f?void 0:f.lastEventTime)&&void 0!==j?j:d.lastEventTime,b=null!==(F=null!==(q=t.optOut)&&void 0!==q?q:null==f?void 0:f.optOut)&&void 0!==F?F:d.optOut,T=null!==(B=null==f?void 0:f.sessionId)&&void 0!==B?B:d.sessionId,w=null==f?void 0:f.deferredSessionId,k=null!==(H=null!==($=t.userId)&&void 0!==$?$:null==f?void 0:f.userId)&&void 0!==H?H:d.userId,n.previousSessionDeviceId=null!==(K=null==f?void 0:f.deviceId)&&void 0!==K?K:d.deviceId,n.previousSessionUserId=null!==(z=null==f?void 0:f.userId)&&void 0!==z?z:d.userId,S={ipAddress:null===(J=null===(G=t.trackingOptions)||void 0===G?void 0:G.ipAddress)||void 0===J||J,language:null===(W=null===(V=t.trackingOptions)||void 0===V?void 0:V.language)||void 0===W||W,platform:null===(Q=null===(Y=t.trackingOptions)||void 0===Y?void 0:Y.platform)||void 0===Q||Q},E=null==f?void 0:f.pageCounter,_=null==f?void 0:f.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(I=new yi(e,t.appVersion,l,s,t.defaultTracking,t.autocapture,v,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,o,t.ingestionMetadata,t.instanceName,m,y,null!==(X=null==i?void 0:i.loggerProvider)&&void 0!==X?X:t.loggerProvider,t.logLevel,t.minIdLength,t.offline,b,t.partnerId,t.plan,t.serverUrl,null!==(Z=null==i?void 0:i.serverZone)&&void 0!==Z?Z:t.serverZone,T,w,t.sessionTimeout,t.storageProvider,S,t.transport,t.useBatch,t.fetchRemoteConfig,k,E,_,t.networkTrackingOptions,t.identify,null!==(ee=null==i?void 0:i.enableDiagnostics)&&void 0!==ee?ee:t.enableDiagnostics,null!==(te=null==i?void 0:i.diagnosticsSampleRate)&&void 0!==te?te:n._diagnosticsSampleRate,r,t.remoteConfig)).storageProvider.isEnabled()];case 8:return ne.sent()||(I.loggerProvider.warn("Storage provider ".concat(I.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),I.storageProvider=new Lt),[2,I]}}))}))},Ti=function(e,t,n){switch(void 0===e&&(e=mi),void 0===t&&(t={}),e){case"localStorage":return new Yr;case"sessionStorage":return new Qr;case"none":return new Lt;default:return new Nt(de(de({},t),{expirationDays:t.expiration}),n)}},wi=function(e){var t="object"==typeof e?e.type:e,n="object"==typeof e?e.headers:void 0;return"xhr"===t?new Xr(n):"beacon"===t?new Zr:new en(n)},ki=function(e){return pe(void 0,void 0,void 0,(function(){var e,t,n,r,i,o,s,a;return ge(this,(function(c){switch(c.label){case 0:return[4,(new Nt).isEnabled()];case 1:if(!c.sent()||"undefined"==typeof location||!location.hostname)return[2,""];for(e=location.hostname,t=e.split("."),n=[],r=Ge(),i="AMP_TLDTEST_".concat(r.substring(0,8)),o=t.length-2;o>=0;--o)n.push(t.slice(o).join("."));o=0,c.label=2;case 2:return o<n.length?(s=n[o],[4,(a=new Nt({domain:"."+s,expirationDays:.003})).set(i,1)]):[3,7];case 3:return c.sent(),[4,a.get(i)];case 4:return c.sent()?[4,a.remove(i)]:[3,6];case 5:return c.sent(),[2,"."+s];case 6:return o++,[3,2];case 7:return[2,""]}}))}))},Si=function(e){var t={};for(var n in e){var r=e[n];r&&(t[n]=r)}return t},Ei=function(e){var t;void 0===e&&(e={});var n,r=Ke(),i=void 0,o=!1,s=e.trackOn,a=e.trackHistoryChanges,c=e.eventType,u=void 0===c?"[Amplitude] Page Viewed":c,l=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==i||i.error("Malformed URI sequence: ",e)}return t},d=function(){return pe(void 0,void 0,void 0,(function(){var e,t,n;return ge(this,(function(r){switch(r.label){case 0:return e=l("undefined"!=typeof location&&location.href||""),n={event_type:u},t=[{}],[4,_i()];case 1:return[2,(n.event_properties=de.apply(void 0,[de.apply(void 0,t.concat([r.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"undefined"!=typeof location&&l(location.pathname)||"","[Amplitude] Page Title":zn(Kn),"[Amplitude] Page URL":e.split("?")[0]}]),n)]}}))}))},f=function(){return void 0===s||"function"==typeof s&&s()},p="undefined"!=typeof location?location.href:null,g=function(){return pe(void 0,void 0,void 0,(function(){var e,n,r,o;return ge(this,(function(s){switch(s.label){case 0:return e=location.href,n=Pi(a,e,p||"")&&f(),p=e,n?(null==i||i.log("Tracking page view event"),null!=t?[3,1]:[3,3]):[3,4];case 1:return o=(r=t).track,[4,d()];case 2:o.apply(r,[s.sent()]),s.label=3;case 3:s.label=4;case 4:return[2]}}))}))},h=function(){g()},v={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,s){return pe(void 0,void 0,void 0,(function(){var a,c;return ge(this,(function(u){switch(u.label){case 0:return t=s,n=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),o=!0,r&&(r.addEventListener("popstate",h),r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=ve(n,3),i=r[0],s=r[1],a=r[2];e.apply(t,[i,s,a]),o&&g()}})),f()?(i.log("Tracking page view event"),c=(a=t).track,[4,d()]):[3,2];case 1:c.apply(a,[u.sent()]),u.label=2;case 2:return[2]}}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){var t;return ge(this,(function(r){switch(r.label){case 0:return"attribution"===s&&Ii(e)?(null==i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,d()]):[3,2];case 1:t=r.sent(),e.event_type=t.event_type,e.event_properties=de(de({},e.event_properties),t.event_properties),r.label=2;case 2:return n&&e.event_type===u&&(n.pageCounter=n.pageCounter?n.pageCounter+1:1,e.event_properties=de(de({},e.event_properties),{"[Amplitude] Page Counter":n.pageCounter})),[2,e]}}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(e){return r&&(r.removeEventListener("popstate",h),o=!1),[2]}))}))}};return v},_i=function(){return pe(void 0,void 0,void 0,(function(){var e;return ge(this,(function(t){switch(t.label){case 0:return e=Si,[4,(new jn).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},Ii=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,n=t[ue.SET]||{},r=t[ue.UNSET]||{},i=me(me([],ve(Object.keys(n)),!1),ve(Object.keys(r)),!1);return Object.keys(Le).every((function(e){return i.includes(e)}))}return!1},Pi=function(e,t,n){if("pathOnly"===e){if(""==n)return!0;var r=new URL(t),i=new URL(n);return r.origin+r.pathname!==i.origin+i.pathname}return t!==n},Ai=function(){var e,t,n=[],r=function(e,t,r){e.addEventListener(t,r),n.push({element:e,type:t,handler:r})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(n,i){return pe(void 0,void 0,void 0,(function(){var o,s;return ge(this,(function(a){return t=function(e){if(Dr(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions}(n),o=function(){if(i){if("undefined"!=typeof document){var o=new WeakSet,s=function(e){if(!o.has(e)){o.add(e);var s=!1;r(e,"change",(function(){var t,n=Ci(e);s||i.track(ii,((t={})[gi]=Oi(e.id),t[hi]=Oi(e.name),t[vi]=n,t)),s=!0})),r(e,"submit",(function(r){var o,a,c=Ci(e);if(s||i.track(ii,((o={})[gi]=Oi(e.id),o[hi]=Oi(e.name),o[vi]=c,o)),s=!0,void 0!==(null==t?void 0:t.shouldTrackSubmit))if("function"==typeof t.shouldTrackSubmit&&"undefined"!=typeof SubmitEvent&&r instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(r))return}catch(e){n.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else n.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");i.track(oi,((a={})[gi]=Oi(e.id),a[hi]=Oi(e.name),a[vi]=c,a)),s=!1}))}};Array.from(document.getElementsByTagName("form")).forEach(s),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"FORM"===e.nodeName&&s(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(s)}))}))}))).observe(document.body,{subtree:!0,childList:!0})}}else n.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?o():(s=Ke())?s.addEventListener("load",o):n.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return null==e||e.disconnect(),n.forEach((function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)})),n=[],[2]}))}))}}},Oi=function(e){if("string"==typeof e)return e},Ci=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},xi=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(n,r){return pe(void 0,void 0,void 0,(function(){var i,o;return ge(this,(function(s){return i=function(){if(r){if("undefined"!=typeof document){var i=function(e){var n;try{n=new URL(e.href,window.location.href)}catch(e){return}var i=o.exec(n.href),s=null==i?void 0:i[1];s&&function(e,n,r){e.addEventListener(n,r),t.push({element:e,type:n,handler:r})}(e,"click",(function(){var t;s&&r.track(si,((t={})[ui]=s,t[li]=n.pathname,t[di]=e.id,t[fi]=e.text,t[pi]=e.href,t))}))},o=/\.(pdf|xlsx?|docx?|txt|rtf|csv|exe|key|pp(s|t|tx)|7z|pkg|rar|gz|zip|avi|mov|mp4|mpe?g|wmv|midi?|mp3|wav|wma)(\?.+)?$/;Array.from(document.getElementsByTagName("a")).forEach(i),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"A"===e.nodeName&&i(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("a")).map(i)}))}))}))).observe(document.body,{subtree:!0,childList:!0})}}else n.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")},"complete"===document.readyState?i():(o=Ke())?o.addEventListener("load",i):n.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(n){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,n=e.type,r=e.handler;null==t||t.removeEventListener(n,r)})),t=[],[2]}))}))}}},Ri=!1,Di=function(){var e=Ke(),t=[],n=function(n,r){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(n,r),t.push({type:n,handler:r}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(r){return"undefined"==typeof navigator?(e.loggerProvider.debug("Network connectivity checker plugin is disabled because navigator is not available."),e.offline=!1,[2]):(e.offline=!navigator.onLine,n("online",(function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout((function(){t.flush()}),e.flushIntervalMillis)})),n("offline",(function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2])}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(n){return t.forEach((function(t){var n=t.type,r=t.handler;null==e||e.removeEventListener(n,r)})),t=[],[2]}))}))}}};function Li(e){var t,n,r,i,o,s,a,c,u,l,d;if("object"==typeof e&&null!==e&&!Array.isArray(e)){var f=Object.keys(e);try{for(var p=he(f),g=p.next();!g.done;g=p.next()){var h=g.value;try{var v=e[h];"boolean"==typeof(null==v?void 0:v.enabled)&&(v.enabled?(delete v.enabled,0===Object.keys(v).length&&(e[h]=!0)):e[h]=!1),Li(v)}catch(e){}}}catch(e){t={error:e}}finally{try{g&&!g.done&&(n=p.return)&&n.call(p)}finally{if(t)throw t.error}}try{if(null===(u=null===(c=null===(a=e.autocapture)||void 0===a?void 0:a.networkTracking)||void 0===c?void 0:c.captureRules)||void 0===u?void 0:u.length)try{for(var m=he(e.autocapture.networkTracking.captureRules),y=m.next();!y.done;y=m.next()){var b=y.value;try{for(var T=(o=void 0,he(["responseHeaders","requestHeaders"])),w=T.next();!w.done;w=T.next()){var k=w.value,S=null!==(l=b[k])&&void 0!==l?l:{},E=S.captureSafeHeaders,_=S.allowlist;(E||_)&&(void 0===_||Array.isArray(_)?b[k]=me(me([],ve(E?Ne:[]),!1),ve(null!=_?_:[]),!1):delete b[k])}}catch(e){o={error:e}}finally{try{w&&!w.done&&(s=T.return)&&s.call(T)}finally{if(o)throw o.error}}}}catch(e){r={error:e}}finally{try{y&&!y.done&&(i=m.return)&&i.call(m)}finally{if(r)throw r.error}}}catch(e){}var I=null===(d=e.autocapture)||void 0===d?void 0:d.frustrationInteractions;I&&(I.rageClick&&(I.rageClicks=I.rageClick,delete I.rageClick),I.deadClick&&(I.deadClicks=I.deadClick,delete I.deadClick))}}function Ni(e,t,n){var r,i,o=[];try{for(var s=he(null!=t?t:[]),a=s.next();!a.done;a=s.next()){var c=a.value;try{o.push(new RegExp(c))}catch(e){n.loggerProvider.warn("Invalid regex pattern: ".concat(c),e)}}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return e.concat(o)}function Ui(e,t){var n,r,i,o,s,a,c;if(e){Li(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var u=e;if(u&&"autocapture"in u){if("boolean"==typeof u.autocapture&&(t.autocapture=u.autocapture),"object"==typeof u.autocapture&&null!==u.autocapture){var l=de({},u.autocapture);if(void 0===t.autocapture&&(t.autocapture=u.autocapture),"object"==typeof u.autocapture.elementInteractions&&null!==u.autocapture.elementInteractions&&(null===(i=u.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===i?void 0:i.length)){l.elementInteractions=de({},u.autocapture.elementInteractions);var d=l.elementInteractions,f=null!==(o=d.pageUrlAllowlist)&&void 0!==o?o:[],p=u.autocapture.elementInteractions.pageUrlAllowlistRegex;d.pageUrlAllowlist=Ni(f,p,t),delete d.pageUrlAllowlistRegex}if("object"==typeof u.autocapture.networkTracking&&null!==u.autocapture.networkTracking&&(null===(s=u.autocapture.networkTracking.captureRules)||void 0===s?void 0:s.length)){l.networkTracking=de({},u.autocapture.networkTracking);var g=null!==(a=l.networkTracking.captureRules)&&void 0!==a?a:[];try{for(var h=he(g),v=h.next();!v.done;v=h.next()){var m=v.value;m.urls=Ni(null!==(c=m.urls)&&void 0!==c?c:[],m.urlsRegex,t),delete m.urlsRegex}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=h.return)&&r.call(h)}finally{if(n)throw n.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=de({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},l)),"object"==typeof t.autocapture&&(t.autocapture=de(de({},t.autocapture),l))}t.defaultTracking=t.autocapture}t.loggerProvider.debug("Browser config after remote config update:",JSON.stringify(t))}catch(e){t.loggerProvider.error("Failed to apply remote configuration because of error: ",e)}}}var Mi,ji="1.22.2",qi="[Amplitude] Element Clicked",Fi="[Amplitude] Element Tag",Bi="[Amplitude] Element Text",$i="[Amplitude] Page URL",Hi="data-amp-mask-attributes",Ki=["input","select","textarea"],zi=function(e,t){var n,r=null===(n=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===n?void 0:n.call(window,e);return"pointer"===(null==r?void 0:r.getPropertyValue("cursor"))&&"click"===t},Gi=function(e){var t=e.pageUrlAllowlist,n=e.pageUrlExcludelist;return!(n&&n.length>0&&xt(window.location.href,n))&&!!xt(window.location.href,t)},Ji=function(e,t,n){return void 0===n&&(n=!1),function(r,i){var o,s,a=e.shouldTrackEventResolver,c=null===(s=null===(o=null==i?void 0:i.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===s?void 0:s.call(o);if(!c)return!1;if(a)return a(r,i);if(!Gi(e))return!1;var u=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof u)switch(u.toLowerCase()){case"hidden":case"password":return!1}var l=zi(i,r);if(n&&l)return!0;if(t){var d=t.some((function(e){var t;return!!(null===(t=null==i?void 0:i.matches)||void 0===t?void 0:t.call(i,e))}));if(!d)return!1}switch(c){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:return!!l||"click"===r}}},Vi=function(e){return Object.keys(e).reduce((function(t,n){var r=e[n];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(r)||(t[n]=r),t}),{})},Wi=function(e,t){return e?t.some((function(t){var n;return null===(n=null==e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)}))?e:Wi(null==e?void 0:e.parentElement,t):null},Yi=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};!function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"}(Mi||(Mi={}));var Qi="__AMPLITUDE_VISUAL_TAGGING__";var Xi=Ke(),Zi=function(){return new pr((function(e){var t=new MutationObserver((function(t){e.next(t)}));return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}}))},eo=function(e){return void 0===e&&(e="click"),new pr((function(t){var n=function(e){t.next(e)};return Xi.document.addEventListener(e,n,{capture:!0}),function(){Xi.document.removeEventListener(e,n,{capture:!0})}}))},to=function(){var e=hr(new pr((function(e){var t=function(t){if(t instanceof ErrorEvent){var n={kind:"error"};t.error instanceof Error||t.error instanceof DOMException?n=de(de({},n),{message:t.error.message,stack:t.error.stack,filename:t.filename,lineNumber:t.lineno,columnNumber:t.colno}):"string"==typeof t.error&&(n.message=t.error),e.next(n)}};return Xi.addEventListener("error",t),function(){Xi.removeEventListener("error",t)}})),new pr((function(e){var t=function(t){var n={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(n.message=t.reason.message,n.stack=t.reason.stack):"string"==typeof t.reason&&(n.message=t.reason),e.next(n)};return Xi.addEventListener("unhandledrejection",t),function(){Xi.removeEventListener("unhandledrejection",t)}})));return hr(e,new pr((function(e){var t=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=void 0;Array.isArray(n[0])&&"string"==typeof n[0][0]&&(i=n[0][0]),e.next({kind:"console",message:i})};return ln.addListener("error",t),function(){ln.removeListener(t)}})))},no=function(e,t,n){e.forEach((function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=n.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}}))},ro={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},io=function(e){var t,n,r,i,o=Object.values(ro).reduce((function(e,t){return e[t]=new Set,e}),{});if(!e)return o;try{for(var s=he(e),a=s.next();!a.done;a=s.next()){var c=a.value;try{try{for(var u=(r=void 0,he(c.definition)),l=u.next();!l.done;l=u.next()){var d=l.value,f=ro[d.event_type];f&&o[f].add(c.id)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==c?void 0:c.id,e)}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},oo=function(e){var t,n,r,i,o=new Map;try{for(var s=he(e),a=s.next();!a.done;a=s.next()){var c=a.value;try{for(var u=(r=void 0,he(c.conditions)),l=u.next();!l.done;l=u.next()){var d=l.value;if("LABELED_EVENT"===d.type){var f=d.match.eventId,p=o.get(f);p||(p=[],o.set(f,p)),p.push(c)}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(i=u.return)&&i.call(u)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}return o},so=function(e,t){return t.filter((function(t){return t.definition.some((function(t){return ro[t.event_type]===e.type&&t.filters.every((function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){return console.error("Error matching event to filter",e),!1}return!1}(e,t)}))}))}))},ao=function(){function e(e,t,n,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=n,this.options=r}return e.prototype.evaluate=function(e){var t,n,r=this.options.pageActions;if(!r)return e;var i=function(e,t){var n,r,i,o,s=new Set;try{for(var a=he(e),c=a.next();!c.done;c=a.next()){var u=c.value,l=t.get(u.id);if(l)try{for(var d=(i=void 0,he(l)),f=d.next();!f.done;f=d.next()){var p=f.value;s.add(p)}}catch(e){i={error:e}}finally{try{f&&!f.done&&(o=d.return)&&o.call(d)}finally{if(i)throw i.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return Array.from(s)}(so(e,Array.from(this.groupedLabeledEvents[e.type]).map((function(e){return r.labeledEvents[e]}))),this.labeledEventToTriggerMap);try{for(var o=he(i),s=o.next();!s.done;s=o.next()){var a=s.value;no(a.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=n},e}(),co=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",Hi,qn]),uo=["type"],lo=["svg","path","g"],fo=["password","hidden"];function po(e,t){var n,r,i,o,s,a;if(null===e)return null;var c=String(e.tagName).toLowerCase(),u={tag:c},l=Array.from(null!==(o=null===(i=e.parentElement)||void 0===i?void 0:i.children)&&void 0!==o?o:[]);l.length&&(u.index=l.indexOf(e),u.indexOfType=l.filter((function(t){return t.tagName===e.tagName})).indexOf(e));var d=null===(a=null===(s=e.previousElementSibling)||void 0===s?void 0:s.tagName)||void 0===a?void 0:a.toLowerCase();d&&(u.prevSib=String(d));var f=e.getAttribute("id");f&&(u.id=String(f));var p=Array.from(e.classList);p.length&&(u.classes=p);var g={},h=Array.from(e.attributes).filter((function(e){return!co.has(e.name)})),v=!function(e){var t,n,r,i=null===(n=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t),o=e instanceof HTMLElement&&"true"===(null===(r=e.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!Ki.includes(i)&&!o}(e);if(!fo.includes(String(e.getAttribute("type")))&&!lo.includes(c))try{for(var m=he(h),y=m.next();!y.done;y=m.next()){var b=y.value;v&&!uo.includes(b.name)||(t.has(b.name)?g[b.name]=Fn:g[b.name]=String(b.value).substring(0,128))}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=m.return)&&r.call(m)}finally{if(n)throw n.error}}return Object.keys(g).length&&(u.attrs=g),u}var go,ho=function(e,t){var n,r,i,o=this;this.replaceSensitiveString=function(e){return Kn(e,o.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,n,r,i,s,a=performance.now();if(!e)return[];for(var c,u=function(e){var t=[];if(!e)return t;t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e),l=new Map,d=u.length-1;d>=0;d--){var f=u[d];if(f){var p=(c=f.getAttribute(Hi))?c.split(",").map((function(e){return e.trim()})).filter((function(e){return e.length>0&&"id"!==e&&"class"!==e})):[],g=d===u.length-1?[]:null!==(r=l.get(u[d+1]))&&void 0!==r?r:new Set,h=new Set(me(me([],ve(g),!1),ve(p),!1));l.set(f,h)}}s=u.map((function(e){var t;return po(e,null!==(t=l.get(e))&&void 0!==t?t:new Set)}));var v=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach((function(t){var n=ve(t,2),r=n[0],i=n[1];e.attrs&&(e.attrs[r]=o.replaceSensitiveString(i))}))};try{for(var m=he(s),y=m.next();!y.done;y=m.next())v(y.value)}catch(e){t={error:e}}finally{try{y&&!y.done&&(n=m.return)&&n.call(m)}finally{if(t)throw t.error}}var b=performance.now();return null===(i=o.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",b-a),s},this.getNearestLabel=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?o.getText(t):o.getNearestLabel(n)},this.getEventProperties=function(e,t,n){var r,i,s,a,c,u,l=null===(s=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===s?void 0:s.call(i),d="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},f=o.getHierarchy(t),p=null===(a=f[0])||void 0===a?void 0:a.attrs,g=o.getNearestLabel(t),h=(c=null!=p?p:{},u=n,Object.entries(c).reduce((function(e,t){var n=ve(t,2),r=n[0],i=n[1];if(r.startsWith(u)){var o=r.replace(u,"");o&&(e[o]=i||"")}return e}),{})),v=((r={})["[Amplitude] Element Hierarchy"]=f,r[Fi]=l,r[Bi]=o.getText(t),r["[Amplitude] Element Position Left"]=null==d.left?null:Math.round(d.left),r["[Amplitude] Element Position Top"]=null==d.top?null:Math.round(d.top),r["[Amplitude] Element Attributes"]=h,r["[Amplitude] Element Parent Label"]=g,r[$i]=Rt(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=zn(o.replaceSensitiveString),r["[Amplitude] Viewport Height"]=window.innerHeight,r["[Amplitude] Viewport Width"]=window.innerWidth,r);if(v["[Amplitude] Element ID"]=t.getAttribute("id")||"",v["[Amplitude] Element Class"]=t.getAttribute("class"),v["[Amplitude] Element Aria Label"]=null==p?void 0:p["aria-label"],"a"===l&&"click"===e&&t instanceof HTMLAnchorElement){var m=t.href.substring(0,128);v["[Amplitude] Element Href"]=o.replaceSensitiveString(m)}return Vi(v)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,n,r,i){void 0===i&&(i=!1);var s=o.addTypeAndTimestamp(e,t);if(function(e){return"click"===e.type||"change"===e.type}(s)&&null!==s.event.target){if(i&&zi(s.event.target,s.type))return s.closestTrackedAncestor=s.event.target,s.targetElementProperties=o.getEventProperties(s.type,s.closestTrackedAncestor,r),s;var a=Wi(s.event.target,n);return a&&(s.closestTrackedAncestor=a,s.targetElementProperties=o.getEventProperties(s.type,a,r)),s}return s},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;return e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector?n.querySelector(e.selector):n}}catch(e){return}}(e,t);if(!n)return;return"TEXT"===e.elementExtractType?o.getText(n):"ATTRIBUTE"===e.elementExtractType&&e.attribute?n.getAttribute(e.attribute):void 0}},this.getTextWithMaskedDescendants=function(e){var t,n,r="[".concat(qn,"], [contenteditable]");if(!e.querySelector(r))return e.innerText;var i="",s=Array.from(e.childNodes);try{for(var a=he(s),c=a.next();!c.done;c=a.next()){var u=c.value;u.nodeType!==Node.TEXT_NODE?u instanceof Element&&(u.hasAttribute(qn)||u.hasAttribute("contenteditable")?i+=Fn:i+=o.getTextWithMaskedDescendants(u)):i+=u.textContent||""}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return i},this.getText=function(e){if(null!==e.closest("[".concat(qn,"]")))return Fn;var t="";return t=e.querySelector("[".concat(qn,"], [contenteditable]"))?o.getTextWithMaskedDescendants(e):e.innerText||"",o.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){var t,n,r;if(!e)return{};var i=null===(r=null===(n=null==e?void 0:e.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n),s=((t={})[Fi]=i,t[Bi]=o.getText(e),t[$i]=window.location.href.split("?")[0],t);return Vi(s)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var s=null!==(i=e.maskTextRegex)&&void 0!==i?i:[],a=[];try{for(var c=he(s),u=c.next();!u.done;u=c.next()){var l=u.value;if(a.length>=25)break;if(l instanceof RegExp)a.push(l);else if("pattern"in l&&"string"==typeof l.pattern)try{a.push(new RegExp(l.pattern,"i"))}catch(e){}}}catch(e){n={error:e}}finally{try{u&&!u.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=a};!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"}(go||(go={}));var vo=function(e,t){var n,r,i,o,s,a,c,u;void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",ji);var l=e.dataAttributePrefix,d=void 0===l?fn:l,f=e.visualTaggingOptions,p=void 0===f?{enabled:!0}:f;e.cssSelectorAllowlist=null!==(n=e.cssSelectorAllowlist)&&void 0!==n?n:dn,e.actionClickAllowlist=null!==(r=e.actionClickAllowlist)&&void 0!==r?r:pn,e.debounceTime=null!==(i=e.debounceTime)&&void 0!==i?i:0,e.pageUrlExcludelist=null===(o=e.pageUrlExcludelist)||void 0===o?void 0:o.reduce((function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(n){return console.warn("Invalid regex pattern: ".concat(t.pattern),n),e}return e}),[]);var g="@amplitude/plugin-autocapture-browser",h=[],v=new ho(e,t),m=io(Object.values(null!==(a=null===(s=e.pageActions)||void 0===s?void 0:s.labeledEvents)&&void 0!==a?a:{})),y=oo(null!==(u=null===(c=e.pageActions)||void 0===c?void 0:c.triggers)&&void 0!==u?u:[]),b=function(e,t,n,r){return new ao(e,t,n,r)}(m,y,v,e);return{name:g,type:"enrichment",setup:function(t,n){return pe(void 0,void 0,void 0,(function(){var r,i,o,s,a,c,u,l,f,T;return ge(this,(function(w){return"undefined"==typeof document||(t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",(function(t){!function(t){var n,r;t&&(e.pageActions=de(de({},e.pageActions),t),m=io(Object.values(null!==(n=e.pageActions.labeledEvents)&&void 0!==n?n:{})),y=oo(null!==(r=e.pageActions.triggers)&&void 0!==r?r:[]),b.update(m,y,e))}(t)})):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),r=Ji(e,e.cssSelectorAllowlist),i=Ji(e,e.actionClickAllowlist),o=function(){var t,n,r=vr(eo().map((function(t){return v.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,d)}))),i=vr(new pr((function(t){var n,r=function(n){var r=v.addAdditionalEventProperties(n,"change",e.cssSelectorAllowlist,d);t.next(r)};return null===(n=Ke())||void 0===n||n.document.addEventListener("change",r,{capture:!0}),function(){var e;return null===(e=Ke())||void 0===e?void 0:e.document.removeEventListener("change",r)}})));window.navigation&&(n=vr(new pr((function(t){var n=function(n){var r=v.addAdditionalEventProperties(n,"navigate",e.cssSelectorAllowlist,d);t.next(r)};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}}))));var o=vr(Zi().map((function(t){return v.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,d)})));return(t={})[go.ChangeObservable]=i,t[go.ClickObservable]=r,t[go.MutationObservable]=o,t[go.NavigateObservable]=n,t}(),s=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackEvent,i=e.evaluateTriggers;return n.clickObservable.filter(Yi).filter((function(e){return r("click",e.closestTrackedAncestor)})).map((function(e){return i(e)})).subscribe((function(e){null==t||t.track(qi,e.targetElementProperties)}))}({allObservables:o,amplitude:n,shouldTrackEvent:r,evaluateTriggers:b.evaluate.bind(b)}),h.push(s),a=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return n.changeObservable.filter(Yi).filter((function(e){return i("change",e.closestTrackedAncestor)})).map((function(e){return o(e)})).subscribe((function(e){null==t||t.track("[Amplitude] Element Changed",r("change",e.closestTrackedAncestor))}))}({allObservables:o,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return v.getEventProperties.apply(v,me(me([],ve(e),!1),[d],!1))},amplitude:n,shouldTrackEvent:r,evaluateTriggers:b.evaluate.bind(b)}),h.push(a),c=function(e){var t=e.amplitude,n=e.allObservables,r=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,s=e.shouldTrackActionClick,a=n.clickObservable,c=n.mutationObservable,u=n.navigateObservable,l=a.filter((function(e){return!o("click",e.closestTrackedAncestor)})).map((function(e){var t=Wi(e.event.target,r.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e})).filter(Yi).filter((function(e){return s("click",e.closestTrackedAncestor)})),d=u?hr(c,u):c,f=hr(l,d),p=null,g=null;return gr(f,(function(e){if(p&&(clearTimeout(p),p=null),"click"===e.type)return g=e,p=setTimeout((function(){p=null,g=null}),500),Promise.resolve(null);if(g){var t=g;return g=null,Promise.resolve(t)}return Promise.resolve(null)})).subscribe((function(e){e&&(null==t||t.track(qi,i("click",e.closestTrackedAncestor)))}))}({allObservables:o,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return v.getEventProperties.apply(v,me(me([],ve(e),!1),[d],!1))},amplitude:n,shouldTrackEvent:r,shouldTrackActionClick:i}),c&&h.push(c),null===(T=null==t?void 0:t.loggerProvider)||void 0===T||T.log("".concat(g," has been successfully added.")),window.opener&&p.enabled&&(u=e.cssSelectorAllowlist,l=e.actionClickAllowlist,function(e,t){var n=e;if(!0!==n[Qi]){n[Qi]=!0;var r=t.dataExtractor,i=t.isElementSelectable,o=t.cssSelectorAllowlist,s=t.actionClickAllowlist,a=null,c=function(t){e.notify({action:"element-selected",data:t})},u=function(t,n){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:n}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:n})};e.registerActionHandler("initialize-visual-tagging-selector",(function(t){e.loadScriptOnce("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then((function(){var n;a=null===(n=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===n?void 0:n.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(e){return!i||i((null==t?void 0:t.actionType)||"click",e)},onTrack:u,onSelect:c,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:s,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:ji}}}),e.notify({action:"selector-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")}))})),e.registerActionHandler("close-visual-tagging-selector",(function(){var e;null===(e=null==a?void 0:a.close)||void 0===e||e.call(a)}))}}(f=Or(),{dataExtractor:v,isElementSelectable:Ji(e,me(me([],ve(u),!1),ve(l),!1)),cssSelectorAllowlist:u,actionClickAllowlist:l}),function(e){var t=e;if(!0!==t[Cr]){t[Cr]=!0;var n="https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.1.js.gz",r=null,i=function(t,n){var r,i;"background-capture-complete"===t&&(null===(i=null===(r=e.logger)||void 0===r?void 0:r.debug)||void 0===i||i.call(r,"Background capture complete"),e.notify({action:"background-capture-complete",data:n}))};e.registerActionHandler("initialize-background-capture",(function(){var t,o;null===(o=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===o||o.call(t,"Initializing background capture (external script)");var s=new URL(n,e.endpoint).toString();e.loadScriptOnce(s).then((function(){var t,n,o;null===(n=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Background capture script loaded (external)"),r=null===(o=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===o?void 0:o.call(window,{messenger:e,onBackgroundCapture:i}),e.notify({action:"background-capture-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")}))})),e.registerActionHandler("close-background-capture",(function(){var e;null===(e=null==r?void 0:r.close)||void 0===e||e.call(r),r=null}))}}(f),f.setup(de({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:_r[t.serverZone]})))),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){var e,t,n,r;return ge(this,(function(i){try{for(e=he(h),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(r=e.return)&&r.call(e)}finally{if(n)throw n.error}}return[2]}))}))}}},mo=["mutation","navigate"];function yo(e,t){var n,r,i,o,s=t.event,a=s.pageX,c=s.pageY;e.yMin=Math.min(null!==(n=e.yMin)&&void 0!==n?n:c,c),e.yMax=Math.max(null!==(r=e.yMax)&&void 0!==r?r:c,c),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:a,a),e.xMax=Math.max(null!==(o=e.xMax)&&void 0!==o?o:a,a),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function bo(e){if(0===e.length)return null;var t=e[0],n=e[e.length-1];return{rageClickEvent:de({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(n.timestamp).toISOString(),"[Amplitude] Duration":n.timestamp-t.timestamp,"[Amplitude] Clicks":e.map((function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}})),"[Amplitude] Click Count":e.length},t.targetElementProperties),time:t.timestamp}}function To(e){var t=this,n=e.amplitude,r=e.allObservables,i=e.shouldTrackRageClick,o=r.clickObservable,s=r.selectionObservable,a=[],c={},u=null;function l(e){a=[],c={},e&&(yo(c,e),a.push(e))}var d=gr(o.filter((function(e){return i("click",e.closestTrackedAncestor)})),(function(e){return pe(t,void 0,void 0,(function(){var t;return ge(this,(function(n){return yo(c,e),t=null,0===a.length||function(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}(a,e)||function(e,t){var n=e[Math.max(0,e.length-4+1)];return t.timestamp-n.timestamp>=1e3}(a,e)||c.isOutOfBounds?(u&&(t=bo(a)),l(e)):a.push(e),u&&(clearTimeout(u.timerId),u.resolve(t),u=null),a.length>=4?[2,new Promise((function(e){u={resolve:e,timerId:setTimeout((function(){e(bo(a))}),1e3)}}))]:[2,null]}))}))})),f=null==s?void 0:s.subscribe((function(){l()})),p=d.subscribe((function(e){null!==e&&n.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})}));return{unsubscribe:function(){p.unsubscribe(),null==f||f.unsubscribe()}}}var wo,ko;!function(e){e.INCREASING="increasing",e.DECREASING="decreasing"}(wo||(wo={})),function(e){e.X="x",e.Y="y"}(ko||(ko={}));function So(e){var t=e.changes,n=e.changesThreshold,r=e.thresholdMs;return!(t.length<n)&&t[t.length-1]-t[0]<r}function Eo(e){e.changes=[],e.startTime=void 0}function _o(e){for(var t=e.changes,n=e.thresholdMs,r=0,i=t[t.length-1];r<t.length;r++){if(i-t[r]<n)break}0!==r&&(e.startTime=t[r],e.changes.splice(0,r))}var Io=function(e){var t=e.mouseDirectionChangeObservable,n=e.directionChanges,r=void 0===n?10:n,i=e.thresholdMs,o=void 0===i?2e3:i;return new pr((function(e){var n={changes:[],changesThreshold:r,thresholdMs:o},i={changes:[],changesThreshold:r,thresholdMs:o},s=void 0,a=null;function c(){void 0!==s&&(e.next(s),s=void 0,null!==a&&clearTimeout(a),Eo(n),Eo(i))}return t.subscribe((function(e){null!==a&&clearTimeout(a),function(e){var t=+Date.now();e.startTime=e.startTime||t;var n=e.changes,r=e.changesThreshold;n.push(t),n.length>r&&n.shift()}(e===ko.X?n:i);var t=function(e,t){var n=void 0;if(So(e)&&(n=e.startTime),So(t)){var r=t.startTime;r&&(!n||r<n)&&(n=r)}return n}(n,i);return t?(s=s||t,a=setTimeout((function(){c(),a=null}),o)):c(),_o(n),_o(i),function(){null!==a&&(clearTimeout(a),a=null)}}))}))},Po=function(e){var t=e.amplitude,n=e.options,r=e.allObservables,i=e.directionChanges,o=void 0===i?10:i,s=e.thresholdMs,a=void 0===s?2e3:s,c=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new pr((function(e){var n=null,r=null,i=null;return t.subscribe((function(t){var o={x:t.clientX,y:t.clientY};null!==n?(o.x>n.x?(r===wo.DECREASING&&e.next(ko.X),r=wo.INCREASING):o.x<n.x&&(r===wo.INCREASING&&e.next(ko.X),r=wo.DECREASING),o.y>n.y?(i===wo.DECREASING&&e.next(ko.Y),i=wo.INCREASING):o.y<n.y&&(i===wo.INCREASING&&e.next(ko.Y),i=wo.DECREASING),n=o):n=o}))}))}({allWindowObservables:r});return Io({mouseDirectionChangeObservable:c,directionChanges:o,thresholdMs:a}).subscribe((function(e){Gi(n)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})}))};function Ao(e,t,n,r){if(!r)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:n}var Oo,Co,xo=4e3,Ro=function(e){var t;void 0===e&&(e={});var n="@amplitude/plugin-frustration-browser",r=[],i=!1!==e.errorClicks;e.errorClicks||(i=!1);var o=!1!==e.deadClicks&&null!==e.deadClicks,s=!1!==e.rageClicks&&null!==e.rageClicks,a=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(a=!1);var c=Ao(e,"rageClicks",mn,s),u=Ao(e,"deadClicks",hn,o),l=Ao(e,"errorClicks",vn,i),d=null!==(t=e.dataAttributePrefix)&&void 0!==t?t:fn,f=new ho(e),p=me([],ve(new Set(me(me(me([],ve(c),!1),ve(u),!1),ve(l),!1))),!1),g=function(){var e,t,n=vr(eo("pointerdown").map((function(e){return f.addAdditionalEventProperties(e,"click",p,d,!0)}))),r=vr(to().map((function(e){return f.addTypeAndTimestamp(e,"error")}))),i=vr(Zi().map((function(e){return f.addAdditionalEventProperties(e,"mutation",p,d)})));window.navigation&&(t=vr(new pr((function(e){var t=function(t){e.next(de(de({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}})).map((function(e){return f.addAdditionalEventProperties(e,"navigate",p,d)}))));var o=vr(new pr((function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){try{if(t.selectionStart===t.selectionEnd)return}catch(e){return}return e.next()}var n=window.getSelection();if(n&&!n.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}}))),s=vr(new pr((function(e){var t=function(t){e.next(t)},n={capture:!0};return Xi.document.addEventListener("mousemove",t,n),function(){Xi.document.removeEventListener("mousemove",t,n)}})));return(e={})[go.ClickObservable]=n,e[go.MutationObservable]=i,e[go.NavigateObservable]=t,e[go.BrowserErrorObservable]=r,e[go.SelectionObservable]=o,e[go.MouseMoveObservable]=s,e};return{name:n,type:"enrichment",setup:function(t,p){return pe(void 0,void 0,void 0,(function(){var h,v,m,y,b,T,w,k,S,E,_;return ge(this,(function(I){return"undefined"==typeof document||(h=g(),s&&(v=Ji(e,c),m=To({allObservables:h,amplitude:p,shouldTrackRageClick:v}),r.push(m)),o&&(y=Ji(e,u),b=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackDeadClick,o=n.clickObservable,s=n.mutationObservable,a=n.navigateObservable,c=o.filter((function(e){return Yi(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===Mi.LEFT_OR_TOUCH_CONTACT})),u=a?hr(s,a):s,l=hr(c,u),d=null;return gr(l,(function(e){return d&&mo.includes(e.type)?(clearTimeout(d),d=null,Promise.resolve(null)):"click"===e.type?d?Promise.resolve(null):new Promise((function(t){d=setTimeout((function(){t(e),d=null}),3e3)})):Promise.resolve(null)})).subscribe((function(e){if(e){var n={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};t.track("[Amplitude] Dead Click",de(de({},r("click",e.closestTrackedAncestor)),n),{time:e.timestamp})}}))}({amplitude:p,allObservables:h,getEventProperties:function(e,t){return f.getEventProperties(e,t,d)},shouldTrackDeadClick:y}),r.push(b)),i&&(T=Ji(e,l),w=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackErrorClick,i=n.clickObservable,o=n.browserErrorObservable,s=i.filter((function(e){return Yi(e)&&r("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===Mi.LEFT_OR_TOUCH_CONTACT})),a=null,c=null,u=function(){null!==a&&(clearTimeout(a),a=null),c=null};return hr(s,o).subscribe((function(e){var n;if("click"===e.type)return u(),c=e,void(a=setTimeout(u,2e3));"error"===e.type&&c&&(t.track("[Amplitude] Error Click",de(((n={})["[Amplitude] Kind"]=e.event.kind,n["[Amplitude] Message"]=e.event.message,n["[Amplitude] Stack"]=e.event.stack,n["[Amplitude] Filename"]=e.event.filename,n["[Amplitude] Line Number"]=e.event.lineNumber,n["[Amplitude] Column Number"]=e.event.columnNumber,n),c.targetElementProperties)),u())}))}({amplitude:p,allObservables:h,shouldTrackErrorClick:T}),r.push(w)),a&&(k=void 0,S=void 0,"object"==typeof e.thrashedCursor&&(k=e.thrashedCursor.directionChanges,S=e.thrashedCursor.threshold,k&&k<5&&(t.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(k," is below the minimum of ").concat(5,", setting to ").concat(5)),k=5),S&&S>xo&&(t.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(S," is above the maximum of ").concat(xo,", setting to ").concat(xo)),S=xo)),E=Po({amplitude:p,options:e,allObservables:h,directionChanges:k,thresholdMs:S}),r.push(E)),null===(_=null==t?void 0:t.loggerProvider)||void 0===_||_.log("".concat(n," has been successfully added."))),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){var e,t,n,i;return ge(this,(function(o){try{for(e=he(r),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(n)throw n.error}}return[2]}))}))}}},Do="[Amplitude] Network Request",Lo="500-599";function No(e,t){var n="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(n).test(e)}function Uo(e,t){var n,r,i=t.split(",");try{for(var o=he(i),s=o.next();!s.done;s=o.next()){var a=ve(s.value.split("-").map(Number),2),c=a[0],u=a[1];if(e===c&&void 0===u)return!0;if(e>=c&&e<=u)return!0}}catch(e){n={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!1}function Mo(e){var t;if(e)try{var n=null===(t=Ke())||void 0===t?void 0:t.location.href,r=new URL(e,n),i=r.searchParams.toString(),o=r.hash.replace("#",""),s=r.href,a=r.host;return r.hash="",r.search="",{query:i,fragment:o,href:s,hrefWithoutQueryOrHash:r.href,host:a}}catch(e){return}}function jo(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return me([],ve(Ne),!1);if(void 0===e){return}}}function qo(e){var t,n;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(n=null==e?void 0:e.blocklist)||void 0===n?void 0:n.length)}function Fo(e,t){var n;void 0===t&&(t={});var r=Mo(e.url);if(!r)return!1;var i,o=r.host;if(!1!==t.ignoreAmplitudeRequests&&(No(o,"*.amplitude.com")||No(o,"amplitude.com")))return!1;if(null===(n=t.ignoreHosts)||void 0===n?void 0:n.find((function(e){return No(o,e)})))return!1;if(!t.captureRules&&void 0!==e.status&&!Uo(e.status,Lo))return!1;if(t.captureRules&&(me([],ve(t.captureRules),!1).reverse().find((function(t){if(i=function(e,t,n,r,i){if((!e.hosts||e.hosts.find((function(e){return No(t,e)})))&&(!r||!e.urls||xt(r,e.urls))&&(!i||!e.methods||e.methods.find((function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e}))))return!((n||0===n)&&!Uo(n,e.statusCodeRange||Lo))}(t,o,e.status,e.url,e.method),i){var n=jo(t.responseHeaders);if(e.responseWrapper&&n){var r=e.responseWrapper.headers(n);r&&(e.responseHeaders=r)}var s=jo(t.requestHeaders);if(e.requestWrapper&&s){var a=e.requestWrapper.headers(s);a&&(e.requestHeaders=a)}e.responseWrapper&&t.responseBody&&!qo(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!qo(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}return void 0!==i})),!i))return!1;return!e.requestWrapper||!function(e,t){if(e.includes("amplitude.com"))try{var n=t.body;if("string"!=typeof n)return!1;if(JSON.parse(n).events.find((function(e){return e.event_type===Do})))return!0}catch(e){}return!1}(o,e.requestWrapper)}function Bo(e){var t=e.allObservables,n=e.networkTrackingOptions,r=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter((function(e){return Fo(e.event,n)})).subscribe((function(e){var t,n,o,s=e.event,a=Mo(s.url);if(a){var c=null===(n=s.responseWrapper)||void 0===n?void 0:n.bodySize,u=null===(o=s.requestWrapper)||void 0===o?void 0:o.bodySize;!function(e,t,n,r){pe(this,void 0,void 0,(function(){var i,o,s;return ge(this,(function(a){switch(a.label){case 0:return t.requestBodyJson||t.responseBodyJson?[4,Promise.all([t.requestBodyJson,t.responseBodyJson])]:[3,2];case 1:if(i=ve.apply(void 0,[a.sent(),2]),o=i[0],s=i[1],o)try{e["[Amplitude] Request Body"]=JSON.stringify(o)}catch(e){null==r||r.debug("Failed to stringify request body",e)}if(s)try{e["[Amplitude] Response Body"]=JSON.stringify(s)}catch(e){null==r||r.debug("Failed to stringify response body")}a.label=2;case 2:return null==n||n.track(Do,e),[2]}}))}))}(((t={})["[Amplitude] URL"]=a.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=a.query,t["[Amplitude] URL Fragment"]=a.fragment,t["[Amplitude] Request Method"]=s.method,t["[Amplitude] Status Code"]=s.status,t["[Amplitude] Start Time"]=s.startTime,t["[Amplitude] Completion Time"]=s.endTime,t["[Amplitude] Duration"]=s.duration,t["[Amplitude] Request Body Size"]=u,t["[Amplitude] Response Body Size"]=c,t["[Amplitude] Request Type"]=s.type,t["[Amplitude] Request Headers"]=s.requestHeaders,t["[Amplitude] Response Headers"]=s.responseHeaders,t),s,r,i)}}))}!function(e){e.NetworkObservable="networkObservable"}(Oo||(Oo={}));var $o=function(e){void 0===e&&(e={});var t,n="@amplitude/plugin-network-capture-browser",r=function(){var e,n=new pr((function(e){var n=new Ln((function(t){var n=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(n)}));return Mn.subscribe(n,t),function(){Mn.unsubscribe(n)}}));return(e={})[Oo.NetworkObservable]=n,e};return{name:n,type:"enrichment",setup:function(i,o){return pe(void 0,void 0,void 0,(function(){var s;return ge(this,(function(a){return"undefined"==typeof document||(s=r(),t=null==i?void 0:i.loggerProvider,Co=Bo({allObservables:s,networkTrackingOptions:e,amplitude:o,loggerProvider:t}),null==t||t.log("".concat(n," has been successfully added."))),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(e){return Co.unsubscribe(),[2]}))}))}}};let Ho=-1;const Ko=e=>{addEventListener("pageshow",(t=>{t.persisted&&(Ho=t.timeStamp,e(t))}),!0)},zo=(e,t,n,r)=>{let i,o;return s=>{t.value>=0&&(s||r)&&(o=t.value-(i??0),(o||void 0===i)&&(i=t.value,t.delta=o,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,n),e(t)))}},Go=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},Jo=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},Vo=()=>{const e=Jo();return e?.activationStart??0},Wo=(e,t=-1)=>{const n=Jo();let r="navigate";return Ho>=0?r="back-forward-cache":n&&(document.prerendering||Vo()>0?r="prerender":document.wasDiscarded?r="restore":n.type&&(r=n.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:r}},Yo=new WeakMap;function Qo(e,t){return Yo.get(e)||Yo.set(e,new t),Yo.get(e)}class Xo{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],n=this.o.at(-1);this.i&&t&&n&&e.startTime-n.startTime<1e3&&e.startTime-t.startTime<5e3?(this.i+=e.value,this.o.push(e)):(this.i=e.value,this.o=[e]),this.t?.(e)}}const Zo=(e,t,n={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const r=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return r.observe({type:e,buffered:!0,...n}),r}}catch{}},es=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let ts=-1;const ns=new Set,rs=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,is=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of ns)e();isFinite(ts)||(ts="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",is,!0))}},os=()=>{if(ts<0){const e=Vo(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0]?.startTime;ts=t??rs(),addEventListener("visibilitychange",is,!0),addEventListener("prerenderingchange",is,!0),Ko((()=>{setTimeout((()=>{ts=rs()}))}))}return{get firstHiddenTime(){return ts},onHidden(e){ns.add(e)}}},ss=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},as=[1800,3e3],cs=(e,t={})=>{ss((()=>{const n=os();let r,i=Wo("FCP");const o=Zo("paint",(e=>{for(const t of e)"first-contentful-paint"===t.name&&(o.disconnect(),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-Vo(),0),i.entries.push(t),r(!0)))}));o&&(r=zo(e,i,as,t.reportAllChanges),Ko((n=>{i=Wo("FCP"),r=zo(e,i,as,t.reportAllChanges),Go((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))})))}))},us=[.1,.25];let ls=0,ds=1/0,fs=0;const ps=e=>{for(const t of e)t.interactionId&&(ds=Math.min(ds,t.interactionId),fs=Math.max(fs,t.interactionId),ls=fs?(fs-ds)/7+1:0)};let gs;const hs=()=>gs?ls:performance.interactionCount??0;let vs=0;class ms{u=[];l=new Map;m;p;v(){vs=hs(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((hs()-vs)/50));return this.u[e]}h(e){if(this.m?.(e),!e.interactionId&&"first-input"!==e.entryType)return;const t=this.u.at(-1);let n=this.l.get(e.interactionId);if(n||this.u.length<10||e.duration>t.P){if(n?e.duration>n.P?(n.entries=[e],n.P=e.duration):e.duration===n.P&&e.startTime===n.entries[0].startTime&&n.entries.push(e):(n={id:e.interactionId,entries:[e],P:e.duration},this.l.set(n.id,n),this.u.push(n)),this.u.sort(((e,t)=>t.P-e.P)),this.u.length>10){const e=this.u.splice(10);for(const t of e)this.l.delete(t.id)}this.p?.(n)}}}const ys=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=es(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},bs=[200,500],Ts=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const n=os();ss((()=>{"interactionCount"in performance||gs||(gs=Zo("event",ps,{type:"event",buffered:!0,durationThreshold:0}));let r,i=Wo("INP");const o=Qo(t,ms),s=e=>{ys((()=>{for(const t of e)o.h(t);const t=o.L();t&&t.P!==i.value&&(i.value=t.P,i.entries=t.entries,r())}))},a=Zo("event",s,{durationThreshold:t.durationThreshold??40});r=zo(e,i,bs,t.reportAllChanges),a&&(a.observe({type:"first-input",buffered:!0}),n.onHidden((()=>{s(a.takeRecords()),r(!0)})),Ko((()=>{o.v(),i=Wo("INP"),r=zo(e,i,bs,t.reportAllChanges)})))}))};class ws{m;h(e){this.m?.(e)}}const ks=[2500,4e3],Ss=[800,1800],Es=e=>{document.prerendering?ss((()=>Es(e))):"complete"!==document.readyState?addEventListener("load",(()=>Es(e)),!0):setTimeout(e)};function _s(e){var t,n=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+n}function Is(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(_s(e)),navigationStart:Math.floor(performance.timeOrigin)}}var Ps,As=function(){var e=null,t=Ke(),n=null==t?void 0:t.document,r=null==t?void 0:t.location;return{name:"web-vitals-browser",type:"enrichment",setup:function(t,i){return pe(void 0,void 0,void 0,(function(){var o,s;return ge(this,(function(a){return void 0===n||(o=Rt((null==r?void 0:r.href)||"",t.loggerProvider),s={"[Amplitude] Page Domain":(null==r?void 0:r.hostname)||"","[Amplitude] Page Location":o,"[Amplitude] Page Path":Rt((null==r?void 0:r.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":Rt(o.split("?")[0],t.loggerProvider)},((e,t={})=>{ss((()=>{const n=os();let r,i=Wo("LCP");const o=Qo(t,ws),s=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)o.h(t),t.startTime<n.firstHiddenTime&&(i.value=Math.max(t.startTime-Vo(),0),i.entries=[t],r())},a=Zo("largest-contentful-paint",s);if(a){r=zo(e,i,ks,t.reportAllChanges);const n=es((()=>{s(a.takeRecords()),a.disconnect(),r(!0)})),o=e=>{e.isTrusted&&(ys(n),removeEventListener(e.type,o,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,o,{capture:!0});Ko((n=>{i=Wo("LCP"),r=zo(e,i,ks,t.reportAllChanges),Go((()=>{i.value=performance.now()-n.timeStamp,r(!0)}))}))}}))})((function(e){s["[Amplitude] LCP"]=Is(e)})),cs((function(e){s["[Amplitude] FCP"]=Is(e)})),Ts((function(e){s["[Amplitude] INP"]=Is(e)})),((e,t={})=>{const n=os();cs(es((()=>{let r,i=Wo("CLS",0);const o=Qo(t,Xo),s=e=>{for(const t of e)o.h(t);o.i>i.value&&(i.value=o.i,i.entries=o.o,r())},a=Zo("layout-shift",s);a&&(r=zo(e,i,us,t.reportAllChanges),n.onHidden((()=>{s(a.takeRecords()),r(!0)})),Ko((()=>{o.i=0,i=Wo("CLS",0),r=zo(e,i,us,t.reportAllChanges),Go((()=>r()))})),setTimeout(r))})))})((function(e){s["[Amplitude] CLS"]=Is(e)})),((e,t={})=>{let n=Wo("TTFB"),r=zo(e,n,Ss,t.reportAllChanges);Es((()=>{const i=Jo();i&&(n.value=Math.max(i.responseStart-Vo(),0),n.entries=[i],r(!0),Ko((()=>{n=Wo("TTFB",0),r=zo(e,n,Ss,t.reportAllChanges),r(!0)})))}))})((function(e){s["[Amplitude] TTFB"]=Is(e)})),e=function(){"hidden"===n.visibilityState&&e&&(i.track("[Amplitude] Web Vitals",s),n.removeEventListener("visibilitychange",e),e=null)},n.addEventListener("visibilitychange",e)),[2]}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return[2,e]}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){return e&&(null==n||n.removeEventListener("visibilitychange",e)),[2]}))}))}}},Os=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},Cs=function(e,t,n,r,i){void 0===i&&(i=!0),e.referrer;var o=e.referring_domain,s=fe(e,["referrer","referring_domain"]),a=t||{};a.referrer;var c=a.referring_domain,u=fe(a,["referrer","referring_domain"]);if(xs(n.excludeReferrers,e.referring_domain))return r.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&function(e){return Object.values(e).every((function(e){return!e}))}(e)&&t)return r.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var l=JSON.stringify(s)!==JSON.stringify(u),d=Os(o||"")!==Os(c||""),f=!t||l||d;return f?r.debug("This is a new campaign. An $identify event will be sent."):r.debug("This is not a new campaign because it's the same as the previous one."),f},xs=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=""),e.some((function(e){return e instanceof RegExp?e.test(t):e===t}))},Rs=function(){function e(e,t){var n,r,i;this.shouldTrackNewCampaign=!1,this.options=de({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:(r=null===(n=t.cookieOptions)||void 0===n?void 0:n.domain,i=r,i?(i.startsWith(".")&&(i=i.substring(1)),[new RegExp("".concat(i.replace(".","\\."),"$"))]):[]),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=jt(t.apiKey,"MKTG"),this.webExpStorageKey=jt(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=Le,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return pe(this,void 0,void 0,(function(){var e,t;return ge(this,(function(n){switch(n.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return t=ve.apply(void 0,[n.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||It(this.sessionTimeout,this.lastEventTime),Cs(this.currentCampaign,this.previousCampaign,this.options,this.logger,e)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}}))}))},e.prototype.fetchCampaign=function(){return pe(this,void 0,void 0,(function(){var e;return ge(this,(function(t){switch(t.label){case 0:return[4,this.storage.get(this.webExpStorageKey)];case 1:return(e=t.sent())?[4,this.storage.remove(this.webExpStorageKey)]:[3,3];case 2:t.sent(),t.label=3;case 3:return[4,Promise.all([e||(new jn).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}}))}))},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t,n,r,i,o=(t=this.currentCampaign,n=this.options,r=de(de({},Le),t),i=Object.entries(r).reduce((function(e,t){var r,i=ve(t,2),o=i[0],s=i[1];return e.setOnce("initial_".concat(o),null!==(r=null!=s?s:n.initialEmptyValue)&&void 0!==r?r:"EMPTY"),s?e.set(o,s):e.unset(o)}),new qe),Ve(i));return e&&(o.event_id=e),o},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),Ds="AMP_CURRENT_PAGE",Ls="AMP_PREVIOUS_PAGE",Ns="AMP_URL_INFO";!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(Ps||(Ps={}));var Us=new Set([le.IDENTIFY,le.GROUP_IDENTIFY,le.REVENUE]),Ms=function(e){var t={}.internalDomains,n=void 0===t?[]:t,r=Ke(),i=void 0,o=!1,s=void 0,a=!1,c=!1,u=function(e){var t="undefined"!=typeof location&&location.hostname||"",r=e?function(e){var t;try{var n=Rt(e,s);t=new URL(n).hostname}catch(e){null==s||s.error("Could not parse URL: ",e)}return t}(e):void 0;if(!r)return Ps.Direct;var i=n.some((function(e){return-1!==t.indexOf(e)})),o=n.some((function(e){return-1!==r.indexOf(e)}));return t===r||o&&i?Ps.Internal:Ps.External},l=function(){pe(void 0,void 0,void 0,(function(){var e,t,n,r,s;return ge(this,(function(a){switch(a.label){case 0:return i&&o?[4,i.get(Ns)]:[3,3];case 1:return e=a.sent(),t=Rt("undefined"!=typeof location&&location.href||""),n=(null==e?void 0:e[Ds])||"",r=void 0,r=t===n?(null==e?void 0:e[Ls])||"":n||document.referrer||"",[4,i.set(Ns,(s={},s[Ds]=t,s[Ls]=r,s))];case 2:a.sent(),a.label=3;case 3:return[2]}}))}))},d={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(t){switch(t.label){case 0:return(s=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),c=!0,r?[4,(i=new qt(r.sessionStorage)).isEnabled()]:[3,2];case 1:o=t.sent(),r.addEventListener("popstate",l),a||(r.history.pushState=new Proxy(r.history.pushState,{apply:function(e,t,n){var r=ve(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),c&&l()}}),r.history.replaceState=new Proxy(r.history.replaceState,{apply:function(e,t,n){var r=ve(n,3),i=r[0],o=r[1],s=r[2];e.apply(t,[i,o,s]),c&&l()}}),a=!0),t.label=2;case 2:return[2]}}))}))},execute:function(e){return pe(void 0,void 0,void 0,(function(){var t,n,r,s,a;return ge(this,(function(c){switch(c.label){case 0:return t=Rt("undefined"!=typeof location&&location.href||""),i&&o?[4,i.get(Ns)]:[3,5];case 1:return(null==(n=c.sent())?void 0:n[Ds])?[3,3]:[4,i.set(Ns,(a={},a[Ds]=t,a[Ls]=document.referrer||"",a))];case 2:c.sent(),c.label=3;case 3:return[4,i.get(Ns)];case 4:if(r=c.sent(),s="",r&&(s=r[Ls]||""),Us.has(e.event_type))return[2,e];e.event_properties=de(de({},e.event_properties||{}),{"[Amplitude] Page Domain":js(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":js(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":js(e,"[Amplitude] Page Path","undefined"!=typeof location&&Rt(location.pathname)||""),"[Amplitude] Page Title":js(e,"[Amplitude] Page Title",zn(Kn)),"[Amplitude] Page URL":js(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":s,"[Amplitude] Previous Page Type":u(s)}),c.label=5;case 5:return[2,e]}}))}))},teardown:function(){return pe(void 0,void 0,void 0,(function(){return ge(this,(function(e){switch(e.label){case 0:return r&&(r.removeEventListener("popstate",l),c=!1),i&&o?[4,i.set(Ns,{})]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}};return d};function js(e,t,n){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?n:e.event_properties[t]}var qs=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return ce(t,e),t.prototype.init=function(e,t,n){var r,i;return void 0===e&&(e=""),arguments.length>2?(r=t,i=n):"string"==typeof t?(r=t,i=void 0):(r=null==t?void 0:t.userId,i=t),We(this._init(de(de({},i),{userId:r,apiKey:e})))},t.prototype._init=function(t){var n,r,i,o,s,a,c;return pe(this,void 0,void 0,(function(){var u,l,d,f,p,g,h,v,m,y,b,T,w,k,S,E=this;return ge(this,(function(_){switch(_.label){case 0:return this.initializing?[2]:(this.initializing=!0,u=function(e){var t,n;return void 0===e&&(e={}),!0===(null===(t=e.remoteConfig)||void 0===t?void 0:t.fetchRemoteConfig)||!1!==(null===(n=e.remoteConfig)||void 0===n?void 0:n.fetchRemoteConfig)&&!1!==e.fetchRemoteConfig}(t),l=null!==(n=t.loggerProvider)&&void 0!==n?n:new et,d=null!==(r=t.serverZone)&&void 0!==r?r:"US",p=this._diagnosticsSampleRate,g=null===(i=t.enableDiagnostics)||void 0===i||i,u?(f=new nn(t.apiKey,l,d,null===(o=t.remoteConfig)||void 0===o?void 0:o.serverUrl),[4,new Promise((function(e){null==f||f.subscribe("configs.diagnostics.browserSDK","all",(function(t,n,r){if(l.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(p=i);var o=t.enabled;"boolean"==typeof o&&(g=o)}e()}))}))]):[3,2]);case 1:_.sent(),_.label=2;case 2:return(h=new Xt(t.apiKey,l,d,{enabled:g,sampleRate:p})).setTag("library","".concat(Jr,"/").concat(Gr)),"undefined"!=typeof navigator&&h.setTag("user_agent",navigator.userAgent),[4,bi(t.apiKey,t,this,h,{loggerProvider:l,serverZone:d,enableDiagnostics:g,diagnosticsSampleRate:p})];case 3:return v=_.sent(),u&&f?[4,new Promise((function(e){null==f||f.subscribe("configs.analyticsSDK.browserSDK","all",(function(t,n,r){v.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:n,lastFetch:r},null,2)),t&&Ui(t,v),e()}))}))]:[3,5];case 4:_.sent(),_.label=5;case 5:return[4,e.prototype._init.call(this,v)];case 6:return _.sent(),this.logBrowserOptions(v),this.config.remoteConfigClient=f,Rr(this.config.defaultTracking)?(this.config.optOut&&this.timeline.addOptOutListener((function(e){return pe(E,void 0,void 0,(function(){var t;return ge(this,(function(n){switch(n.label){case 0:return e?[3,2]:(t=Hr(this.config),this.webAttribution=new Rs(t,this.config),[4,this.webAttribution.init()]);case 1:n.sent(),n.label=2;case 2:return[2]}}))}))})),m=Hr(this.config),this.webAttribution=new Rs(m,this.config),[4,this.webAttribution.init()]):[3,8];case 7:_.sent(),_.label=8;case 8:return y=Ot(),b=y.ampTimestamp?Number(y.ampTimestamp):void 0,T=!b||Date.now()<b,w=T&&!Number.isNaN(Number(y.ampSessionId))?Number(y.ampSessionId):void 0,-1!==(k=this.config.deferredSessionId)||this.config.optOut||(k=Date.now()),this.setSessionId(null!==(c=null!==(a=null!==(s=t.sessionId)&&void 0!==s?s:w)&&void 0!==a?a:k)&&void 0!==c?c:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener((function(e){return pe(E,void 0,void 0,(function(){return ge(this,(function(t){return!e&&this.config.deferredSessionId&&(-1===this.config.deferredSessionId?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]}))}))})),(S=Et(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),null===this.config.offline?[3,10]:[4,this.add(Di()).promise];case 9:_.sent(),_.label=10;case 10:return[4,this.add(new pt({diagnosticsClient:h})).promise];case 11:return _.sent(),[4,this.add(new Vr).promise];case 12:return _.sent(),[4,this.add(new _t).promise];case 13:return _.sent(),P=this.config,Ri||void 0!==P.defaultTracking||(P.loggerProvider.warn("`options.defaultTracking` is set to undefined. This implicitly configures your Amplitude instance to track Page Views, Sessions, File Downloads, and Form Interactions. You can suppress this warning by explicitly setting a value to `options.defaultTracking`. The value must either be a boolean, to enable and disable all default events, or an object, for advanced configuration. For example:\n\namplitude.init(<YOUR_API_KEY>, {\n defaultTracking: true,\n});\n\nVisit https://www.docs.developers.amplitude.com/data/sdks/browser-2/#tracking-default-events for more details."),Ri=!0),I=this.config.defaultTracking,xr(I,"fileDownloads")?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(xi()).promise]):[3,15];case 14:_.sent(),_.label=15;case 15:return Dr(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(Ai()).promise]):[3,17];case 16:_.sent(),_.label=17;case 17:return Lr(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Ei($r(this.config))).promise]):[3,20];case 18:return _.sent(),[3,20];case 19:this.timeline.addOptOutListener((function(e){return pe(E,void 0,void 0,(function(){return ge(this,(function(t){switch(t.label){case 0:return e?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(Ei($r(this.config))).promise]);case 1:return t.sent(),[2]}}))}))})),_.label=20;case 20:return Mr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(vo(qr(this.config),{diagnosticsClient:h})).promise]):[3,22];case 21:_.sent(),_.label=22;case 22:return jr(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(Ro(Fr(this.config))).promise]):[3,24];case 23:_.sent(),_.label=24;case 24:return Ur(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add($o(Br(this.config))).promise]):[3,26];case 25:_.sent(),_.label=26;case 26:return function(e){return"boolean"==typeof e?e:"object"==typeof e&&!0===e.webVitals}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(As()).promise]):[3,28];case 27:_.sent(),_.label=28;case 28:return function(e){return xr(e,"pageUrlEnrichment")}(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(Ms()).promise]):[3,30];case 29:_.sent(),_.label=30;case 30:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 31:return _.sent(),S.eventBridge.setEventReceiver((function(e){var t=e.eventProperties||{},n=t.time,r=fe(t,["time"]),i="number"==typeof n?{time:n}:void 0;E.track(e.eventType,r,i)})),[2]}var I,P}))}))},t.prototype.getUserId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.userId},t.prototype.setUserId=function(e){this.config?(this.config.loggerProvider.debug("function setUserId: ",e),e===this.config.userId&&void 0!==e||(this.config.userId=e,this.timeline.onIdentityChanged({userId:e}),function(e,t){Et(t).identityStore.editIdentity().setUserId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setUserId.bind(this,e))},t.prototype.getDeviceId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.deviceId},t.prototype.setDeviceId=function(e){this.config?(this.config.loggerProvider.debug("function setDeviceId: ",e),e!==this.config.deviceId&&(this.config.deviceId=e,this.timeline.onIdentityChanged({deviceId:e}),function(e,t){Et(t).identityStore.editIdentity().setDeviceId(e).commit()}(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(Ge()),this.setUserId(void 0),this.timeline.onReset()},t.prototype.getIdentity=function(){var e,t;return{deviceId:null===(e=this.config)||void 0===e?void 0:e.deviceId,userId:null===(t=this.config)||void 0===t?void 0:t.userId,userProperties:this.userProperties}},t.prototype.setIdentity=function(e){var t,n,r;if("userId"in e&&this.setUserId(e.userId),"deviceId"in e&&e.deviceId&&this.setDeviceId(e.deviceId),"userProperties"in e){this.userProperties=e.userProperties;var i=new qe,o=null!==(r=e.userProperties)&&void 0!==r?r:{};try{for(var s=he(Object.entries(o)),a=s.next();!a.done;a=s.next()){var c=ve(a.value,2),u=c[0],l=c[1];i.set(u,l)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=s.return)&&n.call(s)}finally{if(t)throw t.error}}this.identify(i)}},t.prototype.getOptOut=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.optOut},t.prototype.getSessionId=function(){var e;return null===(e=this.config)||void 0===e?void 0:e.sessionId},t.prototype.setSessionId=function(e){var t,n=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),We(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:-1,We(Promise.resolve());if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return We(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var r=this.getSessionId();r!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,o=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,Nr(this.config.defaultTracking)&&(r&&i&&n.push(this.track(ci,void 0,{device_id:this.previousSessionDeviceId,event_id:++o,session_id:r,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var s=this.trackCampaignEventIfNeeded(++o,n);return this.config.identify&&n.push(this.track(Ve(this.config.identify)).promise),Nr(this.config.defaultTracking)&&n.push(this.track(ai,void 0,{event_id:s?++o:o,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,We(Promise.all(n))},t.prototype.extendSession=function(){this.config?this.config.lastEventTime=Date.now():this.q.push(this.extendSession.bind(this))},t.prototype.setTransport=function(e){this.config?this.config.transportProvider=wi(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,n){if(zr(t)){var r=t._q;t._q=[],t=Kr(new qe,r)}return(null==n?void 0:n.user_id)&&this.setUserId(n.user_id),(null==n?void 0:n.device_id)&&this.setDeviceId(n.device_id),e.prototype.identify.call(this,t,n)},t.prototype.groupIdentify=function(t,n,r,i){if(zr(r)){var o=r._q;r._q=[],r=Kr(new qe,o)}return e.prototype.groupIdentify.call(this,t,n,r,i)},t.prototype.revenue=function(t,n){if(zr(t)){var r=t._q;t._q=[],t=Kr(new Qe,r)}return e.prototype.revenue.call(this,t,n)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var n=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(n).promise):this.track(n),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return pe(this,void 0,void 0,(function(){var n,r,i;return ge(this,(function(o){return n=Date.now(),r=It(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===ai||t.event_type===ci||t.session_id&&t.session_id!==this.getSessionId()||(r||i?(this.setSessionId(n),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):r||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]}))}))},t.prototype.logBrowserOptions=function(e){try{var t=de(de({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",Sr(t))}catch(e){this.config.loggerProvider.error("Error logging browser config",e)}},t.prototype._setDiagnosticsSampleRate=function(e){e>1||e<0||this.config||(this._diagnosticsSampleRate=e)},t}(Ye),Fs=function(){var e=new qs;return{init:dt(e.init.bind(e),"init",ct(e),lt(e,["config"])),add:dt(e.add.bind(e),"add",ct(e),lt(e,["config.apiKey","timeline.plugins"])),remove:dt(e.remove.bind(e),"remove",ct(e),lt(e,["config.apiKey","timeline.plugins"])),track:dt(e.track.bind(e),"track",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),logEvent:dt(e.logEvent.bind(e),"logEvent",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),identify:dt(e.identify.bind(e),"identify",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),groupIdentify:dt(e.groupIdentify.bind(e),"groupIdentify",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),setGroup:dt(e.setGroup.bind(e),"setGroup",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),revenue:dt(e.revenue.bind(e),"revenue",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),flush:dt(e.flush.bind(e),"flush",ct(e),lt(e,["config.apiKey","timeline.queue.length"])),getUserId:dt(e.getUserId.bind(e),"getUserId",ct(e),lt(e,["config","config.userId"])),setUserId:dt(e.setUserId.bind(e),"setUserId",ct(e),lt(e,["config","config.userId"])),getDeviceId:dt(e.getDeviceId.bind(e),"getDeviceId",ct(e),lt(e,["config","config.deviceId"])),setDeviceId:dt(e.setDeviceId.bind(e),"setDeviceId",ct(e),lt(e,["config","config.deviceId"])),reset:dt(e.reset.bind(e),"reset",ct(e),lt(e,["config","config.userId","config.deviceId"])),getSessionId:dt(e.getSessionId.bind(e),"getSessionId",ct(e),lt(e,["config"])),setSessionId:dt(e.setSessionId.bind(e),"setSessionId",ct(e),lt(e,["config"])),extendSession:dt(e.extendSession.bind(e),"extendSession",ct(e),lt(e,["config"])),setOptOut:dt(e.setOptOut.bind(e),"setOptOut",ct(e),lt(e,["config"])),setTransport:dt(e.setTransport.bind(e),"setTransport",ct(e),lt(e,["config"])),getIdentity:dt(e.getIdentity.bind(e),"getIdentity",ct(e),lt(e,["config"])),setIdentity:dt(e.setIdentity.bind(e),"setIdentity",ct(e),lt(e,["config","config.userId","config.deviceId"])),getOptOut:dt(e.getOptOut.bind(e),"getOptOut",ct(e),lt(e,["config"])),_setDiagnosticsSampleRate:dt(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",ct(e),lt(e,["config"]))}},Bs=Fs(),$s=Object.freeze({__proto__:null,DEFAULT_ACTION_CLICK_ALLOWLIST:pn,DEFAULT_CSS_SELECTOR_ALLOWLIST:dn,DEFAULT_DATA_ATTRIBUTE_PREFIX:fn,get IdentifyOperation(){return ue},get LogLevel(){return Xe},OfflineDisabled:null,get RevenueProperty(){return $e},get ServerZone(){return un},get SpecialEventType(){return le}}),Hs=Bs.add,Ks=Bs.extendSession,zs=Bs.flush,Gs=Bs.getDeviceId,Js=Bs.getIdentity,Vs=Bs.getOptOut,Ws=Bs.getSessionId,Ys=Bs.getUserId,Qs=Bs.groupIdentify,Xs=Bs.identify,Zs=Bs.init,ea=Bs.logEvent,ta=Bs.remove,na=Bs.reset,ra=Bs.revenue,ia=Bs.setDeviceId,oa=Bs.setGroup,sa=Bs.setIdentity,aa=Bs.setOptOut,ca=Bs.setSessionId,ua=Bs.setTransport,la=Bs.setUserId,da=Bs.track,fa=Bs._setDiagnosticsSampleRate,pa=Object.freeze({__proto__:null,AmplitudeBrowser:qs,Identify:qe,Revenue:Qe,Types:$s,_setDiagnosticsSampleRate:fa,add:Hs,createInstance:Fs,extendSession:Ks,flush:zs,getDeviceId:Gs,getIdentity:Js,getOptOut:Vs,getSessionId:Ws,getUserId:Ys,groupIdentify:Qs,identify:Xs,init:Zs,logEvent:ea,remove:ta,reset:na,revenue:ra,runQueuedFunctions:function(e,t){Kr(e,t)},setDeviceId:ia,setGroup:oa,setIdentity:sa,setOptOut:aa,setSessionId:ca,setTransport:ua,setUserId:la,track:da});class ga{constructor(){this.isInitialized=!1}static getInstance(){return ga.instance||(ga.instance=new ga),ga.instance}initialize(){if(this.isInitialized||a())return;const e=b.getEnvironment()||"production",t=e===c.PRODUCTION?"52c120d2f5c89ca646fae6649a1ce7ad":"373aa80c38e5bc2a55895a96c8447fef";try{if(!pa||"function"!=typeof Zs)throw new Error("Analytics SDK module not available");const n={defaultTracking:{sessions:!1,pageViews:!1,formInteractions:!1,fileDownloads:!1},logLevel:e!==c.PRODUCTION?Xe.Debug:Xe.None};Zs(t,void 0,n),this.isInitialized=!0,this.track(oe)}catch(e){console.error("Failed to initialize analytics tracking:",e)}}isEnabled(){return this.isInitialized}track(e,t){if(this.isInitialized)try{da(e,t)}catch(e){console.error("Failed to track analytics event:",e)}}reset(){if(this.isInitialized)try{na()}catch(e){console.error("Failed to reset analytics:",e)}}}const ha=ga.getInstance();function va(e,t){ha.track(e,t)}const ma=e=>{va(se,e)};class ya extends i{constructor(e){super(),this.name="EmbedOperationError",this.message=e}}async function ba({proxyFunction:e,networkCallDescriptor:t,proxyEndpointDescriptor:n}){if(n){const e={...Object.fromEntries([..._(t.options?.headers)??{}])},r=P({...t,options:{...t.options,headers:e}}),i=await fetch(n.path,{method:n.method,headers:n.options.headers,body:r}),o=A(await i.text());if(!i.ok)throw new E({code:i.status,data:o,message:`Error from proxy endpoint: ${i.status} ${i.statusText}`});return o}if(e){const n=Object.fromEntries([..._(t.options?.headers)??{}]),r=P({...t,options:{...t.options,headers:n}});return A(await e(r))}throw new ya("No proxy function or proxy endpoint descriptor provided for proxy call.")}var Ta;function wa(e){return{id:e.id,nickname:e.nickname,embossedName:e.embossed_name,status:e.status,maskPan:e.mask_pan,expMonth:parseInt(e.exp_month,10),expYear:parseInt(e.exp_year,10),lastActivityAt:new Date(e.last_activity_at),lastDigits:e.last_digits,shipToBusiness:e.ship_to_business,atmOption:e.atm_option,atmDailyLimitOption:e.atm_daily_limit_option,nfcOption:e.nfc_option,onlineOption:e.online_option,foreignOption:e.foreign_option,atmMonthlyLimit:e.atm_monthly_limit,atmMonthlySpent:e.atm_monthly_spent,atmDailyLimit:e.atm_daily_limit,atmDailySpent:e.atm_daily_spent,paymentMonthlyLimit:e.payment_monthly_limit,paymentMonthlySpent:e.payment_monthly_spent,paymentDailyLimit:e.payment_daily_limit,paymentDailySpent:e.payment_daily_spent,paymentDailyLimitOption:e.payment_daily_limit_option,paymentTransactionLimit:e.payment_transaction_limit,paymentTransactionLimitOption:e.payment_transaction_limit_option,activeDays:e.active_days,holderId:e.holder_id,bankAccountId:e.bank_account_id,organizationId:e.organization_id,updatedAt:new Date(e.updated_at),createdAt:new Date(e.created_at),shippedAt:new Date(e.shipped_at),cardType:e.card_type,cardLevel:e.card_level,paymentLifespanLimit:e.payment_lifespan_limit,paymentLifespanSpent:e.payment_lifespan_spent,preExpiresAt:new Date(e.pre_expires_at),categories:e.categories,renewed:e.renewed,renewal:e.renewal,...e.parent_card_summary&&{parentCardSummary:{id:e.parent_card_summary.id,lastDigits:e.parent_card_summary.last_digits}},hadOperation:e.had_operation,hadPinOperation:e.had_pin_operation,cardDesign:e.card_design,typeOfPrint:e.type_of_print,upsold:e.upsold,upsell:e.upsell,discardOn:new Date(e.discard_on),reordered:e.reordered}}!function(e){e.PENDING="pending",e.ONHOLD="onhold",e.ORDER_CANCELED="order_canceled",e.LIVE="live",e.PAUSED="paused",e.STOLEN="stolen",e.LOST="lost",e.PIN_BLOCKED="pin_blocked",e.DELETED="deleted",e.PRE_EXPIRED="pre_expired",e.EXPIRED="expired",e.DISCARDED="discarded",e.SHIPPED_LOST="shipped_lost",e.ABUSIVE="abusive"}(Ta||(Ta={}));const ka={getCards:async function(e){ma();const t=e?.cardSettings?.membershipId;if(t&&"string"!=typeof t)throw new R("membershipId must be a string");const{accessToken:n,stagingToken:r}=e?.operationSettings||{},i=n||s(),o=await async function({membershipId:e,accessToken:t,stagingToken:n}){const r=function({membershipId:e,accessToken:t,stagingToken:n}){return{path:e?`/v2/cards?holder_ids[]=${e}`:"/v2/cards",options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({membershipId:e,accessToken:t,stagingToken:n}),{cards:i}=await I(r);return i}({membershipId:t,accessToken:i,stagingToken:r});return o.map((e=>wa(e)))},getCard:async function({cardSettings:e,operationSettings:t}){!function(e){if(!e)throw new R("cardSettings parameter is required for the called function");if(!e.cardId)throw new R("cardId parameter is required for the called function");const t=L({cardId:e.cardId});if(t.length>0)throw new R(t)}(e);const n=e.cardId,{accessToken:r,stagingToken:i}=t||{},o=r||s(),a=await async function({cardId:e,accessToken:t,stagingToken:n}){const r=function({cardId:e,accessToken:t,stagingToken:n}){return{path:`/v2/cards?ids[]=${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({cardId:e,accessToken:t,stagingToken:n}),{cards:i}=await I(r);return i[0]}({cardId:n,accessToken:o,stagingToken:i});return wa(a)}},Sa=e=>({id:e?.id,slug:e.slug,iban:e.iban,bic:e.bic,currency:e.currency,balance:parseFloat(e.balance),balanceCents:e.balance_cents,authorizedBalance:e.authorized_balance,authorizedBalanceCents:e.authorized_balance_cents,name:e.name,updatedAt:new Date(e.updated_at),status:e.status,main:e.main}),Ea={getOrganization:async({operationSettings:e}={})=>{const{accessToken:t,stagingToken:n}=e||{},r=t||s(),i=await(async({accessToken:e,stagingToken:t})=>{const n=(({accessToken:e,stagingToken:t})=>({path:"/v2/organization/",options:{method:"GET",headers:{accessToken:e,stagingToken:t}}}))({accessToken:e,stagingToken:t});return await I(n)})({accessToken:r,stagingToken:n});return{id:(o=i.organization).id,slug:o.slug,legalName:o.legal_name,legalNumber:o.legal_number,legalSector:o.legal_sector,legalRegistrationDate:o.legal_registration_date,legalAddress:o.legal_address,legalForm:o.legal_form,legalCountry:o.legal_country,legalShareCapital:o.legal_share_capital,locale:o.locale,contractSignedAt:o.contract_signed_at,bankAccounts:o.bank_accounts.map(Sa)};var o},getBankAccounts:async({operationSettings:e}={})=>{const{accessToken:t,stagingToken:n}=e||{},r=t||s(),i=await(async({accessToken:e,stagingToken:t})=>{const n=(({accessToken:e,stagingToken:t})=>({path:"/v2/bank_accounts/",options:{method:"GET",headers:{accessToken:e,stagingToken:t}}}))({accessToken:e,stagingToken:t});return await I(n)})({accessToken:r,stagingToken:n});return i.bank_accounts.map(Sa)}},_a={AED:"AED",AUD:"AUD",BGN:"BGN",CAD:"CAD",CHF:"CHF",CNY:"CNY",CZK:"CZK",DKK:"DKK",EUR:"EUR",GBP:"GBP",GHS:"GHS",HKD:"HKD",HUF:"HUF",ILS:"ILS",INR:"INR",MXN:"MXN",NOK:"NOK",NZD:"NZD",PEN:"PEN",PLN:"PLN",RON:"RON",RSD:"RSD",SAR:"SAR",SEK:"SEK",SGD:"SGD",TRY:"TRY",USD:"USD",ZAR:"ZAR",ZMW:"ZMW"},Ia=e=>{if(!(e=>Object.values(_a).includes(e))(e))throw new R(`currency ${e} is not valid, valid currencies are ${Object.values(_a).join(", ")}`)},Pa={GOOD:"good",SERVICE:"service"},Aa={UNIT:"unit",HOUR:"hour",DAY:"day",MONTH:"month",GRAM:"gram",KILOGRAM:"kilogram",LITER:"liter",METER:"meter",SQUARE_METER:"square_meter",CUBIC_METER:"cubic_meter",AMPERE:"ampere",NUMBER_OF_ARTICLES:"number_of_articles",CENTIMETER:"centimeter",CUBIC_METER_PER_HOUR:"cubic_meter_per_hour",GIGAJOULE:"gigajoule",GIGAWATT:"gigawatt",GIGAWATT_HOUR:"gigawatt_hour",HALF_YEAR:"half_year",JOULE:"joule",KILOJOULE:"kilojoule",KILOVAR:"kilovar",KILOWATT:"kilowatt",KILOWATT_HOUR:"kilowatt_hour",MEGAJOULE:"megajoule",MEGAWATT:"megawatt",MEGAWATT_HOUR:"megawatt_hour",MILLIGRAM:"milligram",MILLILITER:"milliliter",MILLIMETER:"millimeter",MINUTE:"minute",PAIR:"pair",QUARTER:"quarter",SECOND:"second",SET:"set",TON:"ton",TWO_WEEK:"two_week",WATT_HOUR:"watt_hour",WEEK:"week",YEAR:"year"},Oa=e=>{if(!(e=>Object.values(Aa).includes(e))(e))throw new R(`unit ${e} is not valid, valid units are ${Object.values(Aa).join(", ")}`)},Ca=[{name:"id"},{name:"title"},{name:"type"},{name:"quantity"},{name:"measureUnit"},{name:"unitPrice"},{name:"vatRate"}],xa=[{name:"currency"},{name:"value"}];const Ra=e=>{if(!Object.values(Pa).includes(e))throw new R(`type ${e} is not valid, valid types are ${Object.values(Pa).join(", ")}`)};const Da={getPaymentLinkCreationFlowUrl:async({paymentLinkSettings:e,operationSettings:t})=>{const{items:n}=e;!function(e){if(!e||!Array.isArray(e))return[];e.forEach((e=>{D(e,Ca),D(e.unitPrice,xa);const t=[...L({id:e.id,title:e.title,vatRate:e.vatRate,currency:e.unitPrice.currency,measureUnit:e.measureUnit,unitPrice:e.unitPrice.value,...e.description?{description:e.description}:{}}),...N({quantity:e.quantity})].flat();if(t.length>0)throw new R(t);Ra(e.type),Ia(e.unitPrice.currency),Oa(e.measureUnit)}))}(n);const r=function(e){if(!e?.callbackUrl)throw new R("callbackUrl parameter is required for the payment link creation flow");if("string"!=typeof e.callbackUrl)throw new R("callbackUrl must be a string");if(""===e.callbackUrl.trim())throw new R("callbackUrl cannot be empty");return e.callbackUrl}(e),i=await M({requestSettings:{action:p.PAYMENT_LINK_CREATE,callbackUrl:r},operationSettings:t}),o=new URLSearchParams({...n?{items:JSON.stringify(n)}:{}});return o.toString()?`${i.url}?${o.toString()}`:i.url}};function La(e){return{id:e.id,initiatorId:e.initiator_id,bankAccountId:e.bank_account_id,amount:Number(e.amount),amountCents:Number(e.amount_cents),amountCurrency:e.amount_currency,status:e.status,beneficiaryId:e.beneficiary_id,reference:e.reference,note:e.note,declinedReason:e.declined_reason,scheduledDate:new Date(e.scheduled_date),createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),processedAt:new Date(e.processed_at),completedAt:new Date(e.completed_at),transactionId:e.transaction_id}}function Na(e){return{name:e.name,iban:e.iban}}const Ua="/v2/sepa",Ma=`${Ua}/transfers`;async function ja({accessToken:e,stagingToken:t,paginationSettings:n}){const r=function({paginationSettings:e,accessToken:t,stagingToken:n}){const r={method:"GET",headers:{accessToken:t,stagingToken:n}},i=q(e),o=i.size?`?${i.toString()}`:"";return{path:`${Ma}${o}`,options:r}}({paginationSettings:n,accessToken:e,stagingToken:t}),{transfers:i,meta:o}=await I(r);return{transfers:i,meta:o}}async function qa({accessToken:e,stagingToken:t,sepaTransferId:n}){const r=function({sepaTransferId:e,accessToken:t,stagingToken:n}){return{path:`${Ma}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({sepaTransferId:n,accessToken:e,stagingToken:t}),{transfer:i}=await I(r);return i}async function Fa({transfer:e,vopProofToken:t,accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}){const s=function({transfer:e,vopProofToken:t,accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}){const s=function(e){const t=e.beneficiaryId||e.beneficiary?.id;return{bank_account_id:e.bankAccountId,beneficiary_id:t,amount:e.amount.toString(),reference:e.reference,...e.note?{note:e.note}:{},...e.scheduledDate?{scheduled_date:e.scheduledDate.toISOString().split("T")[0]}:{},...e.attachmentIds?{attachment_ids:e.attachmentIds}:{}}}(e);return{path:Ma,options:{method:"POST",headers:{accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o},body:{transfer:s,vop_proof_token:t}}}}({transfer:e,vopProofToken:t,accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}),{transfer:a}=await I(s);return a}async function Ba({sepaTransferId:e,accessToken:t,stagingToken:n}){const r=function({sepaTransferId:e,accessToken:t,stagingToken:n}){return{path:`${Ma}/${e}/cancel`,options:{method:"POST",headers:{accessToken:t,stagingToken:n}}}}({sepaTransferId:e,accessToken:t,stagingToken:n});await I(r)}async function $a({sepaPayee:e,accessToken:t,stagingToken:n}){const r=function({sepaPayee:e,accessToken:t,stagingToken:n}){return{path:`${Ua}/verify_payee`,options:{method:"POST",headers:{accessToken:t,stagingToken:n},body:{beneficiary_name:e.name,iban:e.iban}}}}({sepaPayee:e,accessToken:t,stagingToken:n});return await I(r)}function Ha(e){return{id:e.id,initiatorId:e.initiator_id,createdAt:new Date(e.created_at),updatedAt:new Date(e.updated_at),totalCount:Number(e.total_count),completedCount:Number(e.completed_count),failedCount:Number(e.failed_count),pendingCount:Number(e.pending_count),results:e.results.map((e=>({clientTransferId:e.client_transfer_id,transferId:e.transfer_id??null,errors:e.errors||null,status:e.status})))}}function Ka(e){return{id:e.id,response:{matchResult:e.response.match_result,matchedName:e.response.matched_name}}}const za="/v2/sepa/bulk_transfers";async function Ga({accessToken:e,stagingToken:t,paginationSettings:n}){const r=function({paginationSettings:e,accessToken:t,stagingToken:n}){const r={method:"GET",headers:{accessToken:t,stagingToken:n}},i=q(e),o=i.size?`?${i.toString()}`:"";return{path:`${za}${o}`,options:r}}({paginationSettings:n,accessToken:e,stagingToken:t}),{bulk_transfers:i,meta:o}=await I(r);return{bulkTransfers:i,meta:o}}async function Ja({accessToken:e,stagingToken:t,bulkTransferId:n}){const r=function({bulkTransferId:e,accessToken:t,stagingToken:n}){return{path:`${za}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}({bulkTransferId:n,accessToken:e,stagingToken:t}),{bulk_transfer:i}=await I(r);return i}async function Va({sepaPayees:e,accessToken:t,stagingToken:n}){const r=function({sepaPayees:e,accessToken:t,stagingToken:n}){return{path:`${Ua}/bulk_verify_payee`,options:{method:"POST",headers:{accessToken:t,stagingToken:n},body:{requests:e.map(Na)}}}}({sepaPayees:e,accessToken:t,stagingToken:n});return await I(r)}function Wa(e){if(!e)throw new R("bulkTransferSettings parameter is required for the called function.");if(!e.bankAccountId)throw new R("bankAccountId is required");if(!Array.isArray(e.bulkTransfers))throw new R("bulkTransfers must be an array");if(e.bulkTransfers.length>400)throw new R("Maximum of 400 bulk transfers allowed");return e.bulkTransfers.forEach(((e,t)=>{!function(e,t){if(!e)throw new R(`Invalid bulkTransfer at index ${t}: bulkTransfer object is required`);if(!e.beneficiary)throw new R(`Invalid bulkTransfer at index ${t}: Beneficiary details must be provided in the bulkTransferSettings.beneficiary field`);if(!e.beneficiary.iban)throw new R(`Invalid bulkTransfer at index ${t}: IBAN is required as part of the beneficiary details`);if(!e.beneficiary.name)throw new R(`Invalid bulkTransfer at index ${t}: Beneficiary name is required as part of the beneficiary details`);const n=L({reference:e.reference,clientTransferId:e.clientTransferId,note:e.note}),r=N({amount:e.amount}),i=[...n,...r].flat();if(i.length>0)throw new R(i);if(e.amount>d&&(!e.attachmentsIds||0===e.attachmentsIds.length))throw new R(`Invalid bulkTransfer at index ${t}: Attachments are required for transfers over €30000`)}(e,t)})),e}const Ya={requiresUI:!1};function Qa(e,{requiresUI:t}=Ya){const n=e?.uiParentElementId||S.getUIParentElementId();if(t){if(!n)throw new R("operationSettings parameter must have a uiParentElementId for the called function.\nYou can pass it either to the initialize function or in a per function basis.");if(!["string","function"].includes(typeof n))throw new R("operationSettings.uiParentElementId must be a string or a function returning an HTMLElement")}const r=e?.mfaPreference||S.getMFAPreference();if(r){const e=(i=Object.values(l),b.isProductionEnvironment()?i.filter((e=>e!==l.MOCK)):i);if(!e.includes(r))throw new R(`operationSettings.mfaPreference must be one of ${e.join(", ")}`);if(b.isProductionEnvironment()&&r===l.MOCK)throw new R("operationSettings.mfaPreference cannot be set to mock in production environment.")}var i;const o=e?.debugMode||S.getDebugMode();if(void 0!==o&&"boolean"!=typeof o)throw new R("operationSettings.debugMode must be a boolean.");const s=e?.proxyRequestFunction||S.getProxyRequestFunction();if(s&&"function"!=typeof s)throw new R("operationSettings.proxyRequestFunction must be a function.");const a=e?.proxyEndpointDescriptor||S.getProxyEndpointDescriptor();if(a&&!a.path)throw new R("operationSettings.proxyEndpointDescriptor must have at least a string-formatted path property.");return{...e,uiParentElementId:n,mfaPreference:r,debugMode:o,proxyRequestFunction:s,proxyEndpointDescriptor:a}}async function Xa({sepaTransferSettings:e,operationSettings:t}){return e?.beneficiary?e.beneficiary:await async function({beneficiarySettings:e,operationSettings:t}){const n=re(e?.beneficiaryId),{proxyRequestFunction:r,proxyEndpointDescriptor:i,accessToken:o,stagingToken:a}=Qa(t||{});if(r||i){const e=Q({beneficiaryId:n});return J((await ba({proxyFunction:r,proxyEndpointDescriptor:i,networkCallDescriptor:e})).body.beneficiary)}{const e=o||s();return J(await X({beneficiaryId:n,accessToken:e,stagingToken:a}))}}({beneficiarySettings:{beneficiaryId:e?.beneficiaryId},operationSettings:t})}function Za(e,t){const n=t?.locale||w.getLocale(),r=new URL(e);return n&&r.searchParams.append("lang",n),t?.mfaPreference&&r.searchParams.append("mfaPreference",t.mfaPreference),t?.idempotencyKey&&r.searchParams.append("idempotencyKey",t.idempotencyKey),r.toString()}const ec=[{name:"bankAccountId"},{name:"reference"},{name:"amount"}];const tc={getSepaTransfers:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i=t||s(),o=await ja({accessToken:i,stagingToken:n,paginationSettings:r}),a=o.transfers.map(La),c=F(o.meta);return{transfers:a,...c?{meta:c}:{}}},getSepaTransfer:async function({sepaTransferSettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("sepaTransferId parameter is required for the called function");if(e&&"string"!=typeof e)throw new R("sepaTransferId must be a string");return e}(e?.sepaTransferId),{accessToken:r,stagingToken:i}=t||{},o=r||s();return La(await qa({sepaTransferId:n,accessToken:o,stagingToken:i}))},createSepaTransfer:async function*({sepaTransferSettings:e,operationSettings:t}){const{accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}=t||{},a=n||s(),c=o||G();!function(e){if(!e)throw new R("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new R("sepaTransferSettings must be an object");if(!e.beneficiaryId&&!e.beneficiary)throw new R("Either beneficiaryId or beneficiary must be provided");const t=L({beneficiaryId:e.beneficiaryId});if(t.length>0)throw new R(t)}(e);const u=e?.beneficiary?e.beneficiary:await Xa({sepaTransferSettings:e,operationSettings:t}),l={name:u.name,iban:u.iban},p=await $a({sepaPayee:l,accessToken:a,stagingToken:r}),g=yield(h=p,{matchResult:h.match_result,matchedName:h.matched_name});var h;let v;if("string"==typeof g){if(g===f)return}else{if(g.vopDecision===f)return;v=g.sepaTransferSettings}const m={...e,...v};!function(e){if(!e)throw new R("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new R("sepaTransferSettings must be an object");D(e,ec);const t=[...L({bankAccountId:e.bankAccountId,note:e.note,reference:e.reference}),...N({amount:e.amount})].flat();if(t.length>0)throw new R(t);if(e.amount>d&&(!e.attachmentIds||0===e.attachmentIds.length))throw new R("Attachments are required for transfers over €30,000")}(m);const y={...m,beneficiary:u};return{transfer:La(await Fa({transfer:y,vopProofToken:p.proof_token.token,accessToken:a,stagingToken:r,scaSessionToken:i,idempotencyKey:c})),meta:{idempotencyKey:c}}},cancelSepaTransfer:async function({sepaTransferSettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("sepaTransferId parameter is required for the called function");if("string"!=typeof e)throw new R("sepaTransferId must be a string");return e}(e?.sepaTransferId),{accessToken:r,stagingToken:i}=t||{},o=r||s();await Ba({sepaTransferId:n,accessToken:o,stagingToken:i})},getSepaTransferCreationFlowLink:async function({sepaTransferSettings:e,operationSettings:t}){const n=function(e){if(!e||!e.callbackUrl)throw new R("callbackUrl parameter is required for the getSepaTransferCreationFlowLink function");if("string"!=typeof e.callbackUrl)throw new R("callbackUrl must be a string");return e.callbackUrl}(e),{accessToken:r,stagingToken:i}=t||{},o=r||s(),a=await async function({requestSettings:e,operationSettings:t}){U(e);const{proxyRequestFunction:n,proxyEndpointDescriptor:r,stagingToken:i}=Qa(t||{});if(n||r){const t=O({stagingToken:i,action:e.action,callbackUrl:e.callbackUrl});return x((await ba({proxyFunction:n,proxyEndpointDescriptor:r,networkCallDescriptor:t})).body)}{const n=t?.accessToken||s();return x(await C({accessToken:n,stagingToken:i,action:e.action,callbackUrl:e.callbackUrl}))}}({requestSettings:{action:p.SEPA_TRANSFER_CREATE,callbackUrl:n},operationSettings:{stagingToken:i,accessToken:o}});return{...a,url:Za(a.url,t)}},bulkTransfers:{getBulkTransfers:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i=t||s(),o=await Ga({accessToken:i,stagingToken:n,paginationSettings:r}),a=o.bulkTransfers?.map(Ha),c=F(o.meta);return{bulkTransfers:a,...c?{meta:c}:{}}},getBulkTransfer:async function({bulkTransferSettings:e,operationSettings:t}){const n=function(e){if(!e)throw new R("bulkTransferId parameter is required for the called function.");if("string"!=typeof e)throw new R("bulkTransferId must be a string.");return e}(e?.bulkTransferId),{accessToken:r,stagingToken:i}=t||{},o=r||s();return Ha(await Ja({accessToken:o,stagingToken:i,bulkTransferId:n}))},createBulkTransfer:async function*({bulkTransferSettings:e,operationSettings:t}){const{accessToken:n,stagingToken:r,scaSessionToken:i,idempotencyKey:o}=t||{},a=n||s(),c=o||G(),u=Wa(e),l=new Map;for(const e of u.bulkTransfers){const t=e.beneficiary;if(t){const e=t.iban;e&&!l.has(e)&&l.set(e,{name:t.name,iban:e})}}const d=Array.from(l.values()),p=await Va({sepaPayees:d,accessToken:a,stagingToken:r});if((yield p.requests.map(Ka))===f)return;const g=await async function({bulkTransfers:e,accessToken:t,stagingToken:n,scaSessionToken:r,bankAccountId:i,idempotencyKey:o}){const s={method:"POST",headers:{..._({accessToken:t,stagingToken:n,scaSessionToken:r,idempotencyKey:o})},body:JSON.stringify({bank_account_id:i,bulk_transfers:e.map((e=>function(e){return{beneficiary_id:e.beneficiaryId||e.beneficiary?.id,client_transfer_id:e.clientTransferId,amount:e.amount.toString(),reference:e.reference,...e.note?{note:e.note}:{},...e.scheduledDate?{scheduled_date:e.scheduledDate.toISOString().split("T")[0]}:{},...e.attachmentsIds?{attachment_ids:e.attachmentsIds}:{}}}(e)))})},a=new URL(`${b.getEnvironmentUrls().THIRD_PARTY_API_URL}${za}`),c=await fetch(a,s),u=await c.json();if(!c.ok||u.errors)throw new E({message:u.errors?u.errors.map((e=>`${e.code}: ${e.detail}`)).join(", "):"Failed to create SEPA bulk transfer"});return u.bulk_transfer}({bulkTransfers:u.bulkTransfers,bankAccountId:u.bankAccountId,accessToken:a,stagingToken:r,scaSessionToken:i,idempotencyKey:c});return{bulkTransfer:Ha(g),meta:{idempotencyKey:c}}}}},nc="/v2/transactions";async function rc(e){const t=function({bankAccountId:e,iban:t,status:n,updatedAtFrom:r,updatedAtTo:i,emittedAtFrom:o,emittedAtTo:s,settledAtFrom:a,settledAtTo:c,side:u,operationType:l,withAttachments:d,paginationSettings:f,accessToken:p,stagingToken:g}){const h={method:"GET",headers:{accessToken:p,stagingToken:g}},v=new URLSearchParams;e&&v.append("bank_account_id",e),t&&v.append("iban",t),n&&v.append("status",n),r&&v.append("updated_at_from",r),i&&v.append("updated_at_to",i),o&&v.append("emitted_at_from",o),s&&v.append("emitted_at_to",s),a&&v.append("settled_at_from",a),c&&v.append("settled_at_to",c),u&&v.append("side",u),l&&v.append("operation_type",l),void 0!==d&&v.append("with_attachments",String(d));const m=q(f);for(const[e,t]of m)v.append(e,t);const y=v.toString();return{path:`${nc}${y?`?${y}`:""}`,options:h}}(e),{transactions:n,meta:r}=await I(t);return{transactions:n,meta:r}}async function ic(e){const t=function({transactionId:e,accessToken:t,stagingToken:n}){return{path:`${nc}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:n}}}}(e),{transaction:n}=await I(t);return n}function oc(e){return{transactionId:e.transaction_id,amount:e.amount,amountCents:e.amount_cents,settledBalance:e.settled_balance,settledBalanceCents:e.settled_balance_cents,attachmentIds:e.attachment_ids,localAmount:e.local_amount,localAmountCents:e.local_amount_cents,side:e.side,operationType:e.operation_type,currency:e.currency,localCurrency:e.local_currency,label:e.label,settledAt:new Date(e.settled_at),emittedAt:new Date(e.emitted_at),updatedAt:new Date(e.updated_at),status:e.status,note:e.note,reference:e.reference,vatAmount:e.vat_amount,vatAmountCents:e.vat_amount_cents,vatRate:e.vat_rate,initiatorId:e.initiator_id,labelIds:e.label_ids,attachmentLost:e.attachment_lost,attachmentRequired:e.attachment_required,cardLastDigits:e.card_last_digits,category:e.category,cashflowCategory:{name:e.cashflow_category?.name||""},cashflowSubcategory:{name:e.cashflow_subcategory?.name||""},id:e.id,subjectType:e.subject_type,...e.transfer?{transfer:{counterpartyAccountNumber:e.transfer.counterparty_account_number,counterpartyName:e.transfer.counterparty_name,counterpartyBic:e.transfer.counterparty_bic,counterpartyIban:e.transfer.counterparty_iban}}:{}}}const sc={getTransactions:async function(e){const{accessToken:t,stagingToken:n,paginationSettings:r}=e?.operationSettings||{},i={...e?.transactionSettings||{},paginationSettings:r},o=t||s(),a=await rc({...i,accessToken:o,stagingToken:n});return{transactions:a.transactions.map(oc),meta:F(a.meta)}},getTransaction:async function({transactionSettings:e,operationSettings:t}){const{accessToken:n,stagingToken:r}=t||{},{transactionId:i}=function(e){if(!e)throw new R("transactionSettings parameter is required for the called function");if(!e.transactionId)throw new R("transactionSettings.transactionId parameter is required for the called function");if(e.transactionId&&"string"!=typeof e.transactionId)throw new R("transactionSettings.transactionId must be a string.");return e}(e),o=n||s();return oc(await ic({transactionId:i,accessToken:o,stagingToken:r}))}};e.authLinks=j,e.beneficiaries=ie,e.cards=ka,e.organizations=Ea,e.paymentLinks=Da,e.sepaTransfers=tc,e.transactions=sc}));
|