@amplitude/plugin-experiment-browser 1.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/experiment.d.ts +12 -0
- package/lib/cjs/experiment.d.ts.map +1 -0
- package/lib/cjs/experiment.js +27 -0
- package/lib/cjs/experiment.js.map +1 -0
- package/lib/cjs/index.d.ts +3 -0
- package/lib/cjs/index.d.ts.map +1 -0
- package/lib/cjs/index.js +7 -0
- package/lib/cjs/index.js.map +1 -0
- package/lib/esm/experiment.d.ts +12 -0
- package/lib/esm/experiment.d.ts.map +1 -0
- package/lib/esm/experiment.js +23 -0
- package/lib/esm/experiment.js.map +1 -0
- package/lib/esm/index.d.ts +3 -0
- package/lib/esm/index.d.ts.map +1 -0
- package/lib/esm/index.js +2 -0
- package/lib/esm/index.js.map +1 -0
- package/lib/scripts/amplitude-min.umd.js +1 -0
- package/lib/scripts/amplitude-min.umd.js.gz +0 -0
- package/lib/scripts/experiment.d.ts +12 -0
- package/lib/scripts/experiment.d.ts.map +1 -0
- package/lib/scripts/index.d.ts +3 -0
- package/lib/scripts/index.d.ts.map +1 -0
- package/package.json +45 -0
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EnrichmentPlugin, BrowserClient, BrowserConfig } from '@amplitude/analytics-core';
|
|
2
|
+
import { ExperimentConfig, Client as IExperimentClient } from '@amplitude/experiment-js-client';
|
|
3
|
+
export declare class ExperimentPlugin implements EnrichmentPlugin<BrowserClient, BrowserConfig> {
|
|
4
|
+
static pluginName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
experiment: IExperimentClient;
|
|
7
|
+
config?: ExperimentConfig;
|
|
8
|
+
constructor(config?: ExperimentConfig);
|
|
9
|
+
setup(config: BrowserConfig, _client: BrowserClient): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const experimentPlugin: (config?: ExperimentConfig) => EnrichmentPlugin<BrowserClient, BrowserConfig>;
|
|
12
|
+
//# sourceMappingURL=experiment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiment.d.ts","sourceRoot":"","sources":["../../src/experiment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE3F,OAAO,EACL,gBAAgB,EAChB,MAAM,IAAI,iBAAiB,EAE5B,MAAM,iCAAiC,CAAC;AAEzC,qBAAa,gBAAiB,YAAW,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC;IACrF,MAAM,CAAC,UAAU,SAA4C;IAC7D,IAAI,SAA+B;IAGnC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,MAAM,CAAC,EAAE,gBAAgB,CAAC;gBAEd,MAAM,CAAC,EAAE,gBAAgB;IAI/B,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa;CAG1D;AAED,eAAO,MAAM,gBAAgB,EAAE,CAAC,MAAM,CAAC,EAAE,gBAAgB,KAAK,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAI1G,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.experimentPlugin = exports.ExperimentPlugin = void 0;
|
|
4
|
+
var tslib_1 = require("tslib");
|
|
5
|
+
var experiment_js_client_1 = require("@amplitude/experiment-js-client");
|
|
6
|
+
var ExperimentPlugin = /** @class */ (function () {
|
|
7
|
+
function ExperimentPlugin(config) {
|
|
8
|
+
this.name = ExperimentPlugin.pluginName;
|
|
9
|
+
this.config = config;
|
|
10
|
+
}
|
|
11
|
+
ExperimentPlugin.prototype.setup = function (config, _client) {
|
|
12
|
+
return tslib_1.__awaiter(this, void 0, void 0, function () {
|
|
13
|
+
return tslib_1.__generator(this, function (_a) {
|
|
14
|
+
this.experiment = (0, experiment_js_client_1.initializeWithAmplitudeAnalytics)(config.apiKey, this.config);
|
|
15
|
+
return [2 /*return*/];
|
|
16
|
+
});
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
ExperimentPlugin.pluginName = '@amplitude/experiment-analytics-plugin';
|
|
20
|
+
return ExperimentPlugin;
|
|
21
|
+
}());
|
|
22
|
+
exports.ExperimentPlugin = ExperimentPlugin;
|
|
23
|
+
var experimentPlugin = function (config) {
|
|
24
|
+
return new ExperimentPlugin(config);
|
|
25
|
+
};
|
|
26
|
+
exports.experimentPlugin = experimentPlugin;
|
|
27
|
+
//# sourceMappingURL=experiment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiment.js","sourceRoot":"","sources":["../../src/experiment.ts"],"names":[],"mappings":";;;;AAEA,wEAIyC;AAEzC;IAQE,0BAAY,MAAyB;QANrC,SAAI,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAOjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEK,gCAAK,GAAX,UAAY,MAAqB,EAAE,OAAsB;;;gBACvD,IAAI,CAAC,UAAU,GAAG,IAAA,uDAAgC,EAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;;;;KAChF;IAbM,2BAAU,GAAG,wCAAwC,CAAC;IAc/D,uBAAC;CAAA,AAfD,IAeC;AAfY,4CAAgB;AAiBtB,IAAM,gBAAgB,GAAkF,UAC7G,MAAyB;IAEzB,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC,CAAC;AAJW,QAAA,gBAAgB,oBAI3B","sourcesContent":["import { EnrichmentPlugin, BrowserClient, BrowserConfig } from '@amplitude/analytics-core';\n\nimport {\n ExperimentConfig,\n Client as IExperimentClient,\n initializeWithAmplitudeAnalytics,\n} from '@amplitude/experiment-js-client';\n\nexport class ExperimentPlugin implements EnrichmentPlugin<BrowserClient, BrowserConfig> {\n static pluginName = '@amplitude/experiment-analytics-plugin';\n name = ExperimentPlugin.pluginName;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n experiment: IExperimentClient;\n config?: ExperimentConfig;\n\n constructor(config?: ExperimentConfig) {\n this.config = config;\n }\n\n async setup(config: BrowserConfig, _client: BrowserClient) {\n this.experiment = initializeWithAmplitudeAnalytics(config.apiKey, this.config);\n }\n}\n\nexport const experimentPlugin: (config?: ExperimentConfig) => EnrichmentPlugin<BrowserClient, BrowserConfig> = (\n config?: ExperimentConfig,\n) => {\n return new ExperimentPlugin(config);\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,iCAAiC,CAAC"}
|
package/lib/cjs/index.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.experimentPlugin = exports.ExperimentPlugin = void 0;
|
|
4
|
+
var experiment_1 = require("./experiment");
|
|
5
|
+
Object.defineProperty(exports, "ExperimentPlugin", { enumerable: true, get: function () { return experiment_1.ExperimentPlugin; } });
|
|
6
|
+
Object.defineProperty(exports, "experimentPlugin", { enumerable: true, get: function () { return experiment_1.experimentPlugin; } });
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";;;AAAA,2CAAkE;AAAzD,8GAAA,gBAAgB,OAAA;AAAE,8GAAA,gBAAgB,OAAA","sourcesContent":["export { ExperimentPlugin, experimentPlugin } from './experiment';\nexport { ExperimentConfig, Client as IExperimentClient } from '@amplitude/experiment-js-client';\n"]}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EnrichmentPlugin, BrowserClient, BrowserConfig } from '@amplitude/analytics-core';
|
|
2
|
+
import { ExperimentConfig, Client as IExperimentClient } from '@amplitude/experiment-js-client';
|
|
3
|
+
export declare class ExperimentPlugin implements EnrichmentPlugin<BrowserClient, BrowserConfig> {
|
|
4
|
+
static pluginName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
experiment: IExperimentClient;
|
|
7
|
+
config?: ExperimentConfig;
|
|
8
|
+
constructor(config?: ExperimentConfig);
|
|
9
|
+
setup(config: BrowserConfig, _client: BrowserClient): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const experimentPlugin: (config?: ExperimentConfig) => EnrichmentPlugin<BrowserClient, BrowserConfig>;
|
|
12
|
+
//# sourceMappingURL=experiment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiment.d.ts","sourceRoot":"","sources":["../../src/experiment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE3F,OAAO,EACL,gBAAgB,EAChB,MAAM,IAAI,iBAAiB,EAE5B,MAAM,iCAAiC,CAAC;AAEzC,qBAAa,gBAAiB,YAAW,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC;IACrF,MAAM,CAAC,UAAU,SAA4C;IAC7D,IAAI,SAA+B;IAGnC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,MAAM,CAAC,EAAE,gBAAgB,CAAC;gBAEd,MAAM,CAAC,EAAE,gBAAgB;IAI/B,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa;CAG1D;AAED,eAAO,MAAM,gBAAgB,EAAE,CAAC,MAAM,CAAC,EAAE,gBAAgB,KAAK,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAI1G,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { __awaiter, __generator } from "tslib";
|
|
2
|
+
import { initializeWithAmplitudeAnalytics, } from '@amplitude/experiment-js-client';
|
|
3
|
+
var ExperimentPlugin = /** @class */ (function () {
|
|
4
|
+
function ExperimentPlugin(config) {
|
|
5
|
+
this.name = ExperimentPlugin.pluginName;
|
|
6
|
+
this.config = config;
|
|
7
|
+
}
|
|
8
|
+
ExperimentPlugin.prototype.setup = function (config, _client) {
|
|
9
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
10
|
+
return __generator(this, function (_a) {
|
|
11
|
+
this.experiment = initializeWithAmplitudeAnalytics(config.apiKey, this.config);
|
|
12
|
+
return [2 /*return*/];
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
};
|
|
16
|
+
ExperimentPlugin.pluginName = '@amplitude/experiment-analytics-plugin';
|
|
17
|
+
return ExperimentPlugin;
|
|
18
|
+
}());
|
|
19
|
+
export { ExperimentPlugin };
|
|
20
|
+
export var experimentPlugin = function (config) {
|
|
21
|
+
return new ExperimentPlugin(config);
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=experiment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiment.js","sourceRoot":"","sources":["../../src/experiment.ts"],"names":[],"mappings":";AAEA,OAAO,EAGL,gCAAgC,GACjC,MAAM,iCAAiC,CAAC;AAEzC;IAQE,0BAAY,MAAyB;QANrC,SAAI,GAAG,gBAAgB,CAAC,UAAU,CAAC;QAOjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAEK,gCAAK,GAAX,UAAY,MAAqB,EAAE,OAAsB;;;gBACvD,IAAI,CAAC,UAAU,GAAG,gCAAgC,CAAC,MAAM,CAAC,MAAM,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;;;;KAChF;IAbM,2BAAU,GAAG,wCAAwC,CAAC;IAc/D,uBAAC;CAAA,AAfD,IAeC;SAfY,gBAAgB;AAiB7B,MAAM,CAAC,IAAM,gBAAgB,GAAkF,UAC7G,MAAyB;IAEzB,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;AACtC,CAAC,CAAC","sourcesContent":["import { EnrichmentPlugin, BrowserClient, BrowserConfig } from '@amplitude/analytics-core';\n\nimport {\n ExperimentConfig,\n Client as IExperimentClient,\n initializeWithAmplitudeAnalytics,\n} from '@amplitude/experiment-js-client';\n\nexport class ExperimentPlugin implements EnrichmentPlugin<BrowserClient, BrowserConfig> {\n static pluginName = '@amplitude/experiment-analytics-plugin';\n name = ExperimentPlugin.pluginName;\n // eslint-disable-next-line @typescript-eslint/ban-ts-comment\n // @ts-ignore\n experiment: IExperimentClient;\n config?: ExperimentConfig;\n\n constructor(config?: ExperimentConfig) {\n this.config = config;\n }\n\n async setup(config: BrowserConfig, _client: BrowserClient) {\n this.experiment = initializeWithAmplitudeAnalytics(config.apiKey, this.config);\n }\n}\n\nexport const experimentPlugin: (config?: ExperimentConfig) => EnrichmentPlugin<BrowserClient, BrowserConfig> = (\n config?: ExperimentConfig,\n) => {\n return new ExperimentPlugin(config);\n};\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,iCAAiC,CAAC"}
|
package/lib/esm/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC","sourcesContent":["export { ExperimentPlugin, experimentPlugin } from './experiment';\nexport { ExperimentConfig, Client as IExperimentClient } from '@amplitude/experiment-js-client';\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).amplitude={})}(this,(function(e){"use strict";function t(e,t,r,i){return new(r||(r=Promise))((function(n,o){function a(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((i=i.apply(e,t||[])).next())}))}function r(e,t){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}var i=function(e,t){return i=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])},i(e,t)};function n(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");function r(){this.constructor=e}i(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var o=function(){return o=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},o.apply(this,arguments)};function a(e,t,r,i){return new(r||(r=Promise))((function(n,o){function a(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((i=i.apply(e,t||[])).next())}))}function s(e,t){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function u(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function l(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}function c(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var f="is",h="is not",d="contains",p="does not contain",v="less",y="less or equal",g="greater",b="greater or equal",m="version less",w="version less or equal",x="version greater",S="version greater or equal",k="set is",P="set is not",C="set contains",I="set does not contain",A="set contains any",_="set does not contain any",O="regex match",E="regex does not match",T=-862048943,M=461845907,V=function(e,t){void 0===t&&(t=0);for(var r=function(e){for(var t=[],r=0,i=0;i<e.length;i++){var n=e.charCodeAt(i);n<128?t[r++]=n:n<2048?(t[r++]=n>>6|192,t[r++]=63&n|128):55296==(64512&n)&&i+1<e.length&&56320==(64512&e.charCodeAt(i+1))?(n=65536+((1023&n)<<10)+(1023&e.charCodeAt(++i)),t[r++]=n>>18|240,t[r++]=n>>12&63|128,t[r++]=n>>6&63|128,t[r++]=63&n|128):(t[r++]=n>>12|224,t[r++]=n>>6&63|128,t[r++]=63&n|128)}return Uint8Array.from(t)}(e),i=r.length,n=i>>2,o=t,a=0;a<n;a++){var s=F(r,a<<2);o=U(s,o)}var u=n<<2,l=0;switch(i-u){case 3:l^=r[u+2]<<16,l^=r[u+1]<<8,l^=r[u],l=Math.imul(l,T),l=j(l,15),o^=l=Math.imul(l,M);break;case 2:l^=r[u+1]<<8,l^=r[u],l=Math.imul(l,T),l=j(l,15),o^=l=Math.imul(l,M);break;case 1:l^=r[u],l=Math.imul(l,T),l=j(l,15),o^=l=Math.imul(l,M)}return N(o^=i)>>>0},U=function(e,t){var r=e,i=t;return r=Math.imul(r,T),r=j(r,15),r=Math.imul(r,M),i=j(i^=r,13),(i=Math.imul(i,5))+-430675100|0},N=function(e){var t=e;return t^=t>>>16,t=Math.imul(t,-2048144789),t^=t>>>13,t=Math.imul(t,-1028477387),t^=t>>>16},j=function(e,t,r){return void 0===r&&(r=32),t>r&&(t%=r),(e<<t|(e&4294967295<<r-t>>>0)>>>0>>>r-t>>>0)>>>0},F=function(e,t){void 0===t&&(t=0);var r=e[t]<<24|e[t+1]<<16|e[t+2]<<8|e[t+3];return R(r)},R=function(e){return(-16777216&e)>>>24|(16711680&e)>>>8|(65280&e)<<8|(255&e)<<24},q=function(e,t){var r,i;if(t&&0!==t.length){try{for(var n=u(t),o=n.next();!o.done;o=n.next()){var a=o.value;if(!a||!e||"object"!=typeof e)return;e=e[a]}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return e||void 0}},K="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),D=function(){function e(e,t,r,i){void 0===i&&(i=void 0),this.major=e,this.minor=t,this.patch=r,this.preRelease=i}return e.parse=function(t){if(t){var r=new RegExp(K).exec(t);if(r){var i=Number(r[1]),n=Number(r[2]);if(!isNaN(i)&&!isNaN(n))return new e(i,n,Number(r[4])||0,r[5]||void 0)}}},e.prototype.compareTo=function(e){return this.major>e.major?1:this.major<e.major?-1:this.minor>e.minor?1:this.minor<e.minor?-1:this.patch>e.patch?1:this.patch<e.patch||this.preRelease&&!e.preRelease?-1:!this.preRelease&&e.preRelease?1:this.preRelease&&e.preRelease?this.preRelease>e.preRelease?1:this.preRelease<e.preRelease?-1:0:0},e}(),L=function(){function e(){}return e.prototype.evaluate=function(e,t){var r,i,n={},o={context:e,result:n};try{for(var a=u(t),s=a.next();!s.done;s=a.next()){var l=s.value,c=this.evaluateFlag(o,l);c&&(n[l.key]=c)}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n},e.prototype.evaluateFlag=function(e,t){var r,i,n;try{for(var a=u(t.segments),s=a.next();!s.done;s=a.next()){var l=s.value;if(n=this.evaluateSegment(e,t,l)){var c=o(o(o({},t.metadata),l.metadata),n.metadata);n=o(o({},n),{metadata:c});break}}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n},e.prototype.evaluateSegment=function(e,t,r){var i;return r.conditions?this.evaluateConditions(e,r.conditions)&&void 0!==(i=this.bucket(e,r))?t.variants[i]:void 0:void 0!==(i=this.bucket(e,r))?t.variants[i]:void 0},e.prototype.evaluateConditions=function(e,t){var r,i,n,o;try{for(var a=u(t),s=a.next();!s.done;s=a.next()){var l=s.value,c=!0;try{for(var f=(n=void 0,u(l)),h=f.next();!h.done;h=f.next()){var d=h.value;if(!(c=this.matchCondition(e,d)))break}}catch(e){n={error:e}}finally{try{h&&!h.done&&(o=f.return)&&o.call(f)}finally{if(n)throw n.error}}if(c)return!0}}catch(e){r={error:e}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return!1},e.prototype.matchCondition=function(e,t){var r=q(e,t.selector);if(r){if(this.isSetOperator(t.op)){var i=this.coerceStringArray(r);return!!i&&this.matchSet(i,t.op,t.values)}var n=this.coerceString(r);return void 0!==n&&this.matchString(n,t.op,t.values)}return this.matchNull(t.op,t.values)},e.prototype.getHash=function(e){return V(e)},e.prototype.bucket=function(e,t){var r,i,n,o;if(!t.bucket)return t.variant;var a=this.coerceString(q(e,t.bucket.selector));if(!a||0===a.length)return t.variant;var s="".concat(t.bucket.salt,"/").concat(a),l=this.getHash(s),c=l%100,f=Math.floor(l/100);try{for(var h=u(t.bucket.allocations),d=h.next();!d.done;d=h.next()){var p=d.value,v=p.range[0],y=p.range[1];if(c>=v&&c<y)try{for(var g=(n=void 0,u(p.distributions)),b=g.next();!b.done;b=g.next()){var m=b.value,w=m.range[0],x=m.range[1];if(f>=w&&f<x)return m.variant}}catch(e){n={error:e}}finally{try{b&&!b.done&&(o=g.return)&&o.call(g)}finally{if(n)throw n.error}}}}catch(e){r={error:e}}finally{try{d&&!d.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return t.variant},e.prototype.matchNull=function(e,t){var r=this.containsNone(t);switch(e){case f:case d:case v:case y:case g:case b:case m:case w:case x:case S:case k:case C:case A:return r;case h:case p:case I:case _:return!r;default:return!1}},e.prototype.matchSet=function(e,t,r){switch(t){case k:return this.setEquals(e,r);case P:return!this.setEquals(e,r);case C:return this.matchesSetContainsAll(e,r);case I:return!this.matchesSetContainsAll(e,r);case A:return this.matchesSetContainsAny(e,r);case _:return!this.matchesSetContainsAny(e,r);default:return!1}},e.prototype.matchString=function(e,t,r){var i=this;switch(t){case f:return this.matchesIs(e,r);case h:return!this.matchesIs(e,r);case d:return this.matchesContains(e,r);case p:return!this.matchesContains(e,r);case v:case y:case g:case b:return this.matchesComparable(e,t,r,(function(e){return i.parseNumber(e)}),this.comparator);case m:case w:case x:case S:return this.matchesComparable(e,t,r,(function(e){return D.parse(e)}),this.versionComparator);case O:return this.matchesRegex(e,r);case E:return!this.matchesRegex(e,r);default:return!1}},e.prototype.matchesIs=function(e,t){if(this.containsBooleans(t)){var r=e.toLowerCase();if("true"===r||"false"===r)return t.some((function(e){return e.toLowerCase()===r}))}return t.some((function(t){return e===t}))},e.prototype.matchesContains=function(e,t){var r,i;try{for(var n=u(t),o=n.next();!o.done;o=n.next()){var a=o.value;if(e.toLowerCase().includes(a.toLowerCase()))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return!1},e.prototype.matchesComparable=function(e,t,r,i,n){var o=this,a=i(e),s=r.map((function(e){return i(e)})).filter((function(e){return void 0!==e}));return void 0===a||0===s.length?r.some((function(r){return o.comparator(e,t,r)})):s.some((function(e){return n(a,t,e)}))},e.prototype.comparator=function(e,t,r){switch(t){case v:case m:return e<r;case y:case w:return e<=r;case g:case x:return e>r;case b:case S:return e>=r;default:return!1}},e.prototype.versionComparator=function(e,t,r){var i=e.compareTo(r);switch(t){case v:case m:return i<0;case y:case w:return i<=0;case g:case x:return i>0;case b:case S:return i>=0;default:return!1}},e.prototype.matchesRegex=function(e,t){return t.some((function(t){return Boolean(new RegExp(t).exec(e))}))},e.prototype.containsNone=function(e){return e.some((function(e){return"(none)"===e}))},e.prototype.containsBooleans=function(e){return e.some((function(e){switch(e.toLowerCase()){case"true":case"false":return!0;default:return!1}}))},e.prototype.parseNumber=function(e){var t;return null!==(t=Number(e))&&void 0!==t?t:void 0},e.prototype.coerceString=function(e){if(null!=e)return"object"==typeof e?JSON.stringify(e):String(e)},e.prototype.coerceStringArray=function(e){var t=this;if(Array.isArray(e))return e.map((function(e){return t.coerceString(e)})).filter(Boolean);var r=String(e);try{var i=JSON.parse(r);return Array.isArray(i)?e.map((function(e){return t.coerceString(e)})).filter(Boolean):(n=this.coerceString(r))?[n]:void 0}catch(e){var n;return(n=this.coerceString(r))?[n]:void 0}},e.prototype.isSetOperator=function(e){switch(e){case k:case P:case C:case I:case A:case _:return!0;default:return!1}},e.prototype.setEquals=function(e,t){var r=new Set(e),i=new Set(t);return r.size===i.size&&c([],l(i),!1).every((function(e){return r.has(e)}))},e.prototype.matchesSetContainsAll=function(e,t){var r,i;if(e.length<t.length)return!1;try{for(var n=u(t),o=n.next();!o.done;o=n.next()){var a=o.value;if(!this.matchesIs(a,e))return!1}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return!0},e.prototype.matchesSetContainsAny=function(e,t){var r,i;try{for(var n=u(t),o=n.next();!o.done;o=n.next()){var a=o.value;if(this.matchesIs(a,e))return!0}}catch(e){r={error:e}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return!1},e}(),B=function(e,t,r){var i,n;void 0===r&&(r=[]);var o=t[e];if(o){if(!o.dependencies||0===o.dependencies.length)return delete t[o.key],[o];r.push(o.key);var a=[],s=function(e){if(r.some((function(t){return t===e})))throw Error("Detected a cycle between flags ".concat(r));var i=B(e,t,r);i&&a.push.apply(a,c([],l(i),!1))};try{for(var f=u(o.dependencies),h=f.next();!h.done;h=f.next()){s(h.value)}}catch(e){i={error:e}}finally{try{h&&!h.done&&(n=f.return)&&n.call(f)}finally{if(i)throw i.error}}return a.push(o),r.pop(),delete t[o.key],a}};const z="function"==typeof btoa,J="function"==typeof Buffer,Q=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),W=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),X=((e=>{let t={};e.forEach(((e,r)=>t[e]=r))})(W),String.fromCharCode.bind(String)),$=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),e=>e.replace(/=/g,"").replace(/[+\/]/g,(e=>"+"==e?"-":"_"))),H=e=>{let t,r,i,n,o="";const a=e.length%3;for(let a=0;a<e.length;){if((r=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255||(n=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=r<<16|i<<8|n,o+=W[t>>18&63]+W[t>>12&63]+W[t>>6&63]+W[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},G=z?e=>btoa(e):J?e=>Buffer.from(e,"binary").toString("base64"):H,Z=J?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let r=0,i=e.length;r<i;r+=4096)t.push(X.apply(null,e.subarray(r,r+4096)));return G(t.join(""))},Y=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?X(192|t>>>6)+X(128|63&t):X(224|t>>>12&15)+X(128|t>>>6&63)+X(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return X(240|t>>>18&7)+X(128|t>>>12&63)+X(128|t>>>6&63)+X(128|63&t)},ee=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,te=e=>e.replace(ee,Y),re=J?e=>Buffer.from(e,"utf8").toString("base64"):Q?e=>Z(Q.encode(e)):e=>G(te(e)),ie=(e,t=!1)=>t?$(re(e)):re(e),ne=e=>ie(e,!0),oe=ne;var ae=function(e){function t(r,i){var n=e.call(this,i)||this;return n.statusCode=r,Object.setPrototypeOf(n,t.prototype),n}return n(t,e),t}(Error),se=function(e){function t(r){var i=e.call(this,r)||this;return Object.setPrototypeOf(i,t.prototype),i}return n(t,e),t}(Error),ue=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getVariants=function(e,t){return a(this,void 0,void 0,(function(){var r,i,n,o;return s(this,(function(a){switch(a.label){case 0:return r=oe(JSON.stringify(e)),i={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==t?void 0:t.flagKeys)&&(i["X-Amp-Exp-Flag-Keys"]=oe(JSON.stringify(t.flagKeys))),(null==t?void 0:t.trackingOption)&&(i["X-Amp-Exp-Track"]=t.trackingOption),n=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==t?void 0:t.evaluationMode)&&n.searchParams.append("eval_mode",null==t?void 0:t.evaluationMode),(null==t?void 0:t.deliveryMethod)&&n.searchParams.append("delivery_method",null==t?void 0:t.deliveryMethod),[4,this.httpClient.request({requestUrl:n.toString(),method:"GET",headers:i,timeoutMillis:null==t?void 0:t.timeoutMillis})];case 1:if(200!=(o=a.sent()).status)throw new ae(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}}))}))},e}(),le=function(){function e(e,t,r){this.deploymentKey=e,this.serverUrl=t,this.httpClient=r}return e.prototype.getFlags=function(e){return a(this,void 0,void 0,(function(){var t,r;return s(this,(function(i){switch(i.label){case 0:return t={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==e?void 0:e.libraryName)&&(null==e?void 0:e.libraryVersion)&&(t["X-Amp-Exp-Library"]="".concat(e.libraryName,"/").concat(e.libraryVersion)),(null==e?void 0:e.user)&&(t["X-Amp-Exp-User"]=oe(JSON.stringify(e.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==e?void 0:e.deliveryMethod)?"?delivery_method=".concat(e.deliveryMethod):""),method:"GET",headers:t,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(r=i.sent()).status)throw Error("Flags error response: status=".concat(r.status));return[2,JSON.parse(r.body).reduce((function(e,t){return e[t.key]=t,e}),{})]}}))}))},e}(),ce="undefined"!=typeof globalThis?globalThis:global||self,fe=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},he=function(){function e(e,t){this.poller=void 0,this.action=e,this.ms=t}return e.prototype.start=function(){this.poller||(this.poller=ce.setInterval(this.action,this.ms),this.action())},e.prototype.stop=function(){this.poller&&(ce.clearInterval(this.poller),this.poller=void 0)},e}(),de=function(){function e(){}return e.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:pe(),platform:"Web",os:void 0,deviceModel:void 0}},e}(),pe=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},ve=function(){function e(){this.queue=[]}return e.prototype.logEvent=function(e){this.receiver?this.receiver(e):this.queue.length<512&&this.queue.push(e)},e.prototype.setEventReceiver=function(e){this.receiver=e,this.queue.length>0&&(this.queue.forEach((function(t){e(t)})),this.queue=[])},e}(),ye=function(){return ye=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},ye.apply(this,arguments)};function ge(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function be(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}"function"==typeof SuppressedError&&SuppressedError;var me=function(e,t){var r,i,n=typeof e;if(n!==typeof t)return!1;try{for(var o=ge(["string","number","boolean","undefined"]),a=o.next();!a.done;a=o.next()){if(a.value===n)return e===t}}catch(e){r={error:e}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}if(null==e&&null==t)return!0;if(null==e||null==t)return!1;if(e.length!==t.length)return!1;var s=Array.isArray(e),u=Array.isArray(t);if(s!==u)return!1;if(!s||!u){var l=Object.keys(e).sort(),c=Object.keys(t).sort();if(!me(l,c))return!1;var f=!0;return Object.keys(e).forEach((function(r){me(e[r],t[r])||(f=!1)})),f}for(var h=0;h<e.length;h++)if(!me(e[h],t[h]))return!1;return!0};Object.entries||(Object.entries=function(e){for(var t=Object.keys(e),r=t.length,i=new Array(r);r--;)i[r]=[t[r],e[t[r]]];return i});var we=function(){function e(){this.identity={userProperties:{}},this.listeners=new Set}return e.prototype.editIdentity=function(){var e=this,t=ye({},this.identity.userProperties),r=ye(ye({},this.identity),{userProperties:t});return{setUserId:function(e){return r.userId=e,this},setDeviceId:function(e){return r.deviceId=e,this},setUserProperties:function(e){return r.userProperties=e,this},setOptOut:function(e){return r.optOut=e,this},updateUserProperties:function(e){var t,i,n,o,a,s,u=r.userProperties||{};try{for(var l=ge(Object.entries(e)),c=l.next();!c.done;c=l.next()){var f=be(c.value,2),h=f[0],d=f[1];switch(h){case"$set":try{for(var p=(n=void 0,ge(Object.entries(d))),v=p.next();!v.done;v=p.next()){var y=be(v.value,2),g=y[0],b=y[1];u[g]=b}}catch(e){n={error:e}}finally{try{v&&!v.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}break;case"$unset":try{for(var m=(a=void 0,ge(Object.keys(d))),w=m.next();!w.done;w=m.next()){delete u[g=w.value]}}catch(e){a={error:e}}finally{try{w&&!w.done&&(s=m.return)&&s.call(m)}finally{if(a)throw a.error}}break;case"$clearAll":u={}}}}catch(e){t={error:e}}finally{try{c&&!c.done&&(i=l.return)&&i.call(l)}finally{if(t)throw t.error}}return r.userProperties=u,this},commit:function(){return e.setIdentity(r),this}}},e.prototype.getIdentity=function(){return ye({},this.identity)},e.prototype.setIdentity=function(e){var t=ye({},this.identity);this.identity=ye({},e),me(t,this.identity)||this.listeners.forEach((function(t){t(e)}))},e.prototype.addIdentityListener=function(e){this.listeners.add(e)},e.prototype.removeIdentityListener=function(e){this.listeners.delete(e)},e}(),xe="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,Se=function(){function e(){this.identityStore=new we,this.eventBridge=new ve,this.applicationContextProvider=new de}return e.getInstance=function(t){return xe.analyticsConnectorInstances||(xe.analyticsConnectorInstances={}),xe.analyticsConnectorInstances[t]||(xe.analyticsConnectorInstances[t]=new e),xe.analyticsConnectorInstances[t]},e}(),ke="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},Pe={exports:{}};!function(e,t){!function(r,i){var n="function",o="undefined",a="object",s="string",u="model",l="name",c="type",f="vendor",h="version",d="architecture",p="console",v="mobile",y="tablet",g="smarttv",b="wearable",m="embedded",w="Amazon",x="Apple",S="ASUS",k="BlackBerry",P="Browser",C="Chrome",I="Firefox",A="Google",_="Huawei",O="LG",E="Microsoft",T="Motorola",M="Opera",V="Samsung",U="Sony",N="Xiaomi",j="Zebra",F="Facebook",R=function(e){for(var t={},r=0;r<e.length;r++)t[e[r].toUpperCase()]=e[r];return t},q=function(e,t){return typeof e===s&&-1!==K(t).indexOf(K(e))},K=function(e){return e.toLowerCase()},D=function(e,t){if(typeof e===s)return e=e.replace(/^\s\s*/,"").replace(/\s\s*$/,""),typeof t===o?e:e.substring(0,275)},L=function(e,t){for(var r,o,s,u,l,c,f=0;f<t.length&&!l;){var h=t[f],d=t[f+1];for(r=o=0;r<h.length&&!l;)if(l=h[r++].exec(e))for(s=0;s<d.length;s++)c=l[++o],typeof(u=d[s])===a&&u.length>0?2===u.length?typeof u[1]==n?this[u[0]]=u[1].call(this,c):this[u[0]]=u[1]:3===u.length?typeof u[1]!==n||u[1].exec&&u[1].test?this[u[0]]=c?c.replace(u[1],u[2]):i:this[u[0]]=c?u[1].call(this,c,u[2]):i:4===u.length&&(this[u[0]]=c?u[3].call(this,c.replace(u[1],u[2])):i):this[u]=c||i;f+=2}},B=function(e,t){for(var r in t)if(typeof t[r]===a&&t[r].length>0){for(var n=0;n<t[r].length;n++)if(q(t[r][n],e))return"?"===r?i:r}else if(q(t[r],e))return"?"===r?i:r;return e},z={ME:"4.90","NT 3.11":"NT3.51","NT 4.0":"NT4.0",2e3:"NT 5.0",XP:["NT 5.1","NT 5.2"],Vista:"NT 6.0",7:"NT 6.1",8:"NT 6.2",8.1:"NT 6.3",10:["NT 6.4","NT 10.0"],RT:"ARM"},J={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[h,[l,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[h,[l,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[l,h],[/opios[\/ ]+([\w\.]+)/i],[h,[l,M+" Mini"]],[/\bopr\/([\w\.]+)/i],[h,[l,M]],[/(kindle)\/([\w\.]+)/i,/(lunascape|maxthon|netfront|jasmine|blazer)[\/ ]?([\w\.]*)/i,/(avant |iemobile|slim)(?:browser)?[\/ ]?([\w\.]*)/i,/(ba?idubrowser)[\/ ]?([\w\.]+)/i,/(?:ms|\()(ie) ([\w\.]+)/i,/(flock|rockmelt|midori|epiphany|silk|skyfire|ovibrowser|bolt|iron|vivaldi|iridium|phantomjs|bowser|quark|qupzilla|falkon|rekonq|puffin|brave|whale|qqbrowserlite|qq)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[l,h],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[h,[l,"UC"+P]],[/\bqbcore\/([\w\.]+)/i],[h,[l,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[h,[l,"WeChat"]],[/konqueror\/([\w\.]+)/i],[h,[l,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[h,[l,"IE"]],[/yabrowser\/([\w\.]+)/i],[h,[l,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[l,/(.+)/,"$1 Secure "+P],h],[/\bfocus\/([\w\.]+)/i],[h,[l,I+" Focus"]],[/\bopt\/([\w\.]+)/i],[h,[l,M+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[h,[l,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[h,[l,"Dolphin"]],[/coast\/([\w\.]+)/i],[h,[l,M+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[h,[l,"MIUI "+P]],[/fxios\/([-\w\.]+)/i],[h,[l,I]],[/\bqihu|(qi?ho?o?|360)browser/i],[[l,"360 "+P]],[/(oculus|samsung|sailfish)browser\/([\w\.]+)/i],[[l,/(.+)/,"$1 "+P],h],[/(comodo_dragon)\/([\w\.]+)/i],[[l,/_/g," "],h],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[l,h],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i],[l],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[l,F],h],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[l,h],[/\bgsa\/([\w\.]+) .*safari\//i],[h,[l,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[h,[l,C+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[l,C+" WebView"],h],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[h,[l,"Android "+P]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[l,h],[/version\/([\w\.]+) .*mobile\/\w+ (safari)/i],[h,[l,"Mobile Safari"]],[/version\/([\w\.]+) .*(mobile ?safari|safari)/i],[h,l],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[l,[h,B,{"1.0":"/8",1.2:"/1",1.3:"/3","2.0":"/412","2.0.2":"/416","2.0.3":"/417","2.0.4":"/419","?":"/"}]],[/(webkit|khtml)\/([\w\.]+)/i],[l,h],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[l,"Netscape"],h],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[h,[l,I+" Reality"]],[/ekiohf.+(flow)\/([\w\.]+)/i,/(swiftfox)/i,/(icedragon|iceweasel|camino|chimera|fennec|maemo browser|minimo|conkeror|klar)[\/ ]?([\w\.\+]+)/i,/(seamonkey|k-meleon|icecat|iceape|firebird|phoenix|palemoon|basilisk|waterfox)\/([-\w\.]+)$/i,/(firefox)\/([\w\.]+)/i,/(mozilla)\/([\w\.]+) .+rv\:.+gecko\/\d+/i,/(polaris|lynx|dillo|icab|doris|amaya|w3m|netsurf|sleipnir|obigo|mosaic|(?:go|ice|up)[\. ]?browser)[-\/ ]?v?([\w\.]+)/i,/(links) \(([\w\.]+)/i],[l,h]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[d,"amd64"]],[/(ia32(?=;))/i],[[d,K]],[/((?:i[346]|x)86)[;\)]/i],[[d,"ia32"]],[/\b(aarch64|arm(v?8e?l?|_?64))\b/i],[[d,"arm64"]],[/\b(arm(?:v[67])?ht?n?[fl]p?)\b/i],[[d,"armhf"]],[/windows (ce|mobile); ppc;/i],[[d,"arm"]],[/((?:ppc|powerpc)(?:64)?)(?: mac|;|\))/i],[[d,/ower/,"",K]],[/(sun4\w)[;\)]/i],[[d,"sparc"]],[/((?:avr32|ia64(?=;))|68k(?=\))|\barm(?=v(?:[1-7]|[5-7]1)l?|;|eabi)|(?=atmel )avr|(?:irix|mips|sparc)(?:64)?\b|pa-risc)/i],[[d,K]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[pt]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[u,[f,V],[c,y]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[u,[f,V],[c,v]],[/((ipod|iphone)\d+,\d+)/i],[u,[f,x],[c,v]],[/(ipad\d+,\d+)/i],[u,[f,x],[c,y]],[/\((ip(?:hone|od)[\w ]*);/i],[u,[f,x],[c,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[u,[f,x],[c,y]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[u,[f,_],[c,y]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[u,[f,_],[c,v]],[/\b(poco[\w ]+)(?: bui|\))/i,/\b; (\w+) build\/hm\1/i,/\b(hm[-_ ]?note?[_ ]?(?:\d\w)?) bui/i,/\b(redmi[\-_ ]?(?:note|k)?[\w_ ]+)(?: bui|\))/i,/\b(mi[-_ ]?(?:a\d|one|one[_ ]plus|note lte|max|cc)?[_ ]?(?:\d?\w?)[_ ]?(?:plus|se|lite)?)(?: bui|\))/i],[[u,/_/g," "],[f,N],[c,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[u,/_/g," "],[f,N],[c,y]],[/; (\w+) bui.+ oppo/i,/\b(cph[12]\d{3}|p(?:af|c[al]|d\w|e[ar])[mt]\d0|x9007|a101op)\b/i],[u,[f,"OPPO"],[c,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[u,[f,"Vivo"],[c,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[u,[f,"Realme"],[c,v]],[/\b(milestone|droid(?:[2-4x]| (?:bionic|x2|pro|razr))?:?( 4g)?)\b[\w ]+build\//i,/\bmot(?:orola)?[- ](\w*)/i,/((?:moto[\w\(\) ]+|xt\d{3,4}|nexus 6)(?= bui|\)))/i],[u,[f,T],[c,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[u,[f,T],[c,y]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[u,[f,O],[c,y]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[u,[f,O],[c,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[u,[f,"Lenovo"],[c,y]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[u,/_/g," "],[f,"Nokia"],[c,v]],[/(pixel c)\b/i],[u,[f,A],[c,y]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[u,[f,A],[c,v]],[/droid.+ (a?\d[0-2]{2}so|[c-g]\d{4}|so[-gl]\w+|xq-a\w[4-7][12])(?= bui|\).+chrome\/(?![1-6]{0,1}\d\.))/i],[u,[f,U],[c,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[u,"Xperia Tablet"],[f,U],[c,y]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[u,[f,"OnePlus"],[c,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[u,[f,w],[c,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[u,/(.+)/g,"Fire Phone $1"],[f,w],[c,v]],[/(playbook);[-\w\),; ]+(rim)/i],[u,f,[c,y]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[u,[f,k],[c,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[u,[f,S],[c,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[u,[f,S],[c,v]],[/(nexus 9)/i],[u,[f,"HTC"],[c,y]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[f,[u,/_/g," "],[c,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[u,[f,"Acer"],[c,y]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[u,[f,"Meizu"],[c,v]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[u,[f,"Sharp"],[c,v]],[/(blackberry|benq|palm(?=\-)|sonyericsson|acer|asus|dell|meizu|motorola|polytron)[-_ ]?([-\w]*)/i,/(hp) ([\w ]+\w)/i,/(asus)-?(\w+)/i,/(microsoft); (lumia[\w ]+)/i,/(lenovo)[-_ ]?([-\w]+)/i,/(jolla)/i,/(oppo) ?([\w ]+) bui/i],[f,u,[c,v]],[/(archos) (gamepad2?)/i,/(hp).+(touchpad(?!.+tablet)|tablet)/i,/(kindle)\/([\w\.]+)/i,/(nook)[\w ]+build\/(\w+)/i,/(dell) (strea[kpr\d ]*[\dko])/i,/(le[- ]+pan)[- ]+(\w{1,9}) bui/i,/(trinity)[- ]*(t\d{3}) bui/i,/(gigaset)[- ]+(q\w{1,9}) bui/i,/(vodafone) ([\w ]+)(?:\)| bui)/i],[f,u,[c,y]],[/(surface duo)/i],[u,[f,E],[c,y]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[u,[f,"Fairphone"],[c,v]],[/(u304aa)/i],[u,[f,"AT&T"],[c,v]],[/\bsie-(\w*)/i],[u,[f,"Siemens"],[c,v]],[/\b(rct\w+) b/i],[u,[f,"RCA"],[c,y]],[/\b(venue[\d ]{2,7}) b/i],[u,[f,"Dell"],[c,y]],[/\b(q(?:mv|ta)\w+) b/i],[u,[f,"Verizon"],[c,y]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[u,[f,"Barnes & Noble"],[c,y]],[/\b(tm\d{3}\w+) b/i],[u,[f,"NuVision"],[c,y]],[/\b(k88) b/i],[u,[f,"ZTE"],[c,y]],[/\b(nx\d{3}j) b/i],[u,[f,"ZTE"],[c,v]],[/\b(gen\d{3}) b.+49h/i],[u,[f,"Swiss"],[c,v]],[/\b(zur\d{3}) b/i],[u,[f,"Swiss"],[c,y]],[/\b((zeki)?tb.*\b) b/i],[u,[f,"Zeki"],[c,y]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[f,"Dragon Touch"],u,[c,y]],[/\b(ns-?\w{0,9}) b/i],[u,[f,"Insignia"],[c,y]],[/\b((nxa|next)-?\w{0,9}) b/i],[u,[f,"NextBook"],[c,y]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[f,"Voice"],u,[c,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[f,"LvTel"],u,[c,v]],[/\b(ph-1) /i],[u,[f,"Essential"],[c,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[u,[f,"Envizen"],[c,y]],[/\b(trio[-\w\. ]+) b/i],[u,[f,"MachSpeed"],[c,y]],[/\btu_(1491) b/i],[u,[f,"Rotor"],[c,y]],[/(shield[\w ]+) b/i],[u,[f,"Nvidia"],[c,y]],[/(sprint) (\w+)/i],[f,u,[c,v]],[/(kin\.[onetw]{3})/i],[[u,/\./g," "],[f,E],[c,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[u,[f,j],[c,y]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[u,[f,j],[c,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[f,u,[c,p]],[/droid.+; (shield) bui/i],[u,[f,"Nvidia"],[c,p]],[/(playstation [345portablevi]+)/i],[u,[f,U],[c,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[u,[f,E],[c,p]],[/smart-tv.+(samsung)/i],[f,[c,g]],[/hbbtv.+maple;(\d+)/i],[[u,/^/,"SmartTV"],[f,V],[c,g]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[f,O],[c,g]],[/(apple) ?tv/i],[f,[u,x+" TV"],[c,g]],[/crkey/i],[[u,C+"cast"],[f,A],[c,g]],[/droid.+aft(\w)( bui|\))/i],[u,[f,w],[c,g]],[/\(dtv[\);].+(aquos)/i],[u,[f,"Sharp"],[c,g]],[/(bravia[\w- ]+) bui/i],[u,[f,U],[c,g]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[f,D],[u,D],[c,g]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,g]],[/((pebble))app/i],[f,u,[c,b]],[/droid.+; (glass) \d/i],[u,[f,A],[c,b]],[/droid.+; (wt63?0{2,3})\)/i],[u,[f,j],[c,b]],[/(quest( 2)?)/i],[u,[f,F],[c,b]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[f,[c,m]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[u,[c,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[u,[c,y]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,y]],[/(phone|mobile(?:[;\/]| safari)|pda(?=.+windows ce))/i],[[c,v]],[/(android[-\w\. ]{0,9});.+buil/i],[u,[f,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[h,[l,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[h,[l,"Blink"]],[/(presto)\/([\w\.]+)/i,/(webkit|trident|netfront|netsurf|amaya|lynx|w3m|goanna)\/([\w\.]+)/i,/ekioh(flow)\/([\w\.]+)/i,/(khtml|tasman|links)[\/ ]\(?([\w\.]+)/i,/(icab)[\/ ]([23]\.[\d\.]+)/i],[l,h],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[h,l]],os:[[/microsoft (windows) (vista|xp)/i],[l,h],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[l,[h,B,z]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[l,"Windows"],[h,B,z]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[h,/_/g,"."],[l,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[l,"Mac OS"],[h,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86)/i],[h,l],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[l,h],[/\(bb(10);/i],[h,[l,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[h,[l,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[h,[l,I+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[h,[l,"webOS"]],[/crkey\/([\d\.]+)/i],[h,[l,C+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[l,"Chromium OS"],h],[/(nintendo|playstation) ([wids345portablevuch]+)/i,/(xbox); +xbox ([^\);]+)/i,/\b(joli|palm)\b ?(?:os)?\/?([\w\.]*)/i,/(mint)[\/\(\) ]?(\w*)/i,/(mageia|vectorlinux)[; ]/i,/([kxln]?ubuntu|debian|suse|opensuse|gentoo|arch(?= linux)|slackware|fedora|mandriva|centos|pclinuxos|red ?hat|zenwalk|linpus|raspbian|plan 9|minix|risc os|contiki|deepin|manjaro|elementary os|sabayon|linspire)(?: gnu\/linux)?(?: enterprise)?(?:[- ]linux)?(?:-gnu)?[-\/ ]?(?!chrom|package)([-\w\.]*)/i,/(hurd|linux) ?([\w\.]*)/i,/(gnu) ?([\w\.]*)/i,/\b([-frentopcghs]{0,5}bsd|dragonfly)[\/ ]?(?!amd|[ix346]{1,2}86)([\w\.]*)/i,/(haiku) (\w+)/i],[l,h],[/(sunos) ?([\w\.\d]*)/i],[[l,"Solaris"],h],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[l,h]]},Q=function(e,t){if(typeof e===a&&(t=e,e=i),!(this instanceof Q))return new Q(e,t).getResult();var n=e||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),p=t?function(e,t){var r={};for(var i in e)t[i]&&t[i].length%2==0?r[i]=t[i].concat(e[i]):r[i]=e[i];return r}(J,t):J;return this.getBrowser=function(){var e={};return e[l]=i,e[h]=i,L.call(e,n,p.browser),e.major=function(e){return typeof e===s?e.replace(/[^\d\.]/g,"").split(".")[0]:i}(e.version),e},this.getCPU=function(){var e={};return e[d]=i,L.call(e,n,p.cpu),e},this.getDevice=function(){var e={};return e[f]=i,e[u]=i,e[c]=i,L.call(e,n,p.device),e},this.getEngine=function(){var e={};return e[l]=i,e[h]=i,L.call(e,n,p.engine),e},this.getOS=function(){var e={};return e[l]=i,e[h]=i,L.call(e,n,p.os),e},this.getResult=function(){return{ua:this.getUA(),browser:this.getBrowser(),engine:this.getEngine(),os:this.getOS(),device:this.getDevice(),cpu:this.getCPU()}},this.getUA=function(){return n},this.setUA=function(e){return n=typeof e===s&&e.length>275?D(e,275):e,this},this.setUA(n),this};Q.VERSION="0.7.31",Q.BROWSER=R([l,h,"major"]),Q.CPU=R([d]),Q.DEVICE=R([u,f,c,p,v,g,y,b,m]),Q.ENGINE=Q.OS=R([l,h]),e.exports&&(t=e.exports=Q),t.UAParser=Q;var W=typeof r!==o&&(r.jQuery||r.Zepto);if(W&&!W.ua){var X=new Q;W.ua=X.getResult(),W.ua.get=function(){return X.getUA()},W.ua.set=function(e){X.setUA(e);var t=X.getResult();for(var r in t)W.ua[r]=t[r]}}}("object"==typeof window?window:ke)}(Pe,Pe.exports);var Ce=function(){return Ce=Object.assign||function(e){for(var t,r=1,i=arguments.length;r<i;r++)for(var n in t=arguments[r])Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e},Ce.apply(this,arguments)};function Ie(e,t,r,i){return new(r||(r=Promise))((function(n,o){function a(e){try{u(i.next(e))}catch(e){o(e)}}function s(e){try{u(i.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?n(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(a,s)}u((i=i.apply(e,t||[])).next())}))}function Ae(e,t){var r,i,n,o,a={label:0,sent:function(){if(1&n[0])throw n[1];return n[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(s){return function(u){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,i&&(n=2&s[0]?i.return:s[0]?i.throw||((n=i.return)&&n.call(i),0):i.next)&&!(n=n.call(i,s[1])).done)return n;switch(i=0,n&&(s=[2&s[0],n.value]),s[0]){case 0:case 1:n=s;break;case 4:return a.label++,{value:s[1],done:!1};case 5:a.label++,i=s[1],s=[0];continue;case 7:s=a.ops.pop(),a.trys.pop();continue;default:if(!(n=a.trys,(n=n.length>0&&n[n.length-1])||6!==s[0]&&2!==s[0])){a=0;continue}if(3===s[0]&&(!n||s[1]>n[0]&&s[1]<n[3])){a.label=s[1];break}if(6===s[0]&&a.label<n[1]){a.label=n[1],n=s;break}if(n&&a.label<n[2]){a.label=n[2],a.ops.push(s);break}n[2]&&a.ops.pop(),a.trys.pop();continue}s=t.call(e,a)}catch(e){s=[6,e],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,u])}}}function _e(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],i=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&i>=e.length&&(e=void 0),{value:e&&e[i++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Oe(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var i,n,o=r.call(e),a=[];try{for(;(void 0===t||t-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(e){n={error:e}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}function Ee(e,t,r){if(r||2===arguments.length)for(var i,n=0,o=t.length;n<o;n++)!i&&n in t||(i||(i=Array.prototype.slice.call(t,0,n)),i[n]=t[n]);return e.concat(i||Array.prototype.slice.call(t))}"function"==typeof SuppressedError&&SuppressedError;var Te=function(e,t){var r,i;void 0===t&&(t=!1);var n=Me(e,t),o=void 0,a=ce.document.cookie.split("; ");try{for(var s=_e(a),u=s.next();!u.done;u=s.next()){var l=Oe(u.value.split("=",2),2),c=l[0],f=l[1];c===n&&(o=decodeURIComponent(f))}}catch(e){r={error:e}}finally{try{u&&!u.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}if(o)try{if(t){var h=atob(o);return JSON.parse(decodeURIComponent(h))}var d=o.split("."),p=void 0;return d.length>=2&&d[1]&&(p=atob(d[1])),{deviceId:d[0],userId:p}}catch(e){return}},Me=function(e,t){if(t){if((null==e?void 0:e.length)<10)return;return"AMP_".concat(e.substring(0,10))}if(!((null==e?void 0:e.length)<6))return"amp_".concat(e.substring(0,6))},Ve=function(){function e(e,t,r){this.type="integration",this.apiKey=e,this.identityStore=t.identityStore,this.eventBridge=t.eventBridge,this.contextProvider=t.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return e.prototype.setup=function(e,t){return Ie(this,void 0,void 0,(function(){return Ae(this,(function(r){return(null==e?void 0:e.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener((function(){null==t||t.fetch()})),[2,this.waitForConnectorIdentity(this.timeoutMillis)]}))}))},e.prototype.getUser=function(){var e=this.identityStore.getIdentity();return{user_id:e.userId,device_id:e.deviceId,user_properties:e.userProperties,version:this.contextProvider.versionName}},e.prototype.track=function(e){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:e.eventType,eventProperties:e.eventProperties}),!0)},e.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var e=Te(this.apiKey,!0);return(e||(e=Te(this.apiKey,!1))||(e=function(e){var t=Me(e,!0);try{var r=ce.localStorage.getItem(t);if(!r)return;var i=JSON.parse(r);if("object"!=typeof i)return;return i}catch(e){return}}(this.apiKey))||!!(e=function(e){var t=Me(e,!0);try{var r=ce.sessionStorage.getItem(t);if(!r)return;var i=JSON.parse(r);if("object"!=typeof i)return;return i}catch(e){return}}(this.apiKey)))&&(this.commitIdentityToConnector(e),!0)},e.prototype.commitIdentityToConnector=function(e){var t=this.identityStore.editIdentity();t.setDeviceId(e.deviceId),e.userId&&t.setUserId(e.userId),t.commit()},e.prototype.waitForConnectorIdentity=function(e){return Ie(this,void 0,void 0,(function(){var t,r=this;return Ae(this,(function(i){return(t=this.identityStore.getIdentity()).userId||t.deviceId?[2]:[2,Promise.race([new Promise((function(e){var t=function(){e(),r.identityStore.removeIdentityListener(t)};r.identityStore.addIdentityListener(t)})),new Promise((function(t,r){ce.setTimeout(r,e,"Timed out waiting for Amplitude Analytics SDK to initialize.")}))])]}))}))},e}();var Ue,Ne,je=ce.fetch||function(e,t){return t=t||{},new Promise((function(r,i){var n=new XMLHttpRequest,o=[],a=[],s={},u=function(){return{ok:2==(n.status/100|0),statusText:n.statusText,status:n.status,url:n.responseURL,text:function(){return Promise.resolve(n.responseText)},json:function(){return Promise.resolve(JSON.parse(n.responseText))},blob:function(){return Promise.resolve(new Blob([n.response]))},clone:u,headers:{keys:function(){return o},entries:function(){return a},get:function(e){return s[e.toLowerCase()]},has:function(e){return e.toLowerCase()in s}}}};for(var l in n.open(t.method||"get",e,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(e,t,r){o.push(t=t.toLowerCase()),a.push([t,r]),s[t]=s[t]?s[t]+","+r:r})),r(u())},n.onerror=i,n.withCredentials="include"==t.credentials,t.headers)n.setRequestHeader(l,t.headers[l]);n.send(t.body||null)}))},Fe=function(){function e(e){this.client=e}return e.prototype.request=function(e){return Ie(this,void 0,void 0,(function(){return Ae(this,(function(t){switch(t.label){case 0:return[4,this.client.request(e.requestUrl,e.method,e.headers,null,e.timeoutMillis)];case 1:return[2,t.sent()]}}))}))},e}(),Re={request:function(e,t,r,i,n){return function(e,t){return null==t||t<=0?e:new Promise((function(r,i){ce.setTimeout((function(){i(new se("Request timeout after "+t+" milliseconds"))}),t),e.then(r,i)}))}(Ie(void 0,void 0,void 0,(function(){var n,o;return Ae(this,(function(a){switch(a.label){case 0:return[4,je(e,{method:t,headers:r,body:i})];case 1:return n=a.sent(),o={status:n.status},[4,n.text()];case 2:return o.body=a.sent(),[2,o]}}))})),n)}};!function(e){e.LocalStorage="localStorage",e.InitialVariants="initialVariants"}(Ue||(Ue={})),function(e){e.LocalStorage="storage",e.InitialVariants="initial",e.SecondaryLocalStorage="secondary-storage",e.SecondaryInitialVariants="secondary-initial",e.FallbackInline="fallback-inline",e.FallbackConfig="fallback-config",e.LocalEvaluation="local-evaluation"}(Ne||(Ne={}));var qe=function(e){return!e||e===Ne.FallbackInline||e===Ne.FallbackConfig||e===Ne.SecondaryInitialVariants},Ke={debug:!1,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:Ue.LocalStorage,serverUrl:"https://api.lab.amplitude.com",flagsServerUrl:"https://flag.lab.amplitude.com",serverZone:"US",fetchTimeoutMillis:1e4,retryFetchOnFailure:!0,automaticExposureTracking:!0,pollOnStart:!0,flagConfigPollingIntervalMillis:3e5,fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:Re},De="1.15.5",Le=function(){function e(e,t){var r,i=this;this.isReady=new Promise((function(e){i.resolve=e})),this.config=e,this.client=t;var n=null!==(r=e.instanceName)&&void 0!==r?r:Ke.instanceName;this.queue=new ze(n),this.cache=new Be(n)}return e.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},e.prototype.setIntegration=function(e){var t=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=e,e.setup?this.integration.setup(this.config,this.client).then((function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()}),(function(){t.queue.setTracker(t.integration.track.bind(e)),t.resolve()})):(this.queue.setTracker(this.integration.track.bind(e)),this.resolve())},e.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},e.prototype.track=function(e){if(this.cache.shouldTrack(e)){var t=this.getExposureEvent(e);this.queue.push(t)}},e.prototype.getExposureEvent=function(e){var t,r,i,n={eventType:"$exposure",eventProperties:e};return(null===(t=e.metadata)||void 0===t?void 0:t.exposureEvent)?n={eventType:null===(r=e.metadata)||void 0===r?void 0:r.exposureEvent,eventProperties:e}:"web"===(null===(i=e.metadata)||void 0===i?void 0:i.deliveryMethod)&&(n={eventType:"$impression",eventProperties:e}),n},e}(),Be=function(){function e(e){this.isSessionStorageAvailable=Je(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(e),this.isSessionStorageAvailable&&ce.sessionStorage.removeItem("EXP_sent_".concat(e))}return e.prototype.shouldTrack=function(e){var t;if("web"===(null===(t=e.metadata)||void 0===t?void 0:t.deliveryMethod))return!0;this.loadCache();var r=this.inMemoryCache[e.flag_key],i=!1;return r&&r.variant===e.variant||(i=!0,this.inMemoryCache[e.flag_key]=e),this.storeCache(),i},e.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var e=ce.sessionStorage.getItem(this.storageKey);this.inMemoryCache=e?JSON.parse(e):{}}},e.prototype.storeCache=function(){this.isSessionStorageAvailable&&ce.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},e}(),ze=function(){function e(e,t){void 0===t&&(t=512),this.isLocalStorageAvailable=function(){var e=fe();if(e)try{var t="EXP_test";return e.localStorage.setItem(t,t),e.localStorage.removeItem(t),!0}catch(e){return!1}return!1}(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(e),this.maxQueueSize=t}return e.prototype.push=function(e){this.loadQueue(),this.inMemoryQueue.push(e),this.flush(),this.storeQueue()},e.prototype.setTracker=function(e){var t=this;this.tracker=e,this.poller=ce.setInterval((function(){t.loadFlushStore()}),1e3),this.loadFlushStore()},e.prototype.flush=function(){var e,t;if(this.tracker&&0!==this.inMemoryQueue.length){try{for(var r=_e(this.inMemoryQueue),i=r.next();!i.done;i=r.next()){var n=i.value;if(!this.tracker(n))return}}catch(t){e={error:t}}finally{try{i&&!i.done&&(t=r.return)&&t.call(r)}finally{if(e)throw e.error}}this.inMemoryQueue=[],this.poller&&(ce.clearInterval(this.poller),this.poller=void 0)}},e.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var e=ce.localStorage.getItem(this.storageKey);this.inMemoryQueue=e?JSON.parse(e):[]}},e.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),ce.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},e.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},e}(),Je=function(){var e=fe();if(e)try{var t="EXP_test";return e.sessionStorage.setItem(t,t),e.sessionStorage.removeItem(t),!0}catch(e){return!1}return!1},Qe=function(){function e(){this.globalScope=fe()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.localStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.localStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.localStorage.removeItem(e)},e}(),We=function(){function e(e,t,r){this.cache={},this.namespace=e,this.storage=t,this.transformer=r}return e.prototype.get=function(e){return this.cache[e]},e.prototype.getAll=function(){return Ce({},this.cache)},e.prototype.put=function(e,t){this.cache[e]=t},e.prototype.putAll=function(e){var t,r;try{for(var i=_e(Object.keys(e)),n=i.next();!n.done;n=i.next()){var o=n.value;this.cache[o]=e[o]}}catch(e){t={error:e}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(t)throw t.error}}},e.prototype.remove=function(e){delete this.cache[e]},e.prototype.clear=function(){this.cache={}},e.prototype.load=function(){var e,t,r,i=this.storage.get(this.namespace);try{r=JSON.parse(i)||{}}catch(e){return}var n={};try{for(var o=_e(Object.keys(r)),a=o.next();!a.done;a=o.next()){var s=a.value;try{var u=void 0;(u=this.transformer?this.transformer(r[s]):r[s])&&(n[s]=u)}catch(e){}}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}this.clear(),this.putAll(n)},e.prototype.store=function(e){void 0===e&&(e=this.cache),this.storage.put(this.namespace,JSON.stringify(e))},e}(),Xe=function(e){if("string"==typeof e)return{key:e,value:e};if("object"==typeof e){var t=e.key,r=e.value,i=e.payload,n=e.metadata,o=e.expKey;n&&n.experimentKey?o=n.experimentKey:o&&((n=n||{}).experimentKey=o);var a={};return t?a.key=t:r&&(a.key=r),r&&(a.value=r),n&&(a.metadata=n),i&&(a.payload=i),o&&(a.expKey=o),a}},$e=function(){function e(){this.globalScope=fe()}return e.prototype.get=function(e){var t;return null===(t=this.globalScope)||void 0===t?void 0:t.sessionStorage.getItem(e)},e.prototype.put=function(e,t){var r;null===(r=this.globalScope)||void 0===r||r.sessionStorage.setItem(e,t)},e.prototype.delete=function(e){var t;null===(t=this.globalScope)||void 0===t||t.sessionStorage.removeItem(e)},e}(),He=function(e){return null==e},Ge=function(e){return!!He(e)||e&&0===Object.keys(e).length},Ze=function(e){var t;return"local"===(null===(t=null==e?void 0:e.metadata)||void 0===t?void 0:t.evaluationMode)},Ye=function(){function e(e,t,r,i){this.started=!1,this.done=!1,this.attempts=e,this.min=t,this.max=r,this.scalar=i}return e.prototype.start=function(e){return Ie(this,void 0,void 0,(function(){return Ae(this,(function(t){switch(t.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(e,0,this.min)];case 1:return t.sent(),[2]}}))}))},e.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},e.prototype.backoff=function(e,t,r){return Ie(this,void 0,void 0,(function(){var i=this;return Ae(this,(function(n){return this.done||(this.timeoutHandle=ce.setTimeout((function(){return Ie(i,void 0,void 0,(function(){var i,n;return Ae(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,e()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(i=t+1)<this.attempts&&(n=Math.min(r*this.scalar,this.max),this.backoff(e,i,n)),[3,3];case 3:return[2]}}))}))}),r)),[2]}))}))},e}(),et=function(e){return null==e?{}:"string"==typeof e?{key:e,value:e}:e},tt=function(e){if(!e)return{};var t=void 0;e.metadata&&(t=e.metadata.experimentKey);var r={};return e.key&&(r.key=e.key),e.value&&(r.value=e.value),e.payload&&(r.payload=e.payload),t&&(r.expKey=t),e.metadata&&(r.metadata=e.metadata),r},rt=function(){function e(e){this.setProperties={},this.unsetProperties={},this.analyticsProvider=e}return e.prototype.track=function(e){this.setProperties[e.key]!=e.variant.value&&(this.setProperties[e.key]=e.variant.value,delete this.unsetProperties[e.key],this.analyticsProvider.track(e))},e.prototype.setUserProperty=function(e){this.setProperties[e.key]!=e.variant.value&&this.analyticsProvider.setUserProperty(e)},e.prototype.unsetUserProperty=function(e){this.unsetProperties[e.key]||(this.unsetProperties[e.key]="unset",delete this.setProperties[e.key],this.analyticsProvider.unsetUserProperty(e))},e}(),it=function(){function e(e){this.tracked={},this.exposureTrackingProvider=e}return e.prototype.track=function(e){var t=this.tracked[e.flag_key];t&&t.variant===e.variant||(this.tracked[e.flag_key]=e,this.exposureTrackingProvider.track(e))},e}(),nt=function(){function e(e,t){var r,i,n,o,a=this;this.engine=new L,this.isRunning=!1,this.apiKey=e,this.config=Ce(Ce(Ce({},Ke),t),{serverUrl:(null==t?void 0:t.serverUrl)||("eu"===(null===(r=null==t?void 0:t.serverZone)||void 0===r?void 0:r.toLowerCase())?"https://api.lab.eu.amplitude.com":Ke.serverUrl),flagsServerUrl:(null==t?void 0:t.flagsServerUrl)||("eu"===(null===(i=null==t?void 0:t.serverZone)||void 0===i?void 0:i.toLowerCase())?"https://flag.lab.eu.amplitude.com":Ke.flagsServerUrl),flagConfigPollingIntervalMillis:t.flagConfigPollingIntervalMillis<6e4?6e4:null!==(n=t.flagConfigPollingIntervalMillis)&&void 0!==n?n:Ke.flagConfigPollingIntervalMillis});var s=null===(o=this.config)||void 0===o?void 0:o.internalInstanceNameSuffix;if(this.isWebExperiment="web"===s,this.poller=new he((function(){return a.doFlags()}),this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var u in this.config.initialVariants)this.config.initialVariants[u]=Xe(this.config.initialVariants[u]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new rt(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.exposureTrackingProvider=new it(this.config.exposureTrackingProvider)),this.integrationManager=new Le(this.config,this);var l,c=new Fe(this.config.httpClient||Re);this.flagApi=new le(this.apiKey,this.config.flagsServerUrl,c),this.evaluationApi=new ue(this.apiKey,this.config.serverUrl,c);var f=s?"".concat(this.config.instanceName,"-").concat(s):this.config.instanceName;l=this.isWebExperiment?new $e:new Qe,this.variants=function(e,t,r){var i=e.substring(e.length-6),n="amp-exp-".concat(t,"-").concat(i);return new We(n,r,Xe)}(this.apiKey,f,l),this.flags=function(e,t,r){void 0===r&&(r=new Qe);var i=e.substring(e.length-6),n="amp-exp-".concat(t,"-").concat(i,"-flags");return new We(n,r)}(this.apiKey,f,l);try{this.flags.load(),this.variants.load()}catch(e){}this.mergeInitialFlagsWithStorage()}return e.prototype.start=function(e){var t;return Ie(this,void 0,void 0,(function(){var r;return Ae(this,(function(i){switch(i.label){case 0:return this.isRunning?[2]:(this.isRunning=!0,this.setUser(e),r=this.doFlags(),null===(t=this.config.fetchOnStart)||void 0===t||t?[4,Promise.all([this.fetch(e),r])]:[3,2]);case 1:return i.sent(),[3,4];case 2:return[4,r];case 3:i.sent(),i.label=4;case 4:return this.config.pollOnStart&&this.poller.start(),[2]}}))}))},e.prototype.stop=function(){this.isRunning&&(this.poller.stop(),this.isRunning=!1)},e.prototype.fetch=function(e,t){return void 0===e&&(e=this.user),Ie(this,void 0,void 0,(function(){var r;return Ae(this,(function(i){switch(i.label){case 0:this.setUser(e||{}),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.fetchInternal(e,this.config.fetchTimeoutMillis,this.config.retryFetchOnFailure,t)];case 2:return i.sent(),[3,4];case 3:return r=i.sent(),this.config.debug&&(r instanceof se?console.debug(r):console.error(r)),[3,4];case 4:return[2,this]}}))}))},e.prototype.variant=function(e,t){var r,i;if(!this.apiKey)return{value:void 0};var n=this.variantAndSource(e,t);return this.config.automaticExposureTracking&&this.exposureInternal(e,n),this.debug("[Experiment] variant for ".concat(e," is ").concat((null===(r=n.variant)||void 0===r?void 0:r.key)||(null===(i=n.variant)||void 0===i?void 0:i.value))),n.variant||{}},e.prototype.exposure=function(e){var t=this.variantAndSource(e);this.exposureInternal(e,t)},e.prototype.all=function(){if(!this.apiKey)return{};var e=this.evaluate();for(var t in e){var r=this.flags.get(t);Ze(r)||delete e[t]}return Ce(Ce(Ce({},this.secondaryVariants()),this.sourceVariants()),e)},e.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(e){}},e.prototype.getUser=function(){var e;if(!this.user)return this.user;if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var t=Ce({},this.user.user_properties);return Ce(Ce({},this.user),{user_properties:t})}return Ce({},this.user)},e.prototype.setUser=function(e){var t;if(e)if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var r=Ce({},e.user_properties);this.user=Ce(Ce({},e),{user_properties:r})}else this.user=Ce({},e);else this.user=null},e.prototype.getUserProvider=function(){return this.userProvider},e.prototype.setUserProvider=function(e){return this.userProvider=e,this},e.prototype.mergeInitialFlagsWithStorage=function(){var e=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach((function(t){e.flags.get(t.key)||e.flags.put(t.key,t)}))},e.prototype.evaluate=function(e){var t,r,i=this.addContext(this.user),n=function(e,t){var r,i,n=o({},e),a=[],s=t||Object.keys(n);try{for(var f=u(s),h=f.next();!h.done;h=f.next()){var d=h.value,p=B(d,n);p&&a.push.apply(a,c([],l(p),!1))}}catch(e){r={error:e}}finally{try{h&&!h.done&&(i=f.return)&&i.call(f)}finally{if(r)throw r.error}}return a}(this.flags.getAll(),e),a=function(e){var t,r,i,n;if(!e)return{};var o={user:e},a=fe();a&&(o.page={url:a.location.href});var s={};if(!e.groups)return o;try{for(var u=_e(Object.keys(e.groups)),l=u.next();!l.done;l=u.next()){var c=l.value,f=e.groups[c];if(f.length>0&&f[0]){var h=f[0],d={group_name:h},p=null===(n=null===(i=e.group_properties)||void 0===i?void 0:i[c])||void 0===n?void 0:n[h];p&&Object.keys(p).length>0&&(d.group_properties=p),s[c]=d}}}catch(e){t={error:e}}finally{try{l&&!l.done&&(r=u.return)&&r.call(u)}finally{if(t)throw t.error}}return Object.keys(s).length>0&&(o.groups=s),delete o.user.groups,delete o.user.group_properties,o}(i),s=this.engine.evaluate(a,n),f={};try{for(var h=_e(Object.keys(s)),d=h.next();!d.done;d=h.next()){var p=d.value;f[p]=tt(s[p])}}catch(e){t={error:e}}finally{try{d&&!d.done&&(r=h.return)&&r.call(h)}finally{if(t)throw t.error}}return f},e.prototype.variantAndSource=function(e,t){var r={};this.config.source===Ue.LocalStorage?r=this.localStorageVariantAndSource(e,t):this.config.source===Ue.InitialVariants&&(r=this.initialVariantsVariantAndSource(e,t));var i=this.flags.get(e);return(Ze(i)||!r.variant&&i)&&(r=this.localEvaluationVariantAndSource(e,i,t)),r},e.prototype.localEvaluationVariantAndSource=function(e,t,r){var i,n={},o=this.evaluate([t.key])[e],a=Ne.LocalEvaluation,s=null===(i=null==o?void 0:o.metadata)||void 0===i?void 0:i.default;if(!He(o)&&!s)return{variant:et(o),source:a,hasDefaultVariant:!1};if(s&&(n={variant:et(o),source:a,hasDefaultVariant:!0}),!He(r))return{variant:et(r),source:Ne.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var u=this.config.initialVariants[e];if(!He(u))return{variant:et(u),source:Ne.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var l=et(this.config.fallbackVariant),c={variant:l,source:Ne.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Ge(l)?n:c},e.prototype.localStorageVariantAndSource=function(e,t){var r,i={},n=this.variants.get(e),o=null===(r=null==n?void 0:n.metadata)||void 0===r?void 0:r.default;if(!He(n)&&!o)return{variant:et(n),source:Ne.LocalStorage,hasDefaultVariant:!1};if(o&&(i={variant:et(n),source:Ne.LocalStorage,hasDefaultVariant:!0}),!He(t))return{variant:et(t),source:Ne.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var a=this.config.initialVariants[e];if(!He(a))return{variant:et(a),source:Ne.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var s=et(this.config.fallbackVariant),u={variant:s,source:Ne.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return Ge(s)?i:u},e.prototype.initialVariantsVariantAndSource=function(e,t){var r,i={},n=this.config.initialVariants[e];if(!He(n))return{variant:et(n),source:Ne.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(e),a=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!He(o)&&!a)return{variant:et(o),source:Ne.LocalStorage,hasDefaultVariant:!1};if(a&&(i={variant:et(o),source:Ne.LocalStorage,hasDefaultVariant:!0}),!He(t))return{variant:et(t),source:Ne.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var s=et(this.config.fallbackVariant),u={variant:s,source:Ne.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return Ge(s)?i:u},e.prototype.fetchInternal=function(e,t,r,i){return Ie(this,void 0,void 0,(function(){var n,o;return Ae(this,(function(a){switch(a.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");this.debug("[Experiment] Fetch all: retry=".concat(r)),r&&this.stopRetries(),a.label=1;case 1:return a.trys.push([1,4,,5]),[4,this.doFetch(e,t,i)];case 2:return n=a.sent(),[4,this.storeVariants(n,i)];case 3:return a.sent(),[2,n];case 4:throw o=a.sent(),r&&this.shouldRetryFetch(o)&&this.startRetries(e,i),o;case 5:return[2]}}))}))},e.prototype.cleanUserPropsForFetch=function(e){var t=Ce({},e);return delete t.cookie,t},e.prototype.doFetch=function(e,t,r){return Ie(this,void 0,void 0,(function(){var i,n,o,a,s,u,l;return Ae(this,(function(c){switch(c.label){case 0:return[4,this.addContextOrWait(e)];case 1:return e=c.sent(),e=this.cleanUserPropsForFetch(e),this.debug("[Experiment] Fetch variants for user: ",e),[4,this.evaluationApi.getVariants(e,Ce({timeoutMillis:t},r))];case 2:i=c.sent(),n={};try{for(o=_e(Object.keys(i)),a=o.next();!a.done;a=o.next())s=a.value,n[s]=tt(i[s])}catch(e){u={error:e}}finally{try{a&&!a.done&&(l=o.return)&&l.call(o)}finally{if(u)throw u.error}}return this.debug("[Experiment] Received variants: ",n),[2,n]}}))}))},e.prototype.doFlags=function(){return Ie(this,void 0,void 0,(function(){var e,t,r;return Ae(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),e=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:e=i.sent(),i.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:De,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==e?void 0:e.user_id)||(null==e?void 0:e.device_id)?{user_id:null==e?void 0:e.user_id,device_id:null==e?void 0:e.device_id}:void 0})];case 3:return t=i.sent(),this.flags.clear(),this.flags.putAll(t),[3,5];case 4:if(!((r=i.sent())instanceof se))throw r;return this.config.debug&&console.debug(r),[3,5];case 5:try{this.flags.store()}catch(e){}return this.mergeInitialFlagsWithStorage(),[2]}}))}))},e.prototype.storeVariants=function(e,t){return Ie(this,void 0,void 0,(function(){var r,i,n,o;return Ae(this,(function(a){for(o in 0===(r=t&&t.flagKeys?t.flagKeys:[]).length&&this.variants.clear(),i=function(t){r=r.filter((function(e){return e!==t})),n.variants.put(t,e[t])},n=this,e)i(o);for(o in r)this.variants.remove(o);try{this.variants.store()}catch(e){}return this.debug("[Experiment] Stored variants: ",e),[2]}))}))},e.prototype.startRetries=function(e,t){return Ie(this,void 0,void 0,(function(){var r=this;return Ae(this,(function(i){return this.debug("[Experiment] Retry fetch"),this.retriesBackoff=new Ye(8,500,1e4,1.5),this.retriesBackoff.start((function(){return Ie(r,void 0,void 0,(function(){return Ae(this,(function(r){switch(r.label){case 0:return[4,this.fetchInternal(e,1e4,!1,t)];case 1:return r.sent(),[2]}}))}))})),[2]}))}))},e.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},e.prototype.addContext=function(e){var t,r=null===(t=this.userProvider)||void 0===t?void 0:t.getUser(),i=this.integrationManager.getUser(),n=Ce(Ce(Ce({},null==r?void 0:r.user_properties),i.user_properties),null==e?void 0:e.user_properties);return Ce(Ce(Ce(Ce({library:"experiment-js-client/".concat(De)},r),i),e),{user_properties:n})},e.prototype.addContextOrWait=function(e){return Ie(this,void 0,void 0,(function(){return Ae(this,(function(t){switch(t.label){case 0:return[4,this.integrationManager.ready()];case 1:return t.sent(),[2,this.addContext(e)]}}))}))},e.prototype.sourceVariants=function(){return this.config.source==Ue.LocalStorage?this.variants.getAll():this.config.source==Ue.InitialVariants?this.config.initialVariants:void 0},e.prototype.secondaryVariants=function(){return this.config.source==Ue.LocalStorage?this.config.initialVariants:this.config.source==Ue.InitialVariants?this.variants.getAll():void 0},e.prototype.exposureInternal=function(e,t){var r,i,n,o,a,s,u,l,c;if(null===(n=null===(i=null===(r=t.variant)||void 0===r?void 0:r.metadata)||void 0===i?void 0:i.trackExposure)||void 0===n||n){this.legacyExposureInternal(e,t.variant,t.source);var f={flag_key:e},h=qe(t.source);if(!h||t.hasDefaultVariant){(null===(o=t.variant)||void 0===o?void 0:o.expKey)&&(f.experiment_key=null===(a=t.variant)||void 0===a?void 0:a.expKey);var d=null===(s=t.variant)||void 0===s?void 0:s.metadata;h||(null==d?void 0:d.default)||((null===(u=t.variant)||void 0===u?void 0:u.key)?f.variant=t.variant.key:(null===(l=t.variant)||void 0===l?void 0:l.value)&&(f.variant=t.variant.value)),d&&(f.metadata=d),null===(c=this.exposureTrackingProvider)||void 0===c||c.track(f),this.integrationManager.track(f)}}},e.prototype.legacyExposureInternal=function(e,t,r){var i,n,o,a,s;if(this.analyticsProvider){var u=function(e,t,r,i){var n,o=null==r?void 0:r.value,a="[Experiment] ".concat(t);return{name:"[Experiment] Exposure",user:e,key:t,variant:r,userProperty:a,properties:{key:t,variant:o,source:i},userProperties:(n={},n[a]=o,n)}}(this.addContext(this.getUser()),e,t,r);qe(r)||!(null==t?void 0:t.value)?null===(n=null===(i=this.analyticsProvider)||void 0===i?void 0:i.unsetUserProperty)||void 0===n||n.call(i,u):(null==t?void 0:t.value)&&(null===(a=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===a||a.call(o,u),null===(s=this.analyticsProvider)||void 0===s||s.track(u))}},e.prototype.debug=function(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];this.config.debug&&console.debug.apply(console,Ee([e],Oe(t),!1))},e.prototype.shouldRetryFetch=function(e){return!(e instanceof ae)||(e.statusCode<400||e.statusCode>=500||429===e.statusCode)},e.prototype.addPlugin=function(e){"integration"===e.type&&this.integrationManager.setIntegration(e)},e}(),ot=function(){function e(e,t){var r,i,n;this.globalScope=fe(),this.userAgent=void 0!==(null===(r=this.globalScope)||void 0===r?void 0:r.navigator)?null===(i=this.globalScope)||void 0===i?void 0:i.navigator.userAgent:void 0,this.ua=new Pe.exports.UAParser(this.userAgent).getResult(),this.localStorage=new Qe,this.sessionStorage=new $e,this.userProvider=e,this.apiKey=t,this.storageKey="EXP_".concat(null===(n=this.apiKey)||void 0===n?void 0:n.slice(0,10),"_DEFAULT_USER_PROVIDER")}return e.prototype.getUser=function(){var e,t,r,i,n,o=(null===(e=this.userProvider)||void 0===e?void 0:e.getUser())||{};return Ce({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(r=null===(t=this.ua.device)||void 0===t?void 0:t.type)&&void 0!==r?r:"desktop",referring_url:null===(n=null===(i=this.globalScope)||void 0===i?void 0:i.document)||void 0===n?void 0:n.referrer.replace(/\/$/,""),cookie:this.getCookie(),browser:this.getBrowser(this.ua),landing_url:this.getLandingUrl(),first_seen:this.getFirstSeen(),url_param:this.getUrlParam(),user_agent:this.userAgent},o)},e.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},e.prototype.getOs=function(e){var t,r;return[null===(t=e.browser)||void 0===t?void 0:t.name,null===(r=e.browser)||void 0===r?void 0:r.major].filter((function(e){return null!=e})).join(" ")},e.prototype.getDeviceModel=function(e){var t;return null===(t=e.os)||void 0===t?void 0:t.name},e.prototype.getBrowser=function(e){var t,r=null===(t=e.browser)||void 0===t?void 0:t.name;return(null==r?void 0:r.includes("Chrom"))&&(r="Chrome"),(null==r?void 0:r.includes("Firefox"))&&(r="Firefox"),(null==r?void 0:r.includes("Safari"))&&(r="Safari"),(null==r?void 0:r.includes("Edge"))&&(r="Edge"),(null==r?void 0:r.includes("Opera"))&&(r="Opera"),r},e.prototype.getCookie=function(){var e,t,r,i,n;if(null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.document)||void 0===t?void 0:t.cookie)return Object.fromEntries(null===(n=null===(i=null===(r=this.globalScope)||void 0===r?void 0:r.document)||void 0===i?void 0:i.cookie)||void 0===n?void 0:n.split("; ").map((function(e){return e.split("=")})))},e.prototype.getLandingUrl=function(){var e,t;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=null===(t=null===(e=this.globalScope)||void 0===e?void 0:e.location)||void 0===t?void 0:t.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch(e){return}},e.prototype.getFirstSeen=function(){try{var e=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return e.first_seen||(e.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(e))),e.first_seen}catch(e){return}},e.prototype.getUrlParam=function(){var e,t,r;if(this.globalScope){var i={};try{var n=new URL(this.globalScope.location.href);try{for(var o=_e(n.searchParams),a=o.next();!a.done;a=o.next()){var s=Oe(a.value,2),u=s[0],l=s[1];i[u]=Ee(Ee([],Oe(null!==(r=i[u])&&void 0!==r?r:[]),!1),Oe(l.split(",")),!1)}}catch(t){e={error:t}}finally{try{a&&!a.done&&(t=o.return)&&t.call(o)}finally{if(e)throw e.error}}}catch(e){return}return Object.entries(i).reduce((function(e,t){var r=Oe(t,2),i=r[0],n=r[1];return e[i]=1==n.length?n[0]:n,e}),{})}},e}();ce.experimentInstances={};var at=ce.experimentInstances,st=function(e){return(null==e?void 0:e.instanceName)||Ke.instanceName},ut=function(e,t,r){var i=function(e,t){var r=st(t),i=null==t?void 0:t.internalInstanceNameSuffix;return i?"".concat(r,".").concat(e,".").concat(i):"".concat(r,".").concat(e)}(e,t),n=at[i];return n||(n=function(e,t){return new nt(e,Ce(Ce({},t),{userProvider:new ot(null==t?void 0:t.userProvider,e)}))}(e,t),r&&n.addPlugin(r()),at[i]=n,n)},lt=function(){function e(t){this.name=e.pluginName,this.config=t}return e.prototype.setup=function(e,i){return t(this,void 0,void 0,(function(){return r(this,(function(t){return this.experiment=function(e,t){return ut(e,t,(function(){return new Ve(e,Se.getInstance(st(t)),1e4)}))}(e.apiKey,this.config),[2]}))}))},e.pluginName="@amplitude/experiment-analytics-plugin",e}();e.ExperimentPlugin=lt,e.experimentPlugin=function(e){return new lt(e)},Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
Binary file
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { EnrichmentPlugin, BrowserClient, BrowserConfig } from '@amplitude/analytics-core';
|
|
2
|
+
import { ExperimentConfig, Client as IExperimentClient } from '@amplitude/experiment-js-client';
|
|
3
|
+
export declare class ExperimentPlugin implements EnrichmentPlugin<BrowserClient, BrowserConfig> {
|
|
4
|
+
static pluginName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
experiment: IExperimentClient;
|
|
7
|
+
config?: ExperimentConfig;
|
|
8
|
+
constructor(config?: ExperimentConfig);
|
|
9
|
+
setup(config: BrowserConfig, _client: BrowserClient): Promise<void>;
|
|
10
|
+
}
|
|
11
|
+
export declare const experimentPlugin: (config?: ExperimentConfig) => EnrichmentPlugin<BrowserClient, BrowserConfig>;
|
|
12
|
+
//# sourceMappingURL=experiment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"experiment.d.ts","sourceRoot":"","sources":["../../src/experiment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAE3F,OAAO,EACL,gBAAgB,EAChB,MAAM,IAAI,iBAAiB,EAE5B,MAAM,iCAAiC,CAAC;AAEzC,qBAAa,gBAAiB,YAAW,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAAC;IACrF,MAAM,CAAC,UAAU,SAA4C;IAC7D,IAAI,SAA+B;IAGnC,UAAU,EAAE,iBAAiB,CAAC;IAC9B,MAAM,CAAC,EAAE,gBAAgB,CAAC;gBAEd,MAAM,CAAC,EAAE,gBAAgB;IAI/B,KAAK,CAAC,MAAM,EAAE,aAAa,EAAE,OAAO,EAAE,aAAa;CAG1D;AAED,eAAO,MAAM,gBAAgB,EAAE,CAAC,MAAM,CAAC,EAAE,gBAAgB,KAAK,gBAAgB,CAAC,aAAa,EAAE,aAAa,CAI1G,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAC;AAClE,OAAO,EAAE,gBAAgB,EAAE,MAAM,IAAI,iBAAiB,EAAE,MAAM,iCAAiC,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@amplitude/plugin-experiment-browser",
|
|
3
|
+
"version": "1.0.0-beta.0",
|
|
4
|
+
"description": "",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/amplitude/Amplitude-TypeScript.git"
|
|
8
|
+
},
|
|
9
|
+
"author": "Amplitude Inc",
|
|
10
|
+
"license": "MIT",
|
|
11
|
+
"main": "lib/cjs/index.js",
|
|
12
|
+
"module": "lib/esm/index.js",
|
|
13
|
+
"types": "lib/esm/index.d.ts",
|
|
14
|
+
"sideEffects": false,
|
|
15
|
+
"bugs": {
|
|
16
|
+
"url": "https://github.com/amplitude/Amplitude-TypeScript/issues"
|
|
17
|
+
},
|
|
18
|
+
"publishConfig": {
|
|
19
|
+
"tag": "beta"
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"lib"
|
|
23
|
+
],
|
|
24
|
+
"scripts": {
|
|
25
|
+
"build": "yarn bundle && yarn build:es5 && yarn build:esm",
|
|
26
|
+
"bundle": "rollup --config rollup.config.js",
|
|
27
|
+
"build:es5": "tsc -p ./tsconfig.es5.json",
|
|
28
|
+
"build:esm": "tsc -p ./tsconfig.esm.json",
|
|
29
|
+
"clean": "rimraf node_modules lib coverage",
|
|
30
|
+
"fix": "yarn fix:eslint & yarn fix:prettier",
|
|
31
|
+
"fix:eslint": "eslint '{src,test}/**/*.ts' --fix",
|
|
32
|
+
"fix:prettier": "prettier --write \"{src,test}/**/*.ts\"",
|
|
33
|
+
"lint": "yarn lint:eslint & yarn lint:prettier",
|
|
34
|
+
"lint:eslint": "eslint '{src,test}/**/*.ts'",
|
|
35
|
+
"lint:prettier": "prettier --check \"{src,test}/**/*.ts\"",
|
|
36
|
+
"test": "jest",
|
|
37
|
+
"typecheck": "tsc -p ./tsconfig.json",
|
|
38
|
+
"version": "yarn version-file yarn build",
|
|
39
|
+
"version-file": "echo '// Autogenerated by `yarn version-file`. DO NOT EDIT' > src/version.ts && node -p \"'export const VERSION = \\'' + require('./package.json').version + '\\';'\" >> src/version.ts"
|
|
40
|
+
},
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@amplitude/analytics-core": "^2.10.0",
|
|
43
|
+
"@amplitude/experiment-js-client": "^1.15.5"
|
|
44
|
+
}
|
|
45
|
+
}
|