wineater-bot 3.8.0 → 3.8.2

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.
@@ -30,7 +30,7 @@ function mi() {
30
30
  return e || (e = pi(), Rs(t, e, 365)), e;
31
31
  }
32
32
  var $e = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
33
- function bi(t) {
33
+ function vi(t) {
34
34
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
35
35
  }
36
36
  var $n = { exports: {} };
@@ -38,48 +38,48 @@ var $n = { exports: {} };
38
38
  (function(n, s) {
39
39
  s(e);
40
40
  })($e, function(n) {
41
- var s = { getItemSync: function(y) {
41
+ var s = { getItemSync: function(b) {
42
42
  try {
43
- return localStorage.getItem(y) || null;
43
+ return localStorage.getItem(b) || null;
44
44
  } catch {
45
45
  return null;
46
46
  }
47
- }, getItem: function(y, f) {
47
+ }, getItem: function(b, f) {
48
48
  var h = this;
49
49
  return new Promise(function(m, g) {
50
50
  try {
51
- var S = h.getItemSync(y);
51
+ var S = h.getItemSync(b);
52
52
  f == null || f(null, S), m(S);
53
- } catch (x) {
54
- f && f(x, null), g(x);
53
+ } catch (k) {
54
+ f && f(k, null), g(k);
55
55
  }
56
56
  });
57
- }, setItem: function(y, f, h) {
57
+ }, setItem: function(b, f, h) {
58
58
  return new Promise(function(m, g) {
59
59
  try {
60
- localStorage.setItem(y, f), h && h(null, f), m(f);
60
+ localStorage.setItem(b, f), h && h(null, f), m(f);
61
61
  } catch (S) {
62
62
  h && h(S, null), g(S);
63
63
  }
64
64
  });
65
65
  } }, i = function() {
66
- return i = Object.assign || function(y) {
66
+ return i = Object.assign || function(b) {
67
67
  for (var f, h = 1, m = arguments.length; h < m; h++)
68
68
  for (var g in f = arguments[h])
69
- Object.prototype.hasOwnProperty.call(f, g) && (y[g] = f[g]);
70
- return y;
69
+ Object.prototype.hasOwnProperty.call(f, g) && (b[g] = f[g]);
70
+ return b;
71
71
  }, i.apply(this, arguments);
72
72
  };
73
- function r(y, f, h, m) {
73
+ function r(b, f, h, m) {
74
74
  return new (h || (h = Promise))(function(g, S) {
75
- function x(q) {
75
+ function k(q) {
76
76
  try {
77
77
  B(m.next(q));
78
78
  } catch (O) {
79
79
  S(O);
80
80
  }
81
81
  }
82
- function A(q) {
82
+ function L(q) {
83
83
  try {
84
84
  B(m.throw(q));
85
85
  } catch (O) {
@@ -90,26 +90,26 @@ var $n = { exports: {} };
90
90
  var O;
91
91
  q.done ? g(q.value) : (O = q.value, O instanceof h ? O : new h(function(W) {
92
92
  W(O);
93
- })).then(x, A);
93
+ })).then(k, L);
94
94
  }
95
- B((m = m.apply(y, f || [])).next());
95
+ B((m = m.apply(b, f || [])).next());
96
96
  });
97
97
  }
98
- function o(y, f) {
99
- var h, m, g, S, x = { label: 0, sent: function() {
98
+ function o(b, f) {
99
+ var h, m, g, S, k = { label: 0, sent: function() {
100
100
  if (1 & g[0])
101
101
  throw g[1];
102
102
  return g[1];
103
103
  }, trys: [], ops: [] };
104
- return S = { next: A(0), throw: A(1), return: A(2) }, typeof Symbol == "function" && (S[Symbol.iterator] = function() {
104
+ return S = { next: L(0), throw: L(1), return: L(2) }, typeof Symbol == "function" && (S[Symbol.iterator] = function() {
105
105
  return this;
106
106
  }), S;
107
- function A(B) {
107
+ function L(B) {
108
108
  return function(q) {
109
109
  return function(O) {
110
110
  if (h)
111
111
  throw new TypeError("Generator is already executing.");
112
- for (; x; )
112
+ for (; k; )
113
113
  try {
114
114
  if (h = 1, m && (g = 2 & O[0] ? m.return : O[0] ? m.throw || ((g = m.return) && g.call(m), 0) : m.next) && !(g = g.call(m, O[1])).done)
115
115
  return g;
@@ -119,34 +119,34 @@ var $n = { exports: {} };
119
119
  g = O;
120
120
  break;
121
121
  case 4:
122
- return x.label++, { value: O[1], done: !1 };
122
+ return k.label++, { value: O[1], done: !1 };
123
123
  case 5:
124
- x.label++, m = O[1], O = [0];
124
+ k.label++, m = O[1], O = [0];
125
125
  continue;
126
126
  case 7:
127
- O = x.ops.pop(), x.trys.pop();
127
+ O = k.ops.pop(), k.trys.pop();
128
128
  continue;
129
129
  default:
130
- if (g = x.trys, !((g = g.length > 0 && g[g.length - 1]) || O[0] !== 6 && O[0] !== 2)) {
131
- x = 0;
130
+ if (g = k.trys, !((g = g.length > 0 && g[g.length - 1]) || O[0] !== 6 && O[0] !== 2)) {
131
+ k = 0;
132
132
  continue;
133
133
  }
134
134
  if (O[0] === 3 && (!g || O[1] > g[0] && O[1] < g[3])) {
135
- x.label = O[1];
135
+ k.label = O[1];
136
136
  break;
137
137
  }
138
- if (O[0] === 6 && x.label < g[1]) {
139
- x.label = g[1], g = O;
138
+ if (O[0] === 6 && k.label < g[1]) {
139
+ k.label = g[1], g = O;
140
140
  break;
141
141
  }
142
- if (g && x.label < g[2]) {
143
- x.label = g[2], x.ops.push(O);
142
+ if (g && k.label < g[2]) {
143
+ k.label = g[2], k.ops.push(O);
144
144
  break;
145
145
  }
146
- g[2] && x.ops.pop(), x.trys.pop();
146
+ g[2] && k.ops.pop(), k.trys.pop();
147
147
  continue;
148
148
  }
149
- O = f.call(y, x);
149
+ O = f.call(b, k);
150
150
  } catch (W) {
151
151
  O = [6, W], m = 0;
152
152
  } finally {
@@ -159,13 +159,13 @@ var $n = { exports: {} };
159
159
  };
160
160
  }
161
161
  }
162
- function l(y, f, h) {
162
+ function l(b, f, h) {
163
163
  if (h || arguments.length === 2)
164
164
  for (var m, g = 0, S = f.length; g < S; g++)
165
165
  !m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
166
- return y.concat(m || Array.prototype.slice.call(f));
166
+ return b.concat(m || Array.prototype.slice.call(f));
167
167
  }
168
- var c = function y(f, h) {
168
+ var c = function b(f, h) {
169
169
  if (f === h)
170
170
  return !0;
171
171
  if (f && h && typeof f == "object" && typeof h == "object") {
@@ -176,7 +176,7 @@ var $n = { exports: {} };
176
176
  if ((m = f.length) != h.length)
177
177
  return !1;
178
178
  for (g = m; g-- != 0; )
179
- if (!y(f[g], h[g]))
179
+ if (!b(f[g], h[g]))
180
180
  return !1;
181
181
  return !0;
182
182
  }
@@ -192,84 +192,84 @@ var $n = { exports: {} };
192
192
  if (!Object.prototype.hasOwnProperty.call(h, S[g]))
193
193
  return !1;
194
194
  for (g = m; g-- != 0; ) {
195
- var x = S[g];
196
- if (!y(f[x], h[x]))
195
+ var k = S[g];
196
+ if (!b(f[k], h[k]))
197
197
  return !1;
198
198
  }
199
199
  return !0;
200
200
  }
201
201
  return f != f && h != h;
202
202
  };
203
- function u(y, f) {
203
+ function u(b, f) {
204
204
  var h = Object.keys(f || {}).filter(function(m) {
205
- var g = y == null ? void 0 : y[m], S = f == null ? void 0 : f[m];
205
+ var g = b == null ? void 0 : b[m], S = f == null ? void 0 : f[m];
206
206
  return !c(g, S);
207
207
  });
208
- return Object.keys(y || {}).filter(function(m) {
208
+ return Object.keys(b || {}).filter(function(m) {
209
209
  Object.keys(f || {}).includes(m) || h.push(m);
210
210
  }), Object.keys(h).length ? h : null;
211
211
  }
212
212
  var a, d;
213
- function p(y, f, h) {
213
+ function p(b, f, h) {
214
214
  var m = "shortString", g = !0;
215
- typeof h == "number" && (m = "javaDouble", g = !1), y[m] = y[m] || {}, y[m][f] = g ? h + "" : h;
215
+ typeof h == "number" && (m = "javaDouble", g = !1), b[m] = b[m] || {}, b[m][f] = g ? h + "" : h;
216
216
  }
217
- function v(y) {
218
- return !!y && typeof y == "object" && y.value !== void 0;
217
+ function v(b) {
218
+ return !!b && typeof b == "object" && b.value !== void 0;
219
219
  }
220
- function w(y) {
221
- return Object.fromEntries(Object.entries(y).map(function(f) {
220
+ function w(b) {
221
+ return Object.fromEntries(Object.entries(b).map(function(f) {
222
222
  var h = f[0], m = f[1];
223
223
  return [h, v(m) ? m : { value: m }];
224
224
  }));
225
225
  }
226
- function b(y) {
227
- return i(i({}, y), { identity: y.identity ? i(i({}, y.identity), { traits: w(y.identity.traits || {}) }) : void 0 });
226
+ function y(b) {
227
+ return i(i({}, b), { identity: b.identity ? i(i({}, b.identity), { traits: w(b.identity.traits || {}) }) : void 0 });
228
228
  }
229
- (function(y) {
230
- y.NONE = "NONE", y.DEFAULT_FLAGS = "DEFAULT_FLAGS", y.CACHE = "CACHE", y.SERVER = "SERVER";
229
+ (function(b) {
230
+ b.NONE = "NONE", b.DEFAULT_FLAGS = "DEFAULT_FLAGS", b.CACHE = "CACHE", b.SERVER = "SERVER";
231
231
  })(a || (a = {}));
232
- var T, _ = null, M = "BULLET_TRAIN_DB", R = "BULLET_TRAIN_EVENT", k = "https://edge.api.flagsmith.com/api/v1/", N = "flagsmith_value_", D = "flagsmith_enabled_", L = "flagsmith_trait_", I = function() {
233
- function y(f) {
232
+ var x, C = null, F = "BULLET_TRAIN_DB", R = "BULLET_TRAIN_EVENT", T = "https://edge.api.flagsmith.com/api/v1/", N = "flagsmith_value_", D = "flagsmith_enabled_", A = "flagsmith_trait_", I = function() {
233
+ function b(f) {
234
234
  var h = this;
235
235
  this._trigger = null, this._triggerLoadingState = null, this.timestamp = null, this.isLoading = !1, this.eventSource = null, this.getFlags = function() {
236
236
  var m = h, g = m.api, S = m.evaluationContext;
237
237
  h.log("Get Flags"), h.isLoading = !0, h.loadingState.isFetching || h.setLoadingState(i(i({}, h.loadingState), { isFetching: !0 }));
238
- var x = "".concat(h.getContext().identity), A = function(B) {
238
+ var k = "".concat(h.getContext().identity), L = function(B) {
239
239
  var q, O, W, ee;
240
- if (B && x === "".concat(h.getContext().identity)) {
240
+ if (B && k === "".concat(h.getContext().identity)) {
241
241
  var oe = B.flags, te = B.traits, ne = B.identifier;
242
242
  h.isLoading = !1;
243
243
  var ae = {}, ce = {};
244
- te = te || [], (oe = oe || []).forEach(function(J) {
245
- ae[J.feature.name.toLowerCase().replace(/ /g, "_")] = { id: J.feature.id, enabled: J.enabled, value: J.feature_state_value };
246
- }), te.forEach(function(J) {
247
- ce[J.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: J.transient, value: J.trait_value };
244
+ te = te || [], (oe = oe || []).forEach(function(K) {
245
+ ae[K.feature.name.toLowerCase().replace(/ /g, "_")] = { id: K.feature.id, enabled: K.enabled, value: K.feature_state_value };
246
+ }), te.forEach(function(K) {
247
+ ce[K.trait_key.toLowerCase().replace(/ /g, "_")] = { transient: K.transient, value: K.trait_value };
248
248
  }), h.oldFlags = i({}, h.flags);
249
249
  var ge = u(h.oldFlags, ae), Ge = u((q = h.evaluationContext.identity) === null || q === void 0 ? void 0 : q.traits, ce);
250
250
  if ((ne || Object.keys(ce).length) && (h.evaluationContext.identity = { traits: ce }, ne && (h.evaluationContext.identity.identifier = ne)), h.flags = ae, h.updateStorage(), h._onChange(h.oldFlags, { isFromServer: !0, flagsChanged: ge, traitsChanged: Ge }, h._loadedState(null, a.SERVER)), h.datadogRum)
251
251
  try {
252
252
  if (h.datadogRum.trackTraits) {
253
253
  var Ke = {};
254
- Object.keys(((O = h.evaluationContext.identity) === null || O === void 0 ? void 0 : O.traits) || {}).map(function(J) {
255
- Ke[L + J] = h.getTrait(J);
254
+ Object.keys(((O = h.evaluationContext.identity) === null || O === void 0 ? void 0 : O.traits) || {}).map(function(K) {
255
+ Ke[A + K] = h.getTrait(K);
256
256
  });
257
- var Le = i(i(i({}, h.datadogRum.client.getUser()), { id: h.datadogRum.client.getUser().id || ((W = h.evaluationContext.identity) === null || W === void 0 ? void 0 : W.identifier) }), Ke);
258
- h.log("Setting Datadog user", Le), h.datadogRum.client.setUser(Le);
257
+ var Ae = i(i(i({}, h.datadogRum.client.getUser()), { id: h.datadogRum.client.getUser().id || ((W = h.evaluationContext.identity) === null || W === void 0 ? void 0 : W.identifier) }), Ke);
258
+ h.log("Setting Datadog user", Ae), h.datadogRum.client.setUser(Ae);
259
259
  }
260
- } catch (J) {
261
- console.error(J);
260
+ } catch (K) {
261
+ console.error(K);
262
262
  }
263
263
  if (h.dtrum)
264
264
  try {
265
265
  var se = { javaDouble: {}, date: {}, shortString: {}, javaLongOrObject: {} };
266
- Object.keys(h.flags).map(function(J) {
267
- p(se, N + J, h.getValue(J, { skipAnalytics: !0 })), p(se, D + J, h.hasFeature(J, { skipAnalytics: !0 }));
268
- }), Object.keys(((ee = h.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.traits) || {}).map(function(J) {
269
- p(se, L + J, h.getTrait(J));
266
+ Object.keys(h.flags).map(function(K) {
267
+ p(se, N + K, h.getValue(K, { skipAnalytics: !0 })), p(se, D + K, h.hasFeature(K, { skipAnalytics: !0 }));
268
+ }), Object.keys(((ee = h.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.traits) || {}).map(function(K) {
269
+ p(se, A + K, h.getTrait(K));
270
270
  }), h.log("Sending javaLongOrObject traits to dynatrace", se.javaLongOrObject), h.log("Sending date traits to dynatrace", se.date), h.log("Sending shortString traits to dynatrace", se.shortString), h.log("Sending javaDouble to dynatrace", se.javaDouble), h.dtrum.sendSessionProperties(se.javaLongOrObject, se.date, se.shortString, se.javaDouble);
271
- } catch (J) {
272
- console.error(J);
271
+ } catch (K) {
272
+ console.error(K);
273
273
  }
274
274
  }
275
275
  };
@@ -279,12 +279,12 @@ var $n = { exports: {} };
279
279
  }).filter(function(B) {
280
280
  return B.trait_value !== void 0 || (h.log("Warning - attempted to set an undefined trait value for key", B.trait_key), !1);
281
281
  }) })) : h.getJSON(g + "identities/?identifier=" + encodeURIComponent(S.identity.identifier) + (S.identity.transient ? "&transient=true" : ""))]).then(function(B) {
282
- return h.evaluationContext.identity = i(i({}, h.evaluationContext.identity), { traits: {} }), A(B == null ? void 0 : B[0]);
282
+ return h.evaluationContext.identity = i(i({}, h.evaluationContext.identity), { traits: {} }), L(B == null ? void 0 : B[0]);
283
283
  }).catch(function(B) {
284
284
  var q = B.message, O = new Error(q);
285
285
  return Promise.reject(O);
286
286
  }) : h.getJSON(g + "flags/").then(function(B) {
287
- return A({ flags: B, traits: void 0 });
287
+ return L({ flags: B, traits: void 0 });
288
288
  });
289
289
  }, this.analyticsFlags = function() {
290
290
  var m = h.api;
@@ -298,27 +298,27 @@ var $n = { exports: {} };
298
298
  h.log("Exception fetching evaluationEvent", g);
299
299
  }) : void 0;
300
300
  }, this.datadogRum = null, this.loadingState = { isLoading: !0, isFetching: !0, error: null, source: a.NONE }, this.canUseStorage = !1, this.analyticsInterval = null, this.api = null, this.cacheFlags = !1, this.ts = null, this.enableAnalytics = !1, this.enableLogs = !1, this.evaluationContext = {}, this.evaluationEvent = null, this.flags = null, this.getFlagInterval = null, this.headers = null, this.initialised = !1, this.oldFlags = null, this.onChange = null, this.onError = null, this.ticks = null, this.timer = null, this.dtrum = null, this.withTraits = null, this.cacheOptions = { ttl: 0, skipAPI: !1, loadStale: !1 }, this.getValue = function(m, g, S) {
301
- var x = h.flags && h.flags[m.toLowerCase().replace(/ /g, "_")], A = null;
302
- if (x && (A = x.value), g != null && g.skipAnalytics || S || h.evaluateFlag(m, "VALUE"), A === null && (g == null ? void 0 : g.fallback) !== void 0)
301
+ var k = h.flags && h.flags[m.toLowerCase().replace(/ /g, "_")], L = null;
302
+ if (k && (L = k.value), g != null && g.skipAnalytics || S || h.evaluateFlag(m, "VALUE"), L === null && (g == null ? void 0 : g.fallback) !== void 0)
303
303
  return g.fallback;
304
304
  if (g != null && g.json)
305
305
  try {
306
- return A === null ? (h.log("Tried to parse null flag as JSON: " + m), null) : JSON.parse(A);
306
+ return L === null ? (h.log("Tried to parse null flag as JSON: " + m), null) : JSON.parse(L);
307
307
  } catch {
308
308
  return g.fallback;
309
309
  }
310
- return A;
310
+ return L;
311
311
  }, this.getTrait = function(m) {
312
312
  var g, S;
313
313
  return ((g = h.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits) && ((S = h.evaluationContext.identity.traits[m.toLowerCase().replace(/ /g, "_")]) === null || S === void 0 ? void 0 : S.value);
314
314
  }, this.getAllTraits = function() {
315
315
  var m;
316
316
  return Object.fromEntries(Object.entries(((m = h.evaluationContext.identity) === null || m === void 0 ? void 0 : m.traits) || {}).map(function(g) {
317
- var S = g[0], x = g[1];
318
- return [S, x == null ? void 0 : x.value];
317
+ var S = g[0], k = g[1];
318
+ return [S, k == null ? void 0 : k.value];
319
319
  }));
320
320
  }, this.setContext = function(m) {
321
- var g = b(m);
321
+ var g = y(m);
322
322
  return h.evaluationContext = i(i({}, g), { environment: g.environment || h.evaluationContext.environment }), h.initialised ? h.getFlags() : Promise.resolve();
323
323
  }, this.getContext = function() {
324
324
  return h.evaluationContext;
@@ -332,19 +332,19 @@ var $n = { exports: {} };
332
332
  var g;
333
333
  if (h.api)
334
334
  return h.setContext(i(i({}, h.evaluationContext), { identity: i(i({}, h.evaluationContext.identity), { traits: i(i({}, (g = h.evaluationContext.identity) === null || g === void 0 ? void 0 : g.traits), Object.fromEntries(Object.entries(m).map(function(S) {
335
- var x = S[0], A = S[1];
336
- return [x, v(A) ? A : { value: A }];
335
+ var k = S[0], L = S[1];
336
+ return [k, v(L) ? L : { value: L }];
337
337
  }))) }) }));
338
338
  console.error("Attempted to setTraits a user before calling flagsmith.init. Call flagsmith.init first, if you wish to prevent it sending a request for flags, call init with preventFetch:true.");
339
339
  }, this.hasFeature = function(m, g) {
340
- var S = typeof g == "object", x = h.flags && h.flags[m.toLowerCase().replace(/ /g, "_")], A = !1;
341
- return !x && S && g.fallback !== void 0 ? A = g == null ? void 0 : g.fallback : x && x.enabled && (A = !0), (S && !g.skipAnalytics || !g) && h.evaluateFlag(m, "ENABLED"), A;
340
+ var S = typeof g == "object", k = h.flags && h.flags[m.toLowerCase().replace(/ /g, "_")], L = !1;
341
+ return !k && S && g.fallback !== void 0 ? L = g == null ? void 0 : g.fallback : k && k.enabled && (L = !0), (S && !g.skipAnalytics || !g) && h.evaluateFlag(m, "ENABLED"), L;
342
342
  }, this.getJSON = function(m, g, S) {
343
- var x, A = h;
344
- A.evaluationContext;
345
- var B = A.headers, q = { method: g || "GET", body: S, cache: "no-cache", headers: {} };
343
+ var k, L = h;
344
+ L.evaluationContext;
345
+ var B = L.headers, q = { method: g || "GET", body: S, cache: "no-cache", headers: {} };
346
346
  h.evaluationContext.environment && (q.headers["X-Environment-Key"] = h.evaluationContext.environment.apiKey), g && g !== "GET" && (q.headers["Content-Type"] = "application/json; charset=utf-8"), B && Object.assign(q.headers, B), d || console.error("Flagsmith: fetch is undefined, please specify a fetch implementation into flagsmith.init to support SSR.");
347
- var O = "".concat((x = h.evaluationContext.identity) === null || x === void 0 ? void 0 : x.identifier);
347
+ var O = "".concat((k = h.evaluationContext.identity) === null || k === void 0 ? void 0 : k.identifier);
348
348
  return d(m, q).then(function(W) {
349
349
  var ee, oe, te = "".concat((ee = h.evaluationContext.identity) === null || ee === void 0 ? void 0 : ee.identifier);
350
350
  if (O === te) {
@@ -377,28 +377,28 @@ var $n = { exports: {} };
377
377
  }
378
378
  h.updateEventStorage();
379
379
  }, this._onChange = function(m, g, S) {
380
- var x, A;
381
- h.setLoadingState(S), (x = h.onChange) === null || x === void 0 || x.call(h, m, g, h.loadingState), (A = h._trigger) === null || A === void 0 || A.call(h);
382
- }, d = f.fetch ? f.fetch : typeof fetch < "u" ? fetch : $e == null ? void 0 : $e.fetch, this.canUseStorage = typeof window < "u" || !!f.browserlessStorage, this.log("Constructing flagsmith instance " + f), f.eventSource && (T = f.eventSource), f.AsyncStorage && (_ = f.AsyncStorage);
380
+ var k, L;
381
+ h.setLoadingState(S), (k = h.onChange) === null || k === void 0 || k.call(h, m, g, h.loadingState), (L = h._trigger) === null || L === void 0 || L.call(h);
382
+ }, d = f.fetch ? f.fetch : typeof fetch < "u" ? fetch : $e == null ? void 0 : $e.fetch, this.canUseStorage = typeof window < "u" || !!f.browserlessStorage, this.log("Constructing flagsmith instance " + f), f.eventSource && (x = f.eventSource), f.AsyncStorage && (C = f.AsyncStorage);
383
383
  }
384
- return y.prototype.init = function(f) {
384
+ return b.prototype.init = function(f) {
385
385
  var h, m, g;
386
386
  return r(this, void 0, void 0, function() {
387
- var S, x, A, B, q, O, W, ee, oe, te, ne, ae, ce, ge, Ge, Ke, Le, se, J, Ct, Je, Pn, Xe, _t, Bn, jn, Nt, zn, Ot, Ye, Me, Un, ie = this;
387
+ var S, k, L, B, q, O, W, ee, oe, te, ne, ae, ce, ge, Ge, Ke, Ae, se, K, Ct, Je, Pn, Xe, _t, Bn, jn, Nt, zn, Ot, Ye, Me, Un, ie = this;
388
388
  return o(this, function(fe) {
389
389
  switch (fe.label) {
390
390
  case 0:
391
- S = b(f.evaluationContext || this.evaluationContext), fe.label = 1;
391
+ S = y(f.evaluationContext || this.evaluationContext), fe.label = 1;
392
392
  case 1:
393
- if (fe.trys.push([1, 13, , 14]), x = f.environmentID, A = f.api, B = A === void 0 ? k : A, q = f.headers, O = f.onChange, W = f.cacheFlags, ee = f.datadogRum, oe = f.onError, te = f.defaultFlags, ne = f.fetch, ae = f.preventFetch, ce = f.enableLogs, ge = f.enableDynatrace, Ge = f.enableAnalytics, Ke = f.realtime, Le = f.eventSourceUrl, se = Le === void 0 ? "https://realtime.flagsmith.com/" : Le, J = f.AsyncStorage, Ct = f.identity, Je = f.traits, Pn = f.state, Xe = f.cacheOptions, _t = f.angularHttpClient, Bn = f._trigger, jn = f._triggerLoadingState, S.environment = x ? { apiKey: x } : S.environment, !S.environment || !S.environment.apiKey)
393
+ if (fe.trys.push([1, 13, , 14]), k = f.environmentID, L = f.api, B = L === void 0 ? T : L, q = f.headers, O = f.onChange, W = f.cacheFlags, ee = f.datadogRum, oe = f.onError, te = f.defaultFlags, ne = f.fetch, ae = f.preventFetch, ce = f.enableLogs, ge = f.enableDynatrace, Ge = f.enableAnalytics, Ke = f.realtime, Ae = f.eventSourceUrl, se = Ae === void 0 ? "https://realtime.flagsmith.com/" : Ae, K = f.AsyncStorage, Ct = f.identity, Je = f.traits, Pn = f.state, Xe = f.cacheOptions, _t = f.angularHttpClient, Bn = f._trigger, jn = f._triggerLoadingState, S.environment = k ? { apiKey: k } : S.environment, !S.environment || !S.environment.apiKey)
394
394
  throw new Error("Please provide `evaluationContext.environment` with non-empty `apiKey`");
395
395
  if (S.identity = Ct || Je ? { identifier: Ct, traits: Je ? Object.fromEntries(Object.entries(Je).map(function(le) {
396
396
  return [le[0], { value: le[1] }];
397
397
  })) : {} } : S.identity, this.evaluationContext = S, this.api = B, this.headers = q, this.getFlagInterval = null, this.analyticsInterval = null, this.onChange = O, Nt = "Wrong Flagsmith Configuration: preventFetch is true and no defaulFlags provided", this._trigger = Bn || this._trigger, this._triggerLoadingState = jn || this._triggerLoadingState, this.onError = function(le) {
398
398
  ie.setLoadingState(i(i({}, ie.loadingState), { isFetching: !1, isLoading: !1, error: le })), oe == null || oe(le);
399
- }, this.enableLogs = ce || !1, this.cacheOptions = Xe ? { skipAPI: !!Xe.skipAPI, ttl: Xe.ttl || 0, loadStale: !!Xe.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), ne && (d = ne), this.enableAnalytics = Ge || !1, this.flags = Object.assign({}, te) || {}, this.datadogRum = ee || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = _ !== void 0 && !!W, J && (_ = J), Ke && typeof window < "u" && this.setupRealtime(se, S.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: a.DEFAULT_FLAGS })), this.setState(Pn), this.log("Initialising with properties", f, this), ge && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), _t && (d = /* @__PURE__ */ function(le) {
400
- return function(me, be) {
401
- var Te = be.headers, Y = be.method, Fe = be.body;
399
+ }, this.enableLogs = ce || !1, this.cacheOptions = Xe ? { skipAPI: !!Xe.skipAPI, ttl: Xe.ttl || 0, loadStale: !!Xe.loadStale } : this.cacheOptions, !this.cacheOptions.ttl && this.cacheOptions.skipAPI && console.warn("Flagsmith: you have set a cache ttl of 0 and are skipping API calls, this means the API will not be hit unless you clear local storage."), ne && (d = ne), this.enableAnalytics = Ge || !1, this.flags = Object.assign({}, te) || {}, this.datadogRum = ee || null, this.initialised = !0, this.ticks = 1e4, this.timer = this.enableLogs ? (/* @__PURE__ */ new Date()).valueOf() : null, this.cacheFlags = C !== void 0 && !!W, K && (C = K), Ke && typeof window < "u" && this.setupRealtime(se, S.environment.apiKey), Object.keys(this.flags).length && (this.loadingState = i(i({}, this.loadingState), { isLoading: !1, source: a.DEFAULT_FLAGS })), this.setState(Pn), this.log("Initialising with properties", f, this), ge && (typeof dtrum > "u" ? console.error("You have attempted to enable dynatrace but dtrum is undefined, please check you have the Dynatrace RUM JavaScript API installed.") : this.dtrum = dtrum), _t && (d = /* @__PURE__ */ function(le) {
400
+ return function(me, ve) {
401
+ var Te = ve.headers, Y = ve.method, Fe = ve.body;
402
402
  return new Promise(function(Oe) {
403
403
  switch (Y) {
404
404
  case "GET":
@@ -417,36 +417,36 @@ var $n = { exports: {} };
417
417
  }
418
418
  });
419
419
  };
420
- }(_t)), _ && this.canUseStorage && _.getItem(R).then(function(le) {
420
+ }(_t)), C && this.canUseStorage && C.getItem(R).then(function(le) {
421
421
  try {
422
422
  ie.evaluationEvent = JSON.parse(le) || {};
423
423
  } catch {
424
424
  ie.evaluationEvent = {};
425
425
  }
426
426
  ie.analyticsInterval = setInterval(ie.analyticsFlags, ie.ticks);
427
- }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), _ && this.canUseStorage && _.getItem(R, function(le, me) {
427
+ }), this.enableAnalytics && (this.analyticsInterval && clearInterval(this.analyticsInterval), C && this.canUseStorage && C.getItem(R, function(le, me) {
428
428
  if (me && ie.evaluationContext.environment) {
429
- var be = JSON.parse(me);
430
- if (be[ie.evaluationContext.environment.apiKey]) {
429
+ var ve = JSON.parse(me);
430
+ if (ve[ie.evaluationContext.environment.apiKey]) {
431
431
  var Te = ie.getState();
432
- ie.log("Retrieved events from cache", me), ie.setState(i(i({}, Te), { evaluationEvent: be[ie.evaluationContext.environment.apiKey] }));
432
+ ie.log("Retrieved events from cache", me), ie.setState(i(i({}, Te), { evaluationEvent: ve[ie.evaluationContext.environment.apiKey] }));
433
433
  }
434
434
  }
435
435
  })), !W)
436
436
  return [3, 9];
437
- if (!_ || !this.canUseStorage)
437
+ if (!C || !this.canUseStorage)
438
438
  return [3, 8];
439
439
  zn = function(le, me) {
440
440
  return r(ie, void 0, void 0, function() {
441
- var be, Te, Y, Fe, Oe, xe, Rt, Hn, Dt, At, Lt, Mt, Ft, Pt, Bt, jt, zt, Ut, Ht, $t, qt, Wt, Vt, Gt;
441
+ var ve, Te, Y, Fe, Oe, xe, Rt, Hn, Dt, Lt, At, Mt, Ft, Pt, Bt, jt, zt, Ut, Ht, $t, qt, Wt, Vt, Gt;
442
442
  return o(this, function(Ee) {
443
443
  switch (Ee.label) {
444
444
  case 0:
445
445
  if (!me)
446
446
  return [3, 7];
447
- be = null, Te = null, Ee.label = 1;
447
+ ve = null, Te = null, Ee.label = 1;
448
448
  case 1:
449
- return Ee.trys.push([1, 5, , 6]), Y = JSON.parse(me), Fe = !1, Oe = !1, Y && Y.api === this.api && ((At = (Dt = Y.evaluationContext) === null || Dt === void 0 ? void 0 : Dt.environment) === null || At === void 0 ? void 0 : At.apiKey) === ((Lt = this.evaluationContext.environment) === null || Lt === void 0 ? void 0 : Lt.apiKey) && (xe = !0, this.evaluationContext.identity && ((Ft = (Mt = Y.evaluationContext) === null || Mt === void 0 ? void 0 : Mt.identity) === null || Ft === void 0 ? void 0 : Ft.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Bt = (Pt = Y.evaluationContext) === null || Pt === void 0 ? void 0 : Pt.identity) === null || Bt === void 0 ? void 0 : Bt.identifier) + " to " + this.evaluationContext.identity.identifier), xe = !1), this.cacheOptions.ttl && (!Y.ts || (/* @__PURE__ */ new Date()).valueOf() - Y.ts > this.cacheOptions.ttl) && (Y.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), xe = !1) : Y.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), Oe = !0, xe = !0)), xe && (Fe = !0, Te = u((jt = this.evaluationContext.identity) === null || jt === void 0 ? void 0 : jt.traits, (Ut = (zt = Y.evaluationContext) === null || zt === void 0 ? void 0 : zt.identity) === null || Ut === void 0 ? void 0 : Ut.traits), be = u(this.flags, Y.flags), this.setState(i(i({}, Y), { evaluationContext: b(i(i({}, Y.evaluationContext), { identity: !((Ht = Y.evaluationContext) === null || Ht === void 0) && Ht.identity ? i(i({}, ($t = Y.evaluationContext) === null || $t === void 0 ? void 0 : $t.identity), { traits: i(i({}, ((Wt = (qt = Y.evaluationContext) === null || qt === void 0 ? void 0 : qt.identity) === null || Wt === void 0 ? void 0 : Wt.traits) || {}), Je || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", Y))), Fe ? (Rt = !ae && (!this.cacheOptions.skipAPI || Oe), this._onChange(null, { isFromServer: !1, flagsChanged: be, traitsChanged: Te }, this._loadedState(null, a.CACHE, Rt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Fe && !Oe && this.log("Skipping API, using cache"), Rt && this.getFlags(), [3, 4]) : [3, 2];
449
+ return Ee.trys.push([1, 5, , 6]), Y = JSON.parse(me), Fe = !1, Oe = !1, Y && Y.api === this.api && ((Lt = (Dt = Y.evaluationContext) === null || Dt === void 0 ? void 0 : Dt.environment) === null || Lt === void 0 ? void 0 : Lt.apiKey) === ((At = this.evaluationContext.environment) === null || At === void 0 ? void 0 : At.apiKey) && (xe = !0, this.evaluationContext.identity && ((Ft = (Mt = Y.evaluationContext) === null || Mt === void 0 ? void 0 : Mt.identity) === null || Ft === void 0 ? void 0 : Ft.identifier) !== this.evaluationContext.identity.identifier && (this.log("Ignoring cache, identity has changed from " + ((Bt = (Pt = Y.evaluationContext) === null || Pt === void 0 ? void 0 : Pt.identity) === null || Bt === void 0 ? void 0 : Bt.identifier) + " to " + this.evaluationContext.identity.identifier), xe = !1), this.cacheOptions.ttl && (!Y.ts || (/* @__PURE__ */ new Date()).valueOf() - Y.ts > this.cacheOptions.ttl) && (Y.ts && !this.cacheOptions.loadStale ? (this.log("Ignoring cache, timestamp is too old ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), xe = !1) : Y.ts && this.cacheOptions.loadStale && (this.log("Loading stale cache, timestamp ts:" + Y.ts + " ttl: " + this.cacheOptions.ttl + " time elapsed since cache: " + ((/* @__PURE__ */ new Date()).valueOf() - Y.ts) + "ms"), Oe = !0, xe = !0)), xe && (Fe = !0, Te = u((jt = this.evaluationContext.identity) === null || jt === void 0 ? void 0 : jt.traits, (Ut = (zt = Y.evaluationContext) === null || zt === void 0 ? void 0 : zt.identity) === null || Ut === void 0 ? void 0 : Ut.traits), ve = u(this.flags, Y.flags), this.setState(i(i({}, Y), { evaluationContext: y(i(i({}, Y.evaluationContext), { identity: !((Ht = Y.evaluationContext) === null || Ht === void 0) && Ht.identity ? i(i({}, ($t = Y.evaluationContext) === null || $t === void 0 ? void 0 : $t.identity), { traits: i(i({}, ((Wt = (qt = Y.evaluationContext) === null || qt === void 0 ? void 0 : qt.identity) === null || Wt === void 0 ? void 0 : Wt.traits) || {}), Je || {}) }) : void 0 })) })), this.log("Retrieved flags from cache", Y))), Fe ? (Rt = !ae && (!this.cacheOptions.skipAPI || Oe), this._onChange(null, { isFromServer: !1, flagsChanged: ve, traitsChanged: Te }, this._loadedState(null, a.CACHE, Rt)), this.oldFlags = this.flags, this.cacheOptions.skipAPI && Fe && !Oe && this.log("Skipping API, using cache"), Rt && this.getFlags(), [3, 4]) : [3, 2];
450
450
  case 2:
451
451
  return ae ? [3, 4] : [4, this.getFlags()];
452
452
  case 3:
@@ -477,9 +477,9 @@ var $n = { exports: {} };
477
477
  });
478
478
  }, fe.label = 2;
479
479
  case 2:
480
- return fe.trys.push([2, 7, , 8]), _.getItemSync ? (Ot = _.getItemSync(M), [3, 5]) : [3, 3];
480
+ return fe.trys.push([2, 7, , 8]), C.getItemSync ? (Ot = C.getItemSync(F), [3, 5]) : [3, 3];
481
481
  case 3:
482
- return [4, _.getItem(M)];
482
+ return [4, C.getItem(F)];
483
483
  case 4:
484
484
  Ot = fe.sent(), fe.label = 5;
485
485
  case 5:
@@ -508,93 +508,93 @@ var $n = { exports: {} };
508
508
  }
509
509
  });
510
510
  });
511
- }, y.prototype._loadedState = function(f, h, m) {
511
+ }, b.prototype._loadedState = function(f, h, m) {
512
512
  return f === void 0 && (f = null), m === void 0 && (m = !1), { error: f, isFetching: m, isLoading: !1, source: h };
513
- }, y.prototype.getAllFlags = function() {
513
+ }, b.prototype.getAllFlags = function() {
514
514
  return this.flags;
515
- }, y.prototype.identify = function(f, h, m) {
515
+ }, b.prototype.identify = function(f, h, m) {
516
516
  return this.evaluationContext.identity = { identifier: f, transient: m, traits: this.evaluationContext.identity && this.evaluationContext.identity.identifier == f ? this.evaluationContext.identity.traits : {} }, this.evaluationContext.identity.identifier = f, this.log("Identify: " + this.evaluationContext.identity.identifier), h && (this.evaluationContext.identity.traits = Object.fromEntries(Object.entries(h).map(function(g) {
517
- var S = g[0], x = g[1];
518
- return [S, v(x) ? x : { value: x }];
517
+ var S = g[0], k = g[1];
518
+ return [S, v(k) ? k : { value: k }];
519
519
  }))), this.initialised ? this.getFlags() : Promise.resolve();
520
- }, y.prototype.getState = function() {
520
+ }, b.prototype.getState = function() {
521
521
  return { api: this.api, flags: this.flags, ts: this.ts, evaluationContext: this.evaluationContext, evaluationEvent: this.evaluationEvent };
522
- }, y.prototype.setState = function(f) {
523
- f && (this.initialised = !0, this.api = f.api || this.api || k, this.flags = f.flags || this.flags, this.evaluationContext = f.evaluationContext || this.evaluationContext, this.evaluationEvent = f.evaluationEvent || this.evaluationEvent, this.log("setState called", this));
524
- }, y.prototype.logout = function() {
522
+ }, b.prototype.setState = function(f) {
523
+ f && (this.initialised = !0, this.api = f.api || this.api || T, this.flags = f.flags || this.flags, this.evaluationContext = f.evaluationContext || this.evaluationContext, this.evaluationEvent = f.evaluationEvent || this.evaluationEvent, this.log("setState called", this));
524
+ }, b.prototype.logout = function() {
525
525
  return this.evaluationContext.identity = null, this.initialised ? this.getFlags() : Promise.resolve();
526
- }, y.prototype.startListening = function(f) {
526
+ }, b.prototype.startListening = function(f) {
527
527
  f === void 0 && (f = 1e3), this.getFlagInterval && clearInterval(this.getFlagInterval), this.getFlagInterval = setInterval(this.getFlags, f);
528
- }, y.prototype.stopListening = function() {
528
+ }, b.prototype.stopListening = function() {
529
529
  this.getFlagInterval && (clearInterval(this.getFlagInterval), this.getFlagInterval = null);
530
- }, y.prototype.log = function() {
530
+ }, b.prototype.log = function() {
531
531
  for (var f = [], h = 0; h < arguments.length; h++)
532
532
  f[h] = arguments[h];
533
533
  this.enableLogs && console.log.apply(this, l(["FLAGSMITH:", (/* @__PURE__ */ new Date()).valueOf() - (this.timer || 0), "ms"], f, !0));
534
- }, y.prototype.updateStorage = function() {
534
+ }, b.prototype.updateStorage = function() {
535
535
  if (this.cacheFlags) {
536
536
  this.ts = (/* @__PURE__ */ new Date()).valueOf();
537
537
  var f = JSON.stringify(this.getState());
538
- this.log("Setting storage", f), _.setItem(M, f);
538
+ this.log("Setting storage", f), C.setItem(F, f);
539
539
  }
540
- }, y.prototype.updateEventStorage = function() {
540
+ }, b.prototype.updateEventStorage = function() {
541
541
  if (this.enableAnalytics) {
542
542
  var f = JSON.stringify(this.getState().evaluationEvent);
543
- _.setItem(R, f);
543
+ C.setItem(R, f);
544
544
  }
545
- }, y.prototype.setLoadingState = function(f) {
545
+ }, b.prototype.setLoadingState = function(f) {
546
546
  var h;
547
547
  c(f, this.loadingState) || (this.loadingState = i({}, f), this.log("Loading state changed", f), (h = this._triggerLoadingState) === null || h === void 0 || h.call(this));
548
- }, y.prototype.setupRealtime = function(f, h) {
548
+ }, b.prototype.setupRealtime = function(f, h) {
549
549
  var m = this, g = f + "sse/environments/" + h + "/stream";
550
- T ? this.eventSource || (this.log("Creating event source with url " + g), this.eventSource = new T(g), this.eventSource.addEventListener("environment_updated", function(S) {
551
- var x;
550
+ x ? this.eventSource || (this.log("Creating event source with url " + g), this.eventSource = new x(g), this.eventSource.addEventListener("environment_updated", function(S) {
551
+ var k;
552
552
  try {
553
- x = JSON.parse(S.data).updated_at;
554
- } catch (A) {
555
- m.log("Could not parse sse event", A);
553
+ k = JSON.parse(S.data).updated_at;
554
+ } catch (L) {
555
+ m.log("Could not parse sse event", L);
556
556
  }
557
- x ? !m.timestamp || x > m.timestamp ? m.isLoading ? m.log("updated_at is new, but flags are loading", S.data, m.timestamp) : (m.log("updated_at is new, fetching flags", S.data, m.timestamp), m.getFlags()) : m.log("updated_at is outdated, skipping get flags", S.data, m.timestamp) : m.log("No updated_at received, fetching flags", S);
557
+ k ? !m.timestamp || k > m.timestamp ? m.isLoading ? m.log("updated_at is new, but flags are loading", S.data, m.timestamp) : (m.log("updated_at is new, fetching flags", S.data, m.timestamp), m.getFlags()) : m.log("updated_at is outdated, skipping get flags", S.data, m.timestamp) : m.log("No updated_at received, fetching flags", S);
558
558
  })) : this.log("Error, EventSource is undefined");
559
- }, y;
559
+ }, b;
560
560
  }();
561
- function E(y) {
562
- var f = y.fetch, h = y.AsyncStorage, m = y.eventSource;
561
+ function E(b) {
562
+ var f = b.fetch, h = b.AsyncStorage, m = b.eventSource;
563
563
  return new I({ fetch: f, AsyncStorage: h, eventSource: m });
564
564
  }
565
- var P, U = (P = function(y, f) {
565
+ var P, U = (P = function(b, f) {
566
566
  return P = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(h, m) {
567
567
  h.__proto__ = m;
568
568
  } || function(h, m) {
569
569
  for (var g in m)
570
570
  Object.prototype.hasOwnProperty.call(m, g) && (h[g] = m[g]);
571
- }, P(y, f);
572
- }, function(y, f) {
571
+ }, P(b, f);
572
+ }, function(b, f) {
573
573
  if (typeof f != "function" && f !== null)
574
574
  throw new TypeError("Class extends value " + String(f) + " is not a constructor or null");
575
575
  function h() {
576
- this.constructor = y;
576
+ this.constructor = b;
577
577
  }
578
- P(y, f), y.prototype = f === null ? Object.create(f) : (h.prototype = f.prototype, new h());
579
- }), j = function(y) {
580
- var f = typeof Symbol == "function" && Symbol.iterator, h = f && y[f], m = 0;
578
+ P(b, f), b.prototype = f === null ? Object.create(f) : (h.prototype = f.prototype, new h());
579
+ }), j = function(b) {
580
+ var f = typeof Symbol == "function" && Symbol.iterator, h = f && b[f], m = 0;
581
581
  if (h)
582
- return h.call(y);
583
- if (y && typeof y.length == "number")
582
+ return h.call(b);
583
+ if (b && typeof b.length == "number")
584
584
  return { next: function() {
585
- return y && m >= y.length && (y = void 0), { value: y && y[m++], done: !y };
585
+ return b && m >= b.length && (b = void 0), { value: b && b[m++], done: !b };
586
586
  } };
587
587
  throw new TypeError(f ? "Object is not iterable." : "Symbol.iterator is not defined.");
588
- }, z = function(y, f) {
589
- var h = typeof Symbol == "function" && y[Symbol.iterator];
588
+ }, z = function(b, f) {
589
+ var h = typeof Symbol == "function" && b[Symbol.iterator];
590
590
  if (!h)
591
- return y;
592
- var m, g, S = h.call(y), x = [];
591
+ return b;
592
+ var m, g, S = h.call(b), k = [];
593
593
  try {
594
594
  for (; (f === void 0 || f-- > 0) && !(m = S.next()).done; )
595
- x.push(m.value);
596
- } catch (A) {
597
- g = { error: A };
595
+ k.push(m.value);
596
+ } catch (L) {
597
+ g = { error: L };
598
598
  } finally {
599
599
  try {
600
600
  m && !m.done && (h = S.return) && h.call(S);
@@ -603,30 +603,30 @@ var $n = { exports: {} };
603
603
  throw g.error;
604
604
  }
605
605
  }
606
- return x;
607
- }, C = function(y, f, h) {
606
+ return k;
607
+ }, _ = function(b, f, h) {
608
608
  if (h || arguments.length === 2)
609
609
  for (var m, g = 0, S = f.length; g < S; g++)
610
610
  !m && g in f || (m || (m = Array.prototype.slice.call(f, 0, g)), m[g] = f[g]);
611
- return y.concat(m || Array.prototype.slice.call(f));
612
- }, F = function(y) {
611
+ return b.concat(m || Array.prototype.slice.call(f));
612
+ }, M = function(b) {
613
613
  function f() {
614
- return y.call(this, `EventSource not available.
614
+ return b.call(this, `EventSource not available.
615
615
  Consider loading an EventSource polyfill and making it available globally as EventSource, or passing one in as eventSourceClass to the ReconnectingEventSource constructor.`) || this;
616
616
  }
617
- return U(f, y), f;
617
+ return U(f, b), f;
618
618
  }(Error), V = function() {
619
- function y(f, h) {
619
+ function b(f, h) {
620
620
  var m = this;
621
621
  if (this.CONNECTING = 0, this.OPEN = 1, this.CLOSED = 2, this._configuration = h != null ? Object.assign({}, h) : void 0, this.withCredentials = !1, this._eventSource = null, this._lastEventId = null, this._timer = null, this._listeners = { open: [], error: [], message: [] }, this.url = f.toString(), this.readyState = this.CONNECTING, this.max_retry_time = 3e3, this.eventSourceClass = globalThis.FlagsmithEventSource, this._configuration != null && (this._configuration.lastEventId && (this._lastEventId = this._configuration.lastEventId, delete this._configuration.lastEventId), this._configuration.max_retry_time && (this.max_retry_time = this._configuration.max_retry_time, delete this._configuration.max_retry_time), this._configuration.eventSourceClass && (this.eventSourceClass = this._configuration.eventSourceClass, delete this._configuration.eventSourceClass)), this.eventSourceClass == null || typeof this.eventSourceClass != "function")
622
- throw new F();
622
+ throw new M();
623
623
  this._onevent_wrapped = function(g) {
624
624
  m._onevent(g);
625
625
  }, this._start();
626
626
  }
627
- return y.prototype.dispatchEvent = function(f) {
627
+ return b.prototype.dispatchEvent = function(f) {
628
628
  throw new Error("Method not implemented.");
629
- }, y.prototype._start = function() {
629
+ }, b.prototype._start = function() {
630
630
  var f, h, m = this, g = this.url;
631
631
  this._lastEventId && (g.indexOf("?") === -1 ? g += "?" : g += "&", g += "lastEventId=" + encodeURIComponent(this._lastEventId)), this._eventSource = new this.eventSourceClass(g, this._configuration), this._eventSource.onopen = function(B) {
632
632
  m._onopen(B);
@@ -636,23 +636,23 @@ Consider loading an EventSource polyfill and making it available globally as Eve
636
636
  m.onmessage(B);
637
637
  };
638
638
  try {
639
- for (var S = j(Object.keys(this._listeners)), x = S.next(); !x.done; x = S.next()) {
640
- var A = x.value;
641
- this._eventSource.addEventListener(A, this._onevent_wrapped);
639
+ for (var S = j(Object.keys(this._listeners)), k = S.next(); !k.done; k = S.next()) {
640
+ var L = k.value;
641
+ this._eventSource.addEventListener(L, this._onevent_wrapped);
642
642
  }
643
643
  } catch (B) {
644
644
  f = { error: B };
645
645
  } finally {
646
646
  try {
647
- x && !x.done && (h = S.return) && h.call(S);
647
+ k && !k.done && (h = S.return) && h.call(S);
648
648
  } finally {
649
649
  if (f)
650
650
  throw f.error;
651
651
  }
652
652
  }
653
- }, y.prototype._onopen = function(f) {
653
+ }, b.prototype._onopen = function(f) {
654
654
  this.readyState === 0 && (this.readyState = 1, this.onopen(f));
655
- }, y.prototype._onerror = function(f) {
655
+ }, b.prototype._onerror = function(f) {
656
656
  var h = this;
657
657
  if (this.readyState === 1 && (this.readyState = 0, this.onerror(f)), this._eventSource) {
658
658
  this._eventSource.close(), this._eventSource = null;
@@ -661,45 +661,45 @@ Consider loading an EventSource polyfill and making it available globally as Eve
661
661
  return h._start();
662
662
  }, m);
663
663
  }
664
- }, y.prototype._onevent = function(f) {
664
+ }, b.prototype._onevent = function(f) {
665
665
  var h, m;
666
666
  f && f.lastEventId && (this._lastEventId = f.lastEventId);
667
667
  var g = this._listeners[f.type];
668
668
  if (g != null)
669
669
  try {
670
- for (var S = j(C([], z(g), !1)), x = S.next(); !x.done; x = S.next())
671
- x.value.call(this, f);
672
- } catch (A) {
673
- h = { error: A };
670
+ for (var S = j(_([], z(g), !1)), k = S.next(); !k.done; k = S.next())
671
+ k.value.call(this, f);
672
+ } catch (L) {
673
+ h = { error: L };
674
674
  } finally {
675
675
  try {
676
- x && !x.done && (m = S.return) && m.call(S);
676
+ k && !k.done && (m = S.return) && m.call(S);
677
677
  } finally {
678
678
  if (h)
679
679
  throw h.error;
680
680
  }
681
681
  }
682
682
  f.type === "message" && this.onmessage(f);
683
- }, y.prototype.onopen = function(f) {
684
- }, y.prototype.onerror = function(f) {
685
- }, y.prototype.onmessage = function(f) {
686
- }, y.prototype.close = function() {
683
+ }, b.prototype.onopen = function(f) {
684
+ }, b.prototype.onerror = function(f) {
685
+ }, b.prototype.onmessage = function(f) {
686
+ }, b.prototype.close = function() {
687
687
  this._timer && (clearTimeout(this._timer), this._timer = null), this._eventSource && (this._eventSource.close(), this._eventSource = null), this.readyState = 2;
688
- }, y.prototype.addEventListener = function(f, h, m) {
688
+ }, b.prototype.addEventListener = function(f, h, m) {
689
689
  this._listeners[f] == null && (this._listeners[f] = [], this._eventSource != null && this._eventSource.addEventListener(f, this._onevent_wrapped));
690
690
  var g = this._listeners[f];
691
- g.includes(h) || (this._listeners[f] = C(C([], z(g), !1), [h], !1));
692
- }, y.prototype.removeEventListener = function(f, h, m) {
691
+ g.includes(h) || (this._listeners[f] = _(_([], z(g), !1), [h], !1));
692
+ }, b.prototype.removeEventListener = function(f, h, m) {
693
693
  var g = this._listeners[f];
694
694
  this._listeners[f] = g.filter(function(S) {
695
695
  return S !== h;
696
696
  });
697
- }, y;
697
+ }, b;
698
698
  }();
699
699
  globalThis.FlagsmithEventSource = typeof EventSource < "u" ? EventSource : null;
700
- var K = function(y, f) {
700
+ var G = function(b, f) {
701
701
  return f = f || {}, new Promise(function(h, m) {
702
- var g = new XMLHttpRequest(), S = [], x = [], A = {}, B = function() {
702
+ var g = new XMLHttpRequest(), S = [], k = [], L = {}, B = function() {
703
703
  return { ok: (g.status / 100 | 0) == 2, statusText: g.statusText, status: g.status, url: g.responseURL, text: function() {
704
704
  return Promise.resolve(g.responseText);
705
705
  }, json: function() {
@@ -709,28 +709,28 @@ Consider loading an EventSource polyfill and making it available globally as Eve
709
709
  }, clone: B, headers: { keys: function() {
710
710
  return S;
711
711
  }, entries: function() {
712
- return x;
712
+ return k;
713
713
  }, get: function(O) {
714
- return A[O.toLowerCase()];
714
+ return L[O.toLowerCase()];
715
715
  }, has: function(O) {
716
- return O.toLowerCase() in A;
716
+ return O.toLowerCase() in L;
717
717
  } } };
718
718
  };
719
- for (var q in g.open(f.method || "get", y, !0), g.onload = function() {
719
+ for (var q in g.open(f.method || "get", b, !0), g.onload = function() {
720
720
  g.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm, function(O, W, ee) {
721
- S.push(W = W.toLowerCase()), x.push([W, ee]), A[W] = A[W] ? A[W] + "," + ee : ee;
721
+ S.push(W = W.toLowerCase()), k.push([W, ee]), L[W] = L[W] ? L[W] + "," + ee : ee;
722
722
  }), h(B());
723
723
  }, g.onerror = m, g.withCredentials = f.credentials == "include", f.headers)
724
724
  g.setRequestHeader(q, f.headers[q]);
725
725
  g.send(f.body || null);
726
726
  });
727
- }, $ = E({ AsyncStorage: s, fetch: K, eventSource: V });
727
+ }, $ = E({ AsyncStorage: s, fetch: G, eventSource: V });
728
728
  typeof window < "u" && (window.flagsmith = $), n.createFlagsmithInstance = function() {
729
- return E({ AsyncStorage: s, fetch: K, eventSource: V });
729
+ return E({ AsyncStorage: s, fetch: G, eventSource: V });
730
730
  }, n.default = $, Object.defineProperty(n, "__esModule", { value: !0 });
731
731
  });
732
732
  })($n, $n.exports);
733
- var qn = {}, vi = function(t, e, n, s, i) {
733
+ var qn = {}, bi = function(t, e, n, s, i) {
734
734
  var r = new Worker(qn[e] || (qn[e] = URL.createObjectURL(new Blob([
735
735
  t + ';addEventListener("error",function(e){e=e.error;postMessage({$e$:[e.message,e.code,e.stack]})})'
736
736
  ], { type: "text/javascript" }))));
@@ -818,7 +818,7 @@ var qn = {}, vi = function(t, e, n, s, i) {
818
818
  for (var r = n[s]; r < n[s + 1]; ++r)
819
819
  i[r] = r - n[s] << 5 | s;
820
820
  return { b: n, r: i };
821
- }, As = Ds(kt, 2), yi = As.b, dt = As.r;
821
+ }, Ls = Ds(kt, 2), yi = Ls.b, dt = Ls.r;
822
822
  yi[28] = 258, dt[258] = 28;
823
823
  var wi = Ds(Tt, 0), cn = wi.r, ft = new re(32768);
824
824
  for (var X = 0; X < 32768; ++X) {
@@ -855,7 +855,7 @@ for (var X = 280; X < 288; ++X)
855
855
  var tt = new de(32);
856
856
  for (var X = 0; X < 32; ++X)
857
857
  tt[X] = 5;
858
- var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = function(t) {
858
+ var As = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = function(t) {
859
859
  return (t + 7) / 8 | 0;
860
860
  }, Fs = function(t, e, n) {
861
861
  return (e == null || e < 0) && (e = 0), (n == null || n > t.length) && (n = t.length), new de(t.subarray(e, n));
@@ -880,7 +880,7 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
880
880
  if (s.code = t, Error.captureStackTrace && Error.captureStackTrace(s, Ps), !n)
881
881
  throw s;
882
882
  return s;
883
- }, ve = function(t, e, n) {
883
+ }, be = function(t, e, n) {
884
884
  n <<= e & 7;
885
885
  var s = e / 8 | 0;
886
886
  t[s] |= n, t[s + 1] |= n >> 8;
@@ -908,23 +908,23 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
908
908
  r[s].s > p && (p = r[s].s);
909
909
  var v = new re(p + 1), w = pt(n[a - 1], v, 0);
910
910
  if (w > e) {
911
- var s = 0, b = 0, T = w - e, _ = 1 << T;
912
- for (r.sort(function(D, L) {
913
- return v[L.s] - v[D.s] || D.f - L.f;
911
+ var s = 0, y = 0, x = w - e, C = 1 << x;
912
+ for (r.sort(function(D, A) {
913
+ return v[A.s] - v[D.s] || D.f - A.f;
914
914
  }); s < i; ++s) {
915
- var M = r[s].s;
916
- if (v[M] > e)
917
- b += _ - (1 << w - v[M]), v[M] = e;
915
+ var F = r[s].s;
916
+ if (v[F] > e)
917
+ y += C - (1 << w - v[F]), v[F] = e;
918
918
  else
919
919
  break;
920
920
  }
921
- for (b >>= T; b > 0; ) {
921
+ for (y >>= x; y > 0; ) {
922
922
  var R = r[s].s;
923
- v[R] < e ? b -= 1 << e - v[R]++ - 1 : ++s;
923
+ v[R] < e ? y -= 1 << e - v[R]++ - 1 : ++s;
924
924
  }
925
- for (; s >= 0 && b; --s) {
926
- var k = r[s].s;
927
- v[k] == e && (--v[k], ++b);
925
+ for (; s >= 0 && y; --s) {
926
+ var T = r[s].s;
927
+ v[T] == e && (--v[T], ++y);
928
928
  }
929
929
  w = e;
930
930
  }
@@ -965,87 +965,87 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
965
965
  t[i + r + 4] = n[r];
966
966
  return (i + 4 + s) * 8;
967
967
  }, un = function(t, e, n, s, i, r, o, l, c, u, a) {
968
- ve(e, a++, n), ++i[256];
969
- for (var d = ct(i, 15), p = d.t, v = d.l, w = ct(r, 15), b = w.t, T = w.l, _ = ln(p), M = _.c, R = _.n, k = ln(b), N = k.c, D = k.n, L = new re(19), I = 0; I < M.length; ++I)
970
- ++L[M[I] & 31];
968
+ be(e, a++, n), ++i[256];
969
+ for (var d = ct(i, 15), p = d.t, v = d.l, w = ct(r, 15), y = w.t, x = w.l, C = ln(p), F = C.c, R = C.n, T = ln(y), N = T.c, D = T.n, A = new re(19), I = 0; I < F.length; ++I)
970
+ ++A[F[I] & 31];
971
971
  for (var I = 0; I < N.length; ++I)
972
- ++L[N[I] & 31];
973
- for (var E = ct(L, 7), P = E.t, U = E.l, j = 19; j > 4 && !P[an[j - 1]]; --j)
972
+ ++A[N[I] & 31];
973
+ for (var E = ct(A, 7), P = E.t, U = E.l, j = 19; j > 4 && !P[an[j - 1]]; --j)
974
974
  ;
975
- var z = u + 5 << 3, C = Ue(i, Ne) + Ue(r, tt) + o, F = Ue(i, p) + Ue(r, b) + o + 14 + 3 * j + Ue(L, P) + 2 * L[16] + 3 * L[17] + 7 * L[18];
976
- if (c >= 0 && z <= C && z <= F)
975
+ var z = u + 5 << 3, _ = Ue(i, Ne) + Ue(r, tt) + o, M = Ue(i, p) + Ue(r, y) + o + 14 + 3 * j + Ue(A, P) + 2 * A[16] + 3 * A[17] + 7 * A[18];
976
+ if (c >= 0 && z <= _ && z <= M)
977
977
  return En(e, a, t.subarray(c, c + u));
978
- var V, K, $, y;
979
- if (ve(e, a, 1 + (F < C)), a += 2, F < C) {
980
- V = qe(p, v, 0), K = p, $ = qe(b, T, 0), y = b;
978
+ var V, G, $, b;
979
+ if (be(e, a, 1 + (M < _)), a += 2, M < _) {
980
+ V = qe(p, v, 0), G = p, $ = qe(y, x, 0), b = y;
981
981
  var f = qe(P, U, 0);
982
- ve(e, a, R - 257), ve(e, a + 5, D - 1), ve(e, a + 10, j - 4), a += 14;
982
+ be(e, a, R - 257), be(e, a + 5, D - 1), be(e, a + 10, j - 4), a += 14;
983
983
  for (var I = 0; I < j; ++I)
984
- ve(e, a + 3 * I, P[an[I]]);
984
+ be(e, a + 3 * I, P[an[I]]);
985
985
  a += 3 * j;
986
- for (var h = [M, N], m = 0; m < 2; ++m)
986
+ for (var h = [F, N], m = 0; m < 2; ++m)
987
987
  for (var g = h[m], I = 0; I < g.length; ++I) {
988
988
  var S = g[I] & 31;
989
- ve(e, a, f[S]), a += P[S], S > 15 && (ve(e, a, g[I] >> 5 & 127), a += g[I] >> 12);
989
+ be(e, a, f[S]), a += P[S], S > 15 && (be(e, a, g[I] >> 5 & 127), a += g[I] >> 12);
990
990
  }
991
991
  } else
992
- V = Ls, K = Ne, $ = Ms, y = tt;
992
+ V = As, G = Ne, $ = Ms, b = tt;
993
993
  for (var I = 0; I < l; ++I) {
994
- var x = s[I];
995
- if (x > 255) {
996
- var S = x >> 18 & 31;
997
- ze(e, a, V[S + 257]), a += K[S + 257], S > 7 && (ve(e, a, x >> 23 & 31), a += kt[S]);
998
- var A = x & 31;
999
- ze(e, a, $[A]), a += y[A], A > 3 && (ze(e, a, x >> 5 & 8191), a += Tt[A]);
994
+ var k = s[I];
995
+ if (k > 255) {
996
+ var S = k >> 18 & 31;
997
+ ze(e, a, V[S + 257]), a += G[S + 257], S > 7 && (be(e, a, k >> 23 & 31), a += kt[S]);
998
+ var L = k & 31;
999
+ ze(e, a, $[L]), a += b[L], L > 3 && (ze(e, a, k >> 5 & 8191), a += Tt[L]);
1000
1000
  } else
1001
- ze(e, a, V[x]), a += K[x];
1001
+ ze(e, a, V[k]), a += G[k];
1002
1002
  }
1003
- return ze(e, a, V[256]), a + K[256];
1003
+ return ze(e, a, V[256]), a + G[256];
1004
1004
  }, Bs = /* @__PURE__ */ new xt([65540, 131080, 131088, 131104, 262176, 1048704, 1048832, 2114560, 2117632]), In = /* @__PURE__ */ new de(0), js = function(t, e, n, s, i, r) {
1005
1005
  var o = r.z || t.length, l = new de(s + o + 5 * (1 + Math.ceil(o / 7e3)) + i), c = l.subarray(s, l.length - i), u = r.l, a = (r.r || 0) & 7;
1006
1006
  if (e) {
1007
1007
  a && (c[0] = r.r >> 3);
1008
- for (var d = Bs[e - 1], p = d >> 13, v = d & 8191, w = (1 << n) - 1, b = r.p || new re(32768), T = r.h || new re(w + 1), _ = Math.ceil(n / 3), M = 2 * _, R = function(ne) {
1009
- return (t[ne] ^ t[ne + 1] << _ ^ t[ne + 2] << M) & w;
1010
- }, k = new xt(25e3), N = new re(288), D = new re(32), L = 0, I = 0, E = r.i || 0, P = 0, U = r.w || 0, j = 0; E + 2 < o; ++E) {
1011
- var z = R(E), C = E & 32767, F = T[z];
1012
- if (b[C] = F, T[z] = C, U <= E) {
1008
+ for (var d = Bs[e - 1], p = d >> 13, v = d & 8191, w = (1 << n) - 1, y = r.p || new re(32768), x = r.h || new re(w + 1), C = Math.ceil(n / 3), F = 2 * C, R = function(ne) {
1009
+ return (t[ne] ^ t[ne + 1] << C ^ t[ne + 2] << F) & w;
1010
+ }, T = new xt(25e3), N = new re(288), D = new re(32), A = 0, I = 0, E = r.i || 0, P = 0, U = r.w || 0, j = 0; E + 2 < o; ++E) {
1011
+ var z = R(E), _ = E & 32767, M = x[z];
1012
+ if (y[_] = M, x[z] = _, U <= E) {
1013
1013
  var V = o - E;
1014
- if ((L > 7e3 || P > 24576) && (V > 423 || !u)) {
1015
- a = un(t, c, 0, k, N, D, I, P, j, E - j, a), P = L = I = 0, j = E;
1016
- for (var K = 0; K < 286; ++K)
1017
- N[K] = 0;
1018
- for (var K = 0; K < 30; ++K)
1019
- D[K] = 0;
1014
+ if ((A > 7e3 || P > 24576) && (V > 423 || !u)) {
1015
+ a = un(t, c, 0, T, N, D, I, P, j, E - j, a), P = A = I = 0, j = E;
1016
+ for (var G = 0; G < 286; ++G)
1017
+ N[G] = 0;
1018
+ for (var G = 0; G < 30; ++G)
1019
+ D[G] = 0;
1020
1020
  }
1021
- var $ = 2, y = 0, f = v, h = C - F & 32767;
1021
+ var $ = 2, b = 0, f = v, h = _ - M & 32767;
1022
1022
  if (V > 2 && z == R(E - h))
1023
- for (var m = Math.min(p, V) - 1, g = Math.min(32767, E), S = Math.min(258, V); h <= g && --f && C != F; ) {
1023
+ for (var m = Math.min(p, V) - 1, g = Math.min(32767, E), S = Math.min(258, V); h <= g && --f && _ != M; ) {
1024
1024
  if (t[E + $] == t[E + $ - h]) {
1025
- for (var x = 0; x < S && t[E + x] == t[E + x - h]; ++x)
1025
+ for (var k = 0; k < S && t[E + k] == t[E + k - h]; ++k)
1026
1026
  ;
1027
- if (x > $) {
1028
- if ($ = x, y = h, x > m)
1027
+ if (k > $) {
1028
+ if ($ = k, b = h, k > m)
1029
1029
  break;
1030
- for (var A = Math.min(h, x - 2), B = 0, K = 0; K < A; ++K) {
1031
- var q = E - h + K & 32767, O = b[q], W = q - O & 32767;
1032
- W > B && (B = W, F = q);
1030
+ for (var L = Math.min(h, k - 2), B = 0, G = 0; G < L; ++G) {
1031
+ var q = E - h + G & 32767, O = y[q], W = q - O & 32767;
1032
+ W > B && (B = W, M = q);
1033
1033
  }
1034
1034
  }
1035
1035
  }
1036
- C = F, F = b[C], h += C - F & 32767;
1036
+ _ = M, M = y[_], h += _ - M & 32767;
1037
1037
  }
1038
- if (y) {
1039
- k[P++] = 268435456 | dt[$] << 18 | cn[y];
1040
- var ee = dt[$] & 31, oe = cn[y] & 31;
1041
- I += kt[ee] + Tt[oe], ++N[257 + ee], ++D[oe], U = E + $, ++L;
1038
+ if (b) {
1039
+ T[P++] = 268435456 | dt[$] << 18 | cn[b];
1040
+ var ee = dt[$] & 31, oe = cn[b] & 31;
1041
+ I += kt[ee] + Tt[oe], ++N[257 + ee], ++D[oe], U = E + $, ++A;
1042
1042
  } else
1043
- k[P++] = t[E], ++N[t[E]];
1043
+ T[P++] = t[E], ++N[t[E]];
1044
1044
  }
1045
1045
  }
1046
1046
  for (E = Math.max(E, U); E < o; ++E)
1047
- k[P++] = t[E], ++N[t[E]];
1048
- a = un(t, c, u, k, N, D, I, P, j, E - j, a), u || (r.r = a & 7 | c[a / 8 | 0] << 3, a -= 7, r.h = T, r.p = b, r.i = E, r.w = U);
1047
+ T[P++] = t[E], ++N[t[E]];
1048
+ a = un(t, c, u, T, N, D, I, P, j, E - j, a), u || (r.r = a & 7 | c[a / 8 | 0] << 3, a -= 7, r.h = x, r.p = y, r.i = E, r.w = U);
1049
1049
  } else {
1050
1050
  for (var E = r.w || 0; E < o + u; E += 65535) {
1051
1051
  var te = E + 65535;
@@ -1119,9 +1119,9 @@ var Ls = /* @__PURE__ */ qe(Ne, 9, 0), Ms = /* @__PURE__ */ qe(tt, 5, 0), Tn = f
1119
1119
  nt[n] = { c: Wn(t[o], i, r), e: r };
1120
1120
  }
1121
1121
  var c = xi({}, nt[n].e);
1122
- return vi(nt[n].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + e.toString() + "}", n, c, ki(c), s);
1122
+ return bi(nt[n].c + ";onmessage=function(e){for(var k in e.data)self[k]=e.data[k];onmessage=" + e.toString() + "}", n, c, ki(c), s);
1123
1123
  }, Ei = function() {
1124
- return [de, re, xt, kt, Tt, an, dt, cn, Ls, Ne, Ms, tt, ft, Bs, In, qe, ve, ze, ct, pt, ln, Ue, En, un, Tn, Fs, js, Cn, _i, Hs];
1124
+ return [de, re, xt, kt, Tt, an, dt, cn, As, Ne, Ms, tt, ft, Bs, In, qe, be, ze, ct, pt, ln, Ue, En, un, Tn, Fs, js, Cn, _i, Hs];
1125
1125
  }, Ii = function() {
1126
1126
  return [$s, qs, gt, Us, zs];
1127
1127
  }, Hs = function(t) {
@@ -1207,11 +1207,11 @@ class Di {
1207
1207
  this.dict = new Gn();
1208
1208
  }
1209
1209
  }
1210
- class Ai {
1210
+ class Li {
1211
1211
  constructor(e, n) {
1212
1212
  this.app = e, this.startParams = n, this.conditions = [], this.hasStarted = !1, this.createConditionFromFilter = (s) => {
1213
1213
  if (s.value.length) {
1214
- const i = Li(s);
1214
+ const i = Ai(s);
1215
1215
  if (i.type)
1216
1216
  return i;
1217
1217
  }
@@ -1354,7 +1354,7 @@ const Pe = {
1354
1354
  greaterOrEqual: (t, e) => t >= e,
1355
1355
  lessOrEqual: (t, e) => t <= e,
1356
1356
  lessThan: (t, e) => t < e
1357
- }, Li = (t) => {
1357
+ }, Ai = (t) => {
1358
1358
  const e = {
1359
1359
  on: "is",
1360
1360
  notOn: "isNot",
@@ -1556,7 +1556,7 @@ function Nn(t) {
1556
1556
  let e = t.getAttribute("data-openreplay-label");
1557
1557
  return e !== null || (e = t.getAttribute("data-asayer-label"), e !== null && _e('"data-asayer-label" attribute', '"data-openreplay-label" attribute', "/")), e;
1558
1558
  }
1559
- function Ae(t, e) {
1559
+ function Le(t, e) {
1560
1560
  const n = `data-openreplay-${e}`;
1561
1561
  return t.hasAttribute(n) ? (Kn[e] && _e(
1562
1562
  `"${n}" attribute`,
@@ -1948,7 +1948,7 @@ function pn(t, e, n, s) {
1948
1948
  s
1949
1949
  ];
1950
1950
  }
1951
- function bt(t, e, n, s, i, r, o, l, c) {
1951
+ function vt(t, e, n, s, i, r, o, l, c) {
1952
1952
  return [
1953
1953
  83,
1954
1954
  t,
@@ -1973,7 +1973,7 @@ function mr(t, e, n, s, i, r) {
1973
1973
  r
1974
1974
  ];
1975
1975
  }
1976
- function br(t, e, n, s, i, r) {
1976
+ function vr(t, e, n, s, i, r) {
1977
1977
  return [
1978
1978
  112,
1979
1979
  t,
@@ -1992,7 +1992,7 @@ function ss(t, e, n) {
1992
1992
  n
1993
1993
  ];
1994
1994
  }
1995
- function vr(t) {
1995
+ function br(t) {
1996
1996
  return [
1997
1997
  114,
1998
1998
  t
@@ -2294,7 +2294,7 @@ const Er = {
2294
2294
  fontSize: "13px",
2295
2295
  height: "24px",
2296
2296
  width: "24px"
2297
- }, Ar = {
2297
+ }, Lr = {
2298
2298
  display: "flex",
2299
2299
  flexDirection: "column",
2300
2300
  alignItems: "center",
@@ -2318,7 +2318,7 @@ const Er = {
2318
2318
  alignSelf: "stretch"
2319
2319
  }, hs = {
2320
2320
  fontWeight: "bold"
2321
- }, Lr = {
2321
+ }, Ar = {
2322
2322
  fontSize: "13px",
2323
2323
  lineHeight: "auto"
2324
2324
  }, Zs = {
@@ -2493,7 +2493,7 @@ function H(t, e, n, s, i) {
2493
2493
  const r = document.createElement(t);
2494
2494
  return r.className = e, Object.assign(r.style, n), s && (r.textContent = s), i && (r.id = i), r;
2495
2495
  }
2496
- const ut = "or_uxt_test_start", mn = "or_uxt_task_index", bn = "or_uxt_session_id", qr = "or_uxt_test_id";
2496
+ const ut = "or_uxt_test_start", mn = "or_uxt_task_index", vn = "or_uxt_session_id", qr = "or_uxt_test_id";
2497
2497
  class Wr {
2498
2498
  constructor(e, n, s, i, r, o, l, c, u) {
2499
2499
  this.ingestPoint = e, this.getTimestamp = n, this.token = s, this.testId = i, this.storageKey = r, this.setStorageKey = o, this.removeStorageKey = l, this.getStorageKey = c, this.getSessionId = u, this.durations = {
@@ -2504,7 +2504,7 @@ class Wr {
2504
2504
  }, this.signalTask = (d, p, v) => {
2505
2505
  if (!d)
2506
2506
  return console.error("User Testing: No Task ID Given");
2507
- const w = this.durations.tasks.find((_) => _.taskId === d), b = this.getTimestamp(), T = w ? b - w.started : 0;
2507
+ const w = this.durations.tasks.find((C) => C.taskId === d), y = this.getTimestamp(), x = w ? y - w.started : 0;
2508
2508
  return fetch(`${this.ingestPoint}/v1/web/uxt/signals/task`, {
2509
2509
  method: "POST",
2510
2510
  headers: {
@@ -2515,16 +2515,16 @@ class Wr {
2515
2515
  testId: this.testId,
2516
2516
  taskId: d,
2517
2517
  status: p,
2518
- duration: T,
2519
- timestamp: b,
2518
+ duration: x,
2519
+ timestamp: y,
2520
2520
  taskAnswer: v
2521
2521
  })
2522
2522
  });
2523
2523
  }, this.signalTest = (d) => {
2524
2524
  const p = this.getTimestamp();
2525
2525
  if (d === "begin" && this.testId) {
2526
- const b = this.getSessionId();
2527
- this.setStorageKey(bn, b), this.setStorageKey(this.storageKey, this.testId.toString()), this.setStorageKey(ut, p.toString());
2526
+ const y = this.getSessionId();
2527
+ this.setStorageKey(vn, y), this.setStorageKey(this.storageKey, this.testId.toString()), this.setStorageKey(ut, p.toString());
2528
2528
  } else
2529
2529
  this.removeStorageKey(this.storageKey), this.removeStorageKey(mn), this.removeStorageKey(ut);
2530
2530
  const v = this.durations.testStart || p, w = p - v;
@@ -2562,8 +2562,8 @@ class Vr {
2562
2562
  });
2563
2563
  }, this.hideTaskSection = () => !1, this.showTaskSection = () => !0, this.collapseWidget = () => !1, this.removeGreeting = () => !1, this.toggleDescriptionVisibility = () => {
2564
2564
  }, this.currentTaskIndex = 0, this.userRecorder = new Br(e);
2565
- const s = this.app.getSessionID(), i = this.app.localStorage.getItem(bn);
2566
- s !== i && (this.app.localStorage.removeItem(this.storageKey), this.app.localStorage.removeItem(bn), this.app.localStorage.removeItem(qr), this.app.localStorage.removeItem(mn), this.app.localStorage.removeItem(ut));
2565
+ const s = this.app.getSessionID(), i = this.app.localStorage.getItem(vn);
2566
+ s !== i && (this.app.localStorage.removeItem(this.storageKey), this.app.localStorage.removeItem(vn), this.app.localStorage.removeItem(qr), this.app.localStorage.removeItem(mn), this.app.localStorage.removeItem(ut));
2567
2567
  const r = this.app.localStorage.getItem(mn);
2568
2568
  r && (this.currentTaskIndex = parseInt(r, 10));
2569
2569
  }
@@ -2647,7 +2647,7 @@ class Vr {
2647
2647
  }, c.onclick = () => {
2648
2648
  var a, d, p;
2649
2649
  if (u(), this.test) {
2650
- const v = (a = this.signalManager) == null ? void 0 : a.getDurations(), w = v ? v.tasks.findIndex((b) => this.test && b.taskId === this.test.tasks[0].task_id) : null;
2650
+ const v = (a = this.signalManager) == null ? void 0 : a.getDurations(), w = v ? v.tasks.findIndex((y) => this.test && y.taskId === this.test.tasks[0].task_id) : null;
2651
2651
  v && w === -1 && (v.tasks.push({
2652
2652
  taskId: this.test.tasks[0].task_id,
2653
2653
  started: this.app.timestamp()
@@ -2662,19 +2662,19 @@ class Vr {
2662
2662
  fontSize: "13px",
2663
2663
  fontWeight: "500",
2664
2664
  lineHeight: "auto"
2665
- }, "Tasks"), r = H("div", "icon", os, "-"), o = H("div", "content", Be), l = H("div", "pagination", Dr), c = H("div", "taskCard", us), u = H("div", "taskText", hs), a = H("div", "taskDescription", Lr), d = H("div", "taskButtons", Fr), p = H("div", "taskText", hs);
2665
+ }, "Tasks"), r = H("div", "icon", os, "-"), o = H("div", "content", Be), l = H("div", "pagination", Dr), c = H("div", "taskCard", us), u = H("div", "taskText", hs), a = H("div", "taskDescription", Ar), d = H("div", "taskButtons", Fr), p = H("div", "taskText", hs);
2666
2666
  p.textContent = "Your answer";
2667
2667
  const v = H("textarea", "taskDescription", {
2668
2668
  resize: "vertical"
2669
2669
  }), w = H("div", "inputArea", us);
2670
2670
  w.append(p, v);
2671
- const b = H("div", "closePanelButton", Zs, "Collapse Panel"), T = H("div", "nextButton", Mr, "Done, Next");
2672
- s.append(i, r), c.append(u, a), d.append(b, T), o.append(l, c, w, d), n.append(s, o);
2673
- const _ = () => {
2674
- const k = e[this.currentTaskIndex];
2675
- u.textContent = k.title, a.textContent = k.description, k.allow_typing ? w.style.display = "flex" : w.style.display = "none";
2671
+ const y = H("div", "closePanelButton", Zs, "Collapse Panel"), x = H("div", "nextButton", Mr, "Done, Next");
2672
+ s.append(i, r), c.append(u, a), d.append(y, x), o.append(l, c, w, d), n.append(s, o);
2673
+ const C = () => {
2674
+ const T = e[this.currentTaskIndex];
2675
+ u.textContent = T.title, a.textContent = T.description, T.allow_typing ? w.style.display = "flex" : w.style.display = "none";
2676
2676
  };
2677
- e.forEach((k, N) => {
2677
+ e.forEach((T, N) => {
2678
2678
  const D = H("span", `or_task_${N}`, {
2679
2679
  outline: "1px solid #efefef",
2680
2680
  fontSize: "13px",
@@ -2688,36 +2688,36 @@ class Vr {
2688
2688
  }, (N + 1).toString());
2689
2689
  D.id = `or_task_${N}`, l.append(D);
2690
2690
  });
2691
- const M = () => {
2691
+ const F = () => {
2692
2692
  this.widgetTasksVisible = !this.widgetTasksVisible, r.textContent = this.widgetTasksVisible ? "-" : "+", Object.assign(o.style, this.widgetTasksVisible ? Be : { display: "none" });
2693
2693
  };
2694
2694
  this.hideTaskSection = () => (r.textContent = "+", Object.assign(o.style, {
2695
2695
  display: "none"
2696
2696
  }), this.widgetTasksVisible = !1, !1), this.showTaskSection = () => (r.textContent = "-", Object.assign(o.style, Be), this.widgetTasksVisible = !0, !0);
2697
2697
  const R = () => {
2698
- const k = document.getElementById(`or_task_${this.currentTaskIndex}`);
2699
- k && Object.assign(k.style, ls);
2698
+ const T = document.getElementById(`or_task_${this.currentTaskIndex}`);
2699
+ T && Object.assign(T.style, ls);
2700
2700
  for (let N = 0; N < this.currentTaskIndex; N++) {
2701
2701
  const D = document.getElementById(`or_task_${N}`);
2702
- D && Object.assign(D.style, Ar);
2702
+ D && Object.assign(D.style, Lr);
2703
2703
  }
2704
2704
  };
2705
- return s.onclick = M, b.onclick = this.collapseWidget, T.onclick = () => {
2706
- var N, D, L, I;
2707
- const k = e[this.currentTaskIndex].allow_typing ? v.value : void 0;
2708
- if (v.value = "", (N = this.signalManager) == null || N.signalTask(e[this.currentTaskIndex].task_id, "done", k), this.currentTaskIndex < e.length - 1) {
2709
- this.currentTaskIndex++, _();
2705
+ return s.onclick = F, y.onclick = this.collapseWidget, x.onclick = () => {
2706
+ var N, D, A, I;
2707
+ const T = e[this.currentTaskIndex].allow_typing ? v.value : void 0;
2708
+ if (v.value = "", (N = this.signalManager) == null || N.signalTask(e[this.currentTaskIndex].task_id, "done", T), this.currentTaskIndex < e.length - 1) {
2709
+ this.currentTaskIndex++, C();
2710
2710
  const E = (D = this.signalManager) == null ? void 0 : D.getDurations();
2711
2711
  E && E.tasks.findIndex((P) => P.taskId === e[this.currentTaskIndex].task_id) === -1 && (E.tasks.push({
2712
2712
  taskId: e[this.currentTaskIndex].task_id,
2713
2713
  started: this.app.timestamp()
2714
- }), (L = this.signalManager) == null || L.setDurations(E)), (I = this.signalManager) == null || I.signalTask(e[this.currentTaskIndex].task_id, "begin"), R();
2714
+ }), (A = this.signalManager) == null || A.setDurations(E)), (I = this.signalManager) == null || I.signalTask(e[this.currentTaskIndex].task_id, "begin"), R();
2715
2715
  } else
2716
2716
  this.showEndSection();
2717
2717
  this.app.localStorage.setItem("or_uxt_task_index", this.currentTaskIndex.toString());
2718
2718
  }, setTimeout(() => {
2719
- const k = document.getElementById("or_task_0");
2720
- k && Object.assign(k.style, ls), _(), R();
2719
+ const T = document.getElementById("or_task_0");
2720
+ T && Object.assign(T.style, ls), C(), R();
2721
2721
  }, 1), n;
2722
2722
  }
2723
2723
  showEndSection() {
@@ -2742,7 +2742,7 @@ We appreciate your time and valuable input.`), r = H("div", "end_button_or", as,
2742
2742
  function ei(t) {
2743
2743
  return !!t && t.nodeType != null;
2744
2744
  }
2745
- function vn(t) {
2745
+ function bn(t) {
2746
2746
  return t.namespaceURI === "http://www.w3.org/2000/svg";
2747
2747
  }
2748
2748
  function ke(t) {
@@ -2754,7 +2754,7 @@ function Gr(t) {
2754
2754
  function yn(t) {
2755
2755
  return t.nodeType === Node.TEXT_NODE;
2756
2756
  }
2757
- function vt(t) {
2757
+ function bt(t) {
2758
2758
  return t.nodeType === Node.DOCUMENT_NODE;
2759
2759
  }
2760
2760
  function Et(t) {
@@ -2989,7 +2989,7 @@ class Rn {
2989
2989
  this.commited.length = 0, this.recents.clear(), this.indexes.length = 1, this.attributesMap.clear(), this.textSet.clear();
2990
2990
  }
2991
2991
  sendNodeAttribute(e, n, s, i) {
2992
- if (vn(n)) {
2992
+ if (bn(n)) {
2993
2993
  s.substr(0, 6) === "xlink:" && (s = s.substr(6)), i === null ? this.app.send(Yn(e, s)) : s === "href" ? (i.length > 1e5 && (i = ""), this.app.send(hn(e, s, i, this.app.getBaseHref()))) : this.app.attributeSender.sendSetAttribute(e, s, i);
2994
2994
  return;
2995
2995
  }
@@ -3090,7 +3090,7 @@ class Rn {
3090
3090
  const d = a.clientWidth, p = a.clientHeight;
3091
3091
  a = n.cloneNode(), a.style.width = `${d}px`, a.style.height = `${p}px`;
3092
3092
  }
3093
- this.app.send(Gi(e, i, c, a.tagName, vn(n)));
3093
+ this.app.send(Gi(e, i, c, a.tagName, bn(n)));
3094
3094
  }
3095
3095
  for (let d = 0; d < a.attributes.length; d++) {
3096
3096
  const p = a.attributes[d];
@@ -3222,7 +3222,7 @@ class to extends Rn {
3222
3222
  super(e, !0), this.iframeOffsets = new eo(), this.contextCallbacks = [], this.contextsSet = /* @__PURE__ */ new Set(), this.iframeObservers = [], this.shadowRootObservers = [], this.options = Object.assign({
3223
3223
  captureIFrames: !0
3224
3224
  }, n), this.app.nodes.attachNodeCallback((s) => {
3225
- Z(s, "iframe") && (this.options.captureIFrames && !Ae(s, "obscured") || Ae(s, "capture")) && this.handleIframe(s);
3225
+ Z(s, "iframe") && (this.options.captureIFrames && !Le(s, "obscured") || Le(s, "capture")) && this.handleIframe(s);
3226
3226
  }), this.app.nodes.attachNodeCallback((s) => {
3227
3227
  ke(s) && s.shadowRoot !== null && this.handleShadowRoot(s.shadowRoot);
3228
3228
  });
@@ -3287,7 +3287,7 @@ class so {
3287
3287
  }, n);
3288
3288
  }
3289
3289
  handleNode(e, n, s) {
3290
- if ((this.obscured.has(n) || ke(s) && (Ae(s, "masked") || Ae(s, "obscured"))) && this.obscured.add(e), (this.hidden.has(n) || ke(s) && (Ae(s, "htmlmasked") || Ae(s, "hidden"))) && this.hidden.add(e), this.options.domSanitizer !== void 0 && ke(s)) {
3290
+ if ((this.obscured.has(n) || ke(s) && (Le(s, "masked") || Le(s, "obscured"))) && this.obscured.add(e), (this.hidden.has(n) || ke(s) && (Le(s, "htmlmasked") || Le(s, "hidden"))) && this.hidden.add(e), this.options.domSanitizer !== void 0 && ke(s)) {
3291
3291
  const i = this.options.domSanitizer(s);
3292
3292
  i === yt.Obscured && this.obscured.add(e), i === yt.Hidden && this.hidden.add(e);
3293
3293
  }
@@ -3523,56 +3523,56 @@ let lo = class {
3523
3523
  if (d.line === ue.iframeSignal) {
3524
3524
  const p = d.domain, v = Array.from(document.querySelectorAll("iframe"));
3525
3525
  this.pageFrames = v, (async () => {
3526
- let b = 0;
3527
- for (; b < 10; ) {
3528
- const T = this.checkNodeId(v, p);
3529
- if (T) {
3526
+ let y = 0;
3527
+ for (; y < 10; ) {
3528
+ const x = this.checkNodeId(v, p);
3529
+ if (x) {
3530
3530
  this.waitStarted().then(() => {
3531
3531
  var R;
3532
3532
  c++;
3533
- const _ = this.session.getSessionToken(), M = {
3533
+ const C = this.session.getSessionToken(), F = {
3534
3534
  line: ue.iframeId,
3535
3535
  context: this.contextId,
3536
3536
  domain: p,
3537
- id: T,
3538
- token: _,
3537
+ id: x,
3538
+ token: C,
3539
3539
  frameOrderNumber: c
3540
3540
  };
3541
- this.debug.log("iframe_data", M), (R = a.source) == null || R.postMessage(M, "*");
3542
- }).catch(console.error), b = 10;
3541
+ this.debug.log("iframe_data", F), (R = a.source) == null || R.postMessage(F, "*");
3542
+ }).catch(console.error), y = 10;
3543
3543
  break;
3544
3544
  }
3545
- b++, await co(100);
3545
+ y++, await co(100);
3546
3546
  }
3547
3547
  })();
3548
3548
  }
3549
3549
  if (d.line === ue.iframeBatch) {
3550
3550
  const v = d.messages.map((w) => {
3551
3551
  if (w[0] === 20) {
3552
- let b = w;
3553
- return this.pageFrames.forEach((T) => {
3554
- if (T.dataset.domain === a.data.domain) {
3555
- const [_, M, R] = w, { left: k, top: N } = T.getBoundingClientRect();
3556
- b = [_, M + k, R + N];
3552
+ let y = w;
3553
+ return this.pageFrames.forEach((x) => {
3554
+ if (x.dataset.domain === a.data.domain) {
3555
+ const [C, F, R] = w, { left: T, top: N } = x.getBoundingClientRect();
3556
+ y = [C, F + T, R + N];
3557
3557
  }
3558
- }), b;
3558
+ }), y;
3559
3559
  }
3560
3560
  if (w[0] === 68) {
3561
- let b = w;
3562
- return this.pageFrames.forEach((T) => {
3563
- if (T.dataset.domain === a.data.domain) {
3564
- const [_, M, R, k, N, D, L] = w, { left: I, top: E, width: P, height: U } = T.getBoundingClientRect(), j = document.documentElement.scrollWidth, z = document.documentElement.scrollHeight, C = D / 100 * P + I, F = L / 100 * U + E, V = C / j, K = F / z;
3565
- b = [
3566
- _,
3567
- M,
3561
+ let y = w;
3562
+ return this.pageFrames.forEach((x) => {
3563
+ if (x.dataset.domain === a.data.domain) {
3564
+ const [C, F, R, T, N, D, A] = w, { left: I, top: E, width: P, height: U } = x.getBoundingClientRect(), j = document.documentElement.scrollWidth, z = document.documentElement.scrollHeight, _ = D / 100 * P + I, M = A / 100 * U + E, V = _ / j, G = M / z;
3565
+ y = [
3566
+ C,
3567
+ F,
3568
3568
  R,
3569
- k,
3569
+ T,
3570
3570
  N,
3571
3571
  Math.round(V * 1e3) / 10,
3572
- Math.round(K * 1e3) / 10
3572
+ Math.round(G * 1e3) / 10
3573
3573
  ];
3574
3574
  }
3575
- }), b;
3575
+ }), y;
3576
3576
  }
3577
3577
  return w;
3578
3578
  });
@@ -3838,7 +3838,7 @@ let lo = class {
3838
3838
  }
3839
3839
  async setupConditionalStart(e) {
3840
3840
  var p, v;
3841
- this.conditionsManager = new Ai(this, e);
3841
+ this.conditionsManager = new Li(this, e);
3842
3842
  const n = await fetch(this.options.ingestPoint + "/v1/web/start", {
3843
3843
  method: "POST",
3844
3844
  headers: {
@@ -4029,12 +4029,12 @@ let lo = class {
4029
4029
  })
4030
4030
  });
4031
4031
  if (c.status !== 200) {
4032
- const C = await c.text(), F = C === Qe ? Qe : `Server error: ${c.status}. ${C}`;
4033
- return Ce(F);
4032
+ const _ = await c.text(), M = _ === Qe ? Qe : `Server error: ${c.status}. ${_}`;
4033
+ return Ce(M);
4034
4034
  }
4035
4035
  if (!this.worker) {
4036
- const C = "no worker found after start request (this should not happen in real world)";
4037
- return this.signalError(C, []), Ce(C);
4036
+ const _ = "no worker found after start request (this should not happen in real world)";
4037
+ return this.signalError(_, []), Ce(_);
4038
4038
  }
4039
4039
  const {
4040
4040
  token: u,
@@ -4045,52 +4045,52 @@ let lo = class {
4045
4045
  // how big the batch should be before we decide to compress it
4046
4046
  delay: w,
4047
4047
  // derived from token
4048
- sessionID: b,
4048
+ sessionID: y,
4049
4049
  // derived from token
4050
- startTimestamp: T,
4050
+ startTimestamp: x,
4051
4051
  // real startTS (server time), derived from sessionID
4052
- userBrowser: _,
4053
- userCity: M,
4052
+ userBrowser: C,
4053
+ userCity: F,
4054
4054
  userCountry: R,
4055
- userDevice: k,
4055
+ userDevice: T,
4056
4056
  userOS: N,
4057
4057
  userState: D,
4058
- canvasEnabled: L,
4058
+ canvasEnabled: A,
4059
4059
  canvasQuality: I,
4060
4060
  canvasFPS: E,
4061
4061
  assistOnly: P
4062
4062
  } = await c.json();
4063
- if (typeof u != "string" || typeof a != "string" || typeof T != "number" && typeof T < "u" || typeof b != "string" || typeof w != "number" || typeof p != "number" && typeof p < "u") {
4064
- const C = `Incorrect server response: ${JSON.stringify(c)}`;
4065
- return this.signalError(C, []), Ce(C);
4063
+ if (typeof u != "string" || typeof a != "string" || typeof x != "number" && typeof x < "u" || typeof y != "string" || typeof w != "number" || typeof p != "number" && typeof p < "u") {
4064
+ const _ = `Incorrect server response: ${JSON.stringify(c)}`;
4065
+ return this.signalError(_, []), Ce(_);
4066
4066
  }
4067
4067
  this.delay = w, this.session.setSessionToken(u), this.session.setUserInfo({
4068
- userBrowser: _,
4069
- userCity: M,
4068
+ userBrowser: C,
4069
+ userCity: F,
4070
4070
  userCountry: R,
4071
- userDevice: k,
4071
+ userDevice: T,
4072
4072
  userOS: N,
4073
4073
  userState: D
4074
4074
  }), this.session.assign({
4075
- sessionID: b,
4076
- timestamp: T || r,
4075
+ sessionID: y,
4076
+ timestamp: x || r,
4077
4077
  projectID: d
4078
4078
  }), P ? (this.socketMode = !0, this.worker.postMessage("stop")) : this.worker.postMessage({
4079
4079
  type: "auth",
4080
4080
  token: u,
4081
4081
  beaconSizeLimit: p
4082
- }), !l && u === o && (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(lt(this.session.getTabId()))), Object.entries(this.session.getInfo().metadata).forEach(([C, F]) => this.send(Qn(C, F))), this.localStorage.setItem(this.options.local_uuid_key, a), this.compressionThreshold = v;
4083
- const U = { sessionToken: u, userUUID: a, sessionID: b };
4084
- if (this.startCallbacks.forEach((C) => C(U)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint, u), this.activityState = Q.Active, L && !this.options.canvas.disableCanvas && (this.canvasRecorder = this.canvasRecorder ?? new Kr(this, {
4082
+ }), !l && u === o && (this.debug.log("continuing session on new tab", this.session.getTabId()), this.send(lt(this.session.getTabId()))), Object.entries(this.session.getInfo().metadata).forEach(([_, M]) => this.send(Qn(_, M))), this.localStorage.setItem(this.options.local_uuid_key, a), this.compressionThreshold = v;
4083
+ const U = { sessionToken: u, userUUID: a, sessionID: y };
4084
+ if (this.startCallbacks.forEach((_) => _(U)), this.featureFlags.reloadFlags(), await this.tagWatcher.fetchTags(this.options.ingestPoint, u), this.activityState = Q.Active, A && !this.options.canvas.disableCanvas && (this.canvasRecorder = this.canvasRecorder ?? new Kr(this, {
4085
4085
  fps: E,
4086
4086
  quality: I,
4087
4087
  isDebug: this.options.canvas.__save_canvas_locally,
4088
4088
  fixedScaling: this.options.canvas.fixedCanvasScaling,
4089
4089
  useAnimationFrame: this.options.canvas.useAnimationFrame
4090
4090
  }), this.canvasRecorder.startTracking()), i) {
4091
- const C = this.bufferedMessages1.length > this.bufferedMessages2.length ? this.bufferedMessages1 : this.bufferedMessages2;
4092
- for (; C.length > 0; )
4093
- await this.flushBuffer(C);
4091
+ const _ = this.bufferedMessages1.length > this.bufferedMessages2.length ? this.bufferedMessages1 : this.bufferedMessages2;
4092
+ for (; _.length > 0; )
4093
+ await this.flushBuffer(_);
4094
4094
  this.clearBuffers(), this.commit();
4095
4095
  } else
4096
4096
  this.insideIframe && this.rootId ? this.observer.crossdomainObserve(this.rootId, this.frameOderNumber) : this.observer.observe(), this.ticker.start();
@@ -4098,14 +4098,14 @@ let lo = class {
4098
4098
  let j;
4099
4099
  const z = this.localStorage.getItem(gs);
4100
4100
  if (z && (j = parseInt(z, 10)), location != null && location.search) {
4101
- const C = new URLSearchParams(location.search);
4102
- if (C.has("oruxt")) {
4103
- const F = C.get("oruxt");
4104
- j = F ? parseInt(F, 10) : void 0;
4101
+ const _ = new URLSearchParams(location.search);
4102
+ if (_.has("oruxt")) {
4103
+ const M = _.get("oruxt");
4104
+ j = M ? parseInt(M, 10) : void 0;
4105
4105
  }
4106
4106
  }
4107
- return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((C) => C(j)) : this.uxtManager.getTest(j, u, !!z).then((C) => {
4108
- C && this.onUxtCb.forEach((F) => F(C));
4107
+ return j && (this.uxtManager.isActive ? this.onUxtCb.forEach((_) => _(j)) : this.uxtManager.getTest(j, u, !!z).then((_) => {
4108
+ _ && this.onUxtCb.forEach((M) => M(_));
4109
4109
  })), ao(U);
4110
4110
  } catch (c) {
4111
4111
  if (this.stop(), this.session.reset(), c === Qe)
@@ -4243,10 +4243,10 @@ function po(t) {
4243
4243
  }
4244
4244
  })), t.map(ms).join(" ");
4245
4245
  }
4246
- const bs = ["log", "info", "warn", "error", "debug", "assert"];
4246
+ const vs = ["log", "info", "warn", "error", "debug", "assert"];
4247
4247
  function go(t, e) {
4248
4248
  const n = Object.assign({
4249
- consoleMethods: bs,
4249
+ consoleMethods: vs,
4250
4250
  consoleThrottling: 30
4251
4251
  }, e);
4252
4252
  if (!Array.isArray(n.consoleMethods) || n.consoleMethods.length === 0)
@@ -4264,7 +4264,7 @@ function go(t, e) {
4264
4264
  }
4265
4265
  };
4266
4266
  n.consoleMethods.forEach((d) => {
4267
- if (bs.indexOf(d) === -1) {
4267
+ if (vs.indexOf(d) === -1) {
4268
4268
  t.debug.error(`OpenReplay: unsupported console method "${d}"`);
4269
4269
  return;
4270
4270
  }
@@ -4274,83 +4274,83 @@ function go(t, e) {
4274
4274
  }, l = t.safe((c) => o(c.console, c));
4275
4275
  l(window), t.observer.attachContextCallback(l);
4276
4276
  }
4277
- var si = { exports: {} }, nn = { exports: {} }, vs;
4277
+ var si = { exports: {} }, nn = { exports: {} }, bs;
4278
4278
  function mo() {
4279
- return vs || (vs = 1, function(t, e) {
4279
+ return bs || (bs = 1, function(t, e) {
4280
4280
  (function(n, s) {
4281
4281
  t.exports = s();
4282
4282
  })($e, function() {
4283
- function n(b) {
4284
- return !isNaN(parseFloat(b)) && isFinite(b);
4283
+ function n(y) {
4284
+ return !isNaN(parseFloat(y)) && isFinite(y);
4285
4285
  }
4286
- function s(b) {
4287
- return b.charAt(0).toUpperCase() + b.substring(1);
4286
+ function s(y) {
4287
+ return y.charAt(0).toUpperCase() + y.substring(1);
4288
4288
  }
4289
- function i(b) {
4289
+ function i(y) {
4290
4290
  return function() {
4291
- return this[b];
4291
+ return this[y];
4292
4292
  };
4293
4293
  }
4294
4294
  var r = ["isConstructor", "isEval", "isNative", "isToplevel"], o = ["columnNumber", "lineNumber"], l = ["fileName", "functionName", "source"], c = ["args"], u = ["evalOrigin"], a = r.concat(o, l, c, u);
4295
- function d(b) {
4296
- if (b)
4297
- for (var T = 0; T < a.length; T++)
4298
- b[a[T]] !== void 0 && this["set" + s(a[T])](b[a[T]]);
4295
+ function d(y) {
4296
+ if (y)
4297
+ for (var x = 0; x < a.length; x++)
4298
+ y[a[x]] !== void 0 && this["set" + s(a[x])](y[a[x]]);
4299
4299
  }
4300
4300
  d.prototype = {
4301
4301
  getArgs: function() {
4302
4302
  return this.args;
4303
4303
  },
4304
- setArgs: function(b) {
4305
- if (Object.prototype.toString.call(b) !== "[object Array]")
4304
+ setArgs: function(y) {
4305
+ if (Object.prototype.toString.call(y) !== "[object Array]")
4306
4306
  throw new TypeError("Args must be an Array");
4307
- this.args = b;
4307
+ this.args = y;
4308
4308
  },
4309
4309
  getEvalOrigin: function() {
4310
4310
  return this.evalOrigin;
4311
4311
  },
4312
- setEvalOrigin: function(b) {
4313
- if (b instanceof d)
4314
- this.evalOrigin = b;
4315
- else if (b instanceof Object)
4316
- this.evalOrigin = new d(b);
4312
+ setEvalOrigin: function(y) {
4313
+ if (y instanceof d)
4314
+ this.evalOrigin = y;
4315
+ else if (y instanceof Object)
4316
+ this.evalOrigin = new d(y);
4317
4317
  else
4318
4318
  throw new TypeError("Eval Origin must be an Object or StackFrame");
4319
4319
  },
4320
4320
  toString: function() {
4321
- var b = this.getFileName() || "", T = this.getLineNumber() || "", _ = this.getColumnNumber() || "", M = this.getFunctionName() || "";
4322
- return this.getIsEval() ? b ? "[eval] (" + b + ":" + T + ":" + _ + ")" : "[eval]:" + T + ":" + _ : M ? M + " (" + b + ":" + T + ":" + _ + ")" : b + ":" + T + ":" + _;
4321
+ var y = this.getFileName() || "", x = this.getLineNumber() || "", C = this.getColumnNumber() || "", F = this.getFunctionName() || "";
4322
+ return this.getIsEval() ? y ? "[eval] (" + y + ":" + x + ":" + C + ")" : "[eval]:" + x + ":" + C : F ? F + " (" + y + ":" + x + ":" + C + ")" : y + ":" + x + ":" + C;
4323
4323
  }
4324
- }, d.fromString = function(T) {
4325
- var _ = T.indexOf("("), M = T.lastIndexOf(")"), R = T.substring(0, _), k = T.substring(_ + 1, M).split(","), N = T.substring(M + 1);
4324
+ }, d.fromString = function(x) {
4325
+ var C = x.indexOf("("), F = x.lastIndexOf(")"), R = x.substring(0, C), T = x.substring(C + 1, F).split(","), N = x.substring(F + 1);
4326
4326
  if (N.indexOf("@") === 0)
4327
- var D = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(N, ""), L = D[1], I = D[2], E = D[3];
4327
+ var D = /@(.+?)(?::(\d+))?(?::(\d+))?$/.exec(N, ""), A = D[1], I = D[2], E = D[3];
4328
4328
  return new d({
4329
4329
  functionName: R,
4330
- args: k || void 0,
4331
- fileName: L,
4330
+ args: T || void 0,
4331
+ fileName: A,
4332
4332
  lineNumber: I || void 0,
4333
4333
  columnNumber: E || void 0
4334
4334
  });
4335
4335
  };
4336
4336
  for (var p = 0; p < r.length; p++)
4337
- d.prototype["get" + s(r[p])] = i(r[p]), d.prototype["set" + s(r[p])] = /* @__PURE__ */ function(b) {
4338
- return function(T) {
4339
- this[b] = !!T;
4337
+ d.prototype["get" + s(r[p])] = i(r[p]), d.prototype["set" + s(r[p])] = /* @__PURE__ */ function(y) {
4338
+ return function(x) {
4339
+ this[y] = !!x;
4340
4340
  };
4341
4341
  }(r[p]);
4342
4342
  for (var v = 0; v < o.length; v++)
4343
- d.prototype["get" + s(o[v])] = i(o[v]), d.prototype["set" + s(o[v])] = /* @__PURE__ */ function(b) {
4344
- return function(T) {
4345
- if (!n(T))
4346
- throw new TypeError(b + " must be a Number");
4347
- this[b] = Number(T);
4343
+ d.prototype["get" + s(o[v])] = i(o[v]), d.prototype["set" + s(o[v])] = /* @__PURE__ */ function(y) {
4344
+ return function(x) {
4345
+ if (!n(x))
4346
+ throw new TypeError(y + " must be a Number");
4347
+ this[y] = Number(x);
4348
4348
  };
4349
4349
  }(o[v]);
4350
4350
  for (var w = 0; w < l.length; w++)
4351
- d.prototype["get" + s(l[w])] = i(l[w]), d.prototype["set" + s(l[w])] = /* @__PURE__ */ function(b) {
4352
- return function(T) {
4353
- this[b] = String(T);
4351
+ d.prototype["get" + s(l[w])] = i(l[w]), d.prototype["set" + s(l[w])] = /* @__PURE__ */ function(y) {
4352
+ return function(x) {
4353
+ this[y] = String(x);
4354
4354
  };
4355
4355
  }(l[w]);
4356
4356
  return d;
@@ -4394,10 +4394,10 @@ function mo() {
4394
4394
  a.indexOf("(eval ") > -1 && (a = a.replace(/eval code/g, "eval").replace(/(\(eval at [^()]*)|(,.*$)/g, ""));
4395
4395
  var d = a.replace(/^\s+/, "").replace(/\(eval code/g, "(").replace(/^.*?\s+/, ""), p = d.match(/ (\(.+\)$)/);
4396
4396
  d = p ? d.replace(p[0], "") : d;
4397
- var v = this.extractLocation(p ? p[1] : d), w = p && d || void 0, b = ["eval", "<anonymous>"].indexOf(v[0]) > -1 ? void 0 : v[0];
4397
+ var v = this.extractLocation(p ? p[1] : d), w = p && d || void 0, y = ["eval", "<anonymous>"].indexOf(v[0]) > -1 ? void 0 : v[0];
4398
4398
  return new s({
4399
4399
  functionName: w,
4400
- fileName: b,
4400
+ fileName: y,
4401
4401
  lineNumber: v[1],
4402
4402
  columnNumber: v[2],
4403
4403
  source: a
@@ -4464,12 +4464,12 @@ function mo() {
4464
4464
  return !!a.match(i) && !a.match(/^Error created at/);
4465
4465
  }, this);
4466
4466
  return u.map(function(a) {
4467
- var d = a.split("@"), p = this.extractLocation(d.pop()), v = d.shift() || "", w = v.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0, b;
4468
- v.match(/\(([^)]*)\)/) && (b = v.replace(/^[^(]+\(([^)]*)\)$/, "$1"));
4469
- var T = b === void 0 || b === "[arguments not available]" ? void 0 : b.split(",");
4467
+ var d = a.split("@"), p = this.extractLocation(d.pop()), v = d.shift() || "", w = v.replace(/<anonymous function(: (\w+))?>/, "$2").replace(/\([^)]*\)/g, "") || void 0, y;
4468
+ v.match(/\(([^)]*)\)/) && (y = v.replace(/^[^(]+\(([^)]*)\)$/, "$1"));
4469
+ var x = y === void 0 || y === "[arguments not available]" ? void 0 : y.split(",");
4470
4470
  return new s({
4471
4471
  functionName: w,
4472
- args: T,
4472
+ args: x,
4473
4473
  fileName: p[0],
4474
4474
  lineNumber: p[1],
4475
4475
  columnNumber: p[2],
@@ -4480,8 +4480,8 @@ function mo() {
4480
4480
  };
4481
4481
  });
4482
4482
  })(si);
4483
- var bo = si.exports;
4484
- const vo = /* @__PURE__ */ bi(bo);
4483
+ var vo = si.exports;
4484
+ const bo = /* @__PURE__ */ vi(vo);
4485
4485
  function ys(t) {
4486
4486
  return [
4487
4487
  {
@@ -4496,7 +4496,7 @@ function ys(t) {
4496
4496
  function wt(t, e, n = {}) {
4497
4497
  let s = e;
4498
4498
  try {
4499
- s = vo.parse(t);
4499
+ s = bo.parse(t);
4500
4500
  } catch {
4501
4501
  }
4502
4502
  return pn(t.name, t.message, JSON.stringify(s), JSON.stringify(n));
@@ -4681,8 +4681,8 @@ function Co(t, e) {
4681
4681
  });
4682
4682
  }, 3);
4683
4683
  function u(a, d, p, v) {
4684
- const { value: w, mask: b } = s(a, d), T = ri(d);
4685
- t.send(br(a, w, b !== 0, T, p, v));
4684
+ const { value: w, mask: y } = s(a, d), x = ri(d);
4685
+ t.send(vr(a, w, y !== 0, x, p, v));
4686
4686
  }
4687
4687
  t.nodes.attachNodeCallback(t.safe((a) => {
4688
4688
  const d = t.nodes.getID(a);
@@ -4690,14 +4690,14 @@ function Co(t, e) {
4690
4690
  if (Z(a, "select") && (i(d, a), t.nodes.attachNodeListener(a, "change", () => i(d, a))), To(a)) {
4691
4691
  l(d, a);
4692
4692
  let p = 0, v = 0, w = 0;
4693
- const b = () => {
4693
+ const y = () => {
4694
4694
  p = pe();
4695
- }, T = () => {
4695
+ }, x = () => {
4696
4696
  v === 0 && p !== 0 && (v = pe() - p);
4697
- }, _ = () => {
4697
+ }, C = () => {
4698
4698
  p !== 0 && (w = pe() - p), u(d, a, v, w), v = 0, w = 0, p = 0;
4699
4699
  };
4700
- t.nodes.attachNodeListener(a, "focus", b), t.nodes.attachNodeListener(a, "input", T), t.nodes.attachNodeListener(a, "change", _);
4700
+ t.nodes.attachNodeListener(a, "focus", y), t.nodes.attachNodeListener(a, "input", x), t.nodes.attachNodeListener(a, "change", C);
4701
4701
  return;
4702
4702
  }
4703
4703
  if (Eo(a)) {
@@ -4742,8 +4742,8 @@ function it(t, e, n) {
4742
4742
  const l = (/* @__PURE__ */ new Date()).getTime() - oi.getTime();
4743
4743
  if (he.timeoutMs !== void 0 && l > he.timeoutMs)
4744
4744
  throw new Error(`Timeout: Can't find a unique selector after ${l}ms`);
4745
- let c = ot(Oo(r)) || ot(...Ro(r)) || ot(...Do(r)) || ot(Ao(r)) || [ks()];
4746
- const u = Lo(r);
4745
+ let c = ot(Oo(r)) || ot(...Ro(r)) || ot(...Do(r)) || ot(Lo(r)) || [ks()];
4746
+ const u = Ao(r);
4747
4747
  if (e == "all")
4748
4748
  u && (c = c.concat(c.filter(sn).map((a) => rt(a, u))));
4749
4749
  else if (e == "two")
@@ -4811,7 +4811,7 @@ function Do(t) {
4811
4811
  penalty: 1
4812
4812
  }));
4813
4813
  }
4814
- function Ao(t) {
4814
+ function Lo(t) {
4815
4815
  const e = t.tagName.toLowerCase();
4816
4816
  return he.tagName(e) ? {
4817
4817
  name: e,
@@ -4824,7 +4824,7 @@ function ks() {
4824
4824
  penalty: 3
4825
4825
  };
4826
4826
  }
4827
- function Lo(t) {
4827
+ function Ao(t) {
4828
4828
  const e = t.parentNode;
4829
4829
  if (!e)
4830
4830
  return null;
@@ -4901,11 +4901,11 @@ function Ts(t, e) {
4901
4901
  function Bo(t, e) {
4902
4902
  let n = t;
4903
4903
  for (; n !== null && n !== e.documentElement; ) {
4904
- if (Ae(n, "masked"))
4904
+ if (Le(n, "masked"))
4905
4905
  return null;
4906
4906
  n = n.parentElement;
4907
4907
  }
4908
- if (vn(t)) {
4908
+ if (bn(t)) {
4909
4909
  let s = t.ownerSVGElement;
4910
4910
  for (; s !== null; )
4911
4911
  t = s, s = s.ownerSVGElement;
@@ -4922,64 +4922,64 @@ function Bo(t, e) {
4922
4922
  }
4923
4923
  function jo(t, e) {
4924
4924
  const { disableClickmaps: n = !1 } = e || {};
4925
- function s(k) {
4926
- const N = Nn(k);
4925
+ function s(T) {
4926
+ const N = Nn(T);
4927
4927
  if (N !== null)
4928
4928
  return N;
4929
- if (Z(k, "input"))
4930
- return ri(k);
4931
- if (xn(k)) {
4929
+ if (Z(T, "input"))
4930
+ return ri(T);
4931
+ if (xn(T)) {
4932
4932
  let D = "";
4933
- return k instanceof HTMLElement && (D = t.sanitizer.getInnerTextSecure(k)), D = D || k.id || k.className, Ws(D).slice(0, 100);
4933
+ return T instanceof HTMLElement && (D = t.sanitizer.getInnerTextSecure(T)), D = D || T.id || T.className, Ws(D).slice(0, 100);
4934
4934
  }
4935
4935
  return "";
4936
4936
  }
4937
4937
  let i = -1, r = -1, o = !1, l = null, c = 0, u = {}, a = 0, d = 0, p = 0, v = 0, w;
4938
- const b = 8e-3, T = 225;
4939
- function _() {
4940
- const k = v / T;
4938
+ const y = 8e-3, x = 225;
4939
+ function C() {
4940
+ const T = v / x;
4941
4941
  if (!a) {
4942
- a = k;
4942
+ a = T;
4943
4943
  return;
4944
4944
  }
4945
- const N = (k - a) / T;
4946
- p > 4 && N > b && t.send(vr(pe())), v = 0, p = 0, a = k;
4945
+ const N = (T - a) / x;
4946
+ p > 4 && N > y && t.send(br(pe())), v = 0, p = 0, a = T;
4947
4947
  }
4948
4948
  t.attachStartCallback(() => {
4949
- w = setInterval(() => _(), T);
4949
+ w = setInterval(() => C(), x);
4950
4950
  }), t.attachStopCallback(() => {
4951
4951
  i = -1, r = -1, o = !1, l = null, u = {}, w && clearInterval(w);
4952
4952
  });
4953
- const M = () => {
4953
+ const F = () => {
4954
4954
  o && (t.send(tr(i, r)), o = !1);
4955
- }, R = (k, N = !1) => {
4955
+ }, R = (T, N = !1) => {
4956
4956
  function D(I, E, P) {
4957
- return u[I] = u[I] || Po(E, k, P);
4957
+ return u[I] = u[I] || Po(E, T, P);
4958
4958
  }
4959
- const L = N ? t.attachEventListener.bind(t) : t.nodes.attachNodeListener.bind(t.nodes);
4960
- L(k.documentElement, "mouseover", (I) => {
4961
- const E = Ts(I.target, k);
4959
+ const A = N ? t.attachEventListener.bind(t) : t.nodes.attachNodeListener.bind(t.nodes);
4960
+ A(T.documentElement, "mouseover", (I) => {
4961
+ const E = Ts(I.target, T);
4962
4962
  E !== l && (l = E, c = performance.now());
4963
- }), L(k, "mousemove", (I) => {
4964
- const [E, P] = t.observer.getDocumentOffset(k);
4963
+ }), A(T, "mousemove", (I) => {
4964
+ const [E, P] = t.observer.getDocumentOffset(T);
4965
4965
  i = I.clientX + E, r = I.clientY + P, o = !0;
4966
4966
  const U = Math.sign(I.movementX);
4967
4967
  v += Math.abs(I.movementX) + Math.abs(I.movementY), U !== d && (d = U, p++);
4968
- }, !1), L(k, "click", (I) => {
4969
- const E = Ts(I.target, k);
4968
+ }, !1), A(T, "click", (I) => {
4969
+ const E = Ts(I.target, T);
4970
4970
  if (!I.clientX && !I.clientY || E === null)
4971
4971
  return;
4972
4972
  const P = t.nodes.getID(E);
4973
4973
  if (P !== void 0) {
4974
- const U = I.pageX, j = I.pageY, z = k.documentElement.scrollWidth, C = k.documentElement.scrollHeight, F = Es(U / z), V = Es(j / C);
4975
- M(), t.send(pr(P, l === E ? Math.round(performance.now() - c) : 0, s(E), xn(E) && !n ? D(P, E, e) : "", F, V), !0);
4974
+ const U = I.pageX, j = I.pageY, z = T.documentElement.scrollWidth, _ = T.documentElement.scrollHeight, M = Es(U / z), V = Es(j / _);
4975
+ F(), t.send(pr(P, l === E ? Math.round(performance.now() - c) : 0, s(E), xn(E) && !n ? D(P, E, e) : "", M, V), !0);
4976
4976
  }
4977
4977
  l = null;
4978
4978
  });
4979
4979
  };
4980
- t.nodes.attachNodeCallback((k) => {
4981
- vt(k) && R(k);
4982
- }), R(document, !0), t.ticker.attach(M, (e == null ? void 0 : e.trackingOffset) || 7);
4980
+ t.nodes.attachNodeCallback((T) => {
4981
+ bt(T) && R(T);
4982
+ }), R(document, !0), t.ticker.attach(F, (e == null ? void 0 : e.trackingOffset) || 7);
4983
4983
  }
4984
4984
  function Es(t) {
4985
4985
  return Math.round(t * 1e4);
@@ -4992,8 +4992,8 @@ function zo(t) {
4992
4992
  if (Z(r, "img") && (o = r.currentSrc || r.src), !o) {
4993
4993
  const w = getComputedStyle(r).getPropertyValue("background-image");
4994
4994
  if (w) {
4995
- const b = s.exec(w);
4996
- b !== null && (o = b[1], (o.startsWith('"') || o.startsWith("'")) && (o = o.substr(1, o.length - 2)));
4995
+ const y = s.exec(w);
4996
+ y !== null && (o = y[1], (o.startsWith('"') || o.startsWith("'")) && (o = o.substr(1, o.length - 2)));
4997
4997
  }
4998
4998
  }
4999
4999
  if (!o)
@@ -5084,11 +5084,11 @@ function Ho(t, e) {
5084
5084
  responseStart: p,
5085
5085
  responseEnd: v,
5086
5086
  domContentLoadedEventStart: w,
5087
- domContentLoadedEventEnd: b,
5088
- loadEventStart: T,
5089
- loadEventEnd: _
5087
+ domContentLoadedEventEnd: y,
5088
+ loadEventStart: x,
5089
+ loadEventEnd: C
5090
5090
  } = performance.timing;
5091
- t.send(sr(d - a || 0, p - a || 0, v - a || 0, w - a || 0, b - a || 0, T - a || 0, _ - a || 0, l, c));
5091
+ t.send(sr(d - a || 0, p - a || 0, v - a || 0, w - a || 0, y - a || 0, x - a || 0, C - a || 0, l, c));
5092
5092
  }
5093
5093
  }, 30);
5094
5094
  }
@@ -5098,10 +5098,10 @@ function Ho(t, e) {
5098
5098
  if (v)
5099
5099
  return;
5100
5100
  const w = performance.now();
5101
- if (s !== null && (u = Math.max.apply(null, Object.keys(s).map((b) => s[b])), w - u > 1e3 && (p = zo(s), s = null)), d !== null && (w - d > 50 && (a = w), d = w - a > 5e3 ? null : w), p !== null && d === null || w > 3e4) {
5101
+ if (s !== null && (u = Math.max.apply(null, Object.keys(s).map((y) => s[y])), w - u > 1e3 && (p = zo(s), s = null)), d !== null && (w - d > 50 && (a = w), d = w - a > 5e3 ? null : w), p !== null && d === null || w > 3e4) {
5102
5102
  v = !0, s = null;
5103
- const b = p === null ? 0 : Uo(c || l, p), { domContentLoadedEventEnd: T, navigationStart: _ } = performance.timing, M = d === null ? Math.max(a, c, T - _ || 0) : 0;
5104
- t.send(ir(b, c > u ? c : u, M));
5103
+ const y = p === null ? 0 : Uo(c || l, p), { domContentLoadedEventEnd: x, navigationStart: C } = performance.timing, F = d === null ? Math.max(a, c, x - C || 0) : 0;
5104
+ t.send(ir(y, c > u ? c : u, F));
5105
5105
  }
5106
5106
  });
5107
5107
  }
@@ -5117,7 +5117,7 @@ function $o(t, e) {
5117
5117
  let n = !1;
5118
5118
  const s = /* @__PURE__ */ new Map();
5119
5119
  function i(l) {
5120
- ei(l) && (ke(l) && s.set(l, [l.scrollLeft, l.scrollTop]), vt(l) && s.set(l, rn(l)));
5120
+ ei(l) && (ke(l) && s.set(l, [l.scrollLeft, l.scrollTop]), bt(l) && s.set(l, rn(l)));
5121
5121
  }
5122
5122
  const r = t.safe(() => {
5123
5123
  e || t.send(Wi(...rn(document)));
@@ -5128,7 +5128,7 @@ function $o(t, e) {
5128
5128
  t.attachStartCallback(r), t.attachStopCallback(() => {
5129
5129
  n = !1, s.clear();
5130
5130
  }), t.nodes.attachNodeCallback((l, c) => {
5131
- c && (ke(l) && l.scrollLeft + l.scrollTop > 0 ? s.set(l, [l.scrollLeft, l.scrollTop]) : vt(l) && s.set(l, rn(l))), Et(l) && t.nodes.attachNodeListener(l, "scroll", (u) => {
5131
+ c && (ke(l) && l.scrollLeft + l.scrollTop > 0 ? s.set(l, [l.scrollLeft, l.scrollTop]) : bt(l) && s.set(l, rn(l))), Et(l) && t.nodes.attachNodeListener(l, "scroll", (u) => {
5132
5132
  i(u.target);
5133
5133
  });
5134
5134
  }), t.attachEventListener(document, "scroll", (l) => {
@@ -5180,8 +5180,8 @@ function Vo(t) {
5180
5180
  const v = !p;
5181
5181
  if (p || (p = hi(), e.set(d, p)), c.includes(p) || t.send(Ys(p, l)), v) {
5182
5182
  const w = d.cssRules;
5183
- for (let b = 0; b < w.length; b++)
5184
- t.send(fn(p, w[b].cssText, b, t.getBaseHref()));
5183
+ for (let y = 0; y < w.length; y++)
5184
+ t.send(fn(p, w[y].cssText, y, t.getBaseHref()));
5185
5185
  }
5186
5186
  u.push(p);
5187
5187
  }
@@ -5321,7 +5321,7 @@ function Jo(t) {
5321
5321
  s.FontFace = i;
5322
5322
  };
5323
5323
  t.observer.attachContextCallback(n), n(window), t.nodes.attachNodeCallback(t.safe((s) => {
5324
- if (!vt(s))
5324
+ if (!bt(s))
5325
5325
  return;
5326
5326
  const i = e.get(s);
5327
5327
  if (!i)
@@ -5336,35 +5336,35 @@ function Xo(t, e, n, s, i) {
5336
5336
  t.debug.log("Openreplay: attaching axios spy to instance", e);
5337
5337
  function r(p) {
5338
5338
  t.debug.log("Openreplay: capturing axios response data", p);
5339
- const { headers: v, data: w, method: b, url: T, baseURL: _ } = p.config, { data: M, headers: R, status: k, response: N } = p, { data: D, headers: L, status: I } = N || {}, E = n.ignoreHeaders, P = Array.isArray(E) ? ($) => E.includes($) : () => E;
5340
- function U($, y) {
5341
- P(y[0]) || ($[y[0]] = y[1]);
5339
+ const { headers: v, data: w, method: y, url: x, baseURL: C } = p.config, { data: F, headers: R, status: T, response: N } = p, { data: D, headers: A, status: I } = N || {}, E = n.ignoreHeaders, P = Array.isArray(E) ? ($) => E.includes($) : () => E;
5340
+ function U($, b) {
5341
+ P(b[0]) || ($[b[0]] = b[1]);
5342
5342
  }
5343
5343
  let j = {}, z = {};
5344
- v.toJSON ? j = v.toJSON() : v instanceof Headers ? v.forEach(($, y) => U(j, [y, $])) : Array.isArray(v) ? v.forEach(($) => U(j, $)) : typeof v == "object" && Object.entries(v).forEach(($) => U(j, $));
5345
- const C = L || R;
5346
- C.toJSON ? z = C.toJSON() : C instanceof Headers ? C.forEach(($, y) => U(z, [y, $])) : Array.isArray(C) ? C.forEach(($) => U(z, $)) : typeof C == "object" && Object.entries(C).forEach(([$, y]) => {
5347
- P($) || (z[$] = y);
5344
+ v.toJSON ? j = v.toJSON() : v instanceof Headers ? v.forEach(($, b) => U(j, [b, $])) : Array.isArray(v) ? v.forEach(($) => U(j, $)) : typeof v == "object" && Object.entries(v).forEach(($) => U(j, $));
5345
+ const _ = A || R;
5346
+ _.toJSON ? z = _.toJSON() : _ instanceof Headers ? _.forEach(($, b) => U(z, [b, $])) : Array.isArray(_) ? _.forEach(($) => U(z, $)) : typeof _ == "object" && Object.entries(_).forEach(([$, b]) => {
5347
+ P($) || (z[$] = b);
5348
5348
  });
5349
- const F = s({
5350
- url: T,
5351
- method: b || "",
5352
- status: k || I || 0,
5349
+ const M = s({
5350
+ url: x,
5351
+ method: y || "",
5352
+ status: T || I || 0,
5353
5353
  request: {
5354
5354
  headers: j,
5355
5355
  body: w
5356
5356
  },
5357
5357
  response: {
5358
5358
  headers: z,
5359
- body: D || M
5359
+ body: D || F
5360
5360
  }
5361
5361
  });
5362
- if (!F) {
5362
+ if (!M) {
5363
5363
  t.debug.log("Openreplay: empty request/response info, skipping");
5364
5364
  return;
5365
5365
  }
5366
- const V = p.config.__openreplay_timing, K = performance.now() - V;
5367
- t.debug.log("Openreplay: final req object", F), t.send(bt("xhr", String(b), String(F.url), i(F.request), i(F.response), F.status, V + Ve(), K, 0));
5366
+ const V = p.config.__openreplay_timing, G = performance.now() - V;
5367
+ t.debug.log("Openreplay: final req object", M), t.send(vt("xhr", String(y), String(M.url), i(M.request), i(M.response), M.status, V + Ve(), G, 0));
5368
5368
  }
5369
5369
  function o(p) {
5370
5370
  if (t.debug.log("Openreplay: capturing API request", p), p.__openreplay_timing = performance.now(), n.sessionTokenHeader) {
@@ -5388,8 +5388,8 @@ function Xo(t, e, n, s, i) {
5388
5388
  synchronous: !0
5389
5389
  });
5390
5390
  t.attachStopCallback(() => {
5391
- var p, v, w, b;
5392
- (v = (p = e.interceptors.request).eject) == null || v.call(p, a), (b = (w = e.interceptors.response).eject) == null || b.call(w, d);
5391
+ var p, v, w, y;
5392
+ (v = (p = e.interceptors.request).eject) == null || v.call(p, a), (y = (w = e.interceptors.response).eject) == null || y.call(w, d);
5393
5393
  });
5394
5394
  }
5395
5395
  function Yo(t) {
@@ -5402,7 +5402,7 @@ var we;
5402
5402
  (function(t) {
5403
5403
  t[t.UNSENT = 0] = "UNSENT", t[t.OPENED = 1] = "OPENED", t[t.HEADERS_RECEIVED = 2] = "HEADERS_RECEIVED", t[t.LOADING = 3] = "LOADING", t[t.DONE = 4] = "DONE";
5404
5404
  })(we || (we = {}));
5405
- class An {
5405
+ class Ln {
5406
5406
  constructor(e = [], n, s) {
5407
5407
  this.ignoredHeaders = e, this.setSessionTokenHeader = n, this.sanitize = s, this.id = "", this.name = "", this.method = "", this.url = "", this.status = 0, this.statusText = "", this.cancelState = 0, this.readyState = 0, this.header = {}, this.responseType = "", this.requestHeader = {}, this.responseSize = 0, this.responseSizeText = "", this.startTime = 0, this.endTime = 0, this.duration = 0, this.getData = {}, this.requestData = null;
5408
5408
  }
@@ -5418,7 +5418,7 @@ class An {
5418
5418
  response: i
5419
5419
  });
5420
5420
  if (r)
5421
- return bt(this.requestType, r.method, r.url, JSON.stringify(r.request), JSON.stringify(r.response), r.status, this.startTime + Ve(), this.duration, this.responseSize);
5421
+ return vt(this.requestType, r.method, r.url, JSON.stringify(r.request), JSON.stringify(r.response), r.status, this.startTime + Ve(), this.duration, this.responseSize);
5422
5422
  }
5423
5423
  writeHeaders() {
5424
5424
  const e = {};
@@ -5452,7 +5452,7 @@ const et = (t, e) => {
5452
5452
  break;
5453
5453
  }
5454
5454
  return n;
5455
- }, Ln = (t) => {
5455
+ }, An = (t) => {
5456
5456
  if (!t)
5457
5457
  return null;
5458
5458
  let e;
@@ -5544,7 +5544,7 @@ class na {
5544
5544
  if (!i || // @ts-ignore
5545
5545
  typeof i != "string" && !(i != null && i.url) || (i instanceof URL || typeof i == "string" ? this.isServiceUrl(String(i)) : this.isServiceUrl(String(i.url))))
5546
5546
  return e.apply(window, s);
5547
- const l = new An(this.ignoredHeaders, this.setSessionTokenHeader, this.sanitize);
5547
+ const l = new Ln(this.ignoredHeaders, this.setSessionTokenHeader, this.sanitize);
5548
5548
  return this.beforeFetch(l, i, r), this.setSessionTokenHeader((c, u) => {
5549
5549
  if (!(this.tokenUrlMatcher !== void 0 && !this.tokenUrlMatcher(l.url))) {
5550
5550
  if (s[1] === void 0 && s[0] instanceof Request)
@@ -5568,7 +5568,7 @@ class na {
5568
5568
  for (const [l, c] of i.searchParams)
5569
5569
  e.getData[l] = c;
5570
5570
  }
5571
- s != null && s.body && (e.requestData = Ln(s.body));
5571
+ s != null && s.body && (e.requestData = An(s.body));
5572
5572
  }
5573
5573
  afterFetch(e) {
5574
5574
  return (n) => {
@@ -5605,7 +5605,7 @@ class ia {
5605
5605
  this.onAbort();
5606
5606
  }, this.XMLReq.ontimeout = () => {
5607
5607
  this.onTimeout();
5608
- }, this.item = new An(n, s, i), this.item.requestType = "xhr";
5608
+ }, this.item = new Ln(n, s, i), this.item.requestType = "xhr";
5609
5609
  }
5610
5610
  get(e, n) {
5611
5611
  switch (n) {
@@ -5663,7 +5663,7 @@ class ia {
5663
5663
  const n = Reflect.get(e, "send");
5664
5664
  return (...s) => {
5665
5665
  const i = s[0];
5666
- return this.item.requestData = Ln(i), n.apply(e, s);
5666
+ return this.item.requestData = An(i), n.apply(e, s);
5667
5667
  };
5668
5668
  }
5669
5669
  getSetRequestHeader(e) {
@@ -5734,7 +5734,7 @@ class aa {
5734
5734
  this.ignoredHeaders = e, this.setSessionTokenHeader = n, this.sanitize = s, this.sendMessage = i, this.isServiceUrl = r;
5735
5735
  }
5736
5736
  apply(e, n, s) {
5737
- const i = s[0], r = s[1], o = new An(this.ignoredHeaders, this.setSessionTokenHeader, this.sanitize);
5737
+ const i = s[0], r = s[1], o = new Ln(this.ignoredHeaders, this.setSessionTokenHeader, this.sanitize);
5738
5738
  if (this.isServiceUrl(i))
5739
5739
  return e.apply(n, s);
5740
5740
  const l = kn(i);
@@ -5743,7 +5743,7 @@ class aa {
5743
5743
  for (const [a, d] of l.searchParams)
5744
5744
  o.getData[a] = d;
5745
5745
  }
5746
- o.requestData = Ln(r), o.startTime || (o.startTime = performance.now());
5746
+ o.requestData = An(r), o.startTime || (o.startTime = performance.now());
5747
5747
  const c = e.apply(n, s);
5748
5748
  c ? (o.endTime = performance.now(), o.duration = o.endTime - (o.startTime || o.endTime), o.status = 0, o.statusText = "Sent", o.readyState = 4) : (o.status = 500, o.statusText = "Unknown");
5749
5749
  const u = o.getMessage();
@@ -5815,63 +5815,63 @@ function la(t, e = {}) {
5815
5815
  const u = (a) => {
5816
5816
  if (n.useProxy)
5817
5817
  return ca(a, n.ignoreHeaders, o, l, (R) => t.send(R), (R) => t.isServiceURL(R), n.tokenUrlMatcher);
5818
- const d = a.fetch.bind(a), p = (R, k = {}) => {
5818
+ const d = a.fetch.bind(a), p = (R, T = {}) => {
5819
5819
  if (!(typeof R == "string" || R instanceof URL) || t.isServiceURL(String(R)))
5820
- return d(R, k);
5821
- o(function(D, L) {
5822
- k.headers === void 0 && (k.headers = {}), k.headers instanceof Headers ? k.headers.append(D, L) : Array.isArray(k.headers) ? k.headers.push([D, L]) : k.headers[D] = L;
5820
+ return d(R, T);
5821
+ o(function(D, A) {
5822
+ T.headers === void 0 && (T.headers = {}), T.headers instanceof Headers ? T.headers.append(D, A) : Array.isArray(T.headers) ? T.headers.push([D, A]) : T.headers[D] = A;
5823
5823
  });
5824
5824
  const N = performance.now();
5825
- return d(R, k).then((D) => {
5826
- const L = performance.now() - N;
5825
+ return d(R, T).then((D) => {
5826
+ const A = performance.now() - N;
5827
5827
  if (n.failuresOnly && D.status < 400)
5828
5828
  return D;
5829
5829
  const I = D.clone();
5830
5830
  return I.text().then((E) => {
5831
5831
  const P = {}, U = {};
5832
5832
  if (s !== !0) {
5833
- const C = ([F, V]) => {
5834
- i(F) || (P[F] = V);
5833
+ const _ = ([M, V]) => {
5834
+ i(M) || (P[M] = V);
5835
5835
  };
5836
- k.headers instanceof Headers ? k.headers.forEach((F, V) => C([V, F])) : Array.isArray(k.headers) ? k.headers.forEach(C) : typeof k.headers == "object" && Object.entries(k.headers).forEach(C), I.headers.forEach((F, V) => {
5837
- i(V) || (U[V] = F);
5836
+ T.headers instanceof Headers ? T.headers.forEach((M, V) => _([V, M])) : Array.isArray(T.headers) ? T.headers.forEach(_) : typeof T.headers == "object" && Object.entries(T.headers).forEach(_), I.headers.forEach((M, V) => {
5837
+ i(V) || (U[V] = M);
5838
5838
  });
5839
5839
  }
5840
- const j = _s(k.method), z = l({
5840
+ const j = _s(T.method), z = l({
5841
5841
  url: String(R),
5842
5842
  method: j,
5843
5843
  status: I.status,
5844
5844
  request: {
5845
5845
  headers: P,
5846
5846
  // @ts-ignore
5847
- body: k.body || null
5847
+ body: T.body || null
5848
5848
  },
5849
5849
  response: {
5850
5850
  headers: U,
5851
5851
  body: E
5852
5852
  }
5853
5853
  });
5854
- z && t.send(bt("fetch", j, String(z.url), c(z.request), c(z.response), I.status, N + Ve(), L, 0));
5854
+ z && t.send(vt("fetch", j, String(z.url), c(z.request), c(z.response), I.status, N + Ve(), A, 0));
5855
5855
  }).catch((E) => t.debug.error("Could not process Fetch response:", E)), D;
5856
5856
  });
5857
5857
  };
5858
5858
  a.fetch = p;
5859
- const v = a.XMLHttpRequest.prototype.open, w = a.XMLHttpRequest.prototype.setRequestHeader, b = a.XMLHttpRequest.prototype.send;
5860
- function T(R, k) {
5859
+ const v = a.XMLHttpRequest.prototype.open, w = a.XMLHttpRequest.prototype.setRequestHeader, y = a.XMLHttpRequest.prototype.send;
5860
+ function x(R, T) {
5861
5861
  const N = this;
5862
- o((L, I) => N.setRequestHeader(L, I));
5862
+ o((A, I) => N.setRequestHeader(A, I));
5863
5863
  let D = 0;
5864
- return N.addEventListener("loadstart", (L) => {
5865
- D = L.timeStamp;
5866
- }), N.addEventListener("load", t.safe((L) => {
5867
- const { headers: I, body: E } = on(N), P = D > 0 ? L.timeStamp - D : 0, j = (N.getAllResponseHeaders() || "").trim().split(/[\r\n]+/), z = {};
5864
+ return N.addEventListener("loadstart", (A) => {
5865
+ D = A.timeStamp;
5866
+ }), N.addEventListener("load", t.safe((A) => {
5867
+ const { headers: I, body: E } = on(N), P = D > 0 ? A.timeStamp - D : 0, j = (N.getAllResponseHeaders() || "").trim().split(/[\r\n]+/), z = {};
5868
5868
  j.forEach(function(V) {
5869
- const K = V.split(": "), $ = K.shift();
5870
- i($) || (z[$] = K.join(": "));
5869
+ const G = V.split(": "), $ = G.shift();
5870
+ i($) || (z[$] = G.join(": "));
5871
5871
  });
5872
- const C = _s(R), F = l({
5873
- url: String(k),
5874
- method: C,
5872
+ const _ = _s(R), M = l({
5873
+ url: String(T),
5874
+ method: _,
5875
5875
  status: N.status,
5876
5876
  request: {
5877
5877
  headers: I,
@@ -5883,21 +5883,21 @@ function la(t, e = {}) {
5883
5883
  body: N.response
5884
5884
  }
5885
5885
  });
5886
- F && t.send(bt("xhr", C, String(F.url), c(F.request), c(F.response), N.status, D + Ve(), P, 0));
5886
+ M && t.send(vt("xhr", _, String(M.url), c(M.request), c(M.response), N.status, D + Ve(), P, 0));
5887
5887
  })), v.apply(this, arguments);
5888
5888
  }
5889
- function _(R) {
5890
- const k = on(this);
5891
- return k.body = R, b.apply(this, arguments);
5889
+ function C(R) {
5890
+ const T = on(this);
5891
+ return T.body = R, y.apply(this, arguments);
5892
5892
  }
5893
- function M(R, k) {
5893
+ function F(R, T) {
5894
5894
  if (!i(R)) {
5895
5895
  const N = on(this);
5896
- N.headers[R] = k;
5896
+ N.headers[R] = T;
5897
5897
  }
5898
5898
  return w.apply(this, arguments);
5899
5899
  }
5900
- n.axiosInstances || (a.XMLHttpRequest.prototype.open = T, a.XMLHttpRequest.prototype.send = _, a.XMLHttpRequest.prototype.setRequestHeader = M);
5900
+ n.axiosInstances || (a.XMLHttpRequest.prototype.open = x, a.XMLHttpRequest.prototype.send = C, a.XMLHttpRequest.prototype.setRequestHeader = F);
5901
5901
  };
5902
5902
  u(window), n.axiosInstances && n.axiosInstances.forEach((a) => {
5903
5903
  Xo(t, a, n, l, c);
@@ -7119,7 +7119,7 @@ class fi {
7119
7119
  }
7120
7120
  }
7121
7121
  }
7122
- class ba {
7122
+ class va {
7123
7123
  constructor() {
7124
7124
  this.api = new fi(), this.language = "en", this.currency = "USD", this.currencies = {
7125
7125
  USD: {
@@ -7578,8 +7578,8 @@ class ba {
7578
7578
  headerOccasion: "случай",
7579
7579
  headerOr: "или"
7580
7580
  },
7581
- kz: {
7582
- lang: "kz",
7581
+ kk: {
7582
+ lang: "kk",
7583
7583
  welcomeMessage: "Сіз не жегіңіз келеді? Тағамыңызды сипаттаңыз, мен оған керемет шарап ұсынамын.",
7584
7584
  noResultsFound: "Нәтижелер табылмады.",
7585
7585
  somethingWentWrong: "Кешіріңіз, бірдеңе дұрыс болмады.",
@@ -7648,10 +7648,11 @@ class ba {
7648
7648
  try {
7649
7649
  const n = await this.api.getStoreConfig(e);
7650
7650
  this.storeLanguage = n.lang, this.supportedLanguages = n.available_languages, this.OpenAIApiKey = n.open_ai_key;
7651
- const s = localStorage.getItem("selectedLanguage");
7652
- s && this.translations[s] ? this.language = s : n.lang && this.translations[n.lang] ? (this.language = n.lang, localStorage.setItem("selectedLanguage", n.lang)) : this.language = "en", this.currency = n.currency || "USD";
7651
+ const s = new URLSearchParams(window.location.search), i = s.get("lang") || s.get("language");
7652
+ i && this.translations[i] ? this.language = i : n.lang && this.translations[n.lang] ? this.language = n.lang : this.language = "en", this.currency = n.currency || "USD";
7653
7653
  } catch {
7654
- this.language = localStorage.getItem("selectedLanguage") || "en", this.currency = "USD";
7654
+ const s = new URLSearchParams(window.location.search), i = s.get("lang") || s.get("language");
7655
+ this.language = this.translations[i] ? i : "en", this.currency = "USD";
7655
7656
  }
7656
7657
  }
7657
7658
  getCurrency(e) {
@@ -7677,43 +7678,73 @@ class ba {
7677
7678
  getSupportedLanguages() {
7678
7679
  return this.supportedLanguages;
7679
7680
  }
7681
+ getLangFromURL() {
7682
+ const e = new URLSearchParams(window.location.search), n = e.get("lang") || e.get("language");
7683
+ return n && this.translations[n] ? n : null;
7684
+ }
7680
7685
  async translateTexts(e) {
7681
- var u, a, d, p;
7686
+ var c, u, a, d;
7682
7687
  if (this.storeLanguage === this.language || !this.supportedLanguages)
7683
- return e;
7688
+ return console.log("gривет"), e;
7684
7689
  const n = this.OpenAIApiKey, s = "https://api.openai.com/v1/chat/completions", i = {
7685
7690
  "Content-Type": "application/json",
7686
7691
  Authorization: `Bearer ${n}`
7687
- }, o = Object.values(e).join(" ||| "), l = `Translate the following texts to language with the next code: ${this.language}. Return only the translated texts separated by " ||| " in the same order:
7688
-
7689
- ${o}`, c = JSON.stringify({
7692
+ }, r = Object.entries(e).map(([p, v]) => ({
7693
+ key: p,
7694
+ text: v
7695
+ })), o = `
7696
+ You are a professional translator.
7697
+
7698
+ The input texts are written in language with code "${this.storeLanguage}". Your task is to translate them strictly to the target language with code "${this.language}".
7699
+
7700
+ ⚠️ DO NOT leave the original text.
7701
+ ⚠️ DO NOT skip any entry.
7702
+ ⚠️ Preserve the original order and keys exactly.
7703
+
7704
+ Translate only the "text" fields of the JSON array. Return an array of the same length and structure, like this:
7705
+
7706
+ Input:
7707
+ [
7708
+ { "key": "shortDescription", "text": "Red wine with rich cherry notes." },
7709
+ { "key": "tags", "text": "fruity, dry, elegant" }
7710
+ ]
7711
+
7712
+ Output:
7713
+ [
7714
+ { "key": "shortDescription", "text": "..." },
7715
+ { "key": "tags", "text": "..." }
7716
+ ]
7717
+
7718
+ Now translate the following input:
7719
+ ${JSON.stringify(r, null, 2)}
7720
+ `, l = JSON.stringify({
7690
7721
  model: "gpt-3.5-turbo",
7691
7722
  messages: [
7692
7723
  { role: "system", content: "You are a professional translator." },
7693
- { role: "user", content: l }
7724
+ { role: "user", content: o }
7694
7725
  ],
7695
7726
  temperature: 0.2,
7696
7727
  max_tokens: 1e3
7697
7728
  });
7698
7729
  try {
7699
- const b = (p = (d = (a = (u = (await (await fetch(s, {
7730
+ const w = (d = (a = (u = (c = (await (await fetch(s, {
7700
7731
  method: "POST",
7701
7732
  headers: i,
7702
- body: c
7703
- })).json()).choices) == null ? void 0 : u[0]) == null ? void 0 : a.message) == null ? void 0 : d.content) == null ? void 0 : p.trim();
7704
- if (!b)
7733
+ body: l
7734
+ })).json()).choices) == null ? void 0 : c[0]) == null ? void 0 : u.message) == null ? void 0 : a.content) == null ? void 0 : d.trim();
7735
+ if (!w)
7705
7736
  throw new Error("No response from OpenAI");
7706
- const T = b.split(" ||| ").map((M) => M.trim()), _ = {};
7707
- return Object.keys(e).forEach((M, R) => {
7708
- _[M] = T[R] || e[M];
7709
- }), _;
7710
- } catch (v) {
7711
- return console.error("Error translating texts:", v), e;
7737
+ const y = JSON.parse(w), x = {};
7738
+ return y.forEach((C) => {
7739
+ C.key && C.text !== void 0 && (x[C.key] = C.text);
7740
+ }), x;
7741
+ } catch (p) {
7742
+ return console.error("Error translating texts:", p), e;
7712
7743
  }
7713
7744
  }
7714
7745
  }
7715
- const G = new ba();
7716
- class va {
7746
+ const J = new va();
7747
+ class ba {
7717
7748
  constructor() {
7718
7749
  var e, n, s, i, r;
7719
7750
  this.widgetType = ((e = window == null ? void 0 : window.wineaterData) == null ? void 0 : e.WIDGET_TYPE) || "store", this.countryCode = ((n = window == null ? void 0 : window.wineaterData) == null ? void 0 : n.COUNTRY_CODE) || null, this.widgetWrapper = ((s = window == null ? void 0 : window.wineaterData) == null ? void 0 : s.WIDGET_WRAPPER) || "wineater-widget-conteiner", this.titleText = (i = window == null ? void 0 : window.wineaterData) == null ? void 0 : i.TITLE_TEXT, this.subtitleText = (r = window == null ? void 0 : window.wineaterData) == null ? void 0 : r.SUBTITLE_TEXT, this.api = new fi(), console.log(this.titleText), this.selectedFilters = {
@@ -7727,18 +7758,18 @@ class va {
7727
7758
  }
7728
7759
  getTitle(e) {
7729
7760
  return e ? `<h1 class="wine-widget-big-title">${e}</h1>` : `<h1 class="wine-widget-big-title">
7730
- ${G.translate("headerLine1")}
7761
+ ${J.translate("headerLine1")}
7731
7762
  <span class="icon icon-meal"></span>
7732
- <span class="icon-label">${G.translate("headerMeal")}</span>,
7763
+ <span class="icon-label">${J.translate("headerMeal")}</span>,
7733
7764
  <span class="icon icon-mood"></span>
7734
- <span class="icon-label">${G.translate("headerMood")}</span>
7765
+ <span class="icon-label">${J.translate("headerMood")}</span>
7735
7766
  </br>
7736
7767
  <!-- <span class="icon icon-budget"></span> -->
7737
- <!-- <span class="icon-label">${G.translate("headerBudget")}</span>, -->
7738
- ${G.translate("headerOr")}
7768
+ <!-- <span class="icon-label">${J.translate("headerBudget")}</span>, -->
7769
+ ${J.translate("headerOr")}
7739
7770
  <span class="icon icon-occasion"></span>
7740
- <span class="icon-label">${G.translate("headerOccasion")}</span>
7741
- ${G.translate("headerLine2")}
7771
+ <span class="icon-label">${J.translate("headerOccasion")}</span>
7772
+ ${J.translate("headerLine2")}
7742
7773
  </h1>`;
7743
7774
  }
7744
7775
  initializeWidget() {
@@ -7757,11 +7788,11 @@ class va {
7757
7788
  <input
7758
7789
  type="text"
7759
7790
  id="wine-search-input"
7760
- placeholder="${G.translate("searchPlaceholder")}">
7791
+ placeholder="${J.translate("searchPlaceholder")}">
7761
7792
 
7762
7793
  <!-- Кнопка -->
7763
7794
  <button id="wine-search-button">
7764
- ${G.translate("searchButton")}
7795
+ ${J.translate("searchButton")}
7765
7796
  </button>
7766
7797
  </div>
7767
7798
  <div id="wine-widget-right">
@@ -7775,9 +7806,9 @@ class va {
7775
7806
  <div id="powered-by-widget">
7776
7807
  <div class="powered-by-center">
7777
7808
  <a href="https://wineater.com" target="_blank">
7778
- <span>${G.translate("poweredBy")}</span>
7809
+ <span>${J.translate("poweredBy")}</span>
7779
7810
  <img src="${this.countryCode === "ru" ? "https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/divino_logo.svg?x=5" : "https://czvgkhagwvmknscoerfy.supabase.co/storage/v1/object/public/static-media/logo_medium_gray.svg"}" alt="Wineater Logo">
7780
- <span class="powered-by-sommelier">${G.translate("AI sommelier")}</span>
7811
+ <span class="powered-by-sommelier">${J.translate("AI sommelier")}</span>
7781
7812
  </a>
7782
7813
  </div>
7783
7814
  <div class="powered-by-lang"></div>
@@ -7839,20 +7870,20 @@ class va {
7839
7870
  return typeof u != "number" && (u = Number(u)), u.toLocaleString("en-US");
7840
7871
  }
7841
7872
  e.forEach(async (u, a) => {
7842
- const d = i(u, "title"), p = i(u, "image"), v = i(u, "total"), w = i(u, "url"), b = u.tags || u.Tags, T = r(u, ["type", "country", "region", "grape"]), _ = b ? o(b) : "", M = l(u), R = u["Short Description"], k = u.pairing_recommendation, N = u.isSommSelection, D = `
7873
+ const d = i(u, "title"), p = i(u, "image"), v = i(u, "total"), w = i(u, "url"), y = u.tags || u.Tags, x = r(u, ["type", "country", "region", "grape"]), C = y ? o(y) : "", F = l(u), R = u["Short Description"], T = u.pairing_recommendation, N = u.isSommSelection, D = `
7843
7874
  <div class="wine-recommendation-tile ${N ? "somm-selection" : ""}">
7844
- ${N ? `<div class="somm-selection-badge">${G.translate("wineDetails.sommSelection")}</div>` : ""}
7875
+ ${N ? `<div class="somm-selection-badge">${J.translate("wineDetails.sommSelection")}</div>` : ""}
7845
7876
 
7846
7877
  <div class="tile-top">
7847
7878
  ${p ? `<img src="${p}" alt="${d}" class="wine-image" />` : ""}
7848
- <div class="wine-price">${c(v)} ${G.getCurrency("label")}</div>
7879
+ <div class="wine-price">${c(v)} ${J.getCurrency("label")}</div>
7849
7880
  <h3 class="wine-title">${d}</h3>
7850
7881
  </div>
7851
7882
 
7852
- ${T ? `<div class="wine-params">${T}</div>` : ""}
7883
+ ${x ? `<div class="wine-params">${x}</div>` : ""}
7853
7884
 
7854
7885
  <div class="bottom-row">
7855
- ${w ? `<a class="buy-btn" href="${w}" target="_blank">${G.translate("wineDetails.buy")}</a>` : `<button class="buy-btn" data-toggle-info>${G.translate("moreInfo")}</button>`}
7886
+ ${w ? `<a class="buy-btn" href="${w}" target="_blank">${J.translate("wineDetails.buy")}</a>` : `<button class="buy-btn" data-toggle-info>${J.translate("moreInfo")}</button>`}
7856
7887
  </div>
7857
7888
 
7858
7889
  <div class="card-popup hidden" data-wine-index="${a}">
@@ -7861,35 +7892,39 @@ class va {
7861
7892
  <span class="card-popup-close">&times;</span>
7862
7893
  </div>
7863
7894
  ${R ? `<p class="popup-short-desc" data-orig="${R}">${R}</p>` : ""}
7864
- ${u.reason ? `<div class="popup-reason" data-orig="${u.reason}">${u.reason}</div>` : k ? `<p class="popup-pairing" data-orig="${k}">${k}</p>` : ""}
7865
- ${_ ? `<div class="popup-tags">${_}</div>` : ""}
7895
+ ${u.reason ? `<div class="popup-reason" data-orig="${u.reason}">${u.reason}</div>` : T ? `<p class="popup-pairing" data-orig="${T}">${T}</p>` : ""}
7896
+ ${C ? `<div class="popup-tags">${C}</div>` : ""}
7866
7897
  </div>
7867
7898
 
7868
- ${M}
7899
+ ${F}
7869
7900
  </div>
7870
7901
  `;
7871
7902
  s.insertAdjacentHTML("beforeend", D);
7872
- const L = s.children[a];
7903
+ const A = s.children[a];
7873
7904
  if (!w) {
7874
- const I = L.querySelector("[data-toggle-info]"), E = L.querySelector(".card-popup"), P = L.querySelector(".card-popup-close");
7905
+ const I = A.querySelector("[data-toggle-info]"), E = A.querySelector(".card-popup"), P = A.querySelector(".card-popup-close");
7875
7906
  P == null || P.addEventListener("click", (U) => {
7876
7907
  U.stopPropagation(), E.classList.add("hidden");
7877
7908
  }), document.addEventListener("click", (U) => {
7878
7909
  U.target.closest(".card-popup") || U.target.closest(".mobile-fullscreen-popup") || U.target.closest("[data-toggle-info]") || (document.querySelectorAll(".card-popup").forEach((z) => z.classList.add("hidden")), document.querySelectorAll(".mobile-fullscreen-wrapper").forEach((z) => z.remove()));
7879
- }), I == null || I.addEventListener("click", (U) => {
7910
+ }), this.widgetType === "store" ? (A.addEventListener("mouseenter", () => {
7911
+ E.classList.remove("hidden");
7912
+ }), A.addEventListener("mouseleave", () => {
7913
+ E.classList.add("hidden");
7914
+ })) : I == null || I.addEventListener("click", (U) => {
7880
7915
  var j;
7881
7916
  if (U.stopPropagation(), document.querySelectorAll(".card-popup").forEach((z) => z.classList.add("hidden")), document.querySelectorAll(".mobile-fullscreen-wrapper").forEach((z) => z.remove()), window.innerWidth <= 768) {
7882
- const z = E.innerHTML, C = document.createElement("div");
7883
- C.className = "mobile-fullscreen-wrapper", C.innerHTML = `
7884
- <div class="mobile-fullscreen-overlay"></div>
7885
- <div class="card-popup mobile-fullscreen-popup">${z}</div>
7886
- `, (j = C.querySelector(".card-popup-close")) == null || j.addEventListener("click", () => C.remove()), document.body.appendChild(C);
7917
+ const z = E.innerHTML, _ = document.createElement("div");
7918
+ _.className = "mobile-fullscreen-wrapper", _.innerHTML = `
7919
+ <div class="mobile-fullscreen-overlay"></div>
7920
+ <div class="card-popup mobile-fullscreen-popup">${z}</div>
7921
+ `, (j = _.querySelector(".card-popup-close")) == null || j.addEventListener("click", () => _.remove()), document.body.appendChild(_);
7887
7922
  } else
7888
7923
  E.classList.remove("hidden");
7889
7924
  });
7890
7925
  }
7891
7926
  setTimeout(() => {
7892
- L.style.opacity = "1", L.style.transform = "translateY(0)";
7927
+ A.style.opacity = "1", A.style.transform = "translateY(0)";
7893
7928
  }, n ? a * 200 : 0);
7894
7929
  }), this.translatePopupContent(e), this.widgetType === "store" && this.enableHoverPopups();
7895
7930
  }
@@ -7913,7 +7948,7 @@ class va {
7913
7948
  const e = document.getElementById("wine-placeholder");
7914
7949
  e.innerHTML = `
7915
7950
  <div class="no-results">
7916
- <p>${G.translate("noResultsMessage") || "No recommendations found for your query."}</p>
7951
+ <p>${J.translate("noResultsMessage") || "No recommendations found for your query."}</p>
7917
7952
  </div>
7918
7953
  `;
7919
7954
  }
@@ -7921,42 +7956,43 @@ class va {
7921
7956
  const e = document.getElementById("wine-placeholder");
7922
7957
  e.innerHTML = `
7923
7958
  <div class="error-message">
7924
- <p>${G.translate("errorMessage") || "Something went wrong. Please try again later."}</p>
7959
+ <p>${J.translate("errorMessage") || "Something went wrong. Please try again later."}</p>
7925
7960
  </div>
7926
7961
  `;
7927
7962
  }
7928
7963
  async translatePopupContent(e) {
7929
- if (console.log(G.language, G.storeLanguage), G.language === G.storeLanguage || this.widgetType !== "bar")
7964
+ if (console.log(J.language, J.storeLanguage), J.language === J.storeLanguage || this.widgetType !== "bar")
7930
7965
  return;
7931
- const n = ["Short Description", "reason", "pairing_recommendation", "Tags", "tags"], s = e[0], i = n.filter((o) => o in s);
7932
- G.language;
7933
- const r = 4;
7966
+ const n = ["Short Description", "reason", "pairing_recommendation", "Tags", "tags"], s = e[0], i = n.filter((o) => o in s), r = 4;
7934
7967
  for (let o = 0; o < e.length; o += r) {
7935
7968
  const c = e.slice(o, o + r).map(async (u, a) => {
7936
- const d = o + a, p = {};
7937
- if (i.forEach((b) => {
7938
- const T = u[b] || u[b.toLowerCase()];
7939
- T && (p[b] = Array.isArray(T) ? T.join(", ") : T);
7940
- }), Object.keys(p).length === 0)
7969
+ const d = o + a, p = i.map((x) => {
7970
+ const C = u[x] || u[x.toLowerCase()];
7971
+ return C ? { key: x, text: Array.isArray(C) ? C.join(", ") : C } : null;
7972
+ }).filter(Boolean);
7973
+ if (p.length === 0)
7941
7974
  return;
7942
- const v = await G.translateTexts(p), w = document.querySelector(`.card-popup[data-wine-index="${d}"]`);
7943
- if (w) {
7944
- if (v["Short Description"]) {
7945
- const b = w.querySelector(".popup-short-desc");
7946
- b && (b.textContent = v["Short Description"]);
7947
- }
7948
- if (v.reason) {
7949
- const b = w.querySelector(".popup-reason");
7950
- b && (b.textContent = v.reason);
7951
- }
7952
- if (v.pairing_recommendation) {
7953
- const b = w.querySelector(".popup-pairing");
7954
- b && (b.textContent = v.pairing_recommendation);
7955
- }
7956
- if (v.tags || v.Tags) {
7957
- const _ = (v.tags || v.Tags).split(",").map((R) => R.trim()).map((R) => `<span class="popup-tag">${R}</span>`).join(""), M = w.querySelector(".popup-tags");
7958
- M && (M.innerHTML = _);
7959
- }
7975
+ const v = await J.translateTexts(
7976
+ Object.fromEntries(p.map((x) => [x.key, x.text]))
7977
+ ), w = document.querySelector(`.card-popup[data-wine-index="${d}"]`);
7978
+ if (!w)
7979
+ return;
7980
+ if (v["Short Description"]) {
7981
+ const x = w.querySelector(".popup-short-desc");
7982
+ x && (x.textContent = v["Short Description"]);
7983
+ }
7984
+ if (v.reason) {
7985
+ const x = w.querySelector(".popup-reason");
7986
+ x && (x.textContent = v.reason);
7987
+ }
7988
+ if (v.pairing_recommendation) {
7989
+ const x = w.querySelector(".popup-pairing");
7990
+ x && (x.textContent = v.pairing_recommendation);
7991
+ }
7992
+ const y = v.tags || v.Tags;
7993
+ if (y) {
7994
+ const C = y.split(",").map((R) => R.trim()).map((R) => `<span class="popup-tag">${R}</span>`).join(""), F = w.querySelector(".popup-tags");
7995
+ F && (F.innerHTML = C);
7960
7996
  }
7961
7997
  });
7962
7998
  await Promise.all(c);
@@ -7972,7 +8008,7 @@ class va {
7972
8008
  }
7973
8009
  }
7974
8010
  initializeSearchAnimation() {
7975
- const e = document.getElementById("wine-search-input"), n = G.translate("placeholderSuggestions");
8011
+ const e = document.getElementById("wine-search-input"), n = J.translate("placeholderSuggestions");
7976
8012
  let s = 0, i = 0, r = !0, o = !1;
7977
8013
  const l = () => {
7978
8014
  o || (r ? (e.placeholder = n[s].substring(0, i++), i > n[s].length ? (r = !1, setTimeout(l, 2e3)) : setTimeout(l, 100)) : (e.placeholder = n[s].substring(0, i--), i < 0 ? (r = !0, s = (s + 1) % n.length, setTimeout(l, 500)) : setTimeout(l, 50)));
@@ -7984,16 +8020,16 @@ class va {
7984
8020
  });
7985
8021
  }
7986
8022
  createLanguageSwitcher() {
7987
- const e = document.querySelector("#powered-by-widget .powered-by-lang"), n = G.getSupportedLanguages();
8023
+ const e = document.querySelector("#powered-by-widget .powered-by-lang"), n = J.getSupportedLanguages();
7988
8024
  if (!n)
7989
8025
  return;
7990
- const s = G.language, i = document.createElement("select");
8026
+ const s = J.language, i = document.createElement("select");
7991
8027
  i.id = "language-dropdown", i.className = "language-dropdown", n.forEach((r) => {
7992
8028
  const o = document.createElement("option");
7993
8029
  o.value = r, o.textContent = r.toUpperCase(), o.selected = r === s, i.appendChild(o);
7994
8030
  }), i.onchange = (r) => {
7995
- const o = r.target.value;
7996
- G.language = o, localStorage.setItem("selectedLanguage", o), location.reload();
8031
+ const o = r.target.value, l = new URL(window.location.href);
8032
+ l.searchParams.set("lang", o), localStorage.setItem("selectedLanguage", o), window.location.href = l.toString();
7997
8033
  }, e.appendChild(i);
7998
8034
  }
7999
8035
  }
@@ -8004,14 +8040,14 @@ class wa {
8004
8040
  }
8005
8041
  async initTranslator() {
8006
8042
  const e = this.store ? this.store.charAt(0).toUpperCase() + this.store.slice(1) : "Test";
8007
- await G.fetchConfig(e || "Test");
8043
+ await J.fetchConfig(e || "Test");
8008
8044
  }
8009
8045
  initCookies() {
8010
8046
  var e;
8011
8047
  Rs("chatbotToken", ((e = window.wineaterData) == null ? void 0 : e.CLIENT_TOKEN) || ya, 365), mi();
8012
8048
  }
8013
8049
  async initialize() {
8014
- this.tracker.start(), await this.initTranslator(), this.initCookies(), new va();
8050
+ this.tracker.start(), await this.initTranslator(), this.initCookies(), new ba();
8015
8051
  }
8016
8052
  }
8017
8053
  document.addEventListener("DOMContentLoaded", () => {