@amplitude/experiment-tag 0.5.6-beta.0 → 0.6.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/package.json +6 -5
- package/dist/LICENSES +0 -246
- package/dist/experiment-tag.umd.js +0 -2
- package/dist/types/src/config.d.ts +0 -11
- package/dist/types/src/experiment.d.ts +0 -77
- package/dist/types/src/index.d.ts +0 -3
- package/dist/types/src/inject-utils.d.ts +0 -20
- package/dist/types/src/messenger.d.ts +0 -4
- package/dist/types/src/types.d.ts +0 -18
- package/dist/types/src/utils.d.ts +0 -9
- package/dist/types/src/web-experiment.d.ts +0 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amplitude/experiment-tag",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Amplitude Experiment Javascript Snippet",
|
|
5
5
|
"author": "Amplitude",
|
|
6
6
|
"homepage": "https://github.com/amplitude/experiment-js-client",
|
|
@@ -26,9 +26,10 @@
|
|
|
26
26
|
"url": "https://github.com/amplitude/experiment-js-client/issues"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@amplitude/experiment-core": "^0.
|
|
30
|
-
"@amplitude/experiment-js-client": "^1.
|
|
31
|
-
"dom-mutator": "git+ssh://git@github.com:amplitude/dom-mutator#main"
|
|
29
|
+
"@amplitude/experiment-core": "^0.11.0",
|
|
30
|
+
"@amplitude/experiment-js-client": "^1.15.5",
|
|
31
|
+
"dom-mutator": "git+ssh://git@github.com:amplitude/dom-mutator#main",
|
|
32
|
+
"rollup-plugin-license": "^3.6.0"
|
|
32
33
|
},
|
|
33
34
|
"devDependencies": {
|
|
34
35
|
"@rollup/plugin-terser": "^0.4.4",
|
|
@@ -37,5 +38,5 @@
|
|
|
37
38
|
"files": [
|
|
38
39
|
"dist/**/*"
|
|
39
40
|
],
|
|
40
|
-
"gitHead": "
|
|
41
|
+
"gitHead": "8911f69e150a9126dce932e43b50779a79f30fb8"
|
|
41
42
|
}
|
package/dist/LICENSES
DELETED
|
@@ -1,246 +0,0 @@
|
|
|
1
|
-
Name: tslib
|
|
2
|
-
Version: 2.6.1
|
|
3
|
-
License: 0BSD
|
|
4
|
-
Private: false
|
|
5
|
-
Description: Runtime library for TypeScript helper functions
|
|
6
|
-
Repository: https://github.com/Microsoft/tslib.git
|
|
7
|
-
Homepage: https://www.typescriptlang.org/
|
|
8
|
-
Author: Microsoft Corp.
|
|
9
|
-
License Copyright:
|
|
10
|
-
===
|
|
11
|
-
|
|
12
|
-
Copyright (c) Microsoft Corporation.
|
|
13
|
-
|
|
14
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
15
|
-
purpose with or without fee is hereby granted.
|
|
16
|
-
|
|
17
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
18
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
19
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
20
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
21
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
22
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
23
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
24
|
-
|
|
25
|
-
---
|
|
26
|
-
|
|
27
|
-
Name: @amplitude/analytics-connector
|
|
28
|
-
Version: 1.6.4
|
|
29
|
-
License: MIT
|
|
30
|
-
Private: false
|
|
31
|
-
Description: Connector package for Amplitude SDKs
|
|
32
|
-
Repository: https://github.com/amplitude/experiment-js-client.git
|
|
33
|
-
Homepage: https://github.com/amplitude/experiment-js-client
|
|
34
|
-
Author: Amplitude
|
|
35
|
-
|
|
36
|
-
---
|
|
37
|
-
|
|
38
|
-
Name: @amplitude/experiment-core
|
|
39
|
-
Version: 0.11.0
|
|
40
|
-
License: MIT
|
|
41
|
-
Private: false
|
|
42
|
-
Description: Amplitude Experiment evaluation JavaScript implementation.
|
|
43
|
-
Repository: https://github.com/amplitude/experiment-js-client.git
|
|
44
|
-
Homepage: https://github.com/amplitude/experiment-js-client
|
|
45
|
-
Author: Amplitude
|
|
46
|
-
|
|
47
|
-
---
|
|
48
|
-
|
|
49
|
-
Name: @amplitude/ua-parser-js
|
|
50
|
-
Version: 0.7.33
|
|
51
|
-
License: MIT
|
|
52
|
-
Private: false
|
|
53
|
-
Description: Detect Browser, Engine, OS, CPU, and Device type/model from User-Agent data. Supports browser & node.js environment
|
|
54
|
-
Repository: https://github.com/amplitude/ua-parser-js.git
|
|
55
|
-
Homepage: http://github.com/amplitude/ua-parser-js
|
|
56
|
-
Author: Faisal Salman <f@faisalman.com> (http://faisalman.com)
|
|
57
|
-
Contributors:
|
|
58
|
-
Aamir Poonawalla <aamir@urx.com>
|
|
59
|
-
Admas <mollases@users.noreply.github.com>
|
|
60
|
-
algenon <m@antonz.ru>
|
|
61
|
-
Alvin Portillo <alvin@8thwall.com>
|
|
62
|
-
Amumu <yoyo837@hotmail.com>
|
|
63
|
-
Andrea Vaghi <andrea.vaghi@jobrapido.com>
|
|
64
|
-
Anton Zhiyanov <m@antonz.ru>
|
|
65
|
-
Arturo Mejia <amejia@blim.com>
|
|
66
|
-
Arun Rama Reddy <arunramareddy@gmail.com>
|
|
67
|
-
Austin Pray <austin@austinpray.com>
|
|
68
|
-
Bendeguz <symunona@gmail.com>
|
|
69
|
-
Benjamin Bertrand <bertrand.design@gmail.com>
|
|
70
|
-
Benjamin Urban <benjamin.urban@sueddeutsche.de>
|
|
71
|
-
boneyao <admin@boneyao.com>
|
|
72
|
-
Carl C Von Lewin <carlchristianlewin@gmail.com>
|
|
73
|
-
CESAR RAMOS <c@imagenproactiva.com>
|
|
74
|
-
Chad Killingsworth <ckillingsworth@jackhenry.com>
|
|
75
|
-
Christopher De Cairos <chris.decairos@gmail.com>
|
|
76
|
-
Cyrille David <cyrille@qonto.eu>
|
|
77
|
-
Dario Vladovic <d.vladimyr@gmail.com>
|
|
78
|
-
David Annez <david.annez@gmail.com>
|
|
79
|
-
Davit Barbakadze <jayarjo@gmail.com>
|
|
80
|
-
ddivernois <david-emmanuel.divernois@amadeus.com>
|
|
81
|
-
Deliaz <D3liaz@gmail.com>
|
|
82
|
-
Demis Palma <demis.palma@gmail.com>
|
|
83
|
-
dhoko <aurelien@protonmail.com>
|
|
84
|
-
dianhe <dianhe@webank.com>
|
|
85
|
-
dineshks1 <dineshks1@d.kumar44@outlook.com>
|
|
86
|
-
Dmitry Tyschenko <dtyschenko@gmail.com>
|
|
87
|
-
Douglas Li <doug@knotch.it>
|
|
88
|
-
Dumitru Uzun <contact@duzun.me>
|
|
89
|
-
Dustin <duburns@fanatics.com>
|
|
90
|
-
Elchin Valiyev <elchin.valiyev@autodesk.com>
|
|
91
|
-
Emil Hesslow <hesslow@gmail.com>
|
|
92
|
-
Eric Redon <eric.redon@coox.org>
|
|
93
|
-
Eric Schrenker <eric.schrenker@gmail.com>
|
|
94
|
-
Erik Hesselink <hesselink@gmail.com>
|
|
95
|
-
Fabian Becker <halfdan@xnorfz.de>
|
|
96
|
-
Faisal Salman <f@faisalman.com>
|
|
97
|
-
Frédéric Camblor <fcamblor@gmail.com>
|
|
98
|
-
Frederik Ring <frederik.ring@gmail.com>
|
|
99
|
-
Gerald Host <me@jacobford.co.uk>
|
|
100
|
-
Germán M. Bravo <german.mb@gmail.com>
|
|
101
|
-
Grigory Dmitrenko <grigory@snsk.ru>
|
|
102
|
-
gulpin <gulping.gulpin@gmail.com>
|
|
103
|
-
Hendrik Helwich <h.helwich@iplabs.de>
|
|
104
|
-
Hermann Ebert <ebbmo@HE.local>
|
|
105
|
-
hr6r <hedian@gmail.com>
|
|
106
|
-
Igor Topal <i.topal@smartweb.com.ua>
|
|
107
|
-
Ildar Kamalov <i.kamalov@adguard.com>
|
|
108
|
-
insanehong <insane.hong@navercorp.com>
|
|
109
|
-
jackpoll <jackpoll123456@gmail.com>
|
|
110
|
-
Jake Mc <startswithaj@users.noreply.github.com>
|
|
111
|
-
JBYoshi <12983479+JBYoshi@users.noreply.github.com>
|
|
112
|
-
Joey Parrish <joeyparrish@google.com>
|
|
113
|
-
John Tantalo <john.tantalo@gmail.com>
|
|
114
|
-
John Yanarella <jmy@codecatalyst.com>
|
|
115
|
-
Jon Buckley <jon@jbuckley.ca>
|
|
116
|
-
Josh Goldberg <joshuakgoldberg@outlook.com>
|
|
117
|
-
Junki-Ishida <junki_ishida@dwango.co.jp>
|
|
118
|
-
Kendall Buchanan <kendall@kendagriff.com>
|
|
119
|
-
Lee Treveil <leetreveil@gmail.com>
|
|
120
|
-
leonardo <leofiore@libero.it>
|
|
121
|
-
Levente Balogh <balogh.levente.hu@gmail.com>
|
|
122
|
-
Liam Quinn <lquinn@blackberry.com>
|
|
123
|
-
Lithin <lithin@webklipper.com>
|
|
124
|
-
ll-syber <670159357@qq.com>
|
|
125
|
-
Loris Guignard <loris.guignard@gmail.com>
|
|
126
|
-
Lukas Drgon <lukas.drgon@gmail.com>
|
|
127
|
-
Lukas Eipert <leipert@users.noreply.github.com>
|
|
128
|
-
Malash <i@malash.me>
|
|
129
|
-
Martynas <martynas@firmfirm.co>
|
|
130
|
-
Masahiko Sato <masasato@yahoo-corp.jp>
|
|
131
|
-
Matt Brophy <matt@brophy.org>
|
|
132
|
-
Matthew Origer <karatecowboy@gmail.com>
|
|
133
|
-
Maximilian Haupt <mail@maximilianhaupt.com>
|
|
134
|
-
Max Maurer <maxemanuel.maurer@gmail.com>
|
|
135
|
-
Max Nordlund <max.nordlund@gmail.com>
|
|
136
|
-
Michael Hess <mhess@connectify.me>
|
|
137
|
-
MimyyK <michele.marais@hakisa.com>
|
|
138
|
-
naoh <naoh.cs03g@nctu.edu.tw>
|
|
139
|
-
Nicholas Ionata <nionata@ufl.edu>
|
|
140
|
-
Nikhil Motiani <nikhil.motiani@outlook.com>
|
|
141
|
-
Nik Rolls <nik@rolls.cc>
|
|
142
|
-
nionata <n.ionata129@gmail.com>
|
|
143
|
-
niris <nirisix@gmail.com>
|
|
144
|
-
Nobuo Okada <nookada@yahoo-corp.jp>
|
|
145
|
-
o.drapeza <o.drapeza@tinkoff.ru>
|
|
146
|
-
otakuSiD <otakusid@gmail.com>
|
|
147
|
-
patrick-nurt <github@pereira.dk>
|
|
148
|
-
Pavel Studeny <studeny@avast.com>
|
|
149
|
-
Peter Dave Hello <PeterDaveHello@users.noreply.github.com>
|
|
150
|
-
philippsimon <github@philippsimon.de>
|
|
151
|
-
Pieter Hendrickx <pieter.hendrickx@belfius.be>
|
|
152
|
-
Piper Chester <piperchester@gmail.com>
|
|
153
|
-
Queen Vinyl Darkscratch <vinyldarkscratch@gmail.com>
|
|
154
|
-
Raine Makelainen <raine.makelainen@jolla.com>
|
|
155
|
-
Raman Savaryn <homeneartheocean@gmail.com>
|
|
156
|
-
Robert Tod <robert@qubit.com>
|
|
157
|
-
roman.savarin <roman.savarin@skywindgroup.com>
|
|
158
|
-
Ron Korland <ron@testim.io>
|
|
159
|
-
Ross Noble <rosshnoble@gmail.com>
|
|
160
|
-
ruicong <466403866@qq.com>
|
|
161
|
-
Sandro Sonntag <sandro.sonntag@adorsys.de>
|
|
162
|
-
sgautrea <shanegautreau@gmail.com>
|
|
163
|
-
Shane Gautreau <sgautrea@opentext.com>
|
|
164
|
-
Shane Thacker <shane@steadymade.com>
|
|
165
|
-
Shreedhar <shreedhar@uber.com>
|
|
166
|
-
Simon Eisenmann <simon@longsleep.org>
|
|
167
|
-
Simon Lang <me@simonlang.org>
|
|
168
|
-
Stiekel <histkc@gmail.com>
|
|
169
|
-
sUP <dani3l@gmail.com>
|
|
170
|
-
Sylvain Gizard <sylvain.gizard@gmail.com>
|
|
171
|
-
szchenghuang <szchenghuang@gmail.com>
|
|
172
|
-
Tanguy Krotoff <tkrotoff@gmail.com>
|
|
173
|
-
Tony Tomarchio <tony@tomarchio.cc>
|
|
174
|
-
Ulrich Schmidt <u.schmidt@velian.de>
|
|
175
|
-
Vadim Kurachevsky <vadim@hmvs.org>
|
|
176
|
-
Yılmaz <yilmazdemir36@gmail.com>
|
|
177
|
-
yuanyang <work_yuanyang@163.com>
|
|
178
|
-
Yun Young-jin <yupmin@yupmin-office-macmini.local>
|
|
179
|
-
Zach Bjornson <zbbjornson@gmail.com>
|
|
180
|
-
License Copyright:
|
|
181
|
-
===
|
|
182
|
-
|
|
183
|
-
MIT License
|
|
184
|
-
|
|
185
|
-
Copyright (c) 2012-2021 Faisal Salman <<f@faisalman.com>>
|
|
186
|
-
|
|
187
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
188
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
189
|
-
in the Software without restriction, including without limitation the rights
|
|
190
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
191
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
192
|
-
furnished to do so, subject to the following conditions:
|
|
193
|
-
|
|
194
|
-
The above copyright notice and this permission notice shall be included in all
|
|
195
|
-
copies or substantial portions of the Software.
|
|
196
|
-
|
|
197
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
198
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
199
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
200
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
201
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
202
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
203
|
-
SOFTWARE.
|
|
204
|
-
|
|
205
|
-
---
|
|
206
|
-
|
|
207
|
-
Name: @amplitude/experiment-js-client
|
|
208
|
-
Version: 1.15.5
|
|
209
|
-
License: MIT
|
|
210
|
-
Private: false
|
|
211
|
-
Description: Amplitude Experiment Javascript Client SDK
|
|
212
|
-
Repository: https://github.com/amplitude/experiment-js-client.git
|
|
213
|
-
Homepage: https://github.com/amplitude/experiment-js-client
|
|
214
|
-
Author: Amplitude
|
|
215
|
-
|
|
216
|
-
---
|
|
217
|
-
|
|
218
|
-
Name: dom-mutator
|
|
219
|
-
Version: 0.7.1
|
|
220
|
-
License: MIT
|
|
221
|
-
Private: false
|
|
222
|
-
Author: Jeremy Dorn
|
|
223
|
-
License Copyright:
|
|
224
|
-
===
|
|
225
|
-
|
|
226
|
-
MIT License
|
|
227
|
-
|
|
228
|
-
Copyright (c) 2021 Jeremy Dorn
|
|
229
|
-
|
|
230
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
231
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
232
|
-
in the Software without restriction, including without limitation the rights
|
|
233
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
234
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
235
|
-
furnished to do so, subject to the following conditions:
|
|
236
|
-
|
|
237
|
-
The above copyright notice and this permission notice shall be included in all
|
|
238
|
-
copies or substantial portions of the Software.
|
|
239
|
-
|
|
240
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
241
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
242
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
243
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
244
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
245
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
246
|
-
SOFTWARE.
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
/* @amplitude/experiment-tag v0.5.5 - For license info see https://unpkg.com/@amplitude/experiment-tag@0.5.5/LICENSES */
|
|
2
|
-
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(require("url"),require("events"),require("https"),require("http"),require("util")):"function"==typeof define&&define.amd?define(["url","events","https","http","util"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).require$$0,t.events,t.https,t.http,t.util)}(this,(function(t,e,r,i,n){"use strict";function o(t){return t&&"object"==typeof t&&"default"in t?t:{default:t}}var a=o(t),s=o(e),l=o(r),u=o(i),c=o(n),h=function(){return h=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},h.apply(this,arguments)};function f(t,e,r,i){return new(r||(r=Promise))((function(n,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))}function d(t,e){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(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,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=e.call(t,a)}catch(t){s=[6,t],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function p(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function v(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}function y(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var m=function(){function t(){}return t.prototype.getApplicationContext=function(){return{versionName:this.versionName,language:g(),platform:"Web",os:void 0,deviceModel:void 0}},t}(),g=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},b=function(){function t(){this.queue=[]}return t.prototype.logEvent=function(t){this.receiver?this.receiver(t):this.queue.length<512&&this.queue.push(t)},t.prototype.setEventReceiver=function(t){this.receiver=t,this.queue.length>0&&(this.queue.forEach((function(e){t(e)})),this.queue=[])},t}(),w=function(){return w=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},w.apply(this,arguments)};function S(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function x(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}"function"==typeof SuppressedError&&SuppressedError;var k=function(t,e){var r,i,n=typeof t;if(n!==typeof e)return!1;try{for(var o=S(["string","number","boolean","undefined"]),a=o.next();!a.done;a=o.next()){if(a.value===n)return t===e}}catch(t){r={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}if(null==t&&null==e)return!0;if(null==t||null==e)return!1;if(t.length!==e.length)return!1;var s=Array.isArray(t),l=Array.isArray(e);if(s!==l)return!1;if(!s||!l){var u=Object.keys(t).sort(),c=Object.keys(e).sort();if(!k(u,c))return!1;var h=!0;return Object.keys(t).forEach((function(r){k(t[r],e[r])||(h=!1)})),h}for(var f=0;f<t.length;f++)if(!k(t[f],e[f]))return!1;return!0};Object.entries||(Object.entries=function(t){for(var e=Object.keys(t),r=e.length,i=new Array(r);r--;)i[r]=[e[r],t[e[r]]];return i});var E=function(){function t(){this.identity={userProperties:{}},this.listeners=new Set}return t.prototype.editIdentity=function(){var t=this,e=w({},this.identity.userProperties),r=w(w({},this.identity),{userProperties:e});return{setUserId:function(t){return r.userId=t,this},setDeviceId:function(t){return r.deviceId=t,this},setUserProperties:function(t){return r.userProperties=t,this},setOptOut:function(t){return r.optOut=t,this},updateUserProperties:function(t){var e,i,n,o,a,s,l=r.userProperties||{};try{for(var u=S(Object.entries(t)),c=u.next();!c.done;c=u.next()){var h=x(c.value,2),f=h[0],d=h[1];switch(f){case"$set":try{for(var p=(n=void 0,S(Object.entries(d))),v=p.next();!v.done;v=p.next()){var y=x(v.value,2),m=y[0],g=y[1];l[m]=g}}catch(t){n={error:t}}finally{try{v&&!v.done&&(o=p.return)&&o.call(p)}finally{if(n)throw n.error}}break;case"$unset":try{for(var b=(a=void 0,S(Object.keys(d))),w=b.next();!w.done;w=b.next()){delete l[m=w.value]}}catch(t){a={error:t}}finally{try{w&&!w.done&&(s=b.return)&&s.call(b)}finally{if(a)throw a.error}}break;case"$clearAll":l={}}}}catch(t){e={error:t}}finally{try{c&&!c.done&&(i=u.return)&&i.call(u)}finally{if(e)throw e.error}}return r.userProperties=l,this},commit:function(){return t.setIdentity(r),this}}},t.prototype.getIdentity=function(){return w({},this.identity)},t.prototype.setIdentity=function(t){var e=w({},this.identity);this.identity=w({},t),k(e,this.identity)||this.listeners.forEach((function(e){e(t)}))},t.prototype.addIdentityListener=function(t){this.listeners.add(t)},t.prototype.removeIdentityListener=function(t){this.listeners.delete(t)},t}(),I="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:self,C=function(){function t(){this.identityStore=new E,this.eventBridge=new b,this.applicationContextProvider=new m}return t.getInstance=function(e){return I.analyticsConnectorInstances||(I.analyticsConnectorInstances={}),I.analyticsConnectorInstances[e]||(I.analyticsConnectorInstances[e]=new t),I.analyticsConnectorInstances[e]},t}(),T=function(t,e){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},T(t,e)};function P(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}T(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}var O=function(){return O=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},O.apply(this,arguments)};function A(t,e,r,i){return new(r||(r=Promise))((function(n,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))}function M(t,e){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(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,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=e.call(t,a)}catch(t){s=[6,t],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function _(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function N(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}function U(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var V="is",R="is not",j="contains",L="does not contain",F="less",K="less or equal",D="greater",q="greater or equal",B="version less",z="version less or equal",J="version greater",W="version greater or equal",H="set is",Q="set is not",$="set contains",X="set does not contain",G="set contains any",Z="set does not contain any",Y="regex match",tt="regex does not match",et=-862048943,rt=461845907,it=function(t,e){void 0===e&&(e=0);for(var r=function(t){for(var e=[],r=0,i=0;i<t.length;i++){var n=t.charCodeAt(i);n<128?e[r++]=n:n<2048?(e[r++]=n>>6|192,e[r++]=63&n|128):55296==(64512&n)&&i+1<t.length&&56320==(64512&t.charCodeAt(i+1))?(n=65536+((1023&n)<<10)+(1023&t.charCodeAt(++i)),e[r++]=n>>18|240,e[r++]=n>>12&63|128,e[r++]=n>>6&63|128,e[r++]=63&n|128):(e[r++]=n>>12|224,e[r++]=n>>6&63|128,e[r++]=63&n|128)}return Uint8Array.from(e)}(t),i=r.length,n=i>>2,o=e,a=0;a<n;a++){var s=st(r,a<<2);o=nt(s,o)}var l=n<<2,u=0;switch(i-l){case 3:u^=r[l+2]<<16,u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,et),u=at(u,15),o^=u=Math.imul(u,rt);break;case 2:u^=r[l+1]<<8,u^=r[l],u=Math.imul(u,et),u=at(u,15),o^=u=Math.imul(u,rt);break;case 1:u^=r[l],u=Math.imul(u,et),u=at(u,15),o^=u=Math.imul(u,rt)}return ot(o^=i)>>>0},nt=function(t,e){var r=t,i=e;return r=Math.imul(r,et),r=at(r,15),r=Math.imul(r,rt),i=at(i^=r,13),(i=Math.imul(i,5))+-430675100|0},ot=function(t){var e=t;return e^=e>>>16,e=Math.imul(e,-2048144789),e^=e>>>13,e=Math.imul(e,-1028477387),e^=e>>>16},at=function(t,e,r){return void 0===r&&(r=32),e>r&&(e%=r),(t<<e|(t&4294967295<<r-e>>>0)>>>0>>>r-e>>>0)>>>0},st=function(t,e){void 0===e&&(e=0);var r=t[e]<<24|t[e+1]<<16|t[e+2]<<8|t[e+3];return lt(r)},lt=function(t){return(-16777216&t)>>>24|(16711680&t)>>>8|(65280&t)<<8|(255&t)<<24},ut=function(t,e){var r,i;if(e&&0!==e.length){try{for(var n=_(e),o=n.next();!o.done;o=n.next()){var a=o.value;if(!a||!t||"object"!=typeof t)return;t=t[a]}}catch(t){r={error:t}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return t||void 0}},ct="^".concat("(\\d+)\\.(\\d+)","(\\.").concat("(\\d+)").concat("(-(([-\\w]+\\.?)*))?",")?$"),ht=function(){function t(t,e,r,i){void 0===i&&(i=void 0),this.major=t,this.minor=e,this.patch=r,this.preRelease=i}return t.parse=function(e){if(e){var r=new RegExp(ct).exec(e);if(r){var i=Number(r[1]),n=Number(r[2]);if(!isNaN(i)&&!isNaN(n))return new t(i,n,Number(r[4])||0,r[5]||void 0)}}},t.prototype.compareTo=function(t){return this.major>t.major?1:this.major<t.major?-1:this.minor>t.minor?1:this.minor<t.minor?-1:this.patch>t.patch?1:this.patch<t.patch||this.preRelease&&!t.preRelease?-1:!this.preRelease&&t.preRelease?1:this.preRelease&&t.preRelease?this.preRelease>t.preRelease?1:this.preRelease<t.preRelease?-1:0:0},t}(),ft=function(){function t(){}return t.prototype.evaluate=function(t,e){var r,i,n={},o={context:t,result:n};try{for(var a=_(e),s=a.next();!s.done;s=a.next()){var l=s.value,u=this.evaluateFlag(o,l);u&&(n[l.key]=u)}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return n},t.prototype.evaluateFlag=function(t,e){var r,i,n;try{for(var o=_(e.segments),a=o.next();!a.done;a=o.next()){var s=a.value;if(n=this.evaluateSegment(t,e,s)){var l=O(O(O({},e.metadata),s.metadata),n.metadata);n=O(O({},n),{metadata:l});break}}}catch(t){r={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return n},t.prototype.evaluateSegment=function(t,e,r){var i;return r.conditions?this.evaluateConditions(t,r.conditions)&&void 0!==(i=this.bucket(t,r))?e.variants[i]:void 0:void 0!==(i=this.bucket(t,r))?e.variants[i]:void 0},t.prototype.evaluateConditions=function(t,e){var r,i,n,o;try{for(var a=_(e),s=a.next();!s.done;s=a.next()){var l=s.value,u=!0;try{for(var c=(n=void 0,_(l)),h=c.next();!h.done;h=c.next()){var f=h.value;if(!(u=this.matchCondition(t,f)))break}}catch(t){n={error:t}}finally{try{h&&!h.done&&(o=c.return)&&o.call(c)}finally{if(n)throw n.error}}if(u)return!0}}catch(t){r={error:t}}finally{try{s&&!s.done&&(i=a.return)&&i.call(a)}finally{if(r)throw r.error}}return!1},t.prototype.matchCondition=function(t,e){var r=ut(t,e.selector);if(r){if(this.isSetOperator(e.op)){var i=this.coerceStringArray(r);return!!i&&this.matchSet(i,e.op,e.values)}var n=this.coerceString(r);return void 0!==n&&this.matchString(n,e.op,e.values)}return this.matchNull(e.op,e.values)},t.prototype.getHash=function(t){return it(t)},t.prototype.bucket=function(t,e){var r,i,n,o;if(!e.bucket)return e.variant;var a=this.coerceString(ut(t,e.bucket.selector));if(!a||0===a.length)return e.variant;var s="".concat(e.bucket.salt,"/").concat(a),l=this.getHash(s),u=l%100,c=Math.floor(l/100);try{for(var h=_(e.bucket.allocations),f=h.next();!f.done;f=h.next()){var d=f.value,p=d.range[0],v=d.range[1];if(u>=p&&u<v)try{for(var y=(n=void 0,_(d.distributions)),m=y.next();!m.done;m=y.next()){var g=m.value,b=g.range[0],w=g.range[1];if(c>=b&&c<w)return g.variant}}catch(t){n={error:t}}finally{try{m&&!m.done&&(o=y.return)&&o.call(y)}finally{if(n)throw n.error}}}}catch(t){r={error:t}}finally{try{f&&!f.done&&(i=h.return)&&i.call(h)}finally{if(r)throw r.error}}return e.variant},t.prototype.matchNull=function(t,e){var r=this.containsNone(e);switch(t){case V:case j:case F:case K:case D:case q:case B:case z:case J:case W:case H:case $:case G:return r;case R:case L:case X:case Z:return!r;default:return!1}},t.prototype.matchSet=function(t,e,r){switch(e){case H:return this.setEquals(t,r);case Q:return!this.setEquals(t,r);case $:return this.matchesSetContainsAll(t,r);case X:return!this.matchesSetContainsAll(t,r);case G:return this.matchesSetContainsAny(t,r);case Z:return!this.matchesSetContainsAny(t,r);default:return!1}},t.prototype.matchString=function(t,e,r){var i=this;switch(e){case V:return this.matchesIs(t,r);case R:return!this.matchesIs(t,r);case j:return this.matchesContains(t,r);case L:return!this.matchesContains(t,r);case F:case K:case D:case q:return this.matchesComparable(t,e,r,(function(t){return i.parseNumber(t)}),this.comparator);case B:case z:case J:case W:return this.matchesComparable(t,e,r,(function(t){return ht.parse(t)}),this.versionComparator);case Y:return this.matchesRegex(t,r);case tt:return!this.matchesRegex(t,r);default:return!1}},t.prototype.matchesIs=function(t,e){if(this.containsBooleans(e)){var r=t.toLowerCase();if("true"===r||"false"===r)return e.some((function(t){return t.toLowerCase()===r}))}return e.some((function(e){return t===e}))},t.prototype.matchesContains=function(t,e){var r,i;try{for(var n=_(e),o=n.next();!o.done;o=n.next()){var a=o.value;if(t.toLowerCase().includes(a.toLowerCase()))return!0}}catch(t){r={error:t}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return!1},t.prototype.matchesComparable=function(t,e,r,i,n){var o=this,a=i(t),s=r.map((function(t){return i(t)})).filter((function(t){return void 0!==t}));return void 0===a||0===s.length?r.some((function(r){return o.comparator(t,e,r)})):s.some((function(t){return n(a,e,t)}))},t.prototype.comparator=function(t,e,r){switch(e){case F:case B:return t<r;case K:case z:return t<=r;case D:case J:return t>r;case q:case W:return t>=r;default:return!1}},t.prototype.versionComparator=function(t,e,r){var i=t.compareTo(r);switch(e){case F:case B:return i<0;case K:case z:return i<=0;case D:case J:return i>0;case q:case W:return i>=0;default:return!1}},t.prototype.matchesRegex=function(t,e){return e.some((function(e){return Boolean(new RegExp(e).exec(t))}))},t.prototype.containsNone=function(t){return t.some((function(t){return"(none)"===t}))},t.prototype.containsBooleans=function(t){return t.some((function(t){switch(t.toLowerCase()){case"true":case"false":return!0;default:return!1}}))},t.prototype.parseNumber=function(t){var e;return null!==(e=Number(t))&&void 0!==e?e:void 0},t.prototype.coerceString=function(t){if(null!=t)return"object"==typeof t?JSON.stringify(t):String(t)},t.prototype.coerceStringArray=function(t){var e=this;if(Array.isArray(t))return t.map((function(t){return e.coerceString(t)})).filter(Boolean);var r=String(t);try{var i=JSON.parse(r);return Array.isArray(i)?t.map((function(t){return e.coerceString(t)})).filter(Boolean):(n=this.coerceString(r))?[n]:void 0}catch(t){var n;return(n=this.coerceString(r))?[n]:void 0}},t.prototype.isSetOperator=function(t){switch(t){case H:case Q:case $:case X:case G:case Z:return!0;default:return!1}},t.prototype.setEquals=function(t,e){var r=new Set(t),i=new Set(e);return r.size===i.size&&U([],N(i),!1).every((function(t){return r.has(t)}))},t.prototype.matchesSetContainsAll=function(t,e){var r,i;if(t.length<e.length)return!1;try{for(var n=_(e),o=n.next();!o.done;o=n.next()){var a=o.value;if(!this.matchesIs(a,t))return!1}}catch(t){r={error:t}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return!0},t.prototype.matchesSetContainsAny=function(t,e){var r,i;try{for(var n=_(e),o=n.next();!o.done;o=n.next()){var a=o.value;if(this.matchesIs(a,t))return!0}}catch(t){r={error:t}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}return!1},t}(),dt=function(t,e,r){var i,n;void 0===r&&(r=[]);var o=e[t];if(o){if(!o.dependencies||0===o.dependencies.length)return delete e[o.key],[o];r.push(o.key);var a=[],s=function(t){if(r.some((function(e){return e===t})))throw Error("Detected a cycle between flags ".concat(r));var i=dt(t,e,r);i&&a.push.apply(a,U([],N(i),!1))};try{for(var l=_(o.dependencies),u=l.next();!u.done;u=l.next()){s(u.value)}}catch(t){i={error:t}}finally{try{u&&!u.done&&(n=l.return)&&n.call(l)}finally{if(i)throw i.error}}return a.push(o),r.pop(),delete e[o.key],a}};const pt="function"==typeof btoa,vt="function"==typeof Buffer,yt=("function"==typeof TextDecoder&&new TextDecoder,"function"==typeof TextEncoder?new TextEncoder:void 0),mt=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),gt=((t=>{let e={};t.forEach(((t,r)=>e[t]=r))})(mt),String.fromCharCode.bind(String)),bt=("function"==typeof Uint8Array.from&&Uint8Array.from.bind(Uint8Array),t=>t.replace(/=/g,"").replace(/[+\/]/g,(t=>"+"==t?"-":"_"))),wt=t=>{let e,r,i,n,o="";const a=t.length%3;for(let a=0;a<t.length;){if((r=t.charCodeAt(a++))>255||(i=t.charCodeAt(a++))>255||(n=t.charCodeAt(a++))>255)throw new TypeError("invalid character found");e=r<<16|i<<8|n,o+=mt[e>>18&63]+mt[e>>12&63]+mt[e>>6&63]+mt[63&e]}return a?o.slice(0,a-3)+"===".substring(a):o},St=pt?t=>btoa(t):vt?t=>Buffer.from(t,"binary").toString("base64"):wt,xt=vt?t=>Buffer.from(t).toString("base64"):t=>{let e=[];for(let r=0,i=t.length;r<i;r+=4096)e.push(gt.apply(null,t.subarray(r,r+4096)));return St(e.join(""))},kt=t=>{if(t.length<2)return(e=t.charCodeAt(0))<128?t:e<2048?gt(192|e>>>6)+gt(128|63&e):gt(224|e>>>12&15)+gt(128|e>>>6&63)+gt(128|63&e);var e=65536+1024*(t.charCodeAt(0)-55296)+(t.charCodeAt(1)-56320);return gt(240|e>>>18&7)+gt(128|e>>>12&63)+gt(128|e>>>6&63)+gt(128|63&e)},Et=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,It=t=>t.replace(Et,kt),Ct=vt?t=>Buffer.from(t,"utf8").toString("base64"):yt?t=>xt(yt.encode(t)):t=>St(It(t)),Tt=(t,e=!1)=>e?bt(Ct(t)):Ct(t),Pt=t=>Tt(t,!0),Ot=Pt;var At=function(t){function e(r,i){var n=t.call(this,i)||this;return n.statusCode=r,Object.setPrototypeOf(n,e.prototype),n}return P(e,t),e}(Error),Mt=function(t){function e(r){var i=t.call(this,r)||this;return Object.setPrototypeOf(i,e.prototype),i}return P(e,t),e}(Error),_t=function(){function t(t,e,r){this.deploymentKey=t,this.serverUrl=e,this.httpClient=r}return t.prototype.getVariants=function(t,e){return A(this,void 0,void 0,(function(){var r,i,n,o;return M(this,(function(a){switch(a.label){case 0:return r=Ot(JSON.stringify(t)),i={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":r},(null==e?void 0:e.flagKeys)&&(i["X-Amp-Exp-Flag-Keys"]=Ot(JSON.stringify(e.flagKeys))),(null==e?void 0:e.trackingOption)&&(i["X-Amp-Exp-Track"]=e.trackingOption),n=new URL("".concat(this.serverUrl,"/sdk/v2/vardata?v=0")),(null==e?void 0:e.evaluationMode)&&n.searchParams.append("eval_mode",null==e?void 0:e.evaluationMode),(null==e?void 0:e.deliveryMethod)&&n.searchParams.append("delivery_method",null==e?void 0:e.deliveryMethod),[4,this.httpClient.request({requestUrl:n.toString(),method:"GET",headers:i,timeoutMillis:null==e?void 0:e.timeoutMillis})];case 1:if(200!=(o=a.sent()).status)throw new At(o.status,"Fetch error response: status=".concat(o.status));return[2,JSON.parse(o.body)]}}))}))},t}(),Nt=function(){function t(t,e,r){this.deploymentKey=t,this.serverUrl=e,this.httpClient=r}return t.prototype.getFlags=function(t){return A(this,void 0,void 0,(function(){var e,r;return M(this,(function(i){switch(i.label){case 0:return e={Authorization:"Api-Key ".concat(this.deploymentKey)},(null==t?void 0:t.libraryName)&&(null==t?void 0:t.libraryVersion)&&(e["X-Amp-Exp-Library"]="".concat(t.libraryName,"/").concat(t.libraryVersion)),(null==t?void 0:t.user)&&(e["X-Amp-Exp-User"]=Ot(JSON.stringify(t.user))),[4,this.httpClient.request({requestUrl:"".concat(this.serverUrl,"/sdk/v2/flags")+((null==t?void 0:t.deliveryMethod)?"?delivery_method=".concat(t.deliveryMethod):""),method:"GET",headers:e,timeoutMillis:null==t?void 0:t.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(t,e){return t[e.key]=e,t}),{})]}}))}))},t}(),Ut="message",Vt=function(){function t(t,e,r,i,n){void 0===i&&(i=33e3),void 0===n&&(n=18e5),this.onEventTypeUpdate={},this.streamProvider=t,this.url=e,this.headers=r,this.keepAliveInterval=i,this.reconnectionIntervalMillisMin=Math.floor(.9*n),this.reconnectionIntervalMillisRange=Math.ceil(1.1*n)-this.reconnectionIntervalMillisMin}return t.prototype.connect=function(t,e){var r,i=this;"function"==typeof t?this.onEventTypeUpdate=((r={})[Ut]=t,r):(this.onEventTypeUpdate=t,Ut in this.onEventTypeUpdate||(this.onEventTypeUpdate[Ut]=function(){})),this.onError=e,this.es&&this.close(),this.es=this.streamProvider(this.url,{headers:this.headers});var n=function(t){o.es.addEventListener(t,(function(e){i.resetKeepAlive();var r=e;if(" "!==r.data)try{i.onEventTypeUpdate[t](r.data)}catch(t){}}))},o=this;for(var a in this.onEventTypeUpdate)n(a);this.es.addEventListener("error",(function(t){var e;i.close();var r=t,n=r.status?new At(r.status,r.message):new Error("Error in stream: ".concat(JSON.stringify(r)));try{null===(e=i.onError)||void 0===e||e.call(i,n)}catch(t){}})),this.resetKeepAlive(),this.setReconnectionTimeout()},t.prototype.resetKeepAlive=function(){var t=this;this.keepAliveTimer&&(clearTimeout(this.keepAliveTimer),this.keepAliveTimer=void 0),this.es&&(this.keepAliveTimer=setTimeout((function(){var e;t.close(),null===(e=t.onError)||void 0===e||e.call(t,Error("Keep-alive timeout"))}),1.1*this.keepAliveInterval))},t.prototype.setReconnectionTimeout=function(){var t=this;this.reconnectionTimeout&&(clearTimeout(this.reconnectionTimeout),this.reconnectionTimeout=void 0),this.es&&this.reconnectionIntervalMillisMin>0&&this.reconnectionIntervalMillisRange>0&&(this.reconnectionTimeout=setTimeout((function(){t.connect(t.onEventTypeUpdate,t.onError)}),Math.ceil(Math.random()*this.reconnectionIntervalMillisRange+this.reconnectionIntervalMillisMin)))},t.prototype.close=function(){var t;this.keepAliveTimer&&(clearTimeout(this.keepAliveTimer),this.keepAliveTimer=void 0),this.reconnectionTimeout&&(clearTimeout(this.reconnectionTimeout),this.reconnectionTimeout=void 0),null===(t=this.es)||void 0===t||t.close(),this.es=void 0},t}(),Rt=function(){function t(t,e,r,i,n){void 0===i&&(i=3e3),this.deploymentKey=t,this.serverUrl=e,this.sseProvider=r,this.connectionTimeoutMillis=i,this.fetchEvalApi=n}return t.prototype.streamVariants=function(t,e,r,i){return A(this,void 0,void 0,(function(){var n,o,a,s=this;return M(this,(function(l){switch(l.label){case 0:return this.stream?[4,this.close()]:[3,2];case 1:l.sent(),l.label=2;case 2:return n=Ot(JSON.stringify(t)),o={Authorization:"Api-Key ".concat(this.deploymentKey),"X-Amp-Exp-User":n},(null==e?void 0:e.flagKeys)&&(o["X-Amp-Exp-Flag-Keys"]=Ot(JSON.stringify(e.flagKeys))),(null==e?void 0:e.trackingOption)&&(o["X-Amp-Exp-Track"]=e.trackingOption),a=new URL("".concat(this.serverUrl,"/sdk/stream/v1/vardata")),(null==e?void 0:e.evaluationMode)&&a.searchParams.append("eval_mode",null==e?void 0:e.evaluationMode),(null==e?void 0:e.deliveryMethod)&&a.searchParams.append("delivery_method",null==e?void 0:e.deliveryMethod),[2,new Promise((function(t,e){var n;s.stream=new Vt(s.sseProvider,a.toString(),o);var l=!0,u=setTimeout((function(){l&&(s.close(),e(new Error("Connection timed out.")))}),s.connectionTimeoutMillis),c=function(t){l?(l=!1,s.close(),clearTimeout(u),e(t)):(s.close(),null==i||i(t))},h=function(e){var i;try{i=JSON.parse(e)}catch(t){return void c(new Error("Error parsing variant data: "+t))}l&&(l=!1,clearTimeout(u),t()),null==r||r(i)};s.stream.connect(((n={push_data:h})[Ut]=h,n),c)}))]}}))}))},t.prototype.close=function(){var t;return A(this,void 0,void 0,(function(){return M(this,(function(e){return null===(t=this.stream)||void 0===t||t.close(),this.stream=void 0,[2]}))}))},t}(),jt="undefined"!=typeof globalThis?globalThis:global||self,Lt=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof self?self:"undefined"!=typeof global?global:void 0},Ft=function(){var t=Lt();if(t)try{var e="EXP_test";return t.localStorage.setItem(e,e),t.localStorage.removeItem(e),!0}catch(t){return!1}return!1},Kt=function(){function t(t,e){this.poller=void 0,this.action=t,this.ms=e}return t.prototype.start=function(){this.poller||(this.poller=jt.setInterval(this.action,this.ms),this.action())},t.prototype.stop=function(){this.poller&&(jt.clearInterval(this.poller),this.poller=void 0)},t}(),Dt="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var qt=function(t,e,r){return t(r={path:e,exports:{},require:function(t,e){return function(){throw new Error("Dynamic requires are not currently supported by @rollup/plugin-commonjs")}(null==e&&r.path)}},r.exports),r.exports}((function(t,e){!function(r,i){var n="function",o="undefined",a="object",s="string",l="model",u="name",c="type",h="vendor",f="version",d="architecture",p="console",v="mobile",y="tablet",m="smarttv",g="wearable",b="embedded",w="Amazon",S="Apple",x="ASUS",k="BlackBerry",E="Browser",I="Chrome",C="Firefox",T="Google",P="Huawei",O="LG",A="Microsoft",M="Motorola",_="Opera",N="Samsung",U="Sharp",V="Sony",R="Xiaomi",j="Zebra",L="Facebook",F=function(t){for(var e={},r=0;r<t.length;r++)e[t[r].toUpperCase()]=t[r];return e},K=function(t,e){return typeof t===s&&-1!==D(e).indexOf(D(t))},D=function(t){return t.toLowerCase()},q=function(t,e){if(typeof t===s)return t=t.replace(/^\s\s*/,""),typeof e===o?t:t.substring(0,350)},B=function(t,e){for(var r,o,s,l,u,c,h=0;h<e.length&&!u;){var f=e[h],d=e[h+1];for(r=o=0;r<f.length&&!u;)if(u=f[r++].exec(t))for(s=0;s<d.length;s++)c=u[++o],typeof(l=d[s])===a&&l.length>0?2===l.length?typeof l[1]==n?this[l[0]]=l[1].call(this,c):this[l[0]]=l[1]:3===l.length?typeof l[1]!==n||l[1].exec&&l[1].test?this[l[0]]=c?c.replace(l[1],l[2]):i:this[l[0]]=c?l[1].call(this,c,l[2]):i:4===l.length&&(this[l[0]]=c?l[3].call(this,c.replace(l[1],l[2])):i):this[l]=c||i;h+=2}},z=function(t,e){for(var r in e)if(typeof e[r]===a&&e[r].length>0){for(var n=0;n<e[r].length;n++)if(K(e[r][n],t))return"?"===r?i:r}else if(K(e[r],t))return"?"===r?i:r;return t},J={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"},W={browser:[[/\b(?:crmo|crios)\/([\w\.]+)/i],[f,[u,"Chrome"]],[/edg(?:e|ios|a)?\/([\w\.]+)/i],[f,[u,"Edge"]],[/(opera mini)\/([-\w\.]+)/i,/(opera [mobiletab]{3,6})\b.+version\/([-\w\.]+)/i,/(opera)(?:.+version\/|[\/ ]+)([\w\.]+)/i],[u,f],[/opios[\/ ]+([\w\.]+)/i],[f,[u,_+" Mini"]],[/\bopr\/([\w\.]+)/i],[f,[u,_]],[/(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|duckduckgo)\/([-\w\.]+)/i,/(weibo)__([\d\.]+)/i],[u,f],[/(?:\buc? ?browser|(?:juc.+)ucweb)[\/ ]?([\w\.]+)/i],[f,[u,"UC"+E]],[/microm.+\bqbcore\/([\w\.]+)/i,/\bqbcore\/([\w\.]+).+microm/i],[f,[u,"WeChat(Win) Desktop"]],[/micromessenger\/([\w\.]+)/i],[f,[u,"WeChat"]],[/konqueror\/([\w\.]+)/i],[f,[u,"Konqueror"]],[/trident.+rv[: ]([\w\.]{1,9})\b.+like gecko/i],[f,[u,"IE"]],[/yabrowser\/([\w\.]+)/i],[f,[u,"Yandex"]],[/(avast|avg)\/([\w\.]+)/i],[[u,/(.+)/,"$1 Secure "+E],f],[/\bfocus\/([\w\.]+)/i],[f,[u,C+" Focus"]],[/\bopt\/([\w\.]+)/i],[f,[u,_+" Touch"]],[/coc_coc\w+\/([\w\.]+)/i],[f,[u,"Coc Coc"]],[/dolfin\/([\w\.]+)/i],[f,[u,"Dolphin"]],[/coast\/([\w\.]+)/i],[f,[u,_+" Coast"]],[/miuibrowser\/([\w\.]+)/i],[f,[u,"MIUI "+E]],[/fxios\/([-\w\.]+)/i],[f,[u,C]],[/\bqihu|(qi?ho?o?|360)browser/i],[[u,"360 "+E]],[/(oculus|samsung|sailfish|huawei)browser\/([\w\.]+)/i],[[u,/(.+)/,"$1 "+E],f],[/(comodo_dragon)\/([\w\.]+)/i],[[u,/_/g," "],f],[/(electron)\/([\w\.]+) safari/i,/(tesla)(?: qtcarbrowser|\/(20\d\d\.[-\w\.]+))/i,/m?(qqbrowser|baiduboxapp|2345Explorer)[\/ ]?([\w\.]+)/i],[u,f],[/(metasr)[\/ ]?([\w\.]+)/i,/(lbbrowser)/i,/\[(linkedin)app\]/i],[u],[/((?:fban\/fbios|fb_iab\/fb4a)(?!.+fbav)|;fbav\/([\w\.]+);)/i],[[u,L],f],[/safari (line)\/([\w\.]+)/i,/\b(line)\/([\w\.]+)\/iab/i,/(chromium|instagram)[\/ ]([-\w\.]+)/i],[u,f],[/\bgsa\/([\w\.]+) .*safari\//i],[f,[u,"GSA"]],[/headlesschrome(?:\/([\w\.]+)| )/i],[f,[u,I+" Headless"]],[/ wv\).+(chrome)\/([\w\.]+)/i],[[u,I+" WebView"],f],[/droid.+ version\/([\w\.]+)\b.+(?:mobile safari|safari)/i],[f,[u,"Android "+E]],[/(chrome|omniweb|arora|[tizenoka]{5} ?browser)\/v?([\w\.]+)/i],[u,f],[/version\/([\w\.\,]+) .*mobile\/\w+ (safari)/i],[f,[u,"Mobile Safari"]],[/version\/([\w(\.|\,)]+) .*(mobile ?safari|safari)/i],[f,u],[/webkit.+?(mobile ?safari|safari)(\/[\w\.]+)/i],[u,[f,z,{"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],[u,f],[/(navigator|netscape\d?)\/([-\w\.]+)/i],[[u,"Netscape"],f],[/mobile vr; rv:([\w\.]+)\).+firefox/i],[f,[u,C+" 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],[u,f],[/(cobalt)\/([\w\.]+)/i],[u,[f,/master.|lts./,""]]],cpu:[[/(?:(amd|x(?:(?:86|64)[-_])?|wow|win)64)[;\)]/i],[[d,"amd64"]],[/(ia32(?=;))/i],[[d,D]],[/((?: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/,"",D]],[/(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,D]]],device:[[/\b(sch-i[89]0\d|shw-m380s|sm-[ptx]\w{2,4}|gt-[pn]\d{2,4}|sgh-t8[56]9|nexus 10)/i],[l,[h,N],[c,y]],[/\b((?:s[cgp]h|gt|sm)-\w+|galaxy nexus)/i,/samsung[- ]([-\w]+)/i,/sec-(sgh\w+)/i],[l,[h,N],[c,v]],[/((ipod|iphone)\d+,\d+)/i],[l,[h,S],[c,v]],[/(ipad\d+,\d+)/i],[l,[h,S],[c,y]],[/\((ip(?:hone|od)[\w ]*);/i],[l,[h,S],[c,v]],[/\((ipad);[-\w\),; ]+apple/i,/applecoremedia\/[\w\.]+ \((ipad)/i,/\b(ipad)\d\d?,\d\d?[;\]].+ios/i],[l,[h,S],[c,y]],[/(macintosh);/i],[l,[h,S]],[/\b((?:ag[rs][23]?|bah2?|sht?|btv)-a?[lw]\d{2})\b(?!.+d\/s)/i],[l,[h,P],[c,y]],[/(?:huawei|honor)([-\w ]+)[;\)]/i,/\b(nexus 6p|\w{2,4}e?-[atu]?[ln][\dx][012359c][adn]?)\b(?!.+d\/s)/i],[l,[h,P],[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],[[l,/_/g," "],[h,R],[c,v]],[/\b(mi[-_ ]?(?:pad)(?:[\w_ ]+))(?: bui|\))/i],[[l,/_/g," "],[h,R],[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],[l,[h,"OPPO"],[c,v]],[/vivo (\w+)(?: bui|\))/i,/\b(v[12]\d{3}\w?[at])(?: bui|;)/i],[l,[h,"Vivo"],[c,v]],[/\b(rmx[12]\d{3})(?: bui|;|\))/i],[l,[h,"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],[l,[h,M],[c,v]],[/\b(mz60\d|xoom[2 ]{0,2}) build\//i],[l,[h,M],[c,y]],[/((?=lg)?[vl]k\-?\d{3}) bui| 3\.[-\w; ]{10}lg?-([06cv9]{3,4})/i],[l,[h,O],[c,y]],[/(lm(?:-?f100[nv]?|-[\w\.]+)(?= bui|\))|nexus [45])/i,/\blg[-e;\/ ]+((?!browser|netcast|android tv)\w+)/i,/\blg-?([\d\w]+) bui/i],[l,[h,O],[c,v]],[/(ideatab[-\w ]+)/i,/lenovo ?(s[56]000[-\w]+|tab(?:[\w ]+)|yt[-\d\w]{6}|tb[-\d\w]{6})/i],[l,[h,"Lenovo"],[c,y]],[/(?:maemo|nokia).*(n900|lumia \d+)/i,/nokia[-_ ]?([-\w\.]*)/i],[[l,/_/g," "],[h,"Nokia"],[c,v]],[/(pixel c)\b/i],[l,[h,T],[c,y]],[/droid.+; (pixel[\daxl ]{0,6})(?: bui|\))/i],[l,[h,T],[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],[l,[h,V],[c,v]],[/sony tablet [ps]/i,/\b(?:sony)?sgp\w+(?: bui|\))/i],[[l,"Xperia Tablet"],[h,V],[c,y]],[/ (kb2005|in20[12]5|be20[12][59])\b/i,/(?:one)?(?:plus)? (a\d0\d\d)(?: b|\))/i],[l,[h,"OnePlus"],[c,v]],[/(alexa)webm/i,/(kf[a-z]{2}wi)( bui|\))/i,/(kf[a-z]+)( bui|\)).+silk\//i],[l,[h,w],[c,y]],[/((?:sd|kf)[0349hijorstuw]+)( bui|\)).+silk\//i],[[l,/(.+)/g,"Fire Phone $1"],[h,w],[c,v]],[/(playbook);[-\w\),; ]+(rim)/i],[l,h,[c,y]],[/\b((?:bb[a-f]|st[hv])100-\d)/i,/\(bb10; (\w+)/i],[l,[h,k],[c,v]],[/(?:\b|asus_)(transfo[prime ]{4,10} \w+|eeepc|slider \w+|nexus 7|padfone|p00[cj])/i],[l,[h,x],[c,y]],[/ (z[bes]6[027][012][km][ls]|zenfone \d\w?)\b/i],[l,[h,x],[c,v]],[/(nexus 9)/i],[l,[h,"HTC"],[c,y]],[/(htc)[-;_ ]{1,2}([\w ]+(?=\)| bui)|\w+)/i,/(zte)[- ]([\w ]+?)(?: bui|\/|\))/i,/(alcatel|geeksphone|nexian|panasonic|sony(?!-bra))[-_ ]?([-\w]*)/i],[h,[l,/_/g," "],[c,v]],[/droid.+; ([ab][1-7]-?[0178a]\d\d?)/i],[l,[h,"Acer"],[c,y]],[/droid.+; (m[1-5] note) bui/i,/\bmz-([-\w]{2,})/i],[l,[h,"Meizu"],[c,v]],[/\b(sh-?[altvz]?\d\d[a-ekm]?)/i],[l,[h,U],[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],[h,l,[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],[h,l,[c,y]],[/(surface duo)/i],[l,[h,A],[c,y]],[/droid [\d\.]+; (fp\du?)(?: b|\))/i],[l,[h,"Fairphone"],[c,v]],[/(u304aa)/i],[l,[h,"AT&T"],[c,v]],[/\bsie-(\w*)/i],[l,[h,"Siemens"],[c,v]],[/\b(rct\w+) b/i],[l,[h,"RCA"],[c,y]],[/\b(venue[\d ]{2,7}) b/i],[l,[h,"Dell"],[c,y]],[/\b(q(?:mv|ta)\w+) b/i],[l,[h,"Verizon"],[c,y]],[/\b(?:barnes[& ]+noble |bn[rt])([\w\+ ]*) b/i],[l,[h,"Barnes & Noble"],[c,y]],[/\b(tm\d{3}\w+) b/i],[l,[h,"NuVision"],[c,y]],[/\b(k88) b/i],[l,[h,"ZTE"],[c,y]],[/\b(nx\d{3}j) b/i],[l,[h,"ZTE"],[c,v]],[/\b(gen\d{3}) b.+49h/i],[l,[h,"Swiss"],[c,v]],[/\b(zur\d{3}) b/i],[l,[h,"Swiss"],[c,y]],[/\b((zeki)?tb.*\b) b/i],[l,[h,"Zeki"],[c,y]],[/\b([yr]\d{2}) b/i,/\b(dragon[- ]+touch |dt)(\w{5}) b/i],[[h,"Dragon Touch"],l,[c,y]],[/\b(ns-?\w{0,9}) b/i],[l,[h,"Insignia"],[c,y]],[/\b((nxa|next)-?\w{0,9}) b/i],[l,[h,"NextBook"],[c,y]],[/\b(xtreme\_)?(v(1[045]|2[015]|[3469]0|7[05])) b/i],[[h,"Voice"],l,[c,v]],[/\b(lvtel\-)?(v1[12]) b/i],[[h,"LvTel"],l,[c,v]],[/\b(ph-1) /i],[l,[h,"Essential"],[c,v]],[/\b(v(100md|700na|7011|917g).*\b) b/i],[l,[h,"Envizen"],[c,y]],[/\b(trio[-\w\. ]+) b/i],[l,[h,"MachSpeed"],[c,y]],[/\btu_(1491) b/i],[l,[h,"Rotor"],[c,y]],[/(shield[\w ]+) b/i],[l,[h,"Nvidia"],[c,y]],[/(sprint) (\w+)/i],[h,l,[c,v]],[/(kin\.[onetw]{3})/i],[[l,/\./g," "],[h,A],[c,v]],[/droid.+; (cc6666?|et5[16]|mc[239][23]x?|vc8[03]x?)\)/i],[l,[h,j],[c,y]],[/droid.+; (ec30|ps20|tc[2-8]\d[kx])\)/i],[l,[h,j],[c,v]],[/(ouya)/i,/(nintendo) ([wids3utch]+)/i],[h,l,[c,p]],[/droid.+; (shield) bui/i],[l,[h,"Nvidia"],[c,p]],[/(playstation [345portablevi]+)/i],[l,[h,V],[c,p]],[/\b(xbox(?: one)?(?!; xbox))[\); ]/i],[l,[h,A],[c,p]],[/smart-tv.+(samsung)/i],[h,[c,m]],[/hbbtv.+maple;(\d+)/i],[[l,/^/,"SmartTV"],[h,N],[c,m]],[/(nux; netcast.+smarttv|lg (netcast\.tv-201\d|android tv))/i],[[h,O],[c,m]],[/(apple) ?tv/i],[h,[l,S+" TV"],[c,m]],[/crkey/i],[[l,I+"cast"],[h,T],[c,m]],[/droid.+aft(\w)( bui|\))/i],[l,[h,w],[c,m]],[/\(dtv[\);].+(aquos)/i,/(aquos-tv[\w ]+)\)/i],[l,[h,U],[c,m]],[/(bravia[\w ]+)( bui|\))/i],[l,[h,V],[c,m]],[/(mitv-\w{5}) bui/i],[l,[h,R],[c,m]],[/\b(roku)[\dx]*[\)\/]((?:dvp-)?[\d\.]*)/i,/hbbtv\/\d+\.\d+\.\d+ +\([\w ]*; *(\w[^;]*);([^;]*)/i],[[h,q],[l,q],[c,m]],[/\b(android tv|smart[- ]?tv|opera tv|tv; rv:)\b/i],[[c,m]],[/((pebble))app/i],[h,l,[c,g]],[/droid.+; (glass) \d/i],[l,[h,T],[c,g]],[/droid.+; (wt63?0{2,3})\)/i],[l,[h,j],[c,g]],[/(quest( 2)?)/i],[l,[h,L],[c,g]],[/(tesla)(?: qtcarbrowser|\/[-\w\.]+)/i],[h,[c,b]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+? mobile safari/i],[l,[c,v]],[/droid .+?; ([^;]+?)(?: bui|\) applew).+?(?! mobile) safari/i],[l,[c,y]],[/\b((tablet|tab)[;\/]|focus\/\d(?!.+mobile))/i],[[c,y]],[/(phone|mobile(?:[;\/]| [ \w\/\.]*safari)|pda(?=.+windows ce))/i],[[c,v]],[/(android[-\w\. ]{0,9});.+buil/i],[l,[h,"Generic"]]],engine:[[/windows.+ edge\/([\w\.]+)/i],[f,[u,"EdgeHTML"]],[/webkit\/537\.36.+chrome\/(?!27)([\w\.]+)/i],[f,[u,"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],[u,f],[/rv\:([\w\.]{1,9})\b.+(gecko)/i],[f,u]],os:[[/microsoft (windows) (vista|xp)/i],[u,f],[/(windows) nt 6\.2; (arm)/i,/(windows (?:phone(?: os)?|mobile))[\/ ]?([\d\.\w ]*)/i,/(windows)[\/ ]?([ntce\d\. ]+\w)(?!.+xbox)/i],[u,[f,z,J]],[/(win(?=3|9|n)|win 9x )([nt\d\.]+)/i],[[u,"Windows"],[f,z,J]],[/ip[honead]{2,4}\b(?:.*os ([\w]+) like mac|; opera)/i,/cfnetwork\/.+darwin/i],[[f,/_/g,"."],[u,"iOS"]],[/(mac os x) ?([\w\. ]*)/i,/(macintosh|mac_powerpc\b)(?!.+haiku)/i],[[u,"Mac OS"],[f,/_/g,"."]],[/droid ([\w\.]+)\b.+(android[- ]x86|harmonyos)/i],[f,u],[/(android|webos|qnx|bada|rim tablet os|maemo|meego|sailfish)[-\/ ]?([\w\.]*)/i,/(blackberry)\w*\/([\w\.]*)/i,/(tizen|kaios)[\/ ]([\w\.]+)/i,/\((series40);/i],[u,f],[/\(bb(10);/i],[f,[u,k]],[/(?:symbian ?os|symbos|s60(?=;)|series60)[-\/ ]?([\w\.]*)/i],[f,[u,"Symbian"]],[/mozilla\/[\d\.]+ \((?:mobile|tablet|tv|mobile; [\w ]+); rv:.+ gecko\/([\w\.]+)/i],[f,[u,C+" OS"]],[/web0s;.+rt(tv)/i,/\b(?:hp)?wos(?:browser)?\/([\w\.]+)/i],[f,[u,"webOS"]],[/crkey\/([\d\.]+)/i],[f,[u,I+"cast"]],[/(cros) [\w]+ ([\w\.]+\w)/i],[[u,"Chromium OS"],f],[/(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],[u,f],[/(sunos) ?([\w\.\d]*)/i],[[u,"Solaris"],f],[/((?:open)?solaris)[-\/ ]?([\w\.]*)/i,/(aix) ((\d)(?=\.|\)| )[\w\.])*/i,/\b(beos|os\/2|amigaos|morphos|openvms|fuchsia|hp-ux)/i,/(unix) ?([\w\.]*)/i],[u,f]]},H=function(t,e){if(typeof t===a&&(e=t,t=i),!(this instanceof H))return new H(t,e).getResult();var n=t||(typeof r!==o&&r.navigator&&r.navigator.userAgent?r.navigator.userAgent:""),p=e?function(t,e){var r={};for(var i in t)e[i]&&e[i].length%2==0?r[i]=e[i].concat(t[i]):r[i]=t[i];return r}(W,e):W;return this.getBrowser=function(){var t={};return t[u]=i,t[f]=i,B.call(t,n,p.browser),t.major=function(t){return typeof t===s?t.replace(/[^\d\.]/g,"").split(".")[0]:i}(t.version),t},this.getCPU=function(){var t={};return t[d]=i,B.call(t,n,p.cpu),t},this.getDevice=function(){var t={};return t[h]=i,t[l]=i,t[c]=i,B.call(t,n,p.device),t},this.getEngine=function(){var t={};return t[u]=i,t[f]=i,B.call(t,n,p.engine),t},this.getOS=function(){var t={};return t[u]=i,t[f]=i,B.call(t,n,p.os),t},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(t){return n=typeof t===s&&t.length>350?q(t,350):t,this},this.setUA(n),this};H.VERSION="0.7.33",H.BROWSER=F([u,f,"major"]),H.CPU=F([d]),H.DEVICE=F([l,h,c,p,v,m,y,g,b]),H.ENGINE=H.OS=F([u,f]),t.exports&&(e=t.exports=H),e.UAParser=H;var Q=typeof r!==o&&(r.jQuery||r.Zepto);if(Q&&!Q.ua){var $=new H;Q.ua=$.getResult(),Q.ua.get=function(){return $.getUA()},Q.ua.set=function(t){$.setUA(t);var e=$.getResult();for(var r in e)Q.ua[r]=e[r]}}}("object"==typeof window?window:Dt)})),Bt=function(){function t(t){this.amplitudeInstance=t}return t.prototype.getUser=function(){var t,e,r,i,n,o,a,s,l,u;return{device_id:null===(e=null===(t=this.amplitudeInstance)||void 0===t?void 0:t.options)||void 0===e?void 0:e.deviceId,user_id:null===(i=null===(r=this.amplitudeInstance)||void 0===r?void 0:r.options)||void 0===i?void 0:i.userId,version:null===(o=null===(n=this.amplitudeInstance)||void 0===n?void 0:n.options)||void 0===o?void 0:o.versionName,language:null===(s=null===(a=this.amplitudeInstance)||void 0===a?void 0:a.options)||void 0===s?void 0:s.language,platform:null===(u=null===(l=this.amplitudeInstance)||void 0===l?void 0:l.options)||void 0===u?void 0:u.platform,os:this.getOs(),device_model:this.getDeviceModel()}},t.prototype.getOs=function(){var t,e,r,i,n,o;return[null===(r=null===(e=null===(t=this.amplitudeInstance)||void 0===t?void 0:t._ua)||void 0===e?void 0:e.browser)||void 0===r?void 0:r.name,null===(o=null===(n=null===(i=this.amplitudeInstance)||void 0===i?void 0:i._ua)||void 0===n?void 0:n.browser)||void 0===o?void 0:o.major].filter((function(t){return null!=t})).join(" ")},t.prototype.getDeviceModel=function(){var t,e,r;return null===(r=null===(e=null===(t=this.amplitudeInstance)||void 0===t?void 0:t._ua)||void 0===e?void 0:e.os)||void 0===r?void 0:r.name},t}(),zt=function(){function t(t){this.amplitudeInstance=t}return t.prototype.track=function(t){this.amplitudeInstance.logEvent(t.name,t.properties)},t.prototype.setUserProperty=function(t){var e,r;this.amplitudeInstance.setUserProperties(((e={})[t.userProperty]=null===(r=t.variant)||void 0===r?void 0:r.value,e))},t.prototype.unsetUserProperty=function(t){var e;this.amplitudeInstance._logEvent("$identify",null,null,{$unset:(e={},e[t.userProperty]="-",e)})},t}(),Jt=function(t,e){return Jt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])},Jt(t,e)};var Wt=function(){return Wt=Object.assign||function(t){for(var e,r=1,i=arguments.length;r<i;r++)for(var n in e=arguments[r])Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t},Wt.apply(this,arguments)};function Ht(t,e,r,i){return new(r||(r=Promise))((function(n,o){function a(t){try{l(i.next(t))}catch(t){o(t)}}function s(t){try{l(i.throw(t))}catch(t){o(t)}}function l(t){var e;t.done?n(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(a,s)}l((i=i.apply(t,e||[])).next())}))}function Qt(t,e){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(l){return function(s){if(r)throw new TypeError("Generator is already executing.");for(;o&&(o=0,s[0]&&(a=0)),a;)try{if(r=1,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=e.call(t,a)}catch(t){s=[6,t],i=0}finally{r=n=0}if(5&s[0])throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}([s,l])}}}function $t(t){var e="function"==typeof Symbol&&Symbol.iterator,r=e&&t[e],i=0;if(r)return r.call(t);if(t&&"number"==typeof t.length)return{next:function(){return t&&i>=t.length&&(t=void 0),{value:t&&t[i++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function Xt(t,e){var r="function"==typeof Symbol&&t[Symbol.iterator];if(!r)return t;var i,n,o=r.call(t),a=[];try{for(;(void 0===e||e-- >0)&&!(i=o.next()).done;)a.push(i.value)}catch(t){n={error:t}}finally{try{i&&!i.done&&(r=o.return)&&r.call(o)}finally{if(n)throw n.error}}return a}function Gt(t,e,r){if(r||2===arguments.length)for(var i,n=0,o=e.length;n<o;n++)!i&&n in e||(i||(i=Array.prototype.slice.call(e,0,n)),i[n]=e[n]);return t.concat(i||Array.prototype.slice.call(e))}"function"==typeof SuppressedError&&SuppressedError;var Zt=function(t,e){var r,i;void 0===e&&(e=!1);var n=Yt(t,e),o=void 0,a=jt.document.cookie.split("; ");try{for(var s=$t(a),l=s.next();!l.done;l=s.next()){var u=Xt(l.value.split("=",2),2),c=u[0],h=u[1];c===n&&(o=decodeURIComponent(h))}}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}if(o)try{if(e){var f=atob(o);return JSON.parse(decodeURIComponent(f))}var d=o.split("."),p=void 0;return d.length>=2&&d[1]&&(p=atob(d[1])),{deviceId:d[0],userId:p}}catch(t){return}},Yt=function(t,e){if(e){if((null==t?void 0:t.length)<10)return;return"AMP_".concat(t.substring(0,10))}if(!((null==t?void 0:t.length)<6))return"amp_".concat(t.substring(0,6))},te=function(){function t(t,e,r){this.type="integration",this.apiKey=t,this.identityStore=e.identityStore,this.eventBridge=e.eventBridge,this.contextProvider=e.applicationContextProvider,this.timeoutMillis=r,this.loadPersistedState(),r<=0&&(this.setup=void 0)}return t.prototype.setup=function(t,e){return Ht(this,void 0,void 0,(function(){return Qt(this,(function(r){return(null==t?void 0:t.automaticFetchOnAmplitudeIdentityChange)&&this.identityStore.addIdentityListener((function(){null==e||e.fetch()})),[2,this.waitForConnectorIdentity(this.timeoutMillis)]}))}))},t.prototype.getUser=function(){var t=this.identityStore.getIdentity();return{user_id:t.userId,device_id:t.deviceId,user_properties:t.userProperties,version:this.contextProvider.versionName}},t.prototype.track=function(t){return!!this.eventBridge.receiver&&(this.eventBridge.logEvent({eventType:t.eventType,eventProperties:t.eventProperties}),!0)},t.prototype.loadPersistedState=function(){if(!this.apiKey||this.apiKey.startsWith("client-"))return!1;var t=Zt(this.apiKey,!0);return(t||(t=Zt(this.apiKey,!1))||(t=function(t){var e=Yt(t,!0);try{var r=jt.localStorage.getItem(e);if(!r)return;var i=JSON.parse(r);if("object"!=typeof i)return;return i}catch(t){return}}(this.apiKey))||!!(t=function(t){var e=Yt(t,!0);try{var r=jt.sessionStorage.getItem(e);if(!r)return;var i=JSON.parse(r);if("object"!=typeof i)return;return i}catch(t){return}}(this.apiKey)))&&(this.commitIdentityToConnector(t),!0)},t.prototype.commitIdentityToConnector=function(t){var e=this.identityStore.editIdentity();e.setDeviceId(t.deviceId),t.userId&&e.setUserId(t.userId),e.commit()},t.prototype.waitForConnectorIdentity=function(t){return Ht(this,void 0,void 0,(function(){var e,r=this;return Qt(this,(function(i){return(e=this.identityStore.getIdentity()).userId||e.deviceId?[2]:[2,Promise.race([new Promise((function(t){var e=function(){t(),r.identityStore.removeIdentityListener(e)};r.identityStore.addIdentityListener(e)})),new Promise((function(e,r){jt.setTimeout(r,t,"Timed out waiting for Amplitude Analytics SDK to initialize.")}))])]}))}))},t}();var ee,re,ie=jt.fetch||function(t,e){return e=e||{},new Promise((function(r,i){var n=new XMLHttpRequest,o=[],a=[],s={},l=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:l,headers:{keys:function(){return o},entries:function(){return a},get:function(t){return s[t.toLowerCase()]},has:function(t){return t.toLowerCase()in s}}}};for(var u in n.open(e.method||"get",t,!0),n.onload=function(){n.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,(function(t,e,r){o.push(e=e.toLowerCase()),a.push([e,r]),s[e]=s[e]?s[e]+","+r:r})),r(l())},n.onerror=i,n.withCredentials="include"==e.credentials,e.headers)n.setRequestHeader(u,e.headers[u]);n.send(e.body||null)}))},ne=function(){function t(t){this.client=t}return t.prototype.request=function(t){return Ht(this,void 0,void 0,(function(){return Qt(this,(function(e){switch(e.label){case 0:return[4,this.client.request(t.requestUrl,t.method,t.headers,null,t.timeoutMillis)];case 1:return[2,e.sent()]}}))}))},t}(),oe={request:function(t,e,r,i,n){return function(t,e){return null==e||e<=0?t:new Promise((function(r,i){jt.setTimeout((function(){i(new Mt("Request timeout after "+e+" milliseconds"))}),e),t.then(r,i)}))}(Ht(void 0,void 0,void 0,(function(){var n,o;return Qt(this,(function(a){switch(a.label){case 0:return[4,ie(t,{method:e,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(t){t.LocalStorage="localStorage",t.InitialVariants="initialVariants"}(ee||(ee={})),function(t){t.LocalStorage="storage",t.InitialVariants="initial",t.SecondaryLocalStorage="secondary-storage",t.SecondaryInitialVariants="secondary-initial",t.FallbackInline="fallback-inline",t.FallbackConfig="fallback-config",t.LocalEvaluation="local-evaluation"}(re||(re={}));var ae=function(t){return!t||t===re.FallbackInline||t===re.FallbackConfig||t===re.SecondaryInitialVariants},se={debug:!1,instanceName:"$default_instance",fallbackVariant:{},initialVariants:{},initialFlags:void 0,source:ee.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,streamVariants:!1,streamVariantsServerUrl:"https://stream.lab.amplitude.com",fetchOnStart:!0,automaticFetchOnAmplitudeIdentityChange:!1,userProvider:null,analyticsProvider:null,exposureTrackingProvider:null,httpClient:oe},le="1.15.5",ue=function(){function t(t,e){var r,i=this;this.isReady=new Promise((function(t){i.resolve=t})),this.config=t,this.client=e;var n=null!==(r=t.instanceName)&&void 0!==r?r:se.instanceName;this.queue=new he(n),this.cache=new ce(n)}return t.prototype.ready=function(){return this.integration?this.isReady:Promise.resolve()},t.prototype.setIntegration=function(t){var e=this;this.integration&&this.integration.teardown&&this.integration.teardown(),this.integration=t,t.setup?this.integration.setup(this.config,this.client).then((function(){e.queue.setTracker(e.integration.track.bind(t)),e.resolve()}),(function(){e.queue.setTracker(e.integration.track.bind(t)),e.resolve()})):(this.queue.setTracker(this.integration.track.bind(t)),this.resolve())},t.prototype.getUser=function(){return this.integration?this.integration.getUser():{}},t.prototype.track=function(t){if(this.cache.shouldTrack(t)){var e=this.getExposureEvent(t);this.queue.push(e)}},t.prototype.getExposureEvent=function(t){var e,r,i,n={eventType:"$exposure",eventProperties:t};return(null===(e=t.metadata)||void 0===e?void 0:e.exposureEvent)?n={eventType:null===(r=t.metadata)||void 0===r?void 0:r.exposureEvent,eventProperties:t}:"web"===(null===(i=t.metadata)||void 0===i?void 0:i.deliveryMethod)&&(n={eventType:"$impression",eventProperties:t}),n},t}(),ce=function(){function t(t){this.isSessionStorageAvailable=fe(),this.inMemoryCache={},this.storageKey="EXP_sent_v2_".concat(t),this.isSessionStorageAvailable&&jt.sessionStorage.removeItem("EXP_sent_".concat(t))}return t.prototype.shouldTrack=function(t){var e;if("web"===(null===(e=t.metadata)||void 0===e?void 0:e.deliveryMethod))return!0;this.loadCache();var r=this.inMemoryCache[t.flag_key],i=!1;return r&&r.variant===t.variant||(i=!0,this.inMemoryCache[t.flag_key]=t),this.storeCache(),i},t.prototype.loadCache=function(){if(this.isSessionStorageAvailable){var t=jt.sessionStorage.getItem(this.storageKey);this.inMemoryCache=t?JSON.parse(t):{}}},t.prototype.storeCache=function(){this.isSessionStorageAvailable&&jt.sessionStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryCache))},t}(),he=function(){function t(t,e){void 0===e&&(e=512),this.isLocalStorageAvailable=Ft(),this.inMemoryQueue=[],this.storageKey="EXP_unsent_".concat(t),this.maxQueueSize=e}return t.prototype.push=function(t){this.loadQueue(),this.inMemoryQueue.push(t),this.flush(),this.storeQueue()},t.prototype.setTracker=function(t){var e=this;this.tracker=t,this.poller=jt.setInterval((function(){e.loadFlushStore()}),1e3),this.loadFlushStore()},t.prototype.flush=function(){var t,e;if(this.tracker&&0!==this.inMemoryQueue.length){try{for(var r=$t(this.inMemoryQueue),i=r.next();!i.done;i=r.next()){var n=i.value;if(!this.tracker(n))return}}catch(e){t={error:e}}finally{try{i&&!i.done&&(e=r.return)&&e.call(r)}finally{if(t)throw t.error}}this.inMemoryQueue=[],this.poller&&(jt.clearInterval(this.poller),this.poller=void 0)}},t.prototype.loadQueue=function(){if(this.isLocalStorageAvailable){var t=jt.localStorage.getItem(this.storageKey);this.inMemoryQueue=t?JSON.parse(t):[]}},t.prototype.storeQueue=function(){this.isLocalStorageAvailable&&(this.inMemoryQueue.length>this.maxQueueSize&&(this.inMemoryQueue=this.inMemoryQueue.slice(this.inMemoryQueue.length-this.maxQueueSize)),jt.localStorage.setItem(this.storageKey,JSON.stringify(this.inMemoryQueue)))},t.prototype.loadFlushStore=function(){this.loadQueue(),this.flush(),this.storeQueue()},t}(),fe=function(){var t=Lt();if(t)try{var e="EXP_test";return t.sessionStorage.setItem(e,e),t.sessionStorage.removeItem(e),!0}catch(t){return!1}return!1},de=function(){function t(){this.globalScope=Lt()}return t.prototype.get=function(t){var e;return null===(e=this.globalScope)||void 0===e?void 0:e.localStorage.getItem(t)},t.prototype.put=function(t,e){var r;null===(r=this.globalScope)||void 0===r||r.localStorage.setItem(t,e)},t.prototype.delete=function(t){var e;null===(e=this.globalScope)||void 0===e||e.localStorage.removeItem(t)},t}(),pe=function(){function t(t,e,r){this.cache={},this.namespace=t,this.storage=e,this.transformer=r}return t.prototype.get=function(t){return this.cache[t]},t.prototype.getAll=function(){return Wt({},this.cache)},t.prototype.put=function(t,e){this.cache[t]=e},t.prototype.putAll=function(t){var e,r;try{for(var i=$t(Object.keys(t)),n=i.next();!n.done;n=i.next()){var o=n.value;this.cache[o]=t[o]}}catch(t){e={error:t}}finally{try{n&&!n.done&&(r=i.return)&&r.call(i)}finally{if(e)throw e.error}}},t.prototype.remove=function(t){delete this.cache[t]},t.prototype.clear=function(){this.cache={}},t.prototype.load=function(){var t,e,r,i=this.storage.get(this.namespace);try{r=JSON.parse(i)||{}}catch(t){return}var n={};try{for(var o=$t(Object.keys(r)),a=o.next();!a.done;a=o.next()){var s=a.value;try{var l=void 0;(l=this.transformer?this.transformer(r[s]):r[s])&&(n[s]=l)}catch(t){}}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}this.clear(),this.putAll(n)},t.prototype.store=function(t){void 0===t&&(t=this.cache),this.storage.put(this.namespace,JSON.stringify(t))},t}(),ve=function(t){if("string"==typeof t)return{key:t,value:t};if("object"==typeof t){var e=t.key,r=t.value,i=t.payload,n=t.metadata,o=t.expKey;n&&n.experimentKey?o=n.experimentKey:o&&((n=n||{}).experimentKey=o);var a={};return e?a.key=e:r&&(a.key=r),r&&(a.value=r),n&&(a.metadata=n),i&&(a.payload=i),o&&(a.expKey=o),a}},ye=function(){function t(){this.globalScope=Lt()}return t.prototype.get=function(t){var e;return null===(e=this.globalScope)||void 0===e?void 0:e.sessionStorage.getItem(t)},t.prototype.put=function(t,e){var r;null===(r=this.globalScope)||void 0===r||r.sessionStorage.setItem(t,e)},t.prototype.delete=function(t){var e;null===(e=this.globalScope)||void 0===e||e.sessionStorage.removeItem(t)},t}(),me=a.default.parse,ge=["pfx","key","passphrase","cert","ca","ciphers","rejectUnauthorized","secureProtocol","servername","checkServerIdentity"],be=[239,187,191],we=262144,Se=/^(cookie|authorization)$/i;function xe(t,e){var r=xe.CONNECTING,i=e&&e.headers,n=!1;Object.defineProperty(this,"readyState",{get:function(){return r}}),Object.defineProperty(this,"url",{get:function(){return t}});var o,a=this;function s(e){r!==xe.CLOSED&&(r=xe.CONNECTING,y("error",new Ee("error",{message:e})),p&&(t=p,p=null,n=!1),setTimeout((function(){r!==xe.CONNECTING||a.connectionInProgress||(a.connectionInProgress=!0,v())}),a.reconnectInterval))}a.reconnectInterval=1e3,a.connectionInProgress=!1;var c="";i&&i["Last-Event-ID"]&&(c=i["Last-Event-ID"],delete i["Last-Event-ID"]);var h=!1,f="",d="",p=null;function v(){var f=me(t),d="https:"===f.protocol;if(f.headers={"Cache-Control":"no-cache",Accept:"text/event-stream"},c&&(f.headers["Last-Event-ID"]=c),i){var g=n?function(t){var e={};for(var r in t)Se.test(r)||(e[r]=t[r]);return e}(i):i;for(var b in g){var w=g[b];w&&(f.headers[b]=w)}}if(f.rejectUnauthorized=!(e&&!e.rejectUnauthorized),e&&void 0!==e.createConnection&&(f.createConnection=e.createConnection),e&&e.proxy){var S=me(e.proxy);d="https:"===S.protocol,f.protocol=d?"https:":"http:",f.path=t,f.headers.Host=f.host,f.hostname=S.hostname,f.host=S.host,f.port=S.port}if(e&&e.https)for(var x in e.https)if(-1!==ge.indexOf(x)){var k=e.https[x];void 0!==k&&(f[x]=k)}e&&void 0!==e.withCredentials&&(f.withCredentials=e.withCredentials),o=(d?l.default:u.default).request(f,(function(e){if(a.connectionInProgress=!1,500===e.statusCode||502===e.statusCode||503===e.statusCode||504===e.statusCode)return y("error",new Ee("error",{status:e.statusCode,message:e.statusMessage})),void s();if(301===e.statusCode||302===e.statusCode||307===e.statusCode){var i=e.headers.location;if(!i)return void y("error",new Ee("error",{status:e.statusCode,message:e.statusMessage}));var o=new URL(t).origin,l=new URL(i).origin;return n=o!==l,307===e.statusCode&&(p=t),t=i,void process.nextTick(v)}if(200!==e.statusCode)return y("error",new Ee("error",{status:e.statusCode,message:e.statusMessage})),a.close();var u,c;r=xe.OPEN,e.on("close",(function(){e.removeAllListeners("close"),e.removeAllListeners("end"),s()})),e.on("end",(function(){e.removeAllListeners("close"),e.removeAllListeners("end"),s()})),y("open",new Ee("open"));var f=0,d=-1,g=0,b=0;e.on("data",(function(t){u?(t.length>u.length-b&&((g=2*u.length+t.length)>we&&(g=u.length+t.length+we),c=Buffer.alloc(g),u.copy(c,0,0,b),u=c),t.copy(u,b),b+=t.length):(function(t){return be.every((function(e,r){return t[r]===e}))}(u=t)&&(u=u.slice(be.length)),b=u.length);for(var e=0,r=b;e<r;){h&&(10===u[e]&&++e,h=!1);for(var i,n=-1,o=d,a=f;n<0&&a<r;++a)58===(i=u[a])?o<0&&(o=a-e):13===i?(h=!0,n=a-e):10===i&&(n=a-e);if(n<0){f=r-e,d=o;break}f=0,d=-1,m(u,e,o,n),e+=n+1}e===r?(u=void 0,b=0):e>0&&(u=u.slice(e,b),b=u.length)}))})),o.on("error",(function(t){a.connectionInProgress=!1,s(t.message)})),o.setNoDelay&&o.setNoDelay(!0),o.end()}function y(){a.listeners(arguments[0]).length>0&&a.emit.apply(a,arguments)}function m(e,r,i,n){if(0===n){if(f.length>0){var o=d||"message";y(o,new Ie(o,{data:f.slice(0,-1),lastEventId:c,origin:new URL(t).origin})),f=""}d=void 0}else if(i>0){var s=i<0,l=0,u=e.slice(r,r+(s?n:i)).toString();r+=l=s?n:32!==e[r+i+1]?i+1:i+2;var h=n-l,p=e.slice(r,r+h).toString();if("data"===u)f+=p+"\n";else if("event"===u)d=p;else if("id"===u)c=p;else if("retry"===u){var v=parseInt(p,10);Number.isNaN(v)||(a.reconnectInterval=v)}}}v(),this._close=function(){r!==xe.CLOSED&&(r=xe.CLOSED,o.abort&&o.abort(),o.xhr&&o.xhr.abort&&o.xhr.abort())}}var ke=xe;function Ee(t,e){if(Object.defineProperty(this,"type",{writable:!1,value:t,enumerable:!0}),e)for(var r in e)e.hasOwnProperty(r)&&Object.defineProperty(this,r,{writable:!1,value:e[r],enumerable:!0})}function Ie(t,e){for(var r in Object.defineProperty(this,"type",{writable:!1,value:t,enumerable:!0}),e)e.hasOwnProperty(r)&&Object.defineProperty(this,r,{writable:!1,value:e[r],enumerable:!0})}c.default.inherits(xe,s.default.EventEmitter),xe.prototype.constructor=xe,["open","error","message"].forEach((function(t){Object.defineProperty(xe.prototype,"on"+t,{get:function(){var e=this.listeners(t)[0];return e?e._listener?e._listener:e:void 0},set:function(e){this.removeAllListeners(t),this.addEventListener(t,e)}})})),Object.defineProperty(xe,"CONNECTING",{enumerable:!0,value:0}),Object.defineProperty(xe,"OPEN",{enumerable:!0,value:1}),Object.defineProperty(xe,"CLOSED",{enumerable:!0,value:2}),xe.prototype.CONNECTING=0,xe.prototype.OPEN=1,xe.prototype.CLOSED=2,xe.prototype.close=function(){this._close()},xe.prototype.addEventListener=function(t,e){"function"==typeof e&&(e._listener=e,this.on(t,e))},xe.prototype.dispatchEvent=function(t){if(!t.type)throw new Error("UNSPECIFIED_EVENT_TYPE_ERR");this.emit(t.type,t.detail)},xe.prototype.removeEventListener=function(t,e){"function"==typeof e&&(e._listener=void 0,this.removeListener(t,e))};var Ce=function(t,e){return new ke(t,e)},Te=function(t){return null==t},Pe=function(t){return!!Te(t)||t&&0===Object.keys(t).length},Oe=function(t){var e;return"local"===(null===(e=null==t?void 0:t.metadata)||void 0===e?void 0:e.evaluationMode)},Ae=function(t){return null==t?{}:"string"==typeof t?{key:t,value:t}:t},Me=function(t){if(!t)return{};var e=void 0;t.metadata&&(e=t.metadata.experimentKey);var r={};return t.key&&(r.key=t.key),t.value&&(r.value=t.value),t.payload&&(r.payload=t.payload),e&&(r.expKey=e),t.metadata&&(r.metadata=t.metadata),r},_e=function(){function t(t){this.setProperties={},this.unsetProperties={},this.analyticsProvider=t}return t.prototype.track=function(t){this.setProperties[t.key]!=t.variant.value&&(this.setProperties[t.key]=t.variant.value,delete this.unsetProperties[t.key],this.analyticsProvider.track(t))},t.prototype.setUserProperty=function(t){this.setProperties[t.key]!=t.variant.value&&this.analyticsProvider.setUserProperty(t)},t.prototype.unsetUserProperty=function(t){this.unsetProperties[t.key]||(this.unsetProperties[t.key]="unset",delete this.setProperties[t.key],this.analyticsProvider.unsetUserProperty(t))},t}(),Ne=function(){function t(t){this.tracked={},this.exposureTrackingProvider=t}return t.prototype.track=function(t){var e=this.tracked[t.flag_key];e&&e.variant===t.variant||(this.tracked[t.flag_key]=t,this.exposureTrackingProvider.track(t))},t}(),Ue=function(){function t(t,e,r,i){this.started=!1,this.done=!1,this.attempts=t,this.min=e,this.max=r,this.scalar=i}return t.prototype.start=function(t){return Ht(this,void 0,void 0,(function(){return Qt(this,(function(e){switch(e.label){case 0:if(this.started)throw Error("Backoff already started");return this.started=!0,[4,this.backoff(t,0,this.min)];case 1:return e.sent(),[2]}}))}))},t.prototype.cancel=function(){this.done=!0,clearTimeout(this.timeoutHandle)},t.prototype.backoff=function(t,e,r){return Ht(this,void 0,void 0,(function(){var i=this;return Qt(this,(function(n){return this.done||(this.timeoutHandle=jt.setTimeout((function(){return Ht(i,void 0,void 0,(function(){var i,n;return Qt(this,(function(o){switch(o.label){case 0:return o.trys.push([0,2,,3]),[4,t()];case 1:return o.sent(),[3,3];case 2:return o.sent(),(i=e+1)<this.attempts&&(n=Math.min(r*this.scalar,this.max),this.backoff(t,i,n)),[3,3];case 3:return[2]}}))}))}),r)),[2]}))}))},t}();function Ve(t){if(t instanceof At){var e=t;return e.statusCode<400||e.statusCode>=500||429===e.statusCode}return!0}var Re=function(){function t(t){this.hasNonretriableError=!1,this.evaluationApi=t}return t.prototype.start=function(t,e,r){return Ht(this,void 0,void 0,(function(){var i,n=this;return Qt(this,(function(o){switch(o.label){case 0:if(this.hasNonretriableError)throw new Error("Stream updater has non-retriable error, not starting");return[4,this.stop()];case 1:o.sent(),o.label=2;case 2:return o.trys.push([2,4,,6]),[4,this.evaluationApi.streamVariants(r.user,r.options,t,(function(t){return Ht(n,void 0,void 0,(function(){return Qt(this,(function(r){switch(r.label){case 0:return[4,this.handleError(t)];case 1:return r.sent(),e(t),[2]}}))}))}))];case 3:return o.sent(),[3,6];case 4:return i=o.sent(),console.error("[Experiment] Stream updater failed to start: "+i+i.statusCode),[4,this.handleError(i)];case 5:throw o.sent(),i;case 6:return[2]}}))}))},t.prototype.handleError=function(t){return Ht(this,void 0,void 0,(function(){return Qt(this,(function(e){switch(e.label){case 0:return[4,this.stop()];case 1:return e.sent(),Ve(t)||(this.hasNonretriableError=!0,console.error("[Experiment] Stream updater has non-retriable error: "+t)),[2]}}))}))},t.prototype.stop=function(){return Ht(this,void 0,void 0,(function(){return Qt(this,(function(t){switch(t.label){case 0:return[4,this.evaluationApi.close()];case 1:return t.sent(),[2]}}))}))},t}(),je=function(){function t(t){this.evaluationApi=t}return t.prototype.start=function(t,e,r){return Ht(this,void 0,void 0,(function(){var e,i,n,o,a;return Qt(this,(function(s){switch(s.label){case 0:e=r.user,i=r.config,n=r.options,s.label=1;case 1:s.trys.push([1,6,,7]),i.retryFetchOnFailure&&this.stopRetries(),s.label=2;case 2:return s.trys.push([2,4,,5]),[4,this.fetchInternal(e,n,i.fetchTimeoutMillis,t)];case 3:return s.sent(),[3,5];case 4:throw o=s.sent(),i.retryFetchOnFailure&&Ve(o)&&this.startRetries(e,n,t),o;case 5:return[3,7];case 6:return a=s.sent(),i.debug&&(a instanceof Mt?console.debug(a):console.error(a)),[3,7];case 7:return[2]}}))}))},t.prototype.fetchInternal=function(t,e,r,i){return Ht(this,void 0,void 0,(function(){var n;return Qt(this,(function(o){switch(o.label){case 0:return[4,this.evaluationApi.getVariants(t,Wt({timeoutMillis:r},e))];case 1:return n=o.sent(),i(n),[2]}}))}))},t.prototype.startRetries=function(t,e,r){return Ht(this,void 0,void 0,(function(){var i=this;return Qt(this,(function(n){return this.retriesBackoff=new Ue(8,500,1e4,1.5),this.retriesBackoff.start((function(){return Ht(i,void 0,void 0,(function(){return Qt(this,(function(i){switch(i.label){case 0:return[4,this.fetchInternal(t,e,1e4,r)];case 1:return i.sent(),[2]}}))}))})),[2]}))}))},t.prototype.stopRetries=function(){this.retriesBackoff&&this.retriesBackoff.cancel()},t.prototype.stop=function(){return Ht(this,void 0,void 0,(function(){return Qt(this,(function(t){return this.stopRetries(),[2]}))}))},t}(),Le=function(t){function e(e,r,i){return t.call(this,e,r,i)||this}return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");function r(){this.constructor=t}Jt(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}(e,t),e.prototype.start=function(e,r,i){return Ht(this,void 0,void 0,(function(){return Qt(this,(function(n){return[2,t.prototype.start.call(this,e,r,i)]}))}))},e}(function(){function t(t,e,r){this.mainRetryTimer=null,this.fallbackRetryTimer=null,this.mainUpdater=t,this.fallbackUpdater=e,this.retryIntervalMillisMin=.8*r,this.retryIntervalMillisRange=1.2*r-this.retryIntervalMillisMin}return t.prototype.start=function(t,e,r){return Ht(this,void 0,void 0,(function(){var i=this;return Qt(this,(function(n){switch(n.label){case 0:return[4,this.stop()];case 1:n.sent(),n.label=2;case 2:return n.trys.push([2,4,,6]),[4,this.mainUpdater.start(t,(function(n){return Ht(i,void 0,void 0,(function(){var i=this;return Qt(this,(function(n){return this.fallbackUpdater.start(t,e,r).catch((function(n){i.startFallbackRetryTimer(t,e,r)})),this.startMainRetryTimer(t,e,r),[2]}))}))}),r)];case 3:return n.sent(),[3,6];case 4:return n.sent(),[4,this.fallbackUpdater.start(t,e,r)];case 5:return n.sent(),this.startMainRetryTimer(t,e,r),[3,6];case 6:return[2]}}))}))},t.prototype.startMainRetryTimer=function(t,e,r){var i=this;this.mainRetryTimer&&(clearTimeout(this.mainRetryTimer),this.mainRetryTimer=null);var n=setTimeout((function(){return Ht(i,void 0,void 0,(function(){var i=this;return Qt(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,this.mainUpdater.start(t,(function(n){i.fallbackUpdater.start(t,e,r).catch((function(n){i.startFallbackRetryTimer(t,e,r)})),i.startMainRetryTimer(t,e,r)}),r)];case 1:return n.sent(),[3,3];case 2:return n.sent(),this.startMainRetryTimer(t,e,r),[2];case 3:return this.fallbackRetryTimer&&(clearTimeout(this.fallbackRetryTimer),this.fallbackRetryTimer=null),this.fallbackUpdater.stop(),[2]}}))}))}),Math.ceil(this.retryIntervalMillisMin+Math.random()*this.retryIntervalMillisRange));this.mainRetryTimer=n},t.prototype.startFallbackRetryTimer=function(t,e,r){var i=this;this.fallbackRetryTimer&&(clearTimeout(this.fallbackRetryTimer),this.fallbackRetryTimer=null);var n=setTimeout((function(){return Ht(i,void 0,void 0,(function(){return Qt(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,this.fallbackUpdater.start(t,e,r)];case 1:return i.sent(),[3,3];case 2:return i.sent(),this.startFallbackRetryTimer(t,e,r),[3,3];case 3:return[2]}}))}))}),Math.ceil(this.retryIntervalMillisMin+Math.random()*this.retryIntervalMillisRange));this.fallbackRetryTimer=n},t.prototype.stop=function(){return Ht(this,void 0,void 0,(function(){return Qt(this,(function(t){switch(t.label){case 0:return this.mainRetryTimer&&(clearTimeout(this.mainRetryTimer),this.mainRetryTimer=null),this.fallbackRetryTimer&&(clearTimeout(this.fallbackRetryTimer),this.fallbackRetryTimer=null),[4,this.mainUpdater.stop()];case 1:return t.sent(),[4,this.fallbackUpdater.stop()];case 2:return t.sent(),[2]}}))}))},t}()),Fe=function(){function t(t,e){var r,i,n,o,a,s=this;this.engine=new ft,this.isRunning=!1,this.apiKey=t,this.config=Wt(Wt(Wt({},se),e),{serverUrl:(null==e?void 0:e.serverUrl)||("eu"===(null===(r=null==e?void 0:e.serverZone)||void 0===r?void 0:r.toLowerCase())?"https://api.lab.eu.amplitude.com":se.serverUrl),flagsServerUrl:(null==e?void 0:e.flagsServerUrl)||("eu"===(null===(i=null==e?void 0:e.serverZone)||void 0===i?void 0:i.toLowerCase())?"https://flag.lab.eu.amplitude.com":se.flagsServerUrl),streamVariantsServerUrl:(null==e?void 0:e.streamVariantsServerUrl)||("eu"===(null===(n=null==e?void 0:e.serverZone)||void 0===n?void 0:n.toLowerCase())?"https://stream.lab.eu.amplitude.com":se.streamVariantsServerUrl),flagConfigPollingIntervalMillis:e.flagConfigPollingIntervalMillis<6e4?6e4:null!==(o=e.flagConfigPollingIntervalMillis)&&void 0!==o?o:se.flagConfigPollingIntervalMillis});var l=null===(a=this.config)||void 0===a?void 0:a.internalInstanceNameSuffix;if(this.isWebExperiment="web"===l,this.poller=new Kt((function(){return s.doFlags()}),this.config.flagConfigPollingIntervalMillis),this.config.initialVariants)for(var u in this.config.initialVariants)this.config.initialVariants[u]=ve(this.config.initialVariants[u]);this.config.userProvider&&(this.userProvider=this.config.userProvider),this.config.analyticsProvider&&(this.analyticsProvider=new _e(this.config.analyticsProvider)),this.config.exposureTrackingProvider&&(this.exposureTrackingProvider=new Ne(this.config.exposureTrackingProvider)),this.integrationManager=new ue(this.config,this);var c=new ne(this.config.httpClient||oe);this.flagApi=new Nt(this.apiKey,this.config.flagsServerUrl,c);var h,f=new _t(this.apiKey,this.config.serverUrl,c);if(this.variantUpdater=new je(f),e.streamVariants){var d=new Rt(this.apiKey,this.config.streamVariantsServerUrl,Ce,3e3,f),p=new Re(d);this.variantUpdater=new Le(p,this.variantUpdater,6e5)}var v=l?"".concat(this.config.instanceName,"-").concat(l):this.config.instanceName;h=this.isWebExperiment?new ye:new de,this.variants=function(t,e,r){var i=t.substring(t.length-6),n="amp-exp-".concat(e,"-").concat(i);return new pe(n,r,ve)}(this.apiKey,v,h),this.flags=function(t,e,r){void 0===r&&(r=new de);var i=t.substring(t.length-6),n="amp-exp-".concat(e,"-").concat(i,"-flags");return new pe(n,r)}(this.apiKey,v,h);try{this.flags.load(),this.variants.load()}catch(t){}this.mergeInitialFlagsWithStorage()}return t.prototype.start=function(t){var e;return Ht(this,void 0,void 0,(function(){var r;return Qt(this,(function(i){switch(i.label){case 0:return this.isRunning?[2]:(this.isRunning=!0,this.setUser(t),r=this.doFlags(),null===(e=this.config.fetchOnStart)||void 0===e||e?[4,Promise.all([this.fetch(t),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]}}))}))},t.prototype.stop=function(){this.variantUpdater.stop(),this.isRunning&&(this.poller.stop(),this.isRunning=!1)},t.prototype.fetch=function(t,e){return void 0===t&&(t=this.user),Ht(this,void 0,void 0,(function(){var r=this;return Qt(this,(function(i){switch(i.label){case 0:if(!this.apiKey)throw Error("Experiment API key is empty");return this.setUser(t||{}),[4,this.addContextOrWait(t)];case 1:return t=i.sent(),t=this.cleanUserPropsForFetch(t),[4,this.variantUpdater.start((function(t){return Ht(r,void 0,void 0,(function(){return Qt(this,(function(r){switch(r.label){case 0:return this.debug("[Experiment] Received variants update"),[4,this.processVariants(t,e)];case 1:return r.sent(),[2]}}))}))}),(function(t){console.error(t)}),{user:t,options:e,config:this.config})];case 2:return i.sent(),[2,this]}}))}))},t.prototype.processVariants=function(t,e){return Ht(this,void 0,void 0,(function(){var r;return Qt(this,(function(i){switch(i.label){case 0:return r={},Object.entries(t).forEach((function(t){var e=Xt(t,2),i=e[0],n=e[1];r[i]=Me(n)})),[4,this.storeVariants(r,e)];case 1:return i.sent(),[2]}}))}))},t.prototype.variant=function(t,e){var r,i;if(!this.apiKey)return{value:void 0};var n=this.variantAndSource(t,e);return this.config.automaticExposureTracking&&this.exposureInternal(t,n),this.debug("[Experiment] variant for ".concat(t," 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||{}},t.prototype.exposure=function(t){var e=this.variantAndSource(t);this.exposureInternal(t,e)},t.prototype.all=function(){if(!this.apiKey)return{};var t=this.evaluate();for(var e in t){var r=this.flags.get(e);Oe(r)||delete t[e]}return Wt(Wt(Wt({},this.secondaryVariants()),this.sourceVariants()),t)},t.prototype.clear=function(){this.variants.clear();try{this.variants.store()}catch(t){}},t.prototype.getUser=function(){var t;if(!this.user)return this.user;if(null===(t=this.user)||void 0===t?void 0:t.user_properties){var e=Wt({},this.user.user_properties);return Wt(Wt({},this.user),{user_properties:e})}return Wt({},this.user)},t.prototype.setUser=function(t){var e;if(t)if(null===(e=this.user)||void 0===e?void 0:e.user_properties){var r=Wt({},t.user_properties);this.user=Wt(Wt({},t),{user_properties:r})}else this.user=Wt({},t);else this.user=null},t.prototype.getUserProvider=function(){return this.userProvider},t.prototype.setUserProvider=function(t){return this.userProvider=t,this},t.prototype.mergeInitialFlagsWithStorage=function(){var t=this;this.config.initialFlags&&JSON.parse(this.config.initialFlags).forEach((function(e){t.flags.get(e.key)||t.flags.put(e.key,e)}))},t.prototype.evaluate=function(t){var e,r,i=this.addContext(this.user),n=function(t,e){var r,i,n=O({},t),o=[],a=e||Object.keys(n);try{for(var s=_(a),l=s.next();!l.done;l=s.next()){var u=l.value,c=dt(u,n);c&&o.push.apply(o,U([],N(c),!1))}}catch(t){r={error:t}}finally{try{l&&!l.done&&(i=s.return)&&i.call(s)}finally{if(r)throw r.error}}return o}(this.flags.getAll(),t),o=function(t){var e,r,i,n;if(!t)return{};var o={user:t},a=Lt();a&&(o.page={url:a.location.href});var s={};if(!t.groups)return o;try{for(var l=$t(Object.keys(t.groups)),u=l.next();!u.done;u=l.next()){var c=u.value,h=t.groups[c];if(h.length>0&&h[0]){var f=h[0],d={group_name:f},p=null===(n=null===(i=t.group_properties)||void 0===i?void 0:i[c])||void 0===n?void 0:n[f];p&&Object.keys(p).length>0&&(d.group_properties=p),s[c]=d}}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(e)throw e.error}}return Object.keys(s).length>0&&(o.groups=s),delete o.user.groups,delete o.user.group_properties,o}(i),a=this.engine.evaluate(o,n),s={};try{for(var l=$t(Object.keys(a)),u=l.next();!u.done;u=l.next()){var c=u.value;s[c]=Me(a[c])}}catch(t){e={error:t}}finally{try{u&&!u.done&&(r=l.return)&&r.call(l)}finally{if(e)throw e.error}}return s},t.prototype.variantAndSource=function(t,e){var r={};this.config.source===ee.LocalStorage?r=this.localStorageVariantAndSource(t,e):this.config.source===ee.InitialVariants&&(r=this.initialVariantsVariantAndSource(t,e));var i=this.flags.get(t);return(Oe(i)||!r.variant&&i)&&(r=this.localEvaluationVariantAndSource(t,i,e)),r},t.prototype.localEvaluationVariantAndSource=function(t,e,r){var i,n={},o=this.evaluate([e.key])[t],a=re.LocalEvaluation,s=null===(i=null==o?void 0:o.metadata)||void 0===i?void 0:i.default;if(!Te(o)&&!s)return{variant:Ae(o),source:a,hasDefaultVariant:!1};if(s&&(n={variant:Ae(o),source:a,hasDefaultVariant:!0}),!Te(r))return{variant:Ae(r),source:re.FallbackInline,hasDefaultVariant:n.hasDefaultVariant};var l=this.config.initialVariants[t];if(!Te(l))return{variant:Ae(l),source:re.SecondaryInitialVariants,hasDefaultVariant:n.hasDefaultVariant};var u=Ae(this.config.fallbackVariant),c={variant:u,source:re.FallbackConfig,hasDefaultVariant:n.hasDefaultVariant};return Pe(u)?n:c},t.prototype.localStorageVariantAndSource=function(t,e){var r,i={},n=this.variants.get(t),o=null===(r=null==n?void 0:n.metadata)||void 0===r?void 0:r.default;if(!Te(n)&&!o)return{variant:Ae(n),source:re.LocalStorage,hasDefaultVariant:!1};if(o&&(i={variant:Ae(n),source:re.LocalStorage,hasDefaultVariant:!0}),!Te(e))return{variant:Ae(e),source:re.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var a=this.config.initialVariants[t];if(!Te(a))return{variant:Ae(a),source:re.SecondaryInitialVariants,hasDefaultVariant:i.hasDefaultVariant};var s=Ae(this.config.fallbackVariant),l={variant:s,source:re.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return Pe(s)?i:l},t.prototype.initialVariantsVariantAndSource=function(t,e){var r,i={},n=this.config.initialVariants[t];if(!Te(n))return{variant:Ae(n),source:re.InitialVariants,hasDefaultVariant:!1};var o=this.variants.get(t),a=null===(r=null==o?void 0:o.metadata)||void 0===r?void 0:r.default;if(!Te(o)&&!a)return{variant:Ae(o),source:re.LocalStorage,hasDefaultVariant:!1};if(a&&(i={variant:Ae(o),source:re.LocalStorage,hasDefaultVariant:!0}),!Te(e))return{variant:Ae(e),source:re.FallbackInline,hasDefaultVariant:i.hasDefaultVariant};var s=Ae(this.config.fallbackVariant),l={variant:s,source:re.FallbackConfig,hasDefaultVariant:i.hasDefaultVariant};return Pe(s)?i:l},t.prototype.cleanUserPropsForFetch=function(t){var e=Wt({},t);return delete e.cookie,e},t.prototype.doFlags=function(){return Ht(this,void 0,void 0,(function(){var t,e,r;return Qt(this,(function(i){switch(i.label){case 0:return i.trys.push([0,4,,5]),t=void 0,this.isWebExperiment?[4,this.addContextOrWait(this.getUser())]:[3,2];case 1:t=i.sent(),i.label=2;case 2:return[4,this.flagApi.getFlags({libraryName:"experiment-js-client",libraryVersion:le,timeoutMillis:this.config.fetchTimeoutMillis,deliveryMethod:this.isWebExperiment?"web":void 0,user:(null==t?void 0:t.user_id)||(null==t?void 0:t.device_id)?{user_id:null==t?void 0:t.user_id,device_id:null==t?void 0:t.device_id}:void 0})];case 3:return e=i.sent(),this.flags.clear(),this.flags.putAll(e),[3,5];case 4:if(!((r=i.sent())instanceof Mt))throw r;return this.config.debug&&console.debug(r),[3,5];case 5:try{this.flags.store()}catch(t){}return this.mergeInitialFlagsWithStorage(),[2]}}))}))},t.prototype.storeVariants=function(t,e){return Ht(this,void 0,void 0,(function(){var r,i,n,o;return Qt(this,(function(a){for(o in 0===(r=e&&e.flagKeys?e.flagKeys:[]).length&&this.variants.clear(),i=function(e){r=r.filter((function(t){return t!==e})),n.variants.put(e,t[e])},n=this,t)i(o);for(o in r)this.variants.remove(o);try{this.variants.store()}catch(t){}return this.debug("[Experiment] Stored variants: ",t),[2]}))}))},t.prototype.addContext=function(t){var e,r=null===(e=this.userProvider)||void 0===e?void 0:e.getUser(),i=this.integrationManager.getUser(),n=Wt(Wt(Wt({},null==r?void 0:r.user_properties),i.user_properties),null==t?void 0:t.user_properties);return Wt(Wt(Wt(Wt({library:"experiment-js-client/".concat(le)},r),i),t),{user_properties:n})},t.prototype.addContextOrWait=function(t){return Ht(this,void 0,void 0,(function(){return Qt(this,(function(e){switch(e.label){case 0:return[4,this.integrationManager.ready()];case 1:return e.sent(),[2,this.addContext(t)]}}))}))},t.prototype.sourceVariants=function(){return this.config.source==ee.LocalStorage?this.variants.getAll():this.config.source==ee.InitialVariants?this.config.initialVariants:void 0},t.prototype.secondaryVariants=function(){return this.config.source==ee.LocalStorage?this.config.initialVariants:this.config.source==ee.InitialVariants?this.variants.getAll():void 0},t.prototype.exposureInternal=function(t,e){var r,i,n,o,a,s,l,u,c;if(null===(n=null===(i=null===(r=e.variant)||void 0===r?void 0:r.metadata)||void 0===i?void 0:i.trackExposure)||void 0===n||n){this.legacyExposureInternal(t,e.variant,e.source);var h={flag_key:t},f=ae(e.source);if(!f||e.hasDefaultVariant){(null===(o=e.variant)||void 0===o?void 0:o.expKey)&&(h.experiment_key=null===(a=e.variant)||void 0===a?void 0:a.expKey);var d=null===(s=e.variant)||void 0===s?void 0:s.metadata;f||(null==d?void 0:d.default)||((null===(l=e.variant)||void 0===l?void 0:l.key)?h.variant=e.variant.key:(null===(u=e.variant)||void 0===u?void 0:u.value)&&(h.variant=e.variant.value)),d&&(h.metadata=d),null===(c=this.exposureTrackingProvider)||void 0===c||c.track(h),this.integrationManager.track(h)}}},t.prototype.legacyExposureInternal=function(t,e,r){var i,n,o,a,s;if(this.analyticsProvider){var l=function(t,e,r,i){var n,o=null==r?void 0:r.value,a="[Experiment] ".concat(e);return{name:"[Experiment] Exposure",user:t,key:e,variant:r,userProperty:a,properties:{key:e,variant:o,source:i},userProperties:(n={},n[a]=o,n)}}(this.addContext(this.getUser()),t,e,r);ae(r)||!(null==e?void 0:e.value)?null===(n=null===(i=this.analyticsProvider)||void 0===i?void 0:i.unsetUserProperty)||void 0===n||n.call(i,l):(null==e?void 0:e.value)&&(null===(a=null===(o=this.analyticsProvider)||void 0===o?void 0:o.setUserProperty)||void 0===a||a.call(o,l),null===(s=this.analyticsProvider)||void 0===s||s.track(l))}},t.prototype.debug=function(t){for(var e=[],r=1;r<arguments.length;r++)e[r-1]=arguments[r];this.config.debug&&console.debug.apply(console,Gt([t],Xt(e),!1))},t.prototype.shouldRetryFetch=function(t){return!(t instanceof At)||(t.statusCode<400||t.statusCode>=500||429===t.statusCode)},t.prototype.addPlugin=function(t){"integration"===t.type&&this.integrationManager.setIntegration(t)},t}(),Ke=function(){function t(t,e){var r,i,n;this.globalScope=Lt(),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 qt.UAParser(this.userAgent).getResult(),this.localStorage=new de,this.sessionStorage=new ye,this.userProvider=t,this.apiKey=e,this.storageKey="EXP_".concat(null===(n=this.apiKey)||void 0===n?void 0:n.slice(0,10),"_DEFAULT_USER_PROVIDER")}return t.prototype.getUser=function(){var t,e,r,i,n,o=(null===(t=this.userProvider)||void 0===t?void 0:t.getUser())||{};return Wt({language:this.getLanguage(),platform:"Web",os:this.getOs(this.ua),device_model:this.getDeviceModel(this.ua),device_category:null!==(r=null===(e=this.ua.device)||void 0===e?void 0:e.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)},t.prototype.getLanguage=function(){return"undefined"!=typeof navigator&&(navigator.languages&&navigator.languages[0]||navigator.language)||""},t.prototype.getOs=function(t){var e,r;return[null===(e=t.browser)||void 0===e?void 0:e.name,null===(r=t.browser)||void 0===r?void 0:r.major].filter((function(t){return null!=t})).join(" ")},t.prototype.getDeviceModel=function(t){var e;return null===(e=t.os)||void 0===e?void 0:e.name},t.prototype.getBrowser=function(t){var e,r=null===(e=t.browser)||void 0===e?void 0:e.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},t.prototype.getCookie=function(){var t,e,r,i,n;if(null===(e=null===(t=this.globalScope)||void 0===t?void 0:t.document)||void 0===e?void 0:e.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(t){return t.split("=")})))},t.prototype.getLandingUrl=function(){var t,e;try{var r=JSON.parse(this.sessionStorage.get(this.storageKey)||"{}");return r.landing_url||(r.landing_url=null===(e=null===(t=this.globalScope)||void 0===t?void 0:t.location)||void 0===e?void 0:e.href.replace(/\/$/,""),this.sessionStorage.put(this.storageKey,JSON.stringify(r))),r.landing_url}catch(t){return}},t.prototype.getFirstSeen=function(){try{var t=JSON.parse(this.localStorage.get(this.storageKey)||"{}");return t.first_seen||(t.first_seen=(Date.now()/1e3).toString(),this.localStorage.put(this.storageKey,JSON.stringify(t))),t.first_seen}catch(t){return}},t.prototype.getUrlParam=function(){var t,e,r;if(this.globalScope){var i={};try{var n=new URL(this.globalScope.location.href);try{for(var o=$t(n.searchParams),a=o.next();!a.done;a=o.next()){var s=Xt(a.value,2),l=s[0],u=s[1];i[l]=Gt(Gt([],Xt(null!==(r=i[l])&&void 0!==r?r:[]),!1),Xt(u.split(",")),!1)}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}}catch(t){return}return Object.entries(i).reduce((function(t,e){var r=Xt(e,2),i=r[0],n=r[1];return t[i]=1==n.length?n[0]:n,t}),{})}},t}();jt.experimentInstances={};var De=jt.experimentInstances,qe=function(t,e){return Je(t,e)},Be=function(t,e){return Je(t,e,(function(){return new te(t,C.getInstance(ze(e)),1e4)}))},ze=function(t){return(null==t?void 0:t.instanceName)||se.instanceName},Je=function(t,e,r){var i=function(t,e){var r=ze(e),i=null==e?void 0:e.internalInstanceNameSuffix;return i?"".concat(r,".").concat(t,".").concat(i):"".concat(r,".").concat(t)}(t,e),n=De[i];return n||(n=function(t,e){return new Fe(t,Wt(Wt({},e),{userProvider:new Ke(null==e?void 0:e.userProvider,t)}))}(t,e),r&&n.addPlugin(r()),De[i]=n,n)},We={initialize:qe,initializeWithAmplitudeAnalytics:Be},He=function(){function t(){}return t.prototype.getUser=function(){return{}},t.prototype.start=function(t){return Ht(this,void 0,void 0,(function(){return Qt(this,(function(t){return[2]}))}))},t.prototype.stop=function(){},t.prototype.setUser=function(t){},t.prototype.fetch=function(t){return Ht(this,void 0,void 0,(function(){return Qt(this,(function(t){return[2,this]}))}))},t.prototype.getUserProvider=function(){return null},t.prototype.setUserProvider=function(t){return this},t.prototype.variant=function(t,e){return se.fallbackVariant},t.prototype.all=function(){return{}},t.prototype.clear=function(){},t.prototype.exposure=function(t){},t}(),Qe=Object.freeze({__proto__:null,AmplitudeAnalyticsProvider:zt,AmplitudeIntegrationPlugin:te,AmplitudeUserProvider:Bt,Experiment:We,ExperimentClient:Fe,get Source(){return ee},StubExperimentClient:He,initialize:qe,initializeWithAmplitudeAnalytics:Be}),$e=/^[a-zA-Z:_][a-zA-Z0-9:_.-]*$/,Xe={revert:function(){}},Ge=new Map,Ze=new Set;function Ye(t){var e=Ge.get(t);return e||(e={element:t,attributes:{}},Ge.set(t,e)),e}function tr(t,e,r,i,n){var o=r(t),a={isDirty:!1,originalValue:o,virtualValue:o,mutations:[],el:t,_positionTimeout:null,rateLimitCount:0,observer:new MutationObserver((function(){if(!(a.rateLimitCount>=10||(a.rateLimitCount++,setTimeout((function(){a.rateLimitCount=a.rateLimitCount-1,a.rateLimitCount<=0&&(a.rateLimitCount=0)}),1e3),"position"===e&&a._positionTimeout))){"position"===e&&(a._positionTimeout=setTimeout((function(){a._positionTimeout=null}),1e3));var i=r(t);"position"===e&&i.parentNode===a.virtualValue.parentNode&&i.insertBeforeNode===a.virtualValue.insertBeforeNode||i!==a.virtualValue&&(a.originalValue=i,n(a))}})),mutationRunner:n,setValue:i,getCurrentValue:r};return"position"===e&&t.parentNode?a.observer.observe(t.parentNode,{childList:!0,subtree:!0,attributes:!1,characterData:!1}):a.observer.observe(t,function(t){return"html"===t?{childList:!0,subtree:!0,attributes:!0,characterData:!0}:{childList:!1,subtree:!1,attributes:!0,attributeFilter:[t]}}(e)),a}function er(t,e){var r=e.getCurrentValue(e.el);e.virtualValue=t,t&&"string"!=typeof t?r&&t.parentNode===r.parentNode&&t.insertBeforeNode===r.insertBeforeNode||(e.isDirty=!0,xr()):t!==r&&(e.isDirty=!0,xr())}function rr(t){var e=t.originalValue;t.mutations.forEach((function(t){return e=t.mutate(e)})),er(function(t){vr||(vr=document.createElement("div"));return vr.innerHTML=t,vr.innerHTML}(e),t)}function ir(t){var e=new Set(t.originalValue.split(/\s+/).filter(Boolean));t.mutations.forEach((function(t){return t.mutate(e)})),er(Array.from(e).filter(Boolean).join(" "),t)}function nr(t){var e=t.originalValue;t.mutations.forEach((function(t){return e=t.mutate(e)})),er(e,t)}function or(t){var e=t.originalValue;t.mutations.forEach((function(t){var r=function(t){var e=t.parentSelector,r=t.insertBeforeSelector,i=document.querySelector(e);if(!i)return null;var n=r?document.querySelector(r):null;return r&&!n?null:{parentNode:i,insertBeforeNode:n}}(t.mutate());e=r||e})),er(e,t)}var ar=function(t){return t.innerHTML},sr=function(t,e){return t.innerHTML=e};function lr(t){var e=Ye(t);return e.html||(e.html=tr(t,"html",ar,sr,rr)),e.html}var ur=function(t){return{parentNode:t.parentElement,insertBeforeNode:t.nextElementSibling}},cr=function(t,e){e.insertBeforeNode&&!e.parentNode.contains(e.insertBeforeNode)||e.parentNode.insertBefore(t,e.insertBeforeNode)};function hr(t){var e=Ye(t);return e.position||(e.position=tr(t,"position",ur,cr,or)),e.position}var fr=function(t,e){return e?t.className=e:t.removeAttribute("class")},dr=function(t){return t.className};function pr(t){var e=Ye(t);return e.classes||(e.classes=tr(t,"class",dr,fr,ir)),e.classes}var vr,yr,mr=function(t){return function(e){var r;return null!=(r=e.getAttribute(t))?r:null}},gr=function(t){return function(e,r){return null!==r?e.setAttribute(t,r):e.removeAttribute(t)}};function br(t,e){var r=Ye(t);return r.attributes[e]||(r.attributes[e]=tr(t,e,mr(e),gr(e),nr)),r.attributes[e]}function wr(t,e,r){if(r.isDirty){r.isDirty=!1;var i=r.virtualValue;r.mutations.length||function(t,e){var r,i,n=Ge.get(t);if(n)if("html"===e)null==(r=n.html)||null==(i=r.observer)||i.disconnect(),delete n.html;else if("class"===e){var o,a;null==(o=n.classes)||null==(a=o.observer)||a.disconnect(),delete n.classes}else if("position"===e){var s,l;null==(s=n.position)||null==(l=s.observer)||l.disconnect(),delete n.position}else{var u,c,h;null==(u=n.attributes)||null==(c=u[e])||null==(h=c.observer)||h.disconnect(),delete n.attributes[e]}}(t,e),r.setValue(t,i)}}function Sr(t,e){t.html&&wr(e,"html",t.html),t.classes&&wr(e,"class",t.classes),t.position&&wr(e,"position",t.position),Object.keys(t.attributes).forEach((function(r){wr(e,r,t.attributes[r])}))}function xr(){Ge.forEach(Sr)}function kr(t){if("position"!==t.kind||1!==t.elements.size){var e=new Set(t.elements);document.querySelectorAll(t.selector).forEach((function(r){e.has(r)||(t.elements.add(r),function(t,e){var r=null;"html"===t.kind?r=lr(e):"class"===t.kind?r=pr(e):"attribute"===t.kind?r=br(e,t.attribute):"position"===t.kind&&(r=hr(e)),r&&(r.mutations.push(t),r.mutationRunner(r))}(t,r))}))}}function Er(t){t.elements.forEach((function(e){return function(t,e){var r=null;if("html"===t.kind?r=lr(e):"class"===t.kind?r=pr(e):"attribute"===t.kind?r=br(e,t.attribute):"position"===t.kind&&(r=hr(e)),r){var i=r.mutations.indexOf(t);-1!==i&&r.mutations.splice(i,1),r.mutationRunner(r)}}(t,e)})),t.elements.clear(),Ze.delete(t)}function Ir(){Ze.forEach(kr)}function Cr(t){return"undefined"==typeof document?Xe:(Ze.add(t),kr(t),{revert:function(){Er(t)}})}function Tr(t,e){return Cr({kind:"html",elements:new Set,mutate:e,selector:t})}function Pr(t,e){return Cr({kind:"position",elements:new Set,mutate:e,selector:t})}function Or(t,e){return Cr({kind:"class",elements:new Set,mutate:e,selector:t})}function Ar(t,e,r){return $e.test(e)?"class"===e||"className"===e?Or(t,(function(t){var e=r(Array.from(t).join(" "));t.clear(),e&&e.split(/\s+/g).filter(Boolean).forEach((function(e){return t.add(e)}))})):Cr({kind:"attribute",attribute:e,elements:new Set,mutate:r,selector:t}):Xe}"undefined"!=typeof document&&(yr||(yr=new MutationObserver((function(){Ir()}))),Ir(),yr.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!1,characterData:!1}));var Mr={html:Tr,classes:Or,attribute:Ar,position:Pr,declarative:function(t){var e=t.selector,r=t.action,i=t.value,n=t.attribute,o=t.parentSelector,a=t.insertBeforeSelector;if("html"===n){if("append"===r)return Tr(e,(function(t){return t+(null!=i?i:"")}));if("set"===r)return Tr(e,(function(){return null!=i?i:""}))}else if("class"===n){if("append"===r)return Or(e,(function(t){i&&t.add(i)}));if("remove"===r)return Or(e,(function(t){i&&t.delete(i)}));if("set"===r)return Or(e,(function(t){t.clear(),i&&t.add(i)}))}else if("position"===n){if("set"===r&&o)return Pr(e,(function(){return{insertBeforeSelector:a,parentSelector:o}}))}else{if("append"===r)return Ar(e,n,(function(t){return null!==t?t+(null!=i?i:""):null!=i?i:""}));if("set"===r)return Ar(e,n,(function(){return null!=i?i:""}));if("remove"===r)return Ar(e,n,(function(){return null}))}return Xe}},_r={useDefaultNavigationHandler:!0},Nr=function(){function t(){}return t.setup=function(){var t,e="closed";null===(t=Lt())||void 0===t||t.addEventListener("message",(function(t){var r=/^.*\.amplitude\.com$/;try{if(!t.origin||!r.test(new URL(t.origin).hostname))return}catch(t){return}if("OpenOverlay"===t.data.type){if("closed"!==e||!r.test(new URL(t.data.context.injectSrc).hostname))return;e="opening",Ur(t.data.context.injectSrc).then((function(){e="open"})).catch((function(){e="closed"}))}}))},t}(),Ur=function(t){return new Promise((function(e,r){var i;try{var n=document.createElement("script");n.type="text/javascript",n.async=!0,n.src=t,n.addEventListener("load",(function(){e({status:!0})}),{once:!0}),n.addEventListener("error",(function(){r({status:!1,message:"Failed to load the script ".concat(t)})})),null===(i=document.head)||void 0===i||i.appendChild(n)}catch(t){r(t)}}))},Vr=function(){var t,e,r=Lt(),i=new URLSearchParams(null==r?void 0:r.location.search),n={};try{for(var o=p(i),a=o.next();!a.done;a=o.next()){var s=v(a.value,2),l=s[0],u=s[1];n[l]=u}}catch(e){t={error:e}}finally{try{a&&!a.done&&(e=o.return)&&e.call(o)}finally{if(t)throw t.error}}return n},Rr=function(t){if(!t)return"";var e=new URL(t);return e.search="",e.hash="",e.toString()},jr=function(t,e){var r,i,n=new URL(t);try{for(var o=p(e),a=o.next();!a.done;a=o.next()){var s=a.value;n.searchParams.delete(s)}}catch(t){r={error:t}}finally{try{a&&!a.done&&(i=o.return)&&i.call(o)}finally{if(r)throw r.error}}return n.toString()},Lr=function(t){return t?(t^16*Math.random()>>t/4).toString(16):(String(1e7)+String(-1e3)+String(-4e3)+String(-8e3)+String(-1e11)).replace(/[018]/g,Lr)},Fr="Page not targeted",Kr="Page is excluded",Dr="mutate",qr="inject";jt.Experiment=Qe;var Br=function(){function t(t,e,r){void 0===r&&(r={});var i,n=this;this.appliedInjections=new Set,this.appliedMutations={},this.previousUrl=void 0,this.urlExposureCache={},this.flagVariantMap={},this.localFlagKeys=[],this.remoteFlagKeys=[],this.isRemoteBlocking=!1,this.isRunning=!1;var o=Lt();if(!o||!Ft())throw new Error("Amplitude Web Experiment Client could not be initialized.");this.globalScope=o,this.apiKey=t,this.initialFlags=JSON.parse(e),this.config=h(h(h({},_r),r),null!==(i=this.globalScope.experimentConfig)&&void 0!==i?i:{});var a=Vr();this.initialFlags.forEach((function(t){var e=t.key,r=t.variants,i=t.segments,o=t.metadata,s=void 0===o?{}:o;if(n.flagVariantMap[e]={},Object.keys(r).forEach((function(t){n.flagVariantMap[e][t]=function(t){if(!t)return{};var e=void 0;t.metadata&&(e="string"==typeof t.metadata.experimentKey?t.metadata.experimentKey:void 0);var r={};return t.key&&(r.key=t.key),t.value&&(r.value=t.value),t.payload&&(r.payload=t.payload),e&&(r.expKey=e),t.metadata&&(r.metadata=t.metadata),r}(r[t])})),a.PREVIEW&&e in a&&a[e]in r){n.globalScope.history.replaceState({},"",jr(n.globalScope.location.href,["PREVIEW",e]));var l=i.filter(n.isPageTargetingSegment),u={metadata:{segmentName:"Preview"},variant:a[e]};t.segments=y(y([],v(l),!1),[u],!1),s.evaluationMode="local"}"local"!==s.evaluationMode&&n.remoteFlagKeys.push(e),t.metadata=s}));var s=JSON.stringify(this.initialFlags);this.experimentClient=We.initialize(this.apiKey,h({internalInstanceNameSuffix:"web",initialFlags:s,fetchTimeoutMillis:1e3,pollOnStart:!1,fetchOnStart:!1,automaticExposureTracking:!1},this.config));var l=this.experimentClient.all();this.localFlagKeys=Object.keys(l).filter((function(t){var e,r;return"local"===(null===(r=null===(e=l[t])||void 0===e?void 0:e.metadata)||void 0===r?void 0:r.evaluationMode)}))}return t.prototype.start=function(){var t,e,r,i,n,o;return f(this,void 0,void 0,(function(){var a,s,l,u,c,h,f,m,g,b,w;return d(this,(function(d){switch(d.label){case 0:if(this.isRunning)return[2];if(Vr().VISUAL_EDITOR)return Nr.setup(),this.globalScope.history.replaceState({},"",jr(this.globalScope.location.href,["VISUAL_EDITOR"])),[2];a="EXP_".concat(this.apiKey.slice(0,10));try{s=JSON.parse(this.globalScope.localStorage.getItem(a)||"{}")}catch(t){s={}}s.web_exp_id?s.web_exp_id&&s.device_id&&(delete s.device_id,this.globalScope.localStorage.setItem(a,JSON.stringify(s))):(s.web_exp_id=s.device_id||Lr(),delete s.device_id,this.globalScope.localStorage.setItem(a,JSON.stringify(s))),l=this.getVariants();try{for(u=p(Object.entries(l)),c=u.next();!c.done;c=u.next())h=v(c.value,2),f=h[0],m=h[1],this.remoteFlagKeys.includes(f)&&(null===(t=m.metadata)||void 0===t?void 0:t.blockingEvaluation)&&(null===(e=m.metadata)||void 0===e?void 0:e.segmentName)!==Fr&&(null===(r=m.metadata)||void 0===r?void 0:r.segmentName)!==Kr&&(this.isRemoteBlocking=!0,this.applyAntiFlickerCss())}catch(t){b={error:t}}finally{try{c&&!c.done&&(w=u.return)&&w.call(u)}finally{if(b)throw b.error}}return this.globalScope.experimentIntegration||(g=C.getInstance("$default_instance"),this.globalScope.experimentIntegration=new te(this.apiKey,g,1e3)),this.globalScope.experimentIntegration.type="integration",this.experimentClient.addPlugin(this.globalScope.experimentIntegration),this.experimentClient.setUser(s),this.config.useDefaultNavigationHandler&&this.setDefaultNavigationHandler(y(y([],v(this.localFlagKeys),!1),v(this.remoteFlagKeys),!1)),this.applyVariants({flagKeys:this.localFlagKeys}),this.isRemoteBlocking||null===(o=null===(n=(i=this.globalScope.document).getElementById)||void 0===n?void 0:n.call(i,"amp-exp-css"))||void 0===o||o.remove(),0===this.remoteFlagKeys.length?(this.isRunning=!0,[2]):[4,this.fetchRemoteFlags()];case 1:return d.sent(),this.applyVariants({flagKeys:this.remoteFlagKeys}),this.isRunning=!0,[2]}}))}))},t.getInstance=function(e,r,i){void 0===i&&(i={});var n=Lt();if(!n)throw new Error("Amplitude Web Experiment Client could not be initialized.");if(null==n?void 0:n.webExperiment)return n.webExperiment;var o=new t(e,r,i);return n.webExperiment=o,o},t.prototype.getExperimentClient=function(){return this.experimentClient},t.prototype.applyVariants=function(t){var e,r,i,n,o=(t||{}).flagKeys,a=this.getVariants();if(0!==Object.keys(a).length){var s=Rr(this.globalScope.location.href);for(var l in(null===(e=this.urlExposureCache)||void 0===e?void 0:e[s])||(this.urlExposureCache={},this.urlExposureCache[s]={}),a)if(!o||o.includes(l)){var u=a[l];if("web"===(null===(r=u.metadata)||void 0===r?void 0:r.deliveryMethod)){var c=null===(n=null===(i=u.metadata)||void 0===i?void 0:i.trackExposure)||void 0===n||n,h=Array.isArray(u.payload),f=!u.payload||h&&0===u.payload.length;if(c&&f){this.exposureWithDedupe(l,u);continue}h&&this.handleVariantAction(l,u)}}}},t.prototype.revertVariants=function(t){var e,r,i=(t||{}).flagKeys;i||(i=Object.keys(this.appliedMutations));try{for(var n=p(i),o=n.next();!o.done;o=n.next()){var a=o.value,s=this.appliedMutations[a];if(s){for(var l in s)s[l].forEach((function(t){t.revert()})),delete s[l];0===Object.keys(this.appliedMutations[a]).length&&delete this.appliedMutations[a]}}}catch(t){e={error:t}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(e)throw e.error}}},t.prototype.previewVariants=function(t){var e=t.keyToVariant;if(e)for(var r in this.revertVariants({flagKeys:Object.keys(e)}),e){var i=e[r],n=this.flagVariantMap[r];if(!n)return;var o=n[i];if(!o)return;var a=o.payload;if(!a||!Array.isArray(a))return;this.handleVariantAction(r,o)}},t.prototype.getVariants=function(){var t,e,r={};try{for(var i=p(y(y([],v(this.localFlagKeys),!1),v(this.remoteFlagKeys),!1)),n=i.next();!n.done;n=i.next()){var o=n.value;r[o]=this.experimentClient.variant(o)}}catch(e){t={error:e}}finally{try{n&&!n.done&&(e=i.return)&&e.call(i)}finally{if(t)throw t.error}}return r},t.prototype.getActiveExperiments=function(){var t=this.getVariants();return Object.keys(t).filter((function(e){var r,i;return(null===(r=t[e].metadata)||void 0===r?void 0:r.segmentName)!==Fr&&(null===(i=t[e].metadata)||void 0===i?void 0:i.segmentName)!==Kr}))},t.prototype.setRedirectHandler=function(t){this.customRedirectHandler=t},t.prototype.fetchRemoteFlags=function(){return f(this,void 0,void 0,(function(){var t;return d(this,(function(e){switch(e.label){case 0:return e.trys.push([0,2,,3]),[4,this.experimentClient.doFlags()];case 1:return e.sent(),[3,3];case 2:return t=e.sent(),console.warn("Error fetching remote flags:",t),[3,3];case 3:return[2]}}))}))},t.prototype.handleVariantAction=function(t,e){var r,i;try{for(var n=p(e.payload),o=n.next();!o.done;o=n.next()){var a=o.value;"redirect"===a.action?this.handleRedirect(a,t,e):a.action===Dr?this.handleMutate(a,t,e):a.action===qr&&this.handleInject(a,t,e)}}catch(t){r={error:t}}finally{try{o&&!o.done&&(i=n.return)&&i.call(n)}finally{if(r)throw r.error}}},t.prototype.handleRedirect=function(t,e,r){var i,n=Rr(this.previousUrl||this.globalScope.document.referrer),o=null===(i=null==t?void 0:t.data)||void 0===i?void 0:i.url;if(Rr(this.globalScope.location.href)!==n){var a=function(t,e){var r=new URL(t),i=new URL(e),n=new URL(e);return r.searchParams.forEach((function(t,e){i.searchParams.has(e)||n.searchParams.append(e,t)})),n.toString()}(this.globalScope.location.href,o);this.exposureWithDedupe(e,r),this.previousUrl=this.globalScope.location.href,this.customRedirectHandler?this.customRedirectHandler(a):this.globalScope.location.replace(a)}},t.prototype.handleMutate=function(t,e,r){var i,n,o,a;if(!(null===(i=this.appliedMutations[e])||void 0===i?void 0:i[Dr])){var s=null===(n=t.data)||void 0===n?void 0:n.mutations;if(0!==s.length){var l=[];s.forEach((function(t){l.push(Mr.declarative(t))})),(null!==(o=(a=this.appliedMutations)[e])&&void 0!==o?o:a[e]={})[Dr]=l,this.exposureWithDedupe(e,r)}}},t.prototype.handleInject=function(t,e,r){var i,n,o,a,s,l=this,u=t.data.id;if(u&&"string"==typeof u&&0!==u.length&&(u=u.replace(/-/g,""),!this.appliedInjections.has(u))){var c,h=t.data.js;h&&(c=this.globalScope.document.createElement("script"))&&(c.innerHTML="function ".concat(u,"(html, utils, id){").concat(h,"};"),c.id="js-".concat(u),this.globalScope.document.head.appendChild(c));var p,v=t.data.css;v&&(p=this.globalScope.document.createElement("style"))&&(p.innerHTML=v,p.id="css-".concat(u),this.globalScope.document.head.appendChild(p));var y,m=t.data.html;m&&(y=null!==(i=(new DOMParser).parseFromString(m,"text/html").body.firstElementChild)&&void 0!==i?i:void 0);var g={waitForElement:function(t){return f(this,void 0,void 0,(function(){var e;return d(this,(function(r){return(e=document.querySelector(t))?[2,e]:[2,new Promise((function(e){var r=new MutationObserver((function(){var i=document.querySelector(t);i&&(r.disconnect(),e(i))}));r.observe(document.documentElement,{childList:!0,subtree:!0,attributes:!0})}))]}))}))}};this.appliedInjections.add(u);try{var b=this.globalScope[u];b&&"function"==typeof b&&b(y,g,u)}catch(t){null==c||c.remove(),console.error("Experiment inject failed for ".concat(e," variant ").concat(r.key,". Reason:"),t)}null!==(o=(s=null!==(n=(a=this.appliedMutations)[e])&&void 0!==n?n:a[e]={})[qr])&&void 0!==o||(s[qr]=[]),this.appliedMutations[e][qr].push({revert:function(){var t;null===(t=g.remove)||void 0===t||t.call(g),null==p||p.remove(),null==c||c.remove(),l.appliedInjections.delete(u)}}),this.exposureWithDedupe(e,r)}},t.prototype.isPageTargetingSegment=function(t){var e,r,i;return!1===(null===(e=t.metadata)||void 0===e?void 0:e.trackExposure)&&((null===(r=t.metadata)||void 0===r?void 0:r.segmentName)===Fr||(null===(i=t.metadata)||void 0===i?void 0:i.segmentName)===Kr)},t.prototype.exposureWithDedupe=function(t,e){var r,i,n,o,a=null===(i=null===(r=e.metadata)||void 0===r?void 0:r.trackExposure)||void 0===i||i,s=Rr(this.globalScope.location.href),l=(null===(o=null===(n=this.urlExposureCache)||void 0===n?void 0:n[s])||void 0===o?void 0:o[t])===e.key;a&&!l&&(this.experimentClient.exposure(t),this.urlExposureCache[s][t]=e.key)},t.prototype.applyAntiFlickerCss=function(){if(!this.globalScope.document.getElementById("amp-exp-css")){var t=document.createElement("style");t.id="amp-exp-css",t.innerText="* { visibility: hidden !important; background-image: none !important; }",document.head.appendChild(t),this.globalScope.window.setTimeout((function(){t.remove()}),1e3)}},t.prototype.setDefaultNavigationHandler=function(t){var e=this;this.globalScope.addEventListener("popstate",(function(){e.revertVariants(),e.applyVariants({flagKeys:t})}));var r,i,n=function(){e.revertVariants(),e.applyVariants({flagKeys:t}),e.previousUrl=e.globalScope.location.href};r=history.pushState,i=history.replaceState,history.pushState=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var i=r.apply(this,t);return n(),i},history.replaceState=function(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var r=i.apply(this,t);return n(),r}},t}();Br.getInstance("{{DEPLOYMENT_KEY}}","{{INITIAL_FLAGS}}",{serverZone:"{{SERVER_ZONE}}"}).start().then((function(){var t;null===(t=document.getElementById("amp-exp-css"))||void 0===t||t.remove()}))}));
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { ExperimentConfig } from '@amplitude/experiment-js-client';
|
|
2
|
-
export interface WebExperimentConfig extends ExperimentConfig {
|
|
3
|
-
/**
|
|
4
|
-
* Determines whether the default implementation for handling navigation {@link setDefaultUrlChangeHandler} will be used
|
|
5
|
-
* If this is set to false, for single-page applications:
|
|
6
|
-
* 1. The variant actions applied will be based on the context (user, page URL) when the web experiment script was loaded
|
|
7
|
-
* 2. Custom handling of navigation should be implemented such that variant actions applied on the site reflect the latest context
|
|
8
|
-
*/
|
|
9
|
-
useDefaultNavigationHandler?: boolean;
|
|
10
|
-
}
|
|
11
|
-
export declare const Defaults: WebExperimentConfig;
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { ExperimentClient, Variants } from '@amplitude/experiment-js-client';
|
|
2
|
-
import { WebExperimentConfig } from './config';
|
|
3
|
-
import { ApplyVariantsOptions, PreviewVariantsOptions, RevertVariantsOptions } from './types';
|
|
4
|
-
import { WebExperimentClient } from './web-experiment';
|
|
5
|
-
export declare const PAGE_NOT_TARGETED_SEGMENT_NAME = "Page not targeted";
|
|
6
|
-
export declare const PAGE_IS_EXCLUDED_SEGMENT_NAME = "Page is excluded";
|
|
7
|
-
export declare const PREVIEW_SEGMENT_NAME = "Preview";
|
|
8
|
-
export declare class DefaultWebExperimentClient implements WebExperimentClient {
|
|
9
|
-
private readonly apiKey;
|
|
10
|
-
private readonly initialFlags;
|
|
11
|
-
private readonly config;
|
|
12
|
-
private readonly globalScope;
|
|
13
|
-
private readonly experimentClient;
|
|
14
|
-
private appliedInjections;
|
|
15
|
-
private appliedMutations;
|
|
16
|
-
private previousUrl;
|
|
17
|
-
private urlExposureCache;
|
|
18
|
-
private flagVariantMap;
|
|
19
|
-
private localFlagKeys;
|
|
20
|
-
private remoteFlagKeys;
|
|
21
|
-
private isRemoteBlocking;
|
|
22
|
-
private customRedirectHandler;
|
|
23
|
-
private isRunning;
|
|
24
|
-
constructor(apiKey: string, initialFlags: string, config?: WebExperimentConfig);
|
|
25
|
-
/**
|
|
26
|
-
* Start the web experiment client.
|
|
27
|
-
*/
|
|
28
|
-
start(): Promise<void>;
|
|
29
|
-
/**
|
|
30
|
-
* Get singleton of the {@link DefaultWebExperimentClient} if it has already been initialized.
|
|
31
|
-
* If not, initialize the client and return the instance.
|
|
32
|
-
* @param apiKey
|
|
33
|
-
* @param initialFlags
|
|
34
|
-
* @param config
|
|
35
|
-
*/
|
|
36
|
-
static getInstance(apiKey: string, initialFlags: string, config?: WebExperimentConfig): DefaultWebExperimentClient;
|
|
37
|
-
/**
|
|
38
|
-
* Get the underlying {@link ExperimentClient} instance.
|
|
39
|
-
*/
|
|
40
|
-
getExperimentClient(): ExperimentClient;
|
|
41
|
-
/**
|
|
42
|
-
* Apply evaluated variants to the page.
|
|
43
|
-
* @param options
|
|
44
|
-
*/
|
|
45
|
-
applyVariants(options?: ApplyVariantsOptions): void;
|
|
46
|
-
/**
|
|
47
|
-
* Revert variant actions applied by the experiment.
|
|
48
|
-
* @param options
|
|
49
|
-
*/
|
|
50
|
-
revertVariants(options?: RevertVariantsOptions): void;
|
|
51
|
-
/**
|
|
52
|
-
* Preview the effect of a variant on the page.
|
|
53
|
-
* @param options
|
|
54
|
-
*/
|
|
55
|
-
previewVariants(options: PreviewVariantsOptions): void;
|
|
56
|
-
/**
|
|
57
|
-
* Get all variants for the current web experiment context.
|
|
58
|
-
*/
|
|
59
|
-
getVariants(): Variants;
|
|
60
|
-
/**
|
|
61
|
-
* Get the list of experiments that are active on the current page.
|
|
62
|
-
*/
|
|
63
|
-
getActiveExperiments(): string[];
|
|
64
|
-
/**
|
|
65
|
-
* Set a custom redirect handler.
|
|
66
|
-
*/
|
|
67
|
-
setRedirectHandler(handler: (url: string) => void): void;
|
|
68
|
-
private fetchRemoteFlags;
|
|
69
|
-
private handleVariantAction;
|
|
70
|
-
private handleRedirect;
|
|
71
|
-
private handleMutate;
|
|
72
|
-
private handleInject;
|
|
73
|
-
private isPageTargetingSegment;
|
|
74
|
-
private exposureWithDedupe;
|
|
75
|
-
private applyAntiFlickerCss;
|
|
76
|
-
private setDefaultNavigationHandler;
|
|
77
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
export interface InjectUtils {
|
|
2
|
-
/**
|
|
3
|
-
* Returns a promise that is resolved when an element matching the selector
|
|
4
|
-
* is found in DOM.
|
|
5
|
-
*
|
|
6
|
-
* @param selector The element selector to query for.
|
|
7
|
-
*/
|
|
8
|
-
waitForElement(selector: string): Promise<Element>;
|
|
9
|
-
/**
|
|
10
|
-
* Function which can be set inside injected javascript code. This function is
|
|
11
|
-
* called on page change, when experiments are re-evaluated.
|
|
12
|
-
*
|
|
13
|
-
* Useful for cleaning up changes to the page that have been made in single
|
|
14
|
-
* page apps, where page the page is not fully reloaded. For example, if you
|
|
15
|
-
* inject an HTML element on a specific page, you can set this function to
|
|
16
|
-
* remove the injected element on page change.
|
|
17
|
-
*/
|
|
18
|
-
remove: (() => void) | undefined;
|
|
19
|
-
}
|
|
20
|
-
export declare const getInjectUtils: () => InjectUtils;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
export type ApplyVariantsOptions = {
|
|
2
|
-
/**
|
|
3
|
-
* A list of flag keys to apply.
|
|
4
|
-
*/
|
|
5
|
-
flagKeys?: string[];
|
|
6
|
-
};
|
|
7
|
-
export type RevertVariantsOptions = {
|
|
8
|
-
/**
|
|
9
|
-
* A list of flag keys to revert.
|
|
10
|
-
*/
|
|
11
|
-
flagKeys?: string[];
|
|
12
|
-
};
|
|
13
|
-
export type PreviewVariantsOptions = {
|
|
14
|
-
/**
|
|
15
|
-
* A map of flag keys to variant keys to be previewed.
|
|
16
|
-
*/
|
|
17
|
-
keyToVariant?: Record<string, string>;
|
|
18
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { EvaluationVariant } from '@amplitude/experiment-core';
|
|
2
|
-
import { Variant } from '@amplitude/experiment-js-client';
|
|
3
|
-
export declare const getUrlParams: () => Record<string, string>;
|
|
4
|
-
export declare const urlWithoutParamsAndAnchor: (url: string) => string;
|
|
5
|
-
export declare const removeQueryParams: (url: string, paramsToRemove: string[]) => string;
|
|
6
|
-
export declare const UUID: (a?: any) => string;
|
|
7
|
-
export declare const matchesUrl: (urlArray: string[], urlString: string) => boolean;
|
|
8
|
-
export declare const concatenateQueryParamsOf: (currentUrl: string, redirectUrl: string) => string;
|
|
9
|
-
export declare const convertEvaluationVariantToVariant: (evaluationVariant: EvaluationVariant) => Variant;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { ExperimentClient, Variants } from '@amplitude/experiment-js-client';
|
|
2
|
-
import { ApplyVariantsOptions, PreviewVariantsOptions, RevertVariantsOptions } from './types';
|
|
3
|
-
/**
|
|
4
|
-
* Interface for the Web Experiment client.
|
|
5
|
-
*/
|
|
6
|
-
export interface WebExperimentClient {
|
|
7
|
-
start(): void;
|
|
8
|
-
getExperimentClient(): ExperimentClient;
|
|
9
|
-
applyVariants(options?: ApplyVariantsOptions): void;
|
|
10
|
-
revertVariants(options?: RevertVariantsOptions): void;
|
|
11
|
-
previewVariants(options: PreviewVariantsOptions): void;
|
|
12
|
-
getVariants(): Variants;
|
|
13
|
-
getActiveExperiments(): string[];
|
|
14
|
-
setRedirectHandler(handler: (url: string) => void): void;
|
|
15
|
-
}
|