@amplitude/plugin-autocapture-browser 1.6.1 → 1.7.1
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/lib/cjs/frustration-plugin.d.ts +1 -1
- package/lib/cjs/frustration-plugin.d.ts.map +1 -1
- package/lib/cjs/frustration-plugin.js +1 -0
- package/lib/cjs/frustration-plugin.js.map +1 -1
- package/lib/cjs/version.d.ts +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/cjs/version.js.map +1 -1
- package/lib/esm/frustration-plugin.d.ts +1 -1
- package/lib/esm/frustration-plugin.d.ts.map +1 -1
- package/lib/esm/frustration-plugin.js +1 -0
- package/lib/esm/frustration-plugin.js.map +1 -1
- package/lib/esm/version.d.ts +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/scripts/amplitude-min.js +1 -1
- package/lib/scripts/amplitude-min.js.gz +0 -0
- package/lib/scripts/amplitude-min.js.map +1 -1
- package/lib/scripts/amplitude-min.umd.js +1 -1
- package/lib/scripts/amplitude-min.umd.js.gz +0 -0
- package/lib/scripts/frustration-plugin.d.ts +1 -1
- package/lib/scripts/frustration-plugin.d.ts.map +1 -1
- package/lib/scripts/version.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BrowserClient, BrowserConfig, EnrichmentPlugin, FrustrationInteractionsOptions } from '@amplitude/analytics-core';
|
|
2
2
|
type BrowserEnrichmentPlugin = EnrichmentPlugin<BrowserClient, BrowserConfig>;
|
|
3
|
-
export declare const frustrationPlugin: (options
|
|
3
|
+
export declare const frustrationPlugin: (options?: FrustrationInteractionsOptions) => BrowserEnrichmentPlugin;
|
|
4
4
|
export {};
|
|
5
5
|
//# sourceMappingURL=frustration-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frustration-plugin.d.ts","sourceRoot":"","sources":["../../src/frustration-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,8BAA8B,EAI/B,MAAM,2BAA2B,CAAC;AAenC,KAAK,uBAAuB,GAAG,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAE9E,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"frustration-plugin.d.ts","sourceRoot":"","sources":["../../src/frustration-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,8BAA8B,EAI/B,MAAM,2BAA2B,CAAC;AAenC,KAAK,uBAAuB,GAAG,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAE9E,eAAO,MAAM,iBAAiB,aAAa,8BAA8B,KAAQ,uBA0GhF,CAAC"}
|
|
@@ -13,6 +13,7 @@ var autocapture_plugin_1 = require("./autocapture-plugin");
|
|
|
13
13
|
var observables_1 = require("./observables");
|
|
14
14
|
var frustrationPlugin = function (options) {
|
|
15
15
|
var _a, _b, _c, _d, _e;
|
|
16
|
+
if (options === void 0) { options = {}; }
|
|
16
17
|
var name = constants.FRUSTRATION_PLUGIN_NAME;
|
|
17
18
|
var type = 'enrichment';
|
|
18
19
|
var subscriptions = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frustration-plugin.js","sourceRoot":"","sources":["../../src/frustration-plugin.ts"],"names":[],"mappings":";;;;AAAA,0CAA0C;AAC1C,4DAQmC;AACnC,6DAAyC;AACzC,6BAAuE;AACvE,qCAMmB;AACnB,mEAAgE;AAChE,mEAAiE;AACjE,2DAA6E;AAC7E,6CAAgF;AAIzE,IAAM,iBAAiB,GAAG,UAAC,
|
|
1
|
+
{"version":3,"file":"frustration-plugin.js","sourceRoot":"","sources":["../../src/frustration-plugin.ts"],"names":[],"mappings":"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","sourcesContent":["/* eslint-disable no-restricted-globals */\nimport {\n BrowserClient,\n BrowserConfig,\n EnrichmentPlugin,\n FrustrationInteractionsOptions,\n DEFAULT_DATA_ATTRIBUTE_PREFIX,\n DEFAULT_RAGE_CLICK_ALLOWLIST,\n DEFAULT_DEAD_CLICK_ALLOWLIST,\n} from '@amplitude/analytics-core';\nimport * as constants from './constants';\nimport { fromEvent, map, Observable, Subscription, share } from 'rxjs';\nimport {\n addAdditionalEventProperties,\n createShouldTrackEvent,\n ElementBasedTimestampedEvent,\n getEventProperties,\n NavigateEvent,\n} from './helpers';\nimport { trackDeadClick } from './autocapture/track-dead-click';\nimport { trackRageClicks } from './autocapture/track-rage-click';\nimport { AllWindowObservables, ObservablesEnum } from './autocapture-plugin';\nimport { createClickObservable, createMutationObservable } from './observables';\n\ntype BrowserEnrichmentPlugin = EnrichmentPlugin<BrowserClient, BrowserConfig>;\n\nexport const frustrationPlugin = (options: FrustrationInteractionsOptions = {}): BrowserEnrichmentPlugin => {\n const name = constants.FRUSTRATION_PLUGIN_NAME;\n const type = 'enrichment';\n\n const subscriptions: Subscription[] = [];\n\n const rageCssSelectors = options.rageClicks?.cssSelectorAllowlist ?? DEFAULT_RAGE_CLICK_ALLOWLIST;\n const deadCssSelectors = options.deadClicks?.cssSelectorAllowlist ?? DEFAULT_DEAD_CLICK_ALLOWLIST;\n\n const dataAttributePrefix = options.dataAttributePrefix ?? DEFAULT_DATA_ATTRIBUTE_PREFIX;\n\n // combine the two selector lists to determine which clicked elements should be filtered\n const combinedCssSelectors = [...new Set([...rageCssSelectors, ...deadCssSelectors])];\n\n // Create observables on events on the window\n const createObservables = (): AllWindowObservables => {\n // Create Observables from direct user events\n const clickObservable = createClickObservable().pipe(\n map((click) => {\n return addAdditionalEventProperties(\n click,\n 'click',\n combinedCssSelectors,\n dataAttributePrefix,\n true, // capture when cursor is pointer\n );\n }),\n share(),\n );\n\n // Create observable for URL changes\n let navigateObservable;\n /* istanbul ignore next */\n if (window.navigation) {\n navigateObservable = fromEvent<NavigateEvent>(window.navigation, 'navigate').pipe(\n map((navigate) =>\n addAdditionalEventProperties(navigate, 'navigate', combinedCssSelectors, dataAttributePrefix),\n ),\n share(),\n );\n }\n\n // Track DOM Mutations\n const enrichedMutationObservable = createMutationObservable().pipe(\n map((mutation) => addAdditionalEventProperties(mutation, 'mutation', combinedCssSelectors, dataAttributePrefix)),\n share(),\n );\n\n return {\n [ObservablesEnum.ClickObservable]: clickObservable as Observable<ElementBasedTimestampedEvent<MouseEvent>>,\n [ObservablesEnum.ChangeObservable]: new Observable<ElementBasedTimestampedEvent<Event>>(), // Empty observable since we don't need change events\n [ObservablesEnum.NavigateObservable]: navigateObservable,\n [ObservablesEnum.MutationObservable]: enrichedMutationObservable,\n };\n };\n\n const setup: BrowserEnrichmentPlugin['setup'] = async (config, amplitude) => {\n /* istanbul ignore if */\n if (typeof document === 'undefined') {\n return;\n }\n\n // Create should track event functions for the different allowlists\n const shouldTrackRageClick = createShouldTrackEvent(options, rageCssSelectors);\n const shouldTrackDeadClick = createShouldTrackEvent(options, deadCssSelectors);\n\n // Create observables for events on the window\n const allObservables = createObservables();\n\n // Create subscriptions\n const rageClickSubscription = trackRageClicks({\n allObservables,\n amplitude,\n shouldTrackRageClick,\n });\n subscriptions.push(rageClickSubscription);\n\n const deadClickSubscription = trackDeadClick({\n amplitude,\n allObservables,\n getEventProperties: (actionType, element) => getEventProperties(actionType, element, dataAttributePrefix),\n shouldTrackDeadClick,\n });\n subscriptions.push(deadClickSubscription);\n\n /* istanbul ignore next */\n config?.loggerProvider?.log(`${name} has been successfully added.`);\n };\n\n const execute: BrowserEnrichmentPlugin['execute'] = async (event) => {\n return event;\n };\n\n const teardown = async () => {\n for (const subscription of subscriptions) {\n subscription.unsubscribe();\n }\n };\n\n return {\n name,\n type,\n setup,\n execute,\n teardown,\n };\n};\n"]}
|
package/lib/cjs/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.7.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/cjs/version.js
CHANGED
package/lib/cjs/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["export const VERSION = '1.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,OAAO,CAAC","sourcesContent":["export const VERSION = '1.7.1';\n"]}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BrowserClient, BrowserConfig, EnrichmentPlugin, FrustrationInteractionsOptions } from '@amplitude/analytics-core';
|
|
2
2
|
type BrowserEnrichmentPlugin = EnrichmentPlugin<BrowserClient, BrowserConfig>;
|
|
3
|
-
export declare const frustrationPlugin: (options
|
|
3
|
+
export declare const frustrationPlugin: (options?: FrustrationInteractionsOptions) => BrowserEnrichmentPlugin;
|
|
4
4
|
export {};
|
|
5
5
|
//# sourceMappingURL=frustration-plugin.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frustration-plugin.d.ts","sourceRoot":"","sources":["../../src/frustration-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,8BAA8B,EAI/B,MAAM,2BAA2B,CAAC;AAenC,KAAK,uBAAuB,GAAG,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAE9E,eAAO,MAAM,iBAAiB,
|
|
1
|
+
{"version":3,"file":"frustration-plugin.d.ts","sourceRoot":"","sources":["../../src/frustration-plugin.ts"],"names":[],"mappings":"AACA,OAAO,EACL,aAAa,EACb,aAAa,EACb,gBAAgB,EAChB,8BAA8B,EAI/B,MAAM,2BAA2B,CAAC;AAenC,KAAK,uBAAuB,GAAG,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC,CAAC;AAE9E,eAAO,MAAM,iBAAiB,aAAa,8BAA8B,KAAQ,uBA0GhF,CAAC"}
|
|
@@ -10,6 +10,7 @@ import { ObservablesEnum } from './autocapture-plugin';
|
|
|
10
10
|
import { createClickObservable, createMutationObservable } from './observables';
|
|
11
11
|
export var frustrationPlugin = function (options) {
|
|
12
12
|
var _a, _b, _c, _d, _e;
|
|
13
|
+
if (options === void 0) { options = {}; }
|
|
13
14
|
var name = constants.FRUSTRATION_PLUGIN_NAME;
|
|
14
15
|
var type = 'enrichment';
|
|
15
16
|
var subscriptions = [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"frustration-plugin.js","sourceRoot":"","sources":["../../src/frustration-plugin.ts"],"names":[],"mappings":";AAAA,0CAA0C;AAC1C,OAAO,EAKL,6BAA6B,EAC7B,4BAA4B,EAC5B,4BAA4B,GAC7B,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,SAAS,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,SAAS,EAAE,GAAG,EAAE,UAAU,EAAgB,KAAK,EAAE,MAAM,MAAM,CAAC;AACvE,OAAO,EACL,4BAA4B,EAC5B,sBAAsB,EAEtB,kBAAkB,GAEnB,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,cAAc,EAAE,MAAM,gCAAgC,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAC;AACjE,OAAO,EAAwB,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,MAAM,eAAe,CAAC;AAIhF,MAAM,CAAC,IAAM,iBAAiB,GAAG,UAAC,
|
|
1
|
+
{"version":3,"file":"frustration-plugin.js","sourceRoot":"","sources":["../../src/frustration-plugin.ts"],"names":[],"mappings":"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","sourcesContent":["/* eslint-disable no-restricted-globals */\nimport {\n BrowserClient,\n BrowserConfig,\n EnrichmentPlugin,\n FrustrationInteractionsOptions,\n DEFAULT_DATA_ATTRIBUTE_PREFIX,\n DEFAULT_RAGE_CLICK_ALLOWLIST,\n DEFAULT_DEAD_CLICK_ALLOWLIST,\n} from '@amplitude/analytics-core';\nimport * as constants from './constants';\nimport { fromEvent, map, Observable, Subscription, share } from 'rxjs';\nimport {\n addAdditionalEventProperties,\n createShouldTrackEvent,\n ElementBasedTimestampedEvent,\n getEventProperties,\n NavigateEvent,\n} from './helpers';\nimport { trackDeadClick } from './autocapture/track-dead-click';\nimport { trackRageClicks } from './autocapture/track-rage-click';\nimport { AllWindowObservables, ObservablesEnum } from './autocapture-plugin';\nimport { createClickObservable, createMutationObservable } from './observables';\n\ntype BrowserEnrichmentPlugin = EnrichmentPlugin<BrowserClient, BrowserConfig>;\n\nexport const frustrationPlugin = (options: FrustrationInteractionsOptions = {}): BrowserEnrichmentPlugin => {\n const name = constants.FRUSTRATION_PLUGIN_NAME;\n const type = 'enrichment';\n\n const subscriptions: Subscription[] = [];\n\n const rageCssSelectors = options.rageClicks?.cssSelectorAllowlist ?? DEFAULT_RAGE_CLICK_ALLOWLIST;\n const deadCssSelectors = options.deadClicks?.cssSelectorAllowlist ?? DEFAULT_DEAD_CLICK_ALLOWLIST;\n\n const dataAttributePrefix = options.dataAttributePrefix ?? DEFAULT_DATA_ATTRIBUTE_PREFIX;\n\n // combine the two selector lists to determine which clicked elements should be filtered\n const combinedCssSelectors = [...new Set([...rageCssSelectors, ...deadCssSelectors])];\n\n // Create observables on events on the window\n const createObservables = (): AllWindowObservables => {\n // Create Observables from direct user events\n const clickObservable = createClickObservable().pipe(\n map((click) => {\n return addAdditionalEventProperties(\n click,\n 'click',\n combinedCssSelectors,\n dataAttributePrefix,\n true, // capture when cursor is pointer\n );\n }),\n share(),\n );\n\n // Create observable for URL changes\n let navigateObservable;\n /* istanbul ignore next */\n if (window.navigation) {\n navigateObservable = fromEvent<NavigateEvent>(window.navigation, 'navigate').pipe(\n map((navigate) =>\n addAdditionalEventProperties(navigate, 'navigate', combinedCssSelectors, dataAttributePrefix),\n ),\n share(),\n );\n }\n\n // Track DOM Mutations\n const enrichedMutationObservable = createMutationObservable().pipe(\n map((mutation) => addAdditionalEventProperties(mutation, 'mutation', combinedCssSelectors, dataAttributePrefix)),\n share(),\n );\n\n return {\n [ObservablesEnum.ClickObservable]: clickObservable as Observable<ElementBasedTimestampedEvent<MouseEvent>>,\n [ObservablesEnum.ChangeObservable]: new Observable<ElementBasedTimestampedEvent<Event>>(), // Empty observable since we don't need change events\n [ObservablesEnum.NavigateObservable]: navigateObservable,\n [ObservablesEnum.MutationObservable]: enrichedMutationObservable,\n };\n };\n\n const setup: BrowserEnrichmentPlugin['setup'] = async (config, amplitude) => {\n /* istanbul ignore if */\n if (typeof document === 'undefined') {\n return;\n }\n\n // Create should track event functions for the different allowlists\n const shouldTrackRageClick = createShouldTrackEvent(options, rageCssSelectors);\n const shouldTrackDeadClick = createShouldTrackEvent(options, deadCssSelectors);\n\n // Create observables for events on the window\n const allObservables = createObservables();\n\n // Create subscriptions\n const rageClickSubscription = trackRageClicks({\n allObservables,\n amplitude,\n shouldTrackRageClick,\n });\n subscriptions.push(rageClickSubscription);\n\n const deadClickSubscription = trackDeadClick({\n amplitude,\n allObservables,\n getEventProperties: (actionType, element) => getEventProperties(actionType, element, dataAttributePrefix),\n shouldTrackDeadClick,\n });\n subscriptions.push(deadClickSubscription);\n\n /* istanbul ignore next */\n config?.loggerProvider?.log(`${name} has been successfully added.`);\n };\n\n const execute: BrowserEnrichmentPlugin['execute'] = async (event) => {\n return event;\n };\n\n const teardown = async () => {\n for (const subscription of subscriptions) {\n subscription.unsubscribe();\n }\n };\n\n return {\n name,\n type,\n setup,\n execute,\n teardown,\n };\n};\n"]}
|
package/lib/esm/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "1.
|
|
1
|
+
export declare const VERSION = "1.7.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/lib/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export var VERSION = '1.
|
|
1
|
+
export var VERSION = '1.7.1';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
package/lib/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["export const VERSION = '1.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,OAAO,CAAC","sourcesContent":["export const VERSION = '1.7.1';\n"]}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var amplitudeAutocapturePlugin=function(t){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function i(t,e,n,r){return new(n||(n=Promise))((function(i,o){function u(t){try{l(r.next(t))}catch(t){o(t)}}function c(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,c)}l((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(c){return function(l){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(6===c[0]&&o.label<i[1]){o.label=i[1],i=c;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(c);break}i[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(t,o)}catch(t){c=[6,t],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function l(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function s(t){return this instanceof s?(this.v=t,this):new s(t)}function a(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",(function(t){return function(e){return Promise.resolve(e).then(t,a)}})),r[Symbol.asyncIterator]=function(){return this},r;function u(t,e){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||c(t,e)}))},e&&(r[t]=e(r[t])))}function c(t,e){try{(n=i[t](e)).value instanceof s?Promise.resolve(n.value.v).then(l,a):f(o[0][2],n)}catch(t){f(o[0][3],t)}var n}function l(t){c("next",t)}function a(t){c("throw",t)}function f(t,e){t(e),o.shift(),o.length&&c(o[0][0],o[0][1])}}function f(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=u(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;var d=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],p="data-amp-track-",v=["div","span","h1","h2","h3","h4","h5","h6"],h=l(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],c(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),b=["*"],y="[Amplitude] Element Clicked",m="[Amplitude] Element Tag",g="[Amplitude] Element Text",w="[Amplitude] Page URL",_="https://app.amplitude.com",A={US:_,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};function x(t){return"function"==typeof t}function k(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var E=k((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function S(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var T=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=u(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var f=this.initialTeardown;if(x(f))try{f()}catch(t){i=t instanceof E?t.errors:[t]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=u(d),v=p.next();!v.done;v=p.next()){var h=v.value;try{P(h)}catch(t){i=null!=i?i:[],t instanceof E?i=l(l([],c(i)),c(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{v&&!v.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}}if(i)throw new E(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)P(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&S(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&S(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),O=T.EMPTY;function C(t){return t instanceof T||t&&"closed"in t&&x(t.remove)&&x(t.add)&&x(t.unsubscribe)}function P(t){x(t)?t():t.unsubscribe()}var I={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},j=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,l([t,e],c(n)))};function N(t){j((function(){throw t}))}function L(){}function M(t){t()}var q=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,C(e)&&e.add(n)):n.destination=Y,n}return n(e,t),e.create=function(t,e,n){return new z(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(T),F=Function.prototype.bind;function R(t,e){return F.call(t,e)}var D=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){V(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){V(t)}else V(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){V(t)}},t}(),z=function(t){function e(e,n,r){var i,o,u=t.call(this)||this;x(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&I.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return u.unsubscribe()},i={next:e.next&&R(e.next,o),error:e.error&&R(e.error,o),complete:e.complete&&R(e.complete,o)}):i=e;return u.destination=new D(i),u}return n(e,t),e}(q);function V(t){N(t)}var Y={closed:!0,next:L,error:function(t){throw t},complete:L},U="function"==typeof Symbol&&Symbol.observable||"@@observable";function H(t){return t}var W=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof q||function(t){return t&&x(t.next)&&x(t.error)&&x(t.complete)}(r)&&C(r)?t:new z(t,e,n);return M((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=B(e))((function(e,r){var i=new z({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[U]=function(){return this},t.prototype.pipe=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(0===(t=e).length?H:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)})(this)},t.prototype.toPromise=function(t){var e=this;return new(t=B(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function B(t){var e;return null!==(e=null!=t?t:I.Promise)&&void 0!==e?e:Promise}function X(t){return x(null==t?void 0:t.lift)}function G(t){return function(e){if(X(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")}}function J(t,e,n,r,i){return new Z(t,e,n,r,i)}var Z=function(t){function e(e,n,r,i,o,u){var c=t.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=u,c._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,c._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,c}return n(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(q);!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,X(e)&&(r.lift=e.lift),r}n(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new T;var n=this.getSubject();e.add(this.source.subscribe(J(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=T.EMPTY)}return e},e.prototype.refCount=function(){return G((function(t,e){var n=null;t._refCount++;var r=J(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())}))(this)}}(W);var $,K={now:function(){return(K.delegate||performance).now()},delegate:void 0},Q={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new T((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Q.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,l([],c(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,l([],c(t)))},delegate:void 0};new W((function(t){var e=$||K,n=e.now(),r=0,i=function(){t.closed||(r=Q.requestAnimationFrame((function(o){r=0;var u=e.now();t.next({timestamp:$?u:o,elapsed:u-n}),i()})))};return i(),function(){r&&Q.cancelAnimationFrame(r)}}));var tt=k((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),et=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return n(e,t),e.prototype.lift=function(t){var e=new nt(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new tt},e.prototype.next=function(t){var e=this;M((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=u(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;M((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;M((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?O:(this.currentObservers=null,o.push(t),new T((function(){e.currentObservers=null,S(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new W;return t.source=this,t},e.create=function(t,e){return new nt(t,e)},e}(W),nt=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return n(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:O},e}(et);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}n(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(et);var rt={now:function(){return(rt.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=rt);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}n(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,u=n._timestampProvider,c=n._windowTime;r||(i.push(e),!o&&i.push(u.now()+c)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var u=n.now(),c=0,l=1;l<r.length&&r[l]<=u;l+=2)c=l;c&&r.splice(0,c+1)}}}(et),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}n(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,u=e.isStopped,c=e._isComplete;n?t.error(o):(u||c)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(et);var it,ot=function(t){function e(e,n){return t.call(this)||this}return n(e,t),e.prototype.schedule=function(t,e){return this},e}(T),ut=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,l([t,e],c(n)))},ct=function(t){return clearInterval(t)},lt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return n(e,t),e.prototype.schedule=function(t,e){var n;if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),ut(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;null!=e&&ct(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,S(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(ot),st=1,at={};function ft(t){return t in at&&(delete at[t],!0)}var dt=function(t){var e=st++;return at[e]=!0,it||(it=Promise.resolve()),it.then((function(){return ft(e)&&t()})),e},pt=function(t){ft(t)},vt={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=vt.delegate;return((null==n?void 0:n.setImmediate)||dt).apply(void 0,l([],c(t)))},clearImmediate:function(t){return pt(t)},delegate:void 0},ht=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=vt.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(vt.clearImmediate(n),e._scheduled===n&&(e._scheduled=void 0))},e}(lt),bt=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=rt.now,t}(),yt=function(t){function e(e,n){void 0===n&&(n=bt.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r}return n(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(bt),mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(yt);new mt(ht);var gt=new yt(lt),wt=gt,_t=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.flush(this),0)},e}(lt),At=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(yt);new At(_t);var xt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=Q.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&n===e._scheduled&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(Q.cancelAnimationFrame(n),e._scheduled=void 0)},e}(lt),kt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){var e;this._active=!0,t?e=t.id:(e=this._scheduled,this._scheduled=void 0);var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(yt);new kt(xt),function(t){function e(e,n){void 0===e&&(e=Et),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}n(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(yt);var Et=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return n(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return T.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(lt),St=new W((function(t){return t.complete()}));function Tt(t){return t&&x(t.schedule)}function Ot(t){return t[t.length-1]}function Ct(t){return Tt(Ot(t))?t.pop():void 0}var Pt=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function It(t){return x(null==t?void 0:t.then)}function jt(t){return x(t[U])}function Nt(t){return Symbol.asyncIterator&&x(null==t?void 0:t[Symbol.asyncIterator])}function Lt(t){return new TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var Mt,qt="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Ft(t){return x(null==t?void 0:t[qt])}function Rt(t){return a(this,arguments,(function(){var e,n,r;return o(this,(function(i){switch(i.label){case 0:e=t.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,s(e.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,s(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,s(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))}function Dt(t){return x(null==t?void 0:t.getReader)}function zt(t){if(t instanceof W)return t;if(null!=t){if(jt(t))return i=t,new W((function(t){var e=i[U]();if(x(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Pt(t))return r=t,new W((function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()}));if(It(t))return n=t,new W((function(t){n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,N)}));if(Nt(t))return Vt(t);if(Ft(t))return e=t,new W((function(t){var n,r;try{for(var i=u(e),o=i.next();!o.done;o=i.next()){var c=o.value;if(t.next(c),t.closed)return}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()}));if(Dt(t))return Vt(Rt(t))}var e,n,r,i;throw Lt(t)}function Vt(t){return new W((function(e){(function(t,e){var n,r,u,c;return i(this,void 0,void 0,(function(){var i,l;return o(this,(function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),n=f(t),o.label=1;case 1:return[4,n.next()];case 2:if((r=o.sent()).done)return[3,4];if(i=r.value,e.next(i),e.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=o.sent(),u={error:l},[3,11];case 6:return o.trys.push([6,,9,10]),r&&!r.done&&(c=n.return)?[4,c.call(n)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(u)throw u.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}}))}))})(t,e).catch((function(t){return e.error(t)}))}))}function Yt(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=e.schedule((function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()}),r);if(t.add(o),!i)return o}function Ut(t,e){return void 0===e&&(e=0),G((function(n,r){n.subscribe(J(r,(function(n){return Yt(r,t,(function(){return r.next(n)}),e)}),(function(){return Yt(r,t,(function(){return r.complete()}),e)}),(function(n){return Yt(r,t,(function(){return r.error(n)}),e)})))}))}function Ht(t,e){return void 0===e&&(e=0),G((function(n,r){r.add(t.schedule((function(){return n.subscribe(r)}),e))}))}function Wt(t,e){if(!t)throw new Error("Iterable cannot be null");return new W((function(n){Yt(n,e,(function(){var r=t[Symbol.asyncIterator]();Yt(n,e,(function(){r.next().then((function(t){t.done?n.complete():n.next(t.value)}))}),0,!0)}))}))}function Bt(t,e){if(null!=t){if(jt(t))return function(t,e){return zt(t).pipe(Ht(e),Ut(e))}(t,e);if(Pt(t))return function(t,e){return new W((function(n){var r=0;return e.schedule((function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())}))}))}(t,e);if(It(t))return function(t,e){return zt(t).pipe(Ht(e),Ut(e))}(t,e);if(Nt(t))return Wt(t,e);if(Ft(t))return function(t,e){return new W((function(n){var r;return Yt(n,e,(function(){r=t[qt](),Yt(n,e,(function(){var t,e,i;try{e=(t=r.next()).value,i=t.done}catch(t){return void n.error(t)}i?n.complete():n.next(e)}),0,!0)})),function(){return x(null==r?void 0:r.return)&&r.return()}}))}(t,e);if(Dt(t))return function(t,e){return Wt(Rt(t),e)}(t,e)}throw Lt(t)}function Xt(t,e){return e?Bt(t,e):zt(t)}function Gt(t){return t instanceof Date&&!isNaN(t)}!function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(Mt||(Mt={})),k((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),k((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),k((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),k((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}));var Jt=k((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}));function Zt(t){throw new Jt(t)}function $t(t,e){return G((function(n,r){var i=0;n.subscribe(J(r,(function(n){r.next(t.call(e,n,i++))})))}))}var Kt=Array.isArray;function Qt(t){return $t((function(e){return function(t,e){return Kt(e)?t.apply(void 0,l([],c(e))):t(e)}(t,e)}))}function te(t,e,n){return void 0===n&&(n=1/0),x(e)?te((function(n,r){return $t((function(t,i){return e(n,t,r,i)}))(zt(t(n,r)))}),n):("number"==typeof e&&(n=e),G((function(e,r){return function(t,e,n,r,i,o,u,c){var l=[],s=0,a=0,f=!1,d=function(){!f||l.length||s||e.complete()},p=function(t){return s<r?v(t):l.push(t)},v=function(t){o&&e.next(t),s++;var c=!1;zt(n(t,a++)).subscribe(J(e,(function(t){null==i||i(t),o?p(t):e.next(t)}),(function(){c=!0}),void 0,(function(){if(c)try{s--;for(var t=function(){var t=l.shift();u?Yt(e,u,(function(){return v(t)})):v(t)};l.length&&s<r;)t();d()}catch(t){e.error(t)}})))};return t.subscribe(J(e,p,(function(){f=!0,d()}))),function(){null==c||c()}}(e,r,t,n)})))}function ee(t){return void 0===t&&(t=1/0),te(H,t)}function ne(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ee(1)(Xt(t,Ct(t)))}var re=["addListener","removeListener"],ie=["addEventListener","removeEventListener"],oe=["on","off"];function ue(t,e,n,r){if(x(n)&&(r=n,n=void 0),r)return ue(t,e,n).pipe(Qt(r));var i=c(function(t){return x(t.addEventListener)&&x(t.removeEventListener)}(t)?ie.map((function(r){return function(i){return t[r](e,i,n)}})):function(t){return x(t.addListener)&&x(t.removeListener)}(t)?re.map(ce(t,e)):function(t){return x(t.on)&&x(t.off)}(t)?oe.map(ce(t,e)):[],2),o=i[0],u=i[1];if(!o&&Pt(t))return te((function(t){return ue(t,e,n)}))(zt(t));if(!o)throw new TypeError("Invalid event target");return new W((function(t){var e=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1<e.length?e:e[0])};return o(e),function(){return u(e)}}))}function ce(t,e){return function(n){return function(r){return t[n](e,r)}}}function le(t,e,n){void 0===t&&(t=0),void 0===n&&(n=wt);var r=-1;return null!=e&&(Tt(e)?n=e:r=e),new W((function(e){var i=Gt(t)?+t-n.now():t;i<0&&(i=0);var o=0;return n.schedule((function(){e.closed||(e.next(o++),0<=r?this.schedule(void 0,r):e.complete())}),i)}))}function se(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ct(t),r=function(t,e){return"number"==typeof Ot(t)?t.pop():e}(t,1/0),i=t;return i.length?1===i.length?zt(i[0]):ee(r)(Xt(i,n)):St}new W(L);var ae=Array.isArray;function fe(t,e){return G((function(n,r){var i=0;n.subscribe(J(r,(function(n){return t.call(e,n,i++)&&r.next(n)})))}))}function de(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===(e=1===(t=e).length&&ae(t[0])?t[0]:t).length?zt(e[0]):new W(function(t){return function(e){for(var n=[],r=function(r){n.push(zt(t[r]).subscribe(J(e,(function(t){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}e.next(t)}))))},i=0;n&&!e.closed&&i<t.length;i++)r(i)}}(e))}function pe(t){return t<=0?function(){return St}:G((function(e,n){var r=0;e.subscribe(J(n,(function(e){++r<=t&&(n.next(e),t<=r&&n.complete())})))}))}function ve(t,e){return e?function(n){return ne(e.pipe(pe(1),G((function(t,e){t.subscribe(J(e,L))}))),n.pipe(ve(t)))}:te((function(e,n){return zt(t(e,n)).pipe(pe(1),function(t){return $t((function(){return t}))}(e))}))}function he(t){void 0===t&&(t={});var e=t.connector,n=void 0===e?function(){return new et}:e,r=t.resetOnError,i=void 0===r||r,o=t.resetOnComplete,u=void 0===o||o,c=t.resetOnRefCountZero,l=void 0===c||c;return function(t){var e,r,o,c=0,s=!1,a=!1,f=function(){null==r||r.unsubscribe(),r=void 0},d=function(){f(),e=o=void 0,s=a=!1},p=function(){var t=e;d(),null==t||t.unsubscribe()};return G((function(t,v){c++,a||s||f();var h=o=null!=o?o:n();v.add((function(){0!==--c||a||s||(r=be(p,l))})),h.subscribe(v),!e&&c>0&&(e=new z({next:function(t){return h.next(t)},error:function(t){a=!0,f(),r=be(d,i,t),h.error(t)},complete:function(){s=!0,f(),r=be(d,u),h.complete()}}),zt(t).subscribe(e))}))(t)}}function be(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0!==e){if(!1!==e){var i=new z({next:function(){i.unsubscribe(),t()}});return zt(e.apply(void 0,l([],c(n)))).subscribe(i)}}else t()}function ye(t,e,n){void 0===e&&(e=gt);var r=le(t,e);return function(t,e){return G((function(n,r){var i=null!=e?e:{},o=i.leading,u=void 0===o||o,c=i.trailing,l=void 0!==c&&c,s=!1,a=null,f=null,d=!1,p=function(){null==f||f.unsubscribe(),f=null,l&&(b(),d&&r.complete())},v=function(){f=null,d&&r.complete()},h=function(e){return f=zt(t(e)).subscribe(J(r,p,v))},b=function(){if(s){s=!1;var t=a;a=null,r.next(t),!d&&h(t)}};n.subscribe(J(r,(function(t){s=!0,a=t,(!f||f.closed)&&(u?b():h(t))}),(function(){d=!0,(!(l&&s&&f)||f.closed)&&r.complete()})))}))}((function(){return r}),n)}var me=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],ge=["type"],we=["svg","path","g"],_e=["password","hidden"];var Ae=function(t){var e;return t?(e=function(t,e){for(var n=0,r=0;r<t.length;r++){var i=t[r];if(null===i)n+=4;else{var o=xe(i);n+=o?Array.from(o).length:4}if(n>e)return t.slice(0,r)}return t}(function(t){var e=[];if(!t)return e;e.push(t);for(var n=t.parentElement;n&&"HTML"!==n.tagName;)e.push(n),n=n.parentElement;return e}(t).map((function(t){return function(t){var e,n,r,i,o,c;if(null===t)return null;var l=String(t.tagName).toLowerCase(),s={tag:l},a=Array.from(null!==(i=null===(r=t.parentElement)||void 0===r?void 0:r.children)&&void 0!==i?i:[]);a.length&&(s.index=a.indexOf(t),s.indexOfType=a.filter((function(e){return e.tagName===t.tagName})).indexOf(t));var f=null===(c=null===(o=t.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===c?void 0:c.toLowerCase();f&&(s.prevSib=String(f));var d=t.getAttribute("id");d&&(s.id=String(d));var p=Array.from(t.classList);p.length&&(s.classes=p);var v={},h=Array.from(t.attributes).filter((function(t){return!me.includes(t.name)})),b=!Oe(t);if(!_e.includes(String(t.getAttribute("type")))&&!we.includes(l))try{for(var y=u(h),m=y.next();!m.done;m=y.next()){var g=m.value;b&&!ge.includes(g.name)||(v[g.name]=String(g.value).substring(0,128))}}catch(t){e={error:t}}finally{try{m&&!m.done&&(n=y.return)&&n.call(y)}finally{if(e)throw e.error}}return Object.keys(v).length&&(s.attrs=v),s}(t)})),1024),e):[]};function xe(t,e){void 0===e&&(e=!1);try{if(null==t)return e?"None":null;if("string"==typeof t)return e?(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")).includes('"')?"'".concat(t,"'"):t.includes("'")?'"'.concat(t.replace(/'/g,"\\'"),'"'):"'".concat(t,"'"):t;if("boolean"==typeof t)return t?"True":"False";if(Array.isArray(t)){var n=t.map((function(t){return xe(t,!0)}));return"[".concat(n.join(", "),"]")}if("object"==typeof t){var r=Object.entries(t).filter((function(t){return null!=c(t,1)[0]})).map((function(t){var e=c(t,2),n=e[0],r=e[1];return"".concat(String(xe(n,!0)),": ").concat(String(xe(r,!0)))})),i="{".concat(r.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return t.toString()}catch(t){return null}}var ke=["input","select","textarea"],Ee=function(t,e){var n,r=null===(n=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===n?void 0:n.call(window,t);return"pointer"===(null==r?void 0:r.getPropertyValue("cursor"))&&"click"===e},Se=function(t,e,n){return void 0===n&&(n=!1),function(r,i){var o,u,c=t.pageUrlAllowlist,l=t.shouldTrackEventResolver,s=null===(u=null===(o=null==i?void 0:i.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===u?void 0:u.call(o);if(!s)return!1;if(l)return l(r,i);if(!Pe(window.location.href,c))return!1;var a=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof a)switch(a.toLowerCase()){case"hidden":case"password":return!1}var f=Ee(i,r);if(n&&f)return!0;if(e){var d=e.some((function(t){var e;return!!(null===(e=null==i?void 0:i.matches)||void 0===e?void 0:e.call(i,t))}));if(!d)return!1}switch(s){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:return!!f||"click"===r}}},Te=function(t){if(null==t)return!1;if("string"==typeof t){if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((t||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(t))return!1}return!0},Oe=function(t){var e,n,r,i=null===(n=null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase)||void 0===n?void 0:n.call(e),o=t instanceof HTMLElement&&"true"===(null===(r=t.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!ke.includes(i)&&!o},Ce=function(t){var e="";return Oe(t)&&t.childNodes&&t.childNodes.length&&t.childNodes.forEach((function(t){var n,r="";(n=t)&&3===n.nodeType?t.textContent&&(r=t.textContent):r=Ce(t),e+=r.split(/(\s+)/).filter(Te).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)})),e},Pe=function(t,e){return!e||!e.length||e.some((function(e){return"string"==typeof e?t===e:t.match(e)}))},Ie=function(t){return Object.keys(t).reduce((function(e,n){var r=t[n];return function(t){return null==t||"object"==typeof t&&0===Object.keys(t).length||"string"==typeof t&&0===t.trim().length}(r)||(e[n]=r),e}),{})},je=function(t){var e,n=t.parentElement;if(!n)return"";try{e=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(t){e=null}if(e){var r=e.textContent||"";return Te(r)?r:""}return je(n)},Ne=function(t,e){return t?e.some((function(e){var n;return null===(n=null==t?void 0:t.matches)||void 0===n?void 0:n.call(t,e)}))?t:Ne(null==t?void 0:t.parentElement,e):null},Le=function(t){var e,n,r;if(!t)return{};var i=null===(r=null===(n=null==t?void 0:t.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n),o=((e={})[m]=i,e[g]=Ce(t),e[w]=window.location.href.split("?")[0],e);return Ie(o)};var Me=function(t){return!(null===t.event.target||!t.closestTrackedAncestor)},qe=function(t,e,n){var r,i,o,u=null===(o=null===(i=null==e?void 0:e.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i),c="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{left:null,top:null},l=e.getAttribute("aria-label"),s=function(t,e){return t.getAttributeNames().reduce((function(n,r){if(r.startsWith(e)){var i=r.replace(e,""),o=t.getAttribute(r);i&&(n[i]=o||"")}return n}),{})}(e,n),a=je(e),f=((r={})["[Amplitude] Element ID"]=e.getAttribute("id")||"",r["[Amplitude] Element Class"]=e.getAttribute("class"),r["[Amplitude] Element Hierarchy"]=Ae(e),r[m]=u,r[g]=Ce(e),r["[Amplitude] Element Position Left"]=null==c.left?null:Math.round(c.left),r["[Amplitude] Element Position Top"]=null==c.top?null:Math.round(c.top),r["[Amplitude] Element Aria Label"]=l,r["[Amplitude] Element Attributes"]=s,r["[Amplitude] Element Parent Label"]=a,r[w]=window.location.href.split("?")[0],r["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",r["[Amplitude] Viewport Height"]=window.innerHeight,r["[Amplitude] Viewport Width"]=window.innerWidth,r);return"a"===u&&"click"===t&&e instanceof HTMLAnchorElement&&(f["[Amplitude] Element Href"]=e.href),Ie(f)},Fe=function(t,e,n,r,i){void 0===i&&(i=!1);var o={event:t,timestamp:Date.now(),type:e};if(function(t){return"click"===t.type||"change"===t.type}(o)&&null!==o.event.target){if(i)if(Ee(o.event.target,o.type))return o.closestTrackedAncestor=o.event.target,o.targetElementProperties=qe(o.type,o.closestTrackedAncestor,r),o;var u=Ne(o.event.target,n);return u&&(o.closestTrackedAncestor=u,o.targetElementProperties=qe(o.type,u,r)),o}return o};var Re=function(){function t(t){var e=(void 0===t?{}:t).origin,n=void 0===e?_:e,r=this;this.endpoint=_,this.requestCallbacks={},this.onSelect=function(t){r.notify({action:"element-selected",data:t})},this.onTrack=function(t,e){"selector-mode-changed"===t?r.notify({action:"track-selector-mode-changed",data:e}):"selector-moved"===t&&r.notify({action:"track-selector-moved",data:e})},this.endpoint=n}return t.prototype.notify=function(t){var e,n,r,i;null===(n=null===(e=this.logger)||void 0===e?void 0:e.debug)||void 0===n||n.call(e,"Message sent: ",JSON.stringify(t)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,t,this.endpoint)},t.prototype.sendRequest=function(t,e,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:t,args:e};return new Promise((function(e,u){r.requestCallbacks[i]={resolve:e,reject:u},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout((function(){u(new Error("".concat(t," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]}),n.timeout)}))},t.prototype.handleResponse=function(t){var e;this.requestCallbacks[t.id]?(this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]):null===(e=this.logger)||void 0===e||e.warn("No callback found for request id: ".concat(t.id))},t.prototype.setup=function(t){var e=this,n=void 0===t?{}:t,r=n.logger,i=n.endpoint,o=n.isElementSelectable,u=n.cssSelectorAllowlist,c=n.actionClickAllowlist;this.logger=r,i&&this.endpoint===_&&(this.endpoint=i);var l=null;window.addEventListener("message",(function(t){var n,r,i,s,a;if(null===(r=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Message received: ",JSON.stringify(t)),e.endpoint===t.origin){var f,d=null==t?void 0:t.data,p=null==d?void 0:d.action;if(p)if("id"in d)null===(s=null===(i=e.logger)||void 0===i?void 0:i.debug)||void 0===s||s.call(i,"Received Response to previous request: ",JSON.stringify(t)),e.handleResponse(d);else if("ping"===p)e.notify({action:"pong"});else if("initialize-visual-tagging-selector"===p){var v=null==d?void 0:d.data;(f="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise((function(t,e){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=f,r.addEventListener("load",(function(){t({status:!0})}),{once:!0}),r.addEventListener("error",(function(){e({status:!1,message:"Failed to load the script ".concat(f)})})),null===(n=document.head)||void 0===n||n.appendChild(r)}catch(t){e(t)}}))).then((function(){var t;l=null===(t=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===t?void 0:t.call(window,{getEventTagProps:Le,isElementSelectable:function(t){return!o||o((null==v?void 0:v.actionType)||"click",t)},onTrack:e.onTrack,onSelect:e.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:u,actionClickAllowlist:c}),e.notify({action:"selector-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===p&&(null===(a=null==l?void 0:l.close)||void 0===a||a.call(l))}})),this.notify({action:"page-loaded"})},t}();function De(t){var e,n,r,i=t.amplitude,o=t.allObservables,l=t.options,s=t.shouldTrackEvent,a=t.evaluateTriggers,f=o.clickObservable,d=f.pipe(G((function(t,e){var n,r=!1;t.subscribe(J(e,(function(t){var i=n;n=t,r&&e.next([i,t]),r=!0})))})),fe((function(t){var e=c(t,2),n=e[0],r=e[1],i=n.event.target!==r.event.target,o=Math.abs(r.event.screenX-n.event.screenX)<=20&&Math.abs(r.event.screenY-n.event.screenY)<=20;return i&&!o}))),p=se(d,f.pipe((e=l.debounceTime,void 0===n&&(n=gt),G((function(t,r){var i=null,o=null,u=null,c=function(){if(i){i.unsubscribe(),i=null;var t=o;o=null,r.next(t)}};function l(){var t=u+e,o=n.now();if(o<t)return i=this.schedule(void 0,t-o),void r.add(i);c()}t.subscribe(J(r,(function(t){o=t,u=n.now(),i||(i=n.schedule(l,e),r.add(i))}),(function(){c(),r.complete()}),void 0,(function(){o=i=null})))}))),$t((function(){return"timeout"})))),v=f.pipe(function(t,e){void 0===e&&(e=gt);var n=le(t,e);return ve((function(){return n}))}(0),fe(Me),fe((function(t){return s("click",t.closestTrackedAncestor)})),$t((function(t){return a(t)})),(r=p,G((function(t,e){var n=[];return t.subscribe(J(e,(function(t){return n.push(t)}),(function(){e.next(n),e.complete()}))),zt(r).subscribe(J(e,(function(){var t=n;n=[],e.next(t)}),L)),function(){n=null}}))));return v.subscribe((function(t){var e,n,r=(t.length,y);try{for(var o=u(t),c=o.next();!c.done;c=o.next()){var l=c.value;null==i||i.track(r,l.targetElementProperties)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}function ze(t){var e=t.amplitude,n=t.allObservables,r=t.options,i=t.getEventProperties,o=t.shouldTrackEvent,u=t.shouldTrackActionClick,s=n.clickObservable,a=n.mutationObservable,f=n.navigateObservable,d=s.pipe(fe((function(t){return!o("click",t.closestTrackedAncestor)})),$t((function(t){var e=Ne(t.event.target,r.actionClickAllowlist);return t.closestTrackedAncestor=e,null!==t.closestTrackedAncestor&&(t.targetElementProperties=i(t.type,t.closestTrackedAncestor)),t})),fe(Me),fe((function(t){return u("click",t.closestTrackedAncestor)}))),p=[a];f&&p.push(f);var v,h,b=se.apply(void 0,l([],c(p),!1)),m=d.pipe((v=function(t){return b.pipe(pe(1),function(t,e){var n=Gt(t)?{first:t}:"number"==typeof t?{each:t}:t,r=n.first,i=n.each,o=n.with,u=void 0===o?Zt:o,c=n.scheduler,l=void 0===c?null!=e?e:gt:c,s=n.meta,a=void 0===s?null:s;if(null==r&&null==i)throw new TypeError("No timeout provided.");return G((function(t,e){var n,o,c=null,s=0,f=function(t){o=Yt(e,l,(function(){try{n.unsubscribe(),zt(u({meta:a,lastValue:c,seen:s})).subscribe(e)}catch(t){e.error(t)}}),t)};n=t.subscribe(J(e,(function(t){null==o||o.unsubscribe(),s++,e.next(c=t),i>0&&f(i)}),void 0,void 0,(function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),c=null}))),!s&&f(null!=r?"number"==typeof r?r:+r-l.now():i)}))}({first:500,with:function(){return St}}),$t((function(){return t})))},G((function(t,e){var n=null,r=0,i=!1,o=function(){return i&&!n&&e.complete()};t.subscribe(J(e,(function(t){null==n||n.unsubscribe();var i=0,u=r++;zt(v(t,u)).subscribe(n=J(e,(function(n){return e.next(h?h(t,n,u,i++):n)}),(function(){n=null,o()})))}),(function(){i=!0,o()})))}))));return m.subscribe((function(t){null==e||e.track(y,i("click",t.closestTrackedAncestor))}))}var Ve,Ye=function(){return new W((function(t){var e=new MutationObserver((function(e){t.next(e)}));return e.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return e.disconnect()}}))},Ue=function(){return ue(document,"click",{capture:!0})},He=function(t,e){return e.filter((function(e){return e.definition.some((function(e){return e.event_type===t.type&&e.filters.every((function(e){return function(t,e){try{if("[Amplitude] Element Text"===e.subprop_key)return"exact"===e.subprop_op&&e.subprop_value.includes(t.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===e.subprop_key)return"autotrack css match"===e.subprop_op&&!!t.closestTrackedAncestor.closest(e.subprop_value.toString())}catch(t){return console.error("Error matching event to filter",t),!1}return!1}(t,e)}))}))}))},We=function(t,e){if("DOM_ELEMENT"===t.sourceType){var n=function(t,e){if("DOM_ELEMENT"===t.sourceType){var n=document.documentElement;return t.scope&&e&&(n=e.closest(t.scope)),n&&t.selector?n.querySelector(t.selector):n}}(t,e);if(!n)return;return"TEXT"===t.elementExtractType?n.textContent:"ATTRIBUTE"===t.elementExtractType&&t.attribute?n.getAttribute(t.attribute):void 0}},Be=function(t,e){t.forEach((function(t){if("string"!=typeof t&&"ATTACH_EVENT_PROPERTY"===t.actionType){var n=We(t.dataSource,e.closestTrackedAncestor);e.targetElementProperties[t.destinationKey]=n}}))};!function(t){t.ClickObservable="clickObservable",t.ChangeObservable="changeObservable",t.NavigateObservable="navigateObservable",t.MutationObservable="mutationObservable"}(Ve||(Ve={}));var Xe=function(t){var e,n,s,a,f,h,b;void 0===t&&(t={});var y=t.dataAttributePrefix,m=void 0===y?p:y,g=t.visualTaggingOptions,w=void 0===g?{enabled:!0,messenger:new Re}:g;t.cssSelectorAllowlist=null!==(e=t.cssSelectorAllowlist)&&void 0!==e?e:d,t.actionClickAllowlist=null!==(n=t.actionClickAllowlist)&&void 0!==n?n:v,t.debounceTime=null!==(s=t.debounceTime)&&void 0!==s?s:0;var _="@amplitude/plugin-autocapture-browser",x=[],k=function(t){var e,n,r,i,o,c={click:new Set,change:new Set};if(!t)return c;try{for(var l=u(t),s=l.next();!s.done;s=l.next()){var a=s.value;try{try{for(var f=(r=void 0,u(a.definition)),d=f.next();!d.done;d=f.next())null===(o=c[d.value.event_type])||void 0===o||o.add(a.id)}catch(t){r={error:t}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}catch(t){console.warn("Skipping Labeled Event due to malformed definition",null==a?void 0:a.id,t)}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}return c}(Object.values(null!==(f=null===(a=t.pageActions)||void 0===a?void 0:a.labeledEvents)&&void 0!==f?f:{})),E=function(t){var e,n,r,i,o=new Map;try{for(var c=u(t),l=c.next();!l.done;l=c.next()){var s=l.value;try{for(var a=(r=void 0,u(s.conditions)),f=a.next();!f.done;f=a.next()){var d=f.value;if("LABELED_EVENT"===d.type){var p=d.match.eventId,v=o.get(p);v||(v=[],o.set(p,v)),v.push(s)}}}catch(t){r={error:t}}finally{try{f&&!f.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}return o}(null!==(b=null===(h=t.pageActions)||void 0===h?void 0:h.triggers)&&void 0!==b?b:[]),S=function(e){var n,r,i=t.pageActions;if(!i)return e;var o=function(t,e){var n,r,i=new Set;try{for(var o=u(t),c=o.next();!c.done;c=o.next()){var l=c.value,s=e.get(l.id);s&&s.forEach((function(t){return i.add(t)}))}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return Array.from(i)}(He(e,Array.from(k[e.type]).map((function(t){return i.labeledEvents[t]}))),E);try{for(var c=u(o),l=c.next();!l.done;l=c.next()){var s=l.value;Be(s.actions,e)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return e};return{name:_,type:"enrichment",setup:function(e,n){return i(void 0,void 0,void 0,(function(){var i,u,s,a,f,d,p,v,h,b;return o(this,(function(o){return"undefined"==typeof document||(i=Se(t,t.cssSelectorAllowlist),u=Se(t,t.actionClickAllowlist),s=function(){var e,n,r=Ue().pipe($t((function(e){return Fe(e,"click",t.cssSelectorAllowlist,m)})),he()),i=ue(document,"change",{capture:!0}).pipe($t((function(e){return Fe(e,"change",t.cssSelectorAllowlist,m)})),he());window.navigation&&(n=ue(window.navigation,"navigate").pipe($t((function(e){return Fe(e,"navigate",t.cssSelectorAllowlist,m)})),he()));var o=Ye().pipe($t((function(e){return Fe(e,"mutation",t.cssSelectorAllowlist,m)})),he());return(e={})[Ve.ClickObservable]=r,e[Ve.ChangeObservable]=i,e[Ve.NavigateObservable]=n,e[Ve.MutationObservable]=o,e}(),a=De({allObservables:s,options:t,amplitude:n,shouldTrackEvent:i,evaluateTriggers:S}),x.push(a),f=function(t){var e=t.amplitude,n=t.allObservables,r=t.getEventProperties,i=t.shouldTrackEvent,o=t.evaluateTriggers;return n.changeObservable.pipe(fe(Me),fe((function(t){return i("change",t.closestTrackedAncestor)})),$t((function(t){return o(t)}))).subscribe((function(t){null==e||e.track("[Amplitude] Element Changed",r("change",t.closestTrackedAncestor))}))}({allObservables:s,getEventProperties:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return qe.apply(void 0,l(l([],c(t),!1),[m],!1))},amplitude:n,shouldTrackEvent:i,evaluateTriggers:S}),x.push(f),d=ze({allObservables:s,options:t,getEventProperties:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return qe.apply(void 0,l(l([],c(t),!1),[m],!1))},amplitude:n,shouldTrackEvent:i,shouldTrackActionClick:u}),x.push(d),null===(h=null==e?void 0:e.loggerProvider)||void 0===h||h.log("".concat(_," has been successfully added.")),window.opener&&w.enabled&&(p=t.cssSelectorAllowlist,v=t.actionClickAllowlist,null===(b=w.messenger)||void 0===b||b.setup(r(r({logger:null==e?void 0:e.loggerProvider},(null==e?void 0:e.serverZone)&&{endpoint:A[e.serverZone]}),{isElementSelectable:Se(t,l(l([],c(p),!1),c(v),!1)),cssSelectorAllowlist:p,actionClickAllowlist:v})))),[2]}))}))},execute:function(t){return i(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,t]}))}))},teardown:function(){return i(void 0,void 0,void 0,(function(){var t,e,n,r;return o(this,(function(i){try{for(t=u(x),e=t.next();!e.done;e=t.next())e.value.unsubscribe()}catch(t){n={error:t}}finally{try{e&&!e.done&&(r=t.return)&&r.call(t)}finally{if(n)throw n.error}}return[2]}))}))}}};return t.WindowMessenger=Re,t.autocapturePlugin=Xe,t.frustrationPlugin=function(t){var e,n,s,a,f,d="@amplitude/plugin-frustration-browser",v=[],y=null!==(n=null===(e=t.rageClicks)||void 0===e?void 0:e.cssSelectorAllowlist)&&void 0!==n?n:b,m=null!==(a=null===(s=t.deadClicks)||void 0===s?void 0:s.cssSelectorAllowlist)&&void 0!==a?a:h,g=null!==(f=t.dataAttributePrefix)&&void 0!==f?f:p,w=l([],c(new Set(l(l([],c(y),!1),c(m),!1))),!1);return{name:d,type:"enrichment",setup:function(e,n){return i(void 0,void 0,void 0,(function(){var i,u,s,a,f,p;return o(this,(function(o){return"undefined"==typeof document||(i=Se(t,y),u=Se(t,m),s=function(){var t,e,n=Ue().pipe($t((function(t){return Fe(t,"click",w,g,!0)})),he());window.navigation&&(e=ue(window.navigation,"navigate").pipe($t((function(t){return Fe(t,"navigate",w,g)})),he()));var r=Ye().pipe($t((function(t){return Fe(t,"mutation",w,g)})),he());return(t={})[Ve.ClickObservable]=n,t[Ve.ChangeObservable]=new W,t[Ve.NavigateObservable]=e,t[Ve.MutationObservable]=r,t}(),a=function(t){var e=t.amplitude,n=t.allObservables,i=t.shouldTrackRageClick,o=n.clickObservable,u=[];return o.pipe(fe(Me),fe((function(t){return i("click",t.closestTrackedAncestor)})),$t((function(t){var e=t.timestamp;u.length>0&&u[u.length-1].closestTrackedAncestor!==t.closestTrackedAncestor&&u.splice(0,u.length);for(var n=0;n<u.length&&!(e-u[n].timestamp<1e3);n++);if(u.splice(0,n),u.push(t),u.length<4)return null;var i=u[0],o=u[u.length-1],c=r({"[Amplitude] Begin Time":new Date(i.timestamp).toISOString(),"[Amplitude] End Time":new Date(o.timestamp).toISOString(),"[Amplitude] Duration":o.timestamp-i.timestamp,"[Amplitude] Clicks":u.map((function(t){return{X:t.event.clientX,Y:t.event.clientY,Time:t.timestamp}})),"[Amplitude] Click Count":u.length},i.targetElementProperties);return u.splice(0,u.length),{rageClickEvent:c,time:i.timestamp}})),fe((function(t){return null!==t}))).subscribe((function(t){null!==t&&e.track("[Amplitude] Rage Click",t.rageClickEvent,{time:t.time})}))}({allObservables:s,amplitude:n,shouldTrackRageClick:i}),v.push(a),f=function(t){var e=t.amplitude,n=t.allObservables,i=t.getEventProperties,o=t.shouldTrackDeadClick,u=n.clickObservable,s=n.mutationObservable,a=n.navigateObservable,f=u.pipe(fe(Me),fe((function(t){return o("click",t.closestTrackedAncestor)}))),d=[s];a&&d.push(a);var p=se.apply(void 0,l([],c(d),!1));return f.pipe(te((function(t){var e;return de(new W((function(n){return e=setTimeout((function(){return n.next(t)}),3e3),function(){clearTimeout(e)}})),p.pipe(pe(1),$t((function(){return null})))).pipe(fe((function(t){return null!==t})))})),ye(3e3)).subscribe((function(t){var n={"[Amplitude] X":t.event.clientX,"[Amplitude] Y":t.event.clientY};e.track("[Amplitude] Dead Click",r(r({},i("click",t.closestTrackedAncestor)),n),{time:t.timestamp})}))}({amplitude:n,allObservables:s,getEventProperties:function(t,e){return qe(t,e,g)},shouldTrackDeadClick:u}),v.push(f),null===(p=null==e?void 0:e.loggerProvider)||void 0===p||p.log("".concat(d," has been successfully added."))),[2]}))}))},execute:function(t){return i(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,t]}))}))},teardown:function(){return i(void 0,void 0,void 0,(function(){var t,e,n,r;return o(this,(function(i){try{for(t=u(v),e=t.next();!e.done;e=t.next())e.value.unsubscribe()}catch(t){n={error:t}}finally{try{e&&!e.done&&(r=t.return)&&r.call(t)}finally{if(n)throw n.error}}return[2]}))}))}}},t.plugin=Xe,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|
|
1
|
+
var amplitudeAutocapturePlugin=function(t){"use strict";var e=function(t,n){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n])},e(t,n)};function n(t,n){if("function"!=typeof n&&null!==n)throw new TypeError("Class extends value "+String(n)+" is not a constructor or null");function r(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(r.prototype=n.prototype,new r)}var r=function(){return r=Object.assign||function(t){for(var e,n=1,r=arguments.length;n<r;n++)for(var i in e=arguments[n])Object.prototype.hasOwnProperty.call(e,i)&&(t[i]=e[i]);return t},r.apply(this,arguments)};function i(t,e,n,r){return new(n||(n=Promise))((function(i,o){function u(t){try{l(r.next(t))}catch(t){o(t)}}function c(t){try{l(r.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n((function(t){t(e)}))).then(u,c)}l((r=r.apply(t,e||[])).next())}))}function o(t,e){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},u=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return u.next=c(0),u.throw=c(1),u.return=c(2),"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(c){return function(l){return function(c){if(n)throw new TypeError("Generator is already executing.");for(;u&&(u=0,c[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&c[0]?r.return:c[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,c[1])).done)return i;switch(r=0,i&&(c=[2&c[0],i.value]),c[0]){case 0:case 1:i=c;break;case 4:return o.label++,{value:c[1],done:!1};case 5:o.label++,r=c[1],c=[0];continue;case 7:c=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==c[0]&&2!==c[0])){o=0;continue}if(3===c[0]&&(!i||c[1]>i[0]&&c[1]<i[3])){o.label=c[1];break}if(6===c[0]&&o.label<i[1]){o.label=i[1],i=c;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(c);break}i[2]&&o.ops.pop(),o.trys.pop();continue}c=e.call(t,o)}catch(t){c=[6,t],r=0}finally{n=i=0}if(5&c[0])throw c[1];return{value:c[0]?c[1]:void 0,done:!0}}([c,l])}}}function u(t){var e="function"==typeof Symbol&&Symbol.iterator,n=e&&t[e],r=0;if(n)return n.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&r>=t.length&&(t=void 0),{value:t&&t[r++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function c(t,e){var n="function"==typeof Symbol&&t[Symbol.iterator];if(!n)return t;var r,i,o=n.call(t),u=[];try{for(;(void 0===e||e-- >0)&&!(r=o.next()).done;)u.push(r.value)}catch(t){i={error:t}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return u}function l(t,e,n){if(n||2===arguments.length)for(var r,i=0,o=e.length;i<o;i++)!r&&i in e||(r||(r=Array.prototype.slice.call(e,0,i)),r[i]=e[i]);return t.concat(r||Array.prototype.slice.call(e))}function s(t){return this instanceof s?(this.v=t,this):new s(t)}function a(t,e,n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,i=n.apply(t,e||[]),o=[];return r=Object.create(("function"==typeof AsyncIterator?AsyncIterator:Object).prototype),u("next"),u("throw"),u("return",(function(t){return function(e){return Promise.resolve(e).then(t,a)}})),r[Symbol.asyncIterator]=function(){return this},r;function u(t,e){i[t]&&(r[t]=function(e){return new Promise((function(n,r){o.push([t,e,n,r])>1||c(t,e)}))},e&&(r[t]=e(r[t])))}function c(t,e){try{(n=i[t](e)).value instanceof s?Promise.resolve(n.value.v).then(l,a):f(o[0][2],n)}catch(t){f(o[0][3],t)}var n}function l(t){c("next",t)}function a(t){c("throw",t)}function f(t,e){t(e),o.shift(),o.length&&c(o[0][0],o[0][1])}}function f(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e,n=t[Symbol.asyncIterator];return n?n.call(t):(t=u(t),e={},r("next"),r("throw"),r("return"),e[Symbol.asyncIterator]=function(){return this},e);function r(n){e[n]=t[n]&&function(e){return new Promise((function(r,i){(function(t,e,n,r){Promise.resolve(r).then((function(e){t({value:e,done:n})}),e)})(r,i,(e=t[n](e)).done,e.value)}))}}}"function"==typeof SuppressedError&&SuppressedError;var d=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],p="data-amp-track-",v=["div","span","h1","h2","h3","h4","h5","h6"],h=l(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],c(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),b=["*"],y="[Amplitude] Element Clicked",m="[Amplitude] Element Tag",g="[Amplitude] Element Text",w="[Amplitude] Page URL",_="https://app.amplitude.com",A={US:_,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};function x(t){return"function"==typeof t}function k(t){var e=t((function(t){Error.call(t),t.stack=(new Error).stack}));return e.prototype=Object.create(Error.prototype),e.prototype.constructor=e,e}var E=k((function(t){return function(e){t(this),this.message=e?e.length+" errors occurred during unsubscription:\n"+e.map((function(t,e){return e+1+") "+t.toString()})).join("\n "):"",this.name="UnsubscriptionError",this.errors=e}}));function S(t,e){if(t){var n=t.indexOf(e);0<=n&&t.splice(n,1)}}var T=function(){function t(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}var e;return t.prototype.unsubscribe=function(){var t,e,n,r,i;if(!this.closed){this.closed=!0;var o=this._parentage;if(o)if(this._parentage=null,Array.isArray(o))try{for(var s=u(o),a=s.next();!a.done;a=s.next()){a.value.remove(this)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=s.return)&&e.call(s)}finally{if(t)throw t.error}}else o.remove(this);var f=this.initialTeardown;if(x(f))try{f()}catch(t){i=t instanceof E?t.errors:[t]}var d=this._finalizers;if(d){this._finalizers=null;try{for(var p=u(d),v=p.next();!v.done;v=p.next()){var h=v.value;try{P(h)}catch(t){i=null!=i?i:[],t instanceof E?i=l(l([],c(i)),c(t.errors)):i.push(t)}}}catch(t){n={error:t}}finally{try{v&&!v.done&&(r=p.return)&&r.call(p)}finally{if(n)throw n.error}}}if(i)throw new E(i)}},t.prototype.add=function(e){var n;if(e&&e!==this)if(this.closed)P(e);else{if(e instanceof t){if(e.closed||e._hasParent(this))return;e._addParent(this)}(this._finalizers=null!==(n=this._finalizers)&&void 0!==n?n:[]).push(e)}},t.prototype._hasParent=function(t){var e=this._parentage;return e===t||Array.isArray(e)&&e.includes(t)},t.prototype._addParent=function(t){var e=this._parentage;this._parentage=Array.isArray(e)?(e.push(t),e):e?[e,t]:t},t.prototype._removeParent=function(t){var e=this._parentage;e===t?this._parentage=null:Array.isArray(e)&&S(e,t)},t.prototype.remove=function(e){var n=this._finalizers;n&&S(n,e),e instanceof t&&e._removeParent(this)},t.EMPTY=((e=new t).closed=!0,e),t}(),O=T.EMPTY;function C(t){return t instanceof T||t&&"closed"in t&&x(t.remove)&&x(t.add)&&x(t.unsubscribe)}function P(t){x(t)?t():t.unsubscribe()}var I={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1},j=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setTimeout.apply(void 0,l([t,e],c(n)))};function N(t){j((function(){throw t}))}function L(){}function M(t){t()}var q=function(t){function e(e){var n=t.call(this)||this;return n.isStopped=!1,e?(n.destination=e,C(e)&&e.add(n)):n.destination=Y,n}return n(e,t),e.create=function(t,e,n){return new z(t,e,n)},e.prototype.next=function(t){this.isStopped||this._next(t)},e.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},e.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},e.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,t.prototype.unsubscribe.call(this),this.destination=null)},e.prototype._next=function(t){this.destination.next(t)},e.prototype._error=function(t){try{this.destination.error(t)}finally{this.unsubscribe()}},e.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},e}(T),F=Function.prototype.bind;function R(t,e){return F.call(t,e)}var D=function(){function t(t){this.partialObserver=t}return t.prototype.next=function(t){var e=this.partialObserver;if(e.next)try{e.next(t)}catch(t){V(t)}},t.prototype.error=function(t){var e=this.partialObserver;if(e.error)try{e.error(t)}catch(t){V(t)}else V(t)},t.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(t){V(t)}},t}(),z=function(t){function e(e,n,r){var i,o,u=t.call(this)||this;x(e)||!e?i={next:null!=e?e:void 0,error:null!=n?n:void 0,complete:null!=r?r:void 0}:u&&I.useDeprecatedNextContext?((o=Object.create(e)).unsubscribe=function(){return u.unsubscribe()},i={next:e.next&&R(e.next,o),error:e.error&&R(e.error,o),complete:e.complete&&R(e.complete,o)}):i=e;return u.destination=new D(i),u}return n(e,t),e}(q);function V(t){N(t)}var Y={closed:!0,next:L,error:function(t){throw t},complete:L},U="function"==typeof Symbol&&Symbol.observable||"@@observable";function H(t){return t}var W=function(){function t(t){t&&(this._subscribe=t)}return t.prototype.lift=function(e){var n=new t;return n.source=this,n.operator=e,n},t.prototype.subscribe=function(t,e,n){var r,i=this,o=(r=t)&&r instanceof q||function(t){return t&&x(t.next)&&x(t.error)&&x(t.complete)}(r)&&C(r)?t:new z(t,e,n);return M((function(){var t=i,e=t.operator,n=t.source;o.add(e?e.call(o,n):n?i._subscribe(o):i._trySubscribe(o))})),o},t.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.error(e)}},t.prototype.forEach=function(t,e){var n=this;return new(e=B(e))((function(e,r){var i=new z({next:function(e){try{t(e)}catch(t){r(t),i.unsubscribe()}},error:r,complete:e});n.subscribe(i)}))},t.prototype._subscribe=function(t){var e;return null===(e=this.source)||void 0===e?void 0:e.subscribe(t)},t.prototype[U]=function(){return this},t.prototype.pipe=function(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return(0===(t=e).length?H:1===t.length?t[0]:function(e){return t.reduce((function(t,e){return e(t)}),e)})(this)},t.prototype.toPromise=function(t){var e=this;return new(t=B(t))((function(t,n){var r;e.subscribe((function(t){return r=t}),(function(t){return n(t)}),(function(){return t(r)}))}))},t.create=function(e){return new t(e)},t}();function B(t){var e;return null!==(e=null!=t?t:I.Promise)&&void 0!==e?e:Promise}function X(t){return x(null==t?void 0:t.lift)}function G(t){return function(e){if(X(e))return e.lift((function(e){try{return t(e,this)}catch(t){this.error(t)}}));throw new TypeError("Unable to lift unknown Observable type")}}function J(t,e,n,r,i){return new Z(t,e,n,r,i)}var Z=function(t){function e(e,n,r,i,o,u){var c=t.call(this,e)||this;return c.onFinalize=o,c.shouldUnsubscribe=u,c._next=n?function(t){try{n(t)}catch(t){e.error(t)}}:t.prototype._next,c._error=i?function(t){try{i(t)}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._error,c._complete=r?function(){try{r()}catch(t){e.error(t)}finally{this.unsubscribe()}}:t.prototype._complete,c}return n(e,t),e.prototype.unsubscribe=function(){var e;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;t.prototype.unsubscribe.call(this),!n&&(null===(e=this.onFinalize)||void 0===e||e.call(this))}},e}(q);!function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._subject=null,r._refCount=0,r._connection=null,X(e)&&(r.lift=e.lift),r}n(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype._teardown=function(){this._refCount=0;var t=this._connection;this._subject=this._connection=null,null==t||t.unsubscribe()},e.prototype.connect=function(){var t=this,e=this._connection;if(!e){e=this._connection=new T;var n=this.getSubject();e.add(this.source.subscribe(J(n,void 0,(function(){t._teardown(),n.complete()}),(function(e){t._teardown(),n.error(e)}),(function(){return t._teardown()})))),e.closed&&(this._connection=null,e=T.EMPTY)}return e},e.prototype.refCount=function(){return G((function(t,e){var n=null;t._refCount++;var r=J(e,void 0,void 0,void 0,(function(){if(!t||t._refCount<=0||0<--t._refCount)n=null;else{var r=t._connection,i=n;n=null,!r||i&&r!==i||r.unsubscribe(),e.unsubscribe()}}));t.subscribe(r),r.closed||(n=t.connect())}))(this)}}(W);var $,K={now:function(){return(K.delegate||performance).now()},delegate:void 0},Q={schedule:function(t){var e=requestAnimationFrame,n=cancelAnimationFrame,r=e((function(e){n=void 0,t(e)}));return new T((function(){return null==n?void 0:n(r)}))},requestAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Q.delegate;return((null==n?void 0:n.requestAnimationFrame)||requestAnimationFrame).apply(void 0,l([],c(t)))},cancelAnimationFrame:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return cancelAnimationFrame.apply(void 0,l([],c(t)))},delegate:void 0};new W((function(t){var e=$||K,n=e.now(),r=0,i=function(){t.closed||(r=Q.requestAnimationFrame((function(o){r=0;var u=e.now();t.next({timestamp:$?u:o,elapsed:u-n}),i()})))};return i(),function(){r&&Q.cancelAnimationFrame(r)}}));var tt=k((function(t){return function(){t(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}})),et=function(t){function e(){var e=t.call(this)||this;return e.closed=!1,e.currentObservers=null,e.observers=[],e.isStopped=!1,e.hasError=!1,e.thrownError=null,e}return n(e,t),e.prototype.lift=function(t){var e=new nt(this,this);return e.operator=t,e},e.prototype._throwIfClosed=function(){if(this.closed)throw new tt},e.prototype.next=function(t){var e=this;M((function(){var n,r;if(e._throwIfClosed(),!e.isStopped){e.currentObservers||(e.currentObservers=Array.from(e.observers));try{for(var i=u(e.currentObservers),o=i.next();!o.done;o=i.next()){o.value.next(t)}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}}}))},e.prototype.error=function(t){var e=this;M((function(){if(e._throwIfClosed(),!e.isStopped){e.hasError=e.isStopped=!0,e.thrownError=t;for(var n=e.observers;n.length;)n.shift().error(t)}}))},e.prototype.complete=function(){var t=this;M((function(){if(t._throwIfClosed(),!t.isStopped){t.isStopped=!0;for(var e=t.observers;e.length;)e.shift().complete()}}))},e.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(e.prototype,"observed",{get:function(){var t;return(null===(t=this.observers)||void 0===t?void 0:t.length)>0},enumerable:!1,configurable:!0}),e.prototype._trySubscribe=function(e){return this._throwIfClosed(),t.prototype._trySubscribe.call(this,e)},e.prototype._subscribe=function(t){return this._throwIfClosed(),this._checkFinalizedStatuses(t),this._innerSubscribe(t)},e.prototype._innerSubscribe=function(t){var e=this,n=this,r=n.hasError,i=n.isStopped,o=n.observers;return r||i?O:(this.currentObservers=null,o.push(t),new T((function(){e.currentObservers=null,S(o,t)})))},e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e.thrownError,i=e.isStopped;n?t.error(r):i&&t.complete()},e.prototype.asObservable=function(){var t=new W;return t.source=this,t},e.create=function(t,e){return new nt(t,e)},e}(W),nt=function(t){function e(e,n){var r=t.call(this)||this;return r.destination=e,r.source=n,r}return n(e,t),e.prototype.next=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.next)||void 0===n||n.call(e,t)},e.prototype.error=function(t){var e,n;null===(n=null===(e=this.destination)||void 0===e?void 0:e.error)||void 0===n||n.call(e,t)},e.prototype.complete=function(){var t,e;null===(e=null===(t=this.destination)||void 0===t?void 0:t.complete)||void 0===e||e.call(t)},e.prototype._subscribe=function(t){var e,n;return null!==(n=null===(e=this.source)||void 0===e?void 0:e.subscribe(t))&&void 0!==n?n:O},e}(et);!function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}n(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!1,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){var t=this,e=t.hasError,n=t.thrownError,r=t._value;if(e)throw n;return this._throwIfClosed(),r},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)}}(et);var rt={now:function(){return(rt.delegate||Date).now()},delegate:void 0};!function(t){function e(e,n,r){void 0===e&&(e=1/0),void 0===n&&(n=1/0),void 0===r&&(r=rt);var i=t.call(this)||this;return i._bufferSize=e,i._windowTime=n,i._timestampProvider=r,i._buffer=[],i._infiniteTimeWindow=!0,i._infiniteTimeWindow=n===1/0,i._bufferSize=Math.max(1,e),i._windowTime=Math.max(1,n),i}n(e,t),e.prototype.next=function(e){var n=this,r=n.isStopped,i=n._buffer,o=n._infiniteTimeWindow,u=n._timestampProvider,c=n._windowTime;r||(i.push(e),!o&&i.push(u.now()+c)),this._trimBuffer(),t.prototype.next.call(this,e)},e.prototype._subscribe=function(t){this._throwIfClosed(),this._trimBuffer();for(var e=this._innerSubscribe(t),n=this._infiniteTimeWindow,r=this._buffer.slice(),i=0;i<r.length&&!t.closed;i+=n?1:2)t.next(r[i]);return this._checkFinalizedStatuses(t),e},e.prototype._trimBuffer=function(){var t=this,e=t._bufferSize,n=t._timestampProvider,r=t._buffer,i=t._infiniteTimeWindow,o=(i?1:2)*e;if(e<1/0&&o<r.length&&r.splice(0,r.length-o),!i){for(var u=n.now(),c=0,l=1;l<r.length&&r[l]<=u;l+=2)c=l;c&&r.splice(0,c+1)}}}(et),function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._value=null,e._hasValue=!1,e._isComplete=!1,e}n(e,t),e.prototype._checkFinalizedStatuses=function(t){var e=this,n=e.hasError,r=e._hasValue,i=e._value,o=e.thrownError,u=e.isStopped,c=e._isComplete;n?t.error(o):(u||c)&&(r&&t.next(i),t.complete())},e.prototype.next=function(t){this.isStopped||(this._value=t,this._hasValue=!0)},e.prototype.complete=function(){var e=this,n=e._hasValue,r=e._value;e._isComplete||(this._isComplete=!0,n&&t.prototype.next.call(this,r),t.prototype.complete.call(this))}}(et);var it,ot=function(t){function e(e,n){return t.call(this)||this}return n(e,t),e.prototype.schedule=function(t,e){return this},e}(T),ut=function(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];return setInterval.apply(void 0,l([t,e],c(n)))},ct=function(t){return clearInterval(t)},lt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r.pending=!1,r}return n(e,t),e.prototype.schedule=function(t,e){var n;if(void 0===e&&(e=0),this.closed)return this;this.state=t;var r=this.id,i=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(i,r,e)),this.pending=!0,this.delay=e,this.id=null!==(n=this.id)&&void 0!==n?n:this.requestAsyncId(i,this.id,e),this},e.prototype.requestAsyncId=function(t,e,n){return void 0===n&&(n=0),ut(t.flush.bind(t,this),n)},e.prototype.recycleAsyncId=function(t,e,n){if(void 0===n&&(n=0),null!=n&&this.delay===n&&!1===this.pending)return e;null!=e&&ct(e)},e.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var n=this._execute(t,e);if(n)return n;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},e.prototype._execute=function(t,e){var n,r=!1;try{this.work(t)}catch(t){r=!0,n=t||new Error("Scheduled action threw falsy error")}if(r)return this.unsubscribe(),n},e.prototype.unsubscribe=function(){if(!this.closed){var e=this.id,n=this.scheduler,r=n.actions;this.work=this.state=this.scheduler=null,this.pending=!1,S(r,this),null!=e&&(this.id=this.recycleAsyncId(n,e,null)),this.delay=null,t.prototype.unsubscribe.call(this)}},e}(ot),st=1,at={};function ft(t){return t in at&&(delete at[t],!0)}var dt=function(t){var e=st++;return at[e]=!0,it||(it=Promise.resolve()),it.then((function(){return ft(e)&&t()})),e},pt=function(t){ft(t)},vt={setImmediate:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=vt.delegate;return((null==n?void 0:n.setImmediate)||dt).apply(void 0,l([],c(t)))},clearImmediate:function(t){return pt(t)},delegate:void 0},ht=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=vt.setImmediate(e.flush.bind(e,void 0))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(vt.clearImmediate(n),e._scheduled===n&&(e._scheduled=void 0))},e}(lt),bt=function(){function t(e,n){void 0===n&&(n=t.now),this.schedulerActionCtor=e,this.now=n}return t.prototype.schedule=function(t,e,n){return void 0===e&&(e=0),new this.schedulerActionCtor(this,t).schedule(n,e)},t.now=rt.now,t}(),yt=function(t){function e(e,n){void 0===n&&(n=bt.now);var r=t.call(this,e,n)||this;return r.actions=[],r._active=!1,r}return n(e,t),e.prototype.flush=function(t){var e=this.actions;if(this._active)e.push(t);else{var n;this._active=!0;do{if(n=t.execute(t.state,t.delay))break}while(t=e.shift());if(this._active=!1,n){for(;t=e.shift();)t.unsubscribe();throw n}}},e}(bt),mt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){this._active=!0;var e=this._scheduled;this._scheduled=void 0;var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(yt);new mt(ht);var gt=new yt(lt),wt=gt,_t=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!=r&&r>0||null==r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.flush(this),0)},e}(lt),At=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e}(yt);new At(_t);var xt=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return n(e,t),e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0?t.prototype.requestAsyncId.call(this,e,n,r):(e.actions.push(this),e._scheduled||(e._scheduled=Q.requestAnimationFrame((function(){return e.flush(void 0)}))))},e.prototype.recycleAsyncId=function(e,n,r){var i;if(void 0===r&&(r=0),null!=r?r>0:this.delay>0)return t.prototype.recycleAsyncId.call(this,e,n,r);var o=e.actions;null!=n&&n===e._scheduled&&(null===(i=o[o.length-1])||void 0===i?void 0:i.id)!==n&&(Q.cancelAnimationFrame(n),e._scheduled=void 0)},e}(lt),kt=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return n(e,t),e.prototype.flush=function(t){var e;this._active=!0,t?e=t.id:(e=this._scheduled,this._scheduled=void 0);var n,r=this.actions;t=t||r.shift();do{if(n=t.execute(t.state,t.delay))break}while((t=r[0])&&t.id===e&&r.shift());if(this._active=!1,n){for(;(t=r[0])&&t.id===e&&r.shift();)t.unsubscribe();throw n}},e}(yt);new kt(xt),function(t){function e(e,n){void 0===e&&(e=Et),void 0===n&&(n=1/0);var r=t.call(this,e,(function(){return r.frame}))||this;return r.maxFrames=n,r.frame=0,r.index=-1,r}n(e,t),e.prototype.flush=function(){for(var t,e,n=this.actions,r=this.maxFrames;(e=n[0])&&e.delay<=r&&(n.shift(),this.frame=e.delay,!(t=e.execute(e.state,e.delay))););if(t){for(;e=n.shift();)e.unsubscribe();throw t}},e.frameTimeFactor=10}(yt);var Et=function(t){function e(e,n,r){void 0===r&&(r=e.index+=1);var i=t.call(this,e,n)||this;return i.scheduler=e,i.work=n,i.index=r,i.active=!0,i.index=e.index=r,i}return n(e,t),e.prototype.schedule=function(n,r){if(void 0===r&&(r=0),Number.isFinite(r)){if(!this.id)return t.prototype.schedule.call(this,n,r);this.active=!1;var i=new e(this.scheduler,this.work);return this.add(i),i.schedule(n,r)}return T.EMPTY},e.prototype.requestAsyncId=function(t,n,r){void 0===r&&(r=0),this.delay=t.frame+r;var i=t.actions;return i.push(this),i.sort(e.sortActions),1},e.prototype.recycleAsyncId=function(t,e,n){},e.prototype._execute=function(e,n){if(!0===this.active)return t.prototype._execute.call(this,e,n)},e.sortActions=function(t,e){return t.delay===e.delay?t.index===e.index?0:t.index>e.index?1:-1:t.delay>e.delay?1:-1},e}(lt),St=new W((function(t){return t.complete()}));function Tt(t){return t&&x(t.schedule)}function Ot(t){return t[t.length-1]}function Ct(t){return Tt(Ot(t))?t.pop():void 0}var Pt=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t};function It(t){return x(null==t?void 0:t.then)}function jt(t){return x(t[U])}function Nt(t){return Symbol.asyncIterator&&x(null==t?void 0:t[Symbol.asyncIterator])}function Lt(t){return new TypeError("You provided "+(null!==t&&"object"==typeof t?"an invalid object":"'"+t+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}var Mt,qt="function"==typeof Symbol&&Symbol.iterator?Symbol.iterator:"@@iterator";function Ft(t){return x(null==t?void 0:t[qt])}function Rt(t){return a(this,arguments,(function(){var e,n,r;return o(this,(function(i){switch(i.label){case 0:e=t.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,s(e.read())];case 3:return n=i.sent(),r=n.value,n.done?[4,s(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,s(r)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return e.releaseLock(),[7];case 10:return[2]}}))}))}function Dt(t){return x(null==t?void 0:t.getReader)}function zt(t){if(t instanceof W)return t;if(null!=t){if(jt(t))return i=t,new W((function(t){var e=i[U]();if(x(e.subscribe))return e.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")}));if(Pt(t))return r=t,new W((function(t){for(var e=0;e<r.length&&!t.closed;e++)t.next(r[e]);t.complete()}));if(It(t))return n=t,new W((function(t){n.then((function(e){t.closed||(t.next(e),t.complete())}),(function(e){return t.error(e)})).then(null,N)}));if(Nt(t))return Vt(t);if(Ft(t))return e=t,new W((function(t){var n,r;try{for(var i=u(e),o=i.next();!o.done;o=i.next()){var c=o.value;if(t.next(c),t.closed)return}}catch(t){n={error:t}}finally{try{o&&!o.done&&(r=i.return)&&r.call(i)}finally{if(n)throw n.error}}t.complete()}));if(Dt(t))return Vt(Rt(t))}var e,n,r,i;throw Lt(t)}function Vt(t){return new W((function(e){(function(t,e){var n,r,u,c;return i(this,void 0,void 0,(function(){var i,l;return o(this,(function(o){switch(o.label){case 0:o.trys.push([0,5,6,11]),n=f(t),o.label=1;case 1:return[4,n.next()];case 2:if((r=o.sent()).done)return[3,4];if(i=r.value,e.next(i),e.closed)return[2];o.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return l=o.sent(),u={error:l},[3,11];case 6:return o.trys.push([6,,9,10]),r&&!r.done&&(c=n.return)?[4,c.call(n)]:[3,8];case 7:o.sent(),o.label=8;case 8:return[3,10];case 9:if(u)throw u.error;return[7];case 10:return[7];case 11:return e.complete(),[2]}}))}))})(t,e).catch((function(t){return e.error(t)}))}))}function Yt(t,e,n,r,i){void 0===r&&(r=0),void 0===i&&(i=!1);var o=e.schedule((function(){n(),i?t.add(this.schedule(null,r)):this.unsubscribe()}),r);if(t.add(o),!i)return o}function Ut(t,e){return void 0===e&&(e=0),G((function(n,r){n.subscribe(J(r,(function(n){return Yt(r,t,(function(){return r.next(n)}),e)}),(function(){return Yt(r,t,(function(){return r.complete()}),e)}),(function(n){return Yt(r,t,(function(){return r.error(n)}),e)})))}))}function Ht(t,e){return void 0===e&&(e=0),G((function(n,r){r.add(t.schedule((function(){return n.subscribe(r)}),e))}))}function Wt(t,e){if(!t)throw new Error("Iterable cannot be null");return new W((function(n){Yt(n,e,(function(){var r=t[Symbol.asyncIterator]();Yt(n,e,(function(){r.next().then((function(t){t.done?n.complete():n.next(t.value)}))}),0,!0)}))}))}function Bt(t,e){if(null!=t){if(jt(t))return function(t,e){return zt(t).pipe(Ht(e),Ut(e))}(t,e);if(Pt(t))return function(t,e){return new W((function(n){var r=0;return e.schedule((function(){r===t.length?n.complete():(n.next(t[r++]),n.closed||this.schedule())}))}))}(t,e);if(It(t))return function(t,e){return zt(t).pipe(Ht(e),Ut(e))}(t,e);if(Nt(t))return Wt(t,e);if(Ft(t))return function(t,e){return new W((function(n){var r;return Yt(n,e,(function(){r=t[qt](),Yt(n,e,(function(){var t,e,i;try{e=(t=r.next()).value,i=t.done}catch(t){return void n.error(t)}i?n.complete():n.next(e)}),0,!0)})),function(){return x(null==r?void 0:r.return)&&r.return()}}))}(t,e);if(Dt(t))return function(t,e){return Wt(Rt(t),e)}(t,e)}throw Lt(t)}function Xt(t,e){return e?Bt(t,e):zt(t)}function Gt(t){return t instanceof Date&&!isNaN(t)}!function(t){t.NEXT="N",t.ERROR="E",t.COMPLETE="C"}(Mt||(Mt={})),k((function(t){return function(){t(this),this.name="EmptyError",this.message="no elements in sequence"}})),k((function(t){return function(){t(this),this.name="ArgumentOutOfRangeError",this.message="argument out of range"}})),k((function(t){return function(e){t(this),this.name="NotFoundError",this.message=e}})),k((function(t){return function(e){t(this),this.name="SequenceError",this.message=e}}));var Jt=k((function(t){return function(e){void 0===e&&(e=null),t(this),this.message="Timeout has occurred",this.name="TimeoutError",this.info=e}}));function Zt(t){throw new Jt(t)}function $t(t,e){return G((function(n,r){var i=0;n.subscribe(J(r,(function(n){r.next(t.call(e,n,i++))})))}))}var Kt=Array.isArray;function Qt(t){return $t((function(e){return function(t,e){return Kt(e)?t.apply(void 0,l([],c(e))):t(e)}(t,e)}))}function te(t,e,n){return void 0===n&&(n=1/0),x(e)?te((function(n,r){return $t((function(t,i){return e(n,t,r,i)}))(zt(t(n,r)))}),n):("number"==typeof e&&(n=e),G((function(e,r){return function(t,e,n,r,i,o,u,c){var l=[],s=0,a=0,f=!1,d=function(){!f||l.length||s||e.complete()},p=function(t){return s<r?v(t):l.push(t)},v=function(t){o&&e.next(t),s++;var c=!1;zt(n(t,a++)).subscribe(J(e,(function(t){null==i||i(t),o?p(t):e.next(t)}),(function(){c=!0}),void 0,(function(){if(c)try{s--;for(var t=function(){var t=l.shift();u?Yt(e,u,(function(){return v(t)})):v(t)};l.length&&s<r;)t();d()}catch(t){e.error(t)}})))};return t.subscribe(J(e,p,(function(){f=!0,d()}))),function(){null==c||c()}}(e,r,t,n)})))}function ee(t){return void 0===t&&(t=1/0),te(H,t)}function ne(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return ee(1)(Xt(t,Ct(t)))}var re=["addListener","removeListener"],ie=["addEventListener","removeEventListener"],oe=["on","off"];function ue(t,e,n,r){if(x(n)&&(r=n,n=void 0),r)return ue(t,e,n).pipe(Qt(r));var i=c(function(t){return x(t.addEventListener)&&x(t.removeEventListener)}(t)?ie.map((function(r){return function(i){return t[r](e,i,n)}})):function(t){return x(t.addListener)&&x(t.removeListener)}(t)?re.map(ce(t,e)):function(t){return x(t.on)&&x(t.off)}(t)?oe.map(ce(t,e)):[],2),o=i[0],u=i[1];if(!o&&Pt(t))return te((function(t){return ue(t,e,n)}))(zt(t));if(!o)throw new TypeError("Invalid event target");return new W((function(t){var e=function(){for(var e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return t.next(1<e.length?e:e[0])};return o(e),function(){return u(e)}}))}function ce(t,e){return function(n){return function(r){return t[n](e,r)}}}function le(t,e,n){void 0===t&&(t=0),void 0===n&&(n=wt);var r=-1;return null!=e&&(Tt(e)?n=e:r=e),new W((function(e){var i=Gt(t)?+t-n.now():t;i<0&&(i=0);var o=0;return n.schedule((function(){e.closed||(e.next(o++),0<=r?this.schedule(void 0,r):e.complete())}),i)}))}function se(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Ct(t),r=function(t,e){return"number"==typeof Ot(t)?t.pop():e}(t,1/0),i=t;return i.length?1===i.length?zt(i[0]):ee(r)(Xt(i,n)):St}new W(L);var ae=Array.isArray;function fe(t,e){return G((function(n,r){var i=0;n.subscribe(J(r,(function(n){return t.call(e,n,i++)&&r.next(n)})))}))}function de(){for(var t,e=[],n=0;n<arguments.length;n++)e[n]=arguments[n];return 1===(e=1===(t=e).length&&ae(t[0])?t[0]:t).length?zt(e[0]):new W(function(t){return function(e){for(var n=[],r=function(r){n.push(zt(t[r]).subscribe(J(e,(function(t){if(n){for(var i=0;i<n.length;i++)i!==r&&n[i].unsubscribe();n=null}e.next(t)}))))},i=0;n&&!e.closed&&i<t.length;i++)r(i)}}(e))}function pe(t){return t<=0?function(){return St}:G((function(e,n){var r=0;e.subscribe(J(n,(function(e){++r<=t&&(n.next(e),t<=r&&n.complete())})))}))}function ve(t,e){return e?function(n){return ne(e.pipe(pe(1),G((function(t,e){t.subscribe(J(e,L))}))),n.pipe(ve(t)))}:te((function(e,n){return zt(t(e,n)).pipe(pe(1),function(t){return $t((function(){return t}))}(e))}))}function he(t){void 0===t&&(t={});var e=t.connector,n=void 0===e?function(){return new et}:e,r=t.resetOnError,i=void 0===r||r,o=t.resetOnComplete,u=void 0===o||o,c=t.resetOnRefCountZero,l=void 0===c||c;return function(t){var e,r,o,c=0,s=!1,a=!1,f=function(){null==r||r.unsubscribe(),r=void 0},d=function(){f(),e=o=void 0,s=a=!1},p=function(){var t=e;d(),null==t||t.unsubscribe()};return G((function(t,v){c++,a||s||f();var h=o=null!=o?o:n();v.add((function(){0!==--c||a||s||(r=be(p,l))})),h.subscribe(v),!e&&c>0&&(e=new z({next:function(t){return h.next(t)},error:function(t){a=!0,f(),r=be(d,i,t),h.error(t)},complete:function(){s=!0,f(),r=be(d,u),h.complete()}}),zt(t).subscribe(e))}))(t)}}function be(t,e){for(var n=[],r=2;r<arguments.length;r++)n[r-2]=arguments[r];if(!0!==e){if(!1!==e){var i=new z({next:function(){i.unsubscribe(),t()}});return zt(e.apply(void 0,l([],c(n)))).subscribe(i)}}else t()}function ye(t,e,n){void 0===e&&(e=gt);var r=le(t,e);return function(t,e){return G((function(n,r){var i=null!=e?e:{},o=i.leading,u=void 0===o||o,c=i.trailing,l=void 0!==c&&c,s=!1,a=null,f=null,d=!1,p=function(){null==f||f.unsubscribe(),f=null,l&&(b(),d&&r.complete())},v=function(){f=null,d&&r.complete()},h=function(e){return f=zt(t(e)).subscribe(J(r,p,v))},b=function(){if(s){s=!1;var t=a;a=null,r.next(t),!d&&h(t)}};n.subscribe(J(r,(function(t){s=!0,a=t,(!f||f.closed)&&(u?b():h(t))}),(function(){d=!0,(!(l&&s&&f)||f.closed)&&r.complete()})))}))}((function(){return r}),n)}var me=["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot"],ge=["type"],we=["svg","path","g"],_e=["password","hidden"];var Ae=function(t){var e;return t?(e=function(t,e){for(var n=0,r=0;r<t.length;r++){var i=t[r];if(null===i)n+=4;else{var o=xe(i);n+=o?Array.from(o).length:4}if(n>e)return t.slice(0,r)}return t}(function(t){var e=[];if(!t)return e;e.push(t);for(var n=t.parentElement;n&&"HTML"!==n.tagName;)e.push(n),n=n.parentElement;return e}(t).map((function(t){return function(t){var e,n,r,i,o,c;if(null===t)return null;var l=String(t.tagName).toLowerCase(),s={tag:l},a=Array.from(null!==(i=null===(r=t.parentElement)||void 0===r?void 0:r.children)&&void 0!==i?i:[]);a.length&&(s.index=a.indexOf(t),s.indexOfType=a.filter((function(e){return e.tagName===t.tagName})).indexOf(t));var f=null===(c=null===(o=t.previousElementSibling)||void 0===o?void 0:o.tagName)||void 0===c?void 0:c.toLowerCase();f&&(s.prevSib=String(f));var d=t.getAttribute("id");d&&(s.id=String(d));var p=Array.from(t.classList);p.length&&(s.classes=p);var v={},h=Array.from(t.attributes).filter((function(t){return!me.includes(t.name)})),b=!Oe(t);if(!_e.includes(String(t.getAttribute("type")))&&!we.includes(l))try{for(var y=u(h),m=y.next();!m.done;m=y.next()){var g=m.value;b&&!ge.includes(g.name)||(v[g.name]=String(g.value).substring(0,128))}}catch(t){e={error:t}}finally{try{m&&!m.done&&(n=y.return)&&n.call(y)}finally{if(e)throw e.error}}return Object.keys(v).length&&(s.attrs=v),s}(t)})),1024),e):[]};function xe(t,e){void 0===e&&(e=!1);try{if(null==t)return e?"None":null;if("string"==typeof t)return e?(t=t.replace(/\\/g,"\\\\").replace(/\n/g,"\\n").replace(/\t/g,"\\t").replace(/\r/g,"\\r")).includes('"')?"'".concat(t,"'"):t.includes("'")?'"'.concat(t.replace(/'/g,"\\'"),'"'):"'".concat(t,"'"):t;if("boolean"==typeof t)return t?"True":"False";if(Array.isArray(t)){var n=t.map((function(t){return xe(t,!0)}));return"[".concat(n.join(", "),"]")}if("object"==typeof t){var r=Object.entries(t).filter((function(t){return null!=c(t,1)[0]})).map((function(t){var e=c(t,2),n=e[0],r=e[1];return"".concat(String(xe(n,!0)),": ").concat(String(xe(r,!0)))})),i="{".concat(r.join(", "),"}");return i.includes("\\'")&&(i=i.replace(/'/g,"'").replace(/'/g,"\\'")),i}return t.toString()}catch(t){return null}}var ke=["input","select","textarea"],Ee=function(t,e){var n,r=null===(n=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===n?void 0:n.call(window,t);return"pointer"===(null==r?void 0:r.getPropertyValue("cursor"))&&"click"===e},Se=function(t,e,n){return void 0===n&&(n=!1),function(r,i){var o,u,c=t.pageUrlAllowlist,l=t.shouldTrackEventResolver,s=null===(u=null===(o=null==i?void 0:i.tagName)||void 0===o?void 0:o.toLowerCase)||void 0===u?void 0:u.call(o);if(!s)return!1;if(l)return l(r,i);if(!Pe(window.location.href,c))return!1;var a=String(null==i?void 0:i.getAttribute("type"))||"";if("string"==typeof a)switch(a.toLowerCase()){case"hidden":case"password":return!1}var f=Ee(i,r);if(n&&f)return!0;if(e){var d=e.some((function(t){var e;return!!(null===(e=null==i?void 0:i.matches)||void 0===e?void 0:e.call(i,t))}));if(!d)return!1}switch(s){case"input":case"select":case"textarea":return"change"===r||"click"===r;default:return!!f||"click"===r}}},Te=function(t){if(null==t)return!1;if("string"==typeof t){if(/^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/.test((t||"").replace(/[- ]/g,"")))return!1;if(/(^\d{3}-?\d{2}-?\d{4}$)/.test(t))return!1}return!0},Oe=function(t){var e,n,r,i=null===(n=null===(e=null==t?void 0:t.tagName)||void 0===e?void 0:e.toLowerCase)||void 0===n?void 0:n.call(e),o=t instanceof HTMLElement&&"true"===(null===(r=t.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!ke.includes(i)&&!o},Ce=function(t){var e="";return Oe(t)&&t.childNodes&&t.childNodes.length&&t.childNodes.forEach((function(t){var n,r="";(n=t)&&3===n.nodeType?t.textContent&&(r=t.textContent):r=Ce(t),e+=r.split(/(\s+)/).filter(Te).join("").replace(/[\r\n]/g," ").replace(/[ ]+/g," ").substring(0,255)})),e},Pe=function(t,e){return!e||!e.length||e.some((function(e){return"string"==typeof e?t===e:t.match(e)}))},Ie=function(t){return Object.keys(t).reduce((function(e,n){var r=t[n];return function(t){return null==t||"object"==typeof t&&0===Object.keys(t).length||"string"==typeof t&&0===t.trim().length}(r)||(e[n]=r),e}),{})},je=function(t){var e,n=t.parentElement;if(!n)return"";try{e=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(t){e=null}if(e){var r=e.textContent||"";return Te(r)?r:""}return je(n)},Ne=function(t,e){return t?e.some((function(e){var n;return null===(n=null==t?void 0:t.matches)||void 0===n?void 0:n.call(t,e)}))?t:Ne(null==t?void 0:t.parentElement,e):null},Le=function(t){var e,n,r;if(!t)return{};var i=null===(r=null===(n=null==t?void 0:t.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n),o=((e={})[m]=i,e[g]=Ce(t),e[w]=window.location.href.split("?")[0],e);return Ie(o)};var Me=function(t){return!(null===t.event.target||!t.closestTrackedAncestor)},qe=function(t,e,n){var r,i,o,u=null===(o=null===(i=null==e?void 0:e.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i),c="function"==typeof e.getBoundingClientRect?e.getBoundingClientRect():{left:null,top:null},l=e.getAttribute("aria-label"),s=function(t,e){return t.getAttributeNames().reduce((function(n,r){if(r.startsWith(e)){var i=r.replace(e,""),o=t.getAttribute(r);i&&(n[i]=o||"")}return n}),{})}(e,n),a=je(e),f=((r={})["[Amplitude] Element ID"]=e.getAttribute("id")||"",r["[Amplitude] Element Class"]=e.getAttribute("class"),r["[Amplitude] Element Hierarchy"]=Ae(e),r[m]=u,r[g]=Ce(e),r["[Amplitude] Element Position Left"]=null==c.left?null:Math.round(c.left),r["[Amplitude] Element Position Top"]=null==c.top?null:Math.round(c.top),r["[Amplitude] Element Aria Label"]=l,r["[Amplitude] Element Attributes"]=s,r["[Amplitude] Element Parent Label"]=a,r[w]=window.location.href.split("?")[0],r["[Amplitude] Page Title"]="undefined"!=typeof document&&document.title||"",r["[Amplitude] Viewport Height"]=window.innerHeight,r["[Amplitude] Viewport Width"]=window.innerWidth,r);return"a"===u&&"click"===t&&e instanceof HTMLAnchorElement&&(f["[Amplitude] Element Href"]=e.href),Ie(f)},Fe=function(t,e,n,r,i){void 0===i&&(i=!1);var o={event:t,timestamp:Date.now(),type:e};if(function(t){return"click"===t.type||"change"===t.type}(o)&&null!==o.event.target){if(i)if(Ee(o.event.target,o.type))return o.closestTrackedAncestor=o.event.target,o.targetElementProperties=qe(o.type,o.closestTrackedAncestor,r),o;var u=Ne(o.event.target,n);return u&&(o.closestTrackedAncestor=u,o.targetElementProperties=qe(o.type,u,r)),o}return o};var Re=function(){function t(t){var e=(void 0===t?{}:t).origin,n=void 0===e?_:e,r=this;this.endpoint=_,this.requestCallbacks={},this.onSelect=function(t){r.notify({action:"element-selected",data:t})},this.onTrack=function(t,e){"selector-mode-changed"===t?r.notify({action:"track-selector-mode-changed",data:e}):"selector-moved"===t&&r.notify({action:"track-selector-moved",data:e})},this.endpoint=n}return t.prototype.notify=function(t){var e,n,r,i;null===(n=null===(e=this.logger)||void 0===e?void 0:e.debug)||void 0===n||n.call(e,"Message sent: ",JSON.stringify(t)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,t,this.endpoint)},t.prototype.sendRequest=function(t,e,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:t,args:e};return new Promise((function(e,u){r.requestCallbacks[i]={resolve:e,reject:u},r.notify(o),(null==n?void 0:n.timeout)>0&&setTimeout((function(){u(new Error("".concat(t," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]}),n.timeout)}))},t.prototype.handleResponse=function(t){var e;this.requestCallbacks[t.id]?(this.requestCallbacks[t.id].resolve(t.responseData),delete this.requestCallbacks[t.id]):null===(e=this.logger)||void 0===e||e.warn("No callback found for request id: ".concat(t.id))},t.prototype.setup=function(t){var e=this,n=void 0===t?{}:t,r=n.logger,i=n.endpoint,o=n.isElementSelectable,u=n.cssSelectorAllowlist,c=n.actionClickAllowlist;this.logger=r,i&&this.endpoint===_&&(this.endpoint=i);var l=null;window.addEventListener("message",(function(t){var n,r,i,s,a;if(null===(r=null===(n=e.logger)||void 0===n?void 0:n.debug)||void 0===r||r.call(n,"Message received: ",JSON.stringify(t)),e.endpoint===t.origin){var f,d=null==t?void 0:t.data,p=null==d?void 0:d.action;if(p)if("id"in d)null===(s=null===(i=e.logger)||void 0===i?void 0:i.debug)||void 0===s||s.call(i,"Received Response to previous request: ",JSON.stringify(t)),e.handleResponse(d);else if("ping"===p)e.notify({action:"pong"});else if("initialize-visual-tagging-selector"===p){var v=null==d?void 0:d.data;(f="https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz",new Promise((function(t,e){var n;try{var r=document.createElement("script");r.type="text/javascript",r.async=!0,r.src=f,r.addEventListener("load",(function(){t({status:!0})}),{once:!0}),r.addEventListener("error",(function(){e({status:!1,message:"Failed to load the script ".concat(f)})})),null===(n=document.head)||void 0===n||n.appendChild(r)}catch(t){e(t)}}))).then((function(){var t;l=null===(t=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===t?void 0:t.call(window,{getEventTagProps:Le,isElementSelectable:function(t){return!o||o((null==v?void 0:v.actionType)||"click",t)},onTrack:e.onTrack,onSelect:e.onSelect,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:u,actionClickAllowlist:c}),e.notify({action:"selector-loaded"})})).catch((function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")}))}else"close-visual-tagging-selector"===p&&(null===(a=null==l?void 0:l.close)||void 0===a||a.call(l))}})),this.notify({action:"page-loaded"})},t}();function De(t){var e,n,r,i=t.amplitude,o=t.allObservables,l=t.options,s=t.shouldTrackEvent,a=t.evaluateTriggers,f=o.clickObservable,d=f.pipe(G((function(t,e){var n,r=!1;t.subscribe(J(e,(function(t){var i=n;n=t,r&&e.next([i,t]),r=!0})))})),fe((function(t){var e=c(t,2),n=e[0],r=e[1],i=n.event.target!==r.event.target,o=Math.abs(r.event.screenX-n.event.screenX)<=20&&Math.abs(r.event.screenY-n.event.screenY)<=20;return i&&!o}))),p=se(d,f.pipe((e=l.debounceTime,void 0===n&&(n=gt),G((function(t,r){var i=null,o=null,u=null,c=function(){if(i){i.unsubscribe(),i=null;var t=o;o=null,r.next(t)}};function l(){var t=u+e,o=n.now();if(o<t)return i=this.schedule(void 0,t-o),void r.add(i);c()}t.subscribe(J(r,(function(t){o=t,u=n.now(),i||(i=n.schedule(l,e),r.add(i))}),(function(){c(),r.complete()}),void 0,(function(){o=i=null})))}))),$t((function(){return"timeout"})))),v=f.pipe(function(t,e){void 0===e&&(e=gt);var n=le(t,e);return ve((function(){return n}))}(0),fe(Me),fe((function(t){return s("click",t.closestTrackedAncestor)})),$t((function(t){return a(t)})),(r=p,G((function(t,e){var n=[];return t.subscribe(J(e,(function(t){return n.push(t)}),(function(){e.next(n),e.complete()}))),zt(r).subscribe(J(e,(function(){var t=n;n=[],e.next(t)}),L)),function(){n=null}}))));return v.subscribe((function(t){var e,n,r=(t.length,y);try{for(var o=u(t),c=o.next();!c.done;c=o.next()){var l=c.value;null==i||i.track(r,l.targetElementProperties)}}catch(t){e={error:t}}finally{try{c&&!c.done&&(n=o.return)&&n.call(o)}finally{if(e)throw e.error}}}))}function ze(t){var e=t.amplitude,n=t.allObservables,r=t.options,i=t.getEventProperties,o=t.shouldTrackEvent,u=t.shouldTrackActionClick,s=n.clickObservable,a=n.mutationObservable,f=n.navigateObservable,d=s.pipe(fe((function(t){return!o("click",t.closestTrackedAncestor)})),$t((function(t){var e=Ne(t.event.target,r.actionClickAllowlist);return t.closestTrackedAncestor=e,null!==t.closestTrackedAncestor&&(t.targetElementProperties=i(t.type,t.closestTrackedAncestor)),t})),fe(Me),fe((function(t){return u("click",t.closestTrackedAncestor)}))),p=[a];f&&p.push(f);var v,h,b=se.apply(void 0,l([],c(p),!1)),m=d.pipe((v=function(t){return b.pipe(pe(1),function(t,e){var n=Gt(t)?{first:t}:"number"==typeof t?{each:t}:t,r=n.first,i=n.each,o=n.with,u=void 0===o?Zt:o,c=n.scheduler,l=void 0===c?null!=e?e:gt:c,s=n.meta,a=void 0===s?null:s;if(null==r&&null==i)throw new TypeError("No timeout provided.");return G((function(t,e){var n,o,c=null,s=0,f=function(t){o=Yt(e,l,(function(){try{n.unsubscribe(),zt(u({meta:a,lastValue:c,seen:s})).subscribe(e)}catch(t){e.error(t)}}),t)};n=t.subscribe(J(e,(function(t){null==o||o.unsubscribe(),s++,e.next(c=t),i>0&&f(i)}),void 0,void 0,(function(){(null==o?void 0:o.closed)||null==o||o.unsubscribe(),c=null}))),!s&&f(null!=r?"number"==typeof r?r:+r-l.now():i)}))}({first:500,with:function(){return St}}),$t((function(){return t})))},G((function(t,e){var n=null,r=0,i=!1,o=function(){return i&&!n&&e.complete()};t.subscribe(J(e,(function(t){null==n||n.unsubscribe();var i=0,u=r++;zt(v(t,u)).subscribe(n=J(e,(function(n){return e.next(h?h(t,n,u,i++):n)}),(function(){n=null,o()})))}),(function(){i=!0,o()})))}))));return m.subscribe((function(t){null==e||e.track(y,i("click",t.closestTrackedAncestor))}))}var Ve,Ye=function(){return new W((function(t){var e=new MutationObserver((function(e){t.next(e)}));return e.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return e.disconnect()}}))},Ue=function(){return ue(document,"click",{capture:!0})},He=function(t,e){return e.filter((function(e){return e.definition.some((function(e){return e.event_type===t.type&&e.filters.every((function(e){return function(t,e){try{if("[Amplitude] Element Text"===e.subprop_key)return"exact"===e.subprop_op&&e.subprop_value.includes(t.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===e.subprop_key)return"autotrack css match"===e.subprop_op&&!!t.closestTrackedAncestor.closest(e.subprop_value.toString())}catch(t){return console.error("Error matching event to filter",t),!1}return!1}(t,e)}))}))}))},We=function(t,e){if("DOM_ELEMENT"===t.sourceType){var n=function(t,e){if("DOM_ELEMENT"===t.sourceType){var n=document.documentElement;return t.scope&&e&&(n=e.closest(t.scope)),n&&t.selector?n.querySelector(t.selector):n}}(t,e);if(!n)return;return"TEXT"===t.elementExtractType?n.textContent:"ATTRIBUTE"===t.elementExtractType&&t.attribute?n.getAttribute(t.attribute):void 0}},Be=function(t,e){t.forEach((function(t){if("string"!=typeof t&&"ATTACH_EVENT_PROPERTY"===t.actionType){var n=We(t.dataSource,e.closestTrackedAncestor);e.targetElementProperties[t.destinationKey]=n}}))};!function(t){t.ClickObservable="clickObservable",t.ChangeObservable="changeObservable",t.NavigateObservable="navigateObservable",t.MutationObservable="mutationObservable"}(Ve||(Ve={}));var Xe=function(t){var e,n,s,a,f,h,b;void 0===t&&(t={});var y=t.dataAttributePrefix,m=void 0===y?p:y,g=t.visualTaggingOptions,w=void 0===g?{enabled:!0,messenger:new Re}:g;t.cssSelectorAllowlist=null!==(e=t.cssSelectorAllowlist)&&void 0!==e?e:d,t.actionClickAllowlist=null!==(n=t.actionClickAllowlist)&&void 0!==n?n:v,t.debounceTime=null!==(s=t.debounceTime)&&void 0!==s?s:0;var _="@amplitude/plugin-autocapture-browser",x=[],k=function(t){var e,n,r,i,o,c={click:new Set,change:new Set};if(!t)return c;try{for(var l=u(t),s=l.next();!s.done;s=l.next()){var a=s.value;try{try{for(var f=(r=void 0,u(a.definition)),d=f.next();!d.done;d=f.next())null===(o=c[d.value.event_type])||void 0===o||o.add(a.id)}catch(t){r={error:t}}finally{try{d&&!d.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}}catch(t){console.warn("Skipping Labeled Event due to malformed definition",null==a?void 0:a.id,t)}}}catch(t){e={error:t}}finally{try{s&&!s.done&&(n=l.return)&&n.call(l)}finally{if(e)throw e.error}}return c}(Object.values(null!==(f=null===(a=t.pageActions)||void 0===a?void 0:a.labeledEvents)&&void 0!==f?f:{})),E=function(t){var e,n,r,i,o=new Map;try{for(var c=u(t),l=c.next();!l.done;l=c.next()){var s=l.value;try{for(var a=(r=void 0,u(s.conditions)),f=a.next();!f.done;f=a.next()){var d=f.value;if("LABELED_EVENT"===d.type){var p=d.match.eventId,v=o.get(p);v||(v=[],o.set(p,v)),v.push(s)}}}catch(t){r={error:t}}finally{try{f&&!f.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=c.return)&&n.call(c)}finally{if(e)throw e.error}}return o}(null!==(b=null===(h=t.pageActions)||void 0===h?void 0:h.triggers)&&void 0!==b?b:[]),S=function(e){var n,r,i=t.pageActions;if(!i)return e;var o=function(t,e){var n,r,i=new Set;try{for(var o=u(t),c=o.next();!c.done;c=o.next()){var l=c.value,s=e.get(l.id);s&&s.forEach((function(t){return i.add(t)}))}}catch(t){n={error:t}}finally{try{c&&!c.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return Array.from(i)}(He(e,Array.from(k[e.type]).map((function(t){return i.labeledEvents[t]}))),E);try{for(var c=u(o),l=c.next();!l.done;l=c.next()){var s=l.value;Be(s.actions,e)}}catch(t){n={error:t}}finally{try{l&&!l.done&&(r=c.return)&&r.call(c)}finally{if(n)throw n.error}}return e};return{name:_,type:"enrichment",setup:function(e,n){return i(void 0,void 0,void 0,(function(){var i,u,s,a,f,d,p,v,h,b;return o(this,(function(o){return"undefined"==typeof document||(i=Se(t,t.cssSelectorAllowlist),u=Se(t,t.actionClickAllowlist),s=function(){var e,n,r=Ue().pipe($t((function(e){return Fe(e,"click",t.cssSelectorAllowlist,m)})),he()),i=ue(document,"change",{capture:!0}).pipe($t((function(e){return Fe(e,"change",t.cssSelectorAllowlist,m)})),he());window.navigation&&(n=ue(window.navigation,"navigate").pipe($t((function(e){return Fe(e,"navigate",t.cssSelectorAllowlist,m)})),he()));var o=Ye().pipe($t((function(e){return Fe(e,"mutation",t.cssSelectorAllowlist,m)})),he());return(e={})[Ve.ClickObservable]=r,e[Ve.ChangeObservable]=i,e[Ve.NavigateObservable]=n,e[Ve.MutationObservable]=o,e}(),a=De({allObservables:s,options:t,amplitude:n,shouldTrackEvent:i,evaluateTriggers:S}),x.push(a),f=function(t){var e=t.amplitude,n=t.allObservables,r=t.getEventProperties,i=t.shouldTrackEvent,o=t.evaluateTriggers;return n.changeObservable.pipe(fe(Me),fe((function(t){return i("change",t.closestTrackedAncestor)})),$t((function(t){return o(t)}))).subscribe((function(t){null==e||e.track("[Amplitude] Element Changed",r("change",t.closestTrackedAncestor))}))}({allObservables:s,getEventProperties:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return qe.apply(void 0,l(l([],c(t),!1),[m],!1))},amplitude:n,shouldTrackEvent:i,evaluateTriggers:S}),x.push(f),d=ze({allObservables:s,options:t,getEventProperties:function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return qe.apply(void 0,l(l([],c(t),!1),[m],!1))},amplitude:n,shouldTrackEvent:i,shouldTrackActionClick:u}),x.push(d),null===(h=null==e?void 0:e.loggerProvider)||void 0===h||h.log("".concat(_," has been successfully added.")),window.opener&&w.enabled&&(p=t.cssSelectorAllowlist,v=t.actionClickAllowlist,null===(b=w.messenger)||void 0===b||b.setup(r(r({logger:null==e?void 0:e.loggerProvider},(null==e?void 0:e.serverZone)&&{endpoint:A[e.serverZone]}),{isElementSelectable:Se(t,l(l([],c(p),!1),c(v),!1)),cssSelectorAllowlist:p,actionClickAllowlist:v})))),[2]}))}))},execute:function(t){return i(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,t]}))}))},teardown:function(){return i(void 0,void 0,void 0,(function(){var t,e,n,r;return o(this,(function(i){try{for(t=u(x),e=t.next();!e.done;e=t.next())e.value.unsubscribe()}catch(t){n={error:t}}finally{try{e&&!e.done&&(r=t.return)&&r.call(t)}finally{if(n)throw n.error}}return[2]}))}))}}};return t.WindowMessenger=Re,t.autocapturePlugin=Xe,t.frustrationPlugin=function(t){var e,n,s,a,f;void 0===t&&(t={});var d="@amplitude/plugin-frustration-browser",v=[],y=null!==(n=null===(e=t.rageClicks)||void 0===e?void 0:e.cssSelectorAllowlist)&&void 0!==n?n:b,m=null!==(a=null===(s=t.deadClicks)||void 0===s?void 0:s.cssSelectorAllowlist)&&void 0!==a?a:h,g=null!==(f=t.dataAttributePrefix)&&void 0!==f?f:p,w=l([],c(new Set(l(l([],c(y),!1),c(m),!1))),!1);return{name:d,type:"enrichment",setup:function(e,n){return i(void 0,void 0,void 0,(function(){var i,u,s,a,f,p;return o(this,(function(o){return"undefined"==typeof document||(i=Se(t,y),u=Se(t,m),s=function(){var t,e,n=Ue().pipe($t((function(t){return Fe(t,"click",w,g,!0)})),he());window.navigation&&(e=ue(window.navigation,"navigate").pipe($t((function(t){return Fe(t,"navigate",w,g)})),he()));var r=Ye().pipe($t((function(t){return Fe(t,"mutation",w,g)})),he());return(t={})[Ve.ClickObservable]=n,t[Ve.ChangeObservable]=new W,t[Ve.NavigateObservable]=e,t[Ve.MutationObservable]=r,t}(),a=function(t){var e=t.amplitude,n=t.allObservables,i=t.shouldTrackRageClick,o=n.clickObservable,u=[];return o.pipe(fe(Me),fe((function(t){return i("click",t.closestTrackedAncestor)})),$t((function(t){var e=t.timestamp;u.length>0&&u[u.length-1].closestTrackedAncestor!==t.closestTrackedAncestor&&u.splice(0,u.length);for(var n=0;n<u.length&&!(e-u[n].timestamp<1e3);n++);if(u.splice(0,n),u.push(t),u.length<4)return null;var i=u[0],o=u[u.length-1],c=r({"[Amplitude] Begin Time":new Date(i.timestamp).toISOString(),"[Amplitude] End Time":new Date(o.timestamp).toISOString(),"[Amplitude] Duration":o.timestamp-i.timestamp,"[Amplitude] Clicks":u.map((function(t){return{X:t.event.clientX,Y:t.event.clientY,Time:t.timestamp}})),"[Amplitude] Click Count":u.length},i.targetElementProperties);return u.splice(0,u.length),{rageClickEvent:c,time:i.timestamp}})),fe((function(t){return null!==t}))).subscribe((function(t){null!==t&&e.track("[Amplitude] Rage Click",t.rageClickEvent,{time:t.time})}))}({allObservables:s,amplitude:n,shouldTrackRageClick:i}),v.push(a),f=function(t){var e=t.amplitude,n=t.allObservables,i=t.getEventProperties,o=t.shouldTrackDeadClick,u=n.clickObservable,s=n.mutationObservable,a=n.navigateObservable,f=u.pipe(fe(Me),fe((function(t){return o("click",t.closestTrackedAncestor)}))),d=[s];a&&d.push(a);var p=se.apply(void 0,l([],c(d),!1));return f.pipe(te((function(t){var e;return de(new W((function(n){return e=setTimeout((function(){return n.next(t)}),3e3),function(){clearTimeout(e)}})),p.pipe(pe(1),$t((function(){return null})))).pipe(fe((function(t){return null!==t})))})),ye(3e3)).subscribe((function(t){var n={"[Amplitude] X":t.event.clientX,"[Amplitude] Y":t.event.clientY};e.track("[Amplitude] Dead Click",r(r({},i("click",t.closestTrackedAncestor)),n),{time:t.timestamp})}))}({amplitude:n,allObservables:s,getEventProperties:function(t,e){return qe(t,e,g)},shouldTrackDeadClick:u}),v.push(f),null===(p=null==e?void 0:e.loggerProvider)||void 0===p||p.log("".concat(d," has been successfully added."))),[2]}))}))},execute:function(t){return i(void 0,void 0,void 0,(function(){return o(this,(function(e){return[2,t]}))}))},teardown:function(){return i(void 0,void 0,void 0,(function(){var t,e,n,r;return o(this,(function(i){try{for(t=u(v),e=t.next();!e.done;e=t.next())e.value.unsubscribe()}catch(t){n={error:t}}finally{try{e&&!e.done&&(r=t.return)&&r.call(t)}finally{if(n)throw n.error}}return[2]}))}))}}},t.plugin=Xe,Object.defineProperty(t,"__esModule",{value:!0}),t}({});
|
|
2
2
|
//# sourceMappingURL=amplitude-min.js.map
|
|
Binary file
|