@qonto/embed-sdk 0.64.3 → 0.66.0
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/Observable.js +1 -0
- package/dist/_virtual/index2.js +1 -1
- package/dist/_virtual/index3.js +1 -0
- package/dist/auth-links/auth-links.d.ts +7 -7
- package/dist/auth-links/auth-links.d.ts.map +1 -1
- package/dist/auth-links/client/auth-links.client.d.ts +5 -6
- package/dist/auth-links/client/auth-links.client.d.ts.map +1 -1
- package/dist/auth-links/index.d.ts +6 -4
- package/dist/auth-links/index.d.ts.map +1 -1
- package/dist/beneficiaries/beneficiaries.d.ts +10 -10
- package/dist/beneficiaries/beneficiaries.d.ts.map +1 -1
- package/dist/beneficiaries/client/beneficiaries.client.d.ts +11 -13
- package/dist/beneficiaries/client/beneficiaries.client.d.ts.map +1 -1
- package/dist/beneficiaries/index.d.ts +1 -1
- package/dist/cards/client/cards.client.d.ts +11 -11
- package/dist/cards/client/cards.client.d.ts.map +1 -1
- package/dist/cards/index.d.ts +6 -3
- package/dist/cards/index.d.ts.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/attribution/helpers.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/attribution/web-attribution.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/config/joined-config.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/config.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/cookie-migration/index.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/default-tracking.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/index.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/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 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/form-interaction-tracking.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/network-connectivity-checker.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/storage/local-storage.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/storage/session-storage.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/fetch.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/types.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/version.js +1 -0
- package/dist/{server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1 → node_modules/.pnpm/@amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/constants.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/revenue.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/transports/gzip.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/types/config/browser-config.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/element-interactions.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.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/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-dead-click.js +1 -1
- package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-error-click.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-exposure.js +1 -0
- package/dist/{server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2 → node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-rage-click.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-scroll.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.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.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-viewport-content-updated.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture-plugin.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/constants.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/data-extractor.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/frustration-plugin.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/helpers.js +1 -0
- package/dist/{server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2 → node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/hierarchy.js +1 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/libs/element-path.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/version.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-custom-enrichment-browser@0.1.1/node_modules/@amplitude/plugin-custom-enrichment-browser/lib/esm/custom-enrichment.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.9.10/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.8.2 → node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.9.10}/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.7.2/node_modules/@amplitude/plugin-page-url-enrichment-browser/lib/esm/page-url-enrichment.js +1 -0
- package/dist/node_modules/.pnpm/@amplitude_plugin-page-view-tracking-browser@2.9.3/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js +1 -0
- package/dist/node_modules/.pnpm/{@amplitude_plugin-web-vitals-browser@1.1.13 → @amplitude_plugin-web-vitals-browser@1.1.25}/node_modules/@amplitude/plugin-web-vitals-browser/lib/esm/web-vitals-plugin.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry-internal_browser-utils@10.39.0 → @sentry-internal_browser-utils@10.45.0}/node_modules/@sentry-internal/browser-utils/build/esm/getNativeImplementation.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry-internal_browser-utils@10.39.0 → @sentry-internal_browser-utils@10.45.0}/node_modules/@sentry-internal/browser-utils/build/esm/instrument/dom.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry-internal_browser-utils@10.39.0 → @sentry-internal_browser-utils@10.45.0}/node_modules/@sentry-internal/browser-utils/build/esm/instrument/history.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry-internal_browser-utils@10.39.0 → @sentry-internal_browser-utils@10.45.0}/node_modules/@sentry-internal/browser-utils/build/esm/instrument/xhr.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry-internal_browser-utils@10.39.0 → @sentry-internal_browser-utils@10.45.0}/node_modules/@sentry-internal/browser-utils/build/esm/types.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/client.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/eventbuilder.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/helpers.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/integrations/breadcrumbs.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/integrations/browserapierrors.js +1 -1
- package/dist/node_modules/.pnpm/@sentry_browser@10.45.0/node_modules/@sentry/browser/build/npm/esm/prod/integrations/browsersession.js +1 -0
- package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/integrations/culturecontext.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/integrations/globalhandlers.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/integrations/httpcontext.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/integrations/linkederrors.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/sdk.js +1 -1
- package/dist/node_modules/.pnpm/@sentry_browser@10.45.0/node_modules/@sentry/browser/build/npm/esm/prod/stack-parsers.js +1 -0
- package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/transports/fetch.js +1 -1
- package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/utils/detectBrowserExtension.js +1 -1
- package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/client.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/exports.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/integrations/eventFilters.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/utils/baggage.js +1 -0
- package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/browser.js +1 -1
- package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/utils/envelope.js +1 -0
- package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/misc.js +1 -1
- package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/utils/object.js +1 -0
- package/dist/node_modules/.pnpm/@sentry_core@10.45.0/node_modules/@sentry/core/build/esm/utils/version.js +1 -0
- package/dist/node_modules/.pnpm/safe-json-stringify@1.2.0/node_modules/safe-json-stringify/index.js +1 -1
- package/dist/node_modules/.pnpm/zen-observable@0.10.0/node_modules/zen-observable/index.js +1 -0
- package/dist/node_modules/.pnpm/zen-observable@0.10.0/node_modules/zen-observable/lib/Observable.js +1 -0
- package/dist/organizations/client/organizations.client.d.ts +4 -24
- package/dist/organizations/client/organizations.client.d.ts.map +1 -1
- package/dist/organizations/index.d.ts +1 -7
- package/dist/organizations/index.d.ts.map +1 -1
- package/dist/organizations/index.server.d.ts +1 -1
- package/dist/organizations/index.server.d.ts.map +1 -1
- package/dist/payment-links/client/payment-links.client.d.ts +4 -40
- package/dist/payment-links/client/payment-links.client.d.ts.map +1 -1
- package/dist/payment-links/index.d.ts +1 -1
- package/dist/sca/sca.d.ts.map +1 -1
- package/dist/server/_virtual/Observable.js +1 -0
- package/dist/server/_virtual/index2.js +1 -1
- package/dist/server/_virtual/index3.js +1 -0
- package/dist/server/auth-links/auth-links.d.ts +7 -7
- package/dist/server/auth-links/auth-links.d.ts.map +1 -1
- package/dist/server/auth-links/client/auth-links.client.d.ts +5 -6
- package/dist/server/auth-links/client/auth-links.client.d.ts.map +1 -1
- package/dist/server/auth-links/index.d.ts +6 -4
- package/dist/server/auth-links/index.d.ts.map +1 -1
- package/dist/server/beneficiaries/beneficiaries.d.ts +10 -10
- package/dist/server/beneficiaries/beneficiaries.d.ts.map +1 -1
- package/dist/server/beneficiaries/client/beneficiaries.client.d.ts +11 -13
- package/dist/server/beneficiaries/client/beneficiaries.client.d.ts.map +1 -1
- package/dist/server/beneficiaries/index.d.ts +1 -1
- package/dist/server/cards/client/cards.client.d.ts +11 -11
- package/dist/server/cards/client/cards.client.d.ts.map +1 -1
- package/dist/server/cards/index.d.ts +6 -3
- package/dist/server/cards/index.d.ts.map +1 -1
- package/dist/server/index.server.umd.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/attribution/helpers.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/attribution/web-attribution.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/config/joined-config.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/config.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/cookie-migration/index.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/default-tracking.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/index.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/context.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/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 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/form-interaction-tracking.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/plugins/network-connectivity-checker.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/storage/local-storage.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/storage/session-storage.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/fetch.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/types.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.37.2/node_modules/@amplitude/analytics-browser/lib/esm/version.js +1 -0
- package/dist/{node_modules/.pnpm/@amplitude_analytics-core@2.40.1 → server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/constants.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/revenue.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/transports/gzip.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/types/config/browser-config.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/element-interactions.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.43.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.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 → server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-dead-click.js +1 -1
- package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-error-click.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-exposure.js +1 -0
- package/dist/{node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2 → server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-rage-click.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-scroll.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.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.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture/track-viewport-content-updated.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.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.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/constants.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.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.24.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.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/helpers.js +1 -0
- package/dist/{node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2 → server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/hierarchy.js +1 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/libs/element-path.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.24.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/version.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-custom-enrichment-browser@0.1.1/node_modules/@amplitude/plugin-custom-enrichment-browser/lib/esm/custom-enrichment.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.9.10/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.8.2 → server/node_modules/.pnpm/@amplitude_plugin-network-capture-browser@1.9.10}/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.7.2/node_modules/@amplitude/plugin-page-url-enrichment-browser/lib/esm/page-url-enrichment.js +1 -0
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-page-view-tracking-browser@2.9.3/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js +1 -0
- package/dist/server/node_modules/.pnpm/{@amplitude_plugin-web-vitals-browser@1.1.13 → @amplitude_plugin-web-vitals-browser@1.1.25}/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 -1
- package/dist/server/node_modules/.pnpm/zen-observable@0.10.0/node_modules/zen-observable/index.js +1 -0
- package/dist/server/node_modules/.pnpm/zen-observable@0.10.0/node_modules/zen-observable/lib/Observable.js +1 -0
- package/dist/server/organizations/client/organizations.client.d.ts +4 -24
- package/dist/server/organizations/client/organizations.client.d.ts.map +1 -1
- package/dist/server/organizations/index.d.ts +1 -7
- package/dist/server/organizations/index.d.ts.map +1 -1
- package/dist/server/organizations/index.server.d.ts +1 -1
- package/dist/server/organizations/index.server.d.ts.map +1 -1
- package/dist/server/payment-links/client/payment-links.client.d.ts +4 -40
- package/dist/server/payment-links/client/payment-links.client.d.ts.map +1 -1
- package/dist/server/payment-links/index.d.ts +1 -1
- package/dist/server/sca/sca.d.ts.map +1 -1
- package/dist/server/src/auth-links/auth-links.js +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 +1 -2
- package/dist/server/transactions/client/transactions.client.d.ts.map +1 -1
- 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/common/analytics/amplitude-manager.js +1 -1
- package/dist/src/common/sentry/sentry-manager.js +1 -1
- package/dist/src/organizations/client/organizations.client.js +1 -1
- package/dist/src/payment-links/client/payment-links.client.js +1 -1
- package/dist/src/sca/sca.js +1 -1
- package/dist/src/transactions/client/transactions.client.js +1 -1
- package/dist/transactions/client/transactions.client.d.ts +1 -2
- package/dist/transactions/client/transactions.client.d.ts.map +1 -1
- package/package.json +5 -5
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/attribution/helpers.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/attribution/web-attribution.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/config/joined-config.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/config.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/default-tracking.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/index.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/types.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/version.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/transports/fetch.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js +0 -1
- 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 +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/autocapture-plugin.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/constants.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/data-extractor.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/frustration-plugin.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/helpers.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/version.js +0 -1
- 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 +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-page-url-enrichment-browser@0.6.2/node_modules/@amplitude/plugin-page-url-enrichment-browser/lib/esm/page-url-enrichment.js +0 -1
- package/dist/node_modules/.pnpm/@amplitude_plugin-page-view-tracking-browser@2.7.2/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/integrations/browsersession.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_browser@10.39.0/node_modules/@sentry/browser/build/npm/esm/prod/stack-parsers.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/client.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/exports.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/integrations/eventFilters.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/baggage.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/envelope.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/object.js +0 -1
- package/dist/node_modules/.pnpm/@sentry_core@10.39.0/node_modules/@sentry/core/build/esm/utils/version.js +0 -1
- package/dist/node_modules/.pnpm/zen-observable-ts@1.1.0/node_modules/zen-observable-ts/module.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/attribution/helpers.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/attribution/web-attribution.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/browser-client-factory.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/browser-client.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/config/joined-config.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/config.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/default-tracking.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/index.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/transports/send-beacon.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/transports/xhr.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/types.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-browser@2.35.3/node_modules/@amplitude/analytics-browser/lib/esm/version.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/plugins/destination.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/remote-config/remote-config.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/storage/cookie.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/transports/base.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/transports/fetch.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_analytics-core@2.40.1/node_modules/@amplitude/analytics-core/lib/esm/utils/observable.js +0 -1
- 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 +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.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.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/constants.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.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.22.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.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/helpers.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.2/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/observables.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-autocapture-browser@1.22.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.8.2/node_modules/@amplitude/plugin-network-capture-browser/lib/esm/network-capture-plugin.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-page-url-enrichment-browser@0.6.2/node_modules/@amplitude/plugin-page-url-enrichment-browser/lib/esm/page-url-enrichment.js +0 -1
- package/dist/server/node_modules/.pnpm/@amplitude_plugin-page-view-tracking-browser@2.7.2/node_modules/@amplitude/plugin-page-view-tracking-browser/lib/esm/page-view-tracking.js +0 -1
- package/dist/server/node_modules/.pnpm/zen-observable-ts@1.1.0/node_modules/zen-observable-ts/module.js +0 -1
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/det-notification.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/lib-prefix.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/utils/snippet-helper.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/analytics-connector.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/campaign/campaign-parser.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/config.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/cookie-name.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/core-client.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-client.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-storage.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/uncaught-sdk-errors.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/identify.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/language.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/logger.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/background-capture.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/base-window-messenger.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/utils.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/network-request-event.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/observers/console.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/observers/network.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/helpers.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/identity.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/query-params.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.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.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/session.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/browser-storage.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/helpers.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/memory.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/timeline.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/frustration-interactions.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/status.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/json-query.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/safe-stringify.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/sampling.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/url-utils.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.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.22.2 → @amplitude_plugin-autocapture-browser@1.24.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.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/libs/messenger.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/actions.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/matchEventToFilter.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/triggers.js +0 -0
- /package/dist/node_modules/.pnpm/{@amplitude_plugin-network-capture-browser@1.8.2 → @amplitude_plugin-network-capture-browser@1.9.10}/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.7.2 → @amplitude_plugin-page-view-tracking-browser@2.9.3}/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.13 → @amplitude_plugin-web-vitals-browser@1.1.25}/node_modules/@amplitude/plugin-web-vitals-browser/lib/esm/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry-internal_browser-utils@10.39.0 → @sentry-internal_browser-utils@10.45.0}/node_modules/@sentry-internal/browser-utils/build/esm/debug-build.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_browser@10.39.0 → @sentry_browser@10.45.0}/node_modules/@sentry/browser/build/npm/esm/prod/debug-build.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/api.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/asyncContext/index.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/asyncContext/stackStrategy.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/breadcrumbs.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/carrier.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/constants.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/currentScopes.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/debug-build.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/defaultScopes.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/envelope.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/eventProcessors.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/instrument/console.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/instrument/fetch.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/instrument/globalError.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/instrument/globalUnhandledRejection.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/instrument/handlers.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/integration.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/integrations/conversationId.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/integrations/dedupe.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/integrations/functiontostring.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/logs/envelope.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/logs/internal.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/metrics/envelope.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/metrics/internal.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/scope.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/sdk.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/semanticAttributes.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/session.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/tracing/dynamicSamplingContext.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/tracing/spanstatus.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/tracing/utils.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/transports/base.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/aggregate-errors.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/breadcrumb-log-level.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/clientreport.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/debug-ids.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/debug-logger.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/dsn.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/env.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/eventUtils.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/eventbuilder.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/hasSpansEnabled.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/ipAddress.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/is.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/merge.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/normalize.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/parseSampleRate.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/prepareEvent.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/promisebuffer.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/propagationContext.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/randomSafeContext.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/ratelimit.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/scopeData.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/sdkMetadata.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/severity.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/should-ignore-span.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/spanOnScope.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/spanUtils.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/stacktrace.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/string.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/supports.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/syncpromise.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/time.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/timer.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/transactionEvent.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/url.js +0 -0
- /package/dist/node_modules/.pnpm/{@sentry_core@10.39.0 → @sentry_core@10.45.0}/node_modules/@sentry/core/build/esm/utils/worldwide.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/constants.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/det-notification.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/lib-prefix.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-browser@2.35.3 → @amplitude_analytics-browser@2.37.2}/node_modules/@amplitude/analytics-browser/lib/esm/utils/snippet-helper.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/analytics-connector.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/campaign/campaign-parser.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/config.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/cookie-name.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/core-client.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-client.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/diagnostics-storage.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/diagnostics/uncaught-sdk-errors.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/global-scope.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/identify.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/language.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/logger.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/background-capture.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/base-window-messenger.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/messenger/utils.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/network-request-event.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/observers/console.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/observers/network.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/helpers.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/plugins/identity.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/query-params.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.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.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/session.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/browser-storage.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/helpers.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/storage/memory.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/timeline.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/constants.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/event/event.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/frustration-interactions.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/loglevel.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/messages.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/offline.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/server-zone.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/types/status.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/chunk.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/debug.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/event-builder.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/json-query.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/result-builder.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/return-wrapper.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/safe-stringify.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/sampling.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/status-code.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/url-utils.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/uuid.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_analytics-core@2.40.1 → @amplitude_analytics-core@2.43.1}/node_modules/@amplitude/analytics-core/lib/esm/utils/valid-properties.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.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.22.2 → @amplitude_plugin-autocapture-browser@1.24.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.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/libs/messenger.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.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.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/matchEventToFilter.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-autocapture-browser@1.22.2 → @amplitude_plugin-autocapture-browser@1.24.2}/node_modules/@amplitude/plugin-autocapture-browser/lib/esm/pageActions/triggers.js +0 -0
- /package/dist/server/node_modules/.pnpm/{@amplitude_plugin-network-capture-browser@1.8.2 → @amplitude_plugin-network-capture-browser@1.9.10}/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.7.2 → @amplitude_plugin-page-view-tracking-browser@2.9.3}/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.13 → @amplitude_plugin-web-vitals-browser@1.1.25}/node_modules/@amplitude/plugin-web-vitals-browser/lib/esm/constants.js +0 -0
package/dist/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
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).QontoEmbed={})}(this,(function(exports){"use strict";function _mergeNamespaces(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}}))})),Object.freeze(e)}const ANALYTICS_EVENTS={SDK_INITIALIZED:"SDK Initialized",CARDS_LIST:"Cards List",CARDS_GET:"Cards Get",CARDS_ORDER:"Cards Order Virtual",CARDS_UNLOCK:"Cards Unlock",CARDS_DISPLAY:"Cards Display",BENEFICIARIES_LIST:"Beneficiaries List",BENEFICIARIES_GET:"Beneficiaries Get",BENEFICIARIES_ADD:"Beneficiaries Add",BENEFICIARIES_UPDATE:"Beneficiaries Update",BENEFICIARIES_TRUST:"Beneficiaries Trust",BENEFICIARIES_UNTRUST:"Beneficiaries Untrust",SEPA_TRANSFER_LIST:"SEPA Transfer List",SEPA_TRANSFER_GET:"SEPA Transfer Get",SEPA_TRANSFER_CREATE:"SEPA Transfer Create",SEPA_TRANSFER_CANCEL:"SEPA Transfer Cancel",SEPA_TRANSFER_CREATION_FLOW_LINK:"SEPA Transfer Creation Flow Link",SEPA_TRANSFER_BULK_LIST:"SEPA Transfer Bulk List",SEPA_TRANSFER_BULK_GET:"SEPA Transfer Bulk Get",SEPA_TRANSFER_BULK_CREATE:"SEPA Transfer Bulk Create",TRANSACTIONS_LIST:"Transactions List",TRANSACTIONS_GET:"Transactions Get",ORGANIZATIONS_LIST:"Organizations List",ORGANIZATIONS_BANK_ACCOUNTS:"Organizations Bank Accounts",PAYMENT_LINKS_CREATE:"Payment Links Create",PAYMENT_LINKS_REDIRECT:"Payment Links Redirect",AUTH_LINKS_REQUEST:"Auth Links Request",UI_ELEMENT_CREATED:"UI Element Created"};var extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},extendStatics(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var __assign$1=function(){return __assign$1=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign$1.apply(this,arguments)},IdentifyOperation$1,SpecialEventType;function __rest(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function __decorate(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o}function __awaiter(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))}function __generator(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function __values$1(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read$1(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function __spreadArray(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||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"}(IdentifyOperation$1||(IdentifyOperation$1={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(SpecialEventType||(SpecialEventType={}));var UNSET_VALUE="-",AMPLITUDE_PREFIX="AMP",STORAGE_PREFIX="".concat(AMPLITUDE_PREFIX,"_unsent"),DEFAULT_INSTANCE_NAME="$default_instance",AMPLITUDE_SERVER_URL="https://api2.amplitude.com/2/httpapi",EU_AMPLITUDE_SERVER_URL="https://api.eu.amplitude.com/2/httpapi",AMPLITUDE_BATCH_SERVER_URL="https://api2.amplitude.com/batch",EU_AMPLITUDE_BATCH_SERVER_URL="https://api.eu.amplitude.com/batch",UTM_CAMPAIGN="utm_campaign",UTM_CONTENT="utm_content",UTM_ID="utm_id",UTM_MEDIUM="utm_medium",UTM_SOURCE="utm_source",UTM_TERM="utm_term",DCLID="dclid",FBCLID="fbclid",GBRAID="gbraid",GCLID="gclid",KO_CLICK_ID="ko_click_id",LI_FAT_ID="li_fat_id",MSCLKID="msclkid",RDT_CID="rdt_cid",TTCLID="ttclid",TWCLID="twclid",WBRAID="wbraid",BASE_CAMPAIGN={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},SAFE_HEADERS=["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"],FORBIDDEN_HEADERS=["authorization","cookie","set-cookie"],MAX_PROPERTY_KEYS=1e3,isValidObject=function(e){if(Object.keys(e).length>MAX_PROPERTY_KEYS)return!1;for(var t in e){var r=e[t];if(!isValidProperties(t,r))return!1}return!0},isValidProperties=function(e,t){var r,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var a=__values$1(t),o=a.next();!o.done;o=a.next()){var s=o.value;if(Array.isArray(s))return!1;if("object"==typeof s)i=i&&isValidObject(s);else if(!["number","string"].includes(typeof s))return!1;if(!i)return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}else{if(null==t)return!1;if("object"==typeof t)return isValidObject(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},Identify=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return __assign$1({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(IdentifyOperation.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(IdentifyOperation.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(IdentifyOperation.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(IdentifyOperation.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(IdentifyOperation.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(IdentifyOperation.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(IdentifyOperation.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(IdentifyOperation.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(IdentifyOperation.UNSET,e,UNSET_VALUE),this},e.prototype.clearAll=function(){return this._properties={},this._properties[IdentifyOperation.CLEAR_ALL]=UNSET_VALUE,this},e.prototype._safeSet=function(e,t,r){if(this._validate(e,t,r)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=r,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,r){return void 0===this._properties[IdentifyOperation.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===IdentifyOperation.ADD?"number"==typeof r:e===IdentifyOperation.UNSET||e===IdentifyOperation.REMOVE||isValidProperties(t,r)))},e}(),IdentifyOperation;!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"}(IdentifyOperation||(IdentifyOperation={}));var OrderedIdentifyOperations=[IdentifyOperation.CLEAR_ALL,IdentifyOperation.UNSET,IdentifyOperation.SET,IdentifyOperation.SET_ONCE,IdentifyOperation.ADD,IdentifyOperation.APPEND,IdentifyOperation.PREPEND,IdentifyOperation.PREINSERT,IdentifyOperation.POSTINSERT,IdentifyOperation.REMOVE],SUCCESS_MESSAGE="Event tracked successfully",UNEXPECTED_ERROR_MESSAGE="Unexpected error occurred",MAX_RETRIES_EXCEEDED_MESSAGE="Event rejected due to exceeded retry count",OPT_OUT_MESSAGE="Event skipped due to optOut config",MISSING_API_KEY_MESSAGE="Event rejected due to missing API key",INVALID_API_KEY="Invalid API key",CLIENT_NOT_INITIALIZED="Client not initialized",Status;!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"}(Status||(Status={}));var buildResult=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Status.Unknown),{event:e,code:t,message:r}},getGlobalScope$1=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},legacyUUID=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,UUID)},hex=__spreadArray([],__read$1(Array(256).keys()),!1).map((function(e){return e.toString(16).padStart(2,"0")})),UUID=function(e){var t,r=getGlobalScope$1();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return legacyUUID(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,__spreadArray([],__read$1(n.entries()),!1).map((function(e){var t=__read$1(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(hex[n]):hex[n]})).join("")},Timeline=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this._optOutListeners=[]}return e.prototype.register=function(e,t){var r,n;return __awaiter(this,void 0,void 0,(function(){return __generator(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=UUID(),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!==(r=e.type)&&void 0!==r?r:"enrichment",[4,null===(n=e.setup)||void 0===n?void 0:n.call(e,t,this.client)]);case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e,t){var r;return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(a){switch(a.label){case 0:return n=this.plugins.findIndex((function(t){return t.name===e})),-1===n?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(i=this.plugins[n],this.plugins.splice(n,1),[4,null===(r=i.teardown)||void 0===r?void 0:r.call(i)]);case 1:return a.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(r){t.queue.push([e,r]),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 __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a,o,s,l,c,d,u,p,h,f,m,g,v,y,b,E;return __generator(this,(function(_){switch(_.label){case 0:if(!e)return[2];t=__read$1(e,1),r=t[0],n=__read$1(e,2),i=n[1],this.loggerProvider.log("Timeline.apply: Initial event",r),a=this.plugins.filter((function(e){return"before"===e.type})),_.label=1;case 1:_.trys.push([1,6,7,8]),o=__values$1(a),s=o.next(),_.label=2;case 2:return s.done?[3,5]:(p=s.value).execute?[4,p.execute(__assign$1({},r))]:[3,4];case 3:if(null===(h=_.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(r))),i({event:r,code:0,message:""}),[2];r=h,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(r))),_.label=4;case 4:return s=o.next(),[3,2];case 5:return[3,8];case 6:return l=_.sent(),v={error:l},[3,8];case 7:try{s&&!s.done&&(y=o.return)&&y.call(o)}finally{if(v)throw v.error}return[7];case 8:c=this.plugins.filter((function(e){return"enrichment"===e.type||void 0===e.type})),_.label=9;case 9:_.trys.push([9,14,15,16]),d=__values$1(c),u=d.next(),_.label=10;case 10:return u.done?[3,13]:(p=u.value).execute?[4,p.execute(__assign$1({},r))]:[3,12];case 11:if(null===(h=_.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(r))),i({event:r,code:0,message:""}),[2];r=h,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(r))),_.label=12;case 12:return u=d.next(),[3,10];case 13:return[3,16];case 14:return f=_.sent(),b={error:f},[3,16];case 15:try{u&&!u.done&&(E=d.return)&&E.call(d)}finally{if(b)throw b.error}return[7];case 16:return m=this.plugins.filter((function(e){return"destination"===e.type})),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(r))),g=m.map((function(e){var t=__assign$1({},r);return e.execute(t).catch((function(e){return buildResult(t,0,String(e))}))})),Promise.all(g).then((function(e){var t=__read$1(e,1)[0]||buildResult(r,100,"Event not tracked, no destination plugins on the instance");i(t)})),[2]}}))}))},e.prototype.flush=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return n.apply(e)})))];case 1:return i.sent(),t=this.plugins.filter((function(e){return"destination"===e.type})),r=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(r)];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 r;null===(r=t.onIdentityChanged)||void 0===r||r.call(t,e)}))},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach((function(t){var r;null===(r=t.onSessionIdChanged)||void 0===r||r.call(t,e)}))},e.prototype.onOptOutChanged=function(e){this.plugins.forEach((function(t){var r;null===(r=t.onOptOutChanged)||void 0===r||r.call(t,e)})),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a,o,s;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,7,8,9]),t=__values$1(this._optOutListeners),r=t.next(),l.label=1;case 1:if(r.done)return[3,6];n=r.value,l.label=2;case 2:return l.trys.push([2,4,,5]),[4,n(e)];case 3:return l.sent(),[3,5];case 4:return i=l.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return r=t.next(),[3,1];case 6:return[3,9];case 7:return a=l.sent(),o={error:a},[3,9];case 8:try{r&&!r.done&&(s=t.return)&&s.call(t)}finally{if(o)throw o.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}(),createTrackEvent=function(e,t,r){return __assign$1(__assign$1(__assign$1({},"string"==typeof e?{event_type:e}:e),r),t&&{event_properties:t})},createIdentifyEvent=function(e,t){return __assign$1(__assign$1({},t),{event_type:SpecialEventType.IDENTIFY,user_properties:e.getUserProperties()})},createGroupIdentifyEvent=function(e,t,r,n){var i;return __assign$1(__assign$1({},n),{event_type:SpecialEventType.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(i={},i[e]=t,i)})},createGroupEvent=function(e,t,r){var n,i=new Identify;return i.set(e,t),__assign$1(__assign$1({},r),{event_type:SpecialEventType.IDENTIFY,user_properties:i.getUserProperties(),groups:(n={},n[e]=t,n)})},createRevenueEvent=function(e,t){return __assign$1(__assign$1({},t),{event_type:SpecialEventType.REVENUE,event_properties:e.getEventProperties()})},returnWrapper=function(e){return{promise:e||Promise.resolve()}},AmplitudeCore=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 Timeline(this),this.name=e}return e.prototype._init=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(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 __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:t=this[e],this[e]=[],c.label=1;case 1:c.trys.push([1,8,9,10]),r=__values$1(t),n=r.next(),c.label=2;case 2:return n.done?[3,7]:(i=n.value,(a=i())&&"promise"in a?[4,a.promise]:[3,4]);case 3:return c.sent(),[3,6];case 4:return[4,a];case 5:c.sent(),c.label=6;case 6:return n=r.next(),[3,2];case 7:return[3,10];case 8:return o=c.sent(),s={error:o},[3,10];case 9:try{n&&!n.done&&(l=r.return)&&l.call(r)}finally{if(s)throw s.error}return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:c.sent(),c.label=12;case 12:return[2]}}))}))},e.prototype.track=function(e,t,r){var n=createTrackEvent(e,t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),returnWrapper(this.dispatch(n))},e.prototype.identify=function(e,t){var r=createIdentifyEvent(e,t);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),returnWrapper(this.dispatch(r))},e.prototype.groupIdentify=function(e,t,r,n){var i=createGroupIdentifyEvent(e,t,r,n);return returnWrapper(this.dispatch(i))},e.prototype.setGroup=function(e,t,r){var n=createGroupEvent(e,t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),returnWrapper(this.dispatch(n))},e.prototype.revenue=function(e,t){var r=createRevenueEvent(e,t);return returnWrapper(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),returnWrapper())},e.prototype._addPlugin=function(e){return returnWrapper(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)),returnWrapper())},e.prototype._removePlugin=function(e){return returnWrapper(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(buildResult(e,0,CLIENT_NOT_INITIALIZED));this.process(e).then(t)},e.prototype.dispatch=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){return this.isReady?[2,this.process(e)]:[2,new Promise((function(r){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,r))}))]}))}))},e.prototype.getOperationAppliedUserProperties=function(e){var t,r=null!==(t=this.userProperties)&&void 0!==t?t:{},n=__assign$1({},r);if(void 0===e)return n;var i={};return Object.keys(e).forEach((function(t){Object.values(IdentifyOperation$1).includes(t)||(i[t]=e[t])})),OrderedIdentifyOperations.forEach((function(t){if(Object.keys(e).includes(t)){var r=e[t];switch(t){case IdentifyOperation$1.CLEAR_ALL:Object.keys(n).forEach((function(e){delete n[e]}));break;case IdentifyOperation$1.UNSET:Object.keys(r).forEach((function(e){delete n[e]}));break;case IdentifyOperation$1.SET:Object.assign(n,r)}}})),Object.assign(n,i),n},e.prototype.process=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,buildResult(e,0,OPT_OUT_MESSAGE)]:(e.event_type===SpecialEventType.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)]);case 1:return 200===(n=i.sent()).code?this.config.loggerProvider.log(n.message):100===n.code?this.config.loggerProvider.warn(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return t=i.sent(),r=String(t),this.config.loggerProvider.error(r),[2,n=buildResult(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.config.optOut=Boolean(e),this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return returnWrapper(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}(),Revenue=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 isValidObject(e)&&(this.properties=e),this},e.prototype.getEventProperties=function(){var e=this.properties?__assign$1({},this.properties):{};return e[RevenueProperty.REVENUE_PRODUCT_ID]=this.productId,e[RevenueProperty.REVENUE_QUANTITY]=this.quantity,e[RevenueProperty.REVENUE_PRICE]=this.price,e[RevenueProperty.REVENUE_TYPE]=this.revenueType,e[RevenueProperty.REVENUE_CURRENCY]=this.currency,e[RevenueProperty.REVENUE]=this.revenue,e[RevenueProperty.RECEIPT]=this.receipt,e[RevenueProperty.RECEIPT_SIG]=this.receiptSig,e},e}(),RevenueProperty;!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"}(RevenueProperty||(RevenueProperty={}));var chunk=function(e,t){var r=Math.max(t,1);return e.reduce((function(e,t,n){var i=Math.floor(n/r);return e[i]||(e[i]=[]),e[i].push(t),e}),[])},LogLevel;!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"}(LogLevel||(LogLevel={}));var PREFIX$1="Amplitude Logger ",Logger=function(){function e(){this.logLevel=LogLevel.None}return e.prototype.disable=function(){this.logLevel=LogLevel.None},e.prototype.enable=function(e){void 0===e&&(e=LogLevel.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<LogLevel.Verbose||console.log("".concat(PREFIX$1,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<LogLevel.Warn||console.warn("".concat(PREFIX$1,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<LogLevel.Error||console.error("".concat(PREFIX$1,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<LogLevel.Debug||console.log("".concat(PREFIX$1,"[Debug]: ").concat(e.join(" ")))},e}(),getDefaultConfig=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:DEFAULT_INSTANCE_NAME,logLevel:LogLevel.Warn,loggerProvider:new Logger,offline:!1,optOut:!1,serverUrl:AMPLITUDE_SERVER_URL,serverZone:"US",useBatch:!1}},Config=function(){function e(e){var t,r,n,i;this._optOut=!1;var a=getDefaultConfig();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:a.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||a.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||a.flushQueueSize,this.instanceName=e.instanceName||a.instanceName,this.loggerProvider=e.loggerProvider||a.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:a.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:a.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:a.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||a.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:a.useBatch,this.loggerProvider.enable(this.logLevel);var o=createServerConfig(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),getServerUrl=function(e,t){return"EU"===e?t?EU_AMPLITUDE_BATCH_SERVER_URL:EU_AMPLITUDE_SERVER_URL:t?AMPLITUDE_BATCH_SERVER_URL:AMPLITUDE_SERVER_URL},createServerConfig=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=getDefaultConfig().serverZone),void 0===r&&(r=getDefaultConfig().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:getDefaultConfig().serverZone;return{serverZone:n,serverUrl:getServerUrl(n,r)}},RequestMetadata=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function isSuccessStatusCode(e){return e>=200&&e<300}var getStacktrace=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},getClientLogConfig=function(e){return function(){var t=__assign$1({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},getValueByStringPath=function(e,t){var r,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=__values$1(t.split(".")),a=i.next();!a.done;a=i.next()){var o=a.value;if(!(o in e))return;e=e[o]}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},getClientStates=function(e,t){return function(){var r,n,i={};try{for(var a=__values$1(t),o=a.next();!o.done;o=a.next()){var s=o.value;i[s]=getValueByStringPath(e,s)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}},debugWrapper=function(e,t,r,n,i){return void 0===i&&(i=null),function(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];var s=r(),l=s.logger,c=s.logLevel;if(c&&c<LogLevel.Debug||!c||!l)return e.apply(i,a);var d={type:"invoke public method",name:t,args:a,stacktrace:getStacktrace(1),time:{start:(new Date).toISOString()},states:{}};n&&d.states&&(d.states.before=n());var u=e.apply(i,a);return u&&u.promise?u.promise.then((function(){n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=(new Date).toISOString()),l.debug(JSON.stringify(d,null,2))})):(n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=(new Date).toISOString()),l.debug(JSON.stringify(d,null,2))),u}};function getErrorMessage(e){return e instanceof Error?e.message:String(e)}function getResponseBodyString(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var Destination=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 __awaiter(this,void 0,void 0,(function(){var r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(STORAGE_PREFIX,"_").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(r=i.sent())&&r.length>0&&Promise.all(r.map((function(e){return n.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=UUID()),new Promise((function(r){var n={event:e,attempts:0,callback:function(e){return r(e)},timeout:0};t.queue.push(n),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,MAX_RETRIES_EXCEEDED_MESSAGE),!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),__awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(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=[],r=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):r.push(e)})),[4,chunk(t,this.config.flushQueueSize).reduce((function(t,r){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,t];case 1:return n.sent(),[4,this.send(r,e)];case 2:return[2,n.sent()]}}))}))}),Promise.resolve())]);case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}}))}))},e.prototype.send=function(e,t){var r;return void 0===t&&(t=!0),__awaiter(this,void 0,void 0,(function(){var n,i,a,o,s;return __generator(this,(function(l){switch(l.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,MISSING_API_KEY_MESSAGE)];n={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,__rest(t,["extra"])})),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new RequestMetadata,l.label=1;case 1:return l.trys.push([1,3,,4]),i=createServerConfig(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,[4,this.config.transportProvider.send(i,n)];case 2:return null===(a=l.sent())?(this.fulfillRequest(e,0,UNEXPECTED_ERROR_MESSAGE),[2]):t?(this.handleResponse(a,e),[3,4]):("body"in a?this.fulfillRequest(e,a.statusCode,"".concat(a.status,": ").concat(getResponseBodyString(a))):this.fulfillRequest(e,a.statusCode,a.status),[2]);case 3:return o=l.sent(),s=getErrorMessage(o),this.config.loggerProvider.error(s),null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map((function(e){return e.event.event_type})),message:s,stack_trace:getStacktrace()}),this.handleResponse({status:Status.Failed,statusCode:0},e),[3,4];case 4:return[2]}}))}))},e.prototype.handleResponse=function(e,t){var r;isSuccessStatusCode(e.statusCode)||null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful",{events:t.map((function(e){return e.event.event_type})),code:e.statusCode,status:e.status,body:getResponseBodyString(e),stack_trace:getStacktrace()});var n=e.status;switch(n){case Status.Success:this.handleSuccessResponse(e,t);break;case Status.Invalid:this.handleInvalidResponse(e,t);break;case Status.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case Status.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(n,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,SUCCESS_MESSAGE)},e.prototype.handleInvalidResponse=function(e,t){var r=this;if(e.body.missingField||e.body.error.startsWith(INVALID_API_KEY))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=__spreadArray(__spreadArray(__spreadArray(__spreadArray([],__read$1(Object.values(e.body.eventsWithInvalidFields)),!1),__read$1(Object.values(e.body.eventsWithMissingFields)),!1),__read$1(Object.values(e.body.eventsWithInvalidIdLengths)),!1),__read$1(e.body.silencedEvents),!1).flat(),i=new Set(n),a=t.filter((function(t,n){if(!i.has(n))return!0;r.fulfillRequest([t],e.statusCode,e.body.error)}));a.length>0&&this.config.loggerProvider.warn(getResponseBodyString(e));var o=this.removeEventsExceedFlushMaxRetries(a);this.scheduleEvents(o)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(getResponseBodyString(e)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(r)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var r=this,n=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),a=e.body.throttledEvents,o=new Set(n),s=new Set(i),l=new Set(a),c=t.filter((function(t,n){if(!(t.event.user_id&&o.has(t.event.user_id)||t.event.device_id&&s.has(t.event.device_id)))return l.has(n)&&(t.timeout=r.throttleTimeout),!0;r.fulfillRequest([t],e.statusCode,e.body.error)}));c.length>0&&this.config.loggerProvider.warn(getResponseBodyString(e));var d=this.removeEventsExceedFlushMaxRetries(c);this.scheduleEvents(d)},e.prototype.handleOtherResponse=function(e){var t=this,r=e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e})),n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},e.prototype.fulfillRequest=function(e,t,r){var n,i,a;isSuccessStatusCode(t)?null===(a=this.diagnosticsClient)||void 0===a||a.increment("analytics.events.sent",e.length):(null===(n=this.diagnosticsClient)||void 0===n||n.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:r,stack_trace:getStacktrace()})),this.removeEvents(e),e.forEach((function(e){return e.callback(buildResult(e.event,t,r))}))},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}(),ApplicationContextProviderImpl=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:getLanguage$1(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),getLanguage$1=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},EventBridgeImpl=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}(),__assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)};function __values(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}"function"==typeof SuppressedError&&SuppressedError;var isEqual=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var a=__values(["string","number","boolean","undefined"]),o=a.next();!o.done;o=a.next()){if(o.value===i)return e===t}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.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),l=Array.isArray(t);if(s!==l)return!1;if(!s||!l){var c=Object.keys(e).sort(),d=Object.keys(t).sort();if(!isEqual(c,d))return!1;var u=!0;return Object.keys(e).forEach((function(r){isEqual(e[r],t[r])||(u=!1)})),u}for(var p=0;p<e.length;p++)if(!isEqual(e[p],t[p]))return!1;return!0},ID_OP_SET="$set",ID_OP_UNSET="$unset",ID_OP_CLEAR_ALL="$clearAll";Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var IdentityStoreImpl=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=__assign({},this.identity.userProperties),r=__assign(__assign({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,i,a,o,s,l=r.userProperties||{};try{for(var c=__values(Object.entries(e)),d=c.next();!d.done;d=c.next()){var u=__read(d.value,2),p=u[0],h=u[1];switch(p){case ID_OP_SET:try{for(var f=(i=void 0,__values(Object.entries(h))),m=f.next();!m.done;m=f.next()){var g=__read(m.value,2),v=g[0],y=g[1];l[v]=y}}catch(e){i={error:e}}finally{try{m&&!m.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}break;case ID_OP_UNSET:try{for(var b=(o=void 0,__values(Object.keys(h))),E=b.next();!E.done;E=b.next()){delete l[v=E.value]}}catch(e){o={error:e}}finally{try{E&&!E.done&&(s=b.return)&&s.call(b)}finally{if(o)throw o.error}}break;case ID_OP_CLEAR_ALL:l={}}}}catch(e){t={error:e}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return __assign({},this.identity)},e.prototype.setIdentity=function(e){var t=__assign({},this.identity);this.identity=__assign({},e),isEqual(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}(),safeGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,AnalyticsConnector=function(){function e(){this.identityStore=new IdentityStoreImpl,this.eventBridge=new EventBridgeImpl,this.applicationContextProvider=new ApplicationContextProviderImpl}return e.getInstance=function(t){return safeGlobal.analyticsConnectorInstances||(safeGlobal.analyticsConnectorInstances={}),safeGlobal.analyticsConnectorInstances[t]||(safeGlobal.analyticsConnectorInstances[t]=new e),safeGlobal.analyticsConnectorInstances[t]},e}(),getAnalyticsConnector=function(e){return void 0===e&&(e=DEFAULT_INSTANCE_NAME),AnalyticsConnector.getInstance(e)},setConnectorUserId=function(e,t){getAnalyticsConnector(t).identityStore.editIdentity().setUserId(e).commit()},setConnectorDeviceId=function(e,t){getAnalyticsConnector(t).identityStore.editIdentity().setDeviceId(e).commit()},IdentityEventSender=function(){function e(){this.name="identity",this.type="before",this.identityStore=getAnalyticsConnector().identityStore}return e.prototype.execute=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return e.instanceName&&(this.identityStore=getAnalyticsConnector(e.instanceName).identityStore),[2]}))}))},e}(),isNewSession=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},getCookieName=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[AMPLITUDE_PREFIX,t,e.substring(0,r)].filter(Boolean).join("_")},getOldCookieName=function(e){return"".concat(AMPLITUDE_PREFIX.toLowerCase(),"_").concat(e.substring(0,6))},getLanguage=function(){var e,t,r,n;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(n=null!==(r=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==r?r:i)&&void 0!==n?n:""},getQueryParams=function(){var e,t=getGlobalScope$1();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 r=t.split("=",2),n=tryDecodeURIComponent(r[0]),i=tryDecodeURIComponent(r[1]);return i?(e[n]=i,e):e}),{}):{}},tryDecodeURIComponent=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},isUrlMatchAllowlist=function(e,t){return!t||!t.length||t.some((function(t){return"string"==typeof t?e===t:e.match(t)}))},getDecodeURI=function(e,t){var r=e;try{r=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return r},generateHashCode=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t|=0}return t},isTimestampInSampleTemp=function(e,t){var r=generateHashCode(e.toString());return 31*Math.abs(r)%1e5/1e5<t},MemoryStorage=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.get(e)];case 1:return[2,(t=r.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),CookieStorage=function(){function e(e,t){void 0===t&&(t={}),this.options=__assign$1({},e),this.config=t}return e.prototype.isEnabled=function(){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i;return __generator(this,(function(a){switch(a.label){case 0:if(!getGlobalScope$1())return[2,!1];t=String(Date.now()),r=__assign$1(__assign$1({},this.options),{expirationDays:.003}),n=new e(r),i="AMP_TEST_".concat(UUID().substring(0,8)),a.label=1;case 1:return a.trys.push([1,4,5,7]),[4,n.set(i,t)];case 2:return a.sent(),[4,n.get(i)];case 3:return[2,a.sent()===t];case 4:return a.sent(),[2,!1];case 5:return[4,n.remove(i)];case 6:return a.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){switch(n.label){case 0:return[4,this.getRaw(e)];case 1:if(!(t=n.sent()))return[2,void 0];try{return void 0===(r=decodeCookieValue(t))?(console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)),[2,void 0]):[2,JSON.parse(r)]}catch(r){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,r,n,i;return __awaiter(this,void 0,void 0,(function(){var a,o,s,l,c,d,u,p,h,f,m,g,v=this;return __generator(this,(function(y){switch(y.label){case 0:a=getGlobalScope$1(),o=a,y.label=1;case 1:return y.trys.push([1,4,,5]),(s=null==o?void 0:o.cookieStore)?[4,s.getAll(e)]:[3,3];case 2:if(l=y.sent()){l.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:l.map((function(e){return e.domain}))}),null===(r=this.config.diagnosticsClient)||void 0===r||r.increment("cookies.duplicate.occurrence.cookieStore"));try{for(c=__values$1(l),d=c.next();!d.done;d=c.next())if(u=d.value,isDomainEqual(u.domain,this.options.domain))return[2,u.value]}catch(e){m={error:e}}finally{try{d&&!d.done&&(g=c.return)&&g.call(c)}finally{if(m)throw m.error}}}y.label=3;case 3:return[3,5];case 4:return y.sent(),[3,5];case 5:return p=(null!==(i=null===(n=null==a?void 0:a.document)||void 0===n?void 0:n.cookie.split("; "))&&void 0!==i?i:[]).filter((function(t){return 0===t.indexOf(e+"=")})),h=void 0,"function"==typeof(f=this.config.duplicateResolverFn)&&p.length>1&&(h=p.find((function(t){var r;try{var n=f(t.substring(e.length+1));return n||null===(r=v.config.diagnosticsClient)||void 0===r||r.increment("cookies.duplicate.occurrence.document.cookie"),n}catch(e){return!1}}))),h||(h=p[0]),h?[2,h.substring(e.length+1)]:[2,void 0]}}))}))},e.prototype.set=function(e,t){var r;return __awaiter(this,void 0,void 0,(function(){var n,i,a,o,s,l,c;return __generator(this,(function(d){try{n=null!==(r=this.options.expirationDays)&&void 0!==r?r:0,a=void 0,(i=null!==t?n:-1)&&((o=new Date).setTime(o.getTime()+24*i*60*60*1e3),a=o),s="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t)))),a&&(s+="; expires=".concat(a.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)),(l=getGlobalScope$1())&&(l.document.cookie=s)}catch(t){c=t instanceof Error?t.message:String(t),console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}return[2]}))}))},e.prototype.remove=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(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 __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2]}))}))},e}(),decodeCookiesAsDefault=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},decodeCookiesWithDoubleUrlEncoding=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},decodeCookieValue=function(e){var t;return null!==(t=decodeCookiesAsDefault(e))&&void 0!==t?t:decodeCookiesWithDoubleUrlEncoding(e)},isDomainEqual=function(e,t){if(!e||!t)return!1;var r=e.startsWith(".")?e.substring(1):e,n=t.startsWith(".")?t.substring(1):t;return r.toLowerCase()===n.toLowerCase()},getStorageKey=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[AMPLITUDE_PREFIX,t,e.substring(0,r)].filter(Boolean).join("_")},BrowserStorage=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return i.sent(),[4,r.get(n)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=r.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return r.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 __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var r;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){try{null===(r=this.storage)||void 0===r||r.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]}))}))},e}(),MAX_PERSISTENT_STORAGE_EVENTS_COUNT=10,DB_VERSION=1,TABLE_NAMES={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},INTERNAL_KEYS={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},DiagnosticsStorage=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=getGlobalScope$1())||void 0===e?void 0:e.indexedDB)},e.prototype.getDB=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(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,r){var n=indexedDB.open(e.dbName,DB_VERSION);n.onerror=function(){e.dbPromise=null,r(new Error("Failed to open IndexedDB"))},n.onsuccess=function(){var r=n.result;r.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},r.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),r.close()},t(r)},n.onupgradeneeded=function(t){var r=t.target.result;e.createTables(r)}}))},e.prototype.createTables=function(e){(e.objectStoreNames.contains(TABLE_NAMES.TAGS)||e.createObjectStore(TABLE_NAMES.TAGS,{keyPath:"key"}),e.objectStoreNames.contains(TABLE_NAMES.COUNTERS)||e.createObjectStore(TABLE_NAMES.COUNTERS,{keyPath:"key"}),e.objectStoreNames.contains(TABLE_NAMES.HISTOGRAMS)||e.createObjectStore(TABLE_NAMES.HISTOGRAMS,{keyPath:"key"}),e.objectStoreNames.contains(TABLE_NAMES.EVENTS))||e.createObjectStore(TABLE_NAMES.EVENTS,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains(TABLE_NAMES.INTERNAL)||e.createObjectStore(TABLE_NAMES.INTERNAL,{keyPath:"key"})},e.prototype.setTags=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a=this;return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([TABLE_NAMES.TAGS],"readwrite"),n=r.objectStore(TABLE_NAMES.TAGS),[2,new Promise((function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){a.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},i.forEach((function(e){var t=__read$1(e,2),r=t[0],i=t[1];n.put({key:r,value:i}).onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to set tag",r,i,e)}}))}))];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",i),[3,3];case 3:return[2]}}))}))},e.prototype.incrementCounters=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a=this;return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([TABLE_NAMES.COUNTERS],"readwrite"),n=r.objectStore(TABLE_NAMES.COUNTERS),[2,new Promise((function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){a.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},i.forEach((function(e){var t=__read$1(e,2),r=t[0],i=t[1],o=n.get(r);o.onsuccess=function(){var e=o.result,t=e?e.value:0;n.put({key:r,value:t+i}).onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to update counter",r,e)}},o.onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to read existing counter",r,e)}}))}))];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",i),[3,3];case 3:return[2]}}))}))},e.prototype.setHistogramStats=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a=this;return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([TABLE_NAMES.HISTOGRAMS],"readwrite"),n=r.objectStore(TABLE_NAMES.HISTOGRAMS),[2,new Promise((function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){a.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),t()},i.forEach((function(e){var t=__read$1(e,2),r=t[0],i=t[1],o=n.get(r);o.onsuccess=function(){var e,t=o.result;e=t?{key:r,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:r,count:i.count,min:i.min,max:i.max,sum:i.sum},n.put(e).onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r,e)}},o.onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",r,e)}}))}))];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",i),[3,3];case 3:return[2]}}))}))},e.prototype.addEventRecords=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a=this;return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===e.length?[2]:[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([TABLE_NAMES.EVENTS],"readwrite"),n=r.objectStore(TABLE_NAMES.EVENTS),[2,new Promise((function(t){r.oncomplete=function(){t()},r.onabort=function(e){a.logger.debug("DiagnosticsStorage: Failed to add event records",e),t()};var i=n.count();i.onsuccess=function(){var t=i.result,r=Math.max(0,MAX_PERSISTENT_STORAGE_EVENTS_COUNT-t);r<e.length&&a.logger.debug("DiagnosticsStorage: Only added ".concat(r," of ").concat(e.length," events due to storage limit")),e.slice(0,r).forEach((function(e){n.add(e).onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to add event record",e)}}))},i.onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}}))];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",i),[3,3];case 3:return[2]}}))}))},e.prototype.setInternal=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,a;return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=o.sent(),n=r.transaction([TABLE_NAMES.INTERNAL],"readwrite"),i=n.objectStore(TABLE_NAMES.INTERNAL),[2,new Promise((function(r,a){n.onabort=function(){return a(new Error("Failed to set internal value"))};var o=i.put({key:e,value:t});o.onsuccess=function(){return r()},o.onerror=function(){return a(new Error("Failed to set internal value"))}}))];case 2:return a=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",a),[3,3];case 3:return[2]}}))}))},e.prototype.getInternal=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i;return __generator(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.getDB()];case 1:return t=a.sent(),r=t.transaction([TABLE_NAMES.INTERNAL],"readonly"),n=r.objectStore(TABLE_NAMES.INTERNAL),[2,new Promise((function(t,i){r.onabort=function(){return i(new Error("Failed to get internal value"))};var a=n.get(e);a.onsuccess=function(){return t(a.result)},a.onerror=function(){return i(new Error("Failed to get internal value"))}}))];case 2:return i=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",i),[2,void 0];case 3:return[2]}}))}))},e.prototype.getLastFlushTimestamp=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(INTERNAL_KEYS.LAST_FLUSH_TIMESTAMP)];case 1:return[2,(e=r.sent())?parseInt(e.value,10):void 0];case 2:return t=r.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 __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.setInternal(INTERNAL_KEYS.LAST_FLUSH_TIMESTAMP,e.toString())];case 1:return r.sent(),[3,3];case 2:return t=r.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(r,n){var i=e.objectStore(t).clear();i.onsuccess=function(){return r()},i.onerror=function(){return n(new Error("Failed to clear table ".concat(t)))}}))},e.prototype.getAllAndClear=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,i,a,o,s;return __generator(this,(function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=l.sent(),t=e.transaction([TABLE_NAMES.TAGS,TABLE_NAMES.COUNTERS,TABLE_NAMES.HISTOGRAMS,TABLE_NAMES.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(t,TABLE_NAMES.TAGS),this.getAllFromStore(t,TABLE_NAMES.COUNTERS),this.getAllFromStore(t,TABLE_NAMES.HISTOGRAMS),this.getAllFromStore(t,TABLE_NAMES.EVENTS)])];case 2:return r=__read$1.apply(void 0,[l.sent(),4]),n=r[0],i=r[1],a=r[2],o=r[3],[4,Promise.all([this.clearTable(t,TABLE_NAMES.COUNTERS),this.clearTable(t,TABLE_NAMES.HISTOGRAMS),this.clearTable(t,TABLE_NAMES.EVENTS)])];case 3:return l.sent(),[2,{tags:n,counters:i,histogramStats:a,events:o}];case 4:return s=l.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(r,n){var i=e.objectStore(t).getAll();i.onsuccess=function(){return r(i.result)},i.onerror=function(){return n(new Error("Failed to get all from ".concat(t)))}}))},e}(),GLOBAL_KEY="__AMPLITUDE_SCRIPT_URL__",EVENT_NAME_ERROR_UNCAUGHT="sdk.error.uncaught",getNormalizedScriptUrls=function(){var e=getGlobalScope$1();if(!e)return[];var t=e[GLOBAL_KEY];return Array.isArray(t)?t:"string"==typeof t?[t]:[]},enableSdkErrorListeners=function(e){var t=getGlobalScope$1();if(t&&"function"==typeof t.addEventListener){var r=function(t){e.recordEvent(EVENT_NAME_ERROR_UNCAUGHT,__assign$1({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,n=null==t?void 0:t.stack,i=detectSdkOrigin({filename:e.filename,stack:n});i&&r({type:"error",message:e.message,stack:n,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,n=e.reason instanceof Error?e.reason:void 0,i=null==n?void 0:n.stack,a=extractFilenameFromStack(i),o=detectSdkOrigin({filename:a,stack:i});o&&r({type:"unhandledrejection",message:null!==(t=null==n?void 0:n.message)&&void 0!==t?t:stringifyReason(e.reason),stack:i,filename:a,errorName:null==n?void 0:n.name,metadata:{isTrusted:e.isTrusted,matchReason:o}})}),!0)}},detectSdkOrigin=function(e){var t,r,n=getNormalizedScriptUrls();if(0!==n.length)try{for(var i=__values$1(n),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.filename&&e.filename.includes(o))return"filename";if(e.stack&&e.stack.includes(o))return"stack"}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},extractFilenameFromStack=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},stringifyReason=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},SAVE_INTERVAL_MS=1e3,FLUSH_INTERVAL_MS=3e5,DIAGNOSTICS_US_SERVER_URL="https://diagnostics.prod.us-west-2.amplitude.com/v1/capture",DIAGNOSTICS_EU_SERVER_URL="https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",MAX_MEMORY_STORAGE_COUNT=1e4,MAX_MEMORY_STORAGE_EVENTS_COUNT=10,DiagnosticsClient=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===r?DIAGNOSTICS_US_SERVER_URL:DIAGNOSTICS_EU_SERVER_URL,this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(n,null,2)),this.config=__assign$1({enabled:!0,sampleRate:0},n),this.startTimestamp=Date.now(),this.shouldTrack=isTimestampInSampleTemp(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,DiagnosticsStorage.isSupported()?this.storage=new DiagnosticsStorage(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),enableSdkErrorListeners(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>=MAX_MEMORY_STORAGE_COUNT?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>=MAX_MEMORY_STORAGE_COUNT?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>=MAX_MEMORY_STORAGE_COUNT)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var r=this.inMemoryHistograms[e];r?(r.count+=1,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.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>=MAX_MEMORY_STORAGE_EVENTS_COUNT?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}))}),SAVE_INTERVAL_MS)),this.flushTimer||(this.flushTimer=setTimeout((function(){e._flush().catch((function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)})).finally((function(){e.flushTimer=null}))}),FLUSH_INTERVAL_MS))},e.prototype.saveAllDataToStorage=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(i){switch(i.label){case 0:return this.storage?(e=__assign$1({},this.inMemoryTags),t=__assign$1({},this.inMemoryCounters),r=__assign$1({},this.inMemoryHistograms),n=__spreadArray([],__read$1(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(r),this.storage.addEventRecords(n)])]):[2];case 1:return i.sent(),[2]}}))}))},e.prototype._flush=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,i,a,o,s,l,c;return __generator(this,(function(d){switch(d.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return d.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=d.sent(),t=e.tags,r=e.counters,n=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),a={},t.forEach((function(e){a[e.key]=e.value})),o={},r.forEach((function(e){o[e.key]=e.value})),s={},n.forEach((function(e){s[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}})),l=i.map((function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}})),0===Object.keys(o).length&&0===Object.keys(s).length&&0===l.length?[2]:(c={tags:a,histogram:s,counters:o,events:l},this.fetch(c),[2])}}))}))},e.prototype.fetch=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!getGlobalScope$1())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 r.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=r.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}}))}))},e.prototype.initializeFlushInterval=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r;return __generator(this,(function(n){switch(n.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return-1===(t=n.sent()||-1)?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(FLUSH_INTERVAL_MS),[2]):(r=e-t)>=FLUSH_INTERVAL_MS?(this._flush(),[2]):(this._setFlushTimer(FLUSH_INTERVAL_MS-r),[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=isTimestampInSampleTemp(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),BaseTransport=function(){function e(){}return e.prototype.send=function(e,t){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,i,a,o,s,l,c,d,u,p,h,f,m,g,v,y,b,E,_,S;if("object"!=typeof e)return null;var T=e.code||0,x=this.buildStatus(T);switch(x){case Status.Success:return{status:x,statusCode:T,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case Status.Invalid:return{status:x,statusCode:T,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(a=e.missing_field)&&void 0!==a?a:"",eventsWithInvalidFields:null!==(o=e.events_with_invalid_fields)&&void 0!==o?o:{},eventsWithMissingFields:null!==(s=e.events_with_missing_fields)&&void 0!==s?s:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(d=e.exceeded_daily_quota_devices)&&void 0!==d?d:{},silencedDevices:null!==(u=e.silenced_devices)&&void 0!==u?u:[],silencedEvents:null!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(h=e.throttled_devices)&&void 0!==h?h:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case Status.PayloadTooLarge:return{status:x,statusCode:T,body:{error:null!==(m=e.error)&&void 0!==m?m:""}};case Status.RateLimit:return{status:x,statusCode:T,body:{error:null!==(g=e.error)&&void 0!==g?g:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(E=e.exceeded_daily_quota_devices)&&void 0!==E?E:{},exceededDailyQuotaUsers:null!==(_=e.exceeded_daily_quota_users)&&void 0!==_?_:{},throttledEvents:null!==(S=e.throttled_events)&&void 0!==S?S:[]}};case Status.Timeout:default:return{status:x,statusCode:T}}},e.prototype.buildStatus=function(e){return isSuccessStatusCode(e)?Status.Success:429===e?Status.RateLimit:413===e?Status.PayloadTooLarge:408===e?Status.Timeout:e>=400&&e<500?Status.Invalid:e>=500?Status.Failed:Status.Unknown},e}(),FetchTransport=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return __extends(t,e),t.prototype.send=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(a){switch(a.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return r={headers:__assign$1({"Content-Type":"application/json",Accept:"*/*"},this.customHeaders),body:JSON.stringify(t),method:"POST"},[4,fetch(e,r)];case 1:return[4,(n=a.sent()).text()];case 2:i=a.sent();try{return[2,this.buildResponse(JSON.parse(i))]}catch(e){return[2,this.buildResponse({code:n.status})]}return[2]}}))}))},t}(BaseTransport),RemoteConfigLocalStorage=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 r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.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}(),US_SERVER_URL="https://sr-client-cfg.amplitude.com/config",EU_SERVER_URL="https://sr-client-cfg.eu.amplitude.com/config",DEFAULT_MAX_RETRIES=3,DEFAULT_TIMEOUT=1e3,DEFAULT_MIN_TIME_BETWEEN_FETCHES=3e5,RemoteConfigClient=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.apiKey=e,this.serverUrl=n||("US"===r?US_SERVER_URL:EU_SERVER_URL),this.logger=t,this.storage=new RemoteConfigLocalStorage(e,t)}return e.prototype.subscribe=function(e,t,r){var n=UUID(),i={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),n},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 __awaiter(this,void 0,void 0,(function(){var e,t=this;return __generator(this,(function(r){switch(r.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<DEFAULT_MIN_TIME_BETWEEN_FETCHES?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach((function(r){t.sendCallback(r,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 __awaiter(this,void 0,void 0,(function(){var t,r,n,i=this;return __generator(this,(function(a){switch(a.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)})),r=this.storage.fetchConfig().then((function(e){return e})),[4,Promise.race([t,r])];case 1:return void 0!==(n=a.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return a.sent(),[2]}}))}))},e.prototype.subscribeWaitForRemote=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:r=new Promise((function(e,r){setTimeout((function(){r("Timeout exceeded")}),t)})),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[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!==(n=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}}))}))},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=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(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=DEFAULT_MAX_RETRIES),void 0===t&&(t=DEFAULT_TIMEOUT),__awaiter(this,void 0,void 0,(function(){var r,n,i,a,o,s,l=this;return __generator(this,(function(c){switch(c.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},i=function(n){var i,o,s,c,d;return __generator(this,(function(u){switch(u.label){case 0:i=new AbortController,o=setTimeout((function(){return i.abort()}),t),u.label=1;case 1:return u.trys.push([1,7,8,9]),[4,fetch(a.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:i.signal})];case 2:return(s=u.sent()).ok?[3,4]:[4,s.text()];case 3:return c=u.sent(),a.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(s.status,": ").concat(c)),[3,6];case 4:return[4,s.json()];case 5:return[2,{value:{remoteConfig:u.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(d=u.sent())instanceof Error&&"AbortError"===d.name?a.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):a.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),d),[3,9];case 8:return clearTimeout(o),[7];case 9:return n<e-1?[4,new Promise((function(e){return setTimeout(e,l.getJitterDelay(r))}))]:[3,11];case 10:u.sent(),u.label=11;case 11:return[2]}}))},a=this,o=0,c.label=1;case 1:return o<e?[5,i(o)]:[3,4];case 2:if("object"==typeof(s=c.sent()))return[2,s.value];c.label=3;case 3:return o++,[3,1];case 4:return[2,n]}}))}))},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}(),globalScope$1=getGlobalScope$1(),originalConsole=null==globalScope$1?void 0:globalScope$1.console,handlers$1={},originalFn={},inConsoleOverride=!1;function overrideConsole(e){if(!originalConsole)return!1;if("function"!=typeof originalConsole[e])return!1;if(originalFn[e])return!0;return originalFn[e]=originalConsole[e],originalConsole[e]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if(handlers$1[e]&&!inConsoleOverride){inConsoleOverride=!0;var n=handlers$1[e];n&&n.forEach((function(r){try{r(e,t)}catch(e){}}))}}catch(e){}return inConsoleOverride=!1,originalFn[e].apply(originalConsole,t)},!0}function addListener(e,t){if(!overrideConsole(e))return new Error("Console override failed");handlers$1[e]?handlers$1[e].push(t):handlers$1[e]=[t]}function removeListener(e){var t,r;try{for(var n=__values$1(Object.values(handlers$1)),i=n.next();!i.done;i=n.next())for(var a=i.value,o=a.length-1;o>=0;o--)if(a[o]===e){a.splice(o,1);break}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}function _restoreConsole(){var e,t;try{for(var r=__values$1(Object.entries(originalFn)),n=r.next();!n.done;n=r.next()){var i=__read$1(n.value,2),a=i[0],o=i[1];o&&(originalConsole[a]=o)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}originalFn={},handlers$1={}}var consoleObserver={addListener:addListener,removeListener:removeListener,_restoreConsole:_restoreConsole},ServerZone;!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(ServerZone||(ServerZone={}));var OfflineDisabled=null,DEFAULT_CSS_SELECTOR_ALLOWLIST=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],DEFAULT_DATA_ATTRIBUTE_PREFIX="data-amp-track-",DEFAULT_ACTION_CLICK_ALLOWLIST=["div","span","h1","h2","h3","h4","h5","h6"],CLICKABLE_ELEMENT_SELECTORS=["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]'],DEFAULT_ERROR_AND_DEAD_CLICK_ALLOWLIST=__spreadArray(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],__read$1(CLICKABLE_ELEMENT_SELECTORS),!1),DEFAULT_DEAD_CLICK_ALLOWLIST=DEFAULT_ERROR_AND_DEAD_CLICK_ALLOWLIST,DEFAULT_ERROR_CLICK_ALLOWLIST=DEFAULT_ERROR_AND_DEAD_CLICK_ALLOWLIST,DEFAULT_RAGE_CLICK_ALLOWLIST=["*"],DEFAULT_RAGE_CLICK_WINDOW_MS=1e3,DEFAULT_RAGE_CLICK_THRESHOLD=4,DEFAULT_RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD=50;function isJsonPrimitive(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function pruneJson(e,t,r){e&&_pruneJson({json:e,allowlist:t.map(tokenizeJsonPath),excludelist:r.map(tokenizeJsonPath),ancestors:[]})}function _pruneJson(e){var t,r,n=e.json,i=e.targetObject,a=e.allowlist,o=e.excludelist,s=e.ancestors,l=e.parentObject,c=e.targetKey;i||(i=n);var d=Object.keys(i);try{for(var u=__values$1(d),p=u.next();!p.done;p=u.next()){var h=p.value,f=__spreadArray(__spreadArray([],__read$1(s),!1),[h],!1);isJsonPrimitive(i[h])?hasPathMatchInList(f,a)&&!hasPathMatchInList(f,o)||delete i[h]:_pruneJson({json:n,targetObject:i[h],allowlist:a,excludelist:o,ancestors:f,parentObject:i,targetKey:h})}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}0===Object.keys(i).length&&l&&c&&delete l[c]}function tokenizeJsonPath(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map((function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")}))}function isPathMatch(e,t,r,n){if(void 0===r&&(r=0),void 0===n&&(n=0),n===t.length)return r===e.length;if(r===e.length){for(;n<t.length&&"**"===t[n];)n++;return n===t.length}var i=t[n];if("**"===i){if(n+1===t.length)return!0;for(var a=r;a<=e.length;a++)if(isPathMatch(e,t,a,n+1))return!0;return!1}return("*"===i||i===e[r])&&isPathMatch(e,t,r+1,n+1)}function hasPathMatchInList(e,t){return t.some((function(t){return isPathMatch(e,t)}))}var TEXT_READ_TIMEOUT=500,MAXIMUM_ENTRIES=100,RequestWrapperFetch=function(){function e(e){this.request=e}return e.prototype.headers=function(e){var t,r;void 0===e&&(e=[]);var n=this.request.headers,i={};if(Array.isArray(n))n.forEach((function(e){var t=__read$1(e,2),r=t[0],n=t[1];i[r]=n}));else if(n instanceof Headers)n.forEach((function(e,t){i[t]=e}));else if("object"==typeof n&&null!==n)try{for(var a=__values$1(Object.entries(n)),o=a.next();!o.done;o=a.next()){var s=__read$1(o.value,2),l=s[0],c=s[1];i[l]=c}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return pruneHeaders(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=getGlobalScope$1();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=getBodySize(t,MAXIMUM_ENTRIES),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=[]),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return 0===e.length?[2,null]:[2,safeParseAndPruneBody(this.body,e,t)]}))}))},e}(),RequestWrapperXhr=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),pruneHeaders(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return getBodySize(this.bodyRaw,MAXIMUM_ENTRIES)},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=[]),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return 0===e.length?[2,null]:[2,safeParseAndPruneBody(this.body,e,t)]}))}))},e}();function getBodySize(e,t){var r,n,i,a=getGlobalScope$1(),o=null==a?void 0:a.TextEncoder;if(o){var s;if("string"==typeof e)s=e,i=(new o).encode(s).length;else if(e instanceof Blob)i=(s=e).size;else if(e instanceof URLSearchParams)s=e,i=(new o).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 l=e,c=0,d=0;try{for(var u=__values$1(l.entries()),p=u.next();!p.done;p=u.next()){var h=__read$1(p.value,2),f=h[0],m=h[1];if(c+=f.length,"string"==typeof m)c+=(new o).encode(m).length;else{if(!(m instanceof Blob))return;c+=m.size}if(++d>=t)return}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}i=c}else if(e instanceof ReadableStream)return void(s=e);return i}}var ResponseWrapperFetch=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 r=this.response.headers,n={};return null===(t=null==r?void 0:r.forEach)||void 0===t||t.call(r,(function(e,t){n[t]=e})),pruneHeaders(n,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var e,t;if(void 0!==this._bodySize)return this._bodySize;var r=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),n=r?parseInt(r,10):void 0;return this._bodySize=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),r.label=1;case 1:return r.trys.push([1,3,,4]),e=this.clonedResponse.text(),t=new Promise((function(e){return setTimeout((function(){return e(null)}),TEXT_READ_TIMEOUT)})),[4,Promise.race([e,t])];case 2:return[2,r.sent()];case 3:return r.sent(),[2,null];case 4:return[2]}}))}))},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return 0===e.length?[2,null]:[4,this.text()];case 1:return[2,safeParseAndPruneBody(r.sent(),e,t)]}}))}))},e}(),ResponseWrapperXhr=function(){function e(e,t,r,n){this.statusCode=e,this.headersString=t,this.size=r,this.getJson=n}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,r;if(void 0===e&&(e=[]),!this.headersString)return{};var n={},i=this.headersString.split("\r\n");try{for(var a=__values$1(i),o=a.next();!o.done;o=a.next()){var s=__read$1(o.value.split(": "),2),l=s[0],c=s[1];l&&c&&(n[l]=c)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return pruneHeaders(n,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),__awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){return 0===e.length?[2,null]:(r=this.getJson())?(pruneJson(r,e,t),[2,r]):[2,null]}))}))},e}(),PRUNE_STRATEGY;function safeParseAndPruneBody(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return pruneJson(n,t,r),n}catch(e){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(PRUNE_STRATEGY||(PRUNE_STRATEGY={}));var REDACTED_VALUE="[REDACTED]",pruneHeaders=function(e,t){var r,n,i=t.allow,a=void 0===i?[]:i,o=t.strategy,s=void 0===o?PRUNE_STRATEGY.REMOVE:o,l=__spreadArray([],__read$1(FORBIDDEN_HEADERS),!1),c={},d=function(t){var r=t.toLowerCase();l.find((function(e){return e.toLowerCase()===r}))?s===PRUNE_STRATEGY.REDACT&&(c[t]=REDACTED_VALUE):a.find((function(e){return e.toLowerCase()===r}))?c[t]=e[t]:s===PRUNE_STRATEGY.REDACT&&(c[t]=REDACTED_VALUE)};try{for(var u=__values$1(Object.keys(e)),p=u.next();!p.done;p=u.next()){d(p.value)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return c},NetworkRequestEvent=function(){function e(e,t,r,n,i,a,o,s,l,c,d){void 0===o&&(o=0),this.type=e,this.method=t,this.timestamp=r,this.startTime=n,this.url=i,this.requestWrapper=a,this.status=o,this.duration=s,this.responseWrapper=l,this.error=c,this.endTime=d}return e.prototype.toSerializable=function(){var e,t,r,n,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(__spreadArray([],__read$1(SAFE_HEADERS),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(r=this.responseWrapper)||void 0===r?void 0:r.headers(__spreadArray([],__read$1(SAFE_HEADERS),!1)),responseBodySize:null===(n=this.responseWrapper)||void 0===n?void 0:n.bodySize};return Object.fromEntries(Object.entries(i).filter((function(e){var t=__read$1(e,2);return t[0],void 0!==t[1]})))},e}();function isRequest$1(e){return"object"==typeof e&&null!==e&&"url"in e&&"method"in e}var NetworkEventCallback=function(e,t){void 0===t&&(t=UUID()),this.callback=e,this.id=t};function safeInvoke(e){try{e()}catch(e){}}var NetworkObserver=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=getGlobalScope$1();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=getGlobalScope$1();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var r,n,i,a,o,s,l,c,d,u;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var p=null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.XMLHttpRequest)||void 0===n?void 0:n.prototype)||void 0===i?void 0:i.open,h=null===(s=null===(o=null===(a=this.globalScope)||void 0===a?void 0:a.XMLHttpRequest)||void 0===o?void 0:o.prototype)||void 0===s?void 0:s.send,f=null===(d=null===(c=null===(l=this.globalScope)||void 0===l?void 0:l.XMLHttpRequest)||void 0===c?void 0:c.prototype)||void 0===d?void 0:d.setRequestHeader;p&&h&&f&&this.observeXhr(p,h,f);var m=null===(u=this.globalScope)||void 0===u?void 0:u.fetch;m&&this.observeFetch(m),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(r){try{r.callback(e)}catch(e){safeInvoke((function(){var r;null===(r=t.logger)||void 0===r||r.debug("an unexpected error occurred while triggering event callbacks",e)}))}}))},e.prototype.handleNetworkRequestEvent=function(e,t,r,n,i,a,o){var s;if(void 0!==a&&void 0!==o){var l,c,d,u="GET";if(isRequest$1(t)?(l=t.url,u=t.method):l=null===(s=null==t?void 0:t.toString)||void 0===s?void 0:s.call(t),l)try{var p=new URL(l);l="".concat(p.protocol,"//").concat(p.host).concat(p.pathname).concat(p.search).concat(p.hash)}catch(e){}u=(null==r?void 0:r.method)||u,n&&(c=n.status),i&&(d={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},c=0);var h=Math.floor(performance.now()-o),f=Math.floor(a+h),m=new NetworkRequestEvent(e,u,a,a,l,r,c,h,n,d,f);this.triggerEventCallbacks(m)}},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(r,n){return __awaiter(t,void 0,void 0,(function(){var t,i,a,o,s=this;return __generator(this,(function(l){switch(l.label){case 0:try{t=this.getTimestamps()}catch(e){safeInvoke((function(){var t;return null===(t=s.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)}))}l.label=1;case 1:return l.trys.push([1,3,,4]),[4,e(r,n)];case 2:return i=l.sent(),[3,4];case 3:return o=l.sent(),a=o,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,n?new RequestWrapperFetch(n):void 0,i?new ResponseWrapperFetch(i):void 0,a,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){safeInvoke((function(){var t;return null===(t=s.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling fetch",e)}))}if(i)return[2,i];throw a}}))}))})},e.createXhrJsonParser=function(e,t){return function(){var r;try{if("json"===e.responseType){if(null===(r=t.globalScope)||void 0===r?void 0:r.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(r){return r instanceof Error&&"InvalidStateError"===r.name&&safeInvoke((function(){var r;return null===(r=t.logger)||void 0===r?void 0:r.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))})),null}return null}},e.prototype.observeXhr=function(t,r,n){if(this.globalScope&&t&&r){var i=this.globalScope.XMLHttpRequest.prototype,a=this;i.open=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=__read$1(r,2),o=i[0],s=i[1];try{this.$$AmplitudeAnalyticsEvent=__assign$1({method:o,url:null===(e=null==s?void 0:s.toString)||void 0===e?void 0:e.call(s),headers:{}},a.getTimestamps())}catch(e){safeInvoke((function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr open",e)}))}return t.apply(this,r)},i.send=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=this,o=e.createXhrJsonParser(this,a),s=t[0],l=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",(function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),r=new ResponseWrapperXhr(i.status,e,t?parseInt(t,10):void 0,o),n=i.$$AmplitudeAnalyticsEvent.headers,c=new RequestWrapperXhr(s,n);l.status=i.status,a.handleNetworkRequestEvent("xhr",{url:l.url,method:l.method},c,r,void 0,l.startTime,l.durationStart)}catch(e){safeInvoke((function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling xhr send",e)}))}})),r.apply(i,t)},i.setRequestHeader=function(e,t){try{var r=this.$$AmplitudeAnalyticsEvent;r&&(r.headers[e]=t)}catch(e){safeInvoke((function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)}))}n.apply(this,[e,t])}}},e}(),networkObserver=new NetworkObserver,CampaignParser=function(){function e(){}return e.prototype.parse=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,__assign$1(__assign$1(__assign$1(__assign$1({},BASE_CAMPAIGN),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=getQueryParams();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,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=getQueryParams();return(e={})[DCLID]=t[DCLID],e[FBCLID]=t[FBCLID],e[GBRAID]=t[GBRAID],e[GCLID]=t[GCLID],e[KO_CLICK_ID]=t[KO_CLICK_ID],e[LI_FAT_ID]=t[LI_FAT_ID],e[MSCLKID]=t[MSCLKID],e[RDT_CID]=t[RDT_CID],e[TTCLID]=t[TTCLID],e[TWCLID]=t[TWCLID],e[WBRAID]=t[WBRAID],e},e}(),TEXT_MASK_ATTRIBUTE="data-amp-mask",MASKED_TEXT_VALUE="*****",CC_REGEX=/\b(?:\d[ -]*?){13,16}\b/,SSN_REGEX=/(\d{3}-?\d{2}-?\d{4})/g,EMAIL_REGEX=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,replaceSensitiveString=function(e,t){var r,n;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var i=e;i=(i=(i=i.replace(CC_REGEX,MASKED_TEXT_VALUE)).replace(SSN_REGEX,MASKED_TEXT_VALUE)).replace(EMAIL_REGEX,MASKED_TEXT_VALUE);try{for(var a=__values$1(t),o=a.next();!o.done;o=a.next()){var s=o.value;try{i=i.replace(s,MASKED_TEXT_VALUE)}catch(e){}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i},getPageTitle=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(TEXT_MASK_ATTRIBUTE)?MASKED_TEXT_VALUE:e?e(document.title):document.title};function _createForOfIteratorHelperLoose(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(r)return(r=r.call(e)).next.bind(r);if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t){r&&(e=r);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}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 _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _defineProperties(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function _createClass(e,t,r){return t&&_defineProperties(e.prototype,t),r&&_defineProperties(e,r),e}var hasSymbols=function(){return"function"==typeof Symbol},hasSymbol=function(e){return hasSymbols()&&Boolean(Symbol[e])},getSymbol=function(e){return hasSymbol(e)?Symbol[e]:"@@"+e};hasSymbols()&&!hasSymbol("observable")&&(Symbol.observable=Symbol("observable"));var SymbolIterator=getSymbol("iterator"),SymbolObservable=getSymbol("observable"),SymbolSpecies=getSymbol("species");function getMethod(e,t){var r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function getSpecies(e){var t=e.constructor;return void 0!==t&&null===(t=t[SymbolSpecies])&&(t=void 0),void 0!==t?t:Observable}function isObservable(e){return e instanceof Observable}function hostReportError(e){hostReportError.log?hostReportError.log(e):setTimeout((function(){throw e}))}function enqueue(e){Promise.resolve().then((function(){try{e()}catch(e){hostReportError(e)}}))}function cleanupSubscription(e){var t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{var r=getMethod(t,"unsubscribe");r&&r.call(t)}}catch(e){hostReportError(e)}}function closeSubscription(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function flushSubscription(e){var t=e._queue;if(t){e._queue=void 0,e._state="ready";for(var r=0;r<t.length&&(notifySubscription(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}function notifySubscription(e,t,r){e._state="running";var n=e._observer;try{var i=getMethod(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(closeSubscription(e),!i)throw r;i.call(n,r);break;case"complete":closeSubscription(e),i&&i.call(n)}}catch(e){hostReportError(e)}"closed"===e._state?cleanupSubscription(e):"running"===e._state&&(e._state="ready")}function onNotify(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void enqueue((function(){return flushSubscription(e)}))):void notifySubscription(e,t,r);e._queue.push({type:t,value:r})}}var Subscription=function(){function e(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";var r=new SubscriptionObserver(this);try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}return e.prototype.unsubscribe=function(){"closed"!==this._state&&(closeSubscription(this),cleanupSubscription(this))},_createClass(e,[{key:"closed",get:function(){return"closed"===this._state}}]),e}(),SubscriptionObserver=function(){function e(e){this._subscription=e}var t=e.prototype;return t.next=function(e){onNotify(this._subscription,"next",e)},t.error=function(e){onNotify(this._subscription,"error",e)},t.complete=function(){onNotify(this._subscription,"complete")},_createClass(e,[{key:"closed",get:function(){return"closed"===this._subscription._state}}]),e}(),Observable=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 Subscription(e,this._subscriber)},t.forEach=function(e){var t=this;return new Promise((function(r,n){if("function"==typeof e)var i=t.subscribe({next:function(t){try{e(t,a)}catch(e){n(e),i.unsubscribe()}},error:n,complete:r});else n(new TypeError(e+" is not a function"));function a(){i.unsubscribe(),r()}}))},t.map=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(getSpecies(this))((function(r){return t.subscribe({next:function(t){try{t=e(t)}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))},t.filter=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(getSpecies(this))((function(r){return t.subscribe({next:function(t){try{if(!e(t))return}catch(e){return r.error(e)}r.next(t)},error:function(e){r.error(e)},complete:function(){r.complete()}})}))},t.reduce=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=getSpecies(this),n=arguments.length>1,i=!1,a=arguments[1];return new r((function(r){return t.subscribe({next:function(t){var o=!i;if(i=!0,!o||n)try{a=e(a,t)}catch(e){return r.error(e)}else a=t},error:function(e){r.error(e)},complete:function(){if(!i&&!n)return r.error(new TypeError("Cannot reduce an empty sequence"));r.next(a),r.complete()}})}))},t.concat=function(){for(var e=this,t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];var i=getSpecies(this);return new i((function(t){var n,a=0;return function e(o){n=o.subscribe({next:function(e){t.next(e)},error:function(e){t.error(e)},complete:function(){a===r.length?(n=void 0,t.complete()):e(i.from(r[a++]))}})}(e),function(){n&&(n.unsubscribe(),n=void 0)}}))},t.flatMap=function(e){var t=this;if("function"!=typeof e)throw new TypeError(e+" is not a function");var r=getSpecies(this);return new r((function(n){var i=[],a=t.subscribe({next:function(t){if(e)try{t=e(t)}catch(e){return n.error(e)}var a=r.from(t).subscribe({next:function(e){n.next(e)},error:function(e){n.error(e)},complete:function(){var e=i.indexOf(a);e>=0&&i.splice(e,1),o()}});i.push(a)},error:function(e){n.error(e)},complete:function(){o()}});function o(){a.closed&&0===i.length&&n.complete()}return function(){i.forEach((function(e){return e.unsubscribe()})),a.unsubscribe()}}))},t[SymbolObservable]=function(){return this},e.from=function(t){var r="function"==typeof this?this:e;if(null==t)throw new TypeError(t+" is not an object");var n=getMethod(t,SymbolObservable);if(n){var i=n.call(t);if(Object(i)!==i)throw new TypeError(i+" is not an object");return isObservable(i)&&i.constructor===r?i:new r((function(e){return i.subscribe(e)}))}if(hasSymbol("iterator")&&(n=getMethod(t,SymbolIterator)))return new r((function(e){enqueue((function(){if(!e.closed){for(var r,i=_createForOfIteratorHelperLoose(n.call(t));!(r=i()).done;){var a=r.value;if(e.next(a),e.closed)return}e.complete()}}))}));if(Array.isArray(t))return new r((function(e){enqueue((function(){if(!e.closed){for(var r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")},e.of=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return new("function"==typeof this?this:e)((function(e){enqueue((function(){if(!e.closed){for(var t=0;t<r.length;++t)if(e.next(r[t]),e.closed)return;e.complete()}}))}))},_createClass(e,null,[{key:SymbolSpecies,get:function(){return this}}]),e}();function asyncMap(e,t){return new Observable((function(r){e.subscribe({next:function(e){t(e).then((function(e){return r.next(e)})).catch((function(e){return r.error(e)}))},error:function(e){r.error(e)},complete:function(){r.complete()}})}))}function merge$1(e,t){return new Observable((function(r){var n=!1,i=new Set,a=function(){var e,t;n=!0;try{for(var r=__values$1(i),a=r.next();!a.done;a=r.next()){var o=a.value;try{o.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.clear()},o=function(e){var t=e.subscribe({next:function(e){n||r.next(e)},error:function(e){n||(n=!0,r.error(e),a())},complete:function(){i.delete(t),n||0!==i.size||(r.complete(),a(),n=!0)}});i.add(t)};return o(e),o(t),a}))}function multicast(e){var t=new Set,r=null;function n(){null==r||r.unsubscribe(),r=null,t.clear()}return new Observable((function(i){return t.add(i),null===r&&(r=e.subscribe({next:function(e){var r,n,i;try{for(var a=__values$1(t),o=a.next();!o.done;o=a.next()){var s=o.value;null===(i=s.next)||void 0===i||i.call(s,e)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}},error:function(e){var r,i,a;try{for(var o=__values$1(t),s=o.next();!s.done;s=o.next()){var l=s.value;null===(a=l.error)||void 0===a||a.call(l,e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}n()},complete:function(){var e,r,i;try{for(var a=__values$1(t),o=a.next();!o.done;o=a.next()){var s=o.value;null===(i=s.complete)||void 0===i||i.call(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n()}})),function(){t.delete(i),0===t.size&&r&&(r.unsubscribe(),r=null)}}))}function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}hasSymbols()&&Object.defineProperty(Observable,Symbol("extensions"),{value:{symbol:SymbolObservable,hostReportError:hostReportError},configurable:!0});var safeJsonStringify$1={exports:{}},hasRequiredSafeJsonStringify;function requireSafeJsonStringify(){if(hasRequiredSafeJsonStringify)return safeJsonStringify$1.exports;hasRequiredSafeJsonStringify=1;var e=Object.prototype.hasOwnProperty;function t(e){return"[Throws: "+(e?e.message:"?")+"]"}function r(r){var n=[];return function r(i){if(null===i||"object"!=typeof i)return i;if(-1!==n.indexOf(i))return"[Circular]";if(n.push(i),"function"==typeof i.toJSON)try{var a=r(i.toJSON());return n.pop(),a}catch(e){return t(e)}if(Array.isArray(i)){var o=i.map(r);return n.pop(),o}var s=Object.keys(i).reduce((function(n,a){return n[a]=r(function(r,n){if(e.call(r,n))try{return r[n]}catch(e){return t(e)}return r[n]}(i,a)),n}),{});return n.pop(),s}(r)}return safeJsonStringify$1.exports=function(e,t,n){return JSON.stringify(r(e),t,n)},safeJsonStringify$1.exports.ensureProperties=r,safeJsonStringify$1.exports}var safeJsonStringifyExports=requireSafeJsonStringify(),index=getDefaultExportFromCjs(safeJsonStringifyExports),safeJsonStringifyModule=_mergeNamespaces({__proto__:null,default:index},[safeJsonStringifyExports]),safeJsonStringify=index||safeJsonStringifyModule,AMPLITUDE_ORIGIN="https://app.amplitude.com",AMPLITUDE_ORIGIN_EU="https://app.eu.amplitude.com",AMPLITUDE_ORIGIN_STAGING="https://apps.stag2.amplitude.com",AMPLITUDE_ORIGINS_MAP={US:AMPLITUDE_ORIGIN,EU:AMPLITUDE_ORIGIN_EU,STAGING:AMPLITUDE_ORIGIN_STAGING},AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL="https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.1.js.gz",asyncLoadScript=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise((function(t,r){var n;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(){r({status:!1,message:"Failed to load the script ".concat(e)})})),null===(n=document.head)||void 0===n||n.appendChild(i)}catch(e){r(e)}}))},_a;function generateUniqueId(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))}var MESSENGER_BRAND="__AMPLITUDE_MESSENGER_INSTANCE__",MESSENGER_GLOBAL_KEY="__AMPLITUDE_MESSENGER__",BaseWindowMessenger=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?AMPLITUDE_ORIGIN:t;this[_a]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=r}return e.prototype.notify=function(e){var t,r,n,i;null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===i||i.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var i=generateUniqueId(),a={id:i,action:e,args:t};return new Promise((function(t,o){n.requestCallbacks[i]={resolve:t,reject:o},n.notify(a),r.timeout>0&&setTimeout((function(){o(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete n.requestCallbacks[i]}),r.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 r,n,i,a;this.actionHandlers.has(e)&&(null===(a=null===(i=this.logger)||void 0===i?void 0:i.warn)||void 0===a||a.call(i,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var o=this.pendingMessages.get(e);if(o){this.pendingMessages.delete(e);try{for(var s=__values$1(o),l=s.next();!l.done;l=s.next()){t(l.value)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=asyncLoadScript(e).then((function(){})),this.scriptLoadPromises.set(e,r),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r];case 2:return i.sent(),[3,4];case 3:throw n=i.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}}))}))},e.prototype.setup=function(e){var t,r,n=this,i=void 0===e?{}:e,a=i.logger,o=i.endpoint;a&&(this.logger=a),o&&this.endpoint===AMPLITUDE_ORIGIN&&(this.endpoint=o),this.isSetup||(this.isSetup=!0,null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,r,i,a,o;if(null===(r=null===(t=n.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message received: ",JSON.stringify(e)),n.endpoint===e.origin){var s=e.data,l=null==s?void 0:s.action;if(l)if("id"in s&&s.id)null===(a=null===(i=n.logger)||void 0===i?void 0:i.debug)||void 0===a||a.call(i,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(s);else{if("ping"===l)return void n.notify({action:"pong"});var c=n.actionHandlers.get(l);if(c)c(s.data);else{var d=null!==(o=n.pendingMessages.get(l))&&void 0!==o?o:[];d.push(s.data),n.pendingMessages.set(l,d)}}}},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=getGlobalScope$1();(null==e?void 0:e[MESSENGER_GLOBAL_KEY])===this&&delete e[MESSENGER_GLOBAL_KEY]},e}();function isWindowMessenger(e){return"object"==typeof e&&null!==e&&MESSENGER_BRAND in e&&!0===e[MESSENGER_BRAND]}function getOrCreateWindowMessenger(e){var t=getGlobalScope$1(),r=null==t?void 0:t[MESSENGER_GLOBAL_KEY];if(isWindowMessenger(r))return r;var n=new BaseWindowMessenger(e);return t&&(t[MESSENGER_GLOBAL_KEY]=n),n}_a=MESSENGER_BRAND;var BG_CAPTURE_BRAND="__AMPLITUDE_BACKGROUND_CAPTURE__";function enableBackgroundCapture(e,t){var r=e;if(!0!==r[BG_CAPTURE_BRAND]){r[BG_CAPTURE_BRAND]=!0;var n=AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL,i=null,a=function(t,r){var n,i;"background-capture-complete"===t&&(null===(i=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===i||i.call(n,"Background capture complete"),e.notify({action:"background-capture-complete",data:r}))};e.registerActionHandler("initialize-background-capture",(function(){var t,r;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Initializing background capture (external script)");var o=new URL(n,e.endpoint).toString();e.loadScriptOnce(o).then((function(){var t,r,n;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Background capture script loaded (external)"),i=null===(n=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===n?void 0:n.call(window,{messenger:e,onBackgroundCapture:a}),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==i?void 0:i.close)||void 0===e||e.call(i),i=null}))}}var isTrackingEnabled=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},isAttributionTrackingEnabled=function(e){return isTrackingEnabled(e,"attribution")},isFileDownloadTrackingEnabled=function(e){return isTrackingEnabled(e,"fileDownloads")},isFormInteractionTrackingEnabled=function(e){return isTrackingEnabled(e,"formInteractions")},isPageViewTrackingEnabled=function(e){return isTrackingEnabled(e,"pageViews")},isSessionTrackingEnabled=function(e){return isTrackingEnabled(e,"sessions")},isPageUrlEnrichmentEnabled=function(e){return isTrackingEnabled(e,"pageUrlEnrichment")},isNetworkTrackingEnabled=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},isElementInteractionsEnabled=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},isWebVitalsEnabled=function(e){return"boolean"==typeof e?e:"object"==typeof e&&!0===e.webVitals},isFrustrationInteractionsEnabled=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},getElementInteractionsConfig=function(e){if(isElementInteractionsEnabled(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},getFrustrationInteractionsConfig=function(e){if(isFrustrationInteractionsEnabled(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},getNetworkTrackingConfig=function(e){var t;if(isNetworkTrackingEnabled(e.autocapture)){var r=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?r=e.autocapture.networkTracking:e.networkTrackingOptions&&(r=e.networkTrackingOptions),__assign$1(__assign$1({},r),{captureRules:null===(t=null==r?void 0:r.captureRules)||void 0===t?void 0:t.map((function(t){var r,n,i;if((null===(r=t.urls)||void 0===r?void 0:r.length)&&(null===(n=t.hosts)||void 0===n?void 0:n.length)){var a=JSON.stringify(t.hosts),o=JSON.stringify(t.urls);return null===(i=e.loggerProvider)||void 0===i||i.warn("Found network capture rule with both urls='".concat(o,"' and hosts='").concat(a,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),__assign$1(__assign$1({},t),{hosts:void 0})}return t}))})}},getPageViewTrackingConfig=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return isPageViewTrackingEnabled(e.defaultTracking)&&(r=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:r,trackHistoryChanges:n,eventType:t,pageCounter:i}},getAttributionTrackingConfig=function(e){return isAttributionTrackingEnabled(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.attribution&&"object"==typeof e.defaultTracking.attribution?__assign$1({},e.defaultTracking.attribution):{}},getFormInteractionsConfig=function(e){if(isFormInteractionTrackingEnabled(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions},runQueuedFunctions=function(e,t){convertProxyObjectToRealObject(e,t)},convertProxyObjectToRealObject=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.name,a=n.args,o=n.resolve,s=e&&e[i];if("function"==typeof s){var l=s.apply(e,a);"function"==typeof o&&o(null==l?void 0:l.promise)}}return e},isInstanceProxy=function(e){return e&&void 0!==e._q},VERSION$1="2.35.3",LIBPREFIX="amplitude-ts",BROWSER_PLATFORM="Web",IP_ADDRESS="$remote",Context=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(LIBPREFIX,"/").concat(VERSION$1),"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,r;return __awaiter(this,void 0,void 0,(function(){var n,i,a;return __generator(this,(function(o){return n=(new Date).getTime(),i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,a=null!==(r=e.event_id)&&void 0!==r?r:i+1,this.config.lastEventId=a,e.time||(this.config.lastEventTime=n),[2,__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:n},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:BROWSER_PLATFORM}),this.config.trackingOptions.language&&{language:getLanguage()}),this.config.trackingOptions.ipAddress&&{ip:IP_ADDRESS}),{insert_id:UUID(),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:a,library:this.library,user_agent:this.userAgent})]}))}))},e}(),MAX_ARRAY_LENGTH=1e3,LocalStorage=function(e){function t(t){var r,n,i,a=this;try{i=null===(r=getGlobalScope$1())||void 0===r?void 0:r.localStorage}catch(e){null===(n=null==t?void 0:t.loggerProvider)||void 0===n||n.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(a=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,a}return __extends(t,e),t.prototype.set=function(t,r){var n;return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(a){switch(a.label){case 0:return Array.isArray(r)&&r.length>MAX_ARRAY_LENGTH?(i=r.length-MAX_ARRAY_LENGTH,[4,e.prototype.set.call(this,t,r.slice(0,MAX_ARRAY_LENGTH))]):[3,2];case 1:return a.sent(),null===(n=this.loggerProvider)||void 0===n||n.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(MAX_ARRAY_LENGTH,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,r)];case 3:a.sent(),a.label=4;case 4:return[2]}}))}))},t}(BrowserStorage),SessionStorage=function(e){function t(){var t;return e.call(this,null===(t=getGlobalScope$1())||void 0===t?void 0:t.sessionStorage)||this}return __extends(t,e),t}(BrowserStorage),XHRTransport=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.state={done:4},r.customHeaders=t,r}return __extends(t,e),t.prototype.send=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){return[2,new Promise((function(n,i){var a,o;"undefined"==typeof XMLHttpRequest&&i(new Error("XHRTransport is not supported."));var s=new XMLHttpRequest;s.open("POST",e,!0),s.onreadystatechange=function(){if(s.readyState===r.state.done){var e=s.responseText;try{n(r.buildResponse(JSON.parse(e)))}catch(e){n(r.buildResponse({code:s.status}))}}};var l=__assign$1({"Content-Type":"application/json",Accept:"*/*"},r.customHeaders);try{for(var c=__values$1(Object.entries(l)),d=c.next();!d.done;d=c.next()){var u=__read$1(d.value,2),p=u[0],h=u[1];s.setRequestHeader(p,h)}}catch(e){a={error:e}}finally{try{d&&!d.done&&(o=c.return)&&o.call(c)}finally{if(a)throw a.error}}s.send(JSON.stringify(t))}))]}))}))},t}(BaseTransport),SendBeaconTransport=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return __extends(t,e),t.prototype.send=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){return[2,new Promise((function(n,i){var a=getGlobalScope$1();if(!(null==a?void 0:a.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var o=JSON.stringify(t);return n(a.navigator.sendBeacon(e,JSON.stringify(t))?r.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:o.length,server_upload_time:Date.now()}):r.buildResponse({code:500}))}catch(e){i(e)}}))]}))}))},t}(BaseTransport),parseLegacyCookies=function(e,t,r){return void 0===r&&(r=!0),__awaiter(void 0,void 0,void 0,(function(){var n,i,a,o,s,l,c,d,u;return __generator(this,(function(p){switch(p.label){case 0:return n=getOldCookieName(e),[4,t.getRaw(n)];case 1:return(i=p.sent())?r?[4,t.remove(n)]:[3,3]:[2,{optOut:!1}];case 2:p.sent(),p.label=3;case 3:return a=__read$1(i.split("."),6),o=a[0],s=a[1],l=a[2],c=a[3],d=a[4],u=a[5],[2,{deviceId:o,userId:decode(s),sessionId:parseTime(c),lastEventId:parseTime(u),lastEventTime:parseTime(d),optOut:Boolean(l)}]}}))}))},parseTime=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},decode=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},DEFAULT_EVENT_PREFIX="[Amplitude]",DEFAULT_FORM_START_EVENT="".concat(DEFAULT_EVENT_PREFIX," Form Started"),DEFAULT_FORM_SUBMIT_EVENT="".concat(DEFAULT_EVENT_PREFIX," Form Submitted"),DEFAULT_FILE_DOWNLOAD_EVENT="".concat(DEFAULT_EVENT_PREFIX," File Downloaded"),DEFAULT_SESSION_START_EVENT="session_start",DEFAULT_SESSION_END_EVENT="session_end",FILE_EXTENSION="".concat(DEFAULT_EVENT_PREFIX," File Extension"),FILE_NAME="".concat(DEFAULT_EVENT_PREFIX," File Name"),LINK_ID="".concat(DEFAULT_EVENT_PREFIX," Link ID"),LINK_TEXT="".concat(DEFAULT_EVENT_PREFIX," Link Text"),LINK_URL="".concat(DEFAULT_EVENT_PREFIX," Link URL"),FORM_ID="".concat(DEFAULT_EVENT_PREFIX," Form ID"),FORM_NAME="".concat(DEFAULT_EVENT_PREFIX," Form Name"),FORM_DESTINATION="".concat(DEFAULT_EVENT_PREFIX," Form Destination"),DEFAULT_IDENTITY_STORAGE="cookie",DEFAULT_SERVER_ZONE="US",BrowserConfig=function(e){function t(t,r,n,i,a,o,s,l,c,d,u,p,h,f,m,g,v,y,b,E,_,S,T,x,k,A,I,C,P,w,D,R,L,O,N,M,F,$,B,U,G){void 0===n&&(n=new MemoryStorage),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===c&&(c=5),void 0===d&&(d=30),void 0===u&&(u=DEFAULT_IDENTITY_STORAGE),void 0===g&&(g=new Logger),void 0===v&&(v=LogLevel.Warn),void 0===b&&(b=!1),void 0===E&&(E=!1),void 0===T&&(T=""),void 0===x&&(x=DEFAULT_SERVER_ZONE),void 0===I&&(I=18e5),void 0===C&&(C=new LocalStorage({loggerProvider:g})),void 0===P&&(P={ipAddress:!0,language:!0,platform:!0}),void 0===w&&(w="fetch"),void 0===D&&(D=!1),void 0===R&&(R=!0),void 0===$&&($=!0),void 0===B&&(B=0);var V,q=this;(q=e.call(this,{apiKey:t,storageProvider:C,transportProvider:createTransport$1(w)})||this).apiKey=t,q.appVersion=r,q.cookieOptions=i,q.defaultTracking=a,q.autocapture=o,q.flushIntervalMillis=l,q.flushMaxRetries=c,q.flushQueueSize=d,q.identityStorage=u,q.ingestionMetadata=p,q.instanceName=h,q.loggerProvider=g,q.logLevel=v,q.minIdLength=y,q.offline=b,q.partnerId=_,q.plan=S,q.serverUrl=T,q.serverZone=x,q.sessionTimeout=I,q.storageProvider=C,q.trackingOptions=P,q.transport=w,q.useBatch=D,q.fetchRemoteConfig=R,q.networkTrackingOptions=M,q.identify=F,q.enableDiagnostics=$,q.diagnosticsSampleRate=B,q.diagnosticsClient=U,q.remoteConfig=G,q.version=VERSION$1,q._optOut=!1,q._cookieStorage=n,q.deviceId=s,q.lastEventId=f,q.lastEventTime=m,q.optOut=E,q.deferredSessionId=A,q.sessionId=k,q.pageCounter=O,q.userId=L,q.debugLogsEnabled=N,q.loggerProvider.enable(N?LogLevel.Debug:q.logLevel),q.networkTrackingOptions=M,q.identify=F,q.enableDiagnostics=$,q.diagnosticsSampleRate=B,q.diagnosticsClient=U;var z=null!==(V=null==G?void 0:G.fetchRemoteConfig)&&void 0!==V?V:R;return q.remoteConfig=q.remoteConfig||{},q.remoteConfig.fetchRemoteConfig=z,q.fetchRemoteConfig=z,q}return __extends(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 CookieStorage&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(getCookieName(this.apiKey),e)},t}(Config),useBrowserConfig=function(e,t,r,n,i){return void 0===t&&(t={}),__awaiter(void 0,void 0,void 0,(function(){var a,o,s,l,c,d,u,p,h,f,m,g,v,y,b,E,_,S,T,x,k,A,I,C,P,w,D,R,L,O,N,M,F,$,B,U,G,V,q,z,H,j,W,K,Y,X,J,Q,Z,ee,te;return __generator(this,(function(re){switch(re.label){case 0:return a=t.identityStorage||DEFAULT_IDENTITY_STORAGE,I={},a===DEFAULT_IDENTITY_STORAGE?[3,1]:(s="",[3,5]);case 1:return null===(P=null===(C=t.cookieOptions)||void 0===C?void 0:C.domain)||void 0===P?[3,2]:(l=P,[3,4]);case 2:return[4,getTopLevelDomain()];case 3:l=re.sent(),re.label=4;case 4:s=l,re.label=5;case 5:return o=__assign$1.apply(void 0,[(I.domain=s,I.expiration=365,I.sameSite="Lax",I.secure=!1,I.upgrade=!0,I),t.cookieOptions]),c={duplicateResolverFn:function(e){var t=decodeCookieValue(e);if(!t)return!1;var r=JSON.parse(t);return isDomainEqual(r.cookieDomain,o.domain)},diagnosticsClient:n},d=createCookieStorage(t.identityStorage,o,c),[4,parseLegacyCookies(e,d,null===(D=null===(w=t.cookieOptions)||void 0===w?void 0:w.upgrade)||void 0===D||D)];case 6:return u=re.sent(),[4,d.get(getCookieName(e))];case 7:return p=re.sent(),h=getQueryParams(),f=h.ampTimestamp?Number(h.ampTimestamp):void 0,m=!f||Date.now()<f,g=null!==(M=null!==(N=null!==(O=null!==(R=t.deviceId)&&void 0!==R?R:m?null!==(L=h.ampDeviceId)&&void 0!==L?L:h.deviceId:void 0)&&void 0!==O?O:null==p?void 0:p.deviceId)&&void 0!==N?N:u.deviceId)&&void 0!==M?M:UUID(),v=null!==(F=null==p?void 0:p.lastEventId)&&void 0!==F?F:u.lastEventId,y=null!==($=null==p?void 0:p.lastEventTime)&&void 0!==$?$:u.lastEventTime,b=null!==(U=null!==(B=t.optOut)&&void 0!==B?B:null==p?void 0:p.optOut)&&void 0!==U?U:u.optOut,E=null!==(G=null==p?void 0:p.sessionId)&&void 0!==G?G:u.sessionId,_=null==p?void 0:p.deferredSessionId,S=null!==(q=null!==(V=t.userId)&&void 0!==V?V:null==p?void 0:p.userId)&&void 0!==q?q:u.userId,r.previousSessionDeviceId=null!==(z=null==p?void 0:p.deviceId)&&void 0!==z?z:u.deviceId,r.previousSessionUserId=null!==(H=null==p?void 0:p.userId)&&void 0!==H?H:u.userId,T={ipAddress:null===(W=null===(j=t.trackingOptions)||void 0===j?void 0:j.ipAddress)||void 0===W||W,language:null===(Y=null===(K=t.trackingOptions)||void 0===K?void 0:K.language)||void 0===Y||Y,platform:null===(J=null===(X=t.trackingOptions)||void 0===X?void 0:X.platform)||void 0===J||J},x=null==p?void 0:p.pageCounter,k=null==p?void 0:p.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(A=new BrowserConfig(e,t.appVersion,d,o,t.defaultTracking,t.autocapture,g,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,a,t.ingestionMetadata,t.instanceName,v,y,null!==(Q=null==i?void 0:i.loggerProvider)&&void 0!==Q?Q: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,E,_,t.sessionTimeout,t.storageProvider,T,t.transport,t.useBatch,t.fetchRemoteConfig,S,x,k,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:r._diagnosticsSampleRate,n,t.remoteConfig)).storageProvider.isEnabled()];case 8:return re.sent()||(A.loggerProvider.warn("Storage provider ".concat(A.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),A.storageProvider=new MemoryStorage),[2,A]}}))}))},createCookieStorage=function(e,t,r){switch(void 0===e&&(e=DEFAULT_IDENTITY_STORAGE),void 0===t&&(t={}),e){case"localStorage":return new LocalStorage;case"sessionStorage":return new SessionStorage;case"none":return new MemoryStorage;default:return new CookieStorage(__assign$1(__assign$1({},t),{expirationDays:t.expiration}),r)}},shouldFetchRemoteConfig=function(e){var t,r;return void 0===e&&(e={}),!0===(null===(t=e.remoteConfig)||void 0===t?void 0:t.fetchRemoteConfig)||!1!==(null===(r=e.remoteConfig)||void 0===r?void 0:r.fetchRemoteConfig)&&!1!==e.fetchRemoteConfig},createTransport$1=function(e){var t="object"==typeof e?e.type:e,r="object"==typeof e?e.headers:void 0;return"xhr"===t?new XHRTransport(r):"beacon"===t?new SendBeaconTransport:new FetchTransport(r)},getTopLevelDomain=function(e){return __awaiter(void 0,void 0,void 0,(function(){var e,t,r,n,i,a,o,s;return __generator(this,(function(l){switch(l.label){case 0:return[4,(new CookieStorage).isEnabled()];case 1:if(!l.sent()||"undefined"==typeof location||!location.hostname)return[2,""];for(e=location.hostname,t=e.split("."),r=[],n=UUID(),i="AMP_TLDTEST_".concat(n.substring(0,8)),a=t.length-2;a>=0;--a)r.push(t.slice(a).join("."));a=0,l.label=2;case 2:return a<r.length?(o=r[a],[4,(s=new CookieStorage({domain:"."+o,expirationDays:.003})).set(i,1)]):[3,7];case 3:return l.sent(),[4,s.get(i)];case 4:return l.sent()?[4,s.remove(i)]:[3,6];case 5:return l.sent(),[2,"."+o];case 6:return a++,[3,2];case 7:return[2,""]}}))}))},omitUndefined=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},defaultPageViewEvent="[Amplitude] Page Viewed",pageViewTrackingPlugin=function(e){var t;void 0===e&&(e={});var r,n=getGlobalScope$1(),i=void 0,a=!1,o=e.trackOn,s=e.trackHistoryChanges,l=e.eventType,c=void 0===l?defaultPageViewEvent:l,d=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==i||i.error("Malformed URI sequence: ",e)}return t},u=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,t,r;return __generator(this,(function(n){switch(n.label){case 0:return e=d("undefined"!=typeof location&&location.href||""),r={event_type:c},t=[{}],[4,getCampaignParams()];case 1:return[2,(r.event_properties=__assign$1.apply(void 0,[__assign$1.apply(void 0,t.concat([n.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":e,"[Amplitude] Page Path":"undefined"!=typeof location&&d(location.pathname)||"","[Amplitude] Page Title":getPageTitle(replaceSensitiveString),"[Amplitude] Page URL":e.split("?")[0]}]),r)]}}))}))},p=function(){return void 0===o||"function"==typeof o&&o()},h="undefined"!=typeof location?location.href:null,f=function(){return __awaiter(void 0,void 0,void 0,(function(){var e,r,n,a;return __generator(this,(function(o){switch(o.label){case 0:return e=location.href,r=shouldTrackHistoryPageView(s,e,h||"")&&p(),h=e,r?(null==i||i.log("Tracking page view event"),null!=t?[3,1]:[3,3]):[3,4];case 1:return a=(n=t).track,[4,u()];case 2:a.apply(n,[o.sent()]),o.label=3;case 3:o.label=4;case 4:return[2]}}))}))},m=function(){f()},g={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,o){return __awaiter(void 0,void 0,void 0,(function(){var s,l;return __generator(this,(function(c){switch(c.label){case 0:return t=o,r=e,(i=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),a=!0,n&&(n.addEventListener("popstate",m),n.history.pushState=new Proxy(n.history.pushState,{apply:function(e,t,r){var n=__read$1(r,3),i=n[0],o=n[1],s=n[2];e.apply(t,[i,o,s]),a&&f()}})),p()?(i.log("Tracking page view event"),l=(s=t).track,[4,u()]):[3,2];case 1:l.apply(s,[c.sent()]),c.label=2;case 2:return[2]}}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){var t;return __generator(this,(function(n){switch(n.label){case 0:return"attribution"===o&&isCampaignEvent(e)?(null==i||i.log("Enriching campaign event to page view event with campaign parameters"),[4,u()]):[3,2];case 1:t=n.sent(),e.event_type=t.event_type,e.event_properties=__assign$1(__assign$1({},e.event_properties),t.event_properties),n.label=2;case 2:return r&&e.event_type===c&&(r.pageCounter=r.pageCounter?r.pageCounter+1:1,e.event_properties=__assign$1(__assign$1({},e.event_properties),{"[Amplitude] Page Counter":r.pageCounter})),[2,e]}}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return n&&(n.removeEventListener("popstate",m),a=!1),[2]}))}))}};return g},getCampaignParams=function(){return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=omitUndefined,[4,(new CampaignParser).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},isCampaignEvent=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[IdentifyOperation$1.SET]||{},n=t[IdentifyOperation$1.UNSET]||{},i=__spreadArray(__spreadArray([],__read$1(Object.keys(r)),!1),__read$1(Object.keys(n)),!1);return Object.keys(BASE_CAMPAIGN).every((function(e){return i.includes(e)}))}return!1},shouldTrackHistoryPageView=function(e,t,r){if("pathOnly"===e){if(""==r)return!0;var n=new URL(t),i=new URL(r);return n.origin+n.pathname!==i.origin+i.pathname}return t!==r},formInteractionTracking=function(){var e,t,r=[],n=function(e,t,n){e.addEventListener(t,n),r.push({element:e,type:t,handler:n})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(r,i){return __awaiter(void 0,void 0,void 0,(function(){var a,o;return __generator(this,(function(s){return t=getFormInteractionsConfig(r),a=function(){if(i){if("undefined"!=typeof document){var a=new WeakSet,o=function(e){if(!a.has(e)){a.add(e);var o=!1;n(e,"change",(function(){var t,r=extractFormAction(e);o||i.track(DEFAULT_FORM_START_EVENT,((t={})[FORM_ID]=stringOrUndefined(e.id),t[FORM_NAME]=stringOrUndefined(e.name),t[FORM_DESTINATION]=r,t)),o=!0})),n(e,"submit",(function(n){var a,s,l=extractFormAction(e);if(o||i.track(DEFAULT_FORM_START_EVENT,((a={})[FORM_ID]=stringOrUndefined(e.id),a[FORM_NAME]=stringOrUndefined(e.name),a[FORM_DESTINATION]=l,a)),o=!0,void 0!==(null==t?void 0:t.shouldTrackSubmit))if("function"==typeof t.shouldTrackSubmit&&"undefined"!=typeof SubmitEvent&&n instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(n))return}catch(e){r.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else r.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");i.track(DEFAULT_FORM_SUBMIT_EVENT,((s={})[FORM_ID]=stringOrUndefined(e.id),s[FORM_NAME]=stringOrUndefined(e.name),s[FORM_DESTINATION]=l,s)),o=!1}))}};Array.from(document.getElementsByTagName("form")).forEach(o),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"FORM"===e.nodeName&&o(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(o)}))}))}))).observe(document.body,{subtree:!0,childList:!0})}}else r.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?a():(o=getGlobalScope$1())?o.addEventListener("load",a):r.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e]}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return null==e||e.disconnect(),r.forEach((function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)})),r=[],[2]}))}))}}},stringOrUndefined=function(e){if("string"==typeof e)return e},extractFormAction=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},fileDownloadTracking=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(r,n){return __awaiter(void 0,void 0,void 0,(function(){var i,a;return __generator(this,(function(o){return i=function(){if(n){if("undefined"!=typeof document){var i=function(e){var r;try{r=new URL(e.href,window.location.href)}catch(e){return}var i=a.exec(r.href),o=null==i?void 0:i[1];o&&function(e,r,n){e.addEventListener(r,n),t.push({element:e,type:r,handler:n})}(e,"click",(function(){var t;o&&n.track(DEFAULT_FILE_DOWNLOAD_EVENT,((t={})[FILE_EXTENSION]=o,t[FILE_NAME]=r.pathname,t[LINK_ID]=e.id,t[LINK_TEXT]=e.text,t[LINK_URL]=e.href,t))}))},a=/\.(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 r.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")},"complete"===document.readyState?i():(a=getGlobalScope$1())?a.addEventListener("load",i):r.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e]}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)})),t=[],[2]}))}))}}},notified=!1,detNotify=function(e){if(!notified&&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."),notified=!0}},networkConnectivityCheckerPlugin=function(){var e=getGlobalScope$1(),t=[],r=function(r,n){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(r,n),t.push({type:r,handler:n}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(n){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,r("online",(function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout((function(){t.flush()}),e.flushIntervalMillis)})),r("offline",(function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2])}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return t.forEach((function(t){var r=t.type,n=t.handler;null==e||e.removeEventListener(r,n)})),t=[],[2]}))}))}}};function translateRemoteConfigToLocal(e){var t,r,n,i,a,o,s,l,c,d,u;if("object"==typeof e&&null!==e&&!Array.isArray(e)){var p=Object.keys(e);try{for(var h=__values$1(p),f=h.next();!f.done;f=h.next()){var m=f.value;try{var g=e[m];"boolean"==typeof(null==g?void 0:g.enabled)&&(g.enabled?(delete g.enabled,0===Object.keys(g).length&&(e[m]=!0)):e[m]=!1),translateRemoteConfigToLocal(g)}catch(e){}}}catch(e){t={error:e}}finally{try{f&&!f.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}try{if(null===(c=null===(l=null===(s=e.autocapture)||void 0===s?void 0:s.networkTracking)||void 0===l?void 0:l.captureRules)||void 0===c?void 0:c.length)try{for(var v=__values$1(e.autocapture.networkTracking.captureRules),y=v.next();!y.done;y=v.next()){var b=y.value;try{for(var E=(a=void 0,__values$1(["responseHeaders","requestHeaders"])),_=E.next();!_.done;_=E.next()){var S=_.value,T=null!==(d=b[S])&&void 0!==d?d:{},x=T.captureSafeHeaders,k=T.allowlist;(x||k)&&(void 0===k||Array.isArray(k)?b[S]=__spreadArray(__spreadArray([],__read$1(x?SAFE_HEADERS:[]),!1),__read$1(null!=k?k:[]),!1):delete b[S])}}catch(e){a={error:e}}finally{try{_&&!_.done&&(o=E.return)&&o.call(E)}finally{if(a)throw a.error}}}}catch(e){n={error:e}}finally{try{y&&!y.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}}catch(e){}var A=null===(u=e.autocapture)||void 0===u?void 0:u.frustrationInteractions;A&&(A.rageClick&&(A.rageClicks=A.rageClick,delete A.rageClick),A.deadClick&&(A.deadClicks=A.deadClick,delete A.deadClick))}}function mergeUrls(e,t,r){var n,i,a=[];try{for(var o=__values$1(null!=t?t:[]),s=o.next();!s.done;s=o.next()){var l=s.value;try{a.push(new RegExp(l))}catch(e){r.loggerProvider.warn("Invalid regex pattern: ".concat(l),e)}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return e.concat(a)}function updateBrowserConfigWithRemoteConfig(e,t){var r,n,i,a,o,s,l;if(e){translateRemoteConfigToLocal(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var c=e;if(c&&"autocapture"in c){if("boolean"==typeof c.autocapture&&(t.autocapture=c.autocapture),"object"==typeof c.autocapture&&null!==c.autocapture){var d=__assign$1({},c.autocapture);if(void 0===t.autocapture&&(t.autocapture=c.autocapture),"object"==typeof c.autocapture.elementInteractions&&null!==c.autocapture.elementInteractions&&(null===(i=c.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===i?void 0:i.length)){d.elementInteractions=__assign$1({},c.autocapture.elementInteractions);var u=d.elementInteractions,p=null!==(a=u.pageUrlAllowlist)&&void 0!==a?a:[],h=c.autocapture.elementInteractions.pageUrlAllowlistRegex;u.pageUrlAllowlist=mergeUrls(p,h,t),delete u.pageUrlAllowlistRegex}if("object"==typeof c.autocapture.networkTracking&&null!==c.autocapture.networkTracking&&(null===(o=c.autocapture.networkTracking.captureRules)||void 0===o?void 0:o.length)){d.networkTracking=__assign$1({},c.autocapture.networkTracking);var f=null!==(s=d.networkTracking.captureRules)&&void 0!==s?s:[];try{for(var m=__values$1(f),g=m.next();!g.done;g=m.next()){var v=g.value;v.urls=mergeUrls(null!==(l=v.urls)&&void 0!==l?l:[],v.urlsRegex,t),delete v.urlsRegex}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=__assign$1({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},d)),"object"==typeof t.autocapture&&(t.autocapture=__assign$1(__assign$1({},t.autocapture),d))}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 VERSION="1.22.2",PLUGIN_NAME$2="@amplitude/plugin-autocapture-browser",FRUSTRATION_PLUGIN_NAME="@amplitude/plugin-frustration-browser",AMPLITUDE_ELEMENT_CLICKED_EVENT="[Amplitude] Element Clicked",AMPLITUDE_ELEMENT_DEAD_CLICKED_EVENT="[Amplitude] Dead Click",AMPLITUDE_ELEMENT_RAGE_CLICKED_EVENT="[Amplitude] Rage Click",AMPLITUDE_ELEMENT_ERROR_CLICKED_EVENT="[Amplitude] Error Click",AMPLITUDE_ELEMENT_CHANGED_EVENT="[Amplitude] Element Changed",AMPLITUDE_THRASHED_CURSOR_EVENT="[Amplitude] Thrashed Cursor",AMPLITUDE_EVENT_PROP_ELEMENT_ID="[Amplitude] Element ID",AMPLITUDE_EVENT_PROP_ELEMENT_CLASS="[Amplitude] Element Class",AMPLITUDE_EVENT_PROP_ELEMENT_TAG="[Amplitude] Element Tag",AMPLITUDE_EVENT_PROP_ELEMENT_TEXT="[Amplitude] Element Text",AMPLITUDE_EVENT_PROP_ELEMENT_HIERARCHY="[Amplitude] Element Hierarchy",AMPLITUDE_EVENT_PROP_ELEMENT_HREF="[Amplitude] Element Href",AMPLITUDE_EVENT_PROP_ELEMENT_POSITION_LEFT="[Amplitude] Element Position Left",AMPLITUDE_EVENT_PROP_ELEMENT_POSITION_TOP="[Amplitude] Element Position Top",AMPLITUDE_EVENT_PROP_ELEMENT_ARIA_LABEL="[Amplitude] Element Aria Label",AMPLITUDE_EVENT_PROP_ELEMENT_ATTRIBUTES="[Amplitude] Element Attributes",AMPLITUDE_EVENT_PROP_ELEMENT_PARENT_LABEL="[Amplitude] Element Parent Label",AMPLITUDE_EVENT_PROP_PAGE_URL="[Amplitude] Page URL",AMPLITUDE_EVENT_PROP_PAGE_TITLE="[Amplitude] Page Title",AMPLITUDE_EVENT_PROP_VIEWPORT_HEIGHT="[Amplitude] Viewport Height",AMPLITUDE_EVENT_PROP_VIEWPORT_WIDTH="[Amplitude] Viewport Width",AMPLITUDE_VISUAL_TAGGING_SELECTOR_SCRIPT_URL="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",AMPLITUDE_VISUAL_TAGGING_HIGHLIGHT_CLASS="amp-visual-tagging-selector-highlight",DATA_AMP_MASK_ATTRIBUTES="data-amp-mask-attributes",MAX_MASK_TEXT_PATTERNS=25,MAX_ATTRIBUTE_LENGTH=128,SENSITIVE_TAGS=["input","select","textarea"],isElementPointerCursor=function(e,t){var r,n=null===(r=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===r?void 0:r.call(window,e);return"pointer"===(null==n?void 0:n.getPropertyValue("cursor"))&&"click"===t},isUrlAllowed=function(e){var t=e.pageUrlAllowlist,r=e.pageUrlExcludelist;return!(r&&r.length>0&&isUrlMatchAllowlist(window.location.href,r))&&!!isUrlMatchAllowlist(window.location.href,t)},createShouldTrackEvent=function(e,t,r){return void 0===r&&(r=!1),function(n,i){var a,o,s=e.shouldTrackEventResolver,l=null===(o=null===(a=null==i?void 0:i.tagName)||void 0===a?void 0:a.toLowerCase)||void 0===o?void 0:o.call(a);if(!l)return!1;if(s)return s(n,i);if(!isUrlAllowed(e))return!1;var c=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof c)switch(c.toLowerCase()){case"hidden":case"password":return!1}var d=isElementPointerCursor(i,n);if(r&&d)return!0;if(t){var u=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(!u)return!1}switch(l){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:return!!d||"click"===n}}},isNonSensitiveElement=function(e){var t,r,n,i=null===(r=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===r?void 0:r.call(t),a=e instanceof HTMLElement&&"true"===(null===(n=e.getAttribute("contenteditable"))||void 0===n?void 0:n.toLowerCase());return!SENSITIVE_TAGS.includes(i)&&!a},parseAttributesToMask=function(e){return e?e.split(",").map((function(e){return e.trim()})).filter((function(e){return e.length>0&&"id"!==e&&"class"!==e})):[]},extractPrefixedAttributes=function(e,t){return Object.entries(e).reduce((function(e,r){var n=__read$1(r,2),i=n[0],a=n[1];if(i.startsWith(t)){var o=i.replace(t,"");o&&(e[o]=a||"")}return e}),{})},isEmpty=function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length},removeEmptyProperties=function(e){return Object.keys(e).reduce((function(t,r){var n=e[r];return isEmpty(n)||(t[r]=n),t}),{})},getClosestElement=function(e,t){return e?t.some((function(t){var r;return null===(r=null==e?void 0:e.matches)||void 0===r?void 0:r.call(e,t)}))?e:getClosestElement(null==e?void 0:e.parentElement,t):null},filterOutNonTrackableEvents=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)},MouseButton;function isElementBasedEvent(e){return"click"===e.type||"change"===e.type}!function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"}(MouseButton||(MouseButton={}));var VISUAL_TAGGING_BRAND="__AMPLITUDE_VISUAL_TAGGING__";function enableVisualTagging(e,t){var r=e;if(!0!==r[VISUAL_TAGGING_BRAND]){r[VISUAL_TAGGING_BRAND]=!0;var n=t.dataExtractor,i=t.isElementSelectable,a=t.cssSelectorAllowlist,o=t.actionClickAllowlist,s=null,l=function(t){e.notify({action:"element-selected",data:t})},c=function(t,r){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:r}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:r})};e.registerActionHandler("initialize-visual-tagging-selector",(function(t){e.loadScriptOnce(AMPLITUDE_VISUAL_TAGGING_SELECTOR_SCRIPT_URL).then((function(){var r;s=null===(r=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===r?void 0:r.call(window,{getEventTagProps:n.getEventTagProps,isElementSelectable:function(e){return!i||i((null==t?void 0:t.actionType)||"click",e)},onTrack:c,onSelect:l,visualHighlightClass:AMPLITUDE_VISUAL_TAGGING_HIGHLIGHT_CLASS,messenger:e,cssSelectorAllowlist:a,actionClickAllowlist:o,extractDataFromDataSource:n.extractDataFromDataSource,dataExtractor:n,diagnostics:{autocapture:{version:VERSION}}}),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==s?void 0:s.close)||void 0===e||e.call(s)}))}}function trackClicks(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackEvent,i=e.evaluateTriggers;return r.clickObservable.filter(filterOutNonTrackableEvents).filter((function(e){return n("click",e.closestTrackedAncestor)})).map((function(e){return i(e)})).subscribe((function(e){null==t||t.track(AMPLITUDE_ELEMENT_CLICKED_EVENT,e.targetElementProperties)}))}function trackChange(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackEvent,a=e.evaluateTriggers;return r.changeObservable.filter(filterOutNonTrackableEvents).filter((function(e){return i("change",e.closestTrackedAncestor)})).map((function(e){return a(e)})).subscribe((function(e){null==t||t.track(AMPLITUDE_ELEMENT_CHANGED_EVENT,n("change",e.closestTrackedAncestor))}))}function trackActionClick(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,a=e.shouldTrackEvent,o=e.shouldTrackActionClick,s=r.clickObservable,l=r.mutationObservable,c=r.navigateObservable,d=s.filter((function(e){return!a("click",e.closestTrackedAncestor)})).map((function(e){var t=getClosestElement(e.event.target,n.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e})).filter(filterOutNonTrackableEvents).filter((function(e){return o("click",e.closestTrackedAncestor)})),u=c?merge$1(l,c):l,p=merge$1(d,u),h=null,f=null;return asyncMap(p,(function(e){if(h&&(clearTimeout(h),h=null),"click"===e.type)return f=e,h=setTimeout((function(){h=null,f=null}),500),Promise.resolve(null);if(f){var t=f;return f=null,Promise.resolve(t)}return Promise.resolve(null)})).subscribe((function(e){e&&(null==t||t.track(AMPLITUDE_ELEMENT_CLICKED_EVENT,i("click",e.closestTrackedAncestor)))}))}var globalScope=getGlobalScope$1(),createMutationObservable=function(){return new Observable((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()}}))},createClickObservable=function(e){return void 0===e&&(e="click"),new Observable((function(t){var r=function(e){t.next(e)};return globalScope.document.addEventListener(e,r,{capture:!0}),function(){globalScope.document.removeEventListener(e,r,{capture:!0})}}))},createConsoleErrorObservable=function(){return new Observable((function(e){var t=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=void 0;Array.isArray(r[0])&&"string"==typeof r[0][0]&&(i=r[0][0]),e.next({kind:"console",message:i})};return consoleObserver.addListener("error",t),function(){consoleObserver.removeListener(t)}}))},createUnhandledErrorObservable=function(){return new Observable((function(e){var t=function(t){if(t instanceof ErrorEvent){var r={kind:"error"};t.error instanceof Error||t.error instanceof DOMException?r=__assign$1(__assign$1({},r),{message:t.error.message,stack:t.error.stack,filename:t.filename,lineNumber:t.lineno,columnNumber:t.colno}):"string"==typeof t.error&&(r.message=t.error),e.next(r)}};return globalScope.addEventListener("error",t),function(){globalScope.removeEventListener("error",t)}}))},createUnhandledRejectionObservable=function(){return new Observable((function(e){var t=function(t){var r={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(r.message=t.reason.message,r.stack=t.reason.stack):"string"==typeof t.reason&&(r.message=t.reason),e.next(r)};return globalScope.addEventListener("unhandledrejection",t),function(){globalScope.removeEventListener("unhandledrejection",t)}}))},createErrorObservable=function(){var e=merge$1(createUnhandledErrorObservable(),createUnhandledRejectionObservable());return merge$1(e,createConsoleErrorObservable())},createMouseMoveObservable=function(){return new Observable((function(e){var t=function(t){e.next(t)},r={capture:!0};return globalScope.document.addEventListener("mousemove",t,r),function(){globalScope.document.removeEventListener("mousemove",t,r)}}))},matchEventToFilter=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},getDataSource=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var r=document.documentElement;return e.scope&&t&&(r=t.closest(e.scope)),r&&e.selector?r.querySelector(e.selector):r}}catch(e){return}},executeActions=function(e,t,r){e.forEach((function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var n=r.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=n}}))},eventTypeToBrowserEventMap={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},groupLabeledEventIdsByEventType=function(e){var t,r,n,i,a=Object.values(eventTypeToBrowserEventMap).reduce((function(e,t){return e[t]=new Set,e}),{});if(!e)return a;try{for(var o=__values$1(e),s=o.next();!s.done;s=o.next()){var l=s.value;try{try{for(var c=(n=void 0,__values$1(l.definition)),d=c.next();!d.done;d=c.next()){var u=d.value,p=eventTypeToBrowserEventMap[u.event_type];p&&a[p].add(l.id)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==l?void 0:l.id,e)}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return a},createLabeledEventToTriggerMap=function(e){var t,r,n,i,a=new Map;try{for(var o=__values$1(e),s=o.next();!s.done;s=o.next()){var l=s.value;try{for(var c=(n=void 0,__values$1(l.conditions)),d=c.next();!d.done;d=c.next()){var u=d.value;if("LABELED_EVENT"===u.type){var p=u.match.eventId,h=a.get(p);h||(h=[],a.set(p,h)),h.push(l)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return a},matchEventToLabeledEvents=function(e,t){return t.filter((function(t){return t.definition.some((function(t){return eventTypeToBrowserEventMap[t.event_type]===e.type&&t.filters.every((function(t){return matchEventToFilter(e,t)}))}))}))},matchLabeledEventsToTriggers=function(e,t){var r,n,i,a,o=new Set;try{for(var s=__values$1(e),l=s.next();!l.done;l=s.next()){var c=l.value,d=t.get(c.id);if(d)try{for(var u=(i=void 0,__values$1(d)),p=u.next();!p.done;p=u.next()){var h=p.value;o.add(h)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return Array.from(o)},TriggerEvaluator=function(){function e(e,t,r,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=r,this.options=n}return e.prototype.evaluate=function(e){var t,r,n=this.options.pageActions;if(!n)return e;var i=matchEventToLabeledEvents(e,Array.from(this.groupedLabeledEvents[e.type]).map((function(e){return n.labeledEvents[e]}))),a=matchLabeledEventsToTriggers(i,this.labeledEventToTriggerMap);try{for(var o=__values$1(a),s=o.next();!s.done;s=o.next()){var l=s.value;executeActions(l.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=r},e}(),createTriggerEvaluator=function(e,t,r,n){return new TriggerEvaluator(e,t,r,n)},BLOCKED_ATTRIBUTES=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",DATA_AMP_MASK_ATTRIBUTES,TEXT_MASK_ATTRIBUTE]),SENSITIVE_ELEMENT_ATTRIBUTE_ALLOWLIST=["type"],SVG_TAGS=["svg","path","g"],HIGHLY_SENSITIVE_INPUT_TYPES=["password","hidden"];function getElementProperties(e,t){var r,n,i,a,o,s;if(null===e)return null;var l=String(e.tagName).toLowerCase(),c={tag:l},d=Array.from(null!==(a=null===(i=e.parentElement)||void 0===i?void 0:i.children)&&void 0!==a?a:[]);d.length&&(c.index=d.indexOf(e),c.indexOfType=d.filter((function(t){return t.tagName===e.tagName})).indexOf(e));var u=null===(s=null===(o=e.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===s?void 0:s.toLowerCase();u&&(c.prevSib=String(u));var p=e.getAttribute("id");p&&(c.id=String(p));var h=Array.from(e.classList);h.length&&(c.classes=h);var f={},m=Array.from(e.attributes).filter((function(e){return!BLOCKED_ATTRIBUTES.has(e.name)})),g=!isNonSensitiveElement(e);if(!HIGHLY_SENSITIVE_INPUT_TYPES.includes(String(e.getAttribute("type")))&&!SVG_TAGS.includes(l))try{for(var v=__values$1(m),y=v.next();!y.done;y=v.next()){var b=y.value;g&&!SENSITIVE_ELEMENT_ATTRIBUTE_ALLOWLIST.includes(b.name)||(t.has(b.name)?f[b.name]=MASKED_TEXT_VALUE:f[b.name]=String(b.value).substring(0,MAX_ATTRIBUTE_LENGTH))}}catch(e){r={error:e}}finally{try{y&&!y.done&&(n=v.return)&&n.call(v)}finally{if(r)throw r.error}}return Object.keys(f).length&&(c.attrs=f),c}function getAncestors(e){var t=[];if(!e)return t;t.push(e);for(var r=e.parentElement;r&&"HTML"!==r.tagName;)t.push(r),r=r.parentElement;return t}var DataExtractor=function(e,t){var r,n,i,a=this;this.replaceSensitiveString=function(e){return replaceSensitiveString(e,a.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,r,n,i,o,s=performance.now();if(!e)return[];for(var l=getAncestors(e),c=new Map,d=l.length-1;d>=0;d--){var u=l[d];if(u){var p=parseAttributesToMask(u.getAttribute(DATA_AMP_MASK_ATTRIBUTES)),h=d===l.length-1?[]:null!==(n=c.get(l[d+1]))&&void 0!==n?n:new Set,f=new Set(__spreadArray(__spreadArray([],__read$1(h),!1),__read$1(p),!1));c.set(u,f)}}o=l.map((function(e){var t;return getElementProperties(e,null!==(t=c.get(e))&&void 0!==t?t:new Set)}));var m=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach((function(t){var r=__read$1(t,2),n=r[0],i=r[1];e.attrs&&(e.attrs[n]=a.replaceSensitiveString(i))}))};try{for(var g=__values$1(o),v=g.next();!v.done;v=g.next())m(v.value)}catch(e){t={error:e}}finally{try{v&&!v.done&&(r=g.return)&&r.call(g)}finally{if(t)throw t.error}}var y=performance.now();return null===(i=a.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",y-s),o},this.getNearestLabel=function(e){var t,r=e.parentElement;if(!r)return"";try{t=r.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?a.getText(t):a.getNearestLabel(r)},this.getEventProperties=function(e,t,r){var n,i,o,s,l=null===(o=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i),c="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},d=a.getHierarchy(t),u=null===(s=d[0])||void 0===s?void 0:s.attrs,p=a.getNearestLabel(t),h=extractPrefixedAttributes(null!=u?u:{},r),f=((n={})[AMPLITUDE_EVENT_PROP_ELEMENT_HIERARCHY]=d,n[AMPLITUDE_EVENT_PROP_ELEMENT_TAG]=l,n[AMPLITUDE_EVENT_PROP_ELEMENT_TEXT]=a.getText(t),n[AMPLITUDE_EVENT_PROP_ELEMENT_POSITION_LEFT]=null==c.left?null:Math.round(c.left),n[AMPLITUDE_EVENT_PROP_ELEMENT_POSITION_TOP]=null==c.top?null:Math.round(c.top),n[AMPLITUDE_EVENT_PROP_ELEMENT_ATTRIBUTES]=h,n[AMPLITUDE_EVENT_PROP_ELEMENT_PARENT_LABEL]=p,n[AMPLITUDE_EVENT_PROP_PAGE_URL]=getDecodeURI(window.location.href.split("?")[0]),n[AMPLITUDE_EVENT_PROP_PAGE_TITLE]=getPageTitle(a.replaceSensitiveString),n[AMPLITUDE_EVENT_PROP_VIEWPORT_HEIGHT]=window.innerHeight,n[AMPLITUDE_EVENT_PROP_VIEWPORT_WIDTH]=window.innerWidth,n);if(f[AMPLITUDE_EVENT_PROP_ELEMENT_ID]=t.getAttribute("id")||"",f[AMPLITUDE_EVENT_PROP_ELEMENT_CLASS]=t.getAttribute("class"),f[AMPLITUDE_EVENT_PROP_ELEMENT_ARIA_LABEL]=null==u?void 0:u["aria-label"],"a"===l&&"click"===e&&t instanceof HTMLAnchorElement){var m=t.href.substring(0,MAX_ATTRIBUTE_LENGTH);f[AMPLITUDE_EVENT_PROP_ELEMENT_HREF]=a.replaceSensitiveString(m)}return removeEmptyProperties(f)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,r,n,i){void 0===i&&(i=!1);var o=a.addTypeAndTimestamp(e,t);if(isElementBasedEvent(o)&&null!==o.event.target){if(i&&isElementPointerCursor(o.event.target,o.type))return o.closestTrackedAncestor=o.event.target,o.targetElementProperties=a.getEventProperties(o.type,o.closestTrackedAncestor,n),o;var s=getClosestElement(o.event.target,r);return s&&(o.closestTrackedAncestor=s,o.targetElementProperties=a.getEventProperties(o.type,s,n)),o}return o},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=getDataSource(e,t);if(!r)return;return"TEXT"===e.elementExtractType?a.getText(r):"ATTRIBUTE"===e.elementExtractType&&e.attribute?r.getAttribute(e.attribute):void 0}},this.getTextWithMaskedDescendants=function(e){var t,r,n="[".concat(TEXT_MASK_ATTRIBUTE,"], [contenteditable]");if(!e.querySelector(n))return e.innerText;var i="",o=Array.from(e.childNodes);try{for(var s=__values$1(o),l=s.next();!l.done;l=s.next()){var c=l.value;c.nodeType!==Node.TEXT_NODE?c instanceof Element&&(c.hasAttribute(TEXT_MASK_ATTRIBUTE)||c.hasAttribute("contenteditable")?i+=MASKED_TEXT_VALUE:i+=a.getTextWithMaskedDescendants(c)):i+=c.textContent||""}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return i},this.getText=function(e){if(null!==e.closest("[".concat(TEXT_MASK_ATTRIBUTE,"]")))return MASKED_TEXT_VALUE;var t="";return t=e.querySelector("[".concat(TEXT_MASK_ATTRIBUTE,"], [contenteditable]"))?a.getTextWithMaskedDescendants(e):e.innerText||"",a.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){var t,r,n;if(!e)return{};var i=null===(n=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===n?void 0:n.call(r),o=((t={})[AMPLITUDE_EVENT_PROP_ELEMENT_TAG]=i,t[AMPLITUDE_EVENT_PROP_ELEMENT_TEXT]=a.getText(e),t[AMPLITUDE_EVENT_PROP_PAGE_URL]=window.location.href.split("?")[0],t);return removeEmptyProperties(o)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var o=null!==(i=e.maskTextRegex)&&void 0!==i?i:[],s=[];try{for(var l=__values$1(o),c=l.next();!c.done;c=l.next()){var d=c.value;if(s.length>=MAX_MASK_TEXT_PATTERNS)break;if(d instanceof RegExp)s.push(d);else if("pattern"in d&&"string"==typeof d.pattern)try{s.push(new RegExp(d.pattern,"i"))}catch(e){}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}this.additionalMaskTextPatterns=s},ObservablesEnum$1;!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"}(ObservablesEnum$1||(ObservablesEnum$1={}));var autocapturePlugin=function(e,t){var r,n,i,a,o,s,l,c;void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",VERSION);var d=e.dataAttributePrefix,u=void 0===d?DEFAULT_DATA_ATTRIBUTE_PREFIX:d,p=e.visualTaggingOptions,h=void 0===p?{enabled:!0}:p;e.cssSelectorAllowlist=null!==(r=e.cssSelectorAllowlist)&&void 0!==r?r:DEFAULT_CSS_SELECTOR_ALLOWLIST,e.actionClickAllowlist=null!==(n=e.actionClickAllowlist)&&void 0!==n?n:DEFAULT_ACTION_CLICK_ALLOWLIST,e.debounceTime=null!==(i=e.debounceTime)&&void 0!==i?i:0,e.pageUrlExcludelist=null===(a=e.pageUrlExcludelist)||void 0===a?void 0:a.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(r){return console.warn("Invalid regex pattern: ".concat(t.pattern),r),e}return e}),[]);var f=PLUGIN_NAME$2,m=[],g=new DataExtractor(e,t),v=groupLabeledEventIdsByEventType(Object.values(null!==(s=null===(o=e.pageActions)||void 0===o?void 0:o.labeledEvents)&&void 0!==s?s:{})),y=createLabeledEventToTriggerMap(null!==(c=null===(l=e.pageActions)||void 0===l?void 0:l.triggers)&&void 0!==c?c:[]),b=createTriggerEvaluator(v,y,g,e);return{name:f,type:"enrichment",setup:function(t,r){return __awaiter(void 0,void 0,void 0,(function(){var n,i,a,o,s,l,c,d,p,E;return __generator(this,(function(_){return"undefined"==typeof document||(t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",(function(t){!function(t){var r,n;t&&(e.pageActions=__assign$1(__assign$1({},e.pageActions),t),v=groupLabeledEventIdsByEventType(Object.values(null!==(r=e.pageActions.labeledEvents)&&void 0!==r?r:{})),y=createLabeledEventToTriggerMap(null!==(n=e.pageActions.triggers)&&void 0!==n?n:[]),b.update(v,y,e))}(t)})):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),n=createShouldTrackEvent(e,e.cssSelectorAllowlist),i=createShouldTrackEvent(e,e.actionClickAllowlist),a=function(){var t,r,n=multicast(createClickObservable().map((function(t){return g.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,u)}))),i=multicast(new Observable((function(t){var r,n=function(r){var n=g.addAdditionalEventProperties(r,"change",e.cssSelectorAllowlist,u);t.next(n)};return null===(r=getGlobalScope$1())||void 0===r||r.document.addEventListener("change",n,{capture:!0}),function(){var e;return null===(e=getGlobalScope$1())||void 0===e?void 0:e.document.removeEventListener("change",n)}})));window.navigation&&(r=multicast(new Observable((function(t){var r=function(r){var n=g.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,u);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}}))));var a=multicast(createMutationObservable().map((function(t){return g.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,u)})));return(t={})[ObservablesEnum$1.ChangeObservable]=i,t[ObservablesEnum$1.ClickObservable]=n,t[ObservablesEnum$1.MutationObservable]=a,t[ObservablesEnum$1.NavigateObservable]=r,t}(),o=trackClicks({allObservables:a,amplitude:r,shouldTrackEvent:n,evaluateTriggers:b.evaluate.bind(b)}),m.push(o),s=trackChange({allObservables:a,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g.getEventProperties.apply(g,__spreadArray(__spreadArray([],__read$1(e),!1),[u],!1))},amplitude:r,shouldTrackEvent:n,evaluateTriggers:b.evaluate.bind(b)}),m.push(s),l=trackActionClick({allObservables:a,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return g.getEventProperties.apply(g,__spreadArray(__spreadArray([],__read$1(e),!1),[u],!1))},amplitude:r,shouldTrackEvent:n,shouldTrackActionClick:i}),l&&m.push(l),null===(E=null==t?void 0:t.loggerProvider)||void 0===E||E.log("".concat(f," has been successfully added.")),window.opener&&h.enabled&&(c=e.cssSelectorAllowlist,d=e.actionClickAllowlist,enableVisualTagging(p=getOrCreateWindowMessenger(),{dataExtractor:g,isElementSelectable:createShouldTrackEvent(e,__spreadArray(__spreadArray([],__read$1(c),!1),__read$1(d),!1)),cssSelectorAllowlist:c,actionClickAllowlist:d}),enableBackgroundCapture(p),p.setup(__assign$1({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:AMPLITUDE_ORIGINS_MAP[t.serverZone]})))),[2]}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e]}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(i){try{for(e=__values$1(m),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return[2]}))}))}}},DEAD_CLICK_TIMEOUT=3e3,CHANGE_EVENTS=["mutation","navigate"];function trackDeadClick(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackDeadClick,a=r.clickObservable,o=r.mutationObservable,s=r.navigateObservable,l=a.filter((function(e){return filterOutNonTrackableEvents(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===MouseButton.LEFT_OR_TOUCH_CONTACT})),c=s?merge$1(o,s):o,d=merge$1(l,c),u=null;return asyncMap(d,(function(e){return u&&CHANGE_EVENTS.includes(e.type)?(clearTimeout(u),u=null,Promise.resolve(null)):"click"===e.type?u?Promise.resolve(null):new Promise((function(t){u=setTimeout((function(){t(e),u=null}),DEAD_CLICK_TIMEOUT)})):Promise.resolve(null)})).subscribe((function(e){if(e){var r={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};t.track(AMPLITUDE_ELEMENT_DEAD_CLICKED_EVENT,__assign$1(__assign$1({},n("click",e.closestTrackedAncestor)),r),{time:e.timestamp})}}))}var RAGE_CLICK_THRESHOLD=DEFAULT_RAGE_CLICK_THRESHOLD,RAGE_CLICK_WINDOW_MS=DEFAULT_RAGE_CLICK_WINDOW_MS,RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD=DEFAULT_RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD;function addCoordinates(e,t){var r,n,i,a,o=t.event,s=o.pageX,l=o.pageY;e.yMin=Math.min(null!==(r=e.yMin)&&void 0!==r?r:l,l),e.yMax=Math.max(null!==(n=e.yMax)&&void 0!==n?n:l,l),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:s,s),e.xMax=Math.max(null!==(a=e.xMax)&&void 0!==a?a:s,s),e.isOutOfBounds=e.yMax-e.yMin>RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD||e.xMax-e.xMin>RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD}function getRageClickAnalyticsEvent(e){if(0===e.length)return null;var t=e[0],r=e[e.length-1];return{rageClickEvent:__assign$1({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(r.timestamp).toISOString(),"[Amplitude] Duration":r.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 isClickOutsideRageClickWindow(e,t){var r=e[Math.max(0,e.length-RAGE_CLICK_THRESHOLD+1)];return t.timestamp-r.timestamp>=RAGE_CLICK_WINDOW_MS}function isNewElement(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}function trackRageClicks(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,a=n.clickObservable,o=n.selectionObservable,s=[],l={},c=null;function d(e){s=[],l={},e&&(addCoordinates(l,e),s.push(e))}var u=asyncMap(a.filter((function(e){return i("click",e.closestTrackedAncestor)})),(function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(r){return addCoordinates(l,e),t=null,0===s.length||isNewElement(s,e)||isClickOutsideRageClickWindow(s,e)||l.isOutOfBounds?(c&&(t=getRageClickAnalyticsEvent(s)),d(e)):s.push(e),c&&(clearTimeout(c.timerId),c.resolve(t),c=null),s.length>=RAGE_CLICK_THRESHOLD?[2,new Promise((function(e){c={resolve:e,timerId:setTimeout((function(){e(getRageClickAnalyticsEvent(s))}),RAGE_CLICK_WINDOW_MS)}}))]:[2,null]}))}))})),p=null==o?void 0:o.subscribe((function(){d()})),h=u.subscribe((function(e){null!==e&&r.track(AMPLITUDE_ELEMENT_RAGE_CLICKED_EVENT,e.rageClickEvent,{time:e.time})}));return{unsubscribe:function(){h.unsubscribe(),null==p||p.unsubscribe()}}}var ERROR_CLICK_TIMEOUT=2e3,Direction,Axis;function trackErrorClicks(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackErrorClick,i=r.clickObservable,a=r.browserErrorObservable,o=i.filter((function(e){return filterOutNonTrackableEvents(e)&&n("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===MouseButton.LEFT_OR_TOUCH_CONTACT})),s=null,l=null,c=function(){null!==s&&(clearTimeout(s),s=null),l=null};return merge$1(o,a).subscribe((function(e){var r;if("click"===e.type)return c(),l=e,void(s=setTimeout(c,ERROR_CLICK_TIMEOUT));"error"===e.type&&l&&(t.track(AMPLITUDE_ELEMENT_ERROR_CLICKED_EVENT,__assign$1(((r={})["[Amplitude] Kind"]=e.event.kind,r["[Amplitude] Message"]=e.event.message,r["[Amplitude] Stack"]=e.event.stack,r["[Amplitude] Filename"]=e.event.filename,r["[Amplitude] Line Number"]=e.event.lineNumber,r["[Amplitude] Column Number"]=e.event.columnNumber,r),l.targetElementProperties)),c())}))}!function(e){e.INCREASING="increasing",e.DECREASING="decreasing"}(Direction||(Direction={})),function(e){e.X="x",e.Y="y"}(Axis||(Axis={}));var createMouseDirectionChangeObservable=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new Observable((function(e){var r=null,n=null,i=null;return t.subscribe((function(t){var a={x:t.clientX,y:t.clientY};null!==r?(a.x>r.x?(n===Direction.DECREASING&&e.next(Axis.X),n=Direction.INCREASING):a.x<r.x&&(n===Direction.INCREASING&&e.next(Axis.X),n=Direction.DECREASING),a.y>r.y?(i===Direction.DECREASING&&e.next(Axis.Y),i=Direction.INCREASING):a.y<r.y&&(i===Direction.INCREASING&&e.next(Axis.Y),i=Direction.DECREASING),r=a):r=a}))}))};function addDirectionChange(e){var t=+Date.now();e.startTime=e.startTime||t;var r=e.changes,n=e.changesThreshold;r.push(t),r.length>n&&r.shift()}function isThrashedCursor(e){var t=e.changes,r=e.changesThreshold,n=e.thresholdMs;return!(t.length<r)&&t[t.length-1]-t[0]<n}function resetDirectionChangeSeries(e){e.changes=[],e.startTime=void 0}function adjustWindow(e){for(var t=e.changes,r=e.thresholdMs,n=0,i=t[t.length-1];n<t.length;n++){if(i-t[n]<r)break}0!==n&&(e.startTime=t[n],e.changes.splice(0,n))}function getPendingThrashedCursor(e,t){var r=void 0;if(isThrashedCursor(e)&&(r=e.startTime),isThrashedCursor(t)){var n=t.startTime;n&&(!r||n<r)&&(r=n)}return r}var DEFAULT_THRESHOLD=10,DEFAULT_WINDOW_MS=2e3,createThrashedCursorObservable=function(e){var t=e.mouseDirectionChangeObservable,r=e.directionChanges,n=void 0===r?DEFAULT_THRESHOLD:r,i=e.thresholdMs,a=void 0===i?DEFAULT_WINDOW_MS:i;return new Observable((function(e){var r={changes:[],changesThreshold:n,thresholdMs:a},i={changes:[],changesThreshold:n,thresholdMs:a},o=void 0,s=null;function l(){void 0!==o&&(e.next(o),o=void 0,null!==s&&clearTimeout(s),resetDirectionChangeSeries(r),resetDirectionChangeSeries(i))}return t.subscribe((function(e){null!==s&&clearTimeout(s),addDirectionChange(e===Axis.X?r:i);var t=getPendingThrashedCursor(r,i);return t?(o=o||t,s=setTimeout((function(){l(),s=null}),a)):l(),adjustWindow(r),adjustWindow(i),function(){null!==s&&(clearTimeout(s),s=null)}}))}))},trackThrashedCursor=function(e){var t=e.amplitude,r=e.options,n=e.allObservables,i=e.directionChanges,a=void 0===i?DEFAULT_THRESHOLD:i,o=e.thresholdMs,s=void 0===o?DEFAULT_WINDOW_MS:o,l=createMouseDirectionChangeObservable({allWindowObservables:n});return createThrashedCursorObservable({mouseDirectionChangeObservable:l,directionChanges:a,thresholdMs:s}).subscribe((function(e){isUrlAllowed(r)&&t.track(AMPLITUDE_THRASHED_CURSOR_EVENT,void 0,{time:e})}))};function getCssSelectorAllowlist(e,t,r,n){if(!n)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:r}var MINIMUM_THRASHED_CURSOR_DIRECTION_CHANGES=5,MAXIMUM_THRASHED_CURSOR_THRESHOLD=4e3,frustrationPlugin=function(e){var t;void 0===e&&(e={});var r=FRUSTRATION_PLUGIN_NAME,n=[],i=!1!==e.errorClicks;e.errorClicks||(i=!1);var a=!1!==e.deadClicks&&null!==e.deadClicks,o=!1!==e.rageClicks&&null!==e.rageClicks,s=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(s=!1);var l=getCssSelectorAllowlist(e,"rageClicks",DEFAULT_RAGE_CLICK_ALLOWLIST,o),c=getCssSelectorAllowlist(e,"deadClicks",DEFAULT_DEAD_CLICK_ALLOWLIST,a),d=getCssSelectorAllowlist(e,"errorClicks",DEFAULT_ERROR_CLICK_ALLOWLIST,i),u=null!==(t=e.dataAttributePrefix)&&void 0!==t?t:DEFAULT_DATA_ATTRIBUTE_PREFIX,p=new DataExtractor(e),h=__spreadArray([],__read$1(new Set(__spreadArray(__spreadArray(__spreadArray([],__read$1(l),!1),__read$1(c),!1),__read$1(d),!1))),!1);return{name:r,type:"enrichment",setup:function(t,f){return __awaiter(void 0,void 0,void 0,(function(){var m,g,v,y,b,E,_,S,T,x,k;return __generator(this,(function(A){return"undefined"==typeof document||(m=function(){var e,t,r=multicast(createClickObservable("pointerdown").map((function(e){return p.addAdditionalEventProperties(e,"click",h,u,!0)}))),n=multicast(createErrorObservable().map((function(e){return p.addTypeAndTimestamp(e,"error")}))),i=multicast(createMutationObservable().map((function(e){return p.addAdditionalEventProperties(e,"mutation",h,u)})));window.navigation&&(t=multicast(new Observable((function(e){var t=function(t){e.next(__assign$1(__assign$1({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}})).map((function(e){return p.addAdditionalEventProperties(e,"navigate",h,u)}))));var a=multicast(new Observable((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 r=window.getSelection();if(r&&!r.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}}))),o=multicast(createMouseMoveObservable());return(e={})[ObservablesEnum$1.ClickObservable]=r,e[ObservablesEnum$1.MutationObservable]=i,e[ObservablesEnum$1.NavigateObservable]=t,e[ObservablesEnum$1.BrowserErrorObservable]=n,e[ObservablesEnum$1.SelectionObservable]=a,e[ObservablesEnum$1.MouseMoveObservable]=o,e}(),o&&(g=createShouldTrackEvent(e,l),v=trackRageClicks({allObservables:m,amplitude:f,shouldTrackRageClick:g}),n.push(v)),a&&(y=createShouldTrackEvent(e,c),b=trackDeadClick({amplitude:f,allObservables:m,getEventProperties:function(e,t){return p.getEventProperties(e,t,u)},shouldTrackDeadClick:y}),n.push(b)),i&&(E=createShouldTrackEvent(e,d),_=trackErrorClicks({amplitude:f,allObservables:m,shouldTrackErrorClick:E}),n.push(_)),s&&(S=void 0,T=void 0,"object"==typeof e.thrashedCursor&&(S=e.thrashedCursor.directionChanges,T=e.thrashedCursor.threshold,S&&S<MINIMUM_THRASHED_CURSOR_DIRECTION_CHANGES&&(t.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(S," is below the minimum of ").concat(MINIMUM_THRASHED_CURSOR_DIRECTION_CHANGES,", setting to ").concat(MINIMUM_THRASHED_CURSOR_DIRECTION_CHANGES)),S=MINIMUM_THRASHED_CURSOR_DIRECTION_CHANGES),T&&T>MAXIMUM_THRASHED_CURSOR_THRESHOLD&&(t.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(T," is above the maximum of ").concat(MAXIMUM_THRASHED_CURSOR_THRESHOLD,", setting to ").concat(MAXIMUM_THRASHED_CURSOR_THRESHOLD)),T=MAXIMUM_THRASHED_CURSOR_THRESHOLD)),x=trackThrashedCursor({amplitude:f,options:e,allObservables:m,directionChanges:S,thresholdMs:T}),n.push(x)),null===(k=null==t?void 0:t.loggerProvider)||void 0===k||k.log("".concat(r," has been successfully added."))),[2]}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e]}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){var e,t,r,i;return __generator(this,(function(a){try{for(e=__values$1(n),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}return[2]}))}))}}},PLUGIN_NAME$1="@amplitude/plugin-network-capture-browser",AMPLITUDE_NETWORK_REQUEST_EVENT="[Amplitude] Network Request",DEFAULT_STATUS_CODE_RANGE="500-599",ObservablesEnum,subscription;function wildcardMatch(e,t){var r="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(r).test(e)}function isStatusCodeInRange(e,t){var r,n,i=t.split(",");try{for(var a=__values$1(i),o=a.next();!o.done;o=a.next()){var s=__read$1(o.value.split("-").map(Number),2),l=s[0],c=s[1];if(e===l&&void 0===c)return!0;if(e>=l&&e<=c)return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!1}function isCaptureRuleMatch(e,t,r,n,i){if((!e.hosts||e.hosts.find((function(e){return wildcardMatch(t,e)})))&&(!n||!e.urls||isUrlMatchAllowlist(n,e.urls))&&(!i||!e.methods||e.methods.find((function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))){if(r||0===r)if(!isStatusCodeInRange(r,e.statusCodeRange||DEFAULT_STATUS_CODE_RANGE))return!1;return!0}}function parseUrl$1(e){var t;if(e)try{var r=null===(t=getGlobalScope$1())||void 0===t?void 0:t.location.href,n=new URL(e,r),i=n.searchParams.toString(),a=n.hash.replace("#",""),o=n.href,s=n.host;return n.hash="",n.search="",{query:i,fragment:a,href:o,hrefWithoutQueryOrHash:n.href,host:s}}catch(e){return}}function isAmplitudeNetworkRequestEvent(e,t){if(e.includes("amplitude.com"))try{var r=t.body;if("string"!=typeof r)return!1;if(JSON.parse(r).events.find((function(e){return e.event_type===AMPLITUDE_NETWORK_REQUEST_EVENT})))return!0}catch(e){}return!1}function parseHeaderCaptureRule(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return __spreadArray([],__read$1(SAFE_HEADERS),!1);if(void 0===e){return}}}function isBodyCaptureRuleEmpty(e){var t,r;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(r=null==e?void 0:e.blocklist)||void 0===r?void 0:r.length)}function shouldTrackNetworkEvent(e,t){var r;void 0===t&&(t={});var n=parseUrl$1(e.url);if(!n)return!1;var i,a=n.host;if(!1!==t.ignoreAmplitudeRequests&&(wildcardMatch(a,"*.amplitude.com")||wildcardMatch(a,"amplitude.com")))return!1;if(null===(r=t.ignoreHosts)||void 0===r?void 0:r.find((function(e){return wildcardMatch(a,e)})))return!1;if(!t.captureRules&&void 0!==e.status&&!isStatusCodeInRange(e.status,DEFAULT_STATUS_CODE_RANGE))return!1;if(t.captureRules&&(__spreadArray([],__read$1(t.captureRules),!1).reverse().find((function(t){if(i=isCaptureRuleMatch(t,a,e.status,e.url,e.method)){var r=parseHeaderCaptureRule(t.responseHeaders);if(e.responseWrapper&&r){var n=e.responseWrapper.headers(r);n&&(e.responseHeaders=n)}var o=parseHeaderCaptureRule(t.requestHeaders);if(e.requestWrapper&&o){var s=e.requestWrapper.headers(o);s&&(e.requestHeaders=s)}e.responseWrapper&&t.responseBody&&!isBodyCaptureRuleEmpty(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!isBodyCaptureRuleEmpty(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}return void 0!==i})),!i))return!1;return!e.requestWrapper||!isAmplitudeNetworkRequestEvent(a,e.requestWrapper)}function logNetworkAnalyticsEvent(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,a,o;return __generator(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=__read$1.apply(void 0,[s.sent(),2]),a=i[0],o=i[1],a)try{e["[Amplitude] Request Body"]=JSON.stringify(a)}catch(e){null==n||n.debug("Failed to stringify request body",e)}if(o)try{e["[Amplitude] Response Body"]=JSON.stringify(o)}catch(e){null==n||n.debug("Failed to stringify response body")}s.label=2;case 2:return null==r||r.track(AMPLITUDE_NETWORK_REQUEST_EVENT,e),[2]}}))}))}function trackNetworkEvents(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter((function(e){return shouldTrackNetworkEvent(e.event,r)})).subscribe((function(e){var t,r,a,o=e.event,s=parseUrl$1(o.url);if(s){var l=null===(r=o.responseWrapper)||void 0===r?void 0:r.bodySize,c=null===(a=o.requestWrapper)||void 0===a?void 0:a.bodySize;logNetworkAnalyticsEvent(((t={})["[Amplitude] URL"]=s.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=s.query,t["[Amplitude] URL Fragment"]=s.fragment,t["[Amplitude] Request Method"]=o.method,t["[Amplitude] Status Code"]=o.status,t["[Amplitude] Start Time"]=o.startTime,t["[Amplitude] Completion Time"]=o.endTime,t["[Amplitude] Duration"]=o.duration,t["[Amplitude] Request Body Size"]=c,t["[Amplitude] Response Body Size"]=l,t["[Amplitude] Request Type"]=o.type,t["[Amplitude] Request Headers"]=o.requestHeaders,t["[Amplitude] Response Headers"]=o.responseHeaders,t),o,n,i)}}))}!function(e){e.NetworkObservable="networkObservable"}(ObservablesEnum||(ObservablesEnum={}));var networkCapturePlugin=function(e){void 0===e&&(e={});var t,r=PLUGIN_NAME$1,n=function(){var e,r=new Observable((function(e){var r=new NetworkEventCallback((function(t){var r=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(r)}));return networkObserver.subscribe(r,t),function(){networkObserver.unsubscribe(r)}}));return(e={})[ObservablesEnum.NetworkObservable]=r,e};return{name:r,type:"enrichment",setup:function(i,a){return __awaiter(void 0,void 0,void 0,(function(){var o;return __generator(this,(function(s){return"undefined"==typeof document||(o=n(),t=null==i?void 0:i.loggerProvider,subscription=trackNetworkEvents({allObservables:o,networkTrackingOptions:e,amplitude:a,loggerProvider:t}),null==t||t.log("".concat(r," has been successfully added."))),[2]}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e]}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return subscription.unsubscribe(),[2]}))}))}}},PLUGIN_NAME="web-vitals-browser",WEB_VITALS_EVENT_NAME="[Amplitude] Web Vitals";let e$8=-1;const t$4=e=>{addEventListener("pageshow",(t=>{t.persisted&&(e$8=t.timeStamp,e(t))}),!0)},n$7=(e,t,r,n)=>{let i,a;return o=>{t.value>=0&&(o||n)&&(a=t.value-(i??0),(a||void 0===i)&&(i=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t)))}},i$5=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},s$5=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},o$9=()=>{const e=s$5();return e?.activationStart??0},r$7=(e,t=-1)=>{const r=s$5();let n="navigate";return e$8>=0?n="back-forward-cache":r&&(document.prerendering||o$9()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},c$4=new WeakMap;function a$3(e,t){return c$4.get(e)||c$4.set(e,new t),c$4.get(e)}let d$2=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],r=this.o.at(-1);this.i&&t&&r&&e.startTime-r.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 h$7=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return n.observe({type:e,buffered:!0,...r}),n}}catch{}},f$3=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let u$3=-1;const l$3=new Set,m$1=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,p$2=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l$3)e();isFinite(u$3)||(u$3="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",p$2,!0))}},v$4=()=>{if(u$3<0){const e=o$9(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0]?.startTime;u$3=t??m$1(),addEventListener("visibilitychange",p$2,!0),addEventListener("prerenderingchange",p$2,!0),t$4((()=>{setTimeout((()=>{u$3=m$1()}))}))}return{get firstHiddenTime(){return u$3},onHidden(e){l$3.add(e)}}},g$1=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},y$2=[1800,3e3],E$1=(e,t={})=>{g$1((()=>{const r=v$4();let n,i=r$7("FCP");const a=h$7("paint",(e=>{for(const t of e)"first-contentful-paint"===t.name&&(a.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-o$9(),0),i.entries.push(t),n(!0)))}));a&&(n=n$7(e,i,y$2,t.reportAllChanges),t$4((r=>{i=r$7("FCP"),n=n$7(e,i,y$2,t.reportAllChanges),i$5((()=>{i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},b$2=[.1,.25],L$1=(e,t={})=>{const r=v$4();E$1(f$3((()=>{let n,i=r$7("CLS",0);const a=a$3(t,d$2),o=e=>{for(const t of e)a.h(t);a.i>i.value&&(i.value=a.i,i.entries=a.o,n())},s=h$7("layout-shift",o);s&&(n=n$7(e,i,b$2,t.reportAllChanges),r.onHidden((()=>{o(s.takeRecords()),n(!0)})),t$4((()=>{a.i=0,i=r$7("CLS",0),n=n$7(e,i,b$2,t.reportAllChanges),i$5((()=>n()))})),setTimeout(n))})))};let P$1=0,T=1/0,_$1=0;const M$1=e=>{for(const t of e)t.interactionId&&(T=Math.min(T,t.interactionId),_$1=Math.max(_$1,t.interactionId),P$1=_$1?(_$1-T)/7+1:0)};let w$4;const C$1=()=>w$4?P$1:performance.interactionCount??0,I$1=()=>{"interactionCount"in performance||w$4||(w$4=h$7("event",M$1,{type:"event",buffered:!0,durationThreshold:0}))};let F=0,k$1=class{u=[];l=new Map;m;p;v(){F=C$1(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((C$1()-F)/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 r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>t.P){if(r?e.duration>r.P?(r.entries=[e],r.P=e.duration):e.duration===r.P&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],P:e.duration},this.l.set(r.id,r),this.u.push(r)),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?.(r)}}};const A$1=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=f$3(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},B$1=[200,500],S$2=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=v$4();g$1((()=>{I$1();let n,i=r$7("INP");const a=a$3(t,k$1),o=e=>{A$1((()=>{for(const t of e)a.h(t);const t=a.L();t&&t.P!==i.value&&(i.value=t.P,i.entries=t.entries,n())}))},s=h$7("event",o,{durationThreshold:t.durationThreshold??40});n=n$7(e,i,B$1,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{o(s.takeRecords()),n(!0)})),t$4((()=>{a.v(),i=r$7("INP"),n=n$7(e,i,B$1,t.reportAllChanges)})))}))};let N$1=class{m;h(e){this.m?.(e)}};const q=[2500,4e3],x$1=(e,t={})=>{g$1((()=>{const r=v$4();let n,i=r$7("LCP");const a=a$3(t,N$1),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)a.h(t),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-o$9(),0),i.entries=[t],n())},s=h$7("largest-contentful-paint",o);if(s){n=n$7(e,i,q,t.reportAllChanges);const r=f$3((()=>{o(s.takeRecords()),s.disconnect(),n(!0)})),a=e=>{e.isTrusted&&(A$1(r),removeEventListener(e.type,a,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,a,{capture:!0});t$4((r=>{i=r$7("LCP"),n=n$7(e,i,q,t.reportAllChanges),i$5((()=>{i.value=performance.now()-r.timeStamp,n(!0)}))}))}}))},H$1=[800,1800],O=e=>{document.prerendering?g$1((()=>O(e))):"complete"!==document.readyState?addEventListener("load",(()=>O(e)),!0):setTimeout(e)},$$1=(e,t={})=>{let r=r$7("TTFB"),n=n$7(e,r,H$1,t.reportAllChanges);O((()=>{const i=s$5();i&&(r.value=Math.max(i.responseStart-o$9(),0),r.entries=[i],n(!0),t$4((()=>{r=r$7("TTFB",0),n=n$7(e,r,H$1,t.reportAllChanges),n(!0)})))}))};function getMetricStartTime(e){var t,r=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+r}function processMetric(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(getMetricStartTime(e)),navigationStart:Math.floor(performance.timeOrigin)}}var webVitalsPlugin=function(){var e=null,t=getGlobalScope$1(),r=null==t?void 0:t.document,n=null==t?void 0:t.location;return{name:PLUGIN_NAME,type:"enrichment",setup:function(t,i){return __awaiter(void 0,void 0,void 0,(function(){var a,o;return __generator(this,(function(s){return void 0===r||(a=getDecodeURI((null==n?void 0:n.href)||"",t.loggerProvider),o={"[Amplitude] Page Domain":(null==n?void 0:n.hostname)||"","[Amplitude] Page Location":a,"[Amplitude] Page Path":getDecodeURI((null==n?void 0:n.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":getDecodeURI(a.split("?")[0],t.loggerProvider)},x$1((function(e){o["[Amplitude] LCP"]=processMetric(e)})),E$1((function(e){o["[Amplitude] FCP"]=processMetric(e)})),S$2((function(e){o["[Amplitude] INP"]=processMetric(e)})),L$1((function(e){o["[Amplitude] CLS"]=processMetric(e)})),$$1((function(e){o["[Amplitude] TTFB"]=processMetric(e)})),e=function(){"hidden"===r.visibilityState&&e&&(i.track(WEB_VITALS_EVENT_NAME,o),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e)),[2]}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e]}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return e&&(null==r||r.removeEventListener("visibilitychange",e)),[2]}))}))}}},domainWithoutSubdomain=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},isDirectTraffic=function(e){return Object.values(e).every((function(e){return!e}))},isNewCampaign=function(e,t,r,n,i){void 0===i&&(i=!0),e.referrer;var a=e.referring_domain,o=__rest(e,["referrer","referring_domain"]),s=t||{};s.referrer;var l=s.referring_domain,c=__rest(s,["referrer","referring_domain"]);if(isExcludedReferrer(r.excludeReferrers,e.referring_domain))return n.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&isDirectTraffic(e)&&t)return n.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var d=JSON.stringify(o)!==JSON.stringify(c),u=domainWithoutSubdomain(a||"")!==domainWithoutSubdomain(l||""),p=!t||d||u;return p?n.debug("This is a new campaign. An $identify event will be sent."):n.debug("This is not a new campaign because it's the same as the previous one."),p},isExcludedReferrer=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}))},createCampaignEvent=function(e,t){var r=__assign$1(__assign$1({},BASE_CAMPAIGN),e),n=Object.entries(r).reduce((function(e,r){var n,i=__read$1(r,2),a=i[0],o=i[1];return e.setOnce("initial_".concat(a),null!==(n=null!=o?o:t.initialEmptyValue)&&void 0!==n?n:"EMPTY"),o?e.set(a,o):e.unset(a)}),new Identify);return createIdentifyEvent(n)},getDefaultExcludedReferrers=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},WebAttribution=function(){function e(e,t){var r;this.shouldTrackNewCampaign=!1,this.options=__assign$1({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:getDefaultExcludedReferrers(null===(r=t.cookieOptions)||void 0===r?void 0:r.domain),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=getStorageKey(t.apiKey,"MKTG"),this.webExpStorageKey=getStorageKey(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=BASE_CAMPAIGN,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 __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return t=__read$1.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||isNewSession(this.sessionTimeout,this.lastEventTime),isNewCampaign(this.currentCampaign,this.previousCampaign,this.options,this.logger,e)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},e.prototype.fetchCampaign=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(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 CampaignParser).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}}))}))},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t=createCampaignEvent(this.currentCampaign,this.options);return e&&(t.event_id=e),t},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),CURRENT_PAGE_STORAGE_KEY="AMP_CURRENT_PAGE",PREVIOUS_PAGE_STORAGE_KEY="AMP_PREVIOUS_PAGE",URL_INFO_STORAGE_KEY="AMP_URL_INFO",PreviousPageType;!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(PreviousPageType||(PreviousPageType={}));var EXCLUDED_DEFAULT_EVENT_TYPES=new Set([SpecialEventType.IDENTIFY,SpecialEventType.GROUP_IDENTIFY,SpecialEventType.REVENUE]),pageUrlEnrichmentPlugin=function(e){var t={}.internalDomains,r=void 0===t?[]:t,n=getGlobalScope$1(),i=void 0,a=!1,o=void 0,s=!1,l=!1,c=function(e){var t="undefined"!=typeof location&&location.hostname||"",n=e?function(e){var t;try{var r=getDecodeURI(e,o);t=new URL(r).hostname}catch(e){null==o||o.error("Could not parse URL: ",e)}return t}(e):void 0;if(!n)return PreviousPageType.Direct;var i=r.some((function(e){return-1!==t.indexOf(e)})),a=r.some((function(e){return-1!==n.indexOf(e)}));return t===n||a&&i?PreviousPageType.Internal:PreviousPageType.External},d=function(){__awaiter(void 0,void 0,void 0,(function(){var e,t,r,n,o;return __generator(this,(function(s){switch(s.label){case 0:return i&&a?[4,i.get(URL_INFO_STORAGE_KEY)]:[3,3];case 1:return e=s.sent(),t=getDecodeURI("undefined"!=typeof location&&location.href||""),r=(null==e?void 0:e[CURRENT_PAGE_STORAGE_KEY])||"",n=void 0,n=t===r?(null==e?void 0:e[PREVIOUS_PAGE_STORAGE_KEY])||"":r||document.referrer||"",[4,i.set(URL_INFO_STORAGE_KEY,(o={},o[CURRENT_PAGE_STORAGE_KEY]=t,o[PREVIOUS_PAGE_STORAGE_KEY]=n,o))];case 2:s.sent(),s.label=3;case 3:return[2]}}))}))},u={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return(o=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),l=!0,n?[4,(i=new BrowserStorage(n.sessionStorage)).isEnabled()]:[3,2];case 1:a=t.sent(),n.addEventListener("popstate",d),s||(n.history.pushState=new Proxy(n.history.pushState,{apply:function(e,t,r){var n=__read$1(r,3),i=n[0],a=n[1],o=n[2];e.apply(t,[i,a,o]),l&&d()}}),n.history.replaceState=new Proxy(n.history.replaceState,{apply:function(e,t,r){var n=__read$1(r,3),i=n[0],a=n[1],o=n[2];e.apply(t,[i,a,o]),l&&d()}}),s=!0),t.label=2;case 2:return[2]}}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r,n,o,s;return __generator(this,(function(l){switch(l.label){case 0:return t=getDecodeURI("undefined"!=typeof location&&location.href||""),i&&a?[4,i.get(URL_INFO_STORAGE_KEY)]:[3,5];case 1:return(null==(r=l.sent())?void 0:r[CURRENT_PAGE_STORAGE_KEY])?[3,3]:[4,i.set(URL_INFO_STORAGE_KEY,(s={},s[CURRENT_PAGE_STORAGE_KEY]=t,s[PREVIOUS_PAGE_STORAGE_KEY]=document.referrer||"",s))];case 2:l.sent(),l.label=3;case 3:return[4,i.get(URL_INFO_STORAGE_KEY)];case 4:if(n=l.sent(),o="",n&&(o=n[PREVIOUS_PAGE_STORAGE_KEY]||""),EXCLUDED_DEFAULT_EVENT_TYPES.has(e.event_type))return[2,e];e.event_properties=__assign$1(__assign$1({},e.event_properties||{}),{"[Amplitude] Page Domain":addIfNotExist(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":addIfNotExist(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":addIfNotExist(e,"[Amplitude] Page Path","undefined"!=typeof location&&getDecodeURI(location.pathname)||""),"[Amplitude] Page Title":addIfNotExist(e,"[Amplitude] Page Title",getPageTitle(replaceSensitiveString)),"[Amplitude] Page URL":addIfNotExist(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":o,"[Amplitude] Previous Page Type":c(o)}),l.label=5;case 5:return[2,e]}}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return n&&(n.removeEventListener("popstate",d),l=!1),i&&a?[4,i.set(URL_INFO_STORAGE_KEY,{})]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}};return u};function addIfNotExist(e,t,r){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?r:e.event_properties[t]}var UNSPECIFIED_SESSION_ID=-1,AmplitudeBrowser=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t}return __extends(t,e),t.prototype.init=function(e,t,r){var n,i;return void 0===e&&(e=""),arguments.length>2?(n=t,i=r):"string"==typeof t?(n=t,i=void 0):(n=null==t?void 0:t.userId,i=t),returnWrapper(this._init(__assign$1(__assign$1({},i),{userId:n,apiKey:e})))},t.prototype._init=function(t){var r,n,i,a,o,s,l;return __awaiter(this,void 0,void 0,(function(){var c,d,u,p,h,f,m,g,v,y,b,E,_,S,T,x=this;return __generator(this,(function(k){switch(k.label){case 0:return this.initializing?[2]:(this.initializing=!0,c=shouldFetchRemoteConfig(t),d=null!==(r=t.loggerProvider)&&void 0!==r?r:new Logger,u=null!==(n=t.serverZone)&&void 0!==n?n:DEFAULT_SERVER_ZONE,h=this._diagnosticsSampleRate,f=null===(i=t.enableDiagnostics)||void 0===i||i,c?(p=new RemoteConfigClient(t.apiKey,d,u,null===(a=t.remoteConfig)||void 0===a?void 0:a.serverUrl),[4,new Promise((function(e){null==p||p.subscribe("configs.diagnostics.browserSDK","all",(function(t,r,n){if(d.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(h=i);var a=t.enabled;"boolean"==typeof a&&(f=a)}e()}))}))]):[3,2]);case 1:k.sent(),k.label=2;case 2:return(m=new DiagnosticsClient(t.apiKey,d,u,{enabled:f,sampleRate:h})).setTag("library","".concat(LIBPREFIX,"/").concat(VERSION$1)),"undefined"!=typeof navigator&&m.setTag("user_agent",navigator.userAgent),[4,useBrowserConfig(t.apiKey,t,this,m,{loggerProvider:d,serverZone:u,enableDiagnostics:f,diagnosticsSampleRate:h})];case 3:return g=k.sent(),c&&p?[4,new Promise((function(e){null==p||p.subscribe("configs.analyticsSDK.browserSDK","all",(function(t,r,n){g.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t&&updateBrowserConfigWithRemoteConfig(t,g),e()}))}))]:[3,5];case 4:k.sent(),k.label=5;case 5:return[4,e.prototype._init.call(this,g)];case 6:return k.sent(),this.logBrowserOptions(g),this.config.remoteConfigClient=p,isAttributionTrackingEnabled(this.config.defaultTracking)?(this.config.optOut&&this.timeline.addOptOutListener((function(e){return __awaiter(x,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return e?[3,2]:(t=getAttributionTrackingConfig(this.config),this.webAttribution=new WebAttribution(t,this.config),[4,this.webAttribution.init()]);case 1:r.sent(),r.label=2;case 2:return[2]}}))}))})),v=getAttributionTrackingConfig(this.config),this.webAttribution=new WebAttribution(v,this.config),[4,this.webAttribution.init()]):[3,8];case 7:k.sent(),k.label=8;case 8:return y=getQueryParams(),b=y.ampTimestamp?Number(y.ampTimestamp):void 0,E=!b||Date.now()<b,_=E&&!Number.isNaN(Number(y.ampSessionId))?Number(y.ampSessionId):void 0,(S=this.config.deferredSessionId)!==UNSPECIFIED_SESSION_ID||this.config.optOut||(S=Date.now()),this.setSessionId(null!==(l=null!==(s=null!==(o=t.sessionId)&&void 0!==o?o:_)&&void 0!==s?s:S)&&void 0!==l?l:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener((function(e){return __awaiter(x,void 0,void 0,(function(){return __generator(this,(function(t){return!e&&this.config.deferredSessionId&&(this.config.deferredSessionId===UNSPECIFIED_SESSION_ID?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]}))}))})),(T=getAnalyticsConnector(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===OfflineDisabled?[3,10]:[4,this.add(networkConnectivityCheckerPlugin()).promise];case 9:k.sent(),k.label=10;case 10:return[4,this.add(new Destination({diagnosticsClient:m})).promise];case 11:return k.sent(),[4,this.add(new Context).promise];case 12:return k.sent(),[4,this.add(new IdentityEventSender).promise];case 13:return k.sent(),detNotify(this.config),isFileDownloadTrackingEnabled(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(fileDownloadTracking()).promise]):[3,15];case 14:k.sent(),k.label=15;case 15:return isFormInteractionTrackingEnabled(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(formInteractionTracking()).promise]):[3,17];case 16:k.sent(),k.label=17;case 17:return isPageViewTrackingEnabled(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(pageViewTrackingPlugin(getPageViewTrackingConfig(this.config))).promise]):[3,20];case 18:return k.sent(),[3,20];case 19:this.timeline.addOptOutListener((function(e){return __awaiter(x,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return e?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(pageViewTrackingPlugin(getPageViewTrackingConfig(this.config))).promise]);case 1:return t.sent(),[2]}}))}))})),k.label=20;case 20:return isElementInteractionsEnabled(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(autocapturePlugin(getElementInteractionsConfig(this.config),{diagnosticsClient:m})).promise]):[3,22];case 21:k.sent(),k.label=22;case 22:return isFrustrationInteractionsEnabled(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(frustrationPlugin(getFrustrationInteractionsConfig(this.config))).promise]):[3,24];case 23:k.sent(),k.label=24;case 24:return isNetworkTrackingEnabled(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(networkCapturePlugin(getNetworkTrackingConfig(this.config))).promise]):[3,26];case 25:k.sent(),k.label=26;case 26:return isWebVitalsEnabled(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(webVitalsPlugin()).promise]):[3,28];case 27:k.sent(),k.label=28;case 28:return isPageUrlEnrichmentEnabled(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(pageUrlEnrichmentPlugin()).promise]):[3,30];case 29:k.sent(),k.label=30;case 30:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 31:return k.sent(),T.eventBridge.setEventReceiver((function(e){var t=e.eventProperties||{},r=t.time,n=__rest(t,["time"]),i="number"==typeof r?{time:r}:void 0;x.track(e.eventType,n,i)})),[2]}}))}))},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}),setConnectorUserId(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}),setConnectorDeviceId(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(UUID()),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,r,n;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 Identify,a=null!==(n=e.userProperties)&&void 0!==n?n:{};try{for(var o=__values$1(Object.entries(a)),s=o.next();!s.done;s=o.next()){var l=__read$1(s.value,2),c=l[0],d=l[1];i.set(c,d)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}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,r=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),returnWrapper(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:UNSPECIFIED_SESSION_ID,returnWrapper(Promise.resolve());if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return returnWrapper(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var n=this.getSessionId();n!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,a=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,isSessionTrackingEnabled(this.config.defaultTracking)&&(n&&i&&r.push(this.track(DEFAULT_SESSION_END_EVENT,void 0,{device_id:this.previousSessionDeviceId,event_id:++a,session_id:n,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var o=this.trackCampaignEventIfNeeded(++a,r);return this.config.identify&&r.push(this.track(createIdentifyEvent(this.config.identify)).promise),isSessionTrackingEnabled(this.config.defaultTracking)&&r.push(this.track(DEFAULT_SESSION_START_EVENT,void 0,{event_id:o?++a:a,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,returnWrapper(Promise.all(r))},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=createTransport$1(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,r){if(isInstanceProxy(t)){var n=t._q;t._q=[],t=convertProxyObjectToRealObject(new Identify,n)}return(null==r?void 0:r.user_id)&&this.setUserId(r.user_id),(null==r?void 0:r.device_id)&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,t,r)},t.prototype.groupIdentify=function(t,r,n,i){if(isInstanceProxy(n)){var a=n._q;n._q=[],n=convertProxyObjectToRealObject(new Identify,a)}return e.prototype.groupIdentify.call(this,t,r,n,i)},t.prototype.revenue=function(t,r){if(isInstanceProxy(t)){var n=t._q;t._q=[],t=convertProxyObjectToRealObject(new Revenue,n)}return e.prototype.revenue.call(this,t,r)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var r=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(r).promise):this.track(r),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(a){return r=Date.now(),n=isNewSession(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===DEFAULT_SESSION_START_EVENT||t.event_type===DEFAULT_SESSION_END_EVENT||t.session_id&&t.session_id!==this.getSessionId()||(n||i?(this.setSessionId(r),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):n||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]}))}))},t.prototype.logBrowserOptions=function(e){try{var t=__assign$1(__assign$1({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",safeJsonStringify(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}(AmplitudeCore),createInstance=function(){var e=new AmplitudeBrowser;return{init:debugWrapper(e.init.bind(e),"init",getClientLogConfig(e),getClientStates(e,["config"])),add:debugWrapper(e.add.bind(e),"add",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.plugins"])),remove:debugWrapper(e.remove.bind(e),"remove",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.plugins"])),track:debugWrapper(e.track.bind(e),"track",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),logEvent:debugWrapper(e.logEvent.bind(e),"logEvent",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),identify:debugWrapper(e.identify.bind(e),"identify",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),groupIdentify:debugWrapper(e.groupIdentify.bind(e),"groupIdentify",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),setGroup:debugWrapper(e.setGroup.bind(e),"setGroup",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),revenue:debugWrapper(e.revenue.bind(e),"revenue",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),flush:debugWrapper(e.flush.bind(e),"flush",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),getUserId:debugWrapper(e.getUserId.bind(e),"getUserId",getClientLogConfig(e),getClientStates(e,["config","config.userId"])),setUserId:debugWrapper(e.setUserId.bind(e),"setUserId",getClientLogConfig(e),getClientStates(e,["config","config.userId"])),getDeviceId:debugWrapper(e.getDeviceId.bind(e),"getDeviceId",getClientLogConfig(e),getClientStates(e,["config","config.deviceId"])),setDeviceId:debugWrapper(e.setDeviceId.bind(e),"setDeviceId",getClientLogConfig(e),getClientStates(e,["config","config.deviceId"])),reset:debugWrapper(e.reset.bind(e),"reset",getClientLogConfig(e),getClientStates(e,["config","config.userId","config.deviceId"])),getSessionId:debugWrapper(e.getSessionId.bind(e),"getSessionId",getClientLogConfig(e),getClientStates(e,["config"])),setSessionId:debugWrapper(e.setSessionId.bind(e),"setSessionId",getClientLogConfig(e),getClientStates(e,["config"])),extendSession:debugWrapper(e.extendSession.bind(e),"extendSession",getClientLogConfig(e),getClientStates(e,["config"])),setOptOut:debugWrapper(e.setOptOut.bind(e),"setOptOut",getClientLogConfig(e),getClientStates(e,["config"])),setTransport:debugWrapper(e.setTransport.bind(e),"setTransport",getClientLogConfig(e),getClientStates(e,["config"])),getIdentity:debugWrapper(e.getIdentity.bind(e),"getIdentity",getClientLogConfig(e),getClientStates(e,["config"])),setIdentity:debugWrapper(e.setIdentity.bind(e),"setIdentity",getClientLogConfig(e),getClientStates(e,["config","config.userId","config.deviceId"])),getOptOut:debugWrapper(e.getOptOut.bind(e),"getOptOut",getClientLogConfig(e),getClientStates(e,["config"])),_setDiagnosticsSampleRate:debugWrapper(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",getClientLogConfig(e),getClientStates(e,["config"]))}},client=createInstance(),types=Object.freeze({__proto__:null,DEFAULT_ACTION_CLICK_ALLOWLIST:DEFAULT_ACTION_CLICK_ALLOWLIST,DEFAULT_CSS_SELECTOR_ALLOWLIST:DEFAULT_CSS_SELECTOR_ALLOWLIST,DEFAULT_DATA_ATTRIBUTE_PREFIX:DEFAULT_DATA_ATTRIBUTE_PREFIX,get IdentifyOperation(){return IdentifyOperation$1},get LogLevel(){return LogLevel},OfflineDisabled:OfflineDisabled,get RevenueProperty(){return RevenueProperty},get ServerZone(){return ServerZone},get SpecialEventType(){return SpecialEventType}}),add=client.add,extendSession=client.extendSession,flush=client.flush,getDeviceId=client.getDeviceId,getIdentity=client.getIdentity,getOptOut=client.getOptOut,getSessionId=client.getSessionId,getUserId=client.getUserId,groupIdentify=client.groupIdentify,identify=client.identify,init$1=client.init,logEvent=client.logEvent,remove=client.remove,reset$1=client.reset,revenue=client.revenue,setDeviceId=client.setDeviceId,setGroup=client.setGroup,setIdentity=client.setIdentity,setOptOut=client.setOptOut,setSessionId=client.setSessionId,setTransport=client.setTransport,setUserId=client.setUserId,track=client.track,_setDiagnosticsSampleRate=client._setDiagnosticsSampleRate,amplitude=Object.freeze({__proto__:null,AmplitudeBrowser:AmplitudeBrowser,Identify:Identify,Revenue:Revenue,Types:types,_setDiagnosticsSampleRate:_setDiagnosticsSampleRate,add:add,createInstance:createInstance,extendSession:extendSession,flush:flush,getDeviceId:getDeviceId,getIdentity:getIdentity,getOptOut:getOptOut,getSessionId:getSessionId,getUserId:getUserId,groupIdentify:groupIdentify,identify:identify,init:init$1,logEvent:logEvent,remove:remove,reset:reset$1,revenue:revenue,runQueuedFunctions:runQueuedFunctions,setDeviceId:setDeviceId,setGroup:setGroup,setIdentity:setIdentity,setOptOut:setOptOut,setSessionId:setSessionId,setTransport:setTransport,setUserId:setUserId,track:track});const IFRAME_EVENTS={READY:"qonto.ready"},ACTIONS={CARD_SEE:"card.see",CARD_SEE_DETAILS:"card.see-details",CARD_ORDER:"card.order",CARD_UNLOCK:"card.unlock",CARD_SHOW_PIN:"card.show.pin",CARD_SET_PIN:"card.set.pin",TRANSFER_SINGLE_CREATE:"transfer.single.create",TRANSFER_BULK_CREATE:"transfer.bulk.create",BENEFICIARIES_TRUST:"beneficiary.trust"},ENVIRONMENTS={PRODUCTION:"production",STAGING:"staging",LOCAL:"local"},BRANCHES={MASTER:"master",SANDBOX:"sandbox",QA:"qa"},ACTIVITY_TAGS={ATM:"atm",FALLBACK:"fallback",FEES:"fees",FINANCE:"finance",FOOD_AND_GROCERY:"food_and_grocery",GAS_STATION:"gas_station",HARDWARE_AND_EQUIPMENT:"hardware_and_equipment",HOTEL_AND_LODGING:"hotel_and_lodging",INSURANCE:"insurance",IT_AND_ELECTRONICS:"it_and_electronics",LEGAL_AND_ACCOUNTING:"legal_and_accounting",LOGISTICS:"logistics",MANUFACTURING:"manufacturing",MARKETING:"marketing",OFFICE_RENTAL:"office_rental",OFFICE_SUPPLY:"office_supply",ONLINE_SERVICE:"online_service",OTHER_EXPENSE:"other_expense",OTHER_INCOME:"other_income",OTHER_SERVICE:"other_service",PENDING:"pending",REFUND:"refund",RESTAURANT_AND_BAR:"restaurant_and_bar",SALES:"sales",SALARY:"salary",SUBSCRIPTION:"subscription",TAX:"tax",TRANSPORT:"transport",TREASURY_AND_INTERCO:"treasury_and_interco",UTILITY:"utility",VOUCHER:"voucher"},BENEFICIARY_STATUSES={PENDING:"pending",VALIDATED:"validated",DECLINED:"declined"},LOCALES$1={EN:"en",FR:"fr",DE:"de",ES:"es",IT:"it",PT:"pt"},TRANSFER_DECLINE_REASONS={BENEFICIARY_BIC_INVALID:"beneficiary_bic_invalid",BENEFICIARY_IBAN_INVALID:"beneficiary_iban_invalid",BENEFICIARY_STATUS:"beneficiary_status",BENEFICIARY_NETWORK_RULES_ERROR:"beneficiary_network_rules_error",ORGANISATION_COMPLIANCE_REASONS:"organisation_compliance_reasons",DEBIT_ACCOUNT_INSUFFICIENT_FUNDS:"debit_account_insufficient_funds",QONTO_PROCESSING_FAILED:"qonto_processing_failed"},TRANSFER_STATUSES={PENDING:"pending",PROCESSING:"processing",CANCELED:"canceled",DECLINED:"declined",SETTLED:"settled",FAILED:"failed",COMPLETED:"completed"},TRANSACTION_STATUSES={PENDING:"pending",DECLINED:"declined",COMPLETED:"completed"},MFA_METHODS={PASSKEY:"passkey",SMS_OTP:"sms-otp",PAIRED_DEVICE:"paired-device",MOCK:"mock"},AMOUNT_REQUIRING_ATTACHMENTS=3e4,VOP_CHECK_RESULTS={MATCH_RESULT_MATCH:"MATCH_RESULT_MATCH",MATCH_RESULT_NO_MATCH:"MATCH_RESULT_NO_MATCH",MATCH_RESULT_CLOSE_MATCH:"MATCH_RESULT_CLOSE_MATCH",MATCH_RESULT_NOT_POSSIBLE:"MATCH_RESULT_NOT_POSSIBLE",MATCH_RESULT_UNSPECIFIED:"MATCH_RESULT_UNSPECIFIED"},VOP_DECISIONS={ACCEPT:"ACCEPT",REJECT:"REJECT"},AUTH_LINK_ACTIONS={CARD_DISPLAY:"display_card",PAYMENT_LINK_CREATE:"create_payment_link",SEPA_TRANSFER_CREATE:"create_sepa_transfer"},HTTP_CODES={PRECONDITION_REQUIRED:428};var constants$1=Object.freeze({__proto__:null,ACTIONS:ACTIONS,ACTIVITY_TAGS:ACTIVITY_TAGS,AMOUNT_REQUIRING_ATTACHMENTS:AMOUNT_REQUIRING_ATTACHMENTS,AUTH_LINK_ACTIONS:AUTH_LINK_ACTIONS,BENEFICIARY_STATUSES:BENEFICIARY_STATUSES,BRANCHES:BRANCHES,ENVIRONMENTS:ENVIRONMENTS,HTTP_CODES:HTTP_CODES,IFRAME_EVENTS:IFRAME_EVENTS,LOCALES:LOCALES$1,MFA_METHODS:MFA_METHODS,TRANSACTION_STATUSES:TRANSACTION_STATUSES,TRANSFER_DECLINE_REASONS:TRANSFER_DECLINE_REASONS,TRANSFER_STATUSES:TRANSFER_STATUSES,VOP_CHECK_RESULTS:VOP_CHECK_RESULTS,VOP_DECISIONS:VOP_DECISIONS});const EMBED_BASE_URL_PROD="https://embed.qonto.com",EMBED_BASE_URL_STAGING="https://embed-js{branch}.staging.qonto.co",EMBED_BASE_URL_LOCAL="https://embed.dev.qonto.co",urlsPerEnvironment={[ENVIRONMENTS.PRODUCTION]:{EMBED_BASE_URL:EMBED_BASE_URL_PROD,EMBED_URL:`${EMBED_BASE_URL_PROD}/connect`,THIRD_PARTY_API_URL:"https://thirdparty.qonto.com"},[ENVIRONMENTS.STAGING]:{EMBED_BASE_URL:EMBED_BASE_URL_STAGING,EMBED_URL:`${EMBED_BASE_URL_STAGING}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"},[ENVIRONMENTS.LOCAL]:{EMBED_BASE_URL:EMBED_BASE_URL_LOCAL,EMBED_URL:`${EMBED_BASE_URL_LOCAL}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"}};class EnvironmentManager{constructor(){let e,t;this.environment=ENVIRONMENTS.PRODUCTION,this.branch=BRANCHES.SANDBOX,"undefined"!=typeof process&&process.env&&(e=process.env.QONTO_EMBED_ENVIRONMENT,t=process.env.QONTO_EMBED_BRANCH),this.environment=Object.values(ENVIRONMENTS).includes(e)?e:ENVIRONMENTS.PRODUCTION,this.branch=Object.values(BRANCHES).includes(t)?t:BRANCHES.SANDBOX}static getInstance(){return EnvironmentManager.instance||(EnvironmentManager.instance=new EnvironmentManager),EnvironmentManager.instance}setEnvironment(e){this.environment=e}getEnvironment(){return this.environment}isProductionEnvironment(){return this.environment===ENVIRONMENTS.PRODUCTION}setBranch(e){this.branch=e}getBranch(){return this.branch}clear(){this.environment=ENVIRONMENTS.PRODUCTION,this.branch=BRANCHES.MASTER}getEnvironmentUrls(){if(this.environment===ENVIRONMENTS.PRODUCTION)return urlsPerEnvironment.production;{const e=urlsPerEnvironment[this.environment];return Object.entries(e).reduce(((e,[t,r])=>({...e,[t]:r.replace("{branch}",`-${this.branch}`)})),{})}}}const environmentManager=EnvironmentManager.getInstance();class OperationSettingsManager{constructor(){this.mfaPreference=MFA_METHODS.PASSKEY,this.debugMode=!1}static getInstance(){return OperationSettingsManager.instance||(OperationSettingsManager.instance=new OperationSettingsManager),OperationSettingsManager.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=MFA_METHODS.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 operationSettingsManager=OperationSettingsManager.getInstance(),SDK_PREFIX="[Qonto Embed SDK]";function isDebugEnabled(){return operationSettingsManager.getDebugMode()}function info(e,t){if(!isDebugEnabled())return;const r=void 0!==t?[SDK_PREFIX,e,t]:[SDK_PREFIX,e];console.log(...r)}function isRunningInBrowser(){return"undefined"!=typeof window&&"undefined"!=typeof document}function isRunningInServer(){return!isRunningInBrowser()}class AmplitudeManager{constructor(){this.isInitialized=!1}static getInstance(){return AmplitudeManager.instance||(AmplitudeManager.instance=new AmplitudeManager),AmplitudeManager.instance}initialize(){if(this.isInitialized||isRunningInServer())return;const e=environmentManager.getEnvironment()||"production",t=e===ENVIRONMENTS.PRODUCTION?"52c120d2f5c89ca646fae6649a1ce7ad":"373aa80c38e5bc2a55895a96c8447fef";try{if(!amplitude||"function"!=typeof init$1)throw new Error("Analytics SDK module not available");const r={defaultTracking:{sessions:!1,pageViews:!1,formInteractions:!1,fileDownloads:!1},logLevel:e!==ENVIRONMENTS.PRODUCTION?LogLevel.Debug:LogLevel.None};init$1(t,void 0,r),this.isInitialized=!0,this.track(ANALYTICS_EVENTS.SDK_INITIALIZED)}catch(e){console.error("Failed to initialize analytics tracking:",e)}}isEnabled(){return this.isInitialized}track(e,t){if(this.isInitialized)try{track(e,t)}catch(e){console.error("Failed to track analytics event:",e)}}reset(){if(this.isInitialized)try{reset$1()}catch(e){console.error("Failed to reset analytics:",e)}}}const amplitudeManager=AmplitudeManager.getInstance();function initialize$2(){amplitudeManager.initialize()}function reset(){amplitudeManager.reset()}function trackEvent(e,t){amplitudeManager.track(e,t)}const tracker={cardsList:e=>{trackEvent(ANALYTICS_EVENTS.CARDS_LIST,e)},cardsGet:e=>{trackEvent(ANALYTICS_EVENTS.CARDS_GET,e)},cardsOrder:e=>{trackEvent(ANALYTICS_EVENTS.CARDS_ORDER,e)},cardsUnlock:e=>{trackEvent(ANALYTICS_EVENTS.CARDS_UNLOCK,e)},cardsDisplay:e=>{trackEvent(ANALYTICS_EVENTS.CARDS_DISPLAY,e)},beneficiariesList:e=>{trackEvent(ANALYTICS_EVENTS.BENEFICIARIES_LIST,e)},beneficiariesGet:e=>{trackEvent(ANALYTICS_EVENTS.BENEFICIARIES_GET,e)},beneficiariesAdd:e=>{trackEvent(ANALYTICS_EVENTS.BENEFICIARIES_ADD,e)},beneficiariesUpdate:e=>{trackEvent(ANALYTICS_EVENTS.BENEFICIARIES_UPDATE,e)},beneficiariesTrust:e=>{trackEvent(ANALYTICS_EVENTS.BENEFICIARIES_TRUST,e)},beneficiariesUntrust:e=>{trackEvent(ANALYTICS_EVENTS.BENEFICIARIES_UNTRUST,e)},sepaTransferList:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_LIST,e)},sepaTransferGet:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_GET,e)},sepaTransferCreate:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_CREATE,e)},sepaTransferCancel:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_CANCEL,e)},sepaTransferCreationFlowLink:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_CREATION_FLOW_LINK,e)},sepaTransferBulkList:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_BULK_LIST,e)},sepaTransferBulkGet:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_BULK_GET,e)},sepaTransferBulkCreate:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_BULK_CREATE,e)},transactionsList:e=>{trackEvent(ANALYTICS_EVENTS.TRANSACTIONS_LIST,e)},transactionsGet:e=>{trackEvent(ANALYTICS_EVENTS.TRANSACTIONS_GET,e)},organizationsList:e=>{trackEvent(ANALYTICS_EVENTS.ORGANIZATIONS_LIST,e)},organizationsBankAccounts:e=>{trackEvent(ANALYTICS_EVENTS.ORGANIZATIONS_BANK_ACCOUNTS,e)},paymentLinksCreate:e=>{trackEvent(ANALYTICS_EVENTS.PAYMENT_LINKS_CREATE,e)},paymentLinksRedirect:e=>{trackEvent(ANALYTICS_EVENTS.PAYMENT_LINKS_REDIRECT,e)},authLinksRequest:e=>{trackEvent(ANALYTICS_EVENTS.AUTH_LINKS_REQUEST,e)},uiElementCreated:(e,t)=>{trackEvent(ANALYTICS_EVENTS.UI_ELEMENT_CREATED,{uiElementType:e,...t})}};class AuthManager{constructor(){this.accessToken=null,this.stagingToken=null}static getInstance(){return AuthManager.instance||(AuthManager.instance=new AuthManager),AuthManager.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 authManager=AuthManager.getInstance();class QontoEmbedSdkError extends Error{constructor(){super(),this.stack=""}toString(){return`${this.name}: ${this.message}`}}class AuthenticationError extends QontoEmbedSdkError{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 validatePresenceOfAuthToken(){if(!authManager.hasAccessToken())throw new AuthenticationError;return authManager.getAccessToken()}function base64Encode(e){return isRunningInServer()?Buffer.from(e).toString("base64"):btoa(e)}function base64Decode(e){return isRunningInServer()?Buffer.from(e,"base64").toString("utf-8"):atob(e)}class LocaleManager{constructor(){this.currentLocale="en"}static getInstance(){return LocaleManager.instance||(LocaleManager.instance=new LocaleManager),LocaleManager.instance}setLocale(e){this.currentLocale=e}getLocale(){return this.currentLocale}setDefaultLocale(){this.currentLocale="en"}}const localeManager=LocaleManager.getInstance();class EmbedApiError extends QontoEmbedSdkError{constructor({message:e,data:t,code:r}){super(),this.code=500;const n=Array.isArray(e)?e.join("\n"):e;this.name="EmbedApiError",this.message=`The call to the Embed API failed with the following errors:\n${n}`,this.data=t||{},this.code=r||this.code}}function buildRequestHeaders({accessToken:e,stagingToken:t,idempotencyKey:r,mfaPreference:n,scaSessionToken:i}){const a=new Headers;a.append("Authorization",`Bearer ${e}`);const o=t||authManager.getStagingToken();o&&a.append("X-Qonto-Staging-Token",o),r&&a.append("X-Qonto-Idempotency-Key",r);const s=n||operationSettingsManager.getMFAPreference();return s&&a.append("X-Qonto-2fa-Preference",s),i&&a.append("X-Qonto-SCA-Session-Token",i),a.append("Content-Type","application/json"),a.append("Accept-Language",localeManager.getLocale()),a}async function makeNetworkCall({path:e,options:t}){const r=`${environmentManager.getEnvironmentUrls().THIRD_PARTY_API_URL}${e}`,n=await fetch(r,{...t,headers:buildRequestHeaders(t.headers),body:t.body?JSON.stringify(t.body):void 0});if(204===n.status)return;const i=await n.json();if(!n.ok)throw i.errors?new EmbedApiError({code:n.status,message:i.errors.map((e=>`${e.code}: ${e.detail}`))}):new EmbedApiError({code:n.status,message:`${i.code}: ${i.detail}`,data:i});return i}function encodeNetworkCall(e){const t={method:e.options.method,headers:e.options.headers,path:e.path,payload:e.options?.body};return base64Encode(JSON.stringify(t))}function decodeNetworkResponse(e){return JSON.parse(base64Decode(e))}class EmbedOperationError extends QontoEmbedSdkError{constructor(e){super(),this.name="EmbedOperationError",this.message=e}}function getUIParentElement(e){let t=null;if(t="function"==typeof e?e():document.getElementById(e),!(t&&t instanceof HTMLElement))throw new EmbedOperationError(`Could not install the UI Element because the parent element with id ${e} was not found.\nPlease make sure to pass a valid parentElementId or ensure the parentElementId function returns a valid element.`);return t}async function callProxyFunction({proxyFunction:e,networkCallDescriptor:t,proxyEndpointDescriptor:r}){if(r){const e={...Object.fromEntries([...buildRequestHeaders(t.options?.headers)??{}])},n=encodeNetworkCall({...t,options:{...t.options,headers:e}}),i=await fetch(r.path,{method:r.method,headers:r.options.headers,body:n}),a=decodeNetworkResponse(await i.text());if(!i.ok)throw new EmbedApiError({code:i.status,data:a,message:`Error from proxy endpoint: ${i.status} ${i.statusText}`});return a}if(e){const r=Object.fromEntries([...buildRequestHeaders(t.options?.headers)??{}]),n=encodeNetworkCall({...t,options:{...t.options,headers:r}});return decodeNetworkResponse(await e(n))}throw new EmbedOperationError("No proxy function or proxy endpoint descriptor provided for proxy call.")}class InvalidParametersError extends QontoEmbedSdkError{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")}`}}const defaultOperationSettingsValidationConfiguration={requiresUI:!1};function validateOperationSettingsParams(e,{requiresUI:t}=defaultOperationSettingsValidationConfiguration){const r=e?.uiParentElementId||operationSettingsManager.getUIParentElementId();if(t){if(!r)throw new InvalidParametersError("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 r))throw new InvalidParametersError("operationSettings.uiParentElementId must be a string or a function returning an HTMLElement")}const n=e?.mfaPreference||operationSettingsManager.getMFAPreference();if(n){const e=getMfaValuesAvailableInCurrentEnvironment(Object.values(MFA_METHODS));if(!e.includes(n))throw new InvalidParametersError(`operationSettings.mfaPreference must be one of ${e.join(", ")}`);if(environmentManager.isProductionEnvironment()&&n===MFA_METHODS.MOCK)throw new InvalidParametersError("operationSettings.mfaPreference cannot be set to mock in production environment.")}const i=e?.debugMode||operationSettingsManager.getDebugMode();if(void 0!==i&&"boolean"!=typeof i)throw new InvalidParametersError("operationSettings.debugMode must be a boolean.");const a=e?.proxyRequestFunction||operationSettingsManager.getProxyRequestFunction();if(a&&"function"!=typeof a)throw new InvalidParametersError("operationSettings.proxyRequestFunction must be a function.");const o=e?.proxyEndpointDescriptor||operationSettingsManager.getProxyEndpointDescriptor();if(o&&!o.path)throw new InvalidParametersError("operationSettings.proxyEndpointDescriptor must have at least a string-formatted path property.");return{...e,uiParentElementId:r,mfaPreference:n,debugMode:i,proxyRequestFunction:a,proxyEndpointDescriptor:o}}function validateClientOperationSettings(e,t){const r=e?.proxyRequestFunction||operationSettingsManager.getProxyRequestFunction(),n=e?.proxyEndpointDescriptor||operationSettingsManager.getProxyEndpointDescriptor();if(!r&&!n)throw new InvalidParametersError(t||"Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. If you need to use accessToken, import the server version of this module.");return{...e,proxyRequestFunction:r,proxyEndpointDescriptor:n}}function getMfaValuesAvailableInCurrentEnvironment(e){return environmentManager.isProductionEnvironment()?e.filter((e=>e!==MFA_METHODS.MOCK)):e}function prepareAuthLinkRequest({accessToken:e,stagingToken:t,action:r,callbackUrl:n}){const i={post_authn_action:r};return n&&(i.callback_url=n),{path:"/v1/embed_auth_links",options:{method:"POST",headers:{accessToken:e,stagingToken:t},body:{embed_auth_link:i}}}}function serializeAuthLink(e){return{url:e.url,postAuthAction:e.post_authn_action,callbackUrl:e.callback_url,expiresAt:e.expired_at,usedAt:e.used_at}}function validatePresenceOfRequiredParams(e,t){const r=t.filter((t=>t.requiredIfPresent?!e[t.name]&&e[t.requiredIfPresent]:void 0===e[t.name])).map((e=>e.name));if(r.length>0)throw new InvalidParametersError(r.map((e=>`Missing required parameter: ${e}`)))}function validateExpectedStringValues(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"string"!=typeof e)).map((([e])=>`${e} must be a string`))}function validateExpectedBooleanValues(e){return Object.entries(e).filter((([,e])=>void 0!==e&&!1!==e&&!0!==e)).map((([e])=>`${e} must be a boolean`))}function validateExpectedNumericValues(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"number"!=typeof e)).map((([e])=>`${e} must be a number`))}function validateAuthLinkRequestSettings(e){if(!e||"object"!=typeof e)throw new InvalidParametersError("requestSettings must be an object");const t=e,{action:r,callbackUrl:n}=e;validatePresenceOfRequiredParams(t,[{name:"action"}]);const i=validateExpectedStringValues(t),a=Object.values(AUTH_LINK_ACTIONS);if(a.includes(r)||i.push(`action must be one of ${a.join(", ")}`),i.length>0)throw new InvalidParametersError(i);if(void 0!==n&&""===n.trim())throw new InvalidParametersError("callbackUrl cannot be empty")}async function request({requestSettings:e,operationSettings:t}){tracker.authLinksRequest(),validateAuthLinkRequestSettings(e);const{proxyRequestFunction:r,proxyEndpointDescriptor:n,stagingToken:i}=validateClientOperationSettings(t,'Client-side auth-links operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/auth-links" only in server-side/backend environments.'),a=prepareAuthLinkRequest({stagingToken:i,action:e.action,callbackUrl:e.callbackUrl});return serializeAuthLink((await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:a})).body)}const authLinks={request:request};function buildPaginationParams(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 serializePaginationResponse(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 byteToHex=[];for(let e=0;e<256;++e)byteToHex.push((e+256).toString(16).slice(1));function unsafeStringify(e,t=0){return(byteToHex[e[t+0]]+byteToHex[e[t+1]]+byteToHex[e[t+2]]+byteToHex[e[t+3]]+"-"+byteToHex[e[t+4]]+byteToHex[e[t+5]]+"-"+byteToHex[e[t+6]]+byteToHex[e[t+7]]+"-"+byteToHex[e[t+8]]+byteToHex[e[t+9]]+"-"+byteToHex[e[t+10]]+byteToHex[e[t+11]]+byteToHex[e[t+12]]+byteToHex[e[t+13]]+byteToHex[e[t+14]]+byteToHex[e[t+15]]).toLowerCase()}let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");getRandomValues=crypto.getRandomValues.bind(crypto)}return getRandomValues(rnds8)}const randomUUID="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var native={randomUUID:randomUUID};function _v4(e,t,r){const n=(e=e||{}).random??e.rng?.()??rng();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=15&n[6]|64,n[8]=63&n[8]|128,unsafeStringify(n)}function v4(e,t,r){return native.randomUUID&&!e?native.randomUUID():_v4(e)}function buildIframeMessage({actionId:e,actionData:t}){const r=operationSettingsManager.getMFAPreference();return{actionId:e,actionData:{...t,scaPreference:t.scaPreference||r,idempotencyKey:t.idempotencyKey||v4()}}}class EmbedIframe{constructor(e){this.options=e,this.iframe=null,this.parentElement=null,this.messageListeners=new Map,this.defaultTimeout=3e4;const t=new URL(e.iframeUrl);this.targetOrigin=`${t.protocol}//${t.host}`}async initialize(){if(this.iframe)return this;if(this.parentElement=getUIParentElement(this.options.parentElementId),!this.parentElement)throw new EmbedOperationError(`Could not install the authentication UI because the parent element with id ${this.options.parentElementId} was not found.\nPlease make sure to pass a valid parentElementId when calling the method.`);return new Promise(((e,t)=>{this.iframe=document.createElement("iframe"),this.iframe.src=this.options.iframeUrl,this.iframe.style.width="100%",this.iframe.style.height="100%",this.iframe.style.border="none";const r=this.options.timeout||this.defaultTimeout,n=setTimeout((()=>{window.removeEventListener("message",i),t(new EmbedOperationError(`Could not install the authentication UI because the timeout of ${r}ms was reached.\nPlease make sure the application can reach the Internet.`))}),r),i=t=>{t.data.eventId===IFRAME_EVENTS.READY&&(clearTimeout(n),window.removeEventListener("message",i),e(this))};window.addEventListener("message",i),this.parentElement?.appendChild(this.iframe)}))}postMessage(e){if(!this.iframe||!this.iframe.contentWindow)return Promise.reject(new EmbedOperationError("Attempted to perform an Embed operation without having the authentication UI initialized."));const t=buildIframeMessage(e);return new Promise(((e,r)=>{const n=i=>{if(i.data?.actionId===t.actionId){if("error"===i.data.status)return this.removeMessageListener(t.actionId,n),r(new EmbedOperationError(`An error occurred when performing the action ${t.actionId}.\n${JSON.stringify(i.data.payload)}`));this.removeMessageListener(t.actionId,n),e(i.data.payload)}};this.addMessageListener(t.actionId,n),this.iframe?.contentWindow?.postMessage(t,this.targetOrigin)}))}addMessageListener(e,t){this.messageListeners.has(e)||this.messageListeners.set(e,[]);this.messageListeners.get(e).push(t),window.addEventListener("message",t)}removeMessageListener(e,t){const r=this.messageListeners.get(e);if(r){const e=r.indexOf(t);-1!==e&&(r.splice(e,1),window.removeEventListener("message",t))}}destroy(){this.messageListeners.forEach((e=>{e.forEach((e=>{window.removeEventListener("message",e)}))})),this.messageListeners.clear(),this.iframe&&this.parentElement&&(this.parentElement.removeChild(this.iframe),this.iframe=null)}}function buildIframeUrl({accessToken:e,stagingToken:t,locale:r,debugMode:n}){const i=n||!1,a=r||localeManager.getLocale(),o=environmentManager.getEnvironmentUrls().EMBED_URL,s=t?`;staging_token=${encodeURIComponent(t)}`:"";return`${o}?debug=${i}&lang=${encodeURIComponent(a)}#access_token=${encodeURIComponent(e)}${s}`}function createIframe({parentElementId:e,iframeUrl:t}){return new EmbedIframe({parentElementId:e,iframeUrl:t}).initialize()}function serializeBeneficiary(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 serializeToNewBeneficiaryDataObject(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 BENEFICIARIES_ENDPOINT="/v2/sepa/beneficiaries";function prepareGetBeneficiariesCall({paginationSettings:e,accessToken:t,stagingToken:r}){const n={method:"GET",headers:{accessToken:t,stagingToken:r}},i=buildPaginationParams(e),a=i.size?`?${i.toString()}`:"";return{path:`${BENEFICIARIES_ENDPOINT}${a}`,options:n}}async function getBeneficiaries$2({paginationSettings:e,accessToken:t,stagingToken:r}){const n=prepareGetBeneficiariesCall({paginationSettings:e,accessToken:t,stagingToken:r}),{beneficiaries:i,meta:a}=await makeNetworkCall(n);return{beneficiaries:i,meta:a}}function prepareGetBeneficiaryCall({beneficiaryId:e,accessToken:t,stagingToken:r}){return{path:`${BENEFICIARIES_ENDPOINT}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:r}}}}async function getBeneficiary$2({accessToken:e,stagingToken:t,beneficiaryId:r}){const n=prepareGetBeneficiaryCall({beneficiaryId:r,accessToken:e,stagingToken:t}),{beneficiary:i}=await makeNetworkCall(n);return i}function prepareAddBeneficiaryCall({beneficiary:e,accessToken:t,stagingToken:r,idempotencyKey:n=v4()}){return{path:BENEFICIARIES_ENDPOINT,options:{method:"POST",headers:{accessToken:t,stagingToken:r,idempotencyKey:n},body:{beneficiary:serializeToNewBeneficiaryDataObject(e)}}}}function prepareUntrustBeneficiaryCall({beneficiaryIds:e,accessToken:t,stagingToken:r}){return{path:`${BENEFICIARIES_ENDPOINT}/untrust`,options:{method:"PATCH",headers:{accessToken:t,stagingToken:r},body:{ids:e}}}}function prepareUpdateBeneficiaryCall({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:r,idempotencyKey:n,mfaPreference:i}){const{name:a,email:o,activityTag:s}=e,l={method:"PATCH",headers:{accessToken:t,stagingToken:r,idempotencyKey:n,mfaPreference:i},body:{beneficiary:{name:a,email:o,activity_tag:s}}};return{path:`${BENEFICIARIES_ENDPOINT}/${e.id}`,options:l}}const requiredNewBeneficiaryParams=[{name:"name"},{name:"iban"}];function validateGetBeneficiaryParams(e){if(!e)throw new InvalidParametersError("beneficiaryId parameter is required for the called function");if(e&&"string"!=typeof e)throw new InvalidParametersError("beneficiaryId must be a string");return e}function validateAddBeneficiaryParams(e){if(!e)throw new InvalidParametersError("beneficiary parameter is required for the called function");if("object"!=typeof e)throw new InvalidParametersError("beneficiary must be an object");validatePresenceOfRequiredParams(e,requiredNewBeneficiaryParams);const t=validateExpectedStringValues({name:e.name,iban:e.iban,email:e.email,activityTag:e.activityTag,bic:e.bic});if(t.length>0)throw new InvalidParametersError(t);return e}function validateUpdateBeneficiaryParams(e){const{id:t,name:r,email:n,activityTag:i}=e||{};if(!t)throw new InvalidParametersError("Invalid parameters were passed to the function:\nA beneficiary ID is required for the called function");if(!r&&!n&&!i)throw new InvalidParametersError("Invalid parameters were passed to the function:\nAt least one of the following properties must be provided: name, email, activityTag");const a=validateExpectedStringValues({name:r,email:n,activityTag:i});if(a.length>0)throw new InvalidParametersError(a);return{id:t,name:r,email:n,activityTag:i}}function validateTrustBeneficiariesParams(e){if(!e)throw new InvalidParametersError("beneficiaryIds parameter is required for the called function");if(!Array.isArray(e)||!e.every((e=>"string"==typeof e)))throw new InvalidParametersError("beneficiaryIds must be an array of strings");return e}async function getBeneficiaries$1(e){tracker.beneficiariesList();const{proxyRequestFunction:t,proxyEndpointDescriptor:r,paginationSettings:n}=validateClientOperationSettings(e?.operationSettings,'Client-side beneficiary operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/beneficiaries" only in server-side/backend environments.'),i=prepareGetBeneficiariesCall({paginationSettings:n}),a=await callProxyFunction({proxyFunction:t,proxyEndpointDescriptor:r,networkCallDescriptor:i}),o=a.body.beneficiaries.map((e=>serializeBeneficiary(e))),s=serializePaginationResponse(a.body.meta);return{beneficiaries:o,...s?{meta:s}:{}}}async function getBeneficiary$1({beneficiarySettings:e,operationSettings:t}){tracker.beneficiariesGet();const r=validateGetBeneficiaryParams(e?.beneficiaryId),{proxyRequestFunction:n,proxyEndpointDescriptor:i}=validateClientOperationSettings(t,'Client-side beneficiary operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/beneficiaries" only in server-side/backend environments.'),a=prepareGetBeneficiaryCall({beneficiaryId:r});return serializeBeneficiary((await callProxyFunction({proxyFunction:n,proxyEndpointDescriptor:i,networkCallDescriptor:a})).body.beneficiary)}async function addBeneficiary({beneficiarySettings:e,operationSettings:t}){tracker.beneficiariesAdd();const r=validateAddBeneficiaryParams(e),{proxyRequestFunction:n,proxyEndpointDescriptor:i,idempotencyKey:a}=validateClientOperationSettings(t,'Client-side beneficiary operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/beneficiaries" only in server-side/backend environments.'),o=prepareAddBeneficiaryCall({beneficiary:r,idempotencyKey:a});o.options.headers=buildRequestHeaders({...o.options.headers});return serializeBeneficiary((await callProxyFunction({proxyFunction:n,proxyEndpointDescriptor:i,networkCallDescriptor:o})).body.beneficiary)}async function updateBeneficiary({beneficiarySettings:e,operationSettings:t}){tracker.beneficiariesUpdate();const r=validateUpdateBeneficiaryParams(e),{proxyRequestFunction:n,proxyEndpointDescriptor:i,idempotencyKey:a,mfaPreference:o}=validateClientOperationSettings(t,'Client-side beneficiary operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/beneficiaries" only in server-side/backend environments.'),s=prepareUpdateBeneficiaryCall({beneficiaryParamsBeingEdited:r,idempotencyKey:a,mfaPreference:o});return serializeBeneficiary((await callProxyFunction({proxyFunction:n,proxyEndpointDescriptor:i,networkCallDescriptor:s})).body.beneficiary)}async function trustBeneficiaries({beneficiarySettings:e,operationSettings:t}){tracker.beneficiariesTrust();const{accessToken:r,uiParentElementId:n,debugMode:i}=validateOperationSettingsParams(t,{requiresUI:!0}),a=r||validatePresenceOfAuthToken(),o=validateTrustBeneficiariesParams(e?.beneficiaryIds),s=buildIframeUrl({accessToken:a,debugMode:i}),l=await createIframe({parentElementId:n,iframeUrl:s});return(await l.postMessage({actionId:ACTIONS.BENEFICIARIES_TRUST,actionData:{body:{beneficiaryIds:o}}})).beneficiaries}async function untrustBeneficiaries({beneficiarySettings:e,operationSettings:t}){tracker.beneficiariesUntrust();const r=validateTrustBeneficiariesParams(e?.beneficiaryIds),{proxyRequestFunction:n,proxyEndpointDescriptor:i}=validateClientOperationSettings(t,'Client-side beneficiary operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/beneficiaries" only in server-side/backend environments.'),a=prepareUntrustBeneficiaryCall({beneficiaryIds:r});return(await callProxyFunction({proxyFunction:n,proxyEndpointDescriptor:i,networkCallDescriptor:a})).body.beneficiaries.map(serializeBeneficiary)}const beneficiaries={getBeneficiaries:getBeneficiaries$1,getBeneficiary:getBeneficiary$1,addBeneficiary:addBeneficiary,updateBeneficiary:updateBeneficiary,trustBeneficiaries:trustBeneficiaries,untrustBeneficiaries:untrustBeneficiaries};function prepareGetCardsCall({membershipId:e,accessToken:t,stagingToken:r}){return{path:e?`/v2/cards?holder_ids[]=${e}`:"/v2/cards",options:{method:"GET",headers:{accessToken:t,stagingToken:r}}}}function prepareGetCardCall({cardId:e,accessToken:t,stagingToken:r}){return{path:`/v2/cards?ids[]=${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:r}}}}function prepareGetCardIframeUrl({accessToken:e,stagingToken:t}){return prepareAuthLinkRequest({accessToken:e,stagingToken:t,action:AUTH_LINK_ACTIONS.CARD_DISPLAY})}async function getCardIframeURL(e){const t=prepareGetCardIframeUrl(e),{embed_auth_link:r}=await makeNetworkCall(t);return r}var cards_api=Object.freeze({__proto__:null,getCardIframeURL:getCardIframeURL,prepareGetCardCall:prepareGetCardCall,prepareGetCardIframeUrl:prepareGetCardIframeUrl,prepareGetCardsCall:prepareGetCardsCall});const VIRTUAL_CARD_LEVEL={VIRTUAL:"virtual"},PHYSICAL_CARD_LEVEL={METAL:"metal",PLUS:"plus",STANDARD:"standard"},CUSTOM_PROP_PREFIX="--qonto-embed";function isSameDomain(e){return!e.href||e.href.startsWith(window.location.origin)}function isStyleRule(e){return"CSSStyleRule"===e.constructor.name}function extractVariablesFromStylesheet(e,t){return[...e].filter(isSameDomain).reduce(((e,r)=>[...r.cssRules].filter(isStyleRule).reduce(((e,r)=>{if("style"in r){const n=[...r.style].map((e=>[e.trim(),r.style.getPropertyValue(e).trim()])).filter((([e])=>e.startsWith(t))).reduce(((e,[r,n])=>({...e,[r.replace(`${t}-`,"")]:n})),{});return{...e,...n}}return e}),e)),{})}function gatherQontoEmbedCssVariables(e=CUSTOM_PROP_PREFIX){return isRunningInBrowser()?extractVariablesFromStylesheet(document.styleSheets,e):{}}function getPopulatedIframeURL(e,t){const r=new URL(e);r.searchParams.set("cardId",t.cardId),"boolean"==typeof t.allowPinReveal&&r.searchParams.set("canSeePin",t.allowPinReveal.toString()),"boolean"==typeof t.allowBlocking&&r.searchParams.set("canBlock",t.allowBlocking.toString()),!0===t.debugMode&&r.searchParams.set("debug",t.debugMode.toString());const n=gatherQontoEmbedCssVariables(CUSTOM_PROP_PREFIX);return Object.keys(n).length>0&&r.searchParams.set("customization",JSON.stringify(n)),r.toString()}async function createEmbedUI({decorationParams:e,operationSettings:t,cardIframeUrl:r}){const{cardId:n,allowPinReveal:i,allowBlocking:a}=e,{uiParentElementId:o,debugMode:s}=t,l=getPopulatedIframeURL(r,{cardId:n,allowPinReveal:i,allowBlocking:a,debugMode:s}),c=await createIframe({iframeUrl:l,parentElementId:o});return{destroyEmbedUI:()=>{c.destroy()}}}function isVirtualCardOrderSettings(e){return e.cardLevel===VIRTUAL_CARD_LEVEL.VIRTUAL}var CardStatus;!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"}(CardStatus||(CardStatus={}));const CardCategories={TRANSPORT:"transport",RESTAURANT_AND_BAR:"restaurant_and_bar",FOOD_AND_GROCERY:"food_and_grocery",IT_AND_ELECTRONICS:"it_and_electronics",UTILITY:"utility",TAX:"tax",LEGAL_AND_ACCOUNTING:"legal_and_accounting",ATM:"atm",OFFICE_SUPPLY:"office_supply",HARDWARE_AND_EQUIPMENT:"hardware_and_equipment",FINANCE:"finance"};function serializeOrderCardPayload(e){return isVirtualCardOrderSettings(e)?serializeOrderVirtualCardPayload(e):serializeOrderPhysicalCardPayload(e)}function serializeOrderVirtualCardPayload(e){const t=filterValidCategories(e.categories);return{actionId:ACTIONS.CARD_ORDER,actionData:{idempotencyKey:v4(),body:{card:{payment_monthly_limit:e.monthlyLimit,payment_daily_limit:e.dailyLimit,payment_daily_limit_option:e.hasDailyLimit,payment_transaction_limit:e.transactionLimit,payment_transaction_limit_option:e.hasTransactionLimit,active_days:e.activeDays||[],holder_id:e.membershipId,organization_id:e.organizationId,bank_account_id:e.bankAccountId,categories:t,card_level:e.cardLevel}}}}}function serializeOrderPhysicalCardPayload(e){const t=filterValidCategories(e.categories);return{actionId:ACTIONS.CARD_ORDER,actionData:{idempotencyKey:v4(),body:{card:{payment_monthly_limit:e.monthlyLimit,payment_daily_limit:e.dailyLimit,payment_daily_limit_option:e.hasDailyLimit,payment_transaction_limit:e.transactionLimit,payment_transaction_limit_option:e.hasTransactionLimit,active_days:e.activeDays||[],holder_id:e.membershipId,organization_id:e.organizationId,bank_account_id:e.bankAccountId,categories:t,card_level:e.cardLevel,card_design:e.cardDesign,..."plus"===e.cardLevel&&{type_of_print:e.typeOfPrint},ship_to_business_address:e.shipToBusiness,atm_option:e.hasAtmOption,nfc_option:e.hasNfcOption,foreign_option:e.hasForeignPaymentOption,online_option:e.hasOnlinePaymentOption,atm_daily_limit:e.atmDailyLimit,atm_monthly_limit:e.atmMonthlyLimit,...!e.shipToBusiness&&{address:{contact_name:e.address?.contactName,first_line:e.address?.firstLine,second_line:e.address?.secondLine,third_line:e.address?.thirdLine,zipcode:e.address?.zipCode,city:e.address?.city,country:e.address?.country}}}}}}}function serializeCard(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 filterValidCategories(e){const t=Object.values(CardCategories);return(e||[]).filter((e=>t.includes(e)))}function serializeUnlockCardPayload(e){return{actionId:ACTIONS.CARD_UNLOCK,actionData:{body:{cardId:e.cardSettings.cardId}}}}const requiredVirtualCardOrderParams=[{name:"organizationId"},{name:"membershipId"},{name:"bankAccountId"},{name:"monthlyLimit"},{name:"cardLevel"}],requiredPhysicalCardOrderParams=[...requiredVirtualCardOrderParams,{name:"atmDailyLimit",requiredIfPresent:"hasAtmDailyLimit"},{name:"hasAtmDailyLimit",requiredIfPresent:"hasAtmOption"},{name:"atmMonthlyLimit",requiredIfPresent:"hasAtmOption"},{name:"shipToBusiness"},{name:"cardLevel"}];function validateOrderCardParams(e){if(!e)throw new InvalidParametersError("cardSettings parameter is required for the called function");return isVirtualCardOrderSettings(e)?validateOrderVirtualCardParams(e):validateOrderPhysicalCardParams(e)}function validateUnlockCardParams(e){if(!e)throw new InvalidParametersError("cardSettings parameter is required for the called function");if(!e.cardId)throw new InvalidParametersError("cardId is required for the called function");const t=validateExpectedStringValues({cardId:e.cardId});if(t.length>0)throw new InvalidParametersError(t)}function validateOrderVirtualCardParams(e){return validatePresenceOfRequiredParams(e,requiredVirtualCardOrderParams),validateOrderVirtualCardParamsType(e),e}function validateOrderVirtualCardParamsType(e){const{membershipId:t,organizationId:r,bankAccountId:n,hasDailyLimit:i,hasTransactionLimit:a,monthlyLimit:o,dailyLimit:s,transactionLimit:l,activeDays:c,categories:d,cardLevel:u}=e,p=[...validateVirtualCardLevel(u),...validateExpectedStringValues({membershipId:t,organizationId:r,bankAccountId:n}),...validateExpectedBooleanValues({hasDailyLimit:i,hasTransactionLimit:a}),...validateExpectedNumericValues({monthlyLimit:o,dailyLimit:s,transactionLimit:l}),...validateActiveDays(c),...validateCategories(d)];if(p.length>0)throw new InvalidParametersError(p)}function validateOrderPhysicalCardParams(e){validatePresenceOfRequiredParams(e,requiredPhysicalCardOrderParams),validateOrderPhysicalCardParamsType(e)}function validateOrderPhysicalCardParamsType(e){const{membershipId:t,organizationId:r,bankAccountId:n,hasDailyLimit:i,hasTransactionLimit:a,monthlyLimit:o,dailyLimit:s,transactionLimit:l,activeDays:c,categories:d,cardLevel:u,hasNfcOption:p,hasForeignPaymentOption:h,hasOnlinePaymentOption:f,shipToBusiness:m,hasAtmOption:g,hasAtmDailyLimit:v,atmDailyLimit:y,atmMonthlyLimit:b,address:E,cardDesign:_,typeOfPrint:S}=e,T=validatePhysicalCardLevel(u),x=validateTypeOfPrint(S),k=[...T,...validateExpectedStringValues({membershipId:t,organizationId:r,bankAccountId:n}),...validateExpectedBooleanValues({hasDailyLimit:i,hasTransactionLimit:a,hasAtmOption:g,hasNfcOption:p,hasForeignPaymentOption:h,hasOnlinePaymentOption:f,hasAtmDailyLimit:v,shipToBusiness:m}),...validateExpectedNumericValues({monthlyLimit:o,dailyLimit:s,transactionLimit:l,atmDailyLimit:y,atmMonthlyLimit:b}),...validateActiveDays(c),...validateCategories(d),...x,...validateCardDesign(_),...validateAddress(E,m)];if(k.length>0)throw new InvalidParametersError(k)}function validateActiveDays(e){const t=!Array.isArray(e)||!e.every((e=>Number.isInteger(e)&&e>0&&e<8));return void 0!==e&&t?["activeDays must be an array of integers between 1 and 7"]:[]}function validateCategories(e){const t=!Array.isArray(e)||e.some((e=>"string"!=typeof e));return void 0!==e&&t?["categories must be an array of strings"]:[]}function validateCardDesign(e){return["undefined","string"].includes(typeof e)?[]:["cardDesign must be a string"]}function validateTypeOfPrint(e){const t=null!=e&&"string"!=typeof e,r=!["print","embossed",void 0,null].includes(e);return t||r?['typeOfPrint must be one of "print", "embossed" or null']:[]}function validatePhysicalCardLevel(e){return Object.values(PHYSICAL_CARD_LEVEL).includes(e)?[]:['cardLevel must be one of "standard", "plus", "metal"']}function validateVirtualCardLevel(e){return e!==VIRTUAL_CARD_LEVEL.VIRTUAL?['cardLevel must be "virtual"']:[]}function validateAddress(e,t){return t||!e||e.contactName&&e.firstLine&&e.zipCode&&e.city&&e.country?[]:["address must contain at least contactName, firstLine, zipCode, city and country properties"]}function validateDisplayCardParams(e){if(!e)throw new InvalidParametersError("cardSettings parameter is required for the called function");if(!e.cardId)throw new InvalidParametersError("cardId is required for the called function");const t=validateExpectedStringValues({cardId:e.cardId});if(t.length>0)throw new InvalidParametersError(t);let r={};void 0!==e.allowPinReveal&&(r={allowPinReveal:e.allowPinReveal}),void 0!==e.allowBlocking&&(r={...r,allowBlocking:e.allowBlocking});const n=validateExpectedBooleanValues(r);if(n.length>0)throw new InvalidParametersError(n);return e}function validateGetCardParams(e){if(!e)throw new InvalidParametersError("cardSettings parameter is required for the called function");if(!e.cardId)throw new InvalidParametersError("cardId parameter is required for the called function");const t=validateExpectedStringValues({cardId:e.cardId});if(t.length>0)throw new InvalidParametersError(t);return e}async function getCards(e){tracker.cardsList();const t=e?.cardSettings?.membershipId;if(t&&"string"!=typeof t)throw new InvalidParametersError("membershipId must be a string");const{proxyRequestFunction:r,proxyEndpointDescriptor:n,stagingToken:i}=validateClientOperationSettings(e?.operationSettings,'Client-side card operations require either proxyEndpointDescriptor or proxyRequestFunction. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/cards" only in server-side/backend environments.'),a=prepareGetCardsCall({membershipId:t,stagingToken:i});return(await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:a})).body.cards.map((e=>serializeCard(e)))}async function getCard({cardSettings:e,operationSettings:t}){tracker.cardsGet(),validateGetCardParams(e);const r=e.cardId,{proxyRequestFunction:n,proxyEndpointDescriptor:i,stagingToken:a}=validateClientOperationSettings(t,'Client-side card operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/cards" only in server-side/backend environments.'),o=prepareGetCardCall({cardId:r,stagingToken:a}),s=(await callProxyFunction({proxyFunction:n,proxyEndpointDescriptor:i,networkCallDescriptor:o})).body.cards;if(Array.isArray(s)&&s.length>0)return serializeCard(s[0]);throw new InvalidParametersError("Unable to retrieve card data")}async function orderCard(e){tracker.cardsOrder();const t=validatePresenceOfAuthToken(),{uiParentElementId:r,debugMode:n}=e.operationSettings;if(!r)throw new InvalidParametersError("uiParentElementId is required");validateOrderCardParams(e.cardSettings);const i=buildIframeUrl({accessToken:t,stagingToken:authManager.getStagingToken()||void 0,debugMode:n}),a=await createIframe({iframeUrl:i,parentElementId:r}),o=serializeOrderCardPayload(e.cardSettings),s=await a.postMessage(o);return a.destroy(),serializeCard(s)}async function unlockCard(e){tracker.cardsUnlock();const t=validatePresenceOfAuthToken(),{uiParentElementId:r,debugMode:n}=e.operationSettings;if(!r)throw new InvalidParametersError("uiParentElementId is required");validateUnlockCardParams(e.cardSettings);const i=buildIframeUrl({accessToken:t,stagingToken:authManager.getStagingToken()||void 0,debugMode:n}),a=await createIframe({iframeUrl:i,parentElementId:r}),o=serializeUnlockCardPayload(e),s=await a.postMessage(o);return a.destroy(),serializeCard(s)}async function displayCard(e){tracker.cardsDisplay();const{uiParentElementId:t,accessToken:r,stagingToken:n,debugMode:i,mfaPreference:a,proxyRequestFunction:o,proxyEndpointDescriptor:s}=validateOperationSettingsParams(e.operationSettings,{requiresUI:!0});if(!t)throw new InvalidParametersError("uiParentElementId is required");if(validateDisplayCardParams(e.cardSettings),o||s){const r=prepareGetCardIframeUrl({stagingToken:n}),a=(await callProxyFunction({proxyFunction:o,proxyEndpointDescriptor:s,networkCallDescriptor:r})).body.embed_auth_link;return createEmbedUI({decorationParams:e.cardSettings,operationSettings:{uiParentElementId:t,debugMode:i},cardIframeUrl:a.url})}{const a=r||validatePresenceOfAuthToken(),{getCardIframeURL:o}=await Promise.resolve().then((function(){return cards_api})),s=await o({...e.cardSettings,accessToken:a,stagingToken:n});return createEmbedUI({decorationParams:e.cardSettings,operationSettings:{uiParentElementId:t,debugMode:i},cardIframeUrl:s.url})}}const cards={getCards:getCards,getCard:getCard,orderCard:orderCard,unlockCard:unlockCard,displayCard:displayCard},DEBUG_BUILD$2="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,GLOBAL_OBJ=globalThis,SDK_VERSION="10.39.0";function getMainCarrier(){return getSentryCarrier(GLOBAL_OBJ),GLOBAL_OBJ}function getSentryCarrier(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||SDK_VERSION,t[SDK_VERSION]=t[SDK_VERSION]||{}}function getGlobalSingleton(e,t,r=GLOBAL_OBJ){const n=r.__SENTRY__=r.__SENTRY__||{},i=n[SDK_VERSION]=n[SDK_VERSION]||{};return i[e]||(i[e]=t())}const CONSOLE_LEVELS=["debug","info","warn","error","log","assert","trace"],PREFIX="Sentry Logger ",originalConsoleMethods={};function consoleSandbox(e){if(!("console"in GLOBAL_OBJ))return e();const t=GLOBAL_OBJ.console,r={},n=Object.keys(originalConsoleMethods);n.forEach((e=>{const n=originalConsoleMethods[e];r[e]=t[e],t[e]=n}));try{return e()}finally{n.forEach((e=>{t[e]=r[e]}))}}function enable(){_getLoggerSettings().enabled=!0}function disable(){_getLoggerSettings().enabled=!1}function isEnabled(){return _getLoggerSettings().enabled}function log(...e){_maybeLog("log",...e)}function warn(...e){_maybeLog("warn",...e)}function error(...e){_maybeLog("error",...e)}function _maybeLog(e,...t){DEBUG_BUILD$2&&isEnabled()&&consoleSandbox((()=>{GLOBAL_OBJ.console[e](`${PREFIX}[${e}]:`,...t)}))}function _getLoggerSettings(){return DEBUG_BUILD$2?getGlobalSingleton("loggerSettings",(()=>({enabled:!1}))):{enabled:!1}}const debug={enable:enable,disable:disable,isEnabled:isEnabled,log:log,warn:warn,error:error},STACKTRACE_FRAME_LIMIT=50,UNKNOWN_FUNCTION="?",WEBPACK_ERROR_REGEXP=/\(error: (.*)\)/,STRIP_FRAME_REGEXP=/captureMessage|captureException/;function createStackParser(...e){const t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,r=0,n=0)=>{const i=[],a=e.split("\n");for(let e=r;e<a.length;e++){let r=a[e];r.length>1024&&(r=r.slice(0,1024));const o=WEBPACK_ERROR_REGEXP.test(r)?r.replace(WEBPACK_ERROR_REGEXP,"$1"):r;if(!o.match(/\S*Error: /)){for(const e of t){const t=e(o);if(t){i.push(t);break}}if(i.length>=STACKTRACE_FRAME_LIMIT+n)break}}return stripSentryFramesAndReverse(i.slice(n))}}function stackParserFromStackParserOptions(e){return Array.isArray(e)?createStackParser(...e):e}function stripSentryFramesAndReverse(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(getLastStackFrame(t).function||"")&&t.pop(),t.reverse(),STRIP_FRAME_REGEXP.test(getLastStackFrame(t).function||"")&&(t.pop(),STRIP_FRAME_REGEXP.test(getLastStackFrame(t).function||"")&&t.pop()),t.slice(0,STACKTRACE_FRAME_LIMIT).map((e=>({...e,filename:e.filename||getLastStackFrame(t).filename,function:e.function||UNKNOWN_FUNCTION})))}function getLastStackFrame(e){return e[e.length-1]||{}}const defaultFunctionName="<anonymous>";function getFunctionName(e){try{return e&&"function"==typeof e&&e.name||defaultFunctionName}catch{return defaultFunctionName}}function getFramesFromEvent(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach((t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)})),e}catch{return}}}function getVueInternalName(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const handlers={},instrumented={};function addHandler(e,t){handlers[e]=handlers[e]||[],handlers[e].push(t)}function maybeInstrument(e,t){if(!instrumented[e]){instrumented[e]=!0;try{t()}catch(t){DEBUG_BUILD$2&&debug.error(`Error while instrumenting ${e}`,t)}}}function triggerHandlers(e,t){const r=e&&handlers[e];if(r)for(const n of r)try{n(t)}catch(t){DEBUG_BUILD$2&&debug.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${getFunctionName(n)}\nError:`,t)}}let _oldOnErrorHandler=null;function addGlobalErrorInstrumentationHandler(e){const t="error";addHandler(t,e),maybeInstrument(t,instrumentError)}function instrumentError(){_oldOnErrorHandler=GLOBAL_OBJ.onerror,GLOBAL_OBJ.onerror=function(e,t,r,n,i){return triggerHandlers("error",{column:n,error:i,line:r,msg:e,url:t}),!!_oldOnErrorHandler&&_oldOnErrorHandler.apply(this,arguments)},GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__=!0}let _oldOnUnhandledRejectionHandler=null;function addGlobalUnhandledRejectionInstrumentationHandler(e){const t="unhandledrejection";addHandler(t,e),maybeInstrument(t,instrumentUnhandledRejection)}function instrumentUnhandledRejection(){_oldOnUnhandledRejectionHandler=GLOBAL_OBJ.onunhandledrejection,GLOBAL_OBJ.onunhandledrejection=function(e){return triggerHandlers("unhandledrejection",e),!_oldOnUnhandledRejectionHandler||_oldOnUnhandledRejectionHandler.apply(this,arguments)},GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const objectToString=Object.prototype.toString;function isError(e){switch(objectToString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return isInstanceOf(e,Error)}}function isBuiltin(e,t){return objectToString.call(e)===`[object ${t}]`}function isErrorEvent$1(e){return isBuiltin(e,"ErrorEvent")}function isDOMError(e){return isBuiltin(e,"DOMError")}function isDOMException(e){return isBuiltin(e,"DOMException")}function isString(e){return isBuiltin(e,"String")}function isParameterizedString(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function isPrimitive(e){return null===e||isParameterizedString(e)||"object"!=typeof e&&"function"!=typeof e}function isPlainObject(e){return isBuiltin(e,"Object")}function isEvent(e){return"undefined"!=typeof Event&&isInstanceOf(e,Event)}function isElement(e){return"undefined"!=typeof Element&&isInstanceOf(e,Element)}function isRegExp(e){return isBuiltin(e,"RegExp")}function isThenable(e){return Boolean(e?.then&&"function"==typeof e.then)}function isSyntheticEvent(e){return isPlainObject(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function isInstanceOf(e,t){try{return e instanceof t}catch{return!1}}function isVueViewModel(e){return!("object"!=typeof e||null===e||!(e.__isVue||e._isVue||e.__v_isVNode))}function isRequest(e){return"undefined"!=typeof Request&&isInstanceOf(e,Request)}const WINDOW$3=GLOBAL_OBJ,DEFAULT_MAX_STRING_LENGTH=80;function htmlTreeAsString(e,t={}){if(!e)return"<unknown>";try{let r=e;const n=5,i=[];let a=0,o=0;const s=" > ",l=s.length;let c;const d=Array.isArray(t)?t:t.keyAttrs,u=!Array.isArray(t)&&t.maxStringLength||DEFAULT_MAX_STRING_LENGTH;for(;r&&a++<n&&(c=_htmlElementAsString(r,d),!("html"===c||a>1&&o+i.length*l+c.length>=u));)i.push(c),o+=c.length,r=r.parentNode;return i.reverse().join(s)}catch{return"<unknown>"}}function _htmlElementAsString(e,t){const r=e,n=[];if(!r?.tagName)return"";if(WINDOW$3.HTMLElement&&r instanceof HTMLElement&&r.dataset){if(r.dataset.sentryComponent)return r.dataset.sentryComponent;if(r.dataset.sentryElement)return r.dataset.sentryElement}n.push(r.tagName.toLowerCase());const i=t?.length?t.filter((e=>r.getAttribute(e))).map((e=>[e,r.getAttribute(e)])):null;if(i?.length)i.forEach((e=>{n.push(`[${e[0]}="${e[1]}"]`)}));else{r.id&&n.push(`#${r.id}`);const e=r.className;if(e&&isString(e)){const t=e.split(/\s+/);for(const e of t)n.push(`.${e}`)}}const a=["aria-label","type","name","title","alt"];for(const e of a){const t=r.getAttribute(e);t&&n.push(`[${e}="${t}"]`)}return n.join("")}function getLocationHref(){try{return WINDOW$3.document.location.href}catch{return""}}function getComponentName(e){if(!WINDOW$3.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function fill(e,t,r){if(!(t in e))return;const n=e[t];if("function"!=typeof n)return;const i=r(n);"function"==typeof i&&markFunctionWrapped(i,n);try{e[t]=i}catch{DEBUG_BUILD$2&&debug.log(`Failed to replace method "${t}" in object`,e)}}function addNonEnumerableProperty(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{DEBUG_BUILD$2&&debug.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function markFunctionWrapped(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,addNonEnumerableProperty(e,"__sentry_original__",t)}catch{}}function getOriginalFunction(e){return e.__sentry_original__}function convertToPlainObject(e){if(isError(e))return{message:e.message,name:e.name,stack:e.stack,...getOwnProperties(e)};if(isEvent(e)){const t={type:e.type,target:serializeEventTarget(e.target),currentTarget:serializeEventTarget(e.currentTarget),...getOwnProperties(e)};return"undefined"!=typeof CustomEvent&&isInstanceOf(e,CustomEvent)&&(t.detail=e.detail),t}return e}function serializeEventTarget(e){try{return isElement(e)?htmlTreeAsString(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function getOwnProperties(e){if("object"==typeof e&&null!==e){const t={};for(const r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r]);return t}return{}}function extractExceptionKeysForMessage(e){const t=Object.keys(convertToPlainObject(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let RESOLVED_RUNNER,emptyUuid;function withRandomSafeContext(e){if(void 0!==RESOLVED_RUNNER)return RESOLVED_RUNNER?RESOLVED_RUNNER(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),r=GLOBAL_OBJ;return t in r&&"function"==typeof r[t]?(RESOLVED_RUNNER=r[t],RESOLVED_RUNNER(e)):(RESOLVED_RUNNER=null,e())}function safeMathRandom(){return withRandomSafeContext((()=>Math.random()))}function safeDateNow(){return withRandomSafeContext((()=>Date.now()))}function truncate(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function safeJoin(e,t){if(!Array.isArray(e))return"";const r=[];for(let t=0;t<e.length;t++){const n=e[t];try{isVueViewModel(n)?r.push(getVueInternalName(n)):r.push(String(n))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function isMatchingPattern(e,t,r=!1){return!!isString(e)&&(isRegExp(t)?t.test(e):!!isString(t)&&(r?e===t:e.includes(t)))}function stringMatchesSomePattern(e,t=[],r=!1){return t.some((t=>isMatchingPattern(e,t,r)))}function getCrypto(){const e=GLOBAL_OBJ;return e.crypto||e.msCrypto}function getRandomByte(){return 16*safeMathRandom()}function uuid4(e=getCrypto()){try{if(e?.randomUUID)return withRandomSafeContext((()=>e.randomUUID())).replace(/-/g,"")}catch{}return emptyUuid||(emptyUuid=[1e7]+1e3+4e3+8e3+1e11),emptyUuid.replace(/[018]/g,(e=>(e^(15&getRandomByte())>>e/4).toString(16)))}function getFirstException(e){return e.exception?.values?.[0]}function getEventDescription(e){const{message:t,event_id:r}=e;if(t)return t;const n=getFirstException(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function addExceptionTypeValue(e,t,r){const n=e.exception=e.exception||{},i=n.values=n.values||[],a=i[0]=i[0]||{};a.value||(a.value=t||""),a.type||(a.type="Error")}function addExceptionMechanism(e,t){const r=getFirstException(e);if(!r)return;const n=r.mechanism;if(r.mechanism={type:"generic",handled:!0,...n,...t},t&&"data"in t){const e={...n?.data,...t.data};r.mechanism.data=e}}function checkOrSetAlreadyCaught(e){if(isAlreadyCaptured(e))return!0;try{addNonEnumerableProperty(e,"__sentry_captured__",!0)}catch{}return!1}function isAlreadyCaptured(e){try{return e.__sentry_captured__}catch{}}const ONE_SECOND_IN_MS=1e3;function dateTimestampInSeconds(){return safeDateNow()/ONE_SECOND_IN_MS}function createUnixTimestampInSecondsFunc(){const{performance:e}=GLOBAL_OBJ;if(!e?.now||!e.timeOrigin)return dateTimestampInSeconds;const t=e.timeOrigin;return()=>(t+withRandomSafeContext((()=>e.now())))/ONE_SECOND_IN_MS}let _cachedTimestampInSeconds;function timestampInSeconds(){return(_cachedTimestampInSeconds??(_cachedTimestampInSeconds=createUnixTimestampInSecondsFunc()))()}function makeSession(e){const t=timestampInSeconds(),r={sid:uuid4(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>sessionToJSON(r)};return e&&updateSession(r,e),r}function updateSession(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||timestampInSeconds(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:uuid4()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function closeSession(e,t){let r={};"ok"===e.status&&(r={status:"exited"}),updateSession(e,r)}function sessionToJSON(e){return{sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function merge(e,t,r=2){if(!t||"object"!=typeof t||r<=0)return t;if(e&&0===Object.keys(t).length)return e;const n={...e};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=merge(n[e],t[e],r-1));return n}function generateTraceId(){return uuid4()}function generateSpanId(){return uuid4().substring(16)}const SCOPE_SPAN_FIELD="_sentrySpan";function _setSpanForScope(e,t){t?addNonEnumerableProperty(e,SCOPE_SPAN_FIELD,t):delete e[SCOPE_SPAN_FIELD]}function _getSpanForScope(e){return e[SCOPE_SPAN_FIELD]}const DEFAULT_MAX_BREADCRUMBS=100;class Scope{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:generateTraceId(),sampleRand:safeMathRandom()}}clone(){const e=new Scope;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,_setSpanForScope(e,_getSpanForScope(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&updateSession(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,r=t instanceof Scope?t.getScopeData():isPlainObject(t)?e:void 0,{tags:n,attributes:i,extra:a,user:o,contexts:s,level:l,fingerprint:c=[],propagationContext:d,conversationId:u}=r||{};return this._tags={...this._tags,...n},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),l&&(this._level=l),c.length&&(this._fingerprint=c),d&&(this._propagationContext=d),u&&(this._conversationId=u),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,_setSpanForScope(this,void 0),this._attachments=[],this.setPropagationContext({traceId:generateTraceId(),sampleRand:safeMathRandom()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:DEFAULT_MAX_BREADCRUMBS;if(r<=0)return this;const n={timestamp:dateTimestampInSeconds(),...e,message:e.message?truncate(e.message,2048):e.message};return this._breadcrumbs.push(n),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_getSpanForScope(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=merge(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const r=t?.event_id||uuid4();if(!this._client)return DEBUG_BUILD$2&&debug.warn("No client configured on scope - will not capture exception!"),r;const n=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},this),r}captureMessage(e,t,r){const n=r?.event_id||uuid4();if(!this._client)return DEBUG_BUILD$2&&debug.warn("No client configured on scope - will not capture message!"),n;const i=r?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},this),n}captureEvent(e,t){const r=e.event_id||t?.event_id||uuid4();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(DEBUG_BUILD$2&&debug.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}function getDefaultCurrentScope(){return getGlobalSingleton("defaultCurrentScope",(()=>new Scope))}function getDefaultIsolationScope(){return getGlobalSingleton("defaultIsolationScope",(()=>new Scope))}class AsyncContextStack{constructor(e,t){let r,n;r=e||new Scope,n=t||new Scope,this._stack=[{scope:r}],this._isolationScope=n}withScope(e){const t=this._pushScope();let r;try{r=e(t)}catch(e){throw this._popScope(),e}return isThenable(r)?r.then((e=>(this._popScope(),e)),(e=>{throw this._popScope(),e})):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function getAsyncContextStack(){const e=getSentryCarrier(getMainCarrier());return e.stack=e.stack||new AsyncContextStack(getDefaultCurrentScope(),getDefaultIsolationScope())}function withScope$1(e){return getAsyncContextStack().withScope(e)}function withSetScope(e,t){const r=getAsyncContextStack();return r.withScope((()=>(r.getStackTop().scope=e,t(e))))}function withIsolationScope(e){return getAsyncContextStack().withScope((()=>e(getAsyncContextStack().getIsolationScope())))}function getStackAsyncContextStrategy(){return{withIsolationScope:withIsolationScope,withScope:withScope$1,withSetScope:withSetScope,withSetIsolationScope:(e,t)=>withIsolationScope(t),getCurrentScope:()=>getAsyncContextStack().getScope(),getIsolationScope:()=>getAsyncContextStack().getIsolationScope()}}function getAsyncContextStrategy(e){const t=getSentryCarrier(e);return t.acs?t.acs:getStackAsyncContextStrategy()}function getCurrentScope(){return getAsyncContextStrategy(getMainCarrier()).getCurrentScope()}function getIsolationScope(){return getAsyncContextStrategy(getMainCarrier()).getIsolationScope()}function getGlobalScope(){return getGlobalSingleton("globalScope",(()=>new Scope))}function withScope(...e){const t=getAsyncContextStrategy(getMainCarrier());if(2===e.length){const[r,n]=e;return r?t.withSetScope(r,n):t.withScope(n)}return t.withScope(e[0])}function getClient(){return getCurrentScope().getClient()}function getTraceContextFromScope(e){const t=e.getPropagationContext(),{traceId:r,parentSpanId:n,propagationSpanId:i}=t,a={trace_id:r,span_id:i||generateSpanId()};return n&&(a.parent_span_id=n),a}const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE="sentry.source",SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE="sentry.sample_rate",SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE="sentry.previous_trace_sample_rate",SEMANTIC_ATTRIBUTE_SENTRY_OP="sentry.op",SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN="sentry.origin",SEMANTIC_ATTRIBUTE_PROFILE_ID="sentry.profile_id",SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME="sentry.exclusive_time",GEN_AI_CONVERSATION_ID_ATTRIBUTE="gen_ai.conversation.id",SPAN_STATUS_UNSET=0,SPAN_STATUS_OK=1,SCOPE_ON_START_SPAN_FIELD="_sentryScope",ISOLATION_SCOPE_ON_START_SPAN_FIELD="_sentryIsolationScope";function unwrapScopeFromWeakRef(e){if(e){if("object"==typeof e&&"deref"in e&&"function"==typeof e.deref)try{return e.deref()}catch{return}return e}}function getCapturedScopesOnSpan(e){const t=e;return{scope:t[SCOPE_ON_START_SPAN_FIELD],isolationScope:unwrapScopeFromWeakRef(t[ISOLATION_SCOPE_ON_START_SPAN_FIELD])}}const SENTRY_BAGGAGE_KEY_PREFIX="sentry-",SENTRY_BAGGAGE_KEY_PREFIX_REGEX=/^sentry-/;function baggageHeaderToDynamicSamplingContext(e){const t=parseBaggageHeader(e);if(!t)return;const r=Object.entries(t).reduce(((e,[t,r])=>{if(t.match(SENTRY_BAGGAGE_KEY_PREFIX_REGEX)){e[t.slice(SENTRY_BAGGAGE_KEY_PREFIX.length)]=r}return e}),{});return Object.keys(r).length>0?r:void 0}function parseBaggageHeader(e){if(e&&(isString(e)||Array.isArray(e)))return Array.isArray(e)?e.reduce(((e,t)=>{const r=baggageHeaderToObject(t);return Object.entries(r).forEach((([t,r])=>{e[t]=r})),e}),{}):baggageHeaderToObject(e)}function baggageHeaderToObject(e){return e.split(",").map((e=>{const t=e.indexOf("=");if(-1===t)return[];return[e.slice(0,t),e.slice(t+1)].map((e=>{try{return decodeURIComponent(e.trim())}catch{return}}))})).reduce(((e,[t,r])=>(t&&r&&(e[t]=r),e)),{})}const ORG_ID_REGEX=/^o(\d+)\./,DSN_REGEX=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function isValidProtocol(e){return"http"===e||"https"===e}function dsnToString(e,t=!1){const{host:r,path:n,pass:i,port:a,projectId:o,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&i?`:${i}`:""}@${r}${a?`:${a}`:""}/${n?`${n}/`:n}${o}`}function dsnFromString(e){const t=DSN_REGEX.exec(e);if(!t)return void consoleSandbox((()=>{console.error(`Invalid Sentry Dsn: ${e}`)}));const[r,n,i="",a="",o="",s=""]=t.slice(1);let l="",c=s;const d=c.split("/");if(d.length>1&&(l=d.slice(0,-1).join("/"),c=d.pop()),c){const e=c.match(/^\d+/);e&&(c=e[0])}return dsnFromComponents({host:a,pass:i,path:l,projectId:c,port:o,protocol:r,publicKey:n})}function dsnFromComponents(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function validateDsn(e){if(!DEBUG_BUILD$2)return!0;const{port:t,projectId:r,protocol:n}=e;return!["protocol","publicKey","host","projectId"].find((t=>!e[t]&&(debug.error(`Invalid Sentry Dsn: ${t} missing`),!0)))&&(r.match(/^\d+$/)?isValidProtocol(n)?!t||!isNaN(parseInt(t,10))||(debug.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):(debug.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(debug.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1))}function extractOrgIdFromDsnHost(e){const t=e.match(ORG_ID_REGEX);return t?.[1]}function extractOrgIdFromClient(e){const t=e.getOptions(),{host:r}=e.getDsn()||{};let n;return t.orgId?n=String(t.orgId):r&&(n=extractOrgIdFromDsnHost(r)),n}function makeDsn(e){const t="string"==typeof e?dsnFromString(e):dsnFromComponents(e);if(t&&validateDsn(t))return t}function parseSampleRate(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;return"number"!=typeof t||isNaN(t)||t<0||t>1?void 0:t}const TRACE_FLAG_SAMPLED=1;let hasShownSpanDropWarning=!1;function spanToTraceContext(e){const{spanId:t,traceId:r,isRemote:n}=e.spanContext(),i=n?t:spanToJSON(e).parent_span_id,a=getCapturedScopesOnSpan(e).scope;return{parent_span_id:i,span_id:n?a?.getPropagationContext().propagationSpanId||generateSpanId():t,trace_id:r}}function convertSpanLinksForEnvelope(e){return e&&e.length>0?e.map((({context:{spanId:e,traceId:t,traceFlags:r,...n},attributes:i})=>({span_id:e,trace_id:t,sampled:r===TRACE_FLAG_SAMPLED,attributes:i,...n}))):void 0}function spanTimeInputToSeconds(e){return"number"==typeof e?ensureTimestampInSeconds(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?ensureTimestampInSeconds(e.getTime()):timestampInSeconds()}function ensureTimestampInSeconds(e){return e>9999999999?e/1e3:e}function spanToJSON(e){if(spanIsSentrySpan(e))return e.getSpanJSON();const{spanId:t,traceId:r}=e.spanContext();if(spanIsOpenTelemetrySdkTraceBaseSpan(e)){const{attributes:n,startTime:i,name:a,endTime:o,status:s,links:l}=e;return{span_id:t,trace_id:r,data:n,description:a,parent_span_id:"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0,start_timestamp:spanTimeInputToSeconds(i),timestamp:spanTimeInputToSeconds(o)||void 0,status:getStatusMessage(s),op:n[SEMANTIC_ATTRIBUTE_SENTRY_OP],origin:n[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN],links:convertSpanLinksForEnvelope(l)}}return{span_id:t,trace_id:r,start_timestamp:0,data:{}}}function spanIsOpenTelemetrySdkTraceBaseSpan(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}function spanIsSentrySpan(e){return"function"==typeof e.getSpanJSON}function spanIsSampled(e){const{traceFlags:t}=e.spanContext();return t===TRACE_FLAG_SAMPLED}function getStatusMessage(e){if(e&&e.code!==SPAN_STATUS_UNSET)return e.code===SPAN_STATUS_OK?"ok":e.message||"internal_error"}const ROOT_SPAN_FIELD="_sentryRootSpan";function getRootSpan(e){return e[ROOT_SPAN_FIELD]||e}function showSpanDropWarning(){hasShownSpanDropWarning||(consoleSandbox((()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")})),hasShownSpanDropWarning=!0)}function hasSpansEnabled(e){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=getClient()?.getOptions();return!(!t||null==t.tracesSampleRate&&!t.tracesSampler)}function logIgnoredSpan(e){debug.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function shouldIgnoreSpan(e,t){if(!t?.length||!e.description)return!1;for(const r of t){if(isStringOrRegExp(r)){if(isMatchingPattern(e.description,r))return DEBUG_BUILD$2&&logIgnoredSpan(e),!0;continue}if(!r.name&&!r.op)continue;const t=!r.name||isMatchingPattern(e.description,r.name),n=!r.op||e.op&&isMatchingPattern(e.op,r.op);if(t&&n)return DEBUG_BUILD$2&&logIgnoredSpan(e),!0}return!1}function reparentChildSpans(e,t){const r=t.parent_span_id,n=t.span_id;if(r)for(const t of e)t.parent_span_id===n&&(t.parent_span_id=r)}function isStringOrRegExp(e){return"string"==typeof e||e instanceof RegExp}const DEFAULT_ENVIRONMENT="production",FROZEN_DSC_FIELD="_frozenDsc";function getDynamicSamplingContextFromClient(e,t){const r=t.getOptions(),{publicKey:n}=t.getDsn()||{},i={environment:r.environment||DEFAULT_ENVIRONMENT,release:r.release,public_key:n,trace_id:e,org_id:extractOrgIdFromClient(t)};return t.emit("createDsc",i),i}function getDynamicSamplingContextFromScope(e,t){const r=t.getPropagationContext();return r.dsc||getDynamicSamplingContextFromClient(r.traceId,e)}function getDynamicSamplingContextFromSpan(e){const t=getClient();if(!t)return{};const r=getRootSpan(e),n=spanToJSON(r),i=n.data,a=r.spanContext().traceState,o=a?.get("sentry.sample_rate")??i[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]??i[SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE];function s(e){return"number"!=typeof o&&"string"!=typeof o||(e.sample_rate=`${o}`),e}const l=r[FROZEN_DSC_FIELD];if(l)return s(l);const c=a?.get("sentry.dsc"),d=c&&baggageHeaderToDynamicSamplingContext(c);if(d)return s(d);const u=getDynamicSamplingContextFromClient(e.spanContext().traceId,t),p=i[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE],h=n.description;return"url"!==p&&h&&(u.transaction=h),hasSpansEnabled()&&(u.sampled=String(spanIsSampled(r)),u.sample_rand=a?.get("sentry.sample_rand")??getCapturedScopesOnSpan(r).scope?.getPropagationContext().sampleRand.toString()),s(u),t.emit("createDsc",u,r),u}function normalize(e,t=100,r=1/0){try{return visit("",e,t,r)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function normalizeToSize(e,t=3,r=102400){const n=normalize(e,t);return jsonSize(n)>r?normalizeToSize(e,t-1,r):n}function visit(e,t,r=1/0,n=1/0,i=memoBuilder()){const[a,o]=i;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const s=stringifyValue(e,t);if(!s.startsWith("[object "))return s;if(t.__sentry_skip_normalization__)return t;const l="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:r;if(0===l)return s.replace("object ","");if(a(t))return"[Circular ~]";const c=t;if(c&&"function"==typeof c.toJSON)try{return visit("",c.toJSON(),l-1,n,i)}catch{}const d=Array.isArray(t)?[]:{};let u=0;const p=convertToPlainObject(t);for(const e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(u>=n){d[e]="[MaxProperties ~]";break}const t=p[e];d[e]=visit(e,t,l-1,n,i),u++}return o(t),d}function stringifyValue(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!=typeof global&&t===global)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(isVueViewModel(t))return getVueInternalName(t);if(isSyntheticEvent(t))return"[SyntheticEvent]";if("number"==typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"==typeof t)return`[Function: ${getFunctionName(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=getConstructorName(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}}function getConstructorName(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function utf8Length(e){return~-encodeURI(e).split(/%..|./).length}function jsonSize(e){return utf8Length(JSON.stringify(e))}function memoBuilder(){const e=new WeakSet;return[function(t){return!!e.has(t)||(e.add(t),!1)},function(t){e.delete(t)}]}function createEnvelope(e,t=[]){return[e,t]}function addItemToEnvelope(e,t){const[r,n]=e;return[r,[...n,t]]}function forEachEnvelopeItem(e,t){const r=e[1];for(const e of r){if(t(e,e[0].type))return!0}return!1}function envelopeContainsItemType(e,t){return forEachEnvelopeItem(e,((e,r)=>t.includes(r)))}function encodeUTF8(e){const t=getSentryCarrier(GLOBAL_OBJ);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}function serializeEnvelope(e){const[t,r]=e;let n=JSON.stringify(t);function i(e){"string"==typeof n?n="string"==typeof e?n+e:[encodeUTF8(n),e]:n.push("string"==typeof e?encodeUTF8(e):e)}for(const e of r){const[t,r]=e;if(i(`\n${JSON.stringify(t)}\n`),"string"==typeof r||r instanceof Uint8Array)i(r);else{let e;try{e=JSON.stringify(r)}catch{e=JSON.stringify(normalize(r))}i(e)}}return"string"==typeof n?n:concatBuffers(n)}function concatBuffers(e){const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}function createAttachmentEnvelopeItem(e){const t="string"==typeof e.data?encodeUTF8(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const ITEM_TYPE_TO_DATA_CATEGORY_MAP={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item",metric:"metric",trace_metric:"metric"};function envelopeItemTypeToDataCategory(e){return ITEM_TYPE_TO_DATA_CATEGORY_MAP[e]}function getSdkMetadataForEnvelopeHeader(e){if(!e?.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function createEventEnvelopeHeaders(e,t,r,n){const i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!r&&n&&{dsn:dsnToString(n)},...i&&{trace:i}}}function _enhanceEventWithSdkInfo(e,t){if(!t)return e;const r=e.sdk||{};return e.sdk={...r,name:r.name||t.name,version:r.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function createSessionEnvelope(e,t,r,n){const i=getSdkMetadataForEnvelopeHeader(r);return createEnvelope({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!n&&t&&{dsn:dsnToString(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}function createEventEnvelope(e,t,r,n){const i=getSdkMetadataForEnvelopeHeader(r),a=e.type&&"replay_event"!==e.type?e.type:"event";_enhanceEventWithSdkInfo(e,r?.sdk);const o=createEventEnvelopeHeaders(e,i,n,t);delete e.sdkProcessingMetadata;return createEnvelope(o,[[{type:a},e]])}const STATE_PENDING=0,STATE_RESOLVED=1,STATE_REJECTED=2;function resolvedSyncPromise(e){return new SyncPromise((t=>{t(e)}))}function rejectedSyncPromise(e){return new SyncPromise(((t,r)=>{r(e)}))}class SyncPromise{constructor(e){this._state=STATE_PENDING,this._handlers=[],this._runExecutor(e)}then(e,t){return new SyncPromise(((r,n)=>{this._handlers.push([!1,t=>{if(e)try{r(e(t))}catch(e){n(e)}else r(t)},e=>{if(t)try{r(t(e))}catch(e){n(e)}else n(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new SyncPromise(((t,r)=>{let n,i;return this.then((t=>{i=!1,n=t,e&&e()}),(t=>{i=!0,n=t,e&&e()})).then((()=>{i?r(n):t(n)}))}))}_executeHandlers(){if(this._state===STATE_PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===STATE_RESOLVED&&e[1](this._value),this._state===STATE_REJECTED&&e[2](this._value),e[0]=!0)}))}_runExecutor(e){const t=(e,t)=>{this._state===STATE_PENDING&&(isThenable(t)?t.then(r,n):(this._state=e,this._value=t,this._executeHandlers()))},r=e=>{t(STATE_RESOLVED,e)},n=e=>{t(STATE_REJECTED,e)};try{e(r,n)}catch(e){n(e)}}}function notifyEventProcessors(e,t,r,n=0){try{const i=_notifyEventProcessors(t,r,e,n);return isThenable(i)?i:resolvedSyncPromise(i)}catch(e){return rejectedSyncPromise(e)}}function _notifyEventProcessors(e,t,r,n){const i=r[n];if(!e||!i)return e;const a=i({...e},t);return DEBUG_BUILD$2&&null===a&&debug.log(`Event processor "${i.id||"?"}" dropped event`),isThenable(a)?a.then((e=>_notifyEventProcessors(e,t,r,n+1))):_notifyEventProcessors(a,t,r,n+1)}let parsedStackResults,lastSentryKeysCount,lastNativeKeysCount,cachedFilenameDebugIds;function getFilenameToDebugIdMap(e){const t=GLOBAL_OBJ._sentryDebugIds,r=GLOBAL_OBJ._debugIds;if(!t&&!r)return{};const n=t?Object.keys(t):[],i=r?Object.keys(r):[];if(cachedFilenameDebugIds&&n.length===lastSentryKeysCount&&i.length===lastNativeKeysCount)return cachedFilenameDebugIds;lastSentryKeysCount=n.length,lastNativeKeysCount=i.length,cachedFilenameDebugIds={},parsedStackResults||(parsedStackResults={});const a=(t,r)=>{for(const n of t){const t=r[n],i=parsedStackResults?.[n];if(i&&cachedFilenameDebugIds&&t)cachedFilenameDebugIds[i[0]]=t,parsedStackResults&&(parsedStackResults[n]=[i[0],t]);else if(t){const r=e(n);for(let e=r.length-1;e>=0;e--){const i=r[e],a=i?.filename;if(a&&cachedFilenameDebugIds&&parsedStackResults){cachedFilenameDebugIds[a]=t,parsedStackResults[n]=[a,t];break}}}}};return t&&a(n,t),r&&a(i,r),cachedFilenameDebugIds}function applyScopeDataToEvent(e,t){const{fingerprint:r,span:n,breadcrumbs:i,sdkProcessingMetadata:a}=t;applyDataToEvent(e,t),n&&applySpanToEvent(e,n),applyFingerprintToEvent(e,r),applyBreadcrumbsToEvent(e,i),applySdkMetadataToEvent(e,a)}function mergeScopeData(e,t){const{extra:r,tags:n,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:d,eventProcessors:u,attachments:p,propagationContext:h,transactionName:f,span:m}=t;mergeAndOverwriteScopeData(e,"extra",r),mergeAndOverwriteScopeData(e,"tags",n),mergeAndOverwriteScopeData(e,"attributes",i),mergeAndOverwriteScopeData(e,"user",a),mergeAndOverwriteScopeData(e,"contexts",o),e.sdkProcessingMetadata=merge(e.sdkProcessingMetadata,l,2),s&&(e.level=s),f&&(e.transactionName=f),m&&(e.span=m),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),u.length&&(e.eventProcessors=[...e.eventProcessors,...u]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...h}}function mergeAndOverwriteScopeData(e,t,r){e[t]=merge(e[t],r,1)}function getCombinedScopeData(e,t){const r=getGlobalScope().getScopeData();return e&&mergeScopeData(r,e.getScopeData()),t&&mergeScopeData(r,t.getScopeData()),r}function applyDataToEvent(e,t){const{extra:r,tags:n,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(r).length&&(e.extra={...r,...e.extra}),Object.keys(n).length&&(e.tags={...n,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&"transaction"!==e.type&&(e.transaction=s)}function applyBreadcrumbsToEvent(e,t){const r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}function applySdkMetadataToEvent(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function applySpanToEvent(e,t){e.contexts={trace:spanToTraceContext(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:getDynamicSamplingContextFromSpan(t),...e.sdkProcessingMetadata};const r=spanToJSON(getRootSpan(t)).description;r&&!e.transaction&&"transaction"===e.type&&(e.transaction=r)}function applyFingerprintToEvent(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function prepareEvent(e,t,r,n,i,a){const{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,l={...t,event_id:t.event_id||r.event_id||uuid4(),timestamp:t.timestamp||dateTimestampInSeconds()},c=r.integrations||e.integrations.map((e=>e.name));applyClientOptions(l,e),applyIntegrationsMetadata(l,c),i&&i.emit("applyFrameMetadata",t),void 0===t.type&&applyDebugIds(l,e.stackParser);const d=getFinalScope(n,r.captureContext);r.mechanism&&addExceptionMechanism(l,r.mechanism);const u=i?i.getEventProcessors():[],p=getCombinedScopeData(a,d),h=[...r.attachments||[],...p.attachments];h.length&&(r.attachments=h),applyScopeDataToEvent(l,p);const f=[...u,...p.eventProcessors];return(r.data&&!0===r.data.__sentry__?resolvedSyncPromise(l):notifyEventProcessors(f,l,r)).then((e=>(e&&applyDebugMeta(e),"number"==typeof o&&o>0?normalizeEvent(e,o,s):e)))}function applyClientOptions(e,t){const{environment:r,release:n,dist:i,maxValueLength:a}=t;e.environment=e.environment||r||DEFAULT_ENVIRONMENT,!e.release&&n&&(e.release=n),!e.dist&&i&&(e.dist=i);const o=e.request;o?.url&&a&&(o.url=truncate(o.url,a)),a&&e.exception?.values?.forEach((e=>{e.value&&(e.value=truncate(e.value,a))}))}function applyDebugIds(e,t){const r=getFilenameToDebugIdMap(t);e.exception?.values?.forEach((e=>{e.stacktrace?.frames?.forEach((e=>{e.filename&&(e.debug_id=r[e.filename])}))}))}function applyDebugMeta(e){const t={};if(e.exception?.values?.forEach((e=>{e.stacktrace?.frames?.forEach((e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)}))})),0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const r=e.debug_meta.images;Object.entries(t).forEach((([e,t])=>{r.push({type:"sourcemap",code_file:e,debug_id:t})}))}function applyIntegrationsMetadata(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function normalizeEvent(e,t,r){if(!e)return null;const n={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:normalize(e.data,t,r)}})))},...e.user&&{user:normalize(e.user,t,r)},...e.contexts&&{contexts:normalize(e.contexts,t,r)},...e.extra&&{extra:normalize(e.extra,t,r)}};return e.contexts?.trace&&n.contexts&&(n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=normalize(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map((e=>({...e,...e.data&&{data:normalize(e.data,t,r)}})))),e.contexts?.flags&&n.contexts&&(n.contexts.flags=normalize(e.contexts.flags,3,r)),n}function getFinalScope(e,t){if(!t)return e;const r=e?e.clone():new Scope;return r.update(t),r}function parseEventHintOrCaptureContext(e){}function captureException(e,t){return getCurrentScope().captureException(e,parseEventHintOrCaptureContext())}function captureMessage(e,t){const r="string"==typeof t?t:void 0,n="string"!=typeof t?{captureContext:t}:void 0;return getCurrentScope().captureMessage(e,r,n)}function captureEvent(e,t){return getCurrentScope().captureEvent(e,t)}function startSession(e){const t=getIsolationScope(),r=getCurrentScope(),{userAgent:n}=GLOBAL_OBJ.navigator||{},i=makeSession({user:r.getUser()||t.getUser(),...n&&{userAgent:n},...e}),a=t.getSession();return"ok"===a?.status&&updateSession(a,{status:"exited"}),endSession(),t.setSession(i),i}function endSession(){const e=getIsolationScope(),t=getCurrentScope().getSession()||e.getSession();t&&closeSession(t),_sendSessionUpdate(),e.setSession()}function _sendSessionUpdate(){const e=getIsolationScope(),t=getClient(),r=e.getSession();r&&t&&t.captureSession(r)}function captureSession(e=!1){e?endSession():_sendSessionUpdate()}const SENTRY_API_VERSION="7";function getBaseApiEndpoint(e){const t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function _getIngestEndpoint(e){return`${getBaseApiEndpoint(e)}${e.projectId}/envelope/`}function _encodedAuth(e,t){const r={sentry_version:SENTRY_API_VERSION};return e.publicKey&&(r.sentry_key=e.publicKey),t&&(r.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(r).toString()}function getEnvelopeEndpointWithUrlEncodedAuth(e,t,r){return t||`${_getIngestEndpoint(e)}?${_encodedAuth(e,r)}`}const installedIntegrations=[];function filterDuplicates(e){const t={};return e.forEach((e=>{const{name:r}=e,n=t[r];n&&!n.isDefaultInstance&&e.isDefaultInstance||(t[r]=e)})),Object.values(t)}function getIntegrationsToSetup(e){const t=e.defaultIntegrations||[],r=e.integrations;let n;if(t.forEach((e=>{e.isDefaultInstance=!0})),Array.isArray(r))n=[...t,...r];else if("function"==typeof r){const e=r(t);n=Array.isArray(e)?e:[e]}else n=t;return filterDuplicates(n)}function setupIntegrations(e,t){const r={};return t.forEach((t=>{t&&setupIntegration(e,t,r)})),r}function afterSetupIntegrations(e,t){for(const r of t)r?.afterAllSetup&&r.afterAllSetup(e)}function setupIntegration(e,t,r){if(r[t.name])DEBUG_BUILD$2&&debug.log(`Integration skipped because it was already installed: ${t.name}`);else{if(r[t.name]=t,installedIntegrations.includes(t.name)||"function"!=typeof t.setupOnce||(t.setupOnce(),installedIntegrations.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",((t,n)=>r(t,n,e)))}if("function"==typeof t.processEvent){const r=t.processEvent.bind(t),n=Object.assign(((t,n)=>r(t,n,e)),{id:t.name});e.addEventProcessor(n)}DEBUG_BUILD$2&&debug.log(`Integration installed: ${t.name}`)}}function defineIntegration(e){return e}function createLogContainerEnvelopeItem(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function createLogEnvelope(e,t,r,n){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),r&&n&&(i.dsn=dsnToString(n)),createEnvelope(i,[createLogContainerEnvelopeItem(e)])}function _INTERNAL_flushLogsBuffer(e,t){const r=t??_INTERNAL_getLogBuffer(e)??[];if(0===r.length)return;const n=e.getOptions(),i=createLogEnvelope(r,n._metadata,n.tunnel,e.getDsn());_getBufferMap$1().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function _INTERNAL_getLogBuffer(e){return _getBufferMap$1().get(e)}function _getBufferMap$1(){return getGlobalSingleton("clientToLogBufferMap",(()=>new WeakMap))}function createMetricContainerEnvelopeItem(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function createMetricEnvelope(e,t,r,n){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),r&&n&&(i.dsn=dsnToString(n)),createEnvelope(i,[createMetricContainerEnvelopeItem(e)])}function _INTERNAL_flushMetricsBuffer(e,t){const r=t??_INTERNAL_getMetricBuffer(e)??[];if(0===r.length)return;const n=e.getOptions(),i=createMetricEnvelope(r,n._metadata,n.tunnel,e.getDsn());_getBufferMap().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function _INTERNAL_getMetricBuffer(e){return _getBufferMap().get(e)}function _getBufferMap(){return getGlobalSingleton("clientToMetricBufferMap",(()=>new WeakMap))}function safeUnref(e){return"object"==typeof e&&"function"==typeof e.unref&&e.unref(),e}const SENTRY_BUFFER_FULL_ERROR=Symbol.for("SentryBufferFullError");function makePromiseBuffer(e=100){const t=new Set;function r(e){t.delete(e)}return{get $(){return Array.from(t)},add:function(n){if(!(t.size<e))return rejectedSyncPromise(SENTRY_BUFFER_FULL_ERROR);const i=n();return t.add(i),i.then((()=>r(i)),(()=>r(i))),i},drain:function(e){if(!t.size)return resolvedSyncPromise(!0);const r=Promise.allSettled(Array.from(t)).then((()=>!0));if(!e)return r;const n=[r,new Promise((t=>safeUnref(setTimeout((()=>t(!1)),e))))];return Promise.race(n)}}}const DEFAULT_RETRY_AFTER=6e4;function parseRetryAfterHeader(e,t=safeDateNow()){const r=parseInt(`${e}`,10);if(!isNaN(r))return 1e3*r;const n=Date.parse(`${e}`);return isNaN(n)?DEFAULT_RETRY_AFTER:n-t}function disabledUntil(e,t){return e[t]||e.all||0}function isRateLimited(e,t,r=safeDateNow()){return disabledUntil(e,t)>r}function updateRateLimits(e,{statusCode:t,headers:r},n=safeDateNow()){const i={...e},a=r?.["x-sentry-rate-limits"],o=r?.["retry-after"];if(a)for(const e of a.trim().split(",")){const[t,r,,,a]=e.split(":",5),o=parseInt(t,10),s=1e3*(isNaN(o)?60:o);if(r)for(const e of r.split(";"))"metric_bucket"===e&&a&&!a.split(";").includes("custom")||(i[e]=n+s);else i.all=n+s}else o?i.all=n+parseRetryAfterHeader(o,n):429===t&&(i.all=n+6e4);return i}const DEFAULT_TRANSPORT_BUFFER_SIZE=64;function createTransport(e,t,r=makePromiseBuffer(e.bufferSize||DEFAULT_TRANSPORT_BUFFER_SIZE)){let n={};return{send:function(i){const a=[];if(forEachEnvelopeItem(i,((t,r)=>{const i=envelopeItemTypeToDataCategory(r);isRateLimited(n,i)?e.recordDroppedEvent("ratelimit_backoff",i):a.push(t)})),0===a.length)return Promise.resolve({});const o=createEnvelope(i[0],a),s=t=>{envelopeContainsItemType(o,["client_report"])?DEBUG_BUILD$2&&debug.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`):forEachEnvelopeItem(o,((r,n)=>{e.recordDroppedEvent(t,envelopeItemTypeToDataCategory(n))}))};return r.add((()=>t({body:serializeEnvelope(o)}).then((e=>413===e.statusCode?(DEBUG_BUILD$2&&debug.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),s("send_error"),e):(DEBUG_BUILD$2&&void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&debug.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),n=updateRateLimits(n,e),e)),(e=>{throw s("network_error"),DEBUG_BUILD$2&&debug.error("Encountered error running transport request:",e),e})))).then((e=>e),(e=>{if(e===SENTRY_BUFFER_FULL_ERROR)return DEBUG_BUILD$2&&debug.error("Skipped sending event because buffer is full."),s("queue_overflow"),Promise.resolve({});throw e}))},flush:e=>r.drain(e)}}function createClientReportEnvelope(e,t,r){return createEnvelope(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:dateTimestampInSeconds(),discarded_events:e}]])}function getPossibleEventMessages(e){const t=[];e.message&&t.push(e.message);try{const r=e.exception.values[e.exception.values.length-1];r?.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`))}catch{}return t}function convertTransactionEventToSpanJson(e){const{trace_id:t,parent_span_id:r,span_id:n,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:r,span_id:n??"",start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??"",origin:a,profile_id:o?.[SEMANTIC_ATTRIBUTE_PROFILE_ID],exclusive_time:o?.[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME],measurements:e.measurements,is_segment:!0}}function convertSpanJsonToTransactionEvent(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[SEMANTIC_ATTRIBUTE_PROFILE_ID]:e.profile_id},...e.exclusive_time&&{[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]:e.exclusive_time}}}},measurements:e.measurements}}const ALREADY_SEEN_ERROR="Not capturing exception because it's already been captured.",MISSING_RELEASE_FOR_SESSION_ERROR="Discarded session because of missing or non-string release",INTERNAL_ERROR_SYMBOL=Symbol.for("SentryInternalError"),DO_NOT_SEND_EVENT_SYMBOL=Symbol.for("SentryDoNotSendEventError"),DEFAULT_FLUSH_INTERVAL=5e3;function _makeInternalError(e){return{message:e,[INTERNAL_ERROR_SYMBOL]:!0}}function _makeDoNotSendEventError(e){return{message:e,[DO_NOT_SEND_EVENT_SYMBOL]:!0}}function _isInternalError(e){return!!e&&"object"==typeof e&&INTERNAL_ERROR_SYMBOL in e}function _isDoNotSendEventError(e){return!!e&&"object"==typeof e&&DO_NOT_SEND_EVENT_SYMBOL in e}function setupWeightBasedFlushing(e,t,r,n,i){let a,o=0,s=!1;e.on(r,(()=>{o=0,clearTimeout(a),s=!1})),e.on(t,(t=>{o+=n(t),o>=8e5?i(e):s||(s=!0,a=safeUnref(setTimeout((()=>{i(e)}),DEFAULT_FLUSH_INTERVAL)))})),e.on("flush",(()=>{i(e)}))}class Client{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=makePromiseBuffer(e.transportOptions?.bufferSize??DEFAULT_TRANSPORT_BUFFER_SIZE),e.dsn?this._dsn=makeDsn(e.dsn):DEBUG_BUILD$2&&debug.warn("No DSN provided, client will not send events."),this._dsn){const t=getEnvelopeEndpointWithUrlEncodedAuth(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&setupWeightBasedFlushing(this,"afterCaptureLog","flushLogs",estimateLogSizeInBytes,_INTERNAL_flushLogsBuffer);(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&setupWeightBasedFlushing(this,"afterCaptureMetric","flushMetrics",estimateMetricSizeInBytes,_INTERNAL_flushMetricsBuffer)}captureException(e,t,r){const n=uuid4();if(checkOrSetAlreadyCaught(e))return DEBUG_BUILD$2&&debug.log(ALREADY_SEEN_ERROR),n;const i={event_id:n,...t};return this._process((()=>this.eventFromException(e,i).then((e=>this._captureEvent(e,i,r))).then((e=>e))),"error"),i.event_id}captureMessage(e,t,r,n){const i={event_id:uuid4(),...r},a=isParameterizedString(e)?e:String(e),o=isPrimitive(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process((()=>s.then((e=>this._captureEvent(e,i,n)))),o?"unknown":"error"),i.event_id}captureEvent(e,t,r){const n=uuid4();if(t?.originalException&&checkOrSetAlreadyCaught(t.originalException))return DEBUG_BUILD$2&&debug.log(ALREADY_SEEN_ERROR),n;const i={event_id:n,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,l=getDataCategoryByType(e.type);return this._process((()=>this._captureEvent(e,i,o||r,s)),l),i.event_id}captureSession(e){this.sendSession(e),updateSession(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;if(!t)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(e),n=await t.flush(e);return r&&n}async close(e){const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some((({name:e})=>e.startsWith("Spotlight"))))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];setupIntegration(this,e,this._integrations),t||afterSetupIntegrations(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=createEventEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])r=addItemToEnvelope(r,createAttachmentEnvelopeItem(e));this.sendEnvelope(r).then((t=>this.emit("afterSendEvent",e,t)))}sendSession(e){const{release:t,environment:r=DEFAULT_ENVIRONMENT}=this._options;if("aggregates"in e){const n=e.attrs||{};if(!n.release&&!t)return void(DEBUG_BUILD$2&&debug.warn(MISSING_RELEASE_FOR_SESSION_ERROR));n.release=n.release||t,n.environment=n.environment||r,e.attrs=n}else{if(!e.release&&!t)return void(DEBUG_BUILD$2&&debug.warn(MISSING_RELEASE_FOR_SESSION_ERROR));e.release=e.release||t,e.environment=e.environment||r}this.emit("beforeSendSession",e);const n=createSessionEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(n)}recordDroppedEvent(e,t,r=1){if(this._options.sendClientReports){const n=`${e}:${t}`;DEBUG_BUILD$2&&debug.log(`Recording outcome: "${n}"${r>1?` (${r} times)`:""}`),this._outcomes[n]=(this._outcomes[n]||0)+r}}on(e,t){const r=this._hooks[e]=this._hooks[e]||new Set,n=(...e)=>t(...e);return r.add(n),()=>{r.delete(n)}}emit(e,...t){const r=this._hooks[e];r&&r.forEach((e=>e(...t)))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return DEBUG_BUILD$2&&debug.error("Error while sending envelope:",e),{}}return DEBUG_BUILD$2&&debug.error("Transport disabled"),{}}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=setupIntegrations(this,e),afterSetupIntegrations(this,e)}_updateSessionFromEvent(e,t){let r="fatal"===t.level,n=!1;const i=t.exception?.values;if(i){n=!0,r=!1;for(const e of i)if(!1===e.mechanism?.handled){r=!0;break}}const a="ok"===e.status;(a&&0===e.errors||a&&r)&&(updateSession(e,{...r&&{status:"crashed"},errors:e.errors||Number(n||r)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise((e=>setTimeout(e,1))),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,r,n){const i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a?.length&&(t.integrations=a),this.emit("preprocessEvent",e,t),e.type||n.setLastEventId(e.event_id||t.event_id),prepareEvent(i,e,t,r,this,n).then((e=>{if(null===e)return e;this.emit("postprocessEvent",e,t),e.contexts={trace:getTraceContextFromScope(r),...e.contexts};const n=getDynamicSamplingContextFromScope(this,r);return e.sdkProcessingMetadata={dynamicSamplingContext:n,...e.sdkProcessingMetadata},e}))}_captureEvent(e,t={},r=getCurrentScope(),n=getIsolationScope()){return DEBUG_BUILD$2&&isErrorEvent(e)&&debug.log(`Captured error event \`${getPossibleEventMessages(e)[0]||"<unknown>"}\``),this._processEvent(e,t,r,n).then((e=>e.event_id),(e=>{DEBUG_BUILD$2&&(_isDoNotSendEventError(e)?debug.log(e.message):_isInternalError(e)?debug.warn(e.message):debug.warn(e))}))}_processEvent(e,t,r,n){const i=this.getOptions(),{sampleRate:a}=i,o=isTransactionEvent(e),s=isErrorEvent(e),l=`before send for type \`${e.type||"error"}\``,c=void 0===a?void 0:parseSampleRate(a);if(s&&"number"==typeof c&&safeMathRandom()>c)return this.recordDroppedEvent("sample_rate","error"),rejectedSyncPromise(_makeDoNotSendEventError(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));const d=getDataCategoryByType(e.type);return this._prepareEvent(e,t,r,n).then((e=>{if(null===e)throw this.recordDroppedEvent("event_processor",d),_makeDoNotSendEventError("An event processor returned `null`, will not send event.");if(t.data&&!0===t.data.__sentry__)return e;return _validateBeforeSendResult(processBeforeSend(this,i,e,t),l)})).then((i=>{if(null===i){if(this.recordDroppedEvent("before_send",d),o){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw _makeDoNotSendEventError(`${l} returned \`null\`, will not send event.`)}const a=r.getSession()||n.getSession();if(s&&a&&this._updateSessionFromEvent(a,i),o){const e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const c=i.transaction_info;if(o&&c&&i.transaction!==e.transaction){const e="custom";i.transaction_info={...c,source:e}}return this.sendEvent(i,t),i})).then(null,(e=>{if(_isDoNotSendEventError(e)||_isInternalError(e))throw e;throw this.captureException(e,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:e}),_makeInternalError(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e===SENTRY_BUFFER_FULL_ERROR&&this.recordDroppedEvent("queue_overflow",t),e)))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map((([e,t])=>{const[r,n]=e.split(":");return{reason:r,category:n,quantity:t}}))}_flushOutcomes(){DEBUG_BUILD$2&&debug.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(DEBUG_BUILD$2&&debug.log("No outcomes to send"));if(!this._dsn)return void(DEBUG_BUILD$2&&debug.log("No dsn provided, will not send outcomes"));DEBUG_BUILD$2&&debug.log("Sending outcomes:",e);const t=createClientReportEnvelope(e,this._options.tunnel&&dsnToString(this._dsn));this.sendEnvelope(t)}}function getDataCategoryByType(e){return"replay_event"===e?"replay":e||"error"}function _validateBeforeSendResult(e,t){const r=`${t} must return \`null\` or a valid event.`;if(isThenable(e))return e.then((e=>{if(!isPlainObject(e)&&null!==e)throw _makeInternalError(r);return e}),(e=>{throw _makeInternalError(`${t} rejected with ${e}`)}));if(!isPlainObject(e)&&null!==e)throw _makeInternalError(r);return e}function processBeforeSend(e,t,r,n){const{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:o,ignoreSpans:s}=t;let l=r;if(isErrorEvent(l)&&i)return i(l,n);if(isTransactionEvent(l)){if(o||s){const t=convertTransactionEventToSpanJson(l);if(s?.length&&shouldIgnoreSpan(t,s))return null;if(o){const e=o(t);e?l=merge(r,convertSpanJsonToTransactionEvent(e)):showSpanDropWarning()}if(l.spans){const t=[],r=l.spans;for(const e of r)if(s?.length&&shouldIgnoreSpan(e,s))reparentChildSpans(r,e);else if(o){const r=o(e);r?t.push(r):(showSpanDropWarning(),t.push(e))}else t.push(e);const n=l.spans.length-t.length;n&&e.recordDroppedEvent("before_send","span",n),l.spans=t}}if(a){if(l.spans){const e=l.spans.length;l.sdkProcessingMetadata={...r.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(l,n)}}return l}function isErrorEvent(e){return void 0===e.type}function isTransactionEvent(e){return"transaction"===e.type}function estimateMetricSizeInBytes(e){let t=0;return e.name&&(t+=2*e.name.length),t+=8,t+estimateAttributesSizeInBytes(e.attributes)}function estimateLogSizeInBytes(e){let t=0;return e.message&&(t+=2*e.message.length),t+estimateAttributesSizeInBytes(e.attributes)}function estimateAttributesSizeInBytes(e){if(!e)return 0;let t=0;return Object.values(e).forEach((e=>{Array.isArray(e)?t+=e.length*estimatePrimitiveSizeInBytes(e[0]):isPrimitive(e)?t+=estimatePrimitiveSizeInBytes(e):t+=100})),t}function estimatePrimitiveSizeInBytes(e){return"string"==typeof e?2*e.length:"number"==typeof e?8:"boolean"==typeof e?4:0}function hasSentryFetchUrlHost(e){return isError(e)&&"__sentry_fetch_url_host__"in e&&"string"==typeof e.__sentry_fetch_url_host__}function _enhanceErrorWithSentryInfo(e){return hasSentryFetchUrlHost(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function initAndBind(e,t){!0===t.debug&&(DEBUG_BUILD$2?debug.enable():consoleSandbox((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})));getCurrentScope().update(t.initialScope);const r=new e(t);return setCurrentClient(r),r.init(),r}function setCurrentClient(e){getCurrentScope().setClient(e)}function parseUrl(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:r,hash:n,relative:t[5]+r+n}}function stripDataUrlContent(e,t=!0){if(e.startsWith("data:")){const r=e.match(/^data:([^;,]+)/),n=r?r[1]:"text/plain",i=e.includes(";base64,"),a=e.indexOf(",");let o="";if(t&&-1!==a){const t=e.slice(a+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${n}${i?",base64":""}${o?`,${o}`:""}`}return e}function addAutoIpAddressToSession(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}function applySdkMetadata(e,t,r=[t],n="npm"){const i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=r.map((e=>({name:`${n}:@sentry/${e}`,version:SDK_VERSION}))),i.version=SDK_VERSION)}const DEFAULT_BREADCRUMBS=100;function addBreadcrumb(e,t){const r=getClient(),n=getIsolationScope();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=DEFAULT_BREADCRUMBS}=r.getOptions();if(a<=0)return;const o={timestamp:dateTimestampInSeconds(),...e},s=i?consoleSandbox((()=>i(o,t))):o;null!==s&&(r.emit&&r.emit("beforeAddBreadcrumb",s,t),n.addBreadcrumb(s,a))}let originalFunctionToString;const INTEGRATION_NAME$8="FunctionToString",SETUP_CLIENTS=new WeakMap,_functionToStringIntegration=()=>({name:INTEGRATION_NAME$8,setupOnce(){originalFunctionToString=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=getOriginalFunction(this),r=SETUP_CLIENTS.has(getClient())&&void 0!==t?t:this;return originalFunctionToString.apply(r,e)}}catch{}},setup(e){SETUP_CLIENTS.set(e,!0)}}),functionToStringIntegration=defineIntegration(_functionToStringIntegration),DEFAULT_IGNORE_ERRORS=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,'can\'t redefine non-configurable property "solana"',"vv().getRestrictions is not a function. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],INTEGRATION_NAME$7="EventFilters",eventFiltersIntegration=defineIntegration(((e={})=>{let t;return{name:INTEGRATION_NAME$7,setup(r){const n=r.getOptions();t=_mergeOptions(e,n)},processEvent(r,n,i){if(!t){const r=i.getOptions();t=_mergeOptions(e,r)}return _shouldDropEvent$1(r,t)?null:r}}})),inboundFiltersIntegration=defineIntegration(((e={})=>({...eventFiltersIntegration(e),name:"InboundFilters"})));function _mergeOptions(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:DEFAULT_IGNORE_ERRORS],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function _shouldDropEvent$1(e,t){if(e.type){if("transaction"===e.type&&_isIgnoredTransaction(e,t.ignoreTransactions))return DEBUG_BUILD$2&&debug.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${getEventDescription(e)}`),!0}else{if(_isIgnoredError(e,t.ignoreErrors))return DEBUG_BUILD$2&&debug.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${getEventDescription(e)}`),!0;if(_isUselessError(e))return DEBUG_BUILD$2&&debug.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${getEventDescription(e)}`),!0;if(_isDeniedUrl(e,t.denyUrls))return DEBUG_BUILD$2&&debug.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${getEventDescription(e)}.\nUrl: ${_getEventFilterUrl(e)}`),!0;if(!_isAllowedUrl(e,t.allowUrls))return DEBUG_BUILD$2&&debug.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${getEventDescription(e)}.\nUrl: ${_getEventFilterUrl(e)}`),!0}return!1}function _isIgnoredError(e,t){return!!t?.length&&getPossibleEventMessages(e).some((e=>stringMatchesSomePattern(e,t)))}function _isIgnoredTransaction(e,t){if(!t?.length)return!1;const r=e.transaction;return!!r&&stringMatchesSomePattern(r,t)}function _isDeniedUrl(e,t){if(!t?.length)return!1;const r=_getEventFilterUrl(e);return!!r&&stringMatchesSomePattern(r,t)}function _isAllowedUrl(e,t){if(!t?.length)return!0;const r=_getEventFilterUrl(e);return!r||stringMatchesSomePattern(r,t)}function _getLastValidUrl(e=[]){for(let t=e.length-1;t>=0;t--){const r=e[t];if(r&&"<anonymous>"!==r.filename&&"[native code]"!==r.filename)return r.filename||null}return null}function _getEventFilterUrl(e){try{const t=[...e.exception?.values??[]].reverse().find((e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length)),r=t?.stacktrace?.frames;return r?_getLastValidUrl(r):null}catch{return DEBUG_BUILD$2&&debug.error(`Cannot extract url for event ${getEventDescription(e)}`),null}}function _isUselessError(e){return!!e.exception?.values?.length&&(!e.message&&!e.exception.values.some((e=>e.stacktrace||e.type&&"Error"!==e.type||e.value)))}function applyAggregateErrorsToEvent(e,t,r,n,i,a){if(!i.exception?.values||!a||!isInstanceOf(a.originalException,Error))return;const o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=aggregateExceptionsFromError(e,t,n,a.originalException,r,i.exception.values,o,0))}function aggregateExceptionsFromError(e,t,r,n,i,a,o,s){if(a.length>=r+1)return a;let l=[...a];if(isInstanceOf(n[i],Error)){applyExceptionGroupFieldsForParentException(o,s,n);const a=e(t,n[i]),c=l.length;applyExceptionGroupFieldsForChildException(a,i,c,s),l=aggregateExceptionsFromError(e,t,r,n[i],i,[a,...l],a,c)}return isExceptionGroup(n)&&n.errors.forEach(((a,c)=>{if(isInstanceOf(a,Error)){applyExceptionGroupFieldsForParentException(o,s,n);const d=e(t,a),u=l.length;applyExceptionGroupFieldsForChildException(d,`errors[${c}]`,u,s),l=aggregateExceptionsFromError(e,t,r,a,i,[d,...l],d,u)}})),l}function isExceptionGroup(e){return Array.isArray(e.errors)}function applyExceptionGroupFieldsForParentException(e,t,r){e.mechanism={handled:!0,type:"auto.core.linked_errors",...isExceptionGroup(r)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function applyExceptionGroupFieldsForChildException(e,t,r,n){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:r,parent_id:n}}function addConsoleInstrumentationHandler(e){const t="console";addHandler(t,e),maybeInstrument(t,instrumentConsole)}function instrumentConsole(){"console"in GLOBAL_OBJ&&CONSOLE_LEVELS.forEach((function(e){e in GLOBAL_OBJ.console&&fill(GLOBAL_OBJ.console,e,(function(t){return originalConsoleMethods[e]=t,function(...t){triggerHandlers("console",{args:t,level:e});const r=originalConsoleMethods[e];r?.apply(GLOBAL_OBJ.console,t)}}))}))}function severityLevelFromString(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const INTEGRATION_NAME$6="Dedupe",_dedupeIntegration=()=>{let e;return{name:INTEGRATION_NAME$6,processEvent(t){if(t.type)return t;try{if(_shouldDropEvent(t,e))return DEBUG_BUILD$2&&debug.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},dedupeIntegration=defineIntegration(_dedupeIntegration);function _shouldDropEvent(e,t){return!!t&&(!!_isSameMessageEvent(e,t)||!!_isSameExceptionEvent(e,t))}function _isSameMessageEvent(e,t){const r=e.message,n=t.message;return!(!r&&!n)&&(!(r&&!n||!r&&n)&&(r===n&&(!!_isSameFingerprint(e,t)&&!!_isSameStacktrace(e,t))))}function _isSameExceptionEvent(e,t){const r=_getExceptionFromEvent(t),n=_getExceptionFromEvent(e);return!(!r||!n)&&(r.type===n.type&&r.value===n.value&&(!!_isSameFingerprint(e,t)&&!!_isSameStacktrace(e,t)))}function _isSameStacktrace(e,t){let r=getFramesFromEvent(e),n=getFramesFromEvent(t);if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const t=n[e],i=r[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function _isSameFingerprint(e,t){let r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;try{return!(r.join("")!==n.join(""))}catch{return!1}}function _getExceptionFromEvent(e){return e.exception?.values?.[0]}const INTEGRATION_NAME$5="ConversationId",_conversationIdIntegration=()=>({name:INTEGRATION_NAME$5,setup(e){e.on("spanStart",(e=>{const t=getCurrentScope().getScopeData(),r=getIsolationScope().getScopeData(),n=t.conversationId||r.conversationId;n&&e.setAttribute(GEN_AI_CONVERSATION_ID_ATTRIBUTE,n)}))}}),conversationIdIntegration=defineIntegration(_conversationIdIntegration);function getBreadcrumbLogLevelFromHttpStatusCode(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}const WINDOW$2=GLOBAL_OBJ;function supportsHistory(){return"history"in WINDOW$2&&!!WINDOW$2.history}function _isFetchSupported(){if(!("fetch"in WINDOW$2))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function isNativeFunction(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function supportsNativeFetch(){if("string"==typeof EdgeRuntime)return!0;if(!_isFetchSupported())return!1;if(isNativeFunction(WINDOW$2.fetch))return!0;let e=!1;const t=WINDOW$2.document;if(t&&"function"==typeof t.createElement)try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),r.contentWindow?.fetch&&(e=isNativeFunction(r.contentWindow.fetch)),t.head.removeChild(r)}catch(e){DEBUG_BUILD$2&&debug.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e}function addFetchInstrumentationHandler(e,t){const r="fetch";addHandler(r,e),maybeInstrument(r,(()=>instrumentFetch(void 0,t)))}function instrumentFetch(e,t=!1){t&&!supportsNativeFetch()||fill(GLOBAL_OBJ,"fetch",(function(e){return function(...t){const r=new Error,{method:n,url:i}=parseFetchArgs(t),a={args:t,fetchData:{method:n,url:i},startTimestamp:1e3*timestampInSeconds(),virtualError:r,headers:getHeadersFromFetchArgs(t)};return triggerHandlers("fetch",{...a}),e.apply(GLOBAL_OBJ,t).then((async e=>(triggerHandlers("fetch",{...a,endTimestamp:1e3*timestampInSeconds(),response:e}),e)),(e=>{triggerHandlers("fetch",{...a,endTimestamp:1e3*timestampInSeconds(),error:e}),isError(e)&&void 0===e.stack&&(e.stack=r.stack,addNonEnumerableProperty(e,"framesToPop",1));const t=getClient(),n=t?.getOptions().enhanceFetchErrorMessages??"always";if(!1!==n&&e instanceof TypeError&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const t=new URL(a.fetchData.url).host;"always"===n?e.message=`${e.message} (${t})`:addNonEnumerableProperty(e,"__sentry_fetch_url_host__",t)}catch{}throw e}))}}))}function hasProp(e,t){return!!e&&"object"==typeof e&&!!e[t]}function getUrlFromResource(e){return"string"==typeof e?e:e?hasProp(e,"url")?e.url:e.toString?e.toString():"":""}function parseFetchArgs(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,r]=e;return{url:getUrlFromResource(t),method:hasProp(r,"method")?String(r.method).toUpperCase():isRequest(t)&&hasProp(t,"method")?String(t.method).toUpperCase():"GET"}}const t=e[0];return{url:getUrlFromResource(t),method:hasProp(t,"method")?String(t.method).toUpperCase():"GET"}}function getHeadersFromFetchArgs(e){const[t,r]=e;try{if("object"==typeof r&&null!==r&&"headers"in r&&r.headers)return new Headers(r.headers);if(isRequest(t))return new Headers(t.headers)}catch{}}function getSDKSource(){return"npm"}const WINDOW$1=GLOBAL_OBJ;let ignoreOnError=0;function shouldIgnoreOnError(){return ignoreOnError>0}function ignoreNextOnError(){ignoreOnError++,setTimeout((()=>{ignoreOnError--}))}function wrap(e,t={}){if(!function(e){return"function"==typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if(getOriginalFunction(e))return e}catch{return e}const r=function(...r){try{const n=r.map((e=>wrap(e,t)));return e.apply(this,n)}catch(e){throw ignoreNextOnError(),withScope((n=>{n.addEventProcessor((e=>(t.mechanism&&(addExceptionTypeValue(e,void 0),addExceptionMechanism(e,t.mechanism)),e.extra={...e.extra,arguments:r},e))),captureException(e)})),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}markFunctionWrapped(r,e),addNonEnumerableProperty(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch{}return r}function getHttpRequestData(){const e=getLocationHref(),{referrer:t}=WINDOW$1.document||{},{userAgent:r}=WINDOW$1.navigator||{};return{url:e,headers:{...t&&{Referer:t},...r&&{"User-Agent":r}}}}function exceptionFromError(e,t){const r=parseStackFrames(e,t),n={type:extractType(t),value:extractMessage(t)};return r.length&&(n.stacktrace={frames:r}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function eventFromPlainObject(e,t,r,n){const i=getClient(),a=i?.getOptions().normalizeDepth,o=getErrorPropertyFromObject(t),s={__serialized__:normalizeToSize(t,a)};if(o)return{exception:{values:[exceptionFromError(e,o)]},extra:s};const l={exception:{values:[{type:isEvent(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:getNonErrorObjectExceptionValue(t,{isUnhandledRejection:n})}]},extra:s};if(r){const t=parseStackFrames(e,r);t.length&&(l.exception.values[0].stacktrace={frames:t})}return l}function eventFromError(e,t){return{exception:{values:[exceptionFromError(e,t)]}}}function parseStackFrames(e,t){const r=t.stacktrace||t.stack||"",n=getSkipFirstStackStringLines(t),i=getPopFirstTopFrames(t);try{return e(r,n,i)}catch{}return[]}const reactMinifiedRegexp=/Minified React error #\d+;/i;function getSkipFirstStackStringLines(e){return e&&reactMinifiedRegexp.test(e.message)?1:0}function getPopFirstTopFrames(e){return"number"==typeof e.framesToPop?e.framesToPop:0}function isWebAssemblyException(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function extractType(e){const t=e?.name;if(!t&&isWebAssemblyException(e)){return e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception"}return t}function extractMessage(e){const t=e?.message;return isWebAssemblyException(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?_enhanceErrorWithSentryInfo(t.error):_enhanceErrorWithSentryInfo(e):"No error message"}function eventFromException(e,t,r,n){const i=eventFromUnknownInput(e,t,r?.syntheticException||void 0,n);return addExceptionMechanism(i),i.level="error",r?.event_id&&(i.event_id=r.event_id),resolvedSyncPromise(i)}function eventFromMessage(e,t,r="info",n,i){const a=eventFromString(e,t,n?.syntheticException||void 0,i);return a.level=r,n?.event_id&&(a.event_id=n.event_id),resolvedSyncPromise(a)}function eventFromUnknownInput(e,t,r,n,i){let a;if(isErrorEvent$1(t)&&t.error){return eventFromError(e,t.error)}if(isDOMError(t)||isDOMException(t)){const i=t;if("stack"in t)a=eventFromError(e,t);else{const t=i.name||(isDOMError(i)?"DOMError":"DOMException"),o=i.message?`${t}: ${i.message}`:t;a=eventFromString(e,o,r,n),addExceptionTypeValue(a,o)}return"code"in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}if(isError(t))return eventFromError(e,t);if(isPlainObject(t)||isEvent(t)){return a=eventFromPlainObject(e,t,r,i),addExceptionMechanism(a,{synthetic:!0}),a}return a=eventFromString(e,t,r,n),addExceptionTypeValue(a,`${t}`),addExceptionMechanism(a,{synthetic:!0}),a}function eventFromString(e,t,r,n){const i={};if(n&&r){const n=parseStackFrames(e,r);n.length&&(i.exception={values:[{value:t,stacktrace:{frames:n}}]}),addExceptionMechanism(i,{synthetic:!0})}if(isParameterizedString(t)){const{__sentry_template_string__:e,__sentry_template_values__:r}=t;return i.logentry={message:e,params:r},i}return i.message=t,i}function getNonErrorObjectExceptionValue(e,{isUnhandledRejection:t}){const r=extractExceptionKeysForMessage(e),n=t?"promise rejection":"exception";if(isErrorEvent$1(e))return`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``;if(isEvent(e)){return`Event \`${getObjectClassName(e)}\` (type=${e.type}) captured as ${n}`}return`Object captured as ${n} with keys: ${r}`}function getObjectClassName(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function getErrorPropertyFromObject(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t];if(r instanceof Error)return r}}class BrowserClient extends Client{constructor(e){const t=applyDefaultOptions(e);applySdkMetadata(t,"browser",["browser"],WINDOW$1.SENTRY_SDK_SOURCE||getSDKSource()),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?"auto":"never",...t._metadata.sdk.settings}),super(t);const{sendDefaultPii:r,sendClientReports:n,enableLogs:i,_experiments:a,enableMetrics:o}=this._options,s=o??a?.enableMetrics??!0;WINDOW$1.document&&(n||i||s)&&WINDOW$1.document.addEventListener("visibilitychange",(()=>{"hidden"===WINDOW$1.document.visibilityState&&(n&&this._flushOutcomes(),i&&_INTERNAL_flushLogsBuffer(this),s&&_INTERNAL_flushMetricsBuffer(this))})),r&&this.on("beforeSendSession",addAutoIpAddressToSession)}eventFromException(e,t){return eventFromException(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return eventFromMessage(this._options.stackParser,e,t,r,this._options.attachStacktrace)}_prepareEvent(e,t,r,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,r,n)}}function applyDefaultOptions(e){return{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:WINDOW$1.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const DEBUG_BUILD$1="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,WINDOW=GLOBAL_OBJ,DEBOUNCE_DURATION=1e3;let debounceTimerID,lastCapturedEventType,lastCapturedEventTargetId,lastHref;function addClickKeypressInstrumentationHandler(e){addHandler("dom",e),maybeInstrument("dom",instrumentDOM)}function instrumentDOM(){if(!WINDOW.document)return;const e=triggerHandlers.bind(null,"dom"),t=makeDOMEventHandler(e,!0);WINDOW.document.addEventListener("click",t,!1),WINDOW.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const r=WINDOW,n=r[t]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(fill(n,"addEventListener",(function(t){return function(r,n,i){if("click"===r||"keypress"==r)try{const n=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=n[r]=n[r]||{refCount:0};if(!a.handler){const n=makeDOMEventHandler(e);a.handler=n,t.call(this,r,n,i)}a.refCount++}catch{}return t.call(this,r,n,i)}})),fill(n,"removeEventListener",(function(e){return function(t,r,n){if("click"===t||"keypress"==t)try{const r=this.__sentry_instrumentation_handlers__||{},i=r[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,n),i.handler=void 0,delete r[t]),0===Object.keys(r).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,r,n)}})))}))}function isSimilarToLastCapturedEvent(e){if(e.type!==lastCapturedEventType)return!1;try{if(!e.target||e.target._sentryId!==lastCapturedEventTargetId)return!1}catch{}return!0}function shouldSkipDOMEvent(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}function makeDOMEventHandler(e,t=!1){return r=>{if(!r||r._sentryCaptured)return;const n=getEventTarget(r);if(shouldSkipDOMEvent(r.type,n))return;addNonEnumerableProperty(r,"_sentryCaptured",!0),n&&!n._sentryId&&addNonEnumerableProperty(n,"_sentryId",uuid4());const i="keypress"===r.type?"input":r.type;if(!isSimilarToLastCapturedEvent(r)){e({event:r,name:i,global:t}),lastCapturedEventType=r.type,lastCapturedEventTargetId=n?n._sentryId:void 0}clearTimeout(debounceTimerID),debounceTimerID=WINDOW.setTimeout((()=>{lastCapturedEventTargetId=void 0,lastCapturedEventType=void 0}),DEBOUNCE_DURATION)}}function getEventTarget(e){try{return e.target}catch{return null}}function addHistoryInstrumentationHandler(e){const t="history";addHandler(t,e),maybeInstrument(t,instrumentHistory)}function instrumentHistory(){function e(e){return function(...t){const r=t.length>2?t[2]:void 0;if(r){const n=lastHref,i=getAbsoluteUrl(String(r));if(lastHref=i,n===i)return e.apply(this,t);triggerHandlers("history",{from:n,to:i})}return e.apply(this,t)}}WINDOW.addEventListener("popstate",(()=>{const e=WINDOW.location.href,t=lastHref;if(lastHref=e,t===e)return;triggerHandlers("history",{from:t,to:e})})),supportsHistory()&&(fill(WINDOW.history,"pushState",e),fill(WINDOW.history,"replaceState",e))}function getAbsoluteUrl(e){try{return new URL(e,WINDOW.location.origin).toString()}catch{return e}}const cachedImplementations={};function getNativeImplementation(e){const t=cachedImplementations[e];if(t)return t;let r=WINDOW[e];if(isNativeFunction(r))return cachedImplementations[e]=r.bind(WINDOW);const n=WINDOW.document;if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const i=t.contentWindow;i?.[e]&&(r=i[e]),n.head.removeChild(t)}catch(t){DEBUG_BUILD$1&&debug.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return r?cachedImplementations[e]=r.bind(WINDOW):r}function clearCachedImplementation(e){cachedImplementations[e]=void 0}const SENTRY_XHR_DATA_KEY="__sentry_xhr_v3__";function addXhrInstrumentationHandler(e){addHandler("xhr",e),maybeInstrument("xhr",instrumentXHR)}function instrumentXHR(){if(!WINDOW.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,r){const n=new Error,i=1e3*timestampInSeconds(),a=isString(r[0])?r[0].toUpperCase():void 0,o=parseXhrUrlArg(r[1]);if(!a||!o)return e.apply(t,r);t[SENTRY_XHR_DATA_KEY]={method:a,url:o,request_headers:{}},"POST"===a&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const s=()=>{const e=t[SENTRY_XHR_DATA_KEY];if(e&&4===t.readyState){try{e.status_code=t.status}catch{}triggerHandlers("xhr",{endTimestamp:1e3*timestampInSeconds(),startTimestamp:i,xhr:t,virtualError:n})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,r)=>(s(),e.apply(t,r))}):t.addEventListener("readystatechange",s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,r){const[n,i]=r,a=t[SENTRY_XHR_DATA_KEY];return a&&isString(n)&&isString(i)&&(a.request_headers[n.toLowerCase()]=i),e.apply(t,r)}}),e.apply(t,r)}}),e.send=new Proxy(e.send,{apply(e,t,r){const n=t[SENTRY_XHR_DATA_KEY];if(!n)return e.apply(t,r);void 0!==r[0]&&(n.body=r[0]);return triggerHandlers("xhr",{startTimestamp:1e3*timestampInSeconds(),xhr:t}),e.apply(t,r)}})}function parseXhrUrlArg(e){if(isString(e))return e;try{return e.toString()}catch{}}const DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE=40;function makeFetchTransport(e,t=getNativeImplementation("fetch")){let r=0,n=0;return createTransport(e,(async function(i){const a=i.body.length;r+=a,n++;const o={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:r<=6e4&&n<15,...e.fetchOptions};try{const r=await t(e.url,o);return{statusCode:r.status,headers:{"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")}}}catch(e){throw clearCachedImplementation("fetch"),e}finally{r-=a,n--}}),makePromiseBuffer(e.bufferSize||DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE))}const DEBUG_BUILD="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,CHROME_PRIORITY=30,GECKO_PRIORITY=50;function createFrame(e,t,r,n){const i={filename:e,function:"<anonymous>"===t?UNKNOWN_FUNCTION:t,in_app:!0};return void 0!==r&&(i.lineno=r),void 0!==n&&(i.colno=n),i}const chromeRegexNoFnName=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,chromeRegex=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,chromeEvalRegex=/\((\S*)(?::(\d+))(?::(\d+))\)/,chromeDataUriRegex=/at (.+?) ?\(data:(.+?),/,chromeStackParserFn=e=>{const t=e.match(chromeDataUriRegex);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const r=chromeRegexNoFnName.exec(e);if(r){const[,e,t,n]=r;return createFrame(e,UNKNOWN_FUNCTION,+t,+n)}const n=chromeRegex.exec(e);if(n){if(n[2]&&0===n[2].indexOf("eval")){const e=chromeEvalRegex.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=extractSafariExtensionDetails(n[1]||UNKNOWN_FUNCTION,n[2]);return createFrame(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},chromeStackLineParser=[CHROME_PRIORITY,chromeStackParserFn],geckoREgex=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,geckoEvalRegex=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gecko=e=>{const t=geckoREgex.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=geckoEvalRegex.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],r=t[1]||UNKNOWN_FUNCTION;return[r,e]=extractSafariExtensionDetails(r,e),createFrame(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},geckoStackLineParser=[GECKO_PRIORITY,gecko],defaultStackLineParsers=[chromeStackLineParser,geckoStackLineParser],defaultStackParser=createStackParser(...defaultStackLineParsers),extractSafariExtensionDetails=(e,t)=>{const r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:UNKNOWN_FUNCTION,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},MAX_ALLOWED_STRING_LENGTH=1024,INTEGRATION_NAME$4="Breadcrumbs",_breadcrumbsIntegration=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:INTEGRATION_NAME$4,setup(e){t.console&&addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(e)),t.dom&&addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(e,t.dom)),t.xhr&&addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(e)),t.fetch&&addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(e)),t.history&&addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(e)),t.sentry&&e.on("beforeSendEvent",_getSentryBreadcrumbHandler(e))}}},breadcrumbsIntegration=defineIntegration(_breadcrumbsIntegration);function _getSentryBreadcrumbHandler(e){return function(t){getClient()===e&&addBreadcrumb({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:getEventDescription(t)},{event:t})}}function _getDomBreadcrumbHandler(e,t){return function(r){if(getClient()!==e)return;let n,i,a="object"==typeof t?t.serializeAttribute:void 0,o="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;o&&o>MAX_ALLOWED_STRING_LENGTH&&(DEBUG_BUILD&&debug.warn(`\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${o} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`),o=MAX_ALLOWED_STRING_LENGTH),"string"==typeof a&&(a=[a]);try{const e=r.event,t=_isEvent(e)?e.target:e;n=htmlTreeAsString(t,{keyAttrs:a,maxStringLength:o}),i=getComponentName(t)}catch{n="<unknown>"}if(0===n.length)return;const s={category:`ui.${r.name}`,message:n};i&&(s.data={"ui.component_name":i}),addBreadcrumb(s,{event:r.event,name:r.name,global:r.global})}}function _getConsoleBreadcrumbHandler(e){return function(t){if(getClient()!==e)return;const r={category:"console",data:{arguments:t.args,logger:"console"},level:severityLevelFromString(t.level),message:safeJoin(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;r.message=`Assertion failed: ${safeJoin(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1)}addBreadcrumb(r,{input:t.args,level:t.level})}}function _getXhrBreadcrumbHandler(e){return function(t){if(getClient()!==e)return;const{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[SENTRY_XHR_DATA_KEY];if(!r||!n||!i)return;const{method:a,url:o,status_code:s,body:l}=i,c={method:a,url:o,status_code:s},d={xhr:t.xhr,input:l,startTimestamp:r,endTimestamp:n},u={category:"xhr",data:c,type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(s)};e.emit("beforeOutgoingRequestBreadcrumb",u,d),addBreadcrumb(u,d)}}function _getFetchBreadcrumbHandler(e){return function(t){if(getClient()!==e)return;const{startTimestamp:r,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.fetchData.method,t.fetchData.url,t.error){const i=t.fetchData,a={data:t.error,input:t.args,startTimestamp:r,endTimestamp:n},o={category:"fetch",data:i,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",o,a),addBreadcrumb(o,a)}else{const i=t.response,a={...t.fetchData,status_code:i?.status};t.fetchData.request_body_size,t.fetchData.response_body_size;const o={input:t.args,response:i,startTimestamp:r,endTimestamp:n},s={category:"fetch",data:a,type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(a.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",s,o),addBreadcrumb(s,o)}}}function _getHistoryBreadcrumbHandler(e){return function(t){if(getClient()!==e)return;let r=t.from,n=t.to;const i=parseUrl(WINDOW$1.location.href);let a=r?parseUrl(r):void 0;const o=parseUrl(n);a?.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),addBreadcrumb({category:"navigation",data:{from:r,to:n}})}}function _isEvent(e){return!!e&&!!e.target}const DEFAULT_EVENT_TARGET=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],INTEGRATION_NAME$3="BrowserApiErrors",_browserApiErrorsIntegration=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:INTEGRATION_NAME$3,setupOnce(){t.setTimeout&&fill(WINDOW$1,"setTimeout",_wrapTimeFunction),t.setInterval&&fill(WINDOW$1,"setInterval",_wrapTimeFunction),t.requestAnimationFrame&&fill(WINDOW$1,"requestAnimationFrame",_wrapRAF),t.XMLHttpRequest&&"XMLHttpRequest"in WINDOW$1&&fill(XMLHttpRequest.prototype,"send",_wrapXHR);const e=t.eventTarget;if(e){(Array.isArray(e)?e:DEFAULT_EVENT_TARGET).forEach((e=>_wrapEventTarget(e,t)))}}}},browserApiErrorsIntegration=defineIntegration(_browserApiErrorsIntegration);function _wrapTimeFunction(e){return function(...t){const r=t[0];return t[0]=wrap(r,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${getFunctionName(e)}`}}),e.apply(this,t)}}function _wrapRAF(e){return function(t){return e.apply(this,[wrap(t,{mechanism:{data:{handler:getFunctionName(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function _wrapXHR(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in r&&"function"==typeof r[e]&&fill(r,e,(function(t){const r={mechanism:{data:{handler:getFunctionName(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},n=getOriginalFunction(t);return n&&(r.mechanism.data.handler=getFunctionName(n)),wrap(t,r)}))})),e.apply(this,t)}}function _wrapEventTarget(e,t){const r=WINDOW$1,n=r[e]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(fill(n,"addEventListener",(function(r){return function(n,i,a){try{isEventListenerObject(i)&&(i.handleEvent=wrap(i.handleEvent,{mechanism:{data:{handler:getFunctionName(i),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&unregisterOriginalCallback(this,n,i),r.apply(this,[n,wrap(i,{mechanism:{data:{handler:getFunctionName(i),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}})),fill(n,"removeEventListener",(function(e){return function(t,r,n){try{const i=r.__sentry_wrapped__;i&&e.call(this,t,i,n)}catch{}return e.call(this,t,r,n)}})))}function isEventListenerObject(e){return"function"==typeof e.handleEvent}function unregisterOriginalCallback(e,t,r){e&&"object"==typeof e&&"removeEventListener"in e&&"function"==typeof e.removeEventListener&&e.removeEventListener(t,r)}const browserSessionIntegration=defineIntegration(((e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){void 0!==WINDOW$1.document?(startSession({ignoreDuration:!0}),captureSession(),"route"===t&&addHistoryInstrumentationHandler((({from:e,to:t})=>{void 0!==e&&e!==t&&(startSession({ignoreDuration:!0}),captureSession())}))):DEBUG_BUILD&&debug.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.")}}})),INTEGRATION_NAME$2="CultureContext",_cultureContextIntegration=()=>({name:INTEGRATION_NAME$2,preprocessEvent(e){const t=getCultureContext();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}}),cultureContextIntegration=defineIntegration(_cultureContextIntegration);function getCultureContext(){try{const e=WINDOW$1.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const INTEGRATION_NAME$1="GlobalHandlers",_globalHandlersIntegration=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:INTEGRATION_NAME$1,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(_installGlobalOnErrorHandler(e),globalHandlerLog("onerror")),t.onunhandledrejection&&(_installGlobalOnUnhandledRejectionHandler(e),globalHandlerLog("onunhandledrejection"))}}},globalHandlersIntegration=defineIntegration(_globalHandlersIntegration);function _installGlobalOnErrorHandler(e){addGlobalErrorInstrumentationHandler((t=>{const{stackParser:r,attachStacktrace:n}=getOptions();if(getClient()!==e||shouldIgnoreOnError())return;const{msg:i,url:a,line:o,column:s,error:l}=t,c=_enhanceEventWithInitialFrame(eventFromUnknownInput(r,l||i,void 0,n,!1),a,o,s);c.level="error",captureEvent(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})}))}function _installGlobalOnUnhandledRejectionHandler(e){addGlobalUnhandledRejectionInstrumentationHandler((t=>{const{stackParser:r,attachStacktrace:n}=getOptions();if(getClient()!==e||shouldIgnoreOnError())return;const i=_getUnhandledRejectionError(t),a=isPrimitive(i)?_eventFromRejectionWithPrimitive(i):eventFromUnknownInput(r,i,void 0,n,!0);a.level="error",captureEvent(a,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})}))}function _getUnhandledRejectionError(e){if(isPrimitive(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function _eventFromRejectionWithPrimitive(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function _enhanceEventWithInitialFrame(e,t,r,n){const i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},l=s.frames=s.frames||[],c=n,d=r,u=getFilenameFromUrl(t)??getLocationHref();return 0===l.length&&l.push({colno:c,filename:u,function:UNKNOWN_FUNCTION,in_app:!0,lineno:d}),e}function globalHandlerLog(e){DEBUG_BUILD&&debug.log(`Global Handler attached: ${e}`)}function getOptions(){const e=getClient();return e?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function getFilenameFromUrl(e){if(isString(e)&&0!==e.length)return e.startsWith("data:")?`<${stripDataUrlContent(e,!1)}>`:e}const httpContextIntegration=defineIntegration((()=>({name:"HttpContext",preprocessEvent(e){if(!WINDOW$1.navigator&&!WINDOW$1.location&&!WINDOW$1.document)return;const t=getHttpRequestData(),r={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:r}}}))),DEFAULT_KEY="cause",DEFAULT_LIMIT=5,INTEGRATION_NAME="LinkedErrors",_linkedErrorsIntegration=(e={})=>{const t=e.limit||DEFAULT_LIMIT,r=e.key||DEFAULT_KEY;return{name:INTEGRATION_NAME,preprocessEvent(e,n,i){applyAggregateErrorsToEvent(exceptionFromError,i.getOptions().stackParser,r,t,e,n)}}},linkedErrorsIntegration=defineIntegration(_linkedErrorsIntegration);function checkAndWarnIfIsEmbeddedBrowserExtension(){return!!_isEmbeddedBrowserExtension()&&(DEBUG_BUILD&&consoleSandbox((()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")})),!0)}function _isEmbeddedBrowserExtension(){if(void 0===WINDOW$1.window)return!1;const e=WINDOW$1;if(e.nw)return!1;const t=e.chrome||e.browser;if(!t?.runtime?.id)return!1;const r=getLocationHref();return!(WINDOW$1===WINDOW$1.top&&["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"].some((e=>r.startsWith(`${e}://`))))}function getDefaultIntegrations(e){return[inboundFiltersIntegration(),functionToStringIntegration(),conversationIdIntegration(),browserApiErrorsIntegration(),breadcrumbsIntegration(),globalHandlersIntegration(),linkedErrorsIntegration(),dedupeIntegration(),httpContextIntegration(),cultureContextIntegration(),browserSessionIntegration()]}function init(e={}){const t=!e.skipBrowserExtensionCheck&&checkAndWarnIfIsEmbeddedBrowserExtension();let r=null==e.defaultIntegrations?getDefaultIntegrations():e.defaultIntegrations;const n={...e,enabled:!t&&e.enabled,stackParser:stackParserFromStackParserOptions(e.stackParser||defaultStackParser),integrations:getIntegrationsToSetup({integrations:e.integrations,defaultIntegrations:r}),transport:e.transport||makeFetchTransport};return initAndBind(BrowserClient,n)}class SentryManager{constructor(){this.isInitialized=!1}static getInstance(){return SentryManager.instance||(SentryManager.instance=new SentryManager),SentryManager.instance}initialize(){if(this.isInitialized)return;const e=environmentManager.getEnvironment()||"production";if(!(e===ENVIRONMENTS.PRODUCTION||e===ENVIRONMENTS.STAGING))return;init({dsn:"https://8e000dda9faf4372bd40163105017f8a@o74188.ingest.us.sentry.io/4510466352742400",environment:e,sampleRate:.1}),this.isInitialized=!0}isEnabled(){return this.isInitialized}captureError(e){this.isInitialized&&captureException(e)}captureMessage(e,t="info"){this.isInitialized&&captureMessage(e,t)}}const sentryManager=SentryManager.getInstance(),SUPPORTED_LOCALES=Object.values(LOCALES$1);function validateLocale(e){if(!isLocaleSupported(e))throw new InvalidParametersError(`Unsupported locale: ${e}. The locale must be one of: ${SUPPORTED_LOCALES.join(", ")}.`);return e}function isLocaleSupported(e){return SUPPORTED_LOCALES.includes(e)}function validateInitializeParams(e){if(!e?.accessToken&&!e?.operationSettings?.proxyRequestFunction&&!e?.operationSettings?.proxyEndpointDescriptor)throw new InvalidParametersError("Either operationSettings.proxyRequestFunction, operationSettings.proxyEndpointDescriptor, or access token is required when calling initialize()");return e?.operationSettings&&validateOperationSettingsParams(e.operationSettings),validateEnvironmentParams(e),e.locale&&validateLocale(e.locale),e}function validateEnvironmentParams(e){if(e.environment){if(!["production","staging","local"].includes(e.environment))throw new InvalidParametersError('If provided, environment must be either "production" or "staging"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.environment.PRODUCTION" or "constants.environment.STAGING"');if(e.branch&&!["master","sandbox","qa"].includes(e.branch))throw new InvalidParametersError('If provided, branch must be either "master", "sandbox" or "qa"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.branch.MASTER" or "constants.environment.SANDBOX" and so on')}return e}function initialize$1(e){const{accessToken:t,stagingToken:r,operationSettings:n,environment:i,branch:a,locale:o}=validateInitializeParams(e);t&&authManager.setAccessToken(t),r&&authManager.setStagingToken(r),o&&localeManager.setLocale(o),n&&operationSettingsManager.setSettings(n),i&&(environmentManager.setEnvironment(i),a&&environmentManager.setBranch(a)),sentryManager.initialize(),initialize$2(),info("SDK initialized successfully",{environment:i,locale:o,debugMode:n?.debugMode})}function logout$1(){authManager.clearAccessToken(),authManager.clearStagingToken(),localeManager.setDefaultLocale(),operationSettingsManager.clearSettings(),reset()}const common={initialize:initialize$1,logout:logout$1,constants:constants$1},{initialize:initialize,logout:logout,constants:constants}=common,ORGANIZATION_ENDPOINT="/v2/organization/",BANK_ACCOUNTS_ENDPOINT="/v2/bank_accounts/",prepareGetOrganization=({accessToken:e,stagingToken:t})=>({path:`${ORGANIZATION_ENDPOINT}`,options:{method:"GET",headers:{accessToken:e,stagingToken:t}}}),prepareGetBankAccounts=({accessToken:e,stagingToken:t})=>({path:`${BANK_ACCOUNTS_ENDPOINT}`,options:{method:"GET",headers:{accessToken:e,stagingToken:t}}}),serializeOrganization=e=>({id:e.id,slug:e.slug,legalName:e.legal_name,legalNumber:e.legal_number,legalSector:e.legal_sector,legalRegistrationDate:e.legal_registration_date,legalAddress:e.legal_address,legalForm:e.legal_form,legalCountry:e.legal_country,legalShareCapital:e.legal_share_capital,locale:e.locale,contractSignedAt:e.contract_signed_at,bankAccounts:e.bank_accounts.map(serializeBankAccount)}),serializeBankAccount=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}),getOrganization=async({operationSettings:e})=>{tracker.organizationsList();const{stagingToken:t,proxyRequestFunction:r,proxyEndpointDescriptor:n}=validateClientOperationSettings(e,"Client-side organizations operations require either proxyEndpointDescriptor or proxyRequestFunction."),i=prepareGetOrganization({stagingToken:t}),a=await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:i});return serializeOrganization(a.body.organization)},getBankAccounts=async({operationSettings:e})=>{tracker.organizationsBankAccounts();const{stagingToken:t,proxyRequestFunction:r,proxyEndpointDescriptor:n}=validateClientOperationSettings(e,"Client-side organizations operations require either proxyEndpointDescriptor or proxyRequestFunction."),i=prepareGetBankAccounts({stagingToken:t});return(await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:i})).body.bank_accounts.map(serializeBankAccount)},organizations={getOrganization:getOrganization,getBankAccounts:getBankAccounts},CURRENCIES={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"},isValidCurrency=e=>Object.values(CURRENCIES).includes(e),validateCurrency=e=>{if(!isValidCurrency(e))throw new InvalidParametersError(`currency ${e} is not valid, valid currencies are ${Object.values(CURRENCIES).join(", ")}`)},LINK_TYPES={GOOD:"good",SERVICE:"service"},UNITS={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"},isValidUnit=e=>Object.values(UNITS).includes(e),validateUnit=e=>{if(!isValidUnit(e))throw new InvalidParametersError(`unit ${e} is not valid, valid units are ${Object.values(UNITS).join(", ")}`)},requiredCreatePaymentLinkParams=[{name:"id"},{name:"title"},{name:"type"},{name:"quantity"},{name:"measureUnit"},{name:"unitPrice"},{name:"vatRate"}],requiredPriceParams=[{name:"currency"},{name:"value"}];function validateItems(e){if(!e||!Array.isArray(e))return[];e.forEach((e=>{validatePresenceOfRequiredParams(e,requiredCreatePaymentLinkParams),validatePresenceOfRequiredParams(e.unitPrice,requiredPriceParams);const t=[...validateExpectedStringValues({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}:{}}),...validateExpectedNumericValues({quantity:e.quantity})].flat();if(t.length>0)throw new InvalidParametersError(t);validateType(e.type),validateCurrency(e.unitPrice.currency),validateUnit(e.measureUnit)}))}const validateType=e=>{if(!Object.values(LINK_TYPES).includes(e))throw new InvalidParametersError(`type ${e} is not valid, valid types are ${Object.values(LINK_TYPES).join(", ")}`)};function validatePaymentLinkCreationFlowParams(e){if(!e?.callbackUrl)throw new InvalidParametersError("callbackUrl parameter is required for the payment link creation flow");if("string"!=typeof e.callbackUrl)throw new InvalidParametersError("callbackUrl must be a string");if(""===e.callbackUrl.trim())throw new InvalidParametersError("callbackUrl cannot be empty");return e.callbackUrl}const getPaymentLinkCreationFlowUrl=async({paymentLinkSettings:e,operationSettings:t})=>{tracker.paymentLinksCreate(),validateClientOperationSettings(t,'Client-side payment link operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/payment-links" only in server-side/backend environments.');const{items:r}=e;validateItems(r);const n=validatePaymentLinkCreationFlowParams(e),i=await authLinks.request({requestSettings:{action:AUTH_LINK_ACTIONS.PAYMENT_LINK_CREATE,callbackUrl:n},operationSettings:t}),a=new URLSearchParams({...r?{items:JSON.stringify(r)}:{}});return a.toString()?`${i.url}?${a.toString()}`:i.url},redirectToPaymentLinkCreationFlow=async({paymentLinkSettings:e,operationSettings:t})=>{tracker.paymentLinksRedirect();const r=await getPaymentLinkCreationFlowUrl({paymentLinkSettings:e,operationSettings:t});window.location.href=r},paymentLinks={getPaymentLinkCreationFlowUrl:getPaymentLinkCreationFlowUrl,redirectToPaymentLinkCreationFlow:redirectToPaymentLinkCreationFlow},RUNTIME_ENVIRONMENT={BROWSER:"browser",SERVER:"server"};class InvalidRuntimeError extends Error{constructor(e){switch(super(),this.name="InvalidRuntimeError",e){case RUNTIME_ENVIRONMENT.BROWSER:this.message="This code is running in a browser environment, but it is expected to run in a server environment.";break;case RUNTIME_ENVIRONMENT.SERVER:this.message="This code is running in a server environment, but it is expected to run in a browser environment.";break;default:this.message="This code is not expected to run in this environment. Check if the function was server-only or browser-only."}}}function serializeSepaTransfer(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 serializeToNewSepaTransferDataObject(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}:{}}}function serializeToVopVerificationResult(e){return{matchResult:e.match_result,matchedName:e.matched_name}}function serializeToSepaPayeeDataObject(e){return{name:e.name,iban:e.iban}}const SEPA_ENDPOINT="/v2/sepa",SEPA_TRANSFERS_ENDPOINT=`${SEPA_ENDPOINT}/transfers`;function prepareGetSepaTransfersCall({paginationSettings:e,accessToken:t,stagingToken:r}){const n={method:"GET",headers:{accessToken:t,stagingToken:r}},i=buildPaginationParams(e),a=i.size?`?${i.toString()}`:"";return{path:`${SEPA_TRANSFERS_ENDPOINT}${a}`,options:n}}async function getSepaTransfers$2({accessToken:e,stagingToken:t,paginationSettings:r}){const n=prepareGetSepaTransfersCall({paginationSettings:r,accessToken:e,stagingToken:t}),{transfers:i,meta:a}=await makeNetworkCall(n);return{transfers:i,meta:a}}function prepareGetSepaTransferCall({sepaTransferId:e,accessToken:t,stagingToken:r}){return{path:`${SEPA_TRANSFERS_ENDPOINT}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:r}}}}function prepareCreateSepaTransferCall({transfer:e,vopProofToken:t,accessToken:r,stagingToken:n,scaSessionToken:i,idempotencyKey:a}){const o=serializeToNewSepaTransferDataObject(e);return{path:SEPA_TRANSFERS_ENDPOINT,options:{method:"POST",headers:{accessToken:r,stagingToken:n,scaSessionToken:i,idempotencyKey:a},body:{transfer:o,vop_proof_token:t}}}}function prepareCancelSepaTransferCall({sepaTransferId:e,accessToken:t,stagingToken:r}){return{path:`${SEPA_TRANSFERS_ENDPOINT}/${e}/cancel`,options:{method:"POST",headers:{accessToken:t,stagingToken:r}}}}function prepareVerifySepaPayeeCall({sepaPayee:e,accessToken:t,stagingToken:r}){return{path:`${SEPA_ENDPOINT}/verify_payee`,options:{method:"POST",headers:{accessToken:t,stagingToken:r},body:{beneficiary_name:e.name,iban:e.iban}}}}function serializeBulkTransfer(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 serializeToNewBulkTransferDataObject(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}:{}}}function serializeToBulkVopVerificationResult(e){return{id:e.id,response:{matchResult:e.response.match_result,matchedName:e.response.matched_name}}}const BULK_TRANSFERS_ENDPOINT="/v2/sepa/bulk_transfers";function prepareGetBulkTransfersCall({paginationSettings:e,accessToken:t,stagingToken:r}){const n={method:"GET",headers:{accessToken:t,stagingToken:r}},i=buildPaginationParams(e),a=i.size?`?${i.toString()}`:"";return{path:`${BULK_TRANSFERS_ENDPOINT}${a}`,options:n}}function prepareGetBulkTransferCall({bulkTransferId:e,accessToken:t,stagingToken:r}){return{path:`${BULK_TRANSFERS_ENDPOINT}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:r}}}}function prepareCreateBulkTransferCall({bulkTransfers:e,bankAccountId:t,accessToken:r,stagingToken:n,scaSessionToken:i,idempotencyKey:a}){return{path:BULK_TRANSFERS_ENDPOINT,options:{method:"POST",headers:{accessToken:r,stagingToken:n,scaSessionToken:i,idempotencyKey:a},body:{bank_account_id:t,bulk_transfers:e.map((e=>serializeToNewBulkTransferDataObject(e)))}}}}function prepareVerifySepaPayeesCall({sepaPayees:e,accessToken:t,stagingToken:r}){return{path:`${SEPA_ENDPOINT}/bulk_verify_payee`,options:{method:"POST",headers:{accessToken:t,stagingToken:r},body:{requests:e.map(serializeToSepaPayeeDataObject)}}}}function validateBulkTransferParams(e){if(!e)throw new InvalidParametersError("bulkTransferId parameter is required for the called function.");if("string"!=typeof e)throw new InvalidParametersError("bulkTransferId must be a string.");return e}function validateCreateBulkTransferParams(e){if(!e)throw new InvalidParametersError("bulkTransferSettings parameter is required for the called function.");if(!e.bankAccountId)throw new InvalidParametersError("bankAccountId is required");if(!Array.isArray(e.bulkTransfers))throw new InvalidParametersError("bulkTransfers must be an array");if(e.bulkTransfers.length>400)throw new InvalidParametersError("Maximum of 400 bulk transfers allowed");return e.bulkTransfers.forEach(((e,t)=>{validateSingleBulkTransfer(e,t)})),e}function validateSingleBulkTransfer(e,t){if(!e)throw new InvalidParametersError(`Invalid bulkTransfer at index ${t}: bulkTransfer object is required`);if(!e.beneficiary)throw new InvalidParametersError(`Invalid bulkTransfer at index ${t}: Beneficiary details must be provided in the bulkTransferSettings.beneficiary field`);if(!e.beneficiary.iban)throw new InvalidParametersError(`Invalid bulkTransfer at index ${t}: IBAN is required as part of the beneficiary details`);if(!e.beneficiary.name)throw new InvalidParametersError(`Invalid bulkTransfer at index ${t}: Beneficiary name is required as part of the beneficiary details`);const r=[...validateExpectedStringValues({reference:e.reference,clientTransferId:e.clientTransferId,note:e.note}),...validateExpectedNumericValues({amount:e.amount})].flat();if(r.length>0)throw new InvalidParametersError(r);if(e.amount>AMOUNT_REQUIRING_ATTACHMENTS&&(!e.attachmentsIds||0===e.attachmentsIds.length))throw new InvalidParametersError(`Invalid bulkTransfer at index ${t}: Attachments are required for transfers over €${AMOUNT_REQUIRING_ATTACHMENTS}`)}async function getBulkTransfers(e){tracker.sepaTransferBulkList();const{proxyRequestFunction:t,proxyEndpointDescriptor:r,paginationSettings:n}=validateClientOperationSettings(e?.operationSettings,'Client-side bulk transfer operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" and access sepaTransfers.bulkTransfers only in server-side/backend environments.'),i=prepareGetBulkTransfersCall({paginationSettings:n}),a=await callProxyFunction({proxyFunction:t,proxyEndpointDescriptor:r,networkCallDescriptor:i}),o=a.body.bulk_transfers.map(serializeBulkTransfer),s=serializePaginationResponse(a.body.meta);return{bulkTransfers:o,...s?{meta:s}:{}}}async function getBulkTransfer({bulkTransferSettings:e,operationSettings:t}){tracker.sepaTransferBulkGet();const r=validateBulkTransferParams(e?.bulkTransferId),{proxyRequestFunction:n,proxyEndpointDescriptor:i}=validateClientOperationSettings(t,'Client-side bulk transfer operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" and access sepaTransfers.bulkTransfers only in server-side/backend environments.'),a=prepareGetBulkTransferCall({bulkTransferId:r});return serializeBulkTransfer((await callProxyFunction({proxyFunction:n,proxyEndpointDescriptor:i,networkCallDescriptor:a})).body.bulk_transfer)}async function verifySepaPayeesWithProxy({sepaPayees:e,proxyRequestFunction:t,proxyEndpointDescriptor:r}){const n=prepareVerifySepaPayeesCall({sepaPayees:e});return(await callProxyFunction({proxyFunction:t,proxyEndpointDescriptor:r,networkCallDescriptor:n})).body}async function*createBulkTransfer({bulkTransferSettings:e,operationSettings:t}){tracker.sepaTransferBulkCreate();const{proxyRequestFunction:r,proxyEndpointDescriptor:n}=validateClientOperationSettings(t,'Client-side bulk transfer operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" and access sepaTransfers.bulkTransfers only in server-side/backend environments.');if(!isRunningInBrowser())throw new InvalidRuntimeError(RUNTIME_ENVIRONMENT.BROWSER);const i=authManager.getStagingToken(),a=t?.idempotencyKey||v4();validateCreateBulkTransferParams(e);const o=new Map;for(const t of e.bulkTransfers){const e=t.beneficiary.iban;e&&!o.has(e)&&o.set(e,{name:t.beneficiary.name,iban:e})}const s=Array.from(o.values()),l=await verifySepaPayeesWithProxy({sepaPayees:s,proxyRequestFunction:r,proxyEndpointDescriptor:n});if((yield l.requests.map(serializeToBulkVopVerificationResult))===VOP_DECISIONS.REJECT)return;const c=prepareCreateBulkTransferCall({bulkTransfers:e.bulkTransfers,bankAccountId:e.bankAccountId,stagingToken:i||void 0,idempotencyKey:a});return{bulkTransfer:serializeBulkTransfer((await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:c})).body.bulk_transfer),meta:{idempotencyKey:a}}}const bulkTransfers={getBulkTransfers:getBulkTransfers,getBulkTransfer:getBulkTransfer,createBulkTransfer:createBulkTransfer},SCA_POLLING_RESULTS={WAITING:"waiting"};function serializeScaPollingResponse(e){return{result:e.result,canceledAt:e.canceled_at}}function serializePreconditionRequiredResponse(e){return{message:e.message,code:e.code,scaSessionToken:e.sca_session_token,actionType:e.action_type}}async function getBeneficiaries(e){const{stagingToken:t,proxyRequestFunction:r,proxyEndpointDescriptor:n,accessToken:i,paginationSettings:a}=validateOperationSettingsParams(e?.operationSettings||{});if(r||n){const e=prepareGetBeneficiariesCall({paginationSettings:a}),t=await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:e}),i=t.body.beneficiaries.map((e=>serializeBeneficiary(e))),o=serializePaginationResponse(t.body.meta);return{beneficiaries:i,...o?{meta:o}:{}}}{const e=i||validatePresenceOfAuthToken(),r=await getBeneficiaries$2({accessToken:e,stagingToken:t,paginationSettings:a}),n=r.beneficiaries.map((e=>serializeBeneficiary(e))),o=serializePaginationResponse(r.meta);return{beneficiaries:n,...o?{meta:o}:{}}}}async function getBeneficiary({beneficiarySettings:e,operationSettings:t}){const r=validateGetBeneficiaryParams(e?.beneficiaryId),{proxyRequestFunction:n,proxyEndpointDescriptor:i,accessToken:a,stagingToken:o}=validateOperationSettingsParams(t||{});if(n||i){const e=prepareGetBeneficiaryCall({beneficiaryId:r});return serializeBeneficiary((await callProxyFunction({proxyFunction:n,proxyEndpointDescriptor:i,networkCallDescriptor:e})).body.beneficiary)}{const e=a||validatePresenceOfAuthToken();return serializeBeneficiary(await getBeneficiary$2({beneficiaryId:r,accessToken:e,stagingToken:o}))}}async function findBeneficiary({sepaTransferSettings:e,operationSettings:t}){return e?.beneficiary?e.beneficiary:await getBeneficiary({beneficiarySettings:{beneficiaryId:e?.beneficiaryId},operationSettings:t})}function decorateUrlWithExtraParams(e,t){const r=t?.locale||localeManager.getLocale(),n=new URL(e);return r&&n.searchParams.append("lang",r),t?.mfaPreference&&n.searchParams.append("mfaPreference",t.mfaPreference),t?.idempotencyKey&&n.searchParams.append("idempotencyKey",t.idempotencyKey),n.toString()}function createSepaTransferScaElement({networkCallDescriptor:e,scaSessionToken:t,operationSettings:r}){const{uiParentElementId:n,proxyRequestFunction:i,locale:a}=r,o=getUIParentElement(n);o.innerHTML="";const s=document.createElement("qonto-sca-passkey-waiting");return s.networkCallDescriptor={...e,options:{...e.options,headers:{...e.options.headers,scaSessionToken:t}}},s.operationSettings={uiParentElementId:n,proxyRequestFunction:i,locale:a},o.appendChild(s),s}async function waitForSepaTransferScaResult(e){return new Promise(((t,r)=>{e.addEventListener("sca-success",(e=>{t(e.detail.result.transfer)}),{once:!0}),e.addEventListener("sca-error",(e=>{r(e.detail.error)}),{once:!0}),e.addEventListener("sca-abort",(e=>{r(e.detail.result)}),{once:!0})}))}const requiredCreateSepaTransferParams=[{name:"bankAccountId"},{name:"reference"},{name:"amount"}];function validateGetSepaTransferParams(e){if(!e)throw new InvalidParametersError("sepaTransferId parameter is required for the called function");if(e&&"string"!=typeof e)throw new InvalidParametersError("sepaTransferId must be a string");return e}function validateTransferBeneficiaryParams(e){if(!e)throw new InvalidParametersError("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new InvalidParametersError("sepaTransferSettings must be an object");if(!e.beneficiaryId&&!e.beneficiary)throw new InvalidParametersError("Either beneficiaryId or beneficiary must be provided");const t=validateExpectedStringValues({beneficiaryId:e.beneficiaryId});if(t.length>0)throw new InvalidParametersError(t);return e}function validateCreateSepaTransferParams(e){if(!e)throw new InvalidParametersError("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new InvalidParametersError("sepaTransferSettings must be an object");validatePresenceOfRequiredParams(e,requiredCreateSepaTransferParams);const t=[...validateExpectedStringValues({bankAccountId:e.bankAccountId,note:e.note,reference:e.reference}),...validateExpectedNumericValues({amount:e.amount})].flat();if(t.length>0)throw new InvalidParametersError(t);if(e.amount>AMOUNT_REQUIRING_ATTACHMENTS&&(!e.attachmentIds||0===e.attachmentIds.length))throw new InvalidParametersError("Attachments are required for transfers over €30,000");return e}function validateCancelSepaTransferParams(e){if(!e)throw new InvalidParametersError("sepaTransferId parameter is required for the called function");if("string"!=typeof e)throw new InvalidParametersError("sepaTransferId must be a string");return e}function validateGetSepaTransferCreationFlowLinkParams(e){if(!e||!e.callbackUrl)throw new InvalidParametersError("callbackUrl parameter is required for the getSepaTransferCreationFlowLink function");if("string"!=typeof e.callbackUrl)throw new InvalidParametersError("callbackUrl must be a string");return e.callbackUrl}
|
|
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).QontoEmbed={})}(this,(function(exports){"use strict";function _mergeNamespaces(e,t){return t.forEach((function(t){t&&"string"!=typeof t&&!Array.isArray(t)&&Object.keys(t).forEach((function(r){if("default"!==r&&!(r in e)){var n=Object.getOwnPropertyDescriptor(t,r);Object.defineProperty(e,r,n.get?n:{enumerable:!0,get:function(){return t[r]}})}}))})),Object.freeze(e)}const ANALYTICS_EVENTS={SDK_INITIALIZED:"SDK Initialized",CARDS_LIST:"Cards List",CARDS_GET:"Cards Get",CARDS_ORDER:"Cards Order Virtual",CARDS_UNLOCK:"Cards Unlock",CARDS_DISPLAY:"Cards Display",BENEFICIARIES_LIST:"Beneficiaries List",BENEFICIARIES_GET:"Beneficiaries Get",BENEFICIARIES_ADD:"Beneficiaries Add",BENEFICIARIES_UPDATE:"Beneficiaries Update",BENEFICIARIES_TRUST:"Beneficiaries Trust",BENEFICIARIES_UNTRUST:"Beneficiaries Untrust",SEPA_TRANSFER_LIST:"SEPA Transfer List",SEPA_TRANSFER_GET:"SEPA Transfer Get",SEPA_TRANSFER_CREATE:"SEPA Transfer Create",SEPA_TRANSFER_CANCEL:"SEPA Transfer Cancel",SEPA_TRANSFER_CREATION_FLOW_LINK:"SEPA Transfer Creation Flow Link",SEPA_TRANSFER_BULK_LIST:"SEPA Transfer Bulk List",SEPA_TRANSFER_BULK_GET:"SEPA Transfer Bulk Get",SEPA_TRANSFER_BULK_CREATE:"SEPA Transfer Bulk Create",TRANSACTIONS_LIST:"Transactions List",TRANSACTIONS_GET:"Transactions Get",ORGANIZATIONS_LIST:"Organizations List",ORGANIZATIONS_BANK_ACCOUNTS:"Organizations Bank Accounts",PAYMENT_LINKS_CREATE:"Payment Links Create",PAYMENT_LINKS_REDIRECT:"Payment Links Redirect",AUTH_LINKS_REQUEST:"Auth Links Request",UI_ELEMENT_CREATED:"UI Element Created"};var extendStatics=function(e,t){return extendStatics=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},extendStatics(e,t)};function __extends(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var __assign$1=function(){return __assign$1=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign$1.apply(this,arguments)},IdentifyOperation$1,SpecialEventType;function __rest(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]])}return r}function __decorate(e,t,r,n){var i,a=arguments.length,o=a<3?t:null===n?n=Object.getOwnPropertyDescriptor(t,r):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)o=Reflect.decorate(e,t,r,n);else for(var s=e.length-1;s>=0;s--)(i=e[s])&&(o=(a<3?i(o):a>3?i(t,r,o):i(t,r))||o);return a>3&&o&&Object.defineProperty(t,r,o),o}function __awaiter(e,t,r,n){return new(r||(r=Promise))((function(i,a){function o(e){try{l(n.next(e))}catch(e){a(e)}}function s(e){try{l(n.throw(e))}catch(e){a(e)}}function l(e){var t;e.done?i(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(o,s)}l((n=n.apply(e,t||[])).next())}))}function __generator(e,t){var r,n,i,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},o=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,n&&(i=2&s[0]?n.return:s[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,s[1])).done)return i;switch(n=0,i&&(s=[2&s[0],i.value]),s[0]){case 0:case 1:i=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,n=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!i||s[1]>i[0]&&s[1]<i[3])){a.label=s[1];break}if(6===s[0]&&a.label<i[1]){a.label=i[1],i=s;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(s);break}i[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],n=0}finally{r=i=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function __values$1(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read$1(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}function __spreadArray(e,t,r){if(r||2===arguments.length)for(var n,i=0,a=t.length;i<a;i++)!n&&i in t||(n||(n=Array.prototype.slice.call(t,0,i)),n[i]=t[i]);return e.concat(n||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"}(IdentifyOperation$1||(IdentifyOperation$1={})),function(e){e.IDENTIFY="$identify",e.GROUP_IDENTIFY="$groupidentify",e.REVENUE="revenue_amount"}(SpecialEventType||(SpecialEventType={}));var UNSET_VALUE="-",AMPLITUDE_PREFIX="AMP",STORAGE_PREFIX="".concat(AMPLITUDE_PREFIX,"_unsent"),DEFAULT_INSTANCE_NAME="$default_instance",AMPLITUDE_SERVER_URL="https://api2.amplitude.com/2/httpapi",EU_AMPLITUDE_SERVER_URL="https://api.eu.amplitude.com/2/httpapi",AMPLITUDE_BATCH_SERVER_URL="https://api2.amplitude.com/batch",EU_AMPLITUDE_BATCH_SERVER_URL="https://api.eu.amplitude.com/batch",UTM_CAMPAIGN="utm_campaign",UTM_CONTENT="utm_content",UTM_ID="utm_id",UTM_MEDIUM="utm_medium",UTM_SOURCE="utm_source",UTM_TERM="utm_term",DCLID="dclid",FBCLID="fbclid",GBRAID="gbraid",GCLID="gclid",KO_CLICK_ID="ko_click_id",LI_FAT_ID="li_fat_id",MSCLKID="msclkid",RDT_CID="rdt_cid",TTCLID="ttclid",TWCLID="twclid",WBRAID="wbraid",BASE_CAMPAIGN={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},SAFE_HEADERS=["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"],FORBIDDEN_HEADERS=["authorization","cookie","set-cookie"],MAX_PROPERTY_KEYS=1e3,isValidObject=function(e){if(Object.keys(e).length>MAX_PROPERTY_KEYS)return!1;for(var t in e){var r=e[t];if(!isValidProperties(t,r))return!1}return!0},isValidProperties=function(e,t){var r,n;if("string"!=typeof e)return!1;if(Array.isArray(t)){var i=!0;try{for(var a=__values$1(t),o=a.next();!o.done;o=a.next()){var s=o.value;if(Array.isArray(s))return!1;if("object"==typeof s)i=i&&isValidObject(s);else if(!["number","string"].includes(typeof s))return!1;if(!i)return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}}else{if(null==t)return!1;if("object"==typeof t)return isValidObject(t);if(!["number","string","boolean"].includes(typeof t))return!1}return!0},Identify=function(){function e(){this._propertySet=new Set,this._properties={}}return e.prototype.getUserProperties=function(){return __assign$1({},this._properties)},e.prototype.set=function(e,t){return this._safeSet(IdentifyOperation.SET,e,t),this},e.prototype.setOnce=function(e,t){return this._safeSet(IdentifyOperation.SET_ONCE,e,t),this},e.prototype.append=function(e,t){return this._safeSet(IdentifyOperation.APPEND,e,t),this},e.prototype.prepend=function(e,t){return this._safeSet(IdentifyOperation.PREPEND,e,t),this},e.prototype.postInsert=function(e,t){return this._safeSet(IdentifyOperation.POSTINSERT,e,t),this},e.prototype.preInsert=function(e,t){return this._safeSet(IdentifyOperation.PREINSERT,e,t),this},e.prototype.remove=function(e,t){return this._safeSet(IdentifyOperation.REMOVE,e,t),this},e.prototype.add=function(e,t){return this._safeSet(IdentifyOperation.ADD,e,t),this},e.prototype.unset=function(e){return this._safeSet(IdentifyOperation.UNSET,e,UNSET_VALUE),this},e.prototype.clearAll=function(){return this._properties={},this._properties[IdentifyOperation.CLEAR_ALL]=UNSET_VALUE,this},e.prototype._safeSet=function(e,t,r){if(this._validate(e,t,r)){var n=this._properties[e];return void 0===n&&(n={},this._properties[e]=n),n[t]=r,this._propertySet.add(t),!0}return!1},e.prototype._validate=function(e,t,r){return void 0===this._properties[IdentifyOperation.CLEAR_ALL]&&(!this._propertySet.has(t)&&(e===IdentifyOperation.ADD?"number"==typeof r:e===IdentifyOperation.UNSET||e===IdentifyOperation.REMOVE||isValidProperties(t,r)))},e}(),IdentifyOperation;!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"}(IdentifyOperation||(IdentifyOperation={}));var OrderedIdentifyOperations=[IdentifyOperation.CLEAR_ALL,IdentifyOperation.UNSET,IdentifyOperation.SET,IdentifyOperation.SET_ONCE,IdentifyOperation.ADD,IdentifyOperation.APPEND,IdentifyOperation.PREPEND,IdentifyOperation.PREINSERT,IdentifyOperation.POSTINSERT,IdentifyOperation.REMOVE],SUCCESS_MESSAGE="Event tracked successfully",UNEXPECTED_ERROR_MESSAGE="Unexpected error occurred",MAX_RETRIES_EXCEEDED_MESSAGE="Event rejected due to exceeded retry count",OPT_OUT_MESSAGE="Event skipped due to optOut config",MISSING_API_KEY_MESSAGE="Event rejected due to missing API key",INVALID_API_KEY="Invalid API key",CLIENT_NOT_INITIALIZED="Client not initialized",Status;!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"}(Status||(Status={}));var buildResult=function(e,t,r){return void 0===t&&(t=0),void 0===r&&(r=Status.Unknown),{event:e,code:t,message:r}},getGlobalScope$1=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},legacyUUID=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,UUID)},hex=__spreadArray([],__read$1(Array(256).keys()),!1).map((function(e){return e.toString(16).padStart(2,"0")})),UUID=function(e){var t,r=getGlobalScope$1();if(!(null===(t=null==r?void 0:r.crypto)||void 0===t?void 0:t.getRandomValues))return legacyUUID(e);var n=r.crypto.getRandomValues(new Uint8Array(16));return n[6]=15&n[6]|64,n[8]=63&n[8]|128,__spreadArray([],__read$1(n.entries()),!1).map((function(e){var t=__read$1(e,2),r=t[0],n=t[1];return[4,6,8,10].includes(r)?"-".concat(hex[n]):hex[n]})).join("")},Timeline=function(){function e(e){this.client=e,this.queue=[],this.applying=!1,this.plugins=[],this._optOutListeners=[]}return e.prototype.register=function(e,t){var r,n;return __awaiter(this,void 0,void 0,(function(){return __generator(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=UUID(),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!==(r=e.type)&&void 0!==r?r:"enrichment",[4,null===(n=e.setup)||void 0===n?void 0:n.call(e,t,this.client)]);case 1:return i.sent(),this.plugins.push(e),[2]}}))}))},e.prototype.deregister=function(e,t){var r;return __awaiter(this,void 0,void 0,(function(){var n,i;return __generator(this,(function(a){switch(a.label){case 0:return n=this.plugins.findIndex((function(t){return t.name===e})),-1===n?(t.loggerProvider.warn("Plugin with name ".concat(e," does not exist, skipping deregistration")),[2]):(i=this.plugins[n],this.plugins.splice(n,1),[4,null===(r=i.teardown)||void 0===r?void 0:r.call(i)]);case 1:return a.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(r){t.queue.push([e,r]),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 __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a,o,s,l,c,d,u,p,h,f,m,g,v,y,b,E;return __generator(this,(function(_){switch(_.label){case 0:if(!e)return[2];t=__read$1(e,1),r=t[0],n=__read$1(e,2),i=n[1],this.loggerProvider.log("Timeline.apply: Initial event",r),a=this.plugins.filter((function(e){return"before"===e.type})),_.label=1;case 1:_.trys.push([1,6,7,8]),o=__values$1(a),s=o.next(),_.label=2;case 2:return s.done?[3,5]:(p=s.value).execute?[4,p.execute(__assign$1({},r))]:[3,4];case 3:if(null===(h=_.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by before plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(r))),i({event:r,code:0,message:""}),[2];r=h,this.loggerProvider.log("Timeline.apply: Event after before plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(r))),_.label=4;case 4:return s=o.next(),[3,2];case 5:return[3,8];case 6:return l=_.sent(),v={error:l},[3,8];case 7:try{s&&!s.done&&(y=o.return)&&y.call(o)}finally{if(v)throw v.error}return[7];case 8:c=this.plugins.filter((function(e){return"enrichment"===e.type||void 0===e.type})),_.label=9;case 9:_.trys.push([9,14,15,16]),d=__values$1(c),u=d.next(),_.label=10;case 10:return u.done?[3,13]:(p=u.value).execute?[4,p.execute(__assign$1({},r))]:[3,12];case 11:if(null===(h=_.sent()))return this.loggerProvider.log("Timeline.apply: Event filtered out by enrichment plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(r))),i({event:r,code:0,message:""}),[2];r=h,this.loggerProvider.log("Timeline.apply: Event after enrichment plugin '".concat(String(p.name),"', event: ").concat(JSON.stringify(r))),_.label=12;case 12:return u=d.next(),[3,10];case 13:return[3,16];case 14:return f=_.sent(),b={error:f},[3,16];case 15:try{u&&!u.done&&(E=d.return)&&E.call(d)}finally{if(b)throw b.error}return[7];case 16:return m=this.plugins.filter((function(e){return"destination"===e.type})),this.loggerProvider.log("Timeline.apply: Final event before destinations, event: ".concat(JSON.stringify(r))),g=m.map((function(e){var t=__assign$1({},r);return e.execute(t).catch((function(e){return buildResult(t,0,String(e))}))})),Promise.all(g).then((function(e){var t=__read$1(e,1)[0]||buildResult(r,100,"Event not tracked, no destination plugins on the instance");i(t)})),[2]}}))}))},e.prototype.flush=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return e=this.queue,this.queue=[],[4,Promise.all(e.map((function(e){return n.apply(e)})))];case 1:return i.sent(),t=this.plugins.filter((function(e){return"destination"===e.type})),r=t.map((function(e){return e.flush&&e.flush()})),[4,Promise.all(r)];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 r;null===(r=t.onIdentityChanged)||void 0===r||r.call(t,e)}))},e.prototype.onSessionIdChanged=function(e){this.plugins.forEach((function(t){var r;null===(r=t.onSessionIdChanged)||void 0===r||r.call(t,e)}))},e.prototype.onOptOutChanged=function(e){this.plugins.forEach((function(t){var r;null===(r=t.onOptOutChanged)||void 0===r||r.call(t,e)})),this._callOptOutListeners(e)},e.prototype._callOptOutListeners=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a,o,s;return __generator(this,(function(l){switch(l.label){case 0:l.trys.push([0,7,8,9]),t=__values$1(this._optOutListeners),r=t.next(),l.label=1;case 1:if(r.done)return[3,6];n=r.value,l.label=2;case 2:return l.trys.push([2,4,,5]),[4,n(e)];case 3:return l.sent(),[3,5];case 4:return i=l.sent(),this.loggerProvider.error("Error calling optOut listener",i),[3,5];case 5:return r=t.next(),[3,1];case 6:return[3,9];case 7:return a=l.sent(),o={error:a},[3,9];case 8:try{r&&!r.done&&(s=t.return)&&s.call(t)}finally{if(o)throw o.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}(),createTrackEvent=function(e,t,r){return __assign$1(__assign$1(__assign$1({},"string"==typeof e?{event_type:e}:e),r),t&&{event_properties:t})},createIdentifyEvent=function(e,t){return __assign$1(__assign$1({},t),{event_type:SpecialEventType.IDENTIFY,user_properties:e.getUserProperties()})},createGroupIdentifyEvent=function(e,t,r,n){var i;return __assign$1(__assign$1({},n),{event_type:SpecialEventType.GROUP_IDENTIFY,group_properties:r.getUserProperties(),groups:(i={},i[e]=t,i)})},createGroupEvent=function(e,t,r){var n,i=new Identify;return i.set(e,t),__assign$1(__assign$1({},r),{event_type:SpecialEventType.IDENTIFY,user_properties:i.getUserProperties(),groups:(n={},n[e]=t,n)})},createRevenueEvent=function(e,t){return __assign$1(__assign$1({},t),{event_type:SpecialEventType.REVENUE,event_properties:e.getEventProperties()})},returnWrapper=function(e){return{promise:e||Promise.resolve()}},AmplitudeCore=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 Timeline(this),this.name=e}return e.prototype._init=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(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 __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:t=this[e],this[e]=[],c.label=1;case 1:c.trys.push([1,8,9,10]),r=__values$1(t),n=r.next(),c.label=2;case 2:return n.done?[3,7]:(i=n.value,(a=i())&&"promise"in a?[4,a.promise]:[3,4]);case 3:return c.sent(),[3,6];case 4:return[4,a];case 5:c.sent(),c.label=6;case 6:return n=r.next(),[3,2];case 7:return[3,10];case 8:return o=c.sent(),s={error:o},[3,10];case 9:try{n&&!n.done&&(l=r.return)&&l.call(r)}finally{if(s)throw s.error}return[7];case 10:return this[e].length?[4,this.runQueuedFunctions(e)]:[3,12];case 11:c.sent(),c.label=12;case 12:return[2]}}))}))},e.prototype.track=function(e,t,r){var n=createTrackEvent(e,t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),returnWrapper(this.dispatch(n))},e.prototype.identify=function(e,t){var r=createIdentifyEvent(e,t);return this.userProperties=this.getOperationAppliedUserProperties(r.user_properties),returnWrapper(this.dispatch(r))},e.prototype.groupIdentify=function(e,t,r,n){var i=createGroupIdentifyEvent(e,t,r,n);return returnWrapper(this.dispatch(i))},e.prototype.setGroup=function(e,t,r){var n=createGroupEvent(e,t,r);return this.userProperties=this.getOperationAppliedUserProperties(n.user_properties),returnWrapper(this.dispatch(n))},e.prototype.revenue=function(e,t){var r=createRevenueEvent(e,t);return returnWrapper(this.dispatch(r))},e.prototype.add=function(e){return this.isReady?this._addPlugin(e):(this.q.push(this._addPlugin.bind(this,e)),returnWrapper())},e.prototype._addPlugin=function(e){return returnWrapper(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)),returnWrapper())},e.prototype._removePlugin=function(e){return returnWrapper(this.timeline.deregister(e,this.config))},e.prototype.dispatchWithCallback=function(e,t){if(!this.isReady)return t(buildResult(e,0,CLIENT_NOT_INITIALIZED));this.process(e).then(t)},e.prototype.dispatch=function(e){return __awaiter(this,void 0,void 0,(function(){var t=this;return __generator(this,(function(r){return this.isReady?[2,this.process(e)]:[2,new Promise((function(r){t.dispatchQ.push(t.dispatchWithCallback.bind(t,e,r))}))]}))}))},e.prototype.getOperationAppliedUserProperties=function(e){var t,r=null!==(t=this.userProperties)&&void 0!==t?t:{},n=__assign$1({},r);if(void 0===e)return n;var i={};return Object.keys(e).forEach((function(t){Object.values(IdentifyOperation$1).includes(t)||(i[t]=e[t])})),OrderedIdentifyOperations.forEach((function(t){if(Object.keys(e).includes(t)){var r=e[t];switch(t){case IdentifyOperation$1.CLEAR_ALL:Object.keys(n).forEach((function(e){delete n[e]}));break;case IdentifyOperation$1.UNSET:Object.keys(r).forEach((function(e){delete n[e]}));break;case IdentifyOperation$1.SET:Object.assign(n,r)}}})),Object.assign(n,i),n},e.prototype.process=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),this.config.optOut?[2,buildResult(e,0,OPT_OUT_MESSAGE)]:(e.event_type===SpecialEventType.IDENTIFY&&this.timeline.onIdentityChanged({userProperties:this.userProperties}),[4,this.timeline.push(e)]);case 1:return 200===(n=i.sent()).code?this.config.loggerProvider.log(n.message):100===n.code?this.config.loggerProvider.warn(n.message):this.config.loggerProvider.error(n.message),[2,n];case 2:return t=i.sent(),r=String(t),this.config.loggerProvider.error(r),[2,n=buildResult(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.config.optOut=Boolean(e),this.timeline.onOptOutChanged(e))},e.prototype.flush=function(){return returnWrapper(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}(),Revenue=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){try{var t=JSON.parse(JSON.stringify(e));isValidObject(t)&&(this.properties=t)}catch(e){}return this},e.prototype.getEventProperties=function(){var e=this.properties?__assign$1({},this.properties):{};return e[RevenueProperty.REVENUE_PRODUCT_ID]=this.productId,e[RevenueProperty.REVENUE_QUANTITY]=this.quantity,e[RevenueProperty.REVENUE_PRICE]=this.price,e[RevenueProperty.REVENUE_TYPE]=this.revenueType,e[RevenueProperty.REVENUE_CURRENCY]=this.currency,e[RevenueProperty.REVENUE]=this.revenue,e[RevenueProperty.RECEIPT]=this.receipt,e[RevenueProperty.RECEIPT_SIG]=this.receiptSig,e},e}(),RevenueProperty;!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"}(RevenueProperty||(RevenueProperty={}));var chunk=function(e,t){var r=Math.max(t,1);return e.reduce((function(e,t,n){var i=Math.floor(n/r);return e[i]||(e[i]=[]),e[i].push(t),e}),[])},LogLevel;!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"}(LogLevel||(LogLevel={}));var PREFIX$1="Amplitude Logger ",Logger=function(){function e(){this.logLevel=LogLevel.None}return e.prototype.disable=function(){this.logLevel=LogLevel.None},e.prototype.enable=function(e){void 0===e&&(e=LogLevel.Warn),this.logLevel=e},e.prototype.log=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<LogLevel.Verbose||console.log("".concat(PREFIX$1,"[Log]: ").concat(e.join(" ")))},e.prototype.warn=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<LogLevel.Warn||console.warn("".concat(PREFIX$1,"[Warn]: ").concat(e.join(" ")))},e.prototype.error=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<LogLevel.Error||console.error("".concat(PREFIX$1,"[Error]: ").concat(e.join(" ")))},e.prototype.debug=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];this.logLevel<LogLevel.Debug||console.log("".concat(PREFIX$1,"[Debug]: ").concat(e.join(" ")))},e}(),getDefaultConfig=function(){return{flushMaxRetries:12,flushQueueSize:200,flushIntervalMillis:1e4,instanceName:DEFAULT_INSTANCE_NAME,logLevel:LogLevel.Warn,loggerProvider:new Logger,offline:!1,optOut:!1,serverUrl:AMPLITUDE_SERVER_URL,serverZone:"US",useBatch:!1}},Config=function(){function e(e){var t,r,n,i;this._optOut=!1;var a=getDefaultConfig();this.apiKey=e.apiKey,this.flushIntervalMillis=null!==(t=e.flushIntervalMillis)&&void 0!==t?t:a.flushIntervalMillis,this.flushMaxRetries=e.flushMaxRetries||a.flushMaxRetries,this.flushQueueSize=e.flushQueueSize||a.flushQueueSize,this.instanceName=e.instanceName||a.instanceName,this.loggerProvider=e.loggerProvider||a.loggerProvider,this.logLevel=null!==(r=e.logLevel)&&void 0!==r?r:a.logLevel,this.minIdLength=e.minIdLength,this.plan=e.plan,this.ingestionMetadata=e.ingestionMetadata,this.offline=void 0!==e.offline?e.offline:a.offline,this.optOut=null!==(n=e.optOut)&&void 0!==n?n:a.optOut,this.serverUrl=e.serverUrl,this.serverZone=e.serverZone||a.serverZone,this.storageProvider=e.storageProvider,this.transportProvider=e.transportProvider,this.useBatch=null!==(i=e.useBatch)&&void 0!==i?i:a.useBatch,this.loggerProvider.enable(this.logLevel);var o=createServerConfig(e.serverUrl,e.serverZone,e.useBatch);this.serverZone=o.serverZone,this.serverUrl=o.serverUrl}return Object.defineProperty(e.prototype,"optOut",{get:function(){return this._optOut},set:function(e){this._optOut=e},enumerable:!1,configurable:!0}),e}(),getServerUrl=function(e,t){return"EU"===e?t?EU_AMPLITUDE_BATCH_SERVER_URL:EU_AMPLITUDE_SERVER_URL:t?AMPLITUDE_BATCH_SERVER_URL:AMPLITUDE_SERVER_URL},createServerConfig=function(e,t,r){if(void 0===e&&(e=""),void 0===t&&(t=getDefaultConfig().serverZone),void 0===r&&(r=getDefaultConfig().useBatch),e)return{serverUrl:e,serverZone:void 0};var n=["US","EU"].includes(t)?t:getDefaultConfig().serverZone;return{serverZone:n,serverUrl:getServerUrl(n,r)}},RequestMetadata=function(){function e(){this.sdk={metrics:{histogram:{}}}}return e.prototype.recordHistogram=function(e,t){this.sdk.metrics.histogram[e]=t},e}();function isSuccessStatusCode(e){return e>=200&&e<300}var getStacktrace=function(e){return void 0===e&&(e=0),((new Error).stack||"").split("\n").slice(2+e).map((function(e){return e.trim()}))},getClientLogConfig=function(e){return function(){var t=__assign$1({},e.config);return{logger:t.loggerProvider,logLevel:t.logLevel}}},getValueByStringPath=function(e,t){var r,n;t=(t=t.replace(/\[(\w+)\]/g,".$1")).replace(/^\./,"");try{for(var i=__values$1(t.split(".")),a=i.next();!a.done;a=i.next()){var o=a.value;if(!(o in e))return;e=e[o]}}catch(e){r={error:e}}finally{try{a&&!a.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}return e},getClientStates=function(e,t){return function(){var r,n,i={};try{for(var a=__values$1(t),o=a.next();!o.done;o=a.next()){var s=o.value;i[s]=getValueByStringPath(e,s)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i}},debugWrapper=function(e,t,r,n,i){return void 0===i&&(i=null),function(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];var s=r(),l=s.logger,c=s.logLevel;if(c&&c<LogLevel.Debug||!c||!l)return e.apply(i,a);var d={type:"invoke public method",name:t,args:a,stacktrace:getStacktrace(1),time:{start:(new Date).toISOString()},states:{}};n&&d.states&&(d.states.before=n());var u=e.apply(i,a);return u&&u.promise?u.promise.then((function(){n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=(new Date).toISOString()),l.debug(JSON.stringify(d,null,2))})):(n&&d.states&&(d.states.after=n()),d.time&&(d.time.end=(new Date).toISOString()),l.debug(JSON.stringify(d,null,2))),u}},DEFAULT_AMPLITUDE_SERVER_URLS=new Set([AMPLITUDE_SERVER_URL,EU_AMPLITUDE_SERVER_URL,AMPLITUDE_BATCH_SERVER_URL,EU_AMPLITUDE_BATCH_SERVER_URL]),shouldCompressUploadBodyForRequest=function(e,t){return void 0===t&&(t=!1),!!DEFAULT_AMPLITUDE_SERVER_URLS.has(e)||t};function getErrorMessage(e){return e instanceof Error?e.message:String(e)}function getResponseBodyString(e){var t="";try{"body"in e&&(t=JSON.stringify(e.body,null,2))}catch(e){}return t}var Destination=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 __awaiter(this,void 0,void 0,(function(){var r,n=this;return __generator(this,(function(i){switch(i.label){case 0:return this.config=e,this.storageKey="".concat(STORAGE_PREFIX,"_").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(r=i.sent())&&r.length>0&&Promise.all(r.map((function(e){return n.execute(e)}))).catch(),[2,Promise.resolve(void 0)]}}))}))},e.prototype.execute=function(e){var t=this;return e.insert_id||(e.insert_id=UUID()),new Promise((function(r){var n={event:e,attempts:0,callback:function(e){return r(e)},timeout:0};t.queue.push(n),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,MAX_RETRIES_EXCEEDED_MESSAGE),!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),__awaiter(this,void 0,void 0,(function(){var t,r,n=this;return __generator(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=[],r=[],this.queue.forEach((function(e){return 0===e.timeout?t.push(e):r.push(e)})),[4,chunk(t,this.config.flushQueueSize).reduce((function(t,r){return __awaiter(n,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return[4,t];case 1:return n.sent(),[4,this.send(r,e)];case 2:return[2,n.sent()]}}))}))}),Promise.resolve())]);case 1:return i.sent(),this.flushId=null,this.scheduleEvents(this.queue),[2]}}))}))},e.prototype.send=function(e,t){var r;return void 0===t&&(t=!0),__awaiter(this,void 0,void 0,(function(){var n,i,a,o,s,l;return __generator(this,(function(c){switch(c.label){case 0:if(!this.config.apiKey)return[2,this.fulfillRequest(e,400,MISSING_API_KEY_MESSAGE)];n={api_key:this.config.apiKey,events:e.map((function(e){var t=e.event;return t.extra,__rest(t,["extra"])})),options:{min_id_length:this.config.minIdLength},client_upload_time:(new Date).toISOString(),request_metadata:this.config.requestMetadata},this.config.requestMetadata=new RequestMetadata,c.label=1;case 1:return c.trys.push([1,3,,4]),i=createServerConfig(this.config.serverUrl,this.config.serverZone,this.config.useBatch).serverUrl,a=shouldCompressUploadBodyForRequest(i,this.config.enableRequestBodyCompression),[4,this.config.transportProvider.send(i,n,this.config._enableRequestBodyCompressionExperimental&&a)];case 2:return null===(o=c.sent())?(this.fulfillRequest(e,0,UNEXPECTED_ERROR_MESSAGE),[2]):t?(this.handleResponse(o,e),[3,4]):("body"in o?this.fulfillRequest(e,o.statusCode,"".concat(o.status,": ").concat(getResponseBodyString(o))):this.fulfillRequest(e,o.statusCode,o.status),[2]);case 3:return s=c.sent(),l=getErrorMessage(s),this.config.loggerProvider.error(l),null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful.from.catch.error",{events:e.map((function(e){return e.event.event_type})),message:l,stack_trace:getStacktrace()}),this.handleResponse({status:Status.Failed,statusCode:0},e),[3,4];case 4:return[2]}}))}))},e.prototype.handleResponse=function(e,t){var r;isSuccessStatusCode(e.statusCode)||null===(r=this.diagnosticsClient)||void 0===r||r.recordEvent("analytics.events.unsuccessful",{events:t.map((function(e){return e.event.event_type})),code:e.statusCode,status:e.status,body:getResponseBodyString(e),stack_trace:getStacktrace()});var n=e.status;switch(n){case Status.Success:this.handleSuccessResponse(e,t);break;case Status.Invalid:this.handleInvalidResponse(e,t);break;case Status.PayloadTooLarge:this.handlePayloadTooLargeResponse(e,t);break;case Status.RateLimit:this.handleRateLimitResponse(e,t);break;default:this.config.loggerProvider.warn("{code: 0, error: \"Status '".concat(n,"' provided for ").concat(t.length,' events"}')),this.handleOtherResponse(t)}},e.prototype.handleSuccessResponse=function(e,t){this.fulfillRequest(t,e.statusCode,SUCCESS_MESSAGE)},e.prototype.handleInvalidResponse=function(e,t){var r=this;if(e.body.missingField||e.body.error.startsWith(INVALID_API_KEY))this.fulfillRequest(t,e.statusCode,e.body.error);else{var n=__spreadArray(__spreadArray(__spreadArray(__spreadArray([],__read$1(Object.values(e.body.eventsWithInvalidFields)),!1),__read$1(Object.values(e.body.eventsWithMissingFields)),!1),__read$1(Object.values(e.body.eventsWithInvalidIdLengths)),!1),__read$1(e.body.silencedEvents),!1).flat(),i=new Set(n),a=t.filter((function(t,n){if(!i.has(n))return!0;r.fulfillRequest([t],e.statusCode,e.body.error)}));a.length>0&&this.config.loggerProvider.warn(getResponseBodyString(e));var o=this.removeEventsExceedFlushMaxRetries(a);this.scheduleEvents(o)}},e.prototype.handlePayloadTooLargeResponse=function(e,t){if(1!==t.length){this.config.loggerProvider.warn(getResponseBodyString(e)),this.config.flushQueueSize/=2;var r=this.removeEventsExceedFlushMaxRetries(t);this.scheduleEvents(r)}else this.fulfillRequest(t,e.statusCode,e.body.error)},e.prototype.handleRateLimitResponse=function(e,t){var r=this,n=Object.keys(e.body.exceededDailyQuotaUsers),i=Object.keys(e.body.exceededDailyQuotaDevices),a=e.body.throttledEvents,o=new Set(n),s=new Set(i),l=new Set(a),c=t.filter((function(t,n){if(!(t.event.user_id&&o.has(t.event.user_id)||t.event.device_id&&s.has(t.event.device_id)))return l.has(n)&&(t.timeout=r.throttleTimeout),!0;r.fulfillRequest([t],e.statusCode,e.body.error)}));c.length>0&&this.config.loggerProvider.warn(getResponseBodyString(e));var d=this.removeEventsExceedFlushMaxRetries(c);this.scheduleEvents(d)},e.prototype.handleOtherResponse=function(e){var t=this,r=e.map((function(e){return e.timeout=e.attempts*t.retryTimeout,e})),n=this.removeEventsExceedFlushMaxRetries(r);this.scheduleEvents(n)},e.prototype.fulfillRequest=function(e,t,r){var n,i,a;isSuccessStatusCode(t)?null===(a=this.diagnosticsClient)||void 0===a||a.increment("analytics.events.sent",e.length):(null===(n=this.diagnosticsClient)||void 0===n||n.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:r,stack_trace:getStacktrace()})),this.removeEvents(e),e.forEach((function(e){return e.callback(buildResult(e.event,t,r))}))},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}(),ApplicationContextProviderImpl=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:getLanguage$1(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),getLanguage$1=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},EventBridgeImpl=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}(),__assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)};function __values(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function __read(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,a=r.call(e),o=[];try{for(;(void 0===t||t-- >0)&&!(n=a.next()).done;)o.push(n.value)}catch(e){i={error:e}}finally{try{n&&!n.done&&(r=a.return)&&r.call(a)}finally{if(i)throw i.error}}return o}"function"==typeof SuppressedError&&SuppressedError;var isEqual=function(e,t){var r,n,i=typeof e;if(i!==typeof t)return!1;try{for(var a=__values(["string","number","boolean","undefined"]),o=a.next();!o.done;o=a.next()){if(o.value===i)return e===t}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.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),l=Array.isArray(t);if(s!==l)return!1;if(!s||!l){var c=Object.keys(e).sort(),d=Object.keys(t).sort();if(!isEqual(c,d))return!1;var u=!0;return Object.keys(e).forEach((function(r){isEqual(e[r],t[r])||(u=!1)})),u}for(var p=0;p<e.length;p++)if(!isEqual(e[p],t[p]))return!1;return!0},ID_OP_SET="$set",ID_OP_UNSET="$unset",ID_OP_CLEAR_ALL="$clearAll";Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,n=new Array(r);r--;)n[r]=[t[r],e[t[r]]];return n});var IdentityStoreImpl=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=__assign({},this.identity.userProperties),r=__assign(__assign({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,n,i,a,o,s,l=r.userProperties||{};try{for(var c=__values(Object.entries(e)),d=c.next();!d.done;d=c.next()){var u=__read(d.value,2),p=u[0],h=u[1];switch(p){case ID_OP_SET:try{for(var f=(i=void 0,__values(Object.entries(h))),m=f.next();!m.done;m=f.next()){var g=__read(m.value,2),v=g[0],y=g[1];l[v]=y}}catch(e){i={error:e}}finally{try{m&&!m.done&&(a=f.return)&&a.call(f)}finally{if(i)throw i.error}}break;case ID_OP_UNSET:try{for(var b=(o=void 0,__values(Object.keys(h))),E=b.next();!E.done;E=b.next()){delete l[v=E.value]}}catch(e){o={error:e}}finally{try{E&&!E.done&&(s=b.return)&&s.call(b)}finally{if(o)throw o.error}}break;case ID_OP_CLEAR_ALL:l={}}}}catch(e){t={error:e}}finally{try{d&&!d.done&&(n=c.return)&&n.call(c)}finally{if(t)throw t.error}}return r.userProperties=l,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return __assign({},this.identity)},e.prototype.setIdentity=function(e){var t=__assign({},this.identity);this.identity=__assign({},e),isEqual(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}(),safeGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,AnalyticsConnector=function(){function e(){this.identityStore=new IdentityStoreImpl,this.eventBridge=new EventBridgeImpl,this.applicationContextProvider=new ApplicationContextProviderImpl}return e.getInstance=function(t){return safeGlobal.analyticsConnectorInstances||(safeGlobal.analyticsConnectorInstances={}),safeGlobal.analyticsConnectorInstances[t]||(safeGlobal.analyticsConnectorInstances[t]=new e),safeGlobal.analyticsConnectorInstances[t]},e}(),getAnalyticsConnector=function(e){return void 0===e&&(e=DEFAULT_INSTANCE_NAME),AnalyticsConnector.getInstance(e)},setConnectorUserId=function(e,t){getAnalyticsConnector(t).identityStore.editIdentity().setUserId(e).commit()},setConnectorDeviceId=function(e,t){getAnalyticsConnector(t).identityStore.editIdentity().setDeviceId(e).commit()},IdentityEventSender=function(){function e(){this.name="identity",this.type="before",this.identityStore=getAnalyticsConnector().identityStore}return e.prototype.execute=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){return(t=e.user_properties)&&this.identityStore.editIdentity().updateUserProperties(t).commit(),[2,e]}))}))},e.prototype.setup=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return e.instanceName&&(this.identityStore=getAnalyticsConnector(e.instanceName).identityStore),[2]}))}))},e}(),isNewSession=function(e,t){return void 0===t&&(t=Date.now()),Date.now()-t>e},getCookieName=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[AMPLITUDE_PREFIX,t,e.substring(0,r)].filter(Boolean).join("_")},getOldCookieName=function(e){return"".concat(AMPLITUDE_PREFIX.toLowerCase(),"_").concat(e.substring(0,6))},getLanguage=function(){var e,t,r,n;if("undefined"==typeof navigator)return"";var i=navigator.userLanguage;return null!==(n=null!==(r=null!==(t=null===(e=navigator.languages)||void 0===e?void 0:e[0])&&void 0!==t?t:navigator.language)&&void 0!==r?r:i)&&void 0!==n?n:""},getQueryParams=function(){var e,t=getGlobalScope$1();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 r=t.split("=",2),n=tryDecodeURIComponent(r[0]),i=tryDecodeURIComponent(r[1]);return i?(e[n]=i,e):e}),{}):{}},tryDecodeURIComponent=function(e){void 0===e&&(e="");try{return decodeURIComponent(e)}catch(e){return""}},isUrlMatchAllowlist=function(e,t){return!t||!t.length||t.some((function(t){return"string"==typeof t?e===t:e.match(t)}))},getDecodeURI=function(e,t){var r=e;try{r=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return r},generateHashCode=function(e){var t=0;if(0===e.length)return t;for(var r=0;r<e.length;r++){t=(t<<5)-t+e.charCodeAt(r),t|=0}return t},isTimestampInSampleTemp=function(e,t){var r=generateHashCode(e.toString());return 31*Math.abs(r)%1e5/1e5<t},MemoryStorage=function(){function e(){this.memoryStorage=new Map}return e.prototype.isEnabled=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,!0]}))}))},e.prototype.get=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return[2,this.memoryStorage.get(e)]}))}))},e.prototype.getRaw=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.get(e)];case 1:return[2,(t=r.sent())?JSON.stringify(t):void 0]}}))}))},e.prototype.set=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return this.memoryStorage.set(e,t),[2]}))}))},e.prototype.remove=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){return this.memoryStorage.delete(e),[2]}))}))},e.prototype.reset=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return this.memoryStorage.clear(),[2]}))}))},e}(),getLocks=function(){var e,t=getGlobalScope$1();return null===(e=null==t?void 0:t.navigator)||void 0===e?void 0:e.locks},CookieStorage=function(){function e(e,t){void 0===t&&(t={}),this.options=__assign$1({},e),this.config=t}return e.prototype.isEnabled=function(){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a=this;return __generator(this,(function(o){switch(o.label){case 0:return t="AMP_TEST",r=__assign$1({},this.options),n=new e(r),i=String(Date.now()),[4,n.transaction(t,(function(e){var r,n;try{e.set(i);var o=e.get()===i;return!o&&a.config.diagnosticsClient&&(null===(r=a.config.diagnosticsClient)||void 0===r||r.recordEvent("cookies.isEnabled.failure",{reason:"Test Value mismatch",testKey:t,testValue:i,sync:!0})),o}catch(e){if(a.config.diagnosticsClient){var s=e instanceof Error?e.message:String(e);null===(n=a.config.diagnosticsClient)||void 0===n||n.recordEvent("cookies.isEnabled.failure",{reason:"Cookie getter/setter failed",testKey:t,testValue:i,error:s,sync:!0})}return!1}finally{e.set(null)}}))];case 1:return[2,o.sent()]}}))}))},e.prototype.get=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return[4,this.getRaw(e)];case 1:return t=r.sent(),[2,this.decodeCookieValue(e,t)]}}))}))},e.prototype.decodeCookieValue=function(e,t){if(t)try{var r=decodeCookieValue(t);return void 0===r?void console.error("Amplitude Logger [Error]: Failed to decode cookie value for key: ".concat(e,", value: ").concat(t)):JSON.parse(r)}catch(r){return void console.error("Amplitude Logger [Error]: Failed to parse cookie value for key: ".concat(e,", value: ").concat(t))}},e.prototype.getSync=function(e){var t=this.getRawSync(e);return this.decodeCookieValue(e,t)},e.prototype.getRaw=function(e){var t,r;return __awaiter(this,void 0,void 0,(function(){var n,i,a,o,s,l,c,d,u;return __generator(this,(function(p){switch(p.label){case 0:n=getGlobalScope$1(),i=n,p.label=1;case 1:return p.trys.push([1,4,,5]),(a=null==i?void 0:i.cookieStore)?[4,a.getAll(e)]:[3,3];case 2:if(o=p.sent()){o.length>1&&(null===(t=this.config.diagnosticsClient)||void 0===t||t.recordEvent("cookies.duplicate",{cookies:o.map((function(e){return e.domain}))}),null===(r=this.config.diagnosticsClient)||void 0===r||r.increment("cookies.duplicate.occurrence.cookieStore"));try{for(s=__values$1(o),l=s.next();!l.done;l=s.next())if(c=l.value,isDomainEqual(c.domain,this.options.domain))return[2,c.value]}catch(e){d={error:e}}finally{try{l&&!l.done&&(u=s.return)&&u.call(s)}finally{if(d)throw d.error}}}p.label=3;case 3:return[3,5];case 4:return p.sent(),[3,5];case 5:return[2,this.getRawSync(e)]}}))}))},e.prototype.getRawSync=function(e){var t,r,n=this,i=getGlobalScope$1(),a=(null!==(r=null===(t=null==i?void 0:i.document)||void 0===t?void 0:t.cookie.split("; "))&&void 0!==r?r:[]).filter((function(t){return 0===t.indexOf(e+"=")})),o=void 0,s=this.config.duplicateResolverFn;if("function"==typeof s&&a.length>1&&(o=a.find((function(t){var r;try{var i=s(t.substring(e.length+1));return i||null===(r=n.config.diagnosticsClient)||void 0===r||r.increment("cookies.duplicate.occurrence.document.cookie"),i}catch(e){return!1}}))),o||(o=a[0]),o)return o.substring(e.length+1)},e.prototype.set=function(e,t){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return this.setSync(e,t),[2]}))}))},e.prototype.setSync=function(e,t){var r;try{var n=null!==(r=this.options.expirationDays)&&void 0!==r?r:0,i=null!==t?n:-1,a=void 0;if(i){var o=new Date;o.setTime(o.getTime()+24*i*60*60*1e3),a=o}var s="".concat(e,"=").concat(btoa(encodeURIComponent(JSON.stringify(t))));a&&(s+="; expires=".concat(a.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));var l=getGlobalScope$1();(null==l?void 0:l.document)&&(l.document.cookie=s)}catch(t){var c=t instanceof Error?t.message:String(t);console.error("Amplitude Logger [Error]: Failed to set cookie for key: ".concat(e,". Error: ").concat(c))}},e.prototype.remove=function(e){return __awaiter(this,void 0,void 0,(function(){return __generator(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 __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2]}))}))},e.isDomainWritable=function(t){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:if(e.cachedTlds[t])return[2,!0];r="AMP_TLDTEST",n=new e({domain:"."+t}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,n.transaction(r,(function(r){if(e.cachedTlds[t])return!0;try{r.set(1);var n=!!r.get();return n&&(e.cachedTlds[t]=!0),n}finally{r.set(null)}}))];case 2:return[2,!!i.sent()];case 3:return i.sent(),[2,!1];case 4:return[2]}}))}))},e.prototype.transaction=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i=this;return __generator(this,(function(a){switch(a.label){case 0:if(r=getLocks(),n=function(){return t({get:function(){return i.getSync(e)},set:function(t){return i.setSync(e,t)}})},!r)return[2,n()];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,r.request("com.amplitude:cookie-lock:".concat(e),n)];case 2:return[2,a.sent()];case 3:return a.sent(),[2,n()];case 4:return[2]}}))}))},e.cachedTlds={},e}(),decodeCookiesAsDefault=function(e){try{return decodeURIComponent(atob(e))}catch(e){return}},decodeCookiesWithDoubleUrlEncoding=function(e){try{return decodeURIComponent(atob(decodeURIComponent(e)))}catch(e){return}},decodeCookieValue=function(e){var t;return null!==(t=decodeCookiesAsDefault(e))&&void 0!==t?t:decodeCookiesWithDoubleUrlEncoding(e)},isDomainEqual=function(e,t){if(""===e&&""===t)return!0;if(!e||!t)return!1;var r=e.startsWith(".")?e.substring(1):e,n=t.startsWith(".")?t.substring(1):t;return r.toLowerCase()===n.toLowerCase()},getStorageKey=function(e,t,r){return void 0===t&&(t=""),void 0===r&&(r=10),[AMPLITUDE_PREFIX,t,e.substring(0,r)].filter(Boolean).join("_")},BrowserStorage=function(){function e(e){this.storage=e}return e.prototype.isEnabled=function(){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(!this.storage)return[2,!1];t=String(Date.now()),r=new e(this.storage),n="AMP_TEST",i.label=1;case 1:return i.trys.push([1,4,5,7]),[4,r.set(n,t)];case 2:return i.sent(),[4,r.get(n)];case 3:return[2,i.sent()===t];case 4:return i.sent(),[2,!1];case 5:return[4,r.remove(n)];case 6:return i.sent(),[7];case 7:return[2]}}))}))},e.prototype.get=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getRaw(e)];case 1:return(t=r.sent())?[2,JSON.parse(t)]:[2,void 0];case 2:return r.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 __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return[2,(null===(t=this.storage)||void 0===t?void 0:t.getItem(e))||void 0]}))}))},e.prototype.set=function(e,t){var r;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){try{null===(r=this.storage)||void 0===r||r.setItem(e,JSON.stringify(t))}catch(e){}return[2]}))}))},e.prototype.remove=function(e){var t;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){try{null===(t=this.storage)||void 0===t||t.removeItem(e)}catch(e){}return[2]}))}))},e.prototype.reset=function(){var e;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){try{null===(e=this.storage)||void 0===e||e.clear()}catch(e){}return[2]}))}))},e}(),MAX_PERSISTENT_STORAGE_EVENTS_COUNT=10,DB_VERSION=1,TABLE_NAMES={TAGS:"tags",COUNTERS:"counters",HISTOGRAMS:"histograms",EVENTS:"events",INTERNAL:"internal"},INTERNAL_KEYS={LAST_FLUSH_TIMESTAMP:"last_flush_timestamp"},DiagnosticsStorage=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=getGlobalScope$1())||void 0===e?void 0:e.indexedDB)},e.prototype.getDB=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(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,r){var n=indexedDB.open(e.dbName,DB_VERSION);n.onerror=function(){e.dbPromise=null,r(new Error("Failed to open IndexedDB"))},n.onsuccess=function(){var r=n.result;r.onclose=function(){e.dbPromise=null,e.logger.debug("DiagnosticsStorage: DB connection closed.")},r.onerror=function(t){e.logger.debug("DiagnosticsStorage: A global database error occurred.",t),r.close()},t(r)},n.onupgradeneeded=function(t){var r=t.target.result;e.createTables(r)}}))},e.prototype.createTables=function(e){(e.objectStoreNames.contains(TABLE_NAMES.TAGS)||e.createObjectStore(TABLE_NAMES.TAGS,{keyPath:"key"}),e.objectStoreNames.contains(TABLE_NAMES.COUNTERS)||e.createObjectStore(TABLE_NAMES.COUNTERS,{keyPath:"key"}),e.objectStoreNames.contains(TABLE_NAMES.HISTOGRAMS)||e.createObjectStore(TABLE_NAMES.HISTOGRAMS,{keyPath:"key"}),e.objectStoreNames.contains(TABLE_NAMES.EVENTS))||e.createObjectStore(TABLE_NAMES.EVENTS,{keyPath:"id",autoIncrement:!0}).createIndex("time_idx","time",{unique:!1});e.objectStoreNames.contains(TABLE_NAMES.INTERNAL)||e.createObjectStore(TABLE_NAMES.INTERNAL,{keyPath:"key"})},e.prototype.setTags=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a=this;return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([TABLE_NAMES.TAGS],"readwrite"),n=r.objectStore(TABLE_NAMES.TAGS),[2,new Promise((function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){a.logger.debug("DiagnosticsStorage: Failed to set tags",e),t()},i.forEach((function(e){var t=__read$1(e,2),r=t[0],i=t[1];n.put({key:r,value:i}).onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to set tag",r,i,e)}}))}))];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set tags",i),[3,3];case 3:return[2]}}))}))},e.prototype.incrementCounters=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a=this;return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([TABLE_NAMES.COUNTERS],"readwrite"),n=r.objectStore(TABLE_NAMES.COUNTERS),[2,new Promise((function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){a.logger.debug("DiagnosticsStorage: Failed to increment counters",e),t()},i.forEach((function(e){var t=__read$1(e,2),r=t[0],i=t[1],o=n.get(r);o.onsuccess=function(){var e=o.result,t=e?e.value:0;n.put({key:r,value:t+i}).onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to update counter",r,e)}},o.onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to read existing counter",r,e)}}))}))];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to increment counters",i),[3,3];case 3:return[2]}}))}))},e.prototype.setHistogramStats=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a=this;return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===Object.entries(e).length?[2]:[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([TABLE_NAMES.HISTOGRAMS],"readwrite"),n=r.objectStore(TABLE_NAMES.HISTOGRAMS),[2,new Promise((function(t){var i=Object.entries(e);r.oncomplete=function(){t()},r.onabort=function(e){a.logger.debug("DiagnosticsStorage: Failed to set histogram stats",e),t()},i.forEach((function(e){var t=__read$1(e,2),r=t[0],i=t[1],o=n.get(r);o.onsuccess=function(){var e,t=o.result;e=t?{key:r,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:r,count:i.count,min:i.min,max:i.max,sum:i.sum},n.put(e).onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to set histogram stats",r,e)}},o.onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to read existing histogram stats",r,e)}}))}))];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set histogram stats",i),[3,3];case 3:return[2]}}))}))},e.prototype.addEventRecords=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i,a=this;return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),0===e.length?[2]:[4,this.getDB()];case 1:return t=o.sent(),r=t.transaction([TABLE_NAMES.EVENTS],"readwrite"),n=r.objectStore(TABLE_NAMES.EVENTS),[2,new Promise((function(t){r.oncomplete=function(){t()},r.onabort=function(e){a.logger.debug("DiagnosticsStorage: Failed to add event records",e),t()};var i=n.count();i.onsuccess=function(){var t=i.result,r=Math.max(0,MAX_PERSISTENT_STORAGE_EVENTS_COUNT-t);r<e.length&&a.logger.debug("DiagnosticsStorage: Only added ".concat(r," of ").concat(e.length," events due to storage limit")),e.slice(0,r).forEach((function(e){n.add(e).onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to add event record",e)}}))},i.onerror=function(e){a.logger.debug("DiagnosticsStorage: Failed to count existing events",e)}}))];case 2:return i=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to add event records",i),[3,3];case 3:return[2]}}))}))},e.prototype.setInternal=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n,i,a;return __generator(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,this.getDB()];case 1:return r=o.sent(),n=r.transaction([TABLE_NAMES.INTERNAL],"readwrite"),i=n.objectStore(TABLE_NAMES.INTERNAL),[2,new Promise((function(r,a){n.onabort=function(){return a(new Error("Failed to set internal value"))};var o=i.put({key:e,value:t});o.onsuccess=function(){return r()},o.onerror=function(){return a(new Error("Failed to set internal value"))}}))];case 2:return a=o.sent(),this.logger.debug("DiagnosticsStorage: Failed to set internal value",a),[3,3];case 3:return[2]}}))}))},e.prototype.getInternal=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n,i;return __generator(this,(function(a){switch(a.label){case 0:return a.trys.push([0,2,,3]),[4,this.getDB()];case 1:return t=a.sent(),r=t.transaction([TABLE_NAMES.INTERNAL],"readonly"),n=r.objectStore(TABLE_NAMES.INTERNAL),[2,new Promise((function(t,i){r.onabort=function(){return i(new Error("Failed to get internal value"))};var a=n.get(e);a.onsuccess=function(){return t(a.result)},a.onerror=function(){return i(new Error("Failed to get internal value"))}}))];case 2:return i=a.sent(),this.logger.debug("DiagnosticsStorage: Failed to get internal value",i),[2,void 0];case 3:return[2]}}))}))},e.prototype.getLastFlushTimestamp=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.getInternal(INTERNAL_KEYS.LAST_FLUSH_TIMESTAMP)];case 1:return[2,(e=r.sent())?parseInt(e.value,10):void 0];case 2:return t=r.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 __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return r.trys.push([0,2,,3]),[4,this.setInternal(INTERNAL_KEYS.LAST_FLUSH_TIMESTAMP,e.toString())];case 1:return r.sent(),[3,3];case 2:return t=r.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(r,n){var i=e.objectStore(t).clear();i.onsuccess=function(){return r()},i.onerror=function(){return n(new Error("Failed to clear table ".concat(t)))}}))},e.prototype.getAllAndClear=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,i,a,o,s;return __generator(this,(function(l){switch(l.label){case 0:return l.trys.push([0,4,,5]),[4,this.getDB()];case 1:return e=l.sent(),t=e.transaction([TABLE_NAMES.TAGS,TABLE_NAMES.COUNTERS,TABLE_NAMES.HISTOGRAMS,TABLE_NAMES.EVENTS],"readwrite"),[4,Promise.all([this.getAllFromStore(t,TABLE_NAMES.TAGS),this.getAllFromStore(t,TABLE_NAMES.COUNTERS),this.getAllFromStore(t,TABLE_NAMES.HISTOGRAMS),this.getAllFromStore(t,TABLE_NAMES.EVENTS)])];case 2:return r=__read$1.apply(void 0,[l.sent(),4]),n=r[0],i=r[1],a=r[2],o=r[3],[4,Promise.all([this.clearTable(t,TABLE_NAMES.COUNTERS),this.clearTable(t,TABLE_NAMES.HISTOGRAMS),this.clearTable(t,TABLE_NAMES.EVENTS)])];case 3:return l.sent(),[2,{tags:n,counters:i,histogramStats:a,events:o}];case 4:return s=l.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(r,n){var i=e.objectStore(t).getAll();i.onsuccess=function(){return r(i.result)},i.onerror=function(){return n(new Error("Failed to get all from ".concat(t)))}}))},e}(),GLOBAL_KEY="__AMPLITUDE_SCRIPT_URL__",EVENT_NAME_ERROR_UNCAUGHT="sdk.error.uncaught",getNormalizedScriptUrls=function(){var e=getGlobalScope$1();if(!e)return[];var t=e[GLOBAL_KEY];return Array.isArray(t)?t:"string"==typeof t?[t]:[]},enableSdkErrorListeners=function(e){var t=getGlobalScope$1();if(t&&"function"==typeof t.addEventListener){var r=function(t){e.recordEvent(EVENT_NAME_ERROR_UNCAUGHT,__assign$1({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,n=null==t?void 0:t.stack,i=detectSdkOrigin({filename:e.filename,stack:n});i&&r({type:"error",message:e.message,stack:n,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,n=e.reason instanceof Error?e.reason:void 0,i=null==n?void 0:n.stack,a=extractFilenameFromStack(i),o=detectSdkOrigin({filename:a,stack:i});o&&r({type:"unhandledrejection",message:null!==(t=null==n?void 0:n.message)&&void 0!==t?t:stringifyReason(e.reason),stack:i,filename:a,errorName:null==n?void 0:n.name,metadata:{isTrusted:e.isTrusted,matchReason:o}})}),!0)}},detectSdkOrigin=function(e){var t,r,n=getNormalizedScriptUrls();if(0!==n.length)try{for(var i=__values$1(n),a=i.next();!a.done;a=i.next()){var o=a.value;if(e.filename&&e.filename.includes(o))return"filename";if(e.stack&&e.stack.includes(o))return"stack"}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},extractFilenameFromStack=function(e){if(e){var t=e.match(/(https?:\/\/\S+?)(?=[)\s]|$)/);return t?t[1]:void 0}},stringifyReason=function(e){if("string"==typeof e)return e;try{return JSON.stringify(e)}catch(e){return"[object Object]"}},SAVE_INTERVAL_MS=1e3,FLUSH_INTERVAL_MS=3e5,DIAGNOSTICS_US_SERVER_URL="https://diagnostics.prod.us-west-2.amplitude.com/v1/capture",DIAGNOSTICS_EU_SERVER_URL="https://diagnostics.prod.eu-central-1.amplitude.com/v1/capture",MAX_MEMORY_STORAGE_COUNT=1e4,MAX_MEMORY_STORAGE_EVENTS_COUNT=10,DiagnosticsClient=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.inMemoryTags={},this.inMemoryCounters={},this.inMemoryHistograms={},this.inMemoryEvents=[],this.saveTimer=null,this.flushTimer=null,this.apiKey=e,this.logger=t,this.serverUrl="US"===r?DIAGNOSTICS_US_SERVER_URL:DIAGNOSTICS_EU_SERVER_URL,this.logger.debug("DiagnosticsClient: Initializing with options",JSON.stringify(n,null,2)),this.config=__assign$1({enabled:!0,sampleRate:0},n),this.startTimestamp=Date.now(),this.shouldTrack=isTimestampInSampleTemp(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,DiagnosticsStorage.isSupported()?this.storage=new DiagnosticsStorage(e,t):this.logger.debug("DiagnosticsClient: IndexedDB is not supported"),this.initializeFlushInterval(),this.shouldTrack&&(this.increment("sdk.diagnostics.sampled.in.and.enabled"),enableSdkErrorListeners(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>=MAX_MEMORY_STORAGE_COUNT?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>=MAX_MEMORY_STORAGE_COUNT?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>=MAX_MEMORY_STORAGE_COUNT)this.logger.debug("DiagnosticsClient: Early return recordHistogram as reaching memory limit");else{var r=this.inMemoryHistograms[e];r?(r.count+=1,r.min=Math.min(r.min,t),r.max=Math.max(r.max,t),r.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>=MAX_MEMORY_STORAGE_EVENTS_COUNT?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}))}),SAVE_INTERVAL_MS)),this.flushTimer||(this.flushTimer=setTimeout((function(){e._flush().catch((function(t){e.logger.debug("DiagnosticsClient: Failed to flush",t)})).finally((function(){e.flushTimer=null}))}),FLUSH_INTERVAL_MS))},e.prototype.saveAllDataToStorage=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(i){switch(i.label){case 0:return this.storage?(e=__assign$1({},this.inMemoryTags),t=__assign$1({},this.inMemoryCounters),r=__assign$1({},this.inMemoryHistograms),n=__spreadArray([],__read$1(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(r),this.storage.addEventRecords(n)])]):[2];case 1:return i.sent(),[2]}}))}))},e.prototype._flush=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r,n,i,a,o,s,l,c;return __generator(this,(function(d){switch(d.label){case 0:return this.storage?[4,this.saveAllDataToStorage()]:[2];case 1:return d.sent(),this.saveTimer=null,this.flushTimer=null,[4,this.storage.getAllAndClear()];case 2:return e=d.sent(),t=e.tags,r=e.counters,n=e.histogramStats,i=e.events,this.storage.setLastFlushTimestamp(Date.now()),a={},t.forEach((function(e){a[e.key]=e.value})),o={},r.forEach((function(e){o[e.key]=e.value})),s={},n.forEach((function(e){s[e.key]={count:e.count,min:e.min,max:e.max,avg:Math.round(e.sum/e.count*100)/100}})),l=i.map((function(e){return{event_name:e.event_name,time:e.time,event_properties:e.event_properties}})),0===Object.keys(o).length&&0===Object.keys(s).length&&0===l.length?[2]:(c={tags:a,histogram:s,counters:o,events:l},this.fetch(c),[2])}}))}))},e.prototype.fetch=function(e){return __awaiter(this,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:if(r.trys.push([0,2,,3]),!getGlobalScope$1())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 r.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=r.sent(),this.logger.debug("DiagnosticsClient: Failed to send diagnostics data. ",t),[3,3];case 3:return[2]}}))}))},e.prototype.initializeFlushInterval=function(){return __awaiter(this,void 0,void 0,(function(){var e,t,r;return __generator(this,(function(n){switch(n.label){case 0:return this.storage?(e=Date.now(),[4,this.storage.getLastFlushTimestamp()]):[2];case 1:return-1===(t=n.sent()||-1)?(this.storage.setLastFlushTimestamp(e),this._setFlushTimer(FLUSH_INTERVAL_MS),[2]):(r=e-t)>=FLUSH_INTERVAL_MS?(this._flush(),[2]):(this._setFlushTimer(FLUSH_INTERVAL_MS-r),[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=isTimestampInSampleTemp(this.startTimestamp,this.config.sampleRate)&&this.config.enabled,this.logger.debug("DiagnosticsClient: Should track is",this.shouldTrack)},e}(),BaseTransport=function(){function e(){}return e.prototype.send=function(e,t,r){return Promise.resolve(null)},e.prototype.buildResponse=function(e){var t,r,n,i,a,o,s,l,c,d,u,p,h,f,m,g,v,y,b,E,_,S;if("object"!=typeof e)return null;var T=e.code||0,x=this.buildStatus(T);switch(x){case Status.Success:return{status:x,statusCode:T,body:{eventsIngested:null!==(t=e.events_ingested)&&void 0!==t?t:0,payloadSizeBytes:null!==(r=e.payload_size_bytes)&&void 0!==r?r:0,serverUploadTime:null!==(n=e.server_upload_time)&&void 0!==n?n:0}};case Status.Invalid:return{status:x,statusCode:T,body:{error:null!==(i=e.error)&&void 0!==i?i:"",missingField:null!==(a=e.missing_field)&&void 0!==a?a:"",eventsWithInvalidFields:null!==(o=e.events_with_invalid_fields)&&void 0!==o?o:{},eventsWithMissingFields:null!==(s=e.events_with_missing_fields)&&void 0!==s?s:{},eventsWithInvalidIdLengths:null!==(l=e.events_with_invalid_id_lengths)&&void 0!==l?l:{},epsThreshold:null!==(c=e.eps_threshold)&&void 0!==c?c:0,exceededDailyQuotaDevices:null!==(d=e.exceeded_daily_quota_devices)&&void 0!==d?d:{},silencedDevices:null!==(u=e.silenced_devices)&&void 0!==u?u:[],silencedEvents:null!==(p=e.silenced_events)&&void 0!==p?p:[],throttledDevices:null!==(h=e.throttled_devices)&&void 0!==h?h:{},throttledEvents:null!==(f=e.throttled_events)&&void 0!==f?f:[]}};case Status.PayloadTooLarge:return{status:x,statusCode:T,body:{error:null!==(m=e.error)&&void 0!==m?m:""}};case Status.RateLimit:return{status:x,statusCode:T,body:{error:null!==(g=e.error)&&void 0!==g?g:"",epsThreshold:null!==(v=e.eps_threshold)&&void 0!==v?v:0,throttledDevices:null!==(y=e.throttled_devices)&&void 0!==y?y:{},throttledUsers:null!==(b=e.throttled_users)&&void 0!==b?b:{},exceededDailyQuotaDevices:null!==(E=e.exceeded_daily_quota_devices)&&void 0!==E?E:{},exceededDailyQuotaUsers:null!==(_=e.exceeded_daily_quota_users)&&void 0!==_?_:{},throttledEvents:null!==(S=e.throttled_events)&&void 0!==S?S:[]}};case Status.Timeout:default:return{status:x,statusCode:T}}},e.prototype.buildStatus=function(e){return isSuccessStatusCode(e)?Status.Success:429===e?Status.RateLimit:413===e?Status.PayloadTooLarge:408===e?Status.Timeout:e>=400&&e<500?Status.Invalid:e>=500?Status.Failed:Status.Unknown},e}(),MIN_GZIP_UPLOAD_BODY_SIZE_BYTES=2048;function isCompressionStreamAvailable(){return"undefined"!=typeof CompressionStream}function compressToGzipArrayBuffer(e){return __awaiter(this,void 0,void 0,(function(){var t,r;return __generator(this,(function(n){switch(n.label){case 0:if(void 0===(t=CompressionStream))return[2,void 0];n.label=1;case 1:return n.trys.push([1,3,,4]),r=new Blob([e]).stream().pipeThrough(new t("gzip")),[4,new Response(r).arrayBuffer()];case 2:return[2,n.sent()];case 3:return n.sent(),[2,void 0];case 4:return[2]}}))}))}var RemoteConfigLocalStorage=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 r=JSON.parse(e);return this.logger.debug("Remote config localstorage parsed successfully: ".concat(JSON.stringify(r))),Promise.resolve({remoteConfig:r.remoteConfig,lastFetch:new Date(r.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}(),US_SERVER_URL="https://sr-client-cfg.amplitude.com/config",EU_SERVER_URL="https://sr-client-cfg.eu.amplitude.com/config",DEFAULT_MAX_RETRIES=3,CODE_STATUS={INVALID_API_KEY:401,FORBIDDEN:403,RATE_LIMIT:429},DEFAULT_TIMEOUT=1e3,DEFAULT_MIN_TIME_BETWEEN_FETCHES=3e5,RemoteConfigClient=function(){function e(e,t,r,n){void 0===r&&(r="US"),this.callbackInfos=[],this.lastSuccessfulFetch=null,this.fetchPromise=null,this.isLastFetchInvalidApiKey=!1,this.apiKey=e,this.serverUrl=n||("US"===r?US_SERVER_URL:EU_SERVER_URL),this.logger=t,this.storage=new RemoteConfigLocalStorage(e,t)}return e.prototype.subscribe=function(e,t,r){var n=UUID(),i={id:n,key:e,deliveryMode:t,callback:r};return this.callbackInfos.push(i),"all"===t?this.subscribeAll(i):this.subscribeWaitForRemote(i,t.timeout),n},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 __awaiter(this,void 0,void 0,(function(){var e,t=this;return __generator(this,(function(r){switch(r.label){case 0:return this.lastSuccessfulFetch&&Date.now()-this.lastSuccessfulFetch<DEFAULT_MIN_TIME_BETWEEN_FETCHES?(this.logger.debug("Remote config client skipping updateConfigs: Too recent"),[2]):[4,this.getOrCreateFetchPromise()];case 1:return e=r.sent(),this.storage.setConfig(e),this.callbackInfos.forEach((function(r){t.sendCallback(r,e,"remote")})),[2]}}))}))},e.prototype.getOrCreateFetchPromise=function(){var e=this;return this.fetchPromise?this.fetchPromise:this.isLastFetchInvalidApiKey?(this.logger.debug("Remote config client skipping fetch: Invalid API key"),this.fetchPromise=Promise.resolve({remoteConfig:null,lastFetch:new Date}).finally((function(){e.fetchPromise=null})),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 __awaiter(this,void 0,void 0,(function(){var t,r,n,i=this;return __generator(this,(function(a){switch(a.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)})),r=this.storage.fetchConfig().then((function(e){return e})),[4,Promise.race([t,r])];case 1:return void 0!==(n=a.sent())&&(this.logger.debug("Remote config client subscription all mode fetched from cache: ".concat(JSON.stringify(n))),null!==n.remoteConfig?this.sendCallback(e,n,"cache"):this.logger.debug("Remote config client skips sending callback because cache is empty (first time user).")),[4,t];case 2:return a.sent(),[2]}}))}))},e.prototype.subscribeWaitForRemote=function(e,t){return __awaiter(this,void 0,void 0,(function(){var r,n;return __generator(this,(function(i){switch(i.label){case 0:r=new Promise((function(e,r){setTimeout((function(){r("Timeout exceeded")}),t)})),i.label=1;case 1:return i.trys.push([1,3,,5]),[4,Promise.race([this.getOrCreateFetchPromise(),r])];case 2:return n=i.sent(),this.logger.debug("Remote config client subscription wait for remote mode returns from remote."),this.sendCallback(e,n,"remote"),this.storage.setConfig(n),[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!==(n=i.sent()).remoteConfig?(this.logger.debug("Remote config client subscription wait for remote mode returns a cached copy."),this.sendCallback(e,n,"cache")):(this.logger.debug("Remote config client subscription wait for remote mode failed to fetch cache."),this.sendCallback(e,n,"remote")),[3,5];case 5:return[2]}}))}))},e.prototype.sendCallback=function(e,t,r){var n;e.lastCallback=new Date,n=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(n,r,t.lastFetch)},e.prototype.fetch=function(e,t){return void 0===e&&(e=DEFAULT_MAX_RETRIES),void 0===t&&(t=DEFAULT_TIMEOUT),__awaiter(this,void 0,void 0,(function(){var r,n,i,a,o,s,l=this;return __generator(this,(function(c){switch(c.label){case 0:r=t/e,n={remoteConfig:null,lastFetch:new Date},i=function(n){var i,o,s,c,d,u;return __generator(this,(function(p){switch(p.label){case 0:i=!0,o=new AbortController,s=setTimeout((function(){return o.abort()}),t),p.label=1;case 1:return p.trys.push([1,7,8,9]),[4,fetch(a.getUrlParams(),{method:"GET",headers:{Accept:"*/*"},signal:o.signal})];case 2:return(c=p.sent()).ok?[3,4]:[4,c.text()];case 3:return d=p.sent(),a.logger.debug("Remote config client fetch with retry time ".concat(e," failed with ").concat(c.status,": ").concat(d)),c.status===CODE_STATUS.INVALID_API_KEY||c.status===CODE_STATUS.FORBIDDEN?(a.logger.error("Remote config client fetch failed with ".concat(c.status,". Invalid API key; future fetches will be skipped.")),a.isLastFetchInvalidApiKey=!0,i=!1):c.status>=400&&c.status<500&&c.status!==CODE_STATUS.RATE_LIMIT&&(i=!1),[3,6];case 4:return[4,c.json()];case 5:return[2,{value:{remoteConfig:p.sent(),lastFetch:new Date}}];case 6:return[3,9];case 7:return(u=p.sent())instanceof Error&&"AbortError"===u.name?a.logger.debug("Remote config client fetch with retry time ".concat(e," timed out after ").concat(t,"ms")):a.logger.debug("Remote config client fetch with retry time ".concat(e," is rejected because: "),u),[3,9];case 8:return clearTimeout(s),[7];case 9:return i?n<e-1?[4,new Promise((function(e){return setTimeout(e,l.getJitterDelay(r))}))]:[3,11]:[2,"break"];case 10:p.sent(),p.label=11;case 11:return[2]}}))},a=this,o=0,c.label=1;case 1:return o<e?[5,i(o)]:[3,4];case 2:if("object"==typeof(s=c.sent()))return[2,s.value];if("break"===s)return[3,4];c.label=3;case 3:return o++,[3,1];case 4:return[2,n]}}))}))},e.prototype.getJitterDelay=function(e){return Math.floor(Math.random()*e)},e.prototype.getUrlParams=function(){var t=encodeURIComponent(this.apiKey),r=new URLSearchParams;return r.append("config_group",e.CONFIG_GROUP),"".concat(this.serverUrl,"/").concat(t,"?").concat(r.toString())},e.CONFIG_GROUP="browser",e}(),globalScope$1=getGlobalScope$1(),originalConsole=null==globalScope$1?void 0:globalScope$1.console,handlers$1={},originalFn={},inConsoleOverride=!1;function overrideConsole(e){if(!originalConsole)return!1;if("function"!=typeof originalConsole[e])return!1;if(originalFn[e])return!0;return originalFn[e]=originalConsole[e],originalConsole[e]=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];try{if(handlers$1[e]&&!inConsoleOverride){inConsoleOverride=!0;var n=handlers$1[e];n&&n.forEach((function(r){try{r(e,t)}catch(e){}}))}}catch(e){}return inConsoleOverride=!1,originalFn[e].apply(originalConsole,t)},!0}function addListener(e,t){if(!overrideConsole(e))return new Error("Console override failed");handlers$1[e]?handlers$1[e].push(t):handlers$1[e]=[t]}function removeListener(e){var t,r;try{for(var n=__values$1(Object.values(handlers$1)),i=n.next();!i.done;i=n.next())for(var a=i.value,o=a.length-1;o>=0;o--)if(a[o]===e){a.splice(o,1);break}}catch(e){t={error:e}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(t)throw t.error}}}function _restoreConsole(){var e,t;try{for(var r=__values$1(Object.entries(originalFn)),n=r.next();!n.done;n=r.next()){var i=__read$1(n.value,2),a=i[0],o=i[1];o&&(originalConsole[a]=o)}}catch(t){e={error:t}}finally{try{n&&!n.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}originalFn={},handlers$1={}}var consoleObserver={addListener:addListener,removeListener:removeListener,_restoreConsole:_restoreConsole},ServerZone;!function(e){e.US="US",e.EU="EU",e.STAGING="STAGING"}(ServerZone||(ServerZone={}));var OfflineDisabled=null,DEFAULT_CSS_SELECTOR_ALLOWLIST=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],DEFAULT_DATA_ATTRIBUTE_PREFIX="data-amp-track-",DEFAULT_ACTION_CLICK_ALLOWLIST=["div","span","h1","h2","h3","h4","h5","h6"],DEFAULT_EXPOSURE_DURATION=150,CLICKABLE_ELEMENT_SELECTORS=["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]'],DEFAULT_ERROR_AND_DEAD_CLICK_ALLOWLIST=__spreadArray(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],__read$1(CLICKABLE_ELEMENT_SELECTORS),!1),DEFAULT_DEAD_CLICK_ALLOWLIST=DEFAULT_ERROR_AND_DEAD_CLICK_ALLOWLIST,DEFAULT_ERROR_CLICK_ALLOWLIST=DEFAULT_ERROR_AND_DEAD_CLICK_ALLOWLIST,DEFAULT_RAGE_CLICK_ALLOWLIST=["*"],DEFAULT_RAGE_CLICK_WINDOW_MS=1e3,DEFAULT_RAGE_CLICK_THRESHOLD=4,DEFAULT_RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD=50;function isJsonPrimitive(e){return"string"==typeof e||"number"==typeof e||"boolean"==typeof e||null==e}function pruneJson(e,t,r){e&&_pruneJson({json:e,allowlist:t.map(tokenizeJsonPath),excludelist:r.map(tokenizeJsonPath),ancestors:[]})}function _pruneJson(e){var t,r,n=e.json,i=e.targetObject,a=e.allowlist,o=e.excludelist,s=e.ancestors,l=e.parentObject,c=e.targetKey;i||(i=n);var d=Object.keys(i);try{for(var u=__values$1(d),p=u.next();!p.done;p=u.next()){var h=p.value,f=__spreadArray(__spreadArray([],__read$1(s),!1),[h],!1);isJsonPrimitive(i[h])?hasPathMatchInList(f,a)&&!hasPathMatchInList(f,o)||delete i[h]:_pruneJson({json:n,targetObject:i[h],allowlist:a,excludelist:o,ancestors:f,parentObject:i,targetKey:h})}}catch(e){t={error:e}}finally{try{p&&!p.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}0===Object.keys(i).length&&l&&c&&delete l[c]}function tokenizeJsonPath(e){return e.startsWith("/")&&(e=e.slice(1)),e.split("/").map((function(e){return e.replace(/~0/g,"~").replace(/~1/g,"/")}))}function isPathMatch(e,t,r,n){if(void 0===r&&(r=0),void 0===n&&(n=0),n===t.length)return r===e.length;if(r===e.length){for(;n<t.length&&"**"===t[n];)n++;return n===t.length}var i=t[n];if("**"===i){if(n+1===t.length)return!0;for(var a=r;a<=e.length;a++)if(isPathMatch(e,t,a,n+1))return!0;return!1}return("*"===i||i===e[r])&&isPathMatch(e,t,r+1,n+1)}function hasPathMatchInList(e,t){return t.some((function(t){return isPathMatch(e,t)}))}var TEXT_READ_TIMEOUT=500,MAXIMUM_ENTRIES=100,RequestWrapperFetch=function(){function e(e){this.request=e}return e.prototype.headers=function(e){var t,r;void 0===e&&(e=[]);var n=this.request.headers,i={};if(Array.isArray(n))n.forEach((function(e){var t=__read$1(e,2),r=t[0],n=t[1];i[r]=n}));else if(n instanceof Headers)n.forEach((function(e,t){i[t]=e}));else if("object"==typeof n&&null!==n)try{for(var a=__values$1(Object.entries(n)),o=a.next();!o.done;o=a.next()){var s=__read$1(o.value,2),l=s[0],c=s[1];i[l]=c}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return pruneHeaders(i,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){if("number"==typeof this._bodySize)return this._bodySize;var e=getGlobalScope$1();if(null==e?void 0:e.TextEncoder){var t=this.request.body;return this._bodySize=getBodySize(t,MAXIMUM_ENTRIES),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=[]),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return 0===e.length?[2,null]:[2,safeParseAndPruneBody(this.body,e,t)]}))}))},e}(),RequestWrapperXhr=function(){function e(e,t){this.bodyRaw=e,this.requestHeaders=t}return e.prototype.headers=function(e){return void 0===e&&(e=[]),pruneHeaders(this.requestHeaders,{allow:e})},Object.defineProperty(e.prototype,"bodySize",{get:function(){return getBodySize(this.bodyRaw,MAXIMUM_ENTRIES)},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=[]),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){return 0===e.length?[2,null]:[2,safeParseAndPruneBody(this.body,e,t)]}))}))},e}();function getBodySize(e,t){var r,n,i,a=getGlobalScope$1(),o=null==a?void 0:a.TextEncoder;if(o){var s;if("string"==typeof e)s=e,i=(new o).encode(s).length;else if(e instanceof Blob)i=(s=e).size;else if(e instanceof URLSearchParams)s=e,i=(new o).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 l=e,c=0,d=0;try{for(var u=__values$1(l.entries()),p=u.next();!p.done;p=u.next()){var h=__read$1(p.value,2),f=h[0],m=h[1];if(c+=f.length,"string"==typeof m)c+=(new o).encode(m).length;else{if(!(m instanceof Blob))return;c+=m.size}if(++d>=t)return}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}i=c}else if(e instanceof ReadableStream)return void(s=e);return i}}var ResponseWrapperFetch=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 r=this.response.headers,n={};return null===(t=null==r?void 0:r.forEach)||void 0===t||t.call(r,(function(e,t){n[t]=e})),pruneHeaders(n,{allow:e})}},Object.defineProperty(e.prototype,"bodySize",{get:function(){var e,t;if(void 0!==this._bodySize)return this._bodySize;var r=null===(t=null===(e=this.response.headers)||void 0===e?void 0:e.get)||void 0===t?void 0:t.call(e,"content-length"),n=r?parseInt(r,10):void 0;return this._bodySize=n,n},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"status",{get:function(){return this.response.status},enumerable:!1,configurable:!0}),e.prototype.text=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:this.clonedResponse||(this.clonedResponse=this.response.clone()),r.label=1;case 1:return r.trys.push([1,3,,4]),e=this.clonedResponse.text(),t=new Promise((function(e){return setTimeout((function(){return e(null)}),TEXT_READ_TIMEOUT)})),[4,Promise.race([e,t])];case 2:return[2,r.sent()];case 3:return r.sent(),[2,null];case 4:return[2]}}))}))},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),__awaiter(this,void 0,void 0,(function(){return __generator(this,(function(r){switch(r.label){case 0:return 0===e.length?[2,null]:[4,this.text()];case 1:return[2,safeParseAndPruneBody(r.sent(),e,t)]}}))}))},e}(),ResponseWrapperXhr=function(){function e(e,t,r,n){this.statusCode=e,this.headersString=t,this.size=r,this.getJson=n}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,r;if(void 0===e&&(e=[]),!this.headersString)return{};var n={},i=this.headersString.split("\r\n");try{for(var a=__values$1(i),o=a.next();!o.done;o=a.next()){var s=__read$1(o.value.split(": "),2),l=s[0],c=s[1];l&&c&&(n[l]=c)}}catch(e){t={error:e}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(t)throw t.error}}return pruneHeaders(n,{allow:e})},e.prototype.json=function(e,t){return void 0===e&&(e=[]),void 0===t&&(t=[]),__awaiter(this,void 0,void 0,(function(){var r;return __generator(this,(function(n){return 0===e.length?[2,null]:(r=this.getJson())?(pruneJson(r,e,t),[2,r]):[2,null]}))}))},e}(),PRUNE_STRATEGY;function safeParseAndPruneBody(e,t,r){if(!e)return null;try{var n=JSON.parse(e);return pruneJson(n,t,r),n}catch(e){return null}}!function(e){e.REDACT="redact",e.REMOVE="remove"}(PRUNE_STRATEGY||(PRUNE_STRATEGY={}));var REDACTED_VALUE="[REDACTED]",pruneHeaders=function(e,t){var r,n,i=t.allow,a=void 0===i?[]:i,o=t.strategy,s=void 0===o?PRUNE_STRATEGY.REMOVE:o,l=__spreadArray([],__read$1(FORBIDDEN_HEADERS),!1),c={},d=function(t){var r=t.toLowerCase();l.find((function(e){return e.toLowerCase()===r}))?s===PRUNE_STRATEGY.REDACT&&(c[t]=REDACTED_VALUE):a.find((function(e){return e.toLowerCase()===r}))?c[t]=e[t]:s===PRUNE_STRATEGY.REDACT&&(c[t]=REDACTED_VALUE)};try{for(var u=__values$1(Object.keys(e)),p=u.next();!p.done;p=u.next()){d(p.value)}}catch(e){r={error:e}}finally{try{p&&!p.done&&(n=u.return)&&n.call(u)}finally{if(r)throw r.error}}return c},NetworkRequestEvent=function(){function e(e,t,r,n,i,a,o,s,l,c,d){void 0===o&&(o=0),this.type=e,this.method=t,this.timestamp=r,this.startTime=n,this.url=i,this.requestWrapper=a,this.status=o,this.duration=s,this.responseWrapper=l,this.error=c,this.endTime=d}return e.prototype.toSerializable=function(){var e,t,r,n,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(__spreadArray([],__read$1(SAFE_HEADERS),!1)),requestBodySize:null===(t=this.requestWrapper)||void 0===t?void 0:t.bodySize,responseHeaders:null===(r=this.responseWrapper)||void 0===r?void 0:r.headers(__spreadArray([],__read$1(SAFE_HEADERS),!1)),responseBodySize:null===(n=this.responseWrapper)||void 0===n?void 0:n.bodySize};return Object.fromEntries(Object.entries(i).filter((function(e){var t=__read$1(e,2);return t[0],void 0!==t[1]})))},e}();function isRequest$1(e){return"object"==typeof e&&null!==e&&"url"in e&&"method"in e}var NetworkEventCallback=function(e,t){void 0===t&&(t=UUID()),this.callback=e,this.id=t};function safeInvoke(e){try{e()}catch(e){}}var NetworkObserver=function(){function e(t){this.eventCallbacks=new Map,this.isObserving=!1,this.logger=t;var r=getGlobalScope$1();e.isSupported()&&(this.globalScope=r)}return e.isSupported=function(){var e=getGlobalScope$1();return!!e&&!!e.fetch},e.prototype.subscribe=function(e,t){var r,n,i,a,o,s,l,c,d,u;if(this.logger||(this.logger=t),this.eventCallbacks.set(e.id,e),!this.isObserving){var p=null===(i=null===(n=null===(r=this.globalScope)||void 0===r?void 0:r.XMLHttpRequest)||void 0===n?void 0:n.prototype)||void 0===i?void 0:i.open,h=null===(s=null===(o=null===(a=this.globalScope)||void 0===a?void 0:a.XMLHttpRequest)||void 0===o?void 0:o.prototype)||void 0===s?void 0:s.send,f=null===(d=null===(c=null===(l=this.globalScope)||void 0===l?void 0:l.XMLHttpRequest)||void 0===c?void 0:c.prototype)||void 0===d?void 0:d.setRequestHeader;p&&h&&f&&this.observeXhr(p,h,f);var m=null===(u=this.globalScope)||void 0===u?void 0:u.fetch;m&&this.observeFetch(m),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(r){try{r.callback(e)}catch(e){safeInvoke((function(){var r;null===(r=t.logger)||void 0===r||r.debug("an unexpected error occurred while triggering event callbacks",e)}))}}))},e.prototype.handleNetworkRequestEvent=function(e,t,r,n,i,a,o){var s;if(void 0!==a&&void 0!==o){var l,c,d,u="GET";if(isRequest$1(t)?(l=t.url,u=t.method):l=null===(s=null==t?void 0:t.toString)||void 0===s?void 0:s.call(t),l)try{var p=new URL(l);l="".concat(p.protocol,"//").concat(p.host).concat(p.pathname).concat(p.search).concat(p.hash)}catch(e){}u=(null==r?void 0:r.method)||u,n&&(c=n.status),i&&(d={name:i.name||"UnknownError",message:i.message||"An unknown error occurred"},c=0);var h=Math.floor(performance.now()-o),f=Math.floor(a+h),m=new NetworkRequestEvent(e,u,a,a,l,r,c,h,n,d,f);this.triggerEventCallbacks(m)}},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(r,n){return __awaiter(t,void 0,void 0,(function(){var t,i,a,o,s=this;return __generator(this,(function(l){switch(l.label){case 0:try{t=this.getTimestamps()}catch(e){safeInvoke((function(){var t;return null===(t=s.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while retrieving timestamps",e)}))}l.label=1;case 1:return l.trys.push([1,3,,4]),[4,e(r,n)];case 2:return i=l.sent(),[3,4];case 3:return o=l.sent(),a=o,[3,4];case 4:try{this.handleNetworkRequestEvent("fetch",r,n?new RequestWrapperFetch(n):void 0,i?new ResponseWrapperFetch(i):void 0,a,null==t?void 0:t.startTime,null==t?void 0:t.durationStart)}catch(e){safeInvoke((function(){var t;return null===(t=s.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling fetch",e)}))}if(i)return[2,i];throw a}}))}))})},e.createXhrJsonParser=function(e,t){return function(){var r;try{if("json"===e.responseType){if(null===(r=t.globalScope)||void 0===r?void 0:r.structuredClone)return t.globalScope.structuredClone(e.response)}else if(["text",""].includes(e.responseType))return JSON.parse(e.responseText)}catch(r){return r instanceof Error&&"InvalidStateError"===r.name&&safeInvoke((function(){var r;return null===(r=t.logger)||void 0===r?void 0:r.debug("unexpected error when retrieving responseText. responseType='".concat(e.responseType,"'"))})),null}return null}},e.prototype.observeXhr=function(t,r,n){if(this.globalScope&&t&&r){var i=this.globalScope.XMLHttpRequest.prototype,a=this;i.open=function(){for(var e,r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=__read$1(r,2),o=i[0],s=i[1];try{this.$$AmplitudeAnalyticsEvent=__assign$1({method:o,url:null===(e=null==s?void 0:s.toString)||void 0===e?void 0:e.call(s),headers:{}},a.getTimestamps())}catch(e){safeInvoke((function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr open",e)}))}return t.apply(this,r)},i.send=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];var i=this,o=e.createXhrJsonParser(this,a),s=t[0],l=i.$$AmplitudeAnalyticsEvent;return i.$$AmplitudeAnalyticsEvent&&i.addEventListener("loadend",(function(){try{var e=i.getAllResponseHeaders(),t=i.getResponseHeader("content-length"),r=new ResponseWrapperXhr(i.status,e,t?parseInt(t,10):void 0,o),n=i.$$AmplitudeAnalyticsEvent.headers,c=new RequestWrapperXhr(s,n);l.status=i.status,a.handleNetworkRequestEvent("xhr",{url:l.url,method:l.method},c,r,void 0,l.startTime,l.durationStart)}catch(e){safeInvoke((function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while handling xhr send",e)}))}})),r.apply(i,t)},i.setRequestHeader=function(e,t){try{var r=this.$$AmplitudeAnalyticsEvent;r&&(r.headers[e]=t)}catch(e){safeInvoke((function(){var t;return null===(t=a.logger)||void 0===t?void 0:t.debug("an unexpected error occurred while calling xhr setRequestHeader",e)}))}n.apply(this,[e,t])}}},e}(),networkObserver=new NetworkObserver,CampaignParser=function(){function e(){}return e.prototype.parse=function(){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(e){return[2,__assign$1(__assign$1(__assign$1(__assign$1({},BASE_CAMPAIGN),this.getUtmParam()),this.getReferrer()),this.getClickIds())]}))}))},e.prototype.getUtmParam=function(){var e=getQueryParams();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,r={referrer:void 0,referring_domain:void 0};try{r.referrer=document.referrer||void 0,r.referring_domain=null!==(t=null===(e=r.referrer)||void 0===e?void 0:e.split("/")[2])&&void 0!==t?t:void 0}catch(e){}return r},e.prototype.getClickIds=function(){var e,t=getQueryParams();return(e={})[DCLID]=t[DCLID],e[FBCLID]=t[FBCLID],e[GBRAID]=t[GBRAID],e[GCLID]=t[GCLID],e[KO_CLICK_ID]=t[KO_CLICK_ID],e[LI_FAT_ID]=t[LI_FAT_ID],e[MSCLKID]=t[MSCLKID],e[RDT_CID]=t[RDT_CID],e[TTCLID]=t[TTCLID],e[TWCLID]=t[TWCLID],e[WBRAID]=t[WBRAID],e},e}(),TEXT_MASK_ATTRIBUTE="data-amp-mask",MASKED_TEXT_VALUE="*****",CC_REGEX=/\b(?:\d[ -]*?){13,16}\b/,SSN_REGEX=/(\d{3}-?\d{2}-?\d{4})/g,EMAIL_REGEX=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,replaceSensitiveString=function(e,t){var r,n;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var i=e;i=(i=(i=i.replace(CC_REGEX,MASKED_TEXT_VALUE)).replace(SSN_REGEX,MASKED_TEXT_VALUE)).replace(EMAIL_REGEX,MASKED_TEXT_VALUE);try{for(var a=__values$1(t),o=a.next();!o.done;o=a.next()){var s=o.value;try{i=i.replace(s,MASKED_TEXT_VALUE)}catch(e){}}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return i},getPageTitle=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(TEXT_MASK_ATTRIBUTE)?MASKED_TEXT_VALUE:e?e(document.title):document.title};function getDefaultExportFromCjs(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Observable$1={},hasRequiredObservable,zenObservable,hasRequiredZenObservable;function requireObservable(){if(hasRequiredObservable)return Observable$1;hasRequiredObservable=1,Object.defineProperty(Observable$1,"__esModule",{value:!0}),Observable$1.Observable=void 0;const e=e=>Boolean(Symbol[e]),t=t=>e(t)?Symbol[t]:"@@"+t,r=t("iterator"),n=t("observable"),i=t("species");function a(e,t){let r=e[t];if(null!=r){if("function"!=typeof r)throw new TypeError(r+" is not a function");return r}}function o(e){let t=e.constructor;return void 0!==t&&(t=t[i],null===t&&(t=void 0)),void 0!==t?t:f}function s(e){s.log?s.log(e):setTimeout((()=>{throw e}))}function l(e){Promise.resolve().then((()=>{try{e()}catch(e){s(e)}}))}function c(e){let t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{let e=a(t,"unsubscribe");e&&e.call(t)}}catch(e){s(e)}}function d(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function u(e,t,r){e._state="running";let n=e._observer;try{let i=a(n,t);switch(t){case"next":i&&i.call(n,r);break;case"error":if(d(e),!i)throw r;i.call(n,r);break;case"complete":d(e),i&&i.call(n)}}catch(e){s(e)}"closed"===e._state?c(e):"running"===e._state&&(e._state="ready")}function p(e,t,r){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:r}],void l((()=>function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let r=0;r<t.length&&(u(e,t[r].type,t[r].value),"closed"!==e._state);++r);}}(e)))):void u(e,t,r);e._queue.push({type:t,value:r})}}class h{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let r=this,n={get closed(){return"closed"===r._state},next(e){p(r,"next",e)},error(e){p(r,"error",e)},complete(){p(r,"complete")}};try{this._cleanup=t.call(void 0,n)}catch(e){n.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(d(this),c(this))}}class f{constructor(e){if(!(this instanceof f))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new h(e,this._subscriber)}forEach(e){return new Promise(((t,r)=>{if("function"!=typeof e)return void r(new TypeError(e+" is not a function"));function n(){i.unsubscribe(),t()}let i=this.subscribe({next(t){try{e(t,n)}catch(e){r(e),i.unsubscribe()}},error:r,complete:t})}))}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(o(this))((t=>this.subscribe({next(r){try{r=e(r)}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}})))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(o(this))((t=>this.subscribe({next(r){try{if(!e(r))return}catch(e){return t.error(e)}t.next(r)},error(e){t.error(e)},complete(){t.complete()}})))}reduce(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=o(this),r=arguments.length>1,n=!1,i=arguments[1];return new t((t=>this.subscribe({next(a){let o=!n;if(n=!0,!o||r)try{i=e(i,a)}catch(e){return t.error(e)}else i=a},error(e){t.error(e)},complete(){if(!n&&!r)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(i),t.complete()}})))}async all(){let e=[];return await this.forEach((t=>e.push(t))),e}concat(...e){let t=o(this);return new t((r=>{let n,i=0;return function a(o){n=o.subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){i===e.length?(n=void 0,r.complete()):a(t.from(e[i++]))}})}(this),()=>{n&&(n.unsubscribe(),n=void 0)}}))}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=o(this);return new t((r=>{let n=[],i=this.subscribe({next(i){if(e)try{i=e(i)}catch(e){return r.error(e)}let o=t.from(i).subscribe({next(e){r.next(e)},error(e){r.error(e)},complete(){let e=n.indexOf(o);e>=0&&n.splice(e,1),a()}});n.push(o)},error(e){r.error(e)},complete(){a()}});function a(){i.closed&&0===n.length&&r.complete()}return()=>{n.forEach((e=>e.unsubscribe())),i.unsubscribe()}}))}[n](){return this}static from(t){let i="function"==typeof this?this:f;if(null==t)throw new TypeError(t+" is not an object");let o=a(t,n);if(o){let e=o.call(t);if(Object(e)!==e)throw new TypeError(e+" is not an object");return function(e){return e instanceof f}(e)&&e.constructor===i?e:new i((t=>e.subscribe(t)))}if(e("iterator")&&(o=a(t,r),o))return new i((e=>{l((()=>{if(!e.closed){for(let r of o.call(t))if(e.next(r),e.closed)return;e.complete()}}))}));if(Array.isArray(t))return new i((e=>{l((()=>{if(!e.closed){for(let r=0;r<t.length;++r)if(e.next(t[r]),e.closed)return;e.complete()}}))}));throw new TypeError(t+" is not observable")}static of(...e){return new("function"==typeof this?this:f)((t=>{l((()=>{if(!t.closed){for(let r=0;r<e.length;++r)if(t.next(e[r]),t.closed)return;t.complete()}}))}))}static get[i](){return this}}return Observable$1.Observable=f,Object.defineProperty(f,Symbol("extensions"),{value:{symbol:n,hostReportError:s},configurable:!0}),Observable$1}function requireZenObservable(){return hasRequiredZenObservable?zenObservable:(hasRequiredZenObservable=1,zenObservable=requireObservable().Observable)}var zenObservableExports=requireZenObservable(),Observable=getDefaultExportFromCjs(zenObservableExports);function asyncMap(e,t){return new Observable((function(r){e.subscribe({next:function(e){t(e).then((function(e){return r.next(e)})).catch((function(e){return r.error(e)}))},error:function(e){r.error(e)},complete:function(){r.complete()}})}))}function merge$1(e,t){return new Observable((function(r){var n=!1,i=new Set,a=function(){var e,t;n=!0;try{for(var r=__values$1(i),a=r.next();!a.done;a=r.next()){var o=a.value;try{o.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}i.clear()},o=function(e){var t=e.subscribe({next:function(e){n||r.next(e)},error:function(e){n||(n=!0,r.error(e),a())},complete:function(){i.delete(t),n||0!==i.size||(r.complete(),a(),n=!0)}});i.add(t)};return o(e),o(t),a}))}function multicast(e){var t=new Set,r=null;function n(){null==r||r.unsubscribe(),r=null,t.clear()}return new Observable((function(i){return t.add(i),null===r&&(r=e.subscribe({next:function(e){var r,n,i;try{for(var a=__values$1(t),o=a.next();!o.done;o=a.next()){var s=o.value;null===(i=s.next)||void 0===i||i.call(s,e)}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}},error:function(e){var r,i,a;try{for(var o=__values$1(t),s=o.next();!s.done;s=o.next()){var l=s.value;null===(a=l.error)||void 0===a||a.call(l,e)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}n()},complete:function(){var e,r,i;try{for(var a=__values$1(t),o=a.next();!o.done;o=a.next()){var s=o.value;null===(i=s.complete)||void 0===i||i.call(s)}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=a.return)&&r.call(a)}finally{if(e)throw e.error}}n()}})),function(){t.delete(i),0===t.size&&r&&(r.unsubscribe(),r=null)}}))}var safeJsonStringify$1={exports:{}},hasRequiredSafeJsonStringify;function requireSafeJsonStringify(){if(hasRequiredSafeJsonStringify)return safeJsonStringify$1.exports;hasRequiredSafeJsonStringify=1;var e=Object.prototype.hasOwnProperty;function t(e){return"[Throws: "+(e?e.message:"?")+"]"}function r(r){var n=[];return function r(i){if(null===i||"object"!=typeof i)return i;if(-1!==n.indexOf(i))return"[Circular]";if(n.push(i),"function"==typeof i.toJSON)try{var a=r(i.toJSON());return n.pop(),a}catch(e){return t(e)}if(Array.isArray(i)){var o=i.map(r);return n.pop(),o}var s=Object.keys(i).reduce((function(n,a){return n[a]=r(function(r,n){if(e.call(r,n))try{return r[n]}catch(e){return t(e)}return r[n]}(i,a)),n}),{});return n.pop(),s}(r)}return safeJsonStringify$1.exports=function(e,t,n){return JSON.stringify(r(e),t,n)},safeJsonStringify$1.exports.ensureProperties=r,safeJsonStringify$1.exports}var safeJsonStringifyExports=requireSafeJsonStringify(),index=getDefaultExportFromCjs(safeJsonStringifyExports),safeJsonStringifyModule=_mergeNamespaces({__proto__:null,default:index},[safeJsonStringifyExports]),safeJsonStringify=index||safeJsonStringifyModule,AMPLITUDE_ORIGIN="https://app.amplitude.com",AMPLITUDE_ORIGIN_EU="https://app.eu.amplitude.com",AMPLITUDE_ORIGIN_STAGING="https://apps.stag2.amplitude.com",AMPLITUDE_ORIGINS_MAP={US:AMPLITUDE_ORIGIN,EU:AMPLITUDE_ORIGIN_EU,STAGING:AMPLITUDE_ORIGIN_STAGING},AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL="https://cdn.amplitude.com/libs/background-capture-1.0.0-alpha.3.js.gz",asyncLoadScript=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise((function(t,r){var n;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(){r({status:!1,message:"Failed to load the script ".concat(e)})})),null===(n=document.head)||void 0===n||n.appendChild(i)}catch(e){r(e)}}))},_a;function generateUniqueId(){return"".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9))}var MESSENGER_BRAND="__AMPLITUDE_MESSENGER_INSTANCE__",MESSENGER_GLOBAL_KEY="__AMPLITUDE_MESSENGER__",BaseWindowMessenger=function(){function e(e){var t=(void 0===e?{}:e).origin,r=void 0===t?AMPLITUDE_ORIGIN:t;this[_a]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=r}return e.prototype.notify=function(e){var t,r,n,i;null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(n=window.opener)||void 0===n?void 0:n.postMessage)||void 0===i||i.call(n,e,this.endpoint)},e.prototype.sendRequest=function(e,t,r){var n=this;void 0===r&&(r={timeout:15e3});var i=generateUniqueId(),a={id:i,action:e,args:t};return new Promise((function(t,o){n.requestCallbacks[i]={resolve:t,reject:o},n.notify(a),r.timeout>0&&setTimeout((function(){o(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete n.requestCallbacks[i]}),r.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 r,n,i,a;this.actionHandlers.has(e)&&(null===(a=null===(i=this.logger)||void 0===i?void 0:i.warn)||void 0===a||a.call(i,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var o=this.pendingMessages.get(e);if(o){this.pendingMessages.delete(e);try{for(var s=__values$1(o),l=s.next();!l.done;l=s.next()){t(l.value)}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}}},e.prototype.loadScriptOnce=function(e){return __awaiter(this,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];r=asyncLoadScript(e).then((function(){})),this.scriptLoadPromises.set(e,r),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,r];case 2:return i.sent(),[3,4];case 3:throw n=i.sent(),this.scriptLoadPromises.delete(e),n;case 4:return[2]}}))}))},e.prototype.setup=function(e){var t,r,n=this,i=void 0===e?{}:e,a=i.logger,o=i.endpoint;a&&(this.logger=a),o&&this.endpoint===AMPLITUDE_ORIGIN&&(this.endpoint=o),this.isSetup||(this.isSetup=!0,null===(r=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,r,i,a,o;if(null===(r=null===(t=n.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Message received: ",JSON.stringify(e)),n.endpoint===e.origin){var s=e.data,l=null==s?void 0:s.action;if(l)if("id"in s&&s.id)null===(a=null===(i=n.logger)||void 0===i?void 0:i.debug)||void 0===a||a.call(i,"Received Response to previous request: ",JSON.stringify(e)),n.handleResponse(s);else{if("ping"===l)return void n.notify({action:"pong"});var c=n.actionHandlers.get(l);if(c)c(s.data);else{var d=null!==(o=n.pendingMessages.get(l))&&void 0!==o?o:[];d.push(s.data),n.pendingMessages.set(l,d)}}}},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=getGlobalScope$1();(null==e?void 0:e[MESSENGER_GLOBAL_KEY])===this&&delete e[MESSENGER_GLOBAL_KEY]},e}();function isWindowMessenger(e){return"object"==typeof e&&null!==e&&MESSENGER_BRAND in e&&!0===e[MESSENGER_BRAND]}function getOrCreateWindowMessenger(e){var t=getGlobalScope$1(),r=null==t?void 0:t[MESSENGER_GLOBAL_KEY];if(isWindowMessenger(r))return r;var n=new BaseWindowMessenger(e);return t&&(t[MESSENGER_GLOBAL_KEY]=n),n}_a=MESSENGER_BRAND;var BG_CAPTURE_BRAND="__AMPLITUDE_BACKGROUND_CAPTURE__";function enableBackgroundCapture(e,t){var r=e;if(!0!==r[BG_CAPTURE_BRAND]){r[BG_CAPTURE_BRAND]=!0;var n=AMPLITUDE_BACKGROUND_CAPTURE_SCRIPT_URL,i=null,a=function(t,r){var n,i;"background-capture-complete"===t&&(null===(i=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===i||i.call(n,"Background capture complete"),e.notify({action:"background-capture-complete",data:r}))};e.registerActionHandler("initialize-background-capture",(function(){var t,r;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Initializing background capture (external script)");var o=new URL(n,e.endpoint).toString();e.loadScriptOnce(o).then((function(){var t,r,n;null===(r=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===r||r.call(t,"Background capture script loaded (external)"),i=null===(n=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===n?void 0:n.call(window,{messenger:e,onBackgroundCapture:a}),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==i?void 0:i.close)||void 0===e||e.call(i),i=null}))}}var EXCLUDE_INTERNAL_REFERRERS_CONDITIONS={always:"always",ifEmptyCampaign:"ifEmptyCampaign"},isTrackingEnabled=function(e,t){return"boolean"==typeof e?e:!1!==(null==e?void 0:e[t])},isAttributionTrackingEnabled=function(e){return isTrackingEnabled(e,"attribution")},isFileDownloadTrackingEnabled=function(e){return isTrackingEnabled(e,"fileDownloads")},isFormInteractionTrackingEnabled=function(e){return isTrackingEnabled(e,"formInteractions")},isPageViewTrackingEnabled=function(e){return isTrackingEnabled(e,"pageViews")},isSessionTrackingEnabled=function(e){return isTrackingEnabled(e,"sessions")},isPageUrlEnrichmentEnabled=function(e){return isTrackingEnabled(e,"pageUrlEnrichment")},isNetworkTrackingEnabled=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.networkTracking||"object"==typeof e.networkTracking)},isElementInteractionsEnabled=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.elementInteractions||"object"==typeof e.elementInteractions)},isWebVitalsEnabled=function(e){return"boolean"==typeof e?e:"object"==typeof e&&!0===e.webVitals},isFrustrationInteractionsEnabled=function(e){return"boolean"==typeof e?e:"object"==typeof e&&(!0===e.frustrationInteractions||"object"==typeof e.frustrationInteractions)},isCustomEnrichmentEnabled=function(e){return"boolean"==typeof e?e:"object"==typeof e&&null!==e&&!1!==e.enabled},getElementInteractionsConfig=function(e){if(isElementInteractionsEnabled(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.elementInteractions)return e.autocapture.elementInteractions},getFrustrationInteractionsConfig=function(e){if(isFrustrationInteractionsEnabled(e.autocapture)&&"object"==typeof e.autocapture&&"object"==typeof e.autocapture.frustrationInteractions)return e.autocapture.frustrationInteractions},getNetworkTrackingConfig=function(e){var t;if(isNetworkTrackingEnabled(e.autocapture)){var r=void 0;return"object"==typeof e.autocapture&&"object"==typeof e.autocapture.networkTracking?r=e.autocapture.networkTracking:e.networkTrackingOptions&&(r=e.networkTrackingOptions),__assign$1(__assign$1({},r),{captureRules:null===(t=null==r?void 0:r.captureRules)||void 0===t?void 0:t.map((function(t){var r,n,i;if((null===(r=t.urls)||void 0===r?void 0:r.length)&&(null===(n=t.hosts)||void 0===n?void 0:n.length)){var a=JSON.stringify(t.hosts),o=JSON.stringify(t.urls);return null===(i=e.loggerProvider)||void 0===i||i.warn("Found network capture rule with both urls='".concat(o,"' and hosts='").concat(a,"' set. ")+"Definition of urls takes precedence over hosts, so ignoring hosts."),__assign$1(__assign$1({},t),{hosts:void 0})}return t}))})}},getPageViewTrackingConfig=function(e){var t,r=function(){return!1},n=void 0,i=e.pageCounter;return isPageViewTrackingEnabled(e.defaultTracking)&&(r=void 0,t=void 0,e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.pageViews&&"object"==typeof e.defaultTracking.pageViews&&("trackOn"in e.defaultTracking.pageViews&&(r=e.defaultTracking.pageViews.trackOn),"trackHistoryChanges"in e.defaultTracking.pageViews&&(n=e.defaultTracking.pageViews.trackHistoryChanges),"eventType"in e.defaultTracking.pageViews&&e.defaultTracking.pageViews.eventType&&(t=e.defaultTracking.pageViews.eventType))),{trackOn:r,trackHistoryChanges:n,eventType:t,pageCounter:i}},getAttributionTrackingConfig=function(e){return isAttributionTrackingEnabled(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&e.defaultTracking.attribution&&"object"==typeof e.defaultTracking.attribution?__assign$1({},e.defaultTracking.attribution):{}},getFormInteractionsConfig=function(e){if(isFormInteractionTrackingEnabled(e.defaultTracking)&&e.defaultTracking&&"object"==typeof e.defaultTracking&&"object"==typeof e.defaultTracking.formInteractions)return e.defaultTracking.formInteractions},runQueuedFunctions=function(e,t){convertProxyObjectToRealObject(e,t)},convertProxyObjectToRealObject=function(e,t){for(var r=0;r<t.length;r++){var n=t[r],i=n.name,a=n.args,o=n.resolve,s=e&&e[i];if("function"==typeof s){var l=s.apply(e,a);"function"==typeof o&&o(null==l?void 0:l.promise)}}return e},isInstanceProxy=function(e){return e&&void 0!==e._q},VERSION$1="2.37.2",LIBPREFIX="amplitude-ts",BROWSER_PLATFORM="Web",IP_ADDRESS="$remote",Context=function(){function e(){this.name="@amplitude/plugin-context-browser",this.type="before",this.library="".concat(LIBPREFIX,"/").concat(VERSION$1),"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,r;return __awaiter(this,void 0,void 0,(function(){var n,i,a;return __generator(this,(function(o){return n=(new Date).getTime(),i=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1,a=null!==(r=e.event_id)&&void 0!==r?r:i+1,this.config.lastEventId=a,e.time||(this.config.lastEventTime=n),[2,__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1(__assign$1({user_id:this.config.userId,device_id:this.config.deviceId,session_id:this.config.sessionId,time:n},this.config.appVersion&&{app_version:this.config.appVersion}),this.config.trackingOptions.platform&&{platform:BROWSER_PLATFORM}),this.config.trackingOptions.language&&{language:getLanguage()}),this.config.trackingOptions.ipAddress&&{ip:IP_ADDRESS}),{insert_id:UUID(),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:a,library:this.library,user_agent:this.userAgent})]}))}))},e}(),MAX_ARRAY_LENGTH=1e3,LocalStorage=function(e){function t(t){var r,n,i,a=this;try{i=null===(r=getGlobalScope$1())||void 0===r?void 0:r.localStorage}catch(e){null===(n=null==t?void 0:t.loggerProvider)||void 0===n||n.debug("Failed to access localStorage. error=".concat(JSON.stringify(e))),i=void 0}return(a=e.call(this,i)||this).loggerProvider=null==t?void 0:t.loggerProvider,a}return __extends(t,e),t.prototype.set=function(t,r){var n;return __awaiter(this,void 0,void 0,(function(){var i;return __generator(this,(function(a){switch(a.label){case 0:return Array.isArray(r)&&r.length>MAX_ARRAY_LENGTH?(i=r.length-MAX_ARRAY_LENGTH,[4,e.prototype.set.call(this,t,r.slice(0,MAX_ARRAY_LENGTH))]):[3,2];case 1:return a.sent(),null===(n=this.loggerProvider)||void 0===n||n.error("Failed to save ".concat(i," events because the queue length exceeded ").concat(MAX_ARRAY_LENGTH,".")),[3,4];case 2:return[4,e.prototype.set.call(this,t,r)];case 3:a.sent(),a.label=4;case 4:return[2]}}))}))},t}(BrowserStorage),SessionStorage=function(e){function t(){var t;return e.call(this,null===(t=getGlobalScope$1())||void 0===t?void 0:t.sessionStorage)||this}return __extends(t,e),t}(BrowserStorage),XHRTransport=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.state={done:4},r.customHeaders=t,r}return __extends(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),__awaiter(this,void 0,void 0,(function(){var n=this;return __generator(this,(function(i){return[2,new Promise((function(i,a){"undefined"==typeof XMLHttpRequest&&a(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{i(n.buildResponse(JSON.parse(e)))}catch(e){i(n.buildResponse({code:o.status}))}}};var s={"Content-Type":"application/json",Accept:"*/*"},l=JSON.stringify(t),c=r&&l.length>=MIN_GZIP_UPLOAD_BODY_SIZE_BYTES&&isCompressionStreamAvailable(),d=function(e){var t,r;s=__assign$1(__assign$1({},n.customHeaders),s);try{for(var i=__values$1(Object.entries(s)),a=i.next();!a.done;a=i.next()){var l=__read$1(a.value,2),c=l[0],d=l[1];o.setRequestHeader(c,d)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}o.send(e)};__awaiter(n,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return c?[4,compressToGzipArrayBuffer(l)]:[3,2];case 1:return(e=t.sent())?(s["Content-Encoding"]="gzip",d(e)):d(l),[3,3];case 2:d(l),t.label=3;case 3:return[2]}}))})).catch(a)}))]}))}))},t}(BaseTransport),FetchTransport=function(e){function t(t){void 0===t&&(t={});var r=e.call(this)||this;return r.customHeaders=t,r}return __extends(t,e),t.prototype.send=function(e,t,r){return void 0===r&&(r=!1),__awaiter(this,void 0,void 0,(function(){var n,i,a,o,s,l,c;return __generator(this,(function(d){switch(d.label){case 0:if("undefined"==typeof fetch)throw new Error("FetchTransport is not supported");return n=JSON.stringify(t),i=r&&n.length>=MIN_GZIP_UPLOAD_BODY_SIZE_BYTES&&isCompressionStreamAvailable(),a=n,o={"Content-Type":"application/json",Accept:"*/*"},i?[4,compressToGzipArrayBuffer(n)]:[3,2];case 1:(s=d.sent())&&(o["Content-Encoding"]="gzip",a=s),d.label=2;case 2:return o=__assign$1(__assign$1({},this.customHeaders),o),[4,fetch(e,{headers:o,body:a,method:"POST"})];case 3:return[4,(l=d.sent()).text()];case 4:c=d.sent();try{return[2,this.buildResponse(JSON.parse(c))]}catch(e){return[2,this.buildResponse({code:l.status})]}return[2]}}))}))},t}(BaseTransport),SendBeaconTransport=function(e){function t(){return e.call(this)||this}return __extends(t,e),t.prototype.send=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){var r=this;return __generator(this,(function(n){return[2,new Promise((function(n,i){var a=getGlobalScope$1();if(!(null==a?void 0:a.navigator.sendBeacon))throw new Error("SendBeaconTransport is not supported");try{var o=JSON.stringify(t);return n(a.navigator.sendBeacon(e,o)?r.buildResponse({code:200,events_ingested:t.events.length,payload_size_bytes:o.length,server_upload_time:Date.now()}):r.buildResponse({code:500}))}catch(e){i(e)}}))]}))}))},t}(BaseTransport),parseLegacyCookies=function(e,t,r){return void 0===r&&(r=!0),__awaiter(void 0,void 0,void 0,(function(){var n,i,a,o,s,l,c,d,u;return __generator(this,(function(p){switch(p.label){case 0:return n=getOldCookieName(e),[4,t.getRaw(n)];case 1:return(i=p.sent())?r?[4,t.remove(n)]:[3,3]:[2,{optOut:!1}];case 2:p.sent(),p.label=3;case 3:return a=__read$1(i.split("."),6),o=a[0],s=a[1],l=a[2],c=a[3],d=a[4],u=a[5],[2,{deviceId:o,userId:decode(s),sessionId:parseTime(c),lastEventId:parseTime(u),lastEventTime:parseTime(d),optOut:Boolean(l)}]}}))}))},parseTime=function(e){var t=parseInt(e,32);if(!isNaN(t))return t},decode=function(e){if(atob&&escape&&e)try{return decodeURIComponent(escape(atob(e)))}catch(e){return}},DEFAULT_EVENT_PREFIX="[Amplitude]",DEFAULT_FORM_START_EVENT="".concat(DEFAULT_EVENT_PREFIX," Form Started"),DEFAULT_FORM_SUBMIT_EVENT="".concat(DEFAULT_EVENT_PREFIX," Form Submitted"),DEFAULT_FILE_DOWNLOAD_EVENT="".concat(DEFAULT_EVENT_PREFIX," File Downloaded"),DEFAULT_SESSION_START_EVENT="session_start",DEFAULT_SESSION_END_EVENT="session_end",FILE_EXTENSION="".concat(DEFAULT_EVENT_PREFIX," File Extension"),FILE_NAME="".concat(DEFAULT_EVENT_PREFIX," File Name"),LINK_ID="".concat(DEFAULT_EVENT_PREFIX," Link ID"),LINK_TEXT="".concat(DEFAULT_EVENT_PREFIX," Link Text"),LINK_URL="".concat(DEFAULT_EVENT_PREFIX," Link URL"),FORM_ID="".concat(DEFAULT_EVENT_PREFIX," Form ID"),FORM_NAME="".concat(DEFAULT_EVENT_PREFIX," Form Name"),FORM_DESTINATION="".concat(DEFAULT_EVENT_PREFIX," Form Destination"),DEFAULT_IDENTITY_STORAGE="cookie",DEFAULT_SERVER_ZONE="US",types=Object.freeze({__proto__:null,DEFAULT_ACTION_CLICK_ALLOWLIST:DEFAULT_ACTION_CLICK_ALLOWLIST,DEFAULT_CSS_SELECTOR_ALLOWLIST:DEFAULT_CSS_SELECTOR_ALLOWLIST,DEFAULT_DATA_ATTRIBUTE_PREFIX:DEFAULT_DATA_ATTRIBUTE_PREFIX,EXCLUDE_INTERNAL_REFERRERS_CONDITIONS:EXCLUDE_INTERNAL_REFERRERS_CONDITIONS,get IdentifyOperation(){return IdentifyOperation$1},get LogLevel(){return LogLevel},OfflineDisabled:OfflineDisabled,get RevenueProperty(){return RevenueProperty},get ServerZone(){return ServerZone},get SpecialEventType(){return SpecialEventType}}),domainWithoutSubdomain=function(e){var t=e.split(".");return t.length<=2?e:t.slice(t.length-2,t.length).join(".")},isDirectTraffic=function(e){return Object.values(e).every((function(e){return!e}))},isEmptyCampaign=function(e){var t=__assign$1(__assign$1({},e),{referring_domain:void 0,referrer:void 0});return Object.values(t).every((function(e){return!e}))},isNewCampaign=function(e,t,r,n,i,a){void 0===i&&(i=!0),e.referrer;var o=e.referring_domain,s=__rest(e,["referrer","referring_domain"]),l=t||{};l.referrer;var c=l.referring_domain,d=__rest(l,["referrer","referring_domain"]),u=r.excludeInternalReferrers;if(u){var p=getExcludeInternalReferrersCondition(u,n);if(!(p instanceof TypeError)&&e.referring_domain&&isInternalReferrer(e.referring_domain,a)){if("always"===p)return debugLogInternalReferrerExclude(p,e.referring_domain,n),!1;if("ifEmptyCampaign"===p&&isEmptyCampaign(e))return debugLogInternalReferrerExclude(p,e.referring_domain,n),!1}}if(isExcludedReferrer(r.excludeReferrers,e.referring_domain))return n.debug("This is not a new campaign because ".concat(e.referring_domain," is in the exclude referrer list.")),!1;if(!i&&isDirectTraffic(e)&&t)return n.debug("This is not a new campaign because this is a direct traffic in the same session."),!1;var h=JSON.stringify(s)!==JSON.stringify(d),f=domainWithoutSubdomain(o||"")!==domainWithoutSubdomain(c||""),m=!t||h||f;return m?n.debug("This is a new campaign. An $identify event will be sent."):n.debug("This is not a new campaign because it's the same as the previous one."),m},isExcludedReferrer=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}))},isSubdomainOf=function(e,t){var r=t.startsWith(".")?t:".".concat(t);return!!(e.startsWith(".")?e:".".concat(e)).endsWith(r)},createCampaignEvent=function(e,t){var r=__assign$1(__assign$1({},BASE_CAMPAIGN),e),n=Object.entries(r).reduce((function(e,r){var n,i=__read$1(r,2),a=i[0],o=i[1];return e.setOnce("initial_".concat(a),null!==(n=null!=o?o:t.initialEmptyValue)&&void 0!==n?n:"EMPTY"),o?e.set(a,o):e.unset(a)}),new Identify);return createIdentifyEvent(n)},getDefaultExcludedReferrers=function(e){var t=e;return t?(t.startsWith(".")&&(t=t.substring(1)),[new RegExp("".concat(t.replace(".","\\."),"$"))]):[]},getExcludeInternalReferrersCondition=function(e,t){if(!0===e)return EXCLUDE_INTERNAL_REFERRERS_CONDITIONS.always;if("object"==typeof e){var r=e.condition;if("string"==typeof r&&Object.keys(EXCLUDE_INTERNAL_REFERRERS_CONDITIONS).includes(r))return r;if(void 0===r)return EXCLUDE_INTERNAL_REFERRERS_CONDITIONS.always}var n="Invalid configuration provided for attribution.excludeInternalReferrers: ".concat(JSON.stringify(e));return t.error(n),new TypeError(n)};function debugLogInternalReferrerExclude(e,t,r){var n="This is not a new campaign because referring_domain=".concat(t," is on the same domain as the current page and it is configured to exclude internal referrers");"always"===e?r.debug(n):"ifEmptyCampaign"===e&&r.debug("".concat(n," with empty campaign parameters"))}var KNOWN_2LDS=["ac.in","ac.jp","ac.kr","ac.th","ac.uk","ac.za","appspot.com","asn.au","azurewebsites.net","cloudfront.net","myshopify.com","blogspot.com","co.ca","co.in","co.jp","co.kr","co.nz","co.th","co.uk","co.za","com.ar","com.au","com.br","com.cn","com.hk","com.in","com.jp","com.kr","com.mx","com.pl","com.sg","com.tr","com.tw","ed.jp","edu.au","edu.br","edu.cn","edu.hk","edu.sg","edu.th","edu.tr","edu.tw","firebaseapp.com","fly.dev","gc.ca","geek.nz","github.io","gitlab.io","go.jp","go.kr","go.th","gob.ar","gob.mx","gov.au","gov.br","gov.cn","gov.hk","gov.in","gov.pl","gov.sg","gov.tr","gov.tw","gov.uk","gov.za","govt.nz","gr.jp","herokuapp.com","id.au","idv.hk","iwi.nz","lg.jp","ltd.uk","maori.nz","me.uk","mil.kr","ne.jp","ne.kr","net.au","net.br","net.cn","net.hk","net.in","net.nz","net.pl","net.sg","net.tr","net.tw","net.za","onrender.com","or.jp","or.kr","or.th","org.ar","org.au","org.br","org.cn","org.hk","org.in","org.mx","org.nz","org.pl","org.sg","org.tw","org.uk","org.za","pages.dev","pe.kr","plc.uk","re.kr","res.in","sch.uk","vercel.app","netlify.app","workers.dev"],getDomain=function(e){var t,r,n=e||(null===(r=null===(t=getGlobalScope$1())||void 0===t?void 0:t.location)||void 0===r?void 0:r.hostname);if(!n)return"";var i=n.split("."),a=i[i.length-1],o=i[i.length-2];return KNOWN_2LDS.find((function(e){return n.endsWith(".".concat(e))}))&&(a=i[i.length-2]+"."+i[i.length-1],o=i[i.length-3]),o?"".concat(o,".").concat(a):a},isInternalReferrer=function(e,t){var r=getGlobalScope$1();if(!r)return!1;var n=(t||"").trim()||getDomain(r.location.hostname);return isSubdomainOf(e,n)},BrowserConfig=function(e){function t(t,r,n,i,a,o,s,l,c,d,u,p,h,f,m,g,v,y,b,E,_,S,T,x,k,A,I,C,P,w,D,R,L,O,N,M,F,$,B,U,V,G,q,z,H){void 0===n&&(n=new MemoryStorage),void 0===i&&(i={domain:"",expiration:365,sameSite:"Lax",secure:!1,upgrade:!0}),void 0===l&&(l=1e3),void 0===c&&(c=5),void 0===d&&(d=30),void 0===u&&(u=DEFAULT_IDENTITY_STORAGE),void 0===g&&(g=new Logger),void 0===v&&(v=LogLevel.Warn),void 0===b&&(b=!1),void 0===E&&(E=!1),void 0===T&&(T=""),void 0===x&&(x=DEFAULT_SERVER_ZONE),void 0===I&&(I=18e5),void 0===C&&(C=new LocalStorage({loggerProvider:g})),void 0===P&&(P={ipAddress:!0,language:!0,platform:!0}),void 0===w&&(w="fetch"),void 0===D&&(D=!1),void 0===R&&(R=!0),void 0===$&&($=!0),void 0===B&&(B=0),void 0===q&&(q=!1),void 0===z&&(z=!1);var j,W=this;(W=e.call(this,{apiKey:t,storageProvider:C,transportProvider:createTransport$1(w)})||this).apiKey=t,W.appVersion=r,W.cookieOptions=i,W.defaultTracking=a,W.autocapture=o,W.flushIntervalMillis=l,W.flushMaxRetries=c,W.flushQueueSize=d,W.identityStorage=u,W.ingestionMetadata=p,W.instanceName=h,W.loggerProvider=g,W.logLevel=v,W.minIdLength=y,W.offline=b,W.partnerId=_,W.plan=S,W.serverUrl=T,W.serverZone=x,W.sessionTimeout=I,W.storageProvider=C,W.trackingOptions=P,W.transport=w,W.useBatch=D,W.fetchRemoteConfig=R,W.networkTrackingOptions=M,W.identify=F,W.enableDiagnostics=$,W.diagnosticsSampleRate=B,W.diagnosticsClient=U,W.remoteConfig=V,W.topLevelDomain=G,W.enableRequestBodyCompression=q,W._enableRequestBodyCompressionExperimental=z,W.customEnrichment=H,W.version=VERSION$1,W._optOut=!1,W._cookieStorage=n,W.deviceId=s,W.lastEventId=f,W.lastEventTime=m,W.optOut=E,W.deferredSessionId=A,W.sessionId=k,W.pageCounter=O,W.userId=L,W.debugLogsEnabled=N,W.loggerProvider.enable(N?LogLevel.Debug:W.logLevel),W.networkTrackingOptions=M,W.identify=F,W.enableDiagnostics=$,W.diagnosticsSampleRate=B,W.diagnosticsClient=U;var K=null!==(j=null==V?void 0:V.fetchRemoteConfig)&&void 0!==j?j:R;return W.remoteConfig=W.remoteConfig||{},W.remoteConfig.fetchRemoteConfig=K,W.fetchRemoteConfig=K,W.topLevelDomain=G||getDomain(),W}return __extends(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 CookieStorage&&(e.cookieDomain=this.cookieStorage.options.domain),this.cookieStorage.set(getCookieName(this.apiKey),e)},t}(Config),useBrowserConfig=function(e,t,r,n,i){return void 0===t&&(t={}),__awaiter(void 0,void 0,void 0,(function(){var a,o,s,l,c,d,u,p,h,f,m,g,v,y,b,E,_,S,T,x,k,A,I,C,P,w,D,R,L,O,N,M,F,$,B,U,V,G,q,z,H,j,W,K,Y,X,J,Q,Z,ee,te;return __generator(this,(function(re){switch(re.label){case 0:return a=t.identityStorage||DEFAULT_IDENTITY_STORAGE,o="",a!==DEFAULT_IDENTITY_STORAGE||(null===(A=t.cookieOptions)||void 0===A?void 0:A.domain)||""===(null===(I=t.cookieOptions)||void 0===I?void 0:I.domain)?[3,2]:[4,getTopLevelDomain(void 0,n)];case 1:o=re.sent(),re.label=2;case 2:return s=__assign$1({domain:null!==(P=null===(C=t.cookieOptions)||void 0===C?void 0:C.domain)&&void 0!==P?P:o,expiration:365,sameSite:"Lax",secure:!1,upgrade:!0},t.cookieOptions),l={duplicateResolverFn:function(e){var t=decodeCookieValue(e);if(!t)return!1;var r=JSON.parse(t);return isDomainEqual(r.cookieDomain,s.domain)},diagnosticsClient:n},c=createCookieStorage(t.identityStorage,s,l),[4,parseLegacyCookies(e,c,null===(D=null===(w=t.cookieOptions)||void 0===w?void 0:w.upgrade)||void 0===D||D)];case 3:return d=re.sent(),[4,c.get(getCookieName(e))];case 4:return u=re.sent(),p=getQueryParams(),h=p.ampTimestamp?Number(p.ampTimestamp):void 0,f=!h||Date.now()<h,m=null!==(M=null!==(N=null!==(O=null!==(R=t.deviceId)&&void 0!==R?R:f?null!==(L=p.ampDeviceId)&&void 0!==L?L:p.deviceId:void 0)&&void 0!==O?O:null==u?void 0:u.deviceId)&&void 0!==N?N:d.deviceId)&&void 0!==M?M:UUID(),g=null!==(F=null==u?void 0:u.lastEventId)&&void 0!==F?F:d.lastEventId,v=null!==($=null==u?void 0:u.lastEventTime)&&void 0!==$?$:d.lastEventTime,y=null!==(U=null!==(B=t.optOut)&&void 0!==B?B:null==u?void 0:u.optOut)&&void 0!==U?U:d.optOut,b=null!==(V=null==u?void 0:u.sessionId)&&void 0!==V?V:d.sessionId,E=null==u?void 0:u.deferredSessionId,_=null!==(q=null!==(G=t.userId)&&void 0!==G?G:null==u?void 0:u.userId)&&void 0!==q?q:d.userId,r.previousSessionDeviceId=null!==(z=null==u?void 0:u.deviceId)&&void 0!==z?z:d.deviceId,r.previousSessionUserId=null!==(H=null==u?void 0:u.userId)&&void 0!==H?H:d.userId,S={ipAddress:null===(W=null===(j=t.trackingOptions)||void 0===j?void 0:j.ipAddress)||void 0===W||W,language:null===(Y=null===(K=t.trackingOptions)||void 0===K?void 0:K.language)||void 0===Y||Y,platform:null===(J=null===(X=t.trackingOptions)||void 0===X?void 0:X.platform)||void 0===J||J},T=null==u?void 0:u.pageCounter,x=null==u?void 0:u.debugLogsEnabled,void 0!==t.autocapture&&(t.defaultTracking=t.autocapture),[4,(k=new BrowserConfig(e,t.appVersion,c,s,t.defaultTracking,t.autocapture,m,t.flushIntervalMillis,t.flushMaxRetries,t.flushQueueSize,a,t.ingestionMetadata,t.instanceName,g,v,null!==(Q=null==i?void 0:i.loggerProvider)&&void 0!==Q?Q:t.loggerProvider,t.logLevel,t.minIdLength,t.offline,y,t.partnerId,t.plan,t.serverUrl,null!==(Z=null==i?void 0:i.serverZone)&&void 0!==Z?Z:t.serverZone,b,E,t.sessionTimeout,t.storageProvider,S,t.transport,t.useBatch,t.fetchRemoteConfig,_,T,x,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:r._diagnosticsSampleRate,n,t.remoteConfig,o,t.enableRequestBodyCompression,r._enableRequestBodyCompressionExperimentalValue,t.customEnrichment)).storageProvider.isEnabled()];case 5:return re.sent()||(k.loggerProvider.warn("Storage provider ".concat(k.storageProvider.constructor.name," is not enabled. Falling back to MemoryStorage.")),k.storageProvider=new MemoryStorage),[2,k]}}))}))},createCookieStorage=function(e,t,r){switch(void 0===e&&(e=DEFAULT_IDENTITY_STORAGE),void 0===t&&(t={}),e){case"localStorage":return new LocalStorage;case"sessionStorage":return new SessionStorage;case"none":return new MemoryStorage;default:return new CookieStorage(__assign$1(__assign$1({},t),{expirationDays:t.expiration}),r)}},shouldFetchRemoteConfig=function(e){var t,r;return void 0===e&&(e={}),!0===(null===(t=e.remoteConfig)||void 0===t?void 0:t.fetchRemoteConfig)||!1!==(null===(r=e.remoteConfig)||void 0===r?void 0:r.fetchRemoteConfig)&&!1!==e.fetchRemoteConfig},createTransport$1=function(e){var t="object"==typeof e?e.type:e,r="object"==typeof e?e.headers:void 0;return"xhr"===t?new XHRTransport(r):"beacon"===t?new SendBeaconTransport:new FetchTransport(r)},getTopLevelDomain=function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var e,r,n,i,a,o,s;return __generator(this,(function(l){switch(l.label){case 0:return[4,new CookieStorage(void 0,{diagnosticsClient:t}).isEnabled()];case 1:if(!l.sent()||"undefined"==typeof location||!location.hostname)return[2,""];if(e=location.hostname,1===(r=e.split(".")).length)return[2,""];for(n=[],i=1,KNOWN_2LDS.find((function(t){return e.endsWith(".".concat(t))}))&&(i=2),a=r.length-i-1;a>=0;--a)n.push(r.slice(a).join("."));a=0,l.label=2;case 2:if(!(a<n.length))return[3,7];o=n[a],l.label=3;case 3:return l.trys.push([3,5,,6]),[4,CookieStorage.isDomainWritable(o)];case 4:return l.sent()?[2,"."+o]:[3,6];case 5:return s=l.sent(),t&&t.recordEvent("cookies.tld.failure",{reason:"Unexpected exception checking domain is writable: ".concat(o),error:s instanceof Error?s.message:String(s)}),[3,6];case 6:return a++,[3,2];case 7:return t&&t.recordEvent("cookies.tld.failure",{reason:"Could not determine TLD for host ".concat(e)}),[2,""]}}))}))},omitUndefined=function(e){var t={};for(var r in e){var n=e[r];n&&(t[r]=n)}return t},defaultPageViewEvent="[Amplitude] Page Viewed",PAGE_VIEW_SESSION_STORAGE_KEY$1="AMP_PAGE_VIEW",pageViewTrackingPlugin=function(e){var t;void 0===e&&(e={});var r,n,i=getGlobalScope$1(),a=void 0,o=!1,s=e.trackOn,l=e.trackHistoryChanges,c=e.eventType,d=void 0===c?defaultPageViewEvent:c,u=function(e){var t=e;try{t=decodeURI(e)}catch(e){null==a||a.error("Malformed URI sequence: ",e)}return t},p=function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r,n;return __generator(this,(function(i){switch(i.label){case 0:return t=u("undefined"!=typeof location&&location.href||""),n={event_type:d},r=[{}],[4,getCampaignParams()];case 1:return[2,(n.event_properties=__assign$1.apply(void 0,[__assign$1.apply(void 0,r.concat([i.sent()])),{"[Amplitude] Page Domain":"undefined"!=typeof location&&location.hostname||"","[Amplitude] Page Location":t,"[Amplitude] Page Path":"undefined"!=typeof location&&u(location.pathname)||"","[Amplitude] Page Title":getPageTitle(replaceSensitiveString),"[Amplitude] Page URL":t.split("?")[0],"[Amplitude] Page View ID":e}]),n)]}}))}))},h=function(){return void 0===s||"function"==typeof s&&s()},f="undefined"!=typeof location?location.href:null,m=function(){__awaiter(void 0,void 0,void 0,(function(){var e,r,i,o,s;return __generator(this,(function(c){switch(c.label){case 0:return e=location.href,r=shouldTrackHistoryPageView(l,e,f||"")&&h(),f=e,r?(i=void 0,n&&(i=UUID(),n.set(PAGE_VIEW_SESSION_STORAGE_KEY$1,{pageViewId:i})),null==a||a.log("Tracking page view event"),null!=t?[3,1]:[3,3]):[3,4];case 1:return s=(o=t).track,[4,p(i)];case 2:s.apply(o,[c.sent()]),c.label=3;case 3:c.label=4;case 4:return[2]}}))}))},g={name:"@amplitude/plugin-page-view-tracking-browser",type:"enrichment",setup:function(e,s){return __awaiter(void 0,void 0,void 0,(function(){var l,c,d;return __generator(this,(function(u){switch(u.label){case 0:if(t=s,r=e,(a=e.loggerProvider).log("Installing @amplitude/plugin-page-view-tracking-browser"),o=!0,i){try{n=new BrowserStorage(i.sessionStorage)}catch(e){null==a||a.debug("sessionStorage is not available in this environment.")}i.addEventListener("popstate",m),i.history.pushState=new Proxy(i.history.pushState,{apply:function(e,t,r){var n=__read$1(r,3),i=n[0],a=n[1],s=n[2];e.apply(t,[i,a,s]),o&&m()}})}return h()?(a.log("Tracking page view event"),l=void 0,n&&(l=UUID(),n.set(PAGE_VIEW_SESSION_STORAGE_KEY$1,{pageViewId:l})),d=(c=t).track,[4,p(l)]):[3,2];case 1:d.apply(c,[u.sent()]),u.label=2;case 2:return[2]}}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,i,o;return __generator(this,(function(l){switch(l.label){case 0:return"attribution"===s&&isCampaignEvent(e)?(null==a||a.log("Enriching campaign event to page view event with campaign parameters"),t=void 0,n?[4,n.get(PAGE_VIEW_SESSION_STORAGE_KEY$1)]:[3,2]):[3,4];case 1:i=l.sent(),t=null==i?void 0:i.pageViewId,l.label=2;case 2:return[4,p(t)];case 3:o=l.sent(),e.event_type=o.event_type,e.event_properties=__assign$1(__assign$1({},e.event_properties),o.event_properties),l.label=4;case 4:return r&&e.event_type===d&&(r.pageCounter=r.pageCounter?r.pageCounter+1:1,e.event_properties=__assign$1(__assign$1({},e.event_properties),{"[Amplitude] Page Counter":r.pageCounter})),[2,e]}}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return i&&(i.removeEventListener("popstate",m),o=!1),[2]}))}))}};return g},getCampaignParams=function(){return __awaiter(void 0,void 0,void 0,(function(){var e;return __generator(this,(function(t){switch(t.label){case 0:return e=omitUndefined,[4,(new CampaignParser).parse()];case 1:return[2,e.apply(void 0,[t.sent()])]}}))}))},isCampaignEvent=function(e){if("$identify"===e.event_type&&e.user_properties){var t=e.user_properties,r=t[IdentifyOperation$1.SET]||{},n=t[IdentifyOperation$1.UNSET]||{},i=__spreadArray(__spreadArray([],__read$1(Object.keys(r)),!1),__read$1(Object.keys(n)),!1);return Object.keys(BASE_CAMPAIGN).every((function(e){return i.includes(e)}))}return!1},shouldTrackHistoryPageView=function(e,t,r){if("pathOnly"===e){if(""==r)return!0;var n=new URL(t),i=new URL(r);return n.origin+n.pathname!==i.origin+i.pathname}return t!==r},formInteractionTracking=function(){var e,t,r=[],n=function(e,t,n){e.addEventListener(t,n),r.push({element:e,type:t,handler:n})};return{name:"@amplitude/plugin-form-interaction-tracking-browser",type:"enrichment",setup:function(r,i){return __awaiter(void 0,void 0,void 0,(function(){var a,o;return __generator(this,(function(s){return t=getFormInteractionsConfig(r),a=function(){if(i){if("undefined"!=typeof document){var a=new WeakSet,o=function(e){if(!a.has(e)){a.add(e);var o=!1;n(e,"change",(function(){var t,r=extractFormAction(e);o||i.track(DEFAULT_FORM_START_EVENT,((t={})[FORM_ID]=stringOrUndefined(e.id),t[FORM_NAME]=stringOrUndefined(e.name),t[FORM_DESTINATION]=r,t)),o=!0})),n(e,"submit",(function(n){var a,s,l=extractFormAction(e);if(o||i.track(DEFAULT_FORM_START_EVENT,((a={})[FORM_ID]=stringOrUndefined(e.id),a[FORM_NAME]=stringOrUndefined(e.name),a[FORM_DESTINATION]=l,a)),o=!0,void 0!==(null==t?void 0:t.shouldTrackSubmit))if("function"==typeof t.shouldTrackSubmit&&"undefined"!=typeof SubmitEvent&&n instanceof SubmitEvent)try{if(!t.shouldTrackSubmit(n))return}catch(e){r.loggerProvider.warn("shouldTrackSubmit callback threw an error, proceeding with tracking.")}else r.loggerProvider.warn("shouldTrackSubmit is ignored because it is not a function or event is not a SubmitEvent.");i.track(DEFAULT_FORM_SUBMIT_EVENT,((s={})[FORM_ID]=stringOrUndefined(e.id),s[FORM_NAME]=stringOrUndefined(e.name),s[FORM_DESTINATION]=l,s)),o=!1}))}};Array.from(document.getElementsByTagName("form")).forEach(o),"undefined"!=typeof MutationObserver&&(e=new MutationObserver((function(e){e.forEach((function(e){e.addedNodes.forEach((function(e){"FORM"===e.nodeName&&o(e),"querySelectorAll"in e&&"function"==typeof e.querySelectorAll&&Array.from(e.querySelectorAll("form")).map(o)}))}))}))).observe(document.body,{subtree:!0,childList:!0})}}else r.loggerProvider.warn("Form interaction tracking requires a later version of @amplitude/analytics-browser. Form interaction events are not tracked.")},"complete"===document.readyState?a():(o=getGlobalScope$1())?o.addEventListener("load",a):r.loggerProvider.debug("Form interaction tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e]}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return null==e||e.disconnect(),r.forEach((function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)})),r=[],[2]}))}))}}},stringOrUndefined=function(e){if("string"==typeof e)return e},extractFormAction=function(e){var t=e.getAttribute("action");try{t=new URL(encodeURI(null!=t?t:""),window.location.href).href}catch(e){}return t},fileDownloadTracking=function(){var e,t=[];return{name:"@amplitude/plugin-file-download-tracking-browser",type:"enrichment",setup:function(r,n){return __awaiter(void 0,void 0,void 0,(function(){var i,a;return __generator(this,(function(o){return i=function(){if(n){if("undefined"!=typeof document){var i=function(e){var r;try{r=new URL(e.href,window.location.href)}catch(e){return}var i=a.exec(r.href),o=null==i?void 0:i[1];o&&function(e,r,n){e.addEventListener(r,n),t.push({element:e,type:r,handler:n})}(e,"click",(function(){var t;o&&n.track(DEFAULT_FILE_DOWNLOAD_EVENT,((t={})[FILE_EXTENSION]=o,t[FILE_NAME]=r.pathname,t[LINK_ID]=e.id,t[LINK_TEXT]=e.text,t[LINK_URL]=e.href,t))}))},a=/\.(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 r.loggerProvider.warn("File download tracking requires a later version of @amplitude/analytics-browser. File download events are not tracked.")},"complete"===document.readyState?i():(a=getGlobalScope$1())?a.addEventListener("load",i):r.loggerProvider.debug("File download tracking is not installed because global is undefined."),[2]}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e]}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return null==e||e.disconnect(),t.forEach((function(e){var t=e.element,r=e.type,n=e.handler;null==t||t.removeEventListener(r,n)})),t=[],[2]}))}))}}},notified=!1,detNotify=function(e){if(!notified&&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."),notified=!0}},networkConnectivityCheckerPlugin=function(){var e=getGlobalScope$1(),t=[],r=function(r,n){(null==e?void 0:e.addEventListener)&&(null==e||e.addEventListener(r,n),t.push({type:r,handler:n}))};return{name:"@amplitude/plugin-network-checker-browser",type:"before",setup:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(n){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,r("online",(function(){e.loggerProvider.debug("Network connectivity changed to online."),e.offline=!1,setTimeout((function(){t.flush()}),e.flushIntervalMillis)})),r("offline",(function(){e.loggerProvider.debug("Network connectivity changed to offline."),e.offline=!0})),[2])}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(r){return t.forEach((function(t){var r=t.type,n=t.handler;null==e||e.removeEventListener(r,n)})),t=[],[2]}))}))}}};function translateRemoteConfigToLocal(e){var t,r,n,i,a,o,s,l,c,d,u;if("object"==typeof e&&null!==e&&!Array.isArray(e)){var p=Object.keys(e);try{for(var h=__values$1(p),f=h.next();!f.done;f=h.next()){var m=f.value;try{var g=e[m];"boolean"==typeof(null==g?void 0:g.enabled)&&(g.enabled?(delete g.enabled,0===Object.keys(g).length&&(e[m]=!0)):e[m]=!1),translateRemoteConfigToLocal(g)}catch(e){}}}catch(e){t={error:e}}finally{try{f&&!f.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}try{if(null===(c=null===(l=null===(s=e.autocapture)||void 0===s?void 0:s.networkTracking)||void 0===l?void 0:l.captureRules)||void 0===c?void 0:c.length)try{for(var v=__values$1(e.autocapture.networkTracking.captureRules),y=v.next();!y.done;y=v.next()){var b=y.value;try{for(var E=(a=void 0,__values$1(["responseHeaders","requestHeaders"])),_=E.next();!_.done;_=E.next()){var S=_.value,T=null!==(d=b[S])&&void 0!==d?d:{},x=T.captureSafeHeaders,k=T.allowlist;(x||k)&&(void 0===k||Array.isArray(k)?b[S]=__spreadArray(__spreadArray([],__read$1(x?SAFE_HEADERS:[]),!1),__read$1(null!=k?k:[]),!1):delete b[S])}}catch(e){a={error:e}}finally{try{_&&!_.done&&(o=E.return)&&o.call(E)}finally{if(a)throw a.error}}}}catch(e){n={error:e}}finally{try{y&&!y.done&&(i=v.return)&&i.call(v)}finally{if(n)throw n.error}}}catch(e){}var A=null===(u=e.autocapture)||void 0===u?void 0:u.frustrationInteractions;A&&(A.rageClick&&(A.rageClicks=A.rageClick,delete A.rageClick),A.deadClick&&(A.deadClicks=A.deadClick,delete A.deadClick))}}function mergeUrls(e,t,r){var n,i,a=[];try{for(var o=__values$1(null!=t?t:[]),s=o.next();!s.done;s=o.next()){var l=s.value;try{a.push(new RegExp(l))}catch(e){r.loggerProvider.warn("Invalid regex pattern: ".concat(l),e)}}}catch(e){n={error:e}}finally{try{s&&!s.done&&(i=o.return)&&i.call(o)}finally{if(n)throw n.error}}return e.concat(a)}function updateBrowserConfigWithRemoteConfig(e,t){var r,n,i,a,o,s,l;if(e){translateRemoteConfigToLocal(e);try{t.loggerProvider.debug("Update browser config with remote configuration:",JSON.stringify(e));var c=e;if(c&&"autocapture"in c){if("boolean"==typeof c.autocapture&&(t.autocapture=c.autocapture),"object"==typeof c.autocapture&&null!==c.autocapture){var d=__assign$1({},c.autocapture);if(void 0===t.autocapture&&(t.autocapture=c.autocapture),"object"==typeof c.autocapture.elementInteractions&&null!==c.autocapture.elementInteractions&&(null===(i=c.autocapture.elementInteractions.pageUrlAllowlistRegex)||void 0===i?void 0:i.length)){d.elementInteractions=__assign$1({},c.autocapture.elementInteractions);var u=d.elementInteractions,p=null!==(a=u.pageUrlAllowlist)&&void 0!==a?a:[],h=c.autocapture.elementInteractions.pageUrlAllowlistRegex;u.pageUrlAllowlist=mergeUrls(p,h,t),delete u.pageUrlAllowlistRegex}if("object"==typeof c.autocapture.networkTracking&&null!==c.autocapture.networkTracking&&(null===(o=c.autocapture.networkTracking.captureRules)||void 0===o?void 0:o.length)){d.networkTracking=__assign$1({},c.autocapture.networkTracking);var f=null!==(s=d.networkTracking.captureRules)&&void 0!==s?s:[];try{for(var m=__values$1(f),g=m.next();!g.done;g=m.next()){var v=g.value;v.urls=mergeUrls(null!==(l=v.urls)&&void 0!==l?l:[],v.urlsRegex,t),delete v.urlsRegex}}catch(e){r={error:e}}finally{try{g&&!g.done&&(n=m.return)&&n.call(m)}finally{if(r)throw r.error}}}"boolean"==typeof t.autocapture&&(t.autocapture=__assign$1({attribution:t.autocapture,fileDownloads:t.autocapture,formInteractions:t.autocapture,pageViews:t.autocapture,sessions:t.autocapture,elementInteractions:t.autocapture,webVitals:t.autocapture,frustrationInteractions:t.autocapture},d)),"object"==typeof t.autocapture&&(t.autocapture=__assign$1(__assign$1({},t.autocapture),d))}t.defaultTracking=t.autocapture}"customEnrichment"in c&&null!==c.customEnrichment&&(t.customEnrichment=c.customEnrichment),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 VERSION="1.24.2",PLUGIN_NAME$2="@amplitude/plugin-autocapture-browser",FRUSTRATION_PLUGIN_NAME="@amplitude/plugin-frustration-browser",AMPLITUDE_ELEMENT_CLICKED_EVENT="[Amplitude] Element Clicked",AMPLITUDE_ELEMENT_DEAD_CLICKED_EVENT="[Amplitude] Dead Click",AMPLITUDE_ELEMENT_RAGE_CLICKED_EVENT="[Amplitude] Rage Click",AMPLITUDE_ELEMENT_ERROR_CLICKED_EVENT="[Amplitude] Error Click",AMPLITUDE_ELEMENT_CHANGED_EVENT="[Amplitude] Element Changed",AMPLITUDE_THRASHED_CURSOR_EVENT="[Amplitude] Thrashed Cursor",AMPLITUDE_EVENT_PROP_ELEMENT_ID="[Amplitude] Element ID",AMPLITUDE_EVENT_PROP_ELEMENT_CLASS="[Amplitude] Element Class",AMPLITUDE_EVENT_PROP_ELEMENT_TAG="[Amplitude] Element Tag",AMPLITUDE_EVENT_PROP_ELEMENT_TEXT="[Amplitude] Element Text",AMPLITUDE_EVENT_PROP_ELEMENT_HIERARCHY="[Amplitude] Element Hierarchy",AMPLITUDE_EVENT_PROP_ELEMENT_HREF="[Amplitude] Element Href",AMPLITUDE_EVENT_PROP_ELEMENT_POSITION_LEFT="[Amplitude] Element Position Left",AMPLITUDE_EVENT_PROP_ELEMENT_POSITION_TOP="[Amplitude] Element Position Top",AMPLITUDE_EVENT_PROP_ELEMENT_ARIA_LABEL="[Amplitude] Element Aria Label",AMPLITUDE_EVENT_PROP_ELEMENT_ATTRIBUTES="[Amplitude] Element Attributes",AMPLITUDE_EVENT_PROP_ELEMENT_PATH="[Amplitude] Element Path",AMPLITUDE_EVENT_PROP_ELEMENT_PARENT_LABEL="[Amplitude] Element Parent Label",AMPLITUDE_EVENT_PROP_PAGE_URL="[Amplitude] Page URL",AMPLITUDE_EVENT_PROP_PAGE_TITLE="[Amplitude] Page Title",AMPLITUDE_EVENT_PROP_VIEWPORT_HEIGHT="[Amplitude] Viewport Height",AMPLITUDE_EVENT_PROP_VIEWPORT_WIDTH="[Amplitude] Viewport Width",AMPLITUDE_EVENT_PROP_MAX_PAGE_X="[Amplitude] Max Page X",AMPLITUDE_EVENT_PROP_MAX_PAGE_Y="[Amplitude] Max Page Y",AMPLITUDE_EVENT_PROP_PAGE_VIEW_ID="[Amplitude] Page View ID",AMPLITUDE_VISUAL_TAGGING_SELECTOR_SCRIPT_URL="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",AMPLITUDE_VISUAL_TAGGING_HIGHLIGHT_CLASS="amp-visual-tagging-selector-highlight",DATA_AMP_MASK_ATTRIBUTES="data-amp-mask-attributes",MAX_MASK_TEXT_PATTERNS=25,MAX_ATTRIBUTE_LENGTH=128,PAGE_VIEW_SESSION_STORAGE_KEY="AMP_PAGE_VIEW",MAX_ELEMENT_EXPOSED_STR_LENGTH=18e3,SENSITIVE_TAGS=["input","select","textarea"],isElementPointerCursor=function(e,t){var r,n=null===(r=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===r?void 0:r.call(window,e);return"pointer"===(null==n?void 0:n.getPropertyValue("cursor"))&&"click"===t},isUrlAllowed=function(e){var t=e.pageUrlAllowlist,r=e.pageUrlExcludelist;return!(r&&r.length>0&&isUrlMatchAllowlist(window.location.href,r))&&!!isUrlMatchAllowlist(window.location.href,t)},createShouldTrackEvent=function(e,t,r){return void 0===r&&(r=!1),function(n,i){var a,o,s=e.shouldTrackEventResolver,l=null===(o=null===(a=null==i?void 0:i.tagName)||void 0===a?void 0:a.toLowerCase)||void 0===o?void 0:o.call(a);if(!l)return!1;if(s)return s(n,i);if(!isUrlAllowed(e))return!1;var c=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof c)switch(c.toLowerCase()){case"hidden":case"password":return!1}var d=isElementPointerCursor(i,n);if(r&&d)return!0;if(t){var u=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(!u)return!1}switch(l){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:return!!d||"click"===n}}},isNonSensitiveElement=function(e){var t,r,n,i=null===(r=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===r?void 0:r.call(t),a=e instanceof HTMLElement&&"true"===(null===(n=e.getAttribute("contenteditable"))||void 0===n?void 0:n.toLowerCase());return!SENSITIVE_TAGS.includes(i)&&!a},parseAttributesToMask=function(e){return e?e.split(",").map((function(e){return e.trim()})).filter((function(e){return e.length>0&&"id"!==e&&"class"!==e})):[]},extractPrefixedAttributes=function(e,t){return Object.entries(e).reduce((function(e,r){var n=__read$1(r,2),i=n[0],a=n[1];if(i.startsWith(t)){var o=i.replace(t,"");o&&(e[o]=a||"")}return e}),{})},isEmpty=function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length},removeEmptyProperties=function(e){return Object.keys(e).reduce((function(t,r){var n=e[r];return isEmpty(n)||(t[r]=n),t}),{})},getCurrentPageViewId=function(){var e;try{var t=getGlobalScope$1(),r=null===(e=null==t?void 0:t.sessionStorage)||void 0===e?void 0:e.getItem(PAGE_VIEW_SESSION_STORAGE_KEY);if(!r)return;var n=JSON.parse(r);if("string"==typeof n.pageViewId)return n.pageViewId}catch(e){}},getClosestElement=function(e,t){return e?t.some((function(t){var r;return null===(r=null==e?void 0:e.matches)||void 0===r?void 0:r.call(e,t)}))?e:getClosestElement(null==e?void 0:e.parentElement,t):null},filterOutNonTrackableEvents=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)},MouseButton;function isElementBasedEvent(e){return"click"===e.type||"change"===e.type}!function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"}(MouseButton||(MouseButton={}));var VISUAL_TAGGING_BRAND="__AMPLITUDE_VISUAL_TAGGING__";function enableVisualTagging(e,t){var r=e;if(!0!==r[VISUAL_TAGGING_BRAND]){r[VISUAL_TAGGING_BRAND]=!0;var n=t.dataExtractor,i=t.isElementSelectable,a=t.cssSelectorAllowlist,o=t.actionClickAllowlist,s=null,l=function(t){e.notify({action:"element-selected",data:t})},c=function(t,r){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:r}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:r})};e.registerActionHandler("initialize-visual-tagging-selector",(function(t){e.loadScriptOnce(AMPLITUDE_VISUAL_TAGGING_SELECTOR_SCRIPT_URL).then((function(){var r;s=null===(r=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===r?void 0:r.call(window,{getEventTagProps:n.getEventTagProps,isElementSelectable:function(e){return!i||i((null==t?void 0:t.actionType)||"click",e)},onTrack:c,onSelect:l,visualHighlightClass:AMPLITUDE_VISUAL_TAGGING_HIGHLIGHT_CLASS,messenger:e,cssSelectorAllowlist:a,actionClickAllowlist:o,extractDataFromDataSource:n.extractDataFromDataSource,dataExtractor:n,diagnostics:{autocapture:{version:VERSION}}}),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==s?void 0:s.close)||void 0===e||e.call(s)}))}}function trackClicks(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackEvent,i=e.evaluateTriggers;return r.clickObservable.filter(filterOutNonTrackableEvents).filter((function(e){return n("click",e.closestTrackedAncestor)})).map((function(e){return i(e)})).subscribe((function(e){null==t||t.track(AMPLITUDE_ELEMENT_CLICKED_EVENT,e.targetElementProperties)}))}function trackChange(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackEvent,a=e.evaluateTriggers;return r.changeObservable.filter(filterOutNonTrackableEvents).filter((function(e){return i("change",e.closestTrackedAncestor)})).map((function(e){return a(e)})).subscribe((function(e){null==t||t.track(AMPLITUDE_ELEMENT_CHANGED_EVENT,n("change",e.closestTrackedAncestor))}))}function trackActionClick(e){var t=e.amplitude,r=e.allObservables,n=e.options,i=e.getEventProperties,a=e.shouldTrackEvent,o=e.shouldTrackActionClick,s=r.clickObservable,l=r.mutationObservable,c=r.navigateObservable,d=s.filter((function(e){return!a("click",e.closestTrackedAncestor)})).map((function(e){var t=getClosestElement(e.event.target,n.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e})).filter(filterOutNonTrackableEvents).filter((function(e){return o("click",e.closestTrackedAncestor)})),u=c?merge$1(l,c):l,p=merge$1(d,u),h=null,f=null;return asyncMap(p,(function(e){if(h&&(clearTimeout(h),h=null),"click"===e.type)return f=e,h=setTimeout((function(){h=null,f=null}),500),Promise.resolve(null);if(f){var t=f;return f=null,Promise.resolve(t)}return Promise.resolve(null)})).subscribe((function(e){e&&(null==t||t.track(AMPLITUDE_ELEMENT_CLICKED_EVENT,i("click",e.closestTrackedAncestor)))}))}function trackScroll(e){var t=e.allObservables.scrollObservable,r={maxX:0,maxY:0},n=t.subscribe((function(){var e,t,n,i,a=getGlobalScope$1(),o=Math.floor(null!==(t=null!==(e=null==a?void 0:a.scrollX)&&void 0!==e?e:null==a?void 0:a.pageXOffset)&&void 0!==t?t:0),s=Math.floor(null!==(i=null!==(n=null==a?void 0:a.scrollY)&&void 0!==n?n:null==a?void 0:a.pageYOffset)&&void 0!==i?i:0);r.maxX=Math.max(r.maxX,o),r.maxY=Math.max(r.maxY,s)}));return{unsubscribe:function(){n.unsubscribe()},getState:function(){return r},reset:function(){r.maxX=0,r.maxY=0}}}var globalScope=getGlobalScope$1(),createMutationObservable=function(){return new Observable((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()}}))},createClickObservable=function(e){return void 0===e&&(e="click"),new Observable((function(t){var r,n=function(e){t.next(e)};return null===(r=getGlobalScope$1())||void 0===r||r.document.addEventListener(e,n,{capture:!0}),function(){var t;null===(t=getGlobalScope$1())||void 0===t||t.document.removeEventListener(e,n,{capture:!0})}}))},createScrollObservable=function(){return new Observable((function(e){var t,r=function(t){e.next(t)};return null===(t=getGlobalScope$1())||void 0===t||t.addEventListener("scroll",r),function(){var e;null===(e=getGlobalScope$1())||void 0===e||e.removeEventListener("scroll",r)}}))},createConsoleErrorObservable=function(){return new Observable((function(e){var t=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=void 0;Array.isArray(r[0])&&"string"==typeof r[0][0]&&(i=r[0][0]),e.next({kind:"console",message:i})};return consoleObserver.addListener("error",t),function(){consoleObserver.removeListener(t)}}))},createExposureObservable=function(e,t){return new Observable((function(r){var n,i=getGlobalScope$1();if(!(null==i?void 0:i.IntersectionObserver))return function(){};var a=new IntersectionObserver((function(e){e.forEach((function(e){r.next(e)}))}),{root:null,rootMargin:"0px",threshold:1}),o=t.join(",");(null!==(n=null==i?void 0:i.document.querySelectorAll(o))&&void 0!==n?n:[]).forEach((function(e){a.observe(e)}));var s=e.subscribe((function(e){return e.event.forEach((function(e){return e.addedNodes.forEach((function(e){e instanceof Element&&(e.matches(o)&&a.observe(e),e.querySelectorAll(o).forEach((function(e){a.observe(e)})))}))}))}));return function(){s.unsubscribe(),a.disconnect()}}))},createUnhandledErrorObservable=function(){return new Observable((function(e){var t=function(t){if(t instanceof ErrorEvent){var r={kind:"error"};t.error instanceof Error||t.error instanceof DOMException?r=__assign$1(__assign$1({},r),{message:t.error.message,stack:t.error.stack,filename:t.filename,lineNumber:t.lineno,columnNumber:t.colno}):"string"==typeof t.error&&(r.message=t.error),e.next(r)}};return globalScope.addEventListener("error",t),function(){globalScope.removeEventListener("error",t)}}))},createUnhandledRejectionObservable=function(){return new Observable((function(e){var t=function(t){var r={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(r.message=t.reason.message,r.stack=t.reason.stack):"string"==typeof t.reason&&(r.message=t.reason),e.next(r)};return globalScope.addEventListener("unhandledrejection",t),function(){globalScope.removeEventListener("unhandledrejection",t)}}))},createErrorObservable=function(){var e=merge$1(createUnhandledErrorObservable(),createUnhandledRejectionObservable());return merge$1(e,createConsoleErrorObservable())},createMouseMoveObservable=function(){return new Observable((function(e){var t=function(t){e.next(t)},r={capture:!0};return globalScope.document.addEventListener("mousemove",t,r),function(){globalScope.document.removeEventListener("mousemove",t,r)}}))},matchEventToFilter=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},getDataSource=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var r=document.documentElement;return e.scope&&t&&(r=t.closest(e.scope)),r&&e.selector?r.querySelector(e.selector):r}}catch(e){return}},executeActions=function(e,t,r){e.forEach((function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var n=r.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=n}}))},eventTypeToBrowserEventMap={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},groupLabeledEventIdsByEventType=function(e){var t,r,n,i,a=Object.values(eventTypeToBrowserEventMap).reduce((function(e,t){return e[t]=new Set,e}),{});if(!e)return a;try{for(var o=__values$1(e),s=o.next();!s.done;s=o.next()){var l=s.value;try{try{for(var c=(n=void 0,__values$1(l.definition)),d=c.next();!d.done;d=c.next()){var u=d.value,p=eventTypeToBrowserEventMap[u.event_type];p&&a[p].add(l.id)}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==l?void 0:l.id,e)}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return a},createLabeledEventToTriggerMap=function(e){var t,r,n,i,a=new Map;try{for(var o=__values$1(e),s=o.next();!s.done;s=o.next()){var l=s.value;try{for(var c=(n=void 0,__values$1(l.conditions)),d=c.next();!d.done;d=c.next()){var u=d.value;if("LABELED_EVENT"===u.type){var p=u.match.eventId,h=a.get(p);h||(h=[],a.set(p,h)),h.push(l)}}}catch(e){n={error:e}}finally{try{d&&!d.done&&(i=c.return)&&i.call(c)}finally{if(n)throw n.error}}}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return a},matchEventToLabeledEvents=function(e,t){return t.filter((function(t){return t.definition.some((function(t){return eventTypeToBrowserEventMap[t.event_type]===e.type&&t.filters.every((function(t){return matchEventToFilter(e,t)}))}))}))},matchLabeledEventsToTriggers=function(e,t){var r,n,i,a,o=new Set;try{for(var s=__values$1(e),l=s.next();!l.done;l=s.next()){var c=l.value,d=t.get(c.id);if(d)try{for(var u=(i=void 0,__values$1(d)),p=u.next();!p.done;p=u.next()){var h=p.value;o.add(h)}}catch(e){i={error:e}}finally{try{p&&!p.done&&(a=u.return)&&a.call(u)}finally{if(i)throw i.error}}}}catch(e){r={error:e}}finally{try{l&&!l.done&&(n=s.return)&&n.call(s)}finally{if(r)throw r.error}}return Array.from(o)},TriggerEvaluator=function(){function e(e,t,r,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=r,this.options=n}return e.prototype.evaluate=function(e){var t,r,n=this.options.pageActions;if(!n)return e;var i=matchEventToLabeledEvents(e,Array.from(this.groupedLabeledEvents[e.type]).map((function(e){return n.labeledEvents[e]}))),a=matchLabeledEventsToTriggers(i,this.labeledEventToTriggerMap);try{for(var o=__values$1(a),s=o.next();!s.done;s=o.next()){var l=s.value;executeActions(l.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=r},e}(),createTriggerEvaluator=function(e,t,r,n){return new TriggerEvaluator(e,t,r,n)},BLOCKED_ATTRIBUTES=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",DATA_AMP_MASK_ATTRIBUTES,TEXT_MASK_ATTRIBUTE]),SENSITIVE_ELEMENT_ATTRIBUTE_ALLOWLIST=["type"],SVG_TAGS=["svg","path","g"],HIGHLY_SENSITIVE_INPUT_TYPES=["password","hidden"];function getElementProperties(e,t){var r,n,i,a,o,s;if(null===e)return null;var l=String(e.tagName).toLowerCase(),c={tag:l},d=Array.from(null!==(a=null===(i=e.parentElement)||void 0===i?void 0:i.children)&&void 0!==a?a:[]);d.length&&(c.index=d.indexOf(e),c.indexOfType=d.filter((function(t){return t.tagName===e.tagName})).indexOf(e));var u=null===(s=null===(o=e.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===s?void 0:s.toLowerCase();u&&(c.prevSib=String(u));var p=e.getAttribute("id");p&&(c.id=String(p));var h=Array.from(e.classList);h.length&&(c.classes=h);var f={},m=Array.from(e.attributes).filter((function(e){return!BLOCKED_ATTRIBUTES.has(e.name)})),g=!isNonSensitiveElement(e);if(!HIGHLY_SENSITIVE_INPUT_TYPES.includes(String(e.getAttribute("type")))&&!SVG_TAGS.includes(l))try{for(var v=__values$1(m),y=v.next();!y.done;y=v.next()){var b=y.value;g&&!SENSITIVE_ELEMENT_ATTRIBUTE_ALLOWLIST.includes(b.name)||(t.has(b.name)?f[b.name]=MASKED_TEXT_VALUE:f[b.name]=String(b.value).substring(0,MAX_ATTRIBUTE_LENGTH))}}catch(e){r={error:e}}finally{try{y&&!y.done&&(n=v.return)&&n.call(v)}finally{if(r)throw r.error}}return Object.keys(f).length&&(c.attrs=f),c}function getAncestors(e){var t=[];if(!e)return t;t.push(e);for(var r=e.parentElement;r&&"HTML"!==r.tagName;)t.push(r),r=r.parentElement;return t}var Step=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),cssPath=function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var r=[],n=e;n;){var i=cssPathStep(n,Boolean(t),n===e);if(!i)break;if(r.push(i),i.optimized)break;n=n.parentElement}return r.reverse(),r.join(" > ")},cssPathStep=function(e,t,r){var n,i;if(e.nodeType!==Node.ELEMENT_NODE)return null;var a=e.getAttribute("id");if(t){if(a)return new Step(d(a),!0);var o=e.tagName.toLowerCase();if("body"===o||"head"===o||"html"===o)return new Step(o,!0)}var s=e.tagName.toLowerCase();if(a)return new Step(s+d(a),!0);var l=e.parentNode;if(!l||l.nodeType===Node.DOCUMENT_NODE)return new Step(s,!0);function c(e){var t=e.getAttribute("class");return t?t.split(/\s+/g).filter(Boolean).map((function(e){return"$"+e})):[]}function d(e){return"#"+CSS.escape(e)}for(var u=c(e),p=!1,h=!1,f=-1,m=-1,g=l.children,v=0;g&&(-1===f||!h)&&v<g.length;++v){var y=g[v];if(y.nodeType===Node.ELEMENT_NODE)if(m+=1,y!==e){if(!h&&y.tagName.toLowerCase()===s){p=!0;var b=new Set(u);if(b.size)for(var E=c(y),_=0;_<E.length;++_){var S=E[_];if(b.has(S)&&(b.delete(S),!b.size)){h=!0;break}}else h=!0}}else f=m}var T=s;if(r&&"input"===s.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(T+="[type="+CSS.escape(e.getAttribute("type")||"")+"]"),h)T+=":nth-child("+String(f+1)+")";else if(p)try{for(var x=__values$1(u),k=x.next();!k.done;k=x.next()){var A=k.value;T+="."+CSS.escape(A.slice(1))}}catch(e){n={error:e}}finally{try{k&&!k.done&&(i=x.return)&&i.call(x)}finally{if(n)throw n.error}}return new Step(T,!1)},DataExtractor=function(e,t){var r,n,i,a=this;this.replaceSensitiveString=function(e){return replaceSensitiveString(e,a.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,r,n,i,o,s=performance.now();if(!e)return[];for(var l=getAncestors(e),c=new Map,d=l.length-1;d>=0;d--){var u=l[d];if(u){var p=parseAttributesToMask(u.getAttribute(DATA_AMP_MASK_ATTRIBUTES)),h=d===l.length-1?[]:null!==(n=c.get(l[d+1]))&&void 0!==n?n:new Set,f=new Set(__spreadArray(__spreadArray([],__read$1(h),!1),__read$1(p),!1));c.set(u,f)}}o=l.map((function(e){var t;return getElementProperties(e,null!==(t=c.get(e))&&void 0!==t?t:new Set)}));var m=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach((function(t){var r=__read$1(t,2),n=r[0],i=r[1];e.attrs&&(e.attrs[n]=a.replaceSensitiveString(i))}))};try{for(var g=__values$1(o),v=g.next();!v.done;v=g.next())m(v.value)}catch(e){t={error:e}}finally{try{v&&!v.done&&(r=g.return)&&r.call(g)}finally{if(t)throw t.error}}var y=performance.now();return null===(i=a.diagnosticsClient)||void 0===i||i.recordHistogram("autocapturePlugin.getHierarchy",y-s),o},this.getNearestLabel=function(e){var t,r=e.parentElement;if(!r)return"";try{t=r.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?a.getText(t):a.getNearestLabel(r)},this.getElementPath=function(e){var t;if(!e)return"";var r=performance.now(),n=cssPath(e),i=performance.now();return null===(t=a.diagnosticsClient)||void 0===t||t.recordHistogram("autocapturePlugin.getElementPath",i-r),n},this.getEventProperties=function(e,t,r){var n,i,o,s,l=null===(o=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i),c="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},d=a.getHierarchy(t),u=null===(s=d[0])||void 0===s?void 0:s.attrs,p=a.getNearestLabel(t),h=extractPrefixedAttributes(null!=u?u:{},r),f=((n={})[AMPLITUDE_EVENT_PROP_ELEMENT_HIERARCHY]=d,n[AMPLITUDE_EVENT_PROP_ELEMENT_TAG]=l,n[AMPLITUDE_EVENT_PROP_ELEMENT_TEXT]=a.getText(t),n[AMPLITUDE_EVENT_PROP_ELEMENT_POSITION_LEFT]=null==c.left?null:Math.round(c.left),n[AMPLITUDE_EVENT_PROP_ELEMENT_POSITION_TOP]=null==c.top?null:Math.round(c.top),n[AMPLITUDE_EVENT_PROP_ELEMENT_ATTRIBUTES]=h,n[AMPLITUDE_EVENT_PROP_ELEMENT_PATH]=a.getElementPath(t),n[AMPLITUDE_EVENT_PROP_ELEMENT_PARENT_LABEL]=p,n[AMPLITUDE_EVENT_PROP_PAGE_URL]=getDecodeURI(window.location.href.split("?")[0]),n[AMPLITUDE_EVENT_PROP_PAGE_TITLE]=getPageTitle(a.replaceSensitiveString),n[AMPLITUDE_EVENT_PROP_VIEWPORT_HEIGHT]=window.innerHeight,n[AMPLITUDE_EVENT_PROP_VIEWPORT_WIDTH]=window.innerWidth,n),m=getCurrentPageViewId();if(m&&(f[AMPLITUDE_EVENT_PROP_PAGE_VIEW_ID]=m),f[AMPLITUDE_EVENT_PROP_ELEMENT_ID]=t.getAttribute("id")||"",f[AMPLITUDE_EVENT_PROP_ELEMENT_CLASS]=t.getAttribute("class"),f[AMPLITUDE_EVENT_PROP_ELEMENT_ARIA_LABEL]=null==u?void 0:u["aria-label"],"a"===l&&"click"===e&&t instanceof HTMLAnchorElement){var g=t.href.substring(0,MAX_ATTRIBUTE_LENGTH);f[AMPLITUDE_EVENT_PROP_ELEMENT_HREF]=a.replaceSensitiveString(g)}return removeEmptyProperties(f)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,r,n,i){void 0===i&&(i=!1);var o=a.addTypeAndTimestamp(e,t);if(isElementBasedEvent(o)&&null!==o.event.target){if(i&&isElementPointerCursor(o.event.target,o.type))return o.closestTrackedAncestor=o.event.target,o.targetElementProperties=a.getEventProperties(o.type,o.closestTrackedAncestor,n),o;var s=getClosestElement(o.event.target,r);return s&&(o.closestTrackedAncestor=s,o.targetElementProperties=a.getEventProperties(o.type,s,n)),o}return o},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var r=getDataSource(e,t);if(!r)return;return"TEXT"===e.elementExtractType?a.getText(r):"ATTRIBUTE"===e.elementExtractType&&e.attribute?r.getAttribute(e.attribute):void 0}},this.getTextWithMaskedDescendants=function(e){var t,r,n="[".concat(TEXT_MASK_ATTRIBUTE,"], [contenteditable]");if(!e.querySelector(n))return e.innerText;var i="",o=Array.from(e.childNodes);try{for(var s=__values$1(o),l=s.next();!l.done;l=s.next()){var c=l.value;c.nodeType!==Node.TEXT_NODE?c instanceof Element&&(c.hasAttribute(TEXT_MASK_ATTRIBUTE)||c.hasAttribute("contenteditable")?i+=MASKED_TEXT_VALUE:i+=a.getTextWithMaskedDescendants(c)):i+=c.textContent||""}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return i},this.getText=function(e){if(null!==e.closest("[".concat(TEXT_MASK_ATTRIBUTE,"]")))return MASKED_TEXT_VALUE;var t="";return t=e.querySelector("[".concat(TEXT_MASK_ATTRIBUTE,"], [contenteditable]"))?a.getTextWithMaskedDescendants(e):e.innerText||"",a.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){var t,r,n;if(!e)return{};var i=null===(n=null===(r=null==e?void 0:e.tagName)||void 0===r?void 0:r.toLowerCase)||void 0===n?void 0:n.call(r),o=((t={})[AMPLITUDE_EVENT_PROP_ELEMENT_TAG]=i,t[AMPLITUDE_EVENT_PROP_ELEMENT_TEXT]=a.getText(e),t[AMPLITUDE_EVENT_PROP_PAGE_URL]=window.location.href.split("?")[0],t);return removeEmptyProperties(o)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient;var o=null!==(i=e.maskTextRegex)&&void 0!==i?i:[],s=[];try{for(var l=__values$1(o),c=l.next();!c.done;c=l.next()){var d=c.value;if(s.length>=MAX_MASK_TEXT_PATTERNS)break;if(d instanceof RegExp)s.push(d);else if("pattern"in d&&"string"==typeof d.pattern)try{s.push(new RegExp(d.pattern,"i"))}catch(e){}}}catch(e){r={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(r)throw r.error}}this.additionalMaskTextPatterns=s},ObservablesEnum$1;function trackExposure(e){var t=e.allObservables,r=e.onExposure,n=e.dataExtractor,i=e.exposureDuration,a=void 0===i?DEFAULT_EXPOSURE_DURATION:i,o=new Map,s=new Map,l=t.exposureObservable.subscribe((function(e){var t=e,i=t.target;if(t.isIntersecting){if(!o.get(i)){var l=setTimeout((function(){o.set(i,!0);var e=n.getElementPath(i);r(e),s.set(i,null)}),a);s.set(i,l)}}else if(!t.isIntersecting&&t.intersectionRatio<1){(l=s.get(i))&&(clearTimeout(l),s.set(i,null))}}));return{unsubscribe:function(){l.unsubscribe()},reset:function(){s.forEach((function(e){e&&clearTimeout(e)})),s.clear(),o.clear()}}}function fireViewportContentUpdated(e){var t,r,n,i,a=e.amplitude,o=e.scrollTracker,s=e.currentElementExposed,l=e.elementExposedForPage,c=e.exposureTracker,d=e.isPageEnd,u=e.lastScroll,p=o.getState(),h=getGlobalScope$1(),f=null!==(r=null==h?void 0:h.innerWidth)&&void 0!==r?r:0,m=null!==(n=null==h?void 0:h.innerHeight)&&void 0!==n?n:0,g=((t={})[AMPLITUDE_EVENT_PROP_PAGE_URL]=null===(i=null==h?void 0:h.location)||void 0===i?void 0:i.href,t[AMPLITUDE_EVENT_PROP_MAX_PAGE_X]=p.maxX+f,t[AMPLITUDE_EVENT_PROP_MAX_PAGE_Y]=p.maxY+m,t[AMPLITUDE_EVENT_PROP_VIEWPORT_HEIGHT]=m,t[AMPLITUDE_EVENT_PROP_VIEWPORT_WIDTH]=f,t["[Amplitude] Element Exposed"]=Array.from(s),t),v=getCurrentPageViewId();v&&(g[AMPLITUDE_EVENT_PROP_PAGE_VIEW_ID]=v),0!==s.size||p.maxX!==u.maxX||p.maxY!==u.maxY?(null==a||a.track("[Amplitude] Viewport Content Updated",g),u.maxX=p.maxX,u.maxY=p.maxY,s.clear(),d&&(o.reset(),l.clear(),null==c||c.reset())):d&&(o.reset(),l.clear(),null==c||c.reset())}function onExposure(e,t,r,n){if(!t.has(e)){t.add(e),r.add(e);var i=Array.from(r);JSON.stringify(i).length>=MAX_ELEMENT_EXPOSED_STR_LENGTH&&n(!1)}}!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.ScrollObservable="scrollObservable",e.ExposureObservable="exposureObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"}(ObservablesEnum$1||(ObservablesEnum$1={}));var autocapturePlugin=function(e,t){var r,n,i,a,o,s,l,c,d,u,p;void 0===e&&(e={}),null==t||t.diagnosticsClient.setTag("plugin.autocapture.version",VERSION);var h=e.dataAttributePrefix,f=void 0===h?DEFAULT_DATA_ATTRIBUTE_PREFIX:h,m=e.visualTaggingOptions,g=void 0===m?{enabled:!0}:m;e.cssSelectorAllowlist=null!==(r=e.cssSelectorAllowlist)&&void 0!==r?r:DEFAULT_CSS_SELECTOR_ALLOWLIST,e.actionClickAllowlist=null!==(n=e.actionClickAllowlist)&&void 0!==n?n:DEFAULT_ACTION_CLICK_ALLOWLIST,e.debounceTime=null!==(i=e.debounceTime)&&void 0!==i?i:0;var v=null!==(s=null!==(o=null===(a=e.viewportContentUpdated)||void 0===a?void 0:a.exposureDuration)&&void 0!==o?o:e.exposureDuration)&&void 0!==s?s:DEFAULT_EXPOSURE_DURATION;e.viewportContentUpdated=__assign$1(__assign$1({},e.viewportContentUpdated),{exposureDuration:v}),e.pageUrlExcludelist=null===(l=e.pageUrlExcludelist)||void 0===l?void 0:l.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(r){return console.warn("Invalid regex pattern: ".concat(t.pattern),r),e}return e}),[]);var y,b=PLUGIN_NAME$2,E=[],_=new DataExtractor(e,t),S=new Set,T=new Set,x=groupLabeledEventIdsByEventType(Object.values(null!==(d=null===(c=e.pageActions)||void 0===c?void 0:c.labeledEvents)&&void 0!==d?d:{})),k=createLabeledEventToTriggerMap(null!==(p=null===(u=e.pageActions)||void 0===u?void 0:u.triggers)&&void 0!==p?p:[]),A=createTriggerEvaluator(x,k,_,e);return{name:b,type:"enrichment",setup:function(t,r){return __awaiter(void 0,void 0,void 0,(function(){var n,i,a,o,s,l,c,d,u,p,h,m,I,C,P,w,D,R,L,O,N;return __generator(this,(function(M){return"undefined"==typeof document||(n=!1,i={maxX:void 0,maxY:void 0},t.fetchRemoteConfig&&(t.remoteConfigClient?t.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",(function(t){!function(t){var r,n;t&&(e.pageActions=__assign$1(__assign$1({},e.pageActions),t),x=groupLabeledEventIdsByEventType(Object.values(null!==(r=e.pageActions.labeledEvents)&&void 0!==r?r:{})),k=createLabeledEventToTriggerMap(null!==(n=e.pageActions.triggers)&&void 0!==n?n:[]),A.update(x,k,e))}(t)})):t.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),a=createShouldTrackEvent(e,e.cssSelectorAllowlist),o=createShouldTrackEvent(e,e.actionClickAllowlist),s=function(){var t,r,n=multicast(createClickObservable().map((function(t){return _.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,f)}))),i=multicast(new Observable((function(t){var r,n=function(r){var n=_.addAdditionalEventProperties(r,"change",e.cssSelectorAllowlist,f);t.next(n)};return null===(r=getGlobalScope$1())||void 0===r||r.document.addEventListener("change",n,{capture:!0}),function(){var e;return null===(e=getGlobalScope$1())||void 0===e?void 0:e.document.removeEventListener("change",n)}})));window.navigation&&(r=multicast(new Observable((function(t){var r=function(r){var n=_.addAdditionalEventProperties(r,"navigate",e.cssSelectorAllowlist,f);t.next(n)};return window.navigation.addEventListener("navigate",r),function(){window.navigation.removeEventListener("navigate",r)}}))));var a=multicast(createMutationObservable().map((function(t){return _.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,f)}))),o=createScrollObservable(),s=createExposureObservable(a,e.cssSelectorAllowlist);return(t={})[ObservablesEnum$1.ChangeObservable]=i,t[ObservablesEnum$1.ClickObservable]=n,t[ObservablesEnum$1.MutationObservable]=a,t[ObservablesEnum$1.NavigateObservable]=r,t[ObservablesEnum$1.ScrollObservable]=o,t[ObservablesEnum$1.ExposureObservable]=s,t}(),l=trackClicks({allObservables:s,amplitude:r,shouldTrackEvent:a,evaluateTriggers:A.evaluate.bind(A)}),E.push(l),c=trackChange({allObservables:s,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return _.getEventProperties.apply(_,__spreadArray(__spreadArray([],__read$1(e),!1),[f],!1))},amplitude:r,shouldTrackEvent:a,evaluateTriggers:A.evaluate.bind(A)}),E.push(c),d=trackActionClick({allObservables:s,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return _.getEventProperties.apply(_,__spreadArray(__spreadArray([],__read$1(e),!1),[f],!1))},amplitude:r,shouldTrackEvent:a,shouldTrackActionClick:o}),d&&E.push(d),u=trackScroll({allObservables:s}),E.push(u),p={},h=getGlobalScope$1(),m=function(e){e&&n||(setTimeout((function(){n=!1}),100),n=!0,fireViewportContentUpdated({amplitude:r,scrollTracker:u,currentElementExposed:T,elementExposedForPage:S,exposureTracker:p.exposure,isPageEnd:e,lastScroll:i}))},I=function(e){onExposure(e,S,T,m)},p.exposure=trackExposure({allObservables:s,onExposure:I,dataExtractor:_,exposureDuration:v}),p.exposure&&E.push(p.exposure),C=function(){m(!0)},null==h||h.addEventListener("beforeunload",C),y=function(){null==h||h.removeEventListener("beforeunload",C)},E.push({unsubscribe:function(){return y()}}),(P=s[ObservablesEnum$1.NavigateObservable])?E.push(P.subscribe((function(){m(!0)}))):h&&(w=function(){m(!0)},h.addEventListener("popstate",w),D=h.history.pushState,h.history&&D&&(h.history.pushState=new Proxy(D,{apply:function(e,t,r){var n=__read$1(r,3),i=n[0],a=n[1],o=n[2];e.apply(t,[i,a,o]),m(!0)}})),E.push({unsubscribe:function(){h.removeEventListener("popstate",w),h.history&&D&&(h.history.pushState=D)}})),null===(N=null==t?void 0:t.loggerProvider)||void 0===N||N.log("".concat(b," has been successfully added.")),window.opener&&g.enabled&&(R=e.cssSelectorAllowlist,L=e.actionClickAllowlist,enableVisualTagging(O=getOrCreateWindowMessenger(),{dataExtractor:_,isElementSelectable:createShouldTrackEvent(e,__spreadArray(__spreadArray([],__read$1(R),!1),__read$1(L),!1)),cssSelectorAllowlist:R,actionClickAllowlist:L}),enableBackgroundCapture(O),O.setup(__assign$1({logger:null==t?void 0:t.loggerProvider},(null==t?void 0:t.serverZone)&&{endpoint:AMPLITUDE_ORIGINS_MAP[t.serverZone]})))),[2]}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e]}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){var e,t,r,n;return __generator(this,(function(i){try{for(e=__values$1(E),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(n=e.return)&&n.call(e)}finally{if(r)throw r.error}}return[2]}))}))}}},DEAD_CLICK_TIMEOUT=3e3,CHANGE_EVENTS=["mutation","navigate"];function trackDeadClick(e){var t=e.amplitude,r=e.allObservables,n=e.getEventProperties,i=e.shouldTrackDeadClick,a=r.clickObservable,o=r.mutationObservable,s=r.navigateObservable,l=a.filter((function(e){return filterOutNonTrackableEvents(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===MouseButton.LEFT_OR_TOUCH_CONTACT})),c=s?merge$1(o,s):o,d=merge$1(l,c),u=null;return asyncMap(d,(function(e){return u&&CHANGE_EVENTS.includes(e.type)?(clearTimeout(u),u=null,Promise.resolve(null)):"click"===e.type?u?Promise.resolve(null):new Promise((function(t){u=setTimeout((function(){t(e),u=null}),DEAD_CLICK_TIMEOUT)})):Promise.resolve(null)})).subscribe((function(e){if(e){var r={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};t.track(AMPLITUDE_ELEMENT_DEAD_CLICKED_EVENT,__assign$1(__assign$1({},n("click",e.closestTrackedAncestor)),r),{time:e.timestamp})}}))}var RAGE_CLICK_THRESHOLD=DEFAULT_RAGE_CLICK_THRESHOLD,RAGE_CLICK_WINDOW_MS=DEFAULT_RAGE_CLICK_WINDOW_MS,RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD=DEFAULT_RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD;function addCoordinates(e,t){var r,n,i,a,o=t.event,s=o.pageX,l=o.pageY;e.yMin=Math.min(null!==(r=e.yMin)&&void 0!==r?r:l,l),e.yMax=Math.max(null!==(n=e.yMax)&&void 0!==n?n:l,l),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:s,s),e.xMax=Math.max(null!==(a=e.xMax)&&void 0!==a?a:s,s),e.isOutOfBounds=e.yMax-e.yMin>RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD||e.xMax-e.xMin>RAGE_CLICK_OUT_OF_BOUNDS_THRESHOLD}function getRageClickAnalyticsEvent(e){if(0===e.length)return null;var t=e[0],r=e[e.length-1];return{rageClickEvent:__assign$1({"[Amplitude] Begin Time":new Date(t.timestamp).toISOString(),"[Amplitude] End Time":new Date(r.timestamp).toISOString(),"[Amplitude] Duration":r.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 isClickOutsideRageClickWindow(e,t){var r=e[Math.max(0,e.length-RAGE_CLICK_THRESHOLD+1)];return t.timestamp-r.timestamp>=RAGE_CLICK_WINDOW_MS}function isNewElement(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}function trackRageClicks(e){var t=this,r=e.amplitude,n=e.allObservables,i=e.shouldTrackRageClick,a=n.clickObservable,o=n.selectionObservable,s=[],l={},c=null;function d(e){s=[],l={},e&&(addCoordinates(l,e),s.push(e))}var u=asyncMap(a.filter((function(e){return i("click",e.closestTrackedAncestor)})),(function(e){return __awaiter(t,void 0,void 0,(function(){var t;return __generator(this,(function(r){return addCoordinates(l,e),t=null,0===s.length||isNewElement(s,e)||isClickOutsideRageClickWindow(s,e)||l.isOutOfBounds?(c&&(t=getRageClickAnalyticsEvent(s)),d(e)):s.push(e),c&&(clearTimeout(c.timerId),c.resolve(t),c=null),s.length>=RAGE_CLICK_THRESHOLD?[2,new Promise((function(e){c={resolve:e,timerId:setTimeout((function(){e(getRageClickAnalyticsEvent(s))}),RAGE_CLICK_WINDOW_MS)}}))]:[2,null]}))}))})),p=null==o?void 0:o.subscribe((function(){d()})),h=u.subscribe((function(e){null!==e&&r.track(AMPLITUDE_ELEMENT_RAGE_CLICKED_EVENT,e.rageClickEvent,{time:e.time})}));return{unsubscribe:function(){h.unsubscribe(),null==p||p.unsubscribe()}}}var ERROR_CLICK_TIMEOUT=2e3,Direction,Axis;function trackErrorClicks(e){var t=e.amplitude,r=e.allObservables,n=e.shouldTrackErrorClick,i=r.clickObservable,a=r.browserErrorObservable,o=i.filter((function(e){return filterOutNonTrackableEvents(e)&&n("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===MouseButton.LEFT_OR_TOUCH_CONTACT})),s=null,l=null,c=function(){null!==s&&(clearTimeout(s),s=null),l=null};return merge$1(o,a).subscribe((function(e){var r;if("click"===e.type)return c(),l=e,void(s=setTimeout(c,ERROR_CLICK_TIMEOUT));"error"===e.type&&l&&(t.track(AMPLITUDE_ELEMENT_ERROR_CLICKED_EVENT,__assign$1(((r={})["[Amplitude] Kind"]=e.event.kind,r["[Amplitude] Message"]=e.event.message,r["[Amplitude] Stack"]=e.event.stack,r["[Amplitude] Filename"]=e.event.filename,r["[Amplitude] Line Number"]=e.event.lineNumber,r["[Amplitude] Column Number"]=e.event.columnNumber,r),l.targetElementProperties)),c())}))}!function(e){e.INCREASING="increasing",e.DECREASING="decreasing"}(Direction||(Direction={})),function(e){e.X="x",e.Y="y"}(Axis||(Axis={}));var createMouseDirectionChangeObservable=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new Observable((function(e){var r=null,n=null,i=null;return t.subscribe((function(t){var a={x:t.clientX,y:t.clientY};null!==r?(a.x>r.x?(n===Direction.DECREASING&&e.next(Axis.X),n=Direction.INCREASING):a.x<r.x&&(n===Direction.INCREASING&&e.next(Axis.X),n=Direction.DECREASING),a.y>r.y?(i===Direction.DECREASING&&e.next(Axis.Y),i=Direction.INCREASING):a.y<r.y&&(i===Direction.INCREASING&&e.next(Axis.Y),i=Direction.DECREASING),r=a):r=a}))}))};function addDirectionChange(e){var t=+Date.now();e.startTime=e.startTime||t;var r=e.changes,n=e.changesThreshold;r.push(t),r.length>n&&r.shift()}function isThrashedCursor(e){var t=e.changes,r=e.changesThreshold,n=e.thresholdMs;return!(t.length<r)&&t[t.length-1]-t[0]<n}function resetDirectionChangeSeries(e){e.changes=[],e.startTime=void 0}function adjustWindow(e){for(var t=e.changes,r=e.thresholdMs,n=0,i=t[t.length-1];n<t.length;n++){if(i-t[n]<r)break}0!==n&&(e.startTime=t[n],e.changes.splice(0,n))}function getPendingThrashedCursor(e,t){var r=void 0;if(isThrashedCursor(e)&&(r=e.startTime),isThrashedCursor(t)){var n=t.startTime;n&&(!r||n<r)&&(r=n)}return r}var DEFAULT_THRESHOLD=20,DEFAULT_WINDOW_MS=2e3,createThrashedCursorObservable=function(e){var t=e.mouseDirectionChangeObservable,r=e.directionChanges,n=void 0===r?DEFAULT_THRESHOLD:r,i=e.thresholdMs,a=void 0===i?DEFAULT_WINDOW_MS:i;return new Observable((function(e){var r={changes:[],changesThreshold:n,thresholdMs:a},i={changes:[],changesThreshold:n,thresholdMs:a},o=void 0,s=null;function l(){void 0!==o&&(e.next(o),o=void 0,null!==s&&clearTimeout(s),resetDirectionChangeSeries(r),resetDirectionChangeSeries(i))}return t.subscribe((function(e){null!==s&&clearTimeout(s),addDirectionChange(e===Axis.X?r:i);var t=getPendingThrashedCursor(r,i);return t?(o=o||t,s=setTimeout((function(){l(),s=null}),a)):l(),adjustWindow(r),adjustWindow(i),function(){null!==s&&(clearTimeout(s),s=null)}}))}))},trackThrashedCursor=function(e){var t=e.amplitude,r=e.options,n=e.allObservables,i=e.directionChanges,a=void 0===i?DEFAULT_THRESHOLD:i,o=e.thresholdMs,s=void 0===o?DEFAULT_WINDOW_MS:o,l=createMouseDirectionChangeObservable({allWindowObservables:n});return createThrashedCursorObservable({mouseDirectionChangeObservable:l,directionChanges:a,thresholdMs:s}).subscribe((function(e){isUrlAllowed(r)&&t.track(AMPLITUDE_THRASHED_CURSOR_EVENT,void 0,{time:e})}))};function getCssSelectorAllowlist(e,t,r,n){if(!n)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:r}var MINIMUM_THRASHED_CURSOR_DIRECTION_CHANGES=5,MAXIMUM_THRASHED_CURSOR_THRESHOLD=4e3,frustrationPlugin=function(e){var t;void 0===e&&(e={});var r=FRUSTRATION_PLUGIN_NAME,n=[],i=!1!==e.errorClicks;e.errorClicks||(i=!1);var a=!1!==e.deadClicks&&null!==e.deadClicks,o=!1!==e.rageClicks&&null!==e.rageClicks,s=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(s=!1);var l=getCssSelectorAllowlist(e,"rageClicks",DEFAULT_RAGE_CLICK_ALLOWLIST,o),c=getCssSelectorAllowlist(e,"deadClicks",DEFAULT_DEAD_CLICK_ALLOWLIST,a),d=getCssSelectorAllowlist(e,"errorClicks",DEFAULT_ERROR_CLICK_ALLOWLIST,i),u=null!==(t=e.dataAttributePrefix)&&void 0!==t?t:DEFAULT_DATA_ATTRIBUTE_PREFIX,p=new DataExtractor(e),h=__spreadArray([],__read$1(new Set(__spreadArray(__spreadArray(__spreadArray([],__read$1(l),!1),__read$1(c),!1),__read$1(d),!1))),!1);return{name:r,type:"enrichment",setup:function(t,f){return __awaiter(void 0,void 0,void 0,(function(){var m,g,v,y,b,E,_,S,T,x,k;return __generator(this,(function(A){return"undefined"==typeof document||(m=function(){var e,t,r=multicast(createClickObservable("pointerdown").map((function(e){return p.addAdditionalEventProperties(e,"click",h,u,!0)}))),n=multicast(createErrorObservable().map((function(e){return p.addTypeAndTimestamp(e,"error")}))),i=multicast(createMutationObservable().map((function(e){return p.addAdditionalEventProperties(e,"mutation",h,u)})));window.navigation&&(t=multicast(new Observable((function(e){var t=function(t){e.next(__assign$1(__assign$1({},t),{type:"navigate"}))};return window.navigation.addEventListener("navigate",t),function(){window.navigation.removeEventListener("navigate",t)}})).map((function(e){return p.addAdditionalEventProperties(e,"navigate",h,u)}))));var a=multicast(new Observable((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 r=window.getSelection();if(r&&!r.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}}))),o=multicast(createMouseMoveObservable());return(e={})[ObservablesEnum$1.ClickObservable]=r,e[ObservablesEnum$1.MutationObservable]=i,e[ObservablesEnum$1.NavigateObservable]=t,e[ObservablesEnum$1.BrowserErrorObservable]=n,e[ObservablesEnum$1.SelectionObservable]=a,e[ObservablesEnum$1.MouseMoveObservable]=o,e}(),o&&(g=createShouldTrackEvent(e,l),v=trackRageClicks({allObservables:m,amplitude:f,shouldTrackRageClick:g}),n.push(v)),a&&(y=createShouldTrackEvent(e,c),b=trackDeadClick({amplitude:f,allObservables:m,getEventProperties:function(e,t){return p.getEventProperties(e,t,u)},shouldTrackDeadClick:y}),n.push(b)),i&&(E=createShouldTrackEvent(e,d),_=trackErrorClicks({amplitude:f,allObservables:m,shouldTrackErrorClick:E}),n.push(_)),s&&(S=void 0,T=void 0,"object"==typeof e.thrashedCursor&&(S=e.thrashedCursor.directionChanges,T=e.thrashedCursor.threshold,S&&S<MINIMUM_THRASHED_CURSOR_DIRECTION_CHANGES&&(t.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(S," is below the minimum of ").concat(MINIMUM_THRASHED_CURSOR_DIRECTION_CHANGES,", setting to ").concat(MINIMUM_THRASHED_CURSOR_DIRECTION_CHANGES)),S=MINIMUM_THRASHED_CURSOR_DIRECTION_CHANGES),T&&T>MAXIMUM_THRASHED_CURSOR_THRESHOLD&&(t.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(T," is above the maximum of ").concat(MAXIMUM_THRASHED_CURSOR_THRESHOLD,", setting to ").concat(MAXIMUM_THRASHED_CURSOR_THRESHOLD)),T=MAXIMUM_THRASHED_CURSOR_THRESHOLD)),x=trackThrashedCursor({amplitude:f,options:e,allObservables:m,directionChanges:S,thresholdMs:T}),n.push(x)),null===(k=null==t?void 0:t.loggerProvider)||void 0===k||k.log("".concat(r," has been successfully added."))),[2]}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e]}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){var e,t,r,i;return __generator(this,(function(a){try{for(e=__values$1(n),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){r={error:e}}finally{try{t&&!t.done&&(i=e.return)&&i.call(e)}finally{if(r)throw r.error}}return[2]}))}))}}},PLUGIN_NAME$1="@amplitude/plugin-network-capture-browser",AMPLITUDE_NETWORK_REQUEST_EVENT="[Amplitude] Network Request",DEFAULT_STATUS_CODE_RANGE="500-599",ObservablesEnum,subscription;function wildcardMatch(e,t){var r="^"+t.replace(/[-[\]{}()+?.,\\^$|#\s]/g,"\\$&").replace(/\*/g,".*")+"$";return new RegExp(r).test(e)}function isStatusCodeInRange(e,t){var r,n,i=t.split(",");try{for(var a=__values$1(i),o=a.next();!o.done;o=a.next()){var s=__read$1(o.value.split("-").map(Number),2),l=s[0],c=s[1];if(e===l&&void 0===c)return!0;if(e>=l&&e<=c)return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(n=a.return)&&n.call(a)}finally{if(r)throw r.error}}return!1}function isCaptureRuleMatch(e,t,r,n,i){if((!e.hosts||e.hosts.find((function(e){return wildcardMatch(t,e)})))&&(!n||!e.urls||isUrlMatchAllowlist(n,e.urls))&&(!i||!e.methods||e.methods.find((function(e){return i.toLowerCase()===e.toLowerCase()||"*"===e})))){if(r||0===r)if(!isStatusCodeInRange(r,e.statusCodeRange||DEFAULT_STATUS_CODE_RANGE))return!1;return!0}}function parseUrl$1(e){var t;if(e)try{var r=null===(t=getGlobalScope$1())||void 0===t?void 0:t.location.href,n=new URL(e,r),i=n.searchParams.toString(),a=n.hash.replace("#",""),o=n.href,s=n.host;return n.hash="",n.search="",{query:i,fragment:a,href:o,hrefWithoutQueryOrHash:n.href,host:s}}catch(e){return}}function isAmplitudeNetworkRequestEvent(e,t){if(e.includes("amplitude.com"))try{var r=t.body;if("string"!=typeof r)return!1;if(JSON.parse(r).events.find((function(e){return e.event_type===AMPLITUDE_NETWORK_REQUEST_EVENT})))return!0}catch(e){}return!1}function parseHeaderCaptureRule(e){if("object"==typeof e&&null!==e){if(0!==e.length)return e}else{if(e)return __spreadArray([],__read$1(SAFE_HEADERS),!1);if(void 0===e){return}}}function isBodyCaptureRuleEmpty(e){var t,r;return!(null===(t=null==e?void 0:e.allowlist)||void 0===t?void 0:t.length)&&!(null===(r=null==e?void 0:e.blocklist)||void 0===r?void 0:r.length)}function shouldTrackNetworkEvent(e,t){var r;void 0===t&&(t={});var n=parseUrl$1(e.url);if(!n)return!1;var i,a=n.host;if(!1!==t.ignoreAmplitudeRequests&&(wildcardMatch(a,"*.amplitude.com")||wildcardMatch(a,"amplitude.com")))return!1;if(null===(r=t.ignoreHosts)||void 0===r?void 0:r.find((function(e){return wildcardMatch(a,e)})))return!1;if(!t.captureRules&&void 0!==e.status&&!isStatusCodeInRange(e.status,DEFAULT_STATUS_CODE_RANGE))return!1;if(t.captureRules&&(__spreadArray([],__read$1(t.captureRules),!1).reverse().find((function(t){if(i=isCaptureRuleMatch(t,a,e.status,e.url,e.method)){var r=parseHeaderCaptureRule(t.responseHeaders);if(e.responseWrapper&&r){var n=e.responseWrapper.headers(r);n&&(e.responseHeaders=n)}var o=parseHeaderCaptureRule(t.requestHeaders);if(e.requestWrapper&&o){var s=e.requestWrapper.headers(o);s&&(e.requestHeaders=s)}e.responseWrapper&&t.responseBody&&!isBodyCaptureRuleEmpty(t.responseBody)&&(e.responseBodyJson=e.responseWrapper.json(t.responseBody.allowlist,t.responseBody.blocklist)),e.requestWrapper&&t.requestBody&&!isBodyCaptureRuleEmpty(t.requestBody)&&(e.requestBodyJson=e.requestWrapper.json(t.requestBody.allowlist,t.requestBody.blocklist))}return void 0!==i})),!i))return!1;return!e.requestWrapper||!isAmplitudeNetworkRequestEvent(a,e.requestWrapper)}function logNetworkAnalyticsEvent(e,t,r,n){return __awaiter(this,void 0,void 0,(function(){var i,a,o;return __generator(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=__read$1.apply(void 0,[s.sent(),2]),a=i[0],o=i[1],a)try{e["[Amplitude] Request Body"]=JSON.stringify(a)}catch(e){null==n||n.debug("Failed to stringify request body",e)}if(o)try{e["[Amplitude] Response Body"]=JSON.stringify(o)}catch(e){null==n||n.debug("Failed to stringify response body")}s.label=2;case 2:return null==r||r.track(AMPLITUDE_NETWORK_REQUEST_EVENT,e),[2]}}))}))}function trackNetworkEvents(e){var t=e.allObservables,r=e.networkTrackingOptions,n=e.amplitude,i=e.loggerProvider;return t.networkObservable.filter((function(e){return shouldTrackNetworkEvent(e.event,r)})).subscribe((function(e){var t,r,a,o=e.event,s=parseUrl$1(o.url);if(s){var l=null===(r=o.responseWrapper)||void 0===r?void 0:r.bodySize,c=null===(a=o.requestWrapper)||void 0===a?void 0:a.bodySize;logNetworkAnalyticsEvent(((t={})["[Amplitude] URL"]=s.hrefWithoutQueryOrHash,t["[Amplitude] URL Query"]=s.query,t["[Amplitude] URL Fragment"]=s.fragment,t["[Amplitude] Request Method"]=o.method,t["[Amplitude] Status Code"]=o.status,t["[Amplitude] Start Time"]=o.startTime,t["[Amplitude] Completion Time"]=o.endTime,t["[Amplitude] Duration"]=o.duration,t["[Amplitude] Request Body Size"]=c,t["[Amplitude] Response Body Size"]=l,t["[Amplitude] Request Type"]=o.type,t["[Amplitude] Request Headers"]=o.requestHeaders,t["[Amplitude] Response Headers"]=o.responseHeaders,t),o,n,i)}}))}!function(e){e.NetworkObservable="networkObservable"}(ObservablesEnum||(ObservablesEnum={}));var networkCapturePlugin=function(e){void 0===e&&(e={});var t,r=PLUGIN_NAME$1,n=function(){var e,r=new Observable((function(e){var r=new NetworkEventCallback((function(t){var r=function(e,t){return{event:e,timestamp:Date.now(),type:t}}(t,"network");e.next(r)}));return networkObserver.subscribe(r,t),function(){networkObserver.unsubscribe(r)}}));return(e={})[ObservablesEnum.NetworkObservable]=r,e};return{name:r,type:"enrichment",setup:function(i,a){return __awaiter(void 0,void 0,void 0,(function(){var o;return __generator(this,(function(s){return"undefined"==typeof document||(o=n(),t=null==i?void 0:i.loggerProvider,subscription=trackNetworkEvents({allObservables:o,networkTrackingOptions:e,amplitude:a,loggerProvider:t}),null==t||t.log("".concat(r," has been successfully added."))),[2]}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e]}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return subscription.unsubscribe(),[2]}))}))}}},PLUGIN_NAME="web-vitals-browser",WEB_VITALS_EVENT_NAME="[Amplitude] Web Vitals";let e$8=-1;const t$4=e=>{addEventListener("pageshow",(t=>{t.persisted&&(e$8=t.timeStamp,e(t))}),!0)},n$7=(e,t,r,n)=>{let i,a;return o=>{t.value>=0&&(o||n)&&(a=t.value-(i??0),(a||void 0===i)&&(i=t.value,t.delta=a,t.rating=((e,t)=>e>t[1]?"poor":e>t[0]?"needs-improvement":"good")(t.value,r),e(t)))}},i$5=e=>{requestAnimationFrame((()=>requestAnimationFrame((()=>e()))))},s$5=()=>{const e=performance.getEntriesByType("navigation")[0];if(e&&e.responseStart>0&&e.responseStart<performance.now())return e},o$9=()=>{const e=s$5();return e?.activationStart??0},r$7=(e,t=-1)=>{const r=s$5();let n="navigate";return e$8>=0?n="back-forward-cache":r&&(document.prerendering||o$9()>0?n="prerender":document.wasDiscarded?n="restore":r.type&&(n=r.type.replace(/_/g,"-"))),{name:e,value:t,rating:"good",delta:0,entries:[],id:`v5-${Date.now()}-${Math.floor(8999999999999*Math.random())+1e12}`,navigationType:n}},c$4=new WeakMap;function a$3(e,t){return c$4.get(e)||c$4.set(e,new t),c$4.get(e)}let d$2=class{t;i=0;o=[];h(e){if(e.hadRecentInput)return;const t=this.o[0],r=this.o.at(-1);this.i&&t&&r&&e.startTime-r.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 h$7=(e,t,r={})=>{try{if(PerformanceObserver.supportedEntryTypes.includes(e)){const n=new PerformanceObserver((e=>{Promise.resolve().then((()=>{t(e.getEntries())}))}));return n.observe({type:e,buffered:!0,...r}),n}}catch{}},f$3=e=>{let t=!1;return()=>{t||(e(),t=!0)}};let u$3=-1;const l$3=new Set,m$1=()=>"hidden"!==document.visibilityState||document.prerendering?1/0:0,p$2=e=>{if("hidden"===document.visibilityState){if("visibilitychange"===e.type)for(const e of l$3)e();isFinite(u$3)||(u$3="visibilitychange"===e.type?e.timeStamp:0,removeEventListener("prerenderingchange",p$2,!0))}},v$4=()=>{if(u$3<0){const e=o$9(),t=document.prerendering?void 0:globalThis.performance.getEntriesByType("visibility-state").filter((t=>"hidden"===t.name&&t.startTime>e))[0]?.startTime;u$3=t??m$1(),addEventListener("visibilitychange",p$2,!0),addEventListener("prerenderingchange",p$2,!0),t$4((()=>{setTimeout((()=>{u$3=m$1()}))}))}return{get firstHiddenTime(){return u$3},onHidden(e){l$3.add(e)}}},g$1=e=>{document.prerendering?addEventListener("prerenderingchange",(()=>e()),!0):e()},y$2=[1800,3e3],E$1=(e,t={})=>{g$1((()=>{const r=v$4();let n,i=r$7("FCP");const a=h$7("paint",(e=>{for(const t of e)"first-contentful-paint"===t.name&&(a.disconnect(),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-o$9(),0),i.entries.push(t),n(!0)))}));a&&(n=n$7(e,i,y$2,t.reportAllChanges),t$4((r=>{i=r$7("FCP"),n=n$7(e,i,y$2,t.reportAllChanges),i$5((()=>{i.value=performance.now()-r.timeStamp,n(!0)}))})))}))},b$2=[.1,.25],L$1=(e,t={})=>{const r=v$4();E$1(f$3((()=>{let n,i=r$7("CLS",0);const a=a$3(t,d$2),o=e=>{for(const t of e)a.h(t);a.i>i.value&&(i.value=a.i,i.entries=a.o,n())},s=h$7("layout-shift",o);s&&(n=n$7(e,i,b$2,t.reportAllChanges),r.onHidden((()=>{o(s.takeRecords()),n(!0)})),t$4((()=>{a.i=0,i=r$7("CLS",0),n=n$7(e,i,b$2,t.reportAllChanges),i$5((()=>n()))})),setTimeout(n))})))};let P$1=0,T=1/0,_$1=0;const M$1=e=>{for(const t of e)t.interactionId&&(T=Math.min(T,t.interactionId),_$1=Math.max(_$1,t.interactionId),P$1=_$1?(_$1-T)/7+1:0)};let w$4;const C$1=()=>w$4?P$1:performance.interactionCount??0,I$1=()=>{"interactionCount"in performance||w$4||(w$4=h$7("event",M$1,{type:"event",buffered:!0,durationThreshold:0}))};let F=0,k$1=class{u=[];l=new Map;m;p;v(){F=C$1(),this.u.length=0,this.l.clear()}L(){const e=Math.min(this.u.length-1,Math.floor((C$1()-F)/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 r=this.l.get(e.interactionId);if(r||this.u.length<10||e.duration>t.P){if(r?e.duration>r.P?(r.entries=[e],r.P=e.duration):e.duration===r.P&&e.startTime===r.entries[0].startTime&&r.entries.push(e):(r={id:e.interactionId,entries:[e],P:e.duration},this.l.set(r.id,r),this.u.push(r)),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?.(r)}}};const A$1=e=>{const t=globalThis.requestIdleCallback||setTimeout;"hidden"===document.visibilityState?e():(e=f$3(e),addEventListener("visibilitychange",e,{once:!0,capture:!0}),t((()=>{e(),removeEventListener("visibilitychange",e,{capture:!0})})))},B$1=[200,500],S$2=(e,t={})=>{if(!globalThis.PerformanceEventTiming||!("interactionId"in PerformanceEventTiming.prototype))return;const r=v$4();g$1((()=>{I$1();let n,i=r$7("INP");const a=a$3(t,k$1),o=e=>{A$1((()=>{for(const t of e)a.h(t);const t=a.L();t&&t.P!==i.value&&(i.value=t.P,i.entries=t.entries,n())}))},s=h$7("event",o,{durationThreshold:t.durationThreshold??40});n=n$7(e,i,B$1,t.reportAllChanges),s&&(s.observe({type:"first-input",buffered:!0}),r.onHidden((()=>{o(s.takeRecords()),n(!0)})),t$4((()=>{a.v(),i=r$7("INP"),n=n$7(e,i,B$1,t.reportAllChanges)})))}))};let N$1=class{m;h(e){this.m?.(e)}};const q=[2500,4e3],x$1=(e,t={})=>{g$1((()=>{const r=v$4();let n,i=r$7("LCP");const a=a$3(t,N$1),o=e=>{t.reportAllChanges||(e=e.slice(-1));for(const t of e)a.h(t),t.startTime<r.firstHiddenTime&&(i.value=Math.max(t.startTime-o$9(),0),i.entries=[t],n())},s=h$7("largest-contentful-paint",o);if(s){n=n$7(e,i,q,t.reportAllChanges);const r=f$3((()=>{o(s.takeRecords()),s.disconnect(),n(!0)})),a=e=>{e.isTrusted&&(A$1(r),removeEventListener(e.type,a,{capture:!0}))};for(const e of["keydown","click","visibilitychange"])addEventListener(e,a,{capture:!0});t$4((r=>{i=r$7("LCP"),n=n$7(e,i,q,t.reportAllChanges),i$5((()=>{i.value=performance.now()-r.timeStamp,n(!0)}))}))}}))},H$1=[800,1800],O=e=>{document.prerendering?g$1((()=>O(e))):"complete"!==document.readyState?addEventListener("load",(()=>O(e)),!0):setTimeout(e)},$$1=(e,t={})=>{let r=r$7("TTFB"),n=n$7(e,r,H$1,t.reportAllChanges);O((()=>{const i=s$5();i&&(r.value=Math.max(i.responseStart-o$9(),0),r.entries=[i],n(!0),t$4((()=>{r=r$7("TTFB",0),n=n$7(e,r,H$1,t.reportAllChanges),n(!0)})))}))};function getMetricStartTime(e){var t,r=(null===(t=e.entries[0])||void 0===t?void 0:t.startTime)||0;return performance.timeOrigin+r}function processMetric(e){return{value:e.value,rating:e.rating,delta:e.delta,navigationType:e.navigationType,id:e.id,timestamp:Math.floor(getMetricStartTime(e)),navigationStart:Math.floor(performance.timeOrigin)}}var webVitalsPlugin=function(){var e=null,t=getGlobalScope$1(),r=null==t?void 0:t.document,n=null==t?void 0:t.location;return{name:PLUGIN_NAME,type:"enrichment",setup:function(t,i){return __awaiter(void 0,void 0,void 0,(function(){var a,o;return __generator(this,(function(s){return void 0===r||(a=getDecodeURI((null==n?void 0:n.href)||"",t.loggerProvider),o={"[Amplitude] Page Domain":(null==n?void 0:n.hostname)||"","[Amplitude] Page Location":a,"[Amplitude] Page Path":getDecodeURI((null==n?void 0:n.pathname)||"",t.loggerProvider),"[Amplitude] Page Title":"undefined"!=typeof document&&document.title||"","[Amplitude] Page URL":getDecodeURI(a.split("?")[0],t.loggerProvider)},x$1((function(e){o["[Amplitude] LCP"]=processMetric(e)})),E$1((function(e){o["[Amplitude] FCP"]=processMetric(e)})),S$2((function(e){o["[Amplitude] INP"]=processMetric(e)})),L$1((function(e){o["[Amplitude] CLS"]=processMetric(e)})),$$1((function(e){o["[Amplitude] TTFB"]=processMetric(e)})),e=function(){"hidden"===r.visibilityState&&e&&(i.track(WEB_VITALS_EVENT_NAME,o),r.removeEventListener("visibilitychange",e),e=null)},r.addEventListener("visibilitychange",e)),[2]}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return[2,e]}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(t){return e&&(null==r||r.removeEventListener("visibilitychange",e)),[2]}))}))}}},WebAttribution=function(){function e(e,t){var r;this.shouldTrackNewCampaign=!1,this.options=__assign$1({initialEmptyValue:"EMPTY",resetSessionOnNewCampaign:!1,excludeReferrers:getDefaultExcludedReferrers((null===(r=t.cookieOptions)||void 0===r?void 0:r.domain)||t.topLevelDomain),optOut:t.optOut},e),this.storage=t.cookieStorage,this.storageKey=getStorageKey(t.apiKey,"MKTG"),this.webExpStorageKey=getStorageKey(t.apiKey,"MKTG_ORIGINAL"),this.currentCampaign=BASE_CAMPAIGN,this.sessionTimeout=t.sessionTimeout,this.lastEventTime=t.lastEventTime,this.logger=t.loggerProvider,this.topLevelDomain=t.topLevelDomain,t.loggerProvider.log("Installing web attribution tracking.")}return e.prototype.init=function(){return __awaiter(this,void 0,void 0,(function(){var e,t;return __generator(this,(function(r){switch(r.label){case 0:return this.options.optOut?[2]:[4,this.fetchCampaign()];case 1:return t=__read$1.apply(void 0,[r.sent(),2]),this.currentCampaign=t[0],this.previousCampaign=t[1],e=!this.lastEventTime||isNewSession(this.sessionTimeout,this.lastEventTime),isNewCampaign(this.currentCampaign,this.previousCampaign,this.options,this.logger,e,this.topLevelDomain)?(this.shouldTrackNewCampaign=!0,[4,this.storage.set(this.storageKey,this.currentCampaign)]):[3,3];case 2:r.sent(),r.label=3;case 3:return[2]}}))}))},e.prototype.fetchCampaign=function(){return __awaiter(this,void 0,void 0,(function(){var e;return __generator(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 CampaignParser).parse(),this.storage.get(this.storageKey)])];case 4:return[2,t.sent()]}}))}))},e.prototype.generateCampaignEvent=function(e){this.shouldTrackNewCampaign=!1;var t=createCampaignEvent(this.currentCampaign,this.options);return e&&(t.event_id=e),t},e.prototype.shouldSetSessionIdOnNewCampaign=function(){return this.shouldTrackNewCampaign&&!!this.options.resetSessionOnNewCampaign},e}(),CURRENT_PAGE_STORAGE_KEY="AMP_CURRENT_PAGE",PREVIOUS_PAGE_STORAGE_KEY="AMP_PREVIOUS_PAGE",URL_INFO_STORAGE_KEY="AMP_URL_INFO",PreviousPageType;!function(e){e.Direct="direct",e.Internal="internal",e.External="external"}(PreviousPageType||(PreviousPageType={}));var EXCLUDED_DEFAULT_EVENT_TYPES=new Set([SpecialEventType.IDENTIFY,SpecialEventType.GROUP_IDENTIFY,SpecialEventType.REVENUE]),pageUrlEnrichmentPlugin=function(e){var t={}.internalDomains,r=void 0===t?[]:t,n=getGlobalScope$1(),i=void 0,a=!1,o=void 0,s=!1,l=!1,c=function(e){var t="undefined"!=typeof location&&location.hostname||"",n=e?function(e){var t;try{var r=getDecodeURI(e,o);t=new URL(r).hostname}catch(e){null==o||o.error("Could not parse URL: ",e)}return t}(e):void 0;if(!n)return PreviousPageType.Direct;var i=r.some((function(e){return-1!==t.indexOf(e)})),a=r.some((function(e){return-1!==n.indexOf(e)}));return t===n||a&&i?PreviousPageType.Internal:PreviousPageType.External},d=function(){__awaiter(void 0,void 0,void 0,(function(){var e,t,r,n,o;return __generator(this,(function(s){switch(s.label){case 0:return i&&a?[4,i.get(URL_INFO_STORAGE_KEY)]:[3,3];case 1:return e=s.sent(),t=getDecodeURI("undefined"!=typeof location&&location.href||""),r=(null==e?void 0:e[CURRENT_PAGE_STORAGE_KEY])||"",n=void 0,n=t===r?(null==e?void 0:e[PREVIOUS_PAGE_STORAGE_KEY])||"":r||document.referrer||"",[4,i.set(URL_INFO_STORAGE_KEY,(o={},o[CURRENT_PAGE_STORAGE_KEY]=t,o[PREVIOUS_PAGE_STORAGE_KEY]=n,o))];case 2:s.sent(),s.label=3;case 3:return[2]}}))}))},u={name:"@amplitude/plugin-page-url-enrichment-browser",type:"enrichment",setup:function(e,t){return __awaiter(void 0,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:if((o=e.loggerProvider).log("Installing @amplitude/plugin-page-url-enrichment-browser"),l=!0,!n)return[3,2];try{i=new BrowserStorage(n.sessionStorage)}catch(e){null==o||o.debug("sessionStorage is not available in this environment.")}return[4,null==i?void 0:i.isEnabled()];case 1:a=null!==(t=r.sent())&&void 0!==t&&t,n.addEventListener("popstate",d),s||(n.history.pushState=new Proxy(n.history.pushState,{apply:function(e,t,r){var n=__read$1(r,3),i=n[0],a=n[1],o=n[2];e.apply(t,[i,a,o]),l&&d()}}),n.history.replaceState=new Proxy(n.history.replaceState,{apply:function(e,t,r){var n=__read$1(r,3),i=n[0],a=n[1],o=n[2];e.apply(t,[i,a,o]),l&&d()}}),s=!0),r.label=2;case 2:return[2]}}))}))},execute:function(e){return __awaiter(void 0,void 0,void 0,(function(){var t,r,n,o,s;return __generator(this,(function(l){switch(l.label){case 0:return t=getDecodeURI("undefined"!=typeof location&&location.href||""),i&&a?[4,i.get(URL_INFO_STORAGE_KEY)]:[3,5];case 1:return(null==(r=l.sent())?void 0:r[CURRENT_PAGE_STORAGE_KEY])?[3,3]:[4,i.set(URL_INFO_STORAGE_KEY,(s={},s[CURRENT_PAGE_STORAGE_KEY]=t,s[PREVIOUS_PAGE_STORAGE_KEY]=document.referrer||"",s))];case 2:l.sent(),l.label=3;case 3:return[4,i.get(URL_INFO_STORAGE_KEY)];case 4:if(n=l.sent(),o="",n&&(o=n[PREVIOUS_PAGE_STORAGE_KEY]||""),EXCLUDED_DEFAULT_EVENT_TYPES.has(e.event_type))return[2,e];e.event_properties=__assign$1(__assign$1({},e.event_properties||{}),{"[Amplitude] Page Domain":addIfNotExist(e,"[Amplitude] Page Domain","undefined"!=typeof location&&location.hostname||""),"[Amplitude] Page Location":addIfNotExist(e,"[Amplitude] Page Location",t),"[Amplitude] Page Path":addIfNotExist(e,"[Amplitude] Page Path","undefined"!=typeof location&&getDecodeURI(location.pathname)||""),"[Amplitude] Page Title":addIfNotExist(e,"[Amplitude] Page Title",getPageTitle(replaceSensitiveString)),"[Amplitude] Page URL":addIfNotExist(e,"[Amplitude] Page URL",t.split("?")[0]),"[Amplitude] Previous Page Location":o,"[Amplitude] Previous Page Type":c(o)}),l.label=5;case 5:return[2,e]}}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){switch(e.label){case 0:return n&&(n.removeEventListener("popstate",d),l=!1),i&&a?[4,i.set(URL_INFO_STORAGE_KEY,{})]:[3,2];case 1:e.sent(),e.label=2;case 2:return[2]}}))}))}};return u};function addIfNotExist(e,t,r){return e.event_properties||(e.event_properties={}),void 0===e.event_properties[t]?r:e.event_properties[t]}var customEnrichmentPlugin=function(){var e,t,r;function n(t){if(t)try{var r=new Function("return "+t)();if("function"==typeof r)return r;null==e||e.error("Custom enrichment body did not evaluate to a function")}catch(t){null==e||e.error("Could not create custom enrichment function",t)}return function(e){return e}}var i={name:"@amplitude/plugin-custom-enrichment-browser",type:"enrichment",setup:function(i,a){return __awaiter(void 0,void 0,void 0,(function(){var a,o;return __generator(this,(function(s){return null==(e=i.loggerProvider)||e.log("Installing @amplitude/plugin-custom-enrichment-browser"),(null===(o=i.remoteConfig)||void 0===o?void 0:o.fetchRemoteConfig)&&(i.remoteConfigClient?(a=i.remoteConfigClient.subscribe("configs.analyticsSDK.browserSDK.customEnrichment","all",(function(e){r=e&&function(e){return"object"==typeof e&&null!==e&&"body"in e&&"string"==typeof e.body}(e)?n(e.body||""):n("")})),t=function(){var e;return null===(e=i.remoteConfigClient)||void 0===e?void 0:e.unsubscribe(a)}):null==e||e.debug("Remote config client is not provided, skipping remote config fetch")),[2]}))}))},execute:function(t){return __awaiter(void 0,void 0,void 0,(function(){var n;return __generator(this,(function(i){if(r)try{return[2,null!==(n=r(t))&&void 0!==n?n:null]}catch(r){return null==e||e.error("Could not execute custom enrichment function",r),[2,t]}return[2,t]}))}))},teardown:function(){return __awaiter(void 0,void 0,void 0,(function(){return __generator(this,(function(e){return t&&t(),[2]}))}))}};return i},UNSPECIFIED_SESSION_ID=-1,AmplitudeBrowser=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t._diagnosticsSampleRate=0,t._enableRequestBodyCompressionExperimentalValue=!1,t}return __extends(t,e),t.prototype.init=function(e,t,r){var n,i;return void 0===e&&(e=""),arguments.length>2?(n=t,i=r):"string"==typeof t?(n=t,i=void 0):(n=null==t?void 0:t.userId,i=t),returnWrapper(this._init(__assign$1(__assign$1({},i),{userId:n,apiKey:e})))},t.prototype._init=function(t){var r,n,i,a,o,s,l,c;return __awaiter(this,void 0,void 0,(function(){var d,u,p,h,f,m,g,v,y,b,E,_,S,T,x,k=this;return __generator(this,(function(A){switch(A.label){case 0:return this.initializing?[2]:(this.initializing=!0,d=shouldFetchRemoteConfig(t),u=null!==(r=t.loggerProvider)&&void 0!==r?r:new Logger,t.loggerProvider||u.enable(null!==(n=t.logLevel)&&void 0!==n?n:LogLevel.Warn),p=null!==(i=t.serverZone)&&void 0!==i?i:DEFAULT_SERVER_ZONE,f=this._diagnosticsSampleRate,m=null===(a=t.enableDiagnostics)||void 0===a||a,d?(h=new RemoteConfigClient(t.apiKey,u,p,null===(o=t.remoteConfig)||void 0===o?void 0:o.serverUrl),[4,new Promise((function(e){null==h||h.subscribe("configs.diagnostics.browserSDK","all",(function(t,r,n){if(u.debug("Diagnostics remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t){var i=t.sampleRate;"number"!=typeof i||isNaN(i)||(f=i);var a=t.enabled;"boolean"==typeof a&&(m=a)}e()}))}))]):[3,2]);case 1:A.sent(),A.label=2;case 2:return(g=new DiagnosticsClient(t.apiKey,u,p,{enabled:m,sampleRate:f})).setTag("library","".concat(LIBPREFIX,"/").concat(VERSION$1)),"undefined"!=typeof navigator&&g.setTag("user_agent",navigator.userAgent),[4,useBrowserConfig(t.apiKey,t,this,g,{loggerProvider:u,serverZone:p,enableDiagnostics:m,diagnosticsSampleRate:f})];case 3:return v=A.sent(),d&&h?[4,new Promise((function(e){null==h||h.subscribe("configs.analyticsSDK.browserSDK","all",(function(t,r,n){v.loggerProvider.debug("Remote configuration received:",JSON.stringify({remoteConfig:t,source:r,lastFetch:n},null,2)),t&&updateBrowserConfigWithRemoteConfig(t,v),e()}))}))]:[3,5];case 4:A.sent(),A.label=5;case 5:return[4,e.prototype._init.call(this,v)];case 6:return A.sent(),this.logBrowserOptions(v),this.config.remoteConfigClient=h,isAttributionTrackingEnabled(this.config.defaultTracking)?(this.config.optOut&&this.timeline.addOptOutListener((function(e){return __awaiter(k,void 0,void 0,(function(){var t;return __generator(this,(function(r){switch(r.label){case 0:return e?[3,2]:(t=getAttributionTrackingConfig(this.config),this.webAttribution=new WebAttribution(t,this.config),[4,this.webAttribution.init()]);case 1:r.sent(),r.label=2;case 2:return[2]}}))}))})),y=getAttributionTrackingConfig(this.config),this.webAttribution=new WebAttribution(y,this.config),[4,this.webAttribution.init()]):[3,8];case 7:A.sent(),A.label=8;case 8:return b=getQueryParams(),E=b.ampTimestamp?Number(b.ampTimestamp):void 0,_=!E||Date.now()<E,S=_&&!Number.isNaN(Number(b.ampSessionId))?Number(b.ampSessionId):void 0,(T=this.config.deferredSessionId)!==UNSPECIFIED_SESSION_ID||this.config.optOut||(T=Date.now()),this.setSessionId(null!==(c=null!==(l=null!==(s=t.sessionId)&&void 0!==s?s:S)&&void 0!==l?l:T)&&void 0!==c?c:this.config.sessionId),this.config.optOut&&this.timeline.addOptOutListener((function(e){return __awaiter(k,void 0,void 0,(function(){return __generator(this,(function(t){return!e&&this.config.deferredSessionId&&(this.config.deferredSessionId===UNSPECIFIED_SESSION_ID?this.setSessionId(void 0):this.setSessionId(this.config.deferredSessionId)),[2]}))}))})),(x=getAnalyticsConnector(t.instanceName)).identityStore.setIdentity({userId:this.config.userId,deviceId:this.config.deviceId}),this.config.offline===OfflineDisabled?[3,10]:[4,this.add(networkConnectivityCheckerPlugin()).promise];case 9:A.sent(),A.label=10;case 10:return[4,this.add(new Destination({diagnosticsClient:g})).promise];case 11:return A.sent(),[4,this.add(new Context).promise];case 12:return A.sent(),[4,this.add(new IdentityEventSender).promise];case 13:return A.sent(),detNotify(this.config),isFileDownloadTrackingEnabled(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding file download tracking plugin"),[4,this.add(fileDownloadTracking()).promise]):[3,15];case 14:A.sent(),A.label=15;case 15:return isFormInteractionTrackingEnabled(this.config.defaultTracking)?(this.config.loggerProvider.debug("Adding form interaction plugin"),[4,this.add(formInteractionTracking()).promise]):[3,17];case 16:A.sent(),A.label=17;case 17:return isPageViewTrackingEnabled(this.config.defaultTracking)?this.config.optOut?[3,19]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(pageViewTrackingPlugin(getPageViewTrackingConfig(this.config))).promise]):[3,20];case 18:return A.sent(),[3,20];case 19:this.timeline.addOptOutListener((function(e){return __awaiter(k,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return e?[2]:(this.config.loggerProvider.debug("Adding page view tracking plugin"),[4,this.add(pageViewTrackingPlugin(getPageViewTrackingConfig(this.config))).promise]);case 1:return t.sent(),[2]}}))}))})),A.label=20;case 20:return isElementInteractionsEnabled(this.config.autocapture)?(this.config.loggerProvider.debug("Adding user interactions plugin (autocapture plugin)"),[4,this.add(autocapturePlugin(getElementInteractionsConfig(this.config),{diagnosticsClient:g})).promise]):[3,22];case 21:A.sent(),A.label=22;case 22:return isFrustrationInteractionsEnabled(this.config.autocapture)?(this.config.loggerProvider.debug("Adding frustration interactions plugin"),[4,this.add(frustrationPlugin(getFrustrationInteractionsConfig(this.config))).promise]):[3,24];case 23:A.sent(),A.label=24;case 24:return isNetworkTrackingEnabled(this.config.autocapture)?(this.config.loggerProvider.debug("Adding network tracking plugin"),[4,this.add(networkCapturePlugin(getNetworkTrackingConfig(this.config))).promise]):[3,26];case 25:A.sent(),A.label=26;case 26:return isWebVitalsEnabled(this.config.autocapture)?(this.config.loggerProvider.debug("Adding web vitals plugin"),[4,this.add(webVitalsPlugin()).promise]):[3,28];case 27:A.sent(),A.label=28;case 28:return isPageUrlEnrichmentEnabled(this.config.autocapture)?(this.config.loggerProvider.debug("Adding referrer page url plugin"),[4,this.add(pageUrlEnrichmentPlugin()).promise]):[3,30];case 29:A.sent(),A.label=30;case 30:return isCustomEnrichmentEnabled(this.config.customEnrichment)?(this.config.loggerProvider.debug("Adding custom enrichment plugin"),[4,this.add(customEnrichmentPlugin()).promise]):[3,32];case 31:A.sent(),A.label=32;case 32:return this.initializing=!1,[4,this.runQueuedFunctions("dispatchQ")];case 33:return A.sent(),x.eventBridge.setEventReceiver((function(e){var t=e.eventProperties||{},r=t.time,n=__rest(t,["time"]),i="number"==typeof r?{time:r}:void 0;k.track(e.eventType,n,i)})),[2]}}))}))},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}),setConnectorUserId(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}),setConnectorDeviceId(e,this.config.instanceName))):this.q.push(this.setDeviceId.bind(this,e))},t.prototype.reset=function(){this.setDeviceId(UUID()),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,r,n;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 Identify,a=null!==(n=e.userProperties)&&void 0!==n?n:{};try{for(var o=__values$1(Object.entries(a)),s=o.next();!s.done;s=o.next()){var l=__read$1(s.value,2),c=l[0],d=l[1];i.set(c,d)}}catch(e){t={error:e}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}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,r=[];if(!this.config)return this.q.push(this.setSessionId.bind(this,e)),returnWrapper(Promise.resolve());if(this.config.optOut)return this.config.deferredSessionId=null!=e?e:UNSPECIFIED_SESSION_ID,returnWrapper(Promise.resolve());if(void 0===e&&(e=Date.now()),e===this.config.sessionId)return returnWrapper(Promise.resolve());this.config.loggerProvider.debug("function setSessionId: ",e);var n=this.getSessionId();n!==e&&this.timeline.onSessionIdChanged(e);var i=this.config.lastEventTime,a=null!==(t=this.config.lastEventId)&&void 0!==t?t:-1;this.config.sessionId=e,this.config.lastEventTime=void 0,this.config.pageCounter=0,isSessionTrackingEnabled(this.config.defaultTracking)&&(n&&i&&r.push(this.track(DEFAULT_SESSION_END_EVENT,void 0,{device_id:this.previousSessionDeviceId,event_id:++a,session_id:n,time:i+1,user_id:this.previousSessionUserId}).promise),this.config.lastEventTime=this.config.sessionId);var o=this.trackCampaignEventIfNeeded(++a,r);return this.config.identify&&r.push(this.track(createIdentifyEvent(this.config.identify)).promise),isSessionTrackingEnabled(this.config.defaultTracking)&&r.push(this.track(DEFAULT_SESSION_START_EVENT,void 0,{event_id:o?++a:a,session_id:this.config.sessionId,time:this.config.lastEventTime}).promise),this.previousSessionDeviceId=this.config.deviceId,this.previousSessionUserId=this.config.userId,returnWrapper(Promise.all(r))},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=createTransport$1(e):this.q.push(this.setTransport.bind(this,e))},t.prototype.identify=function(t,r){if(isInstanceProxy(t)){var n=t._q;t._q=[],t=convertProxyObjectToRealObject(new Identify,n)}return(null==r?void 0:r.user_id)&&this.setUserId(r.user_id),(null==r?void 0:r.device_id)&&this.setDeviceId(r.device_id),e.prototype.identify.call(this,t,r)},t.prototype.groupIdentify=function(t,r,n,i){if(isInstanceProxy(n)){var a=n._q;n._q=[],n=convertProxyObjectToRealObject(new Identify,a)}return e.prototype.groupIdentify.call(this,t,r,n,i)},t.prototype.revenue=function(t,r){if(isInstanceProxy(t)){var n=t._q;t._q=[],t=convertProxyObjectToRealObject(new Revenue,n)}return e.prototype.revenue.call(this,t,r)},t.prototype.trackCampaignEventIfNeeded=function(e,t){if(!this.webAttribution||!this.webAttribution.shouldTrackNewCampaign)return!1;var r=this.webAttribution.generateCampaignEvent(e);return t?t.push(this.track(r).promise):this.track(r),this.config.loggerProvider.log("Tracking attribution."),!0},t.prototype.process=function(t){return __awaiter(this,void 0,void 0,(function(){var r,n,i;return __generator(this,(function(a){return r=Date.now(),n=isNewSession(this.config.sessionTimeout,this.config.lastEventTime),i=this.webAttribution&&this.webAttribution.shouldSetSessionIdOnNewCampaign(),t.event_type===DEFAULT_SESSION_START_EVENT||t.event_type===DEFAULT_SESSION_END_EVENT||t.session_id&&t.session_id!==this.getSessionId()||(n||i?(this.setSessionId(r),i&&this.config.loggerProvider.log("Created a new session for new campaign.")):n||this.trackCampaignEventIfNeeded()),[2,e.prototype.process.call(this,t)]}))}))},t.prototype.logBrowserOptions=function(e){try{var t=__assign$1(__assign$1({},e),{apiKey:e.apiKey.substring(0,10)+"********"});this.config.loggerProvider.debug("Initialized Amplitude with BrowserConfig:",safeJsonStringify(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.prototype._enableRequestBodyCompressionExperimental=function(e){this.config||(this._enableRequestBodyCompressionExperimentalValue=e)},t}(AmplitudeCore),createInstance=function(){var e=new AmplitudeBrowser;return{init:debugWrapper(e.init.bind(e),"init",getClientLogConfig(e),getClientStates(e,["config"])),add:debugWrapper(e.add.bind(e),"add",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.plugins"])),remove:debugWrapper(e.remove.bind(e),"remove",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.plugins"])),track:debugWrapper(e.track.bind(e),"track",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),logEvent:debugWrapper(e.logEvent.bind(e),"logEvent",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),identify:debugWrapper(e.identify.bind(e),"identify",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),groupIdentify:debugWrapper(e.groupIdentify.bind(e),"groupIdentify",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),setGroup:debugWrapper(e.setGroup.bind(e),"setGroup",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),revenue:debugWrapper(e.revenue.bind(e),"revenue",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),flush:debugWrapper(e.flush.bind(e),"flush",getClientLogConfig(e),getClientStates(e,["config.apiKey","timeline.queue.length"])),getUserId:debugWrapper(e.getUserId.bind(e),"getUserId",getClientLogConfig(e),getClientStates(e,["config","config.userId"])),setUserId:debugWrapper(e.setUserId.bind(e),"setUserId",getClientLogConfig(e),getClientStates(e,["config","config.userId"])),getDeviceId:debugWrapper(e.getDeviceId.bind(e),"getDeviceId",getClientLogConfig(e),getClientStates(e,["config","config.deviceId"])),setDeviceId:debugWrapper(e.setDeviceId.bind(e),"setDeviceId",getClientLogConfig(e),getClientStates(e,["config","config.deviceId"])),reset:debugWrapper(e.reset.bind(e),"reset",getClientLogConfig(e),getClientStates(e,["config","config.userId","config.deviceId"])),getSessionId:debugWrapper(e.getSessionId.bind(e),"getSessionId",getClientLogConfig(e),getClientStates(e,["config"])),setSessionId:debugWrapper(e.setSessionId.bind(e),"setSessionId",getClientLogConfig(e),getClientStates(e,["config"])),extendSession:debugWrapper(e.extendSession.bind(e),"extendSession",getClientLogConfig(e),getClientStates(e,["config"])),setOptOut:debugWrapper(e.setOptOut.bind(e),"setOptOut",getClientLogConfig(e),getClientStates(e,["config"])),setTransport:debugWrapper(e.setTransport.bind(e),"setTransport",getClientLogConfig(e),getClientStates(e,["config"])),getIdentity:debugWrapper(e.getIdentity.bind(e),"getIdentity",getClientLogConfig(e),getClientStates(e,["config"])),setIdentity:debugWrapper(e.setIdentity.bind(e),"setIdentity",getClientLogConfig(e),getClientStates(e,["config","config.userId","config.deviceId"])),getOptOut:debugWrapper(e.getOptOut.bind(e),"getOptOut",getClientLogConfig(e),getClientStates(e,["config"])),_setDiagnosticsSampleRate:debugWrapper(e._setDiagnosticsSampleRate.bind(e),"_setDiagnosticsSampleRate",getClientLogConfig(e),getClientStates(e,["config"])),_enableRequestBodyCompressionExperimental:debugWrapper(e._enableRequestBodyCompressionExperimental.bind(e),"_enableRequestBodyCompressionExperimental",getClientLogConfig(e),getClientStates(e,["config"]))}},client=createInstance(),add=client.add,extendSession=client.extendSession,flush=client.flush,getDeviceId=client.getDeviceId,getIdentity=client.getIdentity,getOptOut=client.getOptOut,getSessionId=client.getSessionId,getUserId=client.getUserId,groupIdentify=client.groupIdentify,identify=client.identify,init$1=client.init,logEvent=client.logEvent,remove=client.remove,reset$1=client.reset,revenue=client.revenue,setDeviceId=client.setDeviceId,setGroup=client.setGroup,setIdentity=client.setIdentity,setOptOut=client.setOptOut,setSessionId=client.setSessionId,setTransport=client.setTransport,setUserId=client.setUserId,track=client.track,_setDiagnosticsSampleRate=client._setDiagnosticsSampleRate,_enableRequestBodyCompressionExperimental=client._enableRequestBodyCompressionExperimental,amplitude=Object.freeze({__proto__:null,AmplitudeBrowser:AmplitudeBrowser,Identify:Identify,Revenue:Revenue,Types:types,_enableRequestBodyCompressionExperimental:_enableRequestBodyCompressionExperimental,_setDiagnosticsSampleRate:_setDiagnosticsSampleRate,add:add,createInstance:createInstance,extendSession:extendSession,flush:flush,getDeviceId:getDeviceId,getIdentity:getIdentity,getOptOut:getOptOut,getSessionId:getSessionId,getUserId:getUserId,groupIdentify:groupIdentify,identify:identify,init:init$1,logEvent:logEvent,remove:remove,reset:reset$1,revenue:revenue,runQueuedFunctions:runQueuedFunctions,setDeviceId:setDeviceId,setGroup:setGroup,setIdentity:setIdentity,setOptOut:setOptOut,setSessionId:setSessionId,setTransport:setTransport,setUserId:setUserId,track:track});const IFRAME_EVENTS={READY:"qonto.ready"},ACTIONS={CARD_SEE:"card.see",CARD_SEE_DETAILS:"card.see-details",CARD_ORDER:"card.order",CARD_UNLOCK:"card.unlock",CARD_SHOW_PIN:"card.show.pin",CARD_SET_PIN:"card.set.pin",TRANSFER_SINGLE_CREATE:"transfer.single.create",TRANSFER_BULK_CREATE:"transfer.bulk.create",BENEFICIARIES_TRUST:"beneficiary.trust"},ENVIRONMENTS={PRODUCTION:"production",STAGING:"staging",LOCAL:"local"},BRANCHES={MASTER:"master",SANDBOX:"sandbox",QA:"qa"},ACTIVITY_TAGS={ATM:"atm",FALLBACK:"fallback",FEES:"fees",FINANCE:"finance",FOOD_AND_GROCERY:"food_and_grocery",GAS_STATION:"gas_station",HARDWARE_AND_EQUIPMENT:"hardware_and_equipment",HOTEL_AND_LODGING:"hotel_and_lodging",INSURANCE:"insurance",IT_AND_ELECTRONICS:"it_and_electronics",LEGAL_AND_ACCOUNTING:"legal_and_accounting",LOGISTICS:"logistics",MANUFACTURING:"manufacturing",MARKETING:"marketing",OFFICE_RENTAL:"office_rental",OFFICE_SUPPLY:"office_supply",ONLINE_SERVICE:"online_service",OTHER_EXPENSE:"other_expense",OTHER_INCOME:"other_income",OTHER_SERVICE:"other_service",PENDING:"pending",REFUND:"refund",RESTAURANT_AND_BAR:"restaurant_and_bar",SALES:"sales",SALARY:"salary",SUBSCRIPTION:"subscription",TAX:"tax",TRANSPORT:"transport",TREASURY_AND_INTERCO:"treasury_and_interco",UTILITY:"utility",VOUCHER:"voucher"},BENEFICIARY_STATUSES={PENDING:"pending",VALIDATED:"validated",DECLINED:"declined"},LOCALES$1={EN:"en",FR:"fr",DE:"de",ES:"es",IT:"it",PT:"pt"},TRANSFER_DECLINE_REASONS={BENEFICIARY_BIC_INVALID:"beneficiary_bic_invalid",BENEFICIARY_IBAN_INVALID:"beneficiary_iban_invalid",BENEFICIARY_STATUS:"beneficiary_status",BENEFICIARY_NETWORK_RULES_ERROR:"beneficiary_network_rules_error",ORGANISATION_COMPLIANCE_REASONS:"organisation_compliance_reasons",DEBIT_ACCOUNT_INSUFFICIENT_FUNDS:"debit_account_insufficient_funds",QONTO_PROCESSING_FAILED:"qonto_processing_failed"},TRANSFER_STATUSES={PENDING:"pending",PROCESSING:"processing",CANCELED:"canceled",DECLINED:"declined",SETTLED:"settled",FAILED:"failed",COMPLETED:"completed"},TRANSACTION_STATUSES={PENDING:"pending",DECLINED:"declined",COMPLETED:"completed"},MFA_METHODS={PASSKEY:"passkey",SMS_OTP:"sms-otp",PAIRED_DEVICE:"paired-device",MOCK:"mock"},AMOUNT_REQUIRING_ATTACHMENTS=3e4,VOP_CHECK_RESULTS={MATCH_RESULT_MATCH:"MATCH_RESULT_MATCH",MATCH_RESULT_NO_MATCH:"MATCH_RESULT_NO_MATCH",MATCH_RESULT_CLOSE_MATCH:"MATCH_RESULT_CLOSE_MATCH",MATCH_RESULT_NOT_POSSIBLE:"MATCH_RESULT_NOT_POSSIBLE",MATCH_RESULT_UNSPECIFIED:"MATCH_RESULT_UNSPECIFIED"},VOP_DECISIONS={ACCEPT:"ACCEPT",REJECT:"REJECT"},AUTH_LINK_ACTIONS={CARD_DISPLAY:"display_card",PAYMENT_LINK_CREATE:"create_payment_link",SEPA_TRANSFER_CREATE:"create_sepa_transfer"},HTTP_CODES={PRECONDITION_REQUIRED:428};var constants$1=Object.freeze({__proto__:null,ACTIONS:ACTIONS,ACTIVITY_TAGS:ACTIVITY_TAGS,AMOUNT_REQUIRING_ATTACHMENTS:AMOUNT_REQUIRING_ATTACHMENTS,AUTH_LINK_ACTIONS:AUTH_LINK_ACTIONS,BENEFICIARY_STATUSES:BENEFICIARY_STATUSES,BRANCHES:BRANCHES,ENVIRONMENTS:ENVIRONMENTS,HTTP_CODES:HTTP_CODES,IFRAME_EVENTS:IFRAME_EVENTS,LOCALES:LOCALES$1,MFA_METHODS:MFA_METHODS,TRANSACTION_STATUSES:TRANSACTION_STATUSES,TRANSFER_DECLINE_REASONS:TRANSFER_DECLINE_REASONS,TRANSFER_STATUSES:TRANSFER_STATUSES,VOP_CHECK_RESULTS:VOP_CHECK_RESULTS,VOP_DECISIONS:VOP_DECISIONS});const EMBED_BASE_URL_PROD="https://embed.qonto.com",EMBED_BASE_URL_STAGING="https://embed-js{branch}.staging.qonto.co",EMBED_BASE_URL_LOCAL="https://embed.dev.qonto.co",urlsPerEnvironment={[ENVIRONMENTS.PRODUCTION]:{EMBED_BASE_URL:EMBED_BASE_URL_PROD,EMBED_URL:`${EMBED_BASE_URL_PROD}/connect`,THIRD_PARTY_API_URL:"https://thirdparty.qonto.com"},[ENVIRONMENTS.STAGING]:{EMBED_BASE_URL:EMBED_BASE_URL_STAGING,EMBED_URL:`${EMBED_BASE_URL_STAGING}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"},[ENVIRONMENTS.LOCAL]:{EMBED_BASE_URL:EMBED_BASE_URL_LOCAL,EMBED_URL:`${EMBED_BASE_URL_LOCAL}/connect`,THIRD_PARTY_API_URL:"https://thirdparty{branch}.staging.qonto.co"}};class EnvironmentManager{constructor(){let e,t;this.environment=ENVIRONMENTS.PRODUCTION,this.branch=BRANCHES.SANDBOX,"undefined"!=typeof process&&process.env&&(e=process.env.QONTO_EMBED_ENVIRONMENT,t=process.env.QONTO_EMBED_BRANCH),this.environment=Object.values(ENVIRONMENTS).includes(e)?e:ENVIRONMENTS.PRODUCTION,this.branch=Object.values(BRANCHES).includes(t)?t:BRANCHES.SANDBOX}static getInstance(){return EnvironmentManager.instance||(EnvironmentManager.instance=new EnvironmentManager),EnvironmentManager.instance}setEnvironment(e){this.environment=e}getEnvironment(){return this.environment}isProductionEnvironment(){return this.environment===ENVIRONMENTS.PRODUCTION}setBranch(e){this.branch=e}getBranch(){return this.branch}clear(){this.environment=ENVIRONMENTS.PRODUCTION,this.branch=BRANCHES.MASTER}getEnvironmentUrls(){if(this.environment===ENVIRONMENTS.PRODUCTION)return urlsPerEnvironment.production;{const e=urlsPerEnvironment[this.environment];return Object.entries(e).reduce(((e,[t,r])=>({...e,[t]:r.replace("{branch}",`-${this.branch}`)})),{})}}}const environmentManager=EnvironmentManager.getInstance();class OperationSettingsManager{constructor(){this.mfaPreference=MFA_METHODS.PASSKEY,this.debugMode=!1}static getInstance(){return OperationSettingsManager.instance||(OperationSettingsManager.instance=new OperationSettingsManager),OperationSettingsManager.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=MFA_METHODS.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 operationSettingsManager=OperationSettingsManager.getInstance(),SDK_PREFIX="[Qonto Embed SDK]";function isDebugEnabled(){return operationSettingsManager.getDebugMode()}function info(e,t){if(!isDebugEnabled())return;const r=void 0!==t?[SDK_PREFIX,e,t]:[SDK_PREFIX,e];console.log(...r)}function isRunningInBrowser(){return"undefined"!=typeof window&&"undefined"!=typeof document}function isRunningInServer(){return!isRunningInBrowser()}class AmplitudeManager{constructor(){this.isInitialized=!1}static getInstance(){return AmplitudeManager.instance||(AmplitudeManager.instance=new AmplitudeManager),AmplitudeManager.instance}initialize(){if(this.isInitialized||isRunningInServer())return;const e=environmentManager.getEnvironment()||"production",t=e===ENVIRONMENTS.PRODUCTION?"52c120d2f5c89ca646fae6649a1ce7ad":"373aa80c38e5bc2a55895a96c8447fef";try{if(!amplitude||"function"!=typeof init$1)throw new Error("Analytics SDK module not available");const r={defaultTracking:{sessions:!1,pageViews:!1,formInteractions:!1,fileDownloads:!1},logLevel:e!==ENVIRONMENTS.PRODUCTION?LogLevel.Debug:LogLevel.None};init$1(t,void 0,r),this.isInitialized=!0,this.track(ANALYTICS_EVENTS.SDK_INITIALIZED)}catch(e){console.error("Failed to initialize analytics tracking:",e)}}isEnabled(){return this.isInitialized}track(e,t){if(this.isInitialized)try{track(e,t)}catch(e){console.error("Failed to track analytics event:",e)}}reset(){if(this.isInitialized)try{reset$1()}catch(e){console.error("Failed to reset analytics:",e)}}}const amplitudeManager=AmplitudeManager.getInstance();function initialize$2(){amplitudeManager.initialize()}function reset(){amplitudeManager.reset()}function trackEvent(e,t){amplitudeManager.track(e,t)}const tracker={cardsList:e=>{trackEvent(ANALYTICS_EVENTS.CARDS_LIST,e)},cardsGet:e=>{trackEvent(ANALYTICS_EVENTS.CARDS_GET,e)},cardsOrder:e=>{trackEvent(ANALYTICS_EVENTS.CARDS_ORDER,e)},cardsUnlock:e=>{trackEvent(ANALYTICS_EVENTS.CARDS_UNLOCK,e)},cardsDisplay:e=>{trackEvent(ANALYTICS_EVENTS.CARDS_DISPLAY,e)},beneficiariesList:e=>{trackEvent(ANALYTICS_EVENTS.BENEFICIARIES_LIST,e)},beneficiariesGet:e=>{trackEvent(ANALYTICS_EVENTS.BENEFICIARIES_GET,e)},beneficiariesAdd:e=>{trackEvent(ANALYTICS_EVENTS.BENEFICIARIES_ADD,e)},beneficiariesUpdate:e=>{trackEvent(ANALYTICS_EVENTS.BENEFICIARIES_UPDATE,e)},beneficiariesTrust:e=>{trackEvent(ANALYTICS_EVENTS.BENEFICIARIES_TRUST,e)},beneficiariesUntrust:e=>{trackEvent(ANALYTICS_EVENTS.BENEFICIARIES_UNTRUST,e)},sepaTransferList:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_LIST,e)},sepaTransferGet:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_GET,e)},sepaTransferCreate:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_CREATE,e)},sepaTransferCancel:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_CANCEL,e)},sepaTransferCreationFlowLink:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_CREATION_FLOW_LINK,e)},sepaTransferBulkList:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_BULK_LIST,e)},sepaTransferBulkGet:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_BULK_GET,e)},sepaTransferBulkCreate:e=>{trackEvent(ANALYTICS_EVENTS.SEPA_TRANSFER_BULK_CREATE,e)},transactionsList:e=>{trackEvent(ANALYTICS_EVENTS.TRANSACTIONS_LIST,e)},transactionsGet:e=>{trackEvent(ANALYTICS_EVENTS.TRANSACTIONS_GET,e)},organizationsList:e=>{trackEvent(ANALYTICS_EVENTS.ORGANIZATIONS_LIST,e)},organizationsBankAccounts:e=>{trackEvent(ANALYTICS_EVENTS.ORGANIZATIONS_BANK_ACCOUNTS,e)},paymentLinksCreate:e=>{trackEvent(ANALYTICS_EVENTS.PAYMENT_LINKS_CREATE,e)},paymentLinksRedirect:e=>{trackEvent(ANALYTICS_EVENTS.PAYMENT_LINKS_REDIRECT,e)},authLinksRequest:e=>{trackEvent(ANALYTICS_EVENTS.AUTH_LINKS_REQUEST,e)},uiElementCreated:(e,t)=>{trackEvent(ANALYTICS_EVENTS.UI_ELEMENT_CREATED,{uiElementType:e,...t})}};class AuthManager{constructor(){this.accessToken=null,this.stagingToken=null}static getInstance(){return AuthManager.instance||(AuthManager.instance=new AuthManager),AuthManager.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 authManager=AuthManager.getInstance();class QontoEmbedSdkError extends Error{constructor(){super(),this.stack=""}toString(){return`${this.name}: ${this.message}`}}class AuthenticationError extends QontoEmbedSdkError{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 validatePresenceOfAuthToken(){if(!authManager.hasAccessToken())throw new AuthenticationError;return authManager.getAccessToken()}function base64Encode(e){return isRunningInServer()?Buffer.from(e).toString("base64"):btoa(e)}function base64Decode(e){return isRunningInServer()?Buffer.from(e,"base64").toString("utf-8"):atob(e)}class LocaleManager{constructor(){this.currentLocale="en"}static getInstance(){return LocaleManager.instance||(LocaleManager.instance=new LocaleManager),LocaleManager.instance}setLocale(e){this.currentLocale=e}getLocale(){return this.currentLocale}setDefaultLocale(){this.currentLocale="en"}}const localeManager=LocaleManager.getInstance();class EmbedApiError extends QontoEmbedSdkError{constructor({message:e,data:t,code:r}){super(),this.code=500;const n=Array.isArray(e)?e.join("\n"):e;this.name="EmbedApiError",this.message=`The call to the Embed API failed with the following errors:\n${n}`,this.data=t||{},this.code=r||this.code}}function buildRequestHeaders({accessToken:e,stagingToken:t,idempotencyKey:r,mfaPreference:n,scaSessionToken:i}){const a=new Headers;a.append("Authorization",`Bearer ${e}`);const o=t||authManager.getStagingToken();o&&a.append("X-Qonto-Staging-Token",o),r&&a.append("X-Qonto-Idempotency-Key",r);const s=n||operationSettingsManager.getMFAPreference();return s&&a.append("X-Qonto-2fa-Preference",s),i&&a.append("X-Qonto-SCA-Session-Token",i),a.append("Content-Type","application/json"),a.append("Accept-Language",localeManager.getLocale()),a}async function makeNetworkCall({path:e,options:t}){const r=`${environmentManager.getEnvironmentUrls().THIRD_PARTY_API_URL}${e}`,n=await fetch(r,{...t,headers:buildRequestHeaders(t.headers),body:t.body?JSON.stringify(t.body):void 0});if(204===n.status)return;const i=await n.json();if(!n.ok)throw i.errors?new EmbedApiError({code:n.status,message:i.errors.map((e=>`${e.code}: ${e.detail}`))}):new EmbedApiError({code:n.status,message:`${i.code}: ${i.detail}`,data:i});return i}function encodeNetworkCall(e){const t={method:e.options.method,headers:e.options.headers,path:e.path,payload:e.options?.body};return base64Encode(JSON.stringify(t))}function decodeNetworkResponse(e){return JSON.parse(base64Decode(e))}class EmbedOperationError extends QontoEmbedSdkError{constructor(e){super(),this.name="EmbedOperationError",this.message=e}}function getUIParentElement(e){let t=null;if(t="function"==typeof e?e():document.getElementById(e),!(t&&t instanceof HTMLElement))throw new EmbedOperationError(`Could not install the UI Element because the parent element with id ${e} was not found.\nPlease make sure to pass a valid parentElementId or ensure the parentElementId function returns a valid element.`);return t}async function callProxyFunction({proxyFunction:e,networkCallDescriptor:t,proxyEndpointDescriptor:r}){if(r){const e={...Object.fromEntries([...buildRequestHeaders(t.options?.headers)??{}])},n=encodeNetworkCall({...t,options:{...t.options,headers:e}}),i=await fetch(r.path,{method:r.method,headers:r.options.headers,body:n}),a=decodeNetworkResponse(await i.text());if(!i.ok)throw new EmbedApiError({code:i.status,data:a,message:`Error from proxy endpoint: ${i.status} ${i.statusText}`});return a}if(e){const r=Object.fromEntries([...buildRequestHeaders(t.options?.headers)??{}]),n=encodeNetworkCall({...t,options:{...t.options,headers:r}});return decodeNetworkResponse(await e(n))}throw new EmbedOperationError("No proxy function or proxy endpoint descriptor provided for proxy call.")}class InvalidParametersError extends QontoEmbedSdkError{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")}`}}const defaultOperationSettingsValidationConfiguration={requiresUI:!1};function validateOperationSettingsParams(e,{requiresUI:t}=defaultOperationSettingsValidationConfiguration){const r=e?.uiParentElementId||operationSettingsManager.getUIParentElementId();if(t){if(!r)throw new InvalidParametersError("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 r))throw new InvalidParametersError("operationSettings.uiParentElementId must be a string or a function returning an HTMLElement")}const n=e?.mfaPreference||operationSettingsManager.getMFAPreference();if(n){const e=getMfaValuesAvailableInCurrentEnvironment(Object.values(MFA_METHODS));if(!e.includes(n))throw new InvalidParametersError(`operationSettings.mfaPreference must be one of ${e.join(", ")}`);if(environmentManager.isProductionEnvironment()&&n===MFA_METHODS.MOCK)throw new InvalidParametersError("operationSettings.mfaPreference cannot be set to mock in production environment.")}const i=e?.debugMode||operationSettingsManager.getDebugMode();if(void 0!==i&&"boolean"!=typeof i)throw new InvalidParametersError("operationSettings.debugMode must be a boolean.");const a=e?.proxyRequestFunction||operationSettingsManager.getProxyRequestFunction();if(a&&"function"!=typeof a)throw new InvalidParametersError("operationSettings.proxyRequestFunction must be a function.");const o=e?.proxyEndpointDescriptor||operationSettingsManager.getProxyEndpointDescriptor();if(o&&!o.path)throw new InvalidParametersError("operationSettings.proxyEndpointDescriptor must have at least a string-formatted path property.");return{...e,uiParentElementId:r,mfaPreference:n,debugMode:i,proxyRequestFunction:a,proxyEndpointDescriptor:o}}function validateClientOperationSettings(e,t){const r=e?.proxyRequestFunction||operationSettingsManager.getProxyRequestFunction(),n=e?.proxyEndpointDescriptor||operationSettingsManager.getProxyEndpointDescriptor();if(!r&&!n)throw new InvalidParametersError(t||"Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. If you need to use accessToken, import the server version of this module.");return{...e,proxyRequestFunction:r,proxyEndpointDescriptor:n}}function getMfaValuesAvailableInCurrentEnvironment(e){return environmentManager.isProductionEnvironment()?e.filter((e=>e!==MFA_METHODS.MOCK)):e}function prepareAuthLinkRequest({accessToken:e,stagingToken:t,action:r,callbackUrl:n}){const i={post_authn_action:r};return n&&(i.callback_url=n),{path:"/v1/embed_auth_links",options:{method:"POST",headers:{accessToken:e,stagingToken:t},body:{embed_auth_link:i}}}}function serializeAuthLink(e){return{url:e.url,postAuthAction:e.post_authn_action,callbackUrl:e.callback_url,expiresAt:e.expired_at,usedAt:e.used_at}}function validatePresenceOfRequiredParams(e,t){const r=t.filter((t=>t.requiredIfPresent?!e[t.name]&&e[t.requiredIfPresent]:void 0===e[t.name])).map((e=>e.name));if(r.length>0)throw new InvalidParametersError(r.map((e=>`Missing required parameter: ${e}`)))}function validateExpectedStringValues(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"string"!=typeof e)).map((([e])=>`${e} must be a string`))}function validateExpectedBooleanValues(e){return Object.entries(e).filter((([,e])=>void 0!==e&&!1!==e&&!0!==e)).map((([e])=>`${e} must be a boolean`))}function validateExpectedNumericValues(e){return Object.entries(e).filter((([,e])=>void 0!==e)).filter((([,e])=>"number"!=typeof e)).map((([e])=>`${e} must be a number`))}function validateAuthLinkRequestSettings(e){if(!e||"object"!=typeof e)throw new InvalidParametersError("requestSettings must be an object");const t=e,{action:r,callbackUrl:n}=e;validatePresenceOfRequiredParams(t,[{name:"action"}]);const i=validateExpectedStringValues(t),a=Object.values(AUTH_LINK_ACTIONS);if(a.includes(r)||i.push(`action must be one of ${a.join(", ")}`),i.length>0)throw new InvalidParametersError(i);if(void 0!==n&&""===n.trim())throw new InvalidParametersError("callbackUrl cannot be empty")}async function request({requestSettings:e,operationSettings:t}){tracker.authLinksRequest(),validateAuthLinkRequestSettings(e);const{proxyEndpointDescriptor:r,stagingToken:n}=validateClientOperationSettings(t,'Client-side auth-links operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/auth-links" only in server-side/backend environments.');if(!r)throw new InvalidParametersError('Client-side auth-links operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/auth-links" only in server-side/backend environments.');const i=prepareAuthLinkRequest({stagingToken:n,action:e.action,callbackUrl:e.callbackUrl});return serializeAuthLink((await callProxyFunction({proxyEndpointDescriptor:r,networkCallDescriptor:i})).body)}const authLinks={request:request};function buildPaginationParams(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 serializePaginationResponse(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 byteToHex=[];for(let e=0;e<256;++e)byteToHex.push((e+256).toString(16).slice(1));function unsafeStringify(e,t=0){return(byteToHex[e[t+0]]+byteToHex[e[t+1]]+byteToHex[e[t+2]]+byteToHex[e[t+3]]+"-"+byteToHex[e[t+4]]+byteToHex[e[t+5]]+"-"+byteToHex[e[t+6]]+byteToHex[e[t+7]]+"-"+byteToHex[e[t+8]]+byteToHex[e[t+9]]+"-"+byteToHex[e[t+10]]+byteToHex[e[t+11]]+byteToHex[e[t+12]]+byteToHex[e[t+13]]+byteToHex[e[t+14]]+byteToHex[e[t+15]]).toLowerCase()}let getRandomValues;const rnds8=new Uint8Array(16);function rng(){if(!getRandomValues){if("undefined"==typeof crypto||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");getRandomValues=crypto.getRandomValues.bind(crypto)}return getRandomValues(rnds8)}const randomUUID="undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto);var native={randomUUID:randomUUID};function _v4(e,t,r){const n=(e=e||{}).random??e.rng?.()??rng();if(n.length<16)throw new Error("Random bytes length must be >= 16");return n[6]=15&n[6]|64,n[8]=63&n[8]|128,unsafeStringify(n)}function v4(e,t,r){return native.randomUUID&&!e?native.randomUUID():_v4(e)}function buildIframeMessage({actionId:e,actionData:t}){const r=operationSettingsManager.getMFAPreference();return{actionId:e,actionData:{...t,scaPreference:t.scaPreference||r,idempotencyKey:t.idempotencyKey||v4()}}}class EmbedIframe{constructor(e){this.options=e,this.iframe=null,this.parentElement=null,this.messageListeners=new Map,this.defaultTimeout=3e4;const t=new URL(e.iframeUrl);this.targetOrigin=`${t.protocol}//${t.host}`}async initialize(){if(this.iframe)return this;if(this.parentElement=getUIParentElement(this.options.parentElementId),!this.parentElement)throw new EmbedOperationError(`Could not install the authentication UI because the parent element with id ${this.options.parentElementId} was not found.\nPlease make sure to pass a valid parentElementId when calling the method.`);return new Promise(((e,t)=>{this.iframe=document.createElement("iframe"),this.iframe.src=this.options.iframeUrl,this.iframe.style.width="100%",this.iframe.style.height="100%",this.iframe.style.border="none";const r=this.options.timeout||this.defaultTimeout,n=setTimeout((()=>{window.removeEventListener("message",i),t(new EmbedOperationError(`Could not install the authentication UI because the timeout of ${r}ms was reached.\nPlease make sure the application can reach the Internet.`))}),r),i=t=>{t.data.eventId===IFRAME_EVENTS.READY&&(clearTimeout(n),window.removeEventListener("message",i),e(this))};window.addEventListener("message",i),this.parentElement?.appendChild(this.iframe)}))}postMessage(e){if(!this.iframe||!this.iframe.contentWindow)return Promise.reject(new EmbedOperationError("Attempted to perform an Embed operation without having the authentication UI initialized."));const t=buildIframeMessage(e);return new Promise(((e,r)=>{const n=i=>{if(i.data?.actionId===t.actionId){if("error"===i.data.status)return this.removeMessageListener(t.actionId,n),r(new EmbedOperationError(`An error occurred when performing the action ${t.actionId}.\n${JSON.stringify(i.data.payload)}`));this.removeMessageListener(t.actionId,n),e(i.data.payload)}};this.addMessageListener(t.actionId,n),this.iframe?.contentWindow?.postMessage(t,this.targetOrigin)}))}addMessageListener(e,t){this.messageListeners.has(e)||this.messageListeners.set(e,[]);this.messageListeners.get(e).push(t),window.addEventListener("message",t)}removeMessageListener(e,t){const r=this.messageListeners.get(e);if(r){const e=r.indexOf(t);-1!==e&&(r.splice(e,1),window.removeEventListener("message",t))}}destroy(){this.messageListeners.forEach((e=>{e.forEach((e=>{window.removeEventListener("message",e)}))})),this.messageListeners.clear(),this.iframe&&this.parentElement&&(this.parentElement.removeChild(this.iframe),this.iframe=null)}}function buildIframeUrl({accessToken:e,stagingToken:t,locale:r,debugMode:n}){const i=n||!1,a=r||localeManager.getLocale(),o=environmentManager.getEnvironmentUrls().EMBED_URL,s=t?`;staging_token=${encodeURIComponent(t)}`:"";return`${o}?debug=${i}&lang=${encodeURIComponent(a)}#access_token=${encodeURIComponent(e)}${s}`}function createIframe({parentElementId:e,iframeUrl:t}){return new EmbedIframe({parentElementId:e,iframeUrl:t}).initialize()}function serializeBeneficiary(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 serializeToNewBeneficiaryDataObject(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 BENEFICIARIES_ENDPOINT="/v2/sepa/beneficiaries";function prepareGetBeneficiariesCall({paginationSettings:e,accessToken:t,stagingToken:r}){const n={method:"GET",headers:{accessToken:t,stagingToken:r}},i=buildPaginationParams(e),a=i.size?`?${i.toString()}`:"";return{path:`${BENEFICIARIES_ENDPOINT}${a}`,options:n}}async function getBeneficiaries$2({paginationSettings:e,accessToken:t,stagingToken:r}){const n=prepareGetBeneficiariesCall({paginationSettings:e,accessToken:t,stagingToken:r}),{beneficiaries:i,meta:a}=await makeNetworkCall(n);return{beneficiaries:i,meta:a}}function prepareGetBeneficiaryCall({beneficiaryId:e,accessToken:t,stagingToken:r}){return{path:`${BENEFICIARIES_ENDPOINT}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:r}}}}async function getBeneficiary$2({accessToken:e,stagingToken:t,beneficiaryId:r}){const n=prepareGetBeneficiaryCall({beneficiaryId:r,accessToken:e,stagingToken:t}),{beneficiary:i}=await makeNetworkCall(n);return i}function prepareAddBeneficiaryCall({beneficiary:e,accessToken:t,stagingToken:r,idempotencyKey:n=v4()}){return{path:BENEFICIARIES_ENDPOINT,options:{method:"POST",headers:{accessToken:t,stagingToken:r,idempotencyKey:n},body:{beneficiary:serializeToNewBeneficiaryDataObject(e)}}}}function prepareUntrustBeneficiaryCall({beneficiaryIds:e,accessToken:t,stagingToken:r}){return{path:`${BENEFICIARIES_ENDPOINT}/untrust`,options:{method:"PATCH",headers:{accessToken:t,stagingToken:r},body:{ids:e}}}}function prepareUpdateBeneficiaryCall({beneficiaryParamsBeingEdited:e,accessToken:t,stagingToken:r,idempotencyKey:n,mfaPreference:i}){const{name:a,email:o,activityTag:s}=e,l={method:"PATCH",headers:{accessToken:t,stagingToken:r,idempotencyKey:n,mfaPreference:i},body:{beneficiary:{name:a,email:o,activity_tag:s}}};return{path:`${BENEFICIARIES_ENDPOINT}/${e.id}`,options:l}}const requiredNewBeneficiaryParams=[{name:"name"},{name:"iban"}];function validateGetBeneficiaryParams(e){if(!e)throw new InvalidParametersError("beneficiaryId parameter is required for the called function");if(e&&"string"!=typeof e)throw new InvalidParametersError("beneficiaryId must be a string");return e}function validateAddBeneficiaryParams(e){if(!e)throw new InvalidParametersError("beneficiary parameter is required for the called function");if("object"!=typeof e)throw new InvalidParametersError("beneficiary must be an object");validatePresenceOfRequiredParams(e,requiredNewBeneficiaryParams);const t=validateExpectedStringValues({name:e.name,iban:e.iban,email:e.email,activityTag:e.activityTag,bic:e.bic});if(t.length>0)throw new InvalidParametersError(t);return e}function validateUpdateBeneficiaryParams(e){const{id:t,name:r,email:n,activityTag:i}=e||{};if(!t)throw new InvalidParametersError("Invalid parameters were passed to the function:\nA beneficiary ID is required for the called function");if(!r&&!n&&!i)throw new InvalidParametersError("Invalid parameters were passed to the function:\nAt least one of the following properties must be provided: name, email, activityTag");const a=validateExpectedStringValues({name:r,email:n,activityTag:i});if(a.length>0)throw new InvalidParametersError(a);return{id:t,name:r,email:n,activityTag:i}}function validateTrustBeneficiariesParams(e){if(!e)throw new InvalidParametersError("beneficiaryIds parameter is required for the called function");if(!Array.isArray(e)||!e.every((e=>"string"==typeof e)))throw new InvalidParametersError("beneficiaryIds must be an array of strings");return e}async function getBeneficiaries$1(e){tracker.beneficiariesList();const{proxyEndpointDescriptor:t,paginationSettings:r}=validateClientOperationSettings(e?.operationSettings,'Client-side beneficiary operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/beneficiaries" only in server-side/backend environments.'),n=prepareGetBeneficiariesCall({paginationSettings:r}),i=await callProxyFunction({proxyEndpointDescriptor:t,networkCallDescriptor:n}),a=i.body.beneficiaries.map((e=>serializeBeneficiary(e))),o=serializePaginationResponse(i.body.meta);return{beneficiaries:a,...o?{meta:o}:{}}}async function getBeneficiary$1({beneficiarySettings:e,operationSettings:t}){tracker.beneficiariesGet();const r=validateGetBeneficiaryParams(e?.beneficiaryId),{proxyEndpointDescriptor:n}=validateClientOperationSettings(t,'Client-side beneficiary operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/beneficiaries" only in server-side/backend environments.'),i=prepareGetBeneficiaryCall({beneficiaryId:r});return serializeBeneficiary((await callProxyFunction({proxyEndpointDescriptor:n,networkCallDescriptor:i})).body.beneficiary)}async function addBeneficiary({beneficiarySettings:e,operationSettings:t}){tracker.beneficiariesAdd();const r=validateAddBeneficiaryParams(e),{proxyEndpointDescriptor:n,idempotencyKey:i}=validateClientOperationSettings(t,'Client-side beneficiary operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/beneficiaries" only in server-side/backend environments.'),a=prepareAddBeneficiaryCall({beneficiary:r,idempotencyKey:i});a.options.headers=buildRequestHeaders({...a.options.headers});return serializeBeneficiary((await callProxyFunction({proxyEndpointDescriptor:n,networkCallDescriptor:a})).body.beneficiary)}async function updateBeneficiary({beneficiarySettings:e,operationSettings:t}){tracker.beneficiariesUpdate();const r=validateUpdateBeneficiaryParams(e),{proxyEndpointDescriptor:n,idempotencyKey:i,mfaPreference:a}=validateClientOperationSettings(t,'Client-side beneficiary operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/beneficiaries" only in server-side/backend environments.'),o=prepareUpdateBeneficiaryCall({beneficiaryParamsBeingEdited:r,idempotencyKey:i,mfaPreference:a});return serializeBeneficiary((await callProxyFunction({proxyEndpointDescriptor:n,networkCallDescriptor:o})).body.beneficiary)}async function trustBeneficiaries({beneficiarySettings:e,operationSettings:t}){tracker.beneficiariesTrust();const{accessToken:r,uiParentElementId:n,debugMode:i}=validateOperationSettingsParams(t,{requiresUI:!0}),a=r||validatePresenceOfAuthToken(),o=validateTrustBeneficiariesParams(e?.beneficiaryIds),s=buildIframeUrl({accessToken:a,debugMode:i}),l=await createIframe({parentElementId:n,iframeUrl:s});return(await l.postMessage({actionId:ACTIONS.BENEFICIARIES_TRUST,actionData:{body:{beneficiaryIds:o}}})).beneficiaries}async function untrustBeneficiaries({beneficiarySettings:e,operationSettings:t}){tracker.beneficiariesUntrust();const r=validateTrustBeneficiariesParams(e?.beneficiaryIds),{proxyEndpointDescriptor:n}=validateClientOperationSettings(t,'Client-side beneficiary operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/beneficiaries" only in server-side/backend environments.'),i=prepareUntrustBeneficiaryCall({beneficiaryIds:r});return(await callProxyFunction({proxyEndpointDescriptor:n,networkCallDescriptor:i})).body.beneficiaries.map(serializeBeneficiary)}const beneficiaries={getBeneficiaries:getBeneficiaries$1,getBeneficiary:getBeneficiary$1,addBeneficiary:addBeneficiary,updateBeneficiary:updateBeneficiary,trustBeneficiaries:trustBeneficiaries,untrustBeneficiaries:untrustBeneficiaries};function prepareGetCardsCall({membershipId:e,accessToken:t,stagingToken:r}){return{path:e?`/v2/cards?holder_ids[]=${e}`:"/v2/cards",options:{method:"GET",headers:{accessToken:t,stagingToken:r}}}}function prepareGetCardCall({cardId:e,accessToken:t,stagingToken:r}){return{path:`/v2/cards?ids[]=${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:r}}}}function prepareGetCardIframeUrl({accessToken:e,stagingToken:t}){return prepareAuthLinkRequest({accessToken:e,stagingToken:t,action:AUTH_LINK_ACTIONS.CARD_DISPLAY})}async function getCardIframeURL(e){const t=prepareGetCardIframeUrl(e),{embed_auth_link:r}=await makeNetworkCall(t);return r}var cards_api=Object.freeze({__proto__:null,getCardIframeURL:getCardIframeURL,prepareGetCardCall:prepareGetCardCall,prepareGetCardIframeUrl:prepareGetCardIframeUrl,prepareGetCardsCall:prepareGetCardsCall});const VIRTUAL_CARD_LEVEL={VIRTUAL:"virtual"},PHYSICAL_CARD_LEVEL={METAL:"metal",PLUS:"plus",STANDARD:"standard"},CUSTOM_PROP_PREFIX="--qonto-embed";function isSameDomain(e){return!e.href||e.href.startsWith(window.location.origin)}function isStyleRule(e){return"CSSStyleRule"===e.constructor.name}function extractVariablesFromStylesheet(e,t){return[...e].filter(isSameDomain).reduce(((e,r)=>[...r.cssRules].filter(isStyleRule).reduce(((e,r)=>{if("style"in r){const n=[...r.style].map((e=>[e.trim(),r.style.getPropertyValue(e).trim()])).filter((([e])=>e.startsWith(t))).reduce(((e,[r,n])=>({...e,[r.replace(`${t}-`,"")]:n})),{});return{...e,...n}}return e}),e)),{})}function gatherQontoEmbedCssVariables(e=CUSTOM_PROP_PREFIX){return isRunningInBrowser()?extractVariablesFromStylesheet(document.styleSheets,e):{}}function getPopulatedIframeURL(e,t){const r=new URL(e);r.searchParams.set("cardId",t.cardId),"boolean"==typeof t.allowPinReveal&&r.searchParams.set("canSeePin",t.allowPinReveal.toString()),"boolean"==typeof t.allowBlocking&&r.searchParams.set("canBlock",t.allowBlocking.toString()),!0===t.debugMode&&r.searchParams.set("debug",t.debugMode.toString());const n=gatherQontoEmbedCssVariables(CUSTOM_PROP_PREFIX);return Object.keys(n).length>0&&r.searchParams.set("customization",JSON.stringify(n)),r.toString()}async function createEmbedUI({decorationParams:e,operationSettings:t,cardIframeUrl:r}){const{cardId:n,allowPinReveal:i,allowBlocking:a}=e,{uiParentElementId:o,debugMode:s}=t,l=getPopulatedIframeURL(r,{cardId:n,allowPinReveal:i,allowBlocking:a,debugMode:s}),c=await createIframe({iframeUrl:l,parentElementId:o});return{destroyEmbedUI:()=>{c.destroy()}}}function isVirtualCardOrderSettings(e){return e.cardLevel===VIRTUAL_CARD_LEVEL.VIRTUAL}var CardStatus;!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"}(CardStatus||(CardStatus={}));const CardCategories={TRANSPORT:"transport",RESTAURANT_AND_BAR:"restaurant_and_bar",FOOD_AND_GROCERY:"food_and_grocery",IT_AND_ELECTRONICS:"it_and_electronics",UTILITY:"utility",TAX:"tax",LEGAL_AND_ACCOUNTING:"legal_and_accounting",ATM:"atm",OFFICE_SUPPLY:"office_supply",HARDWARE_AND_EQUIPMENT:"hardware_and_equipment",FINANCE:"finance"};function serializeOrderCardPayload(e){return isVirtualCardOrderSettings(e)?serializeOrderVirtualCardPayload(e):serializeOrderPhysicalCardPayload(e)}function serializeOrderVirtualCardPayload(e){const t=filterValidCategories(e.categories);return{actionId:ACTIONS.CARD_ORDER,actionData:{idempotencyKey:v4(),body:{card:{payment_monthly_limit:e.monthlyLimit,payment_daily_limit:e.dailyLimit,payment_daily_limit_option:e.hasDailyLimit,payment_transaction_limit:e.transactionLimit,payment_transaction_limit_option:e.hasTransactionLimit,active_days:e.activeDays||[],holder_id:e.membershipId,organization_id:e.organizationId,bank_account_id:e.bankAccountId,categories:t,card_level:e.cardLevel}}}}}function serializeOrderPhysicalCardPayload(e){const t=filterValidCategories(e.categories);return{actionId:ACTIONS.CARD_ORDER,actionData:{idempotencyKey:v4(),body:{card:{payment_monthly_limit:e.monthlyLimit,payment_daily_limit:e.dailyLimit,payment_daily_limit_option:e.hasDailyLimit,payment_transaction_limit:e.transactionLimit,payment_transaction_limit_option:e.hasTransactionLimit,active_days:e.activeDays||[],holder_id:e.membershipId,organization_id:e.organizationId,bank_account_id:e.bankAccountId,categories:t,card_level:e.cardLevel,card_design:e.cardDesign,..."plus"===e.cardLevel&&{type_of_print:e.typeOfPrint},ship_to_business_address:e.shipToBusiness,atm_option:e.hasAtmOption,nfc_option:e.hasNfcOption,foreign_option:e.hasForeignPaymentOption,online_option:e.hasOnlinePaymentOption,atm_daily_limit:e.atmDailyLimit,atm_monthly_limit:e.atmMonthlyLimit,...!e.shipToBusiness&&{address:{contact_name:e.address?.contactName,first_line:e.address?.firstLine,second_line:e.address?.secondLine,third_line:e.address?.thirdLine,zipcode:e.address?.zipCode,city:e.address?.city,country:e.address?.country}}}}}}}function serializeCard(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 filterValidCategories(e){const t=Object.values(CardCategories);return(e||[]).filter((e=>t.includes(e)))}function serializeUnlockCardPayload(e){return{actionId:ACTIONS.CARD_UNLOCK,actionData:{body:{cardId:e.cardSettings.cardId}}}}const requiredVirtualCardOrderParams=[{name:"organizationId"},{name:"membershipId"},{name:"bankAccountId"},{name:"monthlyLimit"},{name:"cardLevel"}],requiredPhysicalCardOrderParams=[...requiredVirtualCardOrderParams,{name:"atmDailyLimit",requiredIfPresent:"hasAtmDailyLimit"},{name:"hasAtmDailyLimit",requiredIfPresent:"hasAtmOption"},{name:"atmMonthlyLimit",requiredIfPresent:"hasAtmOption"},{name:"shipToBusiness"},{name:"cardLevel"}];function validateOrderCardParams(e){if(!e)throw new InvalidParametersError("cardSettings parameter is required for the called function");return isVirtualCardOrderSettings(e)?validateOrderVirtualCardParams(e):validateOrderPhysicalCardParams(e)}function validateUnlockCardParams(e){if(!e)throw new InvalidParametersError("cardSettings parameter is required for the called function");if(!e.cardId)throw new InvalidParametersError("cardId is required for the called function");const t=validateExpectedStringValues({cardId:e.cardId});if(t.length>0)throw new InvalidParametersError(t)}function validateOrderVirtualCardParams(e){return validatePresenceOfRequiredParams(e,requiredVirtualCardOrderParams),validateOrderVirtualCardParamsType(e),e}function validateOrderVirtualCardParamsType(e){const{membershipId:t,organizationId:r,bankAccountId:n,hasDailyLimit:i,hasTransactionLimit:a,monthlyLimit:o,dailyLimit:s,transactionLimit:l,activeDays:c,categories:d,cardLevel:u}=e,p=[...validateVirtualCardLevel(u),...validateExpectedStringValues({membershipId:t,organizationId:r,bankAccountId:n}),...validateExpectedBooleanValues({hasDailyLimit:i,hasTransactionLimit:a}),...validateExpectedNumericValues({monthlyLimit:o,dailyLimit:s,transactionLimit:l}),...validateActiveDays(c),...validateCategories(d)];if(p.length>0)throw new InvalidParametersError(p)}function validateOrderPhysicalCardParams(e){validatePresenceOfRequiredParams(e,requiredPhysicalCardOrderParams),validateOrderPhysicalCardParamsType(e)}function validateOrderPhysicalCardParamsType(e){const{membershipId:t,organizationId:r,bankAccountId:n,hasDailyLimit:i,hasTransactionLimit:a,monthlyLimit:o,dailyLimit:s,transactionLimit:l,activeDays:c,categories:d,cardLevel:u,hasNfcOption:p,hasForeignPaymentOption:h,hasOnlinePaymentOption:f,shipToBusiness:m,hasAtmOption:g,hasAtmDailyLimit:v,atmDailyLimit:y,atmMonthlyLimit:b,address:E,cardDesign:_,typeOfPrint:S}=e,T=validatePhysicalCardLevel(u),x=validateTypeOfPrint(S),k=[...T,...validateExpectedStringValues({membershipId:t,organizationId:r,bankAccountId:n}),...validateExpectedBooleanValues({hasDailyLimit:i,hasTransactionLimit:a,hasAtmOption:g,hasNfcOption:p,hasForeignPaymentOption:h,hasOnlinePaymentOption:f,hasAtmDailyLimit:v,shipToBusiness:m}),...validateExpectedNumericValues({monthlyLimit:o,dailyLimit:s,transactionLimit:l,atmDailyLimit:y,atmMonthlyLimit:b}),...validateActiveDays(c),...validateCategories(d),...x,...validateCardDesign(_),...validateAddress(E,m)];if(k.length>0)throw new InvalidParametersError(k)}function validateActiveDays(e){const t=!Array.isArray(e)||!e.every((e=>Number.isInteger(e)&&e>0&&e<8));return void 0!==e&&t?["activeDays must be an array of integers between 1 and 7"]:[]}function validateCategories(e){const t=!Array.isArray(e)||e.some((e=>"string"!=typeof e));return void 0!==e&&t?["categories must be an array of strings"]:[]}function validateCardDesign(e){return["undefined","string"].includes(typeof e)?[]:["cardDesign must be a string"]}function validateTypeOfPrint(e){const t=null!=e&&"string"!=typeof e,r=!["print","embossed",void 0,null].includes(e);return t||r?['typeOfPrint must be one of "print", "embossed" or null']:[]}function validatePhysicalCardLevel(e){return Object.values(PHYSICAL_CARD_LEVEL).includes(e)?[]:['cardLevel must be one of "standard", "plus", "metal"']}function validateVirtualCardLevel(e){return e!==VIRTUAL_CARD_LEVEL.VIRTUAL?['cardLevel must be "virtual"']:[]}function validateAddress(e,t){return t||!e||e.contactName&&e.firstLine&&e.zipCode&&e.city&&e.country?[]:["address must contain at least contactName, firstLine, zipCode, city and country properties"]}function validateDisplayCardParams(e){if(!e)throw new InvalidParametersError("cardSettings parameter is required for the called function");if(!e.cardId)throw new InvalidParametersError("cardId is required for the called function");const t=validateExpectedStringValues({cardId:e.cardId});if(t.length>0)throw new InvalidParametersError(t);let r={};void 0!==e.allowPinReveal&&(r={allowPinReveal:e.allowPinReveal}),void 0!==e.allowBlocking&&(r={...r,allowBlocking:e.allowBlocking});const n=validateExpectedBooleanValues(r);if(n.length>0)throw new InvalidParametersError(n);return e}function validateGetCardParams(e){if(!e)throw new InvalidParametersError("cardSettings parameter is required for the called function");if(!e.cardId)throw new InvalidParametersError("cardId parameter is required for the called function");const t=validateExpectedStringValues({cardId:e.cardId});if(t.length>0)throw new InvalidParametersError(t);return e}async function getCards(e){tracker.cardsList();const t=e?.cardSettings?.membershipId;if(t&&"string"!=typeof t)throw new InvalidParametersError("membershipId must be a string");if(e?.operationSettings?.proxyRequestFunction)throw new InvalidParametersError("proxyRequestFunction is no longer supported for card operations. Use proxyEndpointDescriptor instead.");const{proxyEndpointDescriptor:r,stagingToken:n}=validateClientOperationSettings(e?.operationSettings,'Client-side card operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/cards" only in server-side/backend environments.'),i=prepareGetCardsCall({membershipId:t,stagingToken:n});return(await callProxyFunction({proxyEndpointDescriptor:r,networkCallDescriptor:i})).body.cards.map((e=>serializeCard(e)))}async function getCard({cardSettings:e,operationSettings:t}){tracker.cardsGet(),validateGetCardParams(e);const r=e.cardId;if(t?.proxyRequestFunction)throw new InvalidParametersError("proxyRequestFunction is no longer supported for card operations. Use proxyEndpointDescriptor instead.");const{proxyEndpointDescriptor:n,stagingToken:i}=validateClientOperationSettings(t,'Client-side card operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/cards" only in server-side/backend environments.'),a=prepareGetCardCall({cardId:r,stagingToken:i}),o=(await callProxyFunction({proxyEndpointDescriptor:n,networkCallDescriptor:a})).body.cards;if(Array.isArray(o)&&o.length>0)return serializeCard(o[0]);throw new InvalidParametersError("Unable to retrieve card data")}async function orderCard(e){tracker.cardsOrder();const t=validatePresenceOfAuthToken(),{uiParentElementId:r,debugMode:n}=e.operationSettings;if(!r)throw new InvalidParametersError("uiParentElementId is required");validateOrderCardParams(e.cardSettings);const i=buildIframeUrl({accessToken:t,stagingToken:authManager.getStagingToken()||void 0,debugMode:n}),a=await createIframe({iframeUrl:i,parentElementId:r}),o=serializeOrderCardPayload(e.cardSettings),s=await a.postMessage(o);return a.destroy(),serializeCard(s)}async function unlockCard(e){tracker.cardsUnlock();const t=validatePresenceOfAuthToken(),{uiParentElementId:r,debugMode:n}=e.operationSettings;if(!r)throw new InvalidParametersError("uiParentElementId is required");validateUnlockCardParams(e.cardSettings);const i=buildIframeUrl({accessToken:t,stagingToken:authManager.getStagingToken()||void 0,debugMode:n}),a=await createIframe({iframeUrl:i,parentElementId:r}),o=serializeUnlockCardPayload(e),s=await a.postMessage(o);return a.destroy(),serializeCard(s)}async function displayCard(e){tracker.cardsDisplay();const{uiParentElementId:t,accessToken:r,stagingToken:n,debugMode:i,mfaPreference:a,proxyEndpointDescriptor:o,proxyRequestFunction:s}=validateOperationSettingsParams(e.operationSettings,{requiresUI:!0});if(!t)throw new InvalidParametersError("uiParentElementId is required");if(validateDisplayCardParams(e.cardSettings),s&&!o)throw new InvalidParametersError("proxyRequestFunction is no longer supported for card operations. Use proxyEndpointDescriptor instead.");if(o){const r=prepareGetCardIframeUrl({stagingToken:n}),a=(await callProxyFunction({proxyEndpointDescriptor:o,networkCallDescriptor:r})).body.embed_auth_link;return createEmbedUI({decorationParams:e.cardSettings,operationSettings:{uiParentElementId:t,debugMode:i},cardIframeUrl:a.url})}{const a=r||validatePresenceOfAuthToken(),{getCardIframeURL:o}=await Promise.resolve().then((function(){return cards_api})),s=await o({...e.cardSettings,accessToken:a,stagingToken:n});return createEmbedUI({decorationParams:e.cardSettings,operationSettings:{uiParentElementId:t,debugMode:i},cardIframeUrl:s.url})}}const cards={getCards:getCards,getCard:getCard,orderCard:orderCard,unlockCard:unlockCard,displayCard:displayCard},DEBUG_BUILD$2="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,GLOBAL_OBJ=globalThis,SDK_VERSION="10.45.0";function getMainCarrier(){return getSentryCarrier(GLOBAL_OBJ),GLOBAL_OBJ}function getSentryCarrier(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||SDK_VERSION,t[SDK_VERSION]=t[SDK_VERSION]||{}}function getGlobalSingleton(e,t,r=GLOBAL_OBJ){const n=r.__SENTRY__=r.__SENTRY__||{},i=n[SDK_VERSION]=n[SDK_VERSION]||{};return i[e]||(i[e]=t())}const CONSOLE_LEVELS=["debug","info","warn","error","log","assert","trace"],PREFIX="Sentry Logger ",originalConsoleMethods={};function consoleSandbox(e){if(!("console"in GLOBAL_OBJ))return e();const t=GLOBAL_OBJ.console,r={},n=Object.keys(originalConsoleMethods);n.forEach((e=>{const n=originalConsoleMethods[e];r[e]=t[e],t[e]=n}));try{return e()}finally{n.forEach((e=>{t[e]=r[e]}))}}function enable(){_getLoggerSettings().enabled=!0}function disable(){_getLoggerSettings().enabled=!1}function isEnabled(){return _getLoggerSettings().enabled}function log(...e){_maybeLog("log",...e)}function warn(...e){_maybeLog("warn",...e)}function error(...e){_maybeLog("error",...e)}function _maybeLog(e,...t){DEBUG_BUILD$2&&isEnabled()&&consoleSandbox((()=>{GLOBAL_OBJ.console[e](`${PREFIX}[${e}]:`,...t)}))}function _getLoggerSettings(){return DEBUG_BUILD$2?getGlobalSingleton("loggerSettings",(()=>({enabled:!1}))):{enabled:!1}}const debug={enable:enable,disable:disable,isEnabled:isEnabled,log:log,warn:warn,error:error},STACKTRACE_FRAME_LIMIT=50,UNKNOWN_FUNCTION="?",WEBPACK_ERROR_REGEXP=/\(error: (.*)\)/,STRIP_FRAME_REGEXP=/captureMessage|captureException/;function createStackParser(...e){const t=e.sort(((e,t)=>e[0]-t[0])).map((e=>e[1]));return(e,r=0,n=0)=>{const i=[],a=e.split("\n");for(let e=r;e<a.length;e++){let r=a[e];r.length>1024&&(r=r.slice(0,1024));const o=WEBPACK_ERROR_REGEXP.test(r)?r.replace(WEBPACK_ERROR_REGEXP,"$1"):r;if(!o.match(/\S*Error: /)){for(const e of t){const t=e(o);if(t){i.push(t);break}}if(i.length>=STACKTRACE_FRAME_LIMIT+n)break}}return stripSentryFramesAndReverse(i.slice(n))}}function stackParserFromStackParserOptions(e){return Array.isArray(e)?createStackParser(...e):e}function stripSentryFramesAndReverse(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(getLastStackFrame(t).function||"")&&t.pop(),t.reverse(),STRIP_FRAME_REGEXP.test(getLastStackFrame(t).function||"")&&(t.pop(),STRIP_FRAME_REGEXP.test(getLastStackFrame(t).function||"")&&t.pop()),t.slice(0,STACKTRACE_FRAME_LIMIT).map((e=>({...e,filename:e.filename||getLastStackFrame(t).filename,function:e.function||UNKNOWN_FUNCTION})))}function getLastStackFrame(e){return e[e.length-1]||{}}const defaultFunctionName="<anonymous>";function getFunctionName(e){try{return e&&"function"==typeof e&&e.name||defaultFunctionName}catch{return defaultFunctionName}}function getFramesFromEvent(e){const t=e.exception;if(t){const e=[];try{return t.values.forEach((t=>{t.stacktrace.frames&&e.push(...t.stacktrace.frames)})),e}catch{return}}}function getVueInternalName(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}const handlers={},instrumented={};function addHandler(e,t){handlers[e]=handlers[e]||[],handlers[e].push(t)}function maybeInstrument(e,t){if(!instrumented[e]){instrumented[e]=!0;try{t()}catch(t){DEBUG_BUILD$2&&debug.error(`Error while instrumenting ${e}`,t)}}}function triggerHandlers(e,t){const r=e&&handlers[e];if(r)for(const n of r)try{n(t)}catch(t){DEBUG_BUILD$2&&debug.error(`Error while triggering instrumentation handler.\nType: ${e}\nName: ${getFunctionName(n)}\nError:`,t)}}let _oldOnErrorHandler=null;function addGlobalErrorInstrumentationHandler(e){const t="error";addHandler(t,e),maybeInstrument(t,instrumentError)}function instrumentError(){_oldOnErrorHandler=GLOBAL_OBJ.onerror,GLOBAL_OBJ.onerror=function(e,t,r,n,i){return triggerHandlers("error",{column:n,error:i,line:r,msg:e,url:t}),!!_oldOnErrorHandler&&_oldOnErrorHandler.apply(this,arguments)},GLOBAL_OBJ.onerror.__SENTRY_INSTRUMENTED__=!0}let _oldOnUnhandledRejectionHandler=null;function addGlobalUnhandledRejectionInstrumentationHandler(e){const t="unhandledrejection";addHandler(t,e),maybeInstrument(t,instrumentUnhandledRejection)}function instrumentUnhandledRejection(){_oldOnUnhandledRejectionHandler=GLOBAL_OBJ.onunhandledrejection,GLOBAL_OBJ.onunhandledrejection=function(e){return triggerHandlers("unhandledrejection",e),!_oldOnUnhandledRejectionHandler||_oldOnUnhandledRejectionHandler.apply(this,arguments)},GLOBAL_OBJ.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const objectToString=Object.prototype.toString;function isError(e){switch(objectToString.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return isInstanceOf(e,Error)}}function isBuiltin(e,t){return objectToString.call(e)===`[object ${t}]`}function isErrorEvent$1(e){return isBuiltin(e,"ErrorEvent")}function isDOMError(e){return isBuiltin(e,"DOMError")}function isDOMException(e){return isBuiltin(e,"DOMException")}function isString(e){return isBuiltin(e,"String")}function isParameterizedString(e){return"object"==typeof e&&null!==e&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function isPrimitive(e){return null===e||isParameterizedString(e)||"object"!=typeof e&&"function"!=typeof e}function isPlainObject(e){return isBuiltin(e,"Object")}function isEvent(e){return"undefined"!=typeof Event&&isInstanceOf(e,Event)}function isElement(e){return"undefined"!=typeof Element&&isInstanceOf(e,Element)}function isRegExp(e){return isBuiltin(e,"RegExp")}function isThenable(e){return Boolean(e?.then&&"function"==typeof e.then)}function isSyntheticEvent(e){return isPlainObject(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function isInstanceOf(e,t){try{return e instanceof t}catch{return!1}}function isVueViewModel(e){return!("object"!=typeof e||null===e||!(e.__isVue||e._isVue||e.__v_isVNode))}function isRequest(e){return"undefined"!=typeof Request&&isInstanceOf(e,Request)}const WINDOW$3=GLOBAL_OBJ,DEFAULT_MAX_STRING_LENGTH=80;function htmlTreeAsString(e,t={}){if(!e)return"<unknown>";try{let r=e;const n=5,i=[];let a=0,o=0;const s=" > ",l=s.length;let c;const d=Array.isArray(t)?t:t.keyAttrs,u=!Array.isArray(t)&&t.maxStringLength||DEFAULT_MAX_STRING_LENGTH;for(;r&&a++<n&&(c=_htmlElementAsString(r,d),!("html"===c||a>1&&o+i.length*l+c.length>=u));)i.push(c),o+=c.length,r=r.parentNode;return i.reverse().join(s)}catch{return"<unknown>"}}function _htmlElementAsString(e,t){const r=e,n=[];if(!r?.tagName)return"";if(WINDOW$3.HTMLElement&&r instanceof HTMLElement&&r.dataset){if(r.dataset.sentryComponent)return r.dataset.sentryComponent;if(r.dataset.sentryElement)return r.dataset.sentryElement}n.push(r.tagName.toLowerCase());const i=t?.length?t.filter((e=>r.getAttribute(e))).map((e=>[e,r.getAttribute(e)])):null;if(i?.length)i.forEach((e=>{n.push(`[${e[0]}="${e[1]}"]`)}));else{r.id&&n.push(`#${r.id}`);const e=r.className;if(e&&isString(e)){const t=e.split(/\s+/);for(const e of t)n.push(`.${e}`)}}for(const e of["aria-label","type","name","title","alt"]){const t=r.getAttribute(e);t&&n.push(`[${e}="${t}"]`)}return n.join("")}function getLocationHref(){try{return WINDOW$3.document.location.href}catch{return""}}function getComponentName(e){if(!WINDOW$3.HTMLElement)return null;let t=e;for(let e=0;e<5;e++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}function fill(e,t,r){if(!(t in e))return;const n=e[t];if("function"!=typeof n)return;const i=r(n);"function"==typeof i&&markFunctionWrapped(i,n);try{e[t]=i}catch{DEBUG_BUILD$2&&debug.log(`Failed to replace method "${t}" in object`,e)}}function addNonEnumerableProperty(e,t,r){try{Object.defineProperty(e,t,{value:r,writable:!0,configurable:!0})}catch{DEBUG_BUILD$2&&debug.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function markFunctionWrapped(e,t){try{const r=t.prototype||{};e.prototype=t.prototype=r,addNonEnumerableProperty(e,"__sentry_original__",t)}catch{}}function getOriginalFunction(e){return e.__sentry_original__}function convertToPlainObject(e){if(isError(e))return{message:e.message,name:e.name,stack:e.stack,...getOwnProperties(e)};if(isEvent(e)){const t={type:e.type,target:serializeEventTarget(e.target),currentTarget:serializeEventTarget(e.currentTarget),...getOwnProperties(e)};return"undefined"!=typeof CustomEvent&&isInstanceOf(e,CustomEvent)&&(t.detail=e.detail),t}return e}function serializeEventTarget(e){try{return isElement(e)?htmlTreeAsString(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function getOwnProperties(e){return"object"==typeof e&&null!==e?Object.fromEntries(Object.entries(e)):{}}function extractExceptionKeysForMessage(e){const t=Object.keys(convertToPlainObject(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}let RESOLVED_RUNNER,emptyUuid;function withRandomSafeContext(e){if(void 0!==RESOLVED_RUNNER)return RESOLVED_RUNNER?RESOLVED_RUNNER(e):e();const t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),r=GLOBAL_OBJ;return t in r&&"function"==typeof r[t]?(RESOLVED_RUNNER=r[t],RESOLVED_RUNNER(e)):(RESOLVED_RUNNER=null,e())}function safeMathRandom(){return withRandomSafeContext((()=>Math.random()))}function safeDateNow(){return withRandomSafeContext((()=>Date.now()))}function truncate(e,t=0){return"string"!=typeof e||0===t||e.length<=t?e:`${e.slice(0,t)}...`}function safeJoin(e,t){if(!Array.isArray(e))return"";const r=[];for(let t=0;t<e.length;t++){const n=e[t];try{isVueViewModel(n)?r.push(getVueInternalName(n)):r.push(String(n))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function isMatchingPattern(e,t,r=!1){return!!isString(e)&&(isRegExp(t)?t.test(e):!!isString(t)&&(r?e===t:e.includes(t)))}function stringMatchesSomePattern(e,t=[],r=!1){return t.some((t=>isMatchingPattern(e,t,r)))}function getCrypto(){const e=GLOBAL_OBJ;return e.crypto||e.msCrypto}function getRandomByte(){return 16*safeMathRandom()}function uuid4(e=getCrypto()){try{if(e?.randomUUID)return withRandomSafeContext((()=>e.randomUUID())).replace(/-/g,"")}catch{}return emptyUuid||(emptyUuid=[1e7]+1e3+4e3+8e3+1e11),emptyUuid.replace(/[018]/g,(e=>(e^(15&getRandomByte())>>e/4).toString(16)))}function getFirstException(e){return e.exception?.values?.[0]}function getEventDescription(e){const{message:t,event_id:r}=e;if(t)return t;const n=getFirstException(e);return n?n.type&&n.value?`${n.type}: ${n.value}`:n.type||n.value||r||"<unknown>":r||"<unknown>"}function addExceptionTypeValue(e,t,r){const n=e.exception=e.exception||{},i=n.values=n.values||[],a=i[0]=i[0]||{};a.value||(a.value=t||""),a.type||(a.type="Error")}function addExceptionMechanism(e,t){const r=getFirstException(e);if(!r)return;const n=r.mechanism;if(r.mechanism={type:"generic",handled:!0,...n,...t},t&&"data"in t){const e={...n?.data,...t.data};r.mechanism.data=e}}function checkOrSetAlreadyCaught(e){if(isAlreadyCaptured(e))return!0;try{addNonEnumerableProperty(e,"__sentry_captured__",!0)}catch{}return!1}function isAlreadyCaptured(e){try{return e.__sentry_captured__}catch{}}const ONE_SECOND_IN_MS=1e3;function dateTimestampInSeconds(){return safeDateNow()/ONE_SECOND_IN_MS}function createUnixTimestampInSecondsFunc(){const{performance:e}=GLOBAL_OBJ;if(!e?.now||!e.timeOrigin)return dateTimestampInSeconds;const t=e.timeOrigin;return()=>(t+withRandomSafeContext((()=>e.now())))/ONE_SECOND_IN_MS}let _cachedTimestampInSeconds;function timestampInSeconds(){return(_cachedTimestampInSeconds??(_cachedTimestampInSeconds=createUnixTimestampInSecondsFunc()))()}function makeSession(e){const t=timestampInSeconds(),r={sid:uuid4(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>sessionToJSON(r)};return e&&updateSession(r,e),r}function updateSession(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),e.did||t.did||(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||timestampInSeconds(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=32===t.sid.length?t.sid:uuid4()),void 0!==t.init&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),"number"==typeof t.started&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if("number"==typeof t.duration)e.duration=t.duration;else{const t=e.timestamp-e.started;e.duration=t>=0?t:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),"number"==typeof t.errors&&(e.errors=t.errors),t.status&&(e.status=t.status)}function closeSession(e,t){let r={};"ok"===e.status&&(r={status:"exited"}),updateSession(e,r)}function sessionToJSON(e){return{sid:`${e.sid}`,init:e.init,started:new Date(1e3*e.started).toISOString(),timestamp:new Date(1e3*e.timestamp).toISOString(),status:e.status,errors:e.errors,did:"number"==typeof e.did||"string"==typeof e.did?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function merge(e,t,r=2){if(!t||"object"!=typeof t||r<=0)return t;if(e&&0===Object.keys(t).length)return e;const n={...e};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=merge(n[e],t[e],r-1));return n}function generateTraceId(){return uuid4()}function generateSpanId(){return uuid4().substring(16)}const SCOPE_SPAN_FIELD="_sentrySpan";function _setSpanForScope(e,t){t?addNonEnumerableProperty(e,SCOPE_SPAN_FIELD,t):delete e[SCOPE_SPAN_FIELD]}function _getSpanForScope(e){return e[SCOPE_SPAN_FIELD]}const DEFAULT_MAX_BREADCRUMBS=100;class Scope{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:generateTraceId(),sampleRand:safeMathRandom()}}clone(){const e=new Scope;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,_setSpanForScope(e,_getSpanForScope(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&updateSession(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,t){return this.setTags({[e]:t})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,t){return this.setAttributes({[e]:t})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,t){return this._extra={...this._extra,[e]:t},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,t){return null===t?delete this._contexts[e]:this._contexts[e]=t,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const t="function"==typeof e?e(this):e,r=t instanceof Scope?t.getScopeData():isPlainObject(t)?e:void 0,{tags:n,attributes:i,extra:a,user:o,contexts:s,level:l,fingerprint:c=[],propagationContext:d,conversationId:u}=r||{};return this._tags={...this._tags,...n},this._attributes={...this._attributes,...i},this._extra={...this._extra,...a},this._contexts={...this._contexts,...s},o&&Object.keys(o).length&&(this._user=o),l&&(this._level=l),c.length&&(this._fingerprint=c),d&&(this._propagationContext=d),u&&(this._conversationId=u),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,_setSpanForScope(this,void 0),this._attachments=[],this.setPropagationContext({traceId:generateTraceId(),sampleRand:safeMathRandom()}),this._notifyScopeListeners(),this}addBreadcrumb(e,t){const r="number"==typeof t?t:DEFAULT_MAX_BREADCRUMBS;if(r<=0)return this;const n={timestamp:dateTimestampInSeconds(),...e,message:e.message?truncate(e.message,2048):e.message};return this._breadcrumbs.push(n),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:_getSpanForScope(this),conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=merge(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,t){const r=t?.event_id||uuid4();if(!this._client)return DEBUG_BUILD$2&&debug.warn("No client configured on scope - will not capture exception!"),r;const n=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:n,...t,event_id:r},this),r}captureMessage(e,t,r){const n=r?.event_id||uuid4();if(!this._client)return DEBUG_BUILD$2&&debug.warn("No client configured on scope - will not capture message!"),n;const i=r?.syntheticException??new Error(e);return this._client.captureMessage(e,t,{originalException:e,syntheticException:i,...r,event_id:n},this),n}captureEvent(e,t){const r=e.event_id||t?.event_id||uuid4();return this._client?(this._client.captureEvent(e,{...t,event_id:r},this),r):(DEBUG_BUILD$2&&debug.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach((e=>{e(this)})),this._notifyingListeners=!1)}}function getDefaultCurrentScope(){return getGlobalSingleton("defaultCurrentScope",(()=>new Scope))}function getDefaultIsolationScope(){return getGlobalSingleton("defaultIsolationScope",(()=>new Scope))}class AsyncContextStack{constructor(e,t){let r,n;r=e||new Scope,n=t||new Scope,this._stack=[{scope:r}],this._isolationScope=n}withScope(e){const t=this._pushScope();let r;try{r=e(t)}catch(e){throw this._popScope(),e}return isThenable(r)?r.then((e=>(this._popScope(),e)),(e=>{throw this._popScope(),e})):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return!(this._stack.length<=1)&&!!this._stack.pop()}}function getAsyncContextStack(){const e=getSentryCarrier(getMainCarrier());return e.stack=e.stack||new AsyncContextStack(getDefaultCurrentScope(),getDefaultIsolationScope())}function withScope$1(e){return getAsyncContextStack().withScope(e)}function withSetScope(e,t){const r=getAsyncContextStack();return r.withScope((()=>(r.getStackTop().scope=e,t(e))))}function withIsolationScope(e){return getAsyncContextStack().withScope((()=>e(getAsyncContextStack().getIsolationScope())))}function getStackAsyncContextStrategy(){return{withIsolationScope:withIsolationScope,withScope:withScope$1,withSetScope:withSetScope,withSetIsolationScope:(e,t)=>withIsolationScope(t),getCurrentScope:()=>getAsyncContextStack().getScope(),getIsolationScope:()=>getAsyncContextStack().getIsolationScope()}}function getAsyncContextStrategy(e){const t=getSentryCarrier(e);return t.acs?t.acs:getStackAsyncContextStrategy()}function getCurrentScope(){return getAsyncContextStrategy(getMainCarrier()).getCurrentScope()}function getIsolationScope(){return getAsyncContextStrategy(getMainCarrier()).getIsolationScope()}function getGlobalScope(){return getGlobalSingleton("globalScope",(()=>new Scope))}function withScope(...e){const t=getAsyncContextStrategy(getMainCarrier());if(2===e.length){const[r,n]=e;return r?t.withSetScope(r,n):t.withScope(n)}return t.withScope(e[0])}function getClient(){return getCurrentScope().getClient()}function getTraceContextFromScope(e){const t=e.getPropagationContext(),{traceId:r,parentSpanId:n,propagationSpanId:i}=t,a={trace_id:r,span_id:i||generateSpanId()};return n&&(a.parent_span_id=n),a}const SEMANTIC_ATTRIBUTE_SENTRY_SOURCE="sentry.source",SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE="sentry.sample_rate",SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE="sentry.previous_trace_sample_rate",SEMANTIC_ATTRIBUTE_SENTRY_OP="sentry.op",SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN="sentry.origin",SEMANTIC_ATTRIBUTE_PROFILE_ID="sentry.profile_id",SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME="sentry.exclusive_time",GEN_AI_CONVERSATION_ID_ATTRIBUTE="gen_ai.conversation.id",SPAN_STATUS_UNSET=0,SPAN_STATUS_OK=1,SCOPE_ON_START_SPAN_FIELD="_sentryScope",ISOLATION_SCOPE_ON_START_SPAN_FIELD="_sentryIsolationScope";function unwrapScopeFromWeakRef(e){if(e){if("object"==typeof e&&"deref"in e&&"function"==typeof e.deref)try{return e.deref()}catch{return}return e}}function getCapturedScopesOnSpan(e){const t=e;return{scope:t[SCOPE_ON_START_SPAN_FIELD],isolationScope:unwrapScopeFromWeakRef(t[ISOLATION_SCOPE_ON_START_SPAN_FIELD])}}const SENTRY_BAGGAGE_KEY_PREFIX="sentry-";function baggageHeaderToDynamicSamplingContext(e){const t=parseBaggageHeader(e);if(!t)return;const r=Object.entries(t).reduce(((e,[t,r])=>{if(t.startsWith(SENTRY_BAGGAGE_KEY_PREFIX)){e[t.slice(SENTRY_BAGGAGE_KEY_PREFIX.length)]=r}return e}),{});return Object.keys(r).length>0?r:void 0}function parseBaggageHeader(e){if(e&&(isString(e)||Array.isArray(e)))return Array.isArray(e)?e.reduce(((e,t)=>{const r=baggageHeaderToObject(t);return Object.entries(r).forEach((([t,r])=>{e[t]=r})),e}),{}):baggageHeaderToObject(e)}function baggageHeaderToObject(e){return e.split(",").map((e=>{const t=e.indexOf("=");if(-1===t)return[];return[e.slice(0,t),e.slice(t+1)].map((e=>{try{return decodeURIComponent(e.trim())}catch{return}}))})).reduce(((e,[t,r])=>(t&&r&&(e[t]=r),e)),{})}const ORG_ID_REGEX=/^o(\d+)\./,DSN_REGEX=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function isValidProtocol(e){return"http"===e||"https"===e}function dsnToString(e,t=!1){const{host:r,path:n,pass:i,port:a,projectId:o,protocol:s,publicKey:l}=e;return`${s}://${l}${t&&i?`:${i}`:""}@${r}${a?`:${a}`:""}/${n?`${n}/`:n}${o}`}function dsnFromString(e){const t=DSN_REGEX.exec(e);if(!t)return void consoleSandbox((()=>{console.error(`Invalid Sentry Dsn: ${e}`)}));const[r,n,i="",a="",o="",s=""]=t.slice(1);let l="",c=s;const d=c.split("/");if(d.length>1&&(l=d.slice(0,-1).join("/"),c=d.pop()),c){const e=c.match(/^\d+/);e&&(c=e[0])}return dsnFromComponents({host:a,pass:i,path:l,projectId:c,port:o,protocol:r,publicKey:n})}function dsnFromComponents(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function validateDsn(e){if(!DEBUG_BUILD$2)return!0;const{port:t,projectId:r,protocol:n}=e;return!["protocol","publicKey","host","projectId"].find((t=>!e[t]&&(debug.error(`Invalid Sentry Dsn: ${t} missing`),!0)))&&(r.match(/^\d+$/)?isValidProtocol(n)?!t||!isNaN(parseInt(t,10))||(debug.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):(debug.error(`Invalid Sentry Dsn: Invalid protocol ${n}`),!1):(debug.error(`Invalid Sentry Dsn: Invalid projectId ${r}`),!1))}function extractOrgIdFromDsnHost(e){const t=e.match(ORG_ID_REGEX);return t?.[1]}function extractOrgIdFromClient(e){const t=e.getOptions(),{host:r}=e.getDsn()||{};let n;return t.orgId?n=String(t.orgId):r&&(n=extractOrgIdFromDsnHost(r)),n}function makeDsn(e){const t="string"==typeof e?dsnFromString(e):dsnFromComponents(e);if(t&&validateDsn(t))return t}function parseSampleRate(e){if("boolean"==typeof e)return Number(e);const t="string"==typeof e?parseFloat(e):e;return"number"!=typeof t||isNaN(t)||t<0||t>1?void 0:t}const TRACE_FLAG_SAMPLED=1;let hasShownSpanDropWarning=!1;function spanToTraceContext(e){const{spanId:t,traceId:r,isRemote:n}=e.spanContext(),i=n?t:spanToJSON(e).parent_span_id,a=getCapturedScopesOnSpan(e).scope;return{parent_span_id:i,span_id:n?a?.getPropagationContext().propagationSpanId||generateSpanId():t,trace_id:r}}function convertSpanLinksForEnvelope(e){return e&&e.length>0?e.map((({context:{spanId:e,traceId:t,traceFlags:r,...n},attributes:i})=>({span_id:e,trace_id:t,sampled:r===TRACE_FLAG_SAMPLED,attributes:i,...n}))):void 0}function spanTimeInputToSeconds(e){return"number"==typeof e?ensureTimestampInSeconds(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?ensureTimestampInSeconds(e.getTime()):timestampInSeconds()}function ensureTimestampInSeconds(e){return e>9999999999?e/1e3:e}function spanToJSON(e){if(spanIsSentrySpan(e))return e.getSpanJSON();const{spanId:t,traceId:r}=e.spanContext();if(spanIsOpenTelemetrySdkTraceBaseSpan(e)){const{attributes:n,startTime:i,name:a,endTime:o,status:s,links:l}=e;return{span_id:t,trace_id:r,data:n,description:a,parent_span_id:"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0,start_timestamp:spanTimeInputToSeconds(i),timestamp:spanTimeInputToSeconds(o)||void 0,status:getStatusMessage(s),op:n[SEMANTIC_ATTRIBUTE_SENTRY_OP],origin:n[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN],links:convertSpanLinksForEnvelope(l)}}return{span_id:t,trace_id:r,start_timestamp:0,data:{}}}function spanIsOpenTelemetrySdkTraceBaseSpan(e){const t=e;return!!(t.attributes&&t.startTime&&t.name&&t.endTime&&t.status)}function spanIsSentrySpan(e){return"function"==typeof e.getSpanJSON}function spanIsSampled(e){const{traceFlags:t}=e.spanContext();return t===TRACE_FLAG_SAMPLED}function getStatusMessage(e){if(e&&e.code!==SPAN_STATUS_UNSET)return e.code===SPAN_STATUS_OK?"ok":e.message||"internal_error"}const ROOT_SPAN_FIELD="_sentryRootSpan";function getRootSpan(e){return e[ROOT_SPAN_FIELD]||e}function showSpanDropWarning(){hasShownSpanDropWarning||(consoleSandbox((()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")})),hasShownSpanDropWarning=!0)}function hasSpansEnabled(e){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const t=getClient()?.getOptions();return!(!t||null==t.tracesSampleRate&&!t.tracesSampler)}function logIgnoredSpan(e){debug.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function shouldIgnoreSpan(e,t){if(!t?.length||!e.description)return!1;for(const r of t){if(isStringOrRegExp(r)){if(isMatchingPattern(e.description,r))return DEBUG_BUILD$2&&logIgnoredSpan(e),!0;continue}if(!r.name&&!r.op)continue;const t=!r.name||isMatchingPattern(e.description,r.name),n=!r.op||e.op&&isMatchingPattern(e.op,r.op);if(t&&n)return DEBUG_BUILD$2&&logIgnoredSpan(e),!0}return!1}function reparentChildSpans(e,t){const r=t.parent_span_id,n=t.span_id;if(r)for(const t of e)t.parent_span_id===n&&(t.parent_span_id=r)}function isStringOrRegExp(e){return"string"==typeof e||e instanceof RegExp}const DEFAULT_ENVIRONMENT="production",FROZEN_DSC_FIELD="_frozenDsc";function getDynamicSamplingContextFromClient(e,t){const r=t.getOptions(),{publicKey:n}=t.getDsn()||{},i={environment:r.environment||DEFAULT_ENVIRONMENT,release:r.release,public_key:n,trace_id:e,org_id:extractOrgIdFromClient(t)};return t.emit("createDsc",i),i}function getDynamicSamplingContextFromScope(e,t){const r=t.getPropagationContext();return r.dsc||getDynamicSamplingContextFromClient(r.traceId,e)}function getDynamicSamplingContextFromSpan(e){const t=getClient();if(!t)return{};const r=getRootSpan(e),n=spanToJSON(r),i=n.data,a=r.spanContext().traceState,o=a?.get("sentry.sample_rate")??i[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE]??i[SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE];function s(e){return"number"!=typeof o&&"string"!=typeof o||(e.sample_rate=`${o}`),e}const l=r[FROZEN_DSC_FIELD];if(l)return s(l);const c=a?.get("sentry.dsc"),d=c&&baggageHeaderToDynamicSamplingContext(c);if(d)return s(d);const u=getDynamicSamplingContextFromClient(e.spanContext().traceId,t),p=i[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE],h=n.description;return"url"!==p&&h&&(u.transaction=h),hasSpansEnabled()&&(u.sampled=String(spanIsSampled(r)),u.sample_rand=a?.get("sentry.sample_rand")??getCapturedScopesOnSpan(r).scope?.getPropagationContext().sampleRand.toString()),s(u),t.emit("createDsc",u,r),u}function normalize(e,t=100,r=1/0){try{return visit("",e,t,r)}catch(e){return{ERROR:`**non-serializable** (${e})`}}}function normalizeToSize(e,t=3,r=102400){const n=normalize(e,t);return jsonSize(n)>r?normalizeToSize(e,t-1,r):n}function visit(e,t,r=1/0,n=1/0,i=memoBuilder()){const[a,o]=i;if(null==t||["boolean","string"].includes(typeof t)||"number"==typeof t&&Number.isFinite(t))return t;const s=stringifyValue(e,t);if(!s.startsWith("[object "))return s;if(t.__sentry_skip_normalization__)return t;const l="number"==typeof t.__sentry_override_normalization_depth__?t.__sentry_override_normalization_depth__:r;if(0===l)return s.replace("object ","");if(a(t))return"[Circular ~]";const c=t;if(c&&"function"==typeof c.toJSON)try{return visit("",c.toJSON(),l-1,n,i)}catch{}const d=Array.isArray(t)?[]:{};let u=0;const p=convertToPlainObject(t);for(const e in p){if(!Object.prototype.hasOwnProperty.call(p,e))continue;if(u>=n){d[e]="[MaxProperties ~]";break}const t=p[e];d[e]=visit(e,t,l-1,n,i),u++}return o(t),d}function stringifyValue(e,t){try{if("domain"===e&&t&&"object"==typeof t&&t._events)return"[Domain]";if("domainEmitter"===e)return"[DomainEmitter]";if("undefined"!=typeof global&&t===global)return"[Global]";if("undefined"!=typeof window&&t===window)return"[Window]";if("undefined"!=typeof document&&t===document)return"[Document]";if(isVueViewModel(t))return getVueInternalName(t);if(isSyntheticEvent(t))return"[SyntheticEvent]";if("number"==typeof t&&!Number.isFinite(t))return`[${t}]`;if("function"==typeof t)return`[Function: ${getFunctionName(t)}]`;if("symbol"==typeof t)return`[${String(t)}]`;if("bigint"==typeof t)return`[BigInt: ${String(t)}]`;const r=getConstructorName(t);return/^HTML(\w*)Element$/.test(r)?`[HTMLElement: ${r}]`:`[object ${r}]`}catch(e){return`**non-serializable** (${e})`}}function getConstructorName(e){const t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function utf8Length(e){return~-encodeURI(e).split(/%..|./).length}function jsonSize(e){return utf8Length(JSON.stringify(e))}function memoBuilder(){const e=new WeakSet;return[function(t){return!!e.has(t)||(e.add(t),!1)},function(t){e.delete(t)}]}function createEnvelope(e,t=[]){return[e,t]}function addItemToEnvelope(e,t){const[r,n]=e;return[r,[...n,t]]}function forEachEnvelopeItem(e,t){const r=e[1];for(const e of r){if(t(e,e[0].type))return!0}return!1}function envelopeContainsItemType(e,t){return forEachEnvelopeItem(e,((e,r)=>t.includes(r)))}function encodeUTF8(e){const t=getSentryCarrier(GLOBAL_OBJ);return t.encodePolyfill?t.encodePolyfill(e):(new TextEncoder).encode(e)}function serializeEnvelope(e){const[t,r]=e;let n=JSON.stringify(t);function i(e){"string"==typeof n?n="string"==typeof e?n+e:[encodeUTF8(n),e]:n.push("string"==typeof e?encodeUTF8(e):e)}for(const e of r){const[t,r]=e;if(i(`\n${JSON.stringify(t)}\n`),"string"==typeof r||r instanceof Uint8Array)i(r);else{let e;try{e=JSON.stringify(r)}catch{e=JSON.stringify(normalize(r))}i(e)}}return"string"==typeof n?n:concatBuffers(n)}function concatBuffers(e){const t=e.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(t);let n=0;for(const t of e)r.set(t,n),n+=t.length;return r}function createAttachmentEnvelopeItem(e){const t="string"==typeof e.data?encodeUTF8(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}const DATA_CATEGORY_OVERRIDES={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function _isOverriddenType(e){return e in DATA_CATEGORY_OVERRIDES}function envelopeItemTypeToDataCategory(e){return _isOverriddenType(e)?DATA_CATEGORY_OVERRIDES[e]:e}function getSdkMetadataForEnvelopeHeader(e){if(!e?.sdk)return;const{name:t,version:r}=e.sdk;return{name:t,version:r}}function createEventEnvelopeHeaders(e,t,r,n){const i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:(new Date).toISOString(),...t&&{sdk:t},...!!r&&n&&{dsn:dsnToString(n)},...i&&{trace:i}}}function _enhanceEventWithSdkInfo(e,t){if(!t)return e;const r=e.sdk||{};return e.sdk={...r,name:r.name||t.name,version:r.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function createSessionEnvelope(e,t,r,n){const i=getSdkMetadataForEnvelopeHeader(r);return createEnvelope({sent_at:(new Date).toISOString(),...i&&{sdk:i},...!!n&&t&&{dsn:dsnToString(t)}},["aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()]])}function createEventEnvelope(e,t,r,n){const i=getSdkMetadataForEnvelopeHeader(r),a=e.type&&"replay_event"!==e.type?e.type:"event";_enhanceEventWithSdkInfo(e,r?.sdk);const o=createEventEnvelopeHeaders(e,i,n,t);delete e.sdkProcessingMetadata;return createEnvelope(o,[[{type:a},e]])}const STATE_PENDING=0,STATE_RESOLVED=1,STATE_REJECTED=2;function resolvedSyncPromise(e){return new SyncPromise((t=>{t(e)}))}function rejectedSyncPromise(e){return new SyncPromise(((t,r)=>{r(e)}))}class SyncPromise{constructor(e){this._state=STATE_PENDING,this._handlers=[],this._runExecutor(e)}then(e,t){return new SyncPromise(((r,n)=>{this._handlers.push([!1,t=>{if(e)try{r(e(t))}catch(e){n(e)}else r(t)},e=>{if(t)try{r(t(e))}catch(e){n(e)}else n(e)}]),this._executeHandlers()}))}catch(e){return this.then((e=>e),e)}finally(e){return new SyncPromise(((t,r)=>{let n,i;return this.then((t=>{i=!1,n=t,e&&e()}),(t=>{i=!0,n=t,e&&e()})).then((()=>{i?r(n):t(n)}))}))}_executeHandlers(){if(this._state===STATE_PENDING)return;const e=this._handlers.slice();this._handlers=[],e.forEach((e=>{e[0]||(this._state===STATE_RESOLVED&&e[1](this._value),this._state===STATE_REJECTED&&e[2](this._value),e[0]=!0)}))}_runExecutor(e){const t=(e,t)=>{this._state===STATE_PENDING&&(isThenable(t)?t.then(r,n):(this._state=e,this._value=t,this._executeHandlers()))},r=e=>{t(STATE_RESOLVED,e)},n=e=>{t(STATE_REJECTED,e)};try{e(r,n)}catch(e){n(e)}}}function notifyEventProcessors(e,t,r,n=0){try{const i=_notifyEventProcessors(t,r,e,n);return isThenable(i)?i:resolvedSyncPromise(i)}catch(e){return rejectedSyncPromise(e)}}function _notifyEventProcessors(e,t,r,n){const i=r[n];if(!e||!i)return e;const a=i({...e},t);return DEBUG_BUILD$2&&null===a&&debug.log(`Event processor "${i.id||"?"}" dropped event`),isThenable(a)?a.then((e=>_notifyEventProcessors(e,t,r,n+1))):_notifyEventProcessors(a,t,r,n+1)}let parsedStackResults,lastSentryKeysCount,lastNativeKeysCount,cachedFilenameDebugIds;function getFilenameToDebugIdMap(e){const t=GLOBAL_OBJ._sentryDebugIds,r=GLOBAL_OBJ._debugIds;if(!t&&!r)return{};const n=t?Object.keys(t):[],i=r?Object.keys(r):[];if(cachedFilenameDebugIds&&n.length===lastSentryKeysCount&&i.length===lastNativeKeysCount)return cachedFilenameDebugIds;lastSentryKeysCount=n.length,lastNativeKeysCount=i.length,cachedFilenameDebugIds={},parsedStackResults||(parsedStackResults={});const a=(t,r)=>{for(const n of t){const t=r[n],i=parsedStackResults?.[n];if(i&&cachedFilenameDebugIds&&t)cachedFilenameDebugIds[i[0]]=t,parsedStackResults&&(parsedStackResults[n]=[i[0],t]);else if(t){const r=e(n);for(let e=r.length-1;e>=0;e--){const i=r[e],a=i?.filename;if(a&&cachedFilenameDebugIds&&parsedStackResults){cachedFilenameDebugIds[a]=t,parsedStackResults[n]=[a,t];break}}}}};return t&&a(n,t),r&&a(i,r),cachedFilenameDebugIds}function applyScopeDataToEvent(e,t){const{fingerprint:r,span:n,breadcrumbs:i,sdkProcessingMetadata:a}=t;applyDataToEvent(e,t),n&&applySpanToEvent(e,n),applyFingerprintToEvent(e,r),applyBreadcrumbsToEvent(e,i),applySdkMetadataToEvent(e,a)}function mergeScopeData(e,t){const{extra:r,tags:n,attributes:i,user:a,contexts:o,level:s,sdkProcessingMetadata:l,breadcrumbs:c,fingerprint:d,eventProcessors:u,attachments:p,propagationContext:h,transactionName:f,span:m}=t;mergeAndOverwriteScopeData(e,"extra",r),mergeAndOverwriteScopeData(e,"tags",n),mergeAndOverwriteScopeData(e,"attributes",i),mergeAndOverwriteScopeData(e,"user",a),mergeAndOverwriteScopeData(e,"contexts",o),e.sdkProcessingMetadata=merge(e.sdkProcessingMetadata,l,2),s&&(e.level=s),f&&(e.transactionName=f),m&&(e.span=m),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),d.length&&(e.fingerprint=[...e.fingerprint,...d]),u.length&&(e.eventProcessors=[...e.eventProcessors,...u]),p.length&&(e.attachments=[...e.attachments,...p]),e.propagationContext={...e.propagationContext,...h}}function mergeAndOverwriteScopeData(e,t,r){e[t]=merge(e[t],r,1)}function getCombinedScopeData(e,t){const r=getGlobalScope().getScopeData();return e&&mergeScopeData(r,e.getScopeData()),t&&mergeScopeData(r,t.getScopeData()),r}function applyDataToEvent(e,t){const{extra:r,tags:n,user:i,contexts:a,level:o,transactionName:s}=t;Object.keys(r).length&&(e.extra={...r,...e.extra}),Object.keys(n).length&&(e.tags={...n,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(a).length&&(e.contexts={...a,...e.contexts}),o&&(e.level=o),s&&"transaction"!==e.type&&(e.transaction=s)}function applyBreadcrumbsToEvent(e,t){const r=[...e.breadcrumbs||[],...t];e.breadcrumbs=r.length?r:void 0}function applySdkMetadataToEvent(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function applySpanToEvent(e,t){e.contexts={trace:spanToTraceContext(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:getDynamicSamplingContextFromSpan(t),...e.sdkProcessingMetadata};const r=spanToJSON(getRootSpan(t)).description;r&&!e.transaction&&"transaction"===e.type&&(e.transaction=r)}function applyFingerprintToEvent(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function prepareEvent(e,t,r,n,i,a){const{normalizeDepth:o=3,normalizeMaxBreadth:s=1e3}=e,l={...t,event_id:t.event_id||r.event_id||uuid4(),timestamp:t.timestamp||dateTimestampInSeconds()},c=r.integrations||e.integrations.map((e=>e.name));applyClientOptions(l,e),applyIntegrationsMetadata(l,c),i&&i.emit("applyFrameMetadata",t),void 0===t.type&&applyDebugIds(l,e.stackParser);const d=getFinalScope(n,r.captureContext);r.mechanism&&addExceptionMechanism(l,r.mechanism);const u=i?i.getEventProcessors():[],p=getCombinedScopeData(a,d),h=[...r.attachments||[],...p.attachments];h.length&&(r.attachments=h),applyScopeDataToEvent(l,p);const f=[...u,...p.eventProcessors];return(r.data&&!0===r.data.__sentry__?resolvedSyncPromise(l):notifyEventProcessors(f,l,r)).then((e=>(e&&applyDebugMeta(e),"number"==typeof o&&o>0?normalizeEvent(e,o,s):e)))}function applyClientOptions(e,t){const{environment:r,release:n,dist:i,maxValueLength:a}=t;e.environment=e.environment||r||DEFAULT_ENVIRONMENT,!e.release&&n&&(e.release=n),!e.dist&&i&&(e.dist=i);const o=e.request;o?.url&&a&&(o.url=truncate(o.url,a)),a&&e.exception?.values?.forEach((e=>{e.value&&(e.value=truncate(e.value,a))}))}function applyDebugIds(e,t){const r=getFilenameToDebugIdMap(t);e.exception?.values?.forEach((e=>{e.stacktrace?.frames?.forEach((e=>{e.filename&&(e.debug_id=r[e.filename])}))}))}function applyDebugMeta(e){const t={};if(e.exception?.values?.forEach((e=>{e.stacktrace?.frames?.forEach((e=>{e.debug_id&&(e.abs_path?t[e.abs_path]=e.debug_id:e.filename&&(t[e.filename]=e.debug_id),delete e.debug_id)}))})),0===Object.keys(t).length)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const r=e.debug_meta.images;Object.entries(t).forEach((([e,t])=>{r.push({type:"sourcemap",code_file:e,debug_id:t})}))}function applyIntegrationsMetadata(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function normalizeEvent(e,t,r){if(!e)return null;const n={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map((e=>({...e,...e.data&&{data:normalize(e.data,t,r)}})))},...e.user&&{user:normalize(e.user,t,r)},...e.contexts&&{contexts:normalize(e.contexts,t,r)},...e.extra&&{extra:normalize(e.extra,t,r)}};return e.contexts?.trace&&n.contexts&&(n.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(n.contexts.trace.data=normalize(e.contexts.trace.data,t,r))),e.spans&&(n.spans=e.spans.map((e=>({...e,...e.data&&{data:normalize(e.data,t,r)}})))),e.contexts?.flags&&n.contexts&&(n.contexts.flags=normalize(e.contexts.flags,3,r)),n}function getFinalScope(e,t){if(!t)return e;const r=e?e.clone():new Scope;return r.update(t),r}function parseEventHintOrCaptureContext(e){}function captureException(e,t){return getCurrentScope().captureException(e,parseEventHintOrCaptureContext())}function captureMessage(e,t){const r="string"==typeof t?t:void 0,n="string"!=typeof t?{captureContext:t}:void 0;return getCurrentScope().captureMessage(e,r,n)}function captureEvent(e,t){return getCurrentScope().captureEvent(e,t)}function startSession(e){const t=getIsolationScope(),{user:r}=getCombinedScopeData(t,getCurrentScope()),{userAgent:n}=GLOBAL_OBJ.navigator||{},i=makeSession({user:r,...n&&{userAgent:n},...e}),a=t.getSession();return"ok"===a?.status&&updateSession(a,{status:"exited"}),endSession(),t.setSession(i),i}function endSession(){const e=getIsolationScope(),t=getCurrentScope().getSession()||e.getSession();t&&closeSession(t),_sendSessionUpdate(),e.setSession()}function _sendSessionUpdate(){const e=getIsolationScope(),t=getClient(),r=e.getSession();r&&t&&t.captureSession(r)}function captureSession(e=!1){e?endSession():_sendSessionUpdate()}const SENTRY_API_VERSION="7";function getBaseApiEndpoint(e){const t=e.protocol?`${e.protocol}:`:"",r=e.port?`:${e.port}`:"";return`${t}//${e.host}${r}${e.path?`/${e.path}`:""}/api/`}function _getIngestEndpoint(e){return`${getBaseApiEndpoint(e)}${e.projectId}/envelope/`}function _encodedAuth(e,t){const r={sentry_version:SENTRY_API_VERSION};return e.publicKey&&(r.sentry_key=e.publicKey),t&&(r.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(r).toString()}function getEnvelopeEndpointWithUrlEncodedAuth(e,t,r){return t||`${_getIngestEndpoint(e)}?${_encodedAuth(e,r)}`}const installedIntegrations=[];function filterDuplicates(e){const t={};return e.forEach((e=>{const{name:r}=e,n=t[r];n&&!n.isDefaultInstance&&e.isDefaultInstance||(t[r]=e)})),Object.values(t)}function getIntegrationsToSetup(e){const t=e.defaultIntegrations||[],r=e.integrations;let n;if(t.forEach((e=>{e.isDefaultInstance=!0})),Array.isArray(r))n=[...t,...r];else if("function"==typeof r){const e=r(t);n=Array.isArray(e)?e:[e]}else n=t;return filterDuplicates(n)}function setupIntegrations(e,t){const r={};return t.forEach((t=>{t&&setupIntegration(e,t,r)})),r}function afterSetupIntegrations(e,t){for(const r of t)r?.afterAllSetup&&r.afterAllSetup(e)}function setupIntegration(e,t,r){if(r[t.name])DEBUG_BUILD$2&&debug.log(`Integration skipped because it was already installed: ${t.name}`);else{if(r[t.name]=t,installedIntegrations.includes(t.name)||"function"!=typeof t.setupOnce||(t.setupOnce(),installedIntegrations.push(t.name)),t.setup&&"function"==typeof t.setup&&t.setup(e),"function"==typeof t.preprocessEvent){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",((t,n)=>r(t,n,e)))}if("function"==typeof t.processEvent){const r=t.processEvent.bind(t),n=Object.assign(((t,n)=>r(t,n,e)),{id:t.name});e.addEventProcessor(n)}DEBUG_BUILD$2&&debug.log(`Integration installed: ${t.name}`)}}function defineIntegration(e){return e}function createLogContainerEnvelopeItem(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function createLogEnvelope(e,t,r,n){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),r&&n&&(i.dsn=dsnToString(n)),createEnvelope(i,[createLogContainerEnvelopeItem(e)])}function _INTERNAL_flushLogsBuffer(e,t){const r=t??_INTERNAL_getLogBuffer(e)??[];if(0===r.length)return;const n=e.getOptions(),i=createLogEnvelope(r,n._metadata,n.tunnel,e.getDsn());_getBufferMap$1().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function _INTERNAL_getLogBuffer(e){return _getBufferMap$1().get(e)}function _getBufferMap$1(){return getGlobalSingleton("clientToLogBufferMap",(()=>new WeakMap))}function createMetricContainerEnvelopeItem(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function createMetricEnvelope(e,t,r,n){const i={};return t?.sdk&&(i.sdk={name:t.sdk.name,version:t.sdk.version}),r&&n&&(i.dsn=dsnToString(n)),createEnvelope(i,[createMetricContainerEnvelopeItem(e)])}function _INTERNAL_flushMetricsBuffer(e,t){const r=t??_INTERNAL_getMetricBuffer(e)??[];if(0===r.length)return;const n=e.getOptions(),i=createMetricEnvelope(r,n._metadata,n.tunnel,e.getDsn());_getBufferMap().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function _INTERNAL_getMetricBuffer(e){return _getBufferMap().get(e)}function _getBufferMap(){return getGlobalSingleton("clientToMetricBufferMap",(()=>new WeakMap))}function safeUnref(e){return"object"==typeof e&&"function"==typeof e.unref&&e.unref(),e}const SENTRY_BUFFER_FULL_ERROR=Symbol.for("SentryBufferFullError");function makePromiseBuffer(e=100){const t=new Set;function r(e){t.delete(e)}return{get $(){return Array.from(t)},add:function(n){if(!(t.size<e))return rejectedSyncPromise(SENTRY_BUFFER_FULL_ERROR);const i=n();return t.add(i),i.then((()=>r(i)),(()=>r(i))),i},drain:function(e){if(!t.size)return resolvedSyncPromise(!0);const r=Promise.allSettled(Array.from(t)).then((()=>!0));if(!e)return r;const n=[r,new Promise((t=>safeUnref(setTimeout((()=>t(!1)),e))))];return Promise.race(n)}}}const DEFAULT_RETRY_AFTER=6e4;function parseRetryAfterHeader(e,t=safeDateNow()){const r=parseInt(`${e}`,10);if(!isNaN(r))return 1e3*r;const n=Date.parse(`${e}`);return isNaN(n)?DEFAULT_RETRY_AFTER:n-t}function disabledUntil(e,t){return e[t]||e.all||0}function isRateLimited(e,t,r=safeDateNow()){return disabledUntil(e,t)>r}function updateRateLimits(e,{statusCode:t,headers:r},n=safeDateNow()){const i={...e},a=r?.["x-sentry-rate-limits"],o=r?.["retry-after"];if(a)for(const e of a.trim().split(",")){const[t,r,,,a]=e.split(":",5),o=parseInt(t,10),s=1e3*(isNaN(o)?60:o);if(r)for(const e of r.split(";"))"metric_bucket"===e&&a&&!a.split(";").includes("custom")||(i[e]=n+s);else i.all=n+s}else o?i.all=n+parseRetryAfterHeader(o,n):429===t&&(i.all=n+6e4);return i}const DEFAULT_TRANSPORT_BUFFER_SIZE=64;function createTransport(e,t,r=makePromiseBuffer(e.bufferSize||DEFAULT_TRANSPORT_BUFFER_SIZE)){let n={};return{send:function(i){const a=[];if(forEachEnvelopeItem(i,((t,r)=>{const i=envelopeItemTypeToDataCategory(r);isRateLimited(n,i)?e.recordDroppedEvent("ratelimit_backoff",i):a.push(t)})),0===a.length)return Promise.resolve({});const o=createEnvelope(i[0],a),s=t=>{envelopeContainsItemType(o,["client_report"])?DEBUG_BUILD$2&&debug.warn(`Dropping client report. Will not send outcomes (reason: ${t}).`):forEachEnvelopeItem(o,((r,n)=>{e.recordDroppedEvent(t,envelopeItemTypeToDataCategory(n))}))};return r.add((()=>t({body:serializeEnvelope(o)}).then((e=>413===e.statusCode?(DEBUG_BUILD$2&&debug.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),s("send_error"),e):(DEBUG_BUILD$2&&void 0!==e.statusCode&&(e.statusCode<200||e.statusCode>=300)&&debug.warn(`Sentry responded with status code ${e.statusCode} to sent event.`),n=updateRateLimits(n,e),e)),(e=>{throw s("network_error"),DEBUG_BUILD$2&&debug.error("Encountered error running transport request:",e),e})))).then((e=>e),(e=>{if(e===SENTRY_BUFFER_FULL_ERROR)return DEBUG_BUILD$2&&debug.error("Skipped sending event because buffer is full."),s("queue_overflow"),Promise.resolve({});throw e}))},flush:e=>r.drain(e)}}function createClientReportEnvelope(e,t,r){return createEnvelope(t?{dsn:t}:{},[[{type:"client_report"},{timestamp:dateTimestampInSeconds(),discarded_events:e}]])}function getPossibleEventMessages(e){const t=[];e.message&&t.push(e.message);try{const r=e.exception.values[e.exception.values.length-1];r?.value&&(t.push(r.value),r.type&&t.push(`${r.type}: ${r.value}`))}catch{}return t}function convertTransactionEventToSpanJson(e){const{trace_id:t,parent_span_id:r,span_id:n,status:i,origin:a,data:o,op:s}=e.contexts?.trace??{};return{data:o??{},description:e.transaction,op:s,parent_span_id:r,span_id:n??"",start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??"",origin:a,profile_id:o?.[SEMANTIC_ATTRIBUTE_PROFILE_ID],exclusive_time:o?.[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME],measurements:e.measurements,is_segment:!0}}function convertSpanJsonToTransactionEvent(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[SEMANTIC_ATTRIBUTE_PROFILE_ID]:e.profile_id},...e.exclusive_time&&{[SEMANTIC_ATTRIBUTE_EXCLUSIVE_TIME]:e.exclusive_time}}}},measurements:e.measurements}}const ALREADY_SEEN_ERROR="Not capturing exception because it's already been captured.",MISSING_RELEASE_FOR_SESSION_ERROR="Discarded session because of missing or non-string release",INTERNAL_ERROR_SYMBOL=Symbol.for("SentryInternalError"),DO_NOT_SEND_EVENT_SYMBOL=Symbol.for("SentryDoNotSendEventError"),DEFAULT_FLUSH_INTERVAL=5e3;function _makeInternalError(e){return{message:e,[INTERNAL_ERROR_SYMBOL]:!0}}function _makeDoNotSendEventError(e){return{message:e,[DO_NOT_SEND_EVENT_SYMBOL]:!0}}function _isInternalError(e){return!!e&&"object"==typeof e&&INTERNAL_ERROR_SYMBOL in e}function _isDoNotSendEventError(e){return!!e&&"object"==typeof e&&DO_NOT_SEND_EVENT_SYMBOL in e}function setupWeightBasedFlushing(e,t,r,n,i){let a,o=0,s=!1;e.on(r,(()=>{o=0,clearTimeout(a),s=!1})),e.on(t,(t=>{o+=n(t),o>=8e5?i(e):s||(s=!0,a=safeUnref(setTimeout((()=>{i(e)}),DEFAULT_FLUSH_INTERVAL)))})),e.on("flush",(()=>{i(e)}))}class Client{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=makePromiseBuffer(e.transportOptions?.bufferSize??DEFAULT_TRANSPORT_BUFFER_SIZE),e.dsn?this._dsn=makeDsn(e.dsn):DEBUG_BUILD$2&&debug.warn("No DSN provided, client will not send events."),this._dsn){const t=getEnvelopeEndpointWithUrlEncodedAuth(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:t})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&setupWeightBasedFlushing(this,"afterCaptureLog","flushLogs",estimateLogSizeInBytes,_INTERNAL_flushLogsBuffer);(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&setupWeightBasedFlushing(this,"afterCaptureMetric","flushMetrics",estimateMetricSizeInBytes,_INTERNAL_flushMetricsBuffer)}captureException(e,t,r){const n=uuid4();if(checkOrSetAlreadyCaught(e))return DEBUG_BUILD$2&&debug.log(ALREADY_SEEN_ERROR),n;const i={event_id:n,...t};return this._process((()=>this.eventFromException(e,i).then((e=>this._captureEvent(e,i,r))).then((e=>e))),"error"),i.event_id}captureMessage(e,t,r,n){const i={event_id:uuid4(),...r},a=isParameterizedString(e)?e:String(e),o=isPrimitive(e),s=o?this.eventFromMessage(a,t,i):this.eventFromException(e,i);return this._process((()=>s.then((e=>this._captureEvent(e,i,n)))),o?"unknown":"error"),i.event_id}captureEvent(e,t,r){const n=uuid4();if(t?.originalException&&checkOrSetAlreadyCaught(t.originalException))return DEBUG_BUILD$2&&debug.log(ALREADY_SEEN_ERROR),n;const i={event_id:n,...t},a=e.sdkProcessingMetadata||{},o=a.capturedSpanScope,s=a.capturedSpanIsolationScope,l=getDataCategoryByType(e.type);return this._process((()=>this._captureEvent(e,i,o||r,s)),l),i.event_id}captureSession(e){this.sendSession(e),updateSession(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const t=this._transport;if(!t)return!0;this.emit("flush");const r=await this._isClientDoneProcessing(e),n=await t.flush(e);return r&&n}async close(e){_INTERNAL_flushLogsBuffer(this);const t=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),t}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some((({name:e})=>e.startsWith("Spotlight"))))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){const t=this._integrations[e.name];setupIntegration(this,e,this._integrations),t||afterSetupIntegrations(this,[e])}sendEvent(e,t={}){this.emit("beforeSendEvent",e,t);let r=createEventEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);for(const e of t.attachments||[])r=addItemToEnvelope(r,createAttachmentEnvelopeItem(e));this.sendEnvelope(r).then((t=>this.emit("afterSendEvent",e,t)))}sendSession(e){const{release:t,environment:r=DEFAULT_ENVIRONMENT}=this._options;if("aggregates"in e){const n=e.attrs||{};if(!n.release&&!t)return void(DEBUG_BUILD$2&&debug.warn(MISSING_RELEASE_FOR_SESSION_ERROR));n.release=n.release||t,n.environment=n.environment||r,e.attrs=n}else{if(!e.release&&!t)return void(DEBUG_BUILD$2&&debug.warn(MISSING_RELEASE_FOR_SESSION_ERROR));e.release=e.release||t,e.environment=e.environment||r}this.emit("beforeSendSession",e);const n=createSessionEnvelope(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(n)}recordDroppedEvent(e,t,r=1){if(this._options.sendClientReports){const n=`${e}:${t}`;DEBUG_BUILD$2&&debug.log(`Recording outcome: "${n}"${r>1?` (${r} times)`:""}`),this._outcomes[n]=(this._outcomes[n]||0)+r}}on(e,t){const r=this._hooks[e]=this._hooks[e]||new Set,n=(...e)=>t(...e);return r.add(n),()=>{r.delete(n)}}emit(e,...t){const r=this._hooks[e];r&&r.forEach((e=>e(...t)))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{return await this._transport.send(e)}catch(e){return DEBUG_BUILD$2&&debug.error("Error while sending envelope:",e),{}}return DEBUG_BUILD$2&&debug.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=setupIntegrations(this,e),afterSetupIntegrations(this,e)}_updateSessionFromEvent(e,t){let r="fatal"===t.level,n=!1;const i=t.exception?.values;if(i){n=!0,r=!1;for(const e of i)if(!1===e.mechanism?.handled){r=!0;break}}const a="ok"===e.status;(a&&0===e.errors||a&&r)&&(updateSession(e,{...r&&{status:"crashed"},errors:e.errors||Number(n||r)}),this.captureSession(e))}async _isClientDoneProcessing(e){let t=0;for(;!e||t<e;){if(await new Promise((e=>setTimeout(e,1))),!this._numProcessing)return!0;t++}return!1}_isEnabled(){return!1!==this.getOptions().enabled&&void 0!==this._transport}_prepareEvent(e,t,r,n){const i=this.getOptions(),a=Object.keys(this._integrations);return!t.integrations&&a?.length&&(t.integrations=a),this.emit("preprocessEvent",e,t),e.type||n.setLastEventId(e.event_id||t.event_id),prepareEvent(i,e,t,r,this,n).then((e=>{if(null===e)return e;this.emit("postprocessEvent",e,t),e.contexts={trace:{...e.contexts?.trace,...getTraceContextFromScope(r)},...e.contexts};const n=getDynamicSamplingContextFromScope(this,r);return e.sdkProcessingMetadata={dynamicSamplingContext:n,...e.sdkProcessingMetadata},e}))}_captureEvent(e,t={},r=getCurrentScope(),n=getIsolationScope()){return DEBUG_BUILD$2&&isErrorEvent(e)&&debug.log(`Captured error event \`${getPossibleEventMessages(e)[0]||"<unknown>"}\``),this._processEvent(e,t,r,n).then((e=>e.event_id),(e=>{DEBUG_BUILD$2&&(_isDoNotSendEventError(e)?debug.log(e.message):_isInternalError(e)?debug.warn(e.message):debug.warn(e))}))}_processEvent(e,t,r,n){const i=this.getOptions(),{sampleRate:a}=i,o=isTransactionEvent(e),s=isErrorEvent(e),l=`before send for type \`${e.type||"error"}\``,c=void 0===a?void 0:parseSampleRate(a);if(s&&"number"==typeof c&&safeMathRandom()>c)return this.recordDroppedEvent("sample_rate","error"),rejectedSyncPromise(_makeDoNotSendEventError(`Discarding event because it's not included in the random sample (sampling rate = ${a})`));const d=getDataCategoryByType(e.type);return this._prepareEvent(e,t,r,n).then((e=>{if(null===e)throw this.recordDroppedEvent("event_processor",d),_makeDoNotSendEventError("An event processor returned `null`, will not send event.");if(!0===t.data?.__sentry__)return e;return _validateBeforeSendResult(processBeforeSend(this,i,e,t),l)})).then((i=>{if(null===i){if(this.recordDroppedEvent("before_send",d),o){const t=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",t)}throw _makeDoNotSendEventError(`${l} returned \`null\`, will not send event.`)}const a=r.getSession()||n.getSession();if(s&&a&&this._updateSessionFromEvent(a,i),o){const e=(i.sdkProcessingMetadata?.spanCountBeforeProcessing||0)-(i.spans?i.spans.length:0);e>0&&this.recordDroppedEvent("before_send","span",e)}const c=i.transaction_info;if(o&&c&&i.transaction!==e.transaction){const e="custom";i.transaction_info={...c,source:e}}return this.sendEvent(i,t),i})).then(null,(e=>{if(_isDoNotSendEventError(e)||_isInternalError(e))throw e;throw this.captureException(e,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:e}),_makeInternalError(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.\nReason: ${e}`)}))}_process(e,t){this._numProcessing++,this._promiseBuffer.add(e).then((e=>(this._numProcessing--,e)),(e=>(this._numProcessing--,e===SENTRY_BUFFER_FULL_ERROR&&this.recordDroppedEvent("queue_overflow",t),e)))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map((([e,t])=>{const[r,n]=e.split(":");return{reason:r,category:n,quantity:t}}))}_flushOutcomes(){DEBUG_BUILD$2&&debug.log("Flushing outcomes...");const e=this._clearOutcomes();if(0===e.length)return void(DEBUG_BUILD$2&&debug.log("No outcomes to send"));if(!this._dsn)return void(DEBUG_BUILD$2&&debug.log("No dsn provided, will not send outcomes"));DEBUG_BUILD$2&&debug.log("Sending outcomes:",e);const t=createClientReportEnvelope(e,this._options.tunnel&&dsnToString(this._dsn));this.sendEnvelope(t)}}function getDataCategoryByType(e){return"replay_event"===e?"replay":e||"error"}function _validateBeforeSendResult(e,t){const r=`${t} must return \`null\` or a valid event.`;if(isThenable(e))return e.then((e=>{if(!isPlainObject(e)&&null!==e)throw _makeInternalError(r);return e}),(e=>{throw _makeInternalError(`${t} rejected with ${e}`)}));if(!isPlainObject(e)&&null!==e)throw _makeInternalError(r);return e}function processBeforeSend(e,t,r,n){const{beforeSend:i,beforeSendTransaction:a,beforeSendSpan:o,ignoreSpans:s}=t;let l=r;if(isErrorEvent(l)&&i)return i(l,n);if(isTransactionEvent(l)){if(o||s){const t=convertTransactionEventToSpanJson(l);if(s?.length&&shouldIgnoreSpan(t,s))return null;if(o){const e=o(t);e?l=merge(r,convertSpanJsonToTransactionEvent(e)):showSpanDropWarning()}if(l.spans){const t=[],r=l.spans;for(const e of r)if(s?.length&&shouldIgnoreSpan(e,s))reparentChildSpans(r,e);else if(o){const r=o(e);r?t.push(r):(showSpanDropWarning(),t.push(e))}else t.push(e);const n=l.spans.length-t.length;n&&e.recordDroppedEvent("before_send","span",n),l.spans=t}}if(a){if(l.spans){const e=l.spans.length;l.sdkProcessingMetadata={...r.sdkProcessingMetadata,spanCountBeforeProcessing:e}}return a(l,n)}}return l}function isErrorEvent(e){return void 0===e.type}function isTransactionEvent(e){return"transaction"===e.type}function estimateMetricSizeInBytes(e){let t=0;return e.name&&(t+=2*e.name.length),t+=8,t+estimateAttributesSizeInBytes(e.attributes)}function estimateLogSizeInBytes(e){let t=0;return e.message&&(t+=2*e.message.length),t+estimateAttributesSizeInBytes(e.attributes)}function estimateAttributesSizeInBytes(e){if(!e)return 0;let t=0;return Object.values(e).forEach((e=>{Array.isArray(e)?t+=e.length*estimatePrimitiveSizeInBytes(e[0]):isPrimitive(e)?t+=estimatePrimitiveSizeInBytes(e):t+=100})),t}function estimatePrimitiveSizeInBytes(e){return"string"==typeof e?2*e.length:"number"==typeof e?8:"boolean"==typeof e?4:0}function hasSentryFetchUrlHost(e){return isError(e)&&"__sentry_fetch_url_host__"in e&&"string"==typeof e.__sentry_fetch_url_host__}function _enhanceErrorWithSentryInfo(e){return hasSentryFetchUrlHost(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function initAndBind(e,t){!0===t.debug&&(DEBUG_BUILD$2?debug.enable():consoleSandbox((()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})));getCurrentScope().update(t.initialScope);const r=new e(t);return setCurrentClient(r),r.init(),r}function setCurrentClient(e){getCurrentScope().setClient(e)}function parseUrl(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:r,hash:n,relative:t[5]+r+n}}function stripDataUrlContent(e,t=!0){if(e.startsWith("data:")){const r=e.match(/^data:([^;,]+)/),n=r?r[1]:"text/plain",i=e.includes(";base64,"),a=e.indexOf(",");let o="";if(t&&-1!==a){const t=e.slice(a+1);o=t.length>10?`${t.slice(0,10)}... [truncated]`:t}return`data:${n}${i?",base64":""}${o?`,${o}`:""}`}return e}function addAutoIpAddressToSession(e){"aggregates"in e?void 0===e.attrs?.ip_address&&(e.attrs={...e.attrs,ip_address:"{{auto}}"}):void 0===e.ipAddress&&(e.ipAddress="{{auto}}")}function applySdkMetadata(e,t,r=[t],n="npm"){const i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=r.map((e=>({name:`${n}:@sentry/${e}`,version:SDK_VERSION}))),i.version=SDK_VERSION)}const DEFAULT_BREADCRUMBS=100;function addBreadcrumb(e,t){const r=getClient(),n=getIsolationScope();if(!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:a=DEFAULT_BREADCRUMBS}=r.getOptions();if(a<=0)return;const o={timestamp:dateTimestampInSeconds(),...e},s=i?consoleSandbox((()=>i(o,t))):o;null!==s&&(r.emit&&r.emit("beforeAddBreadcrumb",s,t),n.addBreadcrumb(s,a))}let originalFunctionToString;const INTEGRATION_NAME$8="FunctionToString",SETUP_CLIENTS=new WeakMap,_functionToStringIntegration=()=>({name:INTEGRATION_NAME$8,setupOnce(){originalFunctionToString=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=getOriginalFunction(this),r=SETUP_CLIENTS.has(getClient())&&void 0!==t?t:this;return originalFunctionToString.apply(r,e)}}catch{}},setup(e){SETUP_CLIENTS.set(e,!0)}}),functionToStringIntegration=defineIntegration(_functionToStringIntegration),DEFAULT_IGNORE_ERRORS=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/^Java exception was raised during method invocation$/],INTEGRATION_NAME$7="EventFilters",eventFiltersIntegration=defineIntegration(((e={})=>{let t;return{name:INTEGRATION_NAME$7,setup(r){const n=r.getOptions();t=_mergeOptions(e,n)},processEvent(r,n,i){if(!t){const r=i.getOptions();t=_mergeOptions(e,r)}return _shouldDropEvent$1(r,t)?null:r}}})),inboundFiltersIntegration=defineIntegration(((e={})=>({...eventFiltersIntegration(e),name:"InboundFilters"})));function _mergeOptions(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:DEFAULT_IGNORE_ERRORS],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function _shouldDropEvent$1(e,t){if(e.type){if("transaction"===e.type&&_isIgnoredTransaction(e,t.ignoreTransactions))return DEBUG_BUILD$2&&debug.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.\nEvent: ${getEventDescription(e)}`),!0}else{if(_isIgnoredError(e,t.ignoreErrors))return DEBUG_BUILD$2&&debug.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${getEventDescription(e)}`),!0;if(_isUselessError(e))return DEBUG_BUILD$2&&debug.warn(`Event dropped due to not having an error message, error type or stacktrace.\nEvent: ${getEventDescription(e)}`),!0;if(_isDeniedUrl(e,t.denyUrls))return DEBUG_BUILD$2&&debug.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${getEventDescription(e)}.\nUrl: ${_getEventFilterUrl(e)}`),!0;if(!_isAllowedUrl(e,t.allowUrls))return DEBUG_BUILD$2&&debug.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${getEventDescription(e)}.\nUrl: ${_getEventFilterUrl(e)}`),!0}return!1}function _isIgnoredError(e,t){return!!t?.length&&getPossibleEventMessages(e).some((e=>stringMatchesSomePattern(e,t)))}function _isIgnoredTransaction(e,t){if(!t?.length)return!1;const r=e.transaction;return!!r&&stringMatchesSomePattern(r,t)}function _isDeniedUrl(e,t){if(!t?.length)return!1;const r=_getEventFilterUrl(e);return!!r&&stringMatchesSomePattern(r,t)}function _isAllowedUrl(e,t){if(!t?.length)return!0;const r=_getEventFilterUrl(e);return!r||stringMatchesSomePattern(r,t)}function _getLastValidUrl(e=[]){for(let t=e.length-1;t>=0;t--){const r=e[t];if(r&&"<anonymous>"!==r.filename&&"[native code]"!==r.filename)return r.filename||null}return null}function _getEventFilterUrl(e){try{const t=[...e.exception?.values??[]].reverse().find((e=>void 0===e.mechanism?.parent_id&&e.stacktrace?.frames?.length)),r=t?.stacktrace?.frames;return r?_getLastValidUrl(r):null}catch{return DEBUG_BUILD$2&&debug.error(`Cannot extract url for event ${getEventDescription(e)}`),null}}function _isUselessError(e){return!!e.exception?.values?.length&&(!e.message&&!e.exception.values.some((e=>e.stacktrace||e.type&&"Error"!==e.type||e.value)))}function applyAggregateErrorsToEvent(e,t,r,n,i,a){if(!i.exception?.values||!a||!isInstanceOf(a.originalException,Error))return;const o=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;o&&(i.exception.values=aggregateExceptionsFromError(e,t,n,a.originalException,r,i.exception.values,o,0))}function aggregateExceptionsFromError(e,t,r,n,i,a,o,s){if(a.length>=r+1)return a;let l=[...a];if(isInstanceOf(n[i],Error)){applyExceptionGroupFieldsForParentException(o,s,n);const a=e(t,n[i]),c=l.length;applyExceptionGroupFieldsForChildException(a,i,c,s),l=aggregateExceptionsFromError(e,t,r,n[i],i,[a,...l],a,c)}return isExceptionGroup(n)&&n.errors.forEach(((a,c)=>{if(isInstanceOf(a,Error)){applyExceptionGroupFieldsForParentException(o,s,n);const d=e(t,a),u=l.length;applyExceptionGroupFieldsForChildException(d,`errors[${c}]`,u,s),l=aggregateExceptionsFromError(e,t,r,a,i,[d,...l],d,u)}})),l}function isExceptionGroup(e){return Array.isArray(e.errors)}function applyExceptionGroupFieldsForParentException(e,t,r){e.mechanism={handled:!0,type:"auto.core.linked_errors",...isExceptionGroup(r)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function applyExceptionGroupFieldsForChildException(e,t,r,n){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:r,parent_id:n}}function addConsoleInstrumentationHandler(e){const t="console";addHandler(t,e),maybeInstrument(t,instrumentConsole)}function instrumentConsole(){"console"in GLOBAL_OBJ&&CONSOLE_LEVELS.forEach((function(e){e in GLOBAL_OBJ.console&&fill(GLOBAL_OBJ.console,e,(function(t){return originalConsoleMethods[e]=t,function(...t){triggerHandlers("console",{args:t,level:e});const r=originalConsoleMethods[e];r?.apply(GLOBAL_OBJ.console,t)}}))}))}function severityLevelFromString(e){return"warn"===e?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}const INTEGRATION_NAME$6="Dedupe",_dedupeIntegration=()=>{let e;return{name:INTEGRATION_NAME$6,processEvent(t){if(t.type)return t;try{if(_shouldDropEvent(t,e))return DEBUG_BUILD$2&&debug.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},dedupeIntegration=defineIntegration(_dedupeIntegration);function _shouldDropEvent(e,t){return!!t&&(!!_isSameMessageEvent(e,t)||!!_isSameExceptionEvent(e,t))}function _isSameMessageEvent(e,t){const r=e.message,n=t.message;return!(!r&&!n)&&(!(r&&!n||!r&&n)&&(r===n&&(!!_isSameFingerprint(e,t)&&!!_isSameStacktrace(e,t))))}function _isSameExceptionEvent(e,t){const r=_getExceptionFromEvent(t),n=_getExceptionFromEvent(e);return!(!r||!n)&&(r.type===n.type&&r.value===n.value&&(!!_isSameFingerprint(e,t)&&!!_isSameStacktrace(e,t)))}function _isSameStacktrace(e,t){let r=getFramesFromEvent(e),n=getFramesFromEvent(t);if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;if(n.length!==r.length)return!1;for(let e=0;e<n.length;e++){const t=n[e],i=r[e];if(t.filename!==i.filename||t.lineno!==i.lineno||t.colno!==i.colno||t.function!==i.function)return!1}return!0}function _isSameFingerprint(e,t){let r=e.fingerprint,n=t.fingerprint;if(!r&&!n)return!0;if(r&&!n||!r&&n)return!1;try{return!(r.join("")!==n.join(""))}catch{return!1}}function _getExceptionFromEvent(e){return e.exception?.values?.[0]}const INTEGRATION_NAME$5="ConversationId",_conversationIdIntegration=()=>({name:INTEGRATION_NAME$5,setup(e){e.on("spanStart",(e=>{const t=getCurrentScope().getScopeData(),r=getIsolationScope().getScopeData(),n=t.conversationId||r.conversationId;n&&e.setAttribute(GEN_AI_CONVERSATION_ID_ATTRIBUTE,n)}))}}),conversationIdIntegration=defineIntegration(_conversationIdIntegration);function getBreadcrumbLogLevelFromHttpStatusCode(e){return void 0===e?void 0:e>=400&&e<500?"warning":e>=500?"error":void 0}const WINDOW$2=GLOBAL_OBJ;function supportsHistory(){return"history"in WINDOW$2&&!!WINDOW$2.history}function _isFetchSupported(){if(!("fetch"in WINDOW$2))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function isNativeFunction(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function supportsNativeFetch(){if("string"==typeof EdgeRuntime)return!0;if(!_isFetchSupported())return!1;if(isNativeFunction(WINDOW$2.fetch))return!0;let e=!1;const t=WINDOW$2.document;if(t&&"function"==typeof t.createElement)try{const r=t.createElement("iframe");r.hidden=!0,t.head.appendChild(r),r.contentWindow?.fetch&&(e=isNativeFunction(r.contentWindow.fetch)),t.head.removeChild(r)}catch(e){DEBUG_BUILD$2&&debug.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",e)}return e}function addFetchInstrumentationHandler(e,t){const r="fetch";addHandler(r,e),maybeInstrument(r,(()=>instrumentFetch(void 0,t)))}function instrumentFetch(e,t=!1){t&&!supportsNativeFetch()||fill(GLOBAL_OBJ,"fetch",(function(e){return function(...t){const r=new Error,{method:n,url:i}=parseFetchArgs(t),a={args:t,fetchData:{method:n,url:i},startTimestamp:1e3*timestampInSeconds(),virtualError:r,headers:getHeadersFromFetchArgs(t)};return triggerHandlers("fetch",{...a}),e.apply(GLOBAL_OBJ,t).then((async e=>(triggerHandlers("fetch",{...a,endTimestamp:1e3*timestampInSeconds(),response:e}),e)),(e=>{triggerHandlers("fetch",{...a,endTimestamp:1e3*timestampInSeconds(),error:e}),isError(e)&&void 0===e.stack&&(e.stack=r.stack,addNonEnumerableProperty(e,"framesToPop",1));const t=getClient(),n=t?.getOptions().enhanceFetchErrorMessages??"always";if(!1!==n&&e instanceof TypeError&&("Failed to fetch"===e.message||"Load failed"===e.message||"NetworkError when attempting to fetch resource."===e.message))try{const t=new URL(a.fetchData.url).host;"always"===n?e.message=`${e.message} (${t})`:addNonEnumerableProperty(e,"__sentry_fetch_url_host__",t)}catch{}throw e}))}}))}function hasProp(e,t){return!!e&&"object"==typeof e&&!!e[t]}function getUrlFromResource(e){return"string"==typeof e?e:e?hasProp(e,"url")?e.url:e.toString?e.toString():"":""}function parseFetchArgs(e){if(0===e.length)return{method:"GET",url:""};if(2===e.length){const[t,r]=e;return{url:getUrlFromResource(t),method:hasProp(r,"method")?String(r.method).toUpperCase():isRequest(t)&&hasProp(t,"method")?String(t.method).toUpperCase():"GET"}}const t=e[0];return{url:getUrlFromResource(t),method:hasProp(t,"method")?String(t.method).toUpperCase():"GET"}}function getHeadersFromFetchArgs(e){const[t,r]=e;try{if("object"==typeof r&&null!==r&&"headers"in r&&r.headers)return new Headers(r.headers);if(isRequest(t))return new Headers(t.headers)}catch{}}function getSDKSource(){return"npm"}const WINDOW$1=GLOBAL_OBJ;let ignoreOnError=0;function shouldIgnoreOnError(){return ignoreOnError>0}function ignoreNextOnError(){ignoreOnError++,setTimeout((()=>{ignoreOnError--}))}function wrap(e,t={}){if(!function(e){return"function"==typeof e}(e))return e;try{const t=e.__sentry_wrapped__;if(t)return"function"==typeof t?t:e;if(getOriginalFunction(e))return e}catch{return e}const r=function(...r){try{const n=r.map((e=>wrap(e,t)));return e.apply(this,n)}catch(e){throw ignoreNextOnError(),withScope((n=>{n.addEventProcessor((e=>(t.mechanism&&(addExceptionTypeValue(e,void 0),addExceptionMechanism(e,t.mechanism)),e.extra={...e.extra,arguments:r},e))),captureException(e)})),e}};try{for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=e[t])}catch{}markFunctionWrapped(r,e),addNonEnumerableProperty(e,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get:()=>e.name})}catch{}return r}function getHttpRequestData(){const e=getLocationHref(),{referrer:t}=WINDOW$1.document||{},{userAgent:r}=WINDOW$1.navigator||{};return{url:e,headers:{...t&&{Referer:t},...r&&{"User-Agent":r}}}}function exceptionFromError(e,t){const r=parseStackFrames(e,t),n={type:extractType(t),value:extractMessage(t)};return r.length&&(n.stacktrace={frames:r}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function eventFromPlainObject(e,t,r,n){const i=getClient(),a=i?.getOptions().normalizeDepth,o=getErrorPropertyFromObject(t),s={__serialized__:normalizeToSize(t,a)};if(o)return{exception:{values:[exceptionFromError(e,o)]},extra:s};const l={exception:{values:[{type:isEvent(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:getNonErrorObjectExceptionValue(t,{isUnhandledRejection:n})}]},extra:s};if(r){const t=parseStackFrames(e,r);t.length&&(l.exception.values[0].stacktrace={frames:t})}return l}function eventFromError(e,t){return{exception:{values:[exceptionFromError(e,t)]}}}function parseStackFrames(e,t){const r=t.stacktrace||t.stack||"",n=getSkipFirstStackStringLines(t),i=getPopFirstTopFrames(t);try{return e(r,n,i)}catch{}return[]}const reactMinifiedRegexp=/Minified React error #\d+;/i;function getSkipFirstStackStringLines(e){return e&&reactMinifiedRegexp.test(e.message)?1:0}function getPopFirstTopFrames(e){return"number"==typeof e.framesToPop?e.framesToPop:0}function isWebAssemblyException(e){return"undefined"!=typeof WebAssembly&&void 0!==WebAssembly.Exception&&e instanceof WebAssembly.Exception}function extractType(e){const t=e?.name;if(!t&&isWebAssemblyException(e)){return e.message&&Array.isArray(e.message)&&2==e.message.length?e.message[0]:"WebAssembly.Exception"}return t}function extractMessage(e){const t=e?.message;return isWebAssemblyException(e)?Array.isArray(e.message)&&2==e.message.length?e.message[1]:"wasm exception":t?t.error&&"string"==typeof t.error.message?_enhanceErrorWithSentryInfo(t.error):_enhanceErrorWithSentryInfo(e):"No error message"}function eventFromException(e,t,r,n){const i=eventFromUnknownInput(e,t,r?.syntheticException||void 0,n);return addExceptionMechanism(i),i.level="error",r?.event_id&&(i.event_id=r.event_id),resolvedSyncPromise(i)}function eventFromMessage(e,t,r="info",n,i){const a=eventFromString(e,t,n?.syntheticException||void 0,i);return a.level=r,n?.event_id&&(a.event_id=n.event_id),resolvedSyncPromise(a)}function eventFromUnknownInput(e,t,r,n,i){let a;if(isErrorEvent$1(t)&&t.error){return eventFromError(e,t.error)}if(isDOMError(t)||isDOMException(t)){const i=t;if("stack"in t)a=eventFromError(e,t);else{const t=i.name||(isDOMError(i)?"DOMError":"DOMException"),o=i.message?`${t}: ${i.message}`:t;a=eventFromString(e,o,r,n),addExceptionTypeValue(a,o)}return"code"in i&&(a.tags={...a.tags,"DOMException.code":`${i.code}`}),a}if(isError(t))return eventFromError(e,t);if(isPlainObject(t)||isEvent(t)){return a=eventFromPlainObject(e,t,r,i),addExceptionMechanism(a,{synthetic:!0}),a}return a=eventFromString(e,t,r,n),addExceptionTypeValue(a,`${t}`),addExceptionMechanism(a,{synthetic:!0}),a}function eventFromString(e,t,r,n){const i={};if(n&&r){const n=parseStackFrames(e,r);n.length&&(i.exception={values:[{value:t,stacktrace:{frames:n}}]}),addExceptionMechanism(i,{synthetic:!0})}if(isParameterizedString(t)){const{__sentry_template_string__:e,__sentry_template_values__:r}=t;return i.logentry={message:e,params:r},i}return i.message=t,i}function getNonErrorObjectExceptionValue(e,{isUnhandledRejection:t}){const r=extractExceptionKeysForMessage(e),n=t?"promise rejection":"exception";if(isErrorEvent$1(e))return`Event \`ErrorEvent\` captured as ${n} with message \`${e.message}\``;if(isEvent(e)){return`Event \`${getObjectClassName(e)}\` (type=${e.type}) captured as ${n}`}return`Object captured as ${n} with keys: ${r}`}function getObjectClassName(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function getErrorPropertyFromObject(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const r=e[t];if(r instanceof Error)return r}}class BrowserClient extends Client{constructor(e){const t=applyDefaultOptions(e);applySdkMetadata(t,"browser",["browser"],WINDOW$1.SENTRY_SDK_SOURCE||getSDKSource()),t._metadata?.sdk&&(t._metadata.sdk.settings={infer_ip:t.sendDefaultPii?"auto":"never",...t._metadata.sdk.settings}),super(t);const{sendDefaultPii:r,sendClientReports:n,enableLogs:i,_experiments:a,enableMetrics:o}=this._options,s=o??a?.enableMetrics??!0;WINDOW$1.document&&(n||i||s)&&WINDOW$1.document.addEventListener("visibilitychange",(()=>{"hidden"===WINDOW$1.document.visibilityState&&(n&&this._flushOutcomes(),i&&_INTERNAL_flushLogsBuffer(this),s&&_INTERNAL_flushMetricsBuffer(this))})),r&&this.on("beforeSendSession",addAutoIpAddressToSession)}eventFromException(e,t){return eventFromException(this._options.stackParser,e,t,this._options.attachStacktrace)}eventFromMessage(e,t="info",r){return eventFromMessage(this._options.stackParser,e,t,r,this._options.attachStacktrace)}_prepareEvent(e,t,r,n){return e.platform=e.platform||"javascript",super._prepareEvent(e,t,r,n)}}function applyDefaultOptions(e){return{release:"string"==typeof __SENTRY_RELEASE__?__SENTRY_RELEASE__:WINDOW$1.SENTRY_RELEASE?.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...e}}const DEBUG_BUILD$1="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,WINDOW=GLOBAL_OBJ,DEBOUNCE_DURATION=1e3;let debounceTimerID,lastCapturedEventType,lastCapturedEventTargetId,lastHref;function addClickKeypressInstrumentationHandler(e){addHandler("dom",e),maybeInstrument("dom",instrumentDOM)}function instrumentDOM(){if(!WINDOW.document)return;const e=triggerHandlers.bind(null,"dom"),t=makeDOMEventHandler(e,!0);WINDOW.document.addEventListener("click",t,!1),WINDOW.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach((t=>{const r=WINDOW,n=r[t]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(fill(n,"addEventListener",(function(t){return function(r,n,i){if("click"===r||"keypress"==r)try{const n=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},a=n[r]=n[r]||{refCount:0};if(!a.handler){const n=makeDOMEventHandler(e);a.handler=n,t.call(this,r,n,i)}a.refCount++}catch{}return t.call(this,r,n,i)}})),fill(n,"removeEventListener",(function(e){return function(t,r,n){if("click"===t||"keypress"==t)try{const r=this.__sentry_instrumentation_handlers__||{},i=r[t];i&&(i.refCount--,i.refCount<=0&&(e.call(this,t,i.handler,n),i.handler=void 0,delete r[t]),0===Object.keys(r).length&&delete this.__sentry_instrumentation_handlers__)}catch{}return e.call(this,t,r,n)}})))}))}function isSimilarToLastCapturedEvent(e){if(e.type!==lastCapturedEventType)return!1;try{if(!e.target||e.target._sentryId!==lastCapturedEventTargetId)return!1}catch{}return!0}function shouldSkipDOMEvent(e,t){return"keypress"===e&&(!t?.tagName||"INPUT"!==t.tagName&&"TEXTAREA"!==t.tagName&&!t.isContentEditable)}function makeDOMEventHandler(e,t=!1){return r=>{if(!r||r._sentryCaptured)return;const n=getEventTarget(r);if(shouldSkipDOMEvent(r.type,n))return;addNonEnumerableProperty(r,"_sentryCaptured",!0),n&&!n._sentryId&&addNonEnumerableProperty(n,"_sentryId",uuid4());const i="keypress"===r.type?"input":r.type;if(!isSimilarToLastCapturedEvent(r)){e({event:r,name:i,global:t}),lastCapturedEventType=r.type,lastCapturedEventTargetId=n?n._sentryId:void 0}clearTimeout(debounceTimerID),debounceTimerID=WINDOW.setTimeout((()=>{lastCapturedEventTargetId=void 0,lastCapturedEventType=void 0}),DEBOUNCE_DURATION)}}function getEventTarget(e){try{return e.target}catch{return null}}function addHistoryInstrumentationHandler(e){const t="history";addHandler(t,e),maybeInstrument(t,instrumentHistory)}function instrumentHistory(){function e(e){return function(...t){const r=t.length>2?t[2]:void 0;if(r){const n=lastHref,i=getAbsoluteUrl(String(r));if(lastHref=i,n===i)return e.apply(this,t);triggerHandlers("history",{from:n,to:i})}return e.apply(this,t)}}WINDOW.addEventListener("popstate",(()=>{const e=WINDOW.location.href,t=lastHref;if(lastHref=e,t===e)return;triggerHandlers("history",{from:t,to:e})})),supportsHistory()&&(fill(WINDOW.history,"pushState",e),fill(WINDOW.history,"replaceState",e))}function getAbsoluteUrl(e){try{return new URL(e,WINDOW.location.origin).toString()}catch{return e}}const cachedImplementations={};function getNativeImplementation(e){const t=cachedImplementations[e];if(t)return t;let r=WINDOW[e];if(isNativeFunction(r))return cachedImplementations[e]=r.bind(WINDOW);const n=WINDOW.document;if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t);const i=t.contentWindow;i?.[e]&&(r=i[e]),n.head.removeChild(t)}catch(t){DEBUG_BUILD$1&&debug.warn(`Could not create sandbox iframe for ${e} check, bailing to window.${e}: `,t)}return r?cachedImplementations[e]=r.bind(WINDOW):r}function clearCachedImplementation(e){cachedImplementations[e]=void 0}const SENTRY_XHR_DATA_KEY="__sentry_xhr_v3__";function addXhrInstrumentationHandler(e){addHandler("xhr",e),maybeInstrument("xhr",instrumentXHR)}function instrumentXHR(){if(!WINDOW.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(e,t,r){const n=new Error,i=1e3*timestampInSeconds(),a=isString(r[0])?r[0].toUpperCase():void 0,o=parseXhrUrlArg(r[1]);if(!a||!o)return e.apply(t,r);t[SENTRY_XHR_DATA_KEY]={method:a,url:o,request_headers:{}},"POST"===a&&o.match(/sentry_key/)&&(t.__sentry_own_request__=!0);const s=()=>{const e=t[SENTRY_XHR_DATA_KEY];if(e&&4===t.readyState){try{e.status_code=t.status}catch{}triggerHandlers("xhr",{endTimestamp:1e3*timestampInSeconds(),startTimestamp:i,xhr:t,virtualError:n})}};return"onreadystatechange"in t&&"function"==typeof t.onreadystatechange?t.onreadystatechange=new Proxy(t.onreadystatechange,{apply:(e,t,r)=>(s(),e.apply(t,r))}):t.addEventListener("readystatechange",s),t.setRequestHeader=new Proxy(t.setRequestHeader,{apply(e,t,r){const[n,i]=r,a=t[SENTRY_XHR_DATA_KEY];return a&&isString(n)&&isString(i)&&(a.request_headers[n.toLowerCase()]=i),e.apply(t,r)}}),e.apply(t,r)}}),e.send=new Proxy(e.send,{apply(e,t,r){const n=t[SENTRY_XHR_DATA_KEY];if(!n)return e.apply(t,r);void 0!==r[0]&&(n.body=r[0]);return triggerHandlers("xhr",{startTimestamp:1e3*timestampInSeconds(),xhr:t}),e.apply(t,r)}})}function parseXhrUrlArg(e){if(isString(e))return e;try{return e.toString()}catch{}}const DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE=40;function makeFetchTransport(e,t=getNativeImplementation("fetch")){let r=0,n=0;return createTransport(e,(async function(i){const a=i.body.length;r+=a,n++;const o={body:i.body,method:"POST",referrerPolicy:"strict-origin",headers:e.headers,keepalive:r<=6e4&&n<15,...e.fetchOptions};try{const r=await t(e.url,o);return{statusCode:r.status,headers:{"x-sentry-rate-limits":r.headers.get("X-Sentry-Rate-Limits"),"retry-after":r.headers.get("Retry-After")}}}catch(e){throw clearCachedImplementation("fetch"),e}finally{r-=a,n--}}),makePromiseBuffer(e.bufferSize||DEFAULT_BROWSER_TRANSPORT_BUFFER_SIZE))}const DEBUG_BUILD="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,CHROME_PRIORITY=30,GECKO_PRIORITY=50;function createFrame(e,t,r,n){const i={filename:e,function:"<anonymous>"===t?UNKNOWN_FUNCTION:t,in_app:!0};return void 0!==r&&(i.lineno=r),void 0!==n&&(i.colno=n),i}const chromeRegexNoFnName=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,chromeRegex=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,chromeEvalRegex=/\((\S*)(?::(\d+))(?::(\d+))\)/,chromeDataUriRegex=/at (.+?) ?\(data:(.+?),/,chromeStackParserFn=e=>{const t=e.match(chromeDataUriRegex);if(t)return{filename:`<data:${t[2]}>`,function:t[1]};const r=chromeRegexNoFnName.exec(e);if(r){const[,e,t,n]=r;return createFrame(e,UNKNOWN_FUNCTION,+t,+n)}const n=chromeRegex.exec(e);if(n){if(0===n[2]?.indexOf("eval")){const e=chromeEvalRegex.exec(n[2]);e&&(n[2]=e[1],n[3]=e[2],n[4]=e[3])}const[e,t]=extractSafariExtensionDetails(n[1]||UNKNOWN_FUNCTION,n[2]);return createFrame(t,e,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},chromeStackLineParser=[CHROME_PRIORITY,chromeStackParserFn],geckoREgex=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,geckoEvalRegex=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,gecko=e=>{const t=geckoREgex.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const e=geckoEvalRegex.exec(t[3]);e&&(t[1]=t[1]||"eval",t[3]=e[1],t[4]=e[2],t[5]="")}let e=t[3],r=t[1]||UNKNOWN_FUNCTION;return[r,e]=extractSafariExtensionDetails(r,e),createFrame(e,r,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},geckoStackLineParser=[GECKO_PRIORITY,gecko],defaultStackLineParsers=[chromeStackLineParser,geckoStackLineParser],defaultStackParser=createStackParser(...defaultStackLineParsers),extractSafariExtensionDetails=(e,t)=>{const r=-1!==e.indexOf("safari-extension"),n=-1!==e.indexOf("safari-web-extension");return r||n?[-1!==e.indexOf("@")?e.split("@")[0]:UNKNOWN_FUNCTION,r?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},MAX_ALLOWED_STRING_LENGTH=1024,INTEGRATION_NAME$4="Breadcrumbs",_breadcrumbsIntegration=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:INTEGRATION_NAME$4,setup(e){t.console&&addConsoleInstrumentationHandler(_getConsoleBreadcrumbHandler(e)),t.dom&&addClickKeypressInstrumentationHandler(_getDomBreadcrumbHandler(e,t.dom)),t.xhr&&addXhrInstrumentationHandler(_getXhrBreadcrumbHandler(e)),t.fetch&&addFetchInstrumentationHandler(_getFetchBreadcrumbHandler(e)),t.history&&addHistoryInstrumentationHandler(_getHistoryBreadcrumbHandler(e)),t.sentry&&e.on("beforeSendEvent",_getSentryBreadcrumbHandler(e))}}},breadcrumbsIntegration=defineIntegration(_breadcrumbsIntegration);function _getSentryBreadcrumbHandler(e){return function(t){getClient()===e&&addBreadcrumb({category:"sentry."+("transaction"===t.type?"transaction":"event"),event_id:t.event_id,level:t.level,message:getEventDescription(t)},{event:t})}}function _getDomBreadcrumbHandler(e,t){return function(r){if(getClient()!==e)return;let n,i,a="object"==typeof t?t.serializeAttribute:void 0,o="object"==typeof t&&"number"==typeof t.maxStringLength?t.maxStringLength:void 0;o&&o>MAX_ALLOWED_STRING_LENGTH&&(DEBUG_BUILD&&debug.warn(`\`dom.maxStringLength\` cannot exceed ${MAX_ALLOWED_STRING_LENGTH}, but a value of ${o} was configured. Sentry will use ${MAX_ALLOWED_STRING_LENGTH} instead.`),o=MAX_ALLOWED_STRING_LENGTH),"string"==typeof a&&(a=[a]);try{const e=r.event,t=_isEvent(e)?e.target:e;n=htmlTreeAsString(t,{keyAttrs:a,maxStringLength:o}),i=getComponentName(t)}catch{n="<unknown>"}if(0===n.length)return;const s={category:`ui.${r.name}`,message:n};i&&(s.data={"ui.component_name":i}),addBreadcrumb(s,{event:r.event,name:r.name,global:r.global})}}function _getConsoleBreadcrumbHandler(e){return function(t){if(getClient()!==e)return;const r={category:"console",data:{arguments:t.args,logger:"console"},level:severityLevelFromString(t.level),message:safeJoin(t.args," ")};if("assert"===t.level){if(!1!==t.args[0])return;r.message=`Assertion failed: ${safeJoin(t.args.slice(1)," ")||"console.assert"}`,r.data.arguments=t.args.slice(1)}addBreadcrumb(r,{input:t.args,level:t.level})}}function _getXhrBreadcrumbHandler(e){return function(t){if(getClient()!==e)return;const{startTimestamp:r,endTimestamp:n}=t,i=t.xhr[SENTRY_XHR_DATA_KEY];if(!r||!n||!i)return;const{method:a,url:o,status_code:s,body:l}=i,c={method:a,url:o,status_code:s},d={xhr:t.xhr,input:l,startTimestamp:r,endTimestamp:n},u={category:"xhr",data:c,type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(s)};e.emit("beforeOutgoingRequestBreadcrumb",u,d),addBreadcrumb(u,d)}}function _getFetchBreadcrumbHandler(e){return function(t){if(getClient()!==e)return;const{startTimestamp:r,endTimestamp:n}=t;if(n&&(!t.fetchData.url.match(/sentry_key/)||"POST"!==t.fetchData.method))if(t.fetchData.method,t.fetchData.url,t.error){const i=t.fetchData,a={data:t.error,input:t.args,startTimestamp:r,endTimestamp:n},o={category:"fetch",data:i,level:"error",type:"http"};e.emit("beforeOutgoingRequestBreadcrumb",o,a),addBreadcrumb(o,a)}else{const i=t.response,a={...t.fetchData,status_code:i?.status};t.fetchData.request_body_size,t.fetchData.response_body_size;const o={input:t.args,response:i,startTimestamp:r,endTimestamp:n},s={category:"fetch",data:a,type:"http",level:getBreadcrumbLogLevelFromHttpStatusCode(a.status_code)};e.emit("beforeOutgoingRequestBreadcrumb",s,o),addBreadcrumb(s,o)}}}function _getHistoryBreadcrumbHandler(e){return function(t){if(getClient()!==e)return;let r=t.from,n=t.to;const i=parseUrl(WINDOW$1.location.href);let a=r?parseUrl(r):void 0;const o=parseUrl(n);a?.path||(a=i),i.protocol===o.protocol&&i.host===o.host&&(n=o.relative),i.protocol===a.protocol&&i.host===a.host&&(r=a.relative),addBreadcrumb({category:"navigation",data:{from:r,to:n}})}}function _isEvent(e){return!!e&&!!e.target}const DEFAULT_EVENT_TARGET=["EventTarget","Window","Node","ApplicationCache","AudioTrackList","BroadcastChannel","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","SharedWorker","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"],INTEGRATION_NAME$3="BrowserApiErrors",_browserApiErrorsIntegration=(e={})=>{const t={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...e};return{name:INTEGRATION_NAME$3,setupOnce(){t.setTimeout&&fill(WINDOW$1,"setTimeout",_wrapTimeFunction),t.setInterval&&fill(WINDOW$1,"setInterval",_wrapTimeFunction),t.requestAnimationFrame&&fill(WINDOW$1,"requestAnimationFrame",_wrapRAF),t.XMLHttpRequest&&"XMLHttpRequest"in WINDOW$1&&fill(XMLHttpRequest.prototype,"send",_wrapXHR);const e=t.eventTarget;if(e){(Array.isArray(e)?e:DEFAULT_EVENT_TARGET).forEach((e=>_wrapEventTarget(e,t)))}}}},browserApiErrorsIntegration=defineIntegration(_browserApiErrorsIntegration);function _wrapTimeFunction(e){return function(...t){const r=t[0];return t[0]=wrap(r,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${getFunctionName(e)}`}}),e.apply(this,t)}}function _wrapRAF(e){return function(t){return e.apply(this,[wrap(t,{mechanism:{data:{handler:getFunctionName(e)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function _wrapXHR(e){return function(...t){const r=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((e=>{e in r&&"function"==typeof r[e]&&fill(r,e,(function(t){const r={mechanism:{data:{handler:getFunctionName(t)},handled:!1,type:`auto.browser.browserapierrors.xhr.${e}`}},n=getOriginalFunction(t);return n&&(r.mechanism.data.handler=getFunctionName(n)),wrap(t,r)}))})),e.apply(this,t)}}function _wrapEventTarget(e,t){const r=WINDOW$1,n=r[e]?.prototype;n?.hasOwnProperty?.("addEventListener")&&(fill(n,"addEventListener",(function(r){return function(n,i,a){try{isEventListenerObject(i)&&(i.handleEvent=wrap(i.handleEvent,{mechanism:{data:{handler:getFunctionName(i),target:e},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return t.unregisterOriginalCallbacks&&unregisterOriginalCallback(this,n,i),r.apply(this,[n,wrap(i,{mechanism:{data:{handler:getFunctionName(i),target:e},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),a])}})),fill(n,"removeEventListener",(function(e){return function(t,r,n){try{const i=r.__sentry_wrapped__;i&&e.call(this,t,i,n)}catch{}return e.call(this,t,r,n)}})))}function isEventListenerObject(e){return"function"==typeof e.handleEvent}function unregisterOriginalCallback(e,t,r){e&&"object"==typeof e&&"removeEventListener"in e&&"function"==typeof e.removeEventListener&&e.removeEventListener(t,r)}const browserSessionIntegration=defineIntegration(((e={})=>{const t=e.lifecycle??"route";return{name:"BrowserSession",setupOnce(){if(void 0===WINDOW$1.document)return void(DEBUG_BUILD&&debug.warn("Using the `browserSessionIntegration` in non-browser environments is not supported."));startSession({ignoreDuration:!0}),captureSession();const e=getIsolationScope();let r=e.getUser();e.addScopeListener((e=>{const t=e.getUser();r?.id===t?.id&&r?.ip_address===t?.ip_address||(captureSession(),r=t)})),"route"===t&&addHistoryInstrumentationHandler((({from:e,to:t})=>{e!==t&&(startSession({ignoreDuration:!0}),captureSession())}))}}})),INTEGRATION_NAME$2="CultureContext",_cultureContextIntegration=()=>({name:INTEGRATION_NAME$2,preprocessEvent(e){const t=getCultureContext();t&&(e.contexts={...e.contexts,culture:{...t,...e.contexts?.culture}})}}),cultureContextIntegration=defineIntegration(_cultureContextIntegration);function getCultureContext(){try{const e=WINDOW$1.Intl;if(!e)return;const t=e.DateTimeFormat().resolvedOptions();return{locale:t.locale,timezone:t.timeZone,calendar:t.calendar}}catch{return}}const INTEGRATION_NAME$1="GlobalHandlers",_globalHandlersIntegration=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:INTEGRATION_NAME$1,setupOnce(){Error.stackTraceLimit=50},setup(e){t.onerror&&(_installGlobalOnErrorHandler(e),globalHandlerLog("onerror")),t.onunhandledrejection&&(_installGlobalOnUnhandledRejectionHandler(e),globalHandlerLog("onunhandledrejection"))}}},globalHandlersIntegration=defineIntegration(_globalHandlersIntegration);function _installGlobalOnErrorHandler(e){addGlobalErrorInstrumentationHandler((t=>{const{stackParser:r,attachStacktrace:n}=getOptions();if(getClient()!==e||shouldIgnoreOnError())return;const{msg:i,url:a,line:o,column:s,error:l}=t,c=_enhanceEventWithInitialFrame(eventFromUnknownInput(r,l||i,void 0,n,!1),a,o,s);c.level="error",captureEvent(c,{originalException:l,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})}))}function _installGlobalOnUnhandledRejectionHandler(e){addGlobalUnhandledRejectionInstrumentationHandler((t=>{const{stackParser:r,attachStacktrace:n}=getOptions();if(getClient()!==e||shouldIgnoreOnError())return;const i=_getUnhandledRejectionError(t),a=isPrimitive(i)?_eventFromRejectionWithPrimitive(i):eventFromUnknownInput(r,i,void 0,n,!0);a.level="error",captureEvent(a,{originalException:i,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})}))}function _getUnhandledRejectionError(e){if(isPrimitive(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function _eventFromRejectionWithPrimitive(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function _enhanceEventWithInitialFrame(e,t,r,n){const i=e.exception=e.exception||{},a=i.values=i.values||[],o=a[0]=a[0]||{},s=o.stacktrace=o.stacktrace||{},l=s.frames=s.frames||[],c=n,d=r,u=getFilenameFromUrl(t)??getLocationHref();return 0===l.length&&l.push({colno:c,filename:u,function:UNKNOWN_FUNCTION,in_app:!0,lineno:d}),e}function globalHandlerLog(e){DEBUG_BUILD&&debug.log(`Global Handler attached: ${e}`)}function getOptions(){const e=getClient();return e?.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}function getFilenameFromUrl(e){if(isString(e)&&0!==e.length)return e.startsWith("data:")?`<${stripDataUrlContent(e,!1)}>`:e}const httpContextIntegration=defineIntegration((()=>({name:"HttpContext",preprocessEvent(e){if(!WINDOW$1.navigator&&!WINDOW$1.location&&!WINDOW$1.document)return;const t=getHttpRequestData(),r={...t.headers,...e.request?.headers};e.request={...t,...e.request,headers:r}}}))),DEFAULT_KEY="cause",DEFAULT_LIMIT=5,INTEGRATION_NAME="LinkedErrors",_linkedErrorsIntegration=(e={})=>{const t=e.limit||DEFAULT_LIMIT,r=e.key||DEFAULT_KEY;return{name:INTEGRATION_NAME,preprocessEvent(e,n,i){applyAggregateErrorsToEvent(exceptionFromError,i.getOptions().stackParser,r,t,e,n)}}},linkedErrorsIntegration=defineIntegration(_linkedErrorsIntegration);function checkAndWarnIfIsEmbeddedBrowserExtension(){return!!_isEmbeddedBrowserExtension()&&(DEBUG_BUILD&&consoleSandbox((()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")})),!0)}function _isEmbeddedBrowserExtension(){if(void 0===WINDOW$1.window)return!1;const e=WINDOW$1;if(e.nw)return!1;const t=e.chrome||e.browser;if(!t?.runtime?.id)return!1;const r=getLocationHref();return!(WINDOW$1===WINDOW$1.top&&["chrome-extension","moz-extension","ms-browser-extension","safari-web-extension"].some((e=>r.startsWith(`${e}://`))))}function getDefaultIntegrations(e){return[inboundFiltersIntegration(),functionToStringIntegration(),conversationIdIntegration(),browserApiErrorsIntegration(),breadcrumbsIntegration(),globalHandlersIntegration(),linkedErrorsIntegration(),dedupeIntegration(),httpContextIntegration(),cultureContextIntegration(),browserSessionIntegration()]}function init(e={}){const t=!e.skipBrowserExtensionCheck&&checkAndWarnIfIsEmbeddedBrowserExtension();let r=null==e.defaultIntegrations?getDefaultIntegrations():e.defaultIntegrations;const n={...e,enabled:!t&&e.enabled,stackParser:stackParserFromStackParserOptions(e.stackParser||defaultStackParser),integrations:getIntegrationsToSetup({integrations:e.integrations,defaultIntegrations:r}),transport:e.transport||makeFetchTransport};return initAndBind(BrowserClient,n)}class SentryManager{constructor(){this.isInitialized=!1}static getInstance(){return SentryManager.instance||(SentryManager.instance=new SentryManager),SentryManager.instance}initialize(){if(this.isInitialized)return;const e=environmentManager.getEnvironment()||"production";if(!(e===ENVIRONMENTS.PRODUCTION||e===ENVIRONMENTS.STAGING))return;init({dsn:"https://8e000dda9faf4372bd40163105017f8a@o74188.ingest.us.sentry.io/4510466352742400",environment:e,sampleRate:.1}),this.isInitialized=!0}isEnabled(){return this.isInitialized}captureError(e){this.isInitialized&&captureException(e)}captureMessage(e,t="info"){this.isInitialized&&captureMessage(e,t)}}const sentryManager=SentryManager.getInstance(),SUPPORTED_LOCALES=Object.values(LOCALES$1);function validateLocale(e){if(!isLocaleSupported(e))throw new InvalidParametersError(`Unsupported locale: ${e}. The locale must be one of: ${SUPPORTED_LOCALES.join(", ")}.`);return e}function isLocaleSupported(e){return SUPPORTED_LOCALES.includes(e)}function validateInitializeParams(e){if(!e?.accessToken&&!e?.operationSettings?.proxyRequestFunction&&!e?.operationSettings?.proxyEndpointDescriptor)throw new InvalidParametersError("Either operationSettings.proxyRequestFunction, operationSettings.proxyEndpointDescriptor, or access token is required when calling initialize()");return e?.operationSettings&&validateOperationSettingsParams(e.operationSettings),validateEnvironmentParams(e),e.locale&&validateLocale(e.locale),e}function validateEnvironmentParams(e){if(e.environment){if(!["production","staging","local"].includes(e.environment))throw new InvalidParametersError('If provided, environment must be either "production" or "staging"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.environment.PRODUCTION" or "constants.environment.STAGING"');if(e.branch&&!["master","sandbox","qa"].includes(e.branch))throw new InvalidParametersError('If provided, branch must be either "master", "sandbox" or "qa"\nYou can "import constants from @qonto/embed-sdk/common" and then use "constants.branch.MASTER" or "constants.environment.SANDBOX" and so on')}return e}function initialize$1(e){const{accessToken:t,stagingToken:r,operationSettings:n,environment:i,branch:a,locale:o}=validateInitializeParams(e);t&&authManager.setAccessToken(t),r&&authManager.setStagingToken(r),o&&localeManager.setLocale(o),n&&operationSettingsManager.setSettings(n),i&&(environmentManager.setEnvironment(i),a&&environmentManager.setBranch(a)),sentryManager.initialize(),initialize$2(),info("SDK initialized successfully",{environment:i,locale:o,debugMode:n?.debugMode})}function logout$1(){authManager.clearAccessToken(),authManager.clearStagingToken(),localeManager.setDefaultLocale(),operationSettingsManager.clearSettings(),reset()}const common={initialize:initialize$1,logout:logout$1,constants:constants$1},{initialize:initialize,logout:logout,constants:constants}=common,ORGANIZATION_ENDPOINT="/v2/organization/",BANK_ACCOUNTS_ENDPOINT="/v2/bank_accounts/",prepareGetOrganization=({accessToken:e,stagingToken:t})=>({path:`${ORGANIZATION_ENDPOINT}`,options:{method:"GET",headers:{accessToken:e,stagingToken:t}}}),prepareGetBankAccounts=({accessToken:e,stagingToken:t})=>({path:`${BANK_ACCOUNTS_ENDPOINT}`,options:{method:"GET",headers:{accessToken:e,stagingToken:t}}}),serializeOrganization=e=>({id:e.id,slug:e.slug,legalName:e.legal_name,legalNumber:e.legal_number,legalSector:e.legal_sector,legalRegistrationDate:e.legal_registration_date,legalAddress:e.legal_address,legalForm:e.legal_form,legalCountry:e.legal_country,legalShareCapital:e.legal_share_capital,locale:e.locale,contractSignedAt:e.contract_signed_at,bankAccounts:e.bank_accounts.map(serializeBankAccount)}),serializeBankAccount=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}),getOrganization=async({operationSettings:e})=>{tracker.organizationsList();const{stagingToken:t,proxyEndpointDescriptor:r}=validateClientOperationSettings(e,"Client-side organizations operations require proxyEndpointDescriptor."),n=prepareGetOrganization({stagingToken:t}),i=await callProxyFunction({proxyEndpointDescriptor:r,networkCallDescriptor:n});return serializeOrganization(i.body.organization)},getBankAccounts=async({operationSettings:e})=>{tracker.organizationsBankAccounts();const{stagingToken:t,proxyEndpointDescriptor:r}=validateClientOperationSettings(e,"Client-side organizations operations require proxyEndpointDescriptor."),n=prepareGetBankAccounts({stagingToken:t});return(await callProxyFunction({proxyEndpointDescriptor:r,networkCallDescriptor:n})).body.bank_accounts.map(serializeBankAccount)},organizations={getOrganization:getOrganization,getBankAccounts:getBankAccounts},CURRENCIES={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"},isValidCurrency=e=>Object.values(CURRENCIES).includes(e),validateCurrency=e=>{if(!isValidCurrency(e))throw new InvalidParametersError(`currency ${e} is not valid, valid currencies are ${Object.values(CURRENCIES).join(", ")}`)},LINK_TYPES={GOOD:"good",SERVICE:"service"},UNITS={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"},isValidUnit=e=>Object.values(UNITS).includes(e),validateUnit=e=>{if(!isValidUnit(e))throw new InvalidParametersError(`unit ${e} is not valid, valid units are ${Object.values(UNITS).join(", ")}`)},requiredCreatePaymentLinkParams=[{name:"id"},{name:"title"},{name:"type"},{name:"quantity"},{name:"measureUnit"},{name:"unitPrice"},{name:"vatRate"}],requiredPriceParams=[{name:"currency"},{name:"value"}];function validateItems(e){if(!e||!Array.isArray(e))return[];e.forEach((e=>{validatePresenceOfRequiredParams(e,requiredCreatePaymentLinkParams),validatePresenceOfRequiredParams(e.unitPrice,requiredPriceParams);const t=[...validateExpectedStringValues({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}:{}}),...validateExpectedNumericValues({quantity:e.quantity})].flat();if(t.length>0)throw new InvalidParametersError(t);validateType(e.type),validateCurrency(e.unitPrice.currency),validateUnit(e.measureUnit)}))}const validateType=e=>{if(!Object.values(LINK_TYPES).includes(e))throw new InvalidParametersError(`type ${e} is not valid, valid types are ${Object.values(LINK_TYPES).join(", ")}`)};function validatePaymentLinkCreationFlowParams(e){if(!e?.callbackUrl)throw new InvalidParametersError("callbackUrl parameter is required for the payment link creation flow");if("string"!=typeof e.callbackUrl)throw new InvalidParametersError("callbackUrl must be a string");if(""===e.callbackUrl.trim())throw new InvalidParametersError("callbackUrl cannot be empty");return e.callbackUrl}const getPaymentLinkCreationFlowUrl=async({paymentLinkSettings:e,operationSettings:t})=>{tracker.paymentLinksCreate();const{proxyEndpointDescriptor:r}=validateClientOperationSettings(t,'Client-side payment link operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/payment-links" only in server-side/backend environments.');if(!r)throw new InvalidParametersError('Client-side payment link operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/payment-links" only in server-side/backend environments.');const{items:n}=e;validateItems(n);const i=validatePaymentLinkCreationFlowParams(e),a=await authLinks.request({requestSettings:{action:AUTH_LINK_ACTIONS.PAYMENT_LINK_CREATE,callbackUrl:i},operationSettings:t}),o=new URLSearchParams({...n?{items:JSON.stringify(n)}:{}});return o.toString()?`${a.url}?${o.toString()}`:a.url},redirectToPaymentLinkCreationFlow=async({paymentLinkSettings:e,operationSettings:t})=>{tracker.paymentLinksRedirect();const r=await getPaymentLinkCreationFlowUrl({paymentLinkSettings:e,operationSettings:t});window.location.href=r},paymentLinks={getPaymentLinkCreationFlowUrl:getPaymentLinkCreationFlowUrl,redirectToPaymentLinkCreationFlow:redirectToPaymentLinkCreationFlow},RUNTIME_ENVIRONMENT={BROWSER:"browser",SERVER:"server"};class InvalidRuntimeError extends Error{constructor(e){switch(super(),this.name="InvalidRuntimeError",e){case RUNTIME_ENVIRONMENT.BROWSER:this.message="This code is running in a browser environment, but it is expected to run in a server environment.";break;case RUNTIME_ENVIRONMENT.SERVER:this.message="This code is running in a server environment, but it is expected to run in a browser environment.";break;default:this.message="This code is not expected to run in this environment. Check if the function was server-only or browser-only."}}}function serializeSepaTransfer(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 serializeToNewSepaTransferDataObject(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}:{}}}function serializeToVopVerificationResult(e){return{matchResult:e.match_result,matchedName:e.matched_name}}function serializeToSepaPayeeDataObject(e){return{name:e.name,iban:e.iban}}const SEPA_ENDPOINT="/v2/sepa",SEPA_TRANSFERS_ENDPOINT=`${SEPA_ENDPOINT}/transfers`;function prepareGetSepaTransfersCall({paginationSettings:e,accessToken:t,stagingToken:r}){const n={method:"GET",headers:{accessToken:t,stagingToken:r}},i=buildPaginationParams(e),a=i.size?`?${i.toString()}`:"";return{path:`${SEPA_TRANSFERS_ENDPOINT}${a}`,options:n}}async function getSepaTransfers$2({accessToken:e,stagingToken:t,paginationSettings:r}){const n=prepareGetSepaTransfersCall({paginationSettings:r,accessToken:e,stagingToken:t}),{transfers:i,meta:a}=await makeNetworkCall(n);return{transfers:i,meta:a}}function prepareGetSepaTransferCall({sepaTransferId:e,accessToken:t,stagingToken:r}){return{path:`${SEPA_TRANSFERS_ENDPOINT}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:r}}}}function prepareCreateSepaTransferCall({transfer:e,vopProofToken:t,accessToken:r,stagingToken:n,scaSessionToken:i,idempotencyKey:a}){const o=serializeToNewSepaTransferDataObject(e);return{path:SEPA_TRANSFERS_ENDPOINT,options:{method:"POST",headers:{accessToken:r,stagingToken:n,scaSessionToken:i,idempotencyKey:a},body:{transfer:o,vop_proof_token:t}}}}function prepareCancelSepaTransferCall({sepaTransferId:e,accessToken:t,stagingToken:r}){return{path:`${SEPA_TRANSFERS_ENDPOINT}/${e}/cancel`,options:{method:"POST",headers:{accessToken:t,stagingToken:r}}}}function prepareVerifySepaPayeeCall({sepaPayee:e,accessToken:t,stagingToken:r}){return{path:`${SEPA_ENDPOINT}/verify_payee`,options:{method:"POST",headers:{accessToken:t,stagingToken:r},body:{beneficiary_name:e.name,iban:e.iban}}}}function serializeBulkTransfer(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 serializeToNewBulkTransferDataObject(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}:{}}}function serializeToBulkVopVerificationResult(e){return{id:e.id,response:{matchResult:e.response.match_result,matchedName:e.response.matched_name}}}const BULK_TRANSFERS_ENDPOINT="/v2/sepa/bulk_transfers";function prepareGetBulkTransfersCall({paginationSettings:e,accessToken:t,stagingToken:r}){const n={method:"GET",headers:{accessToken:t,stagingToken:r}},i=buildPaginationParams(e),a=i.size?`?${i.toString()}`:"";return{path:`${BULK_TRANSFERS_ENDPOINT}${a}`,options:n}}function prepareGetBulkTransferCall({bulkTransferId:e,accessToken:t,stagingToken:r}){return{path:`${BULK_TRANSFERS_ENDPOINT}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:r}}}}function prepareCreateBulkTransferCall({bulkTransfers:e,bankAccountId:t,accessToken:r,stagingToken:n,scaSessionToken:i,idempotencyKey:a}){return{path:BULK_TRANSFERS_ENDPOINT,options:{method:"POST",headers:{accessToken:r,stagingToken:n,scaSessionToken:i,idempotencyKey:a},body:{bank_account_id:t,bulk_transfers:e.map((e=>serializeToNewBulkTransferDataObject(e)))}}}}function prepareVerifySepaPayeesCall({sepaPayees:e,accessToken:t,stagingToken:r}){return{path:`${SEPA_ENDPOINT}/bulk_verify_payee`,options:{method:"POST",headers:{accessToken:t,stagingToken:r},body:{requests:e.map(serializeToSepaPayeeDataObject)}}}}function validateBulkTransferParams(e){if(!e)throw new InvalidParametersError("bulkTransferId parameter is required for the called function.");if("string"!=typeof e)throw new InvalidParametersError("bulkTransferId must be a string.");return e}function validateCreateBulkTransferParams(e){if(!e)throw new InvalidParametersError("bulkTransferSettings parameter is required for the called function.");if(!e.bankAccountId)throw new InvalidParametersError("bankAccountId is required");if(!Array.isArray(e.bulkTransfers))throw new InvalidParametersError("bulkTransfers must be an array");if(e.bulkTransfers.length>400)throw new InvalidParametersError("Maximum of 400 bulk transfers allowed");return e.bulkTransfers.forEach(((e,t)=>{validateSingleBulkTransfer(e,t)})),e}function validateSingleBulkTransfer(e,t){if(!e)throw new InvalidParametersError(`Invalid bulkTransfer at index ${t}: bulkTransfer object is required`);if(!e.beneficiary)throw new InvalidParametersError(`Invalid bulkTransfer at index ${t}: Beneficiary details must be provided in the bulkTransferSettings.beneficiary field`);if(!e.beneficiary.iban)throw new InvalidParametersError(`Invalid bulkTransfer at index ${t}: IBAN is required as part of the beneficiary details`);if(!e.beneficiary.name)throw new InvalidParametersError(`Invalid bulkTransfer at index ${t}: Beneficiary name is required as part of the beneficiary details`);const r=[...validateExpectedStringValues({reference:e.reference,clientTransferId:e.clientTransferId,note:e.note}),...validateExpectedNumericValues({amount:e.amount})].flat();if(r.length>0)throw new InvalidParametersError(r);if(e.amount>AMOUNT_REQUIRING_ATTACHMENTS&&(!e.attachmentsIds||0===e.attachmentsIds.length))throw new InvalidParametersError(`Invalid bulkTransfer at index ${t}: Attachments are required for transfers over €${AMOUNT_REQUIRING_ATTACHMENTS}`)}async function getBulkTransfers(e){tracker.sepaTransferBulkList();const{proxyRequestFunction:t,proxyEndpointDescriptor:r,paginationSettings:n}=validateClientOperationSettings(e?.operationSettings,'Client-side bulk transfer operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" and access sepaTransfers.bulkTransfers only in server-side/backend environments.'),i=prepareGetBulkTransfersCall({paginationSettings:n}),a=await callProxyFunction({proxyFunction:t,proxyEndpointDescriptor:r,networkCallDescriptor:i}),o=a.body.bulk_transfers.map(serializeBulkTransfer),s=serializePaginationResponse(a.body.meta);return{bulkTransfers:o,...s?{meta:s}:{}}}async function getBulkTransfer({bulkTransferSettings:e,operationSettings:t}){tracker.sepaTransferBulkGet();const r=validateBulkTransferParams(e?.bulkTransferId),{proxyRequestFunction:n,proxyEndpointDescriptor:i}=validateClientOperationSettings(t,'Client-side bulk transfer operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" and access sepaTransfers.bulkTransfers only in server-side/backend environments.'),a=prepareGetBulkTransferCall({bulkTransferId:r});return serializeBulkTransfer((await callProxyFunction({proxyFunction:n,proxyEndpointDescriptor:i,networkCallDescriptor:a})).body.bulk_transfer)}async function verifySepaPayeesWithProxy({sepaPayees:e,proxyRequestFunction:t,proxyEndpointDescriptor:r}){const n=prepareVerifySepaPayeesCall({sepaPayees:e});return(await callProxyFunction({proxyFunction:t,proxyEndpointDescriptor:r,networkCallDescriptor:n})).body}async function*createBulkTransfer({bulkTransferSettings:e,operationSettings:t}){tracker.sepaTransferBulkCreate();const{proxyRequestFunction:r,proxyEndpointDescriptor:n}=validateClientOperationSettings(t,'Client-side bulk transfer operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" and access sepaTransfers.bulkTransfers only in server-side/backend environments.');if(!isRunningInBrowser())throw new InvalidRuntimeError(RUNTIME_ENVIRONMENT.BROWSER);const i=authManager.getStagingToken(),a=t?.idempotencyKey||v4();validateCreateBulkTransferParams(e);const o=new Map;for(const t of e.bulkTransfers){const e=t.beneficiary.iban;e&&!o.has(e)&&o.set(e,{name:t.beneficiary.name,iban:e})}const s=Array.from(o.values()),l=await verifySepaPayeesWithProxy({sepaPayees:s,proxyRequestFunction:r,proxyEndpointDescriptor:n});if((yield l.requests.map(serializeToBulkVopVerificationResult))===VOP_DECISIONS.REJECT)return;const c=prepareCreateBulkTransferCall({bulkTransfers:e.bulkTransfers,bankAccountId:e.bankAccountId,stagingToken:i||void 0,idempotencyKey:a});return{bulkTransfer:serializeBulkTransfer((await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:c})).body.bulk_transfer),meta:{idempotencyKey:a}}}const bulkTransfers={getBulkTransfers:getBulkTransfers,getBulkTransfer:getBulkTransfer,createBulkTransfer:createBulkTransfer},SCA_POLLING_RESULTS={WAITING:"waiting"};function serializeScaPollingResponse(e){return{result:e.result,canceledAt:e.canceled_at}}function serializePreconditionRequiredResponse(e){return{message:e.message,code:e.code,scaSessionToken:e.sca_session_token,actionType:e.action_type}}async function getBeneficiaries(e){const{stagingToken:t,proxyEndpointDescriptor:r,accessToken:n,paginationSettings:i}=validateOperationSettingsParams(e?.operationSettings||{});if(r){const e=prepareGetBeneficiariesCall({paginationSettings:i}),t=await callProxyFunction({proxyEndpointDescriptor:r,networkCallDescriptor:e}),n=t.body.beneficiaries.map((e=>serializeBeneficiary(e))),a=serializePaginationResponse(t.body.meta);return{beneficiaries:n,...a?{meta:a}:{}}}{const e=n||validatePresenceOfAuthToken(),r=await getBeneficiaries$2({accessToken:e,stagingToken:t,paginationSettings:i}),a=r.beneficiaries.map((e=>serializeBeneficiary(e))),o=serializePaginationResponse(r.meta);return{beneficiaries:a,...o?{meta:o}:{}}}}async function getBeneficiary({beneficiarySettings:e,operationSettings:t}){const r=validateGetBeneficiaryParams(e?.beneficiaryId),{proxyEndpointDescriptor:n,accessToken:i,stagingToken:a}=validateOperationSettingsParams(t||{});if(n){const e=prepareGetBeneficiaryCall({beneficiaryId:r});return serializeBeneficiary((await callProxyFunction({proxyEndpointDescriptor:n,networkCallDescriptor:e})).body.beneficiary)}{const e=i||validatePresenceOfAuthToken();return serializeBeneficiary(await getBeneficiary$2({beneficiaryId:r,accessToken:e,stagingToken:a}))}}async function findBeneficiary({sepaTransferSettings:e,operationSettings:t}){return e?.beneficiary?e.beneficiary:await getBeneficiary({beneficiarySettings:{beneficiaryId:e?.beneficiaryId},operationSettings:t})}function decorateUrlWithExtraParams(e,t){const r=t?.locale||localeManager.getLocale(),n=new URL(e);return r&&n.searchParams.append("lang",r),t?.mfaPreference&&n.searchParams.append("mfaPreference",t.mfaPreference),t?.idempotencyKey&&n.searchParams.append("idempotencyKey",t.idempotencyKey),n.toString()}function createSepaTransferScaElement({networkCallDescriptor:e,scaSessionToken:t,operationSettings:r}){const{uiParentElementId:n,proxyRequestFunction:i,locale:a}=r,o=getUIParentElement(n);o.innerHTML="";const s=document.createElement("qonto-sca-passkey-waiting");return s.networkCallDescriptor={...e,options:{...e.options,headers:{...e.options.headers,scaSessionToken:t}}},s.operationSettings={uiParentElementId:n,proxyRequestFunction:i,locale:a},o.appendChild(s),s}async function waitForSepaTransferScaResult(e){return new Promise(((t,r)=>{e.addEventListener("sca-success",(e=>{t(e.detail.result.transfer)}),{once:!0}),e.addEventListener("sca-error",(e=>{r(e.detail.error)}),{once:!0}),e.addEventListener("sca-abort",(e=>{r(e.detail.result)}),{once:!0})}))}const requiredCreateSepaTransferParams=[{name:"bankAccountId"},{name:"reference"},{name:"amount"}];function validateGetSepaTransferParams(e){if(!e)throw new InvalidParametersError("sepaTransferId parameter is required for the called function");if(e&&"string"!=typeof e)throw new InvalidParametersError("sepaTransferId must be a string");return e}function validateTransferBeneficiaryParams(e){if(!e)throw new InvalidParametersError("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new InvalidParametersError("sepaTransferSettings must be an object");if(!e.beneficiaryId&&!e.beneficiary)throw new InvalidParametersError("Either beneficiaryId or beneficiary must be provided");const t=validateExpectedStringValues({beneficiaryId:e.beneficiaryId});if(t.length>0)throw new InvalidParametersError(t);return e}function validateCreateSepaTransferParams(e){if(!e)throw new InvalidParametersError("sepaTransferSettings parameter is required for the called function");if("object"!=typeof e)throw new InvalidParametersError("sepaTransferSettings must be an object");validatePresenceOfRequiredParams(e,requiredCreateSepaTransferParams);const t=[...validateExpectedStringValues({bankAccountId:e.bankAccountId,note:e.note,reference:e.reference}),...validateExpectedNumericValues({amount:e.amount})].flat();if(t.length>0)throw new InvalidParametersError(t);if(e.amount>AMOUNT_REQUIRING_ATTACHMENTS&&(!e.attachmentIds||0===e.attachmentIds.length))throw new InvalidParametersError("Attachments are required for transfers over €30,000");return e}function validateCancelSepaTransferParams(e){if(!e)throw new InvalidParametersError("sepaTransferId parameter is required for the called function");if("string"!=typeof e)throw new InvalidParametersError("sepaTransferId must be a string");return e}function validateGetSepaTransferCreationFlowLinkParams(e){if(!e||!e.callbackUrl)throw new InvalidParametersError("callbackUrl parameter is required for the getSepaTransferCreationFlowLink function");if("string"!=typeof e.callbackUrl)throw new InvalidParametersError("callbackUrl must be a string");return e.callbackUrl}
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
4
|
* Copyright 2021 Google LLC
|
|
@@ -207,7 +207,7 @@ const t$1=e=>(t,r)=>{void 0!==r?r.addInitializer((()=>{customElements.define(e,t
|
|
|
207
207
|
* @license
|
|
208
208
|
* Copyright 2020 Google LLC
|
|
209
209
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
210
|
-
*/const e$1=()=>new h$2;let h$2=class{};const o$2=new WeakMap,n$1=e$2(class extends f{render(e){return A}update(e,[t]){const r=t!==this.G;return r&&void 0!==this.G&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),A}rt(e){if(this.isConnected||(e=void 0),"function"==typeof this.G){const t=this.ht??globalThis;let r=o$2.get(t);void 0===r&&(r=new WeakMap,o$2.set(t,r)),void 0!==r.get(this.G)&&this.G.call(this.ht,void 0),r.set(this.G,e),void 0!==e&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return"function"==typeof this.G?o$2.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var lottie$2={exports:{}},lottie$1=lottie$2.exports,hasRequiredLottie;function requireLottie(){return hasRequiredLottie||(hasRequiredLottie=1,function(module,exports$1){var factory;"undefined"!=typeof document&&"undefined"!=typeof navigator&&(factory=function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(e){_useWebWorker=!!e},getWebWorker=function(){return _useWebWorker},setLocationHref=function(e){locationHref=e},getLocationHref=function(){return locationHref};function createTag(e){return document.createElement(e)}function extendPrototype(e,t){var r,n,i=e.length;for(r=0;r<i;r+=1)for(var a in n=e[r].prototype)Object.prototype.hasOwnProperty.call(n,a)&&(t.prototype[a]=n[a])}function getDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)}function createProxyFunction(e){function t(){}return t.prototype=e,t}var audioControllerFactory=function(){function e(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1}return e.prototype={addAudio:function(e){this.audios.push(e)},pause:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].pause()},resume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].resume()},setRate:function(e){var t,r=this.audios.length;for(t=0;t<r;t+=1)this.audios[t].setRate(e)},createAudio:function(e){return this.audioFactory?this.audioFactory(e):window.Howl?new window.Howl({src:[e]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(e){this.audioFactory=e},setVolume:function(e){this._volume=e,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].volume(this._volume*(this._isMuted?0:1))}},function(){return new e}}(),createTypedArray=function(){function e(e,t){var r,n=0,i=[];switch(e){case"int16":case"uint8c":r=1;break;default:r=1.1}for(n=0;n<t;n+=1)i.push(r);return i}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,r){return"float32"===t?new Float32Array(r):"int16"===t?new Int16Array(r):"uint8c"===t?new Uint8ClampedArray(r):e(t,r)}:e}();function createSizedArray(e){return Array.apply(null,{length:e})}function _typeof$6(e){return _typeof$6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$6(e)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};!function(){var e,t=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],r=t.length;for(e=0;e<r;e+=1)BMMath[t[e]]=Math[t[e]]}(),BMMath.random=Math.random,BMMath.abs=function(e){if("object"===_typeof$6(e)&&e.length){var t,r=createSizedArray(e.length),n=e.length;for(t=0;t<n;t+=1)r[t]=Math.abs(e[t]);return r}return Math.abs(e)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(e){e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.display="block",e.style.transformOrigin="0 0",e.style.webkitTransformOrigin="0 0",e.style.backfaceVisibility="visible",e.style.webkitBackfaceVisibility="visible",e.style.transformStyle="preserve-3d",e.style.webkitTransformStyle="preserve-3d",e.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(e,t,r,n){this.type=e,this.currentTime=t,this.totalTime=r,this.direction=n<0?-1:1}function BMCompleteEvent(e,t){this.type=e,this.direction=t<0?-1:1}function BMCompleteLoopEvent(e,t,r,n){this.type=e,this.currentLoop=r,this.totalLoops=t,this.direction=n<0?-1:1}function BMSegmentStartEvent(e,t,r){this.type=e,this.firstFrame=t,this.totalFrames=r}function BMDestroyEvent(e,t){this.type=e,this.target=t}function BMRenderFrameErrorEvent(e,t){this.type="renderFrameError",this.nativeError=e,this.currentTime=t}function BMConfigErrorEvent(e){this.type="configError",this.nativeError=e}var createElementID=(_count=0,function(){return idPrefix$1+"__lottie_element_"+(_count+=1)}),_count;function HSVtoRGB(e,t,r){var n,i,a,o,s,l,c,d;switch(l=r*(1-t),c=r*(1-(s=6*e-(o=Math.floor(6*e)))*t),d=r*(1-(1-s)*t),o%6){case 0:n=r,i=d,a=l;break;case 1:n=c,i=r,a=l;break;case 2:n=l,i=r,a=d;break;case 3:n=l,i=c,a=r;break;case 4:n=d,i=l,a=r;break;case 5:n=r,i=l,a=c}return[n,i,a]}function RGBtoHSV(e,t,r){var n,i=Math.max(e,t,r),a=Math.min(e,t,r),o=i-a,s=0===i?0:o/i,l=i/255;switch(i){case a:n=0;break;case e:n=t-r+o*(t<r?6:0),n/=6*o;break;case t:n=r-e+2*o,n/=6*o;break;case r:n=e-t+4*o,n/=6*o}return[n,s,l]}function addSaturationToRGB(e,t){var r=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return r[1]+=t,r[1]>1?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(e,t){var r=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return r[2]+=t,r[2]>1?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(e,t){var r=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return r[0]+=t/360,r[0]>1?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var e,t,r=[];for(e=0;e<256;e+=1)t=e.toString(16),r[e]=1===t.length?"0"+t:t;return function(e,t,n){return e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),"#"+r[e]+r[t]+r[n]}}(),setSubframeEnabled=function(e){subframeEnabled=!!e},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(e){expressionsPlugin=e},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(e){expressionsInterfaces=e},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(e){defaultCurveSegments=e},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(e){idPrefix$1=e};function createNS(e){return document.createElementNS(svgNS,e)}function _typeof$5(e){return _typeof$5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(e)}var dataManager=function(){var e,t,r=1,n=[],i={onmessage:function(){},postMessage:function(t){e({data:t})}},a={postMessage:function(e){i.onmessage({data:e})}};function o(){t||(t=function(t){if(window.Worker&&window.Blob&&getWebWorker()){var r=new Blob(["var _workerSelf = self; self.onmessage = ",t.toString()],{type:"text/javascript"}),n=URL.createObjectURL(r);return new Worker(n)}return e=t,i}((function(e){if(a.dataManager||(a.dataManager=function(){function e(i,a){var o,s,l,c,d,p,h=i.length;for(s=0;s<h;s+=1)if("ks"in(o=i[s])&&!o.completed){if(o.completed=!0,o.hasMask){var f=o.masksProperties;for(c=f.length,l=0;l<c;l+=1)if(f[l].pt.k.i)n(f[l].pt.k);else for(p=f[l].pt.k.length,d=0;d<p;d+=1)f[l].pt.k[d].s&&n(f[l].pt.k[d].s[0]),f[l].pt.k[d].e&&n(f[l].pt.k[d].e[0])}0===o.ty?(o.layers=t(o.refId,a),e(o.layers,a)):4===o.ty?r(o.shapes):5===o.ty&&u(o)}}function t(e,t){var r=function(e,t){for(var r=0,n=t.length;r<n;){if(t[r].id===e)return t[r];r+=1}return null}(e,t);return r?r.layers.__used?JSON.parse(JSON.stringify(r.layers)):(r.layers.__used=!0,r.layers):null}function r(e){var t,i,a;for(t=e.length-1;t>=0;t-=1)if("sh"===e[t].ty)if(e[t].ks.k.i)n(e[t].ks.k);else for(a=e[t].ks.k.length,i=0;i<a;i+=1)e[t].ks.k[i].s&&n(e[t].ks.k[i].s[0]),e[t].ks.k[i].e&&n(e[t].ks.k[i].e[0]);else"gr"===e[t].ty&&r(e[t].it)}function n(e){var t,r=e.i.length;for(t=0;t<r;t+=1)e.i[t][0]+=e.v[t][0],e.i[t][1]+=e.v[t][1],e.o[t][0]+=e.v[t][0],e.o[t][1]+=e.v[t][1]}function i(e,t){var r=t?t.split("."):[100,100,100];return e[0]>r[0]||!(r[0]>e[0])&&(e[1]>r[1]||!(r[1]>e[1])&&(e[2]>r[2]||!(r[2]>e[2])&&null))}var a,o=function(){var e=[4,4,14];function t(e){var t,r,n,i=e.length;for(t=0;t<i;t+=1)5===e[t].ty&&(n=void 0,n=(r=e[t]).t.d,r.t.d={k:[{s:n,t:0}]})}return function(r){if(i(e,r.v)&&(t(r.layers),r.assets)){var n,a=r.assets.length;for(n=0;n<a;n+=1)r.assets[n].layers&&t(r.assets[n].layers)}}}(),s=(a=[4,7,99],function(e){if(e.chars&&!i(a,e.v)){var t,n=e.chars.length;for(t=0;t<n;t+=1){var o=e.chars[t];o.data&&o.data.shapes&&(r(o.data.shapes),o.data.ip=0,o.data.op=99999,o.data.st=0,o.data.sr=1,o.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},e.chars[t].t||(o.data.shapes.push({ty:"no"}),o.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}),l=function(){var e=[5,7,15];function t(e){var t,r,n=e.length;for(t=0;t<n;t+=1)5===e[t].ty&&(r=void 0,"number"==typeof(r=e[t].t.p).a&&(r.a={a:0,k:r.a}),"number"==typeof r.p&&(r.p={a:0,k:r.p}),"number"==typeof r.r&&(r.r={a:0,k:r.r}))}return function(r){if(i(e,r.v)&&(t(r.layers),r.assets)){var n,a=r.assets.length;for(n=0;n<a;n+=1)r.assets[n].layers&&t(r.assets[n].layers)}}}(),c=function(){var e=[4,1,9];function t(e){var r,n,i,a=e.length;for(r=0;r<a;r+=1)if("gr"===e[r].ty)t(e[r].it);else if("fl"===e[r].ty||"st"===e[r].ty)if(e[r].c.k&&e[r].c.k[0].i)for(i=e[r].c.k.length,n=0;n<i;n+=1)e[r].c.k[n].s&&(e[r].c.k[n].s[0]/=255,e[r].c.k[n].s[1]/=255,e[r].c.k[n].s[2]/=255,e[r].c.k[n].s[3]/=255),e[r].c.k[n].e&&(e[r].c.k[n].e[0]/=255,e[r].c.k[n].e[1]/=255,e[r].c.k[n].e[2]/=255,e[r].c.k[n].e[3]/=255);else e[r].c.k[0]/=255,e[r].c.k[1]/=255,e[r].c.k[2]/=255,e[r].c.k[3]/=255}function r(e){var r,n=e.length;for(r=0;r<n;r+=1)4===e[r].ty&&t(e[r].shapes)}return function(t){if(i(e,t.v)&&(r(t.layers),t.assets)){var n,a=t.assets.length;for(n=0;n<a;n+=1)t.assets[n].layers&&r(t.assets[n].layers)}}}(),d=function(){var e=[4,4,18];function t(e){var r,n,i;for(r=e.length-1;r>=0;r-=1)if("sh"===e[r].ty)if(e[r].ks.k.i)e[r].ks.k.c=e[r].closed;else for(i=e[r].ks.k.length,n=0;n<i;n+=1)e[r].ks.k[n].s&&(e[r].ks.k[n].s[0].c=e[r].closed),e[r].ks.k[n].e&&(e[r].ks.k[n].e[0].c=e[r].closed);else"gr"===e[r].ty&&t(e[r].it)}function r(e){var r,n,i,a,o,s,l=e.length;for(n=0;n<l;n+=1){if((r=e[n]).hasMask){var c=r.masksProperties;for(a=c.length,i=0;i<a;i+=1)if(c[i].pt.k.i)c[i].pt.k.c=c[i].cl;else for(s=c[i].pt.k.length,o=0;o<s;o+=1)c[i].pt.k[o].s&&(c[i].pt.k[o].s[0].c=c[i].cl),c[i].pt.k[o].e&&(c[i].pt.k[o].e[0].c=c[i].cl)}4===r.ty&&t(r.shapes)}}return function(t){if(i(e,t.v)&&(r(t.layers),t.assets)){var n,a=t.assets.length;for(n=0;n<a;n+=1)t.assets[n].layers&&r(t.assets[n].layers)}}}();function u(e){0===e.t.a.length&&e.t.p}var p={completeData:function(r){r.__complete||(c(r),o(r),s(r),l(r),d(r),e(r.layers,r.assets),function(r,n){if(r){var i=0,a=r.length;for(i=0;i<a;i+=1)1===r[i].t&&(r[i].data.layers=t(r[i].data.refId,n),e(r[i].data.layers,n))}}(r.chars,r.assets),r.__complete=!0)}};return p.checkColors=c,p.checkChars=s,p.checkPathProperties=l,p.checkShapes=d,p.completeLayers=e,p}()),a.assetLoader||(a.assetLoader=function(){function e(e){var t=e.getResponseHeader("content-type");return t&&"json"===e.responseType&&-1!==t.indexOf("json")||e.response&&"object"===_typeof$5(e.response)?e.response:e.response&&"string"==typeof e.response?JSON.parse(e.response):e.responseText?JSON.parse(e.responseText):null}return{load:function(t,r,n,i){var a,o=new XMLHttpRequest;try{o.responseType="json"}catch(e){}o.onreadystatechange=function(){if(4===o.readyState)if(200===o.status)a=e(o),n(a);else try{a=e(o),n(a)}catch(e){i&&i(e)}};try{o.open(["G","E","T"].join(""),t,!0)}catch(e){o.open(["G","E","T"].join(""),r+"/"+t,!0)}o.send()}}}()),"loadAnimation"===e.data.type)a.assetLoader.load(e.data.path,e.data.fullPath,(function(t){a.dataManager.completeData(t),a.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){a.postMessage({id:e.data.id,status:"error"})}));else if("complete"===e.data.type){var t=e.data.animation;a.dataManager.completeData(t),a.postMessage({id:e.data.id,payload:t,status:"success"})}else"loadData"===e.data.type&&a.assetLoader.load(e.data.path,e.data.fullPath,(function(t){a.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){a.postMessage({id:e.data.id,status:"error"})}))})),t.onmessage=function(e){var t=e.data,r=t.id,i=n[r];n[r]=null,"success"===t.status?i.onComplete(t.payload):i.onError&&i.onError()})}function s(e,t){var i="processId_"+(r+=1);return n[i]={onComplete:e,onError:t},i}return{loadAnimation:function(e,r,n){o();var i=s(r,n);t.postMessage({type:"loadAnimation",path:e,fullPath:window.location.origin+window.location.pathname,id:i})},loadData:function(e,r,n){o();var i=s(r,n);t.postMessage({type:"loadData",path:e,fullPath:window.location.origin+window.location.pathname,id:i})},completeAnimation:function(e,r,n){o();var i=s(r,n);t.postMessage({type:"complete",animation:e,id:i})}}}(),ImagePreloader=function(){var e=function(){var e=createTag("canvas");e.width=1,e.height=1;var t=e.getContext("2d");return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),e}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function n(e,t,r){var n="";if(e.e)n=e.p;else if(t){var i=e.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),n=t+i}else n=r,n+=e.u?e.u:"",n+=e.p;return n}function i(e){var t=0,r=setInterval(function(){(e.getBBox().width||t>500)&&(this._imageLoaded(),clearInterval(r)),t+=1}.bind(this),50)}function a(e){var t={assetData:e},r=n(e,this.assetsPath,this.path);return dataManager.loadData(r,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function o(){this._imageLoaded=t.bind(this),this._footageLoaded=r.bind(this),this.testImageLoaded=i.bind(this),this.createFootageData=a.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return o.prototype={loadAssets:function(e,t){var r;this.imagesLoadedCb=t;var n=e.length;for(r=0;r<n;r+=1)e[r].layers||(e[r].t&&"seq"!==e[r].t?3===e[r].t&&(this.totalFootages+=1,this.images.push(this.createFootageData(e[r]))):(this.totalImages+=1,this.images.push(this._createImageData(e[r]))))},setAssetsPath:function(e){this.assetsPath=e||""},setPath:function(e){this.path=e||""},loadedImages:function(){return this.totalImages===this.loadedAssets},loadedFootages:function(){return this.totalFootages===this.loadedFootagesCount},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getAsset:function(e){for(var t=0,r=this.images.length;t<r;){if(this.images[t].assetData===e)return this.images[t].img;t+=1}return null},createImgData:function(t){var r=n(t,this.assetsPath,this.path),i=createTag("img");i.crossOrigin="anonymous",i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.src=r;var a={img:i,assetData:t};return a},createImageData:function(t){var r=n(t,this.assetsPath,this.path),i=createNS("image");isSafari?this.testImageLoaded(i):i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.setAttributeNS("http://www.w3.org/1999/xlink","href",r),this._elementHelper.append?this._elementHelper.append(i):this._elementHelper.appendChild(i);var a={img:i,assetData:t};return a},imageLoaded:t,footageLoaded:r,setCacheType:function(e,t){"svg"===e?(this._elementHelper=t,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}},o}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(e,t){if(this._cbs[e])for(var r=this._cbs[e],n=0;n<r.length;n+=1)r[n](t)},addEventListener:function(e,t){return this._cbs[e]||(this._cbs[e]=[]),this._cbs[e].push(t),function(){this.removeEventListener(e,t)}.bind(this)},removeEventListener:function(e,t){if(t){if(this._cbs[e]){for(var r=0,n=this._cbs[e].length;r<n;)this._cbs[e][r]===t&&(this._cbs[e].splice(r,1),r-=1,n-=1),r+=1;this._cbs[e].length||(this._cbs[e]=null)}}else this._cbs[e]=null}};var markerParser=function(){function e(e){for(var t,r=e.split("\r\n"),n={},i=0,a=0;a<r.length;a+=1)2===(t=r[a].split(":")).length&&(n[t[0]]=t[1].trim(),i+=1);if(0===i)throw new Error;return n}return function(t){for(var r=[],n=0;n<t.length;n+=1){var i=t[n],a={time:i.tm,duration:i.dr};try{a.payload=JSON.parse(t[n].cm)}catch(r){try{a.payload=e(t[n].cm)}catch(e){a.payload={name:t[n].cm}}}r.push(a)}return r}}(),ProjectInterface=function(){function e(e){this.compositions.push(e)}return function(){function t(e){for(var t=0,r=this.compositions.length;t<r;){if(this.compositions[t].data&&this.compositions[t].data.nm===e)return this.compositions[t].prepareFrame&&this.compositions[t].data.xt&&this.compositions[t].prepareFrame(this.currentFrame),this.compositions[t].compInterface;t+=1}return null}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),renderers={},registerRenderer=function(e,t){renderers[e]=t};function getRenderer(e){return renderers[e]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var e in renderers)if(renderers[e])return e;return""}function _typeof$4(e){return _typeof$4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$4(e)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(e){(e.wrapper||e.container)&&(this.wrapper=e.wrapper||e.container);var t="svg";e.animType?t=e.animType:e.renderer&&(t=e.renderer);var r=getRenderer(t);this.renderer=new r(this,e.rendererSettings),this.imagePreloader.setCacheType(t,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=t,""===e.loop||null===e.loop||void 0===e.loop||!0===e.loop?this.loop=!0:!1===e.loop?this.loop=!1:this.loop=parseInt(e.loop,10),this.autoplay=!("autoplay"in e)||e.autoplay,this.name=e.name?e.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(e,"autoloadSegments")||e.autoloadSegments,this.assetsPath=e.assetsPath,this.initialSegment=e.initialSegment,e.audioFactory&&this.audioController.setAudioFactory(e.audioFactory),e.animationData?this.setupAnimation(e.animationData):e.path&&(-1!==e.path.lastIndexOf("\\")?this.path=e.path.substr(0,e.path.lastIndexOf("\\")+1):this.path=e.path.substr(0,e.path.lastIndexOf("/")+1),this.fileName=e.path.substr(e.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(e.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(e){dataManager.completeAnimation(e,this.configAnimation)},AnimationItem.prototype.setData=function(e,t){t&&"object"!==_typeof$4(t)&&(t=JSON.parse(t));var r={wrapper:e,animationData:t},n=e.attributes;r.path=n.getNamedItem("data-animation-path")?n.getNamedItem("data-animation-path").value:n.getNamedItem("data-bm-path")?n.getNamedItem("data-bm-path").value:n.getNamedItem("bm-path")?n.getNamedItem("bm-path").value:"",r.animType=n.getNamedItem("data-anim-type")?n.getNamedItem("data-anim-type").value:n.getNamedItem("data-bm-type")?n.getNamedItem("data-bm-type").value:n.getNamedItem("bm-type")?n.getNamedItem("bm-type").value:n.getNamedItem("data-bm-renderer")?n.getNamedItem("data-bm-renderer").value:n.getNamedItem("bm-renderer")?n.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var i=n.getNamedItem("data-anim-loop")?n.getNamedItem("data-anim-loop").value:n.getNamedItem("data-bm-loop")?n.getNamedItem("data-bm-loop").value:n.getNamedItem("bm-loop")?n.getNamedItem("bm-loop").value:"";"false"===i?r.loop=!1:"true"===i?r.loop=!0:""!==i&&(r.loop=parseInt(i,10));var a=n.getNamedItem("data-anim-autoplay")?n.getNamedItem("data-anim-autoplay").value:n.getNamedItem("data-bm-autoplay")?n.getNamedItem("data-bm-autoplay").value:!n.getNamedItem("bm-autoplay")||n.getNamedItem("bm-autoplay").value;r.autoplay="false"!==a,r.name=n.getNamedItem("data-name")?n.getNamedItem("data-name").value:n.getNamedItem("data-bm-name")?n.getNamedItem("data-bm-name").value:n.getNamedItem("bm-name")?n.getNamedItem("bm-name").value:"","false"===(n.getNamedItem("data-anim-prerender")?n.getNamedItem("data-anim-prerender").value:n.getNamedItem("data-bm-prerender")?n.getNamedItem("data-bm-prerender").value:n.getNamedItem("bm-prerender")?n.getNamedItem("bm-prerender").value:"")&&(r.prerender=!1),r.path?this.setParams(r):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(e){e.op>this.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t,r,n=this.animationData.layers,i=n.length,a=e.layers,o=a.length;for(r=0;r<o;r+=1)for(t=0;t<i;){if(n[t].id===a[r].id){n[t]=a[r];break}t+=1}if((e.chars||e.fonts)&&(this.renderer.globalData.fontManager.addChars(e.chars),this.renderer.globalData.fontManager.addFonts(e.fonts,this.renderer.globalData.defs)),e.assets)for(i=e.assets.length,t=0;t<i;t+=1)this.animationData.assets.push(e.assets[t]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(e){this.animationData=e;var t=getExpressionsPlugin();t&&t.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var e=this.animationData.segments;if(!e||0===e.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var t=e.shift();this.timeCompleted=t.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(r,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(e){if(this.renderer)try{this.animationData=e,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(e),e.assets||(e.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(e.assets),this.markers=markerParser(e.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(e){this.triggerConfigError(e)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||"canvas"!==this.renderer.rendererType)&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var e=getExpressionsPlugin();e&&e.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(e,t){var r="number"==typeof e?e:void 0,n="number"==typeof t?t:void 0;this.renderer.updateContainerSize(r,n)},AnimationItem.prototype.setSubframe=function(e){this.isSubframeEnabled=!!e},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},AnimationItem.prototype.play=function(e){e&&this.name!==e||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(e){e&&this.name!==e||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(e){e&&this.name!==e||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(e){for(var t,r=0;r<this.markers.length;r+=1)if((t=this.markers[r]).payload&&t.payload.name===e)return t;return null},AnimationItem.prototype.goToAndStop=function(e,t,r){if(!r||this.name===r){var n=Number(e);if(isNaN(n)){var i=this.getMarkerData(e);i&&this.goToAndStop(i.time,!0)}else t?this.setCurrentRawFrameValue(e):this.setCurrentRawFrameValue(e*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(e,t,r){if(!r||this.name===r){var n=Number(e);if(isNaN(n)){var i=this.getMarkerData(e);i&&(i.duration?this.playSegments([i.time,i.time+i.duration],!0):this.goToAndStop(i.time,!0))}else this.goToAndStop(n,t,r);this.play()}},AnimationItem.prototype.advanceTime=function(e){if(!0!==this.isPaused&&!1!==this.isLoaded){var t=this.currentRawFrame+e*this.frameModifier,r=!1;t>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(t):this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(r=!0,t=this.totalFrames-1):t<0?this.checkSegments(t%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,t=0):(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(t),r&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]<e[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(e,t){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<e?r=e:this.currentRawFrame+this.firstFrame>t&&(r=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),"object"===_typeof$4(e[0])){var r,n=e.length;for(r=0;r<n;r+=1)this.segments.push(e[r])}else this.segments.push(e);this.segments.length&&t&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(e){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),e&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(e){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),e),!0)},AnimationItem.prototype.destroy=function(e){e&&this.name!==e||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(e){this.currentRawFrame=e,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(e){this.playSpeed=e,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(e){this.playDirection=e<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(e){this.loop=e},AnimationItem.prototype.setVolume=function(e,t){t&&this.name!==t||this.audioController.setVolume(e)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(e){e&&this.name!==e||this.audioController.mute()},AnimationItem.prototype.unmute=function(e){e&&this.name!==e||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(e){var t="";if(e.e)t=e.p;else if(this.assetsPath){var r=e.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),t=this.assetsPath+r}else t=this.path,t+=e.u?e.u:"",t+=e.p;return t},AnimationItem.prototype.getAssetData=function(e){for(var t=0,r=this.assets.length;t<r;){if(e===this.assets[t].id)return this.assets[t];t+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(e){return e?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(e,t,r){try{this.renderer.getElementByPath(e).updateDocumentData(t,r)}catch(e){}},AnimationItem.prototype.trigger=function(e){if(this._cbs&&this._cbs[e])switch(e){case"enterFrame":this.triggerEvent(e,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(e,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(e,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(e,new BMCompleteEvent(e,this.frameMult));break;case"segmentStart":this.triggerEvent(e,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(e,new BMDestroyEvent(e,this));break;default:this.triggerEvent(e)}"enterFrame"===e&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===e&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult)),"complete"===e&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(e,this.frameMult)),"segmentStart"===e&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames)),"destroy"===e&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(e,this))},AnimationItem.prototype.triggerRenderFrameError=function(e){var t=new BMRenderFrameErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)},AnimationItem.prototype.triggerConfigError=function(e){var t=new BMConfigErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)};var animationManager=function(){var e={},t=[],r=0,n=0,i=0,a=!0,o=!1;function s(e){for(var r=0,i=e.target;r<n;)t[r].animation===i&&(t.splice(r,1),r-=1,n-=1,i.isPaused||d()),r+=1}function l(e,r){if(!e)return null;for(var i=0;i<n;){if(t[i].elem===e&&null!==t[i].elem)return t[i].animation;i+=1}var a=new AnimationItem;return u(a,e),a.setData(e,r),a}function c(){i+=1,f()}function d(){i-=1}function u(e,r){e.addEventListener("destroy",s),e.addEventListener("_active",c),e.addEventListener("_idle",d),t.push({elem:r,animation:e}),n+=1}function p(e){var s,l=e-r;for(s=0;s<n;s+=1)t[s].animation.advanceTime(l);r=e,i&&!o?window.requestAnimationFrame(p):a=!0}function h(e){r=e,window.requestAnimationFrame(p)}function f(){!o&&i&&a&&(window.requestAnimationFrame(h),a=!1)}return e.registerAnimation=l,e.loadAnimation=function(e){var t=new AnimationItem;return u(t,null),t.setParams(e),t},e.setSpeed=function(e,r){var i;for(i=0;i<n;i+=1)t[i].animation.setSpeed(e,r)},e.setDirection=function(e,r){var i;for(i=0;i<n;i+=1)t[i].animation.setDirection(e,r)},e.play=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.play(e)},e.pause=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.pause(e)},e.stop=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.stop(e)},e.togglePause=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.togglePause(e)},e.searchAnimations=function(e,t,r){var n,i=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=i.length;for(n=0;n<a;n+=1)r&&i[n].setAttribute("data-bm-type",r),l(i[n],e);if(t&&0===a){r||(r="svg");var o=document.getElementsByTagName("body")[0];o.innerText="";var s=createTag("div");s.style.width="100%",s.style.height="100%",s.setAttribute("data-bm-type",r),o.appendChild(s),l(s,e)}},e.resize=function(){var e;for(e=0;e<n;e+=1)t[e].animation.resize()},e.goToAndStop=function(e,r,i){var a;for(a=0;a<n;a+=1)t[a].animation.goToAndStop(e,r,i)},e.destroy=function(e){var r;for(r=n-1;r>=0;r-=1)t[r].animation.destroy(e)},e.freeze=function(){o=!0},e.unfreeze=function(){o=!1,f()},e.setVolume=function(e,r){var i;for(i=0;i<n;i+=1)t[i].animation.setVolume(e,r)},e.mute=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.mute(e)},e.unmute=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.unmute(e)},e.getRegisteredAnimations=function(){var e,r=t.length,n=[];for(e=0;e<r;e+=1)n.push(t[e].animation);return n},e}(),BezierFactory=function(){var e={getBezierEasing:function(e,r,n,i,a){var o=a||("bez_"+e+"_"+r+"_"+n+"_"+i).replace(/\./g,"p");if(t[o])return t[o];var s=new d([e,r,n,i]);return t[o]=s,s}},t={},r=11,n=1/(r-1),i="function"==typeof Float32Array;function a(e,t){return 1-3*t+3*e}function o(e,t){return 3*t-6*e}function s(e){return 3*e}function l(e,t,r){return((a(t,r)*e+o(t,r))*e+s(t))*e}function c(e,t,r){return 3*a(t,r)*e*e+2*o(t,r)*e+s(t)}function d(e){this._p=e,this._mSampleValues=i?new Float32Array(r):new Array(r),this._precomputed=!1,this.get=this.get.bind(this)}return d.prototype={get:function(e){var t=this._p[0],r=this._p[1],n=this._p[2],i=this._p[3];return this._precomputed||this._precompute(),t===r&&n===i?e:0===e?0:1===e?1:l(this._getTForX(e),r,i)},_precompute:function(){var e=this._p[0],t=this._p[1],r=this._p[2],n=this._p[3];this._precomputed=!0,e===t&&r===n||this._calcSampleValues()},_calcSampleValues:function(){for(var e=this._p[0],t=this._p[2],i=0;i<r;++i)this._mSampleValues[i]=l(i*n,e,t)},_getTForX:function(e){for(var t=this._p[0],i=this._p[2],a=this._mSampleValues,o=0,s=1,d=r-1;s!==d&&a[s]<=e;++s)o+=n;var u=o+(e-a[--s])/(a[s+1]-a[s])*n,p=c(u,t,i);return p>=.001?function(e,t,r,n){for(var i=0;i<4;++i){var a=c(t,r,n);if(0===a)return t;t-=(l(t,r,n)-e)/a}return t}(e,u,t,i):0===p?u:function(e,t,r,n,i){var a,o,s=0;do{(a=l(o=t+(r-t)/2,n,i)-e)>0?r=o:t=o}while(Math.abs(a)>1e-7&&++s<10);return o}(e,o,o+n,t,i)}},e}(),pooling={double:function(e){return e.concat(createSizedArray(e.length))}},poolFactory=function(e,t,r){var n=0,i=e,a=createSizedArray(i);return{newElement:function(){return n?a[n-=1]:t()},release:function(e){n===i&&(a=pooling.double(a),i*=2),r&&r(e),a[n]=e,n+=1}}},bezierLengthPool=poolFactory(8,(function(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}})),segmentsLengthPool=poolFactory(8,(function(){return{lengths:[],totalLength:0}}),(function(e){var t,r=e.lengths.length;for(t=0;t<r;t+=1)bezierLengthPool.release(e.lengths[t]);e.lengths.length=0}));function bezFunction(){var e=Math;function t(e,t,r,n,i,a){var o=e*n+t*i+r*a-i*n-a*e-r*t;return o>-.001&&o<.001}var r=function(e,t,r,n){var i,a,o,s,l,c,d=getDefaultCurveSegments(),u=0,p=[],h=[],f=bezierLengthPool.newElement();for(o=r.length,i=0;i<d;i+=1){for(l=i/(d-1),c=0,a=0;a<o;a+=1)s=bmPow(1-l,3)*e[a]+3*bmPow(1-l,2)*l*r[a]+3*(1-l)*bmPow(l,2)*n[a]+bmPow(l,3)*t[a],p[a]=s,null!==h[a]&&(c+=bmPow(p[a]-h[a],2)),h[a]=p[a];c&&(u+=c=bmSqrt(c)),f.percents[i]=l,f.lengths[i]=u}return f.addedLength=u,f};function n(e){this.segmentLength=0,this.points=new Array(e)}function i(e,t){this.partialLength=e,this.point=t}var a,o=(a={},function(e,r,o,s){var l=(e[0]+"_"+e[1]+"_"+r[0]+"_"+r[1]+"_"+o[0]+"_"+o[1]+"_"+s[0]+"_"+s[1]).replace(/\./g,"p");if(!a[l]){var c,d,u,p,h,f,m,g=getDefaultCurveSegments(),v=0,y=null;2===e.length&&(e[0]!==r[0]||e[1]!==r[1])&&t(e[0],e[1],r[0],r[1],e[0]+o[0],e[1]+o[1])&&t(e[0],e[1],r[0],r[1],r[0]+s[0],r[1]+s[1])&&(g=2);var b=new n(g);for(u=o.length,c=0;c<g;c+=1){for(m=createSizedArray(u),h=c/(g-1),f=0,d=0;d<u;d+=1)p=bmPow(1-h,3)*e[d]+3*bmPow(1-h,2)*h*(e[d]+o[d])+3*(1-h)*bmPow(h,2)*(r[d]+s[d])+bmPow(h,3)*r[d],m[d]=p,null!==y&&(f+=bmPow(m[d]-y[d],2));v+=f=bmSqrt(f),b.points[c]=new i(f,m),y=m}b.segmentLength=v,a[l]=b}return a[l]});function s(e,t){var r=t.percents,n=t.lengths,i=r.length,a=bmFloor((i-1)*e),o=e*t.addedLength,s=0;if(a===i-1||0===a||o===n[a])return r[a];for(var l=n[a]>o?-1:1,c=!0;c;)if(n[a]<=o&&n[a+1]>o?(s=(o-n[a])/(n[a+1]-n[a]),c=!1):a+=l,a<0||a>=i-1){if(a===i-1)return r[a];c=!1}return r[a]+(r[a+1]-r[a])*s}var l=createTypedArray("float32",8);return{getSegmentsLength:function(e){var t,n=segmentsLengthPool.newElement(),i=e.c,a=e.v,o=e.o,s=e.i,l=e._length,c=n.lengths,d=0;for(t=0;t<l-1;t+=1)c[t]=r(a[t],a[t+1],o[t],s[t+1]),d+=c[t].addedLength;return i&&l&&(c[t]=r(a[t],a[0],o[t],s[0]),d+=c[t].addedLength),n.totalLength=d,n},getNewSegment:function(t,r,n,i,a,o,c){a<0?a=0:a>1&&(a=1);var d,u=s(a,c),p=s(o=o>1?1:o,c),h=t.length,f=1-u,m=1-p,g=f*f*f,v=u*f*f*3,y=u*u*f*3,b=u*u*u,E=f*f*m,_=u*f*m+f*u*m+f*f*p,S=u*u*m+f*u*p+u*f*p,T=u*u*p,x=f*m*m,k=u*m*m+f*p*m+f*m*p,A=u*p*m+f*p*p+u*m*p,I=u*p*p,C=m*m*m,P=p*m*m+m*p*m+m*m*p,w=p*p*m+m*p*p+p*m*p,D=p*p*p;for(d=0;d<h;d+=1)l[4*d]=e.round(1e3*(g*t[d]+v*n[d]+y*i[d]+b*r[d]))/1e3,l[4*d+1]=e.round(1e3*(E*t[d]+_*n[d]+S*i[d]+T*r[d]))/1e3,l[4*d+2]=e.round(1e3*(x*t[d]+k*n[d]+A*i[d]+I*r[d]))/1e3,l[4*d+3]=e.round(1e3*(C*t[d]+P*n[d]+w*i[d]+D*r[d]))/1e3;return l},getPointInSegment:function(t,r,n,i,a,o){var l=s(a,o),c=1-l;return[e.round(1e3*(c*c*c*t[0]+(l*c*c+c*l*c+c*c*l)*n[0]+(l*l*c+c*l*l+l*c*l)*i[0]+l*l*l*r[0]))/1e3,e.round(1e3*(c*c*c*t[1]+(l*c*c+c*l*c+c*c*l)*n[1]+(l*l*c+c*l*l+l*c*l)*i[1]+l*l*l*r[1]))/1e3]},buildBezierData:o,pointOnLine2D:t,pointOnLine3D:function(r,n,i,a,o,s,l,c,d){if(0===i&&0===s&&0===d)return t(r,n,a,o,l,c);var u,p=e.sqrt(e.pow(a-r,2)+e.pow(o-n,2)+e.pow(s-i,2)),h=e.sqrt(e.pow(l-r,2)+e.pow(c-n,2)+e.pow(d-i,2)),f=e.sqrt(e.pow(l-a,2)+e.pow(c-o,2)+e.pow(d-s,2));return(u=p>h?p>f?p-h-f:f-h-p:f>h?f-h-p:h-p-f)>-1e-4&&u<1e-4}}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(e,t){var r,n=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var i,a,o,s,l,c,d,u,p,h=t.lastIndex,f=h,m=this.keyframes.length-1,g=!0;g;){if(i=this.keyframes[f],a=this.keyframes[f+1],f===m-1&&e>=a.t-n){i.h&&(i=a),h=0;break}if(a.t-n>e){h=f;break}f<m-1?f+=1:(h=0,g=!1)}o=this.keyframesMetadata[f]||{};var v,y=a.t-n,b=i.t-n;if(i.to){o.bezierData||(o.bezierData=bez.buildBezierData(i.s,a.s||i.e,i.to,i.ti));var E=o.bezierData;if(e>=y||e<b){var _=e>=y?E.points.length-1:0;for(l=E.points[_].point.length,s=0;s<l;s+=1)r[s]=E.points[_].point[s]}else{o.__fnct?p=o.__fnct:(p=BezierFactory.getBezierEasing(i.o.x,i.o.y,i.i.x,i.i.y,i.n).get,o.__fnct=p),c=p((e-b)/(y-b));var S,T=E.segmentLength*c,x=t.lastFrame<e&&t._lastKeyframeIndex===f?t._lastAddedLength:0;for(u=t.lastFrame<e&&t._lastKeyframeIndex===f?t._lastPoint:0,g=!0,d=E.points.length;g;){if(x+=E.points[u].partialLength,0===T||0===c||u===E.points.length-1){for(l=E.points[u].point.length,s=0;s<l;s+=1)r[s]=E.points[u].point[s];break}if(T>=x&&T<x+E.points[u+1].partialLength){for(S=(T-x)/E.points[u+1].partialLength,l=E.points[u].point.length,s=0;s<l;s+=1)r[s]=E.points[u].point[s]+(E.points[u+1].point[s]-E.points[u].point[s])*S;break}u<d-1?u+=1:g=!1}t._lastPoint=u,t._lastAddedLength=x-E.points[u].partialLength,t._lastKeyframeIndex=f}}else{var k,A,I,C,P;if(m=i.s.length,v=a.s||i.e,this.sh&&1!==i.h)e>=y?(r[0]=v[0],r[1]=v[1],r[2]=v[2]):e<=b?(r[0]=i.s[0],r[1]=i.s[1],r[2]=i.s[2]):quaternionToEuler(r,slerp(createQuaternion(i.s),createQuaternion(v),(e-b)/(y-b)));else for(f=0;f<m;f+=1)1!==i.h&&(e>=y?c=1:e<b?c=0:(i.o.x.constructor===Array?(o.__fnct||(o.__fnct=[]),o.__fnct[f]?p=o.__fnct[f]:(k=void 0===i.o.x[f]?i.o.x[0]:i.o.x[f],A=void 0===i.o.y[f]?i.o.y[0]:i.o.y[f],I=void 0===i.i.x[f]?i.i.x[0]:i.i.x[f],C=void 0===i.i.y[f]?i.i.y[0]:i.i.y[f],p=BezierFactory.getBezierEasing(k,A,I,C).get,o.__fnct[f]=p)):o.__fnct?p=o.__fnct:(k=i.o.x,A=i.o.y,I=i.i.x,C=i.i.y,p=BezierFactory.getBezierEasing(k,A,I,C).get,i.keyframeMetadata=p),c=p((e-b)/(y-b)))),v=a.s||i.e,P=1===i.h?i.s[f]:i.s[f]+(v[f]-i.s[f])*c,"multidimensional"===this.propType?r[f]=P:r=P}return t.lastIndex=h,r}function slerp(e,t,r){var n,i,a,o,s,l=[],c=e[0],d=e[1],u=e[2],p=e[3],h=t[0],f=t[1],m=t[2],g=t[3];return(i=c*h+d*f+u*m+p*g)<0&&(i=-i,h=-h,f=-f,m=-m,g=-g),1-i>1e-6?(n=Math.acos(i),a=Math.sin(n),o=Math.sin((1-r)*n)/a,s=Math.sin(r*n)/a):(o=1-r,s=r),l[0]=o*c+s*h,l[1]=o*d+s*f,l[2]=o*u+s*m,l[3]=o*p+s*g,l}function quaternionToEuler(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=Math.atan2(2*n*a-2*r*i,1-2*n*n-2*i*i),s=Math.asin(2*r*n+2*i*a),l=Math.atan2(2*r*a-2*n*i,1-2*r*r-2*i*i);e[0]=o/degToRads,e[1]=s/degToRads,e[2]=l/degToRads}function createQuaternion(e){var t=e[0]*degToRads,r=e[1]*degToRads,n=e[2]*degToRads,i=Math.cos(t/2),a=Math.cos(r/2),o=Math.cos(n/2),s=Math.sin(t/2),l=Math.sin(r/2),c=Math.sin(n/2);return[s*l*o+i*a*c,s*a*o+i*l*c,i*l*o-s*a*c,i*a*o-s*l*c]}function getValueAtCurrentTime(){var e=this.comp.renderedFrame-this.offsetTime,t=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(e===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=r&&e>=r||this._caching.lastFrame<t&&e<t))){this._caching.lastFrame>=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var n=this.interpolateValue(e,this._caching);this.pv=n}return this._caching.lastFrame=e,this.pv}function setVValue(e){var t;if("unidimensional"===this.propType)t=e*this.mult,mathAbs(this.v-t)>1e-5&&(this.v=t,this._mdf=!0);else for(var r=0,n=this.v.length;r<n;)t=e[r]*this.mult,mathAbs(this.v[r]-t)>1e-5&&(this.v[r]=t,this._mdf=!0),r+=1}function processEffectsSequence(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e;this.lock=!0,this._mdf=this._isFirstFrame;var t=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(e=0;e<t;e+=1)r=this.effectsSequence[e](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function ValueProperty(e,t,r,n){this.propType="unidimensional",this.mult=r||1,this.data=t,this.v=r?t.k*r:t.k,this.pv=t.k,this._mdf=!1,this.elem=e,this.container=n,this.comp=e.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(e,t,r,n){var i;this.propType="multidimensional",this.mult=r||1,this.data=t,this._mdf=!1,this.elem=e,this.container=n,this.comp=e.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a=t.k.length;for(this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a),this.vel=createTypedArray("float32",a),i=0;i<a;i+=1)this.v[i]=t.k[i]*this.mult,this.pv[i]=t.k[i];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(e,t,r,n){this.propType="unidimensional",this.keyframes=t.k,this.keyframesMetadata=[],this.offsetTime=e.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=t,this.mult=r||1,this.elem=e,this.container=n,this.comp=e.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(e,t,r,n){var i;this.propType="multidimensional";var a,o,s,l,c=t.k.length;for(i=0;i<c-1;i+=1)t.k[i].to&&t.k[i].s&&t.k[i+1]&&t.k[i+1].s&&(a=t.k[i].s,o=t.k[i+1].s,s=t.k[i].to,l=t.k[i].ti,(2===a.length&&(a[0]!==o[0]||a[1]!==o[1])&&bez.pointOnLine2D(a[0],a[1],o[0],o[1],a[0]+s[0],a[1]+s[1])&&bez.pointOnLine2D(a[0],a[1],o[0],o[1],o[0]+l[0],o[1]+l[1])||3===a.length&&(a[0]!==o[0]||a[1]!==o[1]||a[2]!==o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],o[0],o[1],o[2],a[0]+s[0],a[1]+s[1],a[2]+s[2])&&bez.pointOnLine3D(a[0],a[1],a[2],o[0],o[1],o[2],o[0]+l[0],o[1]+l[1],o[2]+l[2]))&&(t.k[i].to=null,t.k[i].ti=null),a[0]===o[0]&&a[1]===o[1]&&0===s[0]&&0===s[1]&&0===l[0]&&0===l[1]&&(2===a.length||a[2]===o[2]&&0===s[2]&&0===l[2])&&(t.k[i].to=null,t.k[i].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=t,this.keyframes=t.k,this.keyframesMetadata=[],this.offsetTime=e.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=r||1,this.elem=e,this.container=n,this.comp=e.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var d=t.k[0].s.length;for(this.v=createTypedArray("float32",d),this.pv=createTypedArray("float32",d),i=0;i<d;i+=1)this.v[i]=initFrame,this.pv[i]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",d)},this.addEffect=addEffect}var PropertyFactory=(ob={getProp:function(e,t,r,n,i){var a;if(t.sid&&(t=e.globalData.slotManager.getProp(t)),t.k.length)if("number"==typeof t.k[0])a=new MultiDimensionalProperty(e,t,n,i);else switch(r){case 0:a=new KeyframedValueProperty(e,t,n,i);break;case 1:a=new KeyframedMultidimensionalProperty(e,t,n,i)}else a=new ValueProperty(e,t,n,i);return a.effectsSequence.length&&i.addDynamicProperty(a),a}},ob),ob;function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&(this.dynamicProperties.push(e),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var e;this._mdf=!1;var t=this.dynamicProperties.length;for(e=0;e<t;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(e){this.container=e,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=poolFactory(8,(function(){return createTypedArray("float32",2)}));function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(e,t){this.c=e,this.setLength(t);for(var r=0;r<t;)this.v[r]=pointPool.newElement(),this.o[r]=pointPool.newElement(),this.i[r]=pointPool.newElement(),r+=1},ShapePath.prototype.setLength=function(e){for(;this._maxLength<e;)this.doubleArrayLength();this._length=e},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(e,t,r,n,i){var a;switch(this._length=Math.max(this._length,n+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}(!a[n]||a[n]&&!i)&&(a[n]=pointPool.newElement()),a[n][0]=e,a[n][1]=t},ShapePath.prototype.setTripleAt=function(e,t,r,n,i,a,o,s){this.setXYAt(e,t,"v",o,s),this.setXYAt(r,n,"o",o,s),this.setXYAt(i,a,"i",o,s)},ShapePath.prototype.reverse=function(){var e=new ShapePath;e.setPathData(this.c,this._length);var t=this.v,r=this.o,n=this.i,i=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],n[0][0],n[0][1],r[0][0],r[0][1],0,!1),i=1);var a,o=this._length-1,s=this._length;for(a=i;a<s;a+=1)e.setTripleAt(t[o][0],t[o][1],n[o][0],n[o][1],r[o][0],r[o][1],a,!1),o-=1;return e},ShapePath.prototype.length=function(){return this._length};var shapePool=(factory=poolFactory(4,(function(){return new ShapePath}),(function(e){var t,r=e._length;for(t=0;t<r;t+=1)pointPool.release(e.v[t]),pointPool.release(e.i[t]),pointPool.release(e.o[t]),e.v[t]=null,e.i[t]=null,e.o[t]=null;e._length=0,e.c=!1})),factory.clone=function(e){var t,r=factory.newElement(),n=void 0===e._length?e.v.length:e._length;for(r.setLength(n),r.c=e.c,t=0;t<n;t+=1)r.setTripleAt(e.v[t][0],e.v[t][1],e.o[t][0],e.o[t][1],e.i[t][0],e.i[t][1],t);return r},factory),factory;function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(e){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=e,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var e;for(e=0;e<this._length;e+=1)shapePool.release(this.shapes[e]);this._length=0};var shapeCollectionPool=function(){var e={newShapeCollection:function(){return t?n[t-=1]:new ShapeCollection},release:function(e){var i,a=e._length;for(i=0;i<a;i+=1)shapePool.release(e.shapes[i]);e._length=0,t===r&&(n=pooling.double(n),r*=2),n[t]=e,t+=1}},t=0,r=4,n=createSizedArray(r);return e}(),ShapePropertyFactory=function(){var e=-999999;function t(e,t,r){var n,i,a,o,s,l,c,d,u,p=r.lastIndex,h=this.keyframes;if(e<h[0].t-this.offsetTime)n=h[0].s[0],a=!0,p=0;else if(e>=h[h.length-1].t-this.offsetTime)n=h[h.length-1].s?h[h.length-1].s[0]:h[h.length-2].e[0],a=!0;else{for(var f,m,g,v=p,y=h.length-1,b=!0;b&&(f=h[v],!((m=h[v+1]).t-this.offsetTime>e));)v<y-1?v+=1:b=!1;if(g=this.keyframesMetadata[v]||{},p=v,!(a=1===f.h)){if(e>=m.t-this.offsetTime)d=1;else if(e<f.t-this.offsetTime)d=0;else{var E;g.__fnct?E=g.__fnct:(E=BezierFactory.getBezierEasing(f.o.x,f.o.y,f.i.x,f.i.y).get,g.__fnct=E),d=E((e-(f.t-this.offsetTime))/(m.t-this.offsetTime-(f.t-this.offsetTime)))}i=m.s?m.s[0]:f.e[0]}n=f.s[0]}for(l=t._length,c=n.i[0].length,r.lastIndex=p,o=0;o<l;o+=1)for(s=0;s<c;s+=1)u=a?n.i[o][s]:n.i[o][s]+(i.i[o][s]-n.i[o][s])*d,t.i[o][s]=u,u=a?n.o[o][s]:n.o[o][s]+(i.o[o][s]-n.o[o][s])*d,t.o[o][s]=u,u=a?n.v[o][s]:n.v[o][s]+(i.v[o][s]-n.v[o][s])*d,t.v[o][s]=u}function r(){var t=this.comp.renderedFrame-this.offsetTime,r=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==e&&(i<r&&t<r||i>n&&t>n)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}function n(){this.paths=this.localShapeCollection}function i(e){(function(e,t){if(e._length!==t._length||e.c!==t.c)return!1;var r,n=e._length;for(r=0;r<n;r+=1)if(e.v[r][0]!==t.v[r][0]||e.v[r][1]!==t.v[r][1]||e.o[r][0]!==t.o[r][0]||e.o[r][1]!==t.o[r][1]||e.i[r][0]!==t.i[r][0]||e.i[r][1]!==t.i[r][1])return!1;return!0})(this.v,e)||(this.v=shapePool.clone(e),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function a(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e,t;this.lock=!0,this._mdf=!1,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var r=this.effectsSequence.length;for(t=0;t<r;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function o(e,t,r){this.propType="shape",this.comp=e.comp,this.container=e,this.elem=e,this.data=t,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===r?t.pt.k:t.ks.k;this.v=shapePool.clone(i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=n,this.effectsSequence=[]}function s(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function l(t,i,a){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===a?i.pt.k:i.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var o=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,o),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=e,this.reset=n,this._caching={lastFrame:e,lastIndex:0},this.effectsSequence=[r.bind(this)]}o.prototype.interpolateShape=t,o.prototype.getValue=a,o.prototype.setVValue=i,o.prototype.addEffect=s,l.prototype.getValue=a,l.prototype.interpolateShape=t,l.prototype.setVValue=i,l.prototype.addEffect=s;var c=function(){var e=roundCorner;function t(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=t.d,this.elem=e,this.comp=e.comp,this.frameId=-1,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],r=this.p.v[1],n=this.s.v[0]/2,i=this.s.v[1]/2,a=3!==this.d,o=this.v;o.v[0][0]=t,o.v[0][1]=r-i,o.v[1][0]=a?t+n:t-n,o.v[1][1]=r,o.v[2][0]=t,o.v[2][1]=r+i,o.v[3][0]=a?t-n:t+n,o.v[3][1]=r,o.i[0][0]=a?t-n*e:t+n*e,o.i[0][1]=r-i,o.i[1][0]=a?t+n:t-n,o.i[1][1]=r-i*e,o.i[2][0]=a?t+n*e:t-n*e,o.i[2][1]=r+i,o.i[3][0]=a?t-n:t+n,o.i[3][1]=r+i*e,o.o[0][0]=a?t+n*e:t-n*e,o.o[0][1]=r-i,o.o[1][0]=a?t+n:t-n,o.o[1][1]=r+i*e,o.o[2][0]=a?t-n*e:t+n*e,o.o[2][1]=r+i,o.o[3][0]=a?t-n:t+n,o.o[3][1]=r-i*e}},extendPrototype([DynamicPropertyContainer],t),t}(),d=function(){function e(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=e,this.comp=e.comp,this.data=t,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),1===t.sy?(this.ir=PropertyFactory.getProp(e,t.ir,0,0,this),this.is=PropertyFactory.getProp(e,t.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(e,t.pt,0,0,this),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,degToRads,this),this.or=PropertyFactory.getProp(e,t.or,0,0,this),this.os=PropertyFactory.getProp(e,t.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return e.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var e,t,r,n,i=2*Math.floor(this.pt.v),a=2*Math.PI/i,o=!0,s=this.or.v,l=this.ir.v,c=this.os.v,d=this.is.v,u=2*Math.PI*s/(2*i),p=2*Math.PI*l/(2*i),h=-Math.PI/2;h+=this.r.v;var f=3===this.data.d?-1:1;for(this.v._length=0,e=0;e<i;e+=1){r=o?c:d,n=o?u:p;var m=(t=o?s:l)*Math.cos(h),g=t*Math.sin(h),v=0===m&&0===g?0:g/Math.sqrt(m*m+g*g),y=0===m&&0===g?0:-m/Math.sqrt(m*m+g*g);m+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(m,g,m-v*n*r*f,g-y*n*r*f,m+v*n*r*f,g+y*n*r*f,e,!0),o=!o,h+=a*f}},convertPolygonToPath:function(){var e,t=Math.floor(this.pt.v),r=2*Math.PI/t,n=this.or.v,i=this.os.v,a=2*Math.PI*n/(4*t),o=.5*-Math.PI,s=3===this.data.d?-1:1;for(o+=this.r.v,this.v._length=0,e=0;e<t;e+=1){var l=n*Math.cos(o),c=n*Math.sin(o),d=0===l&&0===c?0:c/Math.sqrt(l*l+c*c),u=0===l&&0===c?0:-l/Math.sqrt(l*l+c*c);l+=+this.p.v[0],c+=+this.p.v[1],this.v.setTripleAt(l,c,l-d*a*i*s,c-u*a*i*s,l+d*a*i*s,c+u*a*i*s,e,!0),o+=r*s}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],e),e}(),u=function(){function e(e,t){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=e,this.comp=e.comp,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return e.prototype={convertRectToPath:function(){var e=this.p.v[0],t=this.p.v[1],r=this.s.v[0]/2,n=this.s.v[1]/2,i=bmMin(r,n,this.r.v),a=i*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(e+r,t-n+i,e+r,t-n+i,e+r,t-n+a,0,!0),this.v.setTripleAt(e+r,t+n-i,e+r,t+n-a,e+r,t+n-i,1,!0),0!==i?(this.v.setTripleAt(e+r-i,t+n,e+r-i,t+n,e+r-a,t+n,2,!0),this.v.setTripleAt(e-r+i,t+n,e-r+a,t+n,e-r+i,t+n,3,!0),this.v.setTripleAt(e-r,t+n-i,e-r,t+n-i,e-r,t+n-a,4,!0),this.v.setTripleAt(e-r,t-n+i,e-r,t-n+a,e-r,t-n+i,5,!0),this.v.setTripleAt(e-r+i,t-n,e-r+i,t-n,e-r+a,t-n,6,!0),this.v.setTripleAt(e+r-i,t-n,e+r-a,t-n,e+r-i,t-n,7,!0)):(this.v.setTripleAt(e-r,t+n,e-r+a,t+n,e-r,t+n,2),this.v.setTripleAt(e-r,t-n,e-r,t-n+a,e-r,t-n,3))):(this.v.setTripleAt(e+r,t-n+i,e+r,t-n+a,e+r,t-n+i,0,!0),0!==i?(this.v.setTripleAt(e+r-i,t-n,e+r-i,t-n,e+r-a,t-n,1,!0),this.v.setTripleAt(e-r+i,t-n,e-r+a,t-n,e-r+i,t-n,2,!0),this.v.setTripleAt(e-r,t-n+i,e-r,t-n+i,e-r,t-n+a,3,!0),this.v.setTripleAt(e-r,t+n-i,e-r,t+n-a,e-r,t+n-i,4,!0),this.v.setTripleAt(e-r+i,t+n,e-r+i,t+n,e-r+a,t+n,5,!0),this.v.setTripleAt(e+r-i,t+n,e+r-a,t+n,e+r-i,t+n,6,!0),this.v.setTripleAt(e+r,t+n-i,e+r,t+n-i,e+r,t+n-a,7,!0)):(this.v.setTripleAt(e-r,t-n,e-r+a,t-n,e-r,t-n,1,!0),this.v.setTripleAt(e-r,t+n,e-r,t+n-a,e-r,t+n,2,!0),this.v.setTripleAt(e+r,t+n,e+r-a,t+n,e+r,t+n,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:n},extendPrototype([DynamicPropertyContainer],e),e}(),p={getShapeProp:function(e,t,r){var n;return 3===r||4===r?n=(3===r?t.pt:t.ks).k.length?new l(e,t,r):new o(e,t,r):5===r?n=new u(e,t):6===r?n=new c(e,t):7===r&&(n=new d(e,t)),n.k&&e.addDynamicProperty(n),n},getConstructorFunction:function(){return o},getKeyframedConstructorFunction:function(){return l}};return p}(),Matrix=function(){var e=Math.cos,t=Math.sin,r=Math.tan,n=Math.round;function i(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function a(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1)}function o(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1)}function s(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1)}function l(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1)}function c(e,t){return this._t(1,t,e,1,0,0)}function d(e,t){return this.shear(r(e),r(t))}function u(n,i){var a=e(i),o=t(i);return this._t(a,o,0,0,-o,a,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,r(n),1,0,0,0,0,1,0,0,0,0,1)._t(a,-o,0,0,o,a,0,0,0,0,1,0,0,0,0,1)}function p(e,t,r){return r||0===r||(r=1),1===e&&1===t&&1===r?this:this._t(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1)}function h(e,t,r,n,i,a,o,s,l,c,d,u,p,h,f,m){return this.props[0]=e,this.props[1]=t,this.props[2]=r,this.props[3]=n,this.props[4]=i,this.props[5]=a,this.props[6]=o,this.props[7]=s,this.props[8]=l,this.props[9]=c,this.props[10]=d,this.props[11]=u,this.props[12]=p,this.props[13]=h,this.props[14]=f,this.props[15]=m,this}function f(e,t,r){return r=r||0,0!==e||0!==t||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,e,t,r,1):this}function m(e,t,r,n,i,a,o,s,l,c,d,u,p,h,f,m){var g=this.props;if(1===e&&0===t&&0===r&&0===n&&0===i&&1===a&&0===o&&0===s&&0===l&&0===c&&1===d&&0===u)return g[12]=g[12]*e+g[15]*p,g[13]=g[13]*a+g[15]*h,g[14]=g[14]*d+g[15]*f,g[15]*=m,this._identityCalculated=!1,this;var v=g[0],y=g[1],b=g[2],E=g[3],_=g[4],S=g[5],T=g[6],x=g[7],k=g[8],A=g[9],I=g[10],C=g[11],P=g[12],w=g[13],D=g[14],R=g[15];return g[0]=v*e+y*i+b*l+E*p,g[1]=v*t+y*a+b*c+E*h,g[2]=v*r+y*o+b*d+E*f,g[3]=v*n+y*s+b*u+E*m,g[4]=_*e+S*i+T*l+x*p,g[5]=_*t+S*a+T*c+x*h,g[6]=_*r+S*o+T*d+x*f,g[7]=_*n+S*s+T*u+x*m,g[8]=k*e+A*i+I*l+C*p,g[9]=k*t+A*a+I*c+C*h,g[10]=k*r+A*o+I*d+C*f,g[11]=k*n+A*s+I*u+C*m,g[12]=P*e+w*i+D*l+R*p,g[13]=P*t+w*a+D*c+R*h,g[14]=P*r+w*o+D*d+R*f,g[15]=P*n+w*s+D*u+R*m,this._identityCalculated=!1,this}function g(e){var t=e.props;return this.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function v(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function y(e){for(var t=0;t<16;){if(e.props[t]!==this.props[t])return!1;t+=1}return!0}function b(e){var t;for(t=0;t<16;t+=1)e.props[t]=this.props[t];return e}function E(e){var t;for(t=0;t<16;t+=1)this.props[t]=e[t]}function _(e,t,r){return{x:e*this.props[0]+t*this.props[4]+r*this.props[8]+this.props[12],y:e*this.props[1]+t*this.props[5]+r*this.props[9]+this.props[13],z:e*this.props[2]+t*this.props[6]+r*this.props[10]+this.props[14]}}function S(e,t,r){return e*this.props[0]+t*this.props[4]+r*this.props[8]+this.props[12]}function T(e,t,r){return e*this.props[1]+t*this.props[5]+r*this.props[9]+this.props[13]}function x(e,t,r){return e*this.props[2]+t*this.props[6]+r*this.props[10]+this.props[14]}function k(){var e=this.props[0]*this.props[5]-this.props[1]*this.props[4],t=this.props[5]/e,r=-this.props[1]/e,n=-this.props[4]/e,i=this.props[0]/e,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/e,o=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/e,s=new Matrix;return s.props[0]=t,s.props[1]=r,s.props[4]=n,s.props[5]=i,s.props[12]=a,s.props[13]=o,s}function A(e){return this.getInverseMatrix().applyToPointArray(e[0],e[1],e[2]||0)}function I(e){var t,r=e.length,n=[];for(t=0;t<r;t+=1)n[t]=A(e[t]);return n}function C(e,t,r){var n=createTypedArray("float32",6);if(this.isIdentity())n[0]=e[0],n[1]=e[1],n[2]=t[0],n[3]=t[1],n[4]=r[0],n[5]=r[1];else{var i=this.props[0],a=this.props[1],o=this.props[4],s=this.props[5],l=this.props[12],c=this.props[13];n[0]=e[0]*i+e[1]*o+l,n[1]=e[0]*a+e[1]*s+c,n[2]=t[0]*i+t[1]*o+l,n[3]=t[0]*a+t[1]*s+c,n[4]=r[0]*i+r[1]*o+l,n[5]=r[0]*a+r[1]*s+c}return n}function P(e,t,r){return this.isIdentity()?[e,t,r]:[e*this.props[0]+t*this.props[4]+r*this.props[8]+this.props[12],e*this.props[1]+t*this.props[5]+r*this.props[9]+this.props[13],e*this.props[2]+t*this.props[6]+r*this.props[10]+this.props[14]]}function w(e,t){if(this.isIdentity())return e+","+t;var r=this.props;return Math.round(100*(e*r[0]+t*r[4]+r[12]))/100+","+Math.round(100*(e*r[1]+t*r[5]+r[13]))/100}function D(){for(var e=0,t=this.props,r="matrix3d(";e<16;)r+=n(1e4*t[e])/1e4,r+=15===e?")":",",e+=1;return r}function R(e){return e<1e-6&&e>0||e>-1e-6&&e<0?n(1e4*e)/1e4:e}function L(){var e=this.props;return"matrix("+R(e[0])+","+R(e[1])+","+R(e[4])+","+R(e[5])+","+R(e[12])+","+R(e[13])+")"}return function(){this.reset=i,this.rotate=a,this.rotateX=o,this.rotateY=s,this.rotateZ=l,this.skew=d,this.skewFromAxis=u,this.shear=c,this.scale=p,this.setTransform=h,this.translate=f,this.transform=m,this.multiply=g,this.applyToPoint=_,this.applyToX=S,this.applyToY=T,this.applyToZ=x,this.applyToPointArray=P,this.applyToTriplePoints=C,this.applyToPointStringified=w,this.toCSS=D,this.to2dCSS=L,this.clone=b,this.cloneFromProps=E,this.equals=y,this.inversePoints=I,this.inversePoint=A,this.getInverseMatrix=k,this._t=this.transform,this.isIdentity=v,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(e){return _typeof$3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(e)}var lottie={};function setLocation(e){setLocationHref(e)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(e){setSubframeEnabled(e)}function setPrefix(e){setIdPrefix(e)}function loadAnimation(e){return animationManager.loadAnimation(e)}function setQuality(e){if("string"==typeof e)switch(e){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(e)&&e>1&&setDefaultCurveSegments(e)}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(e,t){"expressions"===e&&setExpressionsPlugin(t)}function getFactory(e){switch(e){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(e){for(var t=queryString.split("&"),r=0;r<t.length;r+=1){var n=t[r].split("=");if(decodeURIComponent(n[0])==e)return decodeURIComponent(n[1])}return null}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.13.0";var queryString="",scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src?myScript.src.replace(/^[^\?]+\??/,""):"",getQueryVariable("renderer");var readyStateCheckInterval=setInterval(checkReady,100);try{"object"!==_typeof$3(exports$1)&&(window.bodymovin=lottie)}catch(e){}var ShapeModifiers=function(){var e={},t={};return e.registerModifier=function(e,r){t[e]||(t[e]=r)},e.getModifier=function(e,r,n){return new t[e](r,n)},e}();function ShapeModifier(){}function TrimModifier(){}function PuckerAndBloatModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(e){if(!this.closed){e.sh.container.addDynamicProperty(e.sh);var t={shape:e.sh,data:e,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(t),this.addShapeToModifier(t),this._isAnimated&&e.setAsAnimated()}},ShapeModifier.prototype.init=function(e,t){this.shapes=[],this.elem=e,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(e,t){this.s=PropertyFactory.getProp(e,t.s,0,.01,this),this.e=PropertyFactory.getProp(e,t.e,0,.01,this),this.o=PropertyFactory.getProp(e,t.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=t.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(e){e.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(e,t,r,n,i){var a=[];t<=1?a.push({s:e,e:t}):e>=1?a.push({s:e-1,e:t-1}):(a.push({s:e,e:1}),a.push({s:0,e:t-1}));var o,s,l=[],c=a.length;for(o=0;o<c;o+=1){var d,u;(s=a[o]).e*i<n||s.s*i>n+r||(d=s.s*i<=n?0:(s.s*i-n)/r,u=s.e*i>=n+r?1:(s.e*i-n)/r,l.push([d,u]))}return l.length||l.push([0,0]),l},TrimModifier.prototype.releasePathsData=function(e){var t,r=e.length;for(t=0;t<r;t+=1)segmentsLengthPool.release(e[t]);return e.length=0,e},TrimModifier.prototype.processShapes=function(e){var t,r,n,i;if(this._mdf||e){var a=this.o.v%360/360;if(a<0&&(a+=1),(t=this.s.v>1?1+a:this.s.v<0?0+a:this.s.v+a)>(r=this.e.v>1?1+a:this.e.v<0?0+a:this.e.v+a)){var o=t;t=r,r=o}t=1e-4*Math.round(1e4*t),r=1e-4*Math.round(1e4*r),this.sValue=t,this.eValue=r}else t=this.sValue,r=this.eValue;var s,l,c,d,u,p=this.shapes.length,h=0;if(r===t)for(i=0;i<p;i+=1)this.shapes[i].localShapeCollection.releaseShapes(),this.shapes[i].shape._mdf=!0,this.shapes[i].shape.paths=this.shapes[i].localShapeCollection,this._mdf&&(this.shapes[i].pathsData.length=0);else if(1===r&&0===t||0===r&&1===t){if(this._mdf)for(i=0;i<p;i+=1)this.shapes[i].pathsData.length=0,this.shapes[i].shape._mdf=!0}else{var f,m,g=[];for(i=0;i<p;i+=1)if((f=this.shapes[i]).shape._mdf||this._mdf||e||2===this.m){if(l=(n=f.shape.paths)._length,u=0,!f.shape._mdf&&f.pathsData.length)u=f.totalShapeLength;else{for(c=this.releasePathsData(f.pathsData),s=0;s<l;s+=1)d=bez.getSegmentsLength(n.shapes[s]),c.push(d),u+=d.totalLength;f.totalShapeLength=u,f.pathsData=c}h+=u,f.shape._mdf=!0}else f.shape.paths=f.localShapeCollection;var v,y=t,b=r,E=0;for(i=p-1;i>=0;i-=1)if((f=this.shapes[i]).shape._mdf){for((m=f.localShapeCollection).releaseShapes(),2===this.m&&p>1?(v=this.calculateShapeEdges(t,r,f.totalShapeLength,E,h),E+=f.totalShapeLength):v=[[y,b]],l=v.length,s=0;s<l;s+=1){y=v[s][0],b=v[s][1],g.length=0,b<=1?g.push({s:f.totalShapeLength*y,e:f.totalShapeLength*b}):y>=1?g.push({s:f.totalShapeLength*(y-1),e:f.totalShapeLength*(b-1)}):(g.push({s:f.totalShapeLength*y,e:f.totalShapeLength}),g.push({s:0,e:f.totalShapeLength*(b-1)}));var _=this.addShapes(f,g[0]);if(g[0].s!==g[0].e){if(g.length>1)if(f.shape.paths.shapes[f.shape.paths._length-1].c){var S=_.pop();this.addPaths(_,m),_=this.addShapes(f,g[1],S)}else this.addPaths(_,m),_=this.addShapes(f,g[1]);this.addPaths(_,m)}}f.shape.paths=m}}},TrimModifier.prototype.addPaths=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)t.addShape(e[r])},TrimModifier.prototype.addSegment=function(e,t,r,n,i,a,o){i.setXYAt(t[0],t[1],"o",a),i.setXYAt(r[0],r[1],"i",a+1),o&&i.setXYAt(e[0],e[1],"v",a),i.setXYAt(n[0],n[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(e,t,r,n){t.setXYAt(e[1],e[5],"o",r),t.setXYAt(e[2],e[6],"i",r+1),n&&t.setXYAt(e[0],e[4],"v",r),t.setXYAt(e[3],e[7],"v",r+1)},TrimModifier.prototype.addShapes=function(e,t,r){var n,i,a,o,s,l,c,d,u=e.pathsData,p=e.shape.paths.shapes,h=e.shape.paths._length,f=0,m=[],g=!0;for(r?(s=r._length,d=r._length):(r=shapePool.newElement(),s=0,d=0),m.push(r),n=0;n<h;n+=1){for(l=u[n].lengths,r.c=p[n].c,a=p[n].c?l.length:l.length+1,i=1;i<a;i+=1)if(f+(o=l[i-1]).addedLength<t.s)f+=o.addedLength,r.c=!1;else{if(f>t.e){r.c=!1;break}t.s<=f&&t.e>=f+o.addedLength?(this.addSegment(p[n].v[i-1],p[n].o[i-1],p[n].i[i],p[n].v[i],r,s,g),g=!1):(c=bez.getNewSegment(p[n].v[i-1],p[n].v[i],p[n].o[i-1],p[n].i[i],(t.s-f)/o.addedLength,(t.e-f)/o.addedLength,l[i-1]),this.addSegmentFromArray(c,r,s,g),g=!1,r.c=!1),f+=o.addedLength,s+=1}if(p[n].c&&l.length){if(o=l[i-1],f<=t.e){var v=l[i-1].addedLength;t.s<=f&&t.e>=f+v?(this.addSegment(p[n].v[i-1],p[n].o[i-1],p[n].i[0],p[n].v[0],r,s,g),g=!1):(c=bez.getNewSegment(p[n].v[i-1],p[n].v[0],p[n].o[i-1],p[n].i[0],(t.s-f)/v,(t.e-f)/v,l[i-1]),this.addSegmentFromArray(c,r,s,g),g=!1,r.c=!1)}else r.c=!1;f+=o.addedLength,s+=1}if(r._length&&(r.setXYAt(r.v[d][0],r.v[d][1],"i",d),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),f>t.e)break;n<h-1&&(r=shapePool.newElement(),g=!0,m.push(r),s=0)}return m},extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(e,t){var r=t/100,n=[0,0],i=e._length,a=0;for(a=0;a<i;a+=1)n[0]+=e.v[a][0],n[1]+=e.v[a][1];n[0]/=i,n[1]/=i;var o,s,l,c,d,u,p=shapePool.newElement();for(p.c=e.c,a=0;a<i;a+=1)o=e.v[a][0]+(n[0]-e.v[a][0])*r,s=e.v[a][1]+(n[1]-e.v[a][1])*r,l=e.o[a][0]+(n[0]-e.o[a][0])*-r,c=e.o[a][1]+(n[1]-e.o[a][1])*-r,d=e.i[a][0]+(n[0]-e.i[a][0])*-r,u=e.i[a][1]+(n[1]-e.i[a][1])*-r,p.setTripleAt(o,s,l,c,d,u,a);return p},PuckerAndBloatModifier.prototype.processShapes=function(e){var t,r,n,i,a,o,s=this.shapes.length,l=this.amount.v;if(0!==l)for(r=0;r<s;r+=1){if(o=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||e)for(o.releaseShapes(),a.shape._mdf=!0,t=a.shape.paths.shapes,i=a.shape.paths._length,n=0;n<i;n+=1)o.addShape(this.processPath(t[n],l));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var TransformPropertyFactory=function(){var e=[0,0];function t(e,t,r){if(this.elem=e,this.frameId=-1,this.propType="transform",this.data=t,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(r||e),t.p&&t.p.s?(this.px=PropertyFactory.getProp(e,t.p.x,0,0,this),this.py=PropertyFactory.getProp(e,t.p.y,0,0,this),t.p.z&&(this.pz=PropertyFactory.getProp(e,t.p.z,0,0,this))):this.p=PropertyFactory.getProp(e,t.p||{k:[0,0,0]},1,0,this),t.rx){if(this.rx=PropertyFactory.getProp(e,t.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(e,t.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(e,t.rz,0,degToRads,this),t.or.k[0].ti){var n,i=t.or.k.length;for(n=0;n<i;n+=1)t.or.k[n].to=null,t.or.k[n].ti=null}this.or=PropertyFactory.getProp(e,t.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(e,t.r||{k:0},0,degToRads,this);t.sk&&(this.sk=PropertyFactory.getProp(e,t.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(e,t.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(e,t.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(e,t.s||{k:[100,100,100]},1,.01,this),t.o?this.o=PropertyFactory.getProp(e,t.o,0,.01,e):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return t.prototype={applyToMatrix:function(e){var t=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||t,this.a&&e.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&e.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&e.skewFromAxis(-this.sk.v,this.sa.v),this.r?e.rotate(-this.r.v):e.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?e.translate(this.px.v,this.py.v,-this.pz.v):e.translate(this.px.v,this.py.v,0):e.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var r;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var n,i;if(r=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(n=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/r,0),i=this.p.getValueAtTime(this.p.keyframes[0].t/r,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(n=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/r,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/r,0)):(n=this.p.pv,i=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/r,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){n=[],i=[];var a=this.px,o=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(n[0]=a.getValueAtTime((a.keyframes[0].t+.01)/r,0),n[1]=o.getValueAtTime((o.keyframes[0].t+.01)/r,0),i[0]=a.getValueAtTime(a.keyframes[0].t/r,0),i[1]=o.getValueAtTime(o.keyframes[0].t/r,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(n[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/r,0),n[1]=o.getValueAtTime(o.keyframes[o.keyframes.length-1].t/r,0),i[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/r,0),i[1]=o.getValueAtTime((o.keyframes[o.keyframes.length-1].t-.01)/r,0)):(n=[a.pv,o.pv],i[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/r,a.offsetTime),i[1]=o.getValueAtTime((o._caching.lastFrame+o.offsetTime-.01)/r,o.offsetTime))}else n=i=e;this.v.rotate(-Math.atan2(n[1]-i[1],n[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],t),t.prototype.addDynamicProperty=function(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0},t.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(e,r,n){return new t(e,r,n)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function floatEqual(e,t){return 1e5*Math.abs(e-t)<=Math.min(Math.abs(e),Math.abs(t))}function floatZero(e){return Math.abs(e)<=1e-5}function lerp(e,t,r){return e*(1-r)+t*r}function lerpPoint(e,t,r){return[lerp(e[0],t[0],r),lerp(e[1],t[1],r)]}function quadRoots(e,t,r){if(0===e)return[];var n=t*t-4*e*r;if(n<0)return[];var i=-t/(2*e);if(0===n)return[i];var a=Math.sqrt(n)/(2*e);return[i-a,i+a]}function polynomialCoefficients(e,t,r,n){return[3*t-e-3*r+n,3*e-6*t+3*r,-3*e+3*t,e]}function singlePoint(e){return new PolynomialBezier(e,e,e,e,!1)}function PolynomialBezier(e,t,r,n,i){i&&pointEqual(e,t)&&(t=lerpPoint(e,n,1/3)),i&&pointEqual(r,n)&&(r=lerpPoint(e,n,2/3));var a=polynomialCoefficients(e[0],t[0],r[0],n[0]),o=polynomialCoefficients(e[1],t[1],r[1],n[1]);this.a=[a[0],o[0]],this.b=[a[1],o[1]],this.c=[a[2],o[2]],this.d=[a[3],o[3]],this.points=[e,t,r,n]}function extrema(e,t){var r=e.points[0][t],n=e.points[e.points.length-1][t];if(r>n){var i=n;n=r,r=i}for(var a=quadRoots(3*e.a[t],2*e.b[t],e.c[t]),o=0;o<a.length;o+=1)if(a[o]>0&&a[o]<1){var s=e.point(a[o])[t];s<r?r=s:s>n&&(n=s)}return{min:r,max:n}}function intersectData(e,t,r){var n=e.boundingBox();return{cx:n.cx,cy:n.cy,width:n.width,height:n.height,bez:e,t:(t+r)/2,t1:t,t2:r}}function splitData(e){var t=e.bez.split(.5);return[intersectData(t[0],e.t1,e.t),intersectData(t[1],e.t,e.t2)]}function boxIntersect(e,t){return 2*Math.abs(e.cx-t.cx)<e.width+t.width&&2*Math.abs(e.cy-t.cy)<e.height+t.height}function intersectsImpl(e,t,r,n,i,a){if(boxIntersect(e,t))if(r>=a||e.width<=n&&e.height<=n&&t.width<=n&&t.height<=n)i.push([e.t,t.t]);else{var o=splitData(e),s=splitData(t);intersectsImpl(o[0],s[0],r+1,n,i,a),intersectsImpl(o[0],s[1],r+1,n,i,a),intersectsImpl(o[1],s[0],r+1,n,i,a),intersectsImpl(o[1],s[1],r+1,n,i,a)}}function crossProduct(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function lineIntersection(e,t,r,n){var i=[e[0],e[1],1],a=[t[0],t[1],1],o=[r[0],r[1],1],s=[n[0],n[1],1],l=crossProduct(crossProduct(i,a),crossProduct(o,s));return floatZero(l[2])?null:[l[0]/l[2],l[1]/l[2]]}function polarOffset(e,t,r){return[e[0]+Math.cos(t)*r,e[1]-Math.sin(t)*r]}function pointDistance(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1])}function pointEqual(e,t){return floatEqual(e[0],t[0])&&floatEqual(e[1],t[1])}function ZigZagModifier(){}function setPoint(e,t,r,n,i,a,o){var s=r-Math.PI/2,l=r+Math.PI/2,c=t[0]+Math.cos(r)*n*i,d=t[1]-Math.sin(r)*n*i;e.setTripleAt(c,d,c+Math.cos(s)*a,d-Math.sin(s)*a,c+Math.cos(l)*o,d-Math.sin(l)*o,e.length())}function getPerpendicularVector(e,t){var r=[t[0]-e[0],t[1]-e[1]],n=.5*-Math.PI;return[Math.cos(n)*r[0]-Math.sin(n)*r[1],Math.sin(n)*r[0]+Math.cos(n)*r[1]]}function getProjectingAngle(e,t){var r=0===t?e.length()-1:t-1,n=(t+1)%e.length(),i=getPerpendicularVector(e.v[r],e.v[n]);return Math.atan2(0,1)-Math.atan2(i[1],i[0])}function zigZagCorner(e,t,r,n,i,a,o){var s=getProjectingAngle(t,r),l=t.v[r%t._length],c=t.v[0===r?t._length-1:r-1],d=t.v[(r+1)%t._length],u=2===a?Math.sqrt(Math.pow(l[0]-c[0],2)+Math.pow(l[1]-c[1],2)):0,p=2===a?Math.sqrt(Math.pow(l[0]-d[0],2)+Math.pow(l[1]-d[1],2)):0;setPoint(e,t.v[r%t._length],s,o,n,p/(2*(i+1)),u/(2*(i+1)))}function zigZagSegment(e,t,r,n,i,a){for(var o=0;o<n;o+=1){var s=(o+1)/(n+1),l=2===i?Math.sqrt(Math.pow(t.points[3][0]-t.points[0][0],2)+Math.pow(t.points[3][1]-t.points[0][1],2)):0,c=t.normalAngle(s);setPoint(e,t.point(s),c,a,r,l/(2*(n+1)),l/(2*(n+1))),a=-a}return a}function linearOffset(e,t,r){var n=Math.atan2(t[0]-e[0],t[1]-e[1]);return[polarOffset(e,n,r),polarOffset(t,n,r)]}function offsetSegment(e,t){var r,n,i,a,o,s,l;r=(l=linearOffset(e.points[0],e.points[1],t))[0],n=l[1],i=(l=linearOffset(e.points[1],e.points[2],t))[0],a=l[1],o=(l=linearOffset(e.points[2],e.points[3],t))[0],s=l[1];var c=lineIntersection(r,n,i,a);null===c&&(c=n);var d=lineIntersection(o,s,i,a);return null===d&&(d=o),new PolynomialBezier(r,c,d,s)}function joinLines(e,t,r,n,i){var a=t.points[3],o=r.points[0];if(3===n)return a;if(pointEqual(a,o))return a;if(2===n){var s=-t.tangentAngle(1),l=-r.tangentAngle(0)+Math.PI,c=lineIntersection(a,polarOffset(a,s+Math.PI/2,100),o,polarOffset(o,s+Math.PI/2,100)),d=c?pointDistance(c,a):pointDistance(a,o)/2,u=polarOffset(a,s,2*d*roundCorner);return e.setXYAt(u[0],u[1],"o",e.length()-1),u=polarOffset(o,l,2*d*roundCorner),e.setTripleAt(o[0],o[1],o[0],o[1],u[0],u[1],e.length()),o}var p=lineIntersection(pointEqual(a,t.points[2])?t.points[0]:t.points[2],a,o,pointEqual(o,r.points[1])?r.points[3]:r.points[1]);return p&&pointDistance(p,a)<i?(e.setTripleAt(p[0],p[1],p[0],p[1],p[0],p[1],e.length()),p):a}function getIntersection(e,t){var r=e.intersections(t);return r.length&&floatEqual(r[0][0],1)&&r.shift(),r.length?r[0]:null}function pruneSegmentIntersection(e,t){var r=e.slice(),n=t.slice(),i=getIntersection(e[e.length-1],t[0]);return i&&(r[e.length-1]=e[e.length-1].split(i[0])[0],n[0]=t[0].split(i[1])[1]),e.length>1&&t.length>1&&(i=getIntersection(e[0],t[t.length-1]))?[[e[0].split(i[0])[0]],[t[t.length-1].split(i[1])[1]]]:[r,n]}function pruneIntersections(e){for(var t,r=1;r<e.length;r+=1)t=pruneSegmentIntersection(e[r-1],e[r]),e[r-1]=t[0],e[r]=t[1];return e.length>1&&(t=pruneSegmentIntersection(e[e.length-1],e[0]),e[e.length-1]=t[0],e[0]=t[1]),e}function offsetSegmentSplit(e,t){var r,n,i,a,o=e.inflectionPoints();if(0===o.length)return[offsetSegment(e,t)];if(1===o.length||floatEqual(o[1],1))return r=(i=e.split(o[0]))[0],n=i[1],[offsetSegment(r,t),offsetSegment(n,t)];r=(i=e.split(o[0]))[0];var s=(o[1]-o[0])/(1-o[0]);return a=(i=i[1].split(s))[0],n=i[1],[offsetSegment(r,t),offsetSegment(a,t),offsetSegment(n,t)]}function OffsetPathModifier(){}function getFontProperties(e){for(var t=e.fStyle?e.fStyle.split(" "):[],r="normal",n="normal",i=t.length,a=0;a<i;a+=1)switch(t[a].toLowerCase()){case"italic":n="italic";break;case"bold":r="700";break;case"black":r="900";break;case"medium":r="500";break;case"regular":case"normal":r="400";break;case"light":case"thin":r="200"}return{style:n,weight:e.fWeight||r}}extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(e,t.c,0,null,this),this.o=PropertyFactory.getProp(e,t.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(e,t.tr,this),this.so=PropertyFactory.getProp(e,t.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(e,t.tr.eo,0,.01,this),this.data=t,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(e,t,r,n,i,a){var o=a?-1:1,s=n.s.v[0]+(1-n.s.v[0])*(1-i),l=n.s.v[1]+(1-n.s.v[1])*(1-i);e.translate(n.p.v[0]*o*i,n.p.v[1]*o*i,n.p.v[2]),t.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),t.rotate(-n.r.v*o*i),t.translate(n.a.v[0],n.a.v[1],n.a.v[2]),r.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),r.scale(a?1/s:s,a?1/l:l),r.translate(n.a.v[0],n.a.v[1],n.a.v[2])},RepeaterModifier.prototype.init=function(e,t,r,n){for(this.elem=e,this.arr=t,this.pos=r,this.elemsData=n,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t[r]);r>0;)r-=1,this._elements.unshift(t[r]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(e){var t,r=e.length;for(t=0;t<r;t+=1)e[t]._processed=!1,"gr"===e[t].ty&&this.resetElements(e[t].it)},RepeaterModifier.prototype.cloneElements=function(e){var t=JSON.parse(JSON.stringify(e));return this.resetElements(t),t},RepeaterModifier.prototype.changeGroupRender=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)e[r]._render=t,"gr"===e[r].ty&&this.changeGroupRender(e[r].it,t)},RepeaterModifier.prototype.processShapes=function(e){var t,r,n,i,a,o=!1;if(this._mdf||e){var s,l=Math.ceil(this.c.v);if(this._groups.length<l){for(;this._groups.length<l;){var c={it:this.cloneElements(this._elements),ty:"gr"};c.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,c),this._groups.splice(0,0,c),this._currentCopies+=1}this.elem.reloadShapes(),o=!0}for(a=0,n=0;n<=this._groups.length-1;n+=1){if(s=a<l,this._groups[n]._render=s,this.changeGroupRender(this._groups[n].it,s),!s){var d=this.elemsData[n].it,u=d[d.length-1];0!==u.transform.op.v?(u.transform.op._mdf=!0,u.transform.op.v=0):u.transform.op._mdf=!1}a+=1}this._currentCopies=l;var p=this.o.v,h=p%1,f=p>0?Math.floor(p):Math.ceil(p),m=this.pMatrix.props,g=this.rMatrix.props,v=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var y,b,E=0;if(p>0){for(;E<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),E+=1;h&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,h,!1),E+=h)}else if(p<0){for(;E>f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),E-=1;h&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-h,!0),E-=h)}for(n=1===this.data.m?0:this._currentCopies-1,i=1===this.data.m?1:-1,a=this._currentCopies;a;){if(b=(r=(t=this.elemsData[n].it)[t.length-1].transform.mProps.v.props).length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(n/(this._currentCopies-1)),0!==E){for((0!==n&&1===i||n!==this._currentCopies-1&&-1===i)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),y=0;y<b;y+=1)r[y]=this.matrix.props[y];this.matrix.reset()}else for(this.matrix.reset(),y=0;y<b;y+=1)r[y]=this.matrix.props[y];E+=1,a-=1,n+=i}}else for(a=this._currentCopies,n=0,i=1;a;)r=(t=this.elemsData[n].it)[t.length-1].transform.mProps.v.props,t[t.length-1].transform.mProps._mdf=!1,t[t.length-1].transform.op._mdf=!1,a-=1,n+=i;return o},RepeaterModifier.prototype.addShape=function(){},extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(e,t.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(e,t){var r,n=shapePool.newElement();n.c=e.c;var i,a,o,s,l,c,d,u,p,h,f,m,g=e._length,v=0;for(r=0;r<g;r+=1)i=e.v[r],o=e.o[r],a=e.i[r],i[0]===o[0]&&i[1]===o[1]&&i[0]===a[0]&&i[1]===a[1]?0!==r&&r!==g-1||e.c?(s=0===r?e.v[g-1]:e.v[r-1],c=(l=Math.sqrt(Math.pow(i[0]-s[0],2)+Math.pow(i[1]-s[1],2)))?Math.min(l/2,t)/l:0,d=f=i[0]+(s[0]-i[0])*c,u=m=i[1]-(i[1]-s[1])*c,p=d-(d-i[0])*roundCorner,h=u-(u-i[1])*roundCorner,n.setTripleAt(d,u,p,h,f,m,v),v+=1,s=r===g-1?e.v[0]:e.v[r+1],c=(l=Math.sqrt(Math.pow(i[0]-s[0],2)+Math.pow(i[1]-s[1],2)))?Math.min(l/2,t)/l:0,d=p=i[0]+(s[0]-i[0])*c,u=h=i[1]+(s[1]-i[1])*c,f=d-(d-i[0])*roundCorner,m=u-(u-i[1])*roundCorner,n.setTripleAt(d,u,p,h,f,m,v),v+=1):(n.setTripleAt(i[0],i[1],o[0],o[1],a[0],a[1],v),v+=1):(n.setTripleAt(e.v[r][0],e.v[r][1],e.o[r][0],e.o[r][1],e.i[r][0],e.i[r][1],v),v+=1);return n},RoundCornersModifier.prototype.processShapes=function(e){var t,r,n,i,a,o,s=this.shapes.length,l=this.rd.v;if(0!==l)for(r=0;r<s;r+=1){if(o=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||e)for(o.releaseShapes(),a.shape._mdf=!0,t=a.shape.paths.shapes,i=a.shape.paths._length,n=0;n<i;n+=1)o.addShape(this.processPath(t[n],l));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},PolynomialBezier.prototype.point=function(e){return[((this.a[0]*e+this.b[0])*e+this.c[0])*e+this.d[0],((this.a[1]*e+this.b[1])*e+this.c[1])*e+this.d[1]]},PolynomialBezier.prototype.derivative=function(e){return[(3*e*this.a[0]+2*this.b[0])*e+this.c[0],(3*e*this.a[1]+2*this.b[1])*e+this.c[1]]},PolynomialBezier.prototype.tangentAngle=function(e){var t=this.derivative(e);return Math.atan2(t[1],t[0])},PolynomialBezier.prototype.normalAngle=function(e){var t=this.derivative(e);return Math.atan2(t[0],t[1])},PolynomialBezier.prototype.inflectionPoints=function(){var e=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(floatZero(e))return[];var t=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/e,r=t*t-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/e;if(r<0)return[];var n=Math.sqrt(r);return floatZero(n)?n>0&&n<1?[t]:[]:[t-n,t+n].filter((function(e){return e>0&&e<1}))},PolynomialBezier.prototype.split=function(e){if(e<=0)return[singlePoint(this.points[0]),this];if(e>=1)return[this,singlePoint(this.points[this.points.length-1])];var t=lerpPoint(this.points[0],this.points[1],e),r=lerpPoint(this.points[1],this.points[2],e),n=lerpPoint(this.points[2],this.points[3],e),i=lerpPoint(t,r,e),a=lerpPoint(r,n,e),o=lerpPoint(i,a,e);return[new PolynomialBezier(this.points[0],t,i,o,!0),new PolynomialBezier(o,a,n,this.points[3],!0)]},PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var e=this.bounds();return{left:e.x.min,right:e.x.max,top:e.y.min,bottom:e.y.max,width:e.x.max-e.x.min,height:e.y.max-e.y.min,cx:(e.x.max+e.x.min)/2,cy:(e.y.max+e.y.min)/2}},PolynomialBezier.prototype.intersections=function(e,t,r){void 0===t&&(t=2),void 0===r&&(r=7);var n=[];return intersectsImpl(intersectData(this,0,1),intersectData(e,0,1),0,t,n,r),n},PolynomialBezier.shapeSegment=function(e,t){var r=(t+1)%e.length();return new PolynomialBezier(e.v[t],e.o[t],e.i[r],e.v[r],!0)},PolynomialBezier.shapeSegmentInverted=function(e,t){var r=(t+1)%e.length();return new PolynomialBezier(e.v[r],e.i[r],e.o[t],e.v[t],!0)},extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(e,t.s,0,null,this),this.frequency=PropertyFactory.getProp(e,t.r,0,null,this),this.pointsType=PropertyFactory.getProp(e,t.pt,0,null,this),this._isAnimated=0!==this.amplitude.effectsSequence.length||0!==this.frequency.effectsSequence.length||0!==this.pointsType.effectsSequence.length},ZigZagModifier.prototype.processPath=function(e,t,r,n){var i=e._length,a=shapePool.newElement();if(a.c=e.c,e.c||(i-=1),0===i)return a;var o=-1,s=PolynomialBezier.shapeSegment(e,0);zigZagCorner(a,e,0,t,r,n,o);for(var l=0;l<i;l+=1)o=zigZagSegment(a,s,t,r,n,-o),s=l!==i-1||e.c?PolynomialBezier.shapeSegment(e,(l+1)%i):null,zigZagCorner(a,e,l+1,t,r,n,o);return a},ZigZagModifier.prototype.processShapes=function(e){var t,r,n,i,a,o,s=this.shapes.length,l=this.amplitude.v,c=Math.max(0,Math.round(this.frequency.v)),d=this.pointsType.v;if(0!==l)for(r=0;r<s;r+=1){if(o=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||e)for(o.releaseShapes(),a.shape._mdf=!0,t=a.shape.paths.shapes,i=a.shape.paths._length,n=0;n<i;n+=1)o.addShape(this.processPath(t[n],l,c,d));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this.miterLimit=PropertyFactory.getProp(e,t.ml,0,null,this),this.lineJoin=t.lj,this._isAnimated=0!==this.amount.effectsSequence.length},OffsetPathModifier.prototype.processPath=function(e,t,r,n){var i=shapePool.newElement();i.c=e.c;var a,o,s,l=e.length();e.c||(l-=1);var c=[];for(a=0;a<l;a+=1)s=PolynomialBezier.shapeSegment(e,a),c.push(offsetSegmentSplit(s,t));if(!e.c)for(a=l-1;a>=0;a-=1)s=PolynomialBezier.shapeSegmentInverted(e,a),c.push(offsetSegmentSplit(s,t));c=pruneIntersections(c);var d=null,u=null;for(a=0;a<c.length;a+=1){var p=c[a];for(u&&(d=joinLines(i,u,p[0],r,n)),u=p[p.length-1],o=0;o<p.length;o+=1)s=p[o],d&&pointEqual(s.points[0],d)?i.setXYAt(s.points[1][0],s.points[1][1],"o",i.length()-1):i.setTripleAt(s.points[0][0],s.points[0][1],s.points[1][0],s.points[1][1],s.points[0][0],s.points[0][1],i.length()),i.setTripleAt(s.points[3][0],s.points[3][1],s.points[3][0],s.points[3][1],s.points[2][0],s.points[2][1],i.length()),d=s.points[3]}return c.length&&joinLines(i,u,c[0][0],r,n),i},OffsetPathModifier.prototype.processShapes=function(e){var t,r,n,i,a,o,s=this.shapes.length,l=this.amount.v,c=this.miterLimit.v,d=this.lineJoin;if(0!==l)for(r=0;r<s;r+=1){if(o=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||e)for(o.releaseShapes(),a.shape._mdf=!0,t=a.shape.paths.shapes,i=a.shape.paths._length,n=0;n<i;n+=1)o.addShape(this.processPath(t[n],l,d,c));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var FontManager=function(){var e={w:0,size:0,shapes:[],data:{shapes:[]}},t=[];t=t.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var r=127988,n=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function i(e,t){var r=createTag("span");r.setAttribute("aria-hidden",!0),r.style.fontFamily=t;var n=createTag("span");n.innerText="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(n),document.body.appendChild(r);var i=n.offsetWidth;return n.style.fontFamily=function(e){var t,r=e.split(","),n=r.length,i=[];for(t=0;t<n;t+=1)"sans-serif"!==r[t]&&"monospace"!==r[t]&&i.push(r[t]);return i.join(",")}(e)+", "+t,{node:n,w:i,parent:r}}function a(e,t){var r,n=document.body&&t?"svg":"canvas",i=getFontProperties(e);if("svg"===n){var a=createNS("text");a.style.fontSize="100px",a.setAttribute("font-family",e.fFamily),a.setAttribute("font-style",i.style),a.setAttribute("font-weight",i.weight),a.textContent="1",e.fClass?(a.style.fontFamily="inherit",a.setAttribute("class",e.fClass)):a.style.fontFamily=e.fFamily,t.appendChild(a),r=a}else{var o=new OffscreenCanvas(500,500).getContext("2d");o.font=i.style+" "+i.weight+" 100px "+e.fFamily,r=o}return{measureText:function(e){return"svg"===n?(r.textContent=e,r.getComputedTextLength()):r.measureText(e).width}}}function o(e){var t=0,r=e.charCodeAt(0);if(r>=55296&&r<=56319){var n=e.charCodeAt(1);n>=56320&&n<=57343&&(t=1024*(r-55296)+n-56320+65536)}return t}function s(e){var t=o(e);return t>=127462&&t<=127487}var l=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};l.isModifier=function(e,t){var r=e.toString(16)+t.toString(16);return-1!==n.indexOf(r)},l.isZeroWidthJoiner=function(e){return 8205===e},l.isFlagEmoji=function(e){return s(e.substr(0,2))&&s(e.substr(2,2))},l.isRegionalCode=s,l.isCombinedCharacter=function(e){return-1!==t.indexOf(e)},l.isRegionalFlag=function(e,t){var n=o(e.substr(t,2));if(n!==r)return!1;var i=0;for(t+=2;i<5;){if((n=o(e.substr(t,2)))<917601||n>917626)return!1;i+=1,t+=2}return 917631===o(e.substr(t,2))},l.isVariationSelector=function(e){return 65039===e},l.BLACK_FLAG_CODE_POINT=r;var c={addChars:function(e){if(e){var t;this.chars||(this.chars=[]);var r,n,i=e.length,a=this.chars.length;for(t=0;t<i;t+=1){for(r=0,n=!1;r<a;)this.chars[r].style===e[t].style&&this.chars[r].fFamily===e[t].fFamily&&this.chars[r].ch===e[t].ch&&(n=!0),r+=1;n||(this.chars.push(e[t]),a+=1)}}},addFonts:function(e,t){if(e){if(this.chars)return this.isLoaded=!0,void(this.fonts=e.list);if(!document.body)return this.isLoaded=!0,e.list.forEach((function(e){e.helper=a(e),e.cache={}})),void(this.fonts=e.list);var r,n=e.list,o=n.length,s=o;for(r=0;r<o;r+=1){var l,c,d=!0;if(n[r].loaded=!1,n[r].monoCase=i(n[r].fFamily,"monospace"),n[r].sansCase=i(n[r].fFamily,"sans-serif"),n[r].fPath){if("p"===n[r].fOrigin||3===n[r].origin){if((l=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[r].fFamily+'"], style[f-origin="3"][f-family="'+n[r].fFamily+'"]')).length>0&&(d=!1),d){var u=createTag("style");u.setAttribute("f-forigin",n[r].fOrigin),u.setAttribute("f-origin",n[r].origin),u.setAttribute("f-family",n[r].fFamily),u.type="text/css",u.innerText="@font-face {font-family: "+n[r].fFamily+"; font-style: normal; src: url('"+n[r].fPath+"');}",t.appendChild(u)}}else if("g"===n[r].fOrigin||1===n[r].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),c=0;c<l.length;c+=1)-1!==l[c].href.indexOf(n[r].fPath)&&(d=!1);if(d){var p=createTag("link");p.setAttribute("f-forigin",n[r].fOrigin),p.setAttribute("f-origin",n[r].origin),p.type="text/css",p.rel="stylesheet",p.href=n[r].fPath,document.body.appendChild(p)}}else if("t"===n[r].fOrigin||2===n[r].origin){for(l=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),c=0;c<l.length;c+=1)n[r].fPath===l[c].src&&(d=!1);if(d){var h=createTag("link");h.setAttribute("f-forigin",n[r].fOrigin),h.setAttribute("f-origin",n[r].origin),h.setAttribute("rel","stylesheet"),h.setAttribute("href",n[r].fPath),t.appendChild(h)}}}else n[r].loaded=!0,s-=1;n[r].helper=a(n[r],t),n[r].cache={},this.fonts.push(n[r])}0===s?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,r,n){for(var i=0,a=this.chars.length;i<a;){if(this.chars[i].ch===t&&this.chars[i].style===r&&this.chars[i].fFamily===n)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,r,n)),e},getFontByName:function(e){for(var t=0,r=this.fonts.length;t<r;){if(this.fonts[t].fName===e)return this.fonts[t];t+=1}return this.fonts[0]},measureText:function(e,t,r){var n=this.getFontByName(t),i=e;if(!n.cache[i]){var a=n.helper;if(" "===e){var o=a.measureText("|"+e+"|"),s=a.measureText("||");n.cache[i]=(o-s)/100}else n.cache[i]=a.measureText(e)/100}return n.cache[i]*r},checkLoadedFonts:function(){var e,t,r,n=this.fonts.length,i=n;for(e=0;e<n;e+=1)this.fonts[e].loaded?i-=1:"n"===this.fonts[e].fOrigin||0===this.fonts[e].origin?this.fonts[e].loaded=!0:(t=this.fonts[e].monoCase.node,r=this.fonts[e].monoCase.w,t.offsetWidth!==r?(i-=1,this.fonts[e].loaded=!0):(t=this.fonts[e].sansCase.node,r=this.fonts[e].sansCase.w,t.offsetWidth!==r&&(i-=1,this.fonts[e].loaded=!0)),this.fonts[e].loaded&&(this.fonts[e].sansCase.parent.parentNode.removeChild(this.fonts[e].sansCase.parent),this.fonts[e].monoCase.parent.parentNode.removeChild(this.fonts[e].monoCase.parent)));0!==i&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}};return l.prototype=c,l}();function SlotManager(e){this.animationData=e}function slotFactory(e){return new SlotManager(e)}function RenderableElement(){}SlotManager.prototype.getProp=function(e){return this.animationData.slots&&this.animationData.slots[e.sid]?Object.assign(e,this.animationData.slots[e.sid].p):e},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){-1===this.renderableComponents.indexOf(e)&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){-1!==this.renderableComponents.indexOf(e)&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e<t;e+=1)this.renderableComponents[e].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var getBlendMode=(blendModeEnums={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(e){return blendModeEnums[e]||""}),blendModeEnums;function SliderEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function AngleEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function ColorEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,1,0,r)}function PointEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,1,0,r)}function LayerIndexEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function MaskIndexEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function CheckboxEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(e,t){var r,n=e.ef||[];this.effectElements=[];var i,a=n.length;for(r=0;r<a;r+=1)i=new GroupEffect(n[r],t),this.effectElements.push(i)}function GroupEffect(e,t){this.init(e,t)}function BaseElement(){}function FrameElement(){}function FootageElement(e,t,r){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.footageData=t.imageLoader.getAsset(this.assetData),this.initBaseData(e,t,r)}function AudioElement(e,t,r){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.initBaseData(e,t,r),this._isPlaying=!1,this._canPlay=!1;var n=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(n),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0},this.lv=PropertyFactory.getProp(this,e.au&&e.au.lv?e.au.lv:{k:[100]},1,.01,this)}function BaseRenderer(){}extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(e,t){var r;this.data=e,this.effectElements=[],this.initDynamicPropertyContainer(t);var n,i=this.data.ef.length,a=this.data.ef;for(r=0;r<i;r+=1){switch(n=null,a[r].ty){case 0:n=new SliderEffect(a[r],t,this);break;case 1:n=new AngleEffect(a[r],t,this);break;case 2:n=new ColorEffect(a[r],t,this);break;case 3:n=new PointEffect(a[r],t,this);break;case 4:case 7:n=new CheckboxEffect(a[r],t,this);break;case 10:n=new LayerIndexEffect(a[r],t,this);break;case 11:n=new MaskIndexEffect(a[r],t,this);break;case 5:n=new EffectsManager(a[r],t);break;default:n=new NoValueEffect(a[r])}n&&this.effectElements.push(n)}},BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var e=0,t=this.data.masksProperties.length;e<t;){if("n"!==this.data.masksProperties[e].mode&&!1!==this.data.masksProperties[e].cl)return!0;e+=1}return!1},initExpressions:function(){var e=getExpressionInterfaces();if(e){var t=e("layer"),r=e("effects"),n=e("shape"),i=e("text"),a=e("comp");this.layerInterface=t(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var o=r.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(o),0===this.data.ty||this.data.xt?this.compInterface=a(this):4===this.data.ty?(this.layerInterface.shapeInterface=n(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=i(this),this.layerInterface.text=this.layerInterface.textInterface)}},setBlendMode:function(){var e=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=e},initBaseData:function(e,t,r){this.globalData=t,this.comp=r,this.data=e,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(e,t){var r,n=this.dynamicProperties.length;for(r=0;r<n;r+=1)(t||this._isParent&&"transform"===this.dynamicProperties[r].propType)&&(this.dynamicProperties[r].getValue(),this.dynamicProperties[r]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&this.dynamicProperties.push(e)}},FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){var e=getExpressionInterfaces();if(e){var t=e("footage");this.layerInterface=t(this)}},FootageElement.prototype.getFootageData=function(){return this.footageData},AudioElement.prototype.prepareFrame=function(e){if(this.prepareRenderableFrame(e,!0),this.prepareProperties(e,!0),this.tm._placeholder)this._currentTime=e/this.data.sr;else{var t=this.tm.v;this._currentTime=t}this._volume=this.lv.v[0];var r=this._volume*this._volumeMultiplier;this._previousVolume!==r&&(this._previousVolume=r,this.audio.volume(r))},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(e){this.audio.rate(e)},AudioElement.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(e){var t,r,n=this.layers.length;for(this.completeLayers=!0,t=n-1;t>=0;t-=1)this.elements[t]||(r=this.layers[t]).ip-r.st<=e-this.layers[t].st&&r.op-r.st>e-this.layers[t].st&&this.buildItem(t),this.completeLayers=!!this.elements[t]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:default:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(e){return new AudioElement(e,this.globalData,this)},BaseRenderer.prototype.createFootage=function(e){return new FootageElement(e,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.buildItem(e);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(e){var t;this.completeLayers=!1;var r,n=e.length,i=this.layers.length;for(t=0;t<n;t+=1)for(r=0;r<i;){if(this.layers[r].id===e[t].id){this.layers[r]=e[t];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(e){this.globalData.projectInterface=e},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(e,t,r){for(var n=this.elements,i=this.layers,a=0,o=i.length;a<o;)i[a].ind==t&&(n[a]&&!0!==n[a]?(r.push(n[a]),n[a].setAsParent(),void 0!==i[a].parent?this.buildElementParenting(e,i[a].parent,r):e.setHierarchy(r)):(this.buildItem(a),this.addPendingElement(e))),a+=1},BaseRenderer.prototype.addPendingElement=function(e){this.pendingElements.push(e)},BaseRenderer.prototype.searchExtraCompositions=function(e){var t,r=e.length;for(t=0;t<r;t+=1)if(e[t].xt){var n=this.createComp(e[t]);n.initExpressions(),this.globalData.projectInterface.registerComposition(n)}},BaseRenderer.prototype.getElementById=function(e){var t,r=this.elements.length;for(t=0;t<r;t+=1)if(this.elements[t].data.ind===e)return this.elements[t];return null},BaseRenderer.prototype.getElementByPath=function(e){var t,r=e.shift();if("number"==typeof r)t=this.elements[r];else{var n,i=this.elements.length;for(n=0;n<i;n+=1)if(this.elements[n].data.nm===r){t=this.elements[n];break}}return 0===e.length?t:t.getElementByPath(e)},BaseRenderer.prototype.setupGlobalData=function(e,t){this.globalData.fontManager=new FontManager,this.globalData.slotManager=slotFactory(e),this.globalData.fontManager.addChars(e.chars),this.globalData.fontManager.addFonts(e.fonts,t),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=e.fr,this.globalData.nm=e.nm,this.globalData.compSize={w:e.w,h:e.h}};var effectTypes={TRANSFORM_EFFECT:"transformEFfect"};function TransformElement(){}function MaskElement(e,t,r){this.data=e,this.element=t,this.globalData=r,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var n,i,a=this.globalData.defs,o=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(o),this.solidPath="";var s,l,c,d,u,p,h=this.masksProperties,f=0,m=[],g=createElementID(),v="clipPath",y="clip-path";for(n=0;n<o;n+=1)if(("a"!==h[n].mode&&"n"!==h[n].mode||h[n].inv||100!==h[n].o.k||h[n].o.x)&&(v="mask",y="mask"),"s"!==h[n].mode&&"i"!==h[n].mode||0!==f?c=null:((c=createNS("rect")).setAttribute("fill","#ffffff"),c.setAttribute("width",this.element.comp.data.w||0),c.setAttribute("height",this.element.comp.data.h||0),m.push(c)),i=createNS("path"),"n"===h[n].mode)this.viewData[n]={op:PropertyFactory.getProp(this.element,h[n].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,h[n],3),elem:i,lastPath:""},a.appendChild(i);else{var b;if(f+=1,i.setAttribute("fill","s"===h[n].mode?"#000000":"#ffffff"),i.setAttribute("clip-rule","nonzero"),0!==h[n].x.k?(v="mask",y="mask",p=PropertyFactory.getProp(this.element,h[n].x,0,null,this.element),b=createElementID(),(d=createNS("filter")).setAttribute("id",b),(u=createNS("feMorphology")).setAttribute("operator","erode"),u.setAttribute("in","SourceGraphic"),u.setAttribute("radius","0"),d.appendChild(u),a.appendChild(d),i.setAttribute("stroke","s"===h[n].mode?"#000000":"#ffffff")):(u=null,p=null),this.storedData[n]={elem:i,x:p,expan:u,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"===h[n].mode){l=m.length;var E=createNS("g");for(s=0;s<l;s+=1)E.appendChild(m[s]);var _=createNS("mask");_.setAttribute("mask-type","alpha"),_.setAttribute("id",g+"_"+f),_.appendChild(i),a.appendChild(_),E.setAttribute("mask","url("+getLocationHref()+"#"+g+"_"+f+")"),m.length=0,m.push(E)}else m.push(i);h[n].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[n]={elem:i,lastPath:"",op:PropertyFactory.getProp(this.element,h[n].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,h[n],3),invRect:c},this.viewData[n].prop.k||this.drawPath(h[n],this.viewData[n].prop.v,this.viewData[n])}for(this.maskElement=createNS(v),o=m.length,n=0;n<o;n+=1)this.maskElement.appendChild(m[n]);f>0&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(y,"url("+getLocationHref()+"#"+g+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}TransformElement.prototype={initTransform:function(){var e=new Matrix;this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:e,localMat:e,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var e,t=this.finalTransform.mat,r=0,n=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r<n;){if(this.hierarchy[r].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}r+=1}if(this.finalTransform._matMdf)for(e=this.finalTransform.mProp.v.props,t.cloneFromProps(e),r=0;r<n;r+=1)t.multiply(this.hierarchy[r].finalTransform.mProp.v)}this.localTransforms&&!this.finalTransform._matMdf||(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v)},renderLocalTransform:function(){if(this.localTransforms){var e=0,t=this.localTransforms.length;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;e<t;)this.localTransforms[e]._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[e]._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v,this.finalTransform._opMdf=!0),e+=1;if(this.finalTransform._localMatMdf){var r=this.finalTransform.localMat;for(this.localTransforms[0].matrix.clone(r),e=1;e<t;e+=1){var n=this.localTransforms[e].matrix;r.multiply(n)}r.multiply(this.finalTransform.mat)}if(this.finalTransform._opMdf){var i=this.finalTransform.localOpacity;for(e=0;e<t;e+=1)i*=.01*this.localTransforms[e].opacity;this.finalTransform.localOpacity=i}}},searchEffectTransforms:function(){if(this.renderableEffectsManager){var e=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);if(e.length){this.localTransforms=[],this.finalTransform.localMat=new Matrix;var t=0,r=e.length;for(t=0;t<r;t+=1)this.localTransforms.push(e[t])}}},globalToLocal:function(e){var t=[];t.push(this.finalTransform);for(var r,n=!0,i=this.comp;n;)i.finalTransform?(i.data.hasMask&&t.splice(0,0,i.finalTransform),i=i.comp):n=!1;var a,o=t.length;for(r=0;r<o;r+=1)a=t[r].mat.applyToPointArray(0,0,0),e=[e[0]-a[0],e[1]-a[1],0];return e},mHelper:new Matrix},MaskElement.prototype.getMaskProperty=function(e){return this.viewData[e].prop},MaskElement.prototype.renderFrame=function(e){var t,r=this.element.finalTransform.mat,n=this.masksProperties.length;for(t=0;t<n;t+=1)if((this.viewData[t].prop._mdf||e)&&this.drawPath(this.masksProperties[t],this.viewData[t].prop.v,this.viewData[t]),(this.viewData[t].op._mdf||e)&&this.viewData[t].elem.setAttribute("fill-opacity",this.viewData[t].op.v),"n"!==this.masksProperties[t].mode&&(this.viewData[t].invRect&&(this.element.finalTransform.mProp._mdf||e)&&this.viewData[t].invRect.setAttribute("transform",r.getInverseMatrix().to2dCSS()),this.storedData[t].x&&(this.storedData[t].x._mdf||e))){var i=this.storedData[t].expan;this.storedData[t].x.v<0?("erode"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="erode",this.storedData[t].elem.setAttribute("filter","url("+getLocationHref()+"#"+this.storedData[t].filterId+")")),i.setAttribute("radius",-this.storedData[t].x.v)):("dilate"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="dilate",this.storedData[t].elem.setAttribute("filter",null)),this.storedData[t].elem.setAttribute("stroke-width",2*this.storedData[t].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var e="M0,0 ";return e+=" h"+this.globalData.compSize.w,e+=" v"+this.globalData.compSize.h,e+=" h-"+this.globalData.compSize.w,e+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(e,t,r){var n,i,a=" M"+t.v[0][0]+","+t.v[0][1];for(i=t._length,n=1;n<i;n+=1)a+=" C"+t.o[n-1][0]+","+t.o[n-1][1]+" "+t.i[n][0]+","+t.i[n][1]+" "+t.v[n][0]+","+t.v[n][1];if(t.c&&i>1&&(a+=" C"+t.o[n-1][0]+","+t.o[n-1][1]+" "+t.i[0][0]+","+t.i[0][1]+" "+t.v[0][0]+","+t.v[0][1]),r.lastPath!==a){var o="";r.elem&&(t.c&&(o=e.inv?this.solidPath+a:a),r.elem.setAttribute("d",o)),r.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var e={createFilter:function(e,t){var r=createNS("filter");return r.setAttribute("id",e),!0!==t&&(r.setAttribute("filterUnits","objectBoundingBox"),r.setAttribute("x","0%"),r.setAttribute("y","0%"),r.setAttribute("width","100%"),r.setAttribute("height","100%")),r},createAlphaToLuminanceFilter:function(){var e=createNS("feColorMatrix");return e.setAttribute("type","matrix"),e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),e}};return e}(),featureSupport=function(){var e={maskType:!0,svgLumaHidden:!0,offscreenCanvas:"undefined"!=typeof OffscreenCanvas};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),/firefox/i.test(navigator.userAgent)&&(e.svgLumaHidden=!1),e}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(e){var t,r,n="SourceGraphic",i=e.data.ef?e.data.ef.length:0,a=createElementID(),o=filtersFactory.createFilter(a,!0),s=0;for(this.filters=[],t=0;t<i;t+=1){r=null;var l=e.data.ef[t].ty;registeredEffects$1[l]&&(r=new(0,registeredEffects$1[l].effect)(o,e.effectsManager.effectElements[t],e,idPrefix+s,n),n=idPrefix+s,registeredEffects$1[l].countsAsEffect&&(s+=1)),r&&this.filters.push(r)}s&&(e.globalData.defs.appendChild(o),e.layerElement.setAttribute("filter","url("+getLocationHref()+"#"+a+")")),this.filters.length&&e.addRenderableComponent(this)}function registerEffect$1(e,t,r){registeredEffects$1[e]={effect:t,countsAsEffect:r}}function SVGBaseElement(){}function HierarchyElement(){}function RenderableDOMElement(){}function IImageElement(e,t,r){this.assetData=t.getAssetData(e.refId),this.assetData&&this.assetData.sid&&(this.assetData=t.slotManager.getProp(this.assetData)),this.initElement(e,t,r),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ProcessedElement(e,t){this.elem=e,this.pos=t}function IShapeElement(){}SVGEffects.prototype.renderFrame=function(e){var t,r=this.filters.length;for(t=0;t<r;t+=1)this.filters[t].renderFrame(e)},SVGEffects.prototype.getEffects=function(e){var t,r=this.filters.length,n=[];for(t=0;t<r;t+=1)this.filters[t].type===e&&n.push(this.filters[t]);return n},SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var e=null;if(this.data.td){this.matteMasks={};var t=createNS("g");t.setAttribute("id",this.layerId),t.appendChild(this.layerElement),e=t,this.globalData.defs.appendChild(t)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),e=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var r=createNS("clipPath"),n=createNS("path");n.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var i=createElementID();if(r.setAttribute("id",i),r.appendChild(n),this.globalData.defs.appendChild(r),this.checkMasks()){var a=createNS("g");a.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")"),a.appendChild(this.layerElement),this.transformedElement=a,e?e.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._localMatMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.localOpacity)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this),this.searchEffectTransforms()},getMatte:function(e){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[e]){var t,r,n,i,a=this.layerId+"_"+e;if(1===e||3===e){var o=createNS("mask");o.setAttribute("id",a),o.setAttribute("mask-type",3===e?"luminance":"alpha"),(n=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),o.appendChild(n),this.globalData.defs.appendChild(o),featureSupport.maskType||1!==e||(o.setAttribute("mask-type","luminance"),t=createElementID(),r=filtersFactory.createFilter(t),this.globalData.defs.appendChild(r),r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(i=createNS("g")).appendChild(n),o.appendChild(i),i.setAttribute("filter","url("+getLocationHref()+"#"+t+")"))}else if(2===e){var s=createNS("mask");s.setAttribute("id",a),s.setAttribute("mask-type","alpha");var l=createNS("g");s.appendChild(l),t=createElementID(),r=filtersFactory.createFilter(t);var c=createNS("feComponentTransfer");c.setAttribute("in","SourceGraphic"),r.appendChild(c);var d=createNS("feFuncA");d.setAttribute("type","table"),d.setAttribute("tableValues","1.0 0.0"),c.appendChild(d),this.globalData.defs.appendChild(r);var u=createNS("rect");u.setAttribute("width",this.comp.data.w),u.setAttribute("height",this.comp.data.h),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("fill","#ffffff"),u.setAttribute("opacity","0"),l.setAttribute("filter","url("+getLocationHref()+"#"+t+")"),l.appendChild(u),(n=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),l.appendChild(n),featureSupport.maskType||(s.setAttribute("mask-type","luminance"),r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),i=createNS("g"),l.appendChild(u),i.appendChild(this.layerElement),l.appendChild(i)),this.globalData.defs.appendChild(s)}this.matteMasks[e]=a}return this.matteMasks[e]},setMatte:function(e){this.matteElement&&this.matteElement.setAttribute("mask","url("+getLocationHref()+"#"+e+")")}},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(e){this.hierarchy=e},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initTransform(e,t,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var e=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},IShapeElement.prototype={addShapeToModifiers:function(e){var t,r=this.shapeModifiers.length;for(t=0;t<r;t+=1)this.shapeModifiers[t].addShape(e)},isShapeInAnimatedModifiers:function(e){for(var t=this.shapeModifiers.length;0<t;)if(this.shapeModifiers[0].isAnimatedWithShape(e))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var e,t=this.shapes.length;for(e=0;e<t;e+=1)this.shapes[e].sh.reset();for(e=(t=this.shapeModifiers.length)-1;e>=0&&!this.shapeModifiers[e].processShapes(this._isFirstFrame);e-=1);}},searchProcessedElement:function(e){for(var t=this.processedElements,r=0,n=t.length;r<n;){if(t[r].elem===e)return t[r].pos;r+=1}return 0},addProcessedElement:function(e,t){for(var r=this.processedElements,n=r.length;n;)if(r[n-=1].elem===e)return void(r[n].pos=t);r.push(new ProcessedElement(e,t))},prepareFrame:function(e){this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange)}};var lineCapEnum={1:"butt",2:"round",3:"square"},lineJoinEnum={1:"miter",2:"round",3:"bevel"};function SVGShapeData(e,t,r){this.caches=[],this.styles=[],this.transformers=e,this.lStr="",this.sh=r,this.lvl=t,this._isAnimated=!!r.k;for(var n=0,i=e.length;n<i;){if(e[n].mProps.dynamicProperties.length){this._isAnimated=!0;break}n+=1}}function SVGStyleData(e,t){this.data=e,this.type=e.ty,this.d="",this.lvl=t,this._mdf=!1,this.closed=!0===e.hd,this.pElem=createNS("path"),this.msElem=null}function DashProperty(e,t,r,n){var i;this.elem=e,this.frameId=-1,this.dataProps=createSizedArray(t.length),this.renderer=r,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",t.length?t.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(n);var a,o=t.length||0;for(i=0;i<o;i+=1)a=PropertyFactory.getProp(e,t[i].v,0,0,this),this.k=a.k||this.k,this.dataProps[i]={n:t[i].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function SVGStrokeStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=r,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=r}function SVGNoStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.style=r}function GradientProperty(e,t,r){this.data=t,this.c=createTypedArray("uint8c",4*t.p);var n=t.k.k[0].s?t.k.k[0].s.length-4*t.p:t.k.k.length-4*t.p;this.o=createTypedArray("float32",n),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=n,this.initDynamicPropertyContainer(r),this.prop=PropertyFactory.getProp(e,t.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}function SVGGradientFillStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.initGradientData(e,t,r)}function SVGGradientStrokeStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.initGradientData(e,t,r),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function SVGTransformData(e,t,r){this.transform={mProps:e,op:t,container:r},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},DashProperty.prototype.getValue=function(e){if((this.elem.globalData.frameId!==this.frameId||e)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||e,this._mdf)){var t=0,r=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),t=0;t<r;t+=1)"o"!==this.dataProps[t].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[t].p.v:this.dashArray[t]=this.dataProps[t].p.v:this.dashoffset[0]=this.dataProps[t].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),extendPrototype([DynamicPropertyContainer],SVGNoStyleData),GradientProperty.prototype.comparePoints=function(e,t){for(var r=0,n=this.o.length/2;r<n;){if(Math.abs(e[4*r]-e[4*t+2*r])>.01)return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e<t;){if(!this.comparePoints(this.data.k.k[e].s,this.data.p))return!1;e+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(e){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||e){var t,r,n,i=4*this.data.p;for(t=0;t<i;t+=1)r=t%4==0?100:255,n=Math.round(this.prop.v[t]*r),this.c[t]!==n&&(this.c[t]=n,this._cmdf=!e);if(this.o.length)for(i=this.prop.v.length,t=4*this.data.p;t<i;t+=1)r=t%2==0?100:1,n=t%2==0?Math.round(100*this.prop.v[t]):this.prop.v[t],this.o[t-4*this.data.p]!==n&&(this.o[t-4*this.data.p]=n,this._omdf=!e);this._mdf=!e}},extendPrototype([DynamicPropertyContainer],GradientProperty),SVGGradientFillStyleData.prototype.initGradientData=function(e,t,r){this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.s=PropertyFactory.getProp(e,t.s,1,null,this),this.e=PropertyFactory.getProp(e,t.e,1,null,this),this.h=PropertyFactory.getProp(e,t.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(e,t.a||{k:0},0,degToRads,this),this.g=new GradientProperty(e,t.g,this),this.style=r,this.stops=[],this.setGradientData(r.pElem,t),this.setGradientOpacity(t,r),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(e,t){var r=createElementID(),n=createNS(1===t.t?"linearGradient":"radialGradient");n.setAttribute("id",r),n.setAttribute("spreadMethod","pad"),n.setAttribute("gradientUnits","userSpaceOnUse");var i,a,o,s=[];for(o=4*t.g.p,a=0;a<o;a+=4)i=createNS("stop"),n.appendChild(i),s.push(i);e.setAttribute("gf"===t.ty?"fill":"stroke","url("+getLocationHref()+"#"+r+")"),this.gf=n,this.cst=s},SVGGradientFillStyleData.prototype.setGradientOpacity=function(e,t){if(this.g._hasOpacity&&!this.g._collapsable){var r,n,i,a=createNS("mask"),o=createNS("path");a.appendChild(o);var s=createElementID(),l=createElementID();a.setAttribute("id",l);var c=createNS(1===e.t?"linearGradient":"radialGradient");c.setAttribute("id",s),c.setAttribute("spreadMethod","pad"),c.setAttribute("gradientUnits","userSpaceOnUse"),i=e.g.k.k[0].s?e.g.k.k[0].s.length:e.g.k.k.length;var d=this.stops;for(n=4*e.g.p;n<i;n+=2)(r=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),c.appendChild(r),d.push(r);o.setAttribute("gf"===e.ty?"fill":"stroke","url("+getLocationHref()+"#"+s+")"),"gs"===e.ty&&(o.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),o.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),1===e.lj&&o.setAttribute("stroke-miterlimit",e.ml)),this.of=c,this.ms=a,this.ost=d,this.maskId=l,t.msElem=o}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var buildShapeString=function(e,t,r,n){if(0===t)return"";var i,a=e.o,o=e.i,s=e.v,l=" M"+n.applyToPointStringified(s[0][0],s[0][1]);for(i=1;i<t;i+=1)l+=" C"+n.applyToPointStringified(a[i-1][0],a[i-1][1])+" "+n.applyToPointStringified(o[i][0],o[i][1])+" "+n.applyToPointStringified(s[i][0],s[i][1]);return r&&t&&(l+=" C"+n.applyToPointStringified(a[i-1][0],a[i-1][1])+" "+n.applyToPointStringified(o[0][0],o[0][1])+" "+n.applyToPointStringified(s[0][0],s[0][1]),l+="z"),l},SVGElementsRenderer=function(){var e=new Matrix,t=new Matrix;function r(e,t,r){(r||t.transform.op._mdf)&&t.transform.container.setAttribute("opacity",t.transform.op.v),(r||t.transform.mProps._mdf)&&t.transform.container.setAttribute("transform",t.transform.mProps.v.to2dCSS())}function n(){}function i(r,n,i){var a,o,s,l,c,d,u,p,h,f,m=n.styles.length,g=n.lvl;for(d=0;d<m;d+=1){if(l=n.sh._mdf||i,n.styles[d].lvl<g){for(p=t.reset(),h=g-n.styles[d].lvl,f=n.transformers.length-1;!l&&h>0;)l=n.transformers[f].mProps._mdf||l,h-=1,f-=1;if(l)for(h=g-n.styles[d].lvl,f=n.transformers.length-1;h>0;)p.multiply(n.transformers[f].mProps.v),h-=1,f-=1}else p=e;if(o=(u=n.sh.paths)._length,l){for(s="",a=0;a<o;a+=1)(c=u.shapes[a])&&c._length&&(s+=buildShapeString(c,c._length,c.c,p));n.caches[d]=s}else s=n.caches[d];n.styles[d].d+=!0===r.hd?"":s,n.styles[d]._mdf=l||n.styles[d]._mdf}}function a(e,t,r){var n=t.style;(t.c._mdf||r)&&n.pElem.setAttribute("fill","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r)&&n.pElem.setAttribute("fill-opacity",t.o.v)}function o(e,t,r){s(e,t,r),l(0,t,r)}function s(e,t,r){var n,i,a,o,s,l=t.gf,c=t.g._hasOpacity,d=t.s.v,u=t.e.v;if(t.o._mdf||r){var p="gf"===e.ty?"fill-opacity":"stroke-opacity";t.style.pElem.setAttribute(p,t.o.v)}if(t.s._mdf||r){var h=1===e.t?"x1":"cx",f="x1"===h?"y1":"cy";l.setAttribute(h,d[0]),l.setAttribute(f,d[1]),c&&!t.g._collapsable&&(t.of.setAttribute(h,d[0]),t.of.setAttribute(f,d[1]))}if(t.g._cmdf||r){n=t.cst;var m=t.g.c;for(a=n.length,i=0;i<a;i+=1)(o=n[i]).setAttribute("offset",m[4*i]+"%"),o.setAttribute("stop-color","rgb("+m[4*i+1]+","+m[4*i+2]+","+m[4*i+3]+")")}if(c&&(t.g._omdf||r)){var g=t.g.o;for(a=(n=t.g._collapsable?t.cst:t.ost).length,i=0;i<a;i+=1)o=n[i],t.g._collapsable||o.setAttribute("offset",g[2*i]+"%"),o.setAttribute("stop-opacity",g[2*i+1])}if(1===e.t)(t.e._mdf||r)&&(l.setAttribute("x2",u[0]),l.setAttribute("y2",u[1]),c&&!t.g._collapsable&&(t.of.setAttribute("x2",u[0]),t.of.setAttribute("y2",u[1])));else if((t.s._mdf||t.e._mdf||r)&&(s=Math.sqrt(Math.pow(d[0]-u[0],2)+Math.pow(d[1]-u[1],2)),l.setAttribute("r",s),c&&!t.g._collapsable&&t.of.setAttribute("r",s)),t.s._mdf||t.e._mdf||t.h._mdf||t.a._mdf||r){s||(s=Math.sqrt(Math.pow(d[0]-u[0],2)+Math.pow(d[1]-u[1],2)));var v=Math.atan2(u[1]-d[1],u[0]-d[0]),y=t.h.v;y>=1?y=.99:y<=-1&&(y=-.99);var b=s*y,E=Math.cos(v+t.a.v)*b+d[0],_=Math.sin(v+t.a.v)*b+d[1];l.setAttribute("fx",E),l.setAttribute("fy",_),c&&!t.g._collapsable&&(t.of.setAttribute("fx",E),t.of.setAttribute("fy",_))}}function l(e,t,r){var n=t.style,i=t.d;i&&(i._mdf||r)&&i.dashStr&&(n.pElem.setAttribute("stroke-dasharray",i.dashStr),n.pElem.setAttribute("stroke-dashoffset",i.dashoffset[0])),t.c&&(t.c._mdf||r)&&n.pElem.setAttribute("stroke","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r)&&n.pElem.setAttribute("stroke-opacity",t.o.v),(t.w._mdf||r)&&(n.pElem.setAttribute("stroke-width",t.w.v),n.msElem&&n.msElem.setAttribute("stroke-width",t.w.v))}return{createRenderFunction:function(e){switch(e.ty){case"fl":return a;case"gf":return s;case"gs":return o;case"st":return l;case"sh":case"el":case"rc":case"sr":return i;case"tr":return r;case"no":return n;default:return null}}}}();function SVGShapeElement(e,t,r){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,r),this.prevViewData=[]}function LetterProps(e,t,r,n,i,a){this.o=e,this.sw=t,this.sc=r,this.fc=n,this.m=i,this.p=a,this._mdf={o:!0,sw:!!t,sc:!!r,fc:!!n,m:!0,p:!0}}function TextProperty(e,t){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,t.d&&t.d.sid&&(t.d=e.globalData.slotManager.getProp(t.d)),this.data=t,this.elem=e,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var e,t,r,n,i=this.shapes.length,a=this.stylesList.length,o=[],s=!1;for(r=0;r<a;r+=1){for(n=this.stylesList[r],s=!1,o.length=0,e=0;e<i;e+=1)-1!==(t=this.shapes[e]).styles.indexOf(n)&&(o.push(t),s=t._isAnimated||s);o.length>1&&s&&this.setShapesAsAnimated(o)}},SVGShapeElement.prototype.setShapesAsAnimated=function(e){var t,r=e.length;for(t=0;t<r;t+=1)e[t].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(e,t){var r,n=new SVGStyleData(e,t),i=n.pElem;return"st"===e.ty?r=new SVGStrokeStyleData(this,e,n):"fl"===e.ty?r=new SVGFillStyleData(this,e,n):"gf"===e.ty||"gs"===e.ty?(r=new("gf"===e.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,e,n),this.globalData.defs.appendChild(r.gf),r.maskId&&(this.globalData.defs.appendChild(r.ms),this.globalData.defs.appendChild(r.of),i.setAttribute("mask","url("+getLocationHref()+"#"+r.maskId+")"))):"no"===e.ty&&(r=new SVGNoStyleData(this,e,n)),"st"!==e.ty&&"gs"!==e.ty||(i.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),i.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),i.setAttribute("fill-opacity","0"),1===e.lj&&i.setAttribute("stroke-miterlimit",e.ml)),2===e.r&&i.setAttribute("fill-rule","evenodd"),e.ln&&i.setAttribute("id",e.ln),e.cl&&i.setAttribute("class",e.cl),e.bm&&(i.style["mix-blend-mode"]=getBlendMode(e.bm)),this.stylesList.push(n),this.addToAnimatedContents(e,r),r},SVGShapeElement.prototype.createGroupElement=function(e){var t=new ShapeGroupData;return e.ln&&t.gr.setAttribute("id",e.ln),e.cl&&t.gr.setAttribute("class",e.cl),e.bm&&(t.gr.style["mix-blend-mode"]=getBlendMode(e.bm)),t},SVGShapeElement.prototype.createTransformElement=function(e,t){var r=TransformPropertyFactory.getTransformProperty(this,e,this),n=new SVGTransformData(r,r.o,t);return this.addToAnimatedContents(e,n),n},SVGShapeElement.prototype.createShapeElement=function(e,t,r){var n=4;"rc"===e.ty?n=5:"el"===e.ty?n=6:"sr"===e.ty&&(n=7);var i=new SVGShapeData(t,r,ShapePropertyFactory.getShapeProp(this,e,n,this));return this.shapes.push(i),this.addShapeToModifiers(i),this.addToAnimatedContents(e,i),i},SVGShapeElement.prototype.addToAnimatedContents=function(e,t){for(var r=0,n=this.animatedContents.length;r<n;){if(this.animatedContents[r].element===t)return;r+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(e),element:t,data:e})},SVGShapeElement.prototype.setElementStyles=function(e){var t,r=e.styles,n=this.stylesList.length;for(t=0;t<n;t+=1)-1!==r.indexOf(this.stylesList[t])||this.stylesList[t].closed||r.push(this.stylesList[t])},SVGShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(e,t,r,n,i,a,o){var s,l,c,d,u,p,h=[].concat(a),f=e.length-1,m=[],g=[];for(s=f;s>=0;s-=1){if((p=this.searchProcessedElement(e[s]))?t[s]=r[p-1]:e[s]._render=o,"fl"===e[s].ty||"st"===e[s].ty||"gf"===e[s].ty||"gs"===e[s].ty||"no"===e[s].ty)p?t[s].style.closed=e[s].hd:t[s]=this.createStyleElement(e[s],i),e[s]._render&&t[s].style.pElem.parentNode!==n&&n.appendChild(t[s].style.pElem),m.push(t[s].style);else if("gr"===e[s].ty){if(p)for(c=t[s].it.length,l=0;l<c;l+=1)t[s].prevViewData[l]=t[s].it[l];else t[s]=this.createGroupElement(e[s]);this.searchShapes(e[s].it,t[s].it,t[s].prevViewData,t[s].gr,i+1,h,o),e[s]._render&&t[s].gr.parentNode!==n&&n.appendChild(t[s].gr)}else"tr"===e[s].ty?(p||(t[s]=this.createTransformElement(e[s],n)),d=t[s].transform,h.push(d)):"sh"===e[s].ty||"rc"===e[s].ty||"el"===e[s].ty||"sr"===e[s].ty?(p||(t[s]=this.createShapeElement(e[s],h,i)),this.setElementStyles(t[s])):"tm"===e[s].ty||"rd"===e[s].ty||"ms"===e[s].ty||"pb"===e[s].ty||"zz"===e[s].ty||"op"===e[s].ty?(p?(u=t[s]).closed=!1:((u=ShapeModifiers.getModifier(e[s].ty)).init(this,e[s]),t[s]=u,this.shapeModifiers.push(u)),g.push(u)):"rp"===e[s].ty&&(p?(u=t[s]).closed=!0:(u=ShapeModifiers.getModifier(e[s].ty),t[s]=u,u.init(this,e,s,t),this.shapeModifiers.push(u),o=!1),g.push(u));this.addProcessedElement(e[s],s+1)}for(f=m.length,s=0;s<f;s+=1)m[s].closed=!0;for(f=g.length,s=0;s<f;s+=1)g[s].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var e;this.renderModifiers();var t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].reset();for(this.renderShape(),e=0;e<t;e+=1)(this.stylesList[e]._mdf||this._isFirstFrame)&&(this.stylesList[e].msElem&&(this.stylesList[e].msElem.setAttribute("d",this.stylesList[e].d),this.stylesList[e].d="M0 0"+this.stylesList[e].d),this.stylesList[e].pElem.setAttribute("d",this.stylesList[e].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var e,t,r=this.animatedContents.length;for(e=0;e<r;e+=1)t=this.animatedContents[e],(this._isFirstFrame||t.element._isAnimated)&&!0!==t.data&&t.fn(t.data,t.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},LetterProps.prototype.update=function(e,t,r,n,i,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var o=!1;return this.o!==e&&(this.o=e,this._mdf.o=!0,o=!0),this.sw!==t&&(this.sw=t,this._mdf.sw=!0,o=!0),this.sc!==r&&(this.sc=r,this._mdf.sc=!0,o=!0),this.fc!==n&&(this.fc=n,this._mdf.fc=!0,o=!0),this.m!==i&&(this.m=i,this._mdf.m=!0,o=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,this._mdf.p=!0,o=!0),o},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},TextProperty.prototype.setCurrentData=function(e){e.__complete||this.completeTextData(e),this.currentData=e,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(e){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||e){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var n;this.lock=!0,this._mdf=!1;var i=this.effectsSequence.length,a=e||this.data.d.k[this.keysIndex].s;for(n=0;n<i;n+=1)a=r!==this.keysIndex?this.effectsSequence[n](a,a.t):this.effectsSequence[n](this.currentData,a.t);t!==a&&this.setCurrentData(a),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var e=this.data.d.k,t=this.elem.comp.renderedFrame,r=0,n=e.length;r<=n-1&&!(r===n-1||e[r+1].t>t);)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(e){for(var t,r,n=[],i=0,a=e.length,o=!1,s=!1,l="";i<a;)o=s,s=!1,t=e.charCodeAt(i),l=e.charAt(i),FontManager.isCombinedCharacter(t)?o=!0:t>=55296&&t<=56319?FontManager.isRegionalFlag(e,i)?l=e.substr(i,14):(r=e.charCodeAt(i+1))>=56320&&r<=57343&&(FontManager.isModifier(t,r)?(l=e.substr(i,2),o=!0):l=FontManager.isFlagEmoji(e.substr(i,4))?e.substr(i,4):e.substr(i,2)):t>56319?(r=e.charCodeAt(i+1),FontManager.isVariationSelector(t)&&(o=!0)):FontManager.isZeroWidthJoiner(t)&&(o=!0,s=!0),o?(n[n.length-1]+=l,o=!1):n.push(l),i+=l.length;return n},TextProperty.prototype.completeTextData=function(e){e.__complete=!0;var t,r,n,i,a,o,s,l=this.elem.globalData.fontManager,c=this.data,d=[],u=0,p=c.m.g,h=0,f=0,m=0,g=[],v=0,y=0,b=l.getFontByName(e.f),E=0,_=getFontProperties(b);e.fWeight=_.weight,e.fStyle=_.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),r=e.finalText.length,e.finalLineHeight=e.lh;var S,T=e.tr/1e3*e.finalSize;if(e.sz)for(var x,k,A=!0,I=e.sz[0],C=e.sz[1];A;){x=0,v=0,r=(k=this.buildFinalText(e.t)).length,T=e.tr/1e3*e.finalSize;var P=-1;for(t=0;t<r;t+=1)S=k[t].charCodeAt(0),n=!1," "===k[t]?P=t:13!==S&&3!==S||(v=0,n=!0,x+=e.finalLineHeight||1.2*e.finalSize),l.chars?(s=l.getCharData(k[t],b.fStyle,b.fFamily),E=n?0:s.w*e.finalSize/100):E=l.measureText(k[t],e.f,e.finalSize),v+E>I&&" "!==k[t]?(-1===P?r+=1:t=P,x+=e.finalLineHeight||1.2*e.finalSize,k.splice(t,P===t?1:0,"\r"),P=-1,v=0):(v+=E,v+=T);x+=b.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&C<x?(e.finalSize-=1,e.finalLineHeight=e.finalSize*e.lh/e.s):(e.finalText=k,r=e.finalText.length,A=!1)}v=-T,E=0;var w,D=0;for(t=0;t<r;t+=1)if(n=!1,13===(S=(w=e.finalText[t]).charCodeAt(0))||3===S?(D=0,g.push(v),y=v>y?v:y,v=-2*T,i="",n=!0,m+=1):i=w,l.chars?(s=l.getCharData(w,b.fStyle,l.getFontByName(e.f).fFamily),E=n?0:s.w*e.finalSize/100):E=l.measureText(i,e.f,e.finalSize)," "===w?D+=E+T:(v+=E+T+D,D=0),d.push({l:E,an:E,add:h,n:n,anIndexes:[],val:i,line:m,animatorJustifyOffset:0}),2==p){if(h+=E,""===i||" "===i||t===r-1){for(""!==i&&" "!==i||(h-=E);f<=t;)d[f].an=h,d[f].ind=u,d[f].extra=E,f+=1;u+=1,h=0}}else if(3==p){if(h+=E,""===i||t===r-1){for(""===i&&(h-=E);f<=t;)d[f].an=h,d[f].ind=u,d[f].extra=E,f+=1;h=0,u+=1}}else d[u].ind=u,d[u].extra=0,u+=1;if(e.l=d,y=v>y?v:y,g.push(v),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=y,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=g;var R,L,O,N,M=c.a;o=M.length;var F=[];for(a=0;a<o;a+=1){for((R=M[a]).a.sc&&(e.strokeColorAnim=!0),R.a.sw&&(e.strokeWidthAnim=!0),(R.a.fc||R.a.fh||R.a.fs||R.a.fb)&&(e.fillColorAnim=!0),N=0,O=R.s.b,t=0;t<r;t+=1)(L=d[t]).anIndexes[a]=N,(1==O&&""!==L.val||2==O&&""!==L.val&&" "!==L.val||3==O&&(L.n||" "==L.val||t==r-1)||4==O&&(L.n||t==r-1))&&(1===R.s.rn&&F.push(N),N+=1);c.a[a].s.totalChars=N;var $,B=-1;if(1===R.s.rn)for(t=0;t<r;t+=1)B!=(L=d[t]).anIndexes[a]&&(B=L.anIndexes[a],$=F.splice(Math.floor(Math.random()*F.length),1)[0]),L.anIndexes[a]=$}e.yOffset=e.finalLineHeight||1.2*e.finalSize,e.ls=e.ls||0,e.ascent=b.ascent*e.finalSize/100},TextProperty.prototype.updateDocumentData=function(e,t){t=void 0===t?this.keysIndex:t;var r=this.copyData({},this.data.d.k[t].s);r=this.copyData(r,e),this.data.d.k[t].s=r,this.recalculate(t),this.setCurrentData(r),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(e){var t=this.data.d.k[e].s;t.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(t)},TextProperty.prototype.canResizeFont=function(e){this.canResize=e,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(e){this.minimumFontSize=Math.floor(e)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var e=Math.max,t=Math.min,r=Math.floor;function n(e,t){this._currentTextLength=-1,this.k=!1,this.data=t,this.elem=e,this.comp=e.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(e),this.s=PropertyFactory.getProp(e,t.s||{k:0},0,0,this),this.e="e"in t?PropertyFactory.getProp(e,t.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(e,t.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(e,t.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(e,t.ne||{k:0},0,0,this),this.sm=PropertyFactory.getProp(e,t.sm||{k:100},0,0,this),this.a=PropertyFactory.getProp(e,t.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return n.prototype={getMult:function(n){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var i=0,a=0,o=1,s=1;this.ne.v>0?i=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?o=1-this.xe.v/100:s=1+this.xe.v/100;var l=BezierFactory.getBezierEasing(i,a,o,s).get,c=0,d=this.finalS,u=this.finalE,p=this.data.sh;if(2===p)c=l(c=u===d?n>=u?1:0:e(0,t(.5/(u-d)+(n-d)/(u-d),1)));else if(3===p)c=l(c=u===d?n>=u?0:1:1-e(0,t(.5/(u-d)+(n-d)/(u-d),1)));else if(4===p)u===d?c=0:(c=e(0,t(.5/(u-d)+(n-d)/(u-d),1)))<.5?c*=2:c=1-2*(c-.5),c=l(c);else if(5===p){if(u===d)c=0;else{var h=u-d,f=-h/2+(n=t(e(0,n+.5-d),u-d)),m=h/2;c=Math.sqrt(1-f*f/(m*m))}c=l(c)}else 6===p?(u===d?c=0:(n=t(e(0,n+.5-d),u-d),c=(1+Math.cos(Math.PI+2*Math.PI*n/(u-d)))/2),c=l(c)):(n>=r(d)&&(c=e(0,t(n-d<0?t(u,1)-(d-n):u-n,1))),c=l(c));if(100!==this.sm.v){var g=.01*this.sm.v;0===g&&(g=1e-8);var v=.5-.5*g;c<v?c=0:(c=(c-v)/g)>1&&(c=1)}return c*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&2===this.data.r&&(this.e.v=this._currentTextLength);var t=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/t,n=this.s.v/t+r,i=this.e.v/t+r;if(n>i){var a=n;n=i,i=a}this.finalS=n,this.finalE=i}},extendPrototype([DynamicPropertyContainer],n),{getTextSelectorProp:function(e,t,r){return new n(e,t)}}}();function TextAnimatorDataProperty(e,t,r){var n={propType:!1},i=PropertyFactory.getProp,a=t.a;this.a={r:a.r?i(e,a.r,0,degToRads,r):n,rx:a.rx?i(e,a.rx,0,degToRads,r):n,ry:a.ry?i(e,a.ry,0,degToRads,r):n,sk:a.sk?i(e,a.sk,0,degToRads,r):n,sa:a.sa?i(e,a.sa,0,degToRads,r):n,s:a.s?i(e,a.s,1,.01,r):n,a:a.a?i(e,a.a,1,0,r):n,o:a.o?i(e,a.o,0,.01,r):n,p:a.p?i(e,a.p,1,0,r):n,sw:a.sw?i(e,a.sw,0,0,r):n,sc:a.sc?i(e,a.sc,1,0,r):n,fc:a.fc?i(e,a.fc,1,0,r):n,fh:a.fh?i(e,a.fh,0,0,r):n,fs:a.fs?i(e,a.fs,0,.01,r):n,fb:a.fb?i(e,a.fb,0,.01,r):n,t:a.t?i(e,a.t,0,0,r):n},this.s=TextSelectorProp.getTextSelectorProp(e,t.s,r),this.s.t=t.s.t}function TextAnimatorProperty(e,t,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var e,t,r=this._textData.a.length,n=PropertyFactory.getProp;for(e=0;e<r;e+=1)t=this._textData.a[e],this._animatorsData[e]=new TextAnimatorDataProperty(this._elem,t,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:n(this._elem,this._textData.p.a,0,0,this),f:n(this._elem,this._textData.p.f,0,0,this),l:n(this._elem,this._textData.p.l,0,0,this),r:n(this._elem,this._textData.p.r,0,0,this),p:n(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=n(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(e,t){if(this.lettersChangedFlag=t,this._mdf||this._isFirstFrame||t||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var r,n,i,a,o,s,l,c,d,u,p,h,f,m,g,v,y,b,E,_=this._moreOptions.alignment.v,S=this._animatorsData,T=this._textData,x=this.mHelper,k=this._renderType,A=this.renderedLetters.length,I=e.l;if(this._hasMaskedPath){if(E=this._pathData.m,!this._pathData.n||this._pathData._mdf){var C,P=E.v;for(this._pathData.r.v&&(P=P.reverse()),o={tLength:0,segments:[]},a=P._length-1,v=0,i=0;i<a;i+=1)C=bez.buildBezierData(P.v[i],P.v[i+1],[P.o[i][0]-P.v[i][0],P.o[i][1]-P.v[i][1]],[P.i[i+1][0]-P.v[i+1][0],P.i[i+1][1]-P.v[i+1][1]]),o.tLength+=C.segmentLength,o.segments.push(C),v+=C.segmentLength;i=a,E.v.c&&(C=bez.buildBezierData(P.v[i],P.v[0],[P.o[i][0]-P.v[i][0],P.o[i][1]-P.v[i][1]],[P.i[0][0]-P.v[0][0],P.i[0][1]-P.v[0][1]]),o.tLength+=C.segmentLength,o.segments.push(C),v+=C.segmentLength),this._pathData.pi=o}if(o=this._pathData.pi,s=this._pathData.f.v,p=0,u=1,c=0,d=!0,m=o.segments,s<0&&E.v.c)for(o.tLength<Math.abs(s)&&(s=-Math.abs(s)%o.tLength),u=(f=m[p=m.length-1].points).length-1;s<0;)s+=f[u].partialLength,(u-=1)<0&&(u=(f=m[p-=1].points).length-1);h=(f=m[p].points)[u-1],g=(l=f[u]).partialLength}a=I.length,r=0,n=0;var w,D,R,L,O,N=1.2*e.finalSize*.714,M=!0;R=S.length;var F,$,B,U,G,V,q,z,H,j,W,K,Y=-1,X=s,J=p,Q=u,Z=-1,ee="",te=this.defaultPropsArray;if(2===e.j||1===e.j){var re=0,ne=0,ie=2===e.j?-.5:-1,ae=0,oe=!0;for(i=0;i<a;i+=1)if(I[i].n){for(re&&(re+=ne);ae<i;)I[ae].animatorJustifyOffset=re,ae+=1;re=0,oe=!0}else{for(D=0;D<R;D+=1)(w=S[D].a).t.propType&&(oe&&2===e.j&&(ne+=w.t.v*ie),(O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars)).length?re+=w.t.v*O[0]*ie:re+=w.t.v*O*ie);oe=!1}for(re&&(re+=ne);ae<i;)I[ae].animatorJustifyOffset=re,ae+=1}for(i=0;i<a;i+=1){if(x.reset(),U=1,I[i].n)r=0,n+=e.yOffset,n+=M?1:0,s=X,M=!1,this._hasMaskedPath&&(u=Q,h=(f=m[p=J].points)[u-1],g=(l=f[u]).partialLength,c=0),ee="",W="",H="",K="",te=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Z!==I[i].line){switch(e.j){case 1:s+=v-e.lineWidths[I[i].line];break;case 2:s+=(v-e.lineWidths[I[i].line])/2}Z=I[i].line}Y!==I[i].ind&&(I[Y]&&(s+=I[Y].extra),s+=I[i].an/2,Y=I[i].ind),s+=_[0]*I[i].an*.005;var se=0;for(D=0;D<R;D+=1)(w=S[D].a).p.propType&&((O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars)).length?se+=w.p.v[0]*O[0]:se+=w.p.v[0]*O),w.a.propType&&((O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars)).length?se+=w.a.v[0]*O[0]:se+=w.a.v[0]*O);for(d=!0,this._pathData.a.v&&(s=.5*I[0].an+(v-this._pathData.f.v-.5*I[0].an-.5*I[I.length-1].an)*Y/(a-1),s+=this._pathData.f.v);d;)c+g>=s+se||!f?(y=(s+se-c)/l.partialLength,$=h.point[0]+(l.point[0]-h.point[0])*y,B=h.point[1]+(l.point[1]-h.point[1])*y,x.translate(-_[0]*I[i].an*.005,-_[1]*N*.01),d=!1):f&&(c+=l.partialLength,(u+=1)>=f.length&&(u=0,m[p+=1]?f=m[p].points:E.v.c?(u=0,f=m[p=0].points):(c-=l.partialLength,f=null)),f&&(h=l,g=(l=f[u]).partialLength));F=I[i].an/2-I[i].add,x.translate(-F,0,0)}else F=I[i].an/2-I[i].add,x.translate(-F,0,0),x.translate(-_[0]*I[i].an*.005,-_[1]*N*.01,0);for(D=0;D<R;D+=1)(w=S[D].a).t.propType&&(O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars),0===r&&0===e.j||(this._hasMaskedPath?O.length?s+=w.t.v*O[0]:s+=w.t.v*O:O.length?r+=w.t.v*O[0]:r+=w.t.v*O));for(e.strokeWidthAnim&&(V=e.sw||0),e.strokeColorAnim&&(G=e.sc?[e.sc[0],e.sc[1],e.sc[2]]:[0,0,0]),e.fillColorAnim&&e.fc&&(q=[e.fc[0],e.fc[1],e.fc[2]]),D=0;D<R;D+=1)(w=S[D].a).a.propType&&((O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars)).length?x.translate(-w.a.v[0]*O[0],-w.a.v[1]*O[1],w.a.v[2]*O[2]):x.translate(-w.a.v[0]*O,-w.a.v[1]*O,w.a.v[2]*O));for(D=0;D<R;D+=1)(w=S[D].a).s.propType&&((O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars)).length?x.scale(1+(w.s.v[0]-1)*O[0],1+(w.s.v[1]-1)*O[1],1):x.scale(1+(w.s.v[0]-1)*O,1+(w.s.v[1]-1)*O,1));for(D=0;D<R;D+=1){if(w=S[D].a,O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars),w.sk.propType&&(O.length?x.skewFromAxis(-w.sk.v*O[0],w.sa.v*O[1]):x.skewFromAxis(-w.sk.v*O,w.sa.v*O)),w.r.propType&&(O.length?x.rotateZ(-w.r.v*O[2]):x.rotateZ(-w.r.v*O)),w.ry.propType&&(O.length?x.rotateY(w.ry.v*O[1]):x.rotateY(w.ry.v*O)),w.rx.propType&&(O.length?x.rotateX(w.rx.v*O[0]):x.rotateX(w.rx.v*O)),w.o.propType&&(O.length?U+=(w.o.v*O[0]-U)*O[0]:U+=(w.o.v*O-U)*O),e.strokeWidthAnim&&w.sw.propType&&(O.length?V+=w.sw.v*O[0]:V+=w.sw.v*O),e.strokeColorAnim&&w.sc.propType)for(z=0;z<3;z+=1)O.length?G[z]+=(w.sc.v[z]-G[z])*O[0]:G[z]+=(w.sc.v[z]-G[z])*O;if(e.fillColorAnim&&e.fc){if(w.fc.propType)for(z=0;z<3;z+=1)O.length?q[z]+=(w.fc.v[z]-q[z])*O[0]:q[z]+=(w.fc.v[z]-q[z])*O;w.fh.propType&&(q=O.length?addHueToRGB(q,w.fh.v*O[0]):addHueToRGB(q,w.fh.v*O)),w.fs.propType&&(q=O.length?addSaturationToRGB(q,w.fs.v*O[0]):addSaturationToRGB(q,w.fs.v*O)),w.fb.propType&&(q=O.length?addBrightnessToRGB(q,w.fb.v*O[0]):addBrightnessToRGB(q,w.fb.v*O))}}for(D=0;D<R;D+=1)(w=S[D].a).p.propType&&(O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars),this._hasMaskedPath?O.length?x.translate(0,w.p.v[1]*O[0],-w.p.v[2]*O[1]):x.translate(0,w.p.v[1]*O,-w.p.v[2]*O):O.length?x.translate(w.p.v[0]*O[0],w.p.v[1]*O[1],-w.p.v[2]*O[2]):x.translate(w.p.v[0]*O,w.p.v[1]*O,-w.p.v[2]*O));if(e.strokeWidthAnim&&(H=V<0?0:V),e.strokeColorAnim&&(j="rgb("+Math.round(255*G[0])+","+Math.round(255*G[1])+","+Math.round(255*G[2])+")"),e.fillColorAnim&&e.fc&&(W="rgb("+Math.round(255*q[0])+","+Math.round(255*q[1])+","+Math.round(255*q[2])+")"),this._hasMaskedPath){if(x.translate(0,-e.ls),x.translate(0,_[1]*N*.01+n,0),this._pathData.p.v){b=(l.point[1]-h.point[1])/(l.point[0]-h.point[0]);var le=180*Math.atan(b)/Math.PI;l.point[0]<h.point[0]&&(le+=180),x.rotate(-le*Math.PI/180)}x.translate($,B,0),s-=_[0]*I[i].an*.005,I[i+1]&&Y!==I[i+1].ind&&(s+=I[i].an/2,s+=.001*e.tr*e.finalSize)}else{switch(x.translate(r,n,0),e.ps&&x.translate(e.ps[0],e.ps[1]+e.ascent,0),e.j){case 1:x.translate(I[i].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[I[i].line]),0,0);break;case 2:x.translate(I[i].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[I[i].line])/2,0,0)}x.translate(0,-e.ls),x.translate(F,0,0),x.translate(_[0]*I[i].an*.005,_[1]*N*.01,0),r+=I[i].l+.001*e.tr*e.finalSize}"html"===k?ee=x.toCSS():"svg"===k?ee=x.to2dCSS():te=[x.props[0],x.props[1],x.props[2],x.props[3],x.props[4],x.props[5],x.props[6],x.props[7],x.props[8],x.props[9],x.props[10],x.props[11],x.props[12],x.props[13],x.props[14],x.props[15]],K=U}A<=i?(L=new LetterProps(K,H,j,W,ee,te),this.renderedLetters.push(L),A+=1,this.lettersChangedFlag=!0):(L=this.renderedLetters[i],this.lettersChangedFlag=L.update(K,H,j,W,ee,te)||this.lettersChangedFlag)}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),ITextElement.prototype.initElement=function(e,t,r){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(e,t,r),this.textProperty=new TextProperty(this,e.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(e.t,this.renderType,this),this.initTransform(e,t,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange)},ITextElement.prototype.createPathShape=function(e,t){var r,n,i=t.length,a="";for(r=0;r<i;r+=1)"sh"===t[r].ty&&(n=t[r].ks.k,a+=buildShapeString(n,n.i.length,!0,e));return a},ITextElement.prototype.updateDocumentData=function(e,t){this.textProperty.updateDocumentData(e,t)},ITextElement.prototype.canResizeFont=function(e){this.textProperty.canResizeFont(e)},ITextElement.prototype.setMinimumFontSize=function(e){this.textProperty.setMinimumFontSize(e)},ITextElement.prototype.applyTextPropertiesToMatrix=function(e,t,r,n,i){switch(e.ps&&t.translate(e.ps[0],e.ps[1]+e.ascent,0),t.translate(0,-e.ls,0),e.j){case 1:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[r]),0,0);break;case 2:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[r])/2,0,0)}t.translate(n,i,0)},ITextElement.prototype.buildColor=function(e){return"rgb("+Math.round(255*e[0])+","+Math.round(255*e[1])+","+Math.round(255*e[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},ITextElement.prototype.validateText=function(){(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)};var emptyShapeData={shapes:[]};function SVGTextLottieElement(e,t,r){this.textSpans=[],this.renderType="svg",this.initElement(e,t,r)}function ISolidElement(e,t,r){this.initElement(e,t,r)}function NullElement(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initFrame(),this.initTransform(e,t,r),this.initHierarchy()}function SVGRendererBase(){}function ICompElement(){}function SVGCompElement(e,t,r){this.layers=e.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(e,t,r),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function SVGRenderer(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var r="";if(t&&t.title){var n=createNS("title"),i=createElementID();n.setAttribute("id",i),n.textContent=t.title,this.svgElement.appendChild(n),r+=i}if(t&&t.description){var a=createNS("desc"),o=createElementID();a.setAttribute("id",o),a.textContent=t.description,this.svgElement.appendChild(a),r+=" "+o}r&&this.svgElement.setAttribute("aria-labelledby",r);var s=createNS("defs");this.svgElement.appendChild(s);var l=createNS("g");this.svgElement.appendChild(l),this.layerElement=l,this.renderConfig={preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",progressiveLoad:t&&t.progressiveLoad||!1,hideOnTransparent:!(t&&!1===t.hideOnTransparent),viewBoxOnly:t&&t.viewBoxOnly||!1,viewBoxSize:t&&t.viewBoxSize||!1,className:t&&t.className||"",id:t&&t.id||"",focusable:t&&t.focusable,filterSize:{width:t&&t.filterSize&&t.filterSize.width||"100%",height:t&&t.filterSize&&t.filterSize.height||"100%",x:t&&t.filterSize&&t.filterSize.x||"0%",y:t&&t.filterSize&&t.filterSize.y||"0%"},width:t&&t.width,height:t&&t.height,runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:s,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(e){for(var t=0,r=e.length,n=[],i="";t<r;)e[t]===String.fromCharCode(13)||e[t]===String.fromCharCode(3)?(n.push(i),i=""):i+=e[t],t+=1;return n.push(i),n},SVGTextLottieElement.prototype.buildShapeData=function(e,t){if(e.shapes&&e.shapes.length){var r=e.shapes[0];if(r.it){var n=r.it[r.it.length-1];n.s&&(n.s.k[0]=t,n.s.k[1]=t)}}return e},SVGTextLottieElement.prototype.buildNewText=function(){var e,t;this.addDynamicProperty(this);var r=this.textProperty.currentData;this.renderedLetters=createSizedArray(r?r.l.length:0),r.fc?this.layerElement.setAttribute("fill",this.buildColor(r.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),r.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(r.sc)),this.layerElement.setAttribute("stroke-width",r.sw)),this.layerElement.setAttribute("font-size",r.finalSize);var n=this.globalData.fontManager.getFontByName(r.f);if(n.fClass)this.layerElement.setAttribute("class",n.fClass);else{this.layerElement.setAttribute("font-family",n.fFamily);var i=r.fWeight,a=r.fStyle;this.layerElement.setAttribute("font-style",a),this.layerElement.setAttribute("font-weight",i)}this.layerElement.setAttribute("aria-label",r.t);var o,s=r.l||[],l=!!this.globalData.fontManager.chars;t=s.length;var c=this.mHelper,d=this.data.singleShape,u=0,p=0,h=!0,f=.001*r.tr*r.finalSize;if(!d||l||r.sz){var m,g=this.textSpans.length;for(e=0;e<t;e+=1){if(this.textSpans[e]||(this.textSpans[e]={span:null,childSpan:null,glyph:null}),!l||!d||0===e){if(o=g>e?this.textSpans[e].span:createNS(l?"g":"text"),g<=e){if(o.setAttribute("stroke-linecap","butt"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("stroke-miterlimit","4"),this.textSpans[e].span=o,l){var v=createNS("g");o.appendChild(v),this.textSpans[e].childSpan=v}this.textSpans[e].span=o,this.layerElement.appendChild(o)}o.style.display="inherit"}if(c.reset(),d&&(s[e].n&&(u=-f,p+=r.yOffset,p+=h?1:0,h=!1),this.applyTextPropertiesToMatrix(r,c,s[e].line,u,p),u+=s[e].l||0,u+=f),l){var y;if(1===(m=this.globalData.fontManager.getCharData(r.finalText[e],n.fStyle,this.globalData.fontManager.getFontByName(r.f).fFamily)).t)y=new SVGCompElement(m.data,this.globalData,this);else{var b=emptyShapeData;m.data&&m.data.shapes&&(b=this.buildShapeData(m.data,r.finalSize)),y=new SVGShapeElement(b,this.globalData,this)}if(this.textSpans[e].glyph){var E=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(E.layerElement),E.destroy()}this.textSpans[e].glyph=y,y._debug=!0,y.prepareFrame(0),y.renderFrame(),this.textSpans[e].childSpan.appendChild(y.layerElement),1===m.t&&this.textSpans[e].childSpan.setAttribute("transform","scale("+r.finalSize/100+","+r.finalSize/100+")")}else d&&o.setAttribute("transform","translate("+c.props[12]+","+c.props[13]+")"),o.textContent=s[e].val,o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}d&&o&&o.setAttribute("d","")}else{var _=this.textContainer,S="start";switch(r.j){case 1:S="end";break;case 2:S="middle";break;default:S="start"}_.setAttribute("text-anchor",S),_.setAttribute("letter-spacing",f);var T=this.buildTextContents(r.finalText);for(t=T.length,p=r.ps?r.ps[1]+r.ascent:0,e=0;e<t;e+=1)(o=this.textSpans[e].span||createNS("tspan")).textContent=T[e],o.setAttribute("x",0),o.setAttribute("y",p),o.style.display="inherit",_.appendChild(o),this.textSpans[e]||(this.textSpans[e]={span:null,glyph:null}),this.textSpans[e].span=o,p+=r.finalLineHeight;this.layerElement.appendChild(_)}for(;e<this.textSpans.length;)this.textSpans[e].span.style.display="none",e+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},SVGTextLottieElement.prototype.getValue=function(){var e,t,r=this.textSpans.length;for(this.renderedFrame=this.comp.renderedFrame,e=0;e<r;e+=1)(t=this.textSpans[e].glyph)&&(t.prepareFrame(this.comp.renderedFrame-this.data.st),t._mdf&&(this._mdf=!0))},SVGTextLottieElement.prototype.renderInnerContent=function(){if(this.validateText(),(!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var e,t;this._sizeChanged=!0;var r,n,i,a=this.textAnimator.renderedLetters,o=this.textProperty.currentData.l;for(t=o.length,e=0;e<t;e+=1)o[e].n||(r=a[e],n=this.textSpans[e].span,(i=this.textSpans[e].glyph)&&i.renderFrame(),r._mdf.m&&n.setAttribute("transform",r.m),r._mdf.o&&n.setAttribute("opacity",r.o),r._mdf.sw&&n.setAttribute("stroke-width",r.sw),r._mdf.sc&&n.setAttribute("stroke",r.sc),r._mdf.fc&&n.setAttribute("fill",r.fc))}},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var e=createNS("rect");e.setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.layerElement.appendChild(e)},NullElement.prototype.prepareFrame=function(e){this.prepareProperties(e,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),extendPrototype([BaseRenderer],SVGRendererBase),SVGRendererBase.prototype.createNull=function(e){return new NullElement(e,this.globalData,this)},SVGRendererBase.prototype.createShape=function(e){return new SVGShapeElement(e,this.globalData,this)},SVGRendererBase.prototype.createText=function(e){return new SVGTextLottieElement(e,this.globalData,this)},SVGRendererBase.prototype.createImage=function(e){return new IImageElement(e,this.globalData,this)},SVGRendererBase.prototype.createSolid=function(e){return new ISolidElement(e,this.globalData,this)},SVGRendererBase.prototype.configAnimation=function(e){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+e.w+" "+e.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",e.w),this.svgElement.setAttribute("height",e.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var t=this.globalData.defs;this.setupGlobalData(e,t),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=e;var r=createNS("clipPath"),n=createNS("rect");n.setAttribute("width",e.w),n.setAttribute("height",e.h),n.setAttribute("x",0),n.setAttribute("y",0);var i=createElementID();r.setAttribute("id",i),r.appendChild(n),this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")"),t.appendChild(r),this.layers=e.layers,this.elements=createSizedArray(e.layers.length)},SVGRendererBase.prototype.destroy=function(){var e;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t=this.layers?this.layers.length:0;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRendererBase.prototype.updateContainerSize=function(){},SVGRendererBase.prototype.findIndexByInd=function(e){var t=0,r=this.layers.length;for(t=0;t<r;t+=1)if(this.layers[t].ind===e)return t;return-1},SVGRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){t[e]=!0;var r=this.createItem(this.layers[e]);if(t[e]=r,getExpressionsPlugin()&&(0===this.layers[e].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,e),this.layers[e].tt){var n="tp"in this.layers[e]?this.findIndexByInd(this.layers[e].tp):e-1;if(-1===n)return;if(this.elements[n]&&!0!==this.elements[n]){var i=t[n].getMatte(this.layers[e].tt);r.setMatte(i)}else this.buildItem(n),this.addPendingElement(r)}}},SVGRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var e=this.pendingElements.pop();if(e.checkParenting(),e.data.tt)for(var t=0,r=this.elements.length;t<r;){if(this.elements[t]===e){var n="tp"in e.data?this.findIndexByInd(e.data.tp):t-1,i=this.elements[n].getMatte(this.layers[t].tt);e.setMatte(i);break}t+=1}}},SVGRendererBase.prototype.renderFrame=function(e){if(this.renderedFrame!==e&&!this.destroyed){var t;null===e?e=this.renderedFrame:this.renderedFrame=e,this.globalData.frameNum=e,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=e,this.globalData._mdf=!1;var r=this.layers.length;for(this.completeLayers||this.checkLayers(e),t=r-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t<r;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()}},SVGRendererBase.prototype.appendElementInPos=function(e,t){var r=e.getBaseElement();if(r){for(var n,i=0;i<t;)this.elements[i]&&!0!==this.elements[i]&&this.elements[i].getBaseElement()&&(n=this.elements[i].getBaseElement()),i+=1;n?this.layerElement.insertBefore(r,n):this.layerElement.appendChild(r)}},SVGRendererBase.prototype.hide=function(){this.layerElement.style.display="none"},SVGRendererBase.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initTransform(e,t,r),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&t.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(e){if(this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=e/this.data.sr;else{var t=this.tm.v;t===this.data.op&&(t=this.data.op-1),this.renderedFrame=t}var r,n=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=n-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},ICompElement.prototype.setElements=function(e){this.elements=e},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([SVGRendererBase,ICompElement,SVGBaseElement],SVGCompElement),SVGCompElement.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},extendPrototype([SVGRendererBase],SVGRenderer),SVGRenderer.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},ShapeTransformManager.prototype={addTransformSequence:function(e){var t,r=e.length,n="_";for(t=0;t<r;t+=1)n+=e[t].transform.key+"_";var i=this.sequences[n];return i||(i={transforms:[].concat(e),finalTransform:new Matrix,_mdf:!1},this.sequences[n]=i,this.sequenceList.push(i)),i},processSequence:function(e,t){for(var r=0,n=e.transforms.length,i=t;r<n&&!t;){if(e.transforms[r].transform.mProps._mdf){i=!0;break}r+=1}if(i)for(e.finalTransform.reset(),r=n-1;r>=0;r-=1)e.finalTransform.multiply(e.transforms[r].transform.mProps.v);e._mdf=i},processSequences:function(e){var t,r=this.sequenceList.length;for(t=0;t<r;t+=1)this.processSequence(this.sequenceList[t],e)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}};var lumaLoader=function(){var e="__lottie_element_luma_buffer",t=null,r=null,n=null;function i(){var i,a,o;t||(i=createNS("svg"),a=createNS("filter"),o=createNS("feColorMatrix"),a.setAttribute("id",e),o.setAttribute("type","matrix"),o.setAttribute("color-interpolation-filters","sRGB"),o.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),a.appendChild(o),i.appendChild(a),i.setAttribute("id",e+"_svg"),featureSupport.svgLumaHidden&&(i.style.display="none"),n=i,document.body.appendChild(n),t=createTag("canvas"),(r=t.getContext("2d")).filter="url(#"+e+")",r.fillStyle="rgba(0,0,0,0)",r.fillRect(0,0,1,1))}return{load:i,get:function(n){return t||i(),t.width=n.width,t.height=n.height,r.filter="url(#"+e+")",t}}};function createCanvas(e,t){if(featureSupport.offscreenCanvas)return new OffscreenCanvas(e,t);var r=createTag("canvas");return r.width=e,r.height=t,r}var assetLoader={loadLumaCanvas:lumaLoader.load,getLumaCanvas:lumaLoader.get,createCanvas:createCanvas},registeredEffects={};function CVEffects(e){var t,r,n=e.data.ef?e.data.ef.length:0;for(this.filters=[],t=0;t<n;t+=1){r=null;var i=e.data.ef[t].ty;registeredEffects[i]&&(r=new(0,registeredEffects[i].effect)(e.effectsManager.effectElements[t],e)),r&&this.filters.push(r)}this.filters.length&&e.addRenderableComponent(this)}function registerEffect(e,t){registeredEffects[e]={effect:t}}function CVMaskElement(e,t){var r;this.data=e,this.element=t,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var n=this.masksProperties.length,i=!1;for(r=0;r<n;r+=1)"n"!==this.masksProperties[r].mode&&(i=!0),this.viewData[r]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[r],3);this.hasMasks=i,i&&this.element.addRenderableComponent(this)}function CVBaseElement(){}CVEffects.prototype.renderFrame=function(e){var t,r=this.filters.length;for(t=0;t<r;t+=1)this.filters[t].renderFrame(e)},CVEffects.prototype.getEffects=function(e){var t,r=this.filters.length,n=[];for(t=0;t<r;t+=1)this.filters[t].type===e&&n.push(this.filters[t]);return n},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var e,t,r,n,i=this.element.finalTransform.mat,a=this.element.canvasContext,o=this.masksProperties.length;for(a.beginPath(),e=0;e<o;e+=1)if("n"!==this.masksProperties[e].mode){var s;this.masksProperties[e].inv&&(a.moveTo(0,0),a.lineTo(this.element.globalData.compSize.w,0),a.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),a.lineTo(0,this.element.globalData.compSize.h),a.lineTo(0,0)),n=this.viewData[e].v,t=i.applyToPointArray(n.v[0][0],n.v[0][1],0),a.moveTo(t[0],t[1]);var l=n._length;for(s=1;s<l;s+=1)r=i.applyToTriplePoints(n.o[s-1],n.i[s],n.v[s]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);r=i.applyToTriplePoints(n.o[s-1],n.i[0],n.v[0]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5])}this.element.globalData.renderer.save(!0),a.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null};var operationsMap={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};function CVShapeData(e,t,r,n){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var i,a=4;"rc"===t.ty?a=5:"el"===t.ty?a=6:"sr"===t.ty&&(a=7),this.sh=ShapePropertyFactory.getShapeProp(e,t,a,e);var o,s=r.length;for(i=0;i<s;i+=1)r[i].closed||(o={transforms:n.addTransformSequence(r[i].transforms),trNodes:[]},this.styledShapes.push(o),r[i].elements.push(o))}function CVShapeElement(e,t,r){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(e,t,r)}function CVTextElement(e,t,r){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(e,t,r)}function CVImageElement(e,t,r){this.assetData=t.getAssetData(e.refId),this.img=t.imageLoader.getAsset(this.assetData),this.initElement(e,t,r)}function CVSolidElement(e,t,r){this.initElement(e,t,r)}function CanvasRendererBase(){}function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){var e;for(this.stack=[],this.cArrPos=0,this.cTr=new Matrix,e=0;e<15;e+=1){var t=new CanvasContext;this.stack[e]=t}this._length=15,this.nativeContext=null,this.transformMat=new Matrix,this.currentOpacity=1,this.currentFillStyle="",this.appliedFillStyle="",this.currentStrokeStyle="",this.appliedStrokeStyle="",this.currentLineWidth="",this.appliedLineWidth="",this.currentLineCap="",this.appliedLineCap="",this.currentLineJoin="",this.appliedLineJoin="",this.appliedMiterLimit="",this.currentMiterLimit=""}function CVCompElement(e,t,r){this.completeLayers=!1,this.layers=e.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(e,t,r),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function CanvasRenderer(e,t){this.animationItem=e,this.renderConfig={clearCanvas:!t||void 0===t.clearCanvas||t.clearCanvas,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",className:t&&t.className||"",id:t&&t.id||"",runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}function HBaseElement(){}function HSolidElement(e,t,r){this.initElement(e,t,r)}function HShapeElement(e,t,r){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(e,t,r),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(e,t,r){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(e,t,r)}function HCameraElement(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initHierarchy();var n=PropertyFactory.getProp;if(this.pe=n(this,e.pe,0,0,this),e.ks.p.s?(this.px=n(this,e.ks.p.x,1,0,this),this.py=n(this,e.ks.p.y,1,0,this),this.pz=n(this,e.ks.p.z,1,0,this)):this.p=n(this,e.ks.p,1,0,this),e.ks.a&&(this.a=n(this,e.ks.a,1,0,this)),e.ks.or.k.length&&e.ks.or.k[0].to){var i,a=e.ks.or.k.length;for(i=0;i<a;i+=1)e.ks.or.k[i].to=null,e.ks.or.k[i].ti=null}this.or=n(this,e.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=n(this,e.ks.rx,0,degToRads,this),this.ry=n(this,e.ks.ry,0,degToRads,this),this.rz=n(this,e.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}function HImageElement(e,t,r){this.assetData=t.getAssetData(e.refId),this.initElement(e,t,r)}function HybridRendererBase(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:t&&t.className||"",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(t&&!1===t.hideOnTransparent),filterSize:{width:t&&t.filterSize&&t.filterSize.width||"400%",height:t&&t.filterSize&&t.filterSize.height||"400%",x:t&&t.filterSize&&t.filterSize.x||"-100%",y:t&&t.filterSize&&t.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function HCompElement(e,t,r){this.layers=e.layers,this.supports3d=!e.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(e,t,r),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function HybridRenderer(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:t&&t.className||"",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(t&&!1===t.hideOnTransparent),filterSize:{width:t&&t.filterSize&&t.filterSize.width||"400%",height:t&&t.filterSize&&t.filterSize.height||"400%",x:t&&t.filterSize&&t.filterSize.x||"-100%",y:t&&t.filterSize&&t.filterSize.y||"-100%"},runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){if(this.data.tt>=1){this.buffers=[];var e=this.globalData.canvasContext,t=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var r=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(r),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=getBlendMode(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0].getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext("2d");if(this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var r=assetLoader.getLumaCanvas(this.canvasContext.canvas);r.getContext("2d").drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(r,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(e){if(!this.hidden&&!this.data.hd&&(1!==this.data.td||e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var t=0===this.data.ty;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(e,t){var r={data:e,type:e.ty,preTransforms:this.transformsManager.addTransformSequence(t),transforms:[],elements:[],closed:!0===e.hd},n={};if("fl"===e.ty||"st"===e.ty?(n.c=PropertyFactory.getProp(this,e.c,1,255,this),n.c.k||(r.co="rgb("+bmFloor(n.c.v[0])+","+bmFloor(n.c.v[1])+","+bmFloor(n.c.v[2])+")")):"gf"!==e.ty&&"gs"!==e.ty||(n.s=PropertyFactory.getProp(this,e.s,1,null,this),n.e=PropertyFactory.getProp(this,e.e,1,null,this),n.h=PropertyFactory.getProp(this,e.h||{k:0},0,.01,this),n.a=PropertyFactory.getProp(this,e.a||{k:0},0,degToRads,this),n.g=new GradientProperty(this,e.g,this)),n.o=PropertyFactory.getProp(this,e.o,0,.01,this),"st"===e.ty||"gs"===e.ty){if(r.lc=lineCapEnum[e.lc||2],r.lj=lineJoinEnum[e.lj||2],1==e.lj&&(r.ml=e.ml),n.w=PropertyFactory.getProp(this,e.w,0,null,this),n.w.k||(r.wi=n.w.v),e.d){var i=new DashProperty(this,e.d,"canvas",this);n.d=i,n.d.k||(r.da=n.d.dashArray,r.do=n.d.dashoffset[0])}}else r.r=2===e.r?"evenodd":"nonzero";return this.stylesList.push(r),n.style=r,n},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(e){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,e.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,e,this)}}},CVShapeElement.prototype.createShapeElement=function(e){var t=new CVShapeData(this,e,this.stylesList,this.transformsManager);return this.shapes.push(t),this.addShapeToModifiers(t),t},CVShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(e){var t,r=this.stylesList.length;for(t=0;t<r;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.push(e)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var e,t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.pop()},CVShapeElement.prototype.closeStyles=function(e){var t,r=e.length;for(t=0;t<r;t+=1)e[t].closed=!0},CVShapeElement.prototype.searchShapes=function(e,t,r,n,i){var a,o,s,l,c,d,u=e.length-1,p=[],h=[],f=[].concat(i);for(a=u;a>=0;a-=1){if((l=this.searchProcessedElement(e[a]))?t[a]=r[l-1]:e[a]._shouldRender=n,"fl"===e[a].ty||"st"===e[a].ty||"gf"===e[a].ty||"gs"===e[a].ty)l?t[a].style.closed=!1:t[a]=this.createStyleElement(e[a],f),p.push(t[a].style);else if("gr"===e[a].ty){if(l)for(s=t[a].it.length,o=0;o<s;o+=1)t[a].prevViewData[o]=t[a].it[o];else t[a]=this.createGroupElement(e[a]);this.searchShapes(e[a].it,t[a].it,t[a].prevViewData,n,f)}else"tr"===e[a].ty?(l||(d=this.createTransformElement(e[a]),t[a]=d),f.push(t[a]),this.addTransformToStyleList(t[a])):"sh"===e[a].ty||"rc"===e[a].ty||"el"===e[a].ty||"sr"===e[a].ty?l||(t[a]=this.createShapeElement(e[a])):"tm"===e[a].ty||"rd"===e[a].ty||"pb"===e[a].ty||"zz"===e[a].ty||"op"===e[a].ty?(l?(c=t[a]).closed=!1:((c=ShapeModifiers.getModifier(e[a].ty)).init(this,e[a]),t[a]=c,this.shapeModifiers.push(c)),h.push(c)):"rp"===e[a].ty&&(l?(c=t[a]).closed=!0:(c=ShapeModifiers.getModifier(e[a].ty),t[a]=c,c.init(this,e,a,t),this.shapeModifiers.push(c),n=!1),h.push(c));this.addProcessedElement(e[a],a+1)}for(this.removeTransformFromStyleList(),this.closeStyles(p),u=h.length,a=0;a<u;a+=1)h[a].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(e,t){(e._opMdf||t.op._mdf||this._isFirstFrame)&&(t.opacity=e.opacity,t.opacity*=t.op.v,t._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var e,t,r,n,i,a,o,s,l,c=this.stylesList.length,d=this.globalData.renderer,u=this.globalData.canvasContext;for(e=0;e<c;e+=1)if(("st"!==(s=(l=this.stylesList[e]).type)&&"gs"!==s||0!==l.wi)&&l.data._shouldRender&&0!==l.coOp&&0!==this.globalData.currentGlobalAlpha){for(d.save(),a=l.elements,"st"===s||"gs"===s?(d.ctxStrokeStyle("st"===s?l.co:l.grd),d.ctxLineWidth(l.wi),d.ctxLineCap(l.lc),d.ctxLineJoin(l.lj),d.ctxMiterLimit(l.ml||0)):d.ctxFillStyle("fl"===s?l.co:l.grd),d.ctxOpacity(l.coOp),"st"!==s&&"gs"!==s&&u.beginPath(),d.ctxTransform(l.preTransforms.finalTransform.props),r=a.length,t=0;t<r;t+=1){for("st"!==s&&"gs"!==s||(u.beginPath(),l.da&&(u.setLineDash(l.da),u.lineDashOffset=l.do)),i=(o=a[t].trNodes).length,n=0;n<i;n+=1)"m"===o[n].t?u.moveTo(o[n].p[0],o[n].p[1]):"c"===o[n].t?u.bezierCurveTo(o[n].pts[0],o[n].pts[1],o[n].pts[2],o[n].pts[3],o[n].pts[4],o[n].pts[5]):u.closePath();"st"!==s&&"gs"!==s||(d.ctxStroke(),l.da&&u.setLineDash(this.dashResetter))}"st"!==s&&"gs"!==s&&this.globalData.renderer.ctxFill(l.r),d.restore()}},CVShapeElement.prototype.renderShape=function(e,t,r,n){var i,a;for(a=e,i=t.length-1;i>=0;i-=1)"tr"===t[i].ty?(a=r[i].transform,this.renderShapeTransform(e,a)):"sh"===t[i].ty||"el"===t[i].ty||"rc"===t[i].ty||"sr"===t[i].ty?this.renderPath(t[i],r[i]):"fl"===t[i].ty?this.renderFill(t[i],r[i],a):"st"===t[i].ty?this.renderStroke(t[i],r[i],a):"gf"===t[i].ty||"gs"===t[i].ty?this.renderGradientFill(t[i],r[i],a):"gr"===t[i].ty?this.renderShape(a,t[i].it,r[i].it):t[i].ty;n&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var r,n,i,a=e.trNodes,o=t.paths,s=o._length;a.length=0;var l=e.transforms.finalTransform;for(i=0;i<s;i+=1){var c=o.shapes[i];if(c&&c.v){for(n=c._length,r=1;r<n;r+=1)1===r&&a.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),a.push({t:"c",pts:l.applyToTriplePoints(c.o[r-1],c.i[r],c.v[r])});1===n&&a.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),c.c&&n&&(a.push({t:"c",pts:l.applyToTriplePoints(c.o[r-1],c.i[0],c.v[0])}),a.push({t:"z"}))}}e.trNodes=a}},CVShapeElement.prototype.renderPath=function(e,t){if(!0!==e.hd&&e._shouldRender){var r,n=t.styledShapes.length;for(r=0;r<n;r+=1)this.renderStyledShape(t.styledShapes[r],t.sh)}},CVShapeElement.prototype.renderFill=function(e,t,r){var n=t.style;(t.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r._opMdf||this._isFirstFrame)&&(n.coOp=t.o.v*r.opacity)},CVShapeElement.prototype.renderGradientFill=function(e,t,r){var n,i=t.style;if(!i.grd||t.g._mdf||t.s._mdf||t.e._mdf||1!==e.t&&(t.h._mdf||t.a._mdf)){var a,o=this.globalData.canvasContext,s=t.s.v,l=t.e.v;if(1===e.t)n=o.createLinearGradient(s[0],s[1],l[0],l[1]);else{var c=Math.sqrt(Math.pow(s[0]-l[0],2)+Math.pow(s[1]-l[1],2)),d=Math.atan2(l[1]-s[1],l[0]-s[0]),u=t.h.v;u>=1?u=.99:u<=-1&&(u=-.99);var p=c*u,h=Math.cos(d+t.a.v)*p+s[0],f=Math.sin(d+t.a.v)*p+s[1];n=o.createRadialGradient(h,f,0,s[0],s[1],c)}var m=e.g.p,g=t.g.c,v=1;for(a=0;a<m;a+=1)t.g._hasOpacity&&t.g._collapsable&&(v=t.g.o[2*a+1]),n.addColorStop(g[4*a]/100,"rgba("+g[4*a+1]+","+g[4*a+2]+","+g[4*a+3]+","+v+")");i.grd=n}i.coOp=t.o.v*r.opacity},CVShapeElement.prototype.renderStroke=function(e,t,r){var n=t.style,i=t.d;i&&(i._mdf||this._isFirstFrame)&&(n.da=i.dashArray,n.do=i.dashoffset[0]),(t.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r._opMdf||this._isFirstFrame)&&(n.coOp=t.o.v*r.opacity),(t.w._mdf||this._isFirstFrame)&&(n.wi=t.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var e=this.textProperty.currentData;this.renderedLetters=createSizedArray(e.l?e.l.length:0);var t=!1;e.fc?(t=!0,this.values.fill=this.buildColor(e.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=t;var r=!1;e.sc&&(r=!0,this.values.stroke=this.buildColor(e.sc),this.values.sWidth=e.sw);var n,i,a,o,s,l,c,d,u,p,h,f,m=this.globalData.fontManager.getFontByName(e.f),g=e.l,v=this.mHelper;this.stroke=r,this.values.fValue=e.finalSize+"px "+this.globalData.fontManager.getFontByName(e.f).fFamily,i=e.finalText.length;var y=this.data.singleShape,b=.001*e.tr*e.finalSize,E=0,_=0,S=!0,T=0;for(n=0;n<i;n+=1){o=(a=this.globalData.fontManager.getCharData(e.finalText[n],m.fStyle,this.globalData.fontManager.getFontByName(e.f).fFamily))&&a.data||{},v.reset(),y&&g[n].n&&(E=-b,_+=e.yOffset,_+=S?1:0,S=!1),u=(c=o.shapes?o.shapes[0].it:[]).length,v.scale(e.finalSize/100,e.finalSize/100),y&&this.applyTextPropertiesToMatrix(e,v,g[n].line,E,_),h=createSizedArray(u-1);var x=0;for(d=0;d<u;d+=1)if("sh"===c[d].ty){for(l=c[d].ks.k.i.length,p=c[d].ks.k,f=[],s=1;s<l;s+=1)1===s&&f.push(v.applyToX(p.v[0][0],p.v[0][1],0),v.applyToY(p.v[0][0],p.v[0][1],0)),f.push(v.applyToX(p.o[s-1][0],p.o[s-1][1],0),v.applyToY(p.o[s-1][0],p.o[s-1][1],0),v.applyToX(p.i[s][0],p.i[s][1],0),v.applyToY(p.i[s][0],p.i[s][1],0),v.applyToX(p.v[s][0],p.v[s][1],0),v.applyToY(p.v[s][0],p.v[s][1],0));f.push(v.applyToX(p.o[s-1][0],p.o[s-1][1],0),v.applyToY(p.o[s-1][0],p.o[s-1][1],0),v.applyToX(p.i[0][0],p.i[0][1],0),v.applyToY(p.i[0][0],p.i[0][1],0),v.applyToX(p.v[0][0],p.v[0][1],0),v.applyToY(p.v[0][0],p.v[0][1],0)),h[x]=f,x+=1}y&&(E+=g[n].l,E+=b),this.textSpans[T]?this.textSpans[T].elem=h:this.textSpans[T]={elem:h},T+=1}},CVTextElement.prototype.renderInnerContent=function(){var e,t,r,n,i,a;this.validateText(),this.canvasContext.font=this.values.fValue,this.globalData.renderer.ctxLineCap("butt"),this.globalData.renderer.ctxLineJoin("miter"),this.globalData.renderer.ctxMiterLimit(4),this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var o,s=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;t=l.length;var c,d,u=null,p=null,h=null,f=this.globalData.renderer;for(e=0;e<t;e+=1)if(!l[e].n){if((o=s[e])&&(f.save(),f.ctxTransform(o.p),f.ctxOpacity(o.o)),this.fill){for(o&&o.fc?u!==o.fc&&(f.ctxFillStyle(o.fc),u=o.fc):u!==this.values.fill&&(u=this.values.fill,f.ctxFillStyle(this.values.fill)),n=(c=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<n;r+=1)for(a=(d=c[r]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),i=2;i<a;i+=6)this.globalData.canvasContext.bezierCurveTo(d[i],d[i+1],d[i+2],d[i+3],d[i+4],d[i+5]);this.globalData.canvasContext.closePath(),f.ctxFill()}if(this.stroke){for(o&&o.sw?h!==o.sw&&(h=o.sw,f.ctxLineWidth(o.sw)):h!==this.values.sWidth&&(h=this.values.sWidth,f.ctxLineWidth(this.values.sWidth)),o&&o.sc?p!==o.sc&&(p=o.sc,f.ctxStrokeStyle(o.sc)):p!==this.values.stroke&&(p=this.values.stroke,f.ctxStrokeStyle(this.values.stroke)),n=(c=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<n;r+=1)for(a=(d=c[r]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),i=2;i<a;i+=6)this.globalData.canvasContext.bezierCurveTo(d[i],d[i+1],d[i+2],d[i+3],d[i+4],d[i+5]);this.globalData.canvasContext.closePath(),f.ctxStroke()}o&&this.globalData.renderer.restore()}},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var e=createTag("canvas");e.width=this.assetData.w,e.height=this.assetData.h;var t,r,n=e.getContext("2d"),i=this.img.width,a=this.img.height,o=i/a,s=this.assetData.w/this.assetData.h,l=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;o>s&&"xMidYMid slice"===l||o<s&&"xMidYMid slice"!==l?t=(r=a)*s:r=(t=i)/s,n.drawImage(this.img,(i-t)/2,(a-r)/2,t,r,0,0,this.assetData.w,this.assetData.h),this.img=e}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){this.globalData.renderer.ctxFillStyle(this.data.sc),this.globalData.renderer.ctxFillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseRenderer],CanvasRendererBase),CanvasRendererBase.prototype.createShape=function(e){return new CVShapeElement(e,this.globalData,this)},CanvasRendererBase.prototype.createText=function(e){return new CVTextElement(e,this.globalData,this)},CanvasRendererBase.prototype.createImage=function(e){return new CVImageElement(e,this.globalData,this)},CanvasRendererBase.prototype.createSolid=function(e){return new CVSolidElement(e,this.globalData,this)},CanvasRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRendererBase.prototype.ctxTransform=function(e){1===e[0]&&0===e[1]&&0===e[4]&&1===e[5]&&0===e[12]&&0===e[13]||this.canvasContext.transform(e[0],e[1],e[4],e[5],e[12],e[13])},CanvasRendererBase.prototype.ctxOpacity=function(e){this.canvasContext.globalAlpha*=e<0?0:e},CanvasRendererBase.prototype.ctxFillStyle=function(e){this.canvasContext.fillStyle=e},CanvasRendererBase.prototype.ctxStrokeStyle=function(e){this.canvasContext.strokeStyle=e},CanvasRendererBase.prototype.ctxLineWidth=function(e){this.canvasContext.lineWidth=e},CanvasRendererBase.prototype.ctxLineCap=function(e){this.canvasContext.lineCap=e},CanvasRendererBase.prototype.ctxLineJoin=function(e){this.canvasContext.lineJoin=e},CanvasRendererBase.prototype.ctxMiterLimit=function(e){this.canvasContext.miterLimit=e},CanvasRendererBase.prototype.ctxFill=function(e){this.canvasContext.fill(e)},CanvasRendererBase.prototype.ctxFillRect=function(e,t,r,n){this.canvasContext.fillRect(e,t,r,n)},CanvasRendererBase.prototype.ctxStroke=function(){this.canvasContext.stroke()},CanvasRendererBase.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRendererBase.prototype.save=function(){this.canvasContext.save()},CanvasRendererBase.prototype.restore=function(e){this.renderConfig.clearCanvas?(e&&(this.globalData.blendMode="source-over"),this.contextData.restore(e)):this.canvasContext.restore()},CanvasRendererBase.prototype.configAnimation=function(e){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var t=this.animationItem.container.style;t.width="100%",t.height="100%";var r="0px 0px 0px";t.transformOrigin=r,t.mozTransformOrigin=r,t.webkitTransformOrigin=r,t["-webkit-transform"]=r,t.contentVisibility=this.renderConfig.contentVisibility,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.contextData.setContext(this.canvasContext),this.data=e,this.layers=e.layers,this.transformCanvas={w:e.w,h:e.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(e,document.body),this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(e.layers.length),this.updateContainerSize()},CanvasRendererBase.prototype.updateContainerSize=function(e,t){var r,n,i,a;if(this.reset(),e?(r=e,n=t,this.canvasContext.canvas.width=r,this.canvasContext.canvas.height=n):(this.animationItem.wrapper&&this.animationItem.container?(r=this.animationItem.wrapper.offsetWidth,n=this.animationItem.wrapper.offsetHeight):(r=this.canvasContext.canvas.width,n=this.canvasContext.canvas.height),this.canvasContext.canvas.width=r*this.renderConfig.dpr,this.canvasContext.canvas.height=n*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var o=this.renderConfig.preserveAspectRatio.split(" "),s=o[1]||"meet",l=o[0]||"xMidYMid",c=l.substr(0,4),d=l.substr(4);i=r/n,(a=this.transformCanvas.w/this.transformCanvas.h)>i&&"meet"===s||a<i&&"slice"===s?(this.transformCanvas.sx=r/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=r/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===c&&(a<i&&"meet"===s||a>i&&"slice"===s)?(r-this.transformCanvas.w*(n/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===c&&(a<i&&"meet"===s||a>i&&"slice"===s)?(r-this.transformCanvas.w*(n/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===d&&(a>i&&"meet"===s||a<i&&"slice"===s)?(n-this.transformCanvas.h*(r/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===d&&(a>i&&"meet"===s||a<i&&"slice"===s)?(n-this.transformCanvas.h*(r/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"===this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=r/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRendererBase.prototype.destroy=function(){var e;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),e=(this.layers?this.layers.length:0)-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(e,t){if((this.renderedFrame!==e||!0!==this.renderConfig.clearCanvas||t)&&!this.destroyed&&-1!==e){var r;this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var n=this.layers.length;for(this.completeLayers||this.checkLayers(e),r=n-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(e-this.layers[r].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),r=n-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){var r=this.createItem(this.layers[e],this,this.globalData);t[e]=r,r.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"},CVContextData.prototype.duplicate=function(){var e=2*this._length,t=0;for(t=this._length;t<e;t+=1)this.stack[t]=new CanvasContext;this._length=e},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.stack[this.cArrPos].opacity=1},CVContextData.prototype.restore=function(e){this.cArrPos-=1;var t,r=this.stack[this.cArrPos],n=r.transform,i=this.cTr.props;for(t=0;t<16;t+=1)i[t]=n[t];if(e){this.nativeContext.restore();var a=this.stack[this.cArrPos+1];this.appliedFillStyle=a.fillStyle,this.appliedStrokeStyle=a.strokeStyle,this.appliedLineWidth=a.lineWidth,this.appliedLineCap=a.lineCap,this.appliedLineJoin=a.lineJoin,this.appliedMiterLimit=a.miterLimit}this.nativeContext.setTransform(n[0],n[1],n[4],n[5],n[12],n[13]),(e||-1!==r.opacity&&this.currentOpacity!==r.opacity)&&(this.nativeContext.globalAlpha=r.opacity,this.currentOpacity=r.opacity),this.currentFillStyle=r.fillStyle,this.currentStrokeStyle=r.strokeStyle,this.currentLineWidth=r.lineWidth,this.currentLineCap=r.lineCap,this.currentLineJoin=r.lineJoin,this.currentMiterLimit=r.miterLimit},CVContextData.prototype.save=function(e){e&&this.nativeContext.save();var t=this.cTr.props;this._length<=this.cArrPos&&this.duplicate();var r,n=this.stack[this.cArrPos];for(r=0;r<16;r+=1)n.transform[r]=t[r];this.cArrPos+=1;var i=this.stack[this.cArrPos];i.opacity=n.opacity,i.fillStyle=n.fillStyle,i.strokeStyle=n.strokeStyle,i.lineWidth=n.lineWidth,i.lineCap=n.lineCap,i.lineJoin=n.lineJoin,i.miterLimit=n.miterLimit},CVContextData.prototype.setOpacity=function(e){this.stack[this.cArrPos].opacity=e},CVContextData.prototype.setContext=function(e){this.nativeContext=e},CVContextData.prototype.fillStyle=function(e){this.stack[this.cArrPos].fillStyle!==e&&(this.currentFillStyle=e,this.stack[this.cArrPos].fillStyle=e)},CVContextData.prototype.strokeStyle=function(e){this.stack[this.cArrPos].strokeStyle!==e&&(this.currentStrokeStyle=e,this.stack[this.cArrPos].strokeStyle=e)},CVContextData.prototype.lineWidth=function(e){this.stack[this.cArrPos].lineWidth!==e&&(this.currentLineWidth=e,this.stack[this.cArrPos].lineWidth=e)},CVContextData.prototype.lineCap=function(e){this.stack[this.cArrPos].lineCap!==e&&(this.currentLineCap=e,this.stack[this.cArrPos].lineCap=e)},CVContextData.prototype.lineJoin=function(e){this.stack[this.cArrPos].lineJoin!==e&&(this.currentLineJoin=e,this.stack[this.cArrPos].lineJoin=e)},CVContextData.prototype.miterLimit=function(e){this.stack[this.cArrPos].miterLimit!==e&&(this.currentMiterLimit=e,this.stack[this.cArrPos].miterLimit=e)},CVContextData.prototype.transform=function(e){this.transformMat.cloneFromProps(e);var t=this.cTr;this.transformMat.multiply(t),t.cloneFromProps(this.transformMat.props);var r=t.props;this.nativeContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13])},CVContextData.prototype.opacity=function(e){var t=this.stack[this.cArrPos].opacity;t*=e<0?0:e,this.stack[this.cArrPos].opacity!==t&&(this.currentOpacity!==e&&(this.nativeContext.globalAlpha=e,this.currentOpacity=e),this.stack[this.cArrPos].opacity=t)},CVContextData.prototype.fill=function(e){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fill(e)},CVContextData.prototype.fillRect=function(e,t,r,n){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fillRect(e,t,r,n)},CVContextData.prototype.stroke=function(){this.appliedStrokeStyle!==this.currentStrokeStyle&&(this.appliedStrokeStyle=this.currentStrokeStyle,this.nativeContext.strokeStyle=this.appliedStrokeStyle),this.appliedLineWidth!==this.currentLineWidth&&(this.appliedLineWidth=this.currentLineWidth,this.nativeContext.lineWidth=this.appliedLineWidth),this.appliedLineCap!==this.currentLineCap&&(this.appliedLineCap=this.currentLineCap,this.nativeContext.lineCap=this.appliedLineCap),this.appliedLineJoin!==this.currentLineJoin&&(this.appliedLineJoin=this.currentLineJoin,this.nativeContext.lineJoin=this.appliedLineJoin),this.appliedMiterLimit!==this.currentMiterLimit&&(this.appliedMiterLimit=this.currentMiterLimit,this.nativeContext.miterLimit=this.appliedMiterLimit),this.nativeContext.stroke()},extendPrototype([CanvasRendererBase,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var e,t=this.canvasContext;for(t.beginPath(),t.moveTo(0,0),t.lineTo(this.data.w,0),t.lineTo(this.data.w,this.data.h),t.lineTo(0,this.data.h),t.lineTo(0,0),t.clip(),e=this.layers.length-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},CVCompElement.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){var e=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var t=this.finalTransform.mat.toCSS();e.transform=t,e.webkitTransform=t}this.finalTransform._opMdf&&(e.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var e;this.data.hasMask?((e=createNS("rect")).setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((e=createTag("div")).style.width=this.data.sw+"px",e.style.height=this.data.sh+"px",e.style.backgroundColor=this.data.sc),this.layerElement.appendChild(e)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var e;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),e=this.svgElement;else{e=createNS("svg");var t=this.comp.data?this.comp.data:this.globalData.compSize;e.setAttribute("width",t.w),e.setAttribute("height",t.h),e.appendChild(this.shapesContainer),this.layerElement.appendChild(e)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=e},HShapeElement.prototype.getTransformedPoint=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)t=e[r].mProps.v.applyToPointArray(t[0],t[1],0);return t},HShapeElement.prototype.calculateShapeBoundingBox=function(e,t){var r,n,i,a,o,s=e.sh.v,l=e.transformers,c=s._length;if(!(c<=1)){for(r=0;r<c-1;r+=1)n=this.getTransformedPoint(l,s.v[r]),i=this.getTransformedPoint(l,s.o[r]),a=this.getTransformedPoint(l,s.i[r+1]),o=this.getTransformedPoint(l,s.v[r+1]),this.checkBounds(n,i,a,o,t);s.c&&(n=this.getTransformedPoint(l,s.v[r]),i=this.getTransformedPoint(l,s.o[r]),a=this.getTransformedPoint(l,s.i[0]),o=this.getTransformedPoint(l,s.v[0]),this.checkBounds(n,i,a,o,t))}},HShapeElement.prototype.checkBounds=function(e,t,r,n,i){this.getBoundsOfCurve(e,t,r,n);var a=this.shapeBoundingBox;i.x=bmMin(a.left,i.x),i.xMax=bmMax(a.right,i.xMax),i.y=bmMin(a.top,i.y),i.yMax=bmMax(a.bottom,i.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(e,t,r,n){for(var i,a,o,s,l,c,d,u=[[e[0],n[0]],[e[1],n[1]]],p=0;p<2;++p)a=6*e[p]-12*t[p]+6*r[p],i=-3*e[p]+9*t[p]-9*r[p]+3*n[p],o=3*t[p]-3*e[p],a|=0,o|=0,0==(i|=0)&&0===a||(0===i?(s=-o/a)>0&&s<1&&u[p].push(this.calculateF(s,e,t,r,n,p)):(l=a*a-4*o*i)>=0&&((c=(-a+bmSqrt(l))/(2*i))>0&&c<1&&u[p].push(this.calculateF(c,e,t,r,n,p)),(d=(-a-bmSqrt(l))/(2*i))>0&&d<1&&u[p].push(this.calculateF(d,e,t,r,n,p))));this.shapeBoundingBox.left=bmMin.apply(null,u[0]),this.shapeBoundingBox.top=bmMin.apply(null,u[1]),this.shapeBoundingBox.right=bmMax.apply(null,u[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,u[1])},HShapeElement.prototype.calculateF=function(e,t,r,n,i,a){return bmPow(1-e,3)*t[a]+3*bmPow(1-e,2)*e*r[a]+3*(1-e)*bmPow(e,2)*n[a]+bmPow(e,3)*i[a]},HShapeElement.prototype.calculateBoundingBox=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)e[r]&&e[r].sh?this.calculateShapeBoundingBox(e[r],t):e[r]&&e[r].it?this.calculateBoundingBox(e[r].it,t):e[r]&&e[r].style&&e[r].w&&this.expandStrokeBoundingBox(e[r].w,t)},HShapeElement.prototype.expandStrokeBoundingBox=function(e,t){var r=0;if(e.keyframes){for(var n=0;n<e.keyframes.length;n+=1){var i=e.keyframes[n].s;i>r&&(r=i)}r*=e.mult}else r=e.v*e.mult;t.x-=r,t.xMax+=r,t.y-=r,t.yMax+=r},HShapeElement.prototype.currentBoxContains=function(e){return this.currentBBox.x<=e.x&&this.currentBBox.y<=e.y&&this.currentBBox.width+this.currentBBox.x>=e.x+e.width&&this.currentBBox.height+this.currentBBox.y>=e.y+e.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var e=this.tempBoundingBox,t=999999;if(e.x=t,e.xMax=-t,e.y=t,e.yMax=-t,this.calculateBoundingBox(this.itemsData,e),e.width=e.xMax<e.x?0:e.xMax-e.x,e.height=e.yMax<e.y?0:e.yMax-e.y,this.currentBoxContains(e))return;var r=!1;if(this.currentBBox.w!==e.width&&(this.currentBBox.w=e.width,this.shapeCont.setAttribute("width",e.width),r=!0),this.currentBBox.h!==e.height&&(this.currentBBox.h=e.height,this.shapeCont.setAttribute("height",e.height),r=!0),r||this.currentBBox.x!==e.x||this.currentBBox.y!==e.y){this.currentBBox.w=e.width,this.currentBBox.h=e.height,this.currentBBox.x=e.x,this.currentBBox.y=e.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var n=this.shapeCont.style,i="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";n.transform=i,n.webkitTransform=i}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var e=createNS("g");this.maskedElement.appendChild(e),this.innerElem=e}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var e=this.textProperty.currentData;this.renderedLetters=createSizedArray(e.l?e.l.length:0);var t=this.innerElem.style,r=e.fc?this.buildColor(e.fc):"rgba(0,0,0,0)";t.fill=r,t.color=r,e.sc&&(t.stroke=this.buildColor(e.sc),t.strokeWidth=e.sw+"px");var n,i,a=this.globalData.fontManager.getFontByName(e.f);if(!this.globalData.fontManager.chars)if(t.fontSize=e.finalSize+"px",t.lineHeight=e.finalSize+"px",a.fClass)this.innerElem.className=a.fClass;else{t.fontFamily=a.fFamily;var o=e.fWeight,s=e.fStyle;t.fontStyle=s,t.fontWeight=o}var l,c,d,u=e.l;i=u.length;var p,h=this.mHelper,f="",m=0;for(n=0;n<i;n+=1){if(this.globalData.fontManager.chars?(this.textPaths[m]?l=this.textPaths[m]:((l=createNS("path")).setAttribute("stroke-linecap",lineCapEnum[1]),l.setAttribute("stroke-linejoin",lineJoinEnum[2]),l.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[m]?d=(c=this.textSpans[m]).children[0]:((c=createTag("div")).style.lineHeight=0,(d=createNS("svg")).appendChild(l),styleDiv(c)))):this.isMasked?l=this.textPaths[m]?this.textPaths[m]:createNS("text"):this.textSpans[m]?(c=this.textSpans[m],l=this.textPaths[m]):(styleDiv(c=createTag("span")),styleDiv(l=createTag("span")),c.appendChild(l)),this.globalData.fontManager.chars){var g,v=this.globalData.fontManager.getCharData(e.finalText[n],a.fStyle,this.globalData.fontManager.getFontByName(e.f).fFamily);if(g=v?v.data:null,h.reset(),g&&g.shapes&&g.shapes.length&&(p=g.shapes[0].it,h.scale(e.finalSize/100,e.finalSize/100),f=this.createPathShape(h,p),l.setAttribute("d",f)),this.isMasked)this.innerElem.appendChild(l);else{if(this.innerElem.appendChild(c),g&&g.shapes){document.body.appendChild(d);var y=d.getBBox();d.setAttribute("width",y.width+2),d.setAttribute("height",y.height+2),d.setAttribute("viewBox",y.x-1+" "+(y.y-1)+" "+(y.width+2)+" "+(y.height+2));var b=d.style,E="translate("+(y.x-1)+"px,"+(y.y-1)+"px)";b.transform=E,b.webkitTransform=E,u[n].yOffset=y.y-1}else d.setAttribute("width",1),d.setAttribute("height",1);c.appendChild(d)}}else if(l.textContent=u[n].val,l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(l);else{this.innerElem.appendChild(c);var _=l.style,S="translate3d(0,"+-e.finalSize/1.2+"px,0)";_.transform=S,_.webkitTransform=S}this.isMasked?this.textSpans[m]=l:this.textSpans[m]=c,this.textSpans[m].style.display="block",this.textPaths[m]=l,m+=1}for(;m<this.textSpans.length;)this.textSpans[m].style.display="none",m+=1},HTextElement.prototype.renderInnerContent=function(){var e;if(this.validateText(),this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),e=this.svgElement.style;var t="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";e.transform=t,e.webkitTransform=t}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var r,n,i,a,o,s=0,l=this.textAnimator.renderedLetters,c=this.textProperty.currentData.l;for(n=c.length,r=0;r<n;r+=1)c[r].n?s+=1:(a=this.textSpans[r],o=this.textPaths[r],i=l[s],s+=1,i._mdf.m&&(this.isMasked?a.setAttribute("transform",i.m):(a.style.webkitTransform=i.m,a.style.transform=i.m)),a.style.opacity=i.o,i.sw&&i._mdf.sw&&o.setAttribute("stroke-width",i.sw),i.sc&&i._mdf.sc&&o.setAttribute("stroke",i.sc),i.fc&&i._mdf.fc&&(o.setAttribute("fill",i.fc),o.style.color=i.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var d=this.innerElem.getBBox();if(this.currentBBox.w!==d.width&&(this.currentBBox.w=d.width,this.svgElement.setAttribute("width",d.width)),this.currentBBox.h!==d.height&&(this.currentBBox.h=d.height,this.svgElement.setAttribute("height",d.height)),this.currentBBox.w!==d.width+2||this.currentBBox.h!==d.height+2||this.currentBBox.x!==d.x-1||this.currentBBox.y!==d.y-1){this.currentBBox.w=d.width+2,this.currentBBox.h=d.height+2,this.currentBBox.x=d.x-1,this.currentBBox.y=d.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),e=this.svgElement.style;var u="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";e.transform=u,e.webkitTransform=u}}}},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var e,t,r,n,i=this.comp.threeDElements.length;for(e=0;e<i;e+=1)if("3d"===(t=this.comp.threeDElements[e]).type){r=t.perspectiveElem.style,n=t.container.style;var a=this.pe.v+"px",o="0px 0px 0px",s="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";r.perspective=a,r.webkitPerspective=a,n.transformOrigin=o,n.mozTransformOrigin=o,n.webkitTransformOrigin=o,r.transform=s,r.webkitTransform=s}},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var e,t,r=this._isFirstFrame;if(this.hierarchy)for(t=this.hierarchy.length,e=0;e<t;e+=1)r=this.hierarchy[e].finalTransform.mProp._mdf||r;if(r||this.pe._mdf||this.p&&this.p._mdf||this.px&&(this.px._mdf||this.py._mdf||this.pz._mdf)||this.rx._mdf||this.ry._mdf||this.rz._mdf||this.or._mdf||this.a&&this.a._mdf){if(this.mat.reset(),this.hierarchy)for(e=t=this.hierarchy.length-1;e>=0;e-=1){var n=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-n.p.v[0],-n.p.v[1],n.p.v[2]),this.mat.rotateX(-n.or.v[0]).rotateY(-n.or.v[1]).rotateZ(n.or.v[2]),this.mat.rotateX(-n.rx.v).rotateY(-n.ry.v).rotateZ(n.rz.v),this.mat.scale(1/n.s.v[0],1/n.s.v[1],1/n.s.v[2]),this.mat.translate(n.a.v[0],n.a.v[1],n.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var i;i=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2)+Math.pow(i[2],2)),o=[i[0]/a,i[1]/a,i[2]/a],s=Math.sqrt(o[2]*o[2]+o[0]*o[0]),l=Math.atan2(o[1],s),c=Math.atan2(o[0],-o[2]);this.mat.rotateY(c).rotateX(-l)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var d=!this._prevMat.equals(this.mat);if((d||this.pe._mdf)&&this.comp.threeDElements){var u,p,h;for(t=this.comp.threeDElements.length,e=0;e<t;e+=1)if("3d"===(u=this.comp.threeDElements[e]).type){if(d){var f=this.mat.toCSS();(h=u.container.style).transform=f,h.webkitTransform=f}this.pe._mdf&&((p=u.perspectiveElem.style).perspective=this.pe.v+"px",p.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(e){this.prepareProperties(e,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var e=this.globalData.getAssetsPath(this.assetData),t=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(t),t.crossOrigin="anonymous",t.src=e,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseRenderer],HybridRendererBase),HybridRendererBase.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},HybridRendererBase.prototype.appendElementInPos=function(e,t){var r=e.getBaseElement();if(r){var n=this.layers[t];if(n.ddd&&this.supports3d)this.addTo3dContainer(r,t);else if(this.threeDElements)this.addTo3dContainer(r,t);else{for(var i,a,o=0;o<t;)this.elements[o]&&!0!==this.elements[o]&&this.elements[o].getBaseElement&&(a=this.elements[o],i=(this.layers[o].ddd?this.getThreeDContainerByPos(o):a.getBaseElement())||i),o+=1;i?n.ddd&&this.supports3d||this.layerElement.insertBefore(r,i):n.ddd&&this.supports3d||this.layerElement.appendChild(r)}}},HybridRendererBase.prototype.createShape=function(e){return this.supports3d?new HShapeElement(e,this.globalData,this):new SVGShapeElement(e,this.globalData,this)},HybridRendererBase.prototype.createText=function(e){return this.supports3d?new HTextElement(e,this.globalData,this):new SVGTextLottieElement(e,this.globalData,this)},HybridRendererBase.prototype.createCamera=function(e){return this.camera=new HCameraElement(e,this.globalData,this),this.camera},HybridRendererBase.prototype.createImage=function(e){return this.supports3d?new HImageElement(e,this.globalData,this):new IImageElement(e,this.globalData,this)},HybridRendererBase.prototype.createSolid=function(e){return this.supports3d?new HSolidElement(e,this.globalData,this):new ISolidElement(e,this.globalData,this)},HybridRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,HybridRendererBase.prototype.getThreeDContainerByPos=function(e){for(var t=0,r=this.threeDElements.length;t<r;){if(this.threeDElements[t].startPos<=e&&this.threeDElements[t].endPos>=e)return this.threeDElements[t].perspectiveElem;t+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(e,t){var r,n,i=createTag("div");styleDiv(i);var a=createTag("div");if(styleDiv(a),"3d"===t){(r=i.style).width=this.globalData.compSize.w+"px",r.height=this.globalData.compSize.h+"px";var o="50% 50%";r.webkitTransformOrigin=o,r.mozTransformOrigin=o,r.transformOrigin=o;var s="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(n=a.style).transform=s,n.webkitTransform=s}i.appendChild(a);var l={container:a,perspectiveElem:i,startPos:e,endPos:e,type:t};return this.threeDElements.push(l),l},HybridRendererBase.prototype.build3dContainers=function(){var e,t,r=this.layers.length,n="";for(e=0;e<r;e+=1)this.layers[e].ddd&&3!==this.layers[e].ty?("3d"!==n&&(n="3d",t=this.createThreeDContainer(e,"3d")),t.endPos=Math.max(t.endPos,e)):("2d"!==n&&(n="2d",t=this.createThreeDContainer(e,"2d")),t.endPos=Math.max(t.endPos,e));for(e=(r=this.threeDElements.length)-1;e>=0;e-=1)this.resizerElem.appendChild(this.threeDElements[e].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(e,t){for(var r=0,n=this.threeDElements.length;r<n;){if(t<=this.threeDElements[r].endPos){for(var i,a=this.threeDElements[r].startPos;a<t;)this.elements[a]&&this.elements[a].getBaseElement&&(i=this.elements[a].getBaseElement()),a+=1;i?this.threeDElements[r].container.insertBefore(e,i):this.threeDElements[r].container.appendChild(e);break}r+=1}},HybridRendererBase.prototype.configAnimation=function(e){var t=createTag("div"),r=this.animationItem.wrapper,n=t.style;n.width=e.w+"px",n.height=e.h+"px",this.resizerElem=t,styleDiv(t),n.transformStyle="flat",n.mozTransformStyle="flat",n.webkitTransformStyle="flat",this.renderConfig.className&&t.setAttribute("class",this.renderConfig.className),r.appendChild(t),n.overflow="hidden";var i=createNS("svg");i.setAttribute("width","1"),i.setAttribute("height","1"),styleDiv(i),this.resizerElem.appendChild(i);var a=createNS("defs");i.appendChild(a),this.data=e,this.setupGlobalData(e,i),this.globalData.defs=a,this.layers=e.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRendererBase.prototype.destroy=function(){var e;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var t=this.layers?this.layers.length:0;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRendererBase.prototype.updateContainerSize=function(){var e,t,r,n,i=this.animationItem.wrapper.offsetWidth,a=this.animationItem.wrapper.offsetHeight,o=i/a;this.globalData.compSize.w/this.globalData.compSize.h>o?(e=i/this.globalData.compSize.w,t=i/this.globalData.compSize.w,r=0,n=(a-this.globalData.compSize.h*(i/this.globalData.compSize.w))/2):(e=a/this.globalData.compSize.h,t=a/this.globalData.compSize.h,r=(i-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,n=0);var s=this.resizerElem.style;s.webkitTransform="matrix3d("+e+",0,0,0,0,"+t+",0,0,0,0,1,0,"+r+","+n+",0,1)",s.transform=s.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var e,t=this.globalData.compSize.w,r=this.globalData.compSize.h,n=this.threeDElements.length;for(e=0;e<n;e+=1){var i=this.threeDElements[e].perspectiveElem.style;i.webkitPerspective=Math.sqrt(Math.pow(t,2)+Math.pow(r,2))+"px",i.perspective=i.webkitPerspective}}},HybridRendererBase.prototype.searchExtraCompositions=function(e){var t,r=e.length,n=createTag("div");for(t=0;t<r;t+=1)if(e[t].xt){var i=this.createComp(e[t],n,this.globalData.comp,null);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},extendPrototype([HybridRendererBase,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(e,t){for(var r,n=0;n<t;)this.elements[n]&&this.elements[n].getBaseElement&&(r=this.elements[n].getBaseElement()),n+=1;r?this.layerElement.insertBefore(e,r):this.layerElement.appendChild(e)},HCompElement.prototype.createComp=function(e){return this.supports3d?new HCompElement(e,this.globalData,this):new SVGCompElement(e,this.globalData,this)},extendPrototype([HybridRendererBase],HybridRenderer),HybridRenderer.prototype.createComp=function(e){return this.supports3d?new HCompElement(e,this.globalData,this):new SVGCompElement(e,this.globalData,this)};var CompExpressionInterface=function(e){function t(t){for(var r=0,n=e.layers.length;r<n;){if(e.layers[r].nm===t||e.layers[r].ind===t)return e.elements[r].layerInterface;r+=1}return null}return Object.defineProperty(t,"_name",{value:e.data.nm}),t.layer=t,t.pixelAspect=1,t.height=e.data.h||e.globalData.compSize.h,t.width=e.data.w||e.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/e.globalData.frameRate,t.displayStartTime=0,t.numLayers=e.layers.length,t};function _typeof$2(e){return _typeof$2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$2(e)}function seedRandom(e,t){var r=this,n=256,i="random",a=t.pow(n,6),o=t.pow(2,52),s=2*o,l=255;function c(e){var t,r=e.length,i=this,a=0,o=i.i=i.j=0,s=i.S=[];for(r||(e=[r++]);a<n;)s[a]=a++;for(a=0;a<n;a++)s[a]=s[o=l&o+e[a%r]+(t=s[a])],s[o]=t;i.g=function(e){for(var t,r=0,a=i.i,o=i.j,s=i.S;e--;)t=s[a=l&a+1],r=r*n+s[l&(s[a]=s[o=l&o+t])+(s[o]=t)];return i.i=a,i.j=o,r}}function d(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function u(e,t){var r,n=[],i=_typeof$2(e);if(t&&"object"==i)for(r in e)try{n.push(u(e[r],t-1))}catch(e){}return n.length?n:"string"==i?e:e+"\0"}function p(e,t){for(var r,n=e+"",i=0;i<n.length;)t[l&i]=l&(r^=19*t[l&i])+n.charCodeAt(i++);return h(t)}function h(e){return String.fromCharCode.apply(0,e)}t["seed"+i]=function(l,f,m){var g=[],v=p(u((f=!0===f?{entropy:!0}:f||{}).entropy?[l,h(e)]:null===l?function(){try{var t=new Uint8Array(n);return(r.crypto||r.msCrypto).getRandomValues(t),h(t)}catch(t){var i=r.navigator,a=i&&i.plugins;return[+new Date,r,a,r.screen,h(e)]}}():l,3),g),y=new c(g),b=function(){for(var e=y.g(6),t=a,r=0;e<o;)e=(e+r)*n,t*=n,r=y.g(1);for(;e>=s;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|y.g(4)},b.quick=function(){return y.g(4)/4294967296},b.double=b,p(h(y.S),e),(f.pass||m||function(e,r,n,a){return a&&(a.S&&d(a,y),e.state=function(){return d(y,{})}),n?(t[i]=e,r):e})(b,v,"global"in f?f.global:this==t,f.state)},p(t.random(),e)}function initialize$2(e){seedRandom([],e)}var propTypes={SHAPE:"shape"};function _typeof$1(e){return _typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$1(e)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null,_lottieGlobal={};function resetFrame(){_lottieGlobal={}}function $bm_isInstanceOfArray(e){return e.constructor===Array||e.constructor===Float32Array}function isNumerable(e,t){return"number"===e||t instanceof Number||"boolean"===e||"string"===e}function $bm_neg(e){var t=_typeof$1(e);if("number"===t||e instanceof Number||"boolean"===t)return-e;if($bm_isInstanceOfArray(e)){var r,n=e.length,i=[];for(r=0;r<n;r+=1)i[r]=-e[r];return i}return e.propType?e.v:-e}initialize$2(BMMath);var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(e,t){var r=_typeof$1(e),n=_typeof$1(t);if(isNumerable(r,e)&&isNumerable(n,t)||"string"===r||"string"===n)return e+t;if($bm_isInstanceOfArray(e)&&isNumerable(n,t))return(e=e.slice(0))[0]+=t,e;if(isNumerable(r,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e+t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var i=0,a=e.length,o=t.length,s=[];i<a||i<o;)("number"==typeof e[i]||e[i]instanceof Number)&&("number"==typeof t[i]||t[i]instanceof Number)?s[i]=e[i]+t[i]:s[i]=void 0===t[i]?e[i]:e[i]||t[i],i+=1;return s}return 0}var add=sum;function sub(e,t){var r=_typeof$1(e),n=_typeof$1(t);if(isNumerable(r,e)&&isNumerable(n,t))return"string"===r&&(e=parseInt(e,10)),"string"===n&&(t=parseInt(t,10)),e-t;if($bm_isInstanceOfArray(e)&&isNumerable(n,t))return(e=e.slice(0))[0]-=t,e;if(isNumerable(r,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e-t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var i=0,a=e.length,o=t.length,s=[];i<a||i<o;)("number"==typeof e[i]||e[i]instanceof Number)&&("number"==typeof t[i]||t[i]instanceof Number)?s[i]=e[i]-t[i]:s[i]=void 0===t[i]?e[i]:e[i]||t[i],i+=1;return s}return 0}function mul(e,t){var r,n,i,a=_typeof$1(e),o=_typeof$1(t);if(isNumerable(a,e)&&isNumerable(o,t))return e*t;if($bm_isInstanceOfArray(e)&&isNumerable(o,t)){for(i=e.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e[n]*t;return r}if(isNumerable(a,e)&&$bm_isInstanceOfArray(t)){for(i=t.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e*t[n];return r}return 0}function div(e,t){var r,n,i,a=_typeof$1(e),o=_typeof$1(t);if(isNumerable(a,e)&&isNumerable(o,t))return e/t;if($bm_isInstanceOfArray(e)&&isNumerable(o,t)){for(i=e.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e[n]/t;return r}if(isNumerable(a,e)&&$bm_isInstanceOfArray(t)){for(i=t.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e/t[n];return r}return 0}function mod(e,t){return"string"==typeof e&&(e=parseInt(e,10)),"string"==typeof t&&(t=parseInt(t,10)),e%t}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(e,t,r){if(t>r){var n=r;r=t,t=n}return Math.min(Math.max(e,t),r)}function radiansToDegrees(e){return e/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(e){return e*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(e,t){if("number"==typeof e||e instanceof Number)return t=t||0,Math.abs(e-t);var r;t||(t=helperLengthArray);var n=Math.min(e.length,t.length),i=0;for(r=0;r<n;r+=1)i+=Math.pow(t[r]-e[r],2);return Math.sqrt(i)}function normalize(e){return div(e,length(e))}function rgbToHsl(e){var t,r,n=e[0],i=e[1],a=e[2],o=Math.max(n,i,a),s=Math.min(n,i,a),l=(o+s)/2;if(o===s)t=0,r=0;else{var c=o-s;switch(r=l>.5?c/(2-o-s):c/(o+s),o){case n:t=(i-a)/c+(i<a?6:0);break;case i:t=(a-n)/c+2;break;case a:t=(n-i)/c+4}t/=6}return[t,r,l,e[3]]}function hue2rgb(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function hslToRgb(e){var t,r,n,i=e[0],a=e[1],o=e[2];if(0===a)t=o,n=o,r=o;else{var s=o<.5?o*(1+a):o+a-o*a,l=2*o-s;t=hue2rgb(l,s,i+1/3),r=hue2rgb(l,s,i),n=hue2rgb(l,s,i-1/3)}return[t,r,n,e[3]]}function linear(e,t,r,n,i){if(void 0!==n&&void 0!==i||(n=t,i=r,t=0,r=1),r<t){var a=r;r=t,t=a}if(e<=t)return n;if(e>=r)return i;var o,s=r===t?0:(e-t)/(r-t);if(!n.length)return n+(i-n)*s;var l=n.length,c=createTypedArray("float32",l);for(o=0;o<l;o+=1)c[o]=n[o]+(i[o]-n[o])*s;return c}function random(e,t){if(void 0===t&&(void 0===e?(e=0,t=1):(t=e,e=void 0)),t.length){var r,n=t.length;e||(e=createTypedArray("float32",n));var i=createTypedArray("float32",n),a=BMMath.random();for(r=0;r<n;r+=1)i[r]=e[r]+a*(t[r]-e[r]);return i}return void 0===e&&(e=0),e+BMMath.random()*(t-e)}function createPath(e,t,r,n){var i,a=e.length,o=shapePool.newElement();o.setPathData(!!n,a);var s,l,c=[0,0];for(i=0;i<a;i+=1)s=t&&t[i]?t[i]:c,l=r&&r[i]?r[i]:c,o.setTripleAt(e[i][0],e[i][1],l[0]+e[i][0],l[1]+e[i][1],s[0]+e[i][0],s[1]+e[i][1],i,!0);return o}function initiateExpression(elem,data,property){function noOp(e){return e}if(!elem.globalData.renderConfig.runExpressions)return noOp;var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty._name=elem.data.nm,thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(e,t){var r,n,i=this.pv.length?this.pv.length:1,a=createTypedArray("float32",i),o=Math.floor(5*time);for(r=0,n=0;r<o;){for(n=0;n<i;n+=1)a[n]+=-t+2*t*BMMath.random();r+=1}var s=5*time,l=s-Math.floor(s),c=createTypedArray("float32",i);if(i>1){for(n=0;n<i;n+=1)c[n]=this.pv[n]+a[n]+(-t+2*t*BMMath.random())*l;return c}return this.pv+a[0]+(-t+2*t*BMMath.random())*l}.bind(this);function loopInDuration(e,t){return loopIn(e,t,!0)}function loopOutDuration(e,t){return loopOut(e,t,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(e,t){var r=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],n=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads;return[-Math.atan2(r[1],r[2])/degToRads,n,0]}function easeOut(e,t,r,n,i){return applyEase(easeOutBez,e,t,r,n,i)}function easeIn(e,t,r,n,i){return applyEase(easeInBez,e,t,r,n,i)}function ease(e,t,r,n,i){return applyEase(easeInOutBez,e,t,r,n,i)}function applyEase(e,t,r,n,i,a){void 0===i?(i=r,a=n):t=(t-r)/(n-r),t>1?t=1:t<0&&(t=0);var o=e(t);if($bm_isInstanceOfArray(i)){var s,l=i.length,c=createTypedArray("float32",l);for(s=0;s<l;s+=1)c[s]=(a[s]-i[s])*o+i[s];return c}return(a-i)*o+i}function nearestKey(e){var t,r,n,i=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,(e*=elem.comp.globalData.frameRate)<data.k[0].t)r=1,n=data.k[0].t;else{for(t=0;t<i-1;t+=1){if(e===data.k[t].t){r=t+1,n=data.k[t].t;break}if(e>data.k[t].t&&e<data.k[t+1].t){e-data.k[t].t>data.k[t+1].t-e?(r=t+2,n=data.k[t+1].t):(r=t+1,n=data.k[t].t);break}}-1===r&&(r=t+1,n=data.k[t].t)}else r=0,n=0;var a={};return a.index=r,a.time=n/elem.comp.globalData.frameRate,a}function key(e){var t,r,n;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+e);e-=1,t={time:data.k[e].t/elem.comp.globalData.frameRate,value:[]};var i=Object.prototype.hasOwnProperty.call(data.k[e],"s")?data.k[e].s:data.k[e-1].e;for(n=i.length,r=0;r<n;r+=1)t[r]=i[r],t.value[r]=i[r];return t}function framesToTime(e,t){return t||(t=elem.comp.globalData.frameRate),e/t}function timeToFrames(e,t){return e||0===e||(e=time),t||(t=elem.comp.globalData.frameRate),e*t}function seedRandom(e){BMMath.seedrandom(randSeed+e)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(e,t){return"string"==typeof value?void 0===t?value.substring(e):value.substring(e,t):""}function substr(e,t){return"string"==typeof value?void 0===t?value.substr(e):value.substr(e,t):""}function posterizeTime(e){time=0===e?0:Math.floor(time*e)/e,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(e){return value=e,this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),$bm_transform=transform,transform&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,_needsRandom&&seedRandom(randSeed+time),needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,scoped_bm_rt=scoped_bm_rt.propType===propTypes.SHAPE?scoped_bm_rt.v:scoped_bm_rt)}return executeExpression.__preventDeadCodeRemoval=[$bm_transform,anchorPoint,time,velocity,inPoint,outPoint,width,height,name,loop_in,loop_out,smooth,toComp,fromCompToSurface,toWorld,fromWorld,mask,position,rotation,scale,thisComp,numKeys,active,wiggle,loopInDuration,loopOutDuration,comp,lookAt,easeOut,easeIn,ease,nearestKey,key,text,textIndex,textTotal,selectorValue,framesToTime,timeToFrames,sourceRectAtTime,substring,substr,posterizeTime,index,globalData],executeExpression}return ob.initiateExpression=initiateExpression,ob.__preventDeadCodeRemoval=[window,document,XMLHttpRequest,fetch,frames,$bm_neg,add,$bm_sum,$bm_sub,$bm_mul,$bm_div,$bm_mod,clamp,radians_to_degrees,degreesToRadians,degrees_to_radians,normalize,rgbToHsl,hslToRgb,linear,random,createPath,_lottieGlobal],ob.resetFrame=resetFrame,ob}(),Expressions=function(){var e={initExpressions:function(e){var t=0,r=[];e.renderer.compInterface=CompExpressionInterface(e.renderer),e.renderer.globalData.projectInterface.registerComposition(e.renderer),e.renderer.globalData.pushExpression=function(){t+=1},e.renderer.globalData.popExpression=function(){0==(t-=1)&&function(){var e,t=r.length;for(e=0;e<t;e+=1)r[e].release();r.length=0}()},e.renderer.globalData.registerExpressionProperty=function(e){-1===r.indexOf(e)&&r.push(e)}}};return e.resetFrame=ExpressionManager.resetFrame,e}(),MaskManagerInterface=function(){function e(e,t){this._mask=e,this._data=t}return Object.defineProperty(e.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(e.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}}),function(t){var r,n=createSizedArray(t.viewData.length),i=t.viewData.length;for(r=0;r<i;r+=1)n[r]=new e(t.viewData[r],t.masksProperties[r]);return function(e){for(r=0;r<i;){if(t.masksProperties[r].nm===e)return n[r];r+=1}return null}}}(),ExpressionPropertyInterface=function(){var e={pv:0,v:0,mult:1},t={pv:[0,0,0],v:[0,0,0],mult:1};function r(e,t,r){Object.defineProperty(e,"velocity",{get:function(){return t.getVelocityAtTime(t.comp.currentFrame)}}),e.numKeys=t.keyframes?t.keyframes.length:0,e.key=function(n){if(!e.numKeys)return 0;var i="";i="s"in t.keyframes[n-1]?t.keyframes[n-1].s:"e"in t.keyframes[n-2]?t.keyframes[n-2].e:t.keyframes[n-2].s;var a="unidimensional"===r?new Number(i):Object.assign({},i);return a.time=t.keyframes[n-1].t/t.elem.comp.globalData.frameRate,a.value="unidimensional"===r?i[0]:i,a},e.valueAtTime=t.getValueAtTime,e.speedAtTime=t.getSpeedAtTime,e.velocityAtTime=t.getVelocityAtTime,e.propertyGroup=t.propertyGroup}function n(){return e}return function(i){return i?"unidimensional"===i.propType?function(t){t&&"pv"in t||(t=e);var n=1/t.mult,i=t.pv*n,a=new Number(i);return a.value=i,r(a,t,"unidimensional"),function(){return t.k&&t.getValue(),i=t.v*n,a.value!==i&&((a=new Number(i)).value=i,a[0]=i,r(a,t,"unidimensional")),a}}(i):function(e){e&&"pv"in e||(e=t);var n=1/e.mult,i=e.data&&e.data.l||e.pv.length,a=createTypedArray("float32",i),o=createTypedArray("float32",i);return a.value=o,r(a,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)o[t]=e.v[t]*n,a[t]=o[t];return a}}(i):n}}(),TransformExpressionInterface=function(e){function t(e){switch(e){case"scale":case"Scale":case"ADBE Scale":case 6:return t.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return t.rotation;case"ADBE Rotate X":return t.xRotation;case"ADBE Rotate Y":return t.yRotation;case"position":case"Position":case"ADBE Position":case 2:return t.position;case"ADBE Position_0":return t.xPosition;case"ADBE Position_1":return t.yPosition;case"ADBE Position_2":return t.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return t.anchorPoint;case"opacity":case"Opacity":case 11:return t.opacity;default:return null}}var r,n,i,a;return Object.defineProperty(t,"rotation",{get:ExpressionPropertyInterface(e.r||e.rz)}),Object.defineProperty(t,"zRotation",{get:ExpressionPropertyInterface(e.rz||e.r)}),Object.defineProperty(t,"xRotation",{get:ExpressionPropertyInterface(e.rx)}),Object.defineProperty(t,"yRotation",{get:ExpressionPropertyInterface(e.ry)}),Object.defineProperty(t,"scale",{get:ExpressionPropertyInterface(e.s)}),e.p?a=ExpressionPropertyInterface(e.p):(r=ExpressionPropertyInterface(e.px),n=ExpressionPropertyInterface(e.py),e.pz&&(i=ExpressionPropertyInterface(e.pz))),Object.defineProperty(t,"position",{get:function(){return e.p?a():[r(),n(),i?i():0]}}),Object.defineProperty(t,"xPosition",{get:ExpressionPropertyInterface(e.px)}),Object.defineProperty(t,"yPosition",{get:ExpressionPropertyInterface(e.py)}),Object.defineProperty(t,"zPosition",{get:ExpressionPropertyInterface(e.pz)}),Object.defineProperty(t,"anchorPoint",{get:ExpressionPropertyInterface(e.a)}),Object.defineProperty(t,"opacity",{get:ExpressionPropertyInterface(e.o)}),Object.defineProperty(t,"skew",{get:ExpressionPropertyInterface(e.sk)}),Object.defineProperty(t,"skewAxis",{get:ExpressionPropertyInterface(e.sa)}),Object.defineProperty(t,"orientation",{get:ExpressionPropertyInterface(e.or)}),t},LayerExpressionInterface=function(){function e(e){var t=new Matrix;return void 0!==e?this._elem.finalTransform.mProp.getValueAtTime(e).clone(t):this._elem.finalTransform.mProp.applyToMatrix(t),t}function t(e,t){var r=this.getMatrix(t);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.applyPoint(r,e)}function r(e,t){var r=this.getMatrix(t);return this.applyPoint(r,e)}function n(e,t){var r=this.getMatrix(t);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.invertPoint(r,e)}function i(e,t){var r=this.getMatrix(t);return this.invertPoint(r,e)}function a(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,n=this._elem.hierarchy.length;for(r=0;r<n;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e)}return e.applyToPointArray(t[0],t[1],t[2]||0)}function o(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,n=this._elem.hierarchy.length;for(r=0;r<n;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e)}return e.inversePoint(t)}function s(e){var t=new Matrix;if(t.reset(),this._elem.finalTransform.mProp.applyToMatrix(t),this._elem.hierarchy&&this._elem.hierarchy.length){var r,n=this._elem.hierarchy.length;for(r=0;r<n;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t);return t.inversePoint(e)}return t.inversePoint(e)}function l(){return[1,1,1,1]}return function(c){var d;function u(e){switch(e){case"ADBE Root Vectors Group":case"Contents":case 2:return u.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return d;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return u.effect;case"ADBE Text Properties":return u.textInterface;default:return null}}u.getMatrix=e,u.invertPoint=o,u.applyPoint=a,u.toWorld=r,u.toWorldVec=t,u.fromWorld=i,u.fromWorldVec=n,u.toComp=r,u.fromComp=s,u.sampleImage=l,u.sourceRectAtTime=c.sourceRectAtTime.bind(c),u._elem=c;var p=getDescriptor(d=TransformExpressionInterface(c.finalTransform.mProp),"anchorPoint");return Object.defineProperties(u,{hasParent:{get:function(){return c.hierarchy.length}},parent:{get:function(){return c.hierarchy[0].layerInterface}},rotation:getDescriptor(d,"rotation"),scale:getDescriptor(d,"scale"),position:getDescriptor(d,"position"),opacity:getDescriptor(d,"opacity"),anchorPoint:p,anchor_point:p,transform:{get:function(){return d}},active:{get:function(){return c.isInRange}}}),u.startTime=c.data.st,u.index=c.data.ind,u.source=c.data.refId,u.height=0===c.data.ty?c.data.h:100,u.width=0===c.data.ty?c.data.w:100,u.inPoint=c.data.ip/c.comp.globalData.frameRate,u.outPoint=c.data.op/c.comp.globalData.frameRate,u._name=c.data.nm,u.registerMaskInterface=function(e){u.mask=new MaskManagerInterface(e,c)},u.registerEffectsInterface=function(e){u.effect=e},u}}(),propertyGroupFactory=function(e,t){return function(r){return(r=void 0===r?1:r)<=0?e:t(r-1)}},PropertyInterface=function(e,t){var r={_name:e};return function(e){return(e=void 0===e?1:e)<=0?r:t(e-1)}},EffectsExpressionInterface=function(){var e={createEffectsInterface:function(e,r){if(e.effectsManager){var n,i=[],a=e.data.ef,o=e.effectsManager.effectElements.length;for(n=0;n<o;n+=1)i.push(t(a[n],e.effectsManager.effectElements[n],r,e));var s=e.data.ef||[],l=function(e){for(n=0,o=s.length;n<o;){if(e===s[n].nm||e===s[n].mn||e===s[n].ix)return i[n];n+=1}return null};return Object.defineProperty(l,"numProperties",{get:function(){return s.length}}),l}return null}};function t(e,n,i,a){function o(t){for(var r=e.ef,n=0,i=r.length;n<i;){if(t===r[n].nm||t===r[n].mn||t===r[n].ix)return 5===r[n].ty?c[n]:c[n]();n+=1}throw new Error}var s,l=propertyGroupFactory(o,i),c=[],d=e.ef.length;for(s=0;s<d;s+=1)5===e.ef[s].ty?c.push(t(e.ef[s],n.effectElements[s],n.effectElements[s].propertyGroup,a)):c.push(r(n.effectElements[s],e.ef[s].ty,a,l));return"ADBE Color Control"===e.mn&&Object.defineProperty(o,"color",{get:function(){return c[0]()}}),Object.defineProperties(o,{numProperties:{get:function(){return e.np}},_name:{value:e.nm},propertyGroup:{value:l}}),o.enabled=0!==e.en,o.active=o.enabled,o}function r(e,t,r,n){var i=ExpressionPropertyInterface(e.p);return e.p.setGroupProperty&&e.p.setGroupProperty(PropertyInterface("",n)),function(){return 10===t?r.comp.compInterface(e.p.v):i()}}return e}(),ShapePathInterface=function(e,t,r){var n=t.sh;function i(e){return"Shape"===e||"shape"===e||"Path"===e||"path"===e||"ADBE Vector Shape"===e||2===e?i.path:null}var a=propertyGroupFactory(i,r);return n.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(i,{path:{get:function(){return n.k&&n.getValue(),n}},shape:{get:function(){return n.k&&n.getValue(),n}},_name:{value:e.nm},ix:{value:e.ix},propertyIndex:{value:e.ix},mn:{value:e.mn},propertyGroup:{value:r}}),i},ShapeExpressionInterface=function(){function e(e,o,p){var h,f=[],m=e?e.length:0;for(h=0;h<m;h+=1)"gr"===e[h].ty?f.push(t(e[h],o[h],p)):"fl"===e[h].ty?f.push(r(e[h],o[h],p)):"st"===e[h].ty?f.push(i(e[h],o[h],p)):"tm"===e[h].ty?f.push(a(e[h],o[h],p)):"tr"===e[h].ty||("el"===e[h].ty?f.push(s(e[h],o[h],p)):"sr"===e[h].ty?f.push(l(e[h],o[h],p)):"sh"===e[h].ty?f.push(ShapePathInterface(e[h],o[h],p)):"rc"===e[h].ty?f.push(c(e[h],o[h],p)):"rd"===e[h].ty?f.push(d(e[h],o[h],p)):"rp"===e[h].ty?f.push(u(e[h],o[h],p)):"gf"===e[h].ty?f.push(n(e[h],o[h],p)):f.push((e[h],o[h],function(){return null})));return f}function t(t,r,n){var i=function(e){switch(e){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,n);var a=function(t,r,n){var i,a=function(e){for(var t=0,r=i.length;t<r;){if(i[t]._name===e||i[t].mn===e||i[t].propertyIndex===e||i[t].ix===e||i[t].ind===e)return i[t];t+=1}return"number"==typeof e?i[e-1]:null};a.propertyGroup=propertyGroupFactory(a,n),i=e(t.it,r.it,a.propertyGroup),a.numProperties=i.length;var s=o(t.it[t.it.length-1],r.it[r.it.length-1],a.propertyGroup);return a.transform=s,a.propertyIndex=t.cix,a._name=t.nm,a}(t,r,i.propertyGroup),s=o(t.it[t.it.length-1],r.it[r.it.length-1],i.propertyGroup);return i.content=a,i.transform=s,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function r(e,t,r){function n(e){return"Color"===e||"color"===e?n.color:"Opacity"===e||"opacity"===e?n.opacity:null}return Object.defineProperties(n,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",r)),t.o.setGroupProperty(PropertyInterface("Opacity",r)),n}function n(e,t,r){function n(e){return"Start Point"===e||"start point"===e?n.startPoint:"End Point"===e||"end point"===e?n.endPoint:"Opacity"===e||"opacity"===e?n.opacity:null}return Object.defineProperties(n,{startPoint:{get:ExpressionPropertyInterface(t.s)},endPoint:{get:ExpressionPropertyInterface(t.e)},opacity:{get:ExpressionPropertyInterface(t.o)},type:{get:function(){return"a"}},_name:{value:e.nm},mn:{value:e.mn}}),t.s.setGroupProperty(PropertyInterface("Start Point",r)),t.e.setGroupProperty(PropertyInterface("End Point",r)),t.o.setGroupProperty(PropertyInterface("Opacity",r)),n}function i(e,t,r){var n,i=propertyGroupFactory(c,r),a=propertyGroupFactory(l,i);function o(r){Object.defineProperty(l,e.d[r].nm,{get:ExpressionPropertyInterface(t.d.dataProps[r].p)})}var s=e.d?e.d.length:0,l={};for(n=0;n<s;n+=1)o(n),t.d.dataProps[n].p.setGroupProperty(a);function c(e){return"Color"===e||"color"===e?c.color:"Opacity"===e||"opacity"===e?c.opacity:"Stroke Width"===e||"stroke width"===e?c.strokeWidth:null}return Object.defineProperties(c,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},strokeWidth:{get:ExpressionPropertyInterface(t.w)},dash:{get:function(){return l}},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",i)),t.o.setGroupProperty(PropertyInterface("Opacity",i)),t.w.setGroupProperty(PropertyInterface("Stroke Width",i)),c}function a(e,t,r){function n(t){return t===e.e.ix||"End"===t||"end"===t?n.end:t===e.s.ix?n.start:t===e.o.ix?n.offset:null}var i=propertyGroupFactory(n,r);return n.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",i)),t.e.setGroupProperty(PropertyInterface("End",i)),t.o.setGroupProperty(PropertyInterface("Offset",i)),n.propertyIndex=e.ix,n.propertyGroup=r,Object.defineProperties(n,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),n.mn=e.mn,n}function o(e,t,r){function n(t){return e.a.ix===t||"Anchor Point"===t?n.anchorPoint:e.o.ix===t||"Opacity"===t?n.opacity:e.p.ix===t||"Position"===t?n.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?n.rotation:e.s.ix===t||"Scale"===t?n.scale:e.sk&&e.sk.ix===t||"Skew"===t?n.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?n.skewAxis:null}var i=propertyGroupFactory(n,r);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",i)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",i)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",i)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",i)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",i)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",i)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",i))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",i)),Object.defineProperties(n,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),n.ty="tr",n.mn=e.mn,n.propertyGroup=r,n}function s(e,t,r){function n(t){return e.p.ix===t?n.position:e.s.ix===t?n.size:null}var i=propertyGroupFactory(n,r);n.propertyIndex=e.ix;var a="tm"===t.sh.ty?t.sh.prop:t.sh;return a.s.setGroupProperty(PropertyInterface("Size",i)),a.p.setGroupProperty(PropertyInterface("Position",i)),Object.defineProperties(n,{size:{get:ExpressionPropertyInterface(a.s)},position:{get:ExpressionPropertyInterface(a.p)},_name:{value:e.nm}}),n.mn=e.mn,n}function l(e,t,r){function n(t){return e.p.ix===t?n.position:e.r.ix===t?n.rotation:e.pt.ix===t?n.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?n.outerRadius:e.os.ix===t?n.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?n.innerRoundness:null:n.innerRadius}var i=propertyGroupFactory(n,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return n.propertyIndex=e.ix,a.or.setGroupProperty(PropertyInterface("Outer Radius",i)),a.os.setGroupProperty(PropertyInterface("Outer Roundness",i)),a.pt.setGroupProperty(PropertyInterface("Points",i)),a.p.setGroupProperty(PropertyInterface("Position",i)),a.r.setGroupProperty(PropertyInterface("Rotation",i)),e.ir&&(a.ir.setGroupProperty(PropertyInterface("Inner Radius",i)),a.is.setGroupProperty(PropertyInterface("Inner Roundness",i))),Object.defineProperties(n,{position:{get:ExpressionPropertyInterface(a.p)},rotation:{get:ExpressionPropertyInterface(a.r)},points:{get:ExpressionPropertyInterface(a.pt)},outerRadius:{get:ExpressionPropertyInterface(a.or)},outerRoundness:{get:ExpressionPropertyInterface(a.os)},innerRadius:{get:ExpressionPropertyInterface(a.ir)},innerRoundness:{get:ExpressionPropertyInterface(a.is)},_name:{value:e.nm}}),n.mn=e.mn,n}function c(e,t,r){function n(t){return e.p.ix===t?n.position:e.r.ix===t?n.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?n.size:null}var i=propertyGroupFactory(n,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return n.propertyIndex=e.ix,a.p.setGroupProperty(PropertyInterface("Position",i)),a.s.setGroupProperty(PropertyInterface("Size",i)),a.r.setGroupProperty(PropertyInterface("Rotation",i)),Object.defineProperties(n,{position:{get:ExpressionPropertyInterface(a.p)},roundness:{get:ExpressionPropertyInterface(a.r)},size:{get:ExpressionPropertyInterface(a.s)},_name:{value:e.nm}}),n.mn=e.mn,n}function d(e,t,r){function n(t){return e.r.ix===t||"Round Corners 1"===t?n.radius:null}var i=propertyGroupFactory(n,r),a=t;return n.propertyIndex=e.ix,a.rd.setGroupProperty(PropertyInterface("Radius",i)),Object.defineProperties(n,{radius:{get:ExpressionPropertyInterface(a.rd)},_name:{value:e.nm}}),n.mn=e.mn,n}function u(e,t,r){function n(t){return e.c.ix===t||"Copies"===t?n.copies:e.o.ix===t||"Offset"===t?n.offset:null}var i=propertyGroupFactory(n,r),a=t;return n.propertyIndex=e.ix,a.c.setGroupProperty(PropertyInterface("Copies",i)),a.o.setGroupProperty(PropertyInterface("Offset",i)),Object.defineProperties(n,{copies:{get:ExpressionPropertyInterface(a.c)},offset:{get:ExpressionPropertyInterface(a.o)},_name:{value:e.nm}}),n.mn=e.mn,n}return function(t,r,n){var i;function a(e){if("number"==typeof e)return 0===(e=void 0===e?1:e)?n:i[e-1];for(var t=0,r=i.length;t<r;){if(i[t]._name===e)return i[t];t+=1}return null}return a.propertyGroup=propertyGroupFactory(a,(function(){return n})),i=e(t,r,a.propertyGroup),a.numProperties=i.length,a._name="Contents",a}}(),TextExpressionInterface=function(e){var t;function r(e){return"ADBE Text Document"===e?r.sourceText:null}return Object.defineProperty(r,"sourceText",{get:function(){e.textProperty.getValue();var r=e.textProperty.currentData.t;return t&&r===t.value||((t=new String(r)).value=r||new String(r),Object.defineProperty(t,"style",{get:function(){return{fillColor:e.textProperty.currentData.fc}}})),t}}),r};function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}var FootageInterface=(dataInterfaceFactory=function(e){function t(e){return"Outline"===e?t.outlineInterface():null}return t._name="Outline",t.outlineInterface=function(e){var t="",r=e.getFootageData();function n(e){if(r[e])return t=e,"object"===_typeof(r=r[e])?n:r;var i=e.indexOf(t);if(-1!==i){var a=parseInt(e.substr(i+t.length),10);return"object"===_typeof(r=r[a])?n:r}return""}return function(){return t="",r=e.getFootageData(),n}}(e),t},function(e){function t(e){return"Data"===e?t.dataInterface:null}return t._name="Data",t.dataInterface=dataInterfaceFactory(e),t}),dataInterfaceFactory,interfaces={layer:LayerExpressionInterface,effects:EffectsExpressionInterface,comp:CompExpressionInterface,shape:ShapeExpressionInterface,text:TextExpressionInterface,footage:FootageInterface};function getInterface(e){return interfaces[e]||null}var expressionHelpers={searchExpressions:function(e,t,r){t.x&&(r.k=!0,r.x=!0,r.initiateExpression=ExpressionManager.initiateExpression,r.effectsSequence.push(r.initiateExpression(e,t,r).bind(r)))},getSpeedAtTime:function(e){var t=this.getValueAtTime(e),r=this.getValueAtTime(e+-.01),n=0;if(t.length){var i;for(i=0;i<t.length;i+=1)n+=Math.pow(r[i]-t[i],2);n=100*Math.sqrt(n)}else n=0;return n},getVelocityAtTime:function(e){if(void 0!==this.vel)return this.vel;var t,r,n=-.001,i=this.getValueAtTime(e),a=this.getValueAtTime(e+n);if(i.length)for(t=createTypedArray("float32",i.length),r=0;r<i.length;r+=1)t[r]=(a[r]-i[r])/n;else t=(a-i)/n;return t},getValueAtTime:function(e){return e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<e?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(e,this._cachingAtTime),this._cachingAtTime.lastFrame=e),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(e){this.propertyGroup=e}};function addPropertyDecorator(){function e(e,t,r){if(!this.k||!this.keyframes)return this.pv;e=e?e.toLowerCase():"";var n,i,a,o,s,l=this.comp.renderedFrame,c=this.keyframes,d=c[c.length-1].t;if(l<=d)return this.pv;if(r?i=d-(n=t?Math.abs(d-this.elem.comp.globalData.frameRate*t):Math.max(0,d-this.elem.data.ip)):((!t||t>c.length-1)&&(t=c.length-1),n=d-(i=c[c.length-1-t].t)),"pingpong"===e){if(Math.floor((l-i)/n)%2!=0)return this.getValueAtTime((n-(l-i)%n+i)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var u=this.getValueAtTime(i/this.comp.globalData.frameRate,0),p=this.getValueAtTime(d/this.comp.globalData.frameRate,0),h=this.getValueAtTime(((l-i)%n+i)/this.comp.globalData.frameRate,0),f=Math.floor((l-i)/n);if(this.pv.length){for(o=(s=new Array(u.length)).length,a=0;a<o;a+=1)s[a]=(p[a]-u[a])*f+h[a];return s}return(p-u)*f+h}if("continue"===e){var m=this.getValueAtTime(d/this.comp.globalData.frameRate,0),g=this.getValueAtTime((d-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(o=(s=new Array(m.length)).length,a=0;a<o;a+=1)s[a]=m[a]+(m[a]-g[a])*((l-d)/this.comp.globalData.frameRate)/5e-4;return s}return m+(l-d)/.001*(m-g)}}return this.getValueAtTime(((l-i)%n+i)/this.comp.globalData.frameRate,0)}function t(e,t,r){if(!this.k)return this.pv;e=e?e.toLowerCase():"";var n,i,a,o,s,l=this.comp.renderedFrame,c=this.keyframes,d=c[0].t;if(l>=d)return this.pv;if(r?i=d+(n=t?Math.abs(this.elem.comp.globalData.frameRate*t):Math.max(0,this.elem.data.op-d)):((!t||t>c.length-1)&&(t=c.length-1),n=(i=c[t].t)-d),"pingpong"===e){if(Math.floor((d-l)/n)%2==0)return this.getValueAtTime(((d-l)%n+d)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var u=this.getValueAtTime(d/this.comp.globalData.frameRate,0),p=this.getValueAtTime(i/this.comp.globalData.frameRate,0),h=this.getValueAtTime((n-(d-l)%n+d)/this.comp.globalData.frameRate,0),f=Math.floor((d-l)/n)+1;if(this.pv.length){for(o=(s=new Array(u.length)).length,a=0;a<o;a+=1)s[a]=h[a]-(p[a]-u[a])*f;return s}return h-(p-u)*f}if("continue"===e){var m=this.getValueAtTime(d/this.comp.globalData.frameRate,0),g=this.getValueAtTime((d+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(o=(s=new Array(m.length)).length,a=0;a<o;a+=1)s[a]=m[a]+(m[a]-g[a])*(d-l)/.001;return s}return m+(m-g)*(d-l)/.001}}return this.getValueAtTime((n-((d-l)%n+d))/this.comp.globalData.frameRate,0)}function r(e,t){if(!this.k)return this.pv;if(e=.5*(e||.4),(t=Math.floor(t||5))<=1)return this.pv;var r,n,i=this.comp.renderedFrame/this.comp.globalData.frameRate,a=i-e,o=t>1?(i+e-a)/(t-1):1,s=0,l=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;s<t;){if(n=this.getValueAtTime(a+s*o),this.pv.length)for(l=0;l<this.pv.length;l+=1)r[l]+=n[l];else r+=n;s+=1}if(this.pv.length)for(l=0;l<this.pv.length;l+=1)r[l]/=t;else r/=t;return r}function n(e){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var t=this._transformCachingAtTime.v;if(t.cloneFromProps(this.pre.props),this.appliedTransformations<1){var r=this.a.getValueAtTime(e);t.translate(-r[0]*this.a.mult,-r[1]*this.a.mult,r[2]*this.a.mult)}if(this.appliedTransformations<2){var n=this.s.getValueAtTime(e);t.scale(n[0]*this.s.mult,n[1]*this.s.mult,n[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var i=this.sk.getValueAtTime(e),a=this.sa.getValueAtTime(e);t.skewFromAxis(-i*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var o=this.r.getValueAtTime(e);t.rotate(-o*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var s=this.rz.getValueAtTime(e),l=this.ry.getValueAtTime(e),c=this.rx.getValueAtTime(e),d=this.or.getValueAtTime(e);t.rotateZ(-s*this.rz.mult).rotateY(l*this.ry.mult).rotateX(c*this.rx.mult).rotateZ(-d[2]*this.or.mult).rotateY(d[1]*this.or.mult).rotateX(d[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var u=this.px.getValueAtTime(e),p=this.py.getValueAtTime(e);if(this.data.p.z){var h=this.pz.getValueAtTime(e);t.translate(u*this.px.mult,p*this.py.mult,-h*this.pz.mult)}else t.translate(u*this.px.mult,p*this.py.mult,0)}else{var f=this.p.getValueAtTime(e);t.translate(f[0]*this.p.mult,f[1]*this.p.mult,-f[2]*this.p.mult)}return t}function i(){return this.v.clone(new Matrix)}var a=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(e,t,r){var o=a(e,t,r);return o.dynamicProperties.length?o.getValueAtTime=n.bind(o):o.getValueAtTime=i.bind(o),o.setGroupProperty=expressionHelpers.setGroupProperty,o};var o=PropertyFactory.getProp;PropertyFactory.getProp=function(n,i,a,s,l){var c=o(n,i,a,s,l);c.kf?c.getValueAtTime=expressionHelpers.getValueAtTime.bind(c):c.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(c),c.setGroupProperty=expressionHelpers.setGroupProperty,c.loopOut=e,c.loopIn=t,c.smooth=r,c.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(c),c.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(c),c.numKeys=1===i.a?i.k.length:0,c.propertyIndex=i.ix;var d=0;return 0!==a&&(d=createTypedArray("float32",1===i.a?i.k[0].s.length:i.k.length)),c._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:d},expressionHelpers.searchExpressions(n,i,c),c.k&&l.addDynamicProperty(c),c};var s=ShapePropertyFactory.getConstructorFunction(),l=ShapePropertyFactory.getKeyframedConstructorFunction();function c(){}c.prototype={vertices:function(e,t){this.k&&this.getValue();var r,n=this.v;void 0!==t&&(n=this.getValueAtTime(t,0));var i=n._length,a=n[e],o=n.v,s=createSizedArray(i);for(r=0;r<i;r+=1)s[r]="i"===e||"o"===e?[a[r][0]-o[r][0],a[r][1]-o[r][1]]:[a[r][0],a[r][1]];return s},points:function(e){return this.vertices("v",e)},inTangents:function(e){return this.vertices("i",e)},outTangents:function(e){return this.vertices("o",e)},isClosed:function(){return this.v.c},pointOnPath:function(e,t){var r=this.v;void 0!==t&&(r=this.getValueAtTime(t,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(r));for(var n,i=this._segmentsLength,a=i.lengths,o=i.totalLength*e,s=0,l=a.length,c=0;s<l;){if(c+a[s].addedLength>o){var d=s,u=r.c&&s===l-1?0:s+1,p=(o-c)/a[s].addedLength;n=bez.getPointInSegment(r.v[d],r.v[u],r.o[d],r.i[u],p,a[s]);break}c+=a[s].addedLength,s+=1}return n||(n=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),n},vectorOnPath:function(e,t,r){1==e?e=this.v.c:0==e&&(e=.999);var n=this.pointOnPath(e,t),i=this.pointOnPath(e+.001,t),a=i[0]-n[0],o=i[1]-n[1],s=Math.sqrt(Math.pow(a,2)+Math.pow(o,2));return 0===s?[0,0]:"tangent"===r?[a/s,o/s]:[-o/s,a/s]},tangentOnPath:function(e,t){return this.vectorOnPath(e,t,"tangent")},normalOnPath:function(e,t){return this.vectorOnPath(e,t,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([c],s),extendPrototype([c],l),l.prototype.getValueAtTime=function(e){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<e?this._caching.lastIndex:0,this._cachingAtTime.lastTime=e,this.interpolateShape(e,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},l.prototype.initiateExpression=ExpressionManager.initiateExpression;var d=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(e,t,r,n,i){var a=d(e,t,r,n,i);return a.propertyIndex=t.ix,a.lock=!1,3===r?expressionHelpers.searchExpressions(e,t.pt,a):4===r&&expressionHelpers.searchExpressions(e,t.ks,a),a.k&&e.addDynamicProperty(a),a}}function initialize$1(){addPropertyDecorator()}function addDecorator(){TextProperty.prototype.getExpressionValue=function(e,t){var r=this.calculateExpression(t);if(e.t!==r){var n={};return this.copyData(n,e),n.t=r.toString(),n.__complete=!1,n}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),t=this.searchExpressions();return this.kf=e||t,this.kf},TextProperty.prototype.searchExpressions=function(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function(e,t){var r,n,i=createNS("feMerge");for(i.setAttribute("result",e),n=0;n<t.length;n+=1)(r=createNS("feMergeNode")).setAttribute("in",t[n]),i.appendChild(r),i.appendChild(r);return i}};var linearFilterValue="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0";function SVGTintFilter(e,t,r,n,i){this.filterManager=t;var a=createNS("feColorMatrix");a.setAttribute("type","matrix"),a.setAttribute("color-interpolation-filters","linearRGB"),a.setAttribute("values",linearFilterValue+" 1 0"),this.linearFilter=a,a.setAttribute("result",n+"_tint_1"),e.appendChild(a),(a=createNS("feColorMatrix")).setAttribute("type","matrix"),a.setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),a.setAttribute("result",n+"_tint_2"),e.appendChild(a),this.matrixFilter=a;var o=this.createMergeNode(n,[i,n+"_tint_1",n+"_tint_2"]);e.appendChild(o)}function SVGFillFilter(e,t,r,n){this.filterManager=t;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),i.setAttribute("result",n),e.appendChild(i),this.matrixFilter=i}function SVGStrokeEffect(e,t,r){this.initialized=!1,this.filterManager=t,this.elem=r,this.paths=[]}function SVGTritoneFilter(e,t,r,n){this.filterManager=t;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","linearRGB"),i.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),e.appendChild(i);var a=createNS("feComponentTransfer");a.setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("result",n),this.matrixFilter=a;var o=createNS("feFuncR");o.setAttribute("type","table"),a.appendChild(o),this.feFuncR=o;var s=createNS("feFuncG");s.setAttribute("type","table"),a.appendChild(s),this.feFuncG=s;var l=createNS("feFuncB");l.setAttribute("type","table"),a.appendChild(l),this.feFuncB=l,e.appendChild(a)}function SVGProLevelsFilter(e,t,r,n){this.filterManager=t;var i=this.filterManager.effectElements,a=createNS("feComponentTransfer");(i[10].p.k||0!==i[10].p.v||i[11].p.k||1!==i[11].p.v||i[12].p.k||1!==i[12].p.v||i[13].p.k||0!==i[13].p.v||i[14].p.k||1!==i[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",a)),(i[17].p.k||0!==i[17].p.v||i[18].p.k||1!==i[18].p.v||i[19].p.k||1!==i[19].p.v||i[20].p.k||0!==i[20].p.v||i[21].p.k||1!==i[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",a)),(i[24].p.k||0!==i[24].p.v||i[25].p.k||1!==i[25].p.v||i[26].p.k||1!==i[26].p.v||i[27].p.k||0!==i[27].p.v||i[28].p.k||1!==i[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",a)),(i[31].p.k||0!==i[31].p.v||i[32].p.k||1!==i[32].p.v||i[33].p.k||1!==i[33].p.v||i[34].p.k||0!==i[34].p.v||i[35].p.k||1!==i[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",a)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(a.setAttribute("color-interpolation-filters","sRGB"),e.appendChild(a)),(i[3].p.k||0!==i[3].p.v||i[4].p.k||1!==i[4].p.v||i[5].p.k||1!==i[5].p.v||i[6].p.k||0!==i[6].p.v||i[7].p.k||1!==i[7].p.v)&&((a=createNS("feComponentTransfer")).setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("result",n),e.appendChild(a),this.feFuncRComposed=this.createFeFunc("feFuncR",a),this.feFuncGComposed=this.createFeFunc("feFuncG",a),this.feFuncBComposed=this.createFeFunc("feFuncB",a))}function SVGDropShadowEffect(e,t,r,n,i){var a=t.container.globalData.renderConfig.filterSize,o=t.data.fs||a;e.setAttribute("x",o.x||a.x),e.setAttribute("y",o.y||a.y),e.setAttribute("width",o.width||a.width),e.setAttribute("height",o.height||a.height),this.filterManager=t;var s=createNS("feGaussianBlur");s.setAttribute("in","SourceAlpha"),s.setAttribute("result",n+"_drop_shadow_1"),s.setAttribute("stdDeviation","0"),this.feGaussianBlur=s,e.appendChild(s);var l=createNS("feOffset");l.setAttribute("dx","25"),l.setAttribute("dy","0"),l.setAttribute("in",n+"_drop_shadow_1"),l.setAttribute("result",n+"_drop_shadow_2"),this.feOffset=l,e.appendChild(l);var c=createNS("feFlood");c.setAttribute("flood-color","#00ff00"),c.setAttribute("flood-opacity","1"),c.setAttribute("result",n+"_drop_shadow_3"),this.feFlood=c,e.appendChild(c);var d=createNS("feComposite");d.setAttribute("in",n+"_drop_shadow_3"),d.setAttribute("in2",n+"_drop_shadow_2"),d.setAttribute("operator","in"),d.setAttribute("result",n+"_drop_shadow_4"),e.appendChild(d);var u=this.createMergeNode(n,[n+"_drop_shadow_4",i]);e.appendChild(u)}extendPrototype([SVGComposableEffect],SVGTintFilter),SVGTintFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v/100;this.linearFilter.setAttribute("values",linearFilterValue+" "+n+" 0"),this.matrixFilter.setAttribute("values",r[0]-t[0]+" 0 0 0 "+t[0]+" "+(r[1]-t[1])+" 0 0 0 "+t[1]+" "+(r[2]-t[2])+" 0 0 0 "+t[2]+" 0 0 0 1 0")}},SVGFillFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[2].p.v,r=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+t[0]+" 0 0 0 0 "+t[1]+" 0 0 0 0 "+t[2]+" 0 0 0 "+r+" 0")}},SVGStrokeEffect.prototype.initialize=function(){var e,t,r,n,i=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(n=this.elem.maskManager.masksProperties.length,r=0):n=1+(r=this.filterManager.effectElements[0].p.v-1),(t=createNS("g")).setAttribute("fill","none"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-dashoffset",1);r<n;r+=1)e=createNS("path"),t.appendChild(e),this.paths.push({p:e,m:r});if(3===this.filterManager.effectElements[10].p.v){var a=createNS("mask"),o=createElementID();a.setAttribute("id",o),a.setAttribute("mask-type","alpha"),a.appendChild(t),this.elem.globalData.defs.appendChild(a);var s=createNS("g");for(s.setAttribute("mask","url("+getLocationHref()+"#"+o+")");i[0];)s.appendChild(i[0]);this.elem.layerElement.appendChild(s),this.masker=a,t.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(i=this.elem.layerElement.children||this.elem.layerElement.childNodes;i.length;)this.elem.layerElement.removeChild(i[0]);this.elem.layerElement.appendChild(t),this.elem.layerElement.removeAttribute("mask"),t.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=t},SVGStrokeEffect.prototype.renderFrame=function(e){var t;this.initialized||this.initialize();var r,n,i=this.paths.length;for(t=0;t<i;t+=1)if(-1!==this.paths[t].m&&(r=this.elem.maskManager.viewData[this.paths[t].m],n=this.paths[t].p,(e||this.filterManager._mdf||r.prop._mdf)&&n.setAttribute("d",r.lastPath),e||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||r.prop._mdf)){var a;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var o=.01*Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),s=.01*Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),l=n.getTotalLength();a="0 0 0 "+l*o+" ";var c,d=l*(s-o),u=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01,p=Math.floor(d/u);for(c=0;c<p;c+=1)a+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01+" ";a+="0 "+10*l+" 0 0"}else a="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01;n.setAttribute("stroke-dasharray",a)}if((e||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(e||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(e||this.filterManager.effectElements[3].p._mdf)){var h=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(255*h[0])+","+bmFloor(255*h[1])+","+bmFloor(255*h[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v,i=n[0]+" "+r[0]+" "+t[0],a=n[1]+" "+r[1]+" "+t[1],o=n[2]+" "+r[2]+" "+t[2];this.feFuncR.setAttribute("tableValues",i),this.feFuncG.setAttribute("tableValues",a),this.feFuncB.setAttribute("tableValues",o)}},SVGProLevelsFilter.prototype.createFeFunc=function(e,t){var r=createNS(e);return r.setAttribute("type","table"),t.appendChild(r),r},SVGProLevelsFilter.prototype.getTableValue=function(e,t,r,n,i){for(var a,o,s=0,l=Math.min(e,t),c=Math.max(e,t),d=Array.call(null,{length:256}),u=0,p=i-n,h=t-e;s<=256;)o=(a=s/256)<=l?h<0?i:n:a>=c?h<0?n:i:n+p*Math.pow((a-e)/h,1/r),d[u]=o,u+=1,s+=256/255;return d.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t,r=this.filterManager.effectElements;this.feFuncRComposed&&(e||r[3].p._mdf||r[4].p._mdf||r[5].p._mdf||r[6].p._mdf||r[7].p._mdf)&&(t=this.getTableValue(r[3].p.v,r[4].p.v,r[5].p.v,r[6].p.v,r[7].p.v),this.feFuncRComposed.setAttribute("tableValues",t),this.feFuncGComposed.setAttribute("tableValues",t),this.feFuncBComposed.setAttribute("tableValues",t)),this.feFuncR&&(e||r[10].p._mdf||r[11].p._mdf||r[12].p._mdf||r[13].p._mdf||r[14].p._mdf)&&(t=this.getTableValue(r[10].p.v,r[11].p.v,r[12].p.v,r[13].p.v,r[14].p.v),this.feFuncR.setAttribute("tableValues",t)),this.feFuncG&&(e||r[17].p._mdf||r[18].p._mdf||r[19].p._mdf||r[20].p._mdf||r[21].p._mdf)&&(t=this.getTableValue(r[17].p.v,r[18].p.v,r[19].p.v,r[20].p.v,r[21].p.v),this.feFuncG.setAttribute("tableValues",t)),this.feFuncB&&(e||r[24].p._mdf||r[25].p._mdf||r[26].p._mdf||r[27].p._mdf||r[28].p._mdf)&&(t=this.getTableValue(r[24].p.v,r[25].p.v,r[26].p.v,r[27].p.v,r[28].p.v),this.feFuncB.setAttribute("tableValues",t)),this.feFuncA&&(e||r[31].p._mdf||r[32].p._mdf||r[33].p._mdf||r[34].p._mdf||r[35].p._mdf)&&(t=this.getTableValue(r[31].p.v,r[32].p.v,r[33].p.v,r[34].p.v,r[35].p.v),this.feFuncA.setAttribute("tableValues",t))}},extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){if((e||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),e||this.filterManager.effectElements[0].p._mdf){var t=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*t[0]),Math.round(255*t[1]),Math.round(255*t[2])))}if((e||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),e||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var r=this.filterManager.effectElements[3].p.v,n=(this.filterManager.effectElements[2].p.v-90)*degToRads,i=r*Math.cos(n),a=r*Math.sin(n);this.feOffset.setAttribute("dx",i),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(e,t,r){this.initialized=!1,this.filterManager=t,this.filterElem=e,this.elem=r,r.matteElement=createNS("g"),r.matteElement.appendChild(r.layerElement),r.matteElement.appendChild(r.transformedElement),r.baseElement=r.matteElement}function SVGGaussianBlurEffect(e,t,r,n){e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width","300%"),e.setAttribute("height","300%"),this.filterManager=t;var i=createNS("feGaussianBlur");i.setAttribute("result",n),e.appendChild(i),this.feGaussianBlur=i}function TransformEffect(){}function SVGTransformEffect(e,t){this.init(t)}function CVTransformEffect(e){this.init(e)}return SVGMatte3Effect.prototype.findSymbol=function(e){for(var t=0,r=_svgMatteSymbols.length;t<r;){if(_svgMatteSymbols[t]===e)return _svgMatteSymbols[t];t+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(e,t){var r=e.layerElement.parentNode;if(r){for(var n,i=r.children,a=0,o=i.length;a<o&&i[a]!==e.layerElement;)a+=1;a<=o-2&&(n=i[a+1]);var s=createNS("use");s.setAttribute("href","#"+t),n?r.insertBefore(s,n):r.appendChild(s)}},SVGMatte3Effect.prototype.setElementAsMask=function(e,t){if(!this.findSymbol(t)){var r=createElementID(),n=createNS("mask");n.setAttribute("id",t.layerId),n.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(t);var i=e.globalData.defs;i.appendChild(n);var a=createNS("symbol");a.setAttribute("id",r),this.replaceInParent(t,r),a.appendChild(t.layerElement),i.appendChild(a);var o=createNS("use");o.setAttribute("href","#"+r),n.appendChild(o),t.data.hd=!1,t.show()}e.setMatte(t.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var e=this.filterManager.effectElements[0].p.v,t=this.elem.comp.elements,r=0,n=t.length;r<n;)t[r]&&t[r].data.ind===e&&this.setElementAsMask(this.elem,t[r]),r+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGGaussianBlurEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=.3*this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,n=3==r?0:t,i=2==r?0:t;this.feGaussianBlur.setAttribute("stdDeviation",n+" "+i);var a=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",a)}},TransformEffect.prototype.init=function(e){this.effectsManager=e,this.type=effectTypes.TRANSFORM_EFFECT,this.matrix=new Matrix,this.opacity=-1,this._mdf=!1,this._opMdf=!1},TransformEffect.prototype.renderFrame=function(e){if(this._opMdf=!1,this._mdf=!1,e||this.effectsManager._mdf){var t=this.effectsManager.effectElements,r=t[0].p.v,n=t[1].p.v,i=1===t[2].p.v,a=t[3].p.v,o=i?a:t[4].p.v,s=t[5].p.v,l=t[6].p.v,c=t[7].p.v;this.matrix.reset(),this.matrix.translate(-r[0],-r[1],r[2]),this.matrix.scale(.01*o,.01*a,1),this.matrix.rotate(-c*degToRads),this.matrix.skewFromAxis(-s*degToRads,(l+90)*degToRads),this.matrix.translate(n[0],n[1],0),this._mdf=!0,this.opacity!==t[8].p.v&&(this.opacity=t[8].p.v,this._opMdf=!0)}},extendPrototype([TransformEffect],SVGTransformEffect),extendPrototype([TransformEffect],CVTransformEffect),registerRenderer("canvas",CanvasRenderer),registerRenderer("html",HybridRenderer),registerRenderer("svg",SVGRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("zz",ZigZagModifier),ShapeModifiers.registerModifier("op",OffsetPathModifier),setExpressionsPlugin(Expressions),setExpressionInterfaces(getInterface),initialize$1(),initialize(),registerEffect$1(20,SVGTintFilter,!0),registerEffect$1(21,SVGFillFilter,!0),registerEffect$1(22,SVGStrokeEffect,!1),registerEffect$1(23,SVGTritoneFilter,!0),registerEffect$1(24,SVGProLevelsFilter,!0),registerEffect$1(25,SVGDropShadowEffect,!0),registerEffect$1(28,SVGMatte3Effect,!1),registerEffect$1(29,SVGGaussianBlurEffect,!0),registerEffect$1(35,SVGTransformEffect,!1),registerEffect(35,CVTransformEffect),lottie},module.exports=factory())}(lottie$2,lottie$2.exports)),lottie$2.exports}var lottieExports=requireLottie(),lottie=getDefaultExportFromCjs(lottieExports);const qontoLottiePlayerStyles=i$4`
|
|
210
|
+
*/const e$1=()=>new h$2;let h$2=class{};const o$2=new WeakMap,n$1=e$2(class extends f{render(e){return A}update(e,[t]){const r=t!==this.G;return r&&void 0!==this.G&&this.rt(void 0),(r||this.lt!==this.ct)&&(this.G=t,this.ht=e.options?.host,this.rt(this.ct=e.element)),A}rt(e){if(this.isConnected||(e=void 0),"function"==typeof this.G){const t=this.ht??globalThis;let r=o$2.get(t);void 0===r&&(r=new WeakMap,o$2.set(t,r)),void 0!==r.get(this.G)&&this.G.call(this.ht,void 0),r.set(this.G,e),void 0!==e&&this.G.call(this.ht,e)}else this.G.value=e}get lt(){return"function"==typeof this.G?o$2.get(this.ht??globalThis)?.get(this.G):this.G?.value}disconnected(){this.lt===this.ct&&this.rt(void 0)}reconnected(){this.rt(this.ct)}});var lottie$2={exports:{}},lottie$1=lottie$2.exports,hasRequiredLottie;function requireLottie(){return hasRequiredLottie||(hasRequiredLottie=1,function(module,exports$1){var factory;"undefined"!=typeof document&&"undefined"!=typeof navigator&&(factory=function(){var svgNS="http://www.w3.org/2000/svg",locationHref="",_useWebWorker=!1,initialDefaultFrame=-999999,setWebWorker=function(e){_useWebWorker=!!e},getWebWorker=function(){return _useWebWorker},setLocationHref=function(e){locationHref=e},getLocationHref=function(){return locationHref};function createTag(e){return document.createElement(e)}function extendPrototype(e,t){var r,n,i=e.length;for(r=0;r<i;r+=1)for(var a in n=e[r].prototype)Object.prototype.hasOwnProperty.call(n,a)&&(t.prototype[a]=n[a])}function getDescriptor(e,t){return Object.getOwnPropertyDescriptor(e,t)}function createProxyFunction(e){function t(){}return t.prototype=e,t}var audioControllerFactory=function(){function e(e){this.audios=[],this.audioFactory=e,this._volume=1,this._isMuted=!1}return e.prototype={addAudio:function(e){this.audios.push(e)},pause:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].pause()},resume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].resume()},setRate:function(e){var t,r=this.audios.length;for(t=0;t<r;t+=1)this.audios[t].setRate(e)},createAudio:function(e){return this.audioFactory?this.audioFactory(e):window.Howl?new window.Howl({src:[e]}):{isPlaying:!1,play:function(){this.isPlaying=!0},seek:function(){this.isPlaying=!1},playing:function(){},rate:function(){},setVolume:function(){}}},setAudioFactory:function(e){this.audioFactory=e},setVolume:function(e){this._volume=e,this._updateVolume()},mute:function(){this._isMuted=!0,this._updateVolume()},unmute:function(){this._isMuted=!1,this._updateVolume()},getVolume:function(){return this._volume},_updateVolume:function(){var e,t=this.audios.length;for(e=0;e<t;e+=1)this.audios[e].volume(this._volume*(this._isMuted?0:1))}},function(){return new e}}(),createTypedArray=function(){function e(e,t){var r,n=0,i=[];switch(e){case"int16":case"uint8c":r=1;break;default:r=1.1}for(n=0;n<t;n+=1)i.push(r);return i}return"function"==typeof Uint8ClampedArray&&"function"==typeof Float32Array?function(t,r){return"float32"===t?new Float32Array(r):"int16"===t?new Int16Array(r):"uint8c"===t?new Uint8ClampedArray(r):e(t,r)}:e}();function createSizedArray(e){return Array.apply(null,{length:e})}function _typeof$6(e){return _typeof$6="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$6(e)}var subframeEnabled=!0,expressionsPlugin=null,expressionsInterfaces=null,idPrefix$1="",isSafari=/^((?!chrome|android).)*safari/i.test(navigator.userAgent),bmPow=Math.pow,bmSqrt=Math.sqrt,bmFloor=Math.floor,bmMax=Math.max,bmMin=Math.min,BMMath={};!function(){var e,t=["abs","acos","acosh","asin","asinh","atan","atanh","atan2","ceil","cbrt","expm1","clz32","cos","cosh","exp","floor","fround","hypot","imul","log","log1p","log2","log10","max","min","pow","random","round","sign","sin","sinh","sqrt","tan","tanh","trunc","E","LN10","LN2","LOG10E","LOG2E","PI","SQRT1_2","SQRT2"],r=t.length;for(e=0;e<r;e+=1)BMMath[t[e]]=Math[t[e]]}(),BMMath.random=Math.random,BMMath.abs=function(e){if("object"===_typeof$6(e)&&e.length){var t,r=createSizedArray(e.length),n=e.length;for(t=0;t<n;t+=1)r[t]=Math.abs(e[t]);return r}return Math.abs(e)};var defaultCurveSegments=150,degToRads=Math.PI/180,roundCorner=.5519;function styleDiv(e){e.style.position="absolute",e.style.top=0,e.style.left=0,e.style.display="block",e.style.transformOrigin="0 0",e.style.webkitTransformOrigin="0 0",e.style.backfaceVisibility="visible",e.style.webkitBackfaceVisibility="visible",e.style.transformStyle="preserve-3d",e.style.webkitTransformStyle="preserve-3d",e.style.mozTransformStyle="preserve-3d"}function BMEnterFrameEvent(e,t,r,n){this.type=e,this.currentTime=t,this.totalTime=r,this.direction=n<0?-1:1}function BMCompleteEvent(e,t){this.type=e,this.direction=t<0?-1:1}function BMCompleteLoopEvent(e,t,r,n){this.type=e,this.currentLoop=r,this.totalLoops=t,this.direction=n<0?-1:1}function BMSegmentStartEvent(e,t,r){this.type=e,this.firstFrame=t,this.totalFrames=r}function BMDestroyEvent(e,t){this.type=e,this.target=t}function BMRenderFrameErrorEvent(e,t){this.type="renderFrameError",this.nativeError=e,this.currentTime=t}function BMConfigErrorEvent(e){this.type="configError",this.nativeError=e}var createElementID=(_count=0,function(){return idPrefix$1+"__lottie_element_"+(_count+=1)}),_count;function HSVtoRGB(e,t,r){var n,i,a,o,s,l,c,d;switch(l=r*(1-t),c=r*(1-(s=6*e-(o=Math.floor(6*e)))*t),d=r*(1-(1-s)*t),o%6){case 0:n=r,i=d,a=l;break;case 1:n=c,i=r,a=l;break;case 2:n=l,i=r,a=d;break;case 3:n=l,i=c,a=r;break;case 4:n=d,i=l,a=r;break;case 5:n=r,i=l,a=c}return[n,i,a]}function RGBtoHSV(e,t,r){var n,i=Math.max(e,t,r),a=Math.min(e,t,r),o=i-a,s=0===i?0:o/i,l=i/255;switch(i){case a:n=0;break;case e:n=t-r+o*(t<r?6:0),n/=6*o;break;case t:n=r-e+2*o,n/=6*o;break;case r:n=e-t+4*o,n/=6*o}return[n,s,l]}function addSaturationToRGB(e,t){var r=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return r[1]+=t,r[1]>1?r[1]=1:r[1]<=0&&(r[1]=0),HSVtoRGB(r[0],r[1],r[2])}function addBrightnessToRGB(e,t){var r=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return r[2]+=t,r[2]>1?r[2]=1:r[2]<0&&(r[2]=0),HSVtoRGB(r[0],r[1],r[2])}function addHueToRGB(e,t){var r=RGBtoHSV(255*e[0],255*e[1],255*e[2]);return r[0]+=t/360,r[0]>1?r[0]-=1:r[0]<0&&(r[0]+=1),HSVtoRGB(r[0],r[1],r[2])}var rgbToHex=function(){var e,t,r=[];for(e=0;e<256;e+=1)t=e.toString(16),r[e]=1===t.length?"0"+t:t;return function(e,t,n){return e<0&&(e=0),t<0&&(t=0),n<0&&(n=0),"#"+r[e]+r[t]+r[n]}}(),setSubframeEnabled=function(e){subframeEnabled=!!e},getSubframeEnabled=function(){return subframeEnabled},setExpressionsPlugin=function(e){expressionsPlugin=e},getExpressionsPlugin=function(){return expressionsPlugin},setExpressionInterfaces=function(e){expressionsInterfaces=e},getExpressionInterfaces=function(){return expressionsInterfaces},setDefaultCurveSegments=function(e){defaultCurveSegments=e},getDefaultCurveSegments=function(){return defaultCurveSegments},setIdPrefix=function(e){idPrefix$1=e};function createNS(e){return document.createElementNS(svgNS,e)}function _typeof$5(e){return _typeof$5="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$5(e)}var dataManager=function(){var e,t,r=1,n=[],i={onmessage:function(){},postMessage:function(t){e({data:t})}},a={postMessage:function(e){i.onmessage({data:e})}};function o(){t||(t=function(t){if(window.Worker&&window.Blob&&getWebWorker()){var r=new Blob(["var _workerSelf = self; self.onmessage = ",t.toString()],{type:"text/javascript"}),n=URL.createObjectURL(r);return new Worker(n)}return e=t,i}((function(e){if(a.dataManager||(a.dataManager=function(){function e(i,a){var o,s,l,c,d,p,h=i.length;for(s=0;s<h;s+=1)if("ks"in(o=i[s])&&!o.completed){if(o.completed=!0,o.hasMask){var f=o.masksProperties;for(c=f.length,l=0;l<c;l+=1)if(f[l].pt.k.i)n(f[l].pt.k);else for(p=f[l].pt.k.length,d=0;d<p;d+=1)f[l].pt.k[d].s&&n(f[l].pt.k[d].s[0]),f[l].pt.k[d].e&&n(f[l].pt.k[d].e[0])}0===o.ty?(o.layers=t(o.refId,a),e(o.layers,a)):4===o.ty?r(o.shapes):5===o.ty&&u(o)}}function t(e,t){var r=function(e,t){for(var r=0,n=t.length;r<n;){if(t[r].id===e)return t[r];r+=1}return null}(e,t);return r?r.layers.__used?JSON.parse(JSON.stringify(r.layers)):(r.layers.__used=!0,r.layers):null}function r(e){var t,i,a;for(t=e.length-1;t>=0;t-=1)if("sh"===e[t].ty)if(e[t].ks.k.i)n(e[t].ks.k);else for(a=e[t].ks.k.length,i=0;i<a;i+=1)e[t].ks.k[i].s&&n(e[t].ks.k[i].s[0]),e[t].ks.k[i].e&&n(e[t].ks.k[i].e[0]);else"gr"===e[t].ty&&r(e[t].it)}function n(e){var t,r=e.i.length;for(t=0;t<r;t+=1)e.i[t][0]+=e.v[t][0],e.i[t][1]+=e.v[t][1],e.o[t][0]+=e.v[t][0],e.o[t][1]+=e.v[t][1]}function i(e,t){var r=t?t.split("."):[100,100,100];return e[0]>r[0]||!(r[0]>e[0])&&(e[1]>r[1]||!(r[1]>e[1])&&(e[2]>r[2]||!(r[2]>e[2])&&null))}var a,o=function(){var e=[4,4,14];function t(e){var t,r,n,i=e.length;for(t=0;t<i;t+=1)5===e[t].ty&&(n=void 0,n=(r=e[t]).t.d,r.t.d={k:[{s:n,t:0}]})}return function(r){if(i(e,r.v)&&(t(r.layers),r.assets)){var n,a=r.assets.length;for(n=0;n<a;n+=1)r.assets[n].layers&&t(r.assets[n].layers)}}}(),s=(a=[4,7,99],function(e){if(e.chars&&!i(a,e.v)){var t,n=e.chars.length;for(t=0;t<n;t+=1){var o=e.chars[t];o.data&&o.data.shapes&&(r(o.data.shapes),o.data.ip=0,o.data.op=99999,o.data.st=0,o.data.sr=1,o.data.ks={p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0}},e.chars[t].t||(o.data.shapes.push({ty:"no"}),o.data.shapes[0].it.push({p:{k:[0,0],a:0},s:{k:[100,100],a:0},a:{k:[0,0],a:0},r:{k:0,a:0},o:{k:100,a:0},sk:{k:0,a:0},sa:{k:0,a:0},ty:"tr"})))}}}),l=function(){var e=[5,7,15];function t(e){var t,r,n=e.length;for(t=0;t<n;t+=1)5===e[t].ty&&(r=void 0,"number"==typeof(r=e[t].t.p).a&&(r.a={a:0,k:r.a}),"number"==typeof r.p&&(r.p={a:0,k:r.p}),"number"==typeof r.r&&(r.r={a:0,k:r.r}))}return function(r){if(i(e,r.v)&&(t(r.layers),r.assets)){var n,a=r.assets.length;for(n=0;n<a;n+=1)r.assets[n].layers&&t(r.assets[n].layers)}}}(),c=function(){var e=[4,1,9];function t(e){var r,n,i,a=e.length;for(r=0;r<a;r+=1)if("gr"===e[r].ty)t(e[r].it);else if("fl"===e[r].ty||"st"===e[r].ty)if(e[r].c.k&&e[r].c.k[0].i)for(i=e[r].c.k.length,n=0;n<i;n+=1)e[r].c.k[n].s&&(e[r].c.k[n].s[0]/=255,e[r].c.k[n].s[1]/=255,e[r].c.k[n].s[2]/=255,e[r].c.k[n].s[3]/=255),e[r].c.k[n].e&&(e[r].c.k[n].e[0]/=255,e[r].c.k[n].e[1]/=255,e[r].c.k[n].e[2]/=255,e[r].c.k[n].e[3]/=255);else e[r].c.k[0]/=255,e[r].c.k[1]/=255,e[r].c.k[2]/=255,e[r].c.k[3]/=255}function r(e){var r,n=e.length;for(r=0;r<n;r+=1)4===e[r].ty&&t(e[r].shapes)}return function(t){if(i(e,t.v)&&(r(t.layers),t.assets)){var n,a=t.assets.length;for(n=0;n<a;n+=1)t.assets[n].layers&&r(t.assets[n].layers)}}}(),d=function(){var e=[4,4,18];function t(e){var r,n,i;for(r=e.length-1;r>=0;r-=1)if("sh"===e[r].ty)if(e[r].ks.k.i)e[r].ks.k.c=e[r].closed;else for(i=e[r].ks.k.length,n=0;n<i;n+=1)e[r].ks.k[n].s&&(e[r].ks.k[n].s[0].c=e[r].closed),e[r].ks.k[n].e&&(e[r].ks.k[n].e[0].c=e[r].closed);else"gr"===e[r].ty&&t(e[r].it)}function r(e){var r,n,i,a,o,s,l=e.length;for(n=0;n<l;n+=1){if((r=e[n]).hasMask){var c=r.masksProperties;for(a=c.length,i=0;i<a;i+=1)if(c[i].pt.k.i)c[i].pt.k.c=c[i].cl;else for(s=c[i].pt.k.length,o=0;o<s;o+=1)c[i].pt.k[o].s&&(c[i].pt.k[o].s[0].c=c[i].cl),c[i].pt.k[o].e&&(c[i].pt.k[o].e[0].c=c[i].cl)}4===r.ty&&t(r.shapes)}}return function(t){if(i(e,t.v)&&(r(t.layers),t.assets)){var n,a=t.assets.length;for(n=0;n<a;n+=1)t.assets[n].layers&&r(t.assets[n].layers)}}}();function u(e){0===e.t.a.length&&e.t.p}var p={completeData:function(r){r.__complete||(c(r),o(r),s(r),l(r),d(r),e(r.layers,r.assets),function(r,n){if(r){var i=0,a=r.length;for(i=0;i<a;i+=1)1===r[i].t&&(r[i].data.layers=t(r[i].data.refId,n),e(r[i].data.layers,n))}}(r.chars,r.assets),r.__complete=!0)}};return p.checkColors=c,p.checkChars=s,p.checkPathProperties=l,p.checkShapes=d,p.completeLayers=e,p}()),a.assetLoader||(a.assetLoader=function(){function e(e){var t=e.getResponseHeader("content-type");return t&&"json"===e.responseType&&-1!==t.indexOf("json")||e.response&&"object"===_typeof$5(e.response)?e.response:e.response&&"string"==typeof e.response?JSON.parse(e.response):e.responseText?JSON.parse(e.responseText):null}return{load:function(t,r,n,i){var a,o=new XMLHttpRequest;try{o.responseType="json"}catch(e){}o.onreadystatechange=function(){if(4===o.readyState)if(200===o.status)a=e(o),n(a);else try{a=e(o),n(a)}catch(e){i&&i(e)}};try{o.open(["G","E","T"].join(""),t,!0)}catch(e){o.open(["G","E","T"].join(""),r+"/"+t,!0)}o.send()}}}()),"loadAnimation"===e.data.type)a.assetLoader.load(e.data.path,e.data.fullPath,(function(t){a.dataManager.completeData(t),a.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){a.postMessage({id:e.data.id,status:"error"})}));else if("complete"===e.data.type){var t=e.data.animation;a.dataManager.completeData(t),a.postMessage({id:e.data.id,payload:t,status:"success"})}else"loadData"===e.data.type&&a.assetLoader.load(e.data.path,e.data.fullPath,(function(t){a.postMessage({id:e.data.id,payload:t,status:"success"})}),(function(){a.postMessage({id:e.data.id,status:"error"})}))})),t.onmessage=function(e){var t=e.data,r=t.id,i=n[r];n[r]=null,"success"===t.status?i.onComplete(t.payload):i.onError&&i.onError()})}function s(e,t){var i="processId_"+(r+=1);return n[i]={onComplete:e,onError:t},i}return{loadAnimation:function(e,r,n){o();var i=s(r,n);t.postMessage({type:"loadAnimation",path:e,fullPath:window.location.origin+window.location.pathname,id:i})},loadData:function(e,r,n){o();var i=s(r,n);t.postMessage({type:"loadData",path:e,fullPath:window.location.origin+window.location.pathname,id:i})},completeAnimation:function(e,r,n){o();var i=s(r,n);t.postMessage({type:"complete",animation:e,id:i})}}}(),ImagePreloader=function(){var e=function(){var e=createTag("canvas");e.width=1,e.height=1;var t=e.getContext("2d");return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),e}();function t(){this.loadedAssets+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function r(){this.loadedFootagesCount+=1,this.loadedAssets===this.totalImages&&this.loadedFootagesCount===this.totalFootages&&this.imagesLoadedCb&&this.imagesLoadedCb(null)}function n(e,t,r){var n="";if(e.e)n=e.p;else if(t){var i=e.p;-1!==i.indexOf("images/")&&(i=i.split("/")[1]),n=t+i}else n=r,n+=e.u?e.u:"",n+=e.p;return n}function i(e){var t=0,r=setInterval(function(){(e.getBBox().width||t>500)&&(this._imageLoaded(),clearInterval(r)),t+=1}.bind(this),50)}function a(e){var t={assetData:e},r=n(e,this.assetsPath,this.path);return dataManager.loadData(r,function(e){t.img=e,this._footageLoaded()}.bind(this),function(){t.img={},this._footageLoaded()}.bind(this)),t}function o(){this._imageLoaded=t.bind(this),this._footageLoaded=r.bind(this),this.testImageLoaded=i.bind(this),this.createFootageData=a.bind(this),this.assetsPath="",this.path="",this.totalImages=0,this.totalFootages=0,this.loadedAssets=0,this.loadedFootagesCount=0,this.imagesLoadedCb=null,this.images=[]}return o.prototype={loadAssets:function(e,t){var r;this.imagesLoadedCb=t;var n=e.length;for(r=0;r<n;r+=1)e[r].layers||(e[r].t&&"seq"!==e[r].t?3===e[r].t&&(this.totalFootages+=1,this.images.push(this.createFootageData(e[r]))):(this.totalImages+=1,this.images.push(this._createImageData(e[r]))))},setAssetsPath:function(e){this.assetsPath=e||""},setPath:function(e){this.path=e||""},loadedImages:function(){return this.totalImages===this.loadedAssets},loadedFootages:function(){return this.totalFootages===this.loadedFootagesCount},destroy:function(){this.imagesLoadedCb=null,this.images.length=0},getAsset:function(e){for(var t=0,r=this.images.length;t<r;){if(this.images[t].assetData===e)return this.images[t].img;t+=1}return null},createImgData:function(t){var r=n(t,this.assetsPath,this.path),i=createTag("img");i.crossOrigin="anonymous",i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.src=r;var a={img:i,assetData:t};return a},createImageData:function(t){var r=n(t,this.assetsPath,this.path),i=createNS("image");isSafari?this.testImageLoaded(i):i.addEventListener("load",this._imageLoaded,!1),i.addEventListener("error",function(){a.img=e,this._imageLoaded()}.bind(this),!1),i.setAttributeNS("http://www.w3.org/1999/xlink","href",r),this._elementHelper.append?this._elementHelper.append(i):this._elementHelper.appendChild(i);var a={img:i,assetData:t};return a},imageLoaded:t,footageLoaded:r,setCacheType:function(e,t){"svg"===e?(this._elementHelper=t,this._createImageData=this.createImageData.bind(this)):this._createImageData=this.createImgData.bind(this)}},o}();function BaseEvent(){}BaseEvent.prototype={triggerEvent:function(e,t){if(this._cbs[e])for(var r=this._cbs[e],n=0;n<r.length;n+=1)r[n](t)},addEventListener:function(e,t){return this._cbs[e]||(this._cbs[e]=[]),this._cbs[e].push(t),function(){this.removeEventListener(e,t)}.bind(this)},removeEventListener:function(e,t){if(t){if(this._cbs[e]){for(var r=0,n=this._cbs[e].length;r<n;)this._cbs[e][r]===t&&(this._cbs[e].splice(r,1),r-=1,n-=1),r+=1;this._cbs[e].length||(this._cbs[e]=null)}}else this._cbs[e]=null}};var markerParser=function(){function e(e){for(var t,r=e.split("\r\n"),n={},i=0,a=0;a<r.length;a+=1)2===(t=r[a].split(":")).length&&(n[t[0]]=t[1].trim(),i+=1);if(0===i)throw new Error;return n}return function(t){for(var r=[],n=0;n<t.length;n+=1){var i=t[n],a={time:i.tm,duration:i.dr};try{a.payload=JSON.parse(t[n].cm)}catch(r){try{a.payload=e(t[n].cm)}catch(e){a.payload={name:t[n].cm}}}r.push(a)}return r}}(),ProjectInterface=function(){function e(e){this.compositions.push(e)}return function(){function t(e){for(var t=0,r=this.compositions.length;t<r;){if(this.compositions[t].data&&this.compositions[t].data.nm===e)return this.compositions[t].prepareFrame&&this.compositions[t].data.xt&&this.compositions[t].prepareFrame(this.currentFrame),this.compositions[t].compInterface;t+=1}return null}return t.compositions=[],t.currentFrame=0,t.registerComposition=e,t}}(),renderers={},registerRenderer=function(e,t){renderers[e]=t};function getRenderer(e){return renderers[e]}function getRegisteredRenderer(){if(renderers.canvas)return"canvas";for(var e in renderers)if(renderers[e])return e;return""}function _typeof$4(e){return _typeof$4="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$4(e)}var AnimationItem=function(){this._cbs=[],this.name="",this.path="",this.isLoaded=!1,this.currentFrame=0,this.currentRawFrame=0,this.firstFrame=0,this.totalFrames=0,this.frameRate=0,this.frameMult=0,this.playSpeed=1,this.playDirection=1,this.playCount=0,this.animationData={},this.assets=[],this.isPaused=!0,this.autoplay=!1,this.loop=!0,this.renderer=null,this.animationID=createElementID(),this.assetsPath="",this.timeCompleted=0,this.segmentPos=0,this.isSubframeEnabled=getSubframeEnabled(),this.segments=[],this._idle=!0,this._completedLoop=!1,this.projectInterface=ProjectInterface(),this.imagePreloader=new ImagePreloader,this.audioController=audioControllerFactory(),this.markers=[],this.configAnimation=this.configAnimation.bind(this),this.onSetupError=this.onSetupError.bind(this),this.onSegmentComplete=this.onSegmentComplete.bind(this),this.drawnFrameEvent=new BMEnterFrameEvent("drawnFrame",0,0,0),this.expressionsPlugin=getExpressionsPlugin()};extendPrototype([BaseEvent],AnimationItem),AnimationItem.prototype.setParams=function(e){(e.wrapper||e.container)&&(this.wrapper=e.wrapper||e.container);var t="svg";e.animType?t=e.animType:e.renderer&&(t=e.renderer);var r=getRenderer(t);this.renderer=new r(this,e.rendererSettings),this.imagePreloader.setCacheType(t,this.renderer.globalData.defs),this.renderer.setProjectInterface(this.projectInterface),this.animType=t,""===e.loop||null===e.loop||void 0===e.loop||!0===e.loop?this.loop=!0:!1===e.loop?this.loop=!1:this.loop=parseInt(e.loop,10),this.autoplay=!("autoplay"in e)||e.autoplay,this.name=e.name?e.name:"",this.autoloadSegments=!Object.prototype.hasOwnProperty.call(e,"autoloadSegments")||e.autoloadSegments,this.assetsPath=e.assetsPath,this.initialSegment=e.initialSegment,e.audioFactory&&this.audioController.setAudioFactory(e.audioFactory),e.animationData?this.setupAnimation(e.animationData):e.path&&(-1!==e.path.lastIndexOf("\\")?this.path=e.path.substr(0,e.path.lastIndexOf("\\")+1):this.path=e.path.substr(0,e.path.lastIndexOf("/")+1),this.fileName=e.path.substr(e.path.lastIndexOf("/")+1),this.fileName=this.fileName.substr(0,this.fileName.lastIndexOf(".json")),dataManager.loadAnimation(e.path,this.configAnimation,this.onSetupError))},AnimationItem.prototype.onSetupError=function(){this.trigger("data_failed")},AnimationItem.prototype.setupAnimation=function(e){dataManager.completeAnimation(e,this.configAnimation)},AnimationItem.prototype.setData=function(e,t){t&&"object"!==_typeof$4(t)&&(t=JSON.parse(t));var r={wrapper:e,animationData:t},n=e.attributes;r.path=n.getNamedItem("data-animation-path")?n.getNamedItem("data-animation-path").value:n.getNamedItem("data-bm-path")?n.getNamedItem("data-bm-path").value:n.getNamedItem("bm-path")?n.getNamedItem("bm-path").value:"",r.animType=n.getNamedItem("data-anim-type")?n.getNamedItem("data-anim-type").value:n.getNamedItem("data-bm-type")?n.getNamedItem("data-bm-type").value:n.getNamedItem("bm-type")?n.getNamedItem("bm-type").value:n.getNamedItem("data-bm-renderer")?n.getNamedItem("data-bm-renderer").value:n.getNamedItem("bm-renderer")?n.getNamedItem("bm-renderer").value:getRegisteredRenderer()||"canvas";var i=n.getNamedItem("data-anim-loop")?n.getNamedItem("data-anim-loop").value:n.getNamedItem("data-bm-loop")?n.getNamedItem("data-bm-loop").value:n.getNamedItem("bm-loop")?n.getNamedItem("bm-loop").value:"";"false"===i?r.loop=!1:"true"===i?r.loop=!0:""!==i&&(r.loop=parseInt(i,10));var a=n.getNamedItem("data-anim-autoplay")?n.getNamedItem("data-anim-autoplay").value:n.getNamedItem("data-bm-autoplay")?n.getNamedItem("data-bm-autoplay").value:!n.getNamedItem("bm-autoplay")||n.getNamedItem("bm-autoplay").value;r.autoplay="false"!==a,r.name=n.getNamedItem("data-name")?n.getNamedItem("data-name").value:n.getNamedItem("data-bm-name")?n.getNamedItem("data-bm-name").value:n.getNamedItem("bm-name")?n.getNamedItem("bm-name").value:"","false"===(n.getNamedItem("data-anim-prerender")?n.getNamedItem("data-anim-prerender").value:n.getNamedItem("data-bm-prerender")?n.getNamedItem("data-bm-prerender").value:n.getNamedItem("bm-prerender")?n.getNamedItem("bm-prerender").value:"")&&(r.prerender=!1),r.path?this.setParams(r):this.trigger("destroy")},AnimationItem.prototype.includeLayers=function(e){e.op>this.animationData.op&&(this.animationData.op=e.op,this.totalFrames=Math.floor(e.op-this.animationData.ip));var t,r,n=this.animationData.layers,i=n.length,a=e.layers,o=a.length;for(r=0;r<o;r+=1)for(t=0;t<i;){if(n[t].id===a[r].id){n[t]=a[r];break}t+=1}if((e.chars||e.fonts)&&(this.renderer.globalData.fontManager.addChars(e.chars),this.renderer.globalData.fontManager.addFonts(e.fonts,this.renderer.globalData.defs)),e.assets)for(i=e.assets.length,t=0;t<i;t+=1)this.animationData.assets.push(e.assets[t]);this.animationData.__complete=!1,dataManager.completeAnimation(this.animationData,this.onSegmentComplete)},AnimationItem.prototype.onSegmentComplete=function(e){this.animationData=e;var t=getExpressionsPlugin();t&&t.initExpressions(this),this.loadNextSegment()},AnimationItem.prototype.loadNextSegment=function(){var e=this.animationData.segments;if(!e||0===e.length||!this.autoloadSegments)return this.trigger("data_ready"),void(this.timeCompleted=this.totalFrames);var t=e.shift();this.timeCompleted=t.time*this.frameRate;var r=this.path+this.fileName+"_"+this.segmentPos+".json";this.segmentPos+=1,dataManager.loadData(r,this.includeLayers.bind(this),function(){this.trigger("data_failed")}.bind(this))},AnimationItem.prototype.loadSegments=function(){this.animationData.segments||(this.timeCompleted=this.totalFrames),this.loadNextSegment()},AnimationItem.prototype.imagesLoaded=function(){this.trigger("loaded_images"),this.checkLoaded()},AnimationItem.prototype.preloadImages=function(){this.imagePreloader.setAssetsPath(this.assetsPath),this.imagePreloader.setPath(this.path),this.imagePreloader.loadAssets(this.animationData.assets,this.imagesLoaded.bind(this))},AnimationItem.prototype.configAnimation=function(e){if(this.renderer)try{this.animationData=e,this.initialSegment?(this.totalFrames=Math.floor(this.initialSegment[1]-this.initialSegment[0]),this.firstFrame=Math.round(this.initialSegment[0])):(this.totalFrames=Math.floor(this.animationData.op-this.animationData.ip),this.firstFrame=Math.round(this.animationData.ip)),this.renderer.configAnimation(e),e.assets||(e.assets=[]),this.assets=this.animationData.assets,this.frameRate=this.animationData.fr,this.frameMult=this.animationData.fr/1e3,this.renderer.searchExtraCompositions(e.assets),this.markers=markerParser(e.markers||[]),this.trigger("config_ready"),this.preloadImages(),this.loadSegments(),this.updaFrameModifier(),this.waitForFontsLoaded(),this.isPaused&&this.audioController.pause()}catch(e){this.triggerConfigError(e)}},AnimationItem.prototype.waitForFontsLoaded=function(){this.renderer&&(this.renderer.globalData.fontManager.isLoaded?this.checkLoaded():setTimeout(this.waitForFontsLoaded.bind(this),20))},AnimationItem.prototype.checkLoaded=function(){if(!this.isLoaded&&this.renderer.globalData.fontManager.isLoaded&&(this.imagePreloader.loadedImages()||"canvas"!==this.renderer.rendererType)&&this.imagePreloader.loadedFootages()){this.isLoaded=!0;var e=getExpressionsPlugin();e&&e.initExpressions(this),this.renderer.initItems(),setTimeout(function(){this.trigger("DOMLoaded")}.bind(this),0),this.gotoFrame(),this.autoplay&&this.play()}},AnimationItem.prototype.resize=function(e,t){var r="number"==typeof e?e:void 0,n="number"==typeof t?t:void 0;this.renderer.updateContainerSize(r,n)},AnimationItem.prototype.setSubframe=function(e){this.isSubframeEnabled=!!e},AnimationItem.prototype.gotoFrame=function(){this.currentFrame=this.isSubframeEnabled?this.currentRawFrame:~~this.currentRawFrame,this.timeCompleted!==this.totalFrames&&this.currentFrame>this.timeCompleted&&(this.currentFrame=this.timeCompleted),this.trigger("enterFrame"),this.renderFrame(),this.trigger("drawnFrame")},AnimationItem.prototype.renderFrame=function(){if(!1!==this.isLoaded&&this.renderer)try{this.expressionsPlugin&&this.expressionsPlugin.resetFrame(),this.renderer.renderFrame(this.currentFrame+this.firstFrame)}catch(e){this.triggerRenderFrameError(e)}},AnimationItem.prototype.play=function(e){e&&this.name!==e||!0===this.isPaused&&(this.isPaused=!1,this.trigger("_play"),this.audioController.resume(),this._idle&&(this._idle=!1,this.trigger("_active")))},AnimationItem.prototype.pause=function(e){e&&this.name!==e||!1===this.isPaused&&(this.isPaused=!0,this.trigger("_pause"),this._idle=!0,this.trigger("_idle"),this.audioController.pause())},AnimationItem.prototype.togglePause=function(e){e&&this.name!==e||(!0===this.isPaused?this.play():this.pause())},AnimationItem.prototype.stop=function(e){e&&this.name!==e||(this.pause(),this.playCount=0,this._completedLoop=!1,this.setCurrentRawFrameValue(0))},AnimationItem.prototype.getMarkerData=function(e){for(var t,r=0;r<this.markers.length;r+=1)if((t=this.markers[r]).payload&&t.payload.name===e)return t;return null},AnimationItem.prototype.goToAndStop=function(e,t,r){if(!r||this.name===r){var n=Number(e);if(isNaN(n)){var i=this.getMarkerData(e);i&&this.goToAndStop(i.time,!0)}else t?this.setCurrentRawFrameValue(e):this.setCurrentRawFrameValue(e*this.frameModifier);this.pause()}},AnimationItem.prototype.goToAndPlay=function(e,t,r){if(!r||this.name===r){var n=Number(e);if(isNaN(n)){var i=this.getMarkerData(e);i&&(i.duration?this.playSegments([i.time,i.time+i.duration],!0):this.goToAndStop(i.time,!0))}else this.goToAndStop(n,t,r);this.play()}},AnimationItem.prototype.advanceTime=function(e){if(!0!==this.isPaused&&!1!==this.isLoaded){var t=this.currentRawFrame+e*this.frameModifier,r=!1;t>=this.totalFrames-1&&this.frameModifier>0?this.loop&&this.playCount!==this.loop?t>=this.totalFrames?(this.playCount+=1,this.checkSegments(t%this.totalFrames)||(this.setCurrentRawFrameValue(t%this.totalFrames),this._completedLoop=!0,this.trigger("loopComplete"))):this.setCurrentRawFrameValue(t):this.checkSegments(t>this.totalFrames?t%this.totalFrames:0)||(r=!0,t=this.totalFrames-1):t<0?this.checkSegments(t%this.totalFrames)||(!this.loop||this.playCount--<=0&&!0!==this.loop?(r=!0,t=0):(this.setCurrentRawFrameValue(this.totalFrames+t%this.totalFrames),this._completedLoop?this.trigger("loopComplete"):this._completedLoop=!0)):this.setCurrentRawFrameValue(t),r&&(this.setCurrentRawFrameValue(t),this.pause(),this.trigger("complete"))}},AnimationItem.prototype.adjustSegment=function(e,t){this.playCount=0,e[1]<e[0]?(this.frameModifier>0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(-1)),this.totalFrames=e[0]-e[1],this.timeCompleted=this.totalFrames,this.firstFrame=e[1],this.setCurrentRawFrameValue(this.totalFrames-.001-t)):e[1]>e[0]&&(this.frameModifier<0&&(this.playSpeed<0?this.setSpeed(-this.playSpeed):this.setDirection(1)),this.totalFrames=e[1]-e[0],this.timeCompleted=this.totalFrames,this.firstFrame=e[0],this.setCurrentRawFrameValue(.001+t)),this.trigger("segmentStart")},AnimationItem.prototype.setSegment=function(e,t){var r=-1;this.isPaused&&(this.currentRawFrame+this.firstFrame<e?r=e:this.currentRawFrame+this.firstFrame>t&&(r=t-e)),this.firstFrame=e,this.totalFrames=t-e,this.timeCompleted=this.totalFrames,-1!==r&&this.goToAndStop(r,!0)},AnimationItem.prototype.playSegments=function(e,t){if(t&&(this.segments.length=0),"object"===_typeof$4(e[0])){var r,n=e.length;for(r=0;r<n;r+=1)this.segments.push(e[r])}else this.segments.push(e);this.segments.length&&t&&this.adjustSegment(this.segments.shift(),0),this.isPaused&&this.play()},AnimationItem.prototype.resetSegments=function(e){this.segments.length=0,this.segments.push([this.animationData.ip,this.animationData.op]),e&&this.checkSegments(0)},AnimationItem.prototype.checkSegments=function(e){return!!this.segments.length&&(this.adjustSegment(this.segments.shift(),e),!0)},AnimationItem.prototype.destroy=function(e){e&&this.name!==e||!this.renderer||(this.renderer.destroy(),this.imagePreloader.destroy(),this.trigger("destroy"),this._cbs=null,this.onEnterFrame=null,this.onLoopComplete=null,this.onComplete=null,this.onSegmentStart=null,this.onDestroy=null,this.renderer=null,this.expressionsPlugin=null,this.imagePreloader=null,this.projectInterface=null)},AnimationItem.prototype.setCurrentRawFrameValue=function(e){this.currentRawFrame=e,this.gotoFrame()},AnimationItem.prototype.setSpeed=function(e){this.playSpeed=e,this.updaFrameModifier()},AnimationItem.prototype.setDirection=function(e){this.playDirection=e<0?-1:1,this.updaFrameModifier()},AnimationItem.prototype.setLoop=function(e){this.loop=e},AnimationItem.prototype.setVolume=function(e,t){t&&this.name!==t||this.audioController.setVolume(e)},AnimationItem.prototype.getVolume=function(){return this.audioController.getVolume()},AnimationItem.prototype.mute=function(e){e&&this.name!==e||this.audioController.mute()},AnimationItem.prototype.unmute=function(e){e&&this.name!==e||this.audioController.unmute()},AnimationItem.prototype.updaFrameModifier=function(){this.frameModifier=this.frameMult*this.playSpeed*this.playDirection,this.audioController.setRate(this.playSpeed*this.playDirection)},AnimationItem.prototype.getPath=function(){return this.path},AnimationItem.prototype.getAssetsPath=function(e){var t="";if(e.e)t=e.p;else if(this.assetsPath){var r=e.p;-1!==r.indexOf("images/")&&(r=r.split("/")[1]),t=this.assetsPath+r}else t=this.path,t+=e.u?e.u:"",t+=e.p;return t},AnimationItem.prototype.getAssetData=function(e){for(var t=0,r=this.assets.length;t<r;){if(e===this.assets[t].id)return this.assets[t];t+=1}return null},AnimationItem.prototype.hide=function(){this.renderer.hide()},AnimationItem.prototype.show=function(){this.renderer.show()},AnimationItem.prototype.getDuration=function(e){return e?this.totalFrames:this.totalFrames/this.frameRate},AnimationItem.prototype.updateDocumentData=function(e,t,r){try{this.renderer.getElementByPath(e).updateDocumentData(t,r)}catch(e){}},AnimationItem.prototype.trigger=function(e){if(this._cbs&&this._cbs[e])switch(e){case"enterFrame":this.triggerEvent(e,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameModifier));break;case"drawnFrame":this.drawnFrameEvent.currentTime=this.currentFrame,this.drawnFrameEvent.totalTime=this.totalFrames,this.drawnFrameEvent.direction=this.frameModifier,this.triggerEvent(e,this.drawnFrameEvent);break;case"loopComplete":this.triggerEvent(e,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult));break;case"complete":this.triggerEvent(e,new BMCompleteEvent(e,this.frameMult));break;case"segmentStart":this.triggerEvent(e,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames));break;case"destroy":this.triggerEvent(e,new BMDestroyEvent(e,this));break;default:this.triggerEvent(e)}"enterFrame"===e&&this.onEnterFrame&&this.onEnterFrame.call(this,new BMEnterFrameEvent(e,this.currentFrame,this.totalFrames,this.frameMult)),"loopComplete"===e&&this.onLoopComplete&&this.onLoopComplete.call(this,new BMCompleteLoopEvent(e,this.loop,this.playCount,this.frameMult)),"complete"===e&&this.onComplete&&this.onComplete.call(this,new BMCompleteEvent(e,this.frameMult)),"segmentStart"===e&&this.onSegmentStart&&this.onSegmentStart.call(this,new BMSegmentStartEvent(e,this.firstFrame,this.totalFrames)),"destroy"===e&&this.onDestroy&&this.onDestroy.call(this,new BMDestroyEvent(e,this))},AnimationItem.prototype.triggerRenderFrameError=function(e){var t=new BMRenderFrameErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)},AnimationItem.prototype.triggerConfigError=function(e){var t=new BMConfigErrorEvent(e,this.currentFrame);this.triggerEvent("error",t),this.onError&&this.onError.call(this,t)};var animationManager=function(){var e={},t=[],r=0,n=0,i=0,a=!0,o=!1;function s(e){for(var r=0,i=e.target;r<n;)t[r].animation===i&&(t.splice(r,1),r-=1,n-=1,i.isPaused||d()),r+=1}function l(e,r){if(!e)return null;for(var i=0;i<n;){if(t[i].elem===e&&null!==t[i].elem)return t[i].animation;i+=1}var a=new AnimationItem;return u(a,e),a.setData(e,r),a}function c(){i+=1,f()}function d(){i-=1}function u(e,r){e.addEventListener("destroy",s),e.addEventListener("_active",c),e.addEventListener("_idle",d),t.push({elem:r,animation:e}),n+=1}function p(e){var s,l=e-r;for(s=0;s<n;s+=1)t[s].animation.advanceTime(l);r=e,i&&!o?window.requestAnimationFrame(p):a=!0}function h(e){r=e,window.requestAnimationFrame(p)}function f(){!o&&i&&a&&(window.requestAnimationFrame(h),a=!1)}return e.registerAnimation=l,e.loadAnimation=function(e){var t=new AnimationItem;return u(t,null),t.setParams(e),t},e.setSpeed=function(e,r){var i;for(i=0;i<n;i+=1)t[i].animation.setSpeed(e,r)},e.setDirection=function(e,r){var i;for(i=0;i<n;i+=1)t[i].animation.setDirection(e,r)},e.play=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.play(e)},e.pause=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.pause(e)},e.stop=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.stop(e)},e.togglePause=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.togglePause(e)},e.searchAnimations=function(e,t,r){var n,i=[].concat([].slice.call(document.getElementsByClassName("lottie")),[].slice.call(document.getElementsByClassName("bodymovin"))),a=i.length;for(n=0;n<a;n+=1)r&&i[n].setAttribute("data-bm-type",r),l(i[n],e);if(t&&0===a){r||(r="svg");var o=document.getElementsByTagName("body")[0];o.innerText="";var s=createTag("div");s.style.width="100%",s.style.height="100%",s.setAttribute("data-bm-type",r),o.appendChild(s),l(s,e)}},e.resize=function(){var e;for(e=0;e<n;e+=1)t[e].animation.resize()},e.goToAndStop=function(e,r,i){var a;for(a=0;a<n;a+=1)t[a].animation.goToAndStop(e,r,i)},e.destroy=function(e){var r;for(r=n-1;r>=0;r-=1)t[r].animation.destroy(e)},e.freeze=function(){o=!0},e.unfreeze=function(){o=!1,f()},e.setVolume=function(e,r){var i;for(i=0;i<n;i+=1)t[i].animation.setVolume(e,r)},e.mute=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.mute(e)},e.unmute=function(e){var r;for(r=0;r<n;r+=1)t[r].animation.unmute(e)},e.getRegisteredAnimations=function(){var e,r=t.length,n=[];for(e=0;e<r;e+=1)n.push(t[e].animation);return n},e}(),BezierFactory=function(){var e={getBezierEasing:function(e,r,n,i,a){var o=a||("bez_"+e+"_"+r+"_"+n+"_"+i).replace(/\./g,"p");if(t[o])return t[o];var s=new d([e,r,n,i]);return t[o]=s,s}},t={},r=11,n=1/(r-1),i="function"==typeof Float32Array;function a(e,t){return 1-3*t+3*e}function o(e,t){return 3*t-6*e}function s(e){return 3*e}function l(e,t,r){return((a(t,r)*e+o(t,r))*e+s(t))*e}function c(e,t,r){return 3*a(t,r)*e*e+2*o(t,r)*e+s(t)}function d(e){this._p=e,this._mSampleValues=i?new Float32Array(r):new Array(r),this._precomputed=!1,this.get=this.get.bind(this)}return d.prototype={get:function(e){var t=this._p[0],r=this._p[1],n=this._p[2],i=this._p[3];return this._precomputed||this._precompute(),t===r&&n===i?e:0===e?0:1===e?1:l(this._getTForX(e),r,i)},_precompute:function(){var e=this._p[0],t=this._p[1],r=this._p[2],n=this._p[3];this._precomputed=!0,e===t&&r===n||this._calcSampleValues()},_calcSampleValues:function(){for(var e=this._p[0],t=this._p[2],i=0;i<r;++i)this._mSampleValues[i]=l(i*n,e,t)},_getTForX:function(e){for(var t=this._p[0],i=this._p[2],a=this._mSampleValues,o=0,s=1,d=r-1;s!==d&&a[s]<=e;++s)o+=n;var u=o+(e-a[--s])/(a[s+1]-a[s])*n,p=c(u,t,i);return p>=.001?function(e,t,r,n){for(var i=0;i<4;++i){var a=c(t,r,n);if(0===a)return t;t-=(l(t,r,n)-e)/a}return t}(e,u,t,i):0===p?u:function(e,t,r,n,i){var a,o,s=0;do{(a=l(o=t+(r-t)/2,n,i)-e)>0?r=o:t=o}while(Math.abs(a)>1e-7&&++s<10);return o}(e,o,o+n,t,i)}},e}(),pooling={double:function(e){return e.concat(createSizedArray(e.length))}},poolFactory=function(e,t,r){var n=0,i=e,a=createSizedArray(i);return{newElement:function(){return n?a[n-=1]:t()},release:function(e){n===i&&(a=pooling.double(a),i*=2),r&&r(e),a[n]=e,n+=1}}},bezierLengthPool=poolFactory(8,(function(){return{addedLength:0,percents:createTypedArray("float32",getDefaultCurveSegments()),lengths:createTypedArray("float32",getDefaultCurveSegments())}})),segmentsLengthPool=poolFactory(8,(function(){return{lengths:[],totalLength:0}}),(function(e){var t,r=e.lengths.length;for(t=0;t<r;t+=1)bezierLengthPool.release(e.lengths[t]);e.lengths.length=0}));function bezFunction(){var e=Math;function t(e,t,r,n,i,a){var o=e*n+t*i+r*a-i*n-a*e-r*t;return o>-.001&&o<.001}var r=function(e,t,r,n){var i,a,o,s,l,c,d=getDefaultCurveSegments(),u=0,p=[],h=[],f=bezierLengthPool.newElement();for(o=r.length,i=0;i<d;i+=1){for(l=i/(d-1),c=0,a=0;a<o;a+=1)s=bmPow(1-l,3)*e[a]+3*bmPow(1-l,2)*l*r[a]+3*(1-l)*bmPow(l,2)*n[a]+bmPow(l,3)*t[a],p[a]=s,null!==h[a]&&(c+=bmPow(p[a]-h[a],2)),h[a]=p[a];c&&(u+=c=bmSqrt(c)),f.percents[i]=l,f.lengths[i]=u}return f.addedLength=u,f};function n(e){this.segmentLength=0,this.points=new Array(e)}function i(e,t){this.partialLength=e,this.point=t}var a,o=(a={},function(e,r,o,s){var l=(e[0]+"_"+e[1]+"_"+r[0]+"_"+r[1]+"_"+o[0]+"_"+o[1]+"_"+s[0]+"_"+s[1]).replace(/\./g,"p");if(!a[l]){var c,d,u,p,h,f,m,g=getDefaultCurveSegments(),v=0,y=null;2===e.length&&(e[0]!==r[0]||e[1]!==r[1])&&t(e[0],e[1],r[0],r[1],e[0]+o[0],e[1]+o[1])&&t(e[0],e[1],r[0],r[1],r[0]+s[0],r[1]+s[1])&&(g=2);var b=new n(g);for(u=o.length,c=0;c<g;c+=1){for(m=createSizedArray(u),h=c/(g-1),f=0,d=0;d<u;d+=1)p=bmPow(1-h,3)*e[d]+3*bmPow(1-h,2)*h*(e[d]+o[d])+3*(1-h)*bmPow(h,2)*(r[d]+s[d])+bmPow(h,3)*r[d],m[d]=p,null!==y&&(f+=bmPow(m[d]-y[d],2));v+=f=bmSqrt(f),b.points[c]=new i(f,m),y=m}b.segmentLength=v,a[l]=b}return a[l]});function s(e,t){var r=t.percents,n=t.lengths,i=r.length,a=bmFloor((i-1)*e),o=e*t.addedLength,s=0;if(a===i-1||0===a||o===n[a])return r[a];for(var l=n[a]>o?-1:1,c=!0;c;)if(n[a]<=o&&n[a+1]>o?(s=(o-n[a])/(n[a+1]-n[a]),c=!1):a+=l,a<0||a>=i-1){if(a===i-1)return r[a];c=!1}return r[a]+(r[a+1]-r[a])*s}var l=createTypedArray("float32",8);return{getSegmentsLength:function(e){var t,n=segmentsLengthPool.newElement(),i=e.c,a=e.v,o=e.o,s=e.i,l=e._length,c=n.lengths,d=0;for(t=0;t<l-1;t+=1)c[t]=r(a[t],a[t+1],o[t],s[t+1]),d+=c[t].addedLength;return i&&l&&(c[t]=r(a[t],a[0],o[t],s[0]),d+=c[t].addedLength),n.totalLength=d,n},getNewSegment:function(t,r,n,i,a,o,c){a<0?a=0:a>1&&(a=1);var d,u=s(a,c),p=s(o=o>1?1:o,c),h=t.length,f=1-u,m=1-p,g=f*f*f,v=u*f*f*3,y=u*u*f*3,b=u*u*u,E=f*f*m,_=u*f*m+f*u*m+f*f*p,S=u*u*m+f*u*p+u*f*p,T=u*u*p,x=f*m*m,k=u*m*m+f*p*m+f*m*p,A=u*p*m+f*p*p+u*m*p,I=u*p*p,C=m*m*m,P=p*m*m+m*p*m+m*m*p,w=p*p*m+m*p*p+p*m*p,D=p*p*p;for(d=0;d<h;d+=1)l[4*d]=e.round(1e3*(g*t[d]+v*n[d]+y*i[d]+b*r[d]))/1e3,l[4*d+1]=e.round(1e3*(E*t[d]+_*n[d]+S*i[d]+T*r[d]))/1e3,l[4*d+2]=e.round(1e3*(x*t[d]+k*n[d]+A*i[d]+I*r[d]))/1e3,l[4*d+3]=e.round(1e3*(C*t[d]+P*n[d]+w*i[d]+D*r[d]))/1e3;return l},getPointInSegment:function(t,r,n,i,a,o){var l=s(a,o),c=1-l;return[e.round(1e3*(c*c*c*t[0]+(l*c*c+c*l*c+c*c*l)*n[0]+(l*l*c+c*l*l+l*c*l)*i[0]+l*l*l*r[0]))/1e3,e.round(1e3*(c*c*c*t[1]+(l*c*c+c*l*c+c*c*l)*n[1]+(l*l*c+c*l*l+l*c*l)*i[1]+l*l*l*r[1]))/1e3]},buildBezierData:o,pointOnLine2D:t,pointOnLine3D:function(r,n,i,a,o,s,l,c,d){if(0===i&&0===s&&0===d)return t(r,n,a,o,l,c);var u,p=e.sqrt(e.pow(a-r,2)+e.pow(o-n,2)+e.pow(s-i,2)),h=e.sqrt(e.pow(l-r,2)+e.pow(c-n,2)+e.pow(d-i,2)),f=e.sqrt(e.pow(l-a,2)+e.pow(c-o,2)+e.pow(d-s,2));return(u=p>h?p>f?p-h-f:f-h-p:f>h?f-h-p:h-p-f)>-1e-4&&u<1e-4}}}var bez=bezFunction(),initFrame=initialDefaultFrame,mathAbs=Math.abs;function interpolateValue(e,t){var r,n=this.offsetTime;"multidimensional"===this.propType&&(r=createTypedArray("float32",this.pv.length));for(var i,a,o,s,l,c,d,u,p,h=t.lastIndex,f=h,m=this.keyframes.length-1,g=!0;g;){if(i=this.keyframes[f],a=this.keyframes[f+1],f===m-1&&e>=a.t-n){i.h&&(i=a),h=0;break}if(a.t-n>e){h=f;break}f<m-1?f+=1:(h=0,g=!1)}o=this.keyframesMetadata[f]||{};var v,y=a.t-n,b=i.t-n;if(i.to){o.bezierData||(o.bezierData=bez.buildBezierData(i.s,a.s||i.e,i.to,i.ti));var E=o.bezierData;if(e>=y||e<b){var _=e>=y?E.points.length-1:0;for(l=E.points[_].point.length,s=0;s<l;s+=1)r[s]=E.points[_].point[s]}else{o.__fnct?p=o.__fnct:(p=BezierFactory.getBezierEasing(i.o.x,i.o.y,i.i.x,i.i.y,i.n).get,o.__fnct=p),c=p((e-b)/(y-b));var S,T=E.segmentLength*c,x=t.lastFrame<e&&t._lastKeyframeIndex===f?t._lastAddedLength:0;for(u=t.lastFrame<e&&t._lastKeyframeIndex===f?t._lastPoint:0,g=!0,d=E.points.length;g;){if(x+=E.points[u].partialLength,0===T||0===c||u===E.points.length-1){for(l=E.points[u].point.length,s=0;s<l;s+=1)r[s]=E.points[u].point[s];break}if(T>=x&&T<x+E.points[u+1].partialLength){for(S=(T-x)/E.points[u+1].partialLength,l=E.points[u].point.length,s=0;s<l;s+=1)r[s]=E.points[u].point[s]+(E.points[u+1].point[s]-E.points[u].point[s])*S;break}u<d-1?u+=1:g=!1}t._lastPoint=u,t._lastAddedLength=x-E.points[u].partialLength,t._lastKeyframeIndex=f}}else{var k,A,I,C,P;if(m=i.s.length,v=a.s||i.e,this.sh&&1!==i.h)e>=y?(r[0]=v[0],r[1]=v[1],r[2]=v[2]):e<=b?(r[0]=i.s[0],r[1]=i.s[1],r[2]=i.s[2]):quaternionToEuler(r,slerp(createQuaternion(i.s),createQuaternion(v),(e-b)/(y-b)));else for(f=0;f<m;f+=1)1!==i.h&&(e>=y?c=1:e<b?c=0:(i.o.x.constructor===Array?(o.__fnct||(o.__fnct=[]),o.__fnct[f]?p=o.__fnct[f]:(k=void 0===i.o.x[f]?i.o.x[0]:i.o.x[f],A=void 0===i.o.y[f]?i.o.y[0]:i.o.y[f],I=void 0===i.i.x[f]?i.i.x[0]:i.i.x[f],C=void 0===i.i.y[f]?i.i.y[0]:i.i.y[f],p=BezierFactory.getBezierEasing(k,A,I,C).get,o.__fnct[f]=p)):o.__fnct?p=o.__fnct:(k=i.o.x,A=i.o.y,I=i.i.x,C=i.i.y,p=BezierFactory.getBezierEasing(k,A,I,C).get,i.keyframeMetadata=p),c=p((e-b)/(y-b)))),v=a.s||i.e,P=1===i.h?i.s[f]:i.s[f]+(v[f]-i.s[f])*c,"multidimensional"===this.propType?r[f]=P:r=P}return t.lastIndex=h,r}function slerp(e,t,r){var n,i,a,o,s,l=[],c=e[0],d=e[1],u=e[2],p=e[3],h=t[0],f=t[1],m=t[2],g=t[3];return(i=c*h+d*f+u*m+p*g)<0&&(i=-i,h=-h,f=-f,m=-m,g=-g),1-i>1e-6?(n=Math.acos(i),a=Math.sin(n),o=Math.sin((1-r)*n)/a,s=Math.sin(r*n)/a):(o=1-r,s=r),l[0]=o*c+s*h,l[1]=o*d+s*f,l[2]=o*u+s*m,l[3]=o*p+s*g,l}function quaternionToEuler(e,t){var r=t[0],n=t[1],i=t[2],a=t[3],o=Math.atan2(2*n*a-2*r*i,1-2*n*n-2*i*i),s=Math.asin(2*r*n+2*i*a),l=Math.atan2(2*r*a-2*n*i,1-2*r*r-2*i*i);e[0]=o/degToRads,e[1]=s/degToRads,e[2]=l/degToRads}function createQuaternion(e){var t=e[0]*degToRads,r=e[1]*degToRads,n=e[2]*degToRads,i=Math.cos(t/2),a=Math.cos(r/2),o=Math.cos(n/2),s=Math.sin(t/2),l=Math.sin(r/2),c=Math.sin(n/2);return[s*l*o+i*a*c,s*a*o+i*l*c,i*l*o-s*a*c,i*a*o-s*l*c]}function getValueAtCurrentTime(){var e=this.comp.renderedFrame-this.offsetTime,t=this.keyframes[0].t-this.offsetTime,r=this.keyframes[this.keyframes.length-1].t-this.offsetTime;if(!(e===this._caching.lastFrame||this._caching.lastFrame!==initFrame&&(this._caching.lastFrame>=r&&e>=r||this._caching.lastFrame<t&&e<t))){this._caching.lastFrame>=e&&(this._caching._lastKeyframeIndex=-1,this._caching.lastIndex=0);var n=this.interpolateValue(e,this._caching);this.pv=n}return this._caching.lastFrame=e,this.pv}function setVValue(e){var t;if("unidimensional"===this.propType)t=e*this.mult,mathAbs(this.v-t)>1e-5&&(this.v=t,this._mdf=!0);else for(var r=0,n=this.v.length;r<n;)t=e[r]*this.mult,mathAbs(this.v[r]-t)>1e-5&&(this.v[r]=t,this._mdf=!0),r+=1}function processEffectsSequence(){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e;this.lock=!0,this._mdf=this._isFirstFrame;var t=this.effectsSequence.length,r=this.kf?this.pv:this.data.k;for(e=0;e<t;e+=1)r=this.effectsSequence[e](r);this.setVValue(r),this._isFirstFrame=!1,this.lock=!1,this.frameId=this.elem.globalData.frameId}}function addEffect(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function ValueProperty(e,t,r,n){this.propType="unidimensional",this.mult=r||1,this.data=t,this.v=r?t.k*r:t.k,this.pv=t.k,this._mdf=!1,this.elem=e,this.container=n,this.comp=e.comp,this.k=!1,this.kf=!1,this.vel=0,this.effectsSequence=[],this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function MultiDimensionalProperty(e,t,r,n){var i;this.propType="multidimensional",this.mult=r||1,this.data=t,this._mdf=!1,this.elem=e,this.container=n,this.comp=e.comp,this.k=!1,this.kf=!1,this.frameId=-1;var a=t.k.length;for(this.v=createTypedArray("float32",a),this.pv=createTypedArray("float32",a),this.vel=createTypedArray("float32",a),i=0;i<a;i+=1)this.v[i]=t.k[i]*this.mult,this.pv[i]=t.k[i];this._isFirstFrame=!0,this.effectsSequence=[],this.getValue=processEffectsSequence,this.setVValue=setVValue,this.addEffect=addEffect}function KeyframedValueProperty(e,t,r,n){this.propType="unidimensional",this.keyframes=t.k,this.keyframesMetadata=[],this.offsetTime=e.data.st,this.frameId=-1,this._caching={lastFrame:initFrame,lastIndex:0,value:0,_lastKeyframeIndex:-1},this.k=!0,this.kf=!0,this.data=t,this.mult=r||1,this.elem=e,this.container=n,this.comp=e.comp,this.v=initFrame,this.pv=initFrame,this._isFirstFrame=!0,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.addEffect=addEffect}function KeyframedMultidimensionalProperty(e,t,r,n){var i;this.propType="multidimensional";var a,o,s,l,c=t.k.length;for(i=0;i<c-1;i+=1)t.k[i].to&&t.k[i].s&&t.k[i+1]&&t.k[i+1].s&&(a=t.k[i].s,o=t.k[i+1].s,s=t.k[i].to,l=t.k[i].ti,(2===a.length&&(a[0]!==o[0]||a[1]!==o[1])&&bez.pointOnLine2D(a[0],a[1],o[0],o[1],a[0]+s[0],a[1]+s[1])&&bez.pointOnLine2D(a[0],a[1],o[0],o[1],o[0]+l[0],o[1]+l[1])||3===a.length&&(a[0]!==o[0]||a[1]!==o[1]||a[2]!==o[2])&&bez.pointOnLine3D(a[0],a[1],a[2],o[0],o[1],o[2],a[0]+s[0],a[1]+s[1],a[2]+s[2])&&bez.pointOnLine3D(a[0],a[1],a[2],o[0],o[1],o[2],o[0]+l[0],o[1]+l[1],o[2]+l[2]))&&(t.k[i].to=null,t.k[i].ti=null),a[0]===o[0]&&a[1]===o[1]&&0===s[0]&&0===s[1]&&0===l[0]&&0===l[1]&&(2===a.length||a[2]===o[2]&&0===s[2]&&0===l[2])&&(t.k[i].to=null,t.k[i].ti=null));this.effectsSequence=[getValueAtCurrentTime.bind(this)],this.data=t,this.keyframes=t.k,this.keyframesMetadata=[],this.offsetTime=e.data.st,this.k=!0,this.kf=!0,this._isFirstFrame=!0,this.mult=r||1,this.elem=e,this.container=n,this.comp=e.comp,this.getValue=processEffectsSequence,this.setVValue=setVValue,this.interpolateValue=interpolateValue,this.frameId=-1;var d=t.k[0].s.length;for(this.v=createTypedArray("float32",d),this.pv=createTypedArray("float32",d),i=0;i<d;i+=1)this.v[i]=initFrame,this.pv[i]=initFrame;this._caching={lastFrame:initFrame,lastIndex:0,value:createTypedArray("float32",d)},this.addEffect=addEffect}var PropertyFactory=(ob={getProp:function(e,t,r,n,i){var a;if(t.sid&&(t=e.globalData.slotManager.getProp(t)),t.k.length)if("number"==typeof t.k[0])a=new MultiDimensionalProperty(e,t,n,i);else switch(r){case 0:a=new KeyframedValueProperty(e,t,n,i);break;case 1:a=new KeyframedMultidimensionalProperty(e,t,n,i)}else a=new ValueProperty(e,t,n,i);return a.effectsSequence.length&&i.addDynamicProperty(a),a}},ob),ob;function DynamicPropertyContainer(){}DynamicPropertyContainer.prototype={addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&(this.dynamicProperties.push(e),this.container.addDynamicProperty(this),this._isAnimated=!0)},iterateDynamicProperties:function(){var e;this._mdf=!1;var t=this.dynamicProperties.length;for(e=0;e<t;e+=1)this.dynamicProperties[e].getValue(),this.dynamicProperties[e]._mdf&&(this._mdf=!0)},initDynamicPropertyContainer:function(e){this.container=e,this.dynamicProperties=[],this._mdf=!1,this._isAnimated=!1}};var pointPool=poolFactory(8,(function(){return createTypedArray("float32",2)}));function ShapePath(){this.c=!1,this._length=0,this._maxLength=8,this.v=createSizedArray(this._maxLength),this.o=createSizedArray(this._maxLength),this.i=createSizedArray(this._maxLength)}ShapePath.prototype.setPathData=function(e,t){this.c=e,this.setLength(t);for(var r=0;r<t;)this.v[r]=pointPool.newElement(),this.o[r]=pointPool.newElement(),this.i[r]=pointPool.newElement(),r+=1},ShapePath.prototype.setLength=function(e){for(;this._maxLength<e;)this.doubleArrayLength();this._length=e},ShapePath.prototype.doubleArrayLength=function(){this.v=this.v.concat(createSizedArray(this._maxLength)),this.i=this.i.concat(createSizedArray(this._maxLength)),this.o=this.o.concat(createSizedArray(this._maxLength)),this._maxLength*=2},ShapePath.prototype.setXYAt=function(e,t,r,n,i){var a;switch(this._length=Math.max(this._length,n+1),this._length>=this._maxLength&&this.doubleArrayLength(),r){case"v":a=this.v;break;case"i":a=this.i;break;case"o":a=this.o;break;default:a=[]}(!a[n]||a[n]&&!i)&&(a[n]=pointPool.newElement()),a[n][0]=e,a[n][1]=t},ShapePath.prototype.setTripleAt=function(e,t,r,n,i,a,o,s){this.setXYAt(e,t,"v",o,s),this.setXYAt(r,n,"o",o,s),this.setXYAt(i,a,"i",o,s)},ShapePath.prototype.reverse=function(){var e=new ShapePath;e.setPathData(this.c,this._length);var t=this.v,r=this.o,n=this.i,i=0;this.c&&(e.setTripleAt(t[0][0],t[0][1],n[0][0],n[0][1],r[0][0],r[0][1],0,!1),i=1);var a,o=this._length-1,s=this._length;for(a=i;a<s;a+=1)e.setTripleAt(t[o][0],t[o][1],n[o][0],n[o][1],r[o][0],r[o][1],a,!1),o-=1;return e},ShapePath.prototype.length=function(){return this._length};var shapePool=(factory=poolFactory(4,(function(){return new ShapePath}),(function(e){var t,r=e._length;for(t=0;t<r;t+=1)pointPool.release(e.v[t]),pointPool.release(e.i[t]),pointPool.release(e.o[t]),e.v[t]=null,e.i[t]=null,e.o[t]=null;e._length=0,e.c=!1})),factory.clone=function(e){var t,r=factory.newElement(),n=void 0===e._length?e.v.length:e._length;for(r.setLength(n),r.c=e.c,t=0;t<n;t+=1)r.setTripleAt(e.v[t][0],e.v[t][1],e.o[t][0],e.o[t][1],e.i[t][0],e.i[t][1],t);return r},factory),factory;function ShapeCollection(){this._length=0,this._maxLength=4,this.shapes=createSizedArray(this._maxLength)}ShapeCollection.prototype.addShape=function(e){this._length===this._maxLength&&(this.shapes=this.shapes.concat(createSizedArray(this._maxLength)),this._maxLength*=2),this.shapes[this._length]=e,this._length+=1},ShapeCollection.prototype.releaseShapes=function(){var e;for(e=0;e<this._length;e+=1)shapePool.release(this.shapes[e]);this._length=0};var shapeCollectionPool=function(){var e={newShapeCollection:function(){return t?n[t-=1]:new ShapeCollection},release:function(e){var i,a=e._length;for(i=0;i<a;i+=1)shapePool.release(e.shapes[i]);e._length=0,t===r&&(n=pooling.double(n),r*=2),n[t]=e,t+=1}},t=0,r=4,n=createSizedArray(r);return e}(),ShapePropertyFactory=function(){var e=-999999;function t(e,t,r){var n,i,a,o,s,l,c,d,u,p=r.lastIndex,h=this.keyframes;if(e<h[0].t-this.offsetTime)n=h[0].s[0],a=!0,p=0;else if(e>=h[h.length-1].t-this.offsetTime)n=h[h.length-1].s?h[h.length-1].s[0]:h[h.length-2].e[0],a=!0;else{for(var f,m,g,v=p,y=h.length-1,b=!0;b&&(f=h[v],!((m=h[v+1]).t-this.offsetTime>e));)v<y-1?v+=1:b=!1;if(g=this.keyframesMetadata[v]||{},p=v,!(a=1===f.h)){if(e>=m.t-this.offsetTime)d=1;else if(e<f.t-this.offsetTime)d=0;else{var E;g.__fnct?E=g.__fnct:(E=BezierFactory.getBezierEasing(f.o.x,f.o.y,f.i.x,f.i.y).get,g.__fnct=E),d=E((e-(f.t-this.offsetTime))/(m.t-this.offsetTime-(f.t-this.offsetTime)))}i=m.s?m.s[0]:f.e[0]}n=f.s[0]}for(l=t._length,c=n.i[0].length,r.lastIndex=p,o=0;o<l;o+=1)for(s=0;s<c;s+=1)u=a?n.i[o][s]:n.i[o][s]+(i.i[o][s]-n.i[o][s])*d,t.i[o][s]=u,u=a?n.o[o][s]:n.o[o][s]+(i.o[o][s]-n.o[o][s])*d,t.o[o][s]=u,u=a?n.v[o][s]:n.v[o][s]+(i.v[o][s]-n.v[o][s])*d,t.v[o][s]=u}function r(){var t=this.comp.renderedFrame-this.offsetTime,r=this.keyframes[0].t-this.offsetTime,n=this.keyframes[this.keyframes.length-1].t-this.offsetTime,i=this._caching.lastFrame;return i!==e&&(i<r&&t<r||i>n&&t>n)||(this._caching.lastIndex=i<t?this._caching.lastIndex:0,this.interpolateShape(t,this.pv,this._caching)),this._caching.lastFrame=t,this.pv}function n(){this.paths=this.localShapeCollection}function i(e){(function(e,t){if(e._length!==t._length||e.c!==t.c)return!1;var r,n=e._length;for(r=0;r<n;r+=1)if(e.v[r][0]!==t.v[r][0]||e.v[r][1]!==t.v[r][1]||e.o[r][0]!==t.o[r][0]||e.o[r][1]!==t.o[r][1]||e.i[r][0]!==t.i[r][0]||e.i[r][1]!==t.i[r][1])return!1;return!0})(this.v,e)||(this.v=shapePool.clone(e),this.localShapeCollection.releaseShapes(),this.localShapeCollection.addShape(this.v),this._mdf=!0,this.paths=this.localShapeCollection)}function a(){if(this.elem.globalData.frameId!==this.frameId)if(this.effectsSequence.length)if(this.lock)this.setVValue(this.pv);else{var e,t;this.lock=!0,this._mdf=!1,e=this.kf?this.pv:this.data.ks?this.data.ks.k:this.data.pt.k;var r=this.effectsSequence.length;for(t=0;t<r;t+=1)e=this.effectsSequence[t](e);this.setVValue(e),this.lock=!1,this.frameId=this.elem.globalData.frameId}else this._mdf=!1}function o(e,t,r){this.propType="shape",this.comp=e.comp,this.container=e,this.elem=e,this.data=t,this.k=!1,this.kf=!1,this._mdf=!1;var i=3===r?t.pt.k:t.ks.k;this.v=shapePool.clone(i),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.reset=n,this.effectsSequence=[]}function s(e){this.effectsSequence.push(e),this.container.addDynamicProperty(this)}function l(t,i,a){this.propType="shape",this.comp=t.comp,this.elem=t,this.container=t,this.offsetTime=t.data.st,this.keyframes=3===a?i.pt.k:i.ks.k,this.keyframesMetadata=[],this.k=!0,this.kf=!0;var o=this.keyframes[0].s[0].i.length;this.v=shapePool.newElement(),this.v.setPathData(this.keyframes[0].s[0].c,o),this.pv=shapePool.clone(this.v),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.paths.addShape(this.v),this.lastFrame=e,this.reset=n,this._caching={lastFrame:e,lastIndex:0},this.effectsSequence=[r.bind(this)]}o.prototype.interpolateShape=t,o.prototype.getValue=a,o.prototype.setVValue=i,o.prototype.addEffect=s,l.prototype.getValue=a,l.prototype.interpolateShape=t,l.prototype.setVValue=i,l.prototype.addEffect=s;var c=function(){var e=roundCorner;function t(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,4),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.paths=this.localShapeCollection,this.localShapeCollection.addShape(this.v),this.d=t.d,this.elem=e,this.comp=e.comp,this.frameId=-1,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertEllToPath())}return t.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertEllToPath())},convertEllToPath:function(){var t=this.p.v[0],r=this.p.v[1],n=this.s.v[0]/2,i=this.s.v[1]/2,a=3!==this.d,o=this.v;o.v[0][0]=t,o.v[0][1]=r-i,o.v[1][0]=a?t+n:t-n,o.v[1][1]=r,o.v[2][0]=t,o.v[2][1]=r+i,o.v[3][0]=a?t-n:t+n,o.v[3][1]=r,o.i[0][0]=a?t-n*e:t+n*e,o.i[0][1]=r-i,o.i[1][0]=a?t+n:t-n,o.i[1][1]=r-i*e,o.i[2][0]=a?t+n*e:t-n*e,o.i[2][1]=r+i,o.i[3][0]=a?t-n:t+n,o.i[3][1]=r+i*e,o.o[0][0]=a?t+n*e:t-n*e,o.o[0][1]=r-i,o.o[1][0]=a?t+n:t-n,o.o[1][1]=r+i*e,o.o[2][0]=a?t-n*e:t+n*e,o.o[2][1]=r+i,o.o[3][0]=a?t-n:t+n,o.o[3][1]=r-i*e}},extendPrototype([DynamicPropertyContainer],t),t}(),d=function(){function e(e,t){this.v=shapePool.newElement(),this.v.setPathData(!0,0),this.elem=e,this.comp=e.comp,this.data=t,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),1===t.sy?(this.ir=PropertyFactory.getProp(e,t.ir,0,0,this),this.is=PropertyFactory.getProp(e,t.is,0,.01,this),this.convertToPath=this.convertStarToPath):this.convertToPath=this.convertPolygonToPath,this.pt=PropertyFactory.getProp(e,t.pt,0,0,this),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,degToRads,this),this.or=PropertyFactory.getProp(e,t.or,0,0,this),this.os=PropertyFactory.getProp(e,t.os,0,.01,this),this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertToPath())}return e.prototype={reset:n,getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertToPath())},convertStarToPath:function(){var e,t,r,n,i=2*Math.floor(this.pt.v),a=2*Math.PI/i,o=!0,s=this.or.v,l=this.ir.v,c=this.os.v,d=this.is.v,u=2*Math.PI*s/(2*i),p=2*Math.PI*l/(2*i),h=-Math.PI/2;h+=this.r.v;var f=3===this.data.d?-1:1;for(this.v._length=0,e=0;e<i;e+=1){r=o?c:d,n=o?u:p;var m=(t=o?s:l)*Math.cos(h),g=t*Math.sin(h),v=0===m&&0===g?0:g/Math.sqrt(m*m+g*g),y=0===m&&0===g?0:-m/Math.sqrt(m*m+g*g);m+=+this.p.v[0],g+=+this.p.v[1],this.v.setTripleAt(m,g,m-v*n*r*f,g-y*n*r*f,m+v*n*r*f,g+y*n*r*f,e,!0),o=!o,h+=a*f}},convertPolygonToPath:function(){var e,t=Math.floor(this.pt.v),r=2*Math.PI/t,n=this.or.v,i=this.os.v,a=2*Math.PI*n/(4*t),o=.5*-Math.PI,s=3===this.data.d?-1:1;for(o+=this.r.v,this.v._length=0,e=0;e<t;e+=1){var l=n*Math.cos(o),c=n*Math.sin(o),d=0===l&&0===c?0:c/Math.sqrt(l*l+c*c),u=0===l&&0===c?0:-l/Math.sqrt(l*l+c*c);l+=+this.p.v[0],c+=+this.p.v[1],this.v.setTripleAt(l,c,l-d*a*i*s,c-u*a*i*s,l+d*a*i*s,c+u*a*i*s,e,!0),o+=r*s}this.paths.length=0,this.paths[0]=this.v}},extendPrototype([DynamicPropertyContainer],e),e}(),u=function(){function e(e,t){this.v=shapePool.newElement(),this.v.c=!0,this.localShapeCollection=shapeCollectionPool.newShapeCollection(),this.localShapeCollection.addShape(this.v),this.paths=this.localShapeCollection,this.elem=e,this.comp=e.comp,this.frameId=-1,this.d=t.d,this.initDynamicPropertyContainer(e),this.p=PropertyFactory.getProp(e,t.p,1,0,this),this.s=PropertyFactory.getProp(e,t.s,1,0,this),this.r=PropertyFactory.getProp(e,t.r,0,0,this),this.dynamicProperties.length?this.k=!0:(this.k=!1,this.convertRectToPath())}return e.prototype={convertRectToPath:function(){var e=this.p.v[0],t=this.p.v[1],r=this.s.v[0]/2,n=this.s.v[1]/2,i=bmMin(r,n,this.r.v),a=i*(1-roundCorner);this.v._length=0,2===this.d||1===this.d?(this.v.setTripleAt(e+r,t-n+i,e+r,t-n+i,e+r,t-n+a,0,!0),this.v.setTripleAt(e+r,t+n-i,e+r,t+n-a,e+r,t+n-i,1,!0),0!==i?(this.v.setTripleAt(e+r-i,t+n,e+r-i,t+n,e+r-a,t+n,2,!0),this.v.setTripleAt(e-r+i,t+n,e-r+a,t+n,e-r+i,t+n,3,!0),this.v.setTripleAt(e-r,t+n-i,e-r,t+n-i,e-r,t+n-a,4,!0),this.v.setTripleAt(e-r,t-n+i,e-r,t-n+a,e-r,t-n+i,5,!0),this.v.setTripleAt(e-r+i,t-n,e-r+i,t-n,e-r+a,t-n,6,!0),this.v.setTripleAt(e+r-i,t-n,e+r-a,t-n,e+r-i,t-n,7,!0)):(this.v.setTripleAt(e-r,t+n,e-r+a,t+n,e-r,t+n,2),this.v.setTripleAt(e-r,t-n,e-r,t-n+a,e-r,t-n,3))):(this.v.setTripleAt(e+r,t-n+i,e+r,t-n+a,e+r,t-n+i,0,!0),0!==i?(this.v.setTripleAt(e+r-i,t-n,e+r-i,t-n,e+r-a,t-n,1,!0),this.v.setTripleAt(e-r+i,t-n,e-r+a,t-n,e-r+i,t-n,2,!0),this.v.setTripleAt(e-r,t-n+i,e-r,t-n+i,e-r,t-n+a,3,!0),this.v.setTripleAt(e-r,t+n-i,e-r,t+n-a,e-r,t+n-i,4,!0),this.v.setTripleAt(e-r+i,t+n,e-r+i,t+n,e-r+a,t+n,5,!0),this.v.setTripleAt(e+r-i,t+n,e+r-a,t+n,e+r-i,t+n,6,!0),this.v.setTripleAt(e+r,t+n-i,e+r,t+n-i,e+r,t+n-a,7,!0)):(this.v.setTripleAt(e-r,t-n,e-r+a,t-n,e-r,t-n,1,!0),this.v.setTripleAt(e-r,t+n,e-r,t+n-a,e-r,t+n,2,!0),this.v.setTripleAt(e+r,t+n,e+r-a,t+n,e+r,t+n,3,!0)))},getValue:function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf&&this.convertRectToPath())},reset:n},extendPrototype([DynamicPropertyContainer],e),e}(),p={getShapeProp:function(e,t,r){var n;return 3===r||4===r?n=(3===r?t.pt:t.ks).k.length?new l(e,t,r):new o(e,t,r):5===r?n=new u(e,t):6===r?n=new c(e,t):7===r&&(n=new d(e,t)),n.k&&e.addDynamicProperty(n),n},getConstructorFunction:function(){return o},getKeyframedConstructorFunction:function(){return l}};return p}(),Matrix=function(){var e=Math.cos,t=Math.sin,r=Math.tan,n=Math.round;function i(){return this.props[0]=1,this.props[1]=0,this.props[2]=0,this.props[3]=0,this.props[4]=0,this.props[5]=1,this.props[6]=0,this.props[7]=0,this.props[8]=0,this.props[9]=0,this.props[10]=1,this.props[11]=0,this.props[12]=0,this.props[13]=0,this.props[14]=0,this.props[15]=1,this}function a(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1)}function o(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(1,0,0,0,0,n,-i,0,0,i,n,0,0,0,0,1)}function s(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(n,0,i,0,0,1,0,0,-i,0,n,0,0,0,0,1)}function l(r){if(0===r)return this;var n=e(r),i=t(r);return this._t(n,-i,0,0,i,n,0,0,0,0,1,0,0,0,0,1)}function c(e,t){return this._t(1,t,e,1,0,0)}function d(e,t){return this.shear(r(e),r(t))}function u(n,i){var a=e(i),o=t(i);return this._t(a,o,0,0,-o,a,0,0,0,0,1,0,0,0,0,1)._t(1,0,0,0,r(n),1,0,0,0,0,1,0,0,0,0,1)._t(a,-o,0,0,o,a,0,0,0,0,1,0,0,0,0,1)}function p(e,t,r){return r||0===r||(r=1),1===e&&1===t&&1===r?this:this._t(e,0,0,0,0,t,0,0,0,0,r,0,0,0,0,1)}function h(e,t,r,n,i,a,o,s,l,c,d,u,p,h,f,m){return this.props[0]=e,this.props[1]=t,this.props[2]=r,this.props[3]=n,this.props[4]=i,this.props[5]=a,this.props[6]=o,this.props[7]=s,this.props[8]=l,this.props[9]=c,this.props[10]=d,this.props[11]=u,this.props[12]=p,this.props[13]=h,this.props[14]=f,this.props[15]=m,this}function f(e,t,r){return r=r||0,0!==e||0!==t||0!==r?this._t(1,0,0,0,0,1,0,0,0,0,1,0,e,t,r,1):this}function m(e,t,r,n,i,a,o,s,l,c,d,u,p,h,f,m){var g=this.props;if(1===e&&0===t&&0===r&&0===n&&0===i&&1===a&&0===o&&0===s&&0===l&&0===c&&1===d&&0===u)return g[12]=g[12]*e+g[15]*p,g[13]=g[13]*a+g[15]*h,g[14]=g[14]*d+g[15]*f,g[15]*=m,this._identityCalculated=!1,this;var v=g[0],y=g[1],b=g[2],E=g[3],_=g[4],S=g[5],T=g[6],x=g[7],k=g[8],A=g[9],I=g[10],C=g[11],P=g[12],w=g[13],D=g[14],R=g[15];return g[0]=v*e+y*i+b*l+E*p,g[1]=v*t+y*a+b*c+E*h,g[2]=v*r+y*o+b*d+E*f,g[3]=v*n+y*s+b*u+E*m,g[4]=_*e+S*i+T*l+x*p,g[5]=_*t+S*a+T*c+x*h,g[6]=_*r+S*o+T*d+x*f,g[7]=_*n+S*s+T*u+x*m,g[8]=k*e+A*i+I*l+C*p,g[9]=k*t+A*a+I*c+C*h,g[10]=k*r+A*o+I*d+C*f,g[11]=k*n+A*s+I*u+C*m,g[12]=P*e+w*i+D*l+R*p,g[13]=P*t+w*a+D*c+R*h,g[14]=P*r+w*o+D*d+R*f,g[15]=P*n+w*s+D*u+R*m,this._identityCalculated=!1,this}function g(e){var t=e.props;return this.transform(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],t[8],t[9],t[10],t[11],t[12],t[13],t[14],t[15])}function v(){return this._identityCalculated||(this._identity=!(1!==this.props[0]||0!==this.props[1]||0!==this.props[2]||0!==this.props[3]||0!==this.props[4]||1!==this.props[5]||0!==this.props[6]||0!==this.props[7]||0!==this.props[8]||0!==this.props[9]||1!==this.props[10]||0!==this.props[11]||0!==this.props[12]||0!==this.props[13]||0!==this.props[14]||1!==this.props[15]),this._identityCalculated=!0),this._identity}function y(e){for(var t=0;t<16;){if(e.props[t]!==this.props[t])return!1;t+=1}return!0}function b(e){var t;for(t=0;t<16;t+=1)e.props[t]=this.props[t];return e}function E(e){var t;for(t=0;t<16;t+=1)this.props[t]=e[t]}function _(e,t,r){return{x:e*this.props[0]+t*this.props[4]+r*this.props[8]+this.props[12],y:e*this.props[1]+t*this.props[5]+r*this.props[9]+this.props[13],z:e*this.props[2]+t*this.props[6]+r*this.props[10]+this.props[14]}}function S(e,t,r){return e*this.props[0]+t*this.props[4]+r*this.props[8]+this.props[12]}function T(e,t,r){return e*this.props[1]+t*this.props[5]+r*this.props[9]+this.props[13]}function x(e,t,r){return e*this.props[2]+t*this.props[6]+r*this.props[10]+this.props[14]}function k(){var e=this.props[0]*this.props[5]-this.props[1]*this.props[4],t=this.props[5]/e,r=-this.props[1]/e,n=-this.props[4]/e,i=this.props[0]/e,a=(this.props[4]*this.props[13]-this.props[5]*this.props[12])/e,o=-(this.props[0]*this.props[13]-this.props[1]*this.props[12])/e,s=new Matrix;return s.props[0]=t,s.props[1]=r,s.props[4]=n,s.props[5]=i,s.props[12]=a,s.props[13]=o,s}function A(e){return this.getInverseMatrix().applyToPointArray(e[0],e[1],e[2]||0)}function I(e){var t,r=e.length,n=[];for(t=0;t<r;t+=1)n[t]=A(e[t]);return n}function C(e,t,r){var n=createTypedArray("float32",6);if(this.isIdentity())n[0]=e[0],n[1]=e[1],n[2]=t[0],n[3]=t[1],n[4]=r[0],n[5]=r[1];else{var i=this.props[0],a=this.props[1],o=this.props[4],s=this.props[5],l=this.props[12],c=this.props[13];n[0]=e[0]*i+e[1]*o+l,n[1]=e[0]*a+e[1]*s+c,n[2]=t[0]*i+t[1]*o+l,n[3]=t[0]*a+t[1]*s+c,n[4]=r[0]*i+r[1]*o+l,n[5]=r[0]*a+r[1]*s+c}return n}function P(e,t,r){return this.isIdentity()?[e,t,r]:[e*this.props[0]+t*this.props[4]+r*this.props[8]+this.props[12],e*this.props[1]+t*this.props[5]+r*this.props[9]+this.props[13],e*this.props[2]+t*this.props[6]+r*this.props[10]+this.props[14]]}function w(e,t){if(this.isIdentity())return e+","+t;var r=this.props;return Math.round(100*(e*r[0]+t*r[4]+r[12]))/100+","+Math.round(100*(e*r[1]+t*r[5]+r[13]))/100}function D(){for(var e=0,t=this.props,r="matrix3d(";e<16;)r+=n(1e4*t[e])/1e4,r+=15===e?")":",",e+=1;return r}function R(e){return e<1e-6&&e>0||e>-1e-6&&e<0?n(1e4*e)/1e4:e}function L(){var e=this.props;return"matrix("+R(e[0])+","+R(e[1])+","+R(e[4])+","+R(e[5])+","+R(e[12])+","+R(e[13])+")"}return function(){this.reset=i,this.rotate=a,this.rotateX=o,this.rotateY=s,this.rotateZ=l,this.skew=d,this.skewFromAxis=u,this.shear=c,this.scale=p,this.setTransform=h,this.translate=f,this.transform=m,this.multiply=g,this.applyToPoint=_,this.applyToX=S,this.applyToY=T,this.applyToZ=x,this.applyToPointArray=P,this.applyToTriplePoints=C,this.applyToPointStringified=w,this.toCSS=D,this.to2dCSS=L,this.clone=b,this.cloneFromProps=E,this.equals=y,this.inversePoints=I,this.inversePoint=A,this.getInverseMatrix=k,this._t=this.transform,this.isIdentity=v,this._identity=!0,this._identityCalculated=!1,this.props=createTypedArray("float32",16),this.reset()}}();function _typeof$3(e){return _typeof$3="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$3(e)}var lottie={};function setLocation(e){setLocationHref(e)}function searchAnimations(){animationManager.searchAnimations()}function setSubframeRendering(e){setSubframeEnabled(e)}function setPrefix(e){setIdPrefix(e)}function loadAnimation(e){return animationManager.loadAnimation(e)}function setQuality(e){if("string"==typeof e)switch(e){case"high":setDefaultCurveSegments(200);break;default:case"medium":setDefaultCurveSegments(50);break;case"low":setDefaultCurveSegments(10)}else!isNaN(e)&&e>1&&setDefaultCurveSegments(e)}function inBrowser(){return"undefined"!=typeof navigator}function installPlugin(e,t){"expressions"===e&&setExpressionsPlugin(t)}function getFactory(e){switch(e){case"propertyFactory":return PropertyFactory;case"shapePropertyFactory":return ShapePropertyFactory;case"matrix":return Matrix;default:return null}}function checkReady(){"complete"===document.readyState&&(clearInterval(readyStateCheckInterval),searchAnimations())}function getQueryVariable(e){for(var t=queryString.split("&"),r=0;r<t.length;r+=1){var n=t[r].split("=");if(decodeURIComponent(n[0])==e)return decodeURIComponent(n[1])}return null}lottie.play=animationManager.play,lottie.pause=animationManager.pause,lottie.setLocationHref=setLocation,lottie.togglePause=animationManager.togglePause,lottie.setSpeed=animationManager.setSpeed,lottie.setDirection=animationManager.setDirection,lottie.stop=animationManager.stop,lottie.searchAnimations=searchAnimations,lottie.registerAnimation=animationManager.registerAnimation,lottie.loadAnimation=loadAnimation,lottie.setSubframeRendering=setSubframeRendering,lottie.resize=animationManager.resize,lottie.goToAndStop=animationManager.goToAndStop,lottie.destroy=animationManager.destroy,lottie.setQuality=setQuality,lottie.inBrowser=inBrowser,lottie.installPlugin=installPlugin,lottie.freeze=animationManager.freeze,lottie.unfreeze=animationManager.unfreeze,lottie.setVolume=animationManager.setVolume,lottie.mute=animationManager.mute,lottie.unmute=animationManager.unmute,lottie.getRegisteredAnimations=animationManager.getRegisteredAnimations,lottie.useWebWorker=setWebWorker,lottie.setIDPrefix=setPrefix,lottie.__getFactory=getFactory,lottie.version="5.13.0";var queryString="",scripts=document.getElementsByTagName("script"),index=scripts.length-1,myScript=scripts[index]||{src:""};queryString=myScript.src?myScript.src.replace(/^[^\?]+\??/,""):"",getQueryVariable("renderer");var readyStateCheckInterval=setInterval(checkReady,100);try{"object"!==_typeof$3(exports$1)&&(window.bodymovin=lottie)}catch(e){}var ShapeModifiers=function(){var e={},t={};return e.registerModifier=function(e,r){t[e]||(t[e]=r)},e.getModifier=function(e,r,n){return new t[e](r,n)},e}();function ShapeModifier(){}function TrimModifier(){}function PuckerAndBloatModifier(){}ShapeModifier.prototype.initModifierProperties=function(){},ShapeModifier.prototype.addShapeToModifier=function(){},ShapeModifier.prototype.addShape=function(e){if(!this.closed){e.sh.container.addDynamicProperty(e.sh);var t={shape:e.sh,data:e,localShapeCollection:shapeCollectionPool.newShapeCollection()};this.shapes.push(t),this.addShapeToModifier(t),this._isAnimated&&e.setAsAnimated()}},ShapeModifier.prototype.init=function(e,t){this.shapes=[],this.elem=e,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t),this.frameId=initialDefaultFrame,this.closed=!1,this.k=!1,this.dynamicProperties.length?this.k=!0:this.getValue(!0)},ShapeModifier.prototype.processKeys=function(){this.elem.globalData.frameId!==this.frameId&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties())},extendPrototype([DynamicPropertyContainer],ShapeModifier),extendPrototype([ShapeModifier],TrimModifier),TrimModifier.prototype.initModifierProperties=function(e,t){this.s=PropertyFactory.getProp(e,t.s,0,.01,this),this.e=PropertyFactory.getProp(e,t.e,0,.01,this),this.o=PropertyFactory.getProp(e,t.o,0,0,this),this.sValue=0,this.eValue=0,this.getValue=this.processKeys,this.m=t.m,this._isAnimated=!!this.s.effectsSequence.length||!!this.e.effectsSequence.length||!!this.o.effectsSequence.length},TrimModifier.prototype.addShapeToModifier=function(e){e.pathsData=[]},TrimModifier.prototype.calculateShapeEdges=function(e,t,r,n,i){var a=[];t<=1?a.push({s:e,e:t}):e>=1?a.push({s:e-1,e:t-1}):(a.push({s:e,e:1}),a.push({s:0,e:t-1}));var o,s,l=[],c=a.length;for(o=0;o<c;o+=1){var d,u;(s=a[o]).e*i<n||s.s*i>n+r||(d=s.s*i<=n?0:(s.s*i-n)/r,u=s.e*i>=n+r?1:(s.e*i-n)/r,l.push([d,u]))}return l.length||l.push([0,0]),l},TrimModifier.prototype.releasePathsData=function(e){var t,r=e.length;for(t=0;t<r;t+=1)segmentsLengthPool.release(e[t]);return e.length=0,e},TrimModifier.prototype.processShapes=function(e){var t,r,n,i;if(this._mdf||e){var a=this.o.v%360/360;if(a<0&&(a+=1),(t=this.s.v>1?1+a:this.s.v<0?0+a:this.s.v+a)>(r=this.e.v>1?1+a:this.e.v<0?0+a:this.e.v+a)){var o=t;t=r,r=o}t=1e-4*Math.round(1e4*t),r=1e-4*Math.round(1e4*r),this.sValue=t,this.eValue=r}else t=this.sValue,r=this.eValue;var s,l,c,d,u,p=this.shapes.length,h=0;if(r===t)for(i=0;i<p;i+=1)this.shapes[i].localShapeCollection.releaseShapes(),this.shapes[i].shape._mdf=!0,this.shapes[i].shape.paths=this.shapes[i].localShapeCollection,this._mdf&&(this.shapes[i].pathsData.length=0);else if(1===r&&0===t||0===r&&1===t){if(this._mdf)for(i=0;i<p;i+=1)this.shapes[i].pathsData.length=0,this.shapes[i].shape._mdf=!0}else{var f,m,g=[];for(i=0;i<p;i+=1)if((f=this.shapes[i]).shape._mdf||this._mdf||e||2===this.m){if(l=(n=f.shape.paths)._length,u=0,!f.shape._mdf&&f.pathsData.length)u=f.totalShapeLength;else{for(c=this.releasePathsData(f.pathsData),s=0;s<l;s+=1)d=bez.getSegmentsLength(n.shapes[s]),c.push(d),u+=d.totalLength;f.totalShapeLength=u,f.pathsData=c}h+=u,f.shape._mdf=!0}else f.shape.paths=f.localShapeCollection;var v,y=t,b=r,E=0;for(i=p-1;i>=0;i-=1)if((f=this.shapes[i]).shape._mdf){for((m=f.localShapeCollection).releaseShapes(),2===this.m&&p>1?(v=this.calculateShapeEdges(t,r,f.totalShapeLength,E,h),E+=f.totalShapeLength):v=[[y,b]],l=v.length,s=0;s<l;s+=1){y=v[s][0],b=v[s][1],g.length=0,b<=1?g.push({s:f.totalShapeLength*y,e:f.totalShapeLength*b}):y>=1?g.push({s:f.totalShapeLength*(y-1),e:f.totalShapeLength*(b-1)}):(g.push({s:f.totalShapeLength*y,e:f.totalShapeLength}),g.push({s:0,e:f.totalShapeLength*(b-1)}));var _=this.addShapes(f,g[0]);if(g[0].s!==g[0].e){if(g.length>1)if(f.shape.paths.shapes[f.shape.paths._length-1].c){var S=_.pop();this.addPaths(_,m),_=this.addShapes(f,g[1],S)}else this.addPaths(_,m),_=this.addShapes(f,g[1]);this.addPaths(_,m)}}f.shape.paths=m}}},TrimModifier.prototype.addPaths=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)t.addShape(e[r])},TrimModifier.prototype.addSegment=function(e,t,r,n,i,a,o){i.setXYAt(t[0],t[1],"o",a),i.setXYAt(r[0],r[1],"i",a+1),o&&i.setXYAt(e[0],e[1],"v",a),i.setXYAt(n[0],n[1],"v",a+1)},TrimModifier.prototype.addSegmentFromArray=function(e,t,r,n){t.setXYAt(e[1],e[5],"o",r),t.setXYAt(e[2],e[6],"i",r+1),n&&t.setXYAt(e[0],e[4],"v",r),t.setXYAt(e[3],e[7],"v",r+1)},TrimModifier.prototype.addShapes=function(e,t,r){var n,i,a,o,s,l,c,d,u=e.pathsData,p=e.shape.paths.shapes,h=e.shape.paths._length,f=0,m=[],g=!0;for(r?(s=r._length,d=r._length):(r=shapePool.newElement(),s=0,d=0),m.push(r),n=0;n<h;n+=1){for(l=u[n].lengths,r.c=p[n].c,a=p[n].c?l.length:l.length+1,i=1;i<a;i+=1)if(f+(o=l[i-1]).addedLength<t.s)f+=o.addedLength,r.c=!1;else{if(f>t.e){r.c=!1;break}t.s<=f&&t.e>=f+o.addedLength?(this.addSegment(p[n].v[i-1],p[n].o[i-1],p[n].i[i],p[n].v[i],r,s,g),g=!1):(c=bez.getNewSegment(p[n].v[i-1],p[n].v[i],p[n].o[i-1],p[n].i[i],(t.s-f)/o.addedLength,(t.e-f)/o.addedLength,l[i-1]),this.addSegmentFromArray(c,r,s,g),g=!1,r.c=!1),f+=o.addedLength,s+=1}if(p[n].c&&l.length){if(o=l[i-1],f<=t.e){var v=l[i-1].addedLength;t.s<=f&&t.e>=f+v?(this.addSegment(p[n].v[i-1],p[n].o[i-1],p[n].i[0],p[n].v[0],r,s,g),g=!1):(c=bez.getNewSegment(p[n].v[i-1],p[n].v[0],p[n].o[i-1],p[n].i[0],(t.s-f)/v,(t.e-f)/v,l[i-1]),this.addSegmentFromArray(c,r,s,g),g=!1,r.c=!1)}else r.c=!1;f+=o.addedLength,s+=1}if(r._length&&(r.setXYAt(r.v[d][0],r.v[d][1],"i",d),r.setXYAt(r.v[r._length-1][0],r.v[r._length-1][1],"o",r._length-1)),f>t.e)break;n<h-1&&(r=shapePool.newElement(),g=!0,m.push(r),s=0)}return m},extendPrototype([ShapeModifier],PuckerAndBloatModifier),PuckerAndBloatModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this._isAnimated=!!this.amount.effectsSequence.length},PuckerAndBloatModifier.prototype.processPath=function(e,t){var r=t/100,n=[0,0],i=e._length,a=0;for(a=0;a<i;a+=1)n[0]+=e.v[a][0],n[1]+=e.v[a][1];n[0]/=i,n[1]/=i;var o,s,l,c,d,u,p=shapePool.newElement();for(p.c=e.c,a=0;a<i;a+=1)o=e.v[a][0]+(n[0]-e.v[a][0])*r,s=e.v[a][1]+(n[1]-e.v[a][1])*r,l=e.o[a][0]+(n[0]-e.o[a][0])*-r,c=e.o[a][1]+(n[1]-e.o[a][1])*-r,d=e.i[a][0]+(n[0]-e.i[a][0])*-r,u=e.i[a][1]+(n[1]-e.i[a][1])*-r,p.setTripleAt(o,s,l,c,d,u,a);return p},PuckerAndBloatModifier.prototype.processShapes=function(e){var t,r,n,i,a,o,s=this.shapes.length,l=this.amount.v;if(0!==l)for(r=0;r<s;r+=1){if(o=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||e)for(o.releaseShapes(),a.shape._mdf=!0,t=a.shape.paths.shapes,i=a.shape.paths._length,n=0;n<i;n+=1)o.addShape(this.processPath(t[n],l));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var TransformPropertyFactory=function(){var e=[0,0];function t(e,t,r){if(this.elem=e,this.frameId=-1,this.propType="transform",this.data=t,this.v=new Matrix,this.pre=new Matrix,this.appliedTransformations=0,this.initDynamicPropertyContainer(r||e),t.p&&t.p.s?(this.px=PropertyFactory.getProp(e,t.p.x,0,0,this),this.py=PropertyFactory.getProp(e,t.p.y,0,0,this),t.p.z&&(this.pz=PropertyFactory.getProp(e,t.p.z,0,0,this))):this.p=PropertyFactory.getProp(e,t.p||{k:[0,0,0]},1,0,this),t.rx){if(this.rx=PropertyFactory.getProp(e,t.rx,0,degToRads,this),this.ry=PropertyFactory.getProp(e,t.ry,0,degToRads,this),this.rz=PropertyFactory.getProp(e,t.rz,0,degToRads,this),t.or.k[0].ti){var n,i=t.or.k.length;for(n=0;n<i;n+=1)t.or.k[n].to=null,t.or.k[n].ti=null}this.or=PropertyFactory.getProp(e,t.or,1,degToRads,this),this.or.sh=!0}else this.r=PropertyFactory.getProp(e,t.r||{k:0},0,degToRads,this);t.sk&&(this.sk=PropertyFactory.getProp(e,t.sk,0,degToRads,this),this.sa=PropertyFactory.getProp(e,t.sa,0,degToRads,this)),this.a=PropertyFactory.getProp(e,t.a||{k:[0,0,0]},1,0,this),this.s=PropertyFactory.getProp(e,t.s||{k:[100,100,100]},1,.01,this),t.o?this.o=PropertyFactory.getProp(e,t.o,0,.01,e):this.o={_mdf:!1,v:1},this._isDirty=!0,this.dynamicProperties.length||this.getValue(!0)}return t.prototype={applyToMatrix:function(e){var t=this._mdf;this.iterateDynamicProperties(),this._mdf=this._mdf||t,this.a&&e.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.s&&e.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&e.skewFromAxis(-this.sk.v,this.sa.v),this.r?e.rotate(-this.r.v):e.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.data.p.s?this.data.p.z?e.translate(this.px.v,this.py.v,-this.pz.v):e.translate(this.px.v,this.py.v,0):e.translate(this.p.v[0],this.p.v[1],-this.p.v[2])},getValue:function(t){if(this.elem.globalData.frameId!==this.frameId){if(this._isDirty&&(this.precalculateMatrix(),this._isDirty=!1),this.iterateDynamicProperties(),this._mdf||t){var r;if(this.v.cloneFromProps(this.pre.props),this.appliedTransformations<1&&this.v.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations<2&&this.v.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.sk&&this.appliedTransformations<3&&this.v.skewFromAxis(-this.sk.v,this.sa.v),this.r&&this.appliedTransformations<4?this.v.rotate(-this.r.v):!this.r&&this.appliedTransformations<4&&this.v.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.autoOriented){var n,i;if(r=this.elem.globalData.frameRate,this.p&&this.p.keyframes&&this.p.getValueAtTime)this.p._caching.lastFrame+this.p.offsetTime<=this.p.keyframes[0].t?(n=this.p.getValueAtTime((this.p.keyframes[0].t+.01)/r,0),i=this.p.getValueAtTime(this.p.keyframes[0].t/r,0)):this.p._caching.lastFrame+this.p.offsetTime>=this.p.keyframes[this.p.keyframes.length-1].t?(n=this.p.getValueAtTime(this.p.keyframes[this.p.keyframes.length-1].t/r,0),i=this.p.getValueAtTime((this.p.keyframes[this.p.keyframes.length-1].t-.05)/r,0)):(n=this.p.pv,i=this.p.getValueAtTime((this.p._caching.lastFrame+this.p.offsetTime-.01)/r,this.p.offsetTime));else if(this.px&&this.px.keyframes&&this.py.keyframes&&this.px.getValueAtTime&&this.py.getValueAtTime){n=[],i=[];var a=this.px,o=this.py;a._caching.lastFrame+a.offsetTime<=a.keyframes[0].t?(n[0]=a.getValueAtTime((a.keyframes[0].t+.01)/r,0),n[1]=o.getValueAtTime((o.keyframes[0].t+.01)/r,0),i[0]=a.getValueAtTime(a.keyframes[0].t/r,0),i[1]=o.getValueAtTime(o.keyframes[0].t/r,0)):a._caching.lastFrame+a.offsetTime>=a.keyframes[a.keyframes.length-1].t?(n[0]=a.getValueAtTime(a.keyframes[a.keyframes.length-1].t/r,0),n[1]=o.getValueAtTime(o.keyframes[o.keyframes.length-1].t/r,0),i[0]=a.getValueAtTime((a.keyframes[a.keyframes.length-1].t-.01)/r,0),i[1]=o.getValueAtTime((o.keyframes[o.keyframes.length-1].t-.01)/r,0)):(n=[a.pv,o.pv],i[0]=a.getValueAtTime((a._caching.lastFrame+a.offsetTime-.01)/r,a.offsetTime),i[1]=o.getValueAtTime((o._caching.lastFrame+o.offsetTime-.01)/r,o.offsetTime))}else n=i=e;this.v.rotate(-Math.atan2(n[1]-i[1],n[0]-i[0]))}this.data.p&&this.data.p.s?this.data.p.z?this.v.translate(this.px.v,this.py.v,-this.pz.v):this.v.translate(this.px.v,this.py.v,0):this.v.translate(this.p.v[0],this.p.v[1],-this.p.v[2])}this.frameId=this.elem.globalData.frameId}},precalculateMatrix:function(){if(this.appliedTransformations=0,this.pre.reset(),!this.a.effectsSequence.length&&(this.pre.translate(-this.a.v[0],-this.a.v[1],this.a.v[2]),this.appliedTransformations=1,!this.s.effectsSequence.length)){if(this.pre.scale(this.s.v[0],this.s.v[1],this.s.v[2]),this.appliedTransformations=2,this.sk){if(this.sk.effectsSequence.length||this.sa.effectsSequence.length)return;this.pre.skewFromAxis(-this.sk.v,this.sa.v),this.appliedTransformations=3}this.r?this.r.effectsSequence.length||(this.pre.rotate(-this.r.v),this.appliedTransformations=4):this.rz.effectsSequence.length||this.ry.effectsSequence.length||this.rx.effectsSequence.length||this.or.effectsSequence.length||(this.pre.rotateZ(-this.rz.v).rotateY(this.ry.v).rotateX(this.rx.v).rotateZ(-this.or.v[2]).rotateY(this.or.v[1]).rotateX(this.or.v[0]),this.appliedTransformations=4)}},autoOrient:function(){}},extendPrototype([DynamicPropertyContainer],t),t.prototype.addDynamicProperty=function(e){this._addDynamicProperty(e),this.elem.addDynamicProperty(e),this._isDirty=!0},t.prototype._addDynamicProperty=DynamicPropertyContainer.prototype.addDynamicProperty,{getTransformProperty:function(e,r,n){return new t(e,r,n)}}}();function RepeaterModifier(){}function RoundCornersModifier(){}function floatEqual(e,t){return 1e5*Math.abs(e-t)<=Math.min(Math.abs(e),Math.abs(t))}function floatZero(e){return Math.abs(e)<=1e-5}function lerp(e,t,r){return e*(1-r)+t*r}function lerpPoint(e,t,r){return[lerp(e[0],t[0],r),lerp(e[1],t[1],r)]}function quadRoots(e,t,r){if(0===e)return[];var n=t*t-4*e*r;if(n<0)return[];var i=-t/(2*e);if(0===n)return[i];var a=Math.sqrt(n)/(2*e);return[i-a,i+a]}function polynomialCoefficients(e,t,r,n){return[3*t-e-3*r+n,3*e-6*t+3*r,-3*e+3*t,e]}function singlePoint(e){return new PolynomialBezier(e,e,e,e,!1)}function PolynomialBezier(e,t,r,n,i){i&&pointEqual(e,t)&&(t=lerpPoint(e,n,1/3)),i&&pointEqual(r,n)&&(r=lerpPoint(e,n,2/3));var a=polynomialCoefficients(e[0],t[0],r[0],n[0]),o=polynomialCoefficients(e[1],t[1],r[1],n[1]);this.a=[a[0],o[0]],this.b=[a[1],o[1]],this.c=[a[2],o[2]],this.d=[a[3],o[3]],this.points=[e,t,r,n]}function extrema(e,t){var r=e.points[0][t],n=e.points[e.points.length-1][t];if(r>n){var i=n;n=r,r=i}for(var a=quadRoots(3*e.a[t],2*e.b[t],e.c[t]),o=0;o<a.length;o+=1)if(a[o]>0&&a[o]<1){var s=e.point(a[o])[t];s<r?r=s:s>n&&(n=s)}return{min:r,max:n}}function intersectData(e,t,r){var n=e.boundingBox();return{cx:n.cx,cy:n.cy,width:n.width,height:n.height,bez:e,t:(t+r)/2,t1:t,t2:r}}function splitData(e){var t=e.bez.split(.5);return[intersectData(t[0],e.t1,e.t),intersectData(t[1],e.t,e.t2)]}function boxIntersect(e,t){return 2*Math.abs(e.cx-t.cx)<e.width+t.width&&2*Math.abs(e.cy-t.cy)<e.height+t.height}function intersectsImpl(e,t,r,n,i,a){if(boxIntersect(e,t))if(r>=a||e.width<=n&&e.height<=n&&t.width<=n&&t.height<=n)i.push([e.t,t.t]);else{var o=splitData(e),s=splitData(t);intersectsImpl(o[0],s[0],r+1,n,i,a),intersectsImpl(o[0],s[1],r+1,n,i,a),intersectsImpl(o[1],s[0],r+1,n,i,a),intersectsImpl(o[1],s[1],r+1,n,i,a)}}function crossProduct(e,t){return[e[1]*t[2]-e[2]*t[1],e[2]*t[0]-e[0]*t[2],e[0]*t[1]-e[1]*t[0]]}function lineIntersection(e,t,r,n){var i=[e[0],e[1],1],a=[t[0],t[1],1],o=[r[0],r[1],1],s=[n[0],n[1],1],l=crossProduct(crossProduct(i,a),crossProduct(o,s));return floatZero(l[2])?null:[l[0]/l[2],l[1]/l[2]]}function polarOffset(e,t,r){return[e[0]+Math.cos(t)*r,e[1]-Math.sin(t)*r]}function pointDistance(e,t){return Math.hypot(e[0]-t[0],e[1]-t[1])}function pointEqual(e,t){return floatEqual(e[0],t[0])&&floatEqual(e[1],t[1])}function ZigZagModifier(){}function setPoint(e,t,r,n,i,a,o){var s=r-Math.PI/2,l=r+Math.PI/2,c=t[0]+Math.cos(r)*n*i,d=t[1]-Math.sin(r)*n*i;e.setTripleAt(c,d,c+Math.cos(s)*a,d-Math.sin(s)*a,c+Math.cos(l)*o,d-Math.sin(l)*o,e.length())}function getPerpendicularVector(e,t){var r=[t[0]-e[0],t[1]-e[1]],n=.5*-Math.PI;return[Math.cos(n)*r[0]-Math.sin(n)*r[1],Math.sin(n)*r[0]+Math.cos(n)*r[1]]}function getProjectingAngle(e,t){var r=0===t?e.length()-1:t-1,n=(t+1)%e.length(),i=getPerpendicularVector(e.v[r],e.v[n]);return Math.atan2(0,1)-Math.atan2(i[1],i[0])}function zigZagCorner(e,t,r,n,i,a,o){var s=getProjectingAngle(t,r),l=t.v[r%t._length],c=t.v[0===r?t._length-1:r-1],d=t.v[(r+1)%t._length],u=2===a?Math.sqrt(Math.pow(l[0]-c[0],2)+Math.pow(l[1]-c[1],2)):0,p=2===a?Math.sqrt(Math.pow(l[0]-d[0],2)+Math.pow(l[1]-d[1],2)):0;setPoint(e,t.v[r%t._length],s,o,n,p/(2*(i+1)),u/(2*(i+1)))}function zigZagSegment(e,t,r,n,i,a){for(var o=0;o<n;o+=1){var s=(o+1)/(n+1),l=2===i?Math.sqrt(Math.pow(t.points[3][0]-t.points[0][0],2)+Math.pow(t.points[3][1]-t.points[0][1],2)):0,c=t.normalAngle(s);setPoint(e,t.point(s),c,a,r,l/(2*(n+1)),l/(2*(n+1))),a=-a}return a}function linearOffset(e,t,r){var n=Math.atan2(t[0]-e[0],t[1]-e[1]);return[polarOffset(e,n,r),polarOffset(t,n,r)]}function offsetSegment(e,t){var r,n,i,a,o,s,l;r=(l=linearOffset(e.points[0],e.points[1],t))[0],n=l[1],i=(l=linearOffset(e.points[1],e.points[2],t))[0],a=l[1],o=(l=linearOffset(e.points[2],e.points[3],t))[0],s=l[1];var c=lineIntersection(r,n,i,a);null===c&&(c=n);var d=lineIntersection(o,s,i,a);return null===d&&(d=o),new PolynomialBezier(r,c,d,s)}function joinLines(e,t,r,n,i){var a=t.points[3],o=r.points[0];if(3===n)return a;if(pointEqual(a,o))return a;if(2===n){var s=-t.tangentAngle(1),l=-r.tangentAngle(0)+Math.PI,c=lineIntersection(a,polarOffset(a,s+Math.PI/2,100),o,polarOffset(o,s+Math.PI/2,100)),d=c?pointDistance(c,a):pointDistance(a,o)/2,u=polarOffset(a,s,2*d*roundCorner);return e.setXYAt(u[0],u[1],"o",e.length()-1),u=polarOffset(o,l,2*d*roundCorner),e.setTripleAt(o[0],o[1],o[0],o[1],u[0],u[1],e.length()),o}var p=lineIntersection(pointEqual(a,t.points[2])?t.points[0]:t.points[2],a,o,pointEqual(o,r.points[1])?r.points[3]:r.points[1]);return p&&pointDistance(p,a)<i?(e.setTripleAt(p[0],p[1],p[0],p[1],p[0],p[1],e.length()),p):a}function getIntersection(e,t){var r=e.intersections(t);return r.length&&floatEqual(r[0][0],1)&&r.shift(),r.length?r[0]:null}function pruneSegmentIntersection(e,t){var r=e.slice(),n=t.slice(),i=getIntersection(e[e.length-1],t[0]);return i&&(r[e.length-1]=e[e.length-1].split(i[0])[0],n[0]=t[0].split(i[1])[1]),e.length>1&&t.length>1&&(i=getIntersection(e[0],t[t.length-1]))?[[e[0].split(i[0])[0]],[t[t.length-1].split(i[1])[1]]]:[r,n]}function pruneIntersections(e){for(var t,r=1;r<e.length;r+=1)t=pruneSegmentIntersection(e[r-1],e[r]),e[r-1]=t[0],e[r]=t[1];return e.length>1&&(t=pruneSegmentIntersection(e[e.length-1],e[0]),e[e.length-1]=t[0],e[0]=t[1]),e}function offsetSegmentSplit(e,t){var r,n,i,a,o=e.inflectionPoints();if(0===o.length)return[offsetSegment(e,t)];if(1===o.length||floatEqual(o[1],1))return r=(i=e.split(o[0]))[0],n=i[1],[offsetSegment(r,t),offsetSegment(n,t)];r=(i=e.split(o[0]))[0];var s=(o[1]-o[0])/(1-o[0]);return a=(i=i[1].split(s))[0],n=i[1],[offsetSegment(r,t),offsetSegment(a,t),offsetSegment(n,t)]}function OffsetPathModifier(){}function getFontProperties(e){for(var t=e.fStyle?e.fStyle.split(" "):[],r="normal",n="normal",i=t.length,a=0;a<i;a+=1)switch(t[a].toLowerCase()){case"italic":n="italic";break;case"bold":r="700";break;case"black":r="900";break;case"medium":r="500";break;case"regular":case"normal":r="400";break;case"light":case"thin":r="200"}return{style:n,weight:e.fWeight||r}}extendPrototype([ShapeModifier],RepeaterModifier),RepeaterModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.c=PropertyFactory.getProp(e,t.c,0,null,this),this.o=PropertyFactory.getProp(e,t.o,0,null,this),this.tr=TransformPropertyFactory.getTransformProperty(e,t.tr,this),this.so=PropertyFactory.getProp(e,t.tr.so,0,.01,this),this.eo=PropertyFactory.getProp(e,t.tr.eo,0,.01,this),this.data=t,this.dynamicProperties.length||this.getValue(!0),this._isAnimated=!!this.dynamicProperties.length,this.pMatrix=new Matrix,this.rMatrix=new Matrix,this.sMatrix=new Matrix,this.tMatrix=new Matrix,this.matrix=new Matrix},RepeaterModifier.prototype.applyTransforms=function(e,t,r,n,i,a){var o=a?-1:1,s=n.s.v[0]+(1-n.s.v[0])*(1-i),l=n.s.v[1]+(1-n.s.v[1])*(1-i);e.translate(n.p.v[0]*o*i,n.p.v[1]*o*i,n.p.v[2]),t.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),t.rotate(-n.r.v*o*i),t.translate(n.a.v[0],n.a.v[1],n.a.v[2]),r.translate(-n.a.v[0],-n.a.v[1],n.a.v[2]),r.scale(a?1/s:s,a?1/l:l),r.translate(n.a.v[0],n.a.v[1],n.a.v[2])},RepeaterModifier.prototype.init=function(e,t,r,n){for(this.elem=e,this.arr=t,this.pos=r,this.elemsData=n,this._currentCopies=0,this._elements=[],this._groups=[],this.frameId=-1,this.initDynamicPropertyContainer(e),this.initModifierProperties(e,t[r]);r>0;)r-=1,this._elements.unshift(t[r]);this.dynamicProperties.length?this.k=!0:this.getValue(!0)},RepeaterModifier.prototype.resetElements=function(e){var t,r=e.length;for(t=0;t<r;t+=1)e[t]._processed=!1,"gr"===e[t].ty&&this.resetElements(e[t].it)},RepeaterModifier.prototype.cloneElements=function(e){var t=JSON.parse(JSON.stringify(e));return this.resetElements(t),t},RepeaterModifier.prototype.changeGroupRender=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)e[r]._render=t,"gr"===e[r].ty&&this.changeGroupRender(e[r].it,t)},RepeaterModifier.prototype.processShapes=function(e){var t,r,n,i,a,o=!1;if(this._mdf||e){var s,l=Math.ceil(this.c.v);if(this._groups.length<l){for(;this._groups.length<l;){var c={it:this.cloneElements(this._elements),ty:"gr"};c.it.push({a:{a:0,ix:1,k:[0,0]},nm:"Transform",o:{a:0,ix:7,k:100},p:{a:0,ix:2,k:[0,0]},r:{a:1,ix:6,k:[{s:0,e:0,t:0},{s:0,e:0,t:1}]},s:{a:0,ix:3,k:[100,100]},sa:{a:0,ix:5,k:0},sk:{a:0,ix:4,k:0},ty:"tr"}),this.arr.splice(0,0,c),this._groups.splice(0,0,c),this._currentCopies+=1}this.elem.reloadShapes(),o=!0}for(a=0,n=0;n<=this._groups.length-1;n+=1){if(s=a<l,this._groups[n]._render=s,this.changeGroupRender(this._groups[n].it,s),!s){var d=this.elemsData[n].it,u=d[d.length-1];0!==u.transform.op.v?(u.transform.op._mdf=!0,u.transform.op.v=0):u.transform.op._mdf=!1}a+=1}this._currentCopies=l;var p=this.o.v,h=p%1,f=p>0?Math.floor(p):Math.ceil(p),m=this.pMatrix.props,g=this.rMatrix.props,v=this.sMatrix.props;this.pMatrix.reset(),this.rMatrix.reset(),this.sMatrix.reset(),this.tMatrix.reset(),this.matrix.reset();var y,b,E=0;if(p>0){for(;E<f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),E+=1;h&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,h,!1),E+=h)}else if(p<0){for(;E>f;)this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!0),E-=1;h&&(this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,-h,!0),E-=h)}for(n=1===this.data.m?0:this._currentCopies-1,i=1===this.data.m?1:-1,a=this._currentCopies;a;){if(b=(r=(t=this.elemsData[n].it)[t.length-1].transform.mProps.v.props).length,t[t.length-1].transform.mProps._mdf=!0,t[t.length-1].transform.op._mdf=!0,t[t.length-1].transform.op.v=1===this._currentCopies?this.so.v:this.so.v+(this.eo.v-this.so.v)*(n/(this._currentCopies-1)),0!==E){for((0!==n&&1===i||n!==this._currentCopies-1&&-1===i)&&this.applyTransforms(this.pMatrix,this.rMatrix,this.sMatrix,this.tr,1,!1),this.matrix.transform(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],g[8],g[9],g[10],g[11],g[12],g[13],g[14],g[15]),this.matrix.transform(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],v[8],v[9],v[10],v[11],v[12],v[13],v[14],v[15]),this.matrix.transform(m[0],m[1],m[2],m[3],m[4],m[5],m[6],m[7],m[8],m[9],m[10],m[11],m[12],m[13],m[14],m[15]),y=0;y<b;y+=1)r[y]=this.matrix.props[y];this.matrix.reset()}else for(this.matrix.reset(),y=0;y<b;y+=1)r[y]=this.matrix.props[y];E+=1,a-=1,n+=i}}else for(a=this._currentCopies,n=0,i=1;a;)r=(t=this.elemsData[n].it)[t.length-1].transform.mProps.v.props,t[t.length-1].transform.mProps._mdf=!1,t[t.length-1].transform.op._mdf=!1,a-=1,n+=i;return o},RepeaterModifier.prototype.addShape=function(){},extendPrototype([ShapeModifier],RoundCornersModifier),RoundCornersModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.rd=PropertyFactory.getProp(e,t.r,0,null,this),this._isAnimated=!!this.rd.effectsSequence.length},RoundCornersModifier.prototype.processPath=function(e,t){var r,n=shapePool.newElement();n.c=e.c;var i,a,o,s,l,c,d,u,p,h,f,m,g=e._length,v=0;for(r=0;r<g;r+=1)i=e.v[r],o=e.o[r],a=e.i[r],i[0]===o[0]&&i[1]===o[1]&&i[0]===a[0]&&i[1]===a[1]?0!==r&&r!==g-1||e.c?(s=0===r?e.v[g-1]:e.v[r-1],c=(l=Math.sqrt(Math.pow(i[0]-s[0],2)+Math.pow(i[1]-s[1],2)))?Math.min(l/2,t)/l:0,d=f=i[0]+(s[0]-i[0])*c,u=m=i[1]-(i[1]-s[1])*c,p=d-(d-i[0])*roundCorner,h=u-(u-i[1])*roundCorner,n.setTripleAt(d,u,p,h,f,m,v),v+=1,s=r===g-1?e.v[0]:e.v[r+1],c=(l=Math.sqrt(Math.pow(i[0]-s[0],2)+Math.pow(i[1]-s[1],2)))?Math.min(l/2,t)/l:0,d=p=i[0]+(s[0]-i[0])*c,u=h=i[1]+(s[1]-i[1])*c,f=d-(d-i[0])*roundCorner,m=u-(u-i[1])*roundCorner,n.setTripleAt(d,u,p,h,f,m,v),v+=1):(n.setTripleAt(i[0],i[1],o[0],o[1],a[0],a[1],v),v+=1):(n.setTripleAt(e.v[r][0],e.v[r][1],e.o[r][0],e.o[r][1],e.i[r][0],e.i[r][1],v),v+=1);return n},RoundCornersModifier.prototype.processShapes=function(e){var t,r,n,i,a,o,s=this.shapes.length,l=this.rd.v;if(0!==l)for(r=0;r<s;r+=1){if(o=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||e)for(o.releaseShapes(),a.shape._mdf=!0,t=a.shape.paths.shapes,i=a.shape.paths._length,n=0;n<i;n+=1)o.addShape(this.processPath(t[n],l));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},PolynomialBezier.prototype.point=function(e){return[((this.a[0]*e+this.b[0])*e+this.c[0])*e+this.d[0],((this.a[1]*e+this.b[1])*e+this.c[1])*e+this.d[1]]},PolynomialBezier.prototype.derivative=function(e){return[(3*e*this.a[0]+2*this.b[0])*e+this.c[0],(3*e*this.a[1]+2*this.b[1])*e+this.c[1]]},PolynomialBezier.prototype.tangentAngle=function(e){var t=this.derivative(e);return Math.atan2(t[1],t[0])},PolynomialBezier.prototype.normalAngle=function(e){var t=this.derivative(e);return Math.atan2(t[0],t[1])},PolynomialBezier.prototype.inflectionPoints=function(){var e=this.a[1]*this.b[0]-this.a[0]*this.b[1];if(floatZero(e))return[];var t=-.5*(this.a[1]*this.c[0]-this.a[0]*this.c[1])/e,r=t*t-1/3*(this.b[1]*this.c[0]-this.b[0]*this.c[1])/e;if(r<0)return[];var n=Math.sqrt(r);return floatZero(n)?n>0&&n<1?[t]:[]:[t-n,t+n].filter((function(e){return e>0&&e<1}))},PolynomialBezier.prototype.split=function(e){if(e<=0)return[singlePoint(this.points[0]),this];if(e>=1)return[this,singlePoint(this.points[this.points.length-1])];var t=lerpPoint(this.points[0],this.points[1],e),r=lerpPoint(this.points[1],this.points[2],e),n=lerpPoint(this.points[2],this.points[3],e),i=lerpPoint(t,r,e),a=lerpPoint(r,n,e),o=lerpPoint(i,a,e);return[new PolynomialBezier(this.points[0],t,i,o,!0),new PolynomialBezier(o,a,n,this.points[3],!0)]},PolynomialBezier.prototype.bounds=function(){return{x:extrema(this,0),y:extrema(this,1)}},PolynomialBezier.prototype.boundingBox=function(){var e=this.bounds();return{left:e.x.min,right:e.x.max,top:e.y.min,bottom:e.y.max,width:e.x.max-e.x.min,height:e.y.max-e.y.min,cx:(e.x.max+e.x.min)/2,cy:(e.y.max+e.y.min)/2}},PolynomialBezier.prototype.intersections=function(e,t,r){void 0===t&&(t=2),void 0===r&&(r=7);var n=[];return intersectsImpl(intersectData(this,0,1),intersectData(e,0,1),0,t,n,r),n},PolynomialBezier.shapeSegment=function(e,t){var r=(t+1)%e.length();return new PolynomialBezier(e.v[t],e.o[t],e.i[r],e.v[r],!0)},PolynomialBezier.shapeSegmentInverted=function(e,t){var r=(t+1)%e.length();return new PolynomialBezier(e.v[r],e.i[r],e.o[t],e.v[t],!0)},extendPrototype([ShapeModifier],ZigZagModifier),ZigZagModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amplitude=PropertyFactory.getProp(e,t.s,0,null,this),this.frequency=PropertyFactory.getProp(e,t.r,0,null,this),this.pointsType=PropertyFactory.getProp(e,t.pt,0,null,this),this._isAnimated=0!==this.amplitude.effectsSequence.length||0!==this.frequency.effectsSequence.length||0!==this.pointsType.effectsSequence.length},ZigZagModifier.prototype.processPath=function(e,t,r,n){var i=e._length,a=shapePool.newElement();if(a.c=e.c,e.c||(i-=1),0===i)return a;var o=-1,s=PolynomialBezier.shapeSegment(e,0);zigZagCorner(a,e,0,t,r,n,o);for(var l=0;l<i;l+=1)o=zigZagSegment(a,s,t,r,n,-o),s=l!==i-1||e.c?PolynomialBezier.shapeSegment(e,(l+1)%i):null,zigZagCorner(a,e,l+1,t,r,n,o);return a},ZigZagModifier.prototype.processShapes=function(e){var t,r,n,i,a,o,s=this.shapes.length,l=this.amplitude.v,c=Math.max(0,Math.round(this.frequency.v)),d=this.pointsType.v;if(0!==l)for(r=0;r<s;r+=1){if(o=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||e)for(o.releaseShapes(),a.shape._mdf=!0,t=a.shape.paths.shapes,i=a.shape.paths._length,n=0;n<i;n+=1)o.addShape(this.processPath(t[n],l,c,d));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)},extendPrototype([ShapeModifier],OffsetPathModifier),OffsetPathModifier.prototype.initModifierProperties=function(e,t){this.getValue=this.processKeys,this.amount=PropertyFactory.getProp(e,t.a,0,null,this),this.miterLimit=PropertyFactory.getProp(e,t.ml,0,null,this),this.lineJoin=t.lj,this._isAnimated=0!==this.amount.effectsSequence.length},OffsetPathModifier.prototype.processPath=function(e,t,r,n){var i=shapePool.newElement();i.c=e.c;var a,o,s,l=e.length();e.c||(l-=1);var c=[];for(a=0;a<l;a+=1)s=PolynomialBezier.shapeSegment(e,a),c.push(offsetSegmentSplit(s,t));if(!e.c)for(a=l-1;a>=0;a-=1)s=PolynomialBezier.shapeSegmentInverted(e,a),c.push(offsetSegmentSplit(s,t));c=pruneIntersections(c);var d=null,u=null;for(a=0;a<c.length;a+=1){var p=c[a];for(u&&(d=joinLines(i,u,p[0],r,n)),u=p[p.length-1],o=0;o<p.length;o+=1)s=p[o],d&&pointEqual(s.points[0],d)?i.setXYAt(s.points[1][0],s.points[1][1],"o",i.length()-1):i.setTripleAt(s.points[0][0],s.points[0][1],s.points[1][0],s.points[1][1],s.points[0][0],s.points[0][1],i.length()),i.setTripleAt(s.points[3][0],s.points[3][1],s.points[3][0],s.points[3][1],s.points[2][0],s.points[2][1],i.length()),d=s.points[3]}return c.length&&joinLines(i,u,c[0][0],r,n),i},OffsetPathModifier.prototype.processShapes=function(e){var t,r,n,i,a,o,s=this.shapes.length,l=this.amount.v,c=this.miterLimit.v,d=this.lineJoin;if(0!==l)for(r=0;r<s;r+=1){if(o=(a=this.shapes[r]).localShapeCollection,a.shape._mdf||this._mdf||e)for(o.releaseShapes(),a.shape._mdf=!0,t=a.shape.paths.shapes,i=a.shape.paths._length,n=0;n<i;n+=1)o.addShape(this.processPath(t[n],l,d,c));a.shape.paths=a.localShapeCollection}this.dynamicProperties.length||(this._mdf=!1)};var FontManager=function(){var e={w:0,size:0,shapes:[],data:{shapes:[]}},t=[];t=t.concat([2304,2305,2306,2307,2362,2363,2364,2364,2366,2367,2368,2369,2370,2371,2372,2373,2374,2375,2376,2377,2378,2379,2380,2381,2382,2383,2387,2388,2389,2390,2391,2402,2403]);var r=127988,n=["d83cdffb","d83cdffc","d83cdffd","d83cdffe","d83cdfff"];function i(e,t){var r=createTag("span");r.setAttribute("aria-hidden",!0),r.style.fontFamily=t;var n=createTag("span");n.innerText="giItT1WQy@!-/#",r.style.position="absolute",r.style.left="-10000px",r.style.top="-10000px",r.style.fontSize="300px",r.style.fontVariant="normal",r.style.fontStyle="normal",r.style.fontWeight="normal",r.style.letterSpacing="0",r.appendChild(n),document.body.appendChild(r);var i=n.offsetWidth;return n.style.fontFamily=function(e){var t,r=e.split(","),n=r.length,i=[];for(t=0;t<n;t+=1)"sans-serif"!==r[t]&&"monospace"!==r[t]&&i.push(r[t]);return i.join(",")}(e)+", "+t,{node:n,w:i,parent:r}}function a(e,t){var r,n=document.body&&t?"svg":"canvas",i=getFontProperties(e);if("svg"===n){var a=createNS("text");a.style.fontSize="100px",a.setAttribute("font-family",e.fFamily),a.setAttribute("font-style",i.style),a.setAttribute("font-weight",i.weight),a.textContent="1",e.fClass?(a.style.fontFamily="inherit",a.setAttribute("class",e.fClass)):a.style.fontFamily=e.fFamily,t.appendChild(a),r=a}else{var o=new OffscreenCanvas(500,500).getContext("2d");o.font=i.style+" "+i.weight+" 100px "+e.fFamily,r=o}return{measureText:function(e){return"svg"===n?(r.textContent=e,r.getComputedTextLength()):r.measureText(e).width}}}function o(e){var t=0,r=e.charCodeAt(0);if(r>=55296&&r<=56319){var n=e.charCodeAt(1);n>=56320&&n<=57343&&(t=1024*(r-55296)+n-56320+65536)}return t}function s(e){var t=o(e);return t>=127462&&t<=127487}var l=function(){this.fonts=[],this.chars=null,this.typekitLoaded=0,this.isLoaded=!1,this._warned=!1,this.initTime=Date.now(),this.setIsLoadedBinded=this.setIsLoaded.bind(this),this.checkLoadedFontsBinded=this.checkLoadedFonts.bind(this)};l.isModifier=function(e,t){var r=e.toString(16)+t.toString(16);return-1!==n.indexOf(r)},l.isZeroWidthJoiner=function(e){return 8205===e},l.isFlagEmoji=function(e){return s(e.substr(0,2))&&s(e.substr(2,2))},l.isRegionalCode=s,l.isCombinedCharacter=function(e){return-1!==t.indexOf(e)},l.isRegionalFlag=function(e,t){var n=o(e.substr(t,2));if(n!==r)return!1;var i=0;for(t+=2;i<5;){if((n=o(e.substr(t,2)))<917601||n>917626)return!1;i+=1,t+=2}return 917631===o(e.substr(t,2))},l.isVariationSelector=function(e){return 65039===e},l.BLACK_FLAG_CODE_POINT=r;var c={addChars:function(e){if(e){var t;this.chars||(this.chars=[]);var r,n,i=e.length,a=this.chars.length;for(t=0;t<i;t+=1){for(r=0,n=!1;r<a;)this.chars[r].style===e[t].style&&this.chars[r].fFamily===e[t].fFamily&&this.chars[r].ch===e[t].ch&&(n=!0),r+=1;n||(this.chars.push(e[t]),a+=1)}}},addFonts:function(e,t){if(e){if(this.chars)return this.isLoaded=!0,void(this.fonts=e.list);if(!document.body)return this.isLoaded=!0,e.list.forEach((function(e){e.helper=a(e),e.cache={}})),void(this.fonts=e.list);var r,n=e.list,o=n.length,s=o;for(r=0;r<o;r+=1){var l,c,d=!0;if(n[r].loaded=!1,n[r].monoCase=i(n[r].fFamily,"monospace"),n[r].sansCase=i(n[r].fFamily,"sans-serif"),n[r].fPath){if("p"===n[r].fOrigin||3===n[r].origin){if((l=document.querySelectorAll('style[f-forigin="p"][f-family="'+n[r].fFamily+'"], style[f-origin="3"][f-family="'+n[r].fFamily+'"]')).length>0&&(d=!1),d){var u=createTag("style");u.setAttribute("f-forigin",n[r].fOrigin),u.setAttribute("f-origin",n[r].origin),u.setAttribute("f-family",n[r].fFamily),u.type="text/css",u.innerText="@font-face {font-family: "+n[r].fFamily+"; font-style: normal; src: url('"+n[r].fPath+"');}",t.appendChild(u)}}else if("g"===n[r].fOrigin||1===n[r].origin){for(l=document.querySelectorAll('link[f-forigin="g"], link[f-origin="1"]'),c=0;c<l.length;c+=1)-1!==l[c].href.indexOf(n[r].fPath)&&(d=!1);if(d){var p=createTag("link");p.setAttribute("f-forigin",n[r].fOrigin),p.setAttribute("f-origin",n[r].origin),p.type="text/css",p.rel="stylesheet",p.href=n[r].fPath,document.body.appendChild(p)}}else if("t"===n[r].fOrigin||2===n[r].origin){for(l=document.querySelectorAll('script[f-forigin="t"], script[f-origin="2"]'),c=0;c<l.length;c+=1)n[r].fPath===l[c].src&&(d=!1);if(d){var h=createTag("link");h.setAttribute("f-forigin",n[r].fOrigin),h.setAttribute("f-origin",n[r].origin),h.setAttribute("rel","stylesheet"),h.setAttribute("href",n[r].fPath),t.appendChild(h)}}}else n[r].loaded=!0,s-=1;n[r].helper=a(n[r],t),n[r].cache={},this.fonts.push(n[r])}0===s?this.isLoaded=!0:setTimeout(this.checkLoadedFonts.bind(this),100)}else this.isLoaded=!0},getCharData:function(t,r,n){for(var i=0,a=this.chars.length;i<a;){if(this.chars[i].ch===t&&this.chars[i].style===r&&this.chars[i].fFamily===n)return this.chars[i];i+=1}return("string"==typeof t&&13!==t.charCodeAt(0)||!t)&&console&&console.warn&&!this._warned&&(this._warned=!0,console.warn("Missing character from exported characters list: ",t,r,n)),e},getFontByName:function(e){for(var t=0,r=this.fonts.length;t<r;){if(this.fonts[t].fName===e)return this.fonts[t];t+=1}return this.fonts[0]},measureText:function(e,t,r){var n=this.getFontByName(t),i=e;if(!n.cache[i]){var a=n.helper;if(" "===e){var o=a.measureText("|"+e+"|"),s=a.measureText("||");n.cache[i]=(o-s)/100}else n.cache[i]=a.measureText(e)/100}return n.cache[i]*r},checkLoadedFonts:function(){var e,t,r,n=this.fonts.length,i=n;for(e=0;e<n;e+=1)this.fonts[e].loaded?i-=1:"n"===this.fonts[e].fOrigin||0===this.fonts[e].origin?this.fonts[e].loaded=!0:(t=this.fonts[e].monoCase.node,r=this.fonts[e].monoCase.w,t.offsetWidth!==r?(i-=1,this.fonts[e].loaded=!0):(t=this.fonts[e].sansCase.node,r=this.fonts[e].sansCase.w,t.offsetWidth!==r&&(i-=1,this.fonts[e].loaded=!0)),this.fonts[e].loaded&&(this.fonts[e].sansCase.parent.parentNode.removeChild(this.fonts[e].sansCase.parent),this.fonts[e].monoCase.parent.parentNode.removeChild(this.fonts[e].monoCase.parent)));0!==i&&Date.now()-this.initTime<5e3?setTimeout(this.checkLoadedFontsBinded,20):setTimeout(this.setIsLoadedBinded,10)},setIsLoaded:function(){this.isLoaded=!0}};return l.prototype=c,l}();function SlotManager(e){this.animationData=e}function slotFactory(e){return new SlotManager(e)}function RenderableElement(){}SlotManager.prototype.getProp=function(e){return this.animationData.slots&&this.animationData.slots[e.sid]?Object.assign(e,this.animationData.slots[e.sid].p):e},RenderableElement.prototype={initRenderable:function(){this.isInRange=!1,this.hidden=!1,this.isTransparent=!1,this.renderableComponents=[]},addRenderableComponent:function(e){-1===this.renderableComponents.indexOf(e)&&this.renderableComponents.push(e)},removeRenderableComponent:function(e){-1!==this.renderableComponents.indexOf(e)&&this.renderableComponents.splice(this.renderableComponents.indexOf(e),1)},prepareRenderableFrame:function(e){this.checkLayerLimits(e)},checkTransparency:function(){this.finalTransform.mProp.o.v<=0?!this.isTransparent&&this.globalData.renderConfig.hideOnTransparent&&(this.isTransparent=!0,this.hide()):this.isTransparent&&(this.isTransparent=!1,this.show())},checkLayerLimits:function(e){this.data.ip-this.data.st<=e&&this.data.op-this.data.st>e?!0!==this.isInRange&&(this.globalData._mdf=!0,this._mdf=!0,this.isInRange=!0,this.show()):!1!==this.isInRange&&(this.globalData._mdf=!0,this.isInRange=!1,this.hide())},renderRenderable:function(){var e,t=this.renderableComponents.length;for(e=0;e<t;e+=1)this.renderableComponents[e].renderFrame(this._isFirstFrame)},sourceRectAtTime:function(){return{top:0,left:0,width:100,height:100}},getLayerSize:function(){return 5===this.data.ty?{w:this.data.textData.width,h:this.data.textData.height}:{w:this.data.width,h:this.data.height}}};var getBlendMode=(blendModeEnums={0:"source-over",1:"multiply",2:"screen",3:"overlay",4:"darken",5:"lighten",6:"color-dodge",7:"color-burn",8:"hard-light",9:"soft-light",10:"difference",11:"exclusion",12:"hue",13:"saturation",14:"color",15:"luminosity"},function(e){return blendModeEnums[e]||""}),blendModeEnums;function SliderEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function AngleEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function ColorEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,1,0,r)}function PointEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,1,0,r)}function LayerIndexEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function MaskIndexEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function CheckboxEffect(e,t,r){this.p=PropertyFactory.getProp(t,e.v,0,0,r)}function NoValueEffect(){this.p={}}function EffectsManager(e,t){var r,n=e.ef||[];this.effectElements=[];var i,a=n.length;for(r=0;r<a;r+=1)i=new GroupEffect(n[r],t),this.effectElements.push(i)}function GroupEffect(e,t){this.init(e,t)}function BaseElement(){}function FrameElement(){}function FootageElement(e,t,r){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.footageData=t.imageLoader.getAsset(this.assetData),this.initBaseData(e,t,r)}function AudioElement(e,t,r){this.initFrame(),this.initRenderable(),this.assetData=t.getAssetData(e.refId),this.initBaseData(e,t,r),this._isPlaying=!1,this._canPlay=!1;var n=this.globalData.getAssetsPath(this.assetData);this.audio=this.globalData.audioController.createAudio(n),this._currentTime=0,this.globalData.audioController.addAudio(this),this._volumeMultiplier=1,this._volume=1,this._previousVolume=null,this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0},this.lv=PropertyFactory.getProp(this,e.au&&e.au.lv?e.au.lv:{k:[100]},1,.01,this)}function BaseRenderer(){}extendPrototype([DynamicPropertyContainer],GroupEffect),GroupEffect.prototype.getValue=GroupEffect.prototype.iterateDynamicProperties,GroupEffect.prototype.init=function(e,t){var r;this.data=e,this.effectElements=[],this.initDynamicPropertyContainer(t);var n,i=this.data.ef.length,a=this.data.ef;for(r=0;r<i;r+=1){switch(n=null,a[r].ty){case 0:n=new SliderEffect(a[r],t,this);break;case 1:n=new AngleEffect(a[r],t,this);break;case 2:n=new ColorEffect(a[r],t,this);break;case 3:n=new PointEffect(a[r],t,this);break;case 4:case 7:n=new CheckboxEffect(a[r],t,this);break;case 10:n=new LayerIndexEffect(a[r],t,this);break;case 11:n=new MaskIndexEffect(a[r],t,this);break;case 5:n=new EffectsManager(a[r],t);break;default:n=new NoValueEffect(a[r])}n&&this.effectElements.push(n)}},BaseElement.prototype={checkMasks:function(){if(!this.data.hasMask)return!1;for(var e=0,t=this.data.masksProperties.length;e<t;){if("n"!==this.data.masksProperties[e].mode&&!1!==this.data.masksProperties[e].cl)return!0;e+=1}return!1},initExpressions:function(){var e=getExpressionInterfaces();if(e){var t=e("layer"),r=e("effects"),n=e("shape"),i=e("text"),a=e("comp");this.layerInterface=t(this),this.data.hasMask&&this.maskManager&&this.layerInterface.registerMaskInterface(this.maskManager);var o=r.createEffectsInterface(this,this.layerInterface);this.layerInterface.registerEffectsInterface(o),0===this.data.ty||this.data.xt?this.compInterface=a(this):4===this.data.ty?(this.layerInterface.shapeInterface=n(this.shapesData,this.itemsData,this.layerInterface),this.layerInterface.content=this.layerInterface.shapeInterface):5===this.data.ty&&(this.layerInterface.textInterface=i(this),this.layerInterface.text=this.layerInterface.textInterface)}},setBlendMode:function(){var e=getBlendMode(this.data.bm);(this.baseElement||this.layerElement).style["mix-blend-mode"]=e},initBaseData:function(e,t,r){this.globalData=t,this.comp=r,this.data=e,this.layerId=createElementID(),this.data.sr||(this.data.sr=1),this.effectsManager=new EffectsManager(this.data,this,this.dynamicProperties)},getType:function(){return this.type},sourceRectAtTime:function(){}},FrameElement.prototype={initFrame:function(){this._isFirstFrame=!1,this.dynamicProperties=[],this._mdf=!1},prepareProperties:function(e,t){var r,n=this.dynamicProperties.length;for(r=0;r<n;r+=1)(t||this._isParent&&"transform"===this.dynamicProperties[r].propType)&&(this.dynamicProperties[r].getValue(),this.dynamicProperties[r]._mdf&&(this.globalData._mdf=!0,this._mdf=!0))},addDynamicProperty:function(e){-1===this.dynamicProperties.indexOf(e)&&this.dynamicProperties.push(e)}},FootageElement.prototype.prepareFrame=function(){},extendPrototype([RenderableElement,BaseElement,FrameElement],FootageElement),FootageElement.prototype.getBaseElement=function(){return null},FootageElement.prototype.renderFrame=function(){},FootageElement.prototype.destroy=function(){},FootageElement.prototype.initExpressions=function(){var e=getExpressionInterfaces();if(e){var t=e("footage");this.layerInterface=t(this)}},FootageElement.prototype.getFootageData=function(){return this.footageData},AudioElement.prototype.prepareFrame=function(e){if(this.prepareRenderableFrame(e,!0),this.prepareProperties(e,!0),this.tm._placeholder)this._currentTime=e/this.data.sr;else{var t=this.tm.v;this._currentTime=t}this._volume=this.lv.v[0];var r=this._volume*this._volumeMultiplier;this._previousVolume!==r&&(this._previousVolume=r,this.audio.volume(r))},extendPrototype([RenderableElement,BaseElement,FrameElement],AudioElement),AudioElement.prototype.renderFrame=function(){this.isInRange&&this._canPlay&&(this._isPlaying?(!this.audio.playing()||Math.abs(this._currentTime/this.globalData.frameRate-this.audio.seek())>.1)&&this.audio.seek(this._currentTime/this.globalData.frameRate):(this.audio.play(),this.audio.seek(this._currentTime/this.globalData.frameRate),this._isPlaying=!0))},AudioElement.prototype.show=function(){},AudioElement.prototype.hide=function(){this.audio.pause(),this._isPlaying=!1},AudioElement.prototype.pause=function(){this.audio.pause(),this._isPlaying=!1,this._canPlay=!1},AudioElement.prototype.resume=function(){this._canPlay=!0},AudioElement.prototype.setRate=function(e){this.audio.rate(e)},AudioElement.prototype.volume=function(e){this._volumeMultiplier=e,this._previousVolume=e*this._volume,this.audio.volume(this._previousVolume)},AudioElement.prototype.getBaseElement=function(){return null},AudioElement.prototype.destroy=function(){},AudioElement.prototype.sourceRectAtTime=function(){},AudioElement.prototype.initExpressions=function(){},BaseRenderer.prototype.checkLayers=function(e){var t,r,n=this.layers.length;for(this.completeLayers=!0,t=n-1;t>=0;t-=1)this.elements[t]||(r=this.layers[t]).ip-r.st<=e-this.layers[t].st&&r.op-r.st>e-this.layers[t].st&&this.buildItem(t),this.completeLayers=!!this.elements[t]&&this.completeLayers;this.checkPendingElements()},BaseRenderer.prototype.createItem=function(e){switch(e.ty){case 2:return this.createImage(e);case 0:return this.createComp(e);case 1:return this.createSolid(e);case 3:default:return this.createNull(e);case 4:return this.createShape(e);case 5:return this.createText(e);case 6:return this.createAudio(e);case 13:return this.createCamera(e);case 15:return this.createFootage(e)}},BaseRenderer.prototype.createCamera=function(){throw new Error("You're using a 3d camera. Try the html renderer.")},BaseRenderer.prototype.createAudio=function(e){return new AudioElement(e,this.globalData,this)},BaseRenderer.prototype.createFootage=function(e){return new FootageElement(e,this.globalData,this)},BaseRenderer.prototype.buildAllItems=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.buildItem(e);this.checkPendingElements()},BaseRenderer.prototype.includeLayers=function(e){var t;this.completeLayers=!1;var r,n=e.length,i=this.layers.length;for(t=0;t<n;t+=1)for(r=0;r<i;){if(this.layers[r].id===e[t].id){this.layers[r]=e[t];break}r+=1}},BaseRenderer.prototype.setProjectInterface=function(e){this.globalData.projectInterface=e},BaseRenderer.prototype.initItems=function(){this.globalData.progressiveLoad||this.buildAllItems()},BaseRenderer.prototype.buildElementParenting=function(e,t,r){for(var n=this.elements,i=this.layers,a=0,o=i.length;a<o;)i[a].ind==t&&(n[a]&&!0!==n[a]?(r.push(n[a]),n[a].setAsParent(),void 0!==i[a].parent?this.buildElementParenting(e,i[a].parent,r):e.setHierarchy(r)):(this.buildItem(a),this.addPendingElement(e))),a+=1},BaseRenderer.prototype.addPendingElement=function(e){this.pendingElements.push(e)},BaseRenderer.prototype.searchExtraCompositions=function(e){var t,r=e.length;for(t=0;t<r;t+=1)if(e[t].xt){var n=this.createComp(e[t]);n.initExpressions(),this.globalData.projectInterface.registerComposition(n)}},BaseRenderer.prototype.getElementById=function(e){var t,r=this.elements.length;for(t=0;t<r;t+=1)if(this.elements[t].data.ind===e)return this.elements[t];return null},BaseRenderer.prototype.getElementByPath=function(e){var t,r=e.shift();if("number"==typeof r)t=this.elements[r];else{var n,i=this.elements.length;for(n=0;n<i;n+=1)if(this.elements[n].data.nm===r){t=this.elements[n];break}}return 0===e.length?t:t.getElementByPath(e)},BaseRenderer.prototype.setupGlobalData=function(e,t){this.globalData.fontManager=new FontManager,this.globalData.slotManager=slotFactory(e),this.globalData.fontManager.addChars(e.chars),this.globalData.fontManager.addFonts(e.fonts,t),this.globalData.getAssetData=this.animationItem.getAssetData.bind(this.animationItem),this.globalData.getAssetsPath=this.animationItem.getAssetsPath.bind(this.animationItem),this.globalData.imageLoader=this.animationItem.imagePreloader,this.globalData.audioController=this.animationItem.audioController,this.globalData.frameId=0,this.globalData.frameRate=e.fr,this.globalData.nm=e.nm,this.globalData.compSize={w:e.w,h:e.h}};var effectTypes={TRANSFORM_EFFECT:"transformEFfect"};function TransformElement(){}function MaskElement(e,t,r){this.data=e,this.element=t,this.globalData=r,this.storedData=[],this.masksProperties=this.data.masksProperties||[],this.maskElement=null;var n,i,a=this.globalData.defs,o=this.masksProperties?this.masksProperties.length:0;this.viewData=createSizedArray(o),this.solidPath="";var s,l,c,d,u,p,h=this.masksProperties,f=0,m=[],g=createElementID(),v="clipPath",y="clip-path";for(n=0;n<o;n+=1)if(("a"!==h[n].mode&&"n"!==h[n].mode||h[n].inv||100!==h[n].o.k||h[n].o.x)&&(v="mask",y="mask"),"s"!==h[n].mode&&"i"!==h[n].mode||0!==f?c=null:((c=createNS("rect")).setAttribute("fill","#ffffff"),c.setAttribute("width",this.element.comp.data.w||0),c.setAttribute("height",this.element.comp.data.h||0),m.push(c)),i=createNS("path"),"n"===h[n].mode)this.viewData[n]={op:PropertyFactory.getProp(this.element,h[n].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,h[n],3),elem:i,lastPath:""},a.appendChild(i);else{var b;if(f+=1,i.setAttribute("fill","s"===h[n].mode?"#000000":"#ffffff"),i.setAttribute("clip-rule","nonzero"),0!==h[n].x.k?(v="mask",y="mask",p=PropertyFactory.getProp(this.element,h[n].x,0,null,this.element),b=createElementID(),(d=createNS("filter")).setAttribute("id",b),(u=createNS("feMorphology")).setAttribute("operator","erode"),u.setAttribute("in","SourceGraphic"),u.setAttribute("radius","0"),d.appendChild(u),a.appendChild(d),i.setAttribute("stroke","s"===h[n].mode?"#000000":"#ffffff")):(u=null,p=null),this.storedData[n]={elem:i,x:p,expan:u,lastPath:"",lastOperator:"",filterId:b,lastRadius:0},"i"===h[n].mode){l=m.length;var E=createNS("g");for(s=0;s<l;s+=1)E.appendChild(m[s]);var _=createNS("mask");_.setAttribute("mask-type","alpha"),_.setAttribute("id",g+"_"+f),_.appendChild(i),a.appendChild(_),E.setAttribute("mask","url("+getLocationHref()+"#"+g+"_"+f+")"),m.length=0,m.push(E)}else m.push(i);h[n].inv&&!this.solidPath&&(this.solidPath=this.createLayerSolidPath()),this.viewData[n]={elem:i,lastPath:"",op:PropertyFactory.getProp(this.element,h[n].o,0,.01,this.element),prop:ShapePropertyFactory.getShapeProp(this.element,h[n],3),invRect:c},this.viewData[n].prop.k||this.drawPath(h[n],this.viewData[n].prop.v,this.viewData[n])}for(this.maskElement=createNS(v),o=m.length,n=0;n<o;n+=1)this.maskElement.appendChild(m[n]);f>0&&(this.maskElement.setAttribute("id",g),this.element.maskedElement.setAttribute(y,"url("+getLocationHref()+"#"+g+")"),a.appendChild(this.maskElement)),this.viewData.length&&this.element.addRenderableComponent(this)}TransformElement.prototype={initTransform:function(){var e=new Matrix;this.finalTransform={mProp:this.data.ks?TransformPropertyFactory.getTransformProperty(this,this.data.ks,this):{o:0},_matMdf:!1,_localMatMdf:!1,_opMdf:!1,mat:e,localMat:e,localOpacity:1},this.data.ao&&(this.finalTransform.mProp.autoOriented=!0),this.data.ty},renderTransform:function(){if(this.finalTransform._opMdf=this.finalTransform.mProp.o._mdf||this._isFirstFrame,this.finalTransform._matMdf=this.finalTransform.mProp._mdf||this._isFirstFrame,this.hierarchy){var e,t=this.finalTransform.mat,r=0,n=this.hierarchy.length;if(!this.finalTransform._matMdf)for(;r<n;){if(this.hierarchy[r].finalTransform.mProp._mdf){this.finalTransform._matMdf=!0;break}r+=1}if(this.finalTransform._matMdf)for(e=this.finalTransform.mProp.v.props,t.cloneFromProps(e),r=0;r<n;r+=1)t.multiply(this.hierarchy[r].finalTransform.mProp.v)}this.localTransforms&&!this.finalTransform._matMdf||(this.finalTransform._localMatMdf=this.finalTransform._matMdf),this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v)},renderLocalTransform:function(){if(this.localTransforms){var e=0,t=this.localTransforms.length;if(this.finalTransform._localMatMdf=this.finalTransform._matMdf,!this.finalTransform._localMatMdf||!this.finalTransform._opMdf)for(;e<t;)this.localTransforms[e]._mdf&&(this.finalTransform._localMatMdf=!0),this.localTransforms[e]._opMdf&&!this.finalTransform._opMdf&&(this.finalTransform.localOpacity=this.finalTransform.mProp.o.v,this.finalTransform._opMdf=!0),e+=1;if(this.finalTransform._localMatMdf){var r=this.finalTransform.localMat;for(this.localTransforms[0].matrix.clone(r),e=1;e<t;e+=1){var n=this.localTransforms[e].matrix;r.multiply(n)}r.multiply(this.finalTransform.mat)}if(this.finalTransform._opMdf){var i=this.finalTransform.localOpacity;for(e=0;e<t;e+=1)i*=.01*this.localTransforms[e].opacity;this.finalTransform.localOpacity=i}}},searchEffectTransforms:function(){if(this.renderableEffectsManager){var e=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT);if(e.length){this.localTransforms=[],this.finalTransform.localMat=new Matrix;var t=0,r=e.length;for(t=0;t<r;t+=1)this.localTransforms.push(e[t])}}},globalToLocal:function(e){var t=[];t.push(this.finalTransform);for(var r,n=!0,i=this.comp;n;)i.finalTransform?(i.data.hasMask&&t.splice(0,0,i.finalTransform),i=i.comp):n=!1;var a,o=t.length;for(r=0;r<o;r+=1)a=t[r].mat.applyToPointArray(0,0,0),e=[e[0]-a[0],e[1]-a[1],0];return e},mHelper:new Matrix},MaskElement.prototype.getMaskProperty=function(e){return this.viewData[e].prop},MaskElement.prototype.renderFrame=function(e){var t,r=this.element.finalTransform.mat,n=this.masksProperties.length;for(t=0;t<n;t+=1)if((this.viewData[t].prop._mdf||e)&&this.drawPath(this.masksProperties[t],this.viewData[t].prop.v,this.viewData[t]),(this.viewData[t].op._mdf||e)&&this.viewData[t].elem.setAttribute("fill-opacity",this.viewData[t].op.v),"n"!==this.masksProperties[t].mode&&(this.viewData[t].invRect&&(this.element.finalTransform.mProp._mdf||e)&&this.viewData[t].invRect.setAttribute("transform",r.getInverseMatrix().to2dCSS()),this.storedData[t].x&&(this.storedData[t].x._mdf||e))){var i=this.storedData[t].expan;this.storedData[t].x.v<0?("erode"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="erode",this.storedData[t].elem.setAttribute("filter","url("+getLocationHref()+"#"+this.storedData[t].filterId+")")),i.setAttribute("radius",-this.storedData[t].x.v)):("dilate"!==this.storedData[t].lastOperator&&(this.storedData[t].lastOperator="dilate",this.storedData[t].elem.setAttribute("filter",null)),this.storedData[t].elem.setAttribute("stroke-width",2*this.storedData[t].x.v))}},MaskElement.prototype.getMaskelement=function(){return this.maskElement},MaskElement.prototype.createLayerSolidPath=function(){var e="M0,0 ";return e+=" h"+this.globalData.compSize.w,e+=" v"+this.globalData.compSize.h,e+=" h-"+this.globalData.compSize.w,e+=" v-"+this.globalData.compSize.h+" "},MaskElement.prototype.drawPath=function(e,t,r){var n,i,a=" M"+t.v[0][0]+","+t.v[0][1];for(i=t._length,n=1;n<i;n+=1)a+=" C"+t.o[n-1][0]+","+t.o[n-1][1]+" "+t.i[n][0]+","+t.i[n][1]+" "+t.v[n][0]+","+t.v[n][1];if(t.c&&i>1&&(a+=" C"+t.o[n-1][0]+","+t.o[n-1][1]+" "+t.i[0][0]+","+t.i[0][1]+" "+t.v[0][0]+","+t.v[0][1]),r.lastPath!==a){var o="";r.elem&&(t.c&&(o=e.inv?this.solidPath+a:a),r.elem.setAttribute("d",o)),r.lastPath=a}},MaskElement.prototype.destroy=function(){this.element=null,this.globalData=null,this.maskElement=null,this.data=null,this.masksProperties=null};var filtersFactory=function(){var e={createFilter:function(e,t){var r=createNS("filter");return r.setAttribute("id",e),!0!==t&&(r.setAttribute("filterUnits","objectBoundingBox"),r.setAttribute("x","0%"),r.setAttribute("y","0%"),r.setAttribute("width","100%"),r.setAttribute("height","100%")),r},createAlphaToLuminanceFilter:function(){var e=createNS("feColorMatrix");return e.setAttribute("type","matrix"),e.setAttribute("color-interpolation-filters","sRGB"),e.setAttribute("values","0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 1"),e}};return e}(),featureSupport=function(){var e={maskType:!0,svgLumaHidden:!0,offscreenCanvas:"undefined"!=typeof OffscreenCanvas};return(/MSIE 10/i.test(navigator.userAgent)||/MSIE 9/i.test(navigator.userAgent)||/rv:11.0/i.test(navigator.userAgent)||/Edge\/\d./i.test(navigator.userAgent))&&(e.maskType=!1),/firefox/i.test(navigator.userAgent)&&(e.svgLumaHidden=!1),e}(),registeredEffects$1={},idPrefix="filter_result_";function SVGEffects(e){var t,r,n="SourceGraphic",i=e.data.ef?e.data.ef.length:0,a=createElementID(),o=filtersFactory.createFilter(a,!0),s=0;for(this.filters=[],t=0;t<i;t+=1){r=null;var l=e.data.ef[t].ty;registeredEffects$1[l]&&(r=new(0,registeredEffects$1[l].effect)(o,e.effectsManager.effectElements[t],e,idPrefix+s,n),n=idPrefix+s,registeredEffects$1[l].countsAsEffect&&(s+=1)),r&&this.filters.push(r)}s&&(e.globalData.defs.appendChild(o),e.layerElement.setAttribute("filter","url("+getLocationHref()+"#"+a+")")),this.filters.length&&e.addRenderableComponent(this)}function registerEffect$1(e,t,r){registeredEffects$1[e]={effect:t,countsAsEffect:r}}function SVGBaseElement(){}function HierarchyElement(){}function RenderableDOMElement(){}function IImageElement(e,t,r){this.assetData=t.getAssetData(e.refId),this.assetData&&this.assetData.sid&&(this.assetData=t.slotManager.getProp(this.assetData)),this.initElement(e,t,r),this.sourceRect={top:0,left:0,width:this.assetData.w,height:this.assetData.h}}function ProcessedElement(e,t){this.elem=e,this.pos=t}function IShapeElement(){}SVGEffects.prototype.renderFrame=function(e){var t,r=this.filters.length;for(t=0;t<r;t+=1)this.filters[t].renderFrame(e)},SVGEffects.prototype.getEffects=function(e){var t,r=this.filters.length,n=[];for(t=0;t<r;t+=1)this.filters[t].type===e&&n.push(this.filters[t]);return n},SVGBaseElement.prototype={initRendererElement:function(){this.layerElement=createNS("g")},createContainerElements:function(){this.matteElement=createNS("g"),this.transformedElement=this.layerElement,this.maskedElement=this.layerElement,this._sizeChanged=!1;var e=null;if(this.data.td){this.matteMasks={};var t=createNS("g");t.setAttribute("id",this.layerId),t.appendChild(this.layerElement),e=t,this.globalData.defs.appendChild(t)}else this.data.tt?(this.matteElement.appendChild(this.layerElement),e=this.matteElement,this.baseElement=this.matteElement):this.baseElement=this.layerElement;if(this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0===this.data.ty&&!this.data.hd){var r=createNS("clipPath"),n=createNS("path");n.setAttribute("d","M0,0 L"+this.data.w+",0 L"+this.data.w+","+this.data.h+" L0,"+this.data.h+"z");var i=createElementID();if(r.setAttribute("id",i),r.appendChild(n),this.globalData.defs.appendChild(r),this.checkMasks()){var a=createNS("g");a.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")"),a.appendChild(this.layerElement),this.transformedElement=a,e?e.appendChild(this.transformedElement):this.baseElement=this.transformedElement}else this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")")}0!==this.data.bm&&this.setBlendMode()},renderElement:function(){this.finalTransform._localMatMdf&&this.transformedElement.setAttribute("transform",this.finalTransform.localMat.to2dCSS()),this.finalTransform._opMdf&&this.transformedElement.setAttribute("opacity",this.finalTransform.localOpacity)},destroyBaseElement:function(){this.layerElement=null,this.matteElement=null,this.maskManager.destroy()},getBaseElement:function(){return this.data.hd?null:this.baseElement},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData),this.renderableEffectsManager=new SVGEffects(this),this.searchEffectTransforms()},getMatte:function(e){if(this.matteMasks||(this.matteMasks={}),!this.matteMasks[e]){var t,r,n,i,a=this.layerId+"_"+e;if(1===e||3===e){var o=createNS("mask");o.setAttribute("id",a),o.setAttribute("mask-type",3===e?"luminance":"alpha"),(n=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),o.appendChild(n),this.globalData.defs.appendChild(o),featureSupport.maskType||1!==e||(o.setAttribute("mask-type","luminance"),t=createElementID(),r=filtersFactory.createFilter(t),this.globalData.defs.appendChild(r),r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),(i=createNS("g")).appendChild(n),o.appendChild(i),i.setAttribute("filter","url("+getLocationHref()+"#"+t+")"))}else if(2===e){var s=createNS("mask");s.setAttribute("id",a),s.setAttribute("mask-type","alpha");var l=createNS("g");s.appendChild(l),t=createElementID(),r=filtersFactory.createFilter(t);var c=createNS("feComponentTransfer");c.setAttribute("in","SourceGraphic"),r.appendChild(c);var d=createNS("feFuncA");d.setAttribute("type","table"),d.setAttribute("tableValues","1.0 0.0"),c.appendChild(d),this.globalData.defs.appendChild(r);var u=createNS("rect");u.setAttribute("width",this.comp.data.w),u.setAttribute("height",this.comp.data.h),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("fill","#ffffff"),u.setAttribute("opacity","0"),l.setAttribute("filter","url("+getLocationHref()+"#"+t+")"),l.appendChild(u),(n=createNS("use")).setAttributeNS("http://www.w3.org/1999/xlink","href","#"+this.layerId),l.appendChild(n),featureSupport.maskType||(s.setAttribute("mask-type","luminance"),r.appendChild(filtersFactory.createAlphaToLuminanceFilter()),i=createNS("g"),l.appendChild(u),i.appendChild(this.layerElement),l.appendChild(i)),this.globalData.defs.appendChild(s)}this.matteMasks[e]=a}return this.matteMasks[e]},setMatte:function(e){this.matteElement&&this.matteElement.setAttribute("mask","url("+getLocationHref()+"#"+e+")")}},HierarchyElement.prototype={initHierarchy:function(){this.hierarchy=[],this._isParent=!1,this.checkParenting()},setHierarchy:function(e){this.hierarchy=e},setAsParent:function(){this._isParent=!0},checkParenting:function(){void 0!==this.data.parent&&this.comp.buildElementParenting(this,this.data.parent,[])}},extendPrototype([RenderableElement,createProxyFunction({initElement:function(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initTransform(e,t,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide()},hide:function(){this.hidden||this.isInRange&&!this.isTransparent||((this.baseElement||this.layerElement).style.display="none",this.hidden=!0)},show:function(){this.isInRange&&!this.isTransparent&&(this.data.hd||((this.baseElement||this.layerElement).style.display="block"),this.hidden=!1,this._isFirstFrame=!0)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},renderInnerContent:function(){},prepareFrame:function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.checkTransparency()},destroy:function(){this.innerElem=null,this.destroyBaseElement()}})],RenderableDOMElement),extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],IImageElement),IImageElement.prototype.createContent=function(){var e=this.globalData.getAssetsPath(this.assetData);this.innerElem=createNS("image"),this.innerElem.setAttribute("width",this.assetData.w+"px"),this.innerElem.setAttribute("height",this.assetData.h+"px"),this.innerElem.setAttribute("preserveAspectRatio",this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio),this.innerElem.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this.layerElement.appendChild(this.innerElem)},IImageElement.prototype.sourceRectAtTime=function(){return this.sourceRect},IShapeElement.prototype={addShapeToModifiers:function(e){var t,r=this.shapeModifiers.length;for(t=0;t<r;t+=1)this.shapeModifiers[t].addShape(e)},isShapeInAnimatedModifiers:function(e){for(var t=this.shapeModifiers.length;0<t;)if(this.shapeModifiers[0].isAnimatedWithShape(e))return!0;return!1},renderModifiers:function(){if(this.shapeModifiers.length){var e,t=this.shapes.length;for(e=0;e<t;e+=1)this.shapes[e].sh.reset();for(e=(t=this.shapeModifiers.length)-1;e>=0&&!this.shapeModifiers[e].processShapes(this._isFirstFrame);e-=1);}},searchProcessedElement:function(e){for(var t=this.processedElements,r=0,n=t.length;r<n;){if(t[r].elem===e)return t[r].pos;r+=1}return 0},addProcessedElement:function(e,t){for(var r=this.processedElements,n=r.length;n;)if(r[n-=1].elem===e)return void(r[n].pos=t);r.push(new ProcessedElement(e,t))},prepareFrame:function(e){this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange)}};var lineCapEnum={1:"butt",2:"round",3:"square"},lineJoinEnum={1:"miter",2:"round",3:"bevel"};function SVGShapeData(e,t,r){this.caches=[],this.styles=[],this.transformers=e,this.lStr="",this.sh=r,this.lvl=t,this._isAnimated=!!r.k;for(var n=0,i=e.length;n<i;){if(e[n].mProps.dynamicProperties.length){this._isAnimated=!0;break}n+=1}}function SVGStyleData(e,t){this.data=e,this.type=e.ty,this.d="",this.lvl=t,this._mdf=!1,this.closed=!0===e.hd,this.pElem=createNS("path"),this.msElem=null}function DashProperty(e,t,r,n){var i;this.elem=e,this.frameId=-1,this.dataProps=createSizedArray(t.length),this.renderer=r,this.k=!1,this.dashStr="",this.dashArray=createTypedArray("float32",t.length?t.length-1:0),this.dashoffset=createTypedArray("float32",1),this.initDynamicPropertyContainer(n);var a,o=t.length||0;for(i=0;i<o;i+=1)a=PropertyFactory.getProp(e,t[i].v,0,0,this),this.k=a.k||this.k,this.dataProps[i]={n:t[i].n,p:a};this.k||this.getValue(!0),this._isAnimated=this.k}function SVGStrokeStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=r,this._isAnimated=!!this._isAnimated}function SVGFillStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.c=PropertyFactory.getProp(e,t.c,1,255,this),this.style=r}function SVGNoStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.style=r}function GradientProperty(e,t,r){this.data=t,this.c=createTypedArray("uint8c",4*t.p);var n=t.k.k[0].s?t.k.k[0].s.length-4*t.p:t.k.k.length-4*t.p;this.o=createTypedArray("float32",n),this._cmdf=!1,this._omdf=!1,this._collapsable=this.checkCollapsable(),this._hasOpacity=n,this.initDynamicPropertyContainer(r),this.prop=PropertyFactory.getProp(e,t.k,1,null,this),this.k=this.prop.k,this.getValue(!0)}function SVGGradientFillStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.initGradientData(e,t,r)}function SVGGradientStrokeStyleData(e,t,r){this.initDynamicPropertyContainer(e),this.getValue=this.iterateDynamicProperties,this.w=PropertyFactory.getProp(e,t.w,0,null,this),this.d=new DashProperty(e,t.d||{},"svg",this),this.initGradientData(e,t,r),this._isAnimated=!!this._isAnimated}function ShapeGroupData(){this.it=[],this.prevViewData=[],this.gr=createNS("g")}function SVGTransformData(e,t,r){this.transform={mProps:e,op:t,container:r},this.elements=[],this._isAnimated=this.transform.mProps.dynamicProperties.length||this.transform.op.effectsSequence.length}SVGShapeData.prototype.setAsAnimated=function(){this._isAnimated=!0},SVGStyleData.prototype.reset=function(){this.d="",this._mdf=!1},DashProperty.prototype.getValue=function(e){if((this.elem.globalData.frameId!==this.frameId||e)&&(this.frameId=this.elem.globalData.frameId,this.iterateDynamicProperties(),this._mdf=this._mdf||e,this._mdf)){var t=0,r=this.dataProps.length;for("svg"===this.renderer&&(this.dashStr=""),t=0;t<r;t+=1)"o"!==this.dataProps[t].n?"svg"===this.renderer?this.dashStr+=" "+this.dataProps[t].p.v:this.dashArray[t]=this.dataProps[t].p.v:this.dashoffset[0]=this.dataProps[t].p.v}},extendPrototype([DynamicPropertyContainer],DashProperty),extendPrototype([DynamicPropertyContainer],SVGStrokeStyleData),extendPrototype([DynamicPropertyContainer],SVGFillStyleData),extendPrototype([DynamicPropertyContainer],SVGNoStyleData),GradientProperty.prototype.comparePoints=function(e,t){for(var r=0,n=this.o.length/2;r<n;){if(Math.abs(e[4*r]-e[4*t+2*r])>.01)return!1;r+=1}return!0},GradientProperty.prototype.checkCollapsable=function(){if(this.o.length/2!=this.c.length/4)return!1;if(this.data.k.k[0].s)for(var e=0,t=this.data.k.k.length;e<t;){if(!this.comparePoints(this.data.k.k[e].s,this.data.p))return!1;e+=1}else if(!this.comparePoints(this.data.k.k,this.data.p))return!1;return!0},GradientProperty.prototype.getValue=function(e){if(this.prop.getValue(),this._mdf=!1,this._cmdf=!1,this._omdf=!1,this.prop._mdf||e){var t,r,n,i=4*this.data.p;for(t=0;t<i;t+=1)r=t%4==0?100:255,n=Math.round(this.prop.v[t]*r),this.c[t]!==n&&(this.c[t]=n,this._cmdf=!e);if(this.o.length)for(i=this.prop.v.length,t=4*this.data.p;t<i;t+=1)r=t%2==0?100:1,n=t%2==0?Math.round(100*this.prop.v[t]):this.prop.v[t],this.o[t-4*this.data.p]!==n&&(this.o[t-4*this.data.p]=n,this._omdf=!e);this._mdf=!e}},extendPrototype([DynamicPropertyContainer],GradientProperty),SVGGradientFillStyleData.prototype.initGradientData=function(e,t,r){this.o=PropertyFactory.getProp(e,t.o,0,.01,this),this.s=PropertyFactory.getProp(e,t.s,1,null,this),this.e=PropertyFactory.getProp(e,t.e,1,null,this),this.h=PropertyFactory.getProp(e,t.h||{k:0},0,.01,this),this.a=PropertyFactory.getProp(e,t.a||{k:0},0,degToRads,this),this.g=new GradientProperty(e,t.g,this),this.style=r,this.stops=[],this.setGradientData(r.pElem,t),this.setGradientOpacity(t,r),this._isAnimated=!!this._isAnimated},SVGGradientFillStyleData.prototype.setGradientData=function(e,t){var r=createElementID(),n=createNS(1===t.t?"linearGradient":"radialGradient");n.setAttribute("id",r),n.setAttribute("spreadMethod","pad"),n.setAttribute("gradientUnits","userSpaceOnUse");var i,a,o,s=[];for(o=4*t.g.p,a=0;a<o;a+=4)i=createNS("stop"),n.appendChild(i),s.push(i);e.setAttribute("gf"===t.ty?"fill":"stroke","url("+getLocationHref()+"#"+r+")"),this.gf=n,this.cst=s},SVGGradientFillStyleData.prototype.setGradientOpacity=function(e,t){if(this.g._hasOpacity&&!this.g._collapsable){var r,n,i,a=createNS("mask"),o=createNS("path");a.appendChild(o);var s=createElementID(),l=createElementID();a.setAttribute("id",l);var c=createNS(1===e.t?"linearGradient":"radialGradient");c.setAttribute("id",s),c.setAttribute("spreadMethod","pad"),c.setAttribute("gradientUnits","userSpaceOnUse"),i=e.g.k.k[0].s?e.g.k.k[0].s.length:e.g.k.k.length;var d=this.stops;for(n=4*e.g.p;n<i;n+=2)(r=createNS("stop")).setAttribute("stop-color","rgb(255,255,255)"),c.appendChild(r),d.push(r);o.setAttribute("gf"===e.ty?"fill":"stroke","url("+getLocationHref()+"#"+s+")"),"gs"===e.ty&&(o.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),o.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),1===e.lj&&o.setAttribute("stroke-miterlimit",e.ml)),this.of=c,this.ms=a,this.ost=d,this.maskId=l,t.msElem=o}},extendPrototype([DynamicPropertyContainer],SVGGradientFillStyleData),extendPrototype([SVGGradientFillStyleData,DynamicPropertyContainer],SVGGradientStrokeStyleData);var buildShapeString=function(e,t,r,n){if(0===t)return"";var i,a=e.o,o=e.i,s=e.v,l=" M"+n.applyToPointStringified(s[0][0],s[0][1]);for(i=1;i<t;i+=1)l+=" C"+n.applyToPointStringified(a[i-1][0],a[i-1][1])+" "+n.applyToPointStringified(o[i][0],o[i][1])+" "+n.applyToPointStringified(s[i][0],s[i][1]);return r&&t&&(l+=" C"+n.applyToPointStringified(a[i-1][0],a[i-1][1])+" "+n.applyToPointStringified(o[0][0],o[0][1])+" "+n.applyToPointStringified(s[0][0],s[0][1]),l+="z"),l},SVGElementsRenderer=function(){var e=new Matrix,t=new Matrix;function r(e,t,r){(r||t.transform.op._mdf)&&t.transform.container.setAttribute("opacity",t.transform.op.v),(r||t.transform.mProps._mdf)&&t.transform.container.setAttribute("transform",t.transform.mProps.v.to2dCSS())}function n(){}function i(r,n,i){var a,o,s,l,c,d,u,p,h,f,m=n.styles.length,g=n.lvl;for(d=0;d<m;d+=1){if(l=n.sh._mdf||i,n.styles[d].lvl<g){for(p=t.reset(),h=g-n.styles[d].lvl,f=n.transformers.length-1;!l&&h>0;)l=n.transformers[f].mProps._mdf||l,h-=1,f-=1;if(l)for(h=g-n.styles[d].lvl,f=n.transformers.length-1;h>0;)p.multiply(n.transformers[f].mProps.v),h-=1,f-=1}else p=e;if(o=(u=n.sh.paths)._length,l){for(s="",a=0;a<o;a+=1)(c=u.shapes[a])&&c._length&&(s+=buildShapeString(c,c._length,c.c,p));n.caches[d]=s}else s=n.caches[d];n.styles[d].d+=!0===r.hd?"":s,n.styles[d]._mdf=l||n.styles[d]._mdf}}function a(e,t,r){var n=t.style;(t.c._mdf||r)&&n.pElem.setAttribute("fill","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r)&&n.pElem.setAttribute("fill-opacity",t.o.v)}function o(e,t,r){s(e,t,r),l(0,t,r)}function s(e,t,r){var n,i,a,o,s,l=t.gf,c=t.g._hasOpacity,d=t.s.v,u=t.e.v;if(t.o._mdf||r){var p="gf"===e.ty?"fill-opacity":"stroke-opacity";t.style.pElem.setAttribute(p,t.o.v)}if(t.s._mdf||r){var h=1===e.t?"x1":"cx",f="x1"===h?"y1":"cy";l.setAttribute(h,d[0]),l.setAttribute(f,d[1]),c&&!t.g._collapsable&&(t.of.setAttribute(h,d[0]),t.of.setAttribute(f,d[1]))}if(t.g._cmdf||r){n=t.cst;var m=t.g.c;for(a=n.length,i=0;i<a;i+=1)(o=n[i]).setAttribute("offset",m[4*i]+"%"),o.setAttribute("stop-color","rgb("+m[4*i+1]+","+m[4*i+2]+","+m[4*i+3]+")")}if(c&&(t.g._omdf||r)){var g=t.g.o;for(a=(n=t.g._collapsable?t.cst:t.ost).length,i=0;i<a;i+=1)o=n[i],t.g._collapsable||o.setAttribute("offset",g[2*i]+"%"),o.setAttribute("stop-opacity",g[2*i+1])}if(1===e.t)(t.e._mdf||r)&&(l.setAttribute("x2",u[0]),l.setAttribute("y2",u[1]),c&&!t.g._collapsable&&(t.of.setAttribute("x2",u[0]),t.of.setAttribute("y2",u[1])));else if((t.s._mdf||t.e._mdf||r)&&(s=Math.sqrt(Math.pow(d[0]-u[0],2)+Math.pow(d[1]-u[1],2)),l.setAttribute("r",s),c&&!t.g._collapsable&&t.of.setAttribute("r",s)),t.s._mdf||t.e._mdf||t.h._mdf||t.a._mdf||r){s||(s=Math.sqrt(Math.pow(d[0]-u[0],2)+Math.pow(d[1]-u[1],2)));var v=Math.atan2(u[1]-d[1],u[0]-d[0]),y=t.h.v;y>=1?y=.99:y<=-1&&(y=-.99);var b=s*y,E=Math.cos(v+t.a.v)*b+d[0],_=Math.sin(v+t.a.v)*b+d[1];l.setAttribute("fx",E),l.setAttribute("fy",_),c&&!t.g._collapsable&&(t.of.setAttribute("fx",E),t.of.setAttribute("fy",_))}}function l(e,t,r){var n=t.style,i=t.d;i&&(i._mdf||r)&&i.dashStr&&(n.pElem.setAttribute("stroke-dasharray",i.dashStr),n.pElem.setAttribute("stroke-dashoffset",i.dashoffset[0])),t.c&&(t.c._mdf||r)&&n.pElem.setAttribute("stroke","rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r)&&n.pElem.setAttribute("stroke-opacity",t.o.v),(t.w._mdf||r)&&(n.pElem.setAttribute("stroke-width",t.w.v),n.msElem&&n.msElem.setAttribute("stroke-width",t.w.v))}return{createRenderFunction:function(e){switch(e.ty){case"fl":return a;case"gf":return s;case"gs":return o;case"st":return l;case"sh":case"el":case"rc":case"sr":return i;case"tr":return r;case"no":return n;default:return null}}}}();function SVGShapeElement(e,t,r){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.initElement(e,t,r),this.prevViewData=[]}function LetterProps(e,t,r,n,i,a){this.o=e,this.sw=t,this.sc=r,this.fc=n,this.m=i,this.p=a,this._mdf={o:!0,sw:!!t,sc:!!r,fc:!!n,m:!0,p:!0}}function TextProperty(e,t){this._frameId=initialDefaultFrame,this.pv="",this.v="",this.kf=!1,this._isFirstFrame=!0,this._mdf=!1,t.d&&t.d.sid&&(t.d=e.globalData.slotManager.getProp(t.d)),this.data=t,this.elem=e,this.comp=this.elem.comp,this.keysIndex=0,this.canResize=!1,this.minimumFontSize=1,this.effectsSequence=[],this.currentData={ascent:0,boxWidth:this.defaultBoxWidth,f:"",fStyle:"",fWeight:"",fc:"",j:"",justifyOffset:"",l:[],lh:0,lineWidths:[],ls:"",of:"",s:"",sc:"",sw:0,t:0,tr:0,sz:0,ps:null,fillColorAnim:!1,strokeColorAnim:!1,strokeWidthAnim:!1,yOffset:0,finalSize:0,finalText:[],finalLineHeight:0,__complete:!1},this.copyData(this.currentData,this.data.d.k[0].s),this.searchProperty()||this.completeTextData(this.currentData)}extendPrototype([BaseElement,TransformElement,SVGBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableDOMElement],SVGShapeElement),SVGShapeElement.prototype.initSecondaryElement=function(){},SVGShapeElement.prototype.identityMatrix=new Matrix,SVGShapeElement.prototype.buildExpressionInterface=function(){},SVGShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes()},SVGShapeElement.prototype.filterUniqueShapes=function(){var e,t,r,n,i=this.shapes.length,a=this.stylesList.length,o=[],s=!1;for(r=0;r<a;r+=1){for(n=this.stylesList[r],s=!1,o.length=0,e=0;e<i;e+=1)-1!==(t=this.shapes[e]).styles.indexOf(n)&&(o.push(t),s=t._isAnimated||s);o.length>1&&s&&this.setShapesAsAnimated(o)}},SVGShapeElement.prototype.setShapesAsAnimated=function(e){var t,r=e.length;for(t=0;t<r;t+=1)e[t].setAsAnimated()},SVGShapeElement.prototype.createStyleElement=function(e,t){var r,n=new SVGStyleData(e,t),i=n.pElem;return"st"===e.ty?r=new SVGStrokeStyleData(this,e,n):"fl"===e.ty?r=new SVGFillStyleData(this,e,n):"gf"===e.ty||"gs"===e.ty?(r=new("gf"===e.ty?SVGGradientFillStyleData:SVGGradientStrokeStyleData)(this,e,n),this.globalData.defs.appendChild(r.gf),r.maskId&&(this.globalData.defs.appendChild(r.ms),this.globalData.defs.appendChild(r.of),i.setAttribute("mask","url("+getLocationHref()+"#"+r.maskId+")"))):"no"===e.ty&&(r=new SVGNoStyleData(this,e,n)),"st"!==e.ty&&"gs"!==e.ty||(i.setAttribute("stroke-linecap",lineCapEnum[e.lc||2]),i.setAttribute("stroke-linejoin",lineJoinEnum[e.lj||2]),i.setAttribute("fill-opacity","0"),1===e.lj&&i.setAttribute("stroke-miterlimit",e.ml)),2===e.r&&i.setAttribute("fill-rule","evenodd"),e.ln&&i.setAttribute("id",e.ln),e.cl&&i.setAttribute("class",e.cl),e.bm&&(i.style["mix-blend-mode"]=getBlendMode(e.bm)),this.stylesList.push(n),this.addToAnimatedContents(e,r),r},SVGShapeElement.prototype.createGroupElement=function(e){var t=new ShapeGroupData;return e.ln&&t.gr.setAttribute("id",e.ln),e.cl&&t.gr.setAttribute("class",e.cl),e.bm&&(t.gr.style["mix-blend-mode"]=getBlendMode(e.bm)),t},SVGShapeElement.prototype.createTransformElement=function(e,t){var r=TransformPropertyFactory.getTransformProperty(this,e,this),n=new SVGTransformData(r,r.o,t);return this.addToAnimatedContents(e,n),n},SVGShapeElement.prototype.createShapeElement=function(e,t,r){var n=4;"rc"===e.ty?n=5:"el"===e.ty?n=6:"sr"===e.ty&&(n=7);var i=new SVGShapeData(t,r,ShapePropertyFactory.getShapeProp(this,e,n,this));return this.shapes.push(i),this.addShapeToModifiers(i),this.addToAnimatedContents(e,i),i},SVGShapeElement.prototype.addToAnimatedContents=function(e,t){for(var r=0,n=this.animatedContents.length;r<n;){if(this.animatedContents[r].element===t)return;r+=1}this.animatedContents.push({fn:SVGElementsRenderer.createRenderFunction(e),element:t,data:e})},SVGShapeElement.prototype.setElementStyles=function(e){var t,r=e.styles,n=this.stylesList.length;for(t=0;t<n;t+=1)-1!==r.indexOf(this.stylesList[t])||this.stylesList[t].closed||r.push(this.stylesList[t])},SVGShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.layerElement,0,[],!0),this.filterUniqueShapes(),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers()},SVGShapeElement.prototype.searchShapes=function(e,t,r,n,i,a,o){var s,l,c,d,u,p,h=[].concat(a),f=e.length-1,m=[],g=[];for(s=f;s>=0;s-=1){if((p=this.searchProcessedElement(e[s]))?t[s]=r[p-1]:e[s]._render=o,"fl"===e[s].ty||"st"===e[s].ty||"gf"===e[s].ty||"gs"===e[s].ty||"no"===e[s].ty)p?t[s].style.closed=e[s].hd:t[s]=this.createStyleElement(e[s],i),e[s]._render&&t[s].style.pElem.parentNode!==n&&n.appendChild(t[s].style.pElem),m.push(t[s].style);else if("gr"===e[s].ty){if(p)for(c=t[s].it.length,l=0;l<c;l+=1)t[s].prevViewData[l]=t[s].it[l];else t[s]=this.createGroupElement(e[s]);this.searchShapes(e[s].it,t[s].it,t[s].prevViewData,t[s].gr,i+1,h,o),e[s]._render&&t[s].gr.parentNode!==n&&n.appendChild(t[s].gr)}else"tr"===e[s].ty?(p||(t[s]=this.createTransformElement(e[s],n)),d=t[s].transform,h.push(d)):"sh"===e[s].ty||"rc"===e[s].ty||"el"===e[s].ty||"sr"===e[s].ty?(p||(t[s]=this.createShapeElement(e[s],h,i)),this.setElementStyles(t[s])):"tm"===e[s].ty||"rd"===e[s].ty||"ms"===e[s].ty||"pb"===e[s].ty||"zz"===e[s].ty||"op"===e[s].ty?(p?(u=t[s]).closed=!1:((u=ShapeModifiers.getModifier(e[s].ty)).init(this,e[s]),t[s]=u,this.shapeModifiers.push(u)),g.push(u)):"rp"===e[s].ty&&(p?(u=t[s]).closed=!0:(u=ShapeModifiers.getModifier(e[s].ty),t[s]=u,u.init(this,e,s,t),this.shapeModifiers.push(u),o=!1),g.push(u));this.addProcessedElement(e[s],s+1)}for(f=m.length,s=0;s<f;s+=1)m[s].closed=!0;for(f=g.length,s=0;s<f;s+=1)g[s].closed=!0},SVGShapeElement.prototype.renderInnerContent=function(){var e;this.renderModifiers();var t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].reset();for(this.renderShape(),e=0;e<t;e+=1)(this.stylesList[e]._mdf||this._isFirstFrame)&&(this.stylesList[e].msElem&&(this.stylesList[e].msElem.setAttribute("d",this.stylesList[e].d),this.stylesList[e].d="M0 0"+this.stylesList[e].d),this.stylesList[e].pElem.setAttribute("d",this.stylesList[e].d||"M0 0"))},SVGShapeElement.prototype.renderShape=function(){var e,t,r=this.animatedContents.length;for(e=0;e<r;e+=1)t=this.animatedContents[e],(this._isFirstFrame||t.element._isAnimated)&&!0!==t.data&&t.fn(t.data,t.element,this._isFirstFrame)},SVGShapeElement.prototype.destroy=function(){this.destroyBaseElement(),this.shapesData=null,this.itemsData=null},LetterProps.prototype.update=function(e,t,r,n,i,a){this._mdf.o=!1,this._mdf.sw=!1,this._mdf.sc=!1,this._mdf.fc=!1,this._mdf.m=!1,this._mdf.p=!1;var o=!1;return this.o!==e&&(this.o=e,this._mdf.o=!0,o=!0),this.sw!==t&&(this.sw=t,this._mdf.sw=!0,o=!0),this.sc!==r&&(this.sc=r,this._mdf.sc=!0,o=!0),this.fc!==n&&(this.fc=n,this._mdf.fc=!0,o=!0),this.m!==i&&(this.m=i,this._mdf.m=!0,o=!0),!a.length||this.p[0]===a[0]&&this.p[1]===a[1]&&this.p[4]===a[4]&&this.p[5]===a[5]&&this.p[12]===a[12]&&this.p[13]===a[13]||(this.p=a,this._mdf.p=!0,o=!0),o},TextProperty.prototype.defaultBoxWidth=[0,0],TextProperty.prototype.copyData=function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r]);return e},TextProperty.prototype.setCurrentData=function(e){e.__complete||this.completeTextData(e),this.currentData=e,this.currentData.boxWidth=this.currentData.boxWidth||this.defaultBoxWidth,this._mdf=!0},TextProperty.prototype.searchProperty=function(){return this.searchKeyframes()},TextProperty.prototype.searchKeyframes=function(){return this.kf=this.data.d.k.length>1,this.kf&&this.addEffect(this.getKeyframeValue.bind(this)),this.kf},TextProperty.prototype.addEffect=function(e){this.effectsSequence.push(e),this.elem.addDynamicProperty(this)},TextProperty.prototype.getValue=function(e){if(this.elem.globalData.frameId!==this.frameId&&this.effectsSequence.length||e){this.currentData.t=this.data.d.k[this.keysIndex].s.t;var t=this.currentData,r=this.keysIndex;if(this.lock)this.setCurrentData(this.currentData);else{var n;this.lock=!0,this._mdf=!1;var i=this.effectsSequence.length,a=e||this.data.d.k[this.keysIndex].s;for(n=0;n<i;n+=1)a=r!==this.keysIndex?this.effectsSequence[n](a,a.t):this.effectsSequence[n](this.currentData,a.t);t!==a&&this.setCurrentData(a),this.v=this.currentData,this.pv=this.v,this.lock=!1,this.frameId=this.elem.globalData.frameId}}},TextProperty.prototype.getKeyframeValue=function(){for(var e=this.data.d.k,t=this.elem.comp.renderedFrame,r=0,n=e.length;r<=n-1&&!(r===n-1||e[r+1].t>t);)r+=1;return this.keysIndex!==r&&(this.keysIndex=r),this.data.d.k[this.keysIndex].s},TextProperty.prototype.buildFinalText=function(e){for(var t,r,n=[],i=0,a=e.length,o=!1,s=!1,l="";i<a;)o=s,s=!1,t=e.charCodeAt(i),l=e.charAt(i),FontManager.isCombinedCharacter(t)?o=!0:t>=55296&&t<=56319?FontManager.isRegionalFlag(e,i)?l=e.substr(i,14):(r=e.charCodeAt(i+1))>=56320&&r<=57343&&(FontManager.isModifier(t,r)?(l=e.substr(i,2),o=!0):l=FontManager.isFlagEmoji(e.substr(i,4))?e.substr(i,4):e.substr(i,2)):t>56319?(r=e.charCodeAt(i+1),FontManager.isVariationSelector(t)&&(o=!0)):FontManager.isZeroWidthJoiner(t)&&(o=!0,s=!0),o?(n[n.length-1]+=l,o=!1):n.push(l),i+=l.length;return n},TextProperty.prototype.completeTextData=function(e){e.__complete=!0;var t,r,n,i,a,o,s,l=this.elem.globalData.fontManager,c=this.data,d=[],u=0,p=c.m.g,h=0,f=0,m=0,g=[],v=0,y=0,b=l.getFontByName(e.f),E=0,_=getFontProperties(b);e.fWeight=_.weight,e.fStyle=_.style,e.finalSize=e.s,e.finalText=this.buildFinalText(e.t),r=e.finalText.length,e.finalLineHeight=e.lh;var S,T=e.tr/1e3*e.finalSize;if(e.sz)for(var x,k,A=!0,I=e.sz[0],C=e.sz[1];A;){x=0,v=0,r=(k=this.buildFinalText(e.t)).length,T=e.tr/1e3*e.finalSize;var P=-1;for(t=0;t<r;t+=1)S=k[t].charCodeAt(0),n=!1," "===k[t]?P=t:13!==S&&3!==S||(v=0,n=!0,x+=e.finalLineHeight||1.2*e.finalSize),l.chars?(s=l.getCharData(k[t],b.fStyle,b.fFamily),E=n?0:s.w*e.finalSize/100):E=l.measureText(k[t],e.f,e.finalSize),v+E>I&&" "!==k[t]?(-1===P?r+=1:t=P,x+=e.finalLineHeight||1.2*e.finalSize,k.splice(t,P===t?1:0,"\r"),P=-1,v=0):(v+=E,v+=T);x+=b.ascent*e.finalSize/100,this.canResize&&e.finalSize>this.minimumFontSize&&C<x?(e.finalSize-=1,e.finalLineHeight=e.finalSize*e.lh/e.s):(e.finalText=k,r=e.finalText.length,A=!1)}v=-T,E=0;var w,D=0;for(t=0;t<r;t+=1)if(n=!1,13===(S=(w=e.finalText[t]).charCodeAt(0))||3===S?(D=0,g.push(v),y=v>y?v:y,v=-2*T,i="",n=!0,m+=1):i=w,l.chars?(s=l.getCharData(w,b.fStyle,l.getFontByName(e.f).fFamily),E=n?0:s.w*e.finalSize/100):E=l.measureText(i,e.f,e.finalSize)," "===w?D+=E+T:(v+=E+T+D,D=0),d.push({l:E,an:E,add:h,n:n,anIndexes:[],val:i,line:m,animatorJustifyOffset:0}),2==p){if(h+=E,""===i||" "===i||t===r-1){for(""!==i&&" "!==i||(h-=E);f<=t;)d[f].an=h,d[f].ind=u,d[f].extra=E,f+=1;u+=1,h=0}}else if(3==p){if(h+=E,""===i||t===r-1){for(""===i&&(h-=E);f<=t;)d[f].an=h,d[f].ind=u,d[f].extra=E,f+=1;h=0,u+=1}}else d[u].ind=u,d[u].extra=0,u+=1;if(e.l=d,y=v>y?v:y,g.push(v),e.sz)e.boxWidth=e.sz[0],e.justifyOffset=0;else switch(e.boxWidth=y,e.j){case 1:e.justifyOffset=-e.boxWidth;break;case 2:e.justifyOffset=-e.boxWidth/2;break;default:e.justifyOffset=0}e.lineWidths=g;var R,L,O,N,M=c.a;o=M.length;var F=[];for(a=0;a<o;a+=1){for((R=M[a]).a.sc&&(e.strokeColorAnim=!0),R.a.sw&&(e.strokeWidthAnim=!0),(R.a.fc||R.a.fh||R.a.fs||R.a.fb)&&(e.fillColorAnim=!0),N=0,O=R.s.b,t=0;t<r;t+=1)(L=d[t]).anIndexes[a]=N,(1==O&&""!==L.val||2==O&&""!==L.val&&" "!==L.val||3==O&&(L.n||" "==L.val||t==r-1)||4==O&&(L.n||t==r-1))&&(1===R.s.rn&&F.push(N),N+=1);c.a[a].s.totalChars=N;var $,B=-1;if(1===R.s.rn)for(t=0;t<r;t+=1)B!=(L=d[t]).anIndexes[a]&&(B=L.anIndexes[a],$=F.splice(Math.floor(Math.random()*F.length),1)[0]),L.anIndexes[a]=$}e.yOffset=e.finalLineHeight||1.2*e.finalSize,e.ls=e.ls||0,e.ascent=b.ascent*e.finalSize/100},TextProperty.prototype.updateDocumentData=function(e,t){t=void 0===t?this.keysIndex:t;var r=this.copyData({},this.data.d.k[t].s);r=this.copyData(r,e),this.data.d.k[t].s=r,this.recalculate(t),this.setCurrentData(r),this.elem.addDynamicProperty(this)},TextProperty.prototype.recalculate=function(e){var t=this.data.d.k[e].s;t.__complete=!1,this.keysIndex=0,this._isFirstFrame=!0,this.getValue(t)},TextProperty.prototype.canResizeFont=function(e){this.canResize=e,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)},TextProperty.prototype.setMinimumFontSize=function(e){this.minimumFontSize=Math.floor(e)||1,this.recalculate(this.keysIndex),this.elem.addDynamicProperty(this)};var TextSelectorProp=function(){var e=Math.max,t=Math.min,r=Math.floor;function n(e,t){this._currentTextLength=-1,this.k=!1,this.data=t,this.elem=e,this.comp=e.comp,this.finalS=0,this.finalE=0,this.initDynamicPropertyContainer(e),this.s=PropertyFactory.getProp(e,t.s||{k:0},0,0,this),this.e="e"in t?PropertyFactory.getProp(e,t.e,0,0,this):{v:100},this.o=PropertyFactory.getProp(e,t.o||{k:0},0,0,this),this.xe=PropertyFactory.getProp(e,t.xe||{k:0},0,0,this),this.ne=PropertyFactory.getProp(e,t.ne||{k:0},0,0,this),this.sm=PropertyFactory.getProp(e,t.sm||{k:100},0,0,this),this.a=PropertyFactory.getProp(e,t.a,0,.01,this),this.dynamicProperties.length||this.getValue()}return n.prototype={getMult:function(n){this._currentTextLength!==this.elem.textProperty.currentData.l.length&&this.getValue();var i=0,a=0,o=1,s=1;this.ne.v>0?i=this.ne.v/100:a=-this.ne.v/100,this.xe.v>0?o=1-this.xe.v/100:s=1+this.xe.v/100;var l=BezierFactory.getBezierEasing(i,a,o,s).get,c=0,d=this.finalS,u=this.finalE,p=this.data.sh;if(2===p)c=l(c=u===d?n>=u?1:0:e(0,t(.5/(u-d)+(n-d)/(u-d),1)));else if(3===p)c=l(c=u===d?n>=u?0:1:1-e(0,t(.5/(u-d)+(n-d)/(u-d),1)));else if(4===p)u===d?c=0:(c=e(0,t(.5/(u-d)+(n-d)/(u-d),1)))<.5?c*=2:c=1-2*(c-.5),c=l(c);else if(5===p){if(u===d)c=0;else{var h=u-d,f=-h/2+(n=t(e(0,n+.5-d),u-d)),m=h/2;c=Math.sqrt(1-f*f/(m*m))}c=l(c)}else 6===p?(u===d?c=0:(n=t(e(0,n+.5-d),u-d),c=(1+Math.cos(Math.PI+2*Math.PI*n/(u-d)))/2),c=l(c)):(n>=r(d)&&(c=e(0,t(n-d<0?t(u,1)-(d-n):u-n,1))),c=l(c));if(100!==this.sm.v){var g=.01*this.sm.v;0===g&&(g=1e-8);var v=.5-.5*g;c<v?c=0:(c=(c-v)/g)>1&&(c=1)}return c*this.a.v},getValue:function(e){this.iterateDynamicProperties(),this._mdf=e||this._mdf,this._currentTextLength=this.elem.textProperty.currentData.l.length||0,e&&2===this.data.r&&(this.e.v=this._currentTextLength);var t=2===this.data.r?1:100/this.data.totalChars,r=this.o.v/t,n=this.s.v/t+r,i=this.e.v/t+r;if(n>i){var a=n;n=i,i=a}this.finalS=n,this.finalE=i}},extendPrototype([DynamicPropertyContainer],n),{getTextSelectorProp:function(e,t,r){return new n(e,t)}}}();function TextAnimatorDataProperty(e,t,r){var n={propType:!1},i=PropertyFactory.getProp,a=t.a;this.a={r:a.r?i(e,a.r,0,degToRads,r):n,rx:a.rx?i(e,a.rx,0,degToRads,r):n,ry:a.ry?i(e,a.ry,0,degToRads,r):n,sk:a.sk?i(e,a.sk,0,degToRads,r):n,sa:a.sa?i(e,a.sa,0,degToRads,r):n,s:a.s?i(e,a.s,1,.01,r):n,a:a.a?i(e,a.a,1,0,r):n,o:a.o?i(e,a.o,0,.01,r):n,p:a.p?i(e,a.p,1,0,r):n,sw:a.sw?i(e,a.sw,0,0,r):n,sc:a.sc?i(e,a.sc,1,0,r):n,fc:a.fc?i(e,a.fc,1,0,r):n,fh:a.fh?i(e,a.fh,0,0,r):n,fs:a.fs?i(e,a.fs,0,.01,r):n,fb:a.fb?i(e,a.fb,0,.01,r):n,t:a.t?i(e,a.t,0,0,r):n},this.s=TextSelectorProp.getTextSelectorProp(e,t.s,r),this.s.t=t.s.t}function TextAnimatorProperty(e,t,r){this._isFirstFrame=!0,this._hasMaskedPath=!1,this._frameId=-1,this._textData=e,this._renderType=t,this._elem=r,this._animatorsData=createSizedArray(this._textData.a.length),this._pathData={},this._moreOptions={alignment:{}},this.renderedLetters=[],this.lettersChangedFlag=!1,this.initDynamicPropertyContainer(r)}function ITextElement(){}TextAnimatorProperty.prototype.searchProperties=function(){var e,t,r=this._textData.a.length,n=PropertyFactory.getProp;for(e=0;e<r;e+=1)t=this._textData.a[e],this._animatorsData[e]=new TextAnimatorDataProperty(this._elem,t,this);this._textData.p&&"m"in this._textData.p?(this._pathData={a:n(this._elem,this._textData.p.a,0,0,this),f:n(this._elem,this._textData.p.f,0,0,this),l:n(this._elem,this._textData.p.l,0,0,this),r:n(this._elem,this._textData.p.r,0,0,this),p:n(this._elem,this._textData.p.p,0,0,this),m:this._elem.maskManager.getMaskProperty(this._textData.p.m)},this._hasMaskedPath=!0):this._hasMaskedPath=!1,this._moreOptions.alignment=n(this._elem,this._textData.m.a,1,0,this)},TextAnimatorProperty.prototype.getMeasures=function(e,t){if(this.lettersChangedFlag=t,this._mdf||this._isFirstFrame||t||this._hasMaskedPath&&this._pathData.m._mdf){this._isFirstFrame=!1;var r,n,i,a,o,s,l,c,d,u,p,h,f,m,g,v,y,b,E,_=this._moreOptions.alignment.v,S=this._animatorsData,T=this._textData,x=this.mHelper,k=this._renderType,A=this.renderedLetters.length,I=e.l;if(this._hasMaskedPath){if(E=this._pathData.m,!this._pathData.n||this._pathData._mdf){var C,P=E.v;for(this._pathData.r.v&&(P=P.reverse()),o={tLength:0,segments:[]},a=P._length-1,v=0,i=0;i<a;i+=1)C=bez.buildBezierData(P.v[i],P.v[i+1],[P.o[i][0]-P.v[i][0],P.o[i][1]-P.v[i][1]],[P.i[i+1][0]-P.v[i+1][0],P.i[i+1][1]-P.v[i+1][1]]),o.tLength+=C.segmentLength,o.segments.push(C),v+=C.segmentLength;i=a,E.v.c&&(C=bez.buildBezierData(P.v[i],P.v[0],[P.o[i][0]-P.v[i][0],P.o[i][1]-P.v[i][1]],[P.i[0][0]-P.v[0][0],P.i[0][1]-P.v[0][1]]),o.tLength+=C.segmentLength,o.segments.push(C),v+=C.segmentLength),this._pathData.pi=o}if(o=this._pathData.pi,s=this._pathData.f.v,p=0,u=1,c=0,d=!0,m=o.segments,s<0&&E.v.c)for(o.tLength<Math.abs(s)&&(s=-Math.abs(s)%o.tLength),u=(f=m[p=m.length-1].points).length-1;s<0;)s+=f[u].partialLength,(u-=1)<0&&(u=(f=m[p-=1].points).length-1);h=(f=m[p].points)[u-1],g=(l=f[u]).partialLength}a=I.length,r=0,n=0;var w,D,R,L,O,N=1.2*e.finalSize*.714,M=!0;R=S.length;var F,$,B,U,V,G,q,z,H,j,W,K,Y=-1,X=s,J=p,Q=u,Z=-1,ee="",te=this.defaultPropsArray;if(2===e.j||1===e.j){var re=0,ne=0,ie=2===e.j?-.5:-1,ae=0,oe=!0;for(i=0;i<a;i+=1)if(I[i].n){for(re&&(re+=ne);ae<i;)I[ae].animatorJustifyOffset=re,ae+=1;re=0,oe=!0}else{for(D=0;D<R;D+=1)(w=S[D].a).t.propType&&(oe&&2===e.j&&(ne+=w.t.v*ie),(O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars)).length?re+=w.t.v*O[0]*ie:re+=w.t.v*O*ie);oe=!1}for(re&&(re+=ne);ae<i;)I[ae].animatorJustifyOffset=re,ae+=1}for(i=0;i<a;i+=1){if(x.reset(),U=1,I[i].n)r=0,n+=e.yOffset,n+=M?1:0,s=X,M=!1,this._hasMaskedPath&&(u=Q,h=(f=m[p=J].points)[u-1],g=(l=f[u]).partialLength,c=0),ee="",W="",H="",K="",te=this.defaultPropsArray;else{if(this._hasMaskedPath){if(Z!==I[i].line){switch(e.j){case 1:s+=v-e.lineWidths[I[i].line];break;case 2:s+=(v-e.lineWidths[I[i].line])/2}Z=I[i].line}Y!==I[i].ind&&(I[Y]&&(s+=I[Y].extra),s+=I[i].an/2,Y=I[i].ind),s+=_[0]*I[i].an*.005;var se=0;for(D=0;D<R;D+=1)(w=S[D].a).p.propType&&((O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars)).length?se+=w.p.v[0]*O[0]:se+=w.p.v[0]*O),w.a.propType&&((O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars)).length?se+=w.a.v[0]*O[0]:se+=w.a.v[0]*O);for(d=!0,this._pathData.a.v&&(s=.5*I[0].an+(v-this._pathData.f.v-.5*I[0].an-.5*I[I.length-1].an)*Y/(a-1),s+=this._pathData.f.v);d;)c+g>=s+se||!f?(y=(s+se-c)/l.partialLength,$=h.point[0]+(l.point[0]-h.point[0])*y,B=h.point[1]+(l.point[1]-h.point[1])*y,x.translate(-_[0]*I[i].an*.005,-_[1]*N*.01),d=!1):f&&(c+=l.partialLength,(u+=1)>=f.length&&(u=0,m[p+=1]?f=m[p].points:E.v.c?(u=0,f=m[p=0].points):(c-=l.partialLength,f=null)),f&&(h=l,g=(l=f[u]).partialLength));F=I[i].an/2-I[i].add,x.translate(-F,0,0)}else F=I[i].an/2-I[i].add,x.translate(-F,0,0),x.translate(-_[0]*I[i].an*.005,-_[1]*N*.01,0);for(D=0;D<R;D+=1)(w=S[D].a).t.propType&&(O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars),0===r&&0===e.j||(this._hasMaskedPath?O.length?s+=w.t.v*O[0]:s+=w.t.v*O:O.length?r+=w.t.v*O[0]:r+=w.t.v*O));for(e.strokeWidthAnim&&(G=e.sw||0),e.strokeColorAnim&&(V=e.sc?[e.sc[0],e.sc[1],e.sc[2]]:[0,0,0]),e.fillColorAnim&&e.fc&&(q=[e.fc[0],e.fc[1],e.fc[2]]),D=0;D<R;D+=1)(w=S[D].a).a.propType&&((O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars)).length?x.translate(-w.a.v[0]*O[0],-w.a.v[1]*O[1],w.a.v[2]*O[2]):x.translate(-w.a.v[0]*O,-w.a.v[1]*O,w.a.v[2]*O));for(D=0;D<R;D+=1)(w=S[D].a).s.propType&&((O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars)).length?x.scale(1+(w.s.v[0]-1)*O[0],1+(w.s.v[1]-1)*O[1],1):x.scale(1+(w.s.v[0]-1)*O,1+(w.s.v[1]-1)*O,1));for(D=0;D<R;D+=1){if(w=S[D].a,O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars),w.sk.propType&&(O.length?x.skewFromAxis(-w.sk.v*O[0],w.sa.v*O[1]):x.skewFromAxis(-w.sk.v*O,w.sa.v*O)),w.r.propType&&(O.length?x.rotateZ(-w.r.v*O[2]):x.rotateZ(-w.r.v*O)),w.ry.propType&&(O.length?x.rotateY(w.ry.v*O[1]):x.rotateY(w.ry.v*O)),w.rx.propType&&(O.length?x.rotateX(w.rx.v*O[0]):x.rotateX(w.rx.v*O)),w.o.propType&&(O.length?U+=(w.o.v*O[0]-U)*O[0]:U+=(w.o.v*O-U)*O),e.strokeWidthAnim&&w.sw.propType&&(O.length?G+=w.sw.v*O[0]:G+=w.sw.v*O),e.strokeColorAnim&&w.sc.propType)for(z=0;z<3;z+=1)O.length?V[z]+=(w.sc.v[z]-V[z])*O[0]:V[z]+=(w.sc.v[z]-V[z])*O;if(e.fillColorAnim&&e.fc){if(w.fc.propType)for(z=0;z<3;z+=1)O.length?q[z]+=(w.fc.v[z]-q[z])*O[0]:q[z]+=(w.fc.v[z]-q[z])*O;w.fh.propType&&(q=O.length?addHueToRGB(q,w.fh.v*O[0]):addHueToRGB(q,w.fh.v*O)),w.fs.propType&&(q=O.length?addSaturationToRGB(q,w.fs.v*O[0]):addSaturationToRGB(q,w.fs.v*O)),w.fb.propType&&(q=O.length?addBrightnessToRGB(q,w.fb.v*O[0]):addBrightnessToRGB(q,w.fb.v*O))}}for(D=0;D<R;D+=1)(w=S[D].a).p.propType&&(O=S[D].s.getMult(I[i].anIndexes[D],T.a[D].s.totalChars),this._hasMaskedPath?O.length?x.translate(0,w.p.v[1]*O[0],-w.p.v[2]*O[1]):x.translate(0,w.p.v[1]*O,-w.p.v[2]*O):O.length?x.translate(w.p.v[0]*O[0],w.p.v[1]*O[1],-w.p.v[2]*O[2]):x.translate(w.p.v[0]*O,w.p.v[1]*O,-w.p.v[2]*O));if(e.strokeWidthAnim&&(H=G<0?0:G),e.strokeColorAnim&&(j="rgb("+Math.round(255*V[0])+","+Math.round(255*V[1])+","+Math.round(255*V[2])+")"),e.fillColorAnim&&e.fc&&(W="rgb("+Math.round(255*q[0])+","+Math.round(255*q[1])+","+Math.round(255*q[2])+")"),this._hasMaskedPath){if(x.translate(0,-e.ls),x.translate(0,_[1]*N*.01+n,0),this._pathData.p.v){b=(l.point[1]-h.point[1])/(l.point[0]-h.point[0]);var le=180*Math.atan(b)/Math.PI;l.point[0]<h.point[0]&&(le+=180),x.rotate(-le*Math.PI/180)}x.translate($,B,0),s-=_[0]*I[i].an*.005,I[i+1]&&Y!==I[i+1].ind&&(s+=I[i].an/2,s+=.001*e.tr*e.finalSize)}else{switch(x.translate(r,n,0),e.ps&&x.translate(e.ps[0],e.ps[1]+e.ascent,0),e.j){case 1:x.translate(I[i].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[I[i].line]),0,0);break;case 2:x.translate(I[i].animatorJustifyOffset+e.justifyOffset+(e.boxWidth-e.lineWidths[I[i].line])/2,0,0)}x.translate(0,-e.ls),x.translate(F,0,0),x.translate(_[0]*I[i].an*.005,_[1]*N*.01,0),r+=I[i].l+.001*e.tr*e.finalSize}"html"===k?ee=x.toCSS():"svg"===k?ee=x.to2dCSS():te=[x.props[0],x.props[1],x.props[2],x.props[3],x.props[4],x.props[5],x.props[6],x.props[7],x.props[8],x.props[9],x.props[10],x.props[11],x.props[12],x.props[13],x.props[14],x.props[15]],K=U}A<=i?(L=new LetterProps(K,H,j,W,ee,te),this.renderedLetters.push(L),A+=1,this.lettersChangedFlag=!0):(L=this.renderedLetters[i],this.lettersChangedFlag=L.update(K,H,j,W,ee,te)||this.lettersChangedFlag)}}},TextAnimatorProperty.prototype.getValue=function(){this._elem.globalData.frameId!==this._frameId&&(this._frameId=this._elem.globalData.frameId,this.iterateDynamicProperties())},TextAnimatorProperty.prototype.mHelper=new Matrix,TextAnimatorProperty.prototype.defaultPropsArray=[],extendPrototype([DynamicPropertyContainer],TextAnimatorProperty),ITextElement.prototype.initElement=function(e,t,r){this.lettersChangedFlag=!0,this.initFrame(),this.initBaseData(e,t,r),this.textProperty=new TextProperty(this,e.t,this.dynamicProperties),this.textAnimator=new TextAnimatorProperty(e.t,this.renderType,this),this.initTransform(e,t,r),this.initHierarchy(),this.initRenderable(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),this.createContent(),this.hide(),this.textAnimator.searchProperties(this.dynamicProperties)},ITextElement.prototype.prepareFrame=function(e){this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange)},ITextElement.prototype.createPathShape=function(e,t){var r,n,i=t.length,a="";for(r=0;r<i;r+=1)"sh"===t[r].ty&&(n=t[r].ks.k,a+=buildShapeString(n,n.i.length,!0,e));return a},ITextElement.prototype.updateDocumentData=function(e,t){this.textProperty.updateDocumentData(e,t)},ITextElement.prototype.canResizeFont=function(e){this.textProperty.canResizeFont(e)},ITextElement.prototype.setMinimumFontSize=function(e){this.textProperty.setMinimumFontSize(e)},ITextElement.prototype.applyTextPropertiesToMatrix=function(e,t,r,n,i){switch(e.ps&&t.translate(e.ps[0],e.ps[1]+e.ascent,0),t.translate(0,-e.ls,0),e.j){case 1:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[r]),0,0);break;case 2:t.translate(e.justifyOffset+(e.boxWidth-e.lineWidths[r])/2,0,0)}t.translate(n,i,0)},ITextElement.prototype.buildColor=function(e){return"rgb("+Math.round(255*e[0])+","+Math.round(255*e[1])+","+Math.round(255*e[2])+")"},ITextElement.prototype.emptyProp=new LetterProps,ITextElement.prototype.destroy=function(){},ITextElement.prototype.validateText=function(){(this.textProperty._mdf||this.textProperty._isFirstFrame)&&(this.buildNewText(),this.textProperty._isFirstFrame=!1,this.textProperty._mdf=!1)};var emptyShapeData={shapes:[]};function SVGTextLottieElement(e,t,r){this.textSpans=[],this.renderType="svg",this.initElement(e,t,r)}function ISolidElement(e,t,r){this.initElement(e,t,r)}function NullElement(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initFrame(),this.initTransform(e,t,r),this.initHierarchy()}function SVGRendererBase(){}function ICompElement(){}function SVGCompElement(e,t,r){this.layers=e.layers,this.supports3d=!0,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(e,t,r),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function SVGRenderer(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.svgElement=createNS("svg");var r="";if(t&&t.title){var n=createNS("title"),i=createElementID();n.setAttribute("id",i),n.textContent=t.title,this.svgElement.appendChild(n),r+=i}if(t&&t.description){var a=createNS("desc"),o=createElementID();a.setAttribute("id",o),a.textContent=t.description,this.svgElement.appendChild(a),r+=" "+o}r&&this.svgElement.setAttribute("aria-labelledby",r);var s=createNS("defs");this.svgElement.appendChild(s);var l=createNS("g");this.svgElement.appendChild(l),this.layerElement=l,this.renderConfig={preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",progressiveLoad:t&&t.progressiveLoad||!1,hideOnTransparent:!(t&&!1===t.hideOnTransparent),viewBoxOnly:t&&t.viewBoxOnly||!1,viewBoxSize:t&&t.viewBoxSize||!1,className:t&&t.className||"",id:t&&t.id||"",focusable:t&&t.focusable,filterSize:{width:t&&t.filterSize&&t.filterSize.width||"100%",height:t&&t.filterSize&&t.filterSize.height||"100%",x:t&&t.filterSize&&t.filterSize.x||"0%",y:t&&t.filterSize&&t.filterSize.y||"0%"},width:t&&t.width,height:t&&t.height,runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.globalData={_mdf:!1,frameNum:-1,defs:s,renderConfig:this.renderConfig},this.elements=[],this.pendingElements=[],this.destroyed=!1,this.rendererType="svg"}function ShapeTransformManager(){this.sequences={},this.sequenceList=[],this.transform_key_count=0}extendPrototype([BaseElement,TransformElement,SVGBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],SVGTextLottieElement),SVGTextLottieElement.prototype.createContent=function(){this.data.singleShape&&!this.globalData.fontManager.chars&&(this.textContainer=createNS("text"))},SVGTextLottieElement.prototype.buildTextContents=function(e){for(var t=0,r=e.length,n=[],i="";t<r;)e[t]===String.fromCharCode(13)||e[t]===String.fromCharCode(3)?(n.push(i),i=""):i+=e[t],t+=1;return n.push(i),n},SVGTextLottieElement.prototype.buildShapeData=function(e,t){if(e.shapes&&e.shapes.length){var r=e.shapes[0];if(r.it){var n=r.it[r.it.length-1];n.s&&(n.s.k[0]=t,n.s.k[1]=t)}}return e},SVGTextLottieElement.prototype.buildNewText=function(){var e,t;this.addDynamicProperty(this);var r=this.textProperty.currentData;this.renderedLetters=createSizedArray(r?r.l.length:0),r.fc?this.layerElement.setAttribute("fill",this.buildColor(r.fc)):this.layerElement.setAttribute("fill","rgba(0,0,0,0)"),r.sc&&(this.layerElement.setAttribute("stroke",this.buildColor(r.sc)),this.layerElement.setAttribute("stroke-width",r.sw)),this.layerElement.setAttribute("font-size",r.finalSize);var n=this.globalData.fontManager.getFontByName(r.f);if(n.fClass)this.layerElement.setAttribute("class",n.fClass);else{this.layerElement.setAttribute("font-family",n.fFamily);var i=r.fWeight,a=r.fStyle;this.layerElement.setAttribute("font-style",a),this.layerElement.setAttribute("font-weight",i)}this.layerElement.setAttribute("aria-label",r.t);var o,s=r.l||[],l=!!this.globalData.fontManager.chars;t=s.length;var c=this.mHelper,d=this.data.singleShape,u=0,p=0,h=!0,f=.001*r.tr*r.finalSize;if(!d||l||r.sz){var m,g=this.textSpans.length;for(e=0;e<t;e+=1){if(this.textSpans[e]||(this.textSpans[e]={span:null,childSpan:null,glyph:null}),!l||!d||0===e){if(o=g>e?this.textSpans[e].span:createNS(l?"g":"text"),g<=e){if(o.setAttribute("stroke-linecap","butt"),o.setAttribute("stroke-linejoin","round"),o.setAttribute("stroke-miterlimit","4"),this.textSpans[e].span=o,l){var v=createNS("g");o.appendChild(v),this.textSpans[e].childSpan=v}this.textSpans[e].span=o,this.layerElement.appendChild(o)}o.style.display="inherit"}if(c.reset(),d&&(s[e].n&&(u=-f,p+=r.yOffset,p+=h?1:0,h=!1),this.applyTextPropertiesToMatrix(r,c,s[e].line,u,p),u+=s[e].l||0,u+=f),l){var y;if(1===(m=this.globalData.fontManager.getCharData(r.finalText[e],n.fStyle,this.globalData.fontManager.getFontByName(r.f).fFamily)).t)y=new SVGCompElement(m.data,this.globalData,this);else{var b=emptyShapeData;m.data&&m.data.shapes&&(b=this.buildShapeData(m.data,r.finalSize)),y=new SVGShapeElement(b,this.globalData,this)}if(this.textSpans[e].glyph){var E=this.textSpans[e].glyph;this.textSpans[e].childSpan.removeChild(E.layerElement),E.destroy()}this.textSpans[e].glyph=y,y._debug=!0,y.prepareFrame(0),y.renderFrame(),this.textSpans[e].childSpan.appendChild(y.layerElement),1===m.t&&this.textSpans[e].childSpan.setAttribute("transform","scale("+r.finalSize/100+","+r.finalSize/100+")")}else d&&o.setAttribute("transform","translate("+c.props[12]+","+c.props[13]+")"),o.textContent=s[e].val,o.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve")}d&&o&&o.setAttribute("d","")}else{var _=this.textContainer,S="start";switch(r.j){case 1:S="end";break;case 2:S="middle";break;default:S="start"}_.setAttribute("text-anchor",S),_.setAttribute("letter-spacing",f);var T=this.buildTextContents(r.finalText);for(t=T.length,p=r.ps?r.ps[1]+r.ascent:0,e=0;e<t;e+=1)(o=this.textSpans[e].span||createNS("tspan")).textContent=T[e],o.setAttribute("x",0),o.setAttribute("y",p),o.style.display="inherit",_.appendChild(o),this.textSpans[e]||(this.textSpans[e]={span:null,glyph:null}),this.textSpans[e].span=o,p+=r.finalLineHeight;this.layerElement.appendChild(_)}for(;e<this.textSpans.length;)this.textSpans[e].span.style.display="none",e+=1;this._sizeChanged=!0},SVGTextLottieElement.prototype.sourceRectAtTime=function(){if(this.prepareFrame(this.comp.renderedFrame-this.data.st),this.renderInnerContent(),this._sizeChanged){this._sizeChanged=!1;var e=this.layerElement.getBBox();this.bbox={top:e.y,left:e.x,width:e.width,height:e.height}}return this.bbox},SVGTextLottieElement.prototype.getValue=function(){var e,t,r=this.textSpans.length;for(this.renderedFrame=this.comp.renderedFrame,e=0;e<r;e+=1)(t=this.textSpans[e].glyph)&&(t.prepareFrame(this.comp.renderedFrame-this.data.st),t._mdf&&(this._mdf=!0))},SVGTextLottieElement.prototype.renderInnerContent=function(){if(this.validateText(),(!this.data.singleShape||this._mdf)&&(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag)){var e,t;this._sizeChanged=!0;var r,n,i,a=this.textAnimator.renderedLetters,o=this.textProperty.currentData.l;for(t=o.length,e=0;e<t;e+=1)o[e].n||(r=a[e],n=this.textSpans[e].span,(i=this.textSpans[e].glyph)&&i.renderFrame(),r._mdf.m&&n.setAttribute("transform",r.m),r._mdf.o&&n.setAttribute("opacity",r.o),r._mdf.sw&&n.setAttribute("stroke-width",r.sw),r._mdf.sc&&n.setAttribute("stroke",r.sc),r._mdf.fc&&n.setAttribute("fill",r.fc))}},extendPrototype([IImageElement],ISolidElement),ISolidElement.prototype.createContent=function(){var e=createNS("rect");e.setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.layerElement.appendChild(e)},NullElement.prototype.prepareFrame=function(e){this.prepareProperties(e,!0)},NullElement.prototype.renderFrame=function(){},NullElement.prototype.getBaseElement=function(){return null},NullElement.prototype.destroy=function(){},NullElement.prototype.sourceRectAtTime=function(){},NullElement.prototype.hide=function(){},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement],NullElement),extendPrototype([BaseRenderer],SVGRendererBase),SVGRendererBase.prototype.createNull=function(e){return new NullElement(e,this.globalData,this)},SVGRendererBase.prototype.createShape=function(e){return new SVGShapeElement(e,this.globalData,this)},SVGRendererBase.prototype.createText=function(e){return new SVGTextLottieElement(e,this.globalData,this)},SVGRendererBase.prototype.createImage=function(e){return new IImageElement(e,this.globalData,this)},SVGRendererBase.prototype.createSolid=function(e){return new ISolidElement(e,this.globalData,this)},SVGRendererBase.prototype.configAnimation=function(e){this.svgElement.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.svgElement.setAttribute("xmlns:xlink","http://www.w3.org/1999/xlink"),this.renderConfig.viewBoxSize?this.svgElement.setAttribute("viewBox",this.renderConfig.viewBoxSize):this.svgElement.setAttribute("viewBox","0 0 "+e.w+" "+e.h),this.renderConfig.viewBoxOnly||(this.svgElement.setAttribute("width",e.w),this.svgElement.setAttribute("height",e.h),this.svgElement.style.width="100%",this.svgElement.style.height="100%",this.svgElement.style.transform="translate3d(0,0,0)",this.svgElement.style.contentVisibility=this.renderConfig.contentVisibility),this.renderConfig.width&&this.svgElement.setAttribute("width",this.renderConfig.width),this.renderConfig.height&&this.svgElement.setAttribute("height",this.renderConfig.height),this.renderConfig.className&&this.svgElement.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.svgElement.setAttribute("id",this.renderConfig.id),void 0!==this.renderConfig.focusable&&this.svgElement.setAttribute("focusable",this.renderConfig.focusable),this.svgElement.setAttribute("preserveAspectRatio",this.renderConfig.preserveAspectRatio),this.animationItem.wrapper.appendChild(this.svgElement);var t=this.globalData.defs;this.setupGlobalData(e,t),this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.data=e;var r=createNS("clipPath"),n=createNS("rect");n.setAttribute("width",e.w),n.setAttribute("height",e.h),n.setAttribute("x",0),n.setAttribute("y",0);var i=createElementID();r.setAttribute("id",i),r.appendChild(n),this.layerElement.setAttribute("clip-path","url("+getLocationHref()+"#"+i+")"),t.appendChild(r),this.layers=e.layers,this.elements=createSizedArray(e.layers.length)},SVGRendererBase.prototype.destroy=function(){var e;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.layerElement=null,this.globalData.defs=null;var t=this.layers?this.layers.length:0;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},SVGRendererBase.prototype.updateContainerSize=function(){},SVGRendererBase.prototype.findIndexByInd=function(e){var t=0,r=this.layers.length;for(t=0;t<r;t+=1)if(this.layers[t].ind===e)return t;return-1},SVGRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){t[e]=!0;var r=this.createItem(this.layers[e]);if(t[e]=r,getExpressionsPlugin()&&(0===this.layers[e].ty&&this.globalData.projectInterface.registerComposition(r),r.initExpressions()),this.appendElementInPos(r,e),this.layers[e].tt){var n="tp"in this.layers[e]?this.findIndexByInd(this.layers[e].tp):e-1;if(-1===n)return;if(this.elements[n]&&!0!==this.elements[n]){var i=t[n].getMatte(this.layers[e].tt);r.setMatte(i)}else this.buildItem(n),this.addPendingElement(r)}}},SVGRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;){var e=this.pendingElements.pop();if(e.checkParenting(),e.data.tt)for(var t=0,r=this.elements.length;t<r;){if(this.elements[t]===e){var n="tp"in e.data?this.findIndexByInd(e.data.tp):t-1,i=this.elements[n].getMatte(this.layers[t].tt);e.setMatte(i);break}t+=1}}},SVGRendererBase.prototype.renderFrame=function(e){if(this.renderedFrame!==e&&!this.destroyed){var t;null===e?e=this.renderedFrame:this.renderedFrame=e,this.globalData.frameNum=e,this.globalData.frameId+=1,this.globalData.projectInterface.currentFrame=e,this.globalData._mdf=!1;var r=this.layers.length;for(this.completeLayers||this.checkLayers(e),t=r-1;t>=0;t-=1)(this.completeLayers||this.elements[t])&&this.elements[t].prepareFrame(e-this.layers[t].st);if(this.globalData._mdf)for(t=0;t<r;t+=1)(this.completeLayers||this.elements[t])&&this.elements[t].renderFrame()}},SVGRendererBase.prototype.appendElementInPos=function(e,t){var r=e.getBaseElement();if(r){for(var n,i=0;i<t;)this.elements[i]&&!0!==this.elements[i]&&this.elements[i].getBaseElement()&&(n=this.elements[i].getBaseElement()),i+=1;n?this.layerElement.insertBefore(r,n):this.layerElement.appendChild(r)}},SVGRendererBase.prototype.hide=function(){this.layerElement.style.display="none"},SVGRendererBase.prototype.show=function(){this.layerElement.style.display="block"},extendPrototype([BaseElement,TransformElement,HierarchyElement,FrameElement,RenderableDOMElement],ICompElement),ICompElement.prototype.initElement=function(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initTransform(e,t,r),this.initRenderable(),this.initHierarchy(),this.initRendererElement(),this.createContainerElements(),this.createRenderableComponents(),!this.data.xt&&t.progressiveLoad||this.buildAllItems(),this.hide()},ICompElement.prototype.prepareFrame=function(e){if(this._mdf=!1,this.prepareRenderableFrame(e),this.prepareProperties(e,this.isInRange),this.isInRange||this.data.xt){if(this.tm._placeholder)this.renderedFrame=e/this.data.sr;else{var t=this.tm.v;t===this.data.op&&(t=this.data.op-1),this.renderedFrame=t}var r,n=this.elements.length;for(this.completeLayers||this.checkLayers(this.renderedFrame),r=n-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&(this.elements[r].prepareFrame(this.renderedFrame-this.layers[r].st),this.elements[r]._mdf&&(this._mdf=!0))}},ICompElement.prototype.renderInnerContent=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},ICompElement.prototype.setElements=function(e){this.elements=e},ICompElement.prototype.getElements=function(){return this.elements},ICompElement.prototype.destroyElements=function(){var e,t=this.layers.length;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy()},ICompElement.prototype.destroy=function(){this.destroyElements(),this.destroyBaseElement()},extendPrototype([SVGRendererBase,ICompElement,SVGBaseElement],SVGCompElement),SVGCompElement.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},extendPrototype([SVGRendererBase],SVGRenderer),SVGRenderer.prototype.createComp=function(e){return new SVGCompElement(e,this.globalData,this)},ShapeTransformManager.prototype={addTransformSequence:function(e){var t,r=e.length,n="_";for(t=0;t<r;t+=1)n+=e[t].transform.key+"_";var i=this.sequences[n];return i||(i={transforms:[].concat(e),finalTransform:new Matrix,_mdf:!1},this.sequences[n]=i,this.sequenceList.push(i)),i},processSequence:function(e,t){for(var r=0,n=e.transforms.length,i=t;r<n&&!t;){if(e.transforms[r].transform.mProps._mdf){i=!0;break}r+=1}if(i)for(e.finalTransform.reset(),r=n-1;r>=0;r-=1)e.finalTransform.multiply(e.transforms[r].transform.mProps.v);e._mdf=i},processSequences:function(e){var t,r=this.sequenceList.length;for(t=0;t<r;t+=1)this.processSequence(this.sequenceList[t],e)},getNewKey:function(){return this.transform_key_count+=1,"_"+this.transform_key_count}};var lumaLoader=function(){var e="__lottie_element_luma_buffer",t=null,r=null,n=null;function i(){var i,a,o;t||(i=createNS("svg"),a=createNS("filter"),o=createNS("feColorMatrix"),a.setAttribute("id",e),o.setAttribute("type","matrix"),o.setAttribute("color-interpolation-filters","sRGB"),o.setAttribute("values","0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0, 0.3, 0.3, 0.3, 0, 0"),a.appendChild(o),i.appendChild(a),i.setAttribute("id",e+"_svg"),featureSupport.svgLumaHidden&&(i.style.display="none"),n=i,document.body.appendChild(n),t=createTag("canvas"),(r=t.getContext("2d")).filter="url(#"+e+")",r.fillStyle="rgba(0,0,0,0)",r.fillRect(0,0,1,1))}return{load:i,get:function(n){return t||i(),t.width=n.width,t.height=n.height,r.filter="url(#"+e+")",t}}};function createCanvas(e,t){if(featureSupport.offscreenCanvas)return new OffscreenCanvas(e,t);var r=createTag("canvas");return r.width=e,r.height=t,r}var assetLoader={loadLumaCanvas:lumaLoader.load,getLumaCanvas:lumaLoader.get,createCanvas:createCanvas},registeredEffects={};function CVEffects(e){var t,r,n=e.data.ef?e.data.ef.length:0;for(this.filters=[],t=0;t<n;t+=1){r=null;var i=e.data.ef[t].ty;registeredEffects[i]&&(r=new(0,registeredEffects[i].effect)(e.effectsManager.effectElements[t],e)),r&&this.filters.push(r)}this.filters.length&&e.addRenderableComponent(this)}function registerEffect(e,t){registeredEffects[e]={effect:t}}function CVMaskElement(e,t){var r;this.data=e,this.element=t,this.masksProperties=this.data.masksProperties||[],this.viewData=createSizedArray(this.masksProperties.length);var n=this.masksProperties.length,i=!1;for(r=0;r<n;r+=1)"n"!==this.masksProperties[r].mode&&(i=!0),this.viewData[r]=ShapePropertyFactory.getShapeProp(this.element,this.masksProperties[r],3);this.hasMasks=i,i&&this.element.addRenderableComponent(this)}function CVBaseElement(){}CVEffects.prototype.renderFrame=function(e){var t,r=this.filters.length;for(t=0;t<r;t+=1)this.filters[t].renderFrame(e)},CVEffects.prototype.getEffects=function(e){var t,r=this.filters.length,n=[];for(t=0;t<r;t+=1)this.filters[t].type===e&&n.push(this.filters[t]);return n},CVMaskElement.prototype.renderFrame=function(){if(this.hasMasks){var e,t,r,n,i=this.element.finalTransform.mat,a=this.element.canvasContext,o=this.masksProperties.length;for(a.beginPath(),e=0;e<o;e+=1)if("n"!==this.masksProperties[e].mode){var s;this.masksProperties[e].inv&&(a.moveTo(0,0),a.lineTo(this.element.globalData.compSize.w,0),a.lineTo(this.element.globalData.compSize.w,this.element.globalData.compSize.h),a.lineTo(0,this.element.globalData.compSize.h),a.lineTo(0,0)),n=this.viewData[e].v,t=i.applyToPointArray(n.v[0][0],n.v[0][1],0),a.moveTo(t[0],t[1]);var l=n._length;for(s=1;s<l;s+=1)r=i.applyToTriplePoints(n.o[s-1],n.i[s],n.v[s]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5]);r=i.applyToTriplePoints(n.o[s-1],n.i[0],n.v[0]),a.bezierCurveTo(r[0],r[1],r[2],r[3],r[4],r[5])}this.element.globalData.renderer.save(!0),a.clip()}},CVMaskElement.prototype.getMaskProperty=MaskElement.prototype.getMaskProperty,CVMaskElement.prototype.destroy=function(){this.element=null};var operationsMap={1:"source-in",2:"source-out",3:"source-in",4:"source-out"};function CVShapeData(e,t,r,n){this.styledShapes=[],this.tr=[0,0,0,0,0,0];var i,a=4;"rc"===t.ty?a=5:"el"===t.ty?a=6:"sr"===t.ty&&(a=7),this.sh=ShapePropertyFactory.getShapeProp(e,t,a,e);var o,s=r.length;for(i=0;i<s;i+=1)r[i].closed||(o={transforms:n.addTransformSequence(r[i].transforms),trNodes:[]},this.styledShapes.push(o),r[i].elements.push(o))}function CVShapeElement(e,t,r){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.itemsData=[],this.prevViewData=[],this.shapeModifiers=[],this.processedElements=[],this.transformsManager=new ShapeTransformManager,this.initElement(e,t,r)}function CVTextElement(e,t,r){this.textSpans=[],this.yOffset=0,this.fillColorAnim=!1,this.strokeColorAnim=!1,this.strokeWidthAnim=!1,this.stroke=!1,this.fill=!1,this.justifyOffset=0,this.currentRender=null,this.renderType="canvas",this.values={fill:"rgba(0,0,0,0)",stroke:"rgba(0,0,0,0)",sWidth:0,fValue:""},this.initElement(e,t,r)}function CVImageElement(e,t,r){this.assetData=t.getAssetData(e.refId),this.img=t.imageLoader.getAsset(this.assetData),this.initElement(e,t,r)}function CVSolidElement(e,t,r){this.initElement(e,t,r)}function CanvasRendererBase(){}function CanvasContext(){this.opacity=-1,this.transform=createTypedArray("float32",16),this.fillStyle="",this.strokeStyle="",this.lineWidth="",this.lineCap="",this.lineJoin="",this.miterLimit="",this.id=Math.random()}function CVContextData(){var e;for(this.stack=[],this.cArrPos=0,this.cTr=new Matrix,e=0;e<15;e+=1){var t=new CanvasContext;this.stack[e]=t}this._length=15,this.nativeContext=null,this.transformMat=new Matrix,this.currentOpacity=1,this.currentFillStyle="",this.appliedFillStyle="",this.currentStrokeStyle="",this.appliedStrokeStyle="",this.currentLineWidth="",this.appliedLineWidth="",this.currentLineCap="",this.appliedLineCap="",this.currentLineJoin="",this.appliedLineJoin="",this.appliedMiterLimit="",this.currentMiterLimit=""}function CVCompElement(e,t,r){this.completeLayers=!1,this.layers=e.layers,this.pendingElements=[],this.elements=createSizedArray(this.layers.length),this.initElement(e,t,r),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function CanvasRenderer(e,t){this.animationItem=e,this.renderConfig={clearCanvas:!t||void 0===t.clearCanvas||t.clearCanvas,context:t&&t.context||null,progressiveLoad:t&&t.progressiveLoad||!1,preserveAspectRatio:t&&t.preserveAspectRatio||"xMidYMid meet",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",contentVisibility:t&&t.contentVisibility||"visible",className:t&&t.className||"",id:t&&t.id||"",runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.renderConfig.dpr=t&&t.dpr||1,this.animationItem.wrapper&&(this.renderConfig.dpr=t&&t.dpr||window.devicePixelRatio||1),this.renderedFrame=-1,this.globalData={frameNum:-1,_mdf:!1,renderConfig:this.renderConfig,currentGlobalAlpha:-1},this.contextData=new CVContextData,this.elements=[],this.pendingElements=[],this.transformMat=new Matrix,this.completeLayers=!1,this.rendererType="canvas",this.renderConfig.clearCanvas&&(this.ctxTransform=this.contextData.transform.bind(this.contextData),this.ctxOpacity=this.contextData.opacity.bind(this.contextData),this.ctxFillStyle=this.contextData.fillStyle.bind(this.contextData),this.ctxStrokeStyle=this.contextData.strokeStyle.bind(this.contextData),this.ctxLineWidth=this.contextData.lineWidth.bind(this.contextData),this.ctxLineCap=this.contextData.lineCap.bind(this.contextData),this.ctxLineJoin=this.contextData.lineJoin.bind(this.contextData),this.ctxMiterLimit=this.contextData.miterLimit.bind(this.contextData),this.ctxFill=this.contextData.fill.bind(this.contextData),this.ctxFillRect=this.contextData.fillRect.bind(this.contextData),this.ctxStroke=this.contextData.stroke.bind(this.contextData),this.save=this.contextData.save.bind(this.contextData))}function HBaseElement(){}function HSolidElement(e,t,r){this.initElement(e,t,r)}function HShapeElement(e,t,r){this.shapes=[],this.shapesData=e.shapes,this.stylesList=[],this.shapeModifiers=[],this.itemsData=[],this.processedElements=[],this.animatedContents=[],this.shapesContainer=createNS("g"),this.initElement(e,t,r),this.prevViewData=[],this.currentBBox={x:999999,y:-999999,h:0,w:0}}function HTextElement(e,t,r){this.textSpans=[],this.textPaths=[],this.currentBBox={x:999999,y:-999999,h:0,w:0},this.renderType="svg",this.isMasked=!1,this.initElement(e,t,r)}function HCameraElement(e,t,r){this.initFrame(),this.initBaseData(e,t,r),this.initHierarchy();var n=PropertyFactory.getProp;if(this.pe=n(this,e.pe,0,0,this),e.ks.p.s?(this.px=n(this,e.ks.p.x,1,0,this),this.py=n(this,e.ks.p.y,1,0,this),this.pz=n(this,e.ks.p.z,1,0,this)):this.p=n(this,e.ks.p,1,0,this),e.ks.a&&(this.a=n(this,e.ks.a,1,0,this)),e.ks.or.k.length&&e.ks.or.k[0].to){var i,a=e.ks.or.k.length;for(i=0;i<a;i+=1)e.ks.or.k[i].to=null,e.ks.or.k[i].ti=null}this.or=n(this,e.ks.or,1,degToRads,this),this.or.sh=!0,this.rx=n(this,e.ks.rx,0,degToRads,this),this.ry=n(this,e.ks.ry,0,degToRads,this),this.rz=n(this,e.ks.rz,0,degToRads,this),this.mat=new Matrix,this._prevMat=new Matrix,this._isFirstFrame=!0,this.finalTransform={mProp:this}}function HImageElement(e,t,r){this.assetData=t.getAssetData(e.refId),this.initElement(e,t,r)}function HybridRendererBase(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:t&&t.className||"",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(t&&!1===t.hideOnTransparent),filterSize:{width:t&&t.filterSize&&t.filterSize.width||"400%",height:t&&t.filterSize&&t.filterSize.height||"400%",x:t&&t.filterSize&&t.filterSize.x||"-100%",y:t&&t.filterSize&&t.filterSize.y||"-100%"}},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}function HCompElement(e,t,r){this.layers=e.layers,this.supports3d=!e.hasMask,this.completeLayers=!1,this.pendingElements=[],this.elements=this.layers?createSizedArray(this.layers.length):[],this.initElement(e,t,r),this.tm=e.tm?PropertyFactory.getProp(this,e.tm,0,t.frameRate,this):{_placeholder:!0}}function HybridRenderer(e,t){this.animationItem=e,this.layers=null,this.renderedFrame=-1,this.renderConfig={className:t&&t.className||"",imagePreserveAspectRatio:t&&t.imagePreserveAspectRatio||"xMidYMid slice",hideOnTransparent:!(t&&!1===t.hideOnTransparent),filterSize:{width:t&&t.filterSize&&t.filterSize.width||"400%",height:t&&t.filterSize&&t.filterSize.height||"400%",x:t&&t.filterSize&&t.filterSize.x||"-100%",y:t&&t.filterSize&&t.filterSize.y||"-100%"},runExpressions:!t||void 0===t.runExpressions||t.runExpressions},this.globalData={_mdf:!1,frameNum:-1,renderConfig:this.renderConfig},this.pendingElements=[],this.elements=[],this.threeDElements=[],this.destroyed=!1,this.camera=null,this.supports3d=!0,this.rendererType="html"}CVBaseElement.prototype={createElements:function(){},initRendererElement:function(){},createContainerElements:function(){if(this.data.tt>=1){this.buffers=[];var e=this.globalData.canvasContext,t=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(t);var r=assetLoader.createCanvas(e.canvas.width,e.canvas.height);this.buffers.push(r),this.data.tt>=3&&!document._isProxy&&assetLoader.loadLumaCanvas()}this.canvasContext=this.globalData.canvasContext,this.transformCanvas=this.globalData.transformCanvas,this.renderableEffectsManager=new CVEffects(this),this.searchEffectTransforms()},createContent:function(){},setBlendMode:function(){var e=this.globalData;if(e.blendMode!==this.data.bm){e.blendMode=this.data.bm;var t=getBlendMode(this.data.bm);e.canvasContext.globalCompositeOperation=t}},createRenderableComponents:function(){this.maskManager=new CVMaskElement(this.data,this),this.transformEffects=this.renderableEffectsManager.getEffects(effectTypes.TRANSFORM_EFFECT)},hideElement:function(){this.hidden||this.isInRange&&!this.isTransparent||(this.hidden=!0)},showElement:function(){this.isInRange&&!this.isTransparent&&(this.hidden=!1,this._isFirstFrame=!0,this.maskManager._isFirstFrame=!0)},clearCanvas:function(e){e.clearRect(this.transformCanvas.tx,this.transformCanvas.ty,this.transformCanvas.w*this.transformCanvas.sx,this.transformCanvas.h*this.transformCanvas.sy)},prepareLayer:function(){if(this.data.tt>=1){var e=this.buffers[0].getContext("2d");this.clearCanvas(e),e.drawImage(this.canvasContext.canvas,0,0),this.currentTransform=this.canvasContext.getTransform(),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform)}},exitLayer:function(){if(this.data.tt>=1){var e=this.buffers[1],t=e.getContext("2d");if(this.clearCanvas(t),t.drawImage(this.canvasContext.canvas,0,0),this.canvasContext.setTransform(1,0,0,1,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.setTransform(this.currentTransform),this.comp.getElementById("tp"in this.data?this.data.tp:this.data.ind-1).renderFrame(!0),this.canvasContext.setTransform(1,0,0,1,0,0),this.data.tt>=3&&!document._isProxy){var r=assetLoader.getLumaCanvas(this.canvasContext.canvas);r.getContext("2d").drawImage(this.canvasContext.canvas,0,0),this.clearCanvas(this.canvasContext),this.canvasContext.drawImage(r,0,0)}this.canvasContext.globalCompositeOperation=operationsMap[this.data.tt],this.canvasContext.drawImage(e,0,0),this.canvasContext.globalCompositeOperation="destination-over",this.canvasContext.drawImage(this.buffers[0],0,0),this.canvasContext.setTransform(this.currentTransform),this.canvasContext.globalCompositeOperation="source-over"}},renderFrame:function(e){if(!this.hidden&&!this.data.hd&&(1!==this.data.td||e)){this.renderTransform(),this.renderRenderable(),this.renderLocalTransform(),this.setBlendMode();var t=0===this.data.ty;this.prepareLayer(),this.globalData.renderer.save(t),this.globalData.renderer.ctxTransform(this.finalTransform.localMat.props),this.globalData.renderer.ctxOpacity(this.finalTransform.localOpacity),this.renderInnerContent(),this.globalData.renderer.restore(t),this.exitLayer(),this.maskManager.hasMasks&&this.globalData.renderer.restore(!0),this._isFirstFrame&&(this._isFirstFrame=!1)}},destroy:function(){this.canvasContext=null,this.data=null,this.globalData=null,this.maskManager.destroy()},mHelper:new Matrix},CVBaseElement.prototype.hide=CVBaseElement.prototype.hideElement,CVBaseElement.prototype.show=CVBaseElement.prototype.showElement,CVShapeData.prototype.setAsAnimated=SVGShapeData.prototype.setAsAnimated,extendPrototype([BaseElement,TransformElement,CVBaseElement,IShapeElement,HierarchyElement,FrameElement,RenderableElement],CVShapeElement),CVShapeElement.prototype.initElement=RenderableDOMElement.prototype.initElement,CVShapeElement.prototype.transformHelper={opacity:1,_opMdf:!1},CVShapeElement.prototype.dashResetter=[],CVShapeElement.prototype.createContent=function(){this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[])},CVShapeElement.prototype.createStyleElement=function(e,t){var r={data:e,type:e.ty,preTransforms:this.transformsManager.addTransformSequence(t),transforms:[],elements:[],closed:!0===e.hd},n={};if("fl"===e.ty||"st"===e.ty?(n.c=PropertyFactory.getProp(this,e.c,1,255,this),n.c.k||(r.co="rgb("+bmFloor(n.c.v[0])+","+bmFloor(n.c.v[1])+","+bmFloor(n.c.v[2])+")")):"gf"!==e.ty&&"gs"!==e.ty||(n.s=PropertyFactory.getProp(this,e.s,1,null,this),n.e=PropertyFactory.getProp(this,e.e,1,null,this),n.h=PropertyFactory.getProp(this,e.h||{k:0},0,.01,this),n.a=PropertyFactory.getProp(this,e.a||{k:0},0,degToRads,this),n.g=new GradientProperty(this,e.g,this)),n.o=PropertyFactory.getProp(this,e.o,0,.01,this),"st"===e.ty||"gs"===e.ty){if(r.lc=lineCapEnum[e.lc||2],r.lj=lineJoinEnum[e.lj||2],1==e.lj&&(r.ml=e.ml),n.w=PropertyFactory.getProp(this,e.w,0,null,this),n.w.k||(r.wi=n.w.v),e.d){var i=new DashProperty(this,e.d,"canvas",this);n.d=i,n.d.k||(r.da=n.d.dashArray,r.do=n.d.dashoffset[0])}}else r.r=2===e.r?"evenodd":"nonzero";return this.stylesList.push(r),n.style=r,n},CVShapeElement.prototype.createGroupElement=function(){return{it:[],prevViewData:[]}},CVShapeElement.prototype.createTransformElement=function(e){return{transform:{opacity:1,_opMdf:!1,key:this.transformsManager.getNewKey(),op:PropertyFactory.getProp(this,e.o,0,.01,this),mProps:TransformPropertyFactory.getTransformProperty(this,e,this)}}},CVShapeElement.prototype.createShapeElement=function(e){var t=new CVShapeData(this,e,this.stylesList,this.transformsManager);return this.shapes.push(t),this.addShapeToModifiers(t),t},CVShapeElement.prototype.reloadShapes=function(){var e;this._isFirstFrame=!0;var t=this.itemsData.length;for(e=0;e<t;e+=1)this.prevViewData[e]=this.itemsData[e];for(this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,!0,[]),t=this.dynamicProperties.length,e=0;e<t;e+=1)this.dynamicProperties[e].getValue();this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame)},CVShapeElement.prototype.addTransformToStyleList=function(e){var t,r=this.stylesList.length;for(t=0;t<r;t+=1)this.stylesList[t].closed||this.stylesList[t].transforms.push(e)},CVShapeElement.prototype.removeTransformFromStyleList=function(){var e,t=this.stylesList.length;for(e=0;e<t;e+=1)this.stylesList[e].closed||this.stylesList[e].transforms.pop()},CVShapeElement.prototype.closeStyles=function(e){var t,r=e.length;for(t=0;t<r;t+=1)e[t].closed=!0},CVShapeElement.prototype.searchShapes=function(e,t,r,n,i){var a,o,s,l,c,d,u=e.length-1,p=[],h=[],f=[].concat(i);for(a=u;a>=0;a-=1){if((l=this.searchProcessedElement(e[a]))?t[a]=r[l-1]:e[a]._shouldRender=n,"fl"===e[a].ty||"st"===e[a].ty||"gf"===e[a].ty||"gs"===e[a].ty)l?t[a].style.closed=!1:t[a]=this.createStyleElement(e[a],f),p.push(t[a].style);else if("gr"===e[a].ty){if(l)for(s=t[a].it.length,o=0;o<s;o+=1)t[a].prevViewData[o]=t[a].it[o];else t[a]=this.createGroupElement(e[a]);this.searchShapes(e[a].it,t[a].it,t[a].prevViewData,n,f)}else"tr"===e[a].ty?(l||(d=this.createTransformElement(e[a]),t[a]=d),f.push(t[a]),this.addTransformToStyleList(t[a])):"sh"===e[a].ty||"rc"===e[a].ty||"el"===e[a].ty||"sr"===e[a].ty?l||(t[a]=this.createShapeElement(e[a])):"tm"===e[a].ty||"rd"===e[a].ty||"pb"===e[a].ty||"zz"===e[a].ty||"op"===e[a].ty?(l?(c=t[a]).closed=!1:((c=ShapeModifiers.getModifier(e[a].ty)).init(this,e[a]),t[a]=c,this.shapeModifiers.push(c)),h.push(c)):"rp"===e[a].ty&&(l?(c=t[a]).closed=!0:(c=ShapeModifiers.getModifier(e[a].ty),t[a]=c,c.init(this,e,a,t),this.shapeModifiers.push(c),n=!1),h.push(c));this.addProcessedElement(e[a],a+1)}for(this.removeTransformFromStyleList(),this.closeStyles(p),u=h.length,a=0;a<u;a+=1)h[a].closed=!0},CVShapeElement.prototype.renderInnerContent=function(){this.transformHelper.opacity=1,this.transformHelper._opMdf=!1,this.renderModifiers(),this.transformsManager.processSequences(this._isFirstFrame),this.renderShape(this.transformHelper,this.shapesData,this.itemsData,!0)},CVShapeElement.prototype.renderShapeTransform=function(e,t){(e._opMdf||t.op._mdf||this._isFirstFrame)&&(t.opacity=e.opacity,t.opacity*=t.op.v,t._opMdf=!0)},CVShapeElement.prototype.drawLayer=function(){var e,t,r,n,i,a,o,s,l,c=this.stylesList.length,d=this.globalData.renderer,u=this.globalData.canvasContext;for(e=0;e<c;e+=1)if(("st"!==(s=(l=this.stylesList[e]).type)&&"gs"!==s||0!==l.wi)&&l.data._shouldRender&&0!==l.coOp&&0!==this.globalData.currentGlobalAlpha){for(d.save(),a=l.elements,"st"===s||"gs"===s?(d.ctxStrokeStyle("st"===s?l.co:l.grd),d.ctxLineWidth(l.wi),d.ctxLineCap(l.lc),d.ctxLineJoin(l.lj),d.ctxMiterLimit(l.ml||0)):d.ctxFillStyle("fl"===s?l.co:l.grd),d.ctxOpacity(l.coOp),"st"!==s&&"gs"!==s&&u.beginPath(),d.ctxTransform(l.preTransforms.finalTransform.props),r=a.length,t=0;t<r;t+=1){for("st"!==s&&"gs"!==s||(u.beginPath(),l.da&&(u.setLineDash(l.da),u.lineDashOffset=l.do)),i=(o=a[t].trNodes).length,n=0;n<i;n+=1)"m"===o[n].t?u.moveTo(o[n].p[0],o[n].p[1]):"c"===o[n].t?u.bezierCurveTo(o[n].pts[0],o[n].pts[1],o[n].pts[2],o[n].pts[3],o[n].pts[4],o[n].pts[5]):u.closePath();"st"!==s&&"gs"!==s||(d.ctxStroke(),l.da&&u.setLineDash(this.dashResetter))}"st"!==s&&"gs"!==s&&this.globalData.renderer.ctxFill(l.r),d.restore()}},CVShapeElement.prototype.renderShape=function(e,t,r,n){var i,a;for(a=e,i=t.length-1;i>=0;i-=1)"tr"===t[i].ty?(a=r[i].transform,this.renderShapeTransform(e,a)):"sh"===t[i].ty||"el"===t[i].ty||"rc"===t[i].ty||"sr"===t[i].ty?this.renderPath(t[i],r[i]):"fl"===t[i].ty?this.renderFill(t[i],r[i],a):"st"===t[i].ty?this.renderStroke(t[i],r[i],a):"gf"===t[i].ty||"gs"===t[i].ty?this.renderGradientFill(t[i],r[i],a):"gr"===t[i].ty?this.renderShape(a,t[i].it,r[i].it):t[i].ty;n&&this.drawLayer()},CVShapeElement.prototype.renderStyledShape=function(e,t){if(this._isFirstFrame||t._mdf||e.transforms._mdf){var r,n,i,a=e.trNodes,o=t.paths,s=o._length;a.length=0;var l=e.transforms.finalTransform;for(i=0;i<s;i+=1){var c=o.shapes[i];if(c&&c.v){for(n=c._length,r=1;r<n;r+=1)1===r&&a.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),a.push({t:"c",pts:l.applyToTriplePoints(c.o[r-1],c.i[r],c.v[r])});1===n&&a.push({t:"m",p:l.applyToPointArray(c.v[0][0],c.v[0][1],0)}),c.c&&n&&(a.push({t:"c",pts:l.applyToTriplePoints(c.o[r-1],c.i[0],c.v[0])}),a.push({t:"z"}))}}e.trNodes=a}},CVShapeElement.prototype.renderPath=function(e,t){if(!0!==e.hd&&e._shouldRender){var r,n=t.styledShapes.length;for(r=0;r<n;r+=1)this.renderStyledShape(t.styledShapes[r],t.sh)}},CVShapeElement.prototype.renderFill=function(e,t,r){var n=t.style;(t.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r._opMdf||this._isFirstFrame)&&(n.coOp=t.o.v*r.opacity)},CVShapeElement.prototype.renderGradientFill=function(e,t,r){var n,i=t.style;if(!i.grd||t.g._mdf||t.s._mdf||t.e._mdf||1!==e.t&&(t.h._mdf||t.a._mdf)){var a,o=this.globalData.canvasContext,s=t.s.v,l=t.e.v;if(1===e.t)n=o.createLinearGradient(s[0],s[1],l[0],l[1]);else{var c=Math.sqrt(Math.pow(s[0]-l[0],2)+Math.pow(s[1]-l[1],2)),d=Math.atan2(l[1]-s[1],l[0]-s[0]),u=t.h.v;u>=1?u=.99:u<=-1&&(u=-.99);var p=c*u,h=Math.cos(d+t.a.v)*p+s[0],f=Math.sin(d+t.a.v)*p+s[1];n=o.createRadialGradient(h,f,0,s[0],s[1],c)}var m=e.g.p,g=t.g.c,v=1;for(a=0;a<m;a+=1)t.g._hasOpacity&&t.g._collapsable&&(v=t.g.o[2*a+1]),n.addColorStop(g[4*a]/100,"rgba("+g[4*a+1]+","+g[4*a+2]+","+g[4*a+3]+","+v+")");i.grd=n}i.coOp=t.o.v*r.opacity},CVShapeElement.prototype.renderStroke=function(e,t,r){var n=t.style,i=t.d;i&&(i._mdf||this._isFirstFrame)&&(n.da=i.dashArray,n.do=i.dashoffset[0]),(t.c._mdf||this._isFirstFrame)&&(n.co="rgb("+bmFloor(t.c.v[0])+","+bmFloor(t.c.v[1])+","+bmFloor(t.c.v[2])+")"),(t.o._mdf||r._opMdf||this._isFirstFrame)&&(n.coOp=t.o.v*r.opacity),(t.w._mdf||this._isFirstFrame)&&(n.wi=t.w.v)},CVShapeElement.prototype.destroy=function(){this.shapesData=null,this.globalData=null,this.canvasContext=null,this.stylesList.length=0,this.itemsData.length=0},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement,ITextElement],CVTextElement),CVTextElement.prototype.tHelper=createTag("canvas").getContext("2d"),CVTextElement.prototype.buildNewText=function(){var e=this.textProperty.currentData;this.renderedLetters=createSizedArray(e.l?e.l.length:0);var t=!1;e.fc?(t=!0,this.values.fill=this.buildColor(e.fc)):this.values.fill="rgba(0,0,0,0)",this.fill=t;var r=!1;e.sc&&(r=!0,this.values.stroke=this.buildColor(e.sc),this.values.sWidth=e.sw);var n,i,a,o,s,l,c,d,u,p,h,f,m=this.globalData.fontManager.getFontByName(e.f),g=e.l,v=this.mHelper;this.stroke=r,this.values.fValue=e.finalSize+"px "+this.globalData.fontManager.getFontByName(e.f).fFamily,i=e.finalText.length;var y=this.data.singleShape,b=.001*e.tr*e.finalSize,E=0,_=0,S=!0,T=0;for(n=0;n<i;n+=1){o=(a=this.globalData.fontManager.getCharData(e.finalText[n],m.fStyle,this.globalData.fontManager.getFontByName(e.f).fFamily))&&a.data||{},v.reset(),y&&g[n].n&&(E=-b,_+=e.yOffset,_+=S?1:0,S=!1),u=(c=o.shapes?o.shapes[0].it:[]).length,v.scale(e.finalSize/100,e.finalSize/100),y&&this.applyTextPropertiesToMatrix(e,v,g[n].line,E,_),h=createSizedArray(u-1);var x=0;for(d=0;d<u;d+=1)if("sh"===c[d].ty){for(l=c[d].ks.k.i.length,p=c[d].ks.k,f=[],s=1;s<l;s+=1)1===s&&f.push(v.applyToX(p.v[0][0],p.v[0][1],0),v.applyToY(p.v[0][0],p.v[0][1],0)),f.push(v.applyToX(p.o[s-1][0],p.o[s-1][1],0),v.applyToY(p.o[s-1][0],p.o[s-1][1],0),v.applyToX(p.i[s][0],p.i[s][1],0),v.applyToY(p.i[s][0],p.i[s][1],0),v.applyToX(p.v[s][0],p.v[s][1],0),v.applyToY(p.v[s][0],p.v[s][1],0));f.push(v.applyToX(p.o[s-1][0],p.o[s-1][1],0),v.applyToY(p.o[s-1][0],p.o[s-1][1],0),v.applyToX(p.i[0][0],p.i[0][1],0),v.applyToY(p.i[0][0],p.i[0][1],0),v.applyToX(p.v[0][0],p.v[0][1],0),v.applyToY(p.v[0][0],p.v[0][1],0)),h[x]=f,x+=1}y&&(E+=g[n].l,E+=b),this.textSpans[T]?this.textSpans[T].elem=h:this.textSpans[T]={elem:h},T+=1}},CVTextElement.prototype.renderInnerContent=function(){var e,t,r,n,i,a;this.validateText(),this.canvasContext.font=this.values.fValue,this.globalData.renderer.ctxLineCap("butt"),this.globalData.renderer.ctxLineJoin("miter"),this.globalData.renderer.ctxMiterLimit(4),this.data.singleShape||this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag);var o,s=this.textAnimator.renderedLetters,l=this.textProperty.currentData.l;t=l.length;var c,d,u=null,p=null,h=null,f=this.globalData.renderer;for(e=0;e<t;e+=1)if(!l[e].n){if((o=s[e])&&(f.save(),f.ctxTransform(o.p),f.ctxOpacity(o.o)),this.fill){for(o&&o.fc?u!==o.fc&&(f.ctxFillStyle(o.fc),u=o.fc):u!==this.values.fill&&(u=this.values.fill,f.ctxFillStyle(this.values.fill)),n=(c=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<n;r+=1)for(a=(d=c[r]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),i=2;i<a;i+=6)this.globalData.canvasContext.bezierCurveTo(d[i],d[i+1],d[i+2],d[i+3],d[i+4],d[i+5]);this.globalData.canvasContext.closePath(),f.ctxFill()}if(this.stroke){for(o&&o.sw?h!==o.sw&&(h=o.sw,f.ctxLineWidth(o.sw)):h!==this.values.sWidth&&(h=this.values.sWidth,f.ctxLineWidth(this.values.sWidth)),o&&o.sc?p!==o.sc&&(p=o.sc,f.ctxStrokeStyle(o.sc)):p!==this.values.stroke&&(p=this.values.stroke,f.ctxStrokeStyle(this.values.stroke)),n=(c=this.textSpans[e].elem).length,this.globalData.canvasContext.beginPath(),r=0;r<n;r+=1)for(a=(d=c[r]).length,this.globalData.canvasContext.moveTo(d[0],d[1]),i=2;i<a;i+=6)this.globalData.canvasContext.bezierCurveTo(d[i],d[i+1],d[i+2],d[i+3],d[i+4],d[i+5]);this.globalData.canvasContext.closePath(),f.ctxStroke()}o&&this.globalData.renderer.restore()}},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVImageElement),CVImageElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVImageElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVImageElement.prototype.createContent=function(){if(this.img.width&&(this.assetData.w!==this.img.width||this.assetData.h!==this.img.height)){var e=createTag("canvas");e.width=this.assetData.w,e.height=this.assetData.h;var t,r,n=e.getContext("2d"),i=this.img.width,a=this.img.height,o=i/a,s=this.assetData.w/this.assetData.h,l=this.assetData.pr||this.globalData.renderConfig.imagePreserveAspectRatio;o>s&&"xMidYMid slice"===l||o<s&&"xMidYMid slice"!==l?t=(r=a)*s:r=(t=i)/s,n.drawImage(this.img,(i-t)/2,(a-r)/2,t,r,0,0,this.assetData.w,this.assetData.h),this.img=e}},CVImageElement.prototype.renderInnerContent=function(){this.canvasContext.drawImage(this.img,0,0)},CVImageElement.prototype.destroy=function(){this.img=null},extendPrototype([BaseElement,TransformElement,CVBaseElement,HierarchyElement,FrameElement,RenderableElement],CVSolidElement),CVSolidElement.prototype.initElement=SVGShapeElement.prototype.initElement,CVSolidElement.prototype.prepareFrame=IImageElement.prototype.prepareFrame,CVSolidElement.prototype.renderInnerContent=function(){this.globalData.renderer.ctxFillStyle(this.data.sc),this.globalData.renderer.ctxFillRect(0,0,this.data.sw,this.data.sh)},extendPrototype([BaseRenderer],CanvasRendererBase),CanvasRendererBase.prototype.createShape=function(e){return new CVShapeElement(e,this.globalData,this)},CanvasRendererBase.prototype.createText=function(e){return new CVTextElement(e,this.globalData,this)},CanvasRendererBase.prototype.createImage=function(e){return new CVImageElement(e,this.globalData,this)},CanvasRendererBase.prototype.createSolid=function(e){return new CVSolidElement(e,this.globalData,this)},CanvasRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,CanvasRendererBase.prototype.ctxTransform=function(e){1===e[0]&&0===e[1]&&0===e[4]&&1===e[5]&&0===e[12]&&0===e[13]||this.canvasContext.transform(e[0],e[1],e[4],e[5],e[12],e[13])},CanvasRendererBase.prototype.ctxOpacity=function(e){this.canvasContext.globalAlpha*=e<0?0:e},CanvasRendererBase.prototype.ctxFillStyle=function(e){this.canvasContext.fillStyle=e},CanvasRendererBase.prototype.ctxStrokeStyle=function(e){this.canvasContext.strokeStyle=e},CanvasRendererBase.prototype.ctxLineWidth=function(e){this.canvasContext.lineWidth=e},CanvasRendererBase.prototype.ctxLineCap=function(e){this.canvasContext.lineCap=e},CanvasRendererBase.prototype.ctxLineJoin=function(e){this.canvasContext.lineJoin=e},CanvasRendererBase.prototype.ctxMiterLimit=function(e){this.canvasContext.miterLimit=e},CanvasRendererBase.prototype.ctxFill=function(e){this.canvasContext.fill(e)},CanvasRendererBase.prototype.ctxFillRect=function(e,t,r,n){this.canvasContext.fillRect(e,t,r,n)},CanvasRendererBase.prototype.ctxStroke=function(){this.canvasContext.stroke()},CanvasRendererBase.prototype.reset=function(){this.renderConfig.clearCanvas?this.contextData.reset():this.canvasContext.restore()},CanvasRendererBase.prototype.save=function(){this.canvasContext.save()},CanvasRendererBase.prototype.restore=function(e){this.renderConfig.clearCanvas?(e&&(this.globalData.blendMode="source-over"),this.contextData.restore(e)):this.canvasContext.restore()},CanvasRendererBase.prototype.configAnimation=function(e){if(this.animationItem.wrapper){this.animationItem.container=createTag("canvas");var t=this.animationItem.container.style;t.width="100%",t.height="100%";var r="0px 0px 0px";t.transformOrigin=r,t.mozTransformOrigin=r,t.webkitTransformOrigin=r,t["-webkit-transform"]=r,t.contentVisibility=this.renderConfig.contentVisibility,this.animationItem.wrapper.appendChild(this.animationItem.container),this.canvasContext=this.animationItem.container.getContext("2d"),this.renderConfig.className&&this.animationItem.container.setAttribute("class",this.renderConfig.className),this.renderConfig.id&&this.animationItem.container.setAttribute("id",this.renderConfig.id)}else this.canvasContext=this.renderConfig.context;this.contextData.setContext(this.canvasContext),this.data=e,this.layers=e.layers,this.transformCanvas={w:e.w,h:e.h,sx:0,sy:0,tx:0,ty:0},this.setupGlobalData(e,document.body),this.globalData.canvasContext=this.canvasContext,this.globalData.renderer=this,this.globalData.isDashed=!1,this.globalData.progressiveLoad=this.renderConfig.progressiveLoad,this.globalData.transformCanvas=this.transformCanvas,this.elements=createSizedArray(e.layers.length),this.updateContainerSize()},CanvasRendererBase.prototype.updateContainerSize=function(e,t){var r,n,i,a;if(this.reset(),e?(r=e,n=t,this.canvasContext.canvas.width=r,this.canvasContext.canvas.height=n):(this.animationItem.wrapper&&this.animationItem.container?(r=this.animationItem.wrapper.offsetWidth,n=this.animationItem.wrapper.offsetHeight):(r=this.canvasContext.canvas.width,n=this.canvasContext.canvas.height),this.canvasContext.canvas.width=r*this.renderConfig.dpr,this.canvasContext.canvas.height=n*this.renderConfig.dpr),-1!==this.renderConfig.preserveAspectRatio.indexOf("meet")||-1!==this.renderConfig.preserveAspectRatio.indexOf("slice")){var o=this.renderConfig.preserveAspectRatio.split(" "),s=o[1]||"meet",l=o[0]||"xMidYMid",c=l.substr(0,4),d=l.substr(4);i=r/n,(a=this.transformCanvas.w/this.transformCanvas.h)>i&&"meet"===s||a<i&&"slice"===s?(this.transformCanvas.sx=r/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=r/(this.transformCanvas.w/this.renderConfig.dpr)):(this.transformCanvas.sx=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr)),this.transformCanvas.tx="xMid"===c&&(a<i&&"meet"===s||a>i&&"slice"===s)?(r-this.transformCanvas.w*(n/this.transformCanvas.h))/2*this.renderConfig.dpr:"xMax"===c&&(a<i&&"meet"===s||a>i&&"slice"===s)?(r-this.transformCanvas.w*(n/this.transformCanvas.h))*this.renderConfig.dpr:0,this.transformCanvas.ty="YMid"===d&&(a>i&&"meet"===s||a<i&&"slice"===s)?(n-this.transformCanvas.h*(r/this.transformCanvas.w))/2*this.renderConfig.dpr:"YMax"===d&&(a>i&&"meet"===s||a<i&&"slice"===s)?(n-this.transformCanvas.h*(r/this.transformCanvas.w))*this.renderConfig.dpr:0}else"none"===this.renderConfig.preserveAspectRatio?(this.transformCanvas.sx=r/(this.transformCanvas.w/this.renderConfig.dpr),this.transformCanvas.sy=n/(this.transformCanvas.h/this.renderConfig.dpr),this.transformCanvas.tx=0,this.transformCanvas.ty=0):(this.transformCanvas.sx=this.renderConfig.dpr,this.transformCanvas.sy=this.renderConfig.dpr,this.transformCanvas.tx=0,this.transformCanvas.ty=0);this.transformCanvas.props=[this.transformCanvas.sx,0,0,0,0,this.transformCanvas.sy,0,0,0,0,1,0,this.transformCanvas.tx,this.transformCanvas.ty,0,1],this.ctxTransform(this.transformCanvas.props),this.canvasContext.beginPath(),this.canvasContext.rect(0,0,this.transformCanvas.w,this.transformCanvas.h),this.canvasContext.closePath(),this.canvasContext.clip(),this.renderFrame(this.renderedFrame,!0)},CanvasRendererBase.prototype.destroy=function(){var e;for(this.renderConfig.clearCanvas&&this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),e=(this.layers?this.layers.length:0)-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.globalData.canvasContext=null,this.animationItem.container=null,this.destroyed=!0},CanvasRendererBase.prototype.renderFrame=function(e,t){if((this.renderedFrame!==e||!0!==this.renderConfig.clearCanvas||t)&&!this.destroyed&&-1!==e){var r;this.renderedFrame=e,this.globalData.frameNum=e-this.animationItem._isFirstFrame,this.globalData.frameId+=1,this.globalData._mdf=!this.renderConfig.clearCanvas||t,this.globalData.projectInterface.currentFrame=e;var n=this.layers.length;for(this.completeLayers||this.checkLayers(e),r=n-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].prepareFrame(e-this.layers[r].st);if(this.globalData._mdf){for(!0===this.renderConfig.clearCanvas?this.canvasContext.clearRect(0,0,this.transformCanvas.w,this.transformCanvas.h):this.save(),r=n-1;r>=0;r-=1)(this.completeLayers||this.elements[r])&&this.elements[r].renderFrame();!0!==this.renderConfig.clearCanvas&&this.restore()}}},CanvasRendererBase.prototype.buildItem=function(e){var t=this.elements;if(!t[e]&&99!==this.layers[e].ty){var r=this.createItem(this.layers[e],this,this.globalData);t[e]=r,r.initExpressions()}},CanvasRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},CanvasRendererBase.prototype.hide=function(){this.animationItem.container.style.display="none"},CanvasRendererBase.prototype.show=function(){this.animationItem.container.style.display="block"},CVContextData.prototype.duplicate=function(){var e=2*this._length,t=0;for(t=this._length;t<e;t+=1)this.stack[t]=new CanvasContext;this._length=e},CVContextData.prototype.reset=function(){this.cArrPos=0,this.cTr.reset(),this.stack[this.cArrPos].opacity=1},CVContextData.prototype.restore=function(e){this.cArrPos-=1;var t,r=this.stack[this.cArrPos],n=r.transform,i=this.cTr.props;for(t=0;t<16;t+=1)i[t]=n[t];if(e){this.nativeContext.restore();var a=this.stack[this.cArrPos+1];this.appliedFillStyle=a.fillStyle,this.appliedStrokeStyle=a.strokeStyle,this.appliedLineWidth=a.lineWidth,this.appliedLineCap=a.lineCap,this.appliedLineJoin=a.lineJoin,this.appliedMiterLimit=a.miterLimit}this.nativeContext.setTransform(n[0],n[1],n[4],n[5],n[12],n[13]),(e||-1!==r.opacity&&this.currentOpacity!==r.opacity)&&(this.nativeContext.globalAlpha=r.opacity,this.currentOpacity=r.opacity),this.currentFillStyle=r.fillStyle,this.currentStrokeStyle=r.strokeStyle,this.currentLineWidth=r.lineWidth,this.currentLineCap=r.lineCap,this.currentLineJoin=r.lineJoin,this.currentMiterLimit=r.miterLimit},CVContextData.prototype.save=function(e){e&&this.nativeContext.save();var t=this.cTr.props;this._length<=this.cArrPos&&this.duplicate();var r,n=this.stack[this.cArrPos];for(r=0;r<16;r+=1)n.transform[r]=t[r];this.cArrPos+=1;var i=this.stack[this.cArrPos];i.opacity=n.opacity,i.fillStyle=n.fillStyle,i.strokeStyle=n.strokeStyle,i.lineWidth=n.lineWidth,i.lineCap=n.lineCap,i.lineJoin=n.lineJoin,i.miterLimit=n.miterLimit},CVContextData.prototype.setOpacity=function(e){this.stack[this.cArrPos].opacity=e},CVContextData.prototype.setContext=function(e){this.nativeContext=e},CVContextData.prototype.fillStyle=function(e){this.stack[this.cArrPos].fillStyle!==e&&(this.currentFillStyle=e,this.stack[this.cArrPos].fillStyle=e)},CVContextData.prototype.strokeStyle=function(e){this.stack[this.cArrPos].strokeStyle!==e&&(this.currentStrokeStyle=e,this.stack[this.cArrPos].strokeStyle=e)},CVContextData.prototype.lineWidth=function(e){this.stack[this.cArrPos].lineWidth!==e&&(this.currentLineWidth=e,this.stack[this.cArrPos].lineWidth=e)},CVContextData.prototype.lineCap=function(e){this.stack[this.cArrPos].lineCap!==e&&(this.currentLineCap=e,this.stack[this.cArrPos].lineCap=e)},CVContextData.prototype.lineJoin=function(e){this.stack[this.cArrPos].lineJoin!==e&&(this.currentLineJoin=e,this.stack[this.cArrPos].lineJoin=e)},CVContextData.prototype.miterLimit=function(e){this.stack[this.cArrPos].miterLimit!==e&&(this.currentMiterLimit=e,this.stack[this.cArrPos].miterLimit=e)},CVContextData.prototype.transform=function(e){this.transformMat.cloneFromProps(e);var t=this.cTr;this.transformMat.multiply(t),t.cloneFromProps(this.transformMat.props);var r=t.props;this.nativeContext.setTransform(r[0],r[1],r[4],r[5],r[12],r[13])},CVContextData.prototype.opacity=function(e){var t=this.stack[this.cArrPos].opacity;t*=e<0?0:e,this.stack[this.cArrPos].opacity!==t&&(this.currentOpacity!==e&&(this.nativeContext.globalAlpha=e,this.currentOpacity=e),this.stack[this.cArrPos].opacity=t)},CVContextData.prototype.fill=function(e){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fill(e)},CVContextData.prototype.fillRect=function(e,t,r,n){this.appliedFillStyle!==this.currentFillStyle&&(this.appliedFillStyle=this.currentFillStyle,this.nativeContext.fillStyle=this.appliedFillStyle),this.nativeContext.fillRect(e,t,r,n)},CVContextData.prototype.stroke=function(){this.appliedStrokeStyle!==this.currentStrokeStyle&&(this.appliedStrokeStyle=this.currentStrokeStyle,this.nativeContext.strokeStyle=this.appliedStrokeStyle),this.appliedLineWidth!==this.currentLineWidth&&(this.appliedLineWidth=this.currentLineWidth,this.nativeContext.lineWidth=this.appliedLineWidth),this.appliedLineCap!==this.currentLineCap&&(this.appliedLineCap=this.currentLineCap,this.nativeContext.lineCap=this.appliedLineCap),this.appliedLineJoin!==this.currentLineJoin&&(this.appliedLineJoin=this.currentLineJoin,this.nativeContext.lineJoin=this.appliedLineJoin),this.appliedMiterLimit!==this.currentMiterLimit&&(this.appliedMiterLimit=this.currentMiterLimit,this.nativeContext.miterLimit=this.appliedMiterLimit),this.nativeContext.stroke()},extendPrototype([CanvasRendererBase,ICompElement,CVBaseElement],CVCompElement),CVCompElement.prototype.renderInnerContent=function(){var e,t=this.canvasContext;for(t.beginPath(),t.moveTo(0,0),t.lineTo(this.data.w,0),t.lineTo(this.data.w,this.data.h),t.lineTo(0,this.data.h),t.lineTo(0,0),t.clip(),e=this.layers.length-1;e>=0;e-=1)(this.completeLayers||this.elements[e])&&this.elements[e].renderFrame()},CVCompElement.prototype.destroy=function(){var e;for(e=this.layers.length-1;e>=0;e-=1)this.elements[e]&&this.elements[e].destroy();this.layers=null,this.elements=null},CVCompElement.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},extendPrototype([CanvasRendererBase],CanvasRenderer),CanvasRenderer.prototype.createComp=function(e){return new CVCompElement(e,this.globalData,this)},HBaseElement.prototype={checkBlendMode:function(){},initRendererElement:function(){this.baseElement=createTag(this.data.tg||"div"),this.data.hasMask?(this.svgElement=createNS("svg"),this.layerElement=createNS("g"),this.maskedElement=this.layerElement,this.svgElement.appendChild(this.layerElement),this.baseElement.appendChild(this.svgElement)):this.layerElement=this.baseElement,styleDiv(this.baseElement)},createContainerElements:function(){this.renderableEffectsManager=new CVEffects(this),this.transformedElement=this.baseElement,this.maskedElement=this.layerElement,this.data.ln&&this.layerElement.setAttribute("id",this.data.ln),this.data.cl&&this.layerElement.setAttribute("class",this.data.cl),0!==this.data.bm&&this.setBlendMode()},renderElement:function(){var e=this.transformedElement?this.transformedElement.style:{};if(this.finalTransform._matMdf){var t=this.finalTransform.mat.toCSS();e.transform=t,e.webkitTransform=t}this.finalTransform._opMdf&&(e.opacity=this.finalTransform.mProp.o.v)},renderFrame:function(){this.data.hd||this.hidden||(this.renderTransform(),this.renderRenderable(),this.renderElement(),this.renderInnerContent(),this._isFirstFrame&&(this._isFirstFrame=!1))},destroy:function(){this.layerElement=null,this.transformedElement=null,this.matteElement&&(this.matteElement=null),this.maskManager&&(this.maskManager.destroy(),this.maskManager=null)},createRenderableComponents:function(){this.maskManager=new MaskElement(this.data,this,this.globalData)},addEffects:function(){},setMatte:function(){}},HBaseElement.prototype.getBaseElement=SVGBaseElement.prototype.getBaseElement,HBaseElement.prototype.destroyBaseElement=HBaseElement.prototype.destroy,HBaseElement.prototype.buildElementParenting=BaseRenderer.prototype.buildElementParenting,extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement],HSolidElement),HSolidElement.prototype.createContent=function(){var e;this.data.hasMask?((e=createNS("rect")).setAttribute("width",this.data.sw),e.setAttribute("height",this.data.sh),e.setAttribute("fill",this.data.sc),this.svgElement.setAttribute("width",this.data.sw),this.svgElement.setAttribute("height",this.data.sh)):((e=createTag("div")).style.width=this.data.sw+"px",e.style.height=this.data.sh+"px",e.style.backgroundColor=this.data.sc),this.layerElement.appendChild(e)},extendPrototype([BaseElement,TransformElement,HSolidElement,SVGShapeElement,HBaseElement,HierarchyElement,FrameElement,RenderableElement],HShapeElement),HShapeElement.prototype._renderShapeFrame=HShapeElement.prototype.renderInnerContent,HShapeElement.prototype.createContent=function(){var e;if(this.baseElement.style.fontSize=0,this.data.hasMask)this.layerElement.appendChild(this.shapesContainer),e=this.svgElement;else{e=createNS("svg");var t=this.comp.data?this.comp.data:this.globalData.compSize;e.setAttribute("width",t.w),e.setAttribute("height",t.h),e.appendChild(this.shapesContainer),this.layerElement.appendChild(e)}this.searchShapes(this.shapesData,this.itemsData,this.prevViewData,this.shapesContainer,0,[],!0),this.filterUniqueShapes(),this.shapeCont=e},HShapeElement.prototype.getTransformedPoint=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)t=e[r].mProps.v.applyToPointArray(t[0],t[1],0);return t},HShapeElement.prototype.calculateShapeBoundingBox=function(e,t){var r,n,i,a,o,s=e.sh.v,l=e.transformers,c=s._length;if(!(c<=1)){for(r=0;r<c-1;r+=1)n=this.getTransformedPoint(l,s.v[r]),i=this.getTransformedPoint(l,s.o[r]),a=this.getTransformedPoint(l,s.i[r+1]),o=this.getTransformedPoint(l,s.v[r+1]),this.checkBounds(n,i,a,o,t);s.c&&(n=this.getTransformedPoint(l,s.v[r]),i=this.getTransformedPoint(l,s.o[r]),a=this.getTransformedPoint(l,s.i[0]),o=this.getTransformedPoint(l,s.v[0]),this.checkBounds(n,i,a,o,t))}},HShapeElement.prototype.checkBounds=function(e,t,r,n,i){this.getBoundsOfCurve(e,t,r,n);var a=this.shapeBoundingBox;i.x=bmMin(a.left,i.x),i.xMax=bmMax(a.right,i.xMax),i.y=bmMin(a.top,i.y),i.yMax=bmMax(a.bottom,i.yMax)},HShapeElement.prototype.shapeBoundingBox={left:0,right:0,top:0,bottom:0},HShapeElement.prototype.tempBoundingBox={x:0,xMax:0,y:0,yMax:0,width:0,height:0},HShapeElement.prototype.getBoundsOfCurve=function(e,t,r,n){for(var i,a,o,s,l,c,d,u=[[e[0],n[0]],[e[1],n[1]]],p=0;p<2;++p)a=6*e[p]-12*t[p]+6*r[p],i=-3*e[p]+9*t[p]-9*r[p]+3*n[p],o=3*t[p]-3*e[p],a|=0,o|=0,0==(i|=0)&&0===a||(0===i?(s=-o/a)>0&&s<1&&u[p].push(this.calculateF(s,e,t,r,n,p)):(l=a*a-4*o*i)>=0&&((c=(-a+bmSqrt(l))/(2*i))>0&&c<1&&u[p].push(this.calculateF(c,e,t,r,n,p)),(d=(-a-bmSqrt(l))/(2*i))>0&&d<1&&u[p].push(this.calculateF(d,e,t,r,n,p))));this.shapeBoundingBox.left=bmMin.apply(null,u[0]),this.shapeBoundingBox.top=bmMin.apply(null,u[1]),this.shapeBoundingBox.right=bmMax.apply(null,u[0]),this.shapeBoundingBox.bottom=bmMax.apply(null,u[1])},HShapeElement.prototype.calculateF=function(e,t,r,n,i,a){return bmPow(1-e,3)*t[a]+3*bmPow(1-e,2)*e*r[a]+3*(1-e)*bmPow(e,2)*n[a]+bmPow(e,3)*i[a]},HShapeElement.prototype.calculateBoundingBox=function(e,t){var r,n=e.length;for(r=0;r<n;r+=1)e[r]&&e[r].sh?this.calculateShapeBoundingBox(e[r],t):e[r]&&e[r].it?this.calculateBoundingBox(e[r].it,t):e[r]&&e[r].style&&e[r].w&&this.expandStrokeBoundingBox(e[r].w,t)},HShapeElement.prototype.expandStrokeBoundingBox=function(e,t){var r=0;if(e.keyframes){for(var n=0;n<e.keyframes.length;n+=1){var i=e.keyframes[n].s;i>r&&(r=i)}r*=e.mult}else r=e.v*e.mult;t.x-=r,t.xMax+=r,t.y-=r,t.yMax+=r},HShapeElement.prototype.currentBoxContains=function(e){return this.currentBBox.x<=e.x&&this.currentBBox.y<=e.y&&this.currentBBox.width+this.currentBBox.x>=e.x+e.width&&this.currentBBox.height+this.currentBBox.y>=e.y+e.height},HShapeElement.prototype.renderInnerContent=function(){if(this._renderShapeFrame(),!this.hidden&&(this._isFirstFrame||this._mdf)){var e=this.tempBoundingBox,t=999999;if(e.x=t,e.xMax=-t,e.y=t,e.yMax=-t,this.calculateBoundingBox(this.itemsData,e),e.width=e.xMax<e.x?0:e.xMax-e.x,e.height=e.yMax<e.y?0:e.yMax-e.y,this.currentBoxContains(e))return;var r=!1;if(this.currentBBox.w!==e.width&&(this.currentBBox.w=e.width,this.shapeCont.setAttribute("width",e.width),r=!0),this.currentBBox.h!==e.height&&(this.currentBBox.h=e.height,this.shapeCont.setAttribute("height",e.height),r=!0),r||this.currentBBox.x!==e.x||this.currentBBox.y!==e.y){this.currentBBox.w=e.width,this.currentBBox.h=e.height,this.currentBBox.x=e.x,this.currentBBox.y=e.y,this.shapeCont.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h);var n=this.shapeCont.style,i="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";n.transform=i,n.webkitTransform=i}}},extendPrototype([BaseElement,TransformElement,HBaseElement,HierarchyElement,FrameElement,RenderableDOMElement,ITextElement],HTextElement),HTextElement.prototype.createContent=function(){if(this.isMasked=this.checkMasks(),this.isMasked){this.renderType="svg",this.compW=this.comp.data.w,this.compH=this.comp.data.h,this.svgElement.setAttribute("width",this.compW),this.svgElement.setAttribute("height",this.compH);var e=createNS("g");this.maskedElement.appendChild(e),this.innerElem=e}else this.renderType="html",this.innerElem=this.layerElement;this.checkParenting()},HTextElement.prototype.buildNewText=function(){var e=this.textProperty.currentData;this.renderedLetters=createSizedArray(e.l?e.l.length:0);var t=this.innerElem.style,r=e.fc?this.buildColor(e.fc):"rgba(0,0,0,0)";t.fill=r,t.color=r,e.sc&&(t.stroke=this.buildColor(e.sc),t.strokeWidth=e.sw+"px");var n,i,a=this.globalData.fontManager.getFontByName(e.f);if(!this.globalData.fontManager.chars)if(t.fontSize=e.finalSize+"px",t.lineHeight=e.finalSize+"px",a.fClass)this.innerElem.className=a.fClass;else{t.fontFamily=a.fFamily;var o=e.fWeight,s=e.fStyle;t.fontStyle=s,t.fontWeight=o}var l,c,d,u=e.l;i=u.length;var p,h=this.mHelper,f="",m=0;for(n=0;n<i;n+=1){if(this.globalData.fontManager.chars?(this.textPaths[m]?l=this.textPaths[m]:((l=createNS("path")).setAttribute("stroke-linecap",lineCapEnum[1]),l.setAttribute("stroke-linejoin",lineJoinEnum[2]),l.setAttribute("stroke-miterlimit","4")),this.isMasked||(this.textSpans[m]?d=(c=this.textSpans[m]).children[0]:((c=createTag("div")).style.lineHeight=0,(d=createNS("svg")).appendChild(l),styleDiv(c)))):this.isMasked?l=this.textPaths[m]?this.textPaths[m]:createNS("text"):this.textSpans[m]?(c=this.textSpans[m],l=this.textPaths[m]):(styleDiv(c=createTag("span")),styleDiv(l=createTag("span")),c.appendChild(l)),this.globalData.fontManager.chars){var g,v=this.globalData.fontManager.getCharData(e.finalText[n],a.fStyle,this.globalData.fontManager.getFontByName(e.f).fFamily);if(g=v?v.data:null,h.reset(),g&&g.shapes&&g.shapes.length&&(p=g.shapes[0].it,h.scale(e.finalSize/100,e.finalSize/100),f=this.createPathShape(h,p),l.setAttribute("d",f)),this.isMasked)this.innerElem.appendChild(l);else{if(this.innerElem.appendChild(c),g&&g.shapes){document.body.appendChild(d);var y=d.getBBox();d.setAttribute("width",y.width+2),d.setAttribute("height",y.height+2),d.setAttribute("viewBox",y.x-1+" "+(y.y-1)+" "+(y.width+2)+" "+(y.height+2));var b=d.style,E="translate("+(y.x-1)+"px,"+(y.y-1)+"px)";b.transform=E,b.webkitTransform=E,u[n].yOffset=y.y-1}else d.setAttribute("width",1),d.setAttribute("height",1);c.appendChild(d)}}else if(l.textContent=u[n].val,l.setAttributeNS("http://www.w3.org/XML/1998/namespace","xml:space","preserve"),this.isMasked)this.innerElem.appendChild(l);else{this.innerElem.appendChild(c);var _=l.style,S="translate3d(0,"+-e.finalSize/1.2+"px,0)";_.transform=S,_.webkitTransform=S}this.isMasked?this.textSpans[m]=l:this.textSpans[m]=c,this.textSpans[m].style.display="block",this.textPaths[m]=l,m+=1}for(;m<this.textSpans.length;)this.textSpans[m].style.display="none",m+=1},HTextElement.prototype.renderInnerContent=function(){var e;if(this.validateText(),this.data.singleShape){if(!this._isFirstFrame&&!this.lettersChangedFlag)return;if(this.isMasked&&this.finalTransform._matMdf){this.svgElement.setAttribute("viewBox",-this.finalTransform.mProp.p.v[0]+" "+-this.finalTransform.mProp.p.v[1]+" "+this.compW+" "+this.compH),e=this.svgElement.style;var t="translate("+-this.finalTransform.mProp.p.v[0]+"px,"+-this.finalTransform.mProp.p.v[1]+"px)";e.transform=t,e.webkitTransform=t}}if(this.textAnimator.getMeasures(this.textProperty.currentData,this.lettersChangedFlag),this.lettersChangedFlag||this.textAnimator.lettersChangedFlag){var r,n,i,a,o,s=0,l=this.textAnimator.renderedLetters,c=this.textProperty.currentData.l;for(n=c.length,r=0;r<n;r+=1)c[r].n?s+=1:(a=this.textSpans[r],o=this.textPaths[r],i=l[s],s+=1,i._mdf.m&&(this.isMasked?a.setAttribute("transform",i.m):(a.style.webkitTransform=i.m,a.style.transform=i.m)),a.style.opacity=i.o,i.sw&&i._mdf.sw&&o.setAttribute("stroke-width",i.sw),i.sc&&i._mdf.sc&&o.setAttribute("stroke",i.sc),i.fc&&i._mdf.fc&&(o.setAttribute("fill",i.fc),o.style.color=i.fc));if(this.innerElem.getBBox&&!this.hidden&&(this._isFirstFrame||this._mdf)){var d=this.innerElem.getBBox();if(this.currentBBox.w!==d.width&&(this.currentBBox.w=d.width,this.svgElement.setAttribute("width",d.width)),this.currentBBox.h!==d.height&&(this.currentBBox.h=d.height,this.svgElement.setAttribute("height",d.height)),this.currentBBox.w!==d.width+2||this.currentBBox.h!==d.height+2||this.currentBBox.x!==d.x-1||this.currentBBox.y!==d.y-1){this.currentBBox.w=d.width+2,this.currentBBox.h=d.height+2,this.currentBBox.x=d.x-1,this.currentBBox.y=d.y-1,this.svgElement.setAttribute("viewBox",this.currentBBox.x+" "+this.currentBBox.y+" "+this.currentBBox.w+" "+this.currentBBox.h),e=this.svgElement.style;var u="translate("+this.currentBBox.x+"px,"+this.currentBBox.y+"px)";e.transform=u,e.webkitTransform=u}}}},extendPrototype([BaseElement,FrameElement,HierarchyElement],HCameraElement),HCameraElement.prototype.setup=function(){var e,t,r,n,i=this.comp.threeDElements.length;for(e=0;e<i;e+=1)if("3d"===(t=this.comp.threeDElements[e]).type){r=t.perspectiveElem.style,n=t.container.style;var a=this.pe.v+"px",o="0px 0px 0px",s="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";r.perspective=a,r.webkitPerspective=a,n.transformOrigin=o,n.mozTransformOrigin=o,n.webkitTransformOrigin=o,r.transform=s,r.webkitTransform=s}},HCameraElement.prototype.createElements=function(){},HCameraElement.prototype.hide=function(){},HCameraElement.prototype.renderFrame=function(){var e,t,r=this._isFirstFrame;if(this.hierarchy)for(t=this.hierarchy.length,e=0;e<t;e+=1)r=this.hierarchy[e].finalTransform.mProp._mdf||r;if(r||this.pe._mdf||this.p&&this.p._mdf||this.px&&(this.px._mdf||this.py._mdf||this.pz._mdf)||this.rx._mdf||this.ry._mdf||this.rz._mdf||this.or._mdf||this.a&&this.a._mdf){if(this.mat.reset(),this.hierarchy)for(e=t=this.hierarchy.length-1;e>=0;e-=1){var n=this.hierarchy[e].finalTransform.mProp;this.mat.translate(-n.p.v[0],-n.p.v[1],n.p.v[2]),this.mat.rotateX(-n.or.v[0]).rotateY(-n.or.v[1]).rotateZ(n.or.v[2]),this.mat.rotateX(-n.rx.v).rotateY(-n.ry.v).rotateZ(n.rz.v),this.mat.scale(1/n.s.v[0],1/n.s.v[1],1/n.s.v[2]),this.mat.translate(n.a.v[0],n.a.v[1],n.a.v[2])}if(this.p?this.mat.translate(-this.p.v[0],-this.p.v[1],this.p.v[2]):this.mat.translate(-this.px.v,-this.py.v,this.pz.v),this.a){var i;i=this.p?[this.p.v[0]-this.a.v[0],this.p.v[1]-this.a.v[1],this.p.v[2]-this.a.v[2]]:[this.px.v-this.a.v[0],this.py.v-this.a.v[1],this.pz.v-this.a.v[2]];var a=Math.sqrt(Math.pow(i[0],2)+Math.pow(i[1],2)+Math.pow(i[2],2)),o=[i[0]/a,i[1]/a,i[2]/a],s=Math.sqrt(o[2]*o[2]+o[0]*o[0]),l=Math.atan2(o[1],s),c=Math.atan2(o[0],-o[2]);this.mat.rotateY(c).rotateX(-l)}this.mat.rotateX(-this.rx.v).rotateY(-this.ry.v).rotateZ(this.rz.v),this.mat.rotateX(-this.or.v[0]).rotateY(-this.or.v[1]).rotateZ(this.or.v[2]),this.mat.translate(this.globalData.compSize.w/2,this.globalData.compSize.h/2,0),this.mat.translate(0,0,this.pe.v);var d=!this._prevMat.equals(this.mat);if((d||this.pe._mdf)&&this.comp.threeDElements){var u,p,h;for(t=this.comp.threeDElements.length,e=0;e<t;e+=1)if("3d"===(u=this.comp.threeDElements[e]).type){if(d){var f=this.mat.toCSS();(h=u.container.style).transform=f,h.webkitTransform=f}this.pe._mdf&&((p=u.perspectiveElem.style).perspective=this.pe.v+"px",p.webkitPerspective=this.pe.v+"px")}this.mat.clone(this._prevMat)}}this._isFirstFrame=!1},HCameraElement.prototype.prepareFrame=function(e){this.prepareProperties(e,!0)},HCameraElement.prototype.destroy=function(){},HCameraElement.prototype.getBaseElement=function(){return null},extendPrototype([BaseElement,TransformElement,HBaseElement,HSolidElement,HierarchyElement,FrameElement,RenderableElement],HImageElement),HImageElement.prototype.createContent=function(){var e=this.globalData.getAssetsPath(this.assetData),t=new Image;this.data.hasMask?(this.imageElem=createNS("image"),this.imageElem.setAttribute("width",this.assetData.w+"px"),this.imageElem.setAttribute("height",this.assetData.h+"px"),this.imageElem.setAttributeNS("http://www.w3.org/1999/xlink","href",e),this.layerElement.appendChild(this.imageElem),this.baseElement.setAttribute("width",this.assetData.w),this.baseElement.setAttribute("height",this.assetData.h)):this.layerElement.appendChild(t),t.crossOrigin="anonymous",t.src=e,this.data.ln&&this.baseElement.setAttribute("id",this.data.ln)},extendPrototype([BaseRenderer],HybridRendererBase),HybridRendererBase.prototype.buildItem=SVGRenderer.prototype.buildItem,HybridRendererBase.prototype.checkPendingElements=function(){for(;this.pendingElements.length;)this.pendingElements.pop().checkParenting()},HybridRendererBase.prototype.appendElementInPos=function(e,t){var r=e.getBaseElement();if(r){var n=this.layers[t];if(n.ddd&&this.supports3d)this.addTo3dContainer(r,t);else if(this.threeDElements)this.addTo3dContainer(r,t);else{for(var i,a,o=0;o<t;)this.elements[o]&&!0!==this.elements[o]&&this.elements[o].getBaseElement&&(a=this.elements[o],i=(this.layers[o].ddd?this.getThreeDContainerByPos(o):a.getBaseElement())||i),o+=1;i?n.ddd&&this.supports3d||this.layerElement.insertBefore(r,i):n.ddd&&this.supports3d||this.layerElement.appendChild(r)}}},HybridRendererBase.prototype.createShape=function(e){return this.supports3d?new HShapeElement(e,this.globalData,this):new SVGShapeElement(e,this.globalData,this)},HybridRendererBase.prototype.createText=function(e){return this.supports3d?new HTextElement(e,this.globalData,this):new SVGTextLottieElement(e,this.globalData,this)},HybridRendererBase.prototype.createCamera=function(e){return this.camera=new HCameraElement(e,this.globalData,this),this.camera},HybridRendererBase.prototype.createImage=function(e){return this.supports3d?new HImageElement(e,this.globalData,this):new IImageElement(e,this.globalData,this)},HybridRendererBase.prototype.createSolid=function(e){return this.supports3d?new HSolidElement(e,this.globalData,this):new ISolidElement(e,this.globalData,this)},HybridRendererBase.prototype.createNull=SVGRenderer.prototype.createNull,HybridRendererBase.prototype.getThreeDContainerByPos=function(e){for(var t=0,r=this.threeDElements.length;t<r;){if(this.threeDElements[t].startPos<=e&&this.threeDElements[t].endPos>=e)return this.threeDElements[t].perspectiveElem;t+=1}return null},HybridRendererBase.prototype.createThreeDContainer=function(e,t){var r,n,i=createTag("div");styleDiv(i);var a=createTag("div");if(styleDiv(a),"3d"===t){(r=i.style).width=this.globalData.compSize.w+"px",r.height=this.globalData.compSize.h+"px";var o="50% 50%";r.webkitTransformOrigin=o,r.mozTransformOrigin=o,r.transformOrigin=o;var s="matrix3d(1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1)";(n=a.style).transform=s,n.webkitTransform=s}i.appendChild(a);var l={container:a,perspectiveElem:i,startPos:e,endPos:e,type:t};return this.threeDElements.push(l),l},HybridRendererBase.prototype.build3dContainers=function(){var e,t,r=this.layers.length,n="";for(e=0;e<r;e+=1)this.layers[e].ddd&&3!==this.layers[e].ty?("3d"!==n&&(n="3d",t=this.createThreeDContainer(e,"3d")),t.endPos=Math.max(t.endPos,e)):("2d"!==n&&(n="2d",t=this.createThreeDContainer(e,"2d")),t.endPos=Math.max(t.endPos,e));for(e=(r=this.threeDElements.length)-1;e>=0;e-=1)this.resizerElem.appendChild(this.threeDElements[e].perspectiveElem)},HybridRendererBase.prototype.addTo3dContainer=function(e,t){for(var r=0,n=this.threeDElements.length;r<n;){if(t<=this.threeDElements[r].endPos){for(var i,a=this.threeDElements[r].startPos;a<t;)this.elements[a]&&this.elements[a].getBaseElement&&(i=this.elements[a].getBaseElement()),a+=1;i?this.threeDElements[r].container.insertBefore(e,i):this.threeDElements[r].container.appendChild(e);break}r+=1}},HybridRendererBase.prototype.configAnimation=function(e){var t=createTag("div"),r=this.animationItem.wrapper,n=t.style;n.width=e.w+"px",n.height=e.h+"px",this.resizerElem=t,styleDiv(t),n.transformStyle="flat",n.mozTransformStyle="flat",n.webkitTransformStyle="flat",this.renderConfig.className&&t.setAttribute("class",this.renderConfig.className),r.appendChild(t),n.overflow="hidden";var i=createNS("svg");i.setAttribute("width","1"),i.setAttribute("height","1"),styleDiv(i),this.resizerElem.appendChild(i);var a=createNS("defs");i.appendChild(a),this.data=e,this.setupGlobalData(e,i),this.globalData.defs=a,this.layers=e.layers,this.layerElement=this.resizerElem,this.build3dContainers(),this.updateContainerSize()},HybridRendererBase.prototype.destroy=function(){var e;this.animationItem.wrapper&&(this.animationItem.wrapper.innerText=""),this.animationItem.container=null,this.globalData.defs=null;var t=this.layers?this.layers.length:0;for(e=0;e<t;e+=1)this.elements[e]&&this.elements[e].destroy&&this.elements[e].destroy();this.elements.length=0,this.destroyed=!0,this.animationItem=null},HybridRendererBase.prototype.updateContainerSize=function(){var e,t,r,n,i=this.animationItem.wrapper.offsetWidth,a=this.animationItem.wrapper.offsetHeight,o=i/a;this.globalData.compSize.w/this.globalData.compSize.h>o?(e=i/this.globalData.compSize.w,t=i/this.globalData.compSize.w,r=0,n=(a-this.globalData.compSize.h*(i/this.globalData.compSize.w))/2):(e=a/this.globalData.compSize.h,t=a/this.globalData.compSize.h,r=(i-this.globalData.compSize.w*(a/this.globalData.compSize.h))/2,n=0);var s=this.resizerElem.style;s.webkitTransform="matrix3d("+e+",0,0,0,0,"+t+",0,0,0,0,1,0,"+r+","+n+",0,1)",s.transform=s.webkitTransform},HybridRendererBase.prototype.renderFrame=SVGRenderer.prototype.renderFrame,HybridRendererBase.prototype.hide=function(){this.resizerElem.style.display="none"},HybridRendererBase.prototype.show=function(){this.resizerElem.style.display="block"},HybridRendererBase.prototype.initItems=function(){if(this.buildAllItems(),this.camera)this.camera.setup();else{var e,t=this.globalData.compSize.w,r=this.globalData.compSize.h,n=this.threeDElements.length;for(e=0;e<n;e+=1){var i=this.threeDElements[e].perspectiveElem.style;i.webkitPerspective=Math.sqrt(Math.pow(t,2)+Math.pow(r,2))+"px",i.perspective=i.webkitPerspective}}},HybridRendererBase.prototype.searchExtraCompositions=function(e){var t,r=e.length,n=createTag("div");for(t=0;t<r;t+=1)if(e[t].xt){var i=this.createComp(e[t],n,this.globalData.comp,null);i.initExpressions(),this.globalData.projectInterface.registerComposition(i)}},extendPrototype([HybridRendererBase,ICompElement,HBaseElement],HCompElement),HCompElement.prototype._createBaseContainerElements=HCompElement.prototype.createContainerElements,HCompElement.prototype.createContainerElements=function(){this._createBaseContainerElements(),this.data.hasMask?(this.svgElement.setAttribute("width",this.data.w),this.svgElement.setAttribute("height",this.data.h),this.transformedElement=this.baseElement):this.transformedElement=this.layerElement},HCompElement.prototype.addTo3dContainer=function(e,t){for(var r,n=0;n<t;)this.elements[n]&&this.elements[n].getBaseElement&&(r=this.elements[n].getBaseElement()),n+=1;r?this.layerElement.insertBefore(e,r):this.layerElement.appendChild(e)},HCompElement.prototype.createComp=function(e){return this.supports3d?new HCompElement(e,this.globalData,this):new SVGCompElement(e,this.globalData,this)},extendPrototype([HybridRendererBase],HybridRenderer),HybridRenderer.prototype.createComp=function(e){return this.supports3d?new HCompElement(e,this.globalData,this):new SVGCompElement(e,this.globalData,this)};var CompExpressionInterface=function(e){function t(t){for(var r=0,n=e.layers.length;r<n;){if(e.layers[r].nm===t||e.layers[r].ind===t)return e.elements[r].layerInterface;r+=1}return null}return Object.defineProperty(t,"_name",{value:e.data.nm}),t.layer=t,t.pixelAspect=1,t.height=e.data.h||e.globalData.compSize.h,t.width=e.data.w||e.globalData.compSize.w,t.pixelAspect=1,t.frameDuration=1/e.globalData.frameRate,t.displayStartTime=0,t.numLayers=e.layers.length,t};function _typeof$2(e){return _typeof$2="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$2(e)}function seedRandom(e,t){var r=this,n=256,i="random",a=t.pow(n,6),o=t.pow(2,52),s=2*o,l=255;function c(e){var t,r=e.length,i=this,a=0,o=i.i=i.j=0,s=i.S=[];for(r||(e=[r++]);a<n;)s[a]=a++;for(a=0;a<n;a++)s[a]=s[o=l&o+e[a%r]+(t=s[a])],s[o]=t;i.g=function(e){for(var t,r=0,a=i.i,o=i.j,s=i.S;e--;)t=s[a=l&a+1],r=r*n+s[l&(s[a]=s[o=l&o+t])+(s[o]=t)];return i.i=a,i.j=o,r}}function d(e,t){return t.i=e.i,t.j=e.j,t.S=e.S.slice(),t}function u(e,t){var r,n=[],i=_typeof$2(e);if(t&&"object"==i)for(r in e)try{n.push(u(e[r],t-1))}catch(e){}return n.length?n:"string"==i?e:e+"\0"}function p(e,t){for(var r,n=e+"",i=0;i<n.length;)t[l&i]=l&(r^=19*t[l&i])+n.charCodeAt(i++);return h(t)}function h(e){return String.fromCharCode.apply(0,e)}t["seed"+i]=function(l,f,m){var g=[],v=p(u((f=!0===f?{entropy:!0}:f||{}).entropy?[l,h(e)]:null===l?function(){try{var t=new Uint8Array(n);return(r.crypto||r.msCrypto).getRandomValues(t),h(t)}catch(t){var i=r.navigator,a=i&&i.plugins;return[+new Date,r,a,r.screen,h(e)]}}():l,3),g),y=new c(g),b=function(){for(var e=y.g(6),t=a,r=0;e<o;)e=(e+r)*n,t*=n,r=y.g(1);for(;e>=s;)e/=2,t/=2,r>>>=1;return(e+r)/t};return b.int32=function(){return 0|y.g(4)},b.quick=function(){return y.g(4)/4294967296},b.double=b,p(h(y.S),e),(f.pass||m||function(e,r,n,a){return a&&(a.S&&d(a,y),e.state=function(){return d(y,{})}),n?(t[i]=e,r):e})(b,v,"global"in f?f.global:this==t,f.state)},p(t.random(),e)}function initialize$2(e){seedRandom([],e)}var propTypes={SHAPE:"shape"};function _typeof$1(e){return _typeof$1="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof$1(e)}var ExpressionManager=function(){var ob={},Math=BMMath,window=null,document=null,XMLHttpRequest=null,fetch=null,frames=null,_lottieGlobal={};function resetFrame(){_lottieGlobal={}}function $bm_isInstanceOfArray(e){return e.constructor===Array||e.constructor===Float32Array}function isNumerable(e,t){return"number"===e||t instanceof Number||"boolean"===e||"string"===e}function $bm_neg(e){var t=_typeof$1(e);if("number"===t||e instanceof Number||"boolean"===t)return-e;if($bm_isInstanceOfArray(e)){var r,n=e.length,i=[];for(r=0;r<n;r+=1)i[r]=-e[r];return i}return e.propType?e.v:-e}initialize$2(BMMath);var easeInBez=BezierFactory.getBezierEasing(.333,0,.833,.833,"easeIn").get,easeOutBez=BezierFactory.getBezierEasing(.167,.167,.667,1,"easeOut").get,easeInOutBez=BezierFactory.getBezierEasing(.33,0,.667,1,"easeInOut").get;function sum(e,t){var r=_typeof$1(e),n=_typeof$1(t);if(isNumerable(r,e)&&isNumerable(n,t)||"string"===r||"string"===n)return e+t;if($bm_isInstanceOfArray(e)&&isNumerable(n,t))return(e=e.slice(0))[0]+=t,e;if(isNumerable(r,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e+t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var i=0,a=e.length,o=t.length,s=[];i<a||i<o;)("number"==typeof e[i]||e[i]instanceof Number)&&("number"==typeof t[i]||t[i]instanceof Number)?s[i]=e[i]+t[i]:s[i]=void 0===t[i]?e[i]:e[i]||t[i],i+=1;return s}return 0}var add=sum;function sub(e,t){var r=_typeof$1(e),n=_typeof$1(t);if(isNumerable(r,e)&&isNumerable(n,t))return"string"===r&&(e=parseInt(e,10)),"string"===n&&(t=parseInt(t,10)),e-t;if($bm_isInstanceOfArray(e)&&isNumerable(n,t))return(e=e.slice(0))[0]-=t,e;if(isNumerable(r,e)&&$bm_isInstanceOfArray(t))return(t=t.slice(0))[0]=e-t[0],t;if($bm_isInstanceOfArray(e)&&$bm_isInstanceOfArray(t)){for(var i=0,a=e.length,o=t.length,s=[];i<a||i<o;)("number"==typeof e[i]||e[i]instanceof Number)&&("number"==typeof t[i]||t[i]instanceof Number)?s[i]=e[i]-t[i]:s[i]=void 0===t[i]?e[i]:e[i]||t[i],i+=1;return s}return 0}function mul(e,t){var r,n,i,a=_typeof$1(e),o=_typeof$1(t);if(isNumerable(a,e)&&isNumerable(o,t))return e*t;if($bm_isInstanceOfArray(e)&&isNumerable(o,t)){for(i=e.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e[n]*t;return r}if(isNumerable(a,e)&&$bm_isInstanceOfArray(t)){for(i=t.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e*t[n];return r}return 0}function div(e,t){var r,n,i,a=_typeof$1(e),o=_typeof$1(t);if(isNumerable(a,e)&&isNumerable(o,t))return e/t;if($bm_isInstanceOfArray(e)&&isNumerable(o,t)){for(i=e.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e[n]/t;return r}if(isNumerable(a,e)&&$bm_isInstanceOfArray(t)){for(i=t.length,r=createTypedArray("float32",i),n=0;n<i;n+=1)r[n]=e/t[n];return r}return 0}function mod(e,t){return"string"==typeof e&&(e=parseInt(e,10)),"string"==typeof t&&(t=parseInt(t,10)),e%t}var $bm_sum=sum,$bm_sub=sub,$bm_mul=mul,$bm_div=div,$bm_mod=mod;function clamp(e,t,r){if(t>r){var n=r;r=t,t=n}return Math.min(Math.max(e,t),r)}function radiansToDegrees(e){return e/degToRads}var radians_to_degrees=radiansToDegrees;function degreesToRadians(e){return e*degToRads}var degrees_to_radians=radiansToDegrees,helperLengthArray=[0,0,0,0,0,0];function length(e,t){if("number"==typeof e||e instanceof Number)return t=t||0,Math.abs(e-t);var r;t||(t=helperLengthArray);var n=Math.min(e.length,t.length),i=0;for(r=0;r<n;r+=1)i+=Math.pow(t[r]-e[r],2);return Math.sqrt(i)}function normalize(e){return div(e,length(e))}function rgbToHsl(e){var t,r,n=e[0],i=e[1],a=e[2],o=Math.max(n,i,a),s=Math.min(n,i,a),l=(o+s)/2;if(o===s)t=0,r=0;else{var c=o-s;switch(r=l>.5?c/(2-o-s):c/(o+s),o){case n:t=(i-a)/c+(i<a?6:0);break;case i:t=(a-n)/c+2;break;case a:t=(n-i)/c+4}t/=6}return[t,r,l,e[3]]}function hue2rgb(e,t,r){return r<0&&(r+=1),r>1&&(r-=1),r<1/6?e+6*(t-e)*r:r<.5?t:r<2/3?e+(t-e)*(2/3-r)*6:e}function hslToRgb(e){var t,r,n,i=e[0],a=e[1],o=e[2];if(0===a)t=o,n=o,r=o;else{var s=o<.5?o*(1+a):o+a-o*a,l=2*o-s;t=hue2rgb(l,s,i+1/3),r=hue2rgb(l,s,i),n=hue2rgb(l,s,i-1/3)}return[t,r,n,e[3]]}function linear(e,t,r,n,i){if(void 0!==n&&void 0!==i||(n=t,i=r,t=0,r=1),r<t){var a=r;r=t,t=a}if(e<=t)return n;if(e>=r)return i;var o,s=r===t?0:(e-t)/(r-t);if(!n.length)return n+(i-n)*s;var l=n.length,c=createTypedArray("float32",l);for(o=0;o<l;o+=1)c[o]=n[o]+(i[o]-n[o])*s;return c}function random(e,t){if(void 0===t&&(void 0===e?(e=0,t=1):(t=e,e=void 0)),t.length){var r,n=t.length;e||(e=createTypedArray("float32",n));var i=createTypedArray("float32",n),a=BMMath.random();for(r=0;r<n;r+=1)i[r]=e[r]+a*(t[r]-e[r]);return i}return void 0===e&&(e=0),e+BMMath.random()*(t-e)}function createPath(e,t,r,n){var i,a=e.length,o=shapePool.newElement();o.setPathData(!!n,a);var s,l,c=[0,0];for(i=0;i<a;i+=1)s=t&&t[i]?t[i]:c,l=r&&r[i]?r[i]:c,o.setTripleAt(e[i][0],e[i][1],l[0]+e[i][0],l[1]+e[i][1],s[0]+e[i][0],s[1]+e[i][1],i,!0);return o}function initiateExpression(elem,data,property){function noOp(e){return e}if(!elem.globalData.renderConfig.runExpressions)return noOp;var val=data.x,needsVelocity=/velocity(?![\w\d])/.test(val),_needsRandom=-1!==val.indexOf("random"),elemType=elem.data.ty,transform,$bm_transform,content,effect,thisProperty=property;thisProperty._name=elem.data.nm,thisProperty.valueAtTime=thisProperty.getValueAtTime,Object.defineProperty(thisProperty,"value",{get:function(){return thisProperty.v}}),elem.comp.frameDuration=1/elem.comp.globalData.frameRate,elem.comp.displayStartTime=0;var inPoint=elem.data.ip/elem.comp.globalData.frameRate,outPoint=elem.data.op/elem.comp.globalData.frameRate,width=elem.data.sw?elem.data.sw:0,height=elem.data.sh?elem.data.sh:0,name=elem.data.nm,loopIn,loop_in,loopOut,loop_out,smooth,toWorld,fromWorld,fromComp,toComp,fromCompToSurface,position,rotation,anchorPoint,scale,thisLayer,thisComp,mask,valueAtTime,velocityAtTime,scoped_bm_rt,expression_function=eval("[function _expression_function(){"+val+";scoped_bm_rt=$bm_rt}]")[0],numKeys=property.kf?data.k.length:0,active=!this.data||!0!==this.data.hd,wiggle=function(e,t){var r,n,i=this.pv.length?this.pv.length:1,a=createTypedArray("float32",i),o=Math.floor(5*time);for(r=0,n=0;r<o;){for(n=0;n<i;n+=1)a[n]+=-t+2*t*BMMath.random();r+=1}var s=5*time,l=s-Math.floor(s),c=createTypedArray("float32",i);if(i>1){for(n=0;n<i;n+=1)c[n]=this.pv[n]+a[n]+(-t+2*t*BMMath.random())*l;return c}return this.pv+a[0]+(-t+2*t*BMMath.random())*l}.bind(this);function loopInDuration(e,t){return loopIn(e,t,!0)}function loopOutDuration(e,t){return loopOut(e,t,!0)}thisProperty.loopIn&&(loopIn=thisProperty.loopIn.bind(thisProperty),loop_in=loopIn),thisProperty.loopOut&&(loopOut=thisProperty.loopOut.bind(thisProperty),loop_out=loopOut),thisProperty.smooth&&(smooth=thisProperty.smooth.bind(thisProperty)),this.getValueAtTime&&(valueAtTime=this.getValueAtTime.bind(this)),this.getVelocityAtTime&&(velocityAtTime=this.getVelocityAtTime.bind(this));var comp=elem.comp.globalData.projectInterface.bind(elem.comp.globalData.projectInterface),time,velocity,value,text,textIndex,textTotal,selectorValue;function lookAt(e,t){var r=[t[0]-e[0],t[1]-e[1],t[2]-e[2]],n=Math.atan2(r[0],Math.sqrt(r[1]*r[1]+r[2]*r[2]))/degToRads;return[-Math.atan2(r[1],r[2])/degToRads,n,0]}function easeOut(e,t,r,n,i){return applyEase(easeOutBez,e,t,r,n,i)}function easeIn(e,t,r,n,i){return applyEase(easeInBez,e,t,r,n,i)}function ease(e,t,r,n,i){return applyEase(easeInOutBez,e,t,r,n,i)}function applyEase(e,t,r,n,i,a){void 0===i?(i=r,a=n):t=(t-r)/(n-r),t>1?t=1:t<0&&(t=0);var o=e(t);if($bm_isInstanceOfArray(i)){var s,l=i.length,c=createTypedArray("float32",l);for(s=0;s<l;s+=1)c[s]=(a[s]-i[s])*o+i[s];return c}return(a-i)*o+i}function nearestKey(e){var t,r,n,i=data.k.length;if(data.k.length&&"number"!=typeof data.k[0])if(r=-1,(e*=elem.comp.globalData.frameRate)<data.k[0].t)r=1,n=data.k[0].t;else{for(t=0;t<i-1;t+=1){if(e===data.k[t].t){r=t+1,n=data.k[t].t;break}if(e>data.k[t].t&&e<data.k[t+1].t){e-data.k[t].t>data.k[t+1].t-e?(r=t+2,n=data.k[t+1].t):(r=t+1,n=data.k[t].t);break}}-1===r&&(r=t+1,n=data.k[t].t)}else r=0,n=0;var a={};return a.index=r,a.time=n/elem.comp.globalData.frameRate,a}function key(e){var t,r,n;if(!data.k.length||"number"==typeof data.k[0])throw new Error("The property has no keyframe at index "+e);e-=1,t={time:data.k[e].t/elem.comp.globalData.frameRate,value:[]};var i=Object.prototype.hasOwnProperty.call(data.k[e],"s")?data.k[e].s:data.k[e-1].e;for(n=i.length,r=0;r<n;r+=1)t[r]=i[r],t.value[r]=i[r];return t}function framesToTime(e,t){return t||(t=elem.comp.globalData.frameRate),e/t}function timeToFrames(e,t){return e||0===e||(e=time),t||(t=elem.comp.globalData.frameRate),e*t}function seedRandom(e){BMMath.seedrandom(randSeed+e)}function sourceRectAtTime(){return elem.sourceRectAtTime()}function substring(e,t){return"string"==typeof value?void 0===t?value.substring(e):value.substring(e,t):""}function substr(e,t){return"string"==typeof value?void 0===t?value.substr(e):value.substr(e,t):""}function posterizeTime(e){time=0===e?0:Math.floor(time*e)/e,value=valueAtTime(time)}var index=elem.data.ind,hasParent=!(!elem.hierarchy||!elem.hierarchy.length),parent,randSeed=Math.floor(1e6*Math.random()),globalData=elem.globalData;function executeExpression(e){return value=e,this.frameExpressionId===elem.globalData.frameId&&"textSelector"!==this.propType?value:("textSelector"===this.propType&&(textIndex=this.textIndex,textTotal=this.textTotal,selectorValue=this.selectorValue),thisLayer||(text=elem.layerInterface.text,thisLayer=elem.layerInterface,thisComp=elem.comp.compInterface,toWorld=thisLayer.toWorld.bind(thisLayer),fromWorld=thisLayer.fromWorld.bind(thisLayer),fromComp=thisLayer.fromComp.bind(thisLayer),toComp=thisLayer.toComp.bind(thisLayer),mask=thisLayer.mask?thisLayer.mask.bind(thisLayer):null,fromCompToSurface=fromComp),transform||(transform=elem.layerInterface("ADBE Transform Group"),$bm_transform=transform,transform&&(anchorPoint=transform.anchorPoint)),4!==elemType||content||(content=thisLayer("ADBE Root Vectors Group")),effect||(effect=thisLayer(4)),(hasParent=!(!elem.hierarchy||!elem.hierarchy.length))&&!parent&&(parent=elem.hierarchy[0].layerInterface),time=this.comp.renderedFrame/this.comp.globalData.frameRate,_needsRandom&&seedRandom(randSeed+time),needsVelocity&&(velocity=velocityAtTime(time)),expression_function(),this.frameExpressionId=elem.globalData.frameId,scoped_bm_rt=scoped_bm_rt.propType===propTypes.SHAPE?scoped_bm_rt.v:scoped_bm_rt)}return executeExpression.__preventDeadCodeRemoval=[$bm_transform,anchorPoint,time,velocity,inPoint,outPoint,width,height,name,loop_in,loop_out,smooth,toComp,fromCompToSurface,toWorld,fromWorld,mask,position,rotation,scale,thisComp,numKeys,active,wiggle,loopInDuration,loopOutDuration,comp,lookAt,easeOut,easeIn,ease,nearestKey,key,text,textIndex,textTotal,selectorValue,framesToTime,timeToFrames,sourceRectAtTime,substring,substr,posterizeTime,index,globalData],executeExpression}return ob.initiateExpression=initiateExpression,ob.__preventDeadCodeRemoval=[window,document,XMLHttpRequest,fetch,frames,$bm_neg,add,$bm_sum,$bm_sub,$bm_mul,$bm_div,$bm_mod,clamp,radians_to_degrees,degreesToRadians,degrees_to_radians,normalize,rgbToHsl,hslToRgb,linear,random,createPath,_lottieGlobal],ob.resetFrame=resetFrame,ob}(),Expressions=function(){var e={initExpressions:function(e){var t=0,r=[];e.renderer.compInterface=CompExpressionInterface(e.renderer),e.renderer.globalData.projectInterface.registerComposition(e.renderer),e.renderer.globalData.pushExpression=function(){t+=1},e.renderer.globalData.popExpression=function(){0==(t-=1)&&function(){var e,t=r.length;for(e=0;e<t;e+=1)r[e].release();r.length=0}()},e.renderer.globalData.registerExpressionProperty=function(e){-1===r.indexOf(e)&&r.push(e)}}};return e.resetFrame=ExpressionManager.resetFrame,e}(),MaskManagerInterface=function(){function e(e,t){this._mask=e,this._data=t}return Object.defineProperty(e.prototype,"maskPath",{get:function(){return this._mask.prop.k&&this._mask.prop.getValue(),this._mask.prop}}),Object.defineProperty(e.prototype,"maskOpacity",{get:function(){return this._mask.op.k&&this._mask.op.getValue(),100*this._mask.op.v}}),function(t){var r,n=createSizedArray(t.viewData.length),i=t.viewData.length;for(r=0;r<i;r+=1)n[r]=new e(t.viewData[r],t.masksProperties[r]);return function(e){for(r=0;r<i;){if(t.masksProperties[r].nm===e)return n[r];r+=1}return null}}}(),ExpressionPropertyInterface=function(){var e={pv:0,v:0,mult:1},t={pv:[0,0,0],v:[0,0,0],mult:1};function r(e,t,r){Object.defineProperty(e,"velocity",{get:function(){return t.getVelocityAtTime(t.comp.currentFrame)}}),e.numKeys=t.keyframes?t.keyframes.length:0,e.key=function(n){if(!e.numKeys)return 0;var i="";i="s"in t.keyframes[n-1]?t.keyframes[n-1].s:"e"in t.keyframes[n-2]?t.keyframes[n-2].e:t.keyframes[n-2].s;var a="unidimensional"===r?new Number(i):Object.assign({},i);return a.time=t.keyframes[n-1].t/t.elem.comp.globalData.frameRate,a.value="unidimensional"===r?i[0]:i,a},e.valueAtTime=t.getValueAtTime,e.speedAtTime=t.getSpeedAtTime,e.velocityAtTime=t.getVelocityAtTime,e.propertyGroup=t.propertyGroup}function n(){return e}return function(i){return i?"unidimensional"===i.propType?function(t){t&&"pv"in t||(t=e);var n=1/t.mult,i=t.pv*n,a=new Number(i);return a.value=i,r(a,t,"unidimensional"),function(){return t.k&&t.getValue(),i=t.v*n,a.value!==i&&((a=new Number(i)).value=i,a[0]=i,r(a,t,"unidimensional")),a}}(i):function(e){e&&"pv"in e||(e=t);var n=1/e.mult,i=e.data&&e.data.l||e.pv.length,a=createTypedArray("float32",i),o=createTypedArray("float32",i);return a.value=o,r(a,e,"multidimensional"),function(){e.k&&e.getValue();for(var t=0;t<i;t+=1)o[t]=e.v[t]*n,a[t]=o[t];return a}}(i):n}}(),TransformExpressionInterface=function(e){function t(e){switch(e){case"scale":case"Scale":case"ADBE Scale":case 6:return t.scale;case"rotation":case"Rotation":case"ADBE Rotation":case"ADBE Rotate Z":case 10:return t.rotation;case"ADBE Rotate X":return t.xRotation;case"ADBE Rotate Y":return t.yRotation;case"position":case"Position":case"ADBE Position":case 2:return t.position;case"ADBE Position_0":return t.xPosition;case"ADBE Position_1":return t.yPosition;case"ADBE Position_2":return t.zPosition;case"anchorPoint":case"AnchorPoint":case"Anchor Point":case"ADBE AnchorPoint":case 1:return t.anchorPoint;case"opacity":case"Opacity":case 11:return t.opacity;default:return null}}var r,n,i,a;return Object.defineProperty(t,"rotation",{get:ExpressionPropertyInterface(e.r||e.rz)}),Object.defineProperty(t,"zRotation",{get:ExpressionPropertyInterface(e.rz||e.r)}),Object.defineProperty(t,"xRotation",{get:ExpressionPropertyInterface(e.rx)}),Object.defineProperty(t,"yRotation",{get:ExpressionPropertyInterface(e.ry)}),Object.defineProperty(t,"scale",{get:ExpressionPropertyInterface(e.s)}),e.p?a=ExpressionPropertyInterface(e.p):(r=ExpressionPropertyInterface(e.px),n=ExpressionPropertyInterface(e.py),e.pz&&(i=ExpressionPropertyInterface(e.pz))),Object.defineProperty(t,"position",{get:function(){return e.p?a():[r(),n(),i?i():0]}}),Object.defineProperty(t,"xPosition",{get:ExpressionPropertyInterface(e.px)}),Object.defineProperty(t,"yPosition",{get:ExpressionPropertyInterface(e.py)}),Object.defineProperty(t,"zPosition",{get:ExpressionPropertyInterface(e.pz)}),Object.defineProperty(t,"anchorPoint",{get:ExpressionPropertyInterface(e.a)}),Object.defineProperty(t,"opacity",{get:ExpressionPropertyInterface(e.o)}),Object.defineProperty(t,"skew",{get:ExpressionPropertyInterface(e.sk)}),Object.defineProperty(t,"skewAxis",{get:ExpressionPropertyInterface(e.sa)}),Object.defineProperty(t,"orientation",{get:ExpressionPropertyInterface(e.or)}),t},LayerExpressionInterface=function(){function e(e){var t=new Matrix;return void 0!==e?this._elem.finalTransform.mProp.getValueAtTime(e).clone(t):this._elem.finalTransform.mProp.applyToMatrix(t),t}function t(e,t){var r=this.getMatrix(t);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.applyPoint(r,e)}function r(e,t){var r=this.getMatrix(t);return this.applyPoint(r,e)}function n(e,t){var r=this.getMatrix(t);return r.props[12]=0,r.props[13]=0,r.props[14]=0,this.invertPoint(r,e)}function i(e,t){var r=this.getMatrix(t);return this.invertPoint(r,e)}function a(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,n=this._elem.hierarchy.length;for(r=0;r<n;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e)}return e.applyToPointArray(t[0],t[1],t[2]||0)}function o(e,t){if(this._elem.hierarchy&&this._elem.hierarchy.length){var r,n=this._elem.hierarchy.length;for(r=0;r<n;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(e)}return e.inversePoint(t)}function s(e){var t=new Matrix;if(t.reset(),this._elem.finalTransform.mProp.applyToMatrix(t),this._elem.hierarchy&&this._elem.hierarchy.length){var r,n=this._elem.hierarchy.length;for(r=0;r<n;r+=1)this._elem.hierarchy[r].finalTransform.mProp.applyToMatrix(t);return t.inversePoint(e)}return t.inversePoint(e)}function l(){return[1,1,1,1]}return function(c){var d;function u(e){switch(e){case"ADBE Root Vectors Group":case"Contents":case 2:return u.shapeInterface;case 1:case 6:case"Transform":case"transform":case"ADBE Transform Group":return d;case 4:case"ADBE Effect Parade":case"effects":case"Effects":return u.effect;case"ADBE Text Properties":return u.textInterface;default:return null}}u.getMatrix=e,u.invertPoint=o,u.applyPoint=a,u.toWorld=r,u.toWorldVec=t,u.fromWorld=i,u.fromWorldVec=n,u.toComp=r,u.fromComp=s,u.sampleImage=l,u.sourceRectAtTime=c.sourceRectAtTime.bind(c),u._elem=c;var p=getDescriptor(d=TransformExpressionInterface(c.finalTransform.mProp),"anchorPoint");return Object.defineProperties(u,{hasParent:{get:function(){return c.hierarchy.length}},parent:{get:function(){return c.hierarchy[0].layerInterface}},rotation:getDescriptor(d,"rotation"),scale:getDescriptor(d,"scale"),position:getDescriptor(d,"position"),opacity:getDescriptor(d,"opacity"),anchorPoint:p,anchor_point:p,transform:{get:function(){return d}},active:{get:function(){return c.isInRange}}}),u.startTime=c.data.st,u.index=c.data.ind,u.source=c.data.refId,u.height=0===c.data.ty?c.data.h:100,u.width=0===c.data.ty?c.data.w:100,u.inPoint=c.data.ip/c.comp.globalData.frameRate,u.outPoint=c.data.op/c.comp.globalData.frameRate,u._name=c.data.nm,u.registerMaskInterface=function(e){u.mask=new MaskManagerInterface(e,c)},u.registerEffectsInterface=function(e){u.effect=e},u}}(),propertyGroupFactory=function(e,t){return function(r){return(r=void 0===r?1:r)<=0?e:t(r-1)}},PropertyInterface=function(e,t){var r={_name:e};return function(e){return(e=void 0===e?1:e)<=0?r:t(e-1)}},EffectsExpressionInterface=function(){var e={createEffectsInterface:function(e,r){if(e.effectsManager){var n,i=[],a=e.data.ef,o=e.effectsManager.effectElements.length;for(n=0;n<o;n+=1)i.push(t(a[n],e.effectsManager.effectElements[n],r,e));var s=e.data.ef||[],l=function(e){for(n=0,o=s.length;n<o;){if(e===s[n].nm||e===s[n].mn||e===s[n].ix)return i[n];n+=1}return null};return Object.defineProperty(l,"numProperties",{get:function(){return s.length}}),l}return null}};function t(e,n,i,a){function o(t){for(var r=e.ef,n=0,i=r.length;n<i;){if(t===r[n].nm||t===r[n].mn||t===r[n].ix)return 5===r[n].ty?c[n]:c[n]();n+=1}throw new Error}var s,l=propertyGroupFactory(o,i),c=[],d=e.ef.length;for(s=0;s<d;s+=1)5===e.ef[s].ty?c.push(t(e.ef[s],n.effectElements[s],n.effectElements[s].propertyGroup,a)):c.push(r(n.effectElements[s],e.ef[s].ty,a,l));return"ADBE Color Control"===e.mn&&Object.defineProperty(o,"color",{get:function(){return c[0]()}}),Object.defineProperties(o,{numProperties:{get:function(){return e.np}},_name:{value:e.nm},propertyGroup:{value:l}}),o.enabled=0!==e.en,o.active=o.enabled,o}function r(e,t,r,n){var i=ExpressionPropertyInterface(e.p);return e.p.setGroupProperty&&e.p.setGroupProperty(PropertyInterface("",n)),function(){return 10===t?r.comp.compInterface(e.p.v):i()}}return e}(),ShapePathInterface=function(e,t,r){var n=t.sh;function i(e){return"Shape"===e||"shape"===e||"Path"===e||"path"===e||"ADBE Vector Shape"===e||2===e?i.path:null}var a=propertyGroupFactory(i,r);return n.setGroupProperty(PropertyInterface("Path",a)),Object.defineProperties(i,{path:{get:function(){return n.k&&n.getValue(),n}},shape:{get:function(){return n.k&&n.getValue(),n}},_name:{value:e.nm},ix:{value:e.ix},propertyIndex:{value:e.ix},mn:{value:e.mn},propertyGroup:{value:r}}),i},ShapeExpressionInterface=function(){function e(e,o,p){var h,f=[],m=e?e.length:0;for(h=0;h<m;h+=1)"gr"===e[h].ty?f.push(t(e[h],o[h],p)):"fl"===e[h].ty?f.push(r(e[h],o[h],p)):"st"===e[h].ty?f.push(i(e[h],o[h],p)):"tm"===e[h].ty?f.push(a(e[h],o[h],p)):"tr"===e[h].ty||("el"===e[h].ty?f.push(s(e[h],o[h],p)):"sr"===e[h].ty?f.push(l(e[h],o[h],p)):"sh"===e[h].ty?f.push(ShapePathInterface(e[h],o[h],p)):"rc"===e[h].ty?f.push(c(e[h],o[h],p)):"rd"===e[h].ty?f.push(d(e[h],o[h],p)):"rp"===e[h].ty?f.push(u(e[h],o[h],p)):"gf"===e[h].ty?f.push(n(e[h],o[h],p)):f.push((e[h],o[h],function(){return null})));return f}function t(t,r,n){var i=function(e){switch(e){case"ADBE Vectors Group":case"Contents":case 2:return i.content;default:return i.transform}};i.propertyGroup=propertyGroupFactory(i,n);var a=function(t,r,n){var i,a=function(e){for(var t=0,r=i.length;t<r;){if(i[t]._name===e||i[t].mn===e||i[t].propertyIndex===e||i[t].ix===e||i[t].ind===e)return i[t];t+=1}return"number"==typeof e?i[e-1]:null};a.propertyGroup=propertyGroupFactory(a,n),i=e(t.it,r.it,a.propertyGroup),a.numProperties=i.length;var s=o(t.it[t.it.length-1],r.it[r.it.length-1],a.propertyGroup);return a.transform=s,a.propertyIndex=t.cix,a._name=t.nm,a}(t,r,i.propertyGroup),s=o(t.it[t.it.length-1],r.it[r.it.length-1],i.propertyGroup);return i.content=a,i.transform=s,Object.defineProperty(i,"_name",{get:function(){return t.nm}}),i.numProperties=t.np,i.propertyIndex=t.ix,i.nm=t.nm,i.mn=t.mn,i}function r(e,t,r){function n(e){return"Color"===e||"color"===e?n.color:"Opacity"===e||"opacity"===e?n.opacity:null}return Object.defineProperties(n,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",r)),t.o.setGroupProperty(PropertyInterface("Opacity",r)),n}function n(e,t,r){function n(e){return"Start Point"===e||"start point"===e?n.startPoint:"End Point"===e||"end point"===e?n.endPoint:"Opacity"===e||"opacity"===e?n.opacity:null}return Object.defineProperties(n,{startPoint:{get:ExpressionPropertyInterface(t.s)},endPoint:{get:ExpressionPropertyInterface(t.e)},opacity:{get:ExpressionPropertyInterface(t.o)},type:{get:function(){return"a"}},_name:{value:e.nm},mn:{value:e.mn}}),t.s.setGroupProperty(PropertyInterface("Start Point",r)),t.e.setGroupProperty(PropertyInterface("End Point",r)),t.o.setGroupProperty(PropertyInterface("Opacity",r)),n}function i(e,t,r){var n,i=propertyGroupFactory(c,r),a=propertyGroupFactory(l,i);function o(r){Object.defineProperty(l,e.d[r].nm,{get:ExpressionPropertyInterface(t.d.dataProps[r].p)})}var s=e.d?e.d.length:0,l={};for(n=0;n<s;n+=1)o(n),t.d.dataProps[n].p.setGroupProperty(a);function c(e){return"Color"===e||"color"===e?c.color:"Opacity"===e||"opacity"===e?c.opacity:"Stroke Width"===e||"stroke width"===e?c.strokeWidth:null}return Object.defineProperties(c,{color:{get:ExpressionPropertyInterface(t.c)},opacity:{get:ExpressionPropertyInterface(t.o)},strokeWidth:{get:ExpressionPropertyInterface(t.w)},dash:{get:function(){return l}},_name:{value:e.nm},mn:{value:e.mn}}),t.c.setGroupProperty(PropertyInterface("Color",i)),t.o.setGroupProperty(PropertyInterface("Opacity",i)),t.w.setGroupProperty(PropertyInterface("Stroke Width",i)),c}function a(e,t,r){function n(t){return t===e.e.ix||"End"===t||"end"===t?n.end:t===e.s.ix?n.start:t===e.o.ix?n.offset:null}var i=propertyGroupFactory(n,r);return n.propertyIndex=e.ix,t.s.setGroupProperty(PropertyInterface("Start",i)),t.e.setGroupProperty(PropertyInterface("End",i)),t.o.setGroupProperty(PropertyInterface("Offset",i)),n.propertyIndex=e.ix,n.propertyGroup=r,Object.defineProperties(n,{start:{get:ExpressionPropertyInterface(t.s)},end:{get:ExpressionPropertyInterface(t.e)},offset:{get:ExpressionPropertyInterface(t.o)},_name:{value:e.nm}}),n.mn=e.mn,n}function o(e,t,r){function n(t){return e.a.ix===t||"Anchor Point"===t?n.anchorPoint:e.o.ix===t||"Opacity"===t?n.opacity:e.p.ix===t||"Position"===t?n.position:e.r.ix===t||"Rotation"===t||"ADBE Vector Rotation"===t?n.rotation:e.s.ix===t||"Scale"===t?n.scale:e.sk&&e.sk.ix===t||"Skew"===t?n.skew:e.sa&&e.sa.ix===t||"Skew Axis"===t?n.skewAxis:null}var i=propertyGroupFactory(n,r);return t.transform.mProps.o.setGroupProperty(PropertyInterface("Opacity",i)),t.transform.mProps.p.setGroupProperty(PropertyInterface("Position",i)),t.transform.mProps.a.setGroupProperty(PropertyInterface("Anchor Point",i)),t.transform.mProps.s.setGroupProperty(PropertyInterface("Scale",i)),t.transform.mProps.r.setGroupProperty(PropertyInterface("Rotation",i)),t.transform.mProps.sk&&(t.transform.mProps.sk.setGroupProperty(PropertyInterface("Skew",i)),t.transform.mProps.sa.setGroupProperty(PropertyInterface("Skew Angle",i))),t.transform.op.setGroupProperty(PropertyInterface("Opacity",i)),Object.defineProperties(n,{opacity:{get:ExpressionPropertyInterface(t.transform.mProps.o)},position:{get:ExpressionPropertyInterface(t.transform.mProps.p)},anchorPoint:{get:ExpressionPropertyInterface(t.transform.mProps.a)},scale:{get:ExpressionPropertyInterface(t.transform.mProps.s)},rotation:{get:ExpressionPropertyInterface(t.transform.mProps.r)},skew:{get:ExpressionPropertyInterface(t.transform.mProps.sk)},skewAxis:{get:ExpressionPropertyInterface(t.transform.mProps.sa)},_name:{value:e.nm}}),n.ty="tr",n.mn=e.mn,n.propertyGroup=r,n}function s(e,t,r){function n(t){return e.p.ix===t?n.position:e.s.ix===t?n.size:null}var i=propertyGroupFactory(n,r);n.propertyIndex=e.ix;var a="tm"===t.sh.ty?t.sh.prop:t.sh;return a.s.setGroupProperty(PropertyInterface("Size",i)),a.p.setGroupProperty(PropertyInterface("Position",i)),Object.defineProperties(n,{size:{get:ExpressionPropertyInterface(a.s)},position:{get:ExpressionPropertyInterface(a.p)},_name:{value:e.nm}}),n.mn=e.mn,n}function l(e,t,r){function n(t){return e.p.ix===t?n.position:e.r.ix===t?n.rotation:e.pt.ix===t?n.points:e.or.ix===t||"ADBE Vector Star Outer Radius"===t?n.outerRadius:e.os.ix===t?n.outerRoundness:!e.ir||e.ir.ix!==t&&"ADBE Vector Star Inner Radius"!==t?e.is&&e.is.ix===t?n.innerRoundness:null:n.innerRadius}var i=propertyGroupFactory(n,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return n.propertyIndex=e.ix,a.or.setGroupProperty(PropertyInterface("Outer Radius",i)),a.os.setGroupProperty(PropertyInterface("Outer Roundness",i)),a.pt.setGroupProperty(PropertyInterface("Points",i)),a.p.setGroupProperty(PropertyInterface("Position",i)),a.r.setGroupProperty(PropertyInterface("Rotation",i)),e.ir&&(a.ir.setGroupProperty(PropertyInterface("Inner Radius",i)),a.is.setGroupProperty(PropertyInterface("Inner Roundness",i))),Object.defineProperties(n,{position:{get:ExpressionPropertyInterface(a.p)},rotation:{get:ExpressionPropertyInterface(a.r)},points:{get:ExpressionPropertyInterface(a.pt)},outerRadius:{get:ExpressionPropertyInterface(a.or)},outerRoundness:{get:ExpressionPropertyInterface(a.os)},innerRadius:{get:ExpressionPropertyInterface(a.ir)},innerRoundness:{get:ExpressionPropertyInterface(a.is)},_name:{value:e.nm}}),n.mn=e.mn,n}function c(e,t,r){function n(t){return e.p.ix===t?n.position:e.r.ix===t?n.roundness:e.s.ix===t||"Size"===t||"ADBE Vector Rect Size"===t?n.size:null}var i=propertyGroupFactory(n,r),a="tm"===t.sh.ty?t.sh.prop:t.sh;return n.propertyIndex=e.ix,a.p.setGroupProperty(PropertyInterface("Position",i)),a.s.setGroupProperty(PropertyInterface("Size",i)),a.r.setGroupProperty(PropertyInterface("Rotation",i)),Object.defineProperties(n,{position:{get:ExpressionPropertyInterface(a.p)},roundness:{get:ExpressionPropertyInterface(a.r)},size:{get:ExpressionPropertyInterface(a.s)},_name:{value:e.nm}}),n.mn=e.mn,n}function d(e,t,r){function n(t){return e.r.ix===t||"Round Corners 1"===t?n.radius:null}var i=propertyGroupFactory(n,r),a=t;return n.propertyIndex=e.ix,a.rd.setGroupProperty(PropertyInterface("Radius",i)),Object.defineProperties(n,{radius:{get:ExpressionPropertyInterface(a.rd)},_name:{value:e.nm}}),n.mn=e.mn,n}function u(e,t,r){function n(t){return e.c.ix===t||"Copies"===t?n.copies:e.o.ix===t||"Offset"===t?n.offset:null}var i=propertyGroupFactory(n,r),a=t;return n.propertyIndex=e.ix,a.c.setGroupProperty(PropertyInterface("Copies",i)),a.o.setGroupProperty(PropertyInterface("Offset",i)),Object.defineProperties(n,{copies:{get:ExpressionPropertyInterface(a.c)},offset:{get:ExpressionPropertyInterface(a.o)},_name:{value:e.nm}}),n.mn=e.mn,n}return function(t,r,n){var i;function a(e){if("number"==typeof e)return 0===(e=void 0===e?1:e)?n:i[e-1];for(var t=0,r=i.length;t<r;){if(i[t]._name===e)return i[t];t+=1}return null}return a.propertyGroup=propertyGroupFactory(a,(function(){return n})),i=e(t,r,a.propertyGroup),a.numProperties=i.length,a._name="Contents",a}}(),TextExpressionInterface=function(e){var t;function r(e){return"ADBE Text Document"===e?r.sourceText:null}return Object.defineProperty(r,"sourceText",{get:function(){e.textProperty.getValue();var r=e.textProperty.currentData.t;return t&&r===t.value||((t=new String(r)).value=r||new String(r),Object.defineProperty(t,"style",{get:function(){return{fillColor:e.textProperty.currentData.fc}}})),t}}),r};function _typeof(e){return _typeof="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},_typeof(e)}var FootageInterface=(dataInterfaceFactory=function(e){function t(e){return"Outline"===e?t.outlineInterface():null}return t._name="Outline",t.outlineInterface=function(e){var t="",r=e.getFootageData();function n(e){if(r[e])return t=e,"object"===_typeof(r=r[e])?n:r;var i=e.indexOf(t);if(-1!==i){var a=parseInt(e.substr(i+t.length),10);return"object"===_typeof(r=r[a])?n:r}return""}return function(){return t="",r=e.getFootageData(),n}}(e),t},function(e){function t(e){return"Data"===e?t.dataInterface:null}return t._name="Data",t.dataInterface=dataInterfaceFactory(e),t}),dataInterfaceFactory,interfaces={layer:LayerExpressionInterface,effects:EffectsExpressionInterface,comp:CompExpressionInterface,shape:ShapeExpressionInterface,text:TextExpressionInterface,footage:FootageInterface};function getInterface(e){return interfaces[e]||null}var expressionHelpers={searchExpressions:function(e,t,r){t.x&&(r.k=!0,r.x=!0,r.initiateExpression=ExpressionManager.initiateExpression,r.effectsSequence.push(r.initiateExpression(e,t,r).bind(r)))},getSpeedAtTime:function(e){var t=this.getValueAtTime(e),r=this.getValueAtTime(e+-.01),n=0;if(t.length){var i;for(i=0;i<t.length;i+=1)n+=Math.pow(r[i]-t[i],2);n=100*Math.sqrt(n)}else n=0;return n},getVelocityAtTime:function(e){if(void 0!==this.vel)return this.vel;var t,r,n=-.001,i=this.getValueAtTime(e),a=this.getValueAtTime(e+n);if(i.length)for(t=createTypedArray("float32",i.length),r=0;r<i.length;r+=1)t[r]=(a[r]-i[r])/n;else t=(a-i)/n;return t},getValueAtTime:function(e){return e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastFrame&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastFrame<e?this._cachingAtTime.lastIndex:0,this._cachingAtTime.value=this.interpolateValue(e,this._cachingAtTime),this._cachingAtTime.lastFrame=e),this._cachingAtTime.value},getStaticValueAtTime:function(){return this.pv},setGroupProperty:function(e){this.propertyGroup=e}};function addPropertyDecorator(){function e(e,t,r){if(!this.k||!this.keyframes)return this.pv;e=e?e.toLowerCase():"";var n,i,a,o,s,l=this.comp.renderedFrame,c=this.keyframes,d=c[c.length-1].t;if(l<=d)return this.pv;if(r?i=d-(n=t?Math.abs(d-this.elem.comp.globalData.frameRate*t):Math.max(0,d-this.elem.data.ip)):((!t||t>c.length-1)&&(t=c.length-1),n=d-(i=c[c.length-1-t].t)),"pingpong"===e){if(Math.floor((l-i)/n)%2!=0)return this.getValueAtTime((n-(l-i)%n+i)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var u=this.getValueAtTime(i/this.comp.globalData.frameRate,0),p=this.getValueAtTime(d/this.comp.globalData.frameRate,0),h=this.getValueAtTime(((l-i)%n+i)/this.comp.globalData.frameRate,0),f=Math.floor((l-i)/n);if(this.pv.length){for(o=(s=new Array(u.length)).length,a=0;a<o;a+=1)s[a]=(p[a]-u[a])*f+h[a];return s}return(p-u)*f+h}if("continue"===e){var m=this.getValueAtTime(d/this.comp.globalData.frameRate,0),g=this.getValueAtTime((d-.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(o=(s=new Array(m.length)).length,a=0;a<o;a+=1)s[a]=m[a]+(m[a]-g[a])*((l-d)/this.comp.globalData.frameRate)/5e-4;return s}return m+(l-d)/.001*(m-g)}}return this.getValueAtTime(((l-i)%n+i)/this.comp.globalData.frameRate,0)}function t(e,t,r){if(!this.k)return this.pv;e=e?e.toLowerCase():"";var n,i,a,o,s,l=this.comp.renderedFrame,c=this.keyframes,d=c[0].t;if(l>=d)return this.pv;if(r?i=d+(n=t?Math.abs(this.elem.comp.globalData.frameRate*t):Math.max(0,this.elem.data.op-d)):((!t||t>c.length-1)&&(t=c.length-1),n=(i=c[t].t)-d),"pingpong"===e){if(Math.floor((d-l)/n)%2==0)return this.getValueAtTime(((d-l)%n+d)/this.comp.globalData.frameRate,0)}else{if("offset"===e){var u=this.getValueAtTime(d/this.comp.globalData.frameRate,0),p=this.getValueAtTime(i/this.comp.globalData.frameRate,0),h=this.getValueAtTime((n-(d-l)%n+d)/this.comp.globalData.frameRate,0),f=Math.floor((d-l)/n)+1;if(this.pv.length){for(o=(s=new Array(u.length)).length,a=0;a<o;a+=1)s[a]=h[a]-(p[a]-u[a])*f;return s}return h-(p-u)*f}if("continue"===e){var m=this.getValueAtTime(d/this.comp.globalData.frameRate,0),g=this.getValueAtTime((d+.001)/this.comp.globalData.frameRate,0);if(this.pv.length){for(o=(s=new Array(m.length)).length,a=0;a<o;a+=1)s[a]=m[a]+(m[a]-g[a])*(d-l)/.001;return s}return m+(m-g)*(d-l)/.001}}return this.getValueAtTime((n-((d-l)%n+d))/this.comp.globalData.frameRate,0)}function r(e,t){if(!this.k)return this.pv;if(e=.5*(e||.4),(t=Math.floor(t||5))<=1)return this.pv;var r,n,i=this.comp.renderedFrame/this.comp.globalData.frameRate,a=i-e,o=t>1?(i+e-a)/(t-1):1,s=0,l=0;for(r=this.pv.length?createTypedArray("float32",this.pv.length):0;s<t;){if(n=this.getValueAtTime(a+s*o),this.pv.length)for(l=0;l<this.pv.length;l+=1)r[l]+=n[l];else r+=n;s+=1}if(this.pv.length)for(l=0;l<this.pv.length;l+=1)r[l]/=t;else r/=t;return r}function n(e){this._transformCachingAtTime||(this._transformCachingAtTime={v:new Matrix});var t=this._transformCachingAtTime.v;if(t.cloneFromProps(this.pre.props),this.appliedTransformations<1){var r=this.a.getValueAtTime(e);t.translate(-r[0]*this.a.mult,-r[1]*this.a.mult,r[2]*this.a.mult)}if(this.appliedTransformations<2){var n=this.s.getValueAtTime(e);t.scale(n[0]*this.s.mult,n[1]*this.s.mult,n[2]*this.s.mult)}if(this.sk&&this.appliedTransformations<3){var i=this.sk.getValueAtTime(e),a=this.sa.getValueAtTime(e);t.skewFromAxis(-i*this.sk.mult,a*this.sa.mult)}if(this.r&&this.appliedTransformations<4){var o=this.r.getValueAtTime(e);t.rotate(-o*this.r.mult)}else if(!this.r&&this.appliedTransformations<4){var s=this.rz.getValueAtTime(e),l=this.ry.getValueAtTime(e),c=this.rx.getValueAtTime(e),d=this.or.getValueAtTime(e);t.rotateZ(-s*this.rz.mult).rotateY(l*this.ry.mult).rotateX(c*this.rx.mult).rotateZ(-d[2]*this.or.mult).rotateY(d[1]*this.or.mult).rotateX(d[0]*this.or.mult)}if(this.data.p&&this.data.p.s){var u=this.px.getValueAtTime(e),p=this.py.getValueAtTime(e);if(this.data.p.z){var h=this.pz.getValueAtTime(e);t.translate(u*this.px.mult,p*this.py.mult,-h*this.pz.mult)}else t.translate(u*this.px.mult,p*this.py.mult,0)}else{var f=this.p.getValueAtTime(e);t.translate(f[0]*this.p.mult,f[1]*this.p.mult,-f[2]*this.p.mult)}return t}function i(){return this.v.clone(new Matrix)}var a=TransformPropertyFactory.getTransformProperty;TransformPropertyFactory.getTransformProperty=function(e,t,r){var o=a(e,t,r);return o.dynamicProperties.length?o.getValueAtTime=n.bind(o):o.getValueAtTime=i.bind(o),o.setGroupProperty=expressionHelpers.setGroupProperty,o};var o=PropertyFactory.getProp;PropertyFactory.getProp=function(n,i,a,s,l){var c=o(n,i,a,s,l);c.kf?c.getValueAtTime=expressionHelpers.getValueAtTime.bind(c):c.getValueAtTime=expressionHelpers.getStaticValueAtTime.bind(c),c.setGroupProperty=expressionHelpers.setGroupProperty,c.loopOut=e,c.loopIn=t,c.smooth=r,c.getVelocityAtTime=expressionHelpers.getVelocityAtTime.bind(c),c.getSpeedAtTime=expressionHelpers.getSpeedAtTime.bind(c),c.numKeys=1===i.a?i.k.length:0,c.propertyIndex=i.ix;var d=0;return 0!==a&&(d=createTypedArray("float32",1===i.a?i.k[0].s.length:i.k.length)),c._cachingAtTime={lastFrame:initialDefaultFrame,lastIndex:0,value:d},expressionHelpers.searchExpressions(n,i,c),c.k&&l.addDynamicProperty(c),c};var s=ShapePropertyFactory.getConstructorFunction(),l=ShapePropertyFactory.getKeyframedConstructorFunction();function c(){}c.prototype={vertices:function(e,t){this.k&&this.getValue();var r,n=this.v;void 0!==t&&(n=this.getValueAtTime(t,0));var i=n._length,a=n[e],o=n.v,s=createSizedArray(i);for(r=0;r<i;r+=1)s[r]="i"===e||"o"===e?[a[r][0]-o[r][0],a[r][1]-o[r][1]]:[a[r][0],a[r][1]];return s},points:function(e){return this.vertices("v",e)},inTangents:function(e){return this.vertices("i",e)},outTangents:function(e){return this.vertices("o",e)},isClosed:function(){return this.v.c},pointOnPath:function(e,t){var r=this.v;void 0!==t&&(r=this.getValueAtTime(t,0)),this._segmentsLength||(this._segmentsLength=bez.getSegmentsLength(r));for(var n,i=this._segmentsLength,a=i.lengths,o=i.totalLength*e,s=0,l=a.length,c=0;s<l;){if(c+a[s].addedLength>o){var d=s,u=r.c&&s===l-1?0:s+1,p=(o-c)/a[s].addedLength;n=bez.getPointInSegment(r.v[d],r.v[u],r.o[d],r.i[u],p,a[s]);break}c+=a[s].addedLength,s+=1}return n||(n=r.c?[r.v[0][0],r.v[0][1]]:[r.v[r._length-1][0],r.v[r._length-1][1]]),n},vectorOnPath:function(e,t,r){1==e?e=this.v.c:0==e&&(e=.999);var n=this.pointOnPath(e,t),i=this.pointOnPath(e+.001,t),a=i[0]-n[0],o=i[1]-n[1],s=Math.sqrt(Math.pow(a,2)+Math.pow(o,2));return 0===s?[0,0]:"tangent"===r?[a/s,o/s]:[-o/s,a/s]},tangentOnPath:function(e,t){return this.vectorOnPath(e,t,"tangent")},normalOnPath:function(e,t){return this.vectorOnPath(e,t,"normal")},setGroupProperty:expressionHelpers.setGroupProperty,getValueAtTime:expressionHelpers.getStaticValueAtTime},extendPrototype([c],s),extendPrototype([c],l),l.prototype.getValueAtTime=function(e){return this._cachingAtTime||(this._cachingAtTime={shapeValue:shapePool.clone(this.pv),lastIndex:0,lastTime:initialDefaultFrame}),e*=this.elem.globalData.frameRate,(e-=this.offsetTime)!==this._cachingAtTime.lastTime&&(this._cachingAtTime.lastIndex=this._cachingAtTime.lastTime<e?this._caching.lastIndex:0,this._cachingAtTime.lastTime=e,this.interpolateShape(e,this._cachingAtTime.shapeValue,this._cachingAtTime)),this._cachingAtTime.shapeValue},l.prototype.initiateExpression=ExpressionManager.initiateExpression;var d=ShapePropertyFactory.getShapeProp;ShapePropertyFactory.getShapeProp=function(e,t,r,n,i){var a=d(e,t,r,n,i);return a.propertyIndex=t.ix,a.lock=!1,3===r?expressionHelpers.searchExpressions(e,t.pt,a):4===r&&expressionHelpers.searchExpressions(e,t.ks,a),a.k&&e.addDynamicProperty(a),a}}function initialize$1(){addPropertyDecorator()}function addDecorator(){TextProperty.prototype.getExpressionValue=function(e,t){var r=this.calculateExpression(t);if(e.t!==r){var n={};return this.copyData(n,e),n.t=r.toString(),n.__complete=!1,n}return e},TextProperty.prototype.searchProperty=function(){var e=this.searchKeyframes(),t=this.searchExpressions();return this.kf=e||t,this.kf},TextProperty.prototype.searchExpressions=function(){return this.data.d.x?(this.calculateExpression=ExpressionManager.initiateExpression.bind(this)(this.elem,this.data.d,this),this.addEffect(this.getExpressionValue.bind(this)),!0):null}}function initialize(){addDecorator()}function SVGComposableEffect(){}SVGComposableEffect.prototype={createMergeNode:function(e,t){var r,n,i=createNS("feMerge");for(i.setAttribute("result",e),n=0;n<t.length;n+=1)(r=createNS("feMergeNode")).setAttribute("in",t[n]),i.appendChild(r),i.appendChild(r);return i}};var linearFilterValue="0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0";function SVGTintFilter(e,t,r,n,i){this.filterManager=t;var a=createNS("feColorMatrix");a.setAttribute("type","matrix"),a.setAttribute("color-interpolation-filters","linearRGB"),a.setAttribute("values",linearFilterValue+" 1 0"),this.linearFilter=a,a.setAttribute("result",n+"_tint_1"),e.appendChild(a),(a=createNS("feColorMatrix")).setAttribute("type","matrix"),a.setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),a.setAttribute("result",n+"_tint_2"),e.appendChild(a),this.matrixFilter=a;var o=this.createMergeNode(n,[i,n+"_tint_1",n+"_tint_2"]);e.appendChild(o)}function SVGFillFilter(e,t,r,n){this.filterManager=t;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("values","1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"),i.setAttribute("result",n),e.appendChild(i),this.matrixFilter=i}function SVGStrokeEffect(e,t,r){this.initialized=!1,this.filterManager=t,this.elem=r,this.paths=[]}function SVGTritoneFilter(e,t,r,n){this.filterManager=t;var i=createNS("feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("color-interpolation-filters","linearRGB"),i.setAttribute("values","0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0"),e.appendChild(i);var a=createNS("feComponentTransfer");a.setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("result",n),this.matrixFilter=a;var o=createNS("feFuncR");o.setAttribute("type","table"),a.appendChild(o),this.feFuncR=o;var s=createNS("feFuncG");s.setAttribute("type","table"),a.appendChild(s),this.feFuncG=s;var l=createNS("feFuncB");l.setAttribute("type","table"),a.appendChild(l),this.feFuncB=l,e.appendChild(a)}function SVGProLevelsFilter(e,t,r,n){this.filterManager=t;var i=this.filterManager.effectElements,a=createNS("feComponentTransfer");(i[10].p.k||0!==i[10].p.v||i[11].p.k||1!==i[11].p.v||i[12].p.k||1!==i[12].p.v||i[13].p.k||0!==i[13].p.v||i[14].p.k||1!==i[14].p.v)&&(this.feFuncR=this.createFeFunc("feFuncR",a)),(i[17].p.k||0!==i[17].p.v||i[18].p.k||1!==i[18].p.v||i[19].p.k||1!==i[19].p.v||i[20].p.k||0!==i[20].p.v||i[21].p.k||1!==i[21].p.v)&&(this.feFuncG=this.createFeFunc("feFuncG",a)),(i[24].p.k||0!==i[24].p.v||i[25].p.k||1!==i[25].p.v||i[26].p.k||1!==i[26].p.v||i[27].p.k||0!==i[27].p.v||i[28].p.k||1!==i[28].p.v)&&(this.feFuncB=this.createFeFunc("feFuncB",a)),(i[31].p.k||0!==i[31].p.v||i[32].p.k||1!==i[32].p.v||i[33].p.k||1!==i[33].p.v||i[34].p.k||0!==i[34].p.v||i[35].p.k||1!==i[35].p.v)&&(this.feFuncA=this.createFeFunc("feFuncA",a)),(this.feFuncR||this.feFuncG||this.feFuncB||this.feFuncA)&&(a.setAttribute("color-interpolation-filters","sRGB"),e.appendChild(a)),(i[3].p.k||0!==i[3].p.v||i[4].p.k||1!==i[4].p.v||i[5].p.k||1!==i[5].p.v||i[6].p.k||0!==i[6].p.v||i[7].p.k||1!==i[7].p.v)&&((a=createNS("feComponentTransfer")).setAttribute("color-interpolation-filters","sRGB"),a.setAttribute("result",n),e.appendChild(a),this.feFuncRComposed=this.createFeFunc("feFuncR",a),this.feFuncGComposed=this.createFeFunc("feFuncG",a),this.feFuncBComposed=this.createFeFunc("feFuncB",a))}function SVGDropShadowEffect(e,t,r,n,i){var a=t.container.globalData.renderConfig.filterSize,o=t.data.fs||a;e.setAttribute("x",o.x||a.x),e.setAttribute("y",o.y||a.y),e.setAttribute("width",o.width||a.width),e.setAttribute("height",o.height||a.height),this.filterManager=t;var s=createNS("feGaussianBlur");s.setAttribute("in","SourceAlpha"),s.setAttribute("result",n+"_drop_shadow_1"),s.setAttribute("stdDeviation","0"),this.feGaussianBlur=s,e.appendChild(s);var l=createNS("feOffset");l.setAttribute("dx","25"),l.setAttribute("dy","0"),l.setAttribute("in",n+"_drop_shadow_1"),l.setAttribute("result",n+"_drop_shadow_2"),this.feOffset=l,e.appendChild(l);var c=createNS("feFlood");c.setAttribute("flood-color","#00ff00"),c.setAttribute("flood-opacity","1"),c.setAttribute("result",n+"_drop_shadow_3"),this.feFlood=c,e.appendChild(c);var d=createNS("feComposite");d.setAttribute("in",n+"_drop_shadow_3"),d.setAttribute("in2",n+"_drop_shadow_2"),d.setAttribute("operator","in"),d.setAttribute("result",n+"_drop_shadow_4"),e.appendChild(d);var u=this.createMergeNode(n,[n+"_drop_shadow_4",i]);e.appendChild(u)}extendPrototype([SVGComposableEffect],SVGTintFilter),SVGTintFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v/100;this.linearFilter.setAttribute("values",linearFilterValue+" "+n+" 0"),this.matrixFilter.setAttribute("values",r[0]-t[0]+" 0 0 0 "+t[0]+" "+(r[1]-t[1])+" 0 0 0 "+t[1]+" "+(r[2]-t[2])+" 0 0 0 "+t[2]+" 0 0 0 1 0")}},SVGFillFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[2].p.v,r=this.filterManager.effectElements[6].p.v;this.matrixFilter.setAttribute("values","0 0 0 0 "+t[0]+" 0 0 0 0 "+t[1]+" 0 0 0 0 "+t[2]+" 0 0 0 "+r+" 0")}},SVGStrokeEffect.prototype.initialize=function(){var e,t,r,n,i=this.elem.layerElement.children||this.elem.layerElement.childNodes;for(1===this.filterManager.effectElements[1].p.v?(n=this.elem.maskManager.masksProperties.length,r=0):n=1+(r=this.filterManager.effectElements[0].p.v-1),(t=createNS("g")).setAttribute("fill","none"),t.setAttribute("stroke-linecap","round"),t.setAttribute("stroke-dashoffset",1);r<n;r+=1)e=createNS("path"),t.appendChild(e),this.paths.push({p:e,m:r});if(3===this.filterManager.effectElements[10].p.v){var a=createNS("mask"),o=createElementID();a.setAttribute("id",o),a.setAttribute("mask-type","alpha"),a.appendChild(t),this.elem.globalData.defs.appendChild(a);var s=createNS("g");for(s.setAttribute("mask","url("+getLocationHref()+"#"+o+")");i[0];)s.appendChild(i[0]);this.elem.layerElement.appendChild(s),this.masker=a,t.setAttribute("stroke","#fff")}else if(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v){if(2===this.filterManager.effectElements[10].p.v)for(i=this.elem.layerElement.children||this.elem.layerElement.childNodes;i.length;)this.elem.layerElement.removeChild(i[0]);this.elem.layerElement.appendChild(t),this.elem.layerElement.removeAttribute("mask"),t.setAttribute("stroke","#fff")}this.initialized=!0,this.pathMasker=t},SVGStrokeEffect.prototype.renderFrame=function(e){var t;this.initialized||this.initialize();var r,n,i=this.paths.length;for(t=0;t<i;t+=1)if(-1!==this.paths[t].m&&(r=this.elem.maskManager.viewData[this.paths[t].m],n=this.paths[t].p,(e||this.filterManager._mdf||r.prop._mdf)&&n.setAttribute("d",r.lastPath),e||this.filterManager.effectElements[9].p._mdf||this.filterManager.effectElements[4].p._mdf||this.filterManager.effectElements[7].p._mdf||this.filterManager.effectElements[8].p._mdf||r.prop._mdf)){var a;if(0!==this.filterManager.effectElements[7].p.v||100!==this.filterManager.effectElements[8].p.v){var o=.01*Math.min(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),s=.01*Math.max(this.filterManager.effectElements[7].p.v,this.filterManager.effectElements[8].p.v),l=n.getTotalLength();a="0 0 0 "+l*o+" ";var c,d=l*(s-o),u=1+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01,p=Math.floor(d/u);for(c=0;c<p;c+=1)a+="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01+" ";a+="0 "+10*l+" 0 0"}else a="1 "+2*this.filterManager.effectElements[4].p.v*this.filterManager.effectElements[9].p.v*.01;n.setAttribute("stroke-dasharray",a)}if((e||this.filterManager.effectElements[4].p._mdf)&&this.pathMasker.setAttribute("stroke-width",2*this.filterManager.effectElements[4].p.v),(e||this.filterManager.effectElements[6].p._mdf)&&this.pathMasker.setAttribute("opacity",this.filterManager.effectElements[6].p.v),(1===this.filterManager.effectElements[10].p.v||2===this.filterManager.effectElements[10].p.v)&&(e||this.filterManager.effectElements[3].p._mdf)){var h=this.filterManager.effectElements[3].p.v;this.pathMasker.setAttribute("stroke","rgb("+bmFloor(255*h[0])+","+bmFloor(255*h[1])+","+bmFloor(255*h[2])+")")}},SVGTritoneFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,n=this.filterManager.effectElements[2].p.v,i=n[0]+" "+r[0]+" "+t[0],a=n[1]+" "+r[1]+" "+t[1],o=n[2]+" "+r[2]+" "+t[2];this.feFuncR.setAttribute("tableValues",i),this.feFuncG.setAttribute("tableValues",a),this.feFuncB.setAttribute("tableValues",o)}},SVGProLevelsFilter.prototype.createFeFunc=function(e,t){var r=createNS(e);return r.setAttribute("type","table"),t.appendChild(r),r},SVGProLevelsFilter.prototype.getTableValue=function(e,t,r,n,i){for(var a,o,s=0,l=Math.min(e,t),c=Math.max(e,t),d=Array.call(null,{length:256}),u=0,p=i-n,h=t-e;s<=256;)o=(a=s/256)<=l?h<0?i:n:a>=c?h<0?n:i:n+p*Math.pow((a-e)/h,1/r),d[u]=o,u+=1,s+=256/255;return d.join(" ")},SVGProLevelsFilter.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t,r=this.filterManager.effectElements;this.feFuncRComposed&&(e||r[3].p._mdf||r[4].p._mdf||r[5].p._mdf||r[6].p._mdf||r[7].p._mdf)&&(t=this.getTableValue(r[3].p.v,r[4].p.v,r[5].p.v,r[6].p.v,r[7].p.v),this.feFuncRComposed.setAttribute("tableValues",t),this.feFuncGComposed.setAttribute("tableValues",t),this.feFuncBComposed.setAttribute("tableValues",t)),this.feFuncR&&(e||r[10].p._mdf||r[11].p._mdf||r[12].p._mdf||r[13].p._mdf||r[14].p._mdf)&&(t=this.getTableValue(r[10].p.v,r[11].p.v,r[12].p.v,r[13].p.v,r[14].p.v),this.feFuncR.setAttribute("tableValues",t)),this.feFuncG&&(e||r[17].p._mdf||r[18].p._mdf||r[19].p._mdf||r[20].p._mdf||r[21].p._mdf)&&(t=this.getTableValue(r[17].p.v,r[18].p.v,r[19].p.v,r[20].p.v,r[21].p.v),this.feFuncG.setAttribute("tableValues",t)),this.feFuncB&&(e||r[24].p._mdf||r[25].p._mdf||r[26].p._mdf||r[27].p._mdf||r[28].p._mdf)&&(t=this.getTableValue(r[24].p.v,r[25].p.v,r[26].p.v,r[27].p.v,r[28].p.v),this.feFuncB.setAttribute("tableValues",t)),this.feFuncA&&(e||r[31].p._mdf||r[32].p._mdf||r[33].p._mdf||r[34].p._mdf||r[35].p._mdf)&&(t=this.getTableValue(r[31].p.v,r[32].p.v,r[33].p.v,r[34].p.v,r[35].p.v),this.feFuncA.setAttribute("tableValues",t))}},extendPrototype([SVGComposableEffect],SVGDropShadowEffect),SVGDropShadowEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){if((e||this.filterManager.effectElements[4].p._mdf)&&this.feGaussianBlur.setAttribute("stdDeviation",this.filterManager.effectElements[4].p.v/4),e||this.filterManager.effectElements[0].p._mdf){var t=this.filterManager.effectElements[0].p.v;this.feFlood.setAttribute("flood-color",rgbToHex(Math.round(255*t[0]),Math.round(255*t[1]),Math.round(255*t[2])))}if((e||this.filterManager.effectElements[1].p._mdf)&&this.feFlood.setAttribute("flood-opacity",this.filterManager.effectElements[1].p.v/255),e||this.filterManager.effectElements[2].p._mdf||this.filterManager.effectElements[3].p._mdf){var r=this.filterManager.effectElements[3].p.v,n=(this.filterManager.effectElements[2].p.v-90)*degToRads,i=r*Math.cos(n),a=r*Math.sin(n);this.feOffset.setAttribute("dx",i),this.feOffset.setAttribute("dy",a)}}};var _svgMatteSymbols=[];function SVGMatte3Effect(e,t,r){this.initialized=!1,this.filterManager=t,this.filterElem=e,this.elem=r,r.matteElement=createNS("g"),r.matteElement.appendChild(r.layerElement),r.matteElement.appendChild(r.transformedElement),r.baseElement=r.matteElement}function SVGGaussianBlurEffect(e,t,r,n){e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width","300%"),e.setAttribute("height","300%"),this.filterManager=t;var i=createNS("feGaussianBlur");i.setAttribute("result",n),e.appendChild(i),this.feGaussianBlur=i}function TransformEffect(){}function SVGTransformEffect(e,t){this.init(t)}function CVTransformEffect(e){this.init(e)}return SVGMatte3Effect.prototype.findSymbol=function(e){for(var t=0,r=_svgMatteSymbols.length;t<r;){if(_svgMatteSymbols[t]===e)return _svgMatteSymbols[t];t+=1}return null},SVGMatte3Effect.prototype.replaceInParent=function(e,t){var r=e.layerElement.parentNode;if(r){for(var n,i=r.children,a=0,o=i.length;a<o&&i[a]!==e.layerElement;)a+=1;a<=o-2&&(n=i[a+1]);var s=createNS("use");s.setAttribute("href","#"+t),n?r.insertBefore(s,n):r.appendChild(s)}},SVGMatte3Effect.prototype.setElementAsMask=function(e,t){if(!this.findSymbol(t)){var r=createElementID(),n=createNS("mask");n.setAttribute("id",t.layerId),n.setAttribute("mask-type","alpha"),_svgMatteSymbols.push(t);var i=e.globalData.defs;i.appendChild(n);var a=createNS("symbol");a.setAttribute("id",r),this.replaceInParent(t,r),a.appendChild(t.layerElement),i.appendChild(a);var o=createNS("use");o.setAttribute("href","#"+r),n.appendChild(o),t.data.hd=!1,t.show()}e.setMatte(t.layerId)},SVGMatte3Effect.prototype.initialize=function(){for(var e=this.filterManager.effectElements[0].p.v,t=this.elem.comp.elements,r=0,n=t.length;r<n;)t[r]&&t[r].data.ind===e&&this.setElementAsMask(this.elem,t[r]),r+=1;this.initialized=!0},SVGMatte3Effect.prototype.renderFrame=function(){this.initialized||this.initialize()},SVGGaussianBlurEffect.prototype.renderFrame=function(e){if(e||this.filterManager._mdf){var t=.3*this.filterManager.effectElements[0].p.v,r=this.filterManager.effectElements[1].p.v,n=3==r?0:t,i=2==r?0:t;this.feGaussianBlur.setAttribute("stdDeviation",n+" "+i);var a=1==this.filterManager.effectElements[2].p.v?"wrap":"duplicate";this.feGaussianBlur.setAttribute("edgeMode",a)}},TransformEffect.prototype.init=function(e){this.effectsManager=e,this.type=effectTypes.TRANSFORM_EFFECT,this.matrix=new Matrix,this.opacity=-1,this._mdf=!1,this._opMdf=!1},TransformEffect.prototype.renderFrame=function(e){if(this._opMdf=!1,this._mdf=!1,e||this.effectsManager._mdf){var t=this.effectsManager.effectElements,r=t[0].p.v,n=t[1].p.v,i=1===t[2].p.v,a=t[3].p.v,o=i?a:t[4].p.v,s=t[5].p.v,l=t[6].p.v,c=t[7].p.v;this.matrix.reset(),this.matrix.translate(-r[0],-r[1],r[2]),this.matrix.scale(.01*o,.01*a,1),this.matrix.rotate(-c*degToRads),this.matrix.skewFromAxis(-s*degToRads,(l+90)*degToRads),this.matrix.translate(n[0],n[1],0),this._mdf=!0,this.opacity!==t[8].p.v&&(this.opacity=t[8].p.v,this._opMdf=!0)}},extendPrototype([TransformEffect],SVGTransformEffect),extendPrototype([TransformEffect],CVTransformEffect),registerRenderer("canvas",CanvasRenderer),registerRenderer("html",HybridRenderer),registerRenderer("svg",SVGRenderer),ShapeModifiers.registerModifier("tm",TrimModifier),ShapeModifiers.registerModifier("pb",PuckerAndBloatModifier),ShapeModifiers.registerModifier("rp",RepeaterModifier),ShapeModifiers.registerModifier("rd",RoundCornersModifier),ShapeModifiers.registerModifier("zz",ZigZagModifier),ShapeModifiers.registerModifier("op",OffsetPathModifier),setExpressionsPlugin(Expressions),setExpressionInterfaces(getInterface),initialize$1(),initialize(),registerEffect$1(20,SVGTintFilter,!0),registerEffect$1(21,SVGFillFilter,!0),registerEffect$1(22,SVGStrokeEffect,!1),registerEffect$1(23,SVGTritoneFilter,!0),registerEffect$1(24,SVGProLevelsFilter,!0),registerEffect$1(25,SVGDropShadowEffect,!0),registerEffect$1(28,SVGMatte3Effect,!1),registerEffect$1(29,SVGGaussianBlurEffect,!0),registerEffect$1(35,SVGTransformEffect,!1),registerEffect(35,CVTransformEffect),lottie},module.exports=factory())}(lottie$2,lottie$2.exports)),lottie$2.exports}var lottieExports=requireLottie(),lottie=getDefaultExportFromCjs(lottieExports);const qontoLottiePlayerStyles=i$4`
|
|
211
211
|
:host {
|
|
212
212
|
display: block;
|
|
213
213
|
}
|
|
@@ -475,7 +475,7 @@ const a=Symbol.for(""),o$1=e=>{if(e?.r===a)return e?._$litStatic$},s=e=>({_$litS
|
|
|
475
475
|
data-display-level=${this.displayLevel}
|
|
476
476
|
>
|
|
477
477
|
<slot></slot>
|
|
478
|
-
</p>`}};function prepareScaPollingCall({scaSessionToken:e,stagingToken:t}){return{path:`/v2/sca_sessions/${encodeURIComponent(e)}`,options:{method:"GET",headers:{stagingToken:t,scaSessionToken:e}}}}async function*pollScaSession({scaSettings:e,operationSettings:t}){if(!e||!e.scaSessionToken)throw new InvalidParametersError("scaSettings with scaSessionToken is required to poll SCA session.");if(!t?.
|
|
478
|
+
</p>`}};function prepareScaPollingCall({scaSessionToken:e,stagingToken:t}){return{path:`/v2/sca_sessions/${encodeURIComponent(e)}`,options:{method:"GET",headers:{stagingToken:t,scaSessionToken:e}}}}async function*pollScaSession({scaSettings:e,operationSettings:t}){if(!e||!e.scaSessionToken)throw new InvalidParametersError("scaSettings with scaSessionToken is required to poll SCA session.");if(!t?.proxyEndpointDescriptor)throw new InvalidParametersError("operationSettings with proxyEndpointDescriptor is required to poll SCA session.");const r=prepareScaPollingCall({scaSessionToken:e.scaSessionToken,stagingToken:t.stagingToken});let n;do{n&&(yield n);n=serializeScaPollingResponse((await callProxyFunction({proxyEndpointDescriptor:t.proxyEndpointDescriptor,networkCallDescriptor:r})).body)}while(n.result===SCA_POLLING_RESULTS.WAITING);return n}QontoTextBody.styles=qontoTextBodyStyles,__decorate([n$3({type:String,attribute:"data-variant"})],QontoTextBody.prototype,"variant",void 0),__decorate([n$3({type:String,attribute:"data-display-level"})],QontoTextBody.prototype,"displayLevel",void 0),QontoTextBody=__decorate([t$1("qonto-text-body")],QontoTextBody);const POLLING_INTERVAL_MS=3e3;let QontoScaPasskeyWaiting=class extends i$1{constructor(){super(...arguments),this.phoneLast4Digits="",this.isResending=!1,this.isLinkCopied=!1}connectedCallback(){super.connectedCallback(),this.startPolling()}disconnectedCallback(){super.disconnectedCallback(),this.stopPolling()}async startPolling(){try{this.pollingGenerator=pollScaSession({scaSettings:{scaSessionToken:this.networkCallDescriptor?.options.headers.scaSessionToken},operationSettings:this.operationSettings});let e=await this.pollingGenerator.next();for(;!e.done;)await new Promise((e=>setTimeout(e,POLLING_INTERVAL_MS))),e=await this.pollingGenerator.next();"allow"===e.value.result?await this.executeNetworkCall():"deny"===e.value.result&&this.handleAbortClick()}catch(e){console.error(e),this.dispatchEvent(new CustomEvent("sca-error",{detail:{error:e},bubbles:!0,composed:!0}))}}stopPolling(){this.pollingGenerator?.return({result:"waiting",canceledAt:(new Date).toISOString()})}async executeNetworkCall(){if(this.networkCallDescriptor)try{let e;if(this.operationSettings?.proxyRequestFunction||this.operationSettings?.proxyEndpointDescriptor){e=(await callProxyFunction({proxyFunction:this.operationSettings?.proxyRequestFunction,networkCallDescriptor:this.networkCallDescriptor,proxyEndpointDescriptor:this.operationSettings?.proxyEndpointDescriptor})).body}else e=await makeNetworkCall(this.networkCallDescriptor);this.dispatchEvent(new CustomEvent("sca-success",{detail:{result:e},bubbles:!0,composed:!0}))}catch(e){this.dispatchEvent(new CustomEvent("sca-error",{detail:{error:e},bubbles:!0,composed:!0}))}else console.warn("No network call descriptor provided")}async handleResendClick(){this.isResending||(this.isResending=!0,this.dispatchEvent(new CustomEvent("resend-request",{bubbles:!0,composed:!0})),await this.stopPolling(),this.startPolling(),setTimeout((()=>{this.isResending=!1}),2e3))}handleAbortClick(){this.stopPolling(),this.dispatchEvent(new CustomEvent("sca-abort",{detail:{result:"User aborted SCA"},bubbles:!0,composed:!0}))}render(){return b`
|
|
479
479
|
<qonto-button
|
|
480
480
|
variant="ghost"
|
|
481
481
|
data-close-button
|
|
@@ -508,7 +508,7 @@ const a=Symbol.for(""),o$1=e=>{if(e?.r===a)return e?._$litStatic$},s=e=>({_$litS
|
|
|
508
508
|
</qonto-button>
|
|
509
509
|
</div>
|
|
510
510
|
${environmentManager.isProductionEnvironment()?null:renderTestingScaHelper(this.networkCallDescriptor)}
|
|
511
|
-
`}};async function getSepaTransfers$1(e){tracker.sepaTransferList();const{proxyRequestFunction:t,proxyEndpointDescriptor:r,paginationSettings:n}=validateClientOperationSettings(e?.operationSettings,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=prepareGetSepaTransfersCall({paginationSettings:n}),a=await callProxyFunction({proxyFunction:t,proxyEndpointDescriptor:r,networkCallDescriptor:i}),o=a.body.transfers.map(serializeSepaTransfer),s=serializePaginationResponse(a.body.meta);return{transfers:o,...s?{meta:s}:{}}}async function getSepaTransfer({sepaTransferSettings:e,operationSettings:t}){tracker.sepaTransferGet();const r=validateGetSepaTransferParams(e?.sepaTransferId),{proxyRequestFunction:n,proxyEndpointDescriptor:i}=validateClientOperationSettings(t,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),a=prepareGetSepaTransferCall({sepaTransferId:r});return serializeSepaTransfer((await callProxyFunction({proxyFunction:n,proxyEndpointDescriptor:i,networkCallDescriptor:a})).body.transfer)}async function*createSepaTransfer({sepaTransferSettings:e,operationSettings:t}){tracker.sepaTransferCreate();const{proxyRequestFunction:r,proxyEndpointDescriptor:n,uiParentElementId:i,locale:a}=validateClientOperationSettings(t),o=authManager.getStagingToken(),s=t?.idempotencyKey||v4();let l;validateTransferBeneficiaryParams(e);const c=await findBeneficiary({sepaTransferSettings:e,operationSettings:t}),d={name:c.name,iban:c.iban},u=await verifySepaPayee({sepaPayee:d,operationSettings:t}),p=yield serializeToVopVerificationResult(u);let h;if("string"==typeof p){if(p===VOP_DECISIONS.REJECT)return}else{if(p.vopDecision===VOP_DECISIONS.REJECT)return;h=p.sepaTransferSettings}const f={...e,...h};validateCreateSepaTransferParams(f);const m={...f,beneficiary:c};if(m.beneficiary?.trusted){const e=prepareCreateSepaTransferCall({transfer:m,vopProofToken:u.proof_token.token,idempotencyKey:s});l=(await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:e})).body.transfer}else{if(!isRunningInBrowser())throw new InvalidRuntimeError(RUNTIME_ENVIRONMENT.BROWSER);if(!i)throw new InvalidParametersError("operationSettings.uiParentElementId is required for creating transfers to untrusted beneficiaries. This operation requires UI interaction for SCA.");const e=prepareCreateSepaTransferCall({transfer:m,vopProofToken:u.proof_token.token,stagingToken:o||void 0,idempotencyKey:s});let t;try{l=(await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:e})).body.transfer}catch(e){if(!(e instanceof EmbedApiError&&e.code===HTTP_CODES.PRECONDITION_REQUIRED))throw e;t=serializePreconditionRequiredResponse(e.data.body).scaSessionToken}const c=createSepaTransferScaElement({networkCallDescriptor:e,scaSessionToken:t,operationSettings:{uiParentElementId:i,proxyRequestFunction:r,locale:a}});try{l=await waitForSepaTransferScaResult(c)}finally{c.remove()}}return{transfer:serializeSepaTransfer(l),meta:{idempotencyKey:s}}}async function cancelSepaTransfer({sepaTransferSettings:e,operationSettings:t}){tracker.sepaTransferCancel();const r=validateCancelSepaTransferParams(e?.sepaTransferId),{proxyRequestFunction:n,proxyEndpointDescriptor:i}=validateClientOperationSettings(t,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),a=prepareCancelSepaTransferCall({sepaTransferId:r});await callProxyFunction({proxyFunction:n,proxyEndpointDescriptor:i,networkCallDescriptor:a})}async function verifySepaPayee({sepaPayee:e,operationSettings:t}){const{proxyRequestFunction:r,proxyEndpointDescriptor:n}=validateClientOperationSettings(t,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=prepareVerifySepaPayeeCall({sepaPayee:e});return(await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:i})).body}async function getSepaTransferCreationFlowLink({sepaTransferSettings:e,operationSettings:t}){tracker.sepaTransferCreationFlowLink();const r=validateGetSepaTransferCreationFlowLinkParams(e),{proxyRequestFunction:n,proxyEndpointDescriptor:i}=validateClientOperationSettings(t,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),a=await authLinks.request({requestSettings:{action:AUTH_LINK_ACTIONS.SEPA_TRANSFER_CREATE,callbackUrl:r},operationSettings:{proxyRequestFunction:n,proxyEndpointDescriptor:i}});return{...a,url:decorateUrlWithExtraParams(a.url,t)}}QontoScaPasskeyWaiting.styles=qontoScaPasskeyWaitingStyles,__decorate([n$3({type:String})],QontoScaPasskeyWaiting.prototype,"phoneLast4Digits",void 0),__decorate([n$3({type:Object})],QontoScaPasskeyWaiting.prototype,"networkCallDescriptor",void 0),__decorate([n$3({type:Object})],QontoScaPasskeyWaiting.prototype,"operationSettings",void 0),__decorate([r$2()],QontoScaPasskeyWaiting.prototype,"isResending",void 0),__decorate([r$2()],QontoScaPasskeyWaiting.prototype,"isLinkCopied",void 0),QontoScaPasskeyWaiting=__decorate([localized(),t$1("qonto-sca-passkey-waiting")],QontoScaPasskeyWaiting);const sepaTransfers={getSepaTransfers:getSepaTransfers$1,getSepaTransfer:getSepaTransfer,createSepaTransfer:createSepaTransfer,cancelSepaTransfer:cancelSepaTransfer,getSepaTransferCreationFlowLink:getSepaTransferCreationFlowLink,bulkTransfers:bulkTransfers},TRANSACTIONS_ENDPOINT="/v2/transactions";function prepareGetTransactionsCall({bankAccountId:e,iban:t,status:r,updatedAtFrom:n,updatedAtTo:i,emittedAtFrom:a,emittedAtTo:o,settledAtFrom:s,settledAtTo:l,side:c,operationType:d,withAttachments:u,paginationSettings:p,accessToken:h,stagingToken:f}){const m={method:"GET",headers:{accessToken:h,stagingToken:f}},g=new URLSearchParams;e&&g.append("bank_account_id",e),t&&g.append("iban",t),r&&g.append("status",r),n&&g.append("updated_at_from",n),i&&g.append("updated_at_to",i),a&&g.append("emitted_at_from",a),o&&g.append("emitted_at_to",o),s&&g.append("settled_at_from",s),l&&g.append("settled_at_to",l),c&&g.append("side",c),d&&g.append("operation_type",d),void 0!==u&&g.append("with_attachments",String(u));const v=buildPaginationParams(p);for(const[e,t]of v)g.append(e,t);const y=g.toString();return{path:`${TRANSACTIONS_ENDPOINT}${y?`?${y}`:""}`,options:m}}function prepareGetTransactionCall({transactionId:e,accessToken:t,stagingToken:r}){return{path:`${TRANSACTIONS_ENDPOINT}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:r}}}}function serializeTransaction(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}}:{}}}function validateGetTransactionParams(e){if(!e)throw new InvalidParametersError("transactionSettings parameter is required for the called function");if(!e.transactionId)throw new InvalidParametersError("transactionSettings.transactionId parameter is required for the called function");if(e.transactionId&&"string"!=typeof e.transactionId)throw new InvalidParametersError("transactionSettings.transactionId must be a string.");return e}async function getTransactions(e){tracker.transactionsList();const{proxyRequestFunction:t,proxyEndpointDescriptor:r,paginationSettings:n}=validateClientOperationSettings(e?.operationSettings||{},'Client-side transaction operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/transactions" only in server-side/backend environments.'),i=prepareGetTransactionsCall({...e?.transactionSettings||{},paginationSettings:n}),a=await callProxyFunction({proxyFunction:t,proxyEndpointDescriptor:r,networkCallDescriptor:i});return{transactions:a.body.transactions.map(serializeTransaction),meta:serializePaginationResponse(a.body.meta)}}async function getTransaction({transactionSettings:e,operationSettings:t}){tracker.transactionsGet();const{proxyRequestFunction:r,proxyEndpointDescriptor:n}=validateClientOperationSettings(t||{},'Client-side transaction operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/transactions" only in server-side/backend environments.'),{transactionId:i}=validateGetTransactionParams(e),a=prepareGetTransactionCall({transactionId:i});return serializeTransaction((await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:a})).body.transaction)}const transactions={getTransactions:getTransactions,getTransaction:getTransaction},UI_ELEMENT_NAMES={TRANSFER_LIST:"transfer-list",SEPA_TRANSFER_CREATION:"sepa-transfer-creation",TRANSACTION_LIST:"transaction-list"};function validateCreateUIElementParams(e){if(!e?.uiElementName)throw new InvalidParametersError("uiElementSettings.uiElementName is required when calling createUIElement");const t=Object.values(UI_ELEMENT_NAMES);if(!t.includes(e?.uiElementName))throw new InvalidParametersError(`uiElementSettings.uiElementName must be one of ${t.join(", ")}`);return{uiElementName:e.uiElementName}}const sourceLocale="en",targetLocales=["de","es","fr","it","nl","pt"],templates$5={s09ca90bfc68e29fc:"Geplantes Datum",s0fbf6dc6a1966408:"Nächste",s12bda6ed4915b346:"In Bearbeitung",s12fda681e1531361:"Keine Übereinstimmung gefunden. Bitte überprüfe die Angaben.",s13c4efd1b5ac3a56:"Empfänger",s256aa08dedbda698:"Nicht erhalten?",s270283cc22e1d66b:str`Seite ${0} von ${1} anzeigen (${2} Gesamtelemente)`,s2cc50a787a722cc2:"Nahe Übereinstimmung",s3a150c77a8d32372:"Zahlungsmethode",s3f53588be475bda6:"Nimm dein Handy",s4543ff29118e088d:"Wird bestätigt...",s49730f3d5751a433:"Lädt...",s4b83c11b10db3ecd:"Noch einmal prüfen?",s5033dab8c17f05f2:"Abgeschlossen",s509a8104b078dd96:"Verwendungszweck (wie vom Empfänger gesehen)",s54fac608002f2917:"Erneut senden",s5734c8b4ed165968:"Betrag muss größer als 0 sein",s59d9f8c4cedafcc1:str`Du solltest eine SMS an die Telefonnummer erhalten, die auf ${0} endet. Um fortzufahren, bestätige die Anfrage dort.`,s5c1d01b5aa98d03f:"Belastungskonto",s5e8250fb85d64c23:"Schließen",s6686fcc6d2c8f0bd:"Notiz",s6e123a1f0f64af8e:"Überweisung bestätigen",s6f9fdf0ef3350f1a:"Nimm dir einen Moment Zeit, um alles zu überprüfen.",s78636b92c1a3909c:"Ausstehend",s7f763a1084cb34a9:"Weitere Überweisung erstellen",s8085f59780f33d2a:"Du solltest eine SMS an deine Telefonnummer erhalten. Um fortzufahren, bestätige die Anfrage dort.",s81ecf2d4386b8e84:"Fortfahren",s8237b0bd05a7c64e:"Du sendest",s837fcb0b70616656:"Übereinstimmung",s84550487c5bb7441:"Deine Überweisung wurde gesendet",s84fdc2b810026968:"Nahe Übereinstimmung:",s86c9e77af7225bb5:"Transaktionen konnten nicht geladen werden. Bitte versuchen Sie es erneut.",s8b0bf94f7375fa66:"Bankkonten konnten nicht geladen werden. Bitte versuche es erneut.",s95216d2de29c91e1:"Name und IBAN stimmen mit den Kontodaten des Empfängers überein.",s9b6901ac422f46a7:"Abgelehnt",sa30c4d3b566b6b1a:"Abgebrochen",sad3178c504edf043:"Transaktion",sad3e3c8146fc920f:"Status",sad59707375956ad2:"Fertigstellen",sba98a7152d80b949:"Betrag",sbf9c5c5a8e5efad4:"Fehlgeschlagen",sc1198d93e6399acd:"Gib die Details deiner Überweisung ein",sd057a337e1bb84ef:"Verwendungszweck ist erforderlich",se497cb1f3c37ee07:"Wähle einen Empfänger aus",se67efe78de6988e7:"Keine Übereinstimmung",sf10c96d1fe5eddee:"Nicht überprüft",sf3ff78cc329d3528:"Vorherige",sf7c47b4840e56b34:"Gib den Verwendungszweck der Überweisung ein",sf9ac3755f9746120:"Deine Überweisung konnte nicht gesendet werden",sfda3e4a519cfc5ba:"Abgerechnet",sfe88d270aa3e71da:"Referenz",sff155e9234c5c613:"Betrag übersteigt verfügbares Guthaben"};var de=Object.freeze({__proto__:null,templates:templates$5});const templates$4={s09ca90bfc68e29fc:"Fecha prevista",s0fbf6dc6a1966408:"Siguiente",s12bda6ed4915b346:"En proceso",s12fda681e1531361:"No se ha encontrado coincidencia. Por favor, verifica los datos.",s13c4efd1b5ac3a56:"Beneficiario",s256aa08dedbda698:"¿No lo recibiste?",s270283cc22e1d66b:str`Mostrando página ${0} de ${1} (${2} elementos en total)`,s2cc50a787a722cc2:"Coincidencia cercana",s3a150c77a8d32372:"Método de pago",s3f53588be475bda6:"Coge tu teléfono",s4543ff29118e088d:"Confirmando...",s49730f3d5751a433:"Cargando...",s4b83c11b10db3ecd:"¿Una última revisión?",s5033dab8c17f05f2:"Completado",s509a8104b078dd96:"Referencia (como la ve el beneficiario)",s54fac608002f2917:"Enviar de nuevo",s5734c8b4ed165968:"El importe debe ser mayor que 0",s59d9f8c4cedafcc1:str`Deberías recibir un SMS en el número de teléfono que termina en ${0}. Para continuar, confirma la solicitud desde allí.`,s5c1d01b5aa98d03f:"Cuenta de cargo",s5e8250fb85d64c23:"Cerrar",s6686fcc6d2c8f0bd:"Nota",s6e123a1f0f64af8e:"Confirmar transferencia",s6f9fdf0ef3350f1a:"Tómate un momento para comprobar que todo es correcto.",s78636b92c1a3909c:"Pendiente",s7f763a1084cb34a9:"Crear otra transferencia",s8085f59780f33d2a:"Deberías recibir un SMS en tu número de teléfono. Para continuar, confirma la solicitud desde allí.",s81ecf2d4386b8e84:"Continuar",s8237b0bd05a7c64e:"Estás enviando",s837fcb0b70616656:"Coincidencia",s84550487c5bb7441:"Tu transferencia ha sido enviada",s84fdc2b810026968:"Coincidencia cercana:",s86c9e77af7225bb5:"No se pudieron cargar las transacciones. Por favor, inténtalo de nuevo.",s8b0bf94f7375fa66:"No se pudieron cargar las cuentas bancarias. Por favor, inténtalo de nuevo.",s95216d2de29c91e1:"El nombre y el IBAN coinciden con los datos de la cuenta del beneficiario.",s9b6901ac422f46a7:"Rechazado",sa30c4d3b566b6b1a:"Cancelado",sad3178c504edf043:"Transacción",sad3e3c8146fc920f:"Estado",sad59707375956ad2:"Finalizar",sba98a7152d80b949:"Importe",sbf9c5c5a8e5efad4:"Fallido",sc1198d93e6399acd:"Introduce los detalles de tu transferencia",sd057a337e1bb84ef:"La referencia es obligatoria",se497cb1f3c37ee07:"Selecciona un beneficiario",se67efe78de6988e7:"Sin coincidencia",sf10c96d1fe5eddee:"No verificado",sf3ff78cc329d3528:"Anterior",sf7c47b4840e56b34:"Introduce la referencia de la transferencia",sf9ac3755f9746120:"No se pudo enviar tu transferencia",sfda3e4a519cfc5ba:"Liquidado",sfe88d270aa3e71da:"Referencia",sff155e9234c5c613:"El importe supera el saldo disponible"};var es=Object.freeze({__proto__:null,templates:templates$4});const templates$3={s09ca90bfc68e29fc:"Date prévue",s0fbf6dc6a1966408:"Suivant",s12bda6ed4915b346:"En cours",s12fda681e1531361:"Aucune correspondance trouvée. Veuillez vérifier les informations.",s13c4efd1b5ac3a56:"Bénéficiaire",s256aa08dedbda698:"Vous ne l'avez pas reçu ?",s270283cc22e1d66b:str`Affichage de la page ${0} sur ${1} (${2} éléments au total)`,s2cc50a787a722cc2:"Correspondance proche",s3a150c77a8d32372:"Méthode de paiement",s3f53588be475bda6:"Prends ton téléphone",s4543ff29118e088d:"Confirmation...",s49730f3d5751a433:"Chargement...",s4b83c11b10db3ecd:"Un dernier coup d'œil ?",s5033dab8c17f05f2:"Terminé",s509a8104b078dd96:"Référence (vue par le bénéficiaire)",s54fac608002f2917:"Renvoyer",s5734c8b4ed165968:"Le montant doit être supérieur à 0",s59d9f8c4cedafcc1:str`Vous devriez recevoir un SMS sur le numéro se terminant par ${0}. Pour continuer, confirmez la demande depuis ce numéro.`,s5c1d01b5aa98d03f:"Compte à débiter",s5e8250fb85d64c23:"Fermer",s6686fcc6d2c8f0bd:"Note",s6e123a1f0f64af8e:"Confirmer le virement",s6f9fdf0ef3350f1a:"Prenez un moment pour vérifier que tout est correct.",s78636b92c1a3909c:"En attente",s7f763a1084cb34a9:"Créer un autre virement",s8085f59780f33d2a:"Vous devriez recevoir un SMS sur votre numéro de téléphone. Pour continuer, confirmez la demande depuis ce numéro.",s81ecf2d4386b8e84:"Continuer",s8237b0bd05a7c64e:"Vous envoyez",s837fcb0b70616656:"Correspondance",s84550487c5bb7441:"Votre virement a été envoyé",s84fdc2b810026968:"Correspondance proche :",s86c9e77af7225bb5:"Échec du chargement des transactions. Veuillez réessayer.",s8b0bf94f7375fa66:"Échec du chargement des comptes bancaires. Veuillez réessayer.",s95216d2de29c91e1:"Le nom et l'IBAN correspondent aux informations du bénéficiaire.",s9b6901ac422f46a7:"Refusé",sa30c4d3b566b6b1a:"Annulé",sad3178c504edf043:"Transaction",sad3e3c8146fc920f:"Statut",sad59707375956ad2:"Terminer",sba98a7152d80b949:"Montant",sbf9c5c5a8e5efad4:"Échoué",sc1198d93e6399acd:"Entrez les détails de votre virement",sd057a337e1bb84ef:"La référence est requise",se497cb1f3c37ee07:"Sélectionnez un bénéficiaire",se67efe78de6988e7:"Aucune correspondance",sf10c96d1fe5eddee:"Non vérifié",sf3ff78cc329d3528:"Précédent",sf7c47b4840e56b34:"Entrez la référence du virement",sf9ac3755f9746120:"Votre virement n'a pas pu être envoyé",sfda3e4a519cfc5ba:"Réglé",sfe88d270aa3e71da:"Référence",sff155e9234c5c613:"Le montant dépasse le solde disponible"};var fr$2=Object.freeze({__proto__:null,templates:templates$3});const templates$2={s09ca90bfc68e29fc:"Data programmata",s0fbf6dc6a1966408:"Successivo",s12bda6ed4915b346:"In elaborazione",s12fda681e1531361:"Nessuna corrispondenza trovata. Verifica i dati.",s13c4efd1b5ac3a56:"Beneficiario",s256aa08dedbda698:"Non l'hai ricevuto?",s270283cc22e1d66b:str`Mostra pagina ${0} di ${1} (${2} elementi totali)`,s2cc50a787a722cc2:"Corrispondenza vicina",s3a150c77a8d32372:"Metodo di pagamento",s3f53588be475bda6:"Prendi il tuo telefono",s4543ff29118e088d:"Conferma in corso...",s49730f3d5751a433:"Caricamento...",s4b83c11b10db3ecd:"Un'ultima verifica?",s5033dab8c17f05f2:"Completato",s509a8104b078dd96:"Causale (come vista dal beneficiario)",s54fac608002f2917:"Invia di nuovo",s5734c8b4ed165968:"L'importo deve essere maggiore di 0",s59d9f8c4cedafcc1:str`Dovresti ricevere un SMS al numero che termina con ${0}. Per continuare, conferma la richiesta da lì.`,s5c1d01b5aa98d03f:"Conto da addebitare",s5e8250fb85d64c23:"Chiudi",s6686fcc6d2c8f0bd:"Nota",s6e123a1f0f64af8e:"Conferma bonifico",s6f9fdf0ef3350f1a:"Prenditi un momento per controllare che tutto sia corretto.",s78636b92c1a3909c:"In sospeso",s7f763a1084cb34a9:"Crea un altro bonifico",s8085f59780f33d2a:"Dovresti ricevere un SMS sul tuo numero di telefono. Per continuare, conferma la richiesta da lì.",s81ecf2d4386b8e84:"Continua",s8237b0bd05a7c64e:"Stai inviando",s837fcb0b70616656:"Corrispondenza",s84550487c5bb7441:"Il tuo bonifico è stato inviato",s84fdc2b810026968:"Corrispondenza vicina:",s86c9e77af7225bb5:"Impossibile caricare le transazioni. Riprova.",s8b0bf94f7375fa66:"Impossibile caricare i conti bancari. Riprova.",s95216d2de29c91e1:"Il nome e l'IBAN corrispondono ai dati del beneficiario.",s9b6901ac422f46a7:"Rifiutato",sa30c4d3b566b6b1a:"Annullato",sad3178c504edf043:"Transazione",sad3e3c8146fc920f:"Stato",sad59707375956ad2:"Finisci",sba98a7152d80b949:"Importo",sbf9c5c5a8e5efad4:"Non riuscito",sc1198d93e6399acd:"Inserisci i dettagli del tuo bonifico",sd057a337e1bb84ef:"La causale è obbligatoria",se497cb1f3c37ee07:"Seleziona un beneficiario",se67efe78de6988e7:"Nessuna corrispondenza",sf10c96d1fe5eddee:"Non verificato",sf3ff78cc329d3528:"Precedente",sf7c47b4840e56b34:"Inserisci la causale del bonifico",sf9ac3755f9746120:"La tua operazione non può essere inviata",sfda3e4a519cfc5ba:"Regolato",sfe88d270aa3e71da:"Causale",sff155e9234c5c613:"L'importo supera il saldo disponibile"};var it=Object.freeze({__proto__:null,templates:templates$2});const templates$1={s09ca90bfc68e29fc:"Geplande datum",s0fbf6dc6a1966408:"Volgende",s12bda6ed4915b346:"Bezig met verwerken",s12fda681e1531361:"Geen overeenkomst gevonden. Controleer de gegevens.",s13c4efd1b5ac3a56:"Begunstigde",s256aa08dedbda698:"Niet ontvangen?",s270283cc22e1d66b:str`Pagina ${0} van ${1} weergeven (${2} totaal aantal items)`,s2cc50a787a722cc2:"Dichte overeenkomst",s3a150c77a8d32372:"Betaalmethode",s3f53588be475bda6:"Pak je gekoppelde apparaat erbij",s4543ff29118e088d:"Bevestigen...",s49730f3d5751a433:"Bezig met laden...",s4b83c11b10db3ecd:"Nog één keer controleren?",s5033dab8c17f05f2:"Voltooid",s509a8104b078dd96:"Referentie (zoals gezien door begunstigde)",s54fac608002f2917:"Opnieuw sturen",s5734c8b4ed165968:"Het bedrag moet groter zijn dan 0",s59d9f8c4cedafcc1:str`U zou een sms-bericht moeten ontvangen op het telefoonnummer dat eindigt op ${0}. Om door te gaan, bevestigt u het verzoek hier.`,s5c1d01b5aa98d03f:"Af te schrijven rekening",s5e8250fb85d64c23:"Sluiten",s6686fcc6d2c8f0bd:"Notitie",s6e123a1f0f64af8e:"Overschrijving bevestigen",s6f9fdf0ef3350f1a:"Neem even de tijd om te controleren of alles klopt.",s78636b92c1a3909c:"In afwachting",s7f763a1084cb34a9:"Maak nog een overschrijving",s8085f59780f33d2a:"U zou een sms moeten ontvangen op uw telefoonnummer. Om door te gaan, bevestig het verzoek daar.",s81ecf2d4386b8e84:"Doorgaan",s8237b0bd05a7c64e:"U verstuurt",s837fcb0b70616656:"Overeenkomst",s84550487c5bb7441:"Uw overschrijving is verzonden",s84fdc2b810026968:"Dichte overeenkomst:",s86c9e77af7225bb5:"Transacties laden mislukt. Probeer het opnieuw.",s8b0bf94f7375fa66:"Bankrekeningen konden niet worden geladen. Probeer het opnieuw.",s95216d2de29c91e1:"Naam en IBAN komen overeen met de gegevens van de begunstigde.",s9b6901ac422f46a7:"Geweigerd",sa30c4d3b566b6b1a:"Geannuleerd",sad3178c504edf043:"Transactie",sad3e3c8146fc920f:"Status",sad59707375956ad2:"Voltooien",sba98a7152d80b949:"Bedrag",sbf9c5c5a8e5efad4:"Mislukt",sc1198d93e6399acd:"Voer uw overschrijvingsgegevens in",sd057a337e1bb84ef:"Referentie is verplicht",se497cb1f3c37ee07:"Selecteer een begunstigde",se67efe78de6988e7:"Geen overeenkomst",sf10c96d1fe5eddee:"Niet geverifieerd",sf3ff78cc329d3528:"Vorige",sf7c47b4840e56b34:"Voer de referentie van de overschrijving in",sf9ac3755f9746120:"Je overboeking kon niet worden verzonden",sfda3e4a519cfc5ba:"Afgehandeld",sfe88d270aa3e71da:"Referentie",sff155e9234c5c613:"Het bedrag overschrijdt het beschikbare saldo"};var nl=Object.freeze({__proto__:null,templates:templates$1});const templates={s09ca90bfc68e29fc:"Data agendada",s0fbf6dc6a1966408:"Próximo",s12bda6ed4915b346:"Em processamento",s12fda681e1531361:"Nenhuma correspondência encontrada. Por favor, verifica os dados.",s13c4efd1b5ac3a56:"Beneficiário",s256aa08dedbda698:"Não recebeste?",s270283cc22e1d66b:str`Mostrando página ${0} de ${1} (${2} itens no total)`,s2cc50a787a722cc2:"Correspondência próxima",s3a150c77a8d32372:"Método de pagamento",s3f53588be475bda6:"Pega o teu telemóvel",s4543ff29118e088d:"A confirmar...",s49730f3d5751a433:"A carregar...",s4b83c11b10db3ecd:"Uma última verificação?",s5033dab8c17f05f2:"Concluído",s509a8104b078dd96:"Referência (como vista pelo beneficiário)",s54fac608002f2917:"Enviar novamente",s5734c8b4ed165968:"O valor deve ser superior a 0",s59d9f8c4cedafcc1:str`Deverás receber um SMS no número de telefone que termina em ${0}. Para continuar, confirma o pedido a partir desse número.`,s5c1d01b5aa98d03f:"Conta a debitar",s5e8250fb85d64c23:"Fechar",s6686fcc6d2c8f0bd:"Nota",s6e123a1f0f64af8e:"Confirmar transferência",s6f9fdf0ef3350f1a:"Tira um momento para verificar se está tudo correto.",s78636b92c1a3909c:"Pendente",s7f763a1084cb34a9:"Criar outra transferência",s8085f59780f33d2a:"Deverás receber um SMS no teu número de telefone. Para continuar, confirma o pedido a partir desse número.",s81ecf2d4386b8e84:"Continuar",s8237b0bd05a7c64e:"Estás a enviar",s837fcb0b70616656:"Correspondência",s84550487c5bb7441:"A tua transferência foi enviada",s84fdc2b810026968:"Correspondência próxima:",s86c9e77af7225bb5:"Falha ao carregar transações. Por favor, tente novamente.",s8b0bf94f7375fa66:"Falha ao carregar as contas bancárias. Por favor, tenta novamente.",s95216d2de29c91e1:"O nome e o IBAN correspondem aos dados do beneficiário.",s9b6901ac422f46a7:"Recusado",sa30c4d3b566b6b1a:"Cancelado",sad3178c504edf043:"Transação",sad3e3c8146fc920f:"Estado",sad59707375956ad2:"Terminar",sba98a7152d80b949:"Quantidade",sbf9c5c5a8e5efad4:"Falhou",sc1198d93e6399acd:"Introduz os detalhes da tua transferência",sd057a337e1bb84ef:"A referência é obrigatória",se497cb1f3c37ee07:"Seleciona um beneficiário",se67efe78de6988e7:"Sem correspondência",sf10c96d1fe5eddee:"Não verificado",sf3ff78cc329d3528:"Anterior",sf7c47b4840e56b34:"Introduz a referência da transferência",sf9ac3755f9746120:"Não foi possível enviar a tua transferência",sfda3e4a519cfc5ba:"Liquidado",sfe88d270aa3e71da:"Referência",sff155e9234c5c613:"O valor excede o saldo disponível"};var pt=Object.freeze({__proto__:null,templates:templates});const locales={es:es,fr:fr$2,de:de,nl:nl,pt:pt,it:it},{getLocale:getLocale,setLocale:setLocale}=configureLocalization({sourceLocale:sourceLocale,targetLocales:targetLocales,loadLocale:(e="en")=>new Promise((t=>t(locales[e])))});class RecipientInfoSubmittedEvent extends CustomEvent{constructor(e){super("recipient-info-submitted",{detail:e,bubbles:!0,composed:!0})}}class TransferDetailsSubmittedEvent extends CustomEvent{constructor(e){super("transfer-details-submitted",{detail:e,bubbles:!0,composed:!0})}}const sepaTransferCreationStyles=i$4`
|
|
511
|
+
`}};async function getSepaTransfers$1(e){tracker.sepaTransferList();const{proxyRequestFunction:t,proxyEndpointDescriptor:r,paginationSettings:n}=validateClientOperationSettings(e?.operationSettings,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=prepareGetSepaTransfersCall({paginationSettings:n}),a=await callProxyFunction({proxyFunction:t,proxyEndpointDescriptor:r,networkCallDescriptor:i}),o=a.body.transfers.map(serializeSepaTransfer),s=serializePaginationResponse(a.body.meta);return{transfers:o,...s?{meta:s}:{}}}async function getSepaTransfer({sepaTransferSettings:e,operationSettings:t}){tracker.sepaTransferGet();const r=validateGetSepaTransferParams(e?.sepaTransferId),{proxyRequestFunction:n,proxyEndpointDescriptor:i}=validateClientOperationSettings(t,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),a=prepareGetSepaTransferCall({sepaTransferId:r});return serializeSepaTransfer((await callProxyFunction({proxyFunction:n,proxyEndpointDescriptor:i,networkCallDescriptor:a})).body.transfer)}async function*createSepaTransfer({sepaTransferSettings:e,operationSettings:t}){tracker.sepaTransferCreate();const{proxyRequestFunction:r,proxyEndpointDescriptor:n,uiParentElementId:i,locale:a}=validateClientOperationSettings(t),o=authManager.getStagingToken(),s=t?.idempotencyKey||v4();let l;validateTransferBeneficiaryParams(e);const c=await findBeneficiary({sepaTransferSettings:e,operationSettings:t}),d={name:c.name,iban:c.iban},u=await verifySepaPayee({sepaPayee:d,operationSettings:t}),p=yield serializeToVopVerificationResult(u);let h;if("string"==typeof p){if(p===VOP_DECISIONS.REJECT)return}else{if(p.vopDecision===VOP_DECISIONS.REJECT)return;h=p.sepaTransferSettings}const f={...e,...h};validateCreateSepaTransferParams(f);const m={...f,beneficiary:c};if(m.beneficiary?.trusted){const e=prepareCreateSepaTransferCall({transfer:m,vopProofToken:u.proof_token.token,idempotencyKey:s});l=(await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:e})).body.transfer}else{if(!isRunningInBrowser())throw new InvalidRuntimeError(RUNTIME_ENVIRONMENT.BROWSER);if(!i)throw new InvalidParametersError("operationSettings.uiParentElementId is required for creating transfers to untrusted beneficiaries. This operation requires UI interaction for SCA.");const e=prepareCreateSepaTransferCall({transfer:m,vopProofToken:u.proof_token.token,stagingToken:o||void 0,idempotencyKey:s});let t;try{l=(await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:e})).body.transfer}catch(e){if(!(e instanceof EmbedApiError&&e.code===HTTP_CODES.PRECONDITION_REQUIRED))throw e;t=serializePreconditionRequiredResponse(e.data.body).scaSessionToken}const c=createSepaTransferScaElement({networkCallDescriptor:e,scaSessionToken:t,operationSettings:{uiParentElementId:i,proxyRequestFunction:r,locale:a}});try{l=await waitForSepaTransferScaResult(c)}finally{c.remove()}}return{transfer:serializeSepaTransfer(l),meta:{idempotencyKey:s}}}async function cancelSepaTransfer({sepaTransferSettings:e,operationSettings:t}){tracker.sepaTransferCancel();const r=validateCancelSepaTransferParams(e?.sepaTransferId),{proxyRequestFunction:n,proxyEndpointDescriptor:i}=validateClientOperationSettings(t,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),a=prepareCancelSepaTransferCall({sepaTransferId:r});await callProxyFunction({proxyFunction:n,proxyEndpointDescriptor:i,networkCallDescriptor:a})}async function verifySepaPayee({sepaPayee:e,operationSettings:t}){const{proxyRequestFunction:r,proxyEndpointDescriptor:n}=validateClientOperationSettings(t,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),i=prepareVerifySepaPayeeCall({sepaPayee:e});return(await callProxyFunction({proxyFunction:r,proxyEndpointDescriptor:n,networkCallDescriptor:i})).body}async function getSepaTransferCreationFlowLink({sepaTransferSettings:e,operationSettings:t}){tracker.sepaTransferCreationFlowLink();const r=validateGetSepaTransferCreationFlowLinkParams(e),{proxyRequestFunction:n,proxyEndpointDescriptor:i}=validateClientOperationSettings(t,'Client-side operations require either proxyRequestFunction or proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/sepa-transfers" only in server-side/backend environments.'),a=await authLinks.request({requestSettings:{action:AUTH_LINK_ACTIONS.SEPA_TRANSFER_CREATE,callbackUrl:r},operationSettings:{proxyRequestFunction:n,proxyEndpointDescriptor:i}});return{...a,url:decorateUrlWithExtraParams(a.url,t)}}QontoScaPasskeyWaiting.styles=qontoScaPasskeyWaitingStyles,__decorate([n$3({type:String})],QontoScaPasskeyWaiting.prototype,"phoneLast4Digits",void 0),__decorate([n$3({type:Object})],QontoScaPasskeyWaiting.prototype,"networkCallDescriptor",void 0),__decorate([n$3({type:Object})],QontoScaPasskeyWaiting.prototype,"operationSettings",void 0),__decorate([r$2()],QontoScaPasskeyWaiting.prototype,"isResending",void 0),__decorate([r$2()],QontoScaPasskeyWaiting.prototype,"isLinkCopied",void 0),QontoScaPasskeyWaiting=__decorate([localized(),t$1("qonto-sca-passkey-waiting")],QontoScaPasskeyWaiting);const sepaTransfers={getSepaTransfers:getSepaTransfers$1,getSepaTransfer:getSepaTransfer,createSepaTransfer:createSepaTransfer,cancelSepaTransfer:cancelSepaTransfer,getSepaTransferCreationFlowLink:getSepaTransferCreationFlowLink,bulkTransfers:bulkTransfers},TRANSACTIONS_ENDPOINT="/v2/transactions";function prepareGetTransactionsCall({bankAccountId:e,iban:t,status:r,updatedAtFrom:n,updatedAtTo:i,emittedAtFrom:a,emittedAtTo:o,settledAtFrom:s,settledAtTo:l,side:c,operationType:d,withAttachments:u,paginationSettings:p,accessToken:h,stagingToken:f}){const m={method:"GET",headers:{accessToken:h,stagingToken:f}},g=new URLSearchParams;e&&g.append("bank_account_id",e),t&&g.append("iban",t),r&&g.append("status",r),n&&g.append("updated_at_from",n),i&&g.append("updated_at_to",i),a&&g.append("emitted_at_from",a),o&&g.append("emitted_at_to",o),s&&g.append("settled_at_from",s),l&&g.append("settled_at_to",l),c&&g.append("side",c),d&&g.append("operation_type",d),void 0!==u&&g.append("with_attachments",String(u));const v=buildPaginationParams(p);for(const[e,t]of v)g.append(e,t);const y=g.toString();return{path:`${TRANSACTIONS_ENDPOINT}${y?`?${y}`:""}`,options:m}}function prepareGetTransactionCall({transactionId:e,accessToken:t,stagingToken:r}){return{path:`${TRANSACTIONS_ENDPOINT}/${e}`,options:{method:"GET",headers:{accessToken:t,stagingToken:r}}}}function serializeTransaction(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}}:{}}}function validateGetTransactionParams(e){if(!e)throw new InvalidParametersError("transactionSettings parameter is required for the called function");if(!e.transactionId)throw new InvalidParametersError("transactionSettings.transactionId parameter is required for the called function");if(e.transactionId&&"string"!=typeof e.transactionId)throw new InvalidParametersError("transactionSettings.transactionId must be a string.");return e}async function getTransactions(e){tracker.transactionsList();const{proxyEndpointDescriptor:t,paginationSettings:r}=validateClientOperationSettings(e?.operationSettings||{},'Client-side transaction operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/transactions" only in server-side/backend environments.'),n=prepareGetTransactionsCall({...e?.transactionSettings||{},paginationSettings:r}),i=await callProxyFunction({proxyEndpointDescriptor:t,networkCallDescriptor:n});return{transactions:i.body.transactions.map(serializeTransaction),meta:serializePaginationResponse(i.body.meta)}}async function getTransaction({transactionSettings:e,operationSettings:t}){tracker.transactionsGet();const{proxyEndpointDescriptor:r}=validateClientOperationSettings(t||{},'Client-side transaction operations require proxyEndpointDescriptor. For security, never expose access tokens in the browser. Use "@qonto/embed-sdk/server/transactions" only in server-side/backend environments.'),{transactionId:n}=validateGetTransactionParams(e),i=prepareGetTransactionCall({transactionId:n});return serializeTransaction((await callProxyFunction({proxyEndpointDescriptor:r,networkCallDescriptor:i})).body.transaction)}const transactions={getTransactions:getTransactions,getTransaction:getTransaction},UI_ELEMENT_NAMES={TRANSFER_LIST:"transfer-list",SEPA_TRANSFER_CREATION:"sepa-transfer-creation",TRANSACTION_LIST:"transaction-list"};function validateCreateUIElementParams(e){if(!e?.uiElementName)throw new InvalidParametersError("uiElementSettings.uiElementName is required when calling createUIElement");const t=Object.values(UI_ELEMENT_NAMES);if(!t.includes(e?.uiElementName))throw new InvalidParametersError(`uiElementSettings.uiElementName must be one of ${t.join(", ")}`);return{uiElementName:e.uiElementName}}const sourceLocale="en",targetLocales=["de","es","fr","it","nl","pt"],templates$5={s09ca90bfc68e29fc:"Geplantes Datum",s0fbf6dc6a1966408:"Nächste",s12bda6ed4915b346:"In Bearbeitung",s12fda681e1531361:"Keine Übereinstimmung gefunden. Bitte überprüfe die Angaben.",s13c4efd1b5ac3a56:"Empfänger",s256aa08dedbda698:"Nicht erhalten?",s270283cc22e1d66b:str`Seite ${0} von ${1} anzeigen (${2} Gesamtelemente)`,s2cc50a787a722cc2:"Nahe Übereinstimmung",s3a150c77a8d32372:"Zahlungsmethode",s3f53588be475bda6:"Nimm dein Handy",s4543ff29118e088d:"Wird bestätigt...",s49730f3d5751a433:"Lädt...",s4b83c11b10db3ecd:"Noch einmal prüfen?",s5033dab8c17f05f2:"Abgeschlossen",s509a8104b078dd96:"Verwendungszweck (wie vom Empfänger gesehen)",s54fac608002f2917:"Erneut senden",s5734c8b4ed165968:"Betrag muss größer als 0 sein",s59d9f8c4cedafcc1:str`Du solltest eine SMS an die Telefonnummer erhalten, die auf ${0} endet. Um fortzufahren, bestätige die Anfrage dort.`,s5c1d01b5aa98d03f:"Belastungskonto",s5e8250fb85d64c23:"Schließen",s6686fcc6d2c8f0bd:"Notiz",s6e123a1f0f64af8e:"Überweisung bestätigen",s6f9fdf0ef3350f1a:"Nimm dir einen Moment Zeit, um alles zu überprüfen.",s78636b92c1a3909c:"Ausstehend",s7f763a1084cb34a9:"Weitere Überweisung erstellen",s8085f59780f33d2a:"Du solltest eine SMS an deine Telefonnummer erhalten. Um fortzufahren, bestätige die Anfrage dort.",s81ecf2d4386b8e84:"Fortfahren",s8237b0bd05a7c64e:"Du sendest",s837fcb0b70616656:"Übereinstimmung",s84550487c5bb7441:"Deine Überweisung wurde gesendet",s84fdc2b810026968:"Nahe Übereinstimmung:",s86c9e77af7225bb5:"Transaktionen konnten nicht geladen werden. Bitte versuchen Sie es erneut.",s8b0bf94f7375fa66:"Bankkonten konnten nicht geladen werden. Bitte versuche es erneut.",s95216d2de29c91e1:"Name und IBAN stimmen mit den Kontodaten des Empfängers überein.",s9b6901ac422f46a7:"Abgelehnt",sa30c4d3b566b6b1a:"Abgebrochen",sad3178c504edf043:"Transaktion",sad3e3c8146fc920f:"Status",sad59707375956ad2:"Fertigstellen",sba98a7152d80b949:"Betrag",sbf9c5c5a8e5efad4:"Fehlgeschlagen",sc1198d93e6399acd:"Gib die Details deiner Überweisung ein",sd057a337e1bb84ef:"Verwendungszweck ist erforderlich",se497cb1f3c37ee07:"Wähle einen Empfänger aus",se67efe78de6988e7:"Keine Übereinstimmung",sf10c96d1fe5eddee:"Nicht überprüft",sf3ff78cc329d3528:"Vorherige",sf7c47b4840e56b34:"Gib den Verwendungszweck der Überweisung ein",sf9ac3755f9746120:"Deine Überweisung konnte nicht gesendet werden",sfda3e4a519cfc5ba:"Abgerechnet",sfe88d270aa3e71da:"Referenz",sff155e9234c5c613:"Betrag übersteigt verfügbares Guthaben"};var de=Object.freeze({__proto__:null,templates:templates$5});const templates$4={s09ca90bfc68e29fc:"Fecha prevista",s0fbf6dc6a1966408:"Siguiente",s12bda6ed4915b346:"En proceso",s12fda681e1531361:"No se ha encontrado coincidencia. Por favor, verifica los datos.",s13c4efd1b5ac3a56:"Beneficiario",s256aa08dedbda698:"¿No lo recibiste?",s270283cc22e1d66b:str`Mostrando página ${0} de ${1} (${2} elementos en total)`,s2cc50a787a722cc2:"Coincidencia cercana",s3a150c77a8d32372:"Método de pago",s3f53588be475bda6:"Coge tu teléfono",s4543ff29118e088d:"Confirmando...",s49730f3d5751a433:"Cargando...",s4b83c11b10db3ecd:"¿Una última revisión?",s5033dab8c17f05f2:"Completado",s509a8104b078dd96:"Referencia (como la ve el beneficiario)",s54fac608002f2917:"Enviar de nuevo",s5734c8b4ed165968:"El importe debe ser mayor que 0",s59d9f8c4cedafcc1:str`Deberías recibir un SMS en el número de teléfono que termina en ${0}. Para continuar, confirma la solicitud desde allí.`,s5c1d01b5aa98d03f:"Cuenta de cargo",s5e8250fb85d64c23:"Cerrar",s6686fcc6d2c8f0bd:"Nota",s6e123a1f0f64af8e:"Confirmar transferencia",s6f9fdf0ef3350f1a:"Tómate un momento para comprobar que todo es correcto.",s78636b92c1a3909c:"Pendiente",s7f763a1084cb34a9:"Crear otra transferencia",s8085f59780f33d2a:"Deberías recibir un SMS en tu número de teléfono. Para continuar, confirma la solicitud desde allí.",s81ecf2d4386b8e84:"Continuar",s8237b0bd05a7c64e:"Estás enviando",s837fcb0b70616656:"Coincidencia",s84550487c5bb7441:"Tu transferencia ha sido enviada",s84fdc2b810026968:"Coincidencia cercana:",s86c9e77af7225bb5:"No se pudieron cargar las transacciones. Por favor, inténtalo de nuevo.",s8b0bf94f7375fa66:"No se pudieron cargar las cuentas bancarias. Por favor, inténtalo de nuevo.",s95216d2de29c91e1:"El nombre y el IBAN coinciden con los datos de la cuenta del beneficiario.",s9b6901ac422f46a7:"Rechazado",sa30c4d3b566b6b1a:"Cancelado",sad3178c504edf043:"Transacción",sad3e3c8146fc920f:"Estado",sad59707375956ad2:"Finalizar",sba98a7152d80b949:"Importe",sbf9c5c5a8e5efad4:"Fallido",sc1198d93e6399acd:"Introduce los detalles de tu transferencia",sd057a337e1bb84ef:"La referencia es obligatoria",se497cb1f3c37ee07:"Selecciona un beneficiario",se67efe78de6988e7:"Sin coincidencia",sf10c96d1fe5eddee:"No verificado",sf3ff78cc329d3528:"Anterior",sf7c47b4840e56b34:"Introduce la referencia de la transferencia",sf9ac3755f9746120:"No se pudo enviar tu transferencia",sfda3e4a519cfc5ba:"Liquidado",sfe88d270aa3e71da:"Referencia",sff155e9234c5c613:"El importe supera el saldo disponible"};var es=Object.freeze({__proto__:null,templates:templates$4});const templates$3={s09ca90bfc68e29fc:"Date prévue",s0fbf6dc6a1966408:"Suivant",s12bda6ed4915b346:"En cours",s12fda681e1531361:"Aucune correspondance trouvée. Veuillez vérifier les informations.",s13c4efd1b5ac3a56:"Bénéficiaire",s256aa08dedbda698:"Vous ne l'avez pas reçu ?",s270283cc22e1d66b:str`Affichage de la page ${0} sur ${1} (${2} éléments au total)`,s2cc50a787a722cc2:"Correspondance proche",s3a150c77a8d32372:"Méthode de paiement",s3f53588be475bda6:"Prends ton téléphone",s4543ff29118e088d:"Confirmation...",s49730f3d5751a433:"Chargement...",s4b83c11b10db3ecd:"Un dernier coup d'œil ?",s5033dab8c17f05f2:"Terminé",s509a8104b078dd96:"Référence (vue par le bénéficiaire)",s54fac608002f2917:"Renvoyer",s5734c8b4ed165968:"Le montant doit être supérieur à 0",s59d9f8c4cedafcc1:str`Vous devriez recevoir un SMS sur le numéro se terminant par ${0}. Pour continuer, confirmez la demande depuis ce numéro.`,s5c1d01b5aa98d03f:"Compte à débiter",s5e8250fb85d64c23:"Fermer",s6686fcc6d2c8f0bd:"Note",s6e123a1f0f64af8e:"Confirmer le virement",s6f9fdf0ef3350f1a:"Prenez un moment pour vérifier que tout est correct.",s78636b92c1a3909c:"En attente",s7f763a1084cb34a9:"Créer un autre virement",s8085f59780f33d2a:"Vous devriez recevoir un SMS sur votre numéro de téléphone. Pour continuer, confirmez la demande depuis ce numéro.",s81ecf2d4386b8e84:"Continuer",s8237b0bd05a7c64e:"Vous envoyez",s837fcb0b70616656:"Correspondance",s84550487c5bb7441:"Votre virement a été envoyé",s84fdc2b810026968:"Correspondance proche :",s86c9e77af7225bb5:"Échec du chargement des transactions. Veuillez réessayer.",s8b0bf94f7375fa66:"Échec du chargement des comptes bancaires. Veuillez réessayer.",s95216d2de29c91e1:"Le nom et l'IBAN correspondent aux informations du bénéficiaire.",s9b6901ac422f46a7:"Refusé",sa30c4d3b566b6b1a:"Annulé",sad3178c504edf043:"Transaction",sad3e3c8146fc920f:"Statut",sad59707375956ad2:"Terminer",sba98a7152d80b949:"Montant",sbf9c5c5a8e5efad4:"Échoué",sc1198d93e6399acd:"Entrez les détails de votre virement",sd057a337e1bb84ef:"La référence est requise",se497cb1f3c37ee07:"Sélectionnez un bénéficiaire",se67efe78de6988e7:"Aucune correspondance",sf10c96d1fe5eddee:"Non vérifié",sf3ff78cc329d3528:"Précédent",sf7c47b4840e56b34:"Entrez la référence du virement",sf9ac3755f9746120:"Votre virement n'a pas pu être envoyé",sfda3e4a519cfc5ba:"Réglé",sfe88d270aa3e71da:"Référence",sff155e9234c5c613:"Le montant dépasse le solde disponible"};var fr$2=Object.freeze({__proto__:null,templates:templates$3});const templates$2={s09ca90bfc68e29fc:"Data programmata",s0fbf6dc6a1966408:"Successivo",s12bda6ed4915b346:"In elaborazione",s12fda681e1531361:"Nessuna corrispondenza trovata. Verifica i dati.",s13c4efd1b5ac3a56:"Beneficiario",s256aa08dedbda698:"Non l'hai ricevuto?",s270283cc22e1d66b:str`Mostra pagina ${0} di ${1} (${2} elementi totali)`,s2cc50a787a722cc2:"Corrispondenza vicina",s3a150c77a8d32372:"Metodo di pagamento",s3f53588be475bda6:"Prendi il tuo telefono",s4543ff29118e088d:"Conferma in corso...",s49730f3d5751a433:"Caricamento...",s4b83c11b10db3ecd:"Un'ultima verifica?",s5033dab8c17f05f2:"Completato",s509a8104b078dd96:"Causale (come vista dal beneficiario)",s54fac608002f2917:"Invia di nuovo",s5734c8b4ed165968:"L'importo deve essere maggiore di 0",s59d9f8c4cedafcc1:str`Dovresti ricevere un SMS al numero che termina con ${0}. Per continuare, conferma la richiesta da lì.`,s5c1d01b5aa98d03f:"Conto da addebitare",s5e8250fb85d64c23:"Chiudi",s6686fcc6d2c8f0bd:"Nota",s6e123a1f0f64af8e:"Conferma bonifico",s6f9fdf0ef3350f1a:"Prenditi un momento per controllare che tutto sia corretto.",s78636b92c1a3909c:"In sospeso",s7f763a1084cb34a9:"Crea un altro bonifico",s8085f59780f33d2a:"Dovresti ricevere un SMS sul tuo numero di telefono. Per continuare, conferma la richiesta da lì.",s81ecf2d4386b8e84:"Continua",s8237b0bd05a7c64e:"Stai inviando",s837fcb0b70616656:"Corrispondenza",s84550487c5bb7441:"Il tuo bonifico è stato inviato",s84fdc2b810026968:"Corrispondenza vicina:",s86c9e77af7225bb5:"Impossibile caricare le transazioni. Riprova.",s8b0bf94f7375fa66:"Impossibile caricare i conti bancari. Riprova.",s95216d2de29c91e1:"Il nome e l'IBAN corrispondono ai dati del beneficiario.",s9b6901ac422f46a7:"Rifiutato",sa30c4d3b566b6b1a:"Annullato",sad3178c504edf043:"Transazione",sad3e3c8146fc920f:"Stato",sad59707375956ad2:"Finisci",sba98a7152d80b949:"Importo",sbf9c5c5a8e5efad4:"Non riuscito",sc1198d93e6399acd:"Inserisci i dettagli del tuo bonifico",sd057a337e1bb84ef:"La causale è obbligatoria",se497cb1f3c37ee07:"Seleziona un beneficiario",se67efe78de6988e7:"Nessuna corrispondenza",sf10c96d1fe5eddee:"Non verificato",sf3ff78cc329d3528:"Precedente",sf7c47b4840e56b34:"Inserisci la causale del bonifico",sf9ac3755f9746120:"La tua operazione non può essere inviata",sfda3e4a519cfc5ba:"Regolato",sfe88d270aa3e71da:"Causale",sff155e9234c5c613:"L'importo supera il saldo disponibile"};var it=Object.freeze({__proto__:null,templates:templates$2});const templates$1={s09ca90bfc68e29fc:"Geplande datum",s0fbf6dc6a1966408:"Volgende",s12bda6ed4915b346:"Bezig met verwerken",s12fda681e1531361:"Geen overeenkomst gevonden. Controleer de gegevens.",s13c4efd1b5ac3a56:"Begunstigde",s256aa08dedbda698:"Niet ontvangen?",s270283cc22e1d66b:str`Pagina ${0} van ${1} weergeven (${2} totaal aantal items)`,s2cc50a787a722cc2:"Dichte overeenkomst",s3a150c77a8d32372:"Betaalmethode",s3f53588be475bda6:"Pak je gekoppelde apparaat erbij",s4543ff29118e088d:"Bevestigen...",s49730f3d5751a433:"Bezig met laden...",s4b83c11b10db3ecd:"Nog één keer controleren?",s5033dab8c17f05f2:"Voltooid",s509a8104b078dd96:"Referentie (zoals gezien door begunstigde)",s54fac608002f2917:"Opnieuw sturen",s5734c8b4ed165968:"Het bedrag moet groter zijn dan 0",s59d9f8c4cedafcc1:str`U zou een sms-bericht moeten ontvangen op het telefoonnummer dat eindigt op ${0}. Om door te gaan, bevestigt u het verzoek hier.`,s5c1d01b5aa98d03f:"Af te schrijven rekening",s5e8250fb85d64c23:"Sluiten",s6686fcc6d2c8f0bd:"Notitie",s6e123a1f0f64af8e:"Overschrijving bevestigen",s6f9fdf0ef3350f1a:"Neem even de tijd om te controleren of alles klopt.",s78636b92c1a3909c:"In afwachting",s7f763a1084cb34a9:"Maak nog een overschrijving",s8085f59780f33d2a:"U zou een sms moeten ontvangen op uw telefoonnummer. Om door te gaan, bevestig het verzoek daar.",s81ecf2d4386b8e84:"Doorgaan",s8237b0bd05a7c64e:"U verstuurt",s837fcb0b70616656:"Overeenkomst",s84550487c5bb7441:"Uw overschrijving is verzonden",s84fdc2b810026968:"Dichte overeenkomst:",s86c9e77af7225bb5:"Transacties laden mislukt. Probeer het opnieuw.",s8b0bf94f7375fa66:"Bankrekeningen konden niet worden geladen. Probeer het opnieuw.",s95216d2de29c91e1:"Naam en IBAN komen overeen met de gegevens van de begunstigde.",s9b6901ac422f46a7:"Geweigerd",sa30c4d3b566b6b1a:"Geannuleerd",sad3178c504edf043:"Transactie",sad3e3c8146fc920f:"Status",sad59707375956ad2:"Voltooien",sba98a7152d80b949:"Bedrag",sbf9c5c5a8e5efad4:"Mislukt",sc1198d93e6399acd:"Voer uw overschrijvingsgegevens in",sd057a337e1bb84ef:"Referentie is verplicht",se497cb1f3c37ee07:"Selecteer een begunstigde",se67efe78de6988e7:"Geen overeenkomst",sf10c96d1fe5eddee:"Niet geverifieerd",sf3ff78cc329d3528:"Vorige",sf7c47b4840e56b34:"Voer de referentie van de overschrijving in",sf9ac3755f9746120:"Je overboeking kon niet worden verzonden",sfda3e4a519cfc5ba:"Afgehandeld",sfe88d270aa3e71da:"Referentie",sff155e9234c5c613:"Het bedrag overschrijdt het beschikbare saldo"};var nl=Object.freeze({__proto__:null,templates:templates$1});const templates={s09ca90bfc68e29fc:"Data agendada",s0fbf6dc6a1966408:"Próximo",s12bda6ed4915b346:"Em processamento",s12fda681e1531361:"Nenhuma correspondência encontrada. Por favor, verifica os dados.",s13c4efd1b5ac3a56:"Beneficiário",s256aa08dedbda698:"Não recebeste?",s270283cc22e1d66b:str`Mostrando página ${0} de ${1} (${2} itens no total)`,s2cc50a787a722cc2:"Correspondência próxima",s3a150c77a8d32372:"Método de pagamento",s3f53588be475bda6:"Pega o teu telemóvel",s4543ff29118e088d:"A confirmar...",s49730f3d5751a433:"A carregar...",s4b83c11b10db3ecd:"Uma última verificação?",s5033dab8c17f05f2:"Concluído",s509a8104b078dd96:"Referência (como vista pelo beneficiário)",s54fac608002f2917:"Enviar novamente",s5734c8b4ed165968:"O valor deve ser superior a 0",s59d9f8c4cedafcc1:str`Deverás receber um SMS no número de telefone que termina em ${0}. Para continuar, confirma o pedido a partir desse número.`,s5c1d01b5aa98d03f:"Conta a debitar",s5e8250fb85d64c23:"Fechar",s6686fcc6d2c8f0bd:"Nota",s6e123a1f0f64af8e:"Confirmar transferência",s6f9fdf0ef3350f1a:"Tira um momento para verificar se está tudo correto.",s78636b92c1a3909c:"Pendente",s7f763a1084cb34a9:"Criar outra transferência",s8085f59780f33d2a:"Deverás receber um SMS no teu número de telefone. Para continuar, confirma o pedido a partir desse número.",s81ecf2d4386b8e84:"Continuar",s8237b0bd05a7c64e:"Estás a enviar",s837fcb0b70616656:"Correspondência",s84550487c5bb7441:"A tua transferência foi enviada",s84fdc2b810026968:"Correspondência próxima:",s86c9e77af7225bb5:"Falha ao carregar transações. Por favor, tente novamente.",s8b0bf94f7375fa66:"Falha ao carregar as contas bancárias. Por favor, tenta novamente.",s95216d2de29c91e1:"O nome e o IBAN correspondem aos dados do beneficiário.",s9b6901ac422f46a7:"Recusado",sa30c4d3b566b6b1a:"Cancelado",sad3178c504edf043:"Transação",sad3e3c8146fc920f:"Estado",sad59707375956ad2:"Terminar",sba98a7152d80b949:"Quantidade",sbf9c5c5a8e5efad4:"Falhou",sc1198d93e6399acd:"Introduz os detalhes da tua transferência",sd057a337e1bb84ef:"A referência é obrigatória",se497cb1f3c37ee07:"Seleciona um beneficiário",se67efe78de6988e7:"Sem correspondência",sf10c96d1fe5eddee:"Não verificado",sf3ff78cc329d3528:"Anterior",sf7c47b4840e56b34:"Introduz a referência da transferência",sf9ac3755f9746120:"Não foi possível enviar a tua transferência",sfda3e4a519cfc5ba:"Liquidado",sfe88d270aa3e71da:"Referência",sff155e9234c5c613:"O valor excede o saldo disponível"};var pt=Object.freeze({__proto__:null,templates:templates});const locales={es:es,fr:fr$2,de:de,nl:nl,pt:pt,it:it},{getLocale:getLocale,setLocale:setLocale}=configureLocalization({sourceLocale:sourceLocale,targetLocales:targetLocales,loadLocale:(e="en")=>new Promise((t=>t(locales[e])))});class RecipientInfoSubmittedEvent extends CustomEvent{constructor(e){super("recipient-info-submitted",{detail:e,bubbles:!0,composed:!0})}}class TransferDetailsSubmittedEvent extends CustomEvent{constructor(e){super("transfer-details-submitted",{detail:e,bubbles:!0,composed:!0})}}const sepaTransferCreationStyles=i$4`
|
|
512
512
|
:host {
|
|
513
513
|
display: block;
|
|
514
514
|
width: 100%;
|