@streamlayer/sdk-web 1.7.4 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/lib/cjs/index.js +12 -12
  2. package/lib/es/index.js +772 -709
  3. package/package.json +12 -12
package/lib/es/index.js CHANGED
@@ -1,88 +1,88 @@
1
1
  import { pino as wi } from "pino";
2
- import { QuestionType as _, QuestionStatus as Z, PromotionType as W, NotificationEnabled as $r, SilenceSetting as Ai, UseAsNotification as Ei } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
2
+ import { QuestionType as I, QuestionStatus as Y, PromotionType as U, NotificationEnabled as $r, SilenceSetting as Ai, UseAsNotification as Ei } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
3
3
  import { PickHistoryStatus as lt } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
4
4
  import { SdkOverlayType as R } from "@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb";
5
5
  import { InvitationCategory as Mr, InvitationFrom as Br } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
6
- import { computed as Ii, map as Ti, atom as kt, batched as qr, onMount as Sr } from "nanostores";
7
- import { nanoid as ir } from "nanoid";
8
- import { ConnectError as rt, Code as ie, createContextKey as Ur, createClient as jr, createContextValues as Oi } from "@connectrpc/connect";
6
+ import { computed as Ii, map as Oi, atom as kt, batched as qr, onMount as Sr } from "nanostores";
7
+ import { nanoid as or } from "nanoid";
8
+ import { ConnectError as rt, Code as oe, createContextKey as Ur, createClient as jr, createContextValues as Ti } from "@connectrpc/connect";
9
9
  import { createGrpcWebTransport as xr } from "@connectrpc/connect-web";
10
10
  import { nanoquery as Qr } from "@nanostores/query";
11
- import { Events as On } from "@streamlayer/sl-eslib/sports/events/events_connect";
11
+ import { Events as Tn } from "@streamlayer/sl-eslib/sports/events/events_connect";
12
12
  import { Client as it } from "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
13
13
  import { Users as wr } from "@streamlayer/sl-eslib/users/users_connect";
14
- import { Feed as te } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
14
+ import { Feed as ee } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
15
15
  import { Leaderboard as _n } from "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_connect";
16
16
  import "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb";
17
17
  import { LinksClient as _i } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
18
- import { Kind as Q, TopicSubType as Ae, TopicType as x, PollOpenedFrom as Y, Category as z, ScreenOrientation as Gr } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
18
+ import { Kind as G, TopicSubType as J, TopicType as Q, PollOpenedFrom as X, Category as H, ScreenOrientation as Gr } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
19
19
  import { AnalyticsService as Ln } from "@streamlayer/sl-eslib/analytics/v2/streaming/streaming_connect";
20
20
  import { InteractionActionType as Kr } from "@streamlayer/sl-eslib/analytics/v1/interactions/interactions_pb";
21
- import { NotificationKind as he, NotificationType as zr } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
21
+ import { NotificationKind as ye, NotificationType as zr } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
22
22
  function Li(t) {
23
23
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
24
24
  }
25
- var Cn = { exports: {} }, $ = Cn.exports = {}, ae, ue;
26
- function or() {
25
+ var Cn = { exports: {} }, $ = Cn.exports = {}, ce, le;
26
+ function sr() {
27
27
  throw new Error("setTimeout has not been defined");
28
28
  }
29
- function sr() {
29
+ function ar() {
30
30
  throw new Error("clearTimeout has not been defined");
31
31
  }
32
32
  (function() {
33
33
  try {
34
- typeof setTimeout == "function" ? ae = setTimeout : ae = or;
34
+ typeof setTimeout == "function" ? ce = setTimeout : ce = sr;
35
35
  } catch {
36
- ae = or;
36
+ ce = sr;
37
37
  }
38
38
  try {
39
- typeof clearTimeout == "function" ? ue = clearTimeout : ue = sr;
39
+ typeof clearTimeout == "function" ? le = clearTimeout : le = ar;
40
40
  } catch {
41
- ue = sr;
41
+ le = ar;
42
42
  }
43
43
  })();
44
- function kn(t) {
45
- if (ae === setTimeout)
44
+ function Pn(t) {
45
+ if (ce === setTimeout)
46
46
  return setTimeout(t, 0);
47
- if ((ae === or || !ae) && setTimeout)
48
- return ae = setTimeout, setTimeout(t, 0);
47
+ if ((ce === sr || !ce) && setTimeout)
48
+ return ce = setTimeout, setTimeout(t, 0);
49
49
  try {
50
- return ae(t, 0);
50
+ return ce(t, 0);
51
51
  } catch {
52
52
  try {
53
- return ae.call(null, t, 0);
53
+ return ce.call(null, t, 0);
54
54
  } catch {
55
- return ae.call(this, t, 0);
55
+ return ce.call(this, t, 0);
56
56
  }
57
57
  }
58
58
  }
59
59
  function Ci(t) {
60
- if (ue === clearTimeout)
60
+ if (le === clearTimeout)
61
61
  return clearTimeout(t);
62
- if ((ue === sr || !ue) && clearTimeout)
63
- return ue = clearTimeout, clearTimeout(t);
62
+ if ((le === ar || !le) && clearTimeout)
63
+ return le = clearTimeout, clearTimeout(t);
64
64
  try {
65
- return ue(t);
65
+ return le(t);
66
66
  } catch {
67
67
  try {
68
- return ue.call(null, t);
68
+ return le.call(null, t);
69
69
  } catch {
70
- return ue.call(this, t);
70
+ return le.call(this, t);
71
71
  }
72
72
  }
73
73
  }
74
- var ve = [], Qe = !1, _e, ht = -1;
75
- function ki() {
76
- !Qe || !_e || (Qe = !1, _e.length ? ve = _e.concat(ve) : ht = -1, ve.length && Pn());
74
+ var Se = [], Qe = !1, _e, ht = -1;
75
+ function Pi() {
76
+ !Qe || !_e || (Qe = !1, _e.length ? Se = _e.concat(Se) : ht = -1, Se.length && kn());
77
77
  }
78
- function Pn() {
78
+ function kn() {
79
79
  if (!Qe) {
80
- var t = kn(ki);
80
+ var t = Pn(Pi);
81
81
  Qe = !0;
82
- for (var e = ve.length; e; ) {
83
- for (_e = ve, ve = []; ++ht < e; )
82
+ for (var e = Se.length; e; ) {
83
+ for (_e = Se, Se = []; ++ht < e; )
84
84
  _e && _e[ht].run();
85
- ht = -1, e = ve.length;
85
+ ht = -1, e = Se.length;
86
86
  }
87
87
  _e = null, Qe = !1, Ci(t);
88
88
  }
@@ -92,7 +92,7 @@ $.nextTick = function(t) {
92
92
  if (arguments.length > 1)
93
93
  for (var r = 1; r < arguments.length; r++)
94
94
  e[r - 1] = arguments[r];
95
- ve.push(new Nn(t, e)), ve.length === 1 && !Qe && kn(Pn);
95
+ Se.push(new Nn(t, e)), Se.length === 1 && !Qe && Pn(kn);
96
96
  };
97
97
  function Nn(t, e) {
98
98
  this.fun = t, this.array = e;
@@ -106,17 +106,17 @@ $.env = {};
106
106
  $.argv = [];
107
107
  $.version = "";
108
108
  $.versions = {};
109
- function Se() {
109
+ function we() {
110
110
  }
111
- $.on = Se;
112
- $.addListener = Se;
113
- $.once = Se;
114
- $.off = Se;
115
- $.removeListener = Se;
116
- $.removeAllListeners = Se;
117
- $.emit = Se;
118
- $.prependListener = Se;
119
- $.prependOnceListener = Se;
111
+ $.on = we;
112
+ $.addListener = we;
113
+ $.once = we;
114
+ $.off = we;
115
+ $.removeListener = we;
116
+ $.removeAllListeners = we;
117
+ $.emit = we;
118
+ $.prependListener = we;
119
+ $.prependOnceListener = we;
120
120
  $.listeners = function(t) {
121
121
  return [];
122
122
  };
@@ -132,8 +132,8 @@ $.chdir = function(t) {
132
132
  $.umask = function() {
133
133
  return 0;
134
134
  };
135
- var Pi = Cn.exports;
136
- const E = /* @__PURE__ */ Li(Pi), Ni = wi({
135
+ var ki = Cn.exports;
136
+ const E = /* @__PURE__ */ Li(ki), Ni = wi({
137
137
  level: "trace",
138
138
  enabled: typeof window < "u" && !!window.localStorage.getItem("SL_DEBUG"),
139
139
  browser: {
@@ -141,14 +141,14 @@ const E = /* @__PURE__ */ Li(Pi), Ni = wi({
141
141
  console.log(t);
142
142
  }
143
143
  }
144
- }), de = (t, e) => Ni.child({ name: t }, e);
144
+ }), fe = (t, e) => Ni.child({ name: t }, e);
145
145
  class Fi extends Event {
146
146
  slEventBus;
147
147
  constructor(e, r) {
148
148
  super(e), this.slEventBus = r;
149
149
  }
150
150
  }
151
- const Di = de("event-bus");
151
+ const Di = fe("event-bus");
152
152
  class Ri {
153
153
  name;
154
154
  listeners;
@@ -176,7 +176,7 @@ class Ri {
176
176
  class Vi {
177
177
  }
178
178
  window.slStore = /* @__PURE__ */ Object.create(null);
179
- class Pt {
179
+ class Nt {
180
180
  /**
181
181
  * store instance (nanostores)
182
182
  */
@@ -196,18 +196,18 @@ const $i = (t) => {
196
196
  const e = Object.keys(t);
197
197
  return Ii(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
198
198
  };
199
- class Le extends Pt {
199
+ class Le extends Nt {
200
200
  getValues = () => this.getStore().get();
201
201
  getValue = (e) => this.getStore().get()[e];
202
202
  setValue = (e, r) => this.getStore().setKey(e, r);
203
203
  subscribe = (...e) => this.getStore().subscribe(...e);
204
204
  unsubscribe = () => this.getStore().off();
205
205
  }
206
- const J = (t) => Ti(t);
207
- var me;
206
+ const Z = (t) => Oi(t);
207
+ var ge;
208
208
  (function(t) {
209
209
  t.ORGANIZATION = "ORGANIZATION", t.STREAM = "STREAM";
210
- })(me || (me = {}));
210
+ })(ge || (ge = {}));
211
211
  const Mi = {
212
212
  [R.BETTING]: "betting",
213
213
  [R.GAMES]: "games",
@@ -226,7 +226,7 @@ class Fn {
226
226
  listeners = /* @__PURE__ */ new Set();
227
227
  settingsKey;
228
228
  constructor({ settings: e, ...r }, n) {
229
- this.settingsKey = Mi[r.type], this.status = kt(Ze.Suspended), this.config = new Le(J(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Le(J(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Le(J({}), `feature:settings:${this.settingsKey}`), this.source = n;
229
+ this.settingsKey = Mi[r.type], this.status = kt(Ze.Suspended), this.config = new Le(Z(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Le(Z(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Le(Z({}), `feature:settings:${this.settingsKey}`), this.source = n;
230
230
  }
231
231
  get featureConfig() {
232
232
  return this.config.getStore();
@@ -257,7 +257,7 @@ class Fn {
257
257
  }
258
258
  };
259
259
  update = (e, r) => {
260
- this.source === me.STREAM && r === me.ORGANIZATION || (this.setFeatureConfig(e), this.source = r);
260
+ this.source === ge.STREAM && r === ge.ORGANIZATION || (this.setFeatureConfig(e), this.source = r);
261
261
  };
262
262
  fireEvent(e) {
263
263
  for (const r of this.listeners.values())
@@ -268,7 +268,7 @@ class Fn {
268
268
  }
269
269
  }
270
270
  }
271
- class ee extends Pt {
271
+ class re extends Nt {
272
272
  getValue = () => this.getStore().get();
273
273
  getValues() {
274
274
  throw new Error("not implemented");
@@ -284,7 +284,7 @@ class ee extends Pt {
284
284
  }
285
285
  }
286
286
  const q = (t) => kt(t);
287
- class le extends Pt {
287
+ class se extends Nt {
288
288
  atomStore;
289
289
  constructor(e, r, n) {
290
290
  super(e, `api:${r}`), this.atomStore = kt(), n && e.subscribe((i) => {
@@ -315,10 +315,10 @@ class le extends Pt {
315
315
  key = () => this.getStore().key;
316
316
  off = () => this.getStore().off();
317
317
  }
318
- const B = new Ri();
318
+ const M = new Ri();
319
319
  async function* Bi(t, e) {
320
320
  for await (const r of e) {
321
- t.response.message = r, t.received_at = Date.now(), t.id = Dn++;
321
+ t.response.message = r, t.received_at = Date.now(), t.id = Date.now();
322
322
  const n = {
323
323
  type: "__GRPC_DEVTOOLS_EXTENSION__",
324
324
  data: t
@@ -326,10 +326,9 @@ async function* Bi(t, e) {
326
326
  window.postMessage(n), yield r;
327
327
  }
328
328
  }
329
- let Dn = 0;
330
329
  const qi = () => (t) => async (e) => {
331
330
  const r = {
332
- id: Dn++,
331
+ id: Date.now(),
333
332
  name: e.url,
334
333
  stream: e.stream,
335
334
  sent_at: Date.now(),
@@ -351,7 +350,7 @@ const qi = () => (t) => async (e) => {
351
350
  type: "__GRPC_DEVTOOLS_EXTENSION__",
352
351
  data: {
353
352
  ...r,
354
- stream: !1
353
+ stream: !0
355
354
  }
356
355
  };
357
356
  return window.postMessage(i), {
@@ -380,7 +379,7 @@ const qi = () => (t) => async (e) => {
380
379
  }
381
380
  };
382
381
  window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));
383
- function Rn(t) {
382
+ function Dn(t) {
384
383
  return t instanceof DOMException && // everything except Firefox
385
384
  (t.code === 22 || // Firefox
386
385
  t.code === 1014 || // test name field too, because code might not be present
@@ -405,7 +404,7 @@ class We {
405
404
  try {
406
405
  this.storage.setItem(n, r);
407
406
  } catch (i) {
408
- Rn(i) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(n, r));
407
+ Dn(i) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(n, r));
409
408
  }
410
409
  };
411
410
  read = (...e) => {
@@ -416,11 +415,11 @@ class We {
416
415
  this.storage.removeItem(this.generateKey(e));
417
416
  };
418
417
  }
419
- var ne;
418
+ var ie;
420
419
  (function(t) {
421
420
  t.Init = "init", t.Ready = "ready", t.Connecting = "connecting", t.Connected = "connected", t.Disconnected = "disconnected", t.Failed = "failed", t.Reconnect = "reconnect", t.Reconnecting = "reconnecting";
422
- })(ne || (ne = {}));
423
- const Hr = de("grpc:stream");
421
+ })(ie || (ie = {}));
422
+ const Hr = fe("grpc:stream");
424
423
  class Ui {
425
424
  params;
426
425
  streamCancel;
@@ -435,19 +434,19 @@ class Ui {
435
434
  attempt = 0;
436
435
  constructor(e, r, n, i) {
437
436
  const o = {
438
- status: ne.Init,
437
+ status: ie.Init,
439
438
  ts: /* @__PURE__ */ new Date(),
440
439
  log: []
441
440
  };
442
- this.state = new Le(J(o), `subscription:${i.name}:state`), this.options = {
441
+ this.state = new Le(Z(o), `subscription:${i.name}:state`), this.options = {
443
442
  ...i,
444
443
  reconnectDelay: i.reconnectDelay ?? 1e3,
445
444
  reconnectMaxDelay: i.reconnectMaxDelay ?? 3e4,
446
445
  reconnectMaxAttempts: i.reconnectMaxAttempts ?? 10,
447
446
  withStore: i.withStore ?? !1
448
- }, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new ee(q(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
449
- this.state.getValue("status") === ne.Connected && (this.addStateLog(`params updated, reconnect => ${JSON.stringify(s)}`), this.reconnect());
450
- })), this.updateState(ne.Ready);
447
+ }, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new re(q(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
448
+ this.state.getValue("status") === ie.Connected && (this.addStateLog(`params updated, reconnect => ${JSON.stringify(s)}`), this.reconnect());
449
+ })), this.updateState(ie.Ready);
451
450
  }
452
451
  updateState = (e) => {
453
452
  this.state.setValue("status", e), this.state.setValue("ts", /* @__PURE__ */ new Date()), this.addStateLog(`status => ${e}`);
@@ -460,7 +459,7 @@ class Ui {
460
459
  window.sessionStorage.setItem("slstreamlogs", window.sessionStorage.getItem("slstreamlogs") + `
461
460
  ` + n);
462
461
  } catch (i) {
463
- Rn(i) && window.sessionStorage.removeItem("slstreamlogs"), window.sessionStorage.setItem("slstreamlogs", n);
462
+ Dn(i) && window.sessionStorage.removeItem("slstreamlogs"), window.sessionStorage.setItem("slstreamlogs", n);
464
463
  }
465
464
  }
466
465
  };
@@ -470,7 +469,7 @@ class Ui {
470
469
  this.listeners.delete(e), this.addStateLog(`listener '${e}' removed`);
471
470
  };
472
471
  connect = () => {
473
- this.updateState(ne.Connecting), this.streamCancel && (this.addStateLog("disconnect prev connection"), this.streamCancel.abort(), this.streamCancel = void 0);
472
+ this.updateState(ie.Connecting), this.streamCancel && (this.addStateLog("disconnect prev connection"), this.streamCancel.abort(), this.streamCancel = void 0);
474
473
  const e = "get" in this.params && typeof this.params.get == "function" ? this.params.get() : this.params;
475
474
  (async () => {
476
475
  this.streamCancel = new AbortController();
@@ -482,12 +481,12 @@ class Ui {
482
481
  for await (const o of i)
483
482
  this.attempt = 0, this.onData(o);
484
483
  } catch (n) {
485
- n instanceof rt && n.code != ie.Canceled && this.onStreamError(n);
484
+ n instanceof rt && n.code != oe.Canceled && this.onStreamError(n);
486
485
  }
487
- })(), this.updateState(ne.Connected);
486
+ })(), this.updateState(ie.Connected);
488
487
  };
489
488
  disconnect = () => {
490
- this.streamCancel && this.streamCancel.abort(), this.listeners.clear(), this.paramsListener?.(), clearTimeout(this.reconnectTimeout), this.reconnectTimeout = void 0, this.updateState(ne.Disconnected);
489
+ this.streamCancel && this.streamCancel.abort(), this.listeners.clear(), this.paramsListener?.(), clearTimeout(this.reconnectTimeout), this.reconnectTimeout = void 0, this.updateState(ie.Disconnected);
491
490
  };
492
491
  /**
493
492
  * Reconnect after delay, if not already reconnecting, otherwise do nothing
@@ -496,10 +495,10 @@ class Ui {
496
495
  if (this.reconnectTimeout)
497
496
  this.addStateLog("already reconnecting");
498
497
  else if (this.attempt < this.options.reconnectMaxAttempts) {
499
- this.updateState(ne.Reconnect);
498
+ this.updateState(ie.Reconnect);
500
499
  const e = Math.min(this.options.reconnectMaxDelay, Math.pow(2, this.attempt) * this.options.reconnectDelay), r = Math.round(e * (1 + Math.random()) / 2);
501
500
  this.reconnectTimeout = setTimeout(() => {
502
- this.attempt++, this.updateState(ne.Reconnecting), this.addStateLog(`reconnect attempt ${this.attempt} after ${r}ms`), this.connect(), this.reconnectTimeout = void 0;
501
+ this.attempt++, this.updateState(ie.Reconnecting), this.addStateLog(`reconnect attempt ${this.attempt} after ${r}ms`), this.connect(), this.reconnectTimeout = void 0;
503
502
  }, r);
504
503
  } else
505
504
  this.addStateLog("max reconnect attempts reached"), this.disconnect();
@@ -522,8 +521,8 @@ class Ui {
522
521
  */
523
522
  onStreamError = (e) => {
524
523
  if (this.addStateLog(`error => ${e ? JSON.stringify(e) : "undefined"}}`), e !== void 0) {
525
- if (e instanceof rt && e.code !== ie.Canceled) {
526
- this.updateState(ne.Failed), this.state.setValue("error", e), e.code === ie.Unknown && e.cause === "missing trailer" && (this.attempt = 0), this.reconnect();
524
+ if (e instanceof rt && e.code !== oe.Canceled) {
525
+ this.updateState(ie.Failed), this.state.setValue("error", e), e.code === oe.Unknown && e.cause === "missing trailer" && (this.attempt = 0), this.reconnect();
527
526
  return;
528
527
  }
529
528
  this.disconnect();
@@ -531,15 +530,15 @@ class Ui {
531
530
  };
532
531
  }
533
532
  const ji = /* @__PURE__ */ new Set([
534
- ie.Unknown,
535
- ie.Internal,
536
- ie.DeadlineExceeded,
537
- ie.ResourceExhausted,
538
- ie.FailedPrecondition,
539
- ie.Unavailable,
540
- ie.DataLoss
541
- ]), Wr = de("grpc:retry"), xi = (t) => async (e) => {
542
- const r = e.contextValues.get(ar.retryAttempts), n = 300, i = e.contextValues.get(ar.retryDelay);
533
+ oe.Unknown,
534
+ oe.Internal,
535
+ oe.DeadlineExceeded,
536
+ oe.ResourceExhausted,
537
+ oe.FailedPrecondition,
538
+ oe.Unavailable,
539
+ oe.DataLoss
540
+ ]), Wr = fe("grpc:retry"), xi = (t) => async (e) => {
541
+ const r = e.contextValues.get(ur.retryAttempts), n = 300, i = e.contextValues.get(ur.retryDelay);
543
542
  if (e.stream || r === 0)
544
543
  return t(e);
545
544
  Wr.trace({ url: e.url, attempts: r, maxDelay: i }, "retry options");
@@ -554,14 +553,14 @@ const ji = /* @__PURE__ */ new Set([
554
553
  const u = Math.min(i, Math.pow(2, o) * n), l = Math.round(u * (1 + Math.random()) / 2);
555
554
  await new Promise((c) => setTimeout(c, l));
556
555
  }
557
- }, ar = {
556
+ }, ur = {
558
557
  retryAttempts: Ur(10, { description: "Number of attempts to retry" }),
559
558
  retryDelay: Ur(3e4, { description: "Max delay between retries in milliseconds" })
560
559
  }, Qi = () => {
561
560
  const t = localStorage.getItem("sl-device-id");
562
561
  if (t)
563
562
  return t;
564
- const e = ir();
563
+ const e = or();
565
564
  return localStorage.setItem("sl-device-id", e), e;
566
565
  }, Gi = () => navigator.userAgentData?.platform || navigator.platform;
567
566
  class Yr {
@@ -583,7 +582,7 @@ class Yr {
583
582
  subscriptions;
584
583
  opts;
585
584
  constructor(e, r) {
586
- this.host = e, this.opts = r, this.$headers = new Le(J({
585
+ this.host = e, this.opts = r, this.$headers = new Le(Z({
587
586
  "sl-device-id": Qi(),
588
587
  "sl-device-os": Gi()
589
588
  }), "transport:headers"), this.initInterceptors(), this.clients = /* @__PURE__ */ new Map(), this.streamClients = /* @__PURE__ */ new Map(), this.subscriptions = /* @__PURE__ */ new Map();
@@ -654,9 +653,9 @@ class Yr {
654
653
  ...Array.isArray(r) ? r : [r]
655
654
  ], a = [e.typeName, o.charAt(0).toLowerCase() + o.slice(1)];
656
655
  return { client: i, createRequestOptions: (l) => {
657
- const c = Oi();
656
+ const c = Ti();
658
657
  for (const f in l) {
659
- const p = ar[f];
658
+ const p = ur[f];
660
659
  c.set(p, l[f]);
661
660
  }
662
661
  return c;
@@ -686,7 +685,7 @@ class Yr {
686
685
  };
687
686
  }
688
687
  const Ki = (t, e) => {
689
- const { client: r, queryKey: n } = e.createPromiseClient(On, {
688
+ const { client: r, queryKey: n } = e.createPromiseClient(Tn, {
690
689
  method: "retrieveEventId",
691
690
  params: [t]
692
691
  });
@@ -712,7 +711,7 @@ const Ki = (t, e) => {
712
711
  })).data?.attributes : void 0
713
712
  });
714
713
  }, Hi = (t, e) => {
715
- const { client: r, queryKey: n } = e.createPromiseClient(On, { method: "summary", params: [t] });
714
+ const { client: r, queryKey: n } = e.createPromiseClient(Tn, { method: "summary", params: [t] });
716
715
  return e.nanoquery.createFetcherStore(n, {
717
716
  fetcher: async (i, o, s) => s ? (await r.summary({
718
717
  id: s
@@ -764,42 +763,42 @@ const Ki = (t, e) => {
764
763
  t.transport.disconnect(), t.analyticsTransport.disconnect();
765
764
  }), r();
766
765
  };
767
- var ye;
766
+ var me;
768
767
  (function(t) {
769
768
  t.SCHEMA = "schema", t.EXTERNAL_TOKEN = "eToken", t.TOKEN = "token";
770
- })(ye || (ye = {}));
769
+ })(me || (me = {}));
771
770
  class Ue extends We {
772
771
  constructor() {
773
772
  super("user");
774
773
  }
775
774
  // Schema
776
775
  setSchema = (e) => {
777
- this.write(ye.SCHEMA, e);
776
+ this.write(me.SCHEMA, e);
778
777
  };
779
- getSchema = () => this.read(ye.SCHEMA);
778
+ getSchema = () => this.read(me.SCHEMA);
780
779
  // Token
781
780
  setToken = (e) => {
782
- this.write(ye.TOKEN, e);
781
+ this.write(me.TOKEN, e);
783
782
  };
784
- getToken = () => this.read(ye.TOKEN);
783
+ getToken = () => this.read(me.TOKEN);
785
784
  // External Token
786
785
  setExternalToken = (e) => {
787
- this.write(ye.EXTERNAL_TOKEN, e);
786
+ this.write(me.EXTERNAL_TOKEN, e);
788
787
  };
789
- getExternalToken = () => this.read(ye.EXTERNAL_TOKEN);
788
+ getExternalToken = () => this.read(me.EXTERNAL_TOKEN);
790
789
  removeToken = () => {
791
- this.remove(ye.TOKEN);
790
+ this.remove(me.TOKEN);
792
791
  };
793
792
  }
794
- var ge;
793
+ var be;
795
794
  (function(t) {
796
795
  t.DISABLED = "disabled", t.INITIALIZATION = "initialization", t.READY = "ready", t.FAILED = "failed", t.SUSPENDED = "suspended";
797
- })(ge || (ge = {}));
796
+ })(be || (be = {}));
798
797
  const to = (t) => {
799
- const e = new Ue(), r = new ee(q(e.getExternalToken()), "userKey"), n = new ee(q(e.getToken()), "userToken"), i = new le(Wi(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, l) => {
798
+ const e = new Ue(), r = new re(q(e.getExternalToken()), "userKey"), n = new re(q(e.getToken()), "userToken"), i = new se(Wi(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, l) => {
800
799
  if (!a)
801
800
  return s?.data?.id ? s.data.id : u === !1 ? void 0 : l;
802
- }), o = new le(Ji(n.getStore(), t), "userSettings");
801
+ }), o = new se(Ji(n.getStore(), t), "userSettings");
803
802
  return {
804
803
  userKey: r,
805
804
  userToken: n,
@@ -807,7 +806,7 @@ const to = (t) => {
807
806
  userSettings: o
808
807
  };
809
808
  }, ro = (t) => {
810
- const e = new ee(q(void 0), "providerStreamId"), r = new le(Ki(e.getStore(), t), "slStreamId", (o) => o?.data), n = new le(zi(r.getAtomStore(), t), "streamSettings"), i = new le(Hi(r.getAtomStore(), t), "streamSettings");
809
+ const e = new re(q(void 0), "providerStreamId"), r = new se(Ki(e.getStore(), t), "slStreamId", (o) => o?.data), n = new se(zi(r.getAtomStore(), t), "streamSettings"), i = new se(Hi(r.getAtomStore(), t), "streamSettings");
811
810
  return r.getAtomStore().listen((o) => {
812
811
  (o === "" || o === void 0) && (n.getStore().mutate(void 0), i.getStore().mutate(void 0));
813
812
  }), {
@@ -817,7 +816,7 @@ const to = (t) => {
817
816
  streamSummary: i
818
817
  };
819
818
  }, no = (t) => {
820
- const e = new ee(q(void 0), "enabled"), r = new ee(q(ge.DISABLED), "status"), n = new le(Xi(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new le(Zi(n.getAtomStore(), t), "organizationAdvertising"), o = to(t), s = ro(t);
819
+ const e = new re(q(void 0), "enabled"), r = new re(q(be.DISABLED), "status"), n = new se(Xi(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new se(Zi(n.getAtomStore(), t), "organizationAdvertising"), o = to(t), s = ro(t);
821
820
  return {
822
821
  enabled: e,
823
822
  status: r,
@@ -833,7 +832,7 @@ const to = (t) => {
833
832
  organizationAdvertising: i
834
833
  };
835
834
  };
836
- class io extends Pt {
835
+ class io extends Nt {
837
836
  stores;
838
837
  constructor(e) {
839
838
  const r = no(e), n = $i(r);
@@ -864,7 +863,7 @@ const oo = (t, e, r) => {
864
863
  }, so = (t) => {
865
864
  const { client: e } = t.createPromiseClient(_n, { method: "list" });
866
865
  return (r) => e.list(r);
867
- }, Vn = (t) => {
866
+ }, Rn = (t) => {
868
867
  const { client: e } = t.createPromiseClient(_n, { method: "summary" });
869
868
  return (r) => e.summary(r);
870
869
  }, ao = (t, e) => {
@@ -884,7 +883,7 @@ const oo = (t, e, r) => {
884
883
  }
885
884
  });
886
885
  }, uo = (t, e) => {
887
- const { client: r, queryKey: n } = e.createPromiseClient(te, { method: "get", params: [t] });
886
+ const { client: r, queryKey: n } = e.createPromiseClient(ee, { method: "get", params: [t] });
888
887
  return e.nanoquery.createFetcherStore(n, {
889
888
  fetcher: async (i, o, s) => (await r.get({
890
889
  eventId: s
@@ -893,7 +892,7 @@ const oo = (t, e, r) => {
893
892
  dedupeTime: 1e3 * 60 * 60
894
893
  });
895
894
  }, co = (t, e) => {
896
- const { client: r, queryKey: n } = e.createPromiseClient(te, { method: "syncQuestion", params: [t] });
895
+ const { client: r, queryKey: n } = e.createPromiseClient(ee, { method: "syncQuestion", params: [t] });
897
896
  return e.nanoquery.createFetcherStore(n, {
898
897
  fetcher: async (i, o, s) => {
899
898
  if (!s)
@@ -903,7 +902,7 @@ const oo = (t, e, r) => {
903
902
  eventId: s
904
903
  }
905
904
  });
906
- if (a.data?.attributes?.question?.type !== _.PROMOTION)
905
+ if (a.data?.attributes?.question?.type !== I.PROMOTION)
907
906
  return a.data?.attributes;
908
907
  },
909
908
  dedupeTime: 1e3 * 60 * 10,
@@ -911,25 +910,25 @@ const oo = (t, e, r) => {
911
910
  refetchInterval: 0
912
911
  });
913
912
  }, lo = async (t, e) => {
914
- const { client: r } = e.createPromiseClient(te, { method: "item", params: [t] });
913
+ const { client: r } = e.createPromiseClient(ee, { method: "item", params: [t] });
915
914
  return (await r.item({
916
915
  id: t
917
916
  })).data;
918
917
  }, fo = (t, e) => {
919
- const { client: r } = e.createStreamClient(te), n = kt({ eventId: t.get() || "", feedId: "" });
918
+ const { client: r } = e.createStreamClient(ee), n = kt({ eventId: t.get() || "", feedId: "" });
920
919
  return t.subscribe((o = "") => {
921
920
  n.set({ eventId: o, feedId: "" });
922
921
  }), e.addSubscription(r.subscription, n, { name: "feedSubscription" });
923
922
  }, po = (t, e) => {
924
- const { client: r } = e.createStreamClient(te);
923
+ const { client: r } = e.createStreamClient(ee);
925
924
  return e.addSubscription(r.questionSubscription, { questionId: t }, { name: "questionSubscription" });
926
- }, ho = async (t, e) => {
927
- const { client: r } = e.createPromiseClient(te, { method: "questionByUser", params: [t] });
925
+ }, Vn = async (t, e) => {
926
+ const { client: r } = e.createPromiseClient(ee, { method: "questionByUser", params: [t] });
928
927
  return (await r.questionByUser({
929
928
  questionId: t
930
929
  })).data?.attributes?.question;
931
- }, ur = (t, e) => {
932
- const { client: r, queryKey: n } = e.createPromiseClient(te, { method: "questionByUser", params: [t] });
930
+ }, wt = (t, e) => {
931
+ const { client: r, queryKey: n } = e.createPromiseClient(ee, { method: "questionByUser", params: [t] });
933
932
  return e.nanoquery.createFetcherStore(n, {
934
933
  fetcher: async (i, o, s) => (await r.questionByUser({
935
934
  questionId: s
@@ -939,15 +938,15 @@ const oo = (t, e, r) => {
939
938
  }, $n = async (t, e) => {
940
939
  if (!t)
941
940
  return;
942
- const { client: r } = e.createPromiseClient(te, { method: "getQuestion", params: [t] }), n = await r.getQuestion({
941
+ const { client: r } = e.createPromiseClient(ee, { method: "getQuestion", params: [t] }), n = await r.getQuestion({
943
942
  id: t
944
943
  });
945
944
  if (!n.data?.attributes)
946
945
  return;
947
946
  const { options: i, notification: o, ...s } = n.data.attributes, a = i?.options.case === "promotion" ? i?.options.value : void 0;
948
947
  return { id: s.id, question: s, promotion: a, notification: o };
949
- }, yo = (t, e, r) => {
950
- const { client: n, queryKey: i } = r.createPromiseClient(te, {
948
+ }, ho = (t, e, r) => {
949
+ const { client: n, queryKey: i } = r.createPromiseClient(ee, {
951
950
  method: "list",
952
951
  params: [t, e]
953
952
  });
@@ -955,15 +954,15 @@ const oo = (t, e, r) => {
955
954
  fetcher: async (o, s, a, u) => a ? (await n.list({
956
955
  eventId: a,
957
956
  filter: {
958
- types: u === Ce.ALLOWED ? [] : [_.FACTOID, _.PROMOTION, _.TWEET],
959
- statuses: [Z.ACTIVE, Z.RESOLVED]
957
+ types: u === Ce.ALLOWED ? [] : [I.FACTOID, I.PROMOTION, I.TWEET],
958
+ statuses: [Y.ACTIVE, Y.RESOLVED]
960
959
  }
961
960
  })).data : [],
962
961
  dedupeTime: 0,
963
962
  refetchInterval: 0
964
963
  });
965
- }, mo = (t, e) => {
966
- const { client: r, queryKey: n } = e.createPromiseClient(te, {
964
+ }, yo = (t, e) => {
965
+ const { client: r, queryKey: n } = e.createPromiseClient(ee, {
967
966
  method: "list",
968
967
  params: [t]
969
968
  });
@@ -974,8 +973,8 @@ const oo = (t, e, r) => {
974
973
  const u = (await r.list({
975
974
  eventId: s,
976
975
  filter: {
977
- types: [_.PROMOTION],
978
- statuses: [Z.ACTIVE]
976
+ types: [I.PROMOTION],
977
+ statuses: [Y.ACTIVE]
979
978
  },
980
979
  pagination: {
981
980
  page: 0,
@@ -988,6 +987,30 @@ const oo = (t, e, r) => {
988
987
  dedupeTime: 0,
989
988
  refetchInterval: 0
990
989
  });
990
+ }, mo = (t, e) => {
991
+ const { client: r, queryKey: n } = e.createPromiseClient(ee, {
992
+ method: "betPack",
993
+ params: [t]
994
+ });
995
+ return e.nanoquery.createFetcherStore(n, {
996
+ fetcher: async (i, o, s) => {
997
+ if (!s)
998
+ return null;
999
+ const a = await r.betPack({
1000
+ eventId: s,
1001
+ types: [I.PREDICTION],
1002
+ statuses: [Y.ACTIVE, Y.RESOLVED],
1003
+ limit: 5,
1004
+ sort: {
1005
+ field: "activated_at",
1006
+ order: "asc"
1007
+ }
1008
+ });
1009
+ return !a.data || !a.data.length ? null : a.data?.reduce((u, l) => l?.attributes?.question?.id ? { ...u, [l.attributes.question.id]: l.attributes.question } : u, {});
1010
+ },
1011
+ dedupeTime: 0,
1012
+ refetchInterval: 0
1013
+ });
991
1014
  }, go = (t, e, r) => {
992
1015
  const n = qr([e, r], () => {
993
1016
  const a = e.get();
@@ -995,7 +1018,7 @@ const oo = (t, e, r) => {
995
1018
  return;
996
1019
  const u = r.get().data?.find((c) => c.id === a?.questionId), l = a?.question?.openedFrom;
997
1020
  return u ? (u.openedFrom = l, u) : a.question;
998
- }), i = qr(n, (a) => a && a.type === "question" ? a.id : void 0), o = ur(i, t);
1021
+ }), i = qr(n, (a) => a && a.type === "question" ? a.id : void 0), o = wt(i, t);
999
1022
  return { $store: n, $extendedStore: o, updateExtendedQuestion: (a) => {
1000
1023
  const u = o.get().data, l = (c, f) => {
1001
1024
  if (!c || !f)
@@ -1020,18 +1043,18 @@ const oo = (t, e, r) => {
1020
1043
  });
1021
1044
  } };
1022
1045
  };
1023
- var wt;
1046
+ var At;
1024
1047
  (function(t) {
1025
1048
  t.SHOWED = "showed";
1026
- })(wt || (wt = {}));
1049
+ })(At || (At = {}));
1027
1050
  class bo extends We {
1028
1051
  constructor() {
1029
1052
  super("advertisement");
1030
1053
  }
1031
1054
  setShowed = (e) => {
1032
- this.write(wt.SHOWED, e, "true");
1055
+ this.write(At.SHOWED, e, "true");
1033
1056
  };
1034
- isViewed = (e) => this.read(wt.SHOWED, e);
1057
+ isViewed = (e) => this.read(At.SHOWED, e);
1035
1058
  }
1036
1059
  const vo = (t) => {
1037
1060
  const e = t.data?.attributes?.question;
@@ -1059,32 +1082,29 @@ const vo = (t) => {
1059
1082
  }
1060
1083
  }
1061
1084
  return r + n.join("&");
1062
- }, $e = (t) => (t?.promotion?.type === W.INGAME_IAB11_LBAR || t?.promotion?.type === W.INGAME_IAB21_LBAR) && !!t.promotion.additionalBanner?.imageUrl, wo = (t, e, r) => {
1085
+ }, $e = (t) => (t?.promotion?.type === U.INGAME_IAB11_LBAR || t?.promotion?.type === U.INGAME_IAB21_LBAR) && !!t.promotion.additionalBanner?.imageUrl, wo = (t, e, r) => {
1063
1086
  let n = !1;
1064
- const i = r.transport, o = de("advertisement"), s = new bo(), a = J({}), u = mo(t, i), l = (b) => {
1065
- if (b?.fromNotification) {
1066
- a.setKey("hasNotification", !1);
1067
- const g = a.get(), S = g.data?.question.id, F = g.data?.promotion?.type;
1068
- S && (B.emit("advertisement", {
1069
- action: "opened",
1070
- payload: {
1071
- id: S,
1072
- type: F,
1073
- hasBanner: $e(g.data),
1074
- openedFrom: "notification"
1075
- }
1076
- }), B.emit("advertisement", {
1077
- action: "notification-opened",
1078
- payload: {
1079
- id: S,
1080
- type: F,
1081
- hasBanner: $e(g.data)
1082
- }
1083
- }));
1084
- }
1087
+ const i = r.transport, o = fe("advertisement"), s = new bo(), a = Z({}), u = yo(t, i), l = (b) => {
1088
+ const g = a.get(), S = g.data?.question.id, F = g.data?.promotion?.type;
1089
+ S && (M.emit("advertisement", {
1090
+ action: "opened",
1091
+ payload: {
1092
+ id: S,
1093
+ type: F,
1094
+ hasBanner: $e(g.data),
1095
+ openedFrom: b?.fromNotification ? "notification" : "auto"
1096
+ }
1097
+ }), b?.fromNotification && (a.setKey("hasNotification", !1), M.emit("advertisement", {
1098
+ action: "notification-opened",
1099
+ payload: {
1100
+ id: S,
1101
+ type: F,
1102
+ hasBanner: $e(g.data)
1103
+ }
1104
+ })));
1085
1105
  }, c = () => {
1086
1106
  const b = a.get(), g = b.data?.question.id, S = b.data?.promotion?.type, F = a.get()?.isOpened;
1087
- g && !F && (o.debug({ id: g }, "markAsViewed: %o"), s.setShowed(g), a.setKey("isOpened", !0), B.emit("advertisement", {
1107
+ g && !F && (o.debug({ id: g }, "markAsViewed: %o"), s.setShowed(g), a.setKey("isOpened", !0), M.emit("advertisement", {
1088
1108
  action: "viewed",
1089
1109
  payload: {
1090
1110
  id: g,
@@ -1117,11 +1137,11 @@ const vo = (t) => {
1117
1137
  };
1118
1138
  a.subscribe((b, g) => {
1119
1139
  if (!(b.data?.id === g?.data?.id && b.isPaused !== g?.isPaused)) {
1120
- if (b.data?.promotion?.type === W.EXTERNAL_AD && !b?.externalAd && b.data.promotion.adCampaigns?.gamOptions && b.data.promotion.adCampaigns?.gamBaseUrl) {
1140
+ if (b.data?.promotion?.type === U.EXTERNAL_AD && !b?.externalAd && b.data.promotion.adCampaigns?.gamOptions && b.data.promotion.adCampaigns?.gamBaseUrl) {
1121
1141
  const S = So(b.data.promotion.adCampaigns);
1122
1142
  a.setKey("externalAd", { type: "gam", url: S });
1123
1143
  }
1124
- b.data?.promotion && !b.isOpened && (B.emit("advertisement", {
1144
+ b.data?.promotion && !b.isOpened && (M.emit("advertisement", {
1125
1145
  action: "received",
1126
1146
  payload: {
1127
1147
  id: b.data.question.id,
@@ -1131,7 +1151,7 @@ const vo = (t) => {
1131
1151
  isViewed: !!s.isViewed(b.data.question.id)
1132
1152
  },
1133
1153
  skipAnalytics: b.data.question.id === g?.data?.question.id
1134
- }), b.data.question.id !== g?.data?.question.id && !s.isViewed(b.data.question.id) && B.emit("advertisement", {
1154
+ }), b.data.question.id !== g?.data?.question.id && !s.isViewed(b.data.question.id) && M.emit("advertisement", {
1135
1155
  action: "notification-received",
1136
1156
  payload: {
1137
1157
  id: b.data.question.id,
@@ -1140,7 +1160,7 @@ const vo = (t) => {
1140
1160
  hasBanner: $e(b.data),
1141
1161
  isViewed: !1
1142
1162
  }
1143
- })), !b?.data && g?.data && B.emit("advertisement", {
1163
+ })), !b?.data && g?.data && M.emit("advertisement", {
1144
1164
  action: "closed",
1145
1165
  payload: {
1146
1166
  id: g.data.question.id,
@@ -1163,11 +1183,11 @@ const vo = (t) => {
1163
1183
  }), e.addListener("promotion", (b) => {
1164
1184
  const g = vo(b);
1165
1185
  if (g) {
1166
- if (g.question.status === Z.RESOLVED) {
1186
+ if (g.question.status === Y.RESOLVED) {
1167
1187
  p(g.question.id), o.debug({ promotion: g }, "resolved: %o");
1168
1188
  return;
1169
1189
  }
1170
- if (g.question.status === Z.ACTIVE) {
1190
+ if (g.question.status === Y.ACTIVE) {
1171
1191
  o.debug({ promotion: g }, "active: %o"), f(g.question.id, g);
1172
1192
  return;
1173
1193
  }
@@ -1199,6 +1219,7 @@ class Ao {
1199
1219
  /** last active question in feed */
1200
1220
  activeQuestionId;
1201
1221
  feedList;
1222
+ betPack;
1202
1223
  /** moderation id */
1203
1224
  moderationId;
1204
1225
  /** moderation */
@@ -1213,14 +1234,31 @@ class Ao {
1213
1234
  transport;
1214
1235
  cancels = /* @__PURE__ */ new Set();
1215
1236
  constructor(e) {
1216
- this.transport = e.transport, this.log = de("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new ee(q(void 0), "moderationId").getStore(), this.interactiveAllowed = new ee(q(Ce.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new ee(q(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new le(uo(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new le(yo(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.activeQuestionId = co(this.slStreamId, e.transport), this.openedQuestion = go(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((r) => {
1237
+ this.transport = e.transport, this.log = fe("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new re(q(void 0), "moderationId").getStore(), this.interactiveAllowed = new re(q(Ce.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new re(q(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new se(uo(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new se(ho(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.betPack = new se(mo(this.slStreamId, e.transport), "gamification:betPack"), this.activeQuestionId = co(this.slStreamId, e.transport), this.openedQuestion = go(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((r) => {
1217
1238
  this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = po(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", (n) => {
1218
1239
  this.openedQuestion.updateExtendedQuestion(n.data?.attributes?.question);
1219
1240
  }), this.questionSubscription.connect()) : (this.log.info("cleanup on close question"), this.questionSubscription !== void 0 && (e.transport.removeSubscription(this.questionSubscription), this.questionSubscription = void 0));
1220
- })), this.feedSubscription = fo(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
1241
+ })), this.feedSubscription = fo(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("bet-pack-update", async (r) => {
1242
+ const n = r.data?.attributes?.question;
1243
+ if (n?.type === I.PREDICTION) {
1244
+ const i = this.betPack.getValues().data || {};
1245
+ if (i?.[n.id] || Object.keys(i).length < 5) {
1246
+ const s = wt(n.id, this.transport), a = s.subscribe(() => {
1247
+ });
1248
+ await s.get().promise;
1249
+ let u = s.get().data;
1250
+ u || (u = await Vn(n.id, this.transport)), a(), window.requestAnimationFrame(() => {
1251
+ s.invalidate();
1252
+ }), this.betPack.getStore().mutate({
1253
+ ...i,
1254
+ [n.id]: u
1255
+ });
1256
+ }
1257
+ }
1258
+ })), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
1221
1259
  const n = this.activeQuestionId.get().data?.question?.id, i = r.data?.attributes?.question;
1222
- if (!(!i || i.type === _.PROMOTION)) {
1223
- if (i.status === Z.RESOLVED) {
1260
+ if (!(!i || i.type === I.PROMOTION)) {
1261
+ if (i.status === Y.RESOLVED) {
1224
1262
  n === i.id && this.activeQuestionId.mutate(void 0);
1225
1263
  return;
1226
1264
  }
@@ -1299,7 +1337,7 @@ class Eo {
1299
1337
  options;
1300
1338
  logger;
1301
1339
  constructor(e) {
1302
- this.options = e, this.logger = de("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notificationsList = q(/* @__PURE__ */ new Map());
1340
+ this.options = e, this.logger = fe("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notificationsList = q(/* @__PURE__ */ new Map());
1303
1341
  }
1304
1342
  addToQueue = (e) => {
1305
1343
  if (this.store.has(e.id)) {
@@ -1343,7 +1381,7 @@ class Eo {
1343
1381
  this.logger.debug({ notificationId: e }, "active queue tick skipped, notification not exist");
1344
1382
  return;
1345
1383
  }
1346
- B.emit("notification", {
1384
+ M.emit("notification", {
1347
1385
  action: "received",
1348
1386
  payload: {
1349
1387
  questionId: r.data.questionId,
@@ -1368,7 +1406,7 @@ class Eo {
1368
1406
  const s = new Map(this.notificationsList.get());
1369
1407
  s.delete(e), this.notificationsList.set(s);
1370
1408
  const a = this.timeouts.get(e);
1371
- a !== void 0 && (clearTimeout(a), this.timeouts.delete(e)), this.logger.debug({ notificationId: e }, "notification hidden"), i.hiding && B.emit("notification", {
1409
+ a !== void 0 && (clearTimeout(a), this.timeouts.delete(e)), this.logger.debug({ notificationId: e }, "notification hidden"), i.hiding && M.emit("notification", {
1372
1410
  action: "closed",
1373
1411
  payload: {
1374
1412
  questionId: i.data.questionId,
@@ -1384,18 +1422,18 @@ class Eo {
1384
1422
  this.store.clear(), this.timeouts.clear(), this.waitingQueue.clear(), this.activeQueue.clear(), this.notificationsList.off(), this.notificationsList.set(/* @__PURE__ */ new Map());
1385
1423
  };
1386
1424
  }
1387
- var At;
1425
+ var Et;
1388
1426
  (function(t) {
1389
1427
  t.OPENED = "opened";
1390
- })(At || (At = {}));
1428
+ })(Et || (Et = {}));
1391
1429
  class Io extends We {
1392
1430
  constructor() {
1393
1431
  super("notification");
1394
1432
  }
1395
1433
  setOpened = (e) => {
1396
- this.write(At.OPENED, e, "true");
1434
+ this.write(Et.OPENED, e, "true");
1397
1435
  };
1398
- isOpened = (e) => this.read(At.OPENED, e);
1436
+ isOpened = (e) => this.read(Et.OPENED, e);
1399
1437
  clearNotification = () => {
1400
1438
  this.clear();
1401
1439
  };
@@ -1404,7 +1442,7 @@ var Ee;
1404
1442
  (function(t) {
1405
1443
  t[t.ONBOARDING = 1] = "ONBOARDING", t[t.QUESTION = 2] = "QUESTION", t[t.QUESTION_RESOLVED = 3] = "QUESTION_RESOLVED";
1406
1444
  })(Ee || (Ee = {}));
1407
- class To {
1445
+ class Oo {
1408
1446
  queue;
1409
1447
  storage;
1410
1448
  constructor(e = {}) {
@@ -1416,7 +1454,7 @@ class To {
1416
1454
  if (e.data && e.emitEvent) {
1417
1455
  const n = e.action;
1418
1456
  e.action = (...i) => {
1419
- n && n(...i), B.emit("notification", {
1457
+ n && n(...i), M.emit("notification", {
1420
1458
  action: "opened",
1421
1459
  payload: {
1422
1460
  questionId: e.data.questionId,
@@ -1445,8 +1483,8 @@ class To {
1445
1483
  this.storage.setOpened(e);
1446
1484
  };
1447
1485
  }
1448
- const Oo = (t, e, r) => {
1449
- t.notifications = new To(void 0), t.addNotification = t.notifications.add, t.sdk.getNotificationsStore = () => t.notifications.getQueueStore(), t.sdk.getActiveNotification = () => t.notifications.getActiveNotification(), t.sdk.onMount({ name: "notifications" }, () => () => {
1486
+ const To = (t, e, r) => {
1487
+ t.notifications = new Oo(void 0), t.addNotification = t.notifications.add, t.sdk.getNotificationsStore = () => t.notifications.getQueueStore(), t.sdk.getActiveNotification = () => t.notifications.getActiveNotification(), t.sdk.onMount({ name: "notifications" }, () => () => {
1450
1488
  t.notifications.queue.drain();
1451
1489
  }), r();
1452
1490
  };
@@ -1455,14 +1493,14 @@ var nt;
1455
1493
  t.UNKNOWN = "unknown", t.ALREADY_VOTED = "already_voted";
1456
1494
  })(nt || (nt = {}));
1457
1495
  const _o = async (t, e) => {
1458
- const { client: r, createRequestOptions: n } = t.createPromiseClient(te, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
1496
+ const { client: r, createRequestOptions: n } = t.createPromiseClient(ee, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
1459
1497
  try {
1460
1498
  return await r.submitAnswer({ data: e }, { contextValues: i });
1461
1499
  } catch (o) {
1462
- throw rt.from(o)?.code === ie.AlreadyExists ? new Error(nt.ALREADY_VOTED) : new Error(nt.UNKNOWN);
1500
+ throw rt.from(o)?.code === oe.AlreadyExists ? new Error(nt.ALREADY_VOTED) : new Error(nt.UNKNOWN);
1463
1501
  }
1464
1502
  }, Lo = (t, e) => {
1465
- const { client: r, createRequestOptions: n } = t.createPromiseClient(te, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
1503
+ const { client: r, createRequestOptions: n } = t.createPromiseClient(ee, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
1466
1504
  return r.submitInplay({ data: { eventId: +e } }, { contextValues: i });
1467
1505
  };
1468
1506
  var je;
@@ -1492,11 +1530,11 @@ class Mn extends We {
1492
1530
  };
1493
1531
  getOnboardingInstantOpen = ({ userId: e, eventId: r, organizationId: n }) => this.sessionStorage.readValue([je.ONBOARDING_IO, n, e, r]);
1494
1532
  }
1495
- const ko = {
1533
+ const Po = {
1496
1534
  pageSize: 10
1497
- }, Po = (t, e, r, n, i) => {
1535
+ }, ko = (t, e, r, n, i) => {
1498
1536
  let o = 0;
1499
- const s = q({ pageSize: ko.pageSize, page: 0 }), a = J({
1537
+ const s = q({ pageSize: Po.pageSize, page: 0 }), a = Z({
1500
1538
  data: [],
1501
1539
  key: Date.now(),
1502
1540
  hasMore: !0,
@@ -1542,7 +1580,7 @@ class No extends We {
1542
1580
  super("deep-link-context", window.sessionStorage);
1543
1581
  }
1544
1582
  }
1545
- const Jr = "sldl", Nt = "sldl_uid", Bn = "sldl_eid", qn = "sldl_e_eid", Fo = /* @__PURE__ */ new Set([Nt, Bn, qn]), Xr = (t) => {
1583
+ const Jr = "sldl", Ft = "sldl_uid", Bn = "sldl_eid", qn = "sldl_e_eid", Fo = /* @__PURE__ */ new Set([Ft, Bn, qn]), Xr = (t) => {
1546
1584
  const e = {}, r = {};
1547
1585
  for (const [n, i] of t)
1548
1586
  Fo.has(n) ? e[n] = i : r[n] = i;
@@ -1557,7 +1595,7 @@ const Jr = "sldl", Nt = "sldl_uid", Bn = "sldl_eid", qn = "sldl_e_eid", Fo = /*
1557
1595
  return { search: Xr(r) };
1558
1596
  }
1559
1597
  return null;
1560
- }, Zr = de("deep_link"), ce = {
1598
+ }, Zr = fe("deep_link"), de = {
1561
1599
  debug: (...t) => {
1562
1600
  Zr.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1563
1601
  },
@@ -1566,20 +1604,20 @@ const Jr = "sldl", Nt = "sldl_uid", Bn = "sldl_eid", qn = "sldl_e_eid", Fo = /*
1566
1604
  }
1567
1605
  }, Ro = (t, e) => {
1568
1606
  const { hash: r, search: n } = window.location;
1569
- if (ce.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
1607
+ if (de.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
1570
1608
  const i = Do({ hash: r, search: n });
1571
- if (ce.debug(i, "parse deep link result"), i) {
1609
+ if (de.debug(i, "parse deep link result"), i) {
1572
1610
  const { hash: o, search: s } = i, { result: a, remain: u } = o || s;
1573
1611
  if (Object.keys(a).length !== 0) {
1574
1612
  t.setValue("data", a);
1575
1613
  const l = Object.keys(u).length !== 0;
1576
1614
  if (o) {
1577
1615
  let c = "";
1578
- l && (c = `#${new URLSearchParams(u).toString()}`, ce.debug({ updatedHash: c }, "update hash")), window.history.replaceState(null, "", window.location.pathname + window.location.search + c);
1616
+ l && (c = `#${new URLSearchParams(u).toString()}`, de.debug({ updatedHash: c }, "update hash")), window.history.replaceState(null, "", window.location.pathname + window.location.search + c);
1579
1617
  }
1580
1618
  if (s) {
1581
1619
  let c = "";
1582
- l && (c = `?${new URLSearchParams(u).toString()}`, ce.debug({ updatedSearch: c }, "update search")), window.history.replaceState(null, "", window.location.pathname + c + window.location.hash);
1620
+ l && (c = `?${new URLSearchParams(u).toString()}`, de.debug({ updatedSearch: c }, "update search")), window.history.replaceState(null, "", window.location.pathname + c + window.location.hash);
1583
1621
  }
1584
1622
  e(a);
1585
1623
  }
@@ -1593,40 +1631,40 @@ const Jr = "sldl", Nt = "sldl_uid", Bn = "sldl_eid", qn = "sldl_e_eid", Fo = /*
1593
1631
  try {
1594
1632
  o = JSON.parse(i);
1595
1633
  } catch (a) {
1596
- ce.debug(a);
1634
+ de.debug(a);
1597
1635
  }
1598
1636
  t.deepLink = {
1599
- $store: new Le(J(o), "deep-link-context"),
1637
+ $store: new Le(Z(o), "deep-link-context"),
1600
1638
  getDeepLinkData: () => {
1601
1639
  const { data: a, used: u } = t.deepLink.$store.getValues();
1602
1640
  return { data: a, used: u };
1603
1641
  },
1604
1642
  // we are logged in with inviter id
1605
1643
  deepLinkUsed: (a) => {
1606
- ce.debug(`logged in with inviterId: ${a}`), t.deepLink.$store.setValue("used", !0);
1644
+ de.debug(`logged in with inviterId: ${a}`), t.deepLink.$store.setValue("used", !0);
1607
1645
  },
1608
1646
  onDeepLinkHandlers: /* @__PURE__ */ new Set()
1609
1647
  }, t.sdk.getInviter = () => {
1610
1648
  const { data: a, used: u } = t.deepLink.getDeepLinkData();
1611
- return u ? a?.[Nt] : void 0;
1649
+ return u ? a?.[Ft] : void 0;
1612
1650
  }, t.sdk.inviteDisplayed = () => {
1613
1651
  t.deepLink.$store.getStore().set({}), t.deepLink.$store.getStore().off(), n.del("sl-deep-link-store");
1614
1652
  }, t.deepLink.$store.subscribe((a) => n.set("sl-deep-link-store", JSON.stringify(a))), t.sdk.addDeepLinkHandler = (a) => {
1615
- localStorage.getItem("SL_DEBUG") && ce.trace("adding deep link handler"), t.deepLink.onDeepLinkHandlers.add(a);
1653
+ localStorage.getItem("SL_DEBUG") && de.trace("adding deep link handler"), t.deepLink.onDeepLinkHandlers.add(a);
1616
1654
  }, e.onDeepLinkHandled && t.sdk.addDeepLinkHandler(e.onDeepLinkHandled), t.sdk.removeDeepLinkHandler = (a) => {
1617
- ce.trace("removing deep link handler"), t.deepLink.onDeepLinkHandlers.delete(a);
1655
+ de.trace("removing deep link handler"), t.deepLink.onDeepLinkHandlers.delete(a);
1618
1656
  };
1619
1657
  const s = (a) => {
1620
- t.deepLink.$store.setValue("handled", !0), ce.trace({ size: t.deepLink.onDeepLinkHandlers.size }, "deep link handled, call callbacks");
1658
+ t.deepLink.$store.setValue("handled", !0), de.trace({ size: t.deepLink.onDeepLinkHandlers.size }, "deep link handled, call callbacks");
1621
1659
  for (const u of t.deepLink.onDeepLinkHandlers)
1622
1660
  try {
1623
- ce.trace("called handler"), u(a);
1661
+ de.trace("called handler"), u(a);
1624
1662
  } catch (l) {
1625
1663
  console.error(l);
1626
1664
  }
1627
1665
  };
1628
1666
  Ro(t.deepLink.$store, s), r();
1629
- }, $o = de("bypass");
1667
+ }, $o = fe("bypass");
1630
1668
  class Mo extends Vi {
1631
1669
  $coreStore;
1632
1670
  deepLink;
@@ -1644,7 +1682,7 @@ class Mo extends Vi {
1644
1682
  */
1645
1683
  login = async (e, r) => {
1646
1684
  this.$coreStore.getValues().userKey.setValue(r);
1647
- const { used: n, data: i } = this.deepLink.getDeepLinkData(), o = n ? "" : i?.[Nt];
1685
+ const { used: n, data: i } = this.deepLink.getDeepLinkData(), o = n ? "" : i?.[Ft];
1648
1686
  $o.debug({ inviterKey: o }, "login with inviterKey");
1649
1687
  const s = await this.bypassLogin({
1650
1688
  schema: e,
@@ -1678,18 +1716,19 @@ class Mo extends Vi {
1678
1716
  * -
1679
1717
  * - If no one of the above is true, then logout.
1680
1718
  */
1681
- reLogin = () => {
1682
- const e = new Ue(), r = e.getToken(), n = e.getExternalToken();
1683
- if (this.$coreStore.getValues().userKey.setValue(n), r)
1684
- return this.saveUser(r, ""), this.me().then((i) => {
1685
- if (i?.id) {
1686
- const o = i.id;
1687
- this.saveUser(r, o);
1719
+ reLogin = ({ skipLogin: e } = { skipLogin: !1 }) => {
1720
+ const r = new Ue(), n = r.getToken(), i = r.getExternalToken();
1721
+ if (this.$coreStore.getValues().userKey.setValue(i), n)
1722
+ return this.saveUser(n, ""), this.me().then((o) => {
1723
+ if (o?.id) {
1724
+ const s = o.id;
1725
+ this.saveUser(n, s);
1688
1726
  }
1727
+ return o;
1689
1728
  });
1690
- if (n && !r) {
1691
- const i = e.getSchema();
1692
- i && n && this.login(i, n).catch(() => {
1729
+ if (i && !n && !e) {
1730
+ const o = r.getSchema();
1731
+ o && i && this.login(o, i).catch(() => {
1693
1732
  this.logout();
1694
1733
  });
1695
1734
  }
@@ -1716,7 +1755,7 @@ class Mo extends Vi {
1716
1755
  }
1717
1756
  const Xe = new Ue(), Bo = (t, e, r) => {
1718
1757
  t.auth = new Mo(t.store, t.transport, t.deepLink), t.stores.status.listen((n) => {
1719
- n === ge.READY && t.auth.reLogin();
1758
+ n === be.READY && t.auth.reLogin();
1720
1759
  }), t.sdk.userId = t.stores.user.getAtomStore, t.sdk.authorizationBypass = async (n, i) => {
1721
1760
  if (!(Xe.getSchema() === n && Xe.getExternalToken() === i && t.transport.getHeader("authorization")))
1722
1761
  try {
@@ -1727,7 +1766,7 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1727
1766
  }, t.sdk.logout = () => {
1728
1767
  t.auth.logout(), Xe.clear();
1729
1768
  }, t.sdk.getUserStore = () => t.stores.user.getStore(), t.sdk.isUserAuthorized = () => t.auth.isAuthenticated(), r();
1730
- }, en = de("video_player"), ft = {
1769
+ }, en = fe("video_player"), ft = {
1731
1770
  debug: (...t) => {
1732
1771
  en.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1733
1772
  },
@@ -1753,13 +1792,13 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1753
1792
  }
1754
1793
  }, r();
1755
1794
  }, Uo = {
1756
- [_.FACTOID]: "insight",
1757
- [_.POLL]: "poll",
1758
- [_.TRIVIA]: "trivia",
1759
- [_.PREDICTION]: "prediction",
1760
- [_.TWEET]: "tweet"
1795
+ [I.FACTOID]: "insight",
1796
+ [I.POLL]: "poll",
1797
+ [I.TRIVIA]: "trivia",
1798
+ [I.PREDICTION]: "prediction",
1799
+ [I.TWEET]: "tweet"
1761
1800
  }, jo = (t, e, r) => {
1762
- t.sdk.uiState = J({}), t.ui = {
1801
+ t.sdk.uiState = Z({}), t.ui = {
1763
1802
  enableAppNotification: function() {
1764
1803
  t.sdk.uiState.setKey("appNotification", !0);
1765
1804
  },
@@ -1804,7 +1843,7 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1804
1843
  switch (u.action) {
1805
1844
  case "notification-opened":
1806
1845
  t.sdk.uiState.set({
1807
- promotionExternalAd: v === W.EXTERNAL_AD,
1846
+ promotionExternalAd: v === U.EXTERNAL_AD,
1808
1847
  promotionBanner: c,
1809
1848
  promotionNotification: !1,
1810
1849
  promotionOverlay: !0,
@@ -1823,7 +1862,7 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1823
1862
  promotionBanner: c,
1824
1863
  promotionOverlay: !0,
1825
1864
  promotionSidebar: !0,
1826
- promotionExternalAd: v === W.EXTERNAL_AD
1865
+ promotionExternalAd: v === U.EXTERNAL_AD
1827
1866
  });
1828
1867
  break;
1829
1868
  }
@@ -1833,7 +1872,7 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1833
1872
  promotionBanner: c,
1834
1873
  promotionOverlay: !0,
1835
1874
  promotionSidebar: !0,
1836
- promotionExternalAd: v === W.EXTERNAL_AD
1875
+ promotionExternalAd: v === U.EXTERNAL_AD
1837
1876
  });
1838
1877
  break;
1839
1878
  case "closed":
@@ -1854,7 +1893,7 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1854
1893
  break;
1855
1894
  }
1856
1895
  }
1857
- }, o = B.listen(i), s = t.activeFeature.subscribe((a) => {
1896
+ }, o = M.listen(i), s = t.activeFeature.subscribe((a) => {
1858
1897
  a ? (t.ui.enableApp(), t.sdk.uiState.set({ app: !0 })) : t.ui.disableApp();
1859
1898
  });
1860
1899
  return () => {
@@ -1863,7 +1902,7 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1863
1902
  }), r();
1864
1903
  }, xo = (t, e, r) => {
1865
1904
  const n = { onMountedFired: !1 }, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
1866
- t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.options = J(e), t.sdk.withAuth = !1, t.sdk.onMount = ({ name: s, clear: a }, u) => {
1905
+ t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.options = Z(e), t.sdk.withAuth = !1, t.sdk.onMount = ({ name: s, clear: a }, u) => {
1867
1906
  if (i.has(s)) {
1868
1907
  const l = o.get(s);
1869
1908
  l && l(), i.delete(s), o.delete(s);
@@ -1876,15 +1915,15 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1876
1915
  }, t.sdk.initializeApp = async (s) => {
1877
1916
  if (t.contextConfig = s, t.stores.enabled.get() === "on")
1878
1917
  return { enabled: !0 };
1879
- t.storeSubscribe(), t.stores.enabled.setValue("on"), t.stores.status.setValue(ge.INITIALIZATION);
1918
+ t.storeSubscribe(), t.stores.enabled.setValue("on"), t.stores.status.setValue(be.INITIALIZATION);
1880
1919
  try {
1881
1920
  const a = await t.stores.organizationSettings.getValue();
1882
- return a ? (t.stores.status.setValue(ge.READY), { enabled: !!a }) : (t.stores.status.setValue(ge.FAILED), { err: "failed" });
1921
+ return a ? (t.stores.status.setValue(be.READY), { enabled: !!a }) : (t.stores.status.setValue(be.FAILED), { err: "failed" });
1883
1922
  } catch (a) {
1884
- return t.stores.enabled.setValue(), t.stores.status.setValue(ge.FAILED), { err: `${a}` };
1923
+ return t.stores.enabled.setValue(), t.stores.status.setValue(be.FAILED), { err: `${a}` };
1885
1924
  }
1886
1925
  }, t.sdk.disableApp = () => {
1887
- t.stores.enabled.get() === "on" && (t.stores.enabled.setValue(), t.stores.status.setValue(ge.DISABLED), t.stores.slStreamId.setValue(), t.stores.providerStreamId.setValue(), t.sdk.closeFeature(!0), t.storeUnsubscribe(), t.transport.disconnect());
1926
+ t.stores.enabled.get() === "on" && (t.stores.enabled.setValue(), t.stores.status.setValue(be.DISABLED), t.stores.slStreamId.setValue(), t.stores.providerStreamId.setValue(), t.sdk.closeFeature(!0), t.storeUnsubscribe(), t.transport.disconnect());
1888
1927
  }, t.sdk.createEventSession = (s) => {
1889
1928
  t.stores.providerStreamId.setValue(s);
1890
1929
  }, r();
@@ -1918,10 +1957,10 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1918
1957
  r.append(n, i);
1919
1958
  return r.toString();
1920
1959
  }, Ko = (t, e, r, n) => {
1921
- const i = J({});
1960
+ const i = Z({});
1922
1961
  return Sr(i, () => Qo(t, [e, r]).subscribe(async ({ data: a, loading: u }) => {
1923
1962
  const l = a === void 0 && u === !1 ? "https://streamlayer.io" : a?.url, c = n.get() || "", f = e.get() || "", p = r.get() || "", v = {
1924
- [Nt]: c,
1963
+ [Ft]: c,
1925
1964
  [Bn]: f,
1926
1965
  [qn]: p
1927
1966
  };
@@ -1947,10 +1986,10 @@ const Xe = new Ue(), Bo = (t, e, r) => {
1947
1986
  i.setKey("loading", !0);
1948
1987
  })), { $store: i, fetch };
1949
1988
  };
1950
- var M;
1989
+ var B;
1951
1990
  (function(t) {
1952
1991
  t.Unset = "unset", t.Required = "required", t.Optional = "optional", t.Completed = "completed", t.Disabled = "disabled", t.Unavailable = "unavailable";
1953
- })(M || (M = {}));
1992
+ })(B || (B = {}));
1954
1993
  const zo = (t, e, r, n) => {
1955
1994
  const { inplayGame: i } = t.featureSettings.get(), o = e.getCurrentSessionId({ prefix: "onboarding" });
1956
1995
  i && r.add({
@@ -1964,7 +2003,7 @@ const zo = (t, e, r, n) => {
1964
2003
  autoHideDuration: 1e6,
1965
2004
  data: {
1966
2005
  questionId: "onboarding",
1967
- questionType: _.UNSET,
2006
+ questionType: I.UNSET,
1968
2007
  onboarding: {
1969
2008
  ...i,
1970
2009
  instantOpen: !n.getOnboardingInstantOpen({
@@ -1984,8 +2023,8 @@ const zo = (t, e, r, n) => {
1984
2023
  userId: s,
1985
2024
  organizationId: e.organizationId.get() || "",
1986
2025
  eventId: e.slStreamId.get() || ""
1987
- }) === M.Completed) {
1988
- t.set(M.Completed);
2026
+ }) === B.Completed) {
2027
+ t.set(B.Completed);
1989
2028
  for (const p of o)
1990
2029
  p();
1991
2030
  return;
@@ -1994,22 +2033,22 @@ const zo = (t, e, r, n) => {
1994
2033
  if (u === void 0 || l === void 0)
1995
2034
  return;
1996
2035
  const c = u?.options?.onboardingEnabled, f = l?.titleCard?.optIn;
1997
- c ? f ? t.set(M.Required) : t.set(M.Optional) : (f ? t.set(M.Unavailable) : t.set(M.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), { markAsViewed: !1 }));
2036
+ c ? f ? t.set(B.Required) : t.set(B.Optional) : (f ? t.set(B.Unavailable) : t.set(B.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), { markAsViewed: !1 }));
1998
2037
  } catch (s) {
1999
2038
  console.error(s);
2000
2039
  }
2001
2040
  }, Ho = (t, e, r, n) => {
2002
2041
  let i = !1;
2003
- const o = new Mn(), s = q(M.Unset);
2042
+ const o = new Mn(), s = q(B.Unset);
2004
2043
  s.subscribe((l) => {
2005
- l !== M.Unset && (l === M.Optional || l === M.Required ? i === !1 && (zo(t, e, n, o), i = !0) : t.onboardingProcessed.set(!0), l === M.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
2044
+ l !== B.Unset && (l === B.Optional || l === B.Required ? i === !1 && (zo(t, e, n, o), i = !0) : t.onboardingProcessed.set(!0), l === B.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
2006
2045
  userId: e.userId.get() || "",
2007
2046
  organizationId: e.organizationId.get() || "",
2008
2047
  eventId: e.slStreamId.get() || ""
2009
2048
  }));
2010
2049
  });
2011
2050
  const a = [];
2012
- return pt(s, e, t, n, o, a), s.get() !== M.Completed && (a.push(e.userId.listen((l) => {
2051
+ return pt(s, e, t, n, o, a), s.get() !== B.Completed && (a.push(e.userId.listen((l) => {
2013
2052
  l && pt(s, e, t, n, o, a);
2014
2053
  })), a.push(e.moderation.listen((l) => {
2015
2054
  l.data && pt(s, e, t, n, o, a);
@@ -2018,11 +2057,11 @@ const zo = (t, e, r, n) => {
2018
2057
  }))), { $store: s, submitInplay: async () => {
2019
2058
  const l = e.slStreamId.get();
2020
2059
  if (l) {
2021
- await Lo(r, l), s.set(M.Completed), o.saveOnboardingStatus({
2060
+ await Lo(r, l), s.set(B.Completed), o.saveOnboardingStatus({
2022
2061
  organizationId: e.organizationId.get() || "",
2023
2062
  userId: e.userId.get() || "",
2024
2063
  eventId: l
2025
- }, M.Completed), B.emit("poll", {
2064
+ }, B.Completed), M.emit("poll", {
2026
2065
  action: "onboardingPassed",
2027
2066
  payload: {}
2028
2067
  }), t.openFeature();
@@ -2031,7 +2070,7 @@ const zo = (t, e, r, n) => {
2031
2070
  }
2032
2071
  } };
2033
2072
  }, Wo = (t, e, r, n) => {
2034
- const i = J(void 0), o = Vn(n), s = async () => {
2073
+ const i = Z(void 0), o = Rn(n), s = async () => {
2035
2074
  const u = t.get(), l = e.get(), c = r.getStore().get().data?.map((v) => v.slId);
2036
2075
  if (!c)
2037
2076
  return;
@@ -2051,18 +2090,20 @@ const zo = (t, e, r, n) => {
2051
2090
  };
2052
2091
  }), { $store: i, invalidate: a };
2053
2092
  }, Yo = async (t, e, r, n, i) => {
2054
- const o = Vn(i), s = t.get(), a = e.get(), u = r.getStore().get().data?.map((p) => p.slId) || [], l = {
2093
+ const o = Rn(i), s = t.get(), a = e.get(), u = r.getStore().get().data?.map((p) => p.slId) || [], l = {
2055
2094
  eventId: s,
2056
2095
  userId: n,
2057
2096
  usersIds: [...u, a]
2058
2097
  };
2059
2098
  return (await o(l)).data?.attributes?.summary;
2060
- }, Jo = /* @__PURE__ */ new Set([_.POLL, _.PREDICTION, _.TRIVIA]);
2099
+ }, Jo = /* @__PURE__ */ new Set([I.POLL, I.PREDICTION, I.TRIVIA]);
2061
2100
  class Xo extends Fn {
2062
2101
  /** user statistics (leaderboard panel) */
2063
2102
  userSummary;
2064
2103
  /** feed list (pick history) */
2065
2104
  feedList;
2105
+ /** list (pack) of predefined questions */
2106
+ betPack;
2066
2107
  /** friends list */
2067
2108
  friends;
2068
2109
  /** pinned leaderboard id */
@@ -2096,10 +2137,10 @@ class Xo extends Fn {
2096
2137
  cancels = /* @__PURE__ */ new Set();
2097
2138
  onQuestionActivate;
2098
2139
  constructor(e, r, n) {
2099
- super(e, r), this.background = new Ao(n), this.advertisement = this.background.advertisement, this.onQuestionActivate = n.onQuestionActivate, this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = new Mn(), this.feedList = this.background.feedList, this.friends = new le(ao(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = q(void 0), this.onboardingProcessed = q(!n.sdk.withAuth), this.leaderboardId = new ee(q(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = Ho(this, this.background, n.transport, n.notifications), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = (i = !0) => n.sdk.closeFeature(i), this.openFeature = () => n.sdk.openFeature(R.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = Ko(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = Wo(this.background.slStreamId, this.background.userId, this.friends, this.transport), this.leaderboardList = Po(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.cancels.add(this.userSummary.$store.listen((i, o) => {
2140
+ super(e, r), this.background = new Ao(n), this.advertisement = this.background.advertisement, this.onQuestionActivate = n.onQuestionActivate, this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = new Mn(), this.feedList = this.background.feedList, this.betPack = this.background.betPack, this.friends = new se(ao(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = q(void 0), this.onboardingProcessed = q(!n.sdk.withAuth), this.leaderboardId = new re(q(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = Ho(this, this.background, n.transport, n.notifications), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = (i = !0) => n.sdk.closeFeature(i), this.openFeature = () => n.sdk.openFeature(R.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = Ko(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = Wo(this.background.slStreamId, this.background.userId, this.friends, this.transport), this.leaderboardList = ko(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.cancels.add(this.userSummary.$store.listen((i, o) => {
2100
2141
  o?.summary && i?.summary && this.leaderboardList.invalidate();
2101
2142
  })), this.cancels.add(this.onboardingStatus.$store.listen(this.checkInteractiveFlag)), this.cancels.add(this.background.moderation.getStore().listen(this.checkInteractiveFlag)), this.cancels.add(this.settings.subscribe(this.checkInteractiveFlag)), this.cancels.add(this.onboardingStatus.$store.listen((i, o) => {
2102
- (o === void 0 || i !== M.Unset) && this.background.activeQuestionId.invalidate();
2143
+ (o === void 0 || i !== B.Unset) && this.background.activeQuestionId.invalidate();
2103
2144
  })), this.background.activeQuestionId.listen(this.showInApp), this.friendsTabEnabled = q(!1), this.cancels.add(n.sdk.options.subscribe((i) => {
2104
2145
  i.friendsTab === "disabled" ? this.friendsTabEnabled.set(!1) : i.friendsTab === "enabled" && this.friendsTabEnabled.set(!0);
2105
2146
  })), this.cancels.add(this.settings.subscribe((i) => {
@@ -2113,7 +2154,7 @@ class Xo extends Fn {
2113
2154
  return this.background.interactiveAllowed.get() === Ce.ALLOWED;
2114
2155
  }
2115
2156
  checkInteractiveFlag = () => {
2116
- const e = this.onboardingStatus.$store.get(), r = this.background.moderation.getStore().value?.data?.options?.onboardingEnabled, n = this.settings.getValues().inplayGame?.titleCard?.optIn, i = e === M.Completed, o = !r || i || n !== !0;
2157
+ const e = this.onboardingStatus.$store.get(), r = this.background.moderation.getStore().value?.data?.options?.onboardingEnabled, n = this.settings.getValues().inplayGame?.titleCard?.optIn, i = e === B.Completed, o = !r || i || n !== !0;
2117
2158
  this.background.interactiveAllowed.set(o ? Ce.ALLOWED : Ce.DISALLOWED);
2118
2159
  };
2119
2160
  connect = () => {
@@ -2126,19 +2167,19 @@ class Xo extends Fn {
2126
2167
  if (!r || !n?.attributes)
2127
2168
  return;
2128
2169
  const { status: i, type: o, id: s, answers: a } = r;
2129
- if (i === Z.RESOLVED && o === _.PREDICTION) {
2170
+ if (i === Y.RESOLVED && o === I.PREDICTION) {
2130
2171
  const u = this.background.getCurrentSessionId({
2131
2172
  prefix: `notification-id:${s}`
2132
- }), l = [...this.feedList.getValues().data || []], c = l.findIndex((K) => K.id === s), f = l[c];
2173
+ }), l = [...this.feedList.getValues().data || []], c = l.findIndex((z) => z.id === s), f = l[c];
2133
2174
  let p = f?.attributes?.attributes?.value?.answerId;
2134
- const v = ur(s, this.transport), w = v.subscribe(() => {
2175
+ const v = wt(s, this.transport), w = v.subscribe(() => {
2135
2176
  });
2136
2177
  await v.get().promise;
2137
2178
  let b = v.get().data;
2138
- b || (b = await ho(s, this.transport)), w(), window.requestAnimationFrame(() => {
2179
+ b || (b = await Vn(s, this.transport)), w(), window.requestAnimationFrame(() => {
2139
2180
  v.invalidate();
2140
- }), p || (p = b?.answers.find(({ youVoted: K }) => K)?.id);
2141
- const g = a.find(({ correct: K }) => K), S = p ? a.find(({ id: K }) => K === p) : void 0, F = !!S?.correct;
2181
+ }), p || (p = b?.answers.find(({ youVoted: z }) => z)?.id);
2182
+ const g = a.find(({ correct: z }) => z), S = p ? a.find(({ id: z }) => z === p) : void 0, F = !!S?.correct;
2142
2183
  if (f && l[c]?.attributes?.attributes.case === "question") {
2143
2184
  try {
2144
2185
  l[c].attributes.attributes.value.answerId = p, l[c].attributes.attributes.value.openForVoting = !1, p && (l[c].attributes.attributes.value.status = F ? lt.WON : lt.LOST);
@@ -2157,7 +2198,7 @@ class Xo extends Fn {
2157
2198
  emitEvent: !1,
2158
2199
  data: {
2159
2200
  questionId: s,
2160
- questionType: _.PREDICTION,
2201
+ questionType: I.PREDICTION,
2161
2202
  question: {
2162
2203
  title: F ? `Congratulations! You answered correctly! You won ${g.points} pts!` : `Better luck next time! Correct: ${g?.text}!`,
2163
2204
  votedAnswer: {
@@ -2166,7 +2207,7 @@ class Xo extends Fn {
2166
2207
  },
2167
2208
  correctAnswerTitle: g?.text,
2168
2209
  correct: !!F,
2169
- predictionResult: i === Z.RESOLVED,
2210
+ predictionResult: i === Y.RESOLVED,
2170
2211
  questionTitle: r?.subject
2171
2212
  }
2172
2213
  }
@@ -2174,7 +2215,7 @@ class Xo extends Fn {
2174
2215
  }
2175
2216
  })), this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list", (e) => {
2176
2217
  const r = [...this.feedList.getStore().value?.data || []], n = e.data?.attributes?.feedItem, i = r.findIndex((o) => o.id === n?.id);
2177
- if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !== Z.ACTIVE && n.attributes.status !== Z.RESOLVED)) {
2218
+ if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !== Y.ACTIVE && n.attributes.status !== Y.RESOLVED)) {
2178
2219
  if (i !== -1)
2179
2220
  if (n.attributes.attributes.case === "question" && r[i].attributes?.attributes.case === "question") {
2180
2221
  const o = r[i];
@@ -2220,7 +2261,7 @@ class Xo extends Fn {
2220
2261
  }
2221
2262
  });
2222
2263
  }
2223
- i === -1 && (r.unshift(n), B.emit("poll", {
2264
+ i === -1 && (r.unshift(n), M.emit("poll", {
2224
2265
  action: "received",
2225
2266
  payload: {
2226
2267
  questionId: n.id,
@@ -2234,15 +2275,32 @@ class Xo extends Fn {
2234
2275
  disconnect = () => {
2235
2276
  this.background.feedSubscription.removeListener("feed-subscription-prediction-close"), this.background.feedSubscription.removeListener("feed-subscription-questions-list");
2236
2277
  };
2278
+ betPackVote = async (e, r) => {
2279
+ await this.submitAnswer(e, r);
2280
+ const n = { ...this.betPack.getValues().data }, i = n?.[e];
2281
+ i && (i.answers = n[e].answers.map((o) => o.id === r ? {
2282
+ ...o,
2283
+ youVoted: !0
2284
+ } : o), M.emit("poll", {
2285
+ action: "voted",
2286
+ payload: {
2287
+ questionId: e,
2288
+ questionType: i.type
2289
+ }
2290
+ }), this.betPack.getStore().mutate({
2291
+ ...n,
2292
+ [e]: i
2293
+ }));
2294
+ };
2237
2295
  submitAnswer = async (e, r) => {
2238
- const n = ur(e, this.transport), i = n.subscribe(() => {
2296
+ const n = wt(e, this.transport), i = n.subscribe(() => {
2239
2297
  }), o = { ...n.get().data || {} }, s = () => {
2240
2298
  const a = this.feedList.getValues().data;
2241
2299
  if (!a)
2242
2300
  return;
2243
2301
  const u = a.findIndex((f) => f.id === e), l = a[u], c = l?.attributes?.attributes.case === "question" && l.attributes.attributes.value;
2244
2302
  if (c) {
2245
- B.emit("poll", {
2303
+ M.emit("poll", {
2246
2304
  action: "voted",
2247
2305
  payload: {
2248
2306
  questionId: e,
@@ -2254,7 +2312,7 @@ class Xo extends Fn {
2254
2312
  const p = f.answers.find((g) => g.correct === !0), v = f.answers.findIndex((g) => g.id === r), w = f.answers[v], b = f.answers.every(({ percentageDecimal: g }, S) => g === o?.answers[S].percentageDecimal);
2255
2313
  a[u].attributes.attributes.value.answerId = r, a[u].attributes.attributes.value.openForVoting = !1, a[u].attributes.attributes.value.text = w?.text || "", p && (a[u].attributes.attributes.value.status = p.id === r ? lt.WON : lt.LOST), this.feedList.getStore().mutate([...a]), f.answers[v].correct = p?.id === r, f.answers[v].youVoted = !0, b && f.answers.forEach((g) => {
2256
2314
  g.percentageDecimal = 0;
2257
- }), p?.id === r && (f.answers[v].pointsEarned = f.status === Z.RESOLVED ? 0 : p.points), n.mutate({ ...f });
2315
+ }), p?.id === r && (f.answers[v].pointsEarned = f.status === Y.RESOLVED ? 0 : p.points), n.mutate({ ...f });
2258
2316
  }
2259
2317
  this.submitAnswerTimeout && clearTimeout(this.submitAnswerTimeout), this.submitAnswerTimeout = setTimeout(() => {
2260
2318
  this.userSummary.invalidate();
@@ -2284,7 +2342,7 @@ class Xo extends Fn {
2284
2342
  animateHiding: !1
2285
2343
  });
2286
2344
  let n = r?.attributes?.type;
2287
- return n || (n = (this.feedList.getStore().value?.data || []).find((o) => o.id === e)?.attributes?.type), B.emit("poll", {
2345
+ return n || (n = (this.feedList.getStore().value?.data || []).find((o) => o.id === e)?.attributes?.type), M.emit("poll", {
2288
2346
  action: "opened",
2289
2347
  payload: {
2290
2348
  questionId: e,
@@ -2333,7 +2391,7 @@ class Xo extends Fn {
2333
2391
  */
2334
2392
  showInApp = (e) => {
2335
2393
  const r = this.onboardingStatus.$store.get();
2336
- if (e && e.data && r && r !== M.Unset && e.data.question?.id !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== Ai.ON && e.data.question.status === Z.ACTIVE && !e.data.question.marketClosed) {
2394
+ if (e && e.data && r && r !== B.Unset && e.data.question?.id !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== Ai.ON && e.data.question.status === Y.ACTIVE && !e.data.question.marketClosed) {
2337
2395
  if (Jo.has(e.data.question.type))
2338
2396
  this.isInteractiveAllowed && e.data.question.notification !== void 0 && this.notifications.add({
2339
2397
  type: Ee.QUESTION,
@@ -2358,7 +2416,7 @@ class Xo extends Fn {
2358
2416
  }
2359
2417
  }
2360
2418
  });
2361
- else if (e.data.question.type === _.FACTOID) {
2419
+ else if (e.data.question.type === I.FACTOID) {
2362
2420
  const n = e.data.question.options?.options.value, i = e.data.question.notification?.title || e.data.question.subject || "", o = e.data.question.notification?.body || n.body, s = {
2363
2421
  heading: i,
2364
2422
  body: o,
@@ -2393,7 +2451,7 @@ class Xo extends Fn {
2393
2451
  }
2394
2452
  }
2395
2453
  });
2396
- } else if (e.data.question.type === _.TWEET && e.data.question.notification !== void 0) {
2454
+ } else if (e.data.question.type === I.TWEET && e.data.question.notification !== void 0) {
2397
2455
  const n = e.data.question.options?.options.value, i = {
2398
2456
  image: "",
2399
2457
  video: ""
@@ -2446,7 +2504,7 @@ class es extends Fn {
2446
2504
  }
2447
2505
  }
2448
2506
  const ts = (t, e, r) => t.type === R.GAMES ? new Xo(t, e, r) : new es(t, e), rs = (t, e, r) => {
2449
- t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new ee(q(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new ee(q(R.UNSET), "activeFeature"), t.sdk.getFeatures = () => t.features, t.sdk.getFeature = (n) => t.features.get(n), t.sdk.getActiveFeature = () => t.activeFeature.getStore(), t.sdk.openFeature = (n) => {
2507
+ t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new re(q(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new re(q(R.UNSET), "activeFeature"), t.sdk.getFeatures = () => t.features, t.sdk.getFeature = (n) => t.features.get(n), t.sdk.getActiveFeature = () => t.activeFeature.getStore(), t.sdk.openFeature = (n) => {
2450
2508
  t.activeFeature.setValue(n);
2451
2509
  }, t.sdk.closeFeature = (n = !1) => {
2452
2510
  const i = t.activeFeature.getValue();
@@ -2455,7 +2513,7 @@ const ts = (t, e, r) => t.type === R.GAMES ? new Xo(t, e, r) : new es(t, e), rs
2455
2513
  const o = t.sdk.featuresList.getValue();
2456
2514
  o && o.delete(i), t.sdk.featuresList.setValue(o);
2457
2515
  }
2458
- }, t.initFeature = (n, i = me.ORGANIZATION) => {
2516
+ }, t.initFeature = (n, i = ge.ORGANIZATION) => {
2459
2517
  if (n.type in Zo && !t.features.has(n.type)) {
2460
2518
  const o = ts(n, i, t);
2461
2519
  t.features.set(n.type, o);
@@ -2472,12 +2530,12 @@ const ts = (t, e, r) => t.type === R.GAMES ? new Xo(t, e, r) : new es(t, e), rs
2472
2530
  const n = await t.stores.organizationSettings.getValue();
2473
2531
  t.features.clear(), t.sdk.featuresList.setValue(/* @__PURE__ */ new Set());
2474
2532
  for (const i of n?.overlays || [])
2475
- t.initFeature(i, me.ORGANIZATION);
2533
+ t.initFeature(i, ge.ORGANIZATION);
2476
2534
  }, t.stores.providerStreamId.listen((n) => {
2477
2535
  n || t.reinitializeFeatures();
2478
2536
  }), t.storeSubscribe = () => {
2479
2537
  const n = (o, s) => {
2480
- if (s?.overlays && !(t.contextConfig?.skipOrganizationSettings && o === me.ORGANIZATION))
2538
+ if (s?.overlays && !(t.contextConfig?.skipOrganizationSettings && o === ge.ORGANIZATION))
2481
2539
  for (const a of s.overlays)
2482
2540
  a.sdkEnable === !0 && (t.features.has(a.type) ? t.updateFeature(a, o) : t.initFeature(a, o));
2483
2541
  }, i = {
@@ -2493,7 +2551,7 @@ const ts = (t, e, r) => t.type === R.GAMES ? new Xo(t, e, r) : new es(t, e), rs
2493
2551
  organizationSettings: (o) => {
2494
2552
  if (o.data)
2495
2553
  try {
2496
- n(me.ORGANIZATION, o.data);
2554
+ n(ge.ORGANIZATION, o.data);
2497
2555
  } catch (s) {
2498
2556
  console.log(s);
2499
2557
  }
@@ -2501,7 +2559,7 @@ const ts = (t, e, r) => t.type === R.GAMES ? new Xo(t, e, r) : new es(t, e), rs
2501
2559
  streamSettings: (o) => {
2502
2560
  if (o.data)
2503
2561
  try {
2504
- n(me.STREAM, o.data);
2562
+ n(ge.STREAM, o.data);
2505
2563
  } catch (s) {
2506
2564
  console.log(s);
2507
2565
  }
@@ -2522,14 +2580,14 @@ class ns {
2522
2580
  break;
2523
2581
  }
2524
2582
  };
2525
- return B.listen(r);
2583
+ return M.listen(r);
2526
2584
  });
2527
2585
  }
2528
2586
  accepted = () => {
2529
2587
  this.analytics.write("invitation", {
2530
2588
  common: {
2531
2589
  ...this.analytics.commonStore.getValues(),
2532
- kind: Q.INVITATION_ACCEPTED
2590
+ kind: G.INVITATION_ACCEPTED
2533
2591
  },
2534
2592
  category: Mr.GAMES,
2535
2593
  from: Br.UNSET
@@ -2539,7 +2597,7 @@ class ns {
2539
2597
  this.analytics.write("invitation", {
2540
2598
  common: {
2541
2599
  ...this.analytics.commonStore.getValues(),
2542
- kind: Q.INVITATION_SENT
2600
+ kind: G.INVITATION_SENT
2543
2601
  },
2544
2602
  category: Mr.GAMES,
2545
2603
  from: e || Br.UNSET
@@ -2561,14 +2619,14 @@ class is {
2561
2619
  break;
2562
2620
  }
2563
2621
  };
2564
- return B.listen(r);
2622
+ return M.listen(r);
2565
2623
  });
2566
2624
  }
2567
2625
  tap = () => {
2568
2626
  this.analytics.write("interactions", {
2569
2627
  common: {
2570
2628
  ...this.analytics.commonStore.getValues(),
2571
- kind: Q.INTERACTIONS
2629
+ kind: G.INTERACTIONS
2572
2630
  },
2573
2631
  actionType: Kr.TAP
2574
2632
  });
@@ -2577,21 +2635,26 @@ class is {
2577
2635
  this.analytics.write("interactions", {
2578
2636
  common: {
2579
2637
  ...this.analytics.commonStore.getValues(),
2580
- kind: Q.INTERACTIONS
2638
+ kind: G.INTERACTIONS
2581
2639
  },
2582
2640
  actionType: Kr.SCROLL
2583
2641
  });
2584
2642
  };
2585
2643
  }
2586
2644
  const os = {
2587
- [W.UNSET]: Ae.UNSET,
2588
- [W.INGAME_IAB21]: Ae.PROMOTION_INGAME_IAB21,
2589
- [W.INGAME_IAB11_LBAR]: Ae.PROMOTION_INGAME_IAB11_LBAR,
2590
- [W.INGAME_IAB11]: Ae.PROMOTION_INGAME_IAB11,
2591
- [W.INGAME_IAB21_LBAR]: Ae.PROMOTION_INGAME_IAB21_LBAR,
2592
- [W.INGAME_IAB61]: Ae.PROMOTION_INGAME_IAB61,
2593
- [W.EXTERNAL_AD]: Ae.PROMOTION_GAM
2594
- }, cr = (t) => t ? os[t] : Ae.UNSET;
2645
+ [U.UNSET]: J.UNSET,
2646
+ [U.INGAME_IAB21]: J.PROMOTION_INGAME_IAB21,
2647
+ [U.INGAME_IAB11_LBAR]: J.PROMOTION_INGAME_IAB11_LBAR,
2648
+ [U.INGAME_IAB11]: J.PROMOTION_INGAME_IAB11,
2649
+ [U.INGAME_IAB21_LBAR]: J.PROMOTION_INGAME_IAB21_LBAR,
2650
+ [U.INGAME_IAB61]: J.PROMOTION_INGAME_IAB61,
2651
+ [U.EXTERNAL_AD]: J.PROMOTION_GAM,
2652
+ [U.VIDEO_SIDE_BY_SIDE]: J.PROMOTION_VIDEO_SIDE_BY_SIDE,
2653
+ [U.PICTURE_IN_PICTURE]: J.PROMOTION_PICTURE_IN_PICTURE,
2654
+ [U.SHOP_LBAR]: J.PROMOTION_SHOP_LBAR,
2655
+ [U.SHOP_OVERLAY]: J.PROMOTION_SHOP_OVERLAY,
2656
+ [U.SHOP_SIDEBAR]: J.PROMOTION_SHOP_SIDEBAR
2657
+ }, cr = (t) => t ? os[t] : J.UNSET;
2595
2658
  class ss {
2596
2659
  analytics;
2597
2660
  constructor(e) {
@@ -2621,43 +2684,43 @@ class ss {
2621
2684
  }
2622
2685
  }
2623
2686
  };
2624
- return B.listen(r);
2687
+ return M.listen(r);
2625
2688
  });
2626
2689
  }
2627
2690
  received = ({ id: e }, { topicSubType: r }) => {
2628
2691
  this.analytics.write("games", {
2629
2692
  common: {
2630
2693
  ...this.analytics.commonStore.getValues(),
2631
- kind: Q.POLLS_RECEIVED,
2694
+ kind: G.POLLS_RECEIVED,
2632
2695
  topicId: e,
2633
- topicType: x.POLLS_PROMOTION,
2696
+ topicType: Q.POLLS_PROMOTION,
2634
2697
  topicSubType: r
2635
2698
  },
2636
- pollOpenedFrom: Y.UNSET
2699
+ pollOpenedFrom: X.UNSET
2637
2700
  });
2638
2701
  };
2639
2702
  opened = ({ id: e, openedFrom: r }, { topicSubType: n }) => {
2640
2703
  this.analytics.write("games", {
2641
2704
  common: {
2642
2705
  ...this.analytics.commonStore.getValues(),
2643
- kind: Q.POLLS_OPENED,
2706
+ kind: G.POLLS_OPENED,
2644
2707
  topicId: e,
2645
- topicType: x.POLLS_PROMOTION,
2708
+ topicType: Q.POLLS_PROMOTION,
2646
2709
  topicSubType: n
2647
2710
  },
2648
- pollOpenedFrom: r === "notification" ? Y.IN_APP : Y.UNSET
2711
+ pollOpenedFrom: r === "notification" ? X.IN_APP : X.UNSET
2649
2712
  });
2650
2713
  };
2651
2714
  viewed = ({ id: e }, { topicSubType: r }) => {
2652
2715
  this.analytics.write("games", {
2653
2716
  common: {
2654
2717
  ...this.analytics.commonStore.getValues(),
2655
- kind: Q.POLLS_OPENED,
2718
+ kind: G.POLLS_OPENED,
2656
2719
  topicId: e,
2657
- topicType: x.POLLS_PROMOTION,
2720
+ topicType: Q.POLLS_PROMOTION,
2658
2721
  topicSubType: r
2659
2722
  },
2660
- pollOpenedFrom: Y.UNSET
2723
+ pollOpenedFrom: X.UNSET
2661
2724
  });
2662
2725
  };
2663
2726
  videoPlay = ({ id: e }, { topicSubType: r }) => {
@@ -2665,11 +2728,11 @@ class ss {
2665
2728
  common: {
2666
2729
  ...this.analytics.commonStore.getValues(),
2667
2730
  topicId: e,
2668
- kind: Q.AD_VIDEO_PLAYED,
2669
- topicType: x.POLLS_PROMOTION,
2731
+ kind: G.AD_VIDEO_PLAYED,
2732
+ topicType: Q.POLLS_PROMOTION,
2670
2733
  topicSubType: r
2671
2734
  },
2672
- pollOpenedFrom: Y.UNSET
2735
+ pollOpenedFrom: X.UNSET
2673
2736
  });
2674
2737
  };
2675
2738
  buttonSelect = ({ id: e }, { topicSubType: r }) => {
@@ -2677,11 +2740,11 @@ class ss {
2677
2740
  common: {
2678
2741
  ...this.analytics.commonStore.getValues(),
2679
2742
  topicId: e,
2680
- kind: Q.AD_BUTTON_NAVIGATED,
2681
- topicType: x.POLLS_PROMOTION,
2743
+ kind: G.AD_BUTTON_NAVIGATED,
2744
+ topicType: Q.POLLS_PROMOTION,
2682
2745
  topicSubType: r
2683
2746
  },
2684
- pollOpenedFrom: Y.UNSET
2747
+ pollOpenedFrom: X.UNSET
2685
2748
  });
2686
2749
  };
2687
2750
  bannerSelect = ({ id: e }, { topicSubType: r }) => {
@@ -2689,43 +2752,43 @@ class ss {
2689
2752
  common: {
2690
2753
  ...this.analytics.commonStore.getValues(),
2691
2754
  topicId: e,
2692
- kind: Q.AD_BANNER_NAVIGATED,
2693
- topicType: x.POLLS_PROMOTION,
2755
+ kind: G.AD_BANNER_NAVIGATED,
2756
+ topicType: Q.POLLS_PROMOTION,
2694
2757
  topicSubType: r
2695
2758
  },
2696
- pollOpenedFrom: Y.UNSET
2759
+ pollOpenedFrom: X.UNSET
2697
2760
  });
2698
2761
  };
2699
2762
  }
2700
2763
  const et = {
2701
- [_.UNSET]: x.UNSET,
2702
- [_.FACTOID]: x.POLLS_INSIGHT,
2703
- [_.POLL]: x.POLLS_POLL,
2704
- [_.PREDICTION]: x.POLLS_PREDICTION,
2705
- [_.PROMOTION]: x.POLLS_PROMOTION,
2706
- [_.TRIVIA]: x.POLLS_TRIVIA,
2707
- [_.TWEET]: x.POLLS_TWITTER
2764
+ [I.UNSET]: Q.UNSET,
2765
+ [I.FACTOID]: Q.POLLS_INSIGHT,
2766
+ [I.POLL]: Q.POLLS_POLL,
2767
+ [I.PREDICTION]: Q.POLLS_PREDICTION,
2768
+ [I.PROMOTION]: Q.POLLS_PROMOTION,
2769
+ [I.TRIVIA]: Q.POLLS_TRIVIA,
2770
+ [I.TWEET]: Q.POLLS_TWITTER
2708
2771
  };
2709
- _.UNSET + "", he.UNSET, _.FACTOID + "", he.POLLS, _.POLL + "", he.POLLS, _.PREDICTION + "", he.POLLS, _.PROMOTION + "", he.POLLS, _.TRIVIA + "", he.POLLS, _.TWEET + "", he.POLLS;
2772
+ I.UNSET + "", ye.UNSET, I.FACTOID + "", ye.POLLS, I.POLL + "", ye.POLLS, I.PREDICTION + "", ye.POLLS, I.PROMOTION + "", ye.POLLS, I.TRIVIA + "", ye.POLLS, I.TWEET + "", ye.POLLS;
2710
2773
  const as = {
2711
- [R.UNSET]: z.UNSET,
2712
- [R.INPLAY]: z.INPLAY,
2713
- [R.MESSAGING]: z.MESSAGING,
2714
- [R.STATISTICS]: z.STATS,
2715
- [R.BETTING]: z.BETTING,
2716
- [R.TWITTER]: z.TWITTER,
2717
- [R.MERCHANDISE]: z.MERCHANDISE,
2718
- [R.CONTESTS]: z.CONTESTS,
2719
- [R.VOICE_CHAT]: z.CALLING,
2720
- [R.TICKETS]: z.TICKETS,
2721
- [R.WHOIS_WATCHING]: z.WHOISWATCHING,
2722
- [R.PROFILE]: z.PROFILE,
2723
- [R.GAMES]: z.POLLS,
2774
+ [R.UNSET]: H.UNSET,
2775
+ [R.INPLAY]: H.INPLAY,
2776
+ [R.MESSAGING]: H.MESSAGING,
2777
+ [R.STATISTICS]: H.STATS,
2778
+ [R.BETTING]: H.BETTING,
2779
+ [R.TWITTER]: H.TWITTER,
2780
+ [R.MERCHANDISE]: H.MERCHANDISE,
2781
+ [R.CONTESTS]: H.CONTESTS,
2782
+ [R.VOICE_CHAT]: H.CALLING,
2783
+ [R.TICKETS]: H.TICKETS,
2784
+ [R.WHOIS_WATCHING]: H.WHOISWATCHING,
2785
+ [R.PROFILE]: H.PROFILE,
2786
+ [R.GAMES]: H.POLLS,
2724
2787
  // ??
2725
- [R.GOLF_STATISTICS]: z.STATS,
2788
+ [R.GOLF_STATISTICS]: H.STATS,
2726
2789
  // ??
2727
- [R.HIGHLIGHTS]: z.HIGHLIGHTS,
2728
- [R.PUBLIC_CHAT]: z.PUBLIC_CHAT
2790
+ [R.HIGHLIGHTS]: H.HIGHLIGHTS,
2791
+ [R.PUBLIC_CHAT]: H.PUBLIC_CHAT
2729
2792
  };
2730
2793
  class us {
2731
2794
  analytics;
@@ -2746,32 +2809,32 @@ class us {
2746
2809
  case "notification-received":
2747
2810
  this.received({
2748
2811
  questionId: n.slEventBus.payload.id,
2749
- questionType: _.PROMOTION,
2812
+ questionType: I.PROMOTION,
2750
2813
  topicSubType: cr(n.slEventBus.payload.type)
2751
2814
  });
2752
2815
  break;
2753
2816
  case "notification-opened":
2754
2817
  this.opened({
2755
2818
  questionId: n.slEventBus.payload.id,
2756
- questionType: _.PROMOTION,
2819
+ questionType: I.PROMOTION,
2757
2820
  topicSubType: cr(n.slEventBus.payload.type)
2758
2821
  });
2759
2822
  break;
2760
2823
  }
2761
2824
  };
2762
- return B.listen(r);
2825
+ return M.listen(r);
2763
2826
  });
2764
2827
  }
2765
2828
  received = ({ questionId: e, questionType: r, topicSubType: n }) => {
2766
2829
  this.analytics.write("notification", {
2767
2830
  common: {
2768
2831
  ...this.analytics.commonStore.getValues(),
2769
- kind: Q.NOTIFICATION_RECEIVED,
2832
+ kind: G.NOTIFICATION_RECEIVED,
2770
2833
  topicId: e,
2771
- topicType: r ? et[r] : x.UNSET,
2834
+ topicType: r ? et[r] : Q.UNSET,
2772
2835
  topicSubType: n
2773
2836
  },
2774
- notificationKind: he.POLLS,
2837
+ notificationKind: ye.POLLS,
2775
2838
  notificationType: zr.IN_APP
2776
2839
  });
2777
2840
  };
@@ -2779,12 +2842,12 @@ class us {
2779
2842
  this.analytics.write("notification", {
2780
2843
  common: {
2781
2844
  ...this.analytics.commonStore.getValues(),
2782
- kind: Q.NOTIFICATION_OPENED,
2845
+ kind: G.NOTIFICATION_OPENED,
2783
2846
  topicId: e,
2784
- topicType: r ? et[r] : x.UNSET,
2847
+ topicType: r ? et[r] : Q.UNSET,
2785
2848
  topicSubType: n
2786
2849
  },
2787
- notificationKind: he.POLLS,
2850
+ notificationKind: ye.POLLS,
2788
2851
  notificationType: zr.IN_APP
2789
2852
  });
2790
2853
  };
@@ -2813,7 +2876,7 @@ class cs {
2813
2876
  break;
2814
2877
  }
2815
2878
  };
2816
- return B.listen(r);
2879
+ return M.listen(r);
2817
2880
  });
2818
2881
  }
2819
2882
  // event when a poll is received from subscription or active question request
@@ -2821,11 +2884,11 @@ class cs {
2821
2884
  this.analytics.write("games", {
2822
2885
  common: {
2823
2886
  ...this.analytics.commonStore.getValues(),
2824
- kind: Q.POLLS_RECEIVED,
2887
+ kind: G.POLLS_RECEIVED,
2825
2888
  topicId: e,
2826
- topicType: r ? et[r] : x.UNSET
2889
+ topicType: r ? et[r] : Q.UNSET
2827
2890
  },
2828
- pollOpenedFrom: Y.UNSET
2891
+ pollOpenedFrom: X.UNSET
2829
2892
  });
2830
2893
  };
2831
2894
  // poll is opened from notification or list
@@ -2833,11 +2896,11 @@ class cs {
2833
2896
  this.analytics.write("games", {
2834
2897
  common: {
2835
2898
  ...this.analytics.commonStore.getValues(),
2836
- kind: Q.POLLS_OPENED,
2899
+ kind: G.POLLS_OPENED,
2837
2900
  topicId: e,
2838
- topicType: r ? et[r] : x.UNSET
2901
+ topicType: r ? et[r] : Q.UNSET
2839
2902
  },
2840
- pollOpenedFrom: n === "list" ? Y.PICK_HISTORY : Y.IN_APP
2903
+ pollOpenedFrom: n === "list" ? X.PICK_HISTORY : X.IN_APP
2841
2904
  });
2842
2905
  };
2843
2906
  // poll is voted
@@ -2845,11 +2908,11 @@ class cs {
2845
2908
  this.analytics.write("games", {
2846
2909
  common: {
2847
2910
  ...this.analytics.commonStore.getValues(),
2848
- kind: Q.POLLS_VOTE,
2911
+ kind: G.POLLS_VOTE,
2849
2912
  topicId: e,
2850
- topicType: r ? et[r] : x.UNSET
2913
+ topicType: r ? et[r] : Q.UNSET
2851
2914
  },
2852
- pollOpenedFrom: Y.UNSET
2915
+ pollOpenedFrom: X.UNSET
2853
2916
  });
2854
2917
  };
2855
2918
  // onboarding passed, user is now able to vote
@@ -2857,9 +2920,9 @@ class cs {
2857
2920
  this.analytics.write("games", {
2858
2921
  common: {
2859
2922
  ...this.analytics.commonStore.getValues(),
2860
- kind: Q.GAMES_JOINED
2923
+ kind: G.GAMES_JOINED
2861
2924
  },
2862
- pollOpenedFrom: Y.UNSET
2925
+ pollOpenedFrom: X.UNSET
2863
2926
  });
2864
2927
  };
2865
2928
  // user clicked on link in poll and navigated to another page
@@ -2867,9 +2930,9 @@ class cs {
2867
2930
  this.analytics.write("games", {
2868
2931
  common: {
2869
2932
  ...this.analytics.commonStore.getValues(),
2870
- kind: Q.POLLS_NAVIGATED
2933
+ kind: G.POLLS_NAVIGATED
2871
2934
  },
2872
- pollOpenedFrom: Y.UNSET
2935
+ pollOpenedFrom: X.UNSET
2873
2936
  });
2874
2937
  };
2875
2938
  }
@@ -2888,29 +2951,29 @@ const ls = ({ transport: t, $commonStore: e }) => {
2888
2951
  value: {
2889
2952
  common: {
2890
2953
  ...p,
2891
- kind: Q.SESSION_HEARTBEAT
2954
+ kind: G.SESSION_HEARTBEAT
2892
2955
  }
2893
2956
  }
2894
2957
  }
2895
2958
  });
2896
2959
  } catch (v) {
2897
- be.error(v, "send heartbeat failed");
2960
+ ve.error(v, "send heartbeat failed");
2898
2961
  }
2899
2962
  return Date.now();
2900
2963
  },
2901
2964
  refetchInterval: i
2902
2965
  }), u = () => {
2903
- be.debug("mounted heartbeat"), r = a.subscribe(() => {
2966
+ ve.debug("mounted heartbeat"), r = a.subscribe(() => {
2904
2967
  });
2905
2968
  }, l = () => {
2906
- be.debug("enabled heartbeat"), n.set(!0), a.lc === 0 && u();
2969
+ ve.debug("enabled heartbeat"), n.set(!0), a.lc === 0 && u();
2907
2970
  }, c = () => {
2908
- be.debug("disabled heartbeat"), n.set(!1);
2971
+ ve.debug("disabled heartbeat"), n.set(!1);
2909
2972
  };
2910
2973
  return { enable: l, disable: c, mount: u, unmount: () => {
2911
- be.debug("unmounted heartbeat"), a.off(), r?.(), r = void 0, c();
2974
+ ve.debug("unmounted heartbeat"), a.off(), r?.(), r = void 0, c();
2912
2975
  } };
2913
- }, be = de("analytics");
2976
+ }, ve = fe("analytics");
2914
2977
  class ds {
2915
2978
  commonStore;
2916
2979
  notifications;
@@ -2924,23 +2987,23 @@ class ds {
2924
2987
  listenersCancels;
2925
2988
  connected = !1;
2926
2989
  constructor(e) {
2927
- this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Le(J({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = ls({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new us(this), this.polls = new cs(this), this.invitation = new ns(this), this.interactions = new is(this), this.advertisement = new ss(this);
2990
+ this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Le(Z({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = ls({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new us(this), this.polls = new cs(this), this.invitation = new ns(this), this.interactions = new is(this), this.advertisement = new ss(this);
2928
2991
  const { client: r } = e.analyticsTransport.createPromiseClient(Ln, {
2929
2992
  method: "send"
2930
2993
  });
2931
2994
  this.analyticsClient = r;
2932
2995
  }
2933
2996
  connect = () => {
2934
- this.writeCommon("sessionId", ir()), this.heartbeat.enable(), this.listeners.forEach((e) => this.listenersCancels.add(e())), this.connected = !0, be.debug("analytics connected");
2997
+ this.writeCommon("sessionId", or()), this.heartbeat.enable(), this.listeners.forEach((e) => this.listenersCancels.add(e())), this.connected = !0, ve.debug("analytics connected");
2935
2998
  };
2936
2999
  disconnect = () => {
2937
- this.writeCommon("sessionId", ""), this.writeCommon("overlaySessionId", ""), this.heartbeat.unmount(), this.listenersCancels.forEach((e) => e()), this.connected = !1, be.debug("analytics disconnected");
3000
+ this.writeCommon("sessionId", ""), this.writeCommon("overlaySessionId", ""), this.heartbeat.unmount(), this.listenersCancels.forEach((e) => e()), this.connected = !1, ve.debug("analytics disconnected");
2938
3001
  };
2939
3002
  write = (e, r) => {
2940
3003
  r && this.analyticsClient.unary({ message: { case: e, value: r } }).then(() => {
2941
- be.trace("send analytics success", e, r);
3004
+ ve.trace("send analytics success", e, r);
2942
3005
  }).catch((n) => {
2943
- be.error(n, "send analytics failed");
3006
+ ve.error(n, "send analytics failed");
2944
3007
  });
2945
3008
  };
2946
3009
  writeCommon = (e, r) => {
@@ -2954,7 +3017,7 @@ class ds {
2954
3017
  this.onConnect(() => e.stores.slStreamId.getAtomStore().subscribe((r) => {
2955
3018
  this.writeCommon("eventId", r);
2956
3019
  })), this.onConnect(() => e.sdk.getActiveFeature().subscribe((r) => {
2957
- r && this.writeCommon("category", as[r]), r !== R.UNSET ? this.writeCommon("overlaySessionId", ir()) : this.writeCommon("overlaySessionId", "");
3020
+ r && this.writeCommon("category", as[r]), r !== R.UNSET ? this.writeCommon("overlaySessionId", or()) : this.writeCommon("overlaySessionId", "");
2958
3021
  })), this.onConnect(() => {
2959
3022
  const r = window.matchMedia("(orientation: portrait)"), n = (i) => {
2960
3023
  this.writeCommon("screenOrientation", i.matches ? Gr.PORTRAIT : Gr.LANDSCAPE);
@@ -2997,17 +3060,17 @@ function Un(t, e, r) {
2997
3060
  throw new Error("fastqueue concurrency must be equal to or greater than 1");
2998
3061
  var n = ms(gs), i = null, o = null, s = 0, a = null, u = {
2999
3062
  push: b,
3000
- drain: X,
3001
- saturated: X,
3063
+ drain: te,
3064
+ saturated: te,
3002
3065
  pause: c,
3003
3066
  paused: !1,
3004
3067
  get concurrency() {
3005
3068
  return r;
3006
3069
  },
3007
- set concurrency(P) {
3008
- if (!(P >= 1))
3070
+ set concurrency(k) {
3071
+ if (!(k >= 1))
3009
3072
  throw new Error("fastqueue concurrency must be equal to or greater than 1");
3010
- if (r = P, !u.paused)
3073
+ if (r = k, !u.paused)
3011
3074
  for (; i && s < r; )
3012
3075
  s++, S();
3013
3076
  },
@@ -3017,10 +3080,10 @@ function Un(t, e, r) {
3017
3080
  length: f,
3018
3081
  getQueue: p,
3019
3082
  unshift: g,
3020
- empty: X,
3083
+ empty: te,
3021
3084
  kill: F,
3022
- killAndDrain: K,
3023
- error: re
3085
+ killAndDrain: z,
3086
+ error: ne
3024
3087
  };
3025
3088
  return u;
3026
3089
  function l() {
@@ -3030,13 +3093,13 @@ function Un(t, e, r) {
3030
3093
  u.paused = !0;
3031
3094
  }
3032
3095
  function f() {
3033
- for (var P = i, V = 0; P; )
3034
- P = P.next, V++;
3096
+ for (var k = i, V = 0; k; )
3097
+ k = k.next, V++;
3035
3098
  return V;
3036
3099
  }
3037
3100
  function p() {
3038
- for (var P = i, V = []; P; )
3039
- V.push(P.value), P = P.next;
3101
+ for (var k = i, V = []; k; )
3102
+ V.push(k.value), k = k.next;
3040
3103
  return V;
3041
3104
  }
3042
3105
  function v() {
@@ -3052,37 +3115,37 @@ function Un(t, e, r) {
3052
3115
  function w() {
3053
3116
  return s === 0 && u.length() === 0;
3054
3117
  }
3055
- function b(P, V) {
3056
- var O = n.get();
3057
- O.context = t, O.release = S, O.value = P, O.callback = V || X, O.errorHandler = a, s >= r || u.paused ? o ? (o.next = O, o = O) : (i = O, o = O, u.saturated()) : (s++, e.call(t, O.value, O.worked));
3118
+ function b(k, V) {
3119
+ var _ = n.get();
3120
+ _.context = t, _.release = S, _.value = k, _.callback = V || te, _.errorHandler = a, s >= r || u.paused ? o ? (o.next = _, o = _) : (i = _, o = _, u.saturated()) : (s++, e.call(t, _.value, _.worked));
3058
3121
  }
3059
- function g(P, V) {
3060
- var O = n.get();
3061
- O.context = t, O.release = S, O.value = P, O.callback = V || X, O.errorHandler = a, s >= r || u.paused ? i ? (O.next = i, i = O) : (i = O, o = O, u.saturated()) : (s++, e.call(t, O.value, O.worked));
3122
+ function g(k, V) {
3123
+ var _ = n.get();
3124
+ _.context = t, _.release = S, _.value = k, _.callback = V || te, _.errorHandler = a, s >= r || u.paused ? i ? (_.next = i, i = _) : (i = _, o = _, u.saturated()) : (s++, e.call(t, _.value, _.worked));
3062
3125
  }
3063
- function S(P) {
3064
- P && n.release(P);
3126
+ function S(k) {
3127
+ k && n.release(k);
3065
3128
  var V = i;
3066
3129
  V && s <= r ? u.paused ? s-- : (o === i && (o = null), i = V.next, V.next = null, e.call(t, V.value, V.worked), o === null && u.empty()) : --s === 0 && u.drain();
3067
3130
  }
3068
3131
  function F() {
3069
- i = null, o = null, u.drain = X;
3132
+ i = null, o = null, u.drain = te;
3070
3133
  }
3071
- function K() {
3072
- i = null, o = null, u.drain(), u.drain = X;
3134
+ function z() {
3135
+ i = null, o = null, u.drain(), u.drain = te;
3073
3136
  }
3074
- function re(P) {
3075
- a = P;
3137
+ function ne(k) {
3138
+ a = k;
3076
3139
  }
3077
3140
  }
3078
- function X() {
3141
+ function te() {
3079
3142
  }
3080
3143
  function gs() {
3081
- this.value = null, this.callback = X, this.next = null, this.release = X, this.context = null, this.errorHandler = null;
3144
+ this.value = null, this.callback = te, this.next = null, this.release = te, this.context = null, this.errorHandler = null;
3082
3145
  var t = this;
3083
3146
  this.worked = function(r, n) {
3084
3147
  var i = t.callback, o = t.errorHandler, s = t.value;
3085
- t.value = null, t.callback = X, t.errorHandler && o(r, s), i.call(t.context, r, n), t.release(t);
3148
+ t.value = null, t.callback = te, t.errorHandler && o(r, s), i.call(t.context, r, n), t.release(t);
3086
3149
  };
3087
3150
  }
3088
3151
  function bs(t, e, r) {
@@ -3104,7 +3167,7 @@ function bs(t, e, r) {
3104
3167
  p(b);
3105
3168
  });
3106
3169
  });
3107
- return f.catch(X), f;
3170
+ return f.catch(te), f;
3108
3171
  }
3109
3172
  function u(c) {
3110
3173
  var f = new Promise(function(p, v) {
@@ -3116,7 +3179,7 @@ function bs(t, e, r) {
3116
3179
  p(b);
3117
3180
  });
3118
3181
  });
3119
- return f.catch(X), f;
3182
+ return f.catch(te), f;
3120
3183
  }
3121
3184
  function l() {
3122
3185
  if (i.idle())
@@ -3133,7 +3196,7 @@ function bs(t, e, r) {
3133
3196
  }
3134
3197
  Ir.exports = Un;
3135
3198
  Ir.exports.promise = bs;
3136
- var jn = Ir.exports, Tr = { exports: {} }, Ge = typeof Reflect == "object" ? Reflect : null, rn = Ge && typeof Ge.apply == "function" ? Ge.apply : function(e, r, n) {
3199
+ var jn = Ir.exports, Or = { exports: {} }, Ge = typeof Reflect == "object" ? Reflect : null, rn = Ge && typeof Ge.apply == "function" ? Ge.apply : function(e, r, n) {
3137
3200
  return Function.prototype.apply.call(e, r, n);
3138
3201
  }, yt;
3139
3202
  Ge && typeof Ge.ownKeys == "function" ? yt = Ge.ownKeys : Object.getOwnPropertySymbols ? yt = function(e) {
@@ -3150,14 +3213,14 @@ var xn = Number.isNaN || function(e) {
3150
3213
  function N() {
3151
3214
  N.init.call(this);
3152
3215
  }
3153
- Tr.exports = N;
3154
- Tr.exports.once = Es;
3216
+ Or.exports = N;
3217
+ Or.exports.once = Es;
3155
3218
  N.EventEmitter = N;
3156
3219
  N.prototype._events = void 0;
3157
3220
  N.prototype._eventsCount = 0;
3158
3221
  N.prototype._maxListeners = void 0;
3159
3222
  var nn = 10;
3160
- function Ft(t) {
3223
+ function Dt(t) {
3161
3224
  if (typeof t != "function")
3162
3225
  throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t);
3163
3226
  }
@@ -3212,7 +3275,7 @@ N.prototype.emit = function(e) {
3212
3275
  };
3213
3276
  function Gn(t, e, r, n) {
3214
3277
  var i, o, s;
3215
- if (Ft(r), o = t._events, o === void 0 ? (o = t._events = /* @__PURE__ */ Object.create(null), t._eventsCount = 0) : (o.newListener !== void 0 && (t.emit(
3278
+ if (Dt(r), o = t._events, o === void 0 ? (o = t._events = /* @__PURE__ */ Object.create(null), t._eventsCount = 0) : (o.newListener !== void 0 && (t.emit(
3216
3279
  "newListener",
3217
3280
  e,
3218
3281
  r.listener ? r.listener : r
@@ -3241,14 +3304,14 @@ function Kn(t, e, r) {
3241
3304
  return i.listener = r, n.wrapFn = i, i;
3242
3305
  }
3243
3306
  N.prototype.once = function(e, r) {
3244
- return Ft(r), this.on(e, Kn(this, e, r)), this;
3307
+ return Dt(r), this.on(e, Kn(this, e, r)), this;
3245
3308
  };
3246
3309
  N.prototype.prependOnceListener = function(e, r) {
3247
- return Ft(r), this.prependListener(e, Kn(this, e, r)), this;
3310
+ return Dt(r), this.prependListener(e, Kn(this, e, r)), this;
3248
3311
  };
3249
3312
  N.prototype.removeListener = function(e, r) {
3250
3313
  var n, i, o, s, a;
3251
- if (Ft(r), i = this._events, i === void 0)
3314
+ if (Dt(r), i = this._events, i === void 0)
3252
3315
  return this;
3253
3316
  if (n = i[e], n === void 0)
3254
3317
  return this;
@@ -3356,7 +3419,7 @@ function Yn(t, e, r, n) {
3356
3419
  else
3357
3420
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
3358
3421
  }
3359
- var Jn = Tr.exports, Dt = {}, Xn = {}, Zn = function() {
3422
+ var Jn = Or.exports, Rt = {}, Xn = {}, Zn = function() {
3360
3423
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
3361
3424
  return !1;
3362
3425
  if (typeof Symbol.iterator == "symbol")
@@ -3379,15 +3442,15 @@ var Jn = Tr.exports, Dt = {}, Xn = {}, Zn = function() {
3379
3442
  return !1;
3380
3443
  }
3381
3444
  return !0;
3382
- }, Ts = Zn, Rt = function() {
3383
- return Ts() && !!Symbol.toStringTag;
3384
- }, Os = Error, _s = EvalError, Ls = RangeError, Cs = ReferenceError, ei = SyntaxError, Vt = TypeError, ks = URIError, on = typeof Symbol < "u" && Symbol, Ps = Zn, Ns = function() {
3385
- return typeof on != "function" || typeof Symbol != "function" || typeof on("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Ps();
3386
- }, Ut = {
3445
+ }, Os = Zn, Vt = function() {
3446
+ return Os() && !!Symbol.toStringTag;
3447
+ }, Ts = Error, _s = EvalError, Ls = RangeError, Cs = ReferenceError, ei = SyntaxError, $t = TypeError, Ps = URIError, on = typeof Symbol < "u" && Symbol, ks = Zn, Ns = function() {
3448
+ return typeof on != "function" || typeof Symbol != "function" || typeof on("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : ks();
3449
+ }, jt = {
3387
3450
  __proto__: null,
3388
3451
  foo: {}
3389
3452
  }, Fs = Object, Ds = function() {
3390
- return { __proto__: Ut }.foo === Ut.foo && !(Ut instanceof Fs);
3453
+ return { __proto__: jt }.foo === jt.foo && !(jt instanceof Fs);
3391
3454
  }, Rs = "Function.prototype.bind called on incompatible ", Vs = Object.prototype.toString, $s = Math.max, Ms = "[object Function]", sn = function(e, r) {
3392
3455
  for (var n = [], i = 0; i < e.length; i += 1)
3393
3456
  n[i] = e[i];
@@ -3426,38 +3489,38 @@ var Jn = Tr.exports, Dt = {}, Xn = {}, Zn = function() {
3426
3489
  l.prototype = r.prototype, i.prototype = new l(), l.prototype = null;
3427
3490
  }
3428
3491
  return i;
3429
- }, js = Us, Or = Function.prototype.bind || js, xs = Function.prototype.call, Qs = Object.prototype.hasOwnProperty, Gs = Or, Ks = Gs.call(xs, Qs), T, zs = Os, Hs = _s, Ws = Ls, Ys = Cs, ze = ei, Ke = Vt, Js = ks, ti = Function, jt = function(t) {
3492
+ }, js = Us, Tr = Function.prototype.bind || js, xs = Function.prototype.call, Qs = Object.prototype.hasOwnProperty, Gs = Tr, Ks = Gs.call(xs, Qs), T, zs = Ts, Hs = _s, Ws = Ls, Ys = Cs, ze = ei, Ke = $t, Js = Ps, ti = Function, xt = function(t) {
3430
3493
  try {
3431
3494
  return ti('"use strict"; return (' + t + ").constructor;")();
3432
3495
  } catch {
3433
3496
  }
3434
- }, ke = Object.getOwnPropertyDescriptor;
3435
- if (ke)
3497
+ }, Pe = Object.getOwnPropertyDescriptor;
3498
+ if (Pe)
3436
3499
  try {
3437
- ke({}, "");
3500
+ Pe({}, "");
3438
3501
  } catch {
3439
- ke = null;
3502
+ Pe = null;
3440
3503
  }
3441
- var xt = function() {
3504
+ var Qt = function() {
3442
3505
  throw new Ke();
3443
- }, Xs = ke ? function() {
3506
+ }, Xs = Pe ? function() {
3444
3507
  try {
3445
- return arguments.callee, xt;
3508
+ return arguments.callee, Qt;
3446
3509
  } catch {
3447
3510
  try {
3448
- return ke(arguments, "callee").get;
3511
+ return Pe(arguments, "callee").get;
3449
3512
  } catch {
3450
- return xt;
3513
+ return Qt;
3451
3514
  }
3452
3515
  }
3453
- }() : xt, Me = Ns(), Zs = Ds(), U = Object.getPrototypeOf || (Zs ? function(t) {
3516
+ }() : Qt, Me = Ns(), Zs = Ds(), j = Object.getPrototypeOf || (Zs ? function(t) {
3454
3517
  return t.__proto__;
3455
- } : null), qe = {}, ea = typeof Uint8Array > "u" || !U ? T : U(Uint8Array), Pe = {
3518
+ } : null), qe = {}, ea = typeof Uint8Array > "u" || !j ? T : j(Uint8Array), ke = {
3456
3519
  __proto__: null,
3457
3520
  "%AggregateError%": typeof AggregateError > "u" ? T : AggregateError,
3458
3521
  "%Array%": Array,
3459
3522
  "%ArrayBuffer%": typeof ArrayBuffer > "u" ? T : ArrayBuffer,
3460
- "%ArrayIteratorPrototype%": Me && U ? U([][Symbol.iterator]()) : T,
3523
+ "%ArrayIteratorPrototype%": Me && j ? j([][Symbol.iterator]()) : T,
3461
3524
  "%AsyncFromSyncIteratorPrototype%": T,
3462
3525
  "%AsyncFunction%": qe,
3463
3526
  "%AsyncGenerator%": qe,
@@ -3488,10 +3551,10 @@ var xt = function() {
3488
3551
  "%Int32Array%": typeof Int32Array > "u" ? T : Int32Array,
3489
3552
  "%isFinite%": isFinite,
3490
3553
  "%isNaN%": isNaN,
3491
- "%IteratorPrototype%": Me && U ? U(U([][Symbol.iterator]())) : T,
3554
+ "%IteratorPrototype%": Me && j ? j(j([][Symbol.iterator]())) : T,
3492
3555
  "%JSON%": typeof JSON == "object" ? JSON : T,
3493
3556
  "%Map%": typeof Map > "u" ? T : Map,
3494
- "%MapIteratorPrototype%": typeof Map > "u" || !Me || !U ? T : U((/* @__PURE__ */ new Map())[Symbol.iterator]()),
3557
+ "%MapIteratorPrototype%": typeof Map > "u" || !Me || !j ? T : j((/* @__PURE__ */ new Map())[Symbol.iterator]()),
3495
3558
  "%Math%": Math,
3496
3559
  "%Number%": Number,
3497
3560
  "%Object%": Object,
@@ -3504,10 +3567,10 @@ var xt = function() {
3504
3567
  "%Reflect%": typeof Reflect > "u" ? T : Reflect,
3505
3568
  "%RegExp%": RegExp,
3506
3569
  "%Set%": typeof Set > "u" ? T : Set,
3507
- "%SetIteratorPrototype%": typeof Set > "u" || !Me || !U ? T : U((/* @__PURE__ */ new Set())[Symbol.iterator]()),
3570
+ "%SetIteratorPrototype%": typeof Set > "u" || !Me || !j ? T : j((/* @__PURE__ */ new Set())[Symbol.iterator]()),
3508
3571
  "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? T : SharedArrayBuffer,
3509
3572
  "%String%": String,
3510
- "%StringIteratorPrototype%": Me && U ? U(""[Symbol.iterator]()) : T,
3573
+ "%StringIteratorPrototype%": Me && j ? j(""[Symbol.iterator]()) : T,
3511
3574
  "%Symbol%": Me ? Symbol : T,
3512
3575
  "%SyntaxError%": ze,
3513
3576
  "%ThrowTypeError%": Xs,
@@ -3522,29 +3585,29 @@ var xt = function() {
3522
3585
  "%WeakRef%": typeof WeakRef > "u" ? T : WeakRef,
3523
3586
  "%WeakSet%": typeof WeakSet > "u" ? T : WeakSet
3524
3587
  };
3525
- if (U)
3588
+ if (j)
3526
3589
  try {
3527
3590
  null.error;
3528
3591
  } catch (t) {
3529
- var ta = U(U(t));
3530
- Pe["%Error.prototype%"] = ta;
3592
+ var ta = j(j(t));
3593
+ ke["%Error.prototype%"] = ta;
3531
3594
  }
3532
3595
  var ra = function t(e) {
3533
3596
  var r;
3534
3597
  if (e === "%AsyncFunction%")
3535
- r = jt("async function () {}");
3598
+ r = xt("async function () {}");
3536
3599
  else if (e === "%GeneratorFunction%")
3537
- r = jt("function* () {}");
3600
+ r = xt("function* () {}");
3538
3601
  else if (e === "%AsyncGeneratorFunction%")
3539
- r = jt("async function* () {}");
3602
+ r = xt("async function* () {}");
3540
3603
  else if (e === "%AsyncGenerator%") {
3541
3604
  var n = t("%AsyncGeneratorFunction%");
3542
3605
  n && (r = n.prototype);
3543
3606
  } else if (e === "%AsyncIteratorPrototype%") {
3544
3607
  var i = t("%AsyncGenerator%");
3545
- i && U && (r = U(i.prototype));
3608
+ i && j && (r = j(i.prototype));
3546
3609
  }
3547
- return Pe[e] = r, r;
3610
+ return ke[e] = r, r;
3548
3611
  }, an = {
3549
3612
  __proto__: null,
3550
3613
  "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
@@ -3598,8 +3661,8 @@ var ra = function t(e) {
3598
3661
  "%URIErrorPrototype%": ["URIError", "prototype"],
3599
3662
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
3600
3663
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
3601
- }, ot = Or, Et = Ks, na = ot.call(Function.call, Array.prototype.concat), ia = ot.call(Function.apply, Array.prototype.splice), un = ot.call(Function.call, String.prototype.replace), It = ot.call(Function.call, String.prototype.slice), oa = ot.call(Function.call, RegExp.prototype.exec), sa = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, aa = /\\(\\)?/g, ua = function(e) {
3602
- var r = It(e, 0, 1), n = It(e, -1);
3664
+ }, ot = Tr, It = Ks, na = ot.call(Function.call, Array.prototype.concat), ia = ot.call(Function.apply, Array.prototype.splice), un = ot.call(Function.call, String.prototype.replace), Ot = ot.call(Function.call, String.prototype.slice), oa = ot.call(Function.call, RegExp.prototype.exec), sa = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, aa = /\\(\\)?/g, ua = function(e) {
3665
+ var r = Ot(e, 0, 1), n = Ot(e, -1);
3603
3666
  if (r === "%" && n !== "%")
3604
3667
  throw new ze("invalid intrinsic syntax, expected closing `%`");
3605
3668
  if (n === "%" && r !== "%")
@@ -3610,8 +3673,8 @@ var ra = function t(e) {
3610
3673
  }), i;
3611
3674
  }, ca = function(e, r) {
3612
3675
  var n = e, i;
3613
- if (Et(an, n) && (i = an[n], n = "%" + i[0] + "%"), Et(Pe, n)) {
3614
- var o = Pe[n];
3676
+ if (It(an, n) && (i = an[n], n = "%" + i[0] + "%"), It(ke, n)) {
3677
+ var o = ke[n];
3615
3678
  if (o === qe && (o = ra(n)), typeof o > "u" && !r)
3616
3679
  throw new Ke("intrinsic " + e + " exists, but is not available. Please file an issue!");
3617
3680
  return {
@@ -3631,29 +3694,29 @@ var ra = function t(e) {
3631
3694
  var n = ua(e), i = n.length > 0 ? n[0] : "", o = ca("%" + i + "%", r), s = o.name, a = o.value, u = !1, l = o.alias;
3632
3695
  l && (i = l[0], ia(n, na([0, 1], l)));
3633
3696
  for (var c = 1, f = !0; c < n.length; c += 1) {
3634
- var p = n[c], v = It(p, 0, 1), w = It(p, -1);
3697
+ var p = n[c], v = Ot(p, 0, 1), w = Ot(p, -1);
3635
3698
  if ((v === '"' || v === "'" || v === "`" || w === '"' || w === "'" || w === "`") && v !== w)
3636
3699
  throw new ze("property names with quotes must have matching quotes");
3637
- if ((p === "constructor" || !f) && (u = !0), i += "." + p, s = "%" + i + "%", Et(Pe, s))
3638
- a = Pe[s];
3700
+ if ((p === "constructor" || !f) && (u = !0), i += "." + p, s = "%" + i + "%", It(ke, s))
3701
+ a = ke[s];
3639
3702
  else if (a != null) {
3640
3703
  if (!(p in a)) {
3641
3704
  if (!r)
3642
3705
  throw new Ke("base intrinsic for " + e + " exists, but the property is not available.");
3643
3706
  return;
3644
3707
  }
3645
- if (ke && c + 1 >= n.length) {
3646
- var b = ke(a, p);
3708
+ if (Pe && c + 1 >= n.length) {
3709
+ var b = Pe(a, p);
3647
3710
  f = !!b, f && "get" in b && !("originalValue" in b.get) ? a = b.get : a = a[p];
3648
3711
  } else
3649
- f = Et(a, p), a = a[p];
3650
- f && !u && (Pe[s] = a);
3712
+ f = It(a, p), a = a[p];
3713
+ f && !u && (ke[s] = a);
3651
3714
  }
3652
3715
  }
3653
3716
  return a;
3654
- }, ri = { exports: {} }, Qt, cn;
3717
+ }, ri = { exports: {} }, Gt, cn;
3655
3718
  function _r() {
3656
- if (cn) return Qt;
3719
+ if (cn) return Gt;
3657
3720
  cn = 1;
3658
3721
  var t = st, e = t("%Object.defineProperty%", !0) || !1;
3659
3722
  if (e)
@@ -3662,7 +3725,7 @@ function _r() {
3662
3725
  } catch {
3663
3726
  e = !1;
3664
3727
  }
3665
- return Qt = e, Qt;
3728
+ return Gt = e, Gt;
3666
3729
  }
3667
3730
  var la = st, mt = la("%Object.getOwnPropertyDescriptor%", !0);
3668
3731
  if (mt)
@@ -3671,7 +3734,7 @@ if (mt)
3671
3734
  } catch {
3672
3735
  mt = null;
3673
3736
  }
3674
- var $t = mt, ln = _r(), da = ei, Be = Vt, dn = $t, fa = function(e, r, n) {
3737
+ var Mt = mt, ln = _r(), da = ei, Be = $t, dn = Mt, fa = function(e, r, n) {
3675
3738
  if (!e || typeof e != "object" && typeof e != "function")
3676
3739
  throw new Be("`obj` must be an object or a function`");
3677
3740
  if (typeof r != "string" && typeof r != "symbol")
@@ -3708,7 +3771,7 @@ ni.hasArrayLengthDefineBug = function() {
3708
3771
  return !0;
3709
3772
  }
3710
3773
  };
3711
- var pa = ni, ha = st, fn = fa, ya = pa(), pn = $t, hn = Vt, ma = ha("%Math.floor%"), ga = function(e, r) {
3774
+ var pa = ni, ha = st, fn = fa, ya = pa(), pn = Mt, hn = $t, ma = ha("%Math.floor%"), ga = function(e, r) {
3712
3775
  if (typeof e != "function")
3713
3776
  throw new hn("`fn` is not a function");
3714
3777
  if (typeof r != "number" || r < 0 || r > 4294967295 || ma(r) !== r)
@@ -3733,7 +3796,7 @@ var pa = ni, ha = st, fn = fa, ya = pa(), pn = $t, hn = Vt, ma = ha("%Math.floor
3733
3796
  )), e;
3734
3797
  };
3735
3798
  (function(t) {
3736
- var e = Or, r = st, n = ga, i = Vt, o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = _r(), l = r("%Math.max%");
3799
+ var e = Tr, r = st, n = ga, i = $t, o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = _r(), l = r("%Math.max%");
3737
3800
  t.exports = function(p) {
3738
3801
  if (typeof p != "function")
3739
3802
  throw new i("a function is required");
@@ -3752,37 +3815,37 @@ var pa = ni, ha = st, fn = fa, ya = pa(), pn = $t, hn = Vt, ma = ha("%Math.floor
3752
3815
  var Lr = ri.exports, ii = st, oi = Lr, ba = oi(ii("String.prototype.indexOf")), Cr = function(e, r) {
3753
3816
  var n = ii(e, !!r);
3754
3817
  return typeof n == "function" && ba(e, ".prototype.") > -1 ? oi(n) : n;
3755
- }, va = Rt(), Sa = Cr, dr = Sa("Object.prototype.toString"), Mt = function(e) {
3818
+ }, va = Vt(), Sa = Cr, dr = Sa("Object.prototype.toString"), Bt = function(e) {
3756
3819
  return va && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : dr(e) === "[object Arguments]";
3757
3820
  }, si = function(e) {
3758
- return Mt(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && dr(e) !== "[object Array]" && dr(e.callee) === "[object Function]";
3821
+ return Bt(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && dr(e) !== "[object Array]" && dr(e.callee) === "[object Function]";
3759
3822
  }, wa = function() {
3760
- return Mt(arguments);
3823
+ return Bt(arguments);
3761
3824
  }();
3762
- Mt.isLegacyArguments = si;
3763
- var Aa = wa ? Mt : si, Ea = Object.prototype.toString, Ia = Function.prototype.toString, Ta = /^\s*(?:function)?\*/, ai = Rt(), Gt = Object.getPrototypeOf, Oa = function() {
3825
+ Bt.isLegacyArguments = si;
3826
+ var Aa = wa ? Bt : si, Ea = Object.prototype.toString, Ia = Function.prototype.toString, Oa = /^\s*(?:function)?\*/, ai = Vt(), Kt = Object.getPrototypeOf, Ta = function() {
3764
3827
  if (!ai)
3765
3828
  return !1;
3766
3829
  try {
3767
3830
  return Function("return function*() {}")();
3768
3831
  } catch {
3769
3832
  }
3770
- }, Kt, _a = function(e) {
3833
+ }, zt, _a = function(e) {
3771
3834
  if (typeof e != "function")
3772
3835
  return !1;
3773
- if (Ta.test(Ia.call(e)))
3836
+ if (Oa.test(Ia.call(e)))
3774
3837
  return !0;
3775
3838
  if (!ai) {
3776
3839
  var r = Ea.call(e);
3777
3840
  return r === "[object GeneratorFunction]";
3778
3841
  }
3779
- if (!Gt)
3842
+ if (!Kt)
3780
3843
  return !1;
3781
- if (typeof Kt > "u") {
3782
- var n = Oa();
3783
- Kt = n ? Gt(n) : !1;
3844
+ if (typeof zt > "u") {
3845
+ var n = Ta();
3846
+ zt = n ? Kt(n) : !1;
3784
3847
  }
3785
- return Gt(e) === Kt;
3848
+ return Kt(e) === zt;
3786
3849
  }, ui = Function.prototype.toString, xe = typeof Reflect == "object" && Reflect !== null && Reflect.apply, fr, gt;
3787
3850
  if (typeof xe == "function" && typeof Object.defineProperty == "function")
3788
3851
  try {
@@ -3805,13 +3868,13 @@ var La = /^\s*class\b/, pr = function(e) {
3805
3868
  } catch {
3806
3869
  return !1;
3807
3870
  }
3808
- }, zt = function(e) {
3871
+ }, Ht = function(e) {
3809
3872
  try {
3810
3873
  return pr(e) ? !1 : (ui.call(e), !0);
3811
3874
  } catch {
3812
3875
  return !1;
3813
3876
  }
3814
- }, bt = Object.prototype.toString, Ca = "[object Object]", ka = "[object Function]", Pa = "[object GeneratorFunction]", Na = "[object HTMLAllCollection]", Fa = "[object HTML document.all class]", Da = "[object HTMLCollection]", Ra = typeof Symbol == "function" && !!Symbol.toStringTag, Va = !(0 in [,]), hr = function() {
3877
+ }, bt = Object.prototype.toString, Ca = "[object Object]", Pa = "[object Function]", ka = "[object GeneratorFunction]", Na = "[object HTMLAllCollection]", Fa = "[object HTML document.all class]", Da = "[object HTMLCollection]", Ra = typeof Symbol == "function" && !!Symbol.toStringTag, Va = !(0 in [,]), hr = function() {
3815
3878
  return !1;
3816
3879
  };
3817
3880
  if (typeof document == "object") {
@@ -3837,18 +3900,18 @@ var Ma = xe ? function(e) {
3837
3900
  if (r !== gt)
3838
3901
  return !1;
3839
3902
  }
3840
- return !pr(e) && zt(e);
3903
+ return !pr(e) && Ht(e);
3841
3904
  } : function(e) {
3842
3905
  if (hr(e))
3843
3906
  return !0;
3844
3907
  if (!e || typeof e != "function" && typeof e != "object")
3845
3908
  return !1;
3846
3909
  if (Ra)
3847
- return zt(e);
3910
+ return Ht(e);
3848
3911
  if (pr(e))
3849
3912
  return !1;
3850
3913
  var r = bt.call(e);
3851
- return r !== ka && r !== Pa && !/^\[object HTML/.test(r) ? !1 : zt(e);
3914
+ return r !== Pa && r !== ka && !/^\[object HTML/.test(r) ? !1 : Ht(e);
3852
3915
  }, Ba = Ma, qa = Object.prototype.toString, ci = Object.prototype.hasOwnProperty, Ua = function(e, r, n) {
3853
3916
  for (var i = 0, o = e.length; i < o; i++)
3854
3917
  ci.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
@@ -3875,45 +3938,45 @@ var Ma = xe ? function(e) {
3875
3938
  "Uint32Array",
3876
3939
  "BigInt64Array",
3877
3940
  "BigUint64Array"
3878
- ], Ht = Ga, Ka = typeof globalThis > "u" ? Ar : globalThis, di = function() {
3879
- for (var e = [], r = 0; r < Ht.length; r++)
3880
- typeof Ka[Ht[r]] == "function" && (e[e.length] = Ht[r]);
3941
+ ], Wt = Ga, Ka = typeof globalThis > "u" ? Ar : globalThis, di = function() {
3942
+ for (var e = [], r = 0; r < Wt.length; r++)
3943
+ typeof Ka[Wt[r]] == "function" && (e[e.length] = Wt[r]);
3881
3944
  return e;
3882
- }, Tt = li, za = di, yn = Lr, kr = Cr, vt = $t, Ha = kr("Object.prototype.toString"), fi = Rt(), mn = typeof globalThis > "u" ? Ar : globalThis, yr = za(), Pr = kr("String.prototype.slice"), Wt = Object.getPrototypeOf, Wa = kr("Array.prototype.indexOf", !0) || function(e, r) {
3945
+ }, Tt = li, za = di, yn = Lr, Pr = Cr, vt = Mt, Ha = Pr("Object.prototype.toString"), fi = Vt(), mn = typeof globalThis > "u" ? Ar : globalThis, yr = za(), kr = Pr("String.prototype.slice"), Yt = Object.getPrototypeOf, Wa = Pr("Array.prototype.indexOf", !0) || function(e, r) {
3883
3946
  for (var n = 0; n < e.length; n += 1)
3884
3947
  if (e[n] === r)
3885
3948
  return n;
3886
3949
  return -1;
3887
- }, Ot = { __proto__: null };
3888
- fi && vt && Wt ? Tt(yr, function(t) {
3950
+ }, _t = { __proto__: null };
3951
+ fi && vt && Yt ? Tt(yr, function(t) {
3889
3952
  var e = new mn[t]();
3890
3953
  if (Symbol.toStringTag in e) {
3891
- var r = Wt(e), n = vt(r, Symbol.toStringTag);
3954
+ var r = Yt(e), n = vt(r, Symbol.toStringTag);
3892
3955
  if (!n) {
3893
- var i = Wt(r);
3956
+ var i = Yt(r);
3894
3957
  n = vt(i, Symbol.toStringTag);
3895
3958
  }
3896
- Ot["$" + t] = yn(n.get);
3959
+ _t["$" + t] = yn(n.get);
3897
3960
  }
3898
3961
  }) : Tt(yr, function(t) {
3899
3962
  var e = new mn[t](), r = e.slice || e.set;
3900
- r && (Ot["$" + t] = yn(r));
3963
+ r && (_t["$" + t] = yn(r));
3901
3964
  });
3902
3965
  var Ya = function(e) {
3903
3966
  var r = !1;
3904
- return Tt(Ot, function(n, i) {
3967
+ return Tt(_t, function(n, i) {
3905
3968
  if (!r)
3906
3969
  try {
3907
- "$" + n(e) === i && (r = Pr(i, 1));
3970
+ "$" + n(e) === i && (r = kr(i, 1));
3908
3971
  } catch {
3909
3972
  }
3910
3973
  }), r;
3911
3974
  }, Ja = function(e) {
3912
3975
  var r = !1;
3913
- return Tt(Ot, function(n, i) {
3976
+ return Tt(_t, function(n, i) {
3914
3977
  if (!r)
3915
3978
  try {
3916
- n(e), r = Pr(i, 1);
3979
+ n(e), r = kr(i, 1);
3917
3980
  } catch {
3918
3981
  }
3919
3982
  }), r;
@@ -3921,37 +3984,37 @@ var Ya = function(e) {
3921
3984
  if (!e || typeof e != "object")
3922
3985
  return !1;
3923
3986
  if (!fi) {
3924
- var r = Pr(Ha(e), 8, -1);
3987
+ var r = kr(Ha(e), 8, -1);
3925
3988
  return Wa(yr, r) > -1 ? r : r !== "Object" ? !1 : Ja(e);
3926
3989
  }
3927
3990
  return vt ? Ya(e) : null;
3928
- }, _t = li, Za = di, gn = Lr, Nr = Cr, St = $t, eu = Nr("Object.prototype.toString"), pi = Rt(), bn = typeof globalThis > "u" ? Ar : globalThis, mr = Za(), Fr = Nr("String.prototype.slice"), Yt = Object.getPrototypeOf, tu = Nr("Array.prototype.indexOf", !0) || function(e, r) {
3991
+ }, Lt = li, Za = di, gn = Lr, Nr = Cr, St = Mt, eu = Nr("Object.prototype.toString"), pi = Vt(), bn = typeof globalThis > "u" ? Ar : globalThis, mr = Za(), Fr = Nr("String.prototype.slice"), Jt = Object.getPrototypeOf, tu = Nr("Array.prototype.indexOf", !0) || function(e, r) {
3929
3992
  for (var n = 0; n < e.length; n += 1)
3930
3993
  if (e[n] === r)
3931
3994
  return n;
3932
3995
  return -1;
3933
- }, Lt = { __proto__: null };
3934
- pi && St && Yt ? _t(mr, function(t) {
3996
+ }, Ct = { __proto__: null };
3997
+ pi && St && Jt ? Lt(mr, function(t) {
3935
3998
  var e = new bn[t]();
3936
3999
  if (Symbol.toStringTag in e) {
3937
- var r = Yt(e), n = St(r, Symbol.toStringTag);
4000
+ var r = Jt(e), n = St(r, Symbol.toStringTag);
3938
4001
  if (!n) {
3939
- var i = Yt(r);
4002
+ var i = Jt(r);
3940
4003
  n = St(i, Symbol.toStringTag);
3941
4004
  }
3942
- Lt["$" + t] = gn(n.get);
4005
+ Ct["$" + t] = gn(n.get);
3943
4006
  }
3944
- }) : _t(mr, function(t) {
4007
+ }) : Lt(mr, function(t) {
3945
4008
  var e = new bn[t](), r = e.slice || e.set;
3946
- r && (Lt["$" + t] = gn(r));
4009
+ r && (Ct["$" + t] = gn(r));
3947
4010
  });
3948
4011
  var ru = function(e) {
3949
4012
  var r = !1;
3950
- return _t(
4013
+ return Lt(
3951
4014
  // eslint-disable-next-line no-extra-parens
3952
4015
  /** @type {Record<`\$${TypedArrayName}`, Getter>} */
3953
4016
  /** @type {any} */
3954
- Lt,
4017
+ Ct,
3955
4018
  /** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
3956
4019
  function(n, i) {
3957
4020
  if (!r)
@@ -3963,11 +4026,11 @@ var ru = function(e) {
3963
4026
  ), r;
3964
4027
  }, nu = function(e) {
3965
4028
  var r = !1;
3966
- return _t(
4029
+ return Lt(
3967
4030
  // eslint-disable-next-line no-extra-parens
3968
4031
  /** @type {Record<`\$${TypedArrayName}`, Getter>} */
3969
4032
  /** @type {any} */
3970
- Lt,
4033
+ Ct,
3971
4034
  /** @type {(getter: typeof cache, name: `\$${import('.').TypedArrayName}`) => void} */
3972
4035
  function(n, i) {
3973
4036
  if (!r)
@@ -4024,34 +4087,34 @@ var ru = function(e) {
4024
4087
  return n(y) === "Uint8ClampedArray";
4025
4088
  }
4026
4089
  t.isUint8ClampedArray = F;
4027
- function K(y) {
4090
+ function z(y) {
4028
4091
  return n(y) === "Uint16Array";
4029
4092
  }
4030
- t.isUint16Array = K;
4031
- function re(y) {
4093
+ t.isUint16Array = z;
4094
+ function ne(y) {
4032
4095
  return n(y) === "Uint32Array";
4033
4096
  }
4034
- t.isUint32Array = re;
4035
- function P(y) {
4097
+ t.isUint32Array = ne;
4098
+ function k(y) {
4036
4099
  return n(y) === "Int8Array";
4037
4100
  }
4038
- t.isInt8Array = P;
4101
+ t.isInt8Array = k;
4039
4102
  function V(y) {
4040
4103
  return n(y) === "Int16Array";
4041
4104
  }
4042
4105
  t.isInt16Array = V;
4043
- function O(y) {
4106
+ function _(y) {
4044
4107
  return n(y) === "Int32Array";
4045
4108
  }
4046
- t.isInt32Array = O;
4047
- function oe(y) {
4109
+ t.isInt32Array = _;
4110
+ function ae(y) {
4048
4111
  return n(y) === "Float32Array";
4049
4112
  }
4050
- t.isFloat32Array = oe;
4051
- function se(y) {
4113
+ t.isFloat32Array = ae;
4114
+ function ue(y) {
4052
4115
  return n(y) === "Float64Array";
4053
4116
  }
4054
- t.isFloat64Array = se;
4117
+ t.isFloat64Array = ue;
4055
4118
  function Ne(y) {
4056
4119
  return n(y) === "BigInt64Array";
4057
4120
  }
@@ -4060,38 +4123,38 @@ var ru = function(e) {
4060
4123
  return n(y) === "BigUint64Array";
4061
4124
  }
4062
4125
  t.isBigUint64Array = Ie;
4063
- function fe(y) {
4126
+ function pe(y) {
4064
4127
  return u(y) === "[object Map]";
4065
4128
  }
4066
- fe.working = typeof Map < "u" && fe(/* @__PURE__ */ new Map());
4067
- function Bt(y) {
4068
- return typeof Map > "u" ? !1 : fe.working ? fe(y) : y instanceof Map;
4129
+ pe.working = typeof Map < "u" && pe(/* @__PURE__ */ new Map());
4130
+ function qt(y) {
4131
+ return typeof Map > "u" ? !1 : pe.working ? pe(y) : y instanceof Map;
4069
4132
  }
4070
- t.isMap = Bt;
4071
- function we(y) {
4133
+ t.isMap = qt;
4134
+ function Ae(y) {
4072
4135
  return u(y) === "[object Set]";
4073
4136
  }
4074
- we.working = typeof Set < "u" && we(/* @__PURE__ */ new Set());
4137
+ Ae.working = typeof Set < "u" && Ae(/* @__PURE__ */ new Set());
4075
4138
  function Je(y) {
4076
- return typeof Set > "u" ? !1 : we.working ? we(y) : y instanceof Set;
4139
+ return typeof Set > "u" ? !1 : Ae.working ? Ae(y) : y instanceof Set;
4077
4140
  }
4078
4141
  t.isSet = Je;
4079
4142
  function Fe(y) {
4080
4143
  return u(y) === "[object WeakMap]";
4081
4144
  }
4082
4145
  Fe.working = typeof WeakMap < "u" && Fe(/* @__PURE__ */ new WeakMap());
4083
- function qt(y) {
4146
+ function Ut(y) {
4084
4147
  return typeof WeakMap > "u" ? !1 : Fe.working ? Fe(y) : y instanceof WeakMap;
4085
4148
  }
4086
- t.isWeakMap = qt;
4149
+ t.isWeakMap = Ut;
4087
4150
  function De(y) {
4088
4151
  return u(y) === "[object WeakSet]";
4089
4152
  }
4090
4153
  De.working = typeof WeakSet < "u" && De(/* @__PURE__ */ new WeakSet());
4091
- function pe(y) {
4154
+ function he(y) {
4092
4155
  return De(y);
4093
4156
  }
4094
- t.isWeakSet = pe;
4157
+ t.isWeakSet = he;
4095
4158
  function Re(y) {
4096
4159
  return u(y) === "[object ArrayBuffer]";
4097
4160
  }
@@ -4116,14 +4179,14 @@ var ru = function(e) {
4116
4179
  return typeof m > "u" ? !1 : (typeof A.working > "u" && (A.working = A(new m())), A.working ? A(y) : y instanceof m);
4117
4180
  }
4118
4181
  t.isSharedArrayBuffer = C;
4119
- function k(y) {
4182
+ function P(y) {
4120
4183
  return u(y) === "[object AsyncFunction]";
4121
4184
  }
4122
- t.isAsyncFunction = k;
4123
- function I(y) {
4185
+ t.isAsyncFunction = P;
4186
+ function O(y) {
4124
4187
  return u(y) === "[object Map Iterator]";
4125
4188
  }
4126
- t.isMapIterator = I;
4189
+ t.isMapIterator = O;
4127
4190
  function L(y) {
4128
4191
  return u(y) === "[object Set Iterator]";
4129
4192
  }
@@ -4132,14 +4195,14 @@ var ru = function(e) {
4132
4195
  return u(y) === "[object Generator]";
4133
4196
  }
4134
4197
  t.isGeneratorObject = D;
4135
- function H(y) {
4198
+ function W(y) {
4136
4199
  return u(y) === "[object WebAssembly.Module]";
4137
4200
  }
4138
- t.isWebAssemblyCompiledModule = H;
4139
- function Te(y) {
4201
+ t.isWebAssemblyCompiledModule = W;
4202
+ function Oe(y) {
4140
4203
  return w(y, l);
4141
4204
  }
4142
- t.isNumberObject = Te;
4205
+ t.isNumberObject = Oe;
4143
4206
  function ut(y) {
4144
4207
  return w(y, c);
4145
4208
  }
@@ -4157,7 +4220,7 @@ var ru = function(e) {
4157
4220
  }
4158
4221
  t.isSymbolObject = Vr;
4159
4222
  function bi(y) {
4160
- return Te(y) || ut(y) || Ve(y) || ct(y) || Vr(y);
4223
+ return Oe(y) || ut(y) || Ve(y) || ct(y) || Vr(y);
4161
4224
  }
4162
4225
  t.isBoxedPrimitive = bi;
4163
4226
  function vi(y) {
@@ -4200,12 +4263,12 @@ var uu = gr.exports;
4200
4263
  return A;
4201
4264
  }, r = /%[sdj%]/g;
4202
4265
  t.format = function(d) {
4203
- if (!P(d)) {
4266
+ if (!k(d)) {
4204
4267
  for (var h = [], m = 0; m < arguments.length; m++)
4205
4268
  h.push(s(arguments[m]));
4206
4269
  return h.join(" ");
4207
4270
  }
4208
- for (var m = 1, A = arguments, C = A.length, k = String(d).replace(r, function(L) {
4271
+ for (var m = 1, A = arguments, C = A.length, P = String(d).replace(r, function(L) {
4209
4272
  if (L === "%%") return "%";
4210
4273
  if (m >= C) return L;
4211
4274
  switch (L) {
@@ -4222,9 +4285,9 @@ var uu = gr.exports;
4222
4285
  default:
4223
4286
  return L;
4224
4287
  }
4225
- }), I = A[m]; m < C; I = A[++m])
4226
- F(I) || !se(I) ? k += " " + I : k += " " + s(I);
4227
- return k;
4288
+ }), O = A[m]; m < C; O = A[++m])
4289
+ F(O) || !ue(O) ? P += " " + O : P += " " + s(O);
4290
+ return P;
4228
4291
  }, t.deprecate = function(d, h) {
4229
4292
  if (typeof E < "u" && E.noDeprecation === !0)
4230
4293
  return d;
@@ -4266,7 +4329,7 @@ var uu = gr.exports;
4266
4329
  seen: [],
4267
4330
  stylize: u
4268
4331
  };
4269
- return arguments.length >= 3 && (m.depth = arguments[2]), arguments.length >= 4 && (m.colors = arguments[3]), S(h) ? m.showHidden = h : h && t._extend(m, h), O(m.showHidden) && (m.showHidden = !1), O(m.depth) && (m.depth = 2), O(m.colors) && (m.colors = !1), O(m.customInspect) && (m.customInspect = !0), m.colors && (m.stylize = a), c(m, d, m.depth);
4332
+ return arguments.length >= 3 && (m.depth = arguments[2]), arguments.length >= 4 && (m.colors = arguments[3]), S(h) ? m.showHidden = h : h && t._extend(m, h), _(m.showHidden) && (m.showHidden = !1), _(m.depth) && (m.depth = 2), _(m.colors) && (m.colors = !1), _(m.customInspect) && (m.customInspect = !0), m.colors && (m.stylize = a), c(m, d, m.depth);
4270
4333
  }
4271
4334
  t.inspect = s, s.colors = {
4272
4335
  bold: [1, 22],
@@ -4307,53 +4370,53 @@ var uu = gr.exports;
4307
4370
  }), h;
4308
4371
  }
4309
4372
  function c(d, h, m) {
4310
- if (d.customInspect && h && fe(h.inspect) && // Filter out the util module, it's inspect function is special
4373
+ if (d.customInspect && h && pe(h.inspect) && // Filter out the util module, it's inspect function is special
4311
4374
  h.inspect !== t.inspect && // Also filter out any prototype objects using the circular check.
4312
4375
  !(h.constructor && h.constructor.prototype === h)) {
4313
4376
  var A = h.inspect(m, d);
4314
- return P(A) || (A = c(d, A, m)), A;
4377
+ return k(A) || (A = c(d, A, m)), A;
4315
4378
  }
4316
4379
  var C = f(d, h);
4317
4380
  if (C)
4318
4381
  return C;
4319
- var k = Object.keys(h), I = l(k);
4320
- if (d.showHidden && (k = Object.getOwnPropertyNames(h)), Ie(h) && (k.indexOf("message") >= 0 || k.indexOf("description") >= 0))
4382
+ var P = Object.keys(h), O = l(P);
4383
+ if (d.showHidden && (P = Object.getOwnPropertyNames(h)), Ie(h) && (P.indexOf("message") >= 0 || P.indexOf("description") >= 0))
4321
4384
  return p(h);
4322
- if (k.length === 0) {
4323
- if (fe(h)) {
4385
+ if (P.length === 0) {
4386
+ if (pe(h)) {
4324
4387
  var L = h.name ? ": " + h.name : "";
4325
4388
  return d.stylize("[Function" + L + "]", "special");
4326
4389
  }
4327
- if (oe(h))
4390
+ if (ae(h))
4328
4391
  return d.stylize(RegExp.prototype.toString.call(h), "regexp");
4329
4392
  if (Ne(h))
4330
4393
  return d.stylize(Date.prototype.toString.call(h), "date");
4331
4394
  if (Ie(h))
4332
4395
  return p(h);
4333
4396
  }
4334
- var D = "", H = !1, Te = ["{", "}"];
4335
- if (g(h) && (H = !0, Te = ["[", "]"]), fe(h)) {
4397
+ var D = "", W = !1, Oe = ["{", "}"];
4398
+ if (g(h) && (W = !0, Oe = ["[", "]"]), pe(h)) {
4336
4399
  var ut = h.name ? ": " + h.name : "";
4337
4400
  D = " [Function" + ut + "]";
4338
4401
  }
4339
- if (oe(h) && (D = " " + RegExp.prototype.toString.call(h)), Ne(h) && (D = " " + Date.prototype.toUTCString.call(h)), Ie(h) && (D = " " + p(h)), k.length === 0 && (!H || h.length == 0))
4340
- return Te[0] + D + Te[1];
4402
+ if (ae(h) && (D = " " + RegExp.prototype.toString.call(h)), Ne(h) && (D = " " + Date.prototype.toUTCString.call(h)), Ie(h) && (D = " " + p(h)), P.length === 0 && (!W || h.length == 0))
4403
+ return Oe[0] + D + Oe[1];
4341
4404
  if (m < 0)
4342
- return oe(h) ? d.stylize(RegExp.prototype.toString.call(h), "regexp") : d.stylize("[Object]", "special");
4405
+ return ae(h) ? d.stylize(RegExp.prototype.toString.call(h), "regexp") : d.stylize("[Object]", "special");
4343
4406
  d.seen.push(h);
4344
4407
  var Ve;
4345
- return H ? Ve = v(d, h, m, I, k) : Ve = k.map(function(ct) {
4346
- return w(d, h, m, I, ct, H);
4347
- }), d.seen.pop(), b(Ve, D, Te);
4408
+ return W ? Ve = v(d, h, m, O, P) : Ve = P.map(function(ct) {
4409
+ return w(d, h, m, O, ct, W);
4410
+ }), d.seen.pop(), b(Ve, D, Oe);
4348
4411
  }
4349
4412
  function f(d, h) {
4350
- if (O(h))
4413
+ if (_(h))
4351
4414
  return d.stylize("undefined", "undefined");
4352
- if (P(h)) {
4415
+ if (k(h)) {
4353
4416
  var m = "'" + JSON.stringify(h).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
4354
4417
  return d.stylize(m, "string");
4355
4418
  }
4356
- if (re(h))
4419
+ if (ne(h))
4357
4420
  return d.stylize("" + h, "number");
4358
4421
  if (S(h))
4359
4422
  return d.stylize("" + h, "boolean");
@@ -4364,17 +4427,17 @@ var uu = gr.exports;
4364
4427
  return "[" + Error.prototype.toString.call(d) + "]";
4365
4428
  }
4366
4429
  function v(d, h, m, A, C) {
4367
- for (var k = [], I = 0, L = h.length; I < L; ++I)
4368
- De(h, String(I)) ? k.push(w(
4430
+ for (var P = [], O = 0, L = h.length; O < L; ++O)
4431
+ De(h, String(O)) ? P.push(w(
4369
4432
  d,
4370
4433
  h,
4371
4434
  m,
4372
4435
  A,
4373
- String(I),
4436
+ String(O),
4374
4437
  !0
4375
- )) : k.push("");
4438
+ )) : P.push("");
4376
4439
  return C.forEach(function(D) {
4377
- D.match(/^\d+$/) || k.push(w(
4440
+ D.match(/^\d+$/) || P.push(w(
4378
4441
  d,
4379
4442
  h,
4380
4443
  m,
@@ -4382,31 +4445,31 @@ var uu = gr.exports;
4382
4445
  D,
4383
4446
  !0
4384
4447
  ));
4385
- }), k;
4386
- }
4387
- function w(d, h, m, A, C, k) {
4388
- var I, L, D;
4389
- if (D = Object.getOwnPropertyDescriptor(h, C) || { value: h[C] }, D.get ? D.set ? L = d.stylize("[Getter/Setter]", "special") : L = d.stylize("[Getter]", "special") : D.set && (L = d.stylize("[Setter]", "special")), De(A, C) || (I = "[" + C + "]"), L || (d.seen.indexOf(D.value) < 0 ? (F(m) ? L = c(d, D.value, null) : L = c(d, D.value, m - 1), L.indexOf(`
4390
- `) > -1 && (k ? L = L.split(`
4391
- `).map(function(H) {
4392
- return " " + H;
4448
+ }), P;
4449
+ }
4450
+ function w(d, h, m, A, C, P) {
4451
+ var O, L, D;
4452
+ if (D = Object.getOwnPropertyDescriptor(h, C) || { value: h[C] }, D.get ? D.set ? L = d.stylize("[Getter/Setter]", "special") : L = d.stylize("[Getter]", "special") : D.set && (L = d.stylize("[Setter]", "special")), De(A, C) || (O = "[" + C + "]"), L || (d.seen.indexOf(D.value) < 0 ? (F(m) ? L = c(d, D.value, null) : L = c(d, D.value, m - 1), L.indexOf(`
4453
+ `) > -1 && (P ? L = L.split(`
4454
+ `).map(function(W) {
4455
+ return " " + W;
4393
4456
  }).join(`
4394
4457
  `).slice(2) : L = `
4395
4458
  ` + L.split(`
4396
- `).map(function(H) {
4397
- return " " + H;
4459
+ `).map(function(W) {
4460
+ return " " + W;
4398
4461
  }).join(`
4399
- `))) : L = d.stylize("[Circular]", "special")), O(I)) {
4400
- if (k && C.match(/^\d+$/))
4462
+ `))) : L = d.stylize("[Circular]", "special")), _(O)) {
4463
+ if (P && C.match(/^\d+$/))
4401
4464
  return L;
4402
- I = JSON.stringify("" + C), I.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (I = I.slice(1, -1), I = d.stylize(I, "name")) : (I = I.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), I = d.stylize(I, "string"));
4465
+ O = JSON.stringify("" + C), O.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (O = O.slice(1, -1), O = d.stylize(O, "name")) : (O = O.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), O = d.stylize(O, "string"));
4403
4466
  }
4404
- return I + ": " + L;
4467
+ return O + ": " + L;
4405
4468
  }
4406
4469
  function b(d, h, m) {
4407
- var A = d.reduce(function(C, k) {
4408
- return k.indexOf(`
4409
- `) >= 0, C + k.replace(/\u001b\[\d\d?m/g, "").length + 1;
4470
+ var A = d.reduce(function(C, P) {
4471
+ return P.indexOf(`
4472
+ `) >= 0, C + P.replace(/\u001b\[\d\d?m/g, "").length + 1;
4410
4473
  }, 0);
4411
4474
  return A > 60 ? m[0] + (h === "" ? "" : h + `
4412
4475
  `) + " " + d.join(`,
@@ -4425,52 +4488,52 @@ var uu = gr.exports;
4425
4488
  return d === null;
4426
4489
  }
4427
4490
  t.isNull = F;
4428
- function K(d) {
4491
+ function z(d) {
4429
4492
  return d == null;
4430
4493
  }
4431
- t.isNullOrUndefined = K;
4432
- function re(d) {
4494
+ t.isNullOrUndefined = z;
4495
+ function ne(d) {
4433
4496
  return typeof d == "number";
4434
4497
  }
4435
- t.isNumber = re;
4436
- function P(d) {
4498
+ t.isNumber = ne;
4499
+ function k(d) {
4437
4500
  return typeof d == "string";
4438
4501
  }
4439
- t.isString = P;
4502
+ t.isString = k;
4440
4503
  function V(d) {
4441
4504
  return typeof d == "symbol";
4442
4505
  }
4443
4506
  t.isSymbol = V;
4444
- function O(d) {
4507
+ function _(d) {
4445
4508
  return d === void 0;
4446
4509
  }
4447
- t.isUndefined = O;
4448
- function oe(d) {
4449
- return se(d) && we(d) === "[object RegExp]";
4510
+ t.isUndefined = _;
4511
+ function ae(d) {
4512
+ return ue(d) && Ae(d) === "[object RegExp]";
4450
4513
  }
4451
- t.isRegExp = oe, t.types.isRegExp = oe;
4452
- function se(d) {
4514
+ t.isRegExp = ae, t.types.isRegExp = ae;
4515
+ function ue(d) {
4453
4516
  return typeof d == "object" && d !== null;
4454
4517
  }
4455
- t.isObject = se;
4518
+ t.isObject = ue;
4456
4519
  function Ne(d) {
4457
- return se(d) && we(d) === "[object Date]";
4520
+ return ue(d) && Ae(d) === "[object Date]";
4458
4521
  }
4459
4522
  t.isDate = Ne, t.types.isDate = Ne;
4460
4523
  function Ie(d) {
4461
- return se(d) && (we(d) === "[object Error]" || d instanceof Error);
4524
+ return ue(d) && (Ae(d) === "[object Error]" || d instanceof Error);
4462
4525
  }
4463
4526
  t.isError = Ie, t.types.isNativeError = Ie;
4464
- function fe(d) {
4527
+ function pe(d) {
4465
4528
  return typeof d == "function";
4466
4529
  }
4467
- t.isFunction = fe;
4468
- function Bt(d) {
4530
+ t.isFunction = pe;
4531
+ function qt(d) {
4469
4532
  return d === null || typeof d == "boolean" || typeof d == "number" || typeof d == "string" || typeof d == "symbol" || // ES6 symbol
4470
4533
  typeof d > "u";
4471
4534
  }
4472
- t.isPrimitive = Bt, t.isBuffer = au;
4473
- function we(d) {
4535
+ t.isPrimitive = qt, t.isBuffer = au;
4536
+ function Ae(d) {
4474
4537
  return Object.prototype.toString.call(d);
4475
4538
  }
4476
4539
  function Je(d) {
@@ -4490,7 +4553,7 @@ var uu = gr.exports;
4490
4553
  "Nov",
4491
4554
  "Dec"
4492
4555
  ];
4493
- function qt() {
4556
+ function Ut() {
4494
4557
  var d = /* @__PURE__ */ new Date(), h = [
4495
4558
  Je(d.getHours()),
4496
4559
  Je(d.getMinutes()),
@@ -4499,9 +4562,9 @@ var uu = gr.exports;
4499
4562
  return [d.getDate(), Fe[d.getMonth()], h].join(" ");
4500
4563
  }
4501
4564
  t.log = function() {
4502
- console.log("%s - %s", qt(), t.format.apply(t, arguments));
4565
+ console.log("%s - %s", Ut(), t.format.apply(t, arguments));
4503
4566
  }, t.inherits = uu, t._extend = function(d, h) {
4504
- if (!h || !se(h)) return d;
4567
+ if (!h || !ue(h)) return d;
4505
4568
  for (var m = Object.keys(h), A = m.length; A--; )
4506
4569
  d[m[A]] = h[m[A]];
4507
4570
  return d;
@@ -4509,15 +4572,15 @@ var uu = gr.exports;
4509
4572
  function De(d, h) {
4510
4573
  return Object.prototype.hasOwnProperty.call(d, h);
4511
4574
  }
4512
- var pe = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
4575
+ var he = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
4513
4576
  t.promisify = function(h) {
4514
4577
  if (typeof h != "function")
4515
4578
  throw new TypeError('The "original" argument must be of type Function');
4516
- if (pe && h[pe]) {
4517
- var m = h[pe];
4579
+ if (he && h[he]) {
4580
+ var m = h[he];
4518
4581
  if (typeof m != "function")
4519
4582
  throw new TypeError('The "util.promisify.custom" argument must be of type Function');
4520
- return Object.defineProperty(m, pe, {
4583
+ return Object.defineProperty(m, he, {
4521
4584
  value: m,
4522
4585
  enumerable: !1,
4523
4586
  writable: !1,
@@ -4525,21 +4588,21 @@ var uu = gr.exports;
4525
4588
  }), m;
4526
4589
  }
4527
4590
  function m() {
4528
- for (var A, C, k = new Promise(function(D, H) {
4529
- A = D, C = H;
4530
- }), I = [], L = 0; L < arguments.length; L++)
4531
- I.push(arguments[L]);
4532
- I.push(function(D, H) {
4533
- D ? C(D) : A(H);
4591
+ for (var A, C, P = new Promise(function(D, W) {
4592
+ A = D, C = W;
4593
+ }), O = [], L = 0; L < arguments.length; L++)
4594
+ O.push(arguments[L]);
4595
+ O.push(function(D, W) {
4596
+ D ? C(D) : A(W);
4534
4597
  });
4535
4598
  try {
4536
- h.apply(this, I);
4599
+ h.apply(this, O);
4537
4600
  } catch (D) {
4538
4601
  C(D);
4539
4602
  }
4540
- return k;
4603
+ return P;
4541
4604
  }
4542
- return Object.setPrototypeOf(m, Object.getPrototypeOf(h)), pe && Object.defineProperty(m, pe, {
4605
+ return Object.setPrototypeOf(m, Object.getPrototypeOf(h)), he && Object.defineProperty(m, he, {
4543
4606
  value: m,
4544
4607
  enumerable: !1,
4545
4608
  writable: !1,
@@ -4548,7 +4611,7 @@ var uu = gr.exports;
4548
4611
  m,
4549
4612
  e(h)
4550
4613
  );
4551
- }, t.promisify.custom = pe;
4614
+ }, t.promisify.custom = he;
4552
4615
  function Re(d, h) {
4553
4616
  if (!d) {
4554
4617
  var m = new Error("Promise was rejected with a falsy value");
@@ -4565,15 +4628,15 @@ var uu = gr.exports;
4565
4628
  var C = m.pop();
4566
4629
  if (typeof C != "function")
4567
4630
  throw new TypeError("The last argument must be of type Function");
4568
- var k = this, I = function() {
4569
- return C.apply(k, arguments);
4631
+ var P = this, O = function() {
4632
+ return C.apply(P, arguments);
4570
4633
  };
4571
4634
  d.apply(this, m).then(
4572
4635
  function(L) {
4573
- E.nextTick(I.bind(null, null, L));
4636
+ E.nextTick(O.bind(null, null, L));
4574
4637
  },
4575
4638
  function(L) {
4576
- E.nextTick(Re.bind(null, L, I));
4639
+ E.nextTick(Re.bind(null, L, O));
4577
4640
  }
4578
4641
  );
4579
4642
  }
@@ -4583,43 +4646,43 @@ var uu = gr.exports;
4583
4646
  ), h;
4584
4647
  }
4585
4648
  t.callbackify = at;
4586
- })(Dt);
4587
- const { inherits: cu, format: Jt } = Dt;
4588
- function Oe(t, e, r = Error) {
4649
+ })(Rt);
4650
+ const { inherits: cu, format: Xt } = Rt;
4651
+ function Te(t, e, r = Error) {
4589
4652
  if (!t) throw new Error("Avvio error code must not be empty");
4590
4653
  if (!e) throw new Error("Avvio base error message must not be empty");
4591
4654
  function n(i, o, s) {
4592
4655
  if (!new.target)
4593
4656
  return new n(i, o, s);
4594
- Error.captureStackTrace(this, n), this.code = t, this.message = e, this.name = "AvvioError", i && o && s ? this.message = Jt(e, i, o, s) : i && o ? this.message = Jt(e, i, o) : i ? this.message = Jt(e, i) : this.message = e;
4657
+ Error.captureStackTrace(this, n), this.code = t, this.message = e, this.name = "AvvioError", i && o && s ? this.message = Xt(e, i, o, s) : i && o ? this.message = Xt(e, i, o) : i ? this.message = Xt(e, i) : this.message = e;
4595
4658
  }
4596
4659
  return n.prototype[Symbol.toStringTag] = "Error", n.prototype.toString = function() {
4597
4660
  return `${this.name} [${this.code}]: ${this.message}`;
4598
4661
  }, cu(n, r), n;
4599
4662
  }
4600
4663
  var hi = {
4601
- createError: Oe,
4602
- AVV_ERR_EXPOSE_ALREADY_DEFINED: Oe(
4664
+ createError: Te,
4665
+ AVV_ERR_EXPOSE_ALREADY_DEFINED: Te(
4603
4666
  "AVV_ERR_EXPOSE_ALREADY_DEFINED",
4604
4667
  "'%s' () is already defined, specify an expose option"
4605
4668
  ),
4606
- AVV_ERR_CALLBACK_NOT_FN: Oe(
4669
+ AVV_ERR_CALLBACK_NOT_FN: Te(
4607
4670
  "AVV_ERR_CALLBACK_NOT_FN",
4608
4671
  "Callback for '%s' hook is not a function. Received: '%s'"
4609
4672
  ),
4610
- AVV_ERR_PLUGIN_NOT_VALID: Oe(
4673
+ AVV_ERR_PLUGIN_NOT_VALID: Te(
4611
4674
  "AVV_ERR_PLUGIN_NOT_VALID",
4612
4675
  "Plugin must be a function or a promise. Received: '%s'"
4613
4676
  ),
4614
- AVV_ERR_ROOT_PLG_BOOTED: Oe(
4677
+ AVV_ERR_ROOT_PLG_BOOTED: Te(
4615
4678
  "AVV_ERR_PLUGIN_NOT_VALID",
4616
4679
  "Root plugin has already booted"
4617
4680
  ),
4618
- AVV_ERR_PARENT_PLG_LOADED: Oe(
4681
+ AVV_ERR_PARENT_PLG_LOADED: Te(
4619
4682
  "AVV_ERR_PARENT_PLG_LOADED",
4620
4683
  "Impossible to load '%s' plugin because the parent '%s' was already loaded"
4621
4684
  ),
4622
- AVV_ERR_READY_TIMEOUT: Oe(
4685
+ AVV_ERR_READY_TIMEOUT: Te(
4623
4686
  "AVV_ERR_READY_TIMEOUT",
4624
4687
  "Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise"
4625
4688
  )
@@ -4645,12 +4708,12 @@ var hi = {
4645
4708
  return r + i(c ? "└" : "├") + i("─") + i(f ? "┬" : "─") + " " + t(u, p, n).slice(r.length + 2);
4646
4709
  }).join("");
4647
4710
  };
4648
- const du = lu, vn = Symbol("avvio.TimeTree.untrackNode"), Xt = Symbol("avvio.TimeTree.trackNode"), Sn = Symbol("avvio.TimeTree.getParent"), wn = Symbol("avvio.TimeTree.getNode"), An = Symbol("avvio.TimeTree.addNode");
4711
+ const du = lu, vn = Symbol("avvio.TimeTree.untrackNode"), Zt = Symbol("avvio.TimeTree.trackNode"), Sn = Symbol("avvio.TimeTree.getParent"), wn = Symbol("avvio.TimeTree.getNode"), An = Symbol("avvio.TimeTree.addNode");
4649
4712
  let fu = class {
4650
4713
  constructor() {
4651
4714
  this.root = null, this.tableId = /* @__PURE__ */ new Map(), this.tableLabel = /* @__PURE__ */ new Map();
4652
4715
  }
4653
- [Xt](e) {
4716
+ [Zt](e) {
4654
4717
  this.tableId.set(e.id, e), this.tableLabel.has(e.label) ? this.tableLabel.get(e.label).push(e) : this.tableLabel.set(e.label, [e]);
4655
4718
  }
4656
4719
  [vn](e) {
@@ -4678,7 +4741,7 @@ let fu = class {
4678
4741
  label: r,
4679
4742
  start: n,
4680
4743
  nodes: []
4681
- }, this[Xt](this.root), this.root.id;
4744
+ }, this[Zt](this.root), this.root.id;
4682
4745
  const o = this[Sn](e), s = `${r}-${Math.random()}`, a = {
4683
4746
  id: s,
4684
4747
  parent: e,
@@ -4686,7 +4749,7 @@ let fu = class {
4686
4749
  label: r,
4687
4750
  nodes: []
4688
4751
  };
4689
- return o.nodes.push(a), this[Xt](a), s;
4752
+ return o.nodes.push(a), this[Zt](a), s;
4690
4753
  }
4691
4754
  start(e, r, n = Date.now()) {
4692
4755
  return this[An](e, r, n);
@@ -4703,12 +4766,12 @@ let fu = class {
4703
4766
  return du(r);
4704
4767
  }
4705
4768
  };
4706
- var pu = fu, Dr = { exports: {} }, br = { exports: {} }, Zt, En;
4769
+ var pu = fu, Dr = { exports: {} }, br = { exports: {} }, er, En;
4707
4770
  function hu() {
4708
- if (En) return Zt;
4771
+ if (En) return er;
4709
4772
  En = 1;
4710
4773
  var t = 1e3, e = t * 60, r = e * 60, n = r * 24, i = n * 7, o = n * 365.25;
4711
- Zt = function(c, f) {
4774
+ er = function(c, f) {
4712
4775
  f = f || {};
4713
4776
  var p = typeof c;
4714
4777
  if (p === "string" && c.length > 0)
@@ -4783,7 +4846,7 @@ function hu() {
4783
4846
  var w = f >= p * 1.5;
4784
4847
  return Math.round(c / p) + " " + v + (w ? "s" : "");
4785
4848
  }
4786
- return Zt;
4849
+ return er;
4787
4850
  }
4788
4851
  function yu(t) {
4789
4852
  r.debug = r, r.default = r, r.coerce = u, r.disable = o, r.enable = i, r.enabled = s, r.humanize = hu(), r.destroy = l, Object.keys(t).forEach((c) => {
@@ -4801,17 +4864,17 @@ function yu(t) {
4801
4864
  function b(...g) {
4802
4865
  if (!b.enabled)
4803
4866
  return;
4804
- const S = b, F = Number(/* @__PURE__ */ new Date()), K = F - (f || F);
4805
- S.diff = K, S.prev = f, S.curr = F, f = F, g[0] = r.coerce(g[0]), typeof g[0] != "string" && g.unshift("%O");
4806
- let re = 0;
4807
- g[0] = g[0].replace(/%([a-zA-Z%])/g, (V, O) => {
4867
+ const S = b, F = Number(/* @__PURE__ */ new Date()), z = F - (f || F);
4868
+ S.diff = z, S.prev = f, S.curr = F, f = F, g[0] = r.coerce(g[0]), typeof g[0] != "string" && g.unshift("%O");
4869
+ let ne = 0;
4870
+ g[0] = g[0].replace(/%([a-zA-Z%])/g, (V, _) => {
4808
4871
  if (V === "%%")
4809
4872
  return "%";
4810
- re++;
4811
- const oe = r.formatters[O];
4812
- if (typeof oe == "function") {
4813
- const se = g[re];
4814
- V = oe.call(S, se), g.splice(re, 1), re--;
4873
+ ne++;
4874
+ const ae = r.formatters[_];
4875
+ if (typeof ae == "function") {
4876
+ const ue = g[ne];
4877
+ V = ae.call(S, ue), g.splice(ne, 1), ne--;
4815
4878
  }
4816
4879
  return V;
4817
4880
  }), r.formatArgs.call(S, g), (S.log || r.log).apply(S, g);
@@ -5001,9 +5064,9 @@ var mu = yu;
5001
5064
  };
5002
5065
  })(br, br.exports);
5003
5066
  var yi = br.exports;
5004
- const gu = jn, bu = Jn.EventEmitter, vu = Dt.inherits, j = yi("avvio"), { AVV_ERR_READY_TIMEOUT: Su } = hi, er = Symbol.for("plugin-meta");
5067
+ const gu = jn, bu = Jn.EventEmitter, vu = Rt.inherits, x = yi("avvio"), { AVV_ERR_READY_TIMEOUT: Su } = hi, tr = Symbol.for("plugin-meta");
5005
5068
  function wu(t, e) {
5006
- return t[er] && t[er].name ? t[er].name : typeof e < "u" && typeof e != "function" && e.name ? e.name : t.name ? t.name : t.toString().split(`
5069
+ return t[tr] && t[tr].name ? t[tr].name : typeof e < "u" && typeof e != "function" && e.name ? e.name : t.name ? t.name : t.toString().split(`
5007
5070
  `).slice(0, 2).map((r) => r.trim()).join(" -- ");
5008
5071
  }
5009
5072
  function Au() {
@@ -5021,7 +5084,7 @@ Ye.prototype.exec = function(t, e) {
5021
5084
  let n = !1;
5022
5085
  const i = this.name;
5023
5086
  if (this.parent._error && !this.isAfter) {
5024
- j("skipping loading of plugin as parent errored and it is not an after", i), E.nextTick(e);
5087
+ x("skipping loading of plugin as parent errored and it is not an after", i), E.nextTick(e);
5025
5088
  return;
5026
5089
  }
5027
5090
  if (this.isAfter)
@@ -5030,24 +5093,24 @@ Ye.prototype.exec = function(t, e) {
5030
5093
  try {
5031
5094
  this.server = this.parent.override(t, r, this.opts);
5032
5095
  } catch (u) {
5033
- return j("override errored", i), e(u);
5096
+ return x("override errored", i), e(u);
5034
5097
  }
5035
- this.opts = typeof this.opts == "function" ? this.opts(this.server) : this.opts, j("exec", i);
5098
+ this.opts = typeof this.opts == "function" ? this.opts(this.server) : this.opts, x("exec", i);
5036
5099
  let o;
5037
5100
  const s = (u) => {
5038
5101
  if (n) {
5039
- j("loading complete", i);
5102
+ x("loading complete", i);
5040
5103
  return;
5041
5104
  }
5042
- this._error = u, j(u ? "exec errored" : "exec completed", i), n = !0, o && clearTimeout(o), e(u);
5105
+ this._error = u, x(u ? "exec errored" : "exec completed", i), n = !0, o && clearTimeout(o), e(u);
5043
5106
  };
5044
- this.timeout > 0 && (j("setting up timeout", i, this.timeout), o = setTimeout(function() {
5045
- j("timed out", i), o = null;
5107
+ this.timeout > 0 && (x("setting up timeout", i, this.timeout), o = setTimeout(function() {
5108
+ x("timed out", i), o = null;
5046
5109
  const u = new Su(i);
5047
5110
  u.fn = r, s(u);
5048
5111
  }, this.timeout)), this.started = !0, this.emit("start", this.server ? this.server.name : null, this.name, Date.now());
5049
5112
  const a = r(this.server, this.opts, s);
5050
- a && typeof a.then == "function" && (j("exec: resolving promise", i), a.then(
5113
+ a && typeof a.then == "function" && (x("exec: resolving promise", i), a.then(
5051
5114
  () => E.nextTick(s),
5052
5115
  (u) => E.nextTick(s, u)
5053
5116
  ));
@@ -5057,36 +5120,36 @@ Ye.prototype.loadedSoFar = function() {
5057
5120
  return Promise.resolve();
5058
5121
  const t = () => {
5059
5122
  this.server.after((r, n) => {
5060
- this._error = r, this.q.pause(), r ? (j("rejecting promise", this.name, r), this._promise.reject(r)) : (j("resolving promise", this.name), this._promise.resolve()), this._promise = null, E.nextTick(n, r);
5123
+ this._error = r, this.q.pause(), r ? (x("rejecting promise", this.name, r), this._promise.reject(r)) : (x("resolving promise", this.name), this._promise.resolve()), this._promise = null, E.nextTick(n, r);
5061
5124
  }), this.q.resume();
5062
5125
  };
5063
5126
  let e;
5064
5127
  return this._promise ? e = Promise.resolve() : (this._promise = Au(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
5065
5128
  };
5066
5129
  Ye.prototype.enqueue = function(t, e) {
5067
- j("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
5130
+ x("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
5068
5131
  };
5069
5132
  Ye.prototype.finish = function(t, e) {
5070
- j("finish", this.name, t);
5133
+ x("finish", this.name, t);
5071
5134
  const r = () => {
5072
- this.loaded || (j("loaded", this.name), this.emit("loaded", this.server ? this.server.name : null, this.name, Date.now()), this.loaded = !0, e(t));
5135
+ this.loaded || (x("loaded", this.name), this.emit("loaded", this.server ? this.server.name : null, this.name, Date.now()), this.loaded = !0, e(t));
5073
5136
  };
5074
5137
  if (t) {
5075
5138
  this._promise && (this._promise.reject(t), this._promise = null), r();
5076
5139
  return;
5077
5140
  }
5078
5141
  const n = () => {
5079
- if (j("check", this.name, this.q.length(), this.q.running(), this._promise), this.q.length() === 0 && this.q.running() === 0)
5142
+ if (x("check", this.name, this.q.length(), this.q.running(), this._promise), this.q.length() === 0 && this.q.running() === 0)
5080
5143
  if (this._promise) {
5081
5144
  const i = () => {
5082
- j("wrap"), queueMicrotask(n);
5145
+ x("wrap"), queueMicrotask(n);
5083
5146
  };
5084
5147
  this._promise.resolve(), this._promise.promise.then(i, i), this._promise = null;
5085
5148
  } else
5086
5149
  r();
5087
5150
  else
5088
- j("delayed", this.name), this.q.drain = () => {
5089
- j("drain", this.name), this.q.drain = Iu, queueMicrotask(n);
5151
+ x("delayed", this.name), this.q.drain = () => {
5152
+ x("drain", this.name), this.q.drain = Iu, queueMicrotask(n);
5090
5153
  };
5091
5154
  };
5092
5155
  queueMicrotask(n), this.q.resume();
@@ -5113,30 +5176,30 @@ function Iu() {
5113
5176
  }
5114
5177
  Dr.exports = Ye;
5115
5178
  Dr.exports.loadPlugin = Rr;
5116
- var Tu = Dr.exports;
5117
- const In = jn, Ou = Jn.EventEmitter, _u = Dt.inherits, {
5118
- AVV_ERR_EXPOSE_ALREADY_DEFINED: tr,
5179
+ var Ou = Dr.exports;
5180
+ const In = jn, Tu = Jn.EventEmitter, _u = Rt.inherits, {
5181
+ AVV_ERR_EXPOSE_ALREADY_DEFINED: rr,
5119
5182
  AVV_ERR_CALLBACK_NOT_FN: tt,
5120
5183
  AVV_ERR_PLUGIN_NOT_VALID: Lu,
5121
5184
  AVV_ERR_ROOT_PLG_BOOTED: Cu,
5122
- AVV_ERR_READY_TIMEOUT: ku
5123
- } = hi, Pu = pu, vr = Tu, He = yi("avvio"), Ct = Symbol("kAvvio"), rr = Symbol("kThenifyDoNotWrap");
5185
+ AVV_ERR_READY_TIMEOUT: Pu
5186
+ } = hi, ku = pu, vr = Ou, He = yi("avvio"), Pt = Symbol("kAvvio"), nr = Symbol("kThenifyDoNotWrap");
5124
5187
  function Nu(t, e, r) {
5125
5188
  const n = e.expose || {}, i = n.use || "use", o = n.after || "after", s = n.ready || "ready", a = n.onClose || "onClose", u = n.close || "close";
5126
5189
  if (t[i])
5127
- throw new tr(i);
5190
+ throw new rr(i);
5128
5191
  if (t[o])
5129
- throw new tr(o);
5192
+ throw new rr(o);
5130
5193
  if (t[s])
5131
- throw new tr(s);
5194
+ throw new rr(s);
5132
5195
  t[i] = function(l, c) {
5133
5196
  return r.use(l, c), this;
5134
- }, Object.defineProperty(t, "then", { get: mi.bind(r) }), t[Ct] = !0, t[o] = function(l) {
5135
- return typeof l != "function" ? r._loadRegistered() : (r.after(nr(l, this)), this);
5197
+ }, Object.defineProperty(t, "then", { get: mi.bind(r) }), t[Pt] = !0, t[o] = function(l) {
5198
+ return typeof l != "function" ? r._loadRegistered() : (r.after(ir(l, this)), this);
5136
5199
  }, t[s] = function(l) {
5137
5200
  if (l && typeof l != "function")
5138
5201
  throw new tt(s, typeof l);
5139
- return r.ready(l ? nr(l, this) : void 0);
5202
+ return r.ready(l ? ir(l, this) : void 0);
5140
5203
  }, t[a] = function(l) {
5141
5204
  if (typeof l != "function")
5142
5205
  throw new tt(a, typeof l);
@@ -5144,18 +5207,18 @@ function Nu(t, e, r) {
5144
5207
  }, t[u] = function(l) {
5145
5208
  if (l && typeof l != "function")
5146
5209
  throw new tt(u, typeof l);
5147
- return l ? (r.close(nr(l, this)), this) : r.close();
5210
+ return l ? (r.close(ir(l, this)), this) : r.close();
5148
5211
  };
5149
5212
  }
5150
- function G(t, e, r) {
5151
- if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof G)) {
5152
- const n = new G(t, e, r);
5213
+ function K(t, e, r) {
5214
+ if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof K)) {
5215
+ const n = new K(t, e, r);
5153
5216
  return t && Nu(t, e, n), n;
5154
5217
  }
5155
- e.autostart !== !1 && (e.autostart = !0), t = t || this, this._timeout = Number(e.timeout) || 0, this._server = t, this._current = [], this._error = null, this._isOnCloseHandlerKey = Symbol("isOnCloseHandler"), this._lastUsed = null, this.setMaxListeners(0), r && this.once("start", r), this.started = !1, this.booted = !1, this.pluginTree = new Pu(), this._readyQ = In(this, gi, 1), this._readyQ.pause(), this._readyQ.drain = () => {
5156
- this.emit("start"), this._readyQ.drain = Tn;
5218
+ e.autostart !== !1 && (e.autostart = !0), t = t || this, this._timeout = Number(e.timeout) || 0, this._server = t, this._current = [], this._error = null, this._isOnCloseHandlerKey = Symbol("isOnCloseHandler"), this._lastUsed = null, this.setMaxListeners(0), r && this.once("start", r), this.started = !1, this.booted = !1, this.pluginTree = new ku(), this._readyQ = In(this, gi, 1), this._readyQ.pause(), this._readyQ.drain = () => {
5219
+ this.emit("start"), this._readyQ.drain = On;
5157
5220
  }, this._closeQ = In(this, Vu, 1), this._closeQ.pause(), this._closeQ.drain = () => {
5158
- this.emit("close"), this._closeQ.drain = Tn;
5221
+ this.emit("close"), this._closeQ.drain = On;
5159
5222
  }, this._doStart = null, this._root = new vr(this, Fu.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
5160
5223
  const s = this.pluginTree.start(null, i, o);
5161
5224
  this._root.once("loaded", (a, u, l) => {
@@ -5179,11 +5242,11 @@ function G(t, e, r) {
5179
5242
  function Fu(t, e, r) {
5180
5243
  this._doStart = r, e.autostart && this.start();
5181
5244
  }
5182
- _u(G, Ou);
5183
- G.prototype.start = function() {
5245
+ _u(K, Tu);
5246
+ K.prototype.start = function() {
5184
5247
  return this.started = !0, E.nextTick(this._doStart), this;
5185
5248
  };
5186
- G.prototype.override = function(t, e, r) {
5249
+ K.prototype.override = function(t, e, r) {
5187
5250
  return t;
5188
5251
  };
5189
5252
  function Du(t) {
@@ -5191,16 +5254,16 @@ function Du(t) {
5191
5254
  throw new Lu(typeof t);
5192
5255
  return t;
5193
5256
  }
5194
- G.prototype[Ct] = !0;
5195
- G.prototype.use = function(t, e) {
5257
+ K.prototype[Pt] = !0;
5258
+ K.prototype.use = function(t, e) {
5196
5259
  return this._lastUsed = this._addPlugin(t, e, !1), this;
5197
5260
  };
5198
- G.prototype._loadRegistered = function() {
5261
+ K.prototype._loadRegistered = function() {
5199
5262
  const t = this._current[0];
5200
5263
  return !this.started && !this.booted && E.nextTick(() => this._root.q.resume()), t ? t.loadedSoFar() : Promise.resolve();
5201
5264
  };
5202
- Object.defineProperty(G.prototype, "then", { get: mi });
5203
- G.prototype._addPlugin = function(t, e, r) {
5265
+ Object.defineProperty(K.prototype, "then", { get: mi });
5266
+ K.prototype._addPlugin = function(t, e, r) {
5204
5267
  if (t = Du(t), e = e || {}, this.booted)
5205
5268
  throw new Cu();
5206
5269
  const n = this._current[0], i = new vr(this, t, e, r);
@@ -5215,7 +5278,7 @@ G.prototype._addPlugin = function(t, e, r) {
5215
5278
  o && (this._error = o);
5216
5279
  }), i;
5217
5280
  };
5218
- G.prototype.after = function(t) {
5281
+ K.prototype.after = function(t) {
5219
5282
  if (!t)
5220
5283
  return this._loadRegistered();
5221
5284
  this._addPlugin(e.bind(this), {}, !0);
@@ -5224,7 +5287,7 @@ G.prototype.after = function(t) {
5224
5287
  }
5225
5288
  return this;
5226
5289
  };
5227
- G.prototype.onClose = function(t) {
5290
+ K.prototype.onClose = function(t) {
5228
5291
  if (typeof t != "function")
5229
5292
  throw new Error("not a function");
5230
5293
  t[this._isOnCloseHandlerKey] = !0, this._closeQ.unshift(t, e.bind(this));
@@ -5233,7 +5296,7 @@ G.prototype.onClose = function(t) {
5233
5296
  }
5234
5297
  return this;
5235
5298
  };
5236
- G.prototype.close = function(t) {
5299
+ K.prototype.close = function(t) {
5237
5300
  let e;
5238
5301
  if (t) {
5239
5302
  if (typeof t != "function")
@@ -5250,7 +5313,7 @@ G.prototype.close = function(t) {
5250
5313
  this._error = null, this._closeQ.push(t), E.nextTick(this._closeQ.resume.bind(this._closeQ));
5251
5314
  }), e;
5252
5315
  };
5253
- G.prototype.ready = function(t) {
5316
+ K.prototype.ready = function(t) {
5254
5317
  if (t) {
5255
5318
  if (typeof t != "function")
5256
5319
  throw new tt("ready", typeof t);
@@ -5265,32 +5328,32 @@ G.prototype.ready = function(t) {
5265
5328
  }
5266
5329
  });
5267
5330
  };
5268
- G.prototype.prettyPrint = function() {
5331
+ K.prototype.prettyPrint = function() {
5269
5332
  return this.pluginTree.prittyPrint();
5270
5333
  };
5271
- G.prototype.toJSON = function() {
5334
+ K.prototype.toJSON = function() {
5272
5335
  return this.pluginTree.toJSON();
5273
5336
  };
5274
- function Tn() {
5337
+ function On() {
5275
5338
  }
5276
5339
  function mi() {
5277
5340
  if (this.booted) {
5278
5341
  He("thenify returning null because we are already booted");
5279
5342
  return;
5280
5343
  }
5281
- if (this[rr]) {
5282
- this[rr] = !1;
5344
+ if (this[nr]) {
5345
+ this[nr] = !1;
5283
5346
  return;
5284
5347
  }
5285
- return He("thenify"), (t, e) => this._loadRegistered().then(() => (this[rr] = !0, t(this._server)), e);
5348
+ return He("thenify"), (t, e) => this._loadRegistered().then(() => (this[nr] = !0, t(this._server)), e);
5286
5349
  }
5287
5350
  function gi(t, e) {
5288
5351
  const r = this._server, n = this._error;
5289
5352
  let i;
5290
5353
  if (this._error = null, t.length === 0)
5291
- this._error = n, i = t(), i && !i[Ct] && typeof i.then == "function" ? i.then(() => E.nextTick(e), (o) => E.nextTick(e, o)) : E.nextTick(e);
5354
+ this._error = n, i = t(), i && !i[Pt] && typeof i.then == "function" ? i.then(() => E.nextTick(e), (o) => E.nextTick(e, o)) : E.nextTick(e);
5292
5355
  else if (t.length === 1)
5293
- i = t(n), i && !i[Ct] && typeof i.then == "function" ? i.then(() => E.nextTick(e), (o) => E.nextTick(e, o)) : E.nextTick(e);
5356
+ i = t(n), i && !i[Pt] && typeof i.then == "function" ? i.then(() => E.nextTick(e), (o) => E.nextTick(e, o)) : E.nextTick(e);
5294
5357
  else if (this._timeout === 0) {
5295
5358
  const o = (s) => {
5296
5359
  this._error = s, e(this._error);
@@ -5304,7 +5367,7 @@ function Ru(t, e, r, n) {
5304
5367
  He("setting up ready timeout", i, this._timeout);
5305
5368
  let o = setTimeout(() => {
5306
5369
  He("timed out", i), o = null;
5307
- const a = new ku(i);
5370
+ const a = new Pu(i);
5308
5371
  a.fn = t, this._error = a, n(a);
5309
5372
  }, this._timeout);
5310
5373
  t.length === 2 ? t(e, s.bind(this)) : t(e, r, s.bind(this));
@@ -5333,7 +5396,7 @@ function $u(t, e) {
5333
5396
  }, i) : E.nextTick(i)) : t(this, i);
5334
5397
  }
5335
5398
  }
5336
- function nr(t, e) {
5399
+ function ir(t, e) {
5337
5400
  return r.bind(e);
5338
5401
  function r(n, i) {
5339
5402
  let o;
@@ -5344,9 +5407,9 @@ function nr(t, e) {
5344
5407
  }, i) : E.nextTick(i)) : t.length === 2 ? t(n, i) : t(n, this, i) : E.nextTick(i);
5345
5408
  }
5346
5409
  }
5347
- Er.exports = G;
5410
+ Er.exports = K;
5348
5411
  Er.exports.express = function(t) {
5349
- return G(t, {
5412
+ return K(t, {
5350
5413
  expose: {
5351
5414
  use: "load"
5352
5415
  }
@@ -5377,7 +5440,7 @@ function cc(t, e = !0, r = !0, n = { friendsTab: "enabled" }) {
5377
5440
  onContentActivate: n?.onContentActivate,
5378
5441
  withAd: n?.withAd,
5379
5442
  withAdNotification: n?.withAdNotification
5380
- }), s.use(eo, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(oo), s.use(Bo), s.use(rs), s.use(Oo), s.use(fs), s.after((a, u, l) => {
5443
+ }), s.use(eo, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(oo), s.use(Bo), s.use(rs), s.use(To), s.use(fs), s.after((a, u, l) => {
5381
5444
  if (a)
5382
5445
  throw a;
5383
5446
  u.ready(), l();