@amplitude/plugin-autocapture-browser 1.28.4 → 1.28.6

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.
@@ -1,11 +1,12 @@
1
1
  import { BrowserConfig } from '@amplitude/analytics-core';
2
2
  import { DataExtractor } from './data-extractor';
3
3
  /**
4
- * Remote-config key for the element-selector engine payload. Mirrors the
5
- * `configs.analyticsSDK.pageActions` namespace autocapture already subscribes
6
- * to. The payload shape is `ElementSelectorRemoteConfig`.
4
+ * Remote-config key for the element-selector engine payload. Nested under the
5
+ * browser SDK autocapture namespace alongside other autocapture toggles
6
+ * (elementInteractions, frustrationInteractions, etc.). The payload shape is
7
+ * `ElementSelectorRemoteConfig`.
7
8
  */
8
- export declare const ELEMENT_SELECTOR_REMOTE_CONFIG_KEY = "configs.analyticsSDK.elementSelector";
9
+ export declare const ELEMENT_SELECTOR_REMOTE_CONFIG_KEY = "configs.analyticsSDK.browserSDK.autocapture.elementSelector";
9
10
  /**
10
11
  * Subscribe a plugin's {@link DataExtractor} to element-selector remote config.
11
12
  *
@@ -1 +1 @@
1
- {"version":3,"file":"element-selector-config.d.ts","sourceRoot":"","sources":["../../src/element-selector-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,yCAAyC,CAAC;AAEzF;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,aAAa,GAC3B,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAa1B"}
1
+ {"version":3,"file":"element-selector-config.d.ts","sourceRoot":"","sources":["../../src/element-selector-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,gEAAgE,CAAC;AAEhH;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,aAAa,GAC3B,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAa1B"}
@@ -2,11 +2,12 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.subscribeToElementSelectorConfig = exports.ELEMENT_SELECTOR_REMOTE_CONFIG_KEY = void 0;
4
4
  /**
5
- * Remote-config key for the element-selector engine payload. Mirrors the
6
- * `configs.analyticsSDK.pageActions` namespace autocapture already subscribes
7
- * to. The payload shape is `ElementSelectorRemoteConfig`.
5
+ * Remote-config key for the element-selector engine payload. Nested under the
6
+ * browser SDK autocapture namespace alongside other autocapture toggles
7
+ * (elementInteractions, frustrationInteractions, etc.). The payload shape is
8
+ * `ElementSelectorRemoteConfig`.
8
9
  */
9
- exports.ELEMENT_SELECTOR_REMOTE_CONFIG_KEY = 'configs.analyticsSDK.elementSelector';
10
+ exports.ELEMENT_SELECTOR_REMOTE_CONFIG_KEY = 'configs.analyticsSDK.browserSDK.autocapture.elementSelector';
10
11
  /**
11
12
  * Subscribe a plugin's {@link DataExtractor} to element-selector remote config.
12
13
  *
@@ -1 +1 @@
1
- {"version":3,"file":"element-selector-config.js","sourceRoot":"","sources":["../../src/element-selector-config.ts"],"names":[],"mappings":";;;AAIA;;;;GAIG;AACU,QAAA,kCAAkC,GAAG,sCAAsC,CAAC;AAEzF;;;;;;;;;;GAUG;AACH,SAAgB,gCAAgC,CAC9C,MAAqB,EACrB,aAA4B;IAE5B,IAAM,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;IACrD,IAAI,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC,kBAAkB,EAAE;QACpD,OAAO,SAAS,CAAC;KAClB;IAED,IAAM,cAAc,GAAG,kBAAkB,CAAC,SAAS,CAAC,0CAAkC,EAAE,KAAK,EAAE,UAAC,YAAY;QAC1G,aAAa,CAAC,oBAAoB,CAAC,YAAkD,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAChH,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,kBAAkB,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IACjD,CAAC,CAAC;AACJ,CAAC;AAhBD,4EAgBC","sourcesContent":["import { BrowserConfig } from '@amplitude/analytics-core';\nimport { ElementSelectorRemoteConfig } from '@amplitude/element-selector';\nimport { DataExtractor } from './data-extractor';\n\n/**\n * Remote-config key for the element-selector engine payload. Mirrors the\n * `configs.analyticsSDK.pageActions` namespace autocapture already subscribes\n * to. The payload shape is `ElementSelectorRemoteConfig`.\n */\nexport const ELEMENT_SELECTOR_REMOTE_CONFIG_KEY = 'configs.analyticsSDK.elementSelector';\n\n/**\n * Subscribe a plugin's {@link DataExtractor} to element-selector remote config.\n *\n * On each delivery, the resolved config is pushed into the extractor's engine,\n * which changes what `getElementPath` (and therefore every selector-bearing\n * autocapture event) emits. When remote config is disabled or unavailable, this\n * is a no-op and the engine stays on the dormant defaults.\n *\n * @returns an unsubscribe function when a subscription was created, otherwise\n * `undefined`.\n */\nexport function subscribeToElementSelectorConfig(\n config: BrowserConfig,\n dataExtractor: DataExtractor,\n): (() => void) | undefined {\n const remoteConfigClient = config.remoteConfigClient;\n if (!config.fetchRemoteConfig || !remoteConfigClient) {\n return undefined;\n }\n\n const subscriptionId = remoteConfigClient.subscribe(ELEMENT_SELECTOR_REMOTE_CONFIG_KEY, 'all', (remoteConfig) => {\n dataExtractor.updateSelectorConfig(remoteConfig as ElementSelectorRemoteConfig | null, config.loggerProvider);\n });\n\n return () => {\n remoteConfigClient.unsubscribe(subscriptionId);\n };\n}\n"]}
1
+ {"version":3,"file":"element-selector-config.js","sourceRoot":"","sources":["../../src/element-selector-config.ts"],"names":[],"mappings":";;;AAIA;;;;;GAKG;AACU,QAAA,kCAAkC,GAAG,6DAA6D,CAAC;AAEhH;;;;;;;;;;GAUG;AACH,SAAgB,gCAAgC,CAC9C,MAAqB,EACrB,aAA4B;IAE5B,IAAM,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;IACrD,IAAI,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC,kBAAkB,EAAE;QACpD,OAAO,SAAS,CAAC;KAClB;IAED,IAAM,cAAc,GAAG,kBAAkB,CAAC,SAAS,CAAC,0CAAkC,EAAE,KAAK,EAAE,UAAC,YAAY;QAC1G,aAAa,CAAC,oBAAoB,CAAC,YAAkD,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAChH,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,kBAAkB,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IACjD,CAAC,CAAC;AACJ,CAAC;AAhBD,4EAgBC","sourcesContent":["import { BrowserConfig } from '@amplitude/analytics-core';\nimport { ElementSelectorRemoteConfig } from '@amplitude/element-selector';\nimport { DataExtractor } from './data-extractor';\n\n/**\n * Remote-config key for the element-selector engine payload. Nested under the\n * browser SDK autocapture namespace alongside other autocapture toggles\n * (elementInteractions, frustrationInteractions, etc.). The payload shape is\n * `ElementSelectorRemoteConfig`.\n */\nexport const ELEMENT_SELECTOR_REMOTE_CONFIG_KEY = 'configs.analyticsSDK.browserSDK.autocapture.elementSelector';\n\n/**\n * Subscribe a plugin's {@link DataExtractor} to element-selector remote config.\n *\n * On each delivery, the resolved config is pushed into the extractor's engine,\n * which changes what `getElementPath` (and therefore every selector-bearing\n * autocapture event) emits. When remote config is disabled or unavailable, this\n * is a no-op and the engine stays on the dormant defaults.\n *\n * @returns an unsubscribe function when a subscription was created, otherwise\n * `undefined`.\n */\nexport function subscribeToElementSelectorConfig(\n config: BrowserConfig,\n dataExtractor: DataExtractor,\n): (() => void) | undefined {\n const remoteConfigClient = config.remoteConfigClient;\n if (!config.fetchRemoteConfig || !remoteConfigClient) {\n return undefined;\n }\n\n const subscriptionId = remoteConfigClient.subscribe(ELEMENT_SELECTOR_REMOTE_CONFIG_KEY, 'all', (remoteConfig) => {\n dataExtractor.updateSelectorConfig(remoteConfig as ElementSelectorRemoteConfig | null, config.loggerProvider);\n });\n\n return () => {\n remoteConfigClient.unsubscribe(subscriptionId);\n };\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.28.4";
1
+ export declare const VERSION = "1.28.6";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '1.28.4';
4
+ exports.VERSION = '1.28.6';
5
5
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["export const VERSION = '1.28.4';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["export const VERSION = '1.28.6';\n"]}
@@ -1,11 +1,12 @@
1
1
  import { BrowserConfig } from '@amplitude/analytics-core';
2
2
  import { DataExtractor } from './data-extractor';
3
3
  /**
4
- * Remote-config key for the element-selector engine payload. Mirrors the
5
- * `configs.analyticsSDK.pageActions` namespace autocapture already subscribes
6
- * to. The payload shape is `ElementSelectorRemoteConfig`.
4
+ * Remote-config key for the element-selector engine payload. Nested under the
5
+ * browser SDK autocapture namespace alongside other autocapture toggles
6
+ * (elementInteractions, frustrationInteractions, etc.). The payload shape is
7
+ * `ElementSelectorRemoteConfig`.
7
8
  */
8
- export declare const ELEMENT_SELECTOR_REMOTE_CONFIG_KEY = "configs.analyticsSDK.elementSelector";
9
+ export declare const ELEMENT_SELECTOR_REMOTE_CONFIG_KEY = "configs.analyticsSDK.browserSDK.autocapture.elementSelector";
9
10
  /**
10
11
  * Subscribe a plugin's {@link DataExtractor} to element-selector remote config.
11
12
  *
@@ -1 +1 @@
1
- {"version":3,"file":"element-selector-config.d.ts","sourceRoot":"","sources":["../../src/element-selector-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;GAIG;AACH,eAAO,MAAM,kCAAkC,yCAAyC,CAAC;AAEzF;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,aAAa,GAC3B,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAa1B"}
1
+ {"version":3,"file":"element-selector-config.d.ts","sourceRoot":"","sources":["../../src/element-selector-config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE1D,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD;;;;;GAKG;AACH,eAAO,MAAM,kCAAkC,gEAAgE,CAAC;AAEhH;;;;;;;;;;GAUG;AACH,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,aAAa,EACrB,aAAa,EAAE,aAAa,GAC3B,CAAC,MAAM,IAAI,CAAC,GAAG,SAAS,CAa1B"}
@@ -1,9 +1,10 @@
1
1
  /**
2
- * Remote-config key for the element-selector engine payload. Mirrors the
3
- * `configs.analyticsSDK.pageActions` namespace autocapture already subscribes
4
- * to. The payload shape is `ElementSelectorRemoteConfig`.
2
+ * Remote-config key for the element-selector engine payload. Nested under the
3
+ * browser SDK autocapture namespace alongside other autocapture toggles
4
+ * (elementInteractions, frustrationInteractions, etc.). The payload shape is
5
+ * `ElementSelectorRemoteConfig`.
5
6
  */
6
- export var ELEMENT_SELECTOR_REMOTE_CONFIG_KEY = 'configs.analyticsSDK.elementSelector';
7
+ export var ELEMENT_SELECTOR_REMOTE_CONFIG_KEY = 'configs.analyticsSDK.browserSDK.autocapture.elementSelector';
7
8
  /**
8
9
  * Subscribe a plugin's {@link DataExtractor} to element-selector remote config.
9
10
  *
@@ -1 +1 @@
1
- {"version":3,"file":"element-selector-config.js","sourceRoot":"","sources":["../../src/element-selector-config.ts"],"names":[],"mappings":"AAIA;;;;GAIG;AACH,MAAM,CAAC,IAAM,kCAAkC,GAAG,sCAAsC,CAAC;AAEzF;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gCAAgC,CAC9C,MAAqB,EACrB,aAA4B;IAE5B,IAAM,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;IACrD,IAAI,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC,kBAAkB,EAAE;QACpD,OAAO,SAAS,CAAC;KAClB;IAED,IAAM,cAAc,GAAG,kBAAkB,CAAC,SAAS,CAAC,kCAAkC,EAAE,KAAK,EAAE,UAAC,YAAY;QAC1G,aAAa,CAAC,oBAAoB,CAAC,YAAkD,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAChH,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,kBAAkB,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IACjD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { BrowserConfig } from '@amplitude/analytics-core';\nimport { ElementSelectorRemoteConfig } from '@amplitude/element-selector';\nimport { DataExtractor } from './data-extractor';\n\n/**\n * Remote-config key for the element-selector engine payload. Mirrors the\n * `configs.analyticsSDK.pageActions` namespace autocapture already subscribes\n * to. The payload shape is `ElementSelectorRemoteConfig`.\n */\nexport const ELEMENT_SELECTOR_REMOTE_CONFIG_KEY = 'configs.analyticsSDK.elementSelector';\n\n/**\n * Subscribe a plugin's {@link DataExtractor} to element-selector remote config.\n *\n * On each delivery, the resolved config is pushed into the extractor's engine,\n * which changes what `getElementPath` (and therefore every selector-bearing\n * autocapture event) emits. When remote config is disabled or unavailable, this\n * is a no-op and the engine stays on the dormant defaults.\n *\n * @returns an unsubscribe function when a subscription was created, otherwise\n * `undefined`.\n */\nexport function subscribeToElementSelectorConfig(\n config: BrowserConfig,\n dataExtractor: DataExtractor,\n): (() => void) | undefined {\n const remoteConfigClient = config.remoteConfigClient;\n if (!config.fetchRemoteConfig || !remoteConfigClient) {\n return undefined;\n }\n\n const subscriptionId = remoteConfigClient.subscribe(ELEMENT_SELECTOR_REMOTE_CONFIG_KEY, 'all', (remoteConfig) => {\n dataExtractor.updateSelectorConfig(remoteConfig as ElementSelectorRemoteConfig | null, config.loggerProvider);\n });\n\n return () => {\n remoteConfigClient.unsubscribe(subscriptionId);\n };\n}\n"]}
1
+ {"version":3,"file":"element-selector-config.js","sourceRoot":"","sources":["../../src/element-selector-config.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,MAAM,CAAC,IAAM,kCAAkC,GAAG,6DAA6D,CAAC;AAEhH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gCAAgC,CAC9C,MAAqB,EACrB,aAA4B;IAE5B,IAAM,kBAAkB,GAAG,MAAM,CAAC,kBAAkB,CAAC;IACrD,IAAI,CAAC,MAAM,CAAC,iBAAiB,IAAI,CAAC,kBAAkB,EAAE;QACpD,OAAO,SAAS,CAAC;KAClB;IAED,IAAM,cAAc,GAAG,kBAAkB,CAAC,SAAS,CAAC,kCAAkC,EAAE,KAAK,EAAE,UAAC,YAAY;QAC1G,aAAa,CAAC,oBAAoB,CAAC,YAAkD,EAAE,MAAM,CAAC,cAAc,CAAC,CAAC;IAChH,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,kBAAkB,CAAC,WAAW,CAAC,cAAc,CAAC,CAAC;IACjD,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { BrowserConfig } from '@amplitude/analytics-core';\nimport { ElementSelectorRemoteConfig } from '@amplitude/element-selector';\nimport { DataExtractor } from './data-extractor';\n\n/**\n * Remote-config key for the element-selector engine payload. Nested under the\n * browser SDK autocapture namespace alongside other autocapture toggles\n * (elementInteractions, frustrationInteractions, etc.). The payload shape is\n * `ElementSelectorRemoteConfig`.\n */\nexport const ELEMENT_SELECTOR_REMOTE_CONFIG_KEY = 'configs.analyticsSDK.browserSDK.autocapture.elementSelector';\n\n/**\n * Subscribe a plugin's {@link DataExtractor} to element-selector remote config.\n *\n * On each delivery, the resolved config is pushed into the extractor's engine,\n * which changes what `getElementPath` (and therefore every selector-bearing\n * autocapture event) emits. When remote config is disabled or unavailable, this\n * is a no-op and the engine stays on the dormant defaults.\n *\n * @returns an unsubscribe function when a subscription was created, otherwise\n * `undefined`.\n */\nexport function subscribeToElementSelectorConfig(\n config: BrowserConfig,\n dataExtractor: DataExtractor,\n): (() => void) | undefined {\n const remoteConfigClient = config.remoteConfigClient;\n if (!config.fetchRemoteConfig || !remoteConfigClient) {\n return undefined;\n }\n\n const subscriptionId = remoteConfigClient.subscribe(ELEMENT_SELECTOR_REMOTE_CONFIG_KEY, 'all', (remoteConfig) => {\n dataExtractor.updateSelectorConfig(remoteConfig as ElementSelectorRemoteConfig | null, config.loggerProvider);\n });\n\n return () => {\n remoteConfigClient.unsubscribe(subscriptionId);\n };\n}\n"]}
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "1.28.4";
1
+ export declare const VERSION = "1.28.6";
2
2
  //# sourceMappingURL=version.d.ts.map
@@ -1,2 +1,2 @@
1
- export var VERSION = '1.28.4';
1
+ export var VERSION = '1.28.6';
2
2
  //# sourceMappingURL=version.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["export const VERSION = '1.28.4';\n"]}
1
+ {"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,IAAM,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["export const VERSION = '1.28.6';\n"]}
@@ -1,2 +1,2 @@
1
- var amplitudeAutocapturePlugin=function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};function n(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}u((r=r.apply(e,t||[])).next())})}function r(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(u){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,u])}}}function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function a(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var l=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},u=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},c=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n},s=l(),d=null==s?void 0:s.console,f={},v={},p=!1;var h={addListener:function(e,t){var n,r=(n=e,!!d&&"function"==typeof d[n]&&(v[n]||(v[n]=d[n],d[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{if(f[n]&&!p){p=!0;var r=f[n];r&&r.forEach(function(t){try{t(n,e)}catch(e){}})}}catch(e){}return p=!1,v[n].apply(d,e)}),!0));if(!r)return new Error("Console override failed");f[e]?f[e].push(t):f[e]=[t]},removeListener:function(e){var t,n;try{for(var r=i(Object.values(f)),o=r.next();!o.done;o=r.next())for(var a=o.value,l=a.length-1;l>=0;l--)if(a[l]===e){a.splice(l,1);break}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},_restoreConsole:function(){var e,t;try{for(var n=i(Object.entries(v)),r=n.next();!r.done;r=n.next()){var a=o(r.value,2),l=a[0],u=a[1];u&&(d[l]=u)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}v={},f={}}},g=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],m="data-amp-track-",b=["div","span","h1","h2","h3","h4","h5","h6"],y=a(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],o(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),w=y,E=y,x=["*"],T="data-amp-mask",A="*****",k=/\b(?:\d[ -]*?){13,16}\b/,S=/(\d{3}-?\d{2}-?\d{4})/g,C=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,O={};Object.defineProperty(O,"__esModule",{value:!0}),O.Observable=void 0;const P=e=>Boolean(Symbol[e]),M=e=>P(e)?Symbol[e]:"@@"+e,_=M("iterator"),N=M("observable"),L=M("species");function D(e,t){let n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function I(e){let t=e.constructor;return void 0!==t&&(t=t[L],null===t&&(t=void 0)),void 0!==t?t:X}function R(e){R.log?R.log(e):setTimeout(()=>{throw e})}function B(e){Promise.resolve().then(()=>{try{e()}catch(e){R(e)}})}function j(e){let t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{let e=D(t,"unsubscribe");e&&e.call(t)}}catch(e){R(e)}}function H(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function U(e,t,n){e._state="running";let r=e._observer;try{let i=D(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(H(e),!i)throw n;i.call(r,n);break;case"complete":H(e),i&&i.call(r)}}catch(e){R(e)}"closed"===e._state?j(e):"running"===e._state&&(e._state="ready")}function q(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void B(()=>function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let n=0;n<t.length&&(U(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e))):void U(e,t,n);e._queue.push({type:t,value:n})}}class z{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let n=this,r={get closed(){return"closed"===n._state},next(e){q(n,"next",e)},error(e){q(n,"error",e)},complete(){q(n,"complete")}};try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(H(this),j(this))}}class X{constructor(e){if(!(this instanceof X))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new z(e,this._subscriber)}forEach(e){return new Promise((t,n)=>{if("function"!=typeof e)return void n(new TypeError(e+" is not a function"));function r(){i.unsubscribe(),t()}let i=this.subscribe({next(t){try{e(t,r)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t})})}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(I(this))(t=>this.subscribe({next(n){try{n=e(n)}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(I(this))(t=>this.subscribe({next(n){try{if(!e(n))return}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=I(this),n=arguments.length>1,r=!1,i=arguments[1];return new t(t=>this.subscribe({next(o){let a=!r;if(r=!0,!a||n)try{i=e(i,o)}catch(e){return t.error(e)}else i=o},error(e){t.error(e)},complete(){if(!r&&!n)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(i),t.complete()}}))}async all(){let e=[];return await this.forEach(t=>e.push(t)),e}concat(...e){let t=I(this);return new t(n=>{let r,i=0;return function o(a){r=a.subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){i===e.length?(r=void 0,n.complete()):o(t.from(e[i++]))}})}(this),()=>{r&&(r.unsubscribe(),r=void 0)}})}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=I(this);return new t(n=>{let r=[],i=this.subscribe({next(i){if(e)try{i=e(i)}catch(e){return n.error(e)}let a=t.from(i).subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){let e=r.indexOf(a);e>=0&&r.splice(e,1),o()}});r.push(a)},error(e){n.error(e)},complete(){o()}});function o(){i.closed&&0===r.length&&n.complete()}return()=>{r.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[N](){return this}static from(e){let t="function"==typeof this?this:X;if(null==e)throw new TypeError(e+" is not an object");let n=D(e,N);if(n){let r=n.call(e);if(Object(r)!==r)throw new TypeError(r+" is not an object");return function(e){return e instanceof X}(r)&&r.constructor===t?r:new t(e=>r.subscribe(e))}if(P("iterator")&&(n=D(e,_),n))return new t(t=>{B(()=>{if(!t.closed){for(let r of n.call(e))if(t.next(r),t.closed)return;t.complete()}})});if(Array.isArray(e))return new t(t=>{B(()=>{if(!t.closed){for(let n=0;n<e.length;++n)if(t.next(e[n]),t.closed)return;t.complete()}})});throw new TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:X)(t=>{B(()=>{if(!t.closed){for(let n=0;n<e.length;++n)if(t.next(e[n]),t.closed)return;t.complete()}})})}static get[L](){return this}}O.Observable=X,Object.defineProperty(X,Symbol("extensions"),{value:{symbol:N,hostReportError:R},configurable:!0});var Y=O.Observable;function G(e,t){return new Y(function(n){e.subscribe({next:function(e){t(e).then(function(e){return n.next(e)}).catch(function(e){return n.error(e)})},error:function(e){n.error(e)},complete:function(){n.complete()}})})}function W(e,t){return new Y(function(n){var r=!1,o=new Set,a=function(){var e,t;r=!0;try{for(var n=i(o),a=n.next();!a.done;a=n.next()){var l=a.value;try{l.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}o.clear()},l=function(e){var t=e.subscribe({next:function(e){r||n.next(e)},error:function(e){r||(r=!0,n.error(e),a())},complete:function(){o.delete(t),r||0!==o.size||(n.complete(),a(),r=!0)}});o.add(t)};return l(e),l(t),a})}function F(e){var t=new Set,n=null;function r(){null==n||n.unsubscribe(),n=null,t.clear()}return new Y(function(o){return t.add(o),null===n&&(n=e.subscribe({next:function(e){var n,r,o;try{for(var a=i(t),l=a.next();!l.done;l=a.next()){var u=l.value;null===(o=u.next)||void 0===o||o.call(u,e)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},error:function(e){var n,o,a;try{for(var l=i(t),u=l.next();!u.done;u=l.next()){var c=u.value;null===(a=c.error)||void 0===a||a.call(c,e)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}r()},complete:function(){var e,n,o;try{for(var a=i(t),l=a.next();!l.done;l=a.next()){var u=l.value;null===(o=u.complete)||void 0===o||o.call(u)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}r()}})),function(){t.delete(o),0===t.size&&n&&(n.unsubscribe(),n=null)}})}var V,$="https://app.amplitude.com",Z={US:$,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var J="__AMPLITUDE_MESSENGER_INSTANCE__",K="__AMPLITUDE_MESSENGER__",Q=function(){function e(e){var t=(void 0===e?{}:e).origin,n=void 0===t?$:t;this[V]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=n}return e.prototype.notify=function(e){var t,n,r,i;null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise(function(t,a){r.requestCallbacks[i]={resolve:t,reject:a},r.notify(o),n.timeout>0&&setTimeout(function(){a(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]},n.timeout)})},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.registerActionHandler=function(e,t){var n,r,o,a;this.actionHandlers.has(e)&&(null===(a=null===(o=this.logger)||void 0===o?void 0:o.warn)||void 0===a||a.call(o,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var l=this.pendingMessages.get(e);if(l){this.pendingMessages.delete(e);try{for(var u=i(l),c=u.next();!c.done;c=u.next()){t(c.value)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}},e.prototype.loadScriptOnce=function(e){return n(this,void 0,void 0,function(){var t,n,i;return r(this,function(r){switch(r.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];n=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,n){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){n({status:!1,message:"Failed to load the script ".concat(e)})}),null===(r=document.head)||void 0===r||r.appendChild(i)}catch(e){n(e)}})}(e).then(function(){}),this.scriptLoadPromises.set(e,n),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,n];case 2:return r.sent(),[3,4];case 3:throw i=r.sent(),this.scriptLoadPromises.delete(e),i;case 4:return[2]}})})},e.prototype.setup=function(e){var t,n,r=this,i=void 0===e?{}:e,o=i.logger,a=i.endpoint;o&&(this.logger=o),a&&this.endpoint===$&&(this.endpoint=a),this.isSetup||(this.isSetup=!0,null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,n,i,o,a;if(null===(n=null===(t=r.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message received: ",JSON.stringify(e)),r.endpoint===e.origin){var l=e.data,u=null==l?void 0:l.action;if(u)if("id"in l&&l.id)null===(o=null===(i=r.logger)||void 0===i?void 0:i.debug)||void 0===o||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),r.handleResponse(l);else{if("ping"===u)return void r.notify({action:"pong"});var c=r.actionHandlers.get(u);if(c)c(l.data);else{var s=null!==(a=r.pendingMessages.get(u))&&void 0!==a?a:[];s.push(l.data),r.pendingMessages.set(u,s)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=l();(null==e?void 0:e[K])===this&&delete e[K]},e}();function ee(e){var t,n=l(),r=null==n?void 0:n[K];if("object"==typeof(t=r)&&null!==t&&J in t&&!0===t[J])return r;var i=new Q(e);return n&&(n[K]=i),i}V=J;var te="__AMPLITUDE_BACKGROUND_CAPTURE__";var ne,re="1.28.4",ie="[Amplitude] Element Clicked",oe="[Amplitude] Element Tag",ae="[Amplitude] Element Text",le="[Amplitude] Page URL",ue="[Amplitude] Viewport Height",ce="[Amplitude] Viewport Width",se="[Amplitude] Page View ID",de="data-amp-mask-attributes",fe=["input","select","textarea"],ve=function(e){var t=e.pageUrlAllowlist,n=e.pageUrlExcludelist;return!(n&&n.length>0&&u(window.location.href,n))&&!!u(window.location.href,t)},pe=function(e,t){return function(n,r){var i,o,a=e.shouldTrackEventResolver,l=null===(o=null===(i=null==r?void 0:r.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!l)return!1;if(a)return a(n,r);if(!ve(e))return!1;var u=String(null==r?void 0:r.getAttribute("type"))||"";if("string"==typeof u)switch(u.toLowerCase()){case"hidden":case"password":return!1}if(t){var c=t.some(function(e){var t;return!!(null===(t=null==r?void 0:r.matches)||void 0===t?void 0:t.call(r,e))});if(!c)return!1}switch(l){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:return"click"===n}}},he=function(e){return e?e.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[]},ge=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(r)||(t[n]=r),t},{})},me=function(){var e;try{var t=l(),n=null===(e=null==t?void 0:t.sessionStorage)||void 0===e?void 0:e.getItem("AMP_PAGE_VIEW");if(!n)return;var r=JSON.parse(n);if("string"==typeof r.pageViewId)return r.pageViewId}catch(e){}},be=function(e,t){return e?t.some(function(t){var n;return null===(n=null==e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)})?e:be(null==e?void 0:e.parentElement,t):null},ye=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};!function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"}(ne||(ne={}));var we="__AMPLITUDE_VISUAL_TAGGING__";function Ee(e,t){var n=e;if(!0!==n[we]){n[we]=!0;var r=t.dataExtractor,i=t.isElementSelectable,o=t.cssSelectorAllowlist,a=t.actionClickAllowlist,l=null,u=function(t){e.notify({action:"element-selected",data:t})},c=function(t,n){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:n}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:n})};e.registerActionHandler("initialize-visual-tagging-selector",function(t){e.loadScriptOnce("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then(function(){var n;l=null===(n=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===n?void 0:n.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(e){return!i||i((null==t?void 0:t.actionType)||"click",e)},onTrack:c,onSelect:u,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:a,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:re}}}),e.notify({action:"selector-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var e;null===(e=null==l?void 0:l.close)||void 0===e||e.call(l)})}}var xe=l(),Te=function(){return new Y(function(e){var t=new MutationObserver(function(t){e.next(t)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},Ae=function(e){return void 0===e&&(e="click"),new Y(function(t){var n,r=function(e){t.next(e)};return null===(n=l())||void 0===n||n.document.addEventListener(e,r,{capture:!0}),function(){var t;null===(t=l())||void 0===t||t.document.removeEventListener(e,r,{capture:!0})}})},ke=function(){var e=W(new Y(function(e){var n=function(n){if(n instanceof ErrorEvent){var r={kind:"error"};n.error instanceof Error||n.error instanceof DOMException?r=t(t({},r),{message:n.error.message,stack:n.error.stack,filename:n.filename,lineNumber:n.lineno,columnNumber:n.colno}):"string"==typeof n.error&&(r.message=n.error),e.next(r)}};return xe.addEventListener("error",n),function(){xe.removeEventListener("error",n)}}),new Y(function(e){var t=function(t){var n={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(n.message=t.reason.message,n.stack=t.reason.stack):"string"==typeof t.reason&&(n.message=t.reason),e.next(n)};return xe.addEventListener("unhandledrejection",t),function(){xe.removeEventListener("unhandledrejection",t)}}));return W(e,new Y(function(e){var t=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=void 0;Array.isArray(n[0])&&"string"==typeof n[0][0]&&(i=n[0][0]),e.next({kind:"console",message:i})};return h.addListener("error",t),function(){h.removeListener(t)}}))},Se=function(e,t,n){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=n.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}})},Ce={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},Oe=function(e){var t,n,r,o,a=Object.values(Ce).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return a;try{for(var l=i(e),u=l.next();!u.done;u=l.next()){var c=u.value;try{try{for(var s=(r=void 0,i(c.definition)),d=s.next();!d.done;d=s.next()){var f=d.value,v=Ce[f.event_type];v&&a[v].add(c.id)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==c?void 0:c.id,e)}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return a},Pe=function(e){var t,n,r,o,a=new Map;try{for(var l=i(e),u=l.next();!u.done;u=l.next()){var c=u.value;try{for(var s=(r=void 0,i(c.conditions)),d=s.next();!d.done;d=s.next()){var f=d.value;if("LABELED_EVENT"===f.type){var v=f.match.eventId,p=a.get(v);p||(p=[],a.set(v,p)),p.push(c)}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return a},Me=function(e,t){return t.filter(function(t){return t.definition.some(function(t){return Ce[t.event_type]===e.type&&t.filters.every(function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){return console.error("Error matching event to filter",e),!1}return!1}(e,t)})})})},_e=function(){function e(e,t,n,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=n,this.options=r}return e.prototype.evaluate=function(e){var t,n,r=this.options.pageActions;if(!r)return e;var o=function(e,t){var n,r,o,a,l=new Set;try{for(var u=i(e),c=u.next();!c.done;c=u.next()){var s=c.value,d=t.get(s.id);if(d)try{for(var f=(o=void 0,i(d)),v=f.next();!v.done;v=f.next()){var p=v.value;l.add(p)}}catch(e){o={error:e}}finally{try{v&&!v.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return Array.from(l)}(Me(e,Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return r.labeledEvents[e]})),this.labeledEventToTriggerMap);try{for(var a=i(o),l=a.next();!l.done;l=a.next()){var u=l.value;Se(u.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=n},e}(),Ne=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",de,T]),Le=["type"],De=["svg","path","g"],Ie=["password","hidden"];function Re(e,t){var n,r,o,a,l,u;if(null===e)return null;var c=String(e.tagName).toLowerCase(),s={tag:c},d=Array.from(null!==(a=null===(o=e.parentElement)||void 0===o?void 0:o.children)&&void 0!==a?a:[]);d.length&&(s.index=d.indexOf(e),s.indexOfType=d.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var f=null===(u=null===(l=e.previousElementSibling)||void 0===l?void 0:l.tagName)||void 0===u?void 0:u.toLowerCase();f&&(s.prevSib=String(f));var v=e.getAttribute("id");v&&(s.id=String(v));var p=Array.from(e.classList);p.length&&(s.classes=p);var h={},g=Array.from(e.attributes).filter(function(e){return!Ne.has(e.name)}),m=!function(e){var t,n,r,i=null===(n=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t),o=e instanceof HTMLElement&&"true"===(null===(r=e.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!fe.includes(i)&&!o}(e);if(!Ie.includes(String(e.getAttribute("type")))&&!De.includes(c))try{for(var b=i(g),y=b.next();!y.done;y=b.next()){var w=y.value;m&&!Le.includes(w.name)||(t.has(w.name)?h[w.name]=A:h[w.name]=String(w.value).substring(0,128))}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=b.return)&&r.call(b)}finally{if(n)throw n.error}}return Object.keys(h).length&&(s.attrs=h),s}function Be(e,t){var n=e.getAttribute(t.explicitTrackingAttribute);if(null!==n&&""===n)return null;var r=e.getAttribute("id");return null===r||""===r?null:function(e,t){var n,r;if(null==e||""===e)return!1;try{for(var o=i(t),a=o.next();!a.done;a=o.next())if(a.value.test(e))return!1}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!0}(r,t.autogeneratedIdPatterns)?r:null}function je(e,t){return t.map(He).join(" > ")}function He(e){var t=e.tagName.toLowerCase(),n=e.parentElement;if(null===n)return t;var r=function(e,t){for(var n=0,r=0;r<t.children.length;r++){var i=t.children[r];if(i.tagName===e.tagName&&(n+=1,i===e))return n}return 1}(e,n);return"".concat(t,":nth-of-type(").concat(r,")")}function Ue(e){var t=globalThis.CSS;if(t&&"function"==typeof t.escape)return t.escape(e);for(var n=String(e),r=n.length,i="",o=0;o<r;o++){var a=n.charCodeAt(o);0!==a?a>=1&&a<=31||127===a||0===o&&a>=48&&a<=57||1===o&&a>=48&&a<=57&&45===n.charCodeAt(0)?i+="\\".concat(a.toString(16)," "):i+=0!==o||1!==r||45!==a?a>=128||45===a||95===a||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?n.charAt(o):"\\".concat(n.charAt(o)):"\\-":i+="�"}return i}function qe(e){return Ue(e)}var ze=[{name:"explicitTrackingAttribute",try:function(e,t){var n=t.config.explicitTrackingAttribute,r=e.getAttribute(n);return null===r||""===r?null:"[".concat(n,"=").concat(JSON.stringify(r),"]")}},{name:"stableId",try:function(e,t){var n=Be(e,t.config);return null===n?null:"".concat(e.tagName.toLowerCase(),"#").concat(qe(n))}}];function Xe(e,t,n){var r,o,a,l,u;void 0===n&&(n={});var c=null!==(a=n.strategies)&&void 0!==a?a:ze,s=null!==(u=null!==(l=n.scope)&&void 0!==l?l:e.ownerDocument)&&void 0!==u?u:document,d={scope:s,config:t},f=function(e,t){var n=[],r=e;for(;null!==r&&(n.push(r),!(void 0!==t&&n.length>t));)r=r.parentElement;return n}(e,t.maxAncestorWalkDepth);try{for(var v=i(c),p=v.next();!p.done;p=v.next())for(var h=p.value,g=0;g<f.length;g++){var m=f[g],b=h.try(m,d);if(null!==b)if(0!==g){var y=je(0,f.slice(0,g).reverse()),w="".concat(b," > ").concat(y);if(Ye(s,w,e,h.name,n.logger))return w}else if(Ye(s,b,e,h.name,n.logger))return b}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=v.return)&&o.call(v)}finally{if(r)throw r.error}}return null}function Ye(e,t,n,r,i){var o;try{o=e.querySelectorAll(t)}catch(e){var a=e instanceof Error?e.message:String(e);return null==i||i.debug('@amplitude/element-selector: strategy "'.concat(r,'" emitted a malformed selector "').concat(t,'" (').concat(a,")")),!1}return 1===o.length&&o[0]===n}function Ge(e){var t=e.tagName.toLowerCase(),n=e.parentElement;if(null===n)return t;var r=function(e,t){for(var n=0,r=0;r<t.children.length;r++){var i=t.children[r];if(i.tagName===e.tagName&&(n+=1,i===e))return n}return 1}(e,n);return"".concat(t,":nth-of-type(").concat(r,")")}function We(e,t,n){var r;try{r=e.querySelectorAll(t)}catch(e){return!1}return 1===r.length&&r[0]===n}var Fe=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),Ve=function(e,t,n){var r,o;if(e.nodeType!==Node.ELEMENT_NODE)return null;var a=e.getAttribute("id");if(t){if(a)return new Fe(Ze(a),!0);var l=e.tagName.toLowerCase();if("body"===l||"head"===l||"html"===l)return new Fe(l,!0)}var u=e.tagName.toLowerCase();if(a)return new Fe(u+Ze(a),!0);var c=e.parentNode;if(!c||c.nodeType===Node.DOCUMENT_NODE)return new Fe(u,!0);for(var s=$e(e),d=!1,f=!1,v=-1,p=-1,h=c.children,g=0;h&&(-1===v||!f)&&g<h.length;++g){var m=h[g];if(m.nodeType===Node.ELEMENT_NODE)if(p+=1,m!==e){if(!f&&m.tagName.toLowerCase()===u){d=!0;var b=new Set(s);if(b.size)for(var y=$e(m),w=0;w<y.length;++w){var E=y[w];if(b.has(E)&&(b.delete(E),!b.size)){f=!0;break}}else f=!0}}else v=p}var x=u;if(n&&"input"===u.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(x+="[type="+Ue(e.getAttribute("type")||"")+"]"),f)x+=":nth-child("+String(v+1)+")";else if(d)try{for(var T=i(s),A=T.next();!A.done;A=T.next()){x+="."+Ue(A.value.slice(1))}}catch(e){r={error:e}}finally{try{A&&!A.done&&(o=T.return)&&o.call(T)}finally{if(r)throw r.error}}return new Fe(x,!1)},$e=function(e){var t=e.getAttribute("class");return t?t.split(/\s+/g).filter(Boolean).map(function(e){return"$"+e}):[]},Ze=function(e){return"#"+Ue(e)};function Je(e,t){try{return function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var n=[],r=e;r;){var i=Ve(r,Boolean(t),r===e);if(!i)break;if(n.push(i),i.optimized)break;r=r.parentElement}return n.reverse(),n.join(" > ")}(e)}catch(e){var n=e instanceof Error?e.message:String(e);return null==t||t.warn("@amplitude/element-selector: legacyCssPath threw — emitting empty selector: ".concat(n)),""}}var Ke,Qe=Object.freeze({enabled:!1,explicitTrackingAttribute:"data-amp-track-id",autogeneratedIdPatterns:a([],o([/^:r[0-9a-z]+:$/,/^radix-/,/^headlessui-/,/^mui-/,/^[a-f0-9]{16,}$/i,/-\d{8,}$/,/\d{4,}/]),!1),unstableClassPatterns:a([],o([/^(p|m|px|py|mx|my|pt|pb|pl|pr|mt|mb|ml|mr)-\d+$/,/^(w|h|min-w|max-w|min-h|max-h)-/,/^(text|bg|border|ring|fill|stroke)-/,/^(hover|focus|active|disabled|group-hover):/,/^(sm|md|lg|xl|2xl):/,/^z-\d+$/,/^data-\[/,/^\[/,/^css-[a-z0-9]{6,}$/,/^[a-zA-Z]+_[a-zA-Z0-9]{3,}__[a-zA-Z0-9]{5,}$/,/^sc-[a-zA-Z0-9]{6,}$/,/^jsx-\d+$/,/^swiper-slide-(visible|fully-visible|active|prev|next|duplicate)$/,/^is-(active|open|selected|hovered|focused|expanded)$/,/^Mui[A-Z][a-zA-Z]+-(focused|selected|disabled|expanded|focusVisible|active|checked)$/,/^Mui-(selected|focused|disabled|expanded|focusVisible|active|checked)$/,/^data-state-/]),!1),maxAncestorWalkDepth:void 0});function et(e,t){if(!e)return tt();var n,r=tt();return"boolean"==typeof e.enabled&&(r.enabled=e.enabled),"string"==typeof e.explicitTrackingAttribute&&""!==e.explicitTrackingAttribute&&(r.explicitTrackingAttribute=e.explicitTrackingAttribute),Array.isArray(e.autogeneratedIdPatterns)&&(r.autogeneratedIdPatterns=function(e,t){var n,r,o=[];try{for(var a=i(e),l=a.next();!l.done;l=a.next()){var u=l.value;try{o.push(new RegExp(u))}catch(e){var c=e instanceof Error?e.message:String(e);null==t||t.warn('@amplitude/element-selector: ignoring invalid autogenerated-id pattern "'.concat(u,'" (').concat(c,")"))}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}(e.autogeneratedIdPatterns,t)),Array.isArray(e.unstableClassPatterns)&&(r.unstableClassPatterns=function(e,t){var n,r,o=[];try{for(var a=i(e),l=a.next();!l.done;l=a.next()){var u=l.value;try{o.push(new RegExp(u))}catch(e){var c=e instanceof Error?e.message:String(e);null==t||t.warn('@amplitude/element-selector: ignoring invalid unstable-class pattern "'.concat(u,'" (').concat(c,")"))}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}(e.unstableClassPatterns,t)),r.maxAncestorWalkDepth="number"!=typeof(n=e.maxAncestorWalkDepth)?void 0:Number.isFinite(n)?n<=0?void 0:Math.floor(n):void 0,r}function tt(){return{enabled:Qe.enabled,explicitTrackingAttribute:Qe.explicitTrackingAttribute,autogeneratedIdPatterns:a([],o(Qe.autogeneratedIdPatterns),!1),unstableClassPatterns:a([],o(Qe.unstableClassPatterns),!1),maxAncestorWalkDepth:Qe.maxAncestorWalkDepth}}function nt(e,t){void 0===t&&(t={});var n=e,r=new Set,l=t.logger,u={strategies:t.strategies,scope:t.scope,logger:l};return{generate:function(e){var r,i;if(!n.enabled)return Je(e,l);try{var c=Xe(e,n,u);return null!==c?c:function(e,t,n){var r,i;void 0===n&&(n={});for(var l=null!==(i=null!==(r=n.scope)&&void 0!==r?r:e.ownerDocument)&&void 0!==i?i:document,u=[],c=e,s=0;null!==c&&!(void 0!==t.maxAncestorWalkDepth&&s>t.maxAncestorWalkDepth);){var d=Be(c,t);if(null!==d){var f=a(["".concat(c.tagName.toLowerCase(),"#").concat(qe(d))],o(u),!1).join(" > ");if(We(l,f,e))return f}u.unshift(Ge(c)),c=c.parentElement,s+=1}return u.join(" > ")}(e,n,{scope:null!==(i=null!==(r=t.scope)&&void 0!==r?r:e.ownerDocument)&&void 0!==i?i:document})}catch(t){var s=t instanceof Error?t.message:String(t);return null==l||l.warn("@amplitude/element-selector: strategy chain threw — falling back to legacy cssPath: ".concat(s)),Je(e,l)}},getConfig:function(){return n},updateConfig:function(e){var t,o;n=e;try{for(var a=i(r),u=a.next();!u.done;u=a.next()){var c=u.value;try{c(e)}catch(e){var s=e instanceof Error?e.message:String(e);null==l||l.warn("@amplitude/element-selector: onConfigChange subscriber threw — ".concat(s))}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(t)throw t.error}}},onConfigChange:function(e){return r.add(e),function(){r.delete(e)}}}}var rt,it=function(e,t){var n,r,l,u=this;this.replaceSensitiveString=function(e){return function(e,t){var n,r;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var o=e;o=(o=(o=o.replace(k,A)).replace(S,A)).replace(C,A);try{for(var a=i(t),l=a.next();!l.done;l=a.next()){var u=l.value;try{o=o.replace(u,A)}catch(e){}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}(e,u.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,n,r,l,c,s=performance.now();if(!e)return[];for(var d=function(e){var t=[];if(!e)return t;t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e),f=new Map,v=d.length-1;v>=0;v--){var p=d[v];if(p){var h=he(p.getAttribute(de)),g=v===d.length-1?[]:null!==(r=f.get(d[v+1]))&&void 0!==r?r:new Set,m=new Set(a(a([],o(g),!1),o(h),!1));f.set(p,m)}}c=d.map(function(e){var t;return Re(e,null!==(t=f.get(e))&&void 0!==t?t:new Set)});var b=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var n=o(t,2),r=n[0],i=n[1];e.attrs&&(e.attrs[r]=u.replaceSensitiveString(i))})};try{for(var y=i(c),w=y.next();!w.done;w=y.next())b(w.value)}catch(e){t={error:e}}finally{try{w&&!w.done&&(n=y.return)&&n.call(y)}finally{if(t)throw t.error}}var E=performance.now();return null===(l=u.diagnosticsClient)||void 0===l||l.recordHistogram("autocapturePlugin.getHierarchy",E-s),c},this.getNearestLabel=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?u.getText(t):u.getNearestLabel(n)},this.getElementPath=function(e){var t;if(!e)return"";var n=performance.now(),r=u.selectorEngine.generate(e),i=performance.now();return null===(t=u.diagnosticsClient)||void 0===t||t.recordHistogram("autocapturePlugin.getElementPath",i-n),r},this.updateSelectorConfig=function(e,t){u.selectorEngine.updateConfig(et(null!=e?e:void 0,t))},this.getEventProperties=function(e,t,n){var r,i,a,l,s,d,f=null===(a=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===a?void 0:a.call(i),v="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},p=u.getHierarchy(t),h=null===(l=p[0])||void 0===l?void 0:l.attrs,g=u.getNearestLabel(t),m=(s=null!=h?h:{},d=n,Object.entries(s).reduce(function(e,t){var n=o(t,2),r=n[0],i=n[1];if(r.startsWith(d)){var a=r.replace(d,"");a&&(e[a]=i||"")}return e},{})),b=((r={})["[Amplitude] Element Hierarchy"]=p,r[oe]=f,r[ae]=u.getText(t),r["[Amplitude] Element Position Left"]=null==v.left?null:Math.round(v.left),r["[Amplitude] Element Position Top"]=null==v.top?null:Math.round(v.top),r["[Amplitude] Element Attributes"]=m,r["[Amplitude] Element Path"]=u.getElementPath(t),r["[Amplitude] Element Parent Label"]=g,r[le]=c(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(T)?A:e?e(document.title):document.title}(u.replaceSensitiveString),r[ue]=window.innerHeight,r[ce]=window.innerWidth,r),y=me();if(y&&(b[se]=y),b["[Amplitude] Element ID"]=t.getAttribute("id")||"",b["[Amplitude] Element Class"]=t.getAttribute("class"),b["[Amplitude] Element Aria Label"]=null==h?void 0:h["aria-label"],"a"===f&&"click"===e&&t instanceof HTMLAnchorElement){var w=t.href.substring(0,128);b["[Amplitude] Element Href"]=u.replaceSensitiveString(w)}return ge(b)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,n,r,i){void 0===i&&(i=!1);var o=u.addTypeAndTimestamp(e,t);if(function(e){return"click"===e.type||"change"===e.type}(o)&&null!==o.event.target){if(i){var a=function(e,t){var n,r=null===(n=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===n?void 0:n.call(window,e);return"pointer"===(null==r?void 0:r.getPropertyValue("cursor"))&&"click"===t}(o.event.target,o.type);if(a)return o.closestTrackedAncestor=o.event.target,o.targetElementProperties=u.getEventProperties(o.type,o.closestTrackedAncestor,r),o}var l=be(o.event.target,n);return l&&(o.closestTrackedAncestor=l,o.targetElementProperties=u.getEventProperties(o.type,l,r)),o}return o},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;return e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector?n.querySelector(e.selector):n}}catch(e){return}}(e,t);if(!n)return;return"TEXT"===e.elementExtractType?u.getText(n):"ATTRIBUTE"===e.elementExtractType&&e.attribute?n.getAttribute(e.attribute):void 0}},this.getTextWithMaskedDescendants=function(e){var t,n,r="[".concat(T,"], [contenteditable]");if(!e.querySelector(r))return e.innerText;var o="",a=Array.from(e.childNodes);try{for(var l=i(a),c=l.next();!c.done;c=l.next()){var s=c.value;s.nodeType!==Node.TEXT_NODE?s instanceof Element&&(s.hasAttribute(T)||s.hasAttribute("contenteditable")?o+=A:o+=u.getTextWithMaskedDescendants(s)):o+=s.textContent||""}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return o},this.getText=function(e){if(null!==e.closest("[".concat(T,"]")))return A;var t="";return t=e.querySelector("[".concat(T,"], [contenteditable]"))?u.getTextWithMaskedDescendants(e):e.innerText||"",u.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){var t,n,r;if(!e)return{};var i=null===(r=null===(n=null==e?void 0:e.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n),o=((t={})[oe]=i,t[ae]=u.getText(e),t[le]=window.location.href.split("?")[0],t);return ge(o)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient,this.selectorEngine=(Ke||(Ke=nt(et())),Ke);var s=null!==(l=e.maskTextRegex)&&void 0!==l?l:[],d=[];try{for(var f=i(s),v=f.next();!v.done;v=f.next()){var p=v.value;if(d.length>=25)break;if(p instanceof RegExp)d.push(p);else if("pattern"in p&&"string"==typeof p.pattern)try{d.push(new RegExp(p.pattern,"i"))}catch(e){}}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=d};function ot(e,t){var n=e.remoteConfigClient;if(e.fetchRemoteConfig&&n){var r=n.subscribe("configs.analyticsSDK.elementSelector","all",function(n){t.updateSelectorConfig(n,e.loggerProvider)});return function(){n.unsubscribe(r)}}}!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.ScrollObservable="scrollObservable",e.ExposureObservable="exposureObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"}(rt||(rt={}));var at=function(e,u){var s,d,f,v,p,h,y,w,E,x,T,A;void 0===e&&(e={}),null==u||u.diagnosticsClient.setTag("plugin.autocapture.version",re);var k=e.dataAttributePrefix,S=void 0===k?m:k,C=e.visualTaggingOptions,O=void 0===C?{enabled:!0}:C;e.cssSelectorAllowlist=null!==(s=e.cssSelectorAllowlist)&&void 0!==s?s:g,e.actionClickAllowlist=null!==(d=e.actionClickAllowlist)&&void 0!==d?d:b,e.debounceTime=null!==(f=e.debounceTime)&&void 0!==f?f:0;var P=!1!==(null===(v=e.viewportContentUpdated)||void 0===v?void 0:v.enabled),M=null!==(y=null!==(h=null===(p=e.viewportContentUpdated)||void 0===p?void 0:p.exposureDuration)&&void 0!==h?h:e.exposureDuration)&&void 0!==y?y:150;e.viewportContentUpdated=t(t({},e.viewportContentUpdated),{exposureDuration:M}),e.pageUrlExcludelist=null===(w=e.pageUrlExcludelist)||void 0===w?void 0:w.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(n){return console.warn("Invalid regex pattern: ".concat(t.pattern),n),e}return e},[]);var _,N="@amplitude/plugin-autocapture-browser",L=[],D=new it(e,u),I=new Set,R=new Set,B=function(){var t,n,r=F(Ae().map(function(t){return D.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,S)})),i=F(new Y(function(t){var n,r=function(n){var r=D.addAdditionalEventProperties(n,"change",e.cssSelectorAllowlist,S);t.next(r)};return null===(n=l())||void 0===n||n.document.addEventListener("change",r,{capture:!0}),function(){var e;return null===(e=l())||void 0===e?void 0:e.document.removeEventListener("change",r)}}));window.navigation&&(n=F(new Y(function(t){var n=function(n){var r=D.addAdditionalEventProperties(n,"navigate",e.cssSelectorAllowlist,S);t.next(r)};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}})));var o=F(Te().map(function(t){return D.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,S)})),a=new Y(function(e){var t,n=function(t){e.next(t)};return null===(t=l())||void 0===t||t.addEventListener("scroll",n),function(){var e;null===(e=l())||void 0===e||e.removeEventListener("scroll",n)}}),u=function(e,t){return new Y(function(n){var r,i=l();if(!(null==i?void 0:i.IntersectionObserver))return function(){};var o=new IntersectionObserver(function(e){e.forEach(function(e){n.next(e)})},{root:null,rootMargin:"0px",threshold:1}),a=t.join(",");(null!==(r=null==i?void 0:i.document.querySelectorAll(a))&&void 0!==r?r:[]).forEach(function(e){o.observe(e)});var u=e.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(e){e instanceof Element&&(e.matches(a)&&o.observe(e),e.querySelectorAll(a).forEach(function(e){o.observe(e)}))})})});return function(){u.unsubscribe(),o.disconnect()}})}(o,e.cssSelectorAllowlist);return(t={})[rt.ChangeObservable]=i,t[rt.ClickObservable]=r,t[rt.MutationObservable]=o,t[rt.NavigateObservable]=n,t[rt.ScrollObservable]=a,t[rt.ExposureObservable]=u,t},j=Oe(Object.values(null!==(x=null===(E=e.pageActions)||void 0===E?void 0:E.labeledEvents)&&void 0!==x?x:{})),H=Pe(null!==(A=null===(T=e.pageActions)||void 0===T?void 0:T.triggers)&&void 0!==A?A:[]),U=function(e,t,n,r){return new _e(e,t,n,r)}(j,H,D,e);return{name:N,type:"enrichment",setup:function(i,u){return n(void 0,void 0,void 0,function(){var n,s,d,f,v,p,h,g,m,b,y,w,E,x,T,A,k,C,q,z,X,Y;return r(this,function(r){return"undefined"==typeof document||(n=!1,s={maxX:void 0,maxY:void 0},i.fetchRemoteConfig&&(i.remoteConfigClient?i.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(n){!function(n){var r,i;n&&(e.pageActions=t(t({},e.pageActions),n),j=Oe(Object.values(null!==(r=e.pageActions.labeledEvents)&&void 0!==r?r:{})),H=Pe(null!==(i=e.pageActions.triggers)&&void 0!==i?i:[]),U.update(j,H,e))}(n)}):i.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),(d=ot(i,D))&&L.push({unsubscribe:d}),f=pe(e,e.cssSelectorAllowlist),v=pe(e,e.actionClickAllowlist),p=B(),h=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackEvent,i=e.evaluateTriggers;return n.clickObservable.filter(ye).filter(function(e){return r("click",e.closestTrackedAncestor)}).map(function(e){return i(e)}).subscribe(function(e){null==t||t.track(ie,e.targetElementProperties)})}({allObservables:p,amplitude:u,shouldTrackEvent:f,evaluateTriggers:U.evaluate.bind(U)}),L.push(h),g=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return n.changeObservable.filter(ye).filter(function(e){return i("change",e.closestTrackedAncestor)}).map(function(e){return o(e)}).subscribe(function(e){null==t||t.track("[Amplitude] Element Changed",r("change",e.closestTrackedAncestor))})}({allObservables:p,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return D.getEventProperties.apply(D,a(a([],o(e),!1),[S],!1))},amplitude:u,shouldTrackEvent:f,evaluateTriggers:U.evaluate.bind(U)}),L.push(g),m=function(e){var t=e.amplitude,n=e.allObservables,r=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,a=e.shouldTrackActionClick,l=n.clickObservable,u=n.mutationObservable,c=n.navigateObservable,s=l.filter(function(e){return!o("click",e.closestTrackedAncestor)}).map(function(e){var t=be(e.event.target,r.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e}).filter(ye).filter(function(e){return a("click",e.closestTrackedAncestor)}),d=c?W(u,c):u,f=W(s,d),v=null,p=null;return G(f,function(e){if(v&&(clearTimeout(v),v=null),"click"===e.type)return p=e,v=setTimeout(function(){v=null,p=null},500),Promise.resolve(null);if(p){var t=p;return p=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==t||t.track(ie,i("click",e.closestTrackedAncestor)))})}({allObservables:p,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return D.getEventProperties.apply(D,a(a([],o(e),!1),[S],!1))},amplitude:u,shouldTrackEvent:f,shouldTrackActionClick:v}),m&&L.push(m),b=function(e){e.amplitude;var t=e.allObservables.scrollObservable,n={maxX:0,maxY:0},r=t.subscribe(function(){var e,t,r,i,o=l(),a=Math.floor(null!==(t=null!==(e=null==o?void 0:o.scrollX)&&void 0!==e?e:null==o?void 0:o.pageXOffset)&&void 0!==t?t:0),u=Math.floor(null!==(i=null!==(r=null==o?void 0:o.scrollY)&&void 0!==r?r:null==o?void 0:o.pageYOffset)&&void 0!==i?i:0);n.maxX=Math.max(n.maxX,a),n.maxY=Math.max(n.maxY,u)});return{unsubscribe:function(){r.unsubscribe()},getState:function(){return n},reset:function(){n.maxX=0,n.maxY=0}}}({allObservables:p,amplitude:u}),L.push(b),y={},w=l(),E=function(e){e&&n||(setTimeout(function(){n=!1},100),n=!0,function(e){var t,n,r,i,o,a,u=e.amplitude,s=e.scrollTracker,d=e.currentElementExposed,f=e.elementExposedForPage,v=e.exposureTracker,p=e.isPageEnd,h=e.lastScroll,g=s.getState(),m=l(),b=null!==(n=null==m?void 0:m.innerWidth)&&void 0!==n?n:0,y=null!==(r=null==m?void 0:m.innerHeight)&&void 0!==r?r:0,w=((t={})[le]=c(null!==(a=null===(o=null===(i=null==m?void 0:m.location)||void 0===i?void 0:i.href)||void 0===o?void 0:o.split("?")[0])&&void 0!==a?a:""),t["[Amplitude] Max Page X"]=g.maxX+b,t["[Amplitude] Max Page Y"]=g.maxY+y,t[ue]=y,t[ce]=b,t["[Amplitude] Element Exposed"]=Array.from(d),t),E=me();E&&(w[se]=E),0!==d.size||g.maxX!==h.maxX||g.maxY!==h.maxY?(null==u||u.track("[Amplitude] Viewport Content Updated",w),h.maxX=g.maxX,h.maxY=g.maxY,d.clear(),p&&(s.reset(),f.clear(),null==v||v.reset())):p&&(s.reset(),f.clear(),null==v||v.reset())}({amplitude:u,scrollTracker:b,currentElementExposed:R,elementExposedForPage:I,exposureTracker:y.exposure,isPageEnd:e,lastScroll:s}))},x=function(e){!function(e,t,n,r){if(!t.has(e)){t.add(e),n.add(e);var i=Array.from(n);JSON.stringify(i).length>=18e3&&r(!1)}}(e,I,R,E)},P&&(y.exposure=function(e){var t=e.allObservables,n=e.onExposure,r=e.dataExtractor,i=e.exposureDuration,o=void 0===i?150:i,a=new Map,l=new Map,u=t.exposureObservable.subscribe(function(e){var t=e,i=t.target;if(t.isIntersecting){if(!a.get(i)){var u=setTimeout(function(){a.set(i,!0);var e=r.getElementPath(i);n(e),l.set(i,null)},o);l.set(i,u)}}else!t.isIntersecting&&t.intersectionRatio<1&&(u=l.get(i))&&(clearTimeout(u),l.set(i,null))});return{unsubscribe:function(){u.unsubscribe()},reset:function(){l.forEach(function(e){e&&clearTimeout(e)}),l.clear(),a.clear()}}}({allObservables:p,onExposure:x,dataExtractor:D,exposureDuration:M}),y.exposure&&L.push(y.exposure),T=function(){E(!0)},null==w||w.addEventListener("beforeunload",T),_=function(){null==w||w.removeEventListener("beforeunload",T)},L.push({unsubscribe:function(){return _()}}),(A=p[rt.NavigateObservable])?L.push(A.subscribe(function(){E(!0)})):w&&(k=function(){E(!0)},w.addEventListener("popstate",k),C=w.history.pushState,w.history&&C&&(w.history.pushState=new Proxy(C,{apply:function(e,t,n){var r=o(n,3),i=r[0],a=r[1],l=r[2];e.apply(t,[i,a,l]),E(!0)}})),L.push({unsubscribe:function(){w.removeEventListener("popstate",k),w.history&&C&&(w.history.pushState=C)}}))),null===(Y=null==i?void 0:i.loggerProvider)||void 0===Y||Y.log("".concat(N," has been successfully added.")),window.opener&&O.enabled&&(q=e.cssSelectorAllowlist,z=e.actionClickAllowlist,Ee(X=ee(),{dataExtractor:D,isElementSelectable:pe(e,a(a([],o(q),!1),o(z),!1)),cssSelectorAllowlist:q,actionClickAllowlist:z}),function(e,t){var n,r=e;if(!0!==r[te]){r[te]=!0;var i=null!==(n=null==t?void 0:t.scriptUrl)&&void 0!==n?n:"https://cdn.amplitude.com/libs/background-capture-1.0.3.js.gz",o=null,a=function(t,n){var r,i;"background-capture-complete"===t&&(null===(i=null===(r=e.logger)||void 0===r?void 0:r.debug)||void 0===i||i.call(r,"Background capture complete"),e.notify({action:"background-capture-complete",data:n}))};e.registerActionHandler("initialize-background-capture",function(){var t,n;null===(n=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Initializing background capture (external script)");var r=new URL(i,e.endpoint).toString();e.loadScriptOnce(r).then(function(){var t,n,r;null===(n=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Background capture script loaded (external)"),o=null===(r=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===r?void 0:r.call(window,{messenger:e,onBackgroundCapture:a}),e.notify({action:"background-capture-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var e;null===(e=null==o?void 0:o.close)||void 0===e||e.call(o),o=null})}}(X),X.setup(t({logger:null==i?void 0:i.loggerProvider},(null==i?void 0:i.serverZone)&&{endpoint:Z[i.serverZone]})))),[2]})})},execute:function(e){return n(void 0,void 0,void 0,function(){return r(this,function(t){return[2,e]})})},teardown:function(){return n(void 0,void 0,void 0,function(){var e,t,n,o;return r(this,function(r){try{for(e=i(L),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(o=e.return)&&o.call(e)}finally{if(n)throw n.error}}return[2]})})}}},lt=["mutation","navigate"];function ut(e,t){var n,r,i,o,a=t.event,l=a.pageX,u=a.pageY;e.yMin=Math.min(null!==(n=e.yMin)&&void 0!==n?n:u,u),e.yMax=Math.max(null!==(r=e.yMax)&&void 0!==r?r:u,u),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:l,l),e.xMax=Math.max(null!==(o=e.xMax)&&void 0!==o?o:l,l),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function ct(e){if(0===e.length)return null;var n=e[0],r=e[e.length-1];return{rageClickEvent:t({"[Amplitude] Begin Time":new Date(n.timestamp).toISOString(),"[Amplitude] End Time":new Date(r.timestamp).toISOString(),"[Amplitude] Duration":r.timestamp-n.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},n.targetElementProperties),time:n.timestamp}}function st(e){var t=this,i=e.amplitude,o=e.allObservables,a=e.shouldTrackRageClick,l=o.clickObservable,u=o.selectionObservable,c=[],s={},d=null;function f(e){c=[],s={},e&&(ut(s,e),c.push(e))}var v=G(l.filter(function(e){return a("click",e.closestTrackedAncestor)}),function(e){return n(t,void 0,void 0,function(){var t;return r(this,function(n){return ut(s,e),t=null,0===c.length||function(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}(c,e)||function(e,t){var n=e[Math.max(0,e.length-4+1)];return t.timestamp-n.timestamp>=1e3}(c,e)||s.isOutOfBounds?(d&&(t=ct(c)),f(e)):c.push(e),d&&(clearTimeout(d.timerId),d.resolve(t),d=null),c.length>=4?[2,new Promise(function(e){d={resolve:e,timerId:setTimeout(function(){e(ct(c))},1e3)}})]:[2,null]})})}),p=null==u?void 0:u.subscribe(function(){f()}),h=v.subscribe(function(e){null!==e&&i.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){h.unsubscribe(),null==p||p.unsubscribe()}}}var dt,ft;!function(e){e.INCREASING="increasing",e.DECREASING="decreasing"}(dt||(dt={})),function(e){e.X="x",e.Y="y"}(ft||(ft={}));function vt(e){var t=e.changes,n=e.changesThreshold,r=e.thresholdMs;return!(t.length<n)&&t[t.length-1]-t[0]<r}function pt(e){e.changes=[],e.startTime=void 0}function ht(e){for(var t=e.changes,n=e.thresholdMs,r=0,i=t[t.length-1];r<t.length;r++){if(i-t[r]<n)break}0!==r&&(e.startTime=t[r],e.changes.splice(0,r))}var gt=function(e){var t=e.mouseDirectionChangeObservable,n=e.directionChanges,r=void 0===n?20:n,i=e.thresholdMs,o=void 0===i?2e3:i;return new Y(function(e){var n={changes:[],changesThreshold:r,thresholdMs:o},i={changes:[],changesThreshold:r,thresholdMs:o},a=void 0,l=null;function u(){void 0!==a&&(e.next(a),a=void 0,null!==l&&clearTimeout(l),pt(n),pt(i))}return t.subscribe(function(e){null!==l&&clearTimeout(l),function(e){var t=+Date.now();e.startTime=e.startTime||t;var n=e.changes,r=e.changesThreshold;n.push(t),n.length>r&&n.shift()}(e===ft.X?n:i);var t=function(e,t){var n=void 0;if(vt(e)&&(n=e.startTime),vt(t)){var r=t.startTime;r&&(!n||r<n)&&(n=r)}return n}(n,i);return t?(a=a||t,l=setTimeout(function(){u(),l=null},o)):u(),ht(n),ht(i),function(){null!==l&&(clearTimeout(l),l=null)}})})},mt=function(e){var t=e.amplitude,n=e.options,r=e.allObservables,i=e.directionChanges,o=void 0===i?20:i,a=e.thresholdMs,l=void 0===a?2e3:a,u=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new Y(function(e){var n=null,r=null,i=null;return t.subscribe(function(t){var o={x:t.clientX,y:t.clientY};null!==n?(o.x>n.x?(r===dt.DECREASING&&e.next(ft.X),r=dt.INCREASING):o.x<n.x&&(r===dt.INCREASING&&e.next(ft.X),r=dt.DECREASING),o.y>n.y?(i===dt.DECREASING&&e.next(ft.Y),i=dt.INCREASING):o.y<n.y&&(i===dt.INCREASING&&e.next(ft.Y),i=dt.DECREASING),n=o):n=o})})}({allWindowObservables:r});return gt({mouseDirectionChangeObservable:u,directionChanges:o,thresholdMs:l}).subscribe(function(e){ve(n)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})})};function bt(e,t,n,r){if(!r)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:n}var yt=4e3;function wt(e,t){var n=e.startTime+e.duration;return t.filter(function(t){return t.startTime<n&&t.startTime+t.duration>e.startTime}).map(function(e){return e.name})}function Et(e,n){var r,i=wt(e,n),o=null!==(r=e.scripts)&&void 0!==r?r:[],a=o.map(function(e){return e.sourceURL}).filter(Boolean),l=o.map(function(e){return e.sourceFunctionName}).filter(Boolean),u=o.map(function(e){return e.sourceCharPosition}).filter(function(e){return"number"==typeof e&&e>=0}),c=o.map(function(e){return e.invokerType}).filter(Boolean),s=o.map(function(e){return e.invoker}).filter(Boolean);return t(t(t(t(t(t(t({"[Amplitude] Main Thread Block Source":"long-animation-frame","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.blockingDuration,"[Amplitude] Main Thread Block Start Time":e.startTime},i.length>0&&{"[Amplitude] Main Thread Block Measures":i}),{"[Amplitude] Main Thread Block Render Start":e.renderStart,"[Amplitude] Main Thread Block Style And Layout Start":e.styleAndLayoutStart,"[Amplitude] Main Thread Block Script Count":o.length}),a.length>0&&{"[Amplitude] Main Thread Block Script URLs":a}),l.length>0&&{"[Amplitude] Main Thread Block Script Functions":l}),u.length>0&&{"[Amplitude] Main Thread Block Script Positions":u}),c.length>0&&{"[Amplitude] Main Thread Block Invoker Types":c}),s.length>0&&{"[Amplitude] Main Thread Block Invokers":s})}function xt(e,n){var r,i=wt(e,n),o=null!==(r=e.attribution)&&void 0!==r?r:[];return t(t({"[Amplitude] Main Thread Block Source":"long-task","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.duration,"[Amplitude] Main Thread Block Start Time":e.startTime},i.length>0&&{"[Amplitude] Main Thread Block Measures":i}),o.length>0&&{"[Amplitude] Main Thread Block Attribution":o.map(function(e){return e.name})})}function Tt(e){var t=e.amplitude,n=e.options,r=e.durationThreshold,o=void 0===r?100:r,a=function(){if("undefined"==typeof PerformanceObserver)return null;try{var e=PerformanceObserver.supportedEntryTypes;if(e.includes("long-animation-frame"))return"long-animation-frame";if(e.includes("longtask"))return"longtask"}catch(e){}return null}();if(!a)return{unsubscribe:function(){}};var l=[],u=new PerformanceObserver(function(e){var t,n,r=performance.now();try{for(var o=i(e.getEntries()),a=o.next();!a.done;a=o.next()){var u=a.value;l.push(u)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}for(var c=r-1e4;l.length>0&&l[0].startTime<c;)l.shift()});try{u.observe({entryTypes:["measure"]})}catch(e){}var c=new PerformanceObserver(function(e){var r,u;try{for(var c=i(e.getEntries()),s=c.next();!s.done;s=c.next()){var d=s.value;if(!ve(n))return;if(!(d.duration<o)){var f="long-animation-frame"===a?Et(d,l):xt(d,l);t.track("[Amplitude] Main Thread Block",f)}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(u=c.return)&&u.call(c)}finally{if(r)throw r.error}}});try{c.observe({entryTypes:[a]})}catch(e){return u.disconnect(),{unsubscribe:function(){}}}return{unsubscribe:function(){c.disconnect(),u.disconnect()}}}return e.DataExtractor=it,e.autocapturePlugin=at,e.enableVisualTagging=Ee,e.frustrationPlugin=function(e){var l;void 0===e&&(e={});var u="@amplitude/plugin-frustration-browser",c=[],s=!1!==e.errorClicks;e.errorClicks||(s=!1);var d=!1!==e.deadClicks&&null!==e.deadClicks,f=!1!==e.rageClicks&&null!==e.rageClicks,v=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(v=!1);var p=bt(e,"rageClicks",x,f),h=bt(e,"deadClicks",w,d),g=bt(e,"errorClicks",E,s),b=null!==(l=e.dataAttributePrefix)&&void 0!==l?l:m,y=new it(e),T=a([],o(new Set(a(a(a([],o(p),!1),o(h),!1),o(g),!1))),!1),A=function(){var e,n,r=F(Ae("pointerdown").map(function(e){return y.addAdditionalEventProperties(e,"click",T,b,!0)})),i=F(ke().map(function(e){return y.addTypeAndTimestamp(e,"error")})),o=F(Te().map(function(e){return y.addAdditionalEventProperties(e,"mutation",T,b)}));window.navigation&&(n=F(new Y(function(e){var n=function(n){e.next(t(t({},n),{type:"navigate"}))};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}}).map(function(e){return y.addAdditionalEventProperties(e,"navigate",T,b)})));var a=F(new Y(function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){try{if(t.selectionStart===t.selectionEnd)return}catch(e){return}return e.next()}var n=window.getSelection();if(n&&!n.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}})),l=F(new Y(function(e){var t=function(t){e.next(t)},n={capture:!0};return xe.document.addEventListener("mousemove",t,n),function(){xe.document.removeEventListener("mousemove",t,n)}}));return(e={})[rt.ClickObservable]=r,e[rt.MutationObservable]=o,e[rt.NavigateObservable]=n,e[rt.BrowserErrorObservable]=i,e[rt.SelectionObservable]=a,e[rt.MouseMoveObservable]=l,e};return{name:u,type:"enrichment",setup:function(i,o){return n(void 0,void 0,void 0,function(){var n,a,l,m,w,E,x,T,k,S,C,O;return r(this,function(r){return"undefined"==typeof document||(n=A(),(a=ot(i,y))&&c.push({unsubscribe:a}),f&&(l=pe(e,p),m=st({allObservables:n,amplitude:o,shouldTrackRageClick:l}),c.push(m)),d&&(w=pe(e,h),E=function(e){var n=e.amplitude,r=e.allObservables,i=e.getEventProperties,o=e.shouldTrackDeadClick,a=r.clickObservable,l=r.mutationObservable,u=r.navigateObservable,c=a.filter(function(e){return ye(e)&&o("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===ne.LEFT_OR_TOUCH_CONTACT}),s=u?W(l,u):l,d=W(c,s),f=null;return G(d,function(e){return f&&lt.includes(e.type)?(clearTimeout(f),f=null,Promise.resolve(null)):"click"===e.type?f?Promise.resolve(null):new Promise(function(t){f=setTimeout(function(){t(e),f=null},3e3)}):Promise.resolve(null)}).subscribe(function(e){if(e){var r={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};n.track("[Amplitude] Dead Click",t(t({},i("click",e.closestTrackedAncestor)),r),{time:e.timestamp})}})}({amplitude:o,allObservables:n,getEventProperties:function(e,t){return y.getEventProperties(e,t,b)},shouldTrackDeadClick:w}),c.push(E)),s&&(x=pe(e,g),T=function(e){var n=e.amplitude,r=e.allObservables,i=e.shouldTrackErrorClick,o=r.clickObservable,a=r.browserErrorObservable,l=o.filter(function(e){return ye(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===ne.LEFT_OR_TOUCH_CONTACT}),u=null,c=null,s=function(){null!==u&&(clearTimeout(u),u=null),c=null};return W(l,a).subscribe(function(e){var r;if("click"===e.type)return s(),c=e,void(u=setTimeout(s,2e3));"error"===e.type&&c&&(n.track("[Amplitude] Error Click",t(((r={})["[Amplitude] Kind"]=e.event.kind,r["[Amplitude] Message"]=e.event.message,r["[Amplitude] Stack"]=e.event.stack,r["[Amplitude] Filename"]=e.event.filename,r["[Amplitude] Line Number"]=e.event.lineNumber,r["[Amplitude] Column Number"]=e.event.columnNumber,r),c.targetElementProperties)),s())})}({amplitude:o,allObservables:n,shouldTrackErrorClick:x}),c.push(T)),v&&(k=void 0,S=void 0,"object"==typeof e.thrashedCursor&&(k=e.thrashedCursor.directionChanges,S=e.thrashedCursor.threshold,k&&k<5&&(i.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(k," is below the minimum of ").concat(5,", setting to ").concat(5)),k=5),S&&S>yt&&(i.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(S," is above the maximum of ").concat(yt,", setting to ").concat(yt)),S=yt)),C=mt({amplitude:o,options:e,allObservables:n,directionChanges:k,thresholdMs:S}),c.push(C)),null===(O=null==i?void 0:i.loggerProvider)||void 0===O||O.log("".concat(u," has been successfully added."))),[2]})})},execute:function(e){return n(void 0,void 0,void 0,function(){return r(this,function(t){return[2,e]})})},teardown:function(){return n(void 0,void 0,void 0,function(){var e,t,n,o;return r(this,function(r){try{for(e=i(c),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(o=e.return)&&o.call(e)}finally{if(n)throw n.error}}return[2]})})}}},e.performancePlugin=function(e){void 0===e&&(e={});var t="@amplitude/plugin-performance-browser",o=[],a=!0===e.mainThreadBlock||"object"==typeof e.mainThreadBlock&&null!==e.mainThreadBlock;return{name:t,type:"enrichment",setup:function(i,l){return n(void 0,void 0,void 0,function(){var n,u,c;return r(this,function(r){return"undefined"==typeof document||(a&&(n=100,"object"==typeof e.mainThreadBlock&&void 0!==e.mainThreadBlock.durationThreshold&&(n=e.mainThreadBlock.durationThreshold),u=Tt({amplitude:l,options:e,durationThreshold:n}),o.push(u)),null===(c=null==i?void 0:i.loggerProvider)||void 0===c||c.log("".concat(t," performance tracking has been successfully added."))),[2]})})},execute:function(e){return n(void 0,void 0,void 0,function(){return r(this,function(t){return[2,e]})})},teardown:function(){return n(void 0,void 0,void 0,function(){var e,t,n,a;return r(this,function(r){try{for(e=i(o),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(a=e.return)&&a.call(e)}finally{if(n)throw n.error}}return[2]})})}}},e.plugin=at,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
1
+ var amplitudeAutocapturePlugin=function(e){"use strict";var t=function(){return t=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},t.apply(this,arguments)};function n(e,t,n,r){return new(n||(n=Promise))(function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function l(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(a,l)}u((r=r.apply(e,t||[])).next())})}function r(e,t){var n,r,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},a=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return a.next=l(0),a.throw=l(1),a.return=l(2),"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function l(l){return function(u){return function(l){if(n)throw new TypeError("Generator is already executing.");for(;a&&(a=0,l[0]&&(o=0)),o;)try{if(n=1,r&&(i=2&l[0]?r.return:l[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,l[1])).done)return i;switch(r=0,i&&(l=[2&l[0],i.value]),l[0]){case 0:case 1:i=l;break;case 4:return o.label++,{value:l[1],done:!1};case 5:o.label++,r=l[1],l=[0];continue;case 7:l=o.ops.pop(),o.trys.pop();continue;default:if(!(i=o.trys,(i=i.length>0&&i[i.length-1])||6!==l[0]&&2!==l[0])){o=0;continue}if(3===l[0]&&(!i||l[1]>i[0]&&l[1]<i[3])){o.label=l[1];break}if(6===l[0]&&o.label<i[1]){o.label=i[1],i=l;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(l);break}i[2]&&o.ops.pop(),o.trys.pop();continue}l=t.call(e,o)}catch(e){l=[6,e],r=0}finally{n=i=0}if(5&l[0])throw l[1];return{value:l[0]?l[1]:void 0,done:!0}}([l,u])}}}function i(e){var t="function"==typeof Symbol&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function o(e,t){var n="function"==typeof Symbol&&e[Symbol.iterator];if(!n)return e;var r,i,o=n.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(r=o.next()).done;)a.push(r.value)}catch(e){i={error:e}}finally{try{r&&!r.done&&(n=o.return)&&n.call(o)}finally{if(i)throw i.error}}return a}function a(e,t,n){if(n||2===arguments.length)for(var r,i=0,o=t.length;i<o;i++)!r&&i in t||(r||(r=Array.prototype.slice.call(t,0,i)),r[i]=t[i]);return e.concat(r||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var l=function(){var e="ampIntegrationContext";return"undefined"!=typeof globalThis&&void 0!==globalThis[e]?globalThis[e]:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},u=function(e,t){return!t||!t.length||t.some(function(t){return"string"==typeof t?e===t:e.match(t)})},c=function(e,t){var n=e;try{n=decodeURI(e)}catch(e){null==t||t.error("Malformed URI sequence: ",e)}return n},s=l(),d=null==s?void 0:s.console,f={},v={},p=!1;var h={addListener:function(e,t){var n,r=(n=e,!!d&&"function"==typeof d[n]&&(v[n]||(v[n]=d[n],d[n]=function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];try{if(f[n]&&!p){p=!0;var r=f[n];r&&r.forEach(function(t){try{t(n,e)}catch(e){}})}}catch(e){}return p=!1,v[n].apply(d,e)}),!0));if(!r)return new Error("Console override failed");f[e]?f[e].push(t):f[e]=[t]},removeListener:function(e){var t,n;try{for(var r=i(Object.values(f)),o=r.next();!o.done;o=r.next())for(var a=o.value,l=a.length-1;l>=0;l--)if(a[l]===e){a.splice(l,1);break}}catch(e){t={error:e}}finally{try{o&&!o.done&&(n=r.return)&&n.call(r)}finally{if(t)throw t.error}}},_restoreConsole:function(){var e,t;try{for(var n=i(Object.entries(v)),r=n.next();!r.done;r=n.next()){var a=o(r.value,2),l=a[0],u=a[1];u&&(d[l]=u)}}catch(t){e={error:t}}finally{try{r&&!r.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}v={},f={}}},g=["a","button","input","select","textarea","label","video","audio",'[contenteditable="true" i]',"[data-amp-default-track]",".amp-default-track"],m="data-amp-track-",b=["div","span","h1","h2","h3","h4","h5","h6"],y=a(['input[type="button"]','input[type="submit"]','input[type="reset"]','input[type="image"]','input[type="file"]'],o(["a","button",'[role="button"]','[role="link"]','[role="menuitem"]','[role="menuitemcheckbox"]','[role="menuitemradio"]','[role="option"]','[role="tab"]','[role="treeitem"]','[contenteditable="true" i]']),!1),w=y,E=y,x=["*"],T="data-amp-mask",A="*****",k=/\b(?:\d[ -]*?){13,16}\b/,S=/(\d{3}-?\d{2}-?\d{4})/g,C=/[^\s@]+@[^\s@.]+\.[^\s@]+/g,O={};Object.defineProperty(O,"__esModule",{value:!0}),O.Observable=void 0;const P=e=>Boolean(Symbol[e]),M=e=>P(e)?Symbol[e]:"@@"+e,_=M("iterator"),N=M("observable"),L=M("species");function D(e,t){let n=e[t];if(null!=n){if("function"!=typeof n)throw new TypeError(n+" is not a function");return n}}function I(e){let t=e.constructor;return void 0!==t&&(t=t[L],null===t&&(t=void 0)),void 0!==t?t:X}function R(e){R.log?R.log(e):setTimeout(()=>{throw e})}function B(e){Promise.resolve().then(()=>{try{e()}catch(e){R(e)}})}function j(e){let t=e._cleanup;if(void 0!==t&&(e._cleanup=void 0,t))try{if("function"==typeof t)t();else{let e=D(t,"unsubscribe");e&&e.call(t)}}catch(e){R(e)}}function H(e){e._observer=void 0,e._queue=void 0,e._state="closed"}function U(e,t,n){e._state="running";let r=e._observer;try{let i=D(r,t);switch(t){case"next":i&&i.call(r,n);break;case"error":if(H(e),!i)throw n;i.call(r,n);break;case"complete":H(e),i&&i.call(r)}}catch(e){R(e)}"closed"===e._state?j(e):"running"===e._state&&(e._state="ready")}function q(e,t,n){if("closed"!==e._state){if("buffering"!==e._state)return"ready"!==e._state?(e._state="buffering",e._queue=[{type:t,value:n}],void B(()=>function(e){let t=e._queue;if(t){e._queue=void 0,e._state="ready";for(let n=0;n<t.length&&(U(e,t[n].type,t[n].value),"closed"!==e._state);++n);}}(e))):void U(e,t,n);e._queue.push({type:t,value:n})}}class z{constructor(e,t){this._cleanup=void 0,this._observer=e,this._queue=void 0,this._state="initializing";let n=this,r={get closed(){return"closed"===n._state},next(e){q(n,"next",e)},error(e){q(n,"error",e)},complete(){q(n,"complete")}};try{this._cleanup=t.call(void 0,r)}catch(e){r.error(e)}"initializing"===this._state&&(this._state="ready")}get closed(){return"closed"===this._state}unsubscribe(){"closed"!==this._state&&(H(this),j(this))}}class X{constructor(e){if(!(this instanceof X))throw new TypeError("Observable cannot be called as a function");if("function"!=typeof e)throw new TypeError("Observable initializer must be a function");this._subscriber=e}subscribe(e){return"object"==typeof e&&null!==e||(e={next:e,error:arguments[1],complete:arguments[2]}),new z(e,this._subscriber)}forEach(e){return new Promise((t,n)=>{if("function"!=typeof e)return void n(new TypeError(e+" is not a function"));function r(){i.unsubscribe(),t()}let i=this.subscribe({next(t){try{e(t,r)}catch(e){n(e),i.unsubscribe()}},error:n,complete:t})})}map(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(I(this))(t=>this.subscribe({next(n){try{n=e(n)}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}filter(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");return new(I(this))(t=>this.subscribe({next(n){try{if(!e(n))return}catch(e){return t.error(e)}t.next(n)},error(e){t.error(e)},complete(){t.complete()}}))}reduce(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=I(this),n=arguments.length>1,r=!1,i=arguments[1];return new t(t=>this.subscribe({next(o){let a=!r;if(r=!0,!a||n)try{i=e(i,o)}catch(e){return t.error(e)}else i=o},error(e){t.error(e)},complete(){if(!r&&!n)return t.error(new TypeError("Cannot reduce an empty sequence"));t.next(i),t.complete()}}))}async all(){let e=[];return await this.forEach(t=>e.push(t)),e}concat(...e){let t=I(this);return new t(n=>{let r,i=0;return function o(a){r=a.subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){i===e.length?(r=void 0,n.complete()):o(t.from(e[i++]))}})}(this),()=>{r&&(r.unsubscribe(),r=void 0)}})}flatMap(e){if("function"!=typeof e)throw new TypeError(e+" is not a function");let t=I(this);return new t(n=>{let r=[],i=this.subscribe({next(i){if(e)try{i=e(i)}catch(e){return n.error(e)}let a=t.from(i).subscribe({next(e){n.next(e)},error(e){n.error(e)},complete(){let e=r.indexOf(a);e>=0&&r.splice(e,1),o()}});r.push(a)},error(e){n.error(e)},complete(){o()}});function o(){i.closed&&0===r.length&&n.complete()}return()=>{r.forEach(e=>e.unsubscribe()),i.unsubscribe()}})}[N](){return this}static from(e){let t="function"==typeof this?this:X;if(null==e)throw new TypeError(e+" is not an object");let n=D(e,N);if(n){let r=n.call(e);if(Object(r)!==r)throw new TypeError(r+" is not an object");return function(e){return e instanceof X}(r)&&r.constructor===t?r:new t(e=>r.subscribe(e))}if(P("iterator")&&(n=D(e,_),n))return new t(t=>{B(()=>{if(!t.closed){for(let r of n.call(e))if(t.next(r),t.closed)return;t.complete()}})});if(Array.isArray(e))return new t(t=>{B(()=>{if(!t.closed){for(let n=0;n<e.length;++n)if(t.next(e[n]),t.closed)return;t.complete()}})});throw new TypeError(e+" is not observable")}static of(...e){return new("function"==typeof this?this:X)(t=>{B(()=>{if(!t.closed){for(let n=0;n<e.length;++n)if(t.next(e[n]),t.closed)return;t.complete()}})})}static get[L](){return this}}O.Observable=X,Object.defineProperty(X,Symbol("extensions"),{value:{symbol:N,hostReportError:R},configurable:!0});var Y=O.Observable;function G(e,t){return new Y(function(n){e.subscribe({next:function(e){t(e).then(function(e){return n.next(e)}).catch(function(e){return n.error(e)})},error:function(e){n.error(e)},complete:function(){n.complete()}})})}function W(e,t){return new Y(function(n){var r=!1,o=new Set,a=function(){var e,t;r=!0;try{for(var n=i(o),a=n.next();!a.done;a=n.next()){var l=a.value;try{l.unsubscribe()}catch(e){}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=n.return)&&t.call(n)}finally{if(e)throw e.error}}o.clear()},l=function(e){var t=e.subscribe({next:function(e){r||n.next(e)},error:function(e){r||(r=!0,n.error(e),a())},complete:function(){o.delete(t),r||0!==o.size||(n.complete(),a(),r=!0)}});o.add(t)};return l(e),l(t),a})}function F(e){var t=new Set,n=null;function r(){null==n||n.unsubscribe(),n=null,t.clear()}return new Y(function(o){return t.add(o),null===n&&(n=e.subscribe({next:function(e){var n,r,o;try{for(var a=i(t),l=a.next();!l.done;l=a.next()){var u=l.value;null===(o=u.next)||void 0===o||o.call(u,e)}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}},error:function(e){var n,o,a;try{for(var l=i(t),u=l.next();!u.done;u=l.next()){var c=u.value;null===(a=c.error)||void 0===a||a.call(c,e)}}catch(e){n={error:e}}finally{try{u&&!u.done&&(o=l.return)&&o.call(l)}finally{if(n)throw n.error}}r()},complete:function(){var e,n,o;try{for(var a=i(t),l=a.next();!l.done;l=a.next()){var u=l.value;null===(o=u.complete)||void 0===o||o.call(u)}}catch(t){e={error:t}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(e)throw e.error}}r()}})),function(){t.delete(o),0===t.size&&n&&(n.unsubscribe(),n=null)}})}var V,$="https://app.amplitude.com",Z={US:$,EU:"https://app.eu.amplitude.com",STAGING:"https://apps.stag2.amplitude.com"};var J="__AMPLITUDE_MESSENGER_INSTANCE__",K="__AMPLITUDE_MESSENGER__",Q=function(){function e(e){var t=(void 0===e?{}:e).origin,n=void 0===t?$:t;this[V]=!0,this.isSetup=!1,this.messageHandler=null,this.requestCallbacks={},this.actionHandlers=new Map,this.pendingMessages=new Map,this.scriptLoadPromises=new Map,this.endpoint=n}return e.prototype.notify=function(e){var t,n,r,i;null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message sent: ",JSON.stringify(e)),null===(i=null===(r=window.opener)||void 0===r?void 0:r.postMessage)||void 0===i||i.call(r,e,this.endpoint)},e.prototype.sendRequest=function(e,t,n){var r=this;void 0===n&&(n={timeout:15e3});var i="".concat(Date.now(),"-").concat(Math.random().toString(36).substr(2,9)),o={id:i,action:e,args:t};return new Promise(function(t,a){r.requestCallbacks[i]={resolve:t,reject:a},r.notify(o),n.timeout>0&&setTimeout(function(){a(new Error("".concat(e," timed out (id: ").concat(i,")"))),delete r.requestCallbacks[i]},n.timeout)})},e.prototype.handleResponse=function(e){var t;this.requestCallbacks[e.id]?(this.requestCallbacks[e.id].resolve(e.responseData),delete this.requestCallbacks[e.id]):null===(t=this.logger)||void 0===t||t.warn("No callback found for request id: ".concat(e.id))},e.prototype.registerActionHandler=function(e,t){var n,r,o,a;this.actionHandlers.has(e)&&(null===(a=null===(o=this.logger)||void 0===o?void 0:o.warn)||void 0===a||a.call(o,"Overwriting existing action handler for: ".concat(e))),this.actionHandlers.set(e,t);var l=this.pendingMessages.get(e);if(l){this.pendingMessages.delete(e);try{for(var u=i(l),c=u.next();!c.done;c=u.next()){t(c.value)}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}}},e.prototype.loadScriptOnce=function(e){return n(this,void 0,void 0,function(){var t,n,i;return r(this,function(r){switch(r.label){case 0:if(t=this.scriptLoadPromises.get(e))return[2,t];n=function(e){return document.querySelector('script[src="'.concat(CSS.escape(e),'"]'))?Promise.resolve({status:!0}):new Promise(function(t,n){var r;try{var i=document.createElement("script");i.type="text/javascript",i.async=!0,i.src=e,i.addEventListener("load",function(){t({status:!0})},{once:!0}),i.addEventListener("error",function(){n({status:!1,message:"Failed to load the script ".concat(e)})}),null===(r=document.head)||void 0===r||r.appendChild(i)}catch(e){n(e)}})}(e).then(function(){}),this.scriptLoadPromises.set(e,n),r.label=1;case 1:return r.trys.push([1,3,,4]),[4,n];case 2:return r.sent(),[3,4];case 3:throw i=r.sent(),this.scriptLoadPromises.delete(e),i;case 4:return[2]}})})},e.prototype.setup=function(e){var t,n,r=this,i=void 0===e?{}:e,o=i.logger,a=i.endpoint;o&&(this.logger=o),a&&this.endpoint===$&&(this.endpoint=a),this.isSetup||(this.isSetup=!0,null===(n=null===(t=this.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Setting up messenger"),this.messageHandler=function(e){var t,n,i,o,a;if(null===(n=null===(t=r.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Message received: ",JSON.stringify(e)),r.endpoint===e.origin){var l=e.data,u=null==l?void 0:l.action;if(u)if("id"in l&&l.id)null===(o=null===(i=r.logger)||void 0===i?void 0:i.debug)||void 0===o||o.call(i,"Received Response to previous request: ",JSON.stringify(e)),r.handleResponse(l);else{if("ping"===u)return void r.notify({action:"pong"});var c=r.actionHandlers.get(u);if(c)c(l.data);else{var s=null!==(a=r.pendingMessages.get(u))&&void 0!==a?a:[];s.push(l.data),r.pendingMessages.set(u,s)}}}},window.addEventListener("message",this.messageHandler),this.notify({action:"page-loaded"}))},e.prototype.destroy=function(){this.messageHandler&&(window.removeEventListener("message",this.messageHandler),this.messageHandler=null),this.isSetup=!1,this.actionHandlers.clear(),this.pendingMessages.clear(),this.requestCallbacks={},this.scriptLoadPromises.clear();var e=l();(null==e?void 0:e[K])===this&&delete e[K]},e}();function ee(e){var t,n=l(),r=null==n?void 0:n[K];if("object"==typeof(t=r)&&null!==t&&J in t&&!0===t[J])return r;var i=new Q(e);return n&&(n[K]=i),i}V=J;var te="__AMPLITUDE_BACKGROUND_CAPTURE__";var ne,re="1.28.6",ie="[Amplitude] Element Clicked",oe="[Amplitude] Element Tag",ae="[Amplitude] Element Text",le="[Amplitude] Page URL",ue="[Amplitude] Viewport Height",ce="[Amplitude] Viewport Width",se="[Amplitude] Page View ID",de="data-amp-mask-attributes",fe=["input","select","textarea"],ve=function(e){var t=e.pageUrlAllowlist,n=e.pageUrlExcludelist;return!(n&&n.length>0&&u(window.location.href,n))&&!!u(window.location.href,t)},pe=function(e,t){return function(n,r){var i,o,a=e.shouldTrackEventResolver,l=null===(o=null===(i=null==r?void 0:r.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===o?void 0:o.call(i);if(!l)return!1;if(a)return a(n,r);if(!ve(e))return!1;var u=String(null==r?void 0:r.getAttribute("type"))||"";if("string"==typeof u)switch(u.toLowerCase()){case"hidden":case"password":return!1}if(t){var c=t.some(function(e){var t;return!!(null===(t=null==r?void 0:r.matches)||void 0===t?void 0:t.call(r,e))});if(!c)return!1}switch(l){case"input":case"select":case"textarea":return"change"===n||"click"===n;default:return"click"===n}}},he=function(e){return e?e.split(",").map(function(e){return e.trim()}).filter(function(e){return e.length>0&&"id"!==e&&"class"!==e}):[]},ge=function(e){return Object.keys(e).reduce(function(t,n){var r=e[n];return function(e){return null==e||"object"==typeof e&&0===Object.keys(e).length||"string"==typeof e&&0===e.trim().length}(r)||(t[n]=r),t},{})},me=function(){var e;try{var t=l(),n=null===(e=null==t?void 0:t.sessionStorage)||void 0===e?void 0:e.getItem("AMP_PAGE_VIEW");if(!n)return;var r=JSON.parse(n);if("string"==typeof r.pageViewId)return r.pageViewId}catch(e){}},be=function(e,t){return e?t.some(function(t){var n;return null===(n=null==e?void 0:e.matches)||void 0===n?void 0:n.call(e,t)})?e:be(null==e?void 0:e.parentElement,t):null},ye=function(e){return!(null===e.event.target||!e.closestTrackedAncestor)};!function(e){e[e.LEFT_OR_TOUCH_CONTACT=0]="LEFT_OR_TOUCH_CONTACT",e[e.MIDDLE=1]="MIDDLE",e[e.RIGHT=2]="RIGHT"}(ne||(ne={}));var we="__AMPLITUDE_VISUAL_TAGGING__";function Ee(e,t){var n=e;if(!0!==n[we]){n[we]=!0;var r=t.dataExtractor,i=t.isElementSelectable,o=t.cssSelectorAllowlist,a=t.actionClickAllowlist,l=null,u=function(t){e.notify({action:"element-selected",data:t})},c=function(t,n){"selector-mode-changed"===t?e.notify({action:"track-selector-mode-changed",data:n}):"selector-moved"===t&&e.notify({action:"track-selector-moved",data:n})};e.registerActionHandler("initialize-visual-tagging-selector",function(t){e.loadScriptOnce("https://cdn.amplitude.com/libs/visual-tagging-selector-1.0.0-alpha.js.gz").then(function(){var n;l=null===(n=null===window||void 0===window?void 0:window.amplitudeVisualTaggingSelector)||void 0===n?void 0:n.call(window,{getEventTagProps:r.getEventTagProps,isElementSelectable:function(e){return!i||i((null==t?void 0:t.actionType)||"click",e)},onTrack:c,onSelect:u,visualHighlightClass:"amp-visual-tagging-selector-highlight",messenger:e,cssSelectorAllowlist:o,actionClickAllowlist:a,extractDataFromDataSource:r.extractDataFromDataSource,dataExtractor:r,diagnostics:{autocapture:{version:re}}}),e.notify({action:"selector-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize visual tagging selector")})}),e.registerActionHandler("close-visual-tagging-selector",function(){var e;null===(e=null==l?void 0:l.close)||void 0===e||e.call(l)})}}var xe=l(),Te=function(){return new Y(function(e){var t=new MutationObserver(function(t){e.next(t)});return document.body&&t.observe(document.body,{childList:!0,attributes:!0,characterData:!0,subtree:!0}),function(){return t.disconnect()}})},Ae=function(e){return void 0===e&&(e="click"),new Y(function(t){var n,r=function(e){t.next(e)};return null===(n=l())||void 0===n||n.document.addEventListener(e,r,{capture:!0}),function(){var t;null===(t=l())||void 0===t||t.document.removeEventListener(e,r,{capture:!0})}})},ke=function(){var e=W(new Y(function(e){var n=function(n){if(n instanceof ErrorEvent){var r={kind:"error"};n.error instanceof Error||n.error instanceof DOMException?r=t(t({},r),{message:n.error.message,stack:n.error.stack,filename:n.filename,lineNumber:n.lineno,columnNumber:n.colno}):"string"==typeof n.error&&(r.message=n.error),e.next(r)}};return xe.addEventListener("error",n),function(){xe.removeEventListener("error",n)}}),new Y(function(e){var t=function(t){var n={kind:"unhandledrejection"};t.reason instanceof Error||t.reason instanceof DOMException?(n.message=t.reason.message,n.stack=t.reason.stack):"string"==typeof t.reason&&(n.message=t.reason),e.next(n)};return xe.addEventListener("unhandledrejection",t),function(){xe.removeEventListener("unhandledrejection",t)}}));return W(e,new Y(function(e){var t=function(t){for(var n=[],r=1;r<arguments.length;r++)n[r-1]=arguments[r];var i=void 0;Array.isArray(n[0])&&"string"==typeof n[0][0]&&(i=n[0][0]),e.next({kind:"console",message:i})};return h.addListener("error",t),function(){h.removeListener(t)}}))},Se=function(e,t,n){e.forEach(function(e){if("string"!=typeof e&&"ATTACH_EVENT_PROPERTY"===e.actionType){var r=n.extractDataFromDataSource(e.dataSource,t.closestTrackedAncestor);t.targetElementProperties[e.destinationKey]=r}})},Ce={"[Amplitude] Element Clicked":"click","[Amplitude] Element Changed":"change"},Oe=function(e){var t,n,r,o,a=Object.values(Ce).reduce(function(e,t){return e[t]=new Set,e},{});if(!e)return a;try{for(var l=i(e),u=l.next();!u.done;u=l.next()){var c=u.value;try{try{for(var s=(r=void 0,i(c.definition)),d=s.next();!d.done;d=s.next()){var f=d.value,v=Ce[f.event_type];v&&a[v].add(c.id)}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}}catch(e){console.warn("Skipping Labeled Event due to malformed definition",null==c?void 0:c.id,e)}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return a},Pe=function(e){var t,n,r,o,a=new Map;try{for(var l=i(e),u=l.next();!u.done;u=l.next()){var c=u.value;try{for(var s=(r=void 0,i(c.conditions)),d=s.next();!d.done;d=s.next()){var f=d.value;if("LABELED_EVENT"===f.type){var v=f.match.eventId,p=a.get(v);p||(p=[],a.set(v,p)),p.push(c)}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(o=s.return)&&o.call(s)}finally{if(r)throw r.error}}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return a},Me=function(e,t){return t.filter(function(t){return t.definition.some(function(t){return Ce[t.event_type]===e.type&&t.filters.every(function(t){return function(e,t){try{if("[Amplitude] Element Text"===t.subprop_key)return"is"===t.subprop_op&&t.subprop_value.includes(e.targetElementProperties["[Amplitude] Element Text"]);if("[Amplitude] Element Hierarchy"===t.subprop_key)return"autotrack css match"===t.subprop_op&&!!e.closestTrackedAncestor.closest(t.subprop_value.toString())}catch(e){return console.error("Error matching event to filter",e),!1}return!1}(e,t)})})})},_e=function(){function e(e,t,n,r){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.dataExtractor=n,this.options=r}return e.prototype.evaluate=function(e){var t,n,r=this.options.pageActions;if(!r)return e;var o=function(e,t){var n,r,o,a,l=new Set;try{for(var u=i(e),c=u.next();!c.done;c=u.next()){var s=c.value,d=t.get(s.id);if(d)try{for(var f=(o=void 0,i(d)),v=f.next();!v.done;v=f.next()){var p=v.value;l.add(p)}}catch(e){o={error:e}}finally{try{v&&!v.done&&(a=f.return)&&a.call(f)}finally{if(o)throw o.error}}}}catch(e){n={error:e}}finally{try{c&&!c.done&&(r=u.return)&&r.call(u)}finally{if(n)throw n.error}}return Array.from(l)}(Me(e,Array.from(this.groupedLabeledEvents[e.type]).map(function(e){return r.labeledEvents[e]})),this.labeledEventToTriggerMap);try{for(var a=i(o),l=a.next();!l.done;l=a.next()){var u=l.value;Se(u.actions,e,this.dataExtractor)}}catch(e){t={error:e}}finally{try{l&&!l.done&&(n=a.return)&&n.call(a)}finally{if(t)throw t.error}}return e},e.prototype.update=function(e,t,n){this.groupedLabeledEvents=e,this.labeledEventToTriggerMap=t,this.options=n},e}(),Ne=new Set(["id","class","style","value","onclick","onchange","oninput","onblur","onsubmit","onfocus","onkeydown","onkeyup","onkeypress","data-reactid","data-react-checksum","data-reactroot",de,T]),Le=["type"],De=["svg","path","g"],Ie=["password","hidden"];function Re(e,t){var n,r,o,a,l,u;if(null===e)return null;var c=String(e.tagName).toLowerCase(),s={tag:c},d=Array.from(null!==(a=null===(o=e.parentElement)||void 0===o?void 0:o.children)&&void 0!==a?a:[]);d.length&&(s.index=d.indexOf(e),s.indexOfType=d.filter(function(t){return t.tagName===e.tagName}).indexOf(e));var f=null===(u=null===(l=e.previousElementSibling)||void 0===l?void 0:l.tagName)||void 0===u?void 0:u.toLowerCase();f&&(s.prevSib=String(f));var v=e.getAttribute("id");v&&(s.id=String(v));var p=Array.from(e.classList);p.length&&(s.classes=p);var h={},g=Array.from(e.attributes).filter(function(e){return!Ne.has(e.name)}),m=!function(e){var t,n,r,i=null===(n=null===(t=null==e?void 0:e.tagName)||void 0===t?void 0:t.toLowerCase)||void 0===n?void 0:n.call(t),o=e instanceof HTMLElement&&"true"===(null===(r=e.getAttribute("contenteditable"))||void 0===r?void 0:r.toLowerCase());return!fe.includes(i)&&!o}(e);if(!Ie.includes(String(e.getAttribute("type")))&&!De.includes(c))try{for(var b=i(g),y=b.next();!y.done;y=b.next()){var w=y.value;m&&!Le.includes(w.name)||(t.has(w.name)?h[w.name]=A:h[w.name]=String(w.value).substring(0,128))}}catch(e){n={error:e}}finally{try{y&&!y.done&&(r=b.return)&&r.call(b)}finally{if(n)throw n.error}}return Object.keys(h).length&&(s.attrs=h),s}function Be(e,t){var n=e.getAttribute(t.explicitTrackingAttribute);if(null!==n&&""===n)return null;var r=e.getAttribute("id");return null===r||""===r?null:function(e,t){var n,r;if(null==e||""===e)return!1;try{for(var o=i(t),a=o.next();!a.done;a=o.next())if(a.value.test(e))return!1}catch(e){n={error:e}}finally{try{a&&!a.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return!0}(r,t.autogeneratedIdPatterns)?r:null}function je(e,t){return t.map(He).join(" > ")}function He(e){var t=e.tagName.toLowerCase(),n=e.parentElement;if(null===n)return t;var r=function(e,t){for(var n=0,r=0;r<t.children.length;r++){var i=t.children[r];if(i.tagName===e.tagName&&(n+=1,i===e))return n}return 1}(e,n);return"".concat(t,":nth-of-type(").concat(r,")")}function Ue(e){var t=globalThis.CSS;if(t&&"function"==typeof t.escape)return t.escape(e);for(var n=String(e),r=n.length,i="",o=0;o<r;o++){var a=n.charCodeAt(o);0!==a?a>=1&&a<=31||127===a||0===o&&a>=48&&a<=57||1===o&&a>=48&&a<=57&&45===n.charCodeAt(0)?i+="\\".concat(a.toString(16)," "):i+=0!==o||1!==r||45!==a?a>=128||45===a||95===a||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?n.charAt(o):"\\".concat(n.charAt(o)):"\\-":i+="�"}return i}function qe(e){return Ue(e)}var ze=[{name:"explicitTrackingAttribute",try:function(e,t){var n=t.config.explicitTrackingAttribute,r=e.getAttribute(n);return null===r||""===r?null:"[".concat(n,"=").concat(JSON.stringify(r),"]")}},{name:"stableId",try:function(e,t){var n=Be(e,t.config);return null===n?null:"".concat(e.tagName.toLowerCase(),"#").concat(qe(n))}}];function Xe(e,t,n){var r,o,a,l,u;void 0===n&&(n={});var c=null!==(a=n.strategies)&&void 0!==a?a:ze,s=null!==(u=null!==(l=n.scope)&&void 0!==l?l:e.ownerDocument)&&void 0!==u?u:document,d={scope:s,config:t},f=function(e,t){var n=[],r=e;for(;null!==r&&(n.push(r),!(void 0!==t&&n.length>t));)r=r.parentElement;return n}(e,t.maxAncestorWalkDepth);try{for(var v=i(c),p=v.next();!p.done;p=v.next())for(var h=p.value,g=0;g<f.length;g++){var m=f[g],b=h.try(m,d);if(null!==b)if(0!==g){var y=je(0,f.slice(0,g).reverse()),w="".concat(b," > ").concat(y);if(Ye(s,w,e,h.name,n.logger))return w}else if(Ye(s,b,e,h.name,n.logger))return b}}catch(e){r={error:e}}finally{try{p&&!p.done&&(o=v.return)&&o.call(v)}finally{if(r)throw r.error}}return null}function Ye(e,t,n,r,i){var o;try{o=e.querySelectorAll(t)}catch(e){var a=e instanceof Error?e.message:String(e);return null==i||i.debug('@amplitude/element-selector: strategy "'.concat(r,'" emitted a malformed selector "').concat(t,'" (').concat(a,")")),!1}return 1===o.length&&o[0]===n}function Ge(e){var t=e.tagName.toLowerCase(),n=e.parentElement;if(null===n)return t;var r=function(e,t){for(var n=0,r=0;r<t.children.length;r++){var i=t.children[r];if(i.tagName===e.tagName&&(n+=1,i===e))return n}return 1}(e,n);return"".concat(t,":nth-of-type(").concat(r,")")}function We(e,t,n){var r;try{r=e.querySelectorAll(t)}catch(e){return!1}return 1===r.length&&r[0]===n}var Fe=function(){function e(e,t){this.value=e,this.optimized=t}return e.prototype.toString=function(){return this.value},e}(),Ve=function(e,t,n){var r,o;if(e.nodeType!==Node.ELEMENT_NODE)return null;var a=e.getAttribute("id");if(t){if(a)return new Fe(Ze(a),!0);var l=e.tagName.toLowerCase();if("body"===l||"head"===l||"html"===l)return new Fe(l,!0)}var u=e.tagName.toLowerCase();if(a)return new Fe(u+Ze(a),!0);var c=e.parentNode;if(!c||c.nodeType===Node.DOCUMENT_NODE)return new Fe(u,!0);for(var s=$e(e),d=!1,f=!1,v=-1,p=-1,h=c.children,g=0;h&&(-1===v||!f)&&g<h.length;++g){var m=h[g];if(m.nodeType===Node.ELEMENT_NODE)if(p+=1,m!==e){if(!f&&m.tagName.toLowerCase()===u){d=!0;var b=new Set(s);if(b.size)for(var y=$e(m),w=0;w<y.length;++w){var E=y[w];if(b.has(E)&&(b.delete(E),!b.size)){f=!0;break}}else f=!0}}else v=p}var x=u;if(n&&"input"===u.toLowerCase()&&e.getAttribute("type")&&!e.getAttribute("id")&&!e.getAttribute("class")&&(x+="[type="+Ue(e.getAttribute("type")||"")+"]"),f)x+=":nth-child("+String(v+1)+")";else if(d)try{for(var T=i(s),A=T.next();!A.done;A=T.next()){x+="."+Ue(A.value.slice(1))}}catch(e){r={error:e}}finally{try{A&&!A.done&&(o=T.return)&&o.call(T)}finally{if(r)throw r.error}}return new Fe(x,!1)},$e=function(e){var t=e.getAttribute("class");return t?t.split(/\s+/g).filter(Boolean).map(function(e){return"$"+e}):[]},Ze=function(e){return"#"+Ue(e)};function Je(e,t){try{return function(e,t){if(e.nodeType!==Node.ELEMENT_NODE)return"";for(var n=[],r=e;r;){var i=Ve(r,Boolean(t),r===e);if(!i)break;if(n.push(i),i.optimized)break;r=r.parentElement}return n.reverse(),n.join(" > ")}(e)}catch(e){var n=e instanceof Error?e.message:String(e);return null==t||t.warn("@amplitude/element-selector: legacyCssPath threw — emitting empty selector: ".concat(n)),""}}var Ke,Qe=Object.freeze({enabled:!1,explicitTrackingAttribute:"data-amp-track-id",autogeneratedIdPatterns:a([],o([/^:r[0-9a-z]+:$/,/^radix-/,/^headlessui-/,/^mui-/,/^[a-f0-9]{16,}$/i,/-\d{8,}$/,/\d{4,}/]),!1),unstableClassPatterns:a([],o([/^(p|m|px|py|mx|my|pt|pb|pl|pr|mt|mb|ml|mr)-\d+$/,/^(w|h|min-w|max-w|min-h|max-h)-/,/^(text|bg|border|ring|fill|stroke)-/,/^(hover|focus|active|disabled|group-hover):/,/^(sm|md|lg|xl|2xl):/,/^z-\d+$/,/^data-\[/,/^\[/,/^css-[a-z0-9]{6,}$/,/^[a-zA-Z]+_[a-zA-Z0-9]{3,}__[a-zA-Z0-9]{5,}$/,/^sc-[a-zA-Z0-9]{6,}$/,/^jsx-\d+$/,/^swiper-slide-(visible|fully-visible|active|prev|next|duplicate)$/,/^is-(active|open|selected|hovered|focused|expanded)$/,/^Mui[A-Z][a-zA-Z]+-(focused|selected|disabled|expanded|focusVisible|active|checked)$/,/^Mui-(selected|focused|disabled|expanded|focusVisible|active|checked)$/,/^data-state-/]),!1),maxAncestorWalkDepth:void 0});function et(e,t){if(!e)return tt();var n,r=tt();return"boolean"==typeof e.enabled&&(r.enabled=e.enabled),"string"==typeof e.explicitTrackingAttribute&&""!==e.explicitTrackingAttribute&&(r.explicitTrackingAttribute=e.explicitTrackingAttribute),Array.isArray(e.autogeneratedIdPatterns)&&(r.autogeneratedIdPatterns=function(e,t){var n,r,o=[];try{for(var a=i(e),l=a.next();!l.done;l=a.next()){var u=l.value;try{o.push(new RegExp(u))}catch(e){var c=e instanceof Error?e.message:String(e);null==t||t.warn('@amplitude/element-selector: ignoring invalid autogenerated-id pattern "'.concat(u,'" (').concat(c,")"))}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}(e.autogeneratedIdPatterns,t)),Array.isArray(e.unstableClassPatterns)&&(r.unstableClassPatterns=function(e,t){var n,r,o=[];try{for(var a=i(e),l=a.next();!l.done;l=a.next()){var u=l.value;try{o.push(new RegExp(u))}catch(e){var c=e instanceof Error?e.message:String(e);null==t||t.warn('@amplitude/element-selector: ignoring invalid unstable-class pattern "'.concat(u,'" (').concat(c,")"))}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}(e.unstableClassPatterns,t)),r.maxAncestorWalkDepth="number"!=typeof(n=e.maxAncestorWalkDepth)?void 0:Number.isFinite(n)?n<=0?void 0:Math.floor(n):void 0,r}function tt(){return{enabled:Qe.enabled,explicitTrackingAttribute:Qe.explicitTrackingAttribute,autogeneratedIdPatterns:a([],o(Qe.autogeneratedIdPatterns),!1),unstableClassPatterns:a([],o(Qe.unstableClassPatterns),!1),maxAncestorWalkDepth:Qe.maxAncestorWalkDepth}}function nt(e,t){void 0===t&&(t={});var n=e,r=new Set,l=t.logger,u={strategies:t.strategies,scope:t.scope,logger:l};return{generate:function(e){var r,i;if(!n.enabled)return Je(e,l);try{var c=Xe(e,n,u);return null!==c?c:function(e,t,n){var r,i;void 0===n&&(n={});for(var l=null!==(i=null!==(r=n.scope)&&void 0!==r?r:e.ownerDocument)&&void 0!==i?i:document,u=[],c=e,s=0;null!==c&&!(void 0!==t.maxAncestorWalkDepth&&s>t.maxAncestorWalkDepth);){var d=Be(c,t);if(null!==d){var f=a(["".concat(c.tagName.toLowerCase(),"#").concat(qe(d))],o(u),!1).join(" > ");if(We(l,f,e))return f}u.unshift(Ge(c)),c=c.parentElement,s+=1}return u.join(" > ")}(e,n,{scope:null!==(i=null!==(r=t.scope)&&void 0!==r?r:e.ownerDocument)&&void 0!==i?i:document})}catch(t){var s=t instanceof Error?t.message:String(t);return null==l||l.warn("@amplitude/element-selector: strategy chain threw — falling back to legacy cssPath: ".concat(s)),Je(e,l)}},getConfig:function(){return n},updateConfig:function(e){var t,o;n=e;try{for(var a=i(r),u=a.next();!u.done;u=a.next()){var c=u.value;try{c(e)}catch(e){var s=e instanceof Error?e.message:String(e);null==l||l.warn("@amplitude/element-selector: onConfigChange subscriber threw — ".concat(s))}}}catch(e){t={error:e}}finally{try{u&&!u.done&&(o=a.return)&&o.call(a)}finally{if(t)throw t.error}}},onConfigChange:function(e){return r.add(e),function(){r.delete(e)}}}}var rt,it=function(e,t){var n,r,l,u=this;this.replaceSensitiveString=function(e){return function(e,t){var n,r;if(void 0===t&&(t=[]),"string"!=typeof e)return"";var o=e;o=(o=(o=o.replace(k,A)).replace(S,A)).replace(C,A);try{for(var a=i(t),l=a.next();!l.done;l=a.next()){var u=l.value;try{o=o.replace(u,A)}catch(e){}}}catch(e){n={error:e}}finally{try{l&&!l.done&&(r=a.return)&&r.call(a)}finally{if(n)throw n.error}}return o}(e,u.additionalMaskTextPatterns)},this.getHierarchy=function(e){var t,n,r,l,c,s=performance.now();if(!e)return[];for(var d=function(e){var t=[];if(!e)return t;t.push(e);for(var n=e.parentElement;n&&"HTML"!==n.tagName;)t.push(n),n=n.parentElement;return t}(e),f=new Map,v=d.length-1;v>=0;v--){var p=d[v];if(p){var h=he(p.getAttribute(de)),g=v===d.length-1?[]:null!==(r=f.get(d[v+1]))&&void 0!==r?r:new Set,m=new Set(a(a([],o(g),!1),o(h),!1));f.set(p,m)}}c=d.map(function(e){var t;return Re(e,null!==(t=f.get(e))&&void 0!==t?t:new Set)});var b=function(e){(null==e?void 0:e.attrs)&&Object.entries(e.attrs).forEach(function(t){var n=o(t,2),r=n[0],i=n[1];e.attrs&&(e.attrs[r]=u.replaceSensitiveString(i))})};try{for(var y=i(c),w=y.next();!w.done;w=y.next())b(w.value)}catch(e){t={error:e}}finally{try{w&&!w.done&&(n=y.return)&&n.call(y)}finally{if(t)throw t.error}}var E=performance.now();return null===(l=u.diagnosticsClient)||void 0===l||l.recordHistogram("autocapturePlugin.getHierarchy",E-s),c},this.getNearestLabel=function(e){var t,n=e.parentElement;if(!n)return"";try{t=n.querySelector(":scope>span,h1,h2,h3,h4,h5,h6")}catch(e){t=null}return t?u.getText(t):u.getNearestLabel(n)},this.getElementPath=function(e){var t;if(!e)return"";var n=performance.now(),r=u.selectorEngine.generate(e),i=performance.now();return null===(t=u.diagnosticsClient)||void 0===t||t.recordHistogram("autocapturePlugin.getElementPath",i-n),r},this.updateSelectorConfig=function(e,t){u.selectorEngine.updateConfig(et(null!=e?e:void 0,t))},this.getEventProperties=function(e,t,n){var r,i,a,l,s,d,f=null===(a=null===(i=null==t?void 0:t.tagName)||void 0===i?void 0:i.toLowerCase)||void 0===a?void 0:a.call(i),v="function"==typeof t.getBoundingClientRect?t.getBoundingClientRect():{left:null,top:null},p=u.getHierarchy(t),h=null===(l=p[0])||void 0===l?void 0:l.attrs,g=u.getNearestLabel(t),m=(s=null!=h?h:{},d=n,Object.entries(s).reduce(function(e,t){var n=o(t,2),r=n[0],i=n[1];if(r.startsWith(d)){var a=r.replace(d,"");a&&(e[a]=i||"")}return e},{})),b=((r={})["[Amplitude] Element Hierarchy"]=p,r[oe]=f,r[ae]=u.getText(t),r["[Amplitude] Element Position Left"]=null==v.left?null:Math.round(v.left),r["[Amplitude] Element Position Top"]=null==v.top?null:Math.round(v.top),r["[Amplitude] Element Attributes"]=m,r["[Amplitude] Element Path"]=u.getElementPath(t),r["[Amplitude] Element Parent Label"]=g,r[le]=c(window.location.href.split("?")[0]),r["[Amplitude] Page Title"]=function(e){if("undefined"==typeof document||!document.title)return"";var t=document.querySelector("title");return t&&t.hasAttribute(T)?A:e?e(document.title):document.title}(u.replaceSensitiveString),r[ue]=window.innerHeight,r[ce]=window.innerWidth,r),y=me();if(y&&(b[se]=y),b["[Amplitude] Element ID"]=t.getAttribute("id")||"",b["[Amplitude] Element Class"]=t.getAttribute("class"),b["[Amplitude] Element Aria Label"]=null==h?void 0:h["aria-label"],"a"===f&&"click"===e&&t instanceof HTMLAnchorElement){var w=t.href.substring(0,128);b["[Amplitude] Element Href"]=u.replaceSensitiveString(w)}return ge(b)},this.addTypeAndTimestamp=function(e,t){return{event:e,timestamp:Date.now(),type:t}},this.addAdditionalEventProperties=function(e,t,n,r,i){void 0===i&&(i=!1);var o=u.addTypeAndTimestamp(e,t);if(function(e){return"click"===e.type||"change"===e.type}(o)&&null!==o.event.target){if(i){var a=function(e,t){var n,r=null===(n=null===window||void 0===window?void 0:window.getComputedStyle)||void 0===n?void 0:n.call(window,e);return"pointer"===(null==r?void 0:r.getPropertyValue("cursor"))&&"click"===t}(o.event.target,o.type);if(a)return o.closestTrackedAncestor=o.event.target,o.targetElementProperties=u.getEventProperties(o.type,o.closestTrackedAncestor,r),o}var l=be(o.event.target,n);return l&&(o.closestTrackedAncestor=l,o.targetElementProperties=u.getEventProperties(o.type,l,r)),o}return o},this.extractDataFromDataSource=function(e,t){if("DOM_ELEMENT"===e.sourceType){var n=function(e,t){try{if("DOM_ELEMENT"===e.sourceType){var n=document.documentElement;return e.scope&&t&&(n=t.closest(e.scope)),n&&e.selector?n.querySelector(e.selector):n}}catch(e){return}}(e,t);if(!n)return;return"TEXT"===e.elementExtractType?u.getText(n):"ATTRIBUTE"===e.elementExtractType&&e.attribute?n.getAttribute(e.attribute):void 0}},this.getTextWithMaskedDescendants=function(e){var t,n,r="[".concat(T,"], [contenteditable]");if(!e.querySelector(r))return e.innerText;var o="",a=Array.from(e.childNodes);try{for(var l=i(a),c=l.next();!c.done;c=l.next()){var s=c.value;s.nodeType!==Node.TEXT_NODE?s instanceof Element&&(s.hasAttribute(T)||s.hasAttribute("contenteditable")?o+=A:o+=u.getTextWithMaskedDescendants(s)):o+=s.textContent||""}}catch(e){t={error:e}}finally{try{c&&!c.done&&(n=l.return)&&n.call(l)}finally{if(t)throw t.error}}return o},this.getText=function(e){if(null!==e.closest("[".concat(T,"]")))return A;var t="";return t=e.querySelector("[".concat(T,"], [contenteditable]"))?u.getTextWithMaskedDescendants(e):e.innerText||"",u.replaceSensitiveString(t.substring(0,255)).replace(/\s+/g," ").trim()},this.getEventTagProps=function(e){var t,n,r;if(!e)return{};var i=null===(r=null===(n=null==e?void 0:e.tagName)||void 0===n?void 0:n.toLowerCase)||void 0===r?void 0:r.call(n),o=((t={})[oe]=i,t[ae]=u.getText(e),t[le]=window.location.href.split("?")[0],t);return ge(o)},this.diagnosticsClient=null==t?void 0:t.diagnosticsClient,this.selectorEngine=(Ke||(Ke=nt(et())),Ke);var s=null!==(l=e.maskTextRegex)&&void 0!==l?l:[],d=[];try{for(var f=i(s),v=f.next();!v.done;v=f.next()){var p=v.value;if(d.length>=25)break;if(p instanceof RegExp)d.push(p);else if("pattern"in p&&"string"==typeof p.pattern)try{d.push(new RegExp(p.pattern,"i"))}catch(e){}}}catch(e){n={error:e}}finally{try{v&&!v.done&&(r=f.return)&&r.call(f)}finally{if(n)throw n.error}}this.additionalMaskTextPatterns=d};function ot(e,t){var n=e.remoteConfigClient;if(e.fetchRemoteConfig&&n){var r=n.subscribe("configs.analyticsSDK.browserSDK.autocapture.elementSelector","all",function(n){t.updateSelectorConfig(n,e.loggerProvider)});return function(){n.unsubscribe(r)}}}!function(e){e.ClickObservable="clickObservable",e.ChangeObservable="changeObservable",e.NavigateObservable="navigateObservable",e.MutationObservable="mutationObservable",e.ScrollObservable="scrollObservable",e.ExposureObservable="exposureObservable",e.BrowserErrorObservable="browserErrorObservable",e.SelectionObservable="selectionObservable",e.MouseMoveObservable="mouseMoveObservable"}(rt||(rt={}));var at=function(e,u){var s,d,f,v,p,h,y,w,E,x,T,A;void 0===e&&(e={}),null==u||u.diagnosticsClient.setTag("plugin.autocapture.version",re);var k=e.dataAttributePrefix,S=void 0===k?m:k,C=e.visualTaggingOptions,O=void 0===C?{enabled:!0}:C;e.cssSelectorAllowlist=null!==(s=e.cssSelectorAllowlist)&&void 0!==s?s:g,e.actionClickAllowlist=null!==(d=e.actionClickAllowlist)&&void 0!==d?d:b,e.debounceTime=null!==(f=e.debounceTime)&&void 0!==f?f:0;var P=!1!==(null===(v=e.viewportContentUpdated)||void 0===v?void 0:v.enabled),M=null!==(y=null!==(h=null===(p=e.viewportContentUpdated)||void 0===p?void 0:p.exposureDuration)&&void 0!==h?h:e.exposureDuration)&&void 0!==y?y:150;e.viewportContentUpdated=t(t({},e.viewportContentUpdated),{exposureDuration:M}),e.pageUrlExcludelist=null===(w=e.pageUrlExcludelist)||void 0===w?void 0:w.reduce(function(e,t){if("string"==typeof t&&e.push(t),t instanceof RegExp&&e.push(t),"object"==typeof t&&null!==t&&"pattern"in t)try{e.push(new RegExp(t.pattern))}catch(n){return console.warn("Invalid regex pattern: ".concat(t.pattern),n),e}return e},[]);var _,N="@amplitude/plugin-autocapture-browser",L=[],D=new it(e,u),I=new Set,R=new Set,B=function(){var t,n,r=F(Ae().map(function(t){return D.addAdditionalEventProperties(t,"click",e.cssSelectorAllowlist,S)})),i=F(new Y(function(t){var n,r=function(n){var r=D.addAdditionalEventProperties(n,"change",e.cssSelectorAllowlist,S);t.next(r)};return null===(n=l())||void 0===n||n.document.addEventListener("change",r,{capture:!0}),function(){var e;return null===(e=l())||void 0===e?void 0:e.document.removeEventListener("change",r)}}));window.navigation&&(n=F(new Y(function(t){var n=function(n){var r=D.addAdditionalEventProperties(n,"navigate",e.cssSelectorAllowlist,S);t.next(r)};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}})));var o=F(Te().map(function(t){return D.addAdditionalEventProperties(t,"mutation",e.cssSelectorAllowlist,S)})),a=new Y(function(e){var t,n=function(t){e.next(t)};return null===(t=l())||void 0===t||t.addEventListener("scroll",n),function(){var e;null===(e=l())||void 0===e||e.removeEventListener("scroll",n)}}),u=function(e,t){return new Y(function(n){var r,i=l();if(!(null==i?void 0:i.IntersectionObserver))return function(){};var o=new IntersectionObserver(function(e){e.forEach(function(e){n.next(e)})},{root:null,rootMargin:"0px",threshold:1}),a=t.join(",");(null!==(r=null==i?void 0:i.document.querySelectorAll(a))&&void 0!==r?r:[]).forEach(function(e){o.observe(e)});var u=e.subscribe(function(e){return e.event.forEach(function(e){return e.addedNodes.forEach(function(e){e instanceof Element&&(e.matches(a)&&o.observe(e),e.querySelectorAll(a).forEach(function(e){o.observe(e)}))})})});return function(){u.unsubscribe(),o.disconnect()}})}(o,e.cssSelectorAllowlist);return(t={})[rt.ChangeObservable]=i,t[rt.ClickObservable]=r,t[rt.MutationObservable]=o,t[rt.NavigateObservable]=n,t[rt.ScrollObservable]=a,t[rt.ExposureObservable]=u,t},j=Oe(Object.values(null!==(x=null===(E=e.pageActions)||void 0===E?void 0:E.labeledEvents)&&void 0!==x?x:{})),H=Pe(null!==(A=null===(T=e.pageActions)||void 0===T?void 0:T.triggers)&&void 0!==A?A:[]),U=function(e,t,n,r){return new _e(e,t,n,r)}(j,H,D,e);return{name:N,type:"enrichment",setup:function(i,u){return n(void 0,void 0,void 0,function(){var n,s,d,f,v,p,h,g,m,b,y,w,E,x,T,A,k,C,q,z,X,Y;return r(this,function(r){return"undefined"==typeof document||(n=!1,s={maxX:void 0,maxY:void 0},i.fetchRemoteConfig&&(i.remoteConfigClient?i.remoteConfigClient.subscribe("configs.analyticsSDK.pageActions","all",function(n){!function(n){var r,i;n&&(e.pageActions=t(t({},e.pageActions),n),j=Oe(Object.values(null!==(r=e.pageActions.labeledEvents)&&void 0!==r?r:{})),H=Pe(null!==(i=e.pageActions.triggers)&&void 0!==i?i:[]),U.update(j,H,e))}(n)}):i.loggerProvider.debug("Remote config client is not provided, skipping remote config fetch")),(d=ot(i,D))&&L.push({unsubscribe:d}),f=pe(e,e.cssSelectorAllowlist),v=pe(e,e.actionClickAllowlist),p=B(),h=function(e){var t=e.amplitude,n=e.allObservables,r=e.shouldTrackEvent,i=e.evaluateTriggers;return n.clickObservable.filter(ye).filter(function(e){return r("click",e.closestTrackedAncestor)}).map(function(e){return i(e)}).subscribe(function(e){null==t||t.track(ie,e.targetElementProperties)})}({allObservables:p,amplitude:u,shouldTrackEvent:f,evaluateTriggers:U.evaluate.bind(U)}),L.push(h),g=function(e){var t=e.amplitude,n=e.allObservables,r=e.getEventProperties,i=e.shouldTrackEvent,o=e.evaluateTriggers;return n.changeObservable.filter(ye).filter(function(e){return i("change",e.closestTrackedAncestor)}).map(function(e){return o(e)}).subscribe(function(e){null==t||t.track("[Amplitude] Element Changed",r("change",e.closestTrackedAncestor))})}({allObservables:p,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return D.getEventProperties.apply(D,a(a([],o(e),!1),[S],!1))},amplitude:u,shouldTrackEvent:f,evaluateTriggers:U.evaluate.bind(U)}),L.push(g),m=function(e){var t=e.amplitude,n=e.allObservables,r=e.options,i=e.getEventProperties,o=e.shouldTrackEvent,a=e.shouldTrackActionClick,l=n.clickObservable,u=n.mutationObservable,c=n.navigateObservable,s=l.filter(function(e){return!o("click",e.closestTrackedAncestor)}).map(function(e){var t=be(e.event.target,r.actionClickAllowlist);return e.closestTrackedAncestor=t,null!==e.closestTrackedAncestor&&(e.targetElementProperties=i(e.type,e.closestTrackedAncestor)),e}).filter(ye).filter(function(e){return a("click",e.closestTrackedAncestor)}),d=c?W(u,c):u,f=W(s,d),v=null,p=null;return G(f,function(e){if(v&&(clearTimeout(v),v=null),"click"===e.type)return p=e,v=setTimeout(function(){v=null,p=null},500),Promise.resolve(null);if(p){var t=p;return p=null,Promise.resolve(t)}return Promise.resolve(null)}).subscribe(function(e){e&&(null==t||t.track(ie,i("click",e.closestTrackedAncestor)))})}({allObservables:p,options:e,getEventProperties:function(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return D.getEventProperties.apply(D,a(a([],o(e),!1),[S],!1))},amplitude:u,shouldTrackEvent:f,shouldTrackActionClick:v}),m&&L.push(m),b=function(e){e.amplitude;var t=e.allObservables.scrollObservable,n={maxX:0,maxY:0},r=t.subscribe(function(){var e,t,r,i,o=l(),a=Math.floor(null!==(t=null!==(e=null==o?void 0:o.scrollX)&&void 0!==e?e:null==o?void 0:o.pageXOffset)&&void 0!==t?t:0),u=Math.floor(null!==(i=null!==(r=null==o?void 0:o.scrollY)&&void 0!==r?r:null==o?void 0:o.pageYOffset)&&void 0!==i?i:0);n.maxX=Math.max(n.maxX,a),n.maxY=Math.max(n.maxY,u)});return{unsubscribe:function(){r.unsubscribe()},getState:function(){return n},reset:function(){n.maxX=0,n.maxY=0}}}({allObservables:p,amplitude:u}),L.push(b),y={},w=l(),E=function(e){e&&n||(setTimeout(function(){n=!1},100),n=!0,function(e){var t,n,r,i,o,a,u=e.amplitude,s=e.scrollTracker,d=e.currentElementExposed,f=e.elementExposedForPage,v=e.exposureTracker,p=e.isPageEnd,h=e.lastScroll,g=s.getState(),m=l(),b=null!==(n=null==m?void 0:m.innerWidth)&&void 0!==n?n:0,y=null!==(r=null==m?void 0:m.innerHeight)&&void 0!==r?r:0,w=((t={})[le]=c(null!==(a=null===(o=null===(i=null==m?void 0:m.location)||void 0===i?void 0:i.href)||void 0===o?void 0:o.split("?")[0])&&void 0!==a?a:""),t["[Amplitude] Max Page X"]=g.maxX+b,t["[Amplitude] Max Page Y"]=g.maxY+y,t[ue]=y,t[ce]=b,t["[Amplitude] Element Exposed"]=Array.from(d),t),E=me();E&&(w[se]=E),0!==d.size||g.maxX!==h.maxX||g.maxY!==h.maxY?(null==u||u.track("[Amplitude] Viewport Content Updated",w),h.maxX=g.maxX,h.maxY=g.maxY,d.clear(),p&&(s.reset(),f.clear(),null==v||v.reset())):p&&(s.reset(),f.clear(),null==v||v.reset())}({amplitude:u,scrollTracker:b,currentElementExposed:R,elementExposedForPage:I,exposureTracker:y.exposure,isPageEnd:e,lastScroll:s}))},x=function(e){!function(e,t,n,r){if(!t.has(e)){t.add(e),n.add(e);var i=Array.from(n);JSON.stringify(i).length>=18e3&&r(!1)}}(e,I,R,E)},P&&(y.exposure=function(e){var t=e.allObservables,n=e.onExposure,r=e.dataExtractor,i=e.exposureDuration,o=void 0===i?150:i,a=new Map,l=new Map,u=t.exposureObservable.subscribe(function(e){var t=e,i=t.target;if(t.isIntersecting){if(!a.get(i)){var u=setTimeout(function(){a.set(i,!0);var e=r.getElementPath(i);n(e),l.set(i,null)},o);l.set(i,u)}}else!t.isIntersecting&&t.intersectionRatio<1&&(u=l.get(i))&&(clearTimeout(u),l.set(i,null))});return{unsubscribe:function(){u.unsubscribe()},reset:function(){l.forEach(function(e){e&&clearTimeout(e)}),l.clear(),a.clear()}}}({allObservables:p,onExposure:x,dataExtractor:D,exposureDuration:M}),y.exposure&&L.push(y.exposure),T=function(){E(!0)},null==w||w.addEventListener("beforeunload",T),_=function(){null==w||w.removeEventListener("beforeunload",T)},L.push({unsubscribe:function(){return _()}}),(A=p[rt.NavigateObservable])?L.push(A.subscribe(function(){E(!0)})):w&&(k=function(){E(!0)},w.addEventListener("popstate",k),C=w.history.pushState,w.history&&C&&(w.history.pushState=new Proxy(C,{apply:function(e,t,n){var r=o(n,3),i=r[0],a=r[1],l=r[2];e.apply(t,[i,a,l]),E(!0)}})),L.push({unsubscribe:function(){w.removeEventListener("popstate",k),w.history&&C&&(w.history.pushState=C)}}))),null===(Y=null==i?void 0:i.loggerProvider)||void 0===Y||Y.log("".concat(N," has been successfully added.")),window.opener&&O.enabled&&(q=e.cssSelectorAllowlist,z=e.actionClickAllowlist,Ee(X=ee(),{dataExtractor:D,isElementSelectable:pe(e,a(a([],o(q),!1),o(z),!1)),cssSelectorAllowlist:q,actionClickAllowlist:z}),function(e,t){var n,r=e;if(!0!==r[te]){r[te]=!0;var i=null!==(n=null==t?void 0:t.scriptUrl)&&void 0!==n?n:"https://cdn.amplitude.com/libs/background-capture-1.0.3.js.gz",o=null,a=function(t,n){var r,i;"background-capture-complete"===t&&(null===(i=null===(r=e.logger)||void 0===r?void 0:r.debug)||void 0===i||i.call(r,"Background capture complete"),e.notify({action:"background-capture-complete",data:n}))};e.registerActionHandler("initialize-background-capture",function(){var t,n;null===(n=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Initializing background capture (external script)");var r=new URL(i,e.endpoint).toString();e.loadScriptOnce(r).then(function(){var t,n,r;null===(n=null===(t=e.logger)||void 0===t?void 0:t.debug)||void 0===n||n.call(t,"Background capture script loaded (external)"),o=null===(r=null===window||void 0===window?void 0:window.amplitudeBackgroundCapture)||void 0===r?void 0:r.call(window,{messenger:e,onBackgroundCapture:a}),e.notify({action:"background-capture-loaded"})}).catch(function(){var t;null===(t=e.logger)||void 0===t||t.warn("Failed to initialize background capture")})}),e.registerActionHandler("close-background-capture",function(){var e;null===(e=null==o?void 0:o.close)||void 0===e||e.call(o),o=null})}}(X),X.setup(t({logger:null==i?void 0:i.loggerProvider},(null==i?void 0:i.serverZone)&&{endpoint:Z[i.serverZone]})))),[2]})})},execute:function(e){return n(void 0,void 0,void 0,function(){return r(this,function(t){return[2,e]})})},teardown:function(){return n(void 0,void 0,void 0,function(){var e,t,n,o;return r(this,function(r){try{for(e=i(L),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(o=e.return)&&o.call(e)}finally{if(n)throw n.error}}return[2]})})}}},lt=["mutation","navigate"];function ut(e,t){var n,r,i,o,a=t.event,l=a.pageX,u=a.pageY;e.yMin=Math.min(null!==(n=e.yMin)&&void 0!==n?n:u,u),e.yMax=Math.max(null!==(r=e.yMax)&&void 0!==r?r:u,u),e.xMin=Math.min(null!==(i=e.xMin)&&void 0!==i?i:l,l),e.xMax=Math.max(null!==(o=e.xMax)&&void 0!==o?o:l,l),e.isOutOfBounds=e.yMax-e.yMin>50||e.xMax-e.xMin>50}function ct(e){if(0===e.length)return null;var n=e[0],r=e[e.length-1];return{rageClickEvent:t({"[Amplitude] Begin Time":new Date(n.timestamp).toISOString(),"[Amplitude] End Time":new Date(r.timestamp).toISOString(),"[Amplitude] Duration":r.timestamp-n.timestamp,"[Amplitude] Clicks":e.map(function(e){return{X:e.event.pageX,Y:e.event.pageY,Time:e.timestamp}}),"[Amplitude] Click Count":e.length},n.targetElementProperties),time:n.timestamp}}function st(e){var t=this,i=e.amplitude,o=e.allObservables,a=e.shouldTrackRageClick,l=o.clickObservable,u=o.selectionObservable,c=[],s={},d=null;function f(e){c=[],s={},e&&(ut(s,e),c.push(e))}var v=G(l.filter(function(e){return a("click",e.closestTrackedAncestor)}),function(e){return n(t,void 0,void 0,function(){var t;return r(this,function(n){return ut(s,e),t=null,0===c.length||function(e,t){return e.length>0&&e[e.length-1].closestTrackedAncestor!==t.closestTrackedAncestor}(c,e)||function(e,t){var n=e[Math.max(0,e.length-4+1)];return t.timestamp-n.timestamp>=1e3}(c,e)||s.isOutOfBounds?(d&&(t=ct(c)),f(e)):c.push(e),d&&(clearTimeout(d.timerId),d.resolve(t),d=null),c.length>=4?[2,new Promise(function(e){d={resolve:e,timerId:setTimeout(function(){e(ct(c))},1e3)}})]:[2,null]})})}),p=null==u?void 0:u.subscribe(function(){f()}),h=v.subscribe(function(e){null!==e&&i.track("[Amplitude] Rage Click",e.rageClickEvent,{time:e.time})});return{unsubscribe:function(){h.unsubscribe(),null==p||p.unsubscribe()}}}var dt,ft;!function(e){e.INCREASING="increasing",e.DECREASING="decreasing"}(dt||(dt={})),function(e){e.X="x",e.Y="y"}(ft||(ft={}));function vt(e){var t=e.changes,n=e.changesThreshold,r=e.thresholdMs;return!(t.length<n)&&t[t.length-1]-t[0]<r}function pt(e){e.changes=[],e.startTime=void 0}function ht(e){for(var t=e.changes,n=e.thresholdMs,r=0,i=t[t.length-1];r<t.length;r++){if(i-t[r]<n)break}0!==r&&(e.startTime=t[r],e.changes.splice(0,r))}var gt=function(e){var t=e.mouseDirectionChangeObservable,n=e.directionChanges,r=void 0===n?20:n,i=e.thresholdMs,o=void 0===i?2e3:i;return new Y(function(e){var n={changes:[],changesThreshold:r,thresholdMs:o},i={changes:[],changesThreshold:r,thresholdMs:o},a=void 0,l=null;function u(){void 0!==a&&(e.next(a),a=void 0,null!==l&&clearTimeout(l),pt(n),pt(i))}return t.subscribe(function(e){null!==l&&clearTimeout(l),function(e){var t=+Date.now();e.startTime=e.startTime||t;var n=e.changes,r=e.changesThreshold;n.push(t),n.length>r&&n.shift()}(e===ft.X?n:i);var t=function(e,t){var n=void 0;if(vt(e)&&(n=e.startTime),vt(t)){var r=t.startTime;r&&(!n||r<n)&&(n=r)}return n}(n,i);return t?(a=a||t,l=setTimeout(function(){u(),l=null},o)):u(),ht(n),ht(i),function(){null!==l&&(clearTimeout(l),l=null)}})})},mt=function(e){var t=e.amplitude,n=e.options,r=e.allObservables,i=e.directionChanges,o=void 0===i?20:i,a=e.thresholdMs,l=void 0===a?2e3:a,u=function(e){var t=e.allWindowObservables.mouseMoveObservable;return new Y(function(e){var n=null,r=null,i=null;return t.subscribe(function(t){var o={x:t.clientX,y:t.clientY};null!==n?(o.x>n.x?(r===dt.DECREASING&&e.next(ft.X),r=dt.INCREASING):o.x<n.x&&(r===dt.INCREASING&&e.next(ft.X),r=dt.DECREASING),o.y>n.y?(i===dt.DECREASING&&e.next(ft.Y),i=dt.INCREASING):o.y<n.y&&(i===dt.INCREASING&&e.next(ft.Y),i=dt.DECREASING),n=o):n=o})})}({allWindowObservables:r});return gt({mouseDirectionChangeObservable:u,directionChanges:o,thresholdMs:l}).subscribe(function(e){ve(n)&&t.track("[Amplitude] Thrashed Cursor",void 0,{time:e})})};function bt(e,t,n,r){if(!r)return[];var i=e[t];return"object"==typeof i&&null!==i&&"cssSelectorAllowlist"in i&&Array.isArray(i.cssSelectorAllowlist)?i.cssSelectorAllowlist:n}var yt=4e3;function wt(e,t){var n=e.startTime+e.duration;return t.filter(function(t){return t.startTime<n&&t.startTime+t.duration>e.startTime}).map(function(e){return e.name})}function Et(e,n){var r,i=wt(e,n),o=null!==(r=e.scripts)&&void 0!==r?r:[],a=o.map(function(e){return e.sourceURL}).filter(Boolean),l=o.map(function(e){return e.sourceFunctionName}).filter(Boolean),u=o.map(function(e){return e.sourceCharPosition}).filter(function(e){return"number"==typeof e&&e>=0}),c=o.map(function(e){return e.invokerType}).filter(Boolean),s=o.map(function(e){return e.invoker}).filter(Boolean);return t(t(t(t(t(t(t({"[Amplitude] Main Thread Block Source":"long-animation-frame","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.blockingDuration,"[Amplitude] Main Thread Block Start Time":e.startTime},i.length>0&&{"[Amplitude] Main Thread Block Measures":i}),{"[Amplitude] Main Thread Block Render Start":e.renderStart,"[Amplitude] Main Thread Block Style And Layout Start":e.styleAndLayoutStart,"[Amplitude] Main Thread Block Script Count":o.length}),a.length>0&&{"[Amplitude] Main Thread Block Script URLs":a}),l.length>0&&{"[Amplitude] Main Thread Block Script Functions":l}),u.length>0&&{"[Amplitude] Main Thread Block Script Positions":u}),c.length>0&&{"[Amplitude] Main Thread Block Invoker Types":c}),s.length>0&&{"[Amplitude] Main Thread Block Invokers":s})}function xt(e,n){var r,i=wt(e,n),o=null!==(r=e.attribution)&&void 0!==r?r:[];return t(t({"[Amplitude] Main Thread Block Source":"long-task","[Amplitude] Main Thread Block Duration":e.duration,"[Amplitude] Main Thread Block Blocking Duration":e.duration,"[Amplitude] Main Thread Block Start Time":e.startTime},i.length>0&&{"[Amplitude] Main Thread Block Measures":i}),o.length>0&&{"[Amplitude] Main Thread Block Attribution":o.map(function(e){return e.name})})}function Tt(e){var t=e.amplitude,n=e.options,r=e.durationThreshold,o=void 0===r?100:r,a=function(){if("undefined"==typeof PerformanceObserver)return null;try{var e=PerformanceObserver.supportedEntryTypes;if(e.includes("long-animation-frame"))return"long-animation-frame";if(e.includes("longtask"))return"longtask"}catch(e){}return null}();if(!a)return{unsubscribe:function(){}};var l=[],u=new PerformanceObserver(function(e){var t,n,r=performance.now();try{for(var o=i(e.getEntries()),a=o.next();!a.done;a=o.next()){var u=a.value;l.push(u)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(t)throw t.error}}for(var c=r-1e4;l.length>0&&l[0].startTime<c;)l.shift()});try{u.observe({entryTypes:["measure"]})}catch(e){}var c=new PerformanceObserver(function(e){var r,u;try{for(var c=i(e.getEntries()),s=c.next();!s.done;s=c.next()){var d=s.value;if(!ve(n))return;if(!(d.duration<o)){var f="long-animation-frame"===a?Et(d,l):xt(d,l);t.track("[Amplitude] Main Thread Block",f)}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(u=c.return)&&u.call(c)}finally{if(r)throw r.error}}});try{c.observe({entryTypes:[a]})}catch(e){return u.disconnect(),{unsubscribe:function(){}}}return{unsubscribe:function(){c.disconnect(),u.disconnect()}}}return e.DataExtractor=it,e.autocapturePlugin=at,e.enableVisualTagging=Ee,e.frustrationPlugin=function(e){var l;void 0===e&&(e={});var u="@amplitude/plugin-frustration-browser",c=[],s=!1!==e.errorClicks;e.errorClicks||(s=!1);var d=!1!==e.deadClicks&&null!==e.deadClicks,f=!1!==e.rageClicks&&null!==e.rageClicks,v=!1!==e.thrashedCursor&&null!==e.thrashedCursor;e.thrashedCursor||(v=!1);var p=bt(e,"rageClicks",x,f),h=bt(e,"deadClicks",w,d),g=bt(e,"errorClicks",E,s),b=null!==(l=e.dataAttributePrefix)&&void 0!==l?l:m,y=new it(e),T=a([],o(new Set(a(a(a([],o(p),!1),o(h),!1),o(g),!1))),!1),A=function(){var e,n,r=F(Ae("pointerdown").map(function(e){return y.addAdditionalEventProperties(e,"click",T,b,!0)})),i=F(ke().map(function(e){return y.addTypeAndTimestamp(e,"error")})),o=F(Te().map(function(e){return y.addAdditionalEventProperties(e,"mutation",T,b)}));window.navigation&&(n=F(new Y(function(e){var n=function(n){e.next(t(t({},n),{type:"navigate"}))};return window.navigation.addEventListener("navigate",n),function(){window.navigation.removeEventListener("navigate",n)}}).map(function(e){return y.addAdditionalEventProperties(e,"navigate",T,b)})));var a=F(new Y(function(e){var t=function(){var t=document.activeElement;if(t&&("TEXTAREA"===t.tagName||"INPUT"===t.tagName)){try{if(t.selectionStart===t.selectionEnd)return}catch(e){return}return e.next()}var n=window.getSelection();if(n&&!n.isCollapsed)return e.next()};return window.document.addEventListener("selectionchange",t),function(){window.document.removeEventListener("selectionchange",t)}})),l=F(new Y(function(e){var t=function(t){e.next(t)},n={capture:!0};return xe.document.addEventListener("mousemove",t,n),function(){xe.document.removeEventListener("mousemove",t,n)}}));return(e={})[rt.ClickObservable]=r,e[rt.MutationObservable]=o,e[rt.NavigateObservable]=n,e[rt.BrowserErrorObservable]=i,e[rt.SelectionObservable]=a,e[rt.MouseMoveObservable]=l,e};return{name:u,type:"enrichment",setup:function(i,o){return n(void 0,void 0,void 0,function(){var n,a,l,m,w,E,x,T,k,S,C,O;return r(this,function(r){return"undefined"==typeof document||(n=A(),(a=ot(i,y))&&c.push({unsubscribe:a}),f&&(l=pe(e,p),m=st({allObservables:n,amplitude:o,shouldTrackRageClick:l}),c.push(m)),d&&(w=pe(e,h),E=function(e){var n=e.amplitude,r=e.allObservables,i=e.getEventProperties,o=e.shouldTrackDeadClick,a=r.clickObservable,l=r.mutationObservable,u=r.navigateObservable,c=a.filter(function(e){return ye(e)&&o("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===ne.LEFT_OR_TOUCH_CONTACT}),s=u?W(l,u):l,d=W(c,s),f=null;return G(d,function(e){return f&&lt.includes(e.type)?(clearTimeout(f),f=null,Promise.resolve(null)):"click"===e.type?f?Promise.resolve(null):new Promise(function(t){f=setTimeout(function(){t(e),f=null},3e3)}):Promise.resolve(null)}).subscribe(function(e){if(e){var r={"[Amplitude] X":e.event.clientX,"[Amplitude] Y":e.event.clientY};n.track("[Amplitude] Dead Click",t(t({},i("click",e.closestTrackedAncestor)),r),{time:e.timestamp})}})}({amplitude:o,allObservables:n,getEventProperties:function(e,t){return y.getEventProperties(e,t,b)},shouldTrackDeadClick:w}),c.push(E)),s&&(x=pe(e,g),T=function(e){var n=e.amplitude,r=e.allObservables,i=e.shouldTrackErrorClick,o=r.clickObservable,a=r.browserErrorObservable,l=o.filter(function(e){return ye(e)&&i("click",e.closestTrackedAncestor)&&e.event.target instanceof Element&&null===e.event.target.closest('a[target="_blank"]')&&e.event.button===ne.LEFT_OR_TOUCH_CONTACT}),u=null,c=null,s=function(){null!==u&&(clearTimeout(u),u=null),c=null};return W(l,a).subscribe(function(e){var r;if("click"===e.type)return s(),c=e,void(u=setTimeout(s,2e3));"error"===e.type&&c&&(n.track("[Amplitude] Error Click",t(((r={})["[Amplitude] Kind"]=e.event.kind,r["[Amplitude] Message"]=e.event.message,r["[Amplitude] Stack"]=e.event.stack,r["[Amplitude] Filename"]=e.event.filename,r["[Amplitude] Line Number"]=e.event.lineNumber,r["[Amplitude] Column Number"]=e.event.columnNumber,r),c.targetElementProperties)),s())})}({amplitude:o,allObservables:n,shouldTrackErrorClick:x}),c.push(T)),v&&(k=void 0,S=void 0,"object"==typeof e.thrashedCursor&&(k=e.thrashedCursor.directionChanges,S=e.thrashedCursor.threshold,k&&k<5&&(i.loggerProvider.warn("'thrashedCursor.directionChanges' of ".concat(k," is below the minimum of ").concat(5,", setting to ").concat(5)),k=5),S&&S>yt&&(i.loggerProvider.warn("'thrashedCursor.threshold' of ".concat(S," is above the maximum of ").concat(yt,", setting to ").concat(yt)),S=yt)),C=mt({amplitude:o,options:e,allObservables:n,directionChanges:k,thresholdMs:S}),c.push(C)),null===(O=null==i?void 0:i.loggerProvider)||void 0===O||O.log("".concat(u," has been successfully added."))),[2]})})},execute:function(e){return n(void 0,void 0,void 0,function(){return r(this,function(t){return[2,e]})})},teardown:function(){return n(void 0,void 0,void 0,function(){var e,t,n,o;return r(this,function(r){try{for(e=i(c),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(o=e.return)&&o.call(e)}finally{if(n)throw n.error}}return[2]})})}}},e.performancePlugin=function(e){void 0===e&&(e={});var t="@amplitude/plugin-performance-browser",o=[],a=!0===e.mainThreadBlock||"object"==typeof e.mainThreadBlock&&null!==e.mainThreadBlock;return{name:t,type:"enrichment",setup:function(i,l){return n(void 0,void 0,void 0,function(){var n,u,c;return r(this,function(r){return"undefined"==typeof document||(a&&(n=100,"object"==typeof e.mainThreadBlock&&void 0!==e.mainThreadBlock.durationThreshold&&(n=e.mainThreadBlock.durationThreshold),u=Tt({amplitude:l,options:e,durationThreshold:n}),o.push(u)),null===(c=null==i?void 0:i.loggerProvider)||void 0===c||c.log("".concat(t," performance tracking has been successfully added."))),[2]})})},execute:function(e){return n(void 0,void 0,void 0,function(){return r(this,function(t){return[2,e]})})},teardown:function(){return n(void 0,void 0,void 0,function(){var e,t,n,a;return r(this,function(r){try{for(e=i(o),t=e.next();!t.done;t=e.next())t.value.unsubscribe()}catch(e){n={error:e}}finally{try{t&&!t.done&&(a=e.return)&&a.call(e)}finally{if(n)throw n.error}}return[2]})})}}},e.plugin=at,Object.defineProperty(e,"__esModule",{value:!0}),e}({});
2
2
  //# sourceMappingURL=amplitude-min.js.map
Binary file