@streamlayer/sdk-web 0.33.0 → 0.33.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/lib/cjs/index.js +12 -12
  2. package/lib/es/index.js +1113 -1046
  3. package/package.json +7 -7
package/lib/es/index.js CHANGED
@@ -1,28 +1,28 @@
1
1
  import { pino as Jn } from "pino";
2
- import { QuestionType as D, QuestionStatus as $e, SilenceSetting as Yn } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
2
+ import { QuestionType as D, QuestionStatus as ce, SilenceSetting as Yn } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
3
3
  import { PickHistoryStatus as at } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
4
4
  import { SdkOverlayType as N } from "@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb";
5
- import { InvitationCategory as vr, InvitationFrom as Sr } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
6
- import { computed as Xn, map as Zn, atom as At, batched as wr, onMount as nn } from "nanostores";
5
+ import { InvitationCategory as Sr, InvitationFrom as wr } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
6
+ import { computed as Xn, map as Zn, atom as At, batched as Ar, onMount as sr } from "nanostores";
7
7
  import { nanoid as Gt } from "nanoid";
8
- import { ConnectError as et, Code as te, createContextKey as Ar, createPromiseClient as Er, createContextValues as ei } from "@connectrpc/connect";
9
- import { createGrpcWebTransport as Ir } from "@connectrpc/connect-web";
10
- import { nanoquery as Tr } from "@nanostores/query";
8
+ import { ConnectError as et, Code as ee, createContextKey as Ir, createPromiseClient as Er, createContextValues as ei } from "@connectrpc/connect";
9
+ import { createGrpcWebTransport as Tr } from "@connectrpc/connect-web";
10
+ import { nanoquery as Or } from "@nanostores/query";
11
11
  import { Events as ti } from "@streamlayer/sl-eslib/sports/events/events_connect";
12
12
  import { Client as rt } from "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
13
- import { Users as sr } from "@streamlayer/sl-eslib/users/users_connect";
14
- import { Feed as be } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
15
- import { Leaderboard as on } from "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_connect";
13
+ import { Users as ar } from "@streamlayer/sl-eslib/users/users_connect";
14
+ import { Feed as ve } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
15
+ import { Leaderboard as nn } 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 ri } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
18
- import { Kind as J, TopicType as H, Category as Q, PollOpenedFrom as Ne, ScreenOrientation as Or } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
19
- import { AnalyticsService as sn } from "@streamlayer/sl-eslib/analytics/v2/streaming/streaming_connect";
20
- import { InteractionActionType as Cr } from "@streamlayer/sl-eslib/analytics/v1/interactions/interactions_pb";
18
+ import { Kind as H, TopicType as K, Category as Q, PollOpenedFrom as De, ScreenOrientation as Cr } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
19
+ import { AnalyticsService as on } from "@streamlayer/sl-eslib/analytics/v2/streaming/streaming_connect";
20
+ import { InteractionActionType as Lr } from "@streamlayer/sl-eslib/analytics/v1/interactions/interactions_pb";
21
21
  import { NotificationKind as ae, NotificationType as _r } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
22
22
  function ni(t) {
23
23
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
24
24
  }
25
- var an = { exports: {} }, $ = an.exports = {}, re, ne;
25
+ var sn = { exports: {} }, $ = sn.exports = {}, te, re;
26
26
  function Kt() {
27
27
  throw new Error("setTimeout has not been defined");
28
28
  }
@@ -31,58 +31,58 @@ function zt() {
31
31
  }
32
32
  (function() {
33
33
  try {
34
- typeof setTimeout == "function" ? re = setTimeout : re = Kt;
34
+ typeof setTimeout == "function" ? te = setTimeout : te = Kt;
35
35
  } catch {
36
- re = Kt;
36
+ te = Kt;
37
37
  }
38
38
  try {
39
- typeof clearTimeout == "function" ? ne = clearTimeout : ne = zt;
39
+ typeof clearTimeout == "function" ? re = clearTimeout : re = zt;
40
40
  } catch {
41
- ne = zt;
41
+ re = zt;
42
42
  }
43
43
  })();
44
- function un(t) {
45
- if (re === setTimeout)
44
+ function an(t) {
45
+ if (te === setTimeout)
46
46
  return setTimeout(t, 0);
47
- if ((re === Kt || !re) && setTimeout)
48
- return re = setTimeout, setTimeout(t, 0);
47
+ if ((te === Kt || !te) && setTimeout)
48
+ return te = setTimeout, setTimeout(t, 0);
49
49
  try {
50
- return re(t, 0);
50
+ return te(t, 0);
51
51
  } catch {
52
52
  try {
53
- return re.call(null, t, 0);
53
+ return te.call(null, t, 0);
54
54
  } catch {
55
- return re.call(this, t, 0);
55
+ return te.call(this, t, 0);
56
56
  }
57
57
  }
58
58
  }
59
59
  function ii(t) {
60
- if (ne === clearTimeout)
60
+ if (re === clearTimeout)
61
61
  return clearTimeout(t);
62
- if ((ne === zt || !ne) && clearTimeout)
63
- return ne = clearTimeout, clearTimeout(t);
62
+ if ((re === zt || !re) && clearTimeout)
63
+ return re = clearTimeout, clearTimeout(t);
64
64
  try {
65
- return ne(t);
65
+ return re(t);
66
66
  } catch {
67
67
  try {
68
- return ne.call(null, t);
68
+ return re.call(null, t);
69
69
  } catch {
70
- return ne.call(this, t);
70
+ return re.call(this, t);
71
71
  }
72
72
  }
73
73
  }
74
- var fe = [], xe = !1, Ee, lt = -1;
74
+ var he = [], xe = !1, Ee, lt = -1;
75
75
  function oi() {
76
- !xe || !Ee || (xe = !1, Ee.length ? fe = Ee.concat(fe) : lt = -1, fe.length && cn());
76
+ !xe || !Ee || (xe = !1, Ee.length ? he = Ee.concat(he) : lt = -1, he.length && un());
77
77
  }
78
- function cn() {
78
+ function un() {
79
79
  if (!xe) {
80
- var t = un(oi);
80
+ var t = an(oi);
81
81
  xe = !0;
82
- for (var e = fe.length; e; ) {
83
- for (Ee = fe, fe = []; ++lt < e; )
82
+ for (var e = he.length; e; ) {
83
+ for (Ee = he, he = []; ++lt < e; )
84
84
  Ee && Ee[lt].run();
85
- lt = -1, e = fe.length;
85
+ lt = -1, e = he.length;
86
86
  }
87
87
  Ee = null, xe = !1, ii(t);
88
88
  }
@@ -92,12 +92,12 @@ $.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
- fe.push(new ln(t, e)), fe.length === 1 && !xe && un(cn);
95
+ he.push(new cn(t, e)), he.length === 1 && !xe && an(un);
96
96
  };
97
- function ln(t, e) {
97
+ function cn(t, e) {
98
98
  this.fun = t, this.array = e;
99
99
  }
100
- ln.prototype.run = function() {
100
+ cn.prototype.run = function() {
101
101
  this.fun.apply(null, this.array);
102
102
  };
103
103
  $.title = "browser";
@@ -106,17 +106,17 @@ $.env = {};
106
106
  $.argv = [];
107
107
  $.version = "";
108
108
  $.versions = {};
109
- function ye() {
109
+ function ge() {
110
110
  }
111
- $.on = ye;
112
- $.addListener = ye;
113
- $.once = ye;
114
- $.off = ye;
115
- $.removeListener = ye;
116
- $.removeAllListeners = ye;
117
- $.emit = ye;
118
- $.prependListener = ye;
119
- $.prependOnceListener = ye;
111
+ $.on = ge;
112
+ $.addListener = ge;
113
+ $.once = ge;
114
+ $.off = ge;
115
+ $.removeListener = ge;
116
+ $.removeAllListeners = ge;
117
+ $.emit = ge;
118
+ $.prependListener = ge;
119
+ $.prependOnceListener = ge;
120
120
  $.listeners = function(t) {
121
121
  return [];
122
122
  };
@@ -132,7 +132,7 @@ $.chdir = function(t) {
132
132
  $.umask = function() {
133
133
  return 0;
134
134
  };
135
- var si = an.exports;
135
+ var si = sn.exports;
136
136
  const S = /* @__PURE__ */ ni(si), ai = Jn({
137
137
  level: "trace",
138
138
  enabled: !!window.localStorage.getItem("SL_DEBUG"),
@@ -141,14 +141,14 @@ const S = /* @__PURE__ */ ni(si), ai = Jn({
141
141
  console.log(t);
142
142
  }
143
143
  }
144
- }), ve = (t, e) => ai.child({ name: t }, e);
144
+ }), Se = (t, e) => ai.child({ name: t }, e);
145
145
  class ui extends Event {
146
146
  slEventBus;
147
147
  constructor(e, r) {
148
148
  super(e), this.slEventBus = r;
149
149
  }
150
150
  }
151
- const ci = ve("event-bus");
151
+ const ci = Se("event-bus");
152
152
  class li {
153
153
  name;
154
154
  listeners;
@@ -176,7 +176,7 @@ class li {
176
176
  class di {
177
177
  }
178
178
  window.slStore = /* @__PURE__ */ Object.create(null);
179
- class Et {
179
+ class It {
180
180
  /**
181
181
  * store instance (nanostores)
182
182
  */
@@ -196,19 +196,19 @@ const fi = (t) => {
196
196
  const e = Object.keys(t);
197
197
  return Xn(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
198
198
  };
199
- class Ie extends Et {
199
+ class Te extends It {
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 pe = (t) => Zn(t);
207
- var ce;
206
+ const ie = (t) => Zn(t);
207
+ var le;
208
208
  (function(t) {
209
209
  t.ORGANIZATION = "ORGANIZATION", t.STREAM = "STREAM";
210
- })(ce || (ce = {}));
211
- const pi = {
210
+ })(le || (le = {}));
211
+ const hi = {
212
212
  [N.BETTING]: "betting",
213
213
  [N.GAMES]: "games",
214
214
  [N.PUBLIC_CHAT]: "publicChat",
@@ -218,7 +218,7 @@ var Je;
218
218
  (function(t) {
219
219
  t.Ready = "ready", t.Suspended = "suspended";
220
220
  })(Je || (Je = {}));
221
- class dn {
221
+ class ln {
222
222
  status;
223
223
  source;
224
224
  config;
@@ -226,7 +226,7 @@ class dn {
226
226
  listeners = /* @__PURE__ */ new Set();
227
227
  settingsKey;
228
228
  constructor({ settings: e, ...r }, n) {
229
- this.settingsKey = pi[r.type], this.status = At(Je.Suspended), this.config = new Ie(pe(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Ie(pe(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Ie(pe({}), `feature:settings:${this.settingsKey}`), this.source = n;
229
+ this.settingsKey = hi[r.type], this.status = At(Je.Suspended), this.config = new Te(ie(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Te(ie(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Te(ie({}), `feature:settings:${this.settingsKey}`), this.source = n;
230
230
  }
231
231
  get featureConfig() {
232
232
  return this.config.getStore();
@@ -257,7 +257,7 @@ class dn {
257
257
  }
258
258
  };
259
259
  update = (e, r) => {
260
- this.source === ce.STREAM && r === ce.ORGANIZATION || (this.setFeatureConfig(e), this.source = r);
260
+ this.source === le.STREAM && r === le.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 dn {
268
268
  }
269
269
  }
270
270
  }
271
- class z extends Et {
271
+ class W extends It {
272
272
  getValue = () => this.getStore().get();
273
273
  getValues() {
274
274
  throw new Error("not implemented");
@@ -283,8 +283,8 @@ class z extends Et {
283
283
  return this.getStore().get();
284
284
  }
285
285
  }
286
- const q = (t) => At(t);
287
- class X extends Et {
286
+ const B = (t) => At(t);
287
+ class ye extends It {
288
288
  atomStore;
289
289
  constructor(e, r, n) {
290
290
  super(e, `api:${r}`), this.atomStore = At(), n && e.subscribe((i) => {
@@ -315,8 +315,8 @@ class X extends Et {
315
315
  key = () => this.getStore().key;
316
316
  off = () => this.getStore().off();
317
317
  }
318
- const he = new li();
319
- async function* hi(t, e) {
318
+ const pe = new li();
319
+ async function* pi(t, e) {
320
320
  for await (const r of e) {
321
321
  t.response.message = r, t.received_at = Date.now();
322
322
  const n = {
@@ -350,7 +350,7 @@ const yi = () => (t) => async (e) => {
350
350
  };
351
351
  return window.postMessage(i), {
352
352
  ...n,
353
- message: hi(r, n.message)
353
+ message: pi(r, n.message)
354
354
  };
355
355
  } else {
356
356
  r.request.message = e.message, r.response.message = n.message, r.latency = r.received_at - r.sent_at;
@@ -396,13 +396,13 @@ class gi {
396
396
  ts: /* @__PURE__ */ new Date(),
397
397
  log: []
398
398
  };
399
- this.state = new Ie(pe(o), `subscription:${i.name}:state`), this.options = {
399
+ this.state = new Te(ie(o), `subscription:${i.name}:state`), this.options = {
400
400
  ...i,
401
401
  reconnectDelay: i.reconnectDelay ?? 1e3,
402
402
  reconnectMaxDelay: i.reconnectMaxDelay ?? 3e4,
403
403
  reconnectMaxAttempts: i.reconnectMaxAttempts ?? 10,
404
404
  withStore: i.withStore ?? !1
405
- }, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new z(q(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
405
+ }, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new W(B(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
406
406
  this.state.getValue("status") === Y.Connected && (this.addStateLog(`params updated, reconnect => ${JSON.stringify(s)}`), this.reconnect());
407
407
  })), this.updateState(Y.Ready);
408
408
  }
@@ -414,7 +414,8 @@ class gi {
414
414
  r.push(n), this.state.setValue("log", r), window.sessionStorage.setItem("slstreamlogs", window.sessionStorage.getItem("slstreamlogs") + `
415
415
  ` + n);
416
416
  };
417
- addListener = (e, r) => this.listeners.has(e) ? (this.addStateLog(`listener '${e}' not added, already exists`), !1) : (this.listeners.set(e, r), this.addStateLog(`listener '${e}' added`), !0);
417
+ addListener = (e, r) => this.listeners.has(e) ? (this.addStateLog(`listener '${e}' not added, already exists`), () => {
418
+ }) : (this.listeners.set(e, r), this.addStateLog(`listener '${e}' added`), () => this.removeListener(e));
418
419
  removeListener = (e) => {
419
420
  this.listeners.delete(e), this.addStateLog(`listener '${e}' removed`);
420
421
  };
@@ -431,7 +432,7 @@ class gi {
431
432
  for await (const o of i)
432
433
  this.attempt = 0, this.onData(o);
433
434
  } catch (n) {
434
- n instanceof et && n.code != te.Canceled && this.onStreamError(n);
435
+ n instanceof et && n.code != ee.Canceled && this.onStreamError(n);
435
436
  }
436
437
  })(), this.updateState(Y.Connected);
437
438
  };
@@ -471,7 +472,7 @@ class gi {
471
472
  */
472
473
  onStreamError = (e) => {
473
474
  if (this.addStateLog(`error => ${e ? JSON.stringify(e) : "undefined"}}`), e !== void 0) {
474
- if (e instanceof et && e.code !== te.Canceled) {
475
+ if (e instanceof et && e.code !== ee.Canceled) {
475
476
  this.updateState(Y.Failed), this.state.setValue("error", e), this.reconnect();
476
477
  return;
477
478
  }
@@ -480,23 +481,23 @@ class gi {
480
481
  };
481
482
  }
482
483
  const mi = /* @__PURE__ */ new Set([
483
- te.Unknown,
484
- te.Internal,
485
- te.DeadlineExceeded,
486
- te.ResourceExhausted,
487
- te.FailedPrecondition,
488
- te.Unavailable,
489
- te.DataLoss
490
- ]), Lr = ve("grpc:retry"), bi = (t) => async (e) => {
484
+ ee.Unknown,
485
+ ee.Internal,
486
+ ee.DeadlineExceeded,
487
+ ee.ResourceExhausted,
488
+ ee.FailedPrecondition,
489
+ ee.Unavailable,
490
+ ee.DataLoss
491
+ ]), kr = Se("grpc:retry"), bi = (t) => async (e) => {
491
492
  const r = e.contextValues.get(Ht.retryAttempts), n = 300, i = e.contextValues.get(Ht.retryDelay);
492
493
  if (e.stream || r === 0)
493
494
  return t(e);
494
- Lr.trace({ url: e.url, attempts: r, maxDelay: i }, "retry options");
495
+ kr.trace({ url: e.url, attempts: r, maxDelay: i }, "retry options");
495
496
  for (let o = 0; ; o++)
496
497
  try {
497
498
  return await t(e);
498
499
  } catch (s) {
499
- Lr.trace({ attempt: o, error: s }, "retry attempt");
500
+ kr.trace({ attempt: o, error: s }, "retry attempt");
500
501
  const a = et.from(s);
501
502
  if (o >= r || !(a instanceof et) || !mi.has(a.code))
502
503
  throw s;
@@ -504,8 +505,8 @@ const mi = /* @__PURE__ */ new Set([
504
505
  await new Promise((c) => setTimeout(c, d));
505
506
  }
506
507
  }, Ht = {
507
- retryAttempts: Ar(5, { description: "Number of attempts to retry" }),
508
- retryDelay: Ar(3e4, { description: "Max delay between retries in milliseconds" })
508
+ retryAttempts: Ir(5, { description: "Number of attempts to retry" }),
509
+ retryDelay: Ir(3e4, { description: "Max delay between retries in milliseconds" })
509
510
  }, vi = () => {
510
511
  const t = localStorage.getItem("sl-device-id");
511
512
  if (t)
@@ -513,7 +514,7 @@ const mi = /* @__PURE__ */ new Set([
513
514
  const e = Gt();
514
515
  return localStorage.setItem("sl-device-id", e), e;
515
516
  }, Si = () => navigator.userAgentData?.platform || navigator.platform;
516
- class kr {
517
+ class Pr {
517
518
  toJsonOptions = {
518
519
  emitDefaultValues: !1,
519
520
  enumAsInteger: !0,
@@ -530,21 +531,22 @@ class kr {
530
531
  clients;
531
532
  streamClients;
532
533
  subscriptions;
533
- constructor(e) {
534
- this.host = e, this.$headers = new Ie(pe({
534
+ opts;
535
+ constructor(e, r) {
536
+ this.host = e, this.opts = r, this.$headers = new Te(ie({
535
537
  "sl-device-id": vi(),
536
538
  "sl-device-os": Si()
537
539
  }), "transport:headers"), this.initInterceptors(), this.clients = /* @__PURE__ */ new Map(), this.streamClients = /* @__PURE__ */ new Map(), this.subscriptions = /* @__PURE__ */ new Map();
538
- const [r, n, i] = Tr({
539
- dedupeTime: 1e3 * 60 * 5,
540
- refetchInterval: 1e3 * 60 * 5
540
+ const [n, i, o] = Or({
541
+ dedupeTime: r?.dedupeTime,
542
+ refetchInterval: r?.refetchInterval
541
543
  });
542
- this.nanoquery = { createFetcherStore: r, createMutatorStore: n, utils: i }, this.transport = Ir({
544
+ this.nanoquery = { createFetcherStore: n, createMutatorStore: i, utils: o }, this.transport = Tr({
543
545
  baseUrl: e,
544
546
  defaultTimeoutMs: 1e4,
545
547
  interceptors: this.interceptors,
546
548
  useBinaryFormat: !0
547
- }), this.streamTransport = Ir({
549
+ }), this.streamTransport = Tr({
548
550
  baseUrl: e,
549
551
  interceptors: this.interceptors,
550
552
  useBinaryFormat: !0
@@ -568,7 +570,10 @@ class kr {
568
570
  for (const [i, o] of this.subscriptions)
569
571
  o.disconnect(), this.subscriptions.delete(i);
570
572
  this.clients.clear(), this.streamClients.clear(), this.subscriptions.clear();
571
- const [e, r, n] = Tr();
573
+ const [e, r, n] = Or({
574
+ dedupeTime: 1e3 * 60 * 5,
575
+ refetchInterval: 1e3 * 60 * 5
576
+ });
572
577
  this.nanoquery = { createFetcherStore: e, createMutatorStore: r, utils: n };
573
578
  };
574
579
  registerInterceptor = (e) => {
@@ -601,8 +606,8 @@ class kr {
601
606
  return { client: i, createRequestOptions: (d) => {
602
607
  const c = ei();
603
608
  for (const f in d) {
604
- const y = Ht[f];
605
- c.set(y, d[f]);
609
+ const p = Ht[f];
610
+ c.set(p, d[f]);
606
611
  }
607
612
  return c;
608
613
  }, queryKey: s, queryKeyStr: a.join("") };
@@ -627,7 +632,7 @@ class kr {
627
632
  n.header.set(o, i[o]);
628
633
  return r(n);
629
634
  };
630
- this.interceptors.push(e), this.interceptors.push(yi()), this.interceptors.push(bi);
635
+ this.interceptors.push(e), this.interceptors.push(yi()), this.opts?.retryable && this.interceptors.push(bi);
631
636
  };
632
637
  }
633
638
  const wi = (t, e) => {
@@ -656,17 +661,14 @@ const wi = (t, e) => {
656
661
  // we are sure that id is a string
657
662
  })).data?.attributes : void 0
658
663
  });
659
- }, Ei = (t, e) => {
660
- const { queryKey: r, client: n } = e.createPromiseClient(sr, { method: "me", params: [t] });
664
+ }, Ii = (t, e) => {
665
+ const { queryKey: r, client: n } = e.createPromiseClient(ar, { method: "me", params: [t] });
661
666
  return e.nanoquery.createFetcherStore(r, {
662
667
  fetcher: () => n.me({})
663
668
  });
664
- }, Ii = (t) => {
665
- const { client: e, createRequestOptions: r } = t.createPromiseClient(sr, { method: "bypassAuth" }), n = r({ retryAttempts: 0 });
666
- return async ({ userKey: i, schema: o, init: s, inviterKey: a }) => {
667
- const u = await e.bypassAuth({ userKey: i, schema: o, init: s }, { contextValues: n });
668
- return u.meta && (u.meta.inviterKey = a), u;
669
- };
669
+ }, Ei = (t) => {
670
+ const { client: e, createRequestOptions: r } = t.createPromiseClient(ar, { method: "bypassAuth" }), n = r({ retryAttempts: 0 });
671
+ return ({ userKey: i, schema: o, init: s, inviterKey: a }) => e.bypassAuth({ userKey: i, schema: o, init: s, inviterKey: a }, { contextValues: n });
670
672
  }, Ti = (t, e) => {
671
673
  const { client: r, queryKey: n } = e.createPromiseClient(rt, { method: "get", params: [t] });
672
674
  return e.nanoquery.createFetcherStore(n, {
@@ -691,14 +693,18 @@ const wi = (t, e) => {
691
693
  return e.nanoquery.createFetcherStore(n, {
692
694
  fetcher: async () => (await r.getOrganizationAdvertising({})).data?.attributes
693
695
  });
694
- }, _i = (t, e, r) => {
695
- t.transport = new kr(e.host), t.analyticsTransport = new kr(e.analyticsHost), t.sdk.host = t.transport.host, t.transport.setSdkKey(e.sdkKey), t.transport.setHeader("sl-sdk-version", e.version || "-"), t.transport.$headers.subscribe((n) => {
696
+ }, Li = (t, e, r) => {
697
+ t.transport = new Pr(e.host, {
698
+ dedupeTime: 1e3 * 60 * 5,
699
+ refetchInterval: 1e3 * 60 * 5,
700
+ retryable: !0
701
+ }), t.analyticsTransport = new Pr(e.analyticsHost), t.sdk.host = t.transport.host, t.transport.setSdkKey(e.sdkKey), t.transport.setHeader("sl-sdk-version", e.version || "-"), t.transport.$headers.subscribe((n) => {
696
702
  t.analyticsTransport.$headers.getStore().set(n);
697
703
  }), t.sdk.onMount(() => () => {
698
704
  t.transport.disconnect(), t.analyticsTransport.disconnect();
699
705
  }), r();
700
706
  };
701
- class It {
707
+ class Et {
702
708
  delimiter = ":";
703
709
  prefix;
704
710
  storage;
@@ -726,7 +732,7 @@ var ue;
726
732
  (function(t) {
727
733
  t.SCHEMA = "schema", t.EXTERNAL_TOKEN = "eToken", t.TOKEN = "token";
728
734
  })(ue || (ue = {}));
729
- class je extends It {
735
+ class je extends Et {
730
736
  constructor() {
731
737
  super("user");
732
738
  }
@@ -749,15 +755,15 @@ class je extends It {
749
755
  this.remove(ue.TOKEN);
750
756
  };
751
757
  }
752
- var le;
758
+ var de;
753
759
  (function(t) {
754
760
  t.DISABLED = "disabled", t.INITIALIZATION = "initialization", t.READY = "ready", t.FAILED = "failed", t.SUSPENDED = "suspended";
755
- })(le || (le = {}));
756
- const Li = (t) => {
757
- const e = new je(), r = new z(q(e.getExternalToken()), "userKey"), n = new z(q(e.getToken()), "userToken"), i = new X(Ei(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, d) => {
761
+ })(de || (de = {}));
762
+ const _i = (t) => {
763
+ const e = new je(), r = new W(B(e.getExternalToken()), "userKey"), n = new W(B(e.getToken()), "userToken"), i = new ye(Ii(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, d) => {
758
764
  if (!a)
759
765
  return s?.data?.id ? s.data.id : u === !1 ? void 0 : d;
760
- }), o = new X(Ti(n.getStore(), t), "userSettings");
766
+ }), o = new ye(Ti(n.getStore(), t), "userSettings");
761
767
  return {
762
768
  userKey: r,
763
769
  userToken: n,
@@ -765,7 +771,7 @@ const Li = (t) => {
765
771
  userSettings: o
766
772
  };
767
773
  }, ki = (t) => {
768
- const e = new z(q(void 0), "providerStreamId"), r = new X(wi(e.getStore(), t), "slStreamId", (i) => i?.data), n = new X(Ai(r.getAtomStore(), t), "streamSettings");
774
+ const e = new W(B(void 0), "providerStreamId"), r = new ye(wi(e.getStore(), t), "slStreamId", (i) => i?.data), n = new ye(Ai(r.getAtomStore(), t), "streamSettings");
769
775
  return r.getAtomStore().listen((i) => {
770
776
  (i === "" || i === void 0) && n.getStore().mutate(void 0);
771
777
  }), {
@@ -774,7 +780,7 @@ const Li = (t) => {
774
780
  streamSettings: n
775
781
  };
776
782
  }, Pi = (t) => {
777
- const e = new z(q(void 0), "enabled"), r = new z(q(le.DISABLED), "status"), n = new X(Oi(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new X(Ci(n.getAtomStore(), t), "organizationAdvertising"), o = Li(t), s = ki(t);
783
+ const e = new W(B(void 0), "enabled"), r = new W(B(de.DISABLED), "status"), n = new ye(Oi(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new ye(Ci(n.getAtomStore(), t), "organizationAdvertising"), o = _i(t), s = ki(t);
778
784
  return {
779
785
  enabled: e,
780
786
  status: r,
@@ -789,7 +795,7 @@ const Li = (t) => {
789
795
  organizationAdvertising: i
790
796
  };
791
797
  };
792
- class Fi extends Et {
798
+ class Fi extends It {
793
799
  stores;
794
800
  constructor(e) {
795
801
  const r = Pi(e), n = fi(r);
@@ -817,30 +823,22 @@ const Ni = (t, e, r) => {
817
823
  t.store = new Fi(t.transport), t.stores = t.store.getValues(), t.sdk.enabled = t.stores.enabled.getStore(), t.sdk.status = t.stores.status.getStore(), t.sdk.sdkStore = Object.fromEntries(Object.entries(t.stores).map(([n, i]) => [n, i.getStore()])), t.sdk.organizationStore = () => t.stores.organizationSettings.getStore(), t.sdk.streamStore = () => t.stores.streamSettings.getStore(), t.storeUnsubscribe = () => {
818
824
  t.store.unsubscribe();
819
825
  }, r();
820
- }, Di = (t, e, r) => {
821
- const { client: n, queryKey: i } = r.createPromiseClient(on, {
822
- method: "summary",
823
- params: [t, e]
824
- });
825
- return r.nanoquery.createFetcherStore(i, {
826
- fetcher: async (o, s, a, u) => (await n.summary({
827
- eventId: a,
828
- userId: u
829
- })).data?.attributes
830
- });
831
- }, Ri = (t) => {
832
- const { client: e } = t.createPromiseClient(on, { method: "list" });
826
+ }, Di = (t) => {
827
+ const { client: e } = t.createPromiseClient(nn, { method: "list" });
833
828
  return (r) => e.list(r);
834
- }, Vi = (t, e) => {
835
- const { client: r, queryKey: n } = e.createPromiseClient(sr, {
829
+ }, dn = (t) => {
830
+ const { client: e } = t.createPromiseClient(nn, { method: "summary" });
831
+ return (r) => e.summary(r);
832
+ }, Ri = (t, e) => {
833
+ const { client: r, queryKey: n } = e.createPromiseClient(ar, {
836
834
  method: "getFriends",
837
835
  params: [t]
838
836
  });
839
837
  return e.nanoquery.createFetcherStore(n, {
840
838
  fetcher: async (i, o, s) => s ? (await r.getFriends({})).data : []
841
839
  });
842
- }, $i = (t, e) => {
843
- const { client: r, queryKey: n } = e.createPromiseClient(be, { method: "get", params: [t] });
840
+ }, Vi = (t, e) => {
841
+ const { client: r, queryKey: n } = e.createPromiseClient(ve, { method: "get", params: [t] });
844
842
  return e.nanoquery.createFetcherStore(n, {
845
843
  fetcher: async (i, o, s) => (await r.get({
846
844
  eventId: s
@@ -848,8 +846,8 @@ const Ni = (t, e, r) => {
848
846
  refetchInterval: 0,
849
847
  dedupeTime: 1e3 * 60 * 60
850
848
  });
851
- }, ji = (t, e) => {
852
- const { client: r, queryKey: n } = e.createPromiseClient(be, { method: "syncQuestion", params: [t] });
849
+ }, $i = (t, e) => {
850
+ const { client: r, queryKey: n } = e.createPromiseClient(ve, { method: "syncQuestion", params: [t] });
853
851
  return e.nanoquery.createFetcherStore(n, {
854
852
  fetcher: async (i, o, s) => s ? (await r.syncQuestion({
855
853
  filter: {
@@ -860,24 +858,24 @@ const Ni = (t, e, r) => {
860
858
  // 10 minutes
861
859
  refetchInterval: 0
862
860
  });
863
- }, Mi = (t, e) => {
864
- const { client: r } = e.createStreamClient(be), n = At({ eventId: t.get() || "", feedId: "" });
861
+ }, ji = (t, e) => {
862
+ const { client: r } = e.createStreamClient(ve), n = At({ eventId: t.get() || "", feedId: "" });
865
863
  return t.subscribe((o = "") => {
866
864
  n.set({ eventId: o, feedId: "" });
867
865
  }), e.addSubscription(r.subscription, n, { name: "feedSubscription" });
868
- }, Ui = (t, e) => {
869
- const { client: r } = e.createStreamClient(be);
866
+ }, Mi = (t, e) => {
867
+ const { client: r } = e.createStreamClient(ve);
870
868
  return e.addSubscription(r.questionSubscription, { questionId: t }, { name: "questionSubscription" });
871
869
  }, Wt = (t, e) => {
872
- const { client: r, queryKey: n } = e.createPromiseClient(be, { method: "questionByUser", params: [t] });
870
+ const { client: r, queryKey: n } = e.createPromiseClient(ve, { method: "questionByUser", params: [t] });
873
871
  return e.nanoquery.createFetcherStore(n, {
874
872
  fetcher: async (i, o, s) => (await r.questionByUser({
875
873
  questionId: s
876
874
  })).data?.attributes?.question,
877
875
  dedupeTime: 1e3 * 60 * 5
878
876
  });
879
- }, xi = (t, e, r) => {
880
- const { client: n, queryKey: i } = r.createPromiseClient(be, {
877
+ }, Ui = (t, e, r) => {
878
+ const { client: n, queryKey: i } = r.createPromiseClient(ve, {
881
879
  method: "list",
882
880
  params: [t, e]
883
881
  });
@@ -885,47 +883,50 @@ const Ni = (t, e, r) => {
885
883
  fetcher: async (o, s, a, u) => a ? (await n.list({
886
884
  eventId: a,
887
885
  filter: {
888
- types: u === Te.ALLOWED ? [] : [D.FACTOID, D.PROMOTION, D.TWEET],
889
- statuses: [$e.ACTIVE, $e.RESOLVED]
886
+ types: u === Oe.ALLOWED ? [] : [D.FACTOID, D.PROMOTION, D.TWEET],
887
+ statuses: [ce.ACTIVE, ce.RESOLVED]
890
888
  }
891
889
  })).data : [],
892
890
  dedupeTime: 0,
893
891
  refetchInterval: 0
894
892
  });
895
- }, Bi = (t, e, r) => {
896
- const n = wr([e, r], () => {
893
+ }, xi = (t, e, r) => {
894
+ const n = Ar([e, r], () => {
897
895
  const a = e.get();
898
896
  if (!a)
899
897
  return;
900
898
  const u = r.get().data?.find((c) => c.id === a?.questionId), d = a?.question?.openedFrom;
901
899
  return u ? (u.openedFrom = d, u) : a.question;
902
- }), i = wr(n, (a) => a && a.type === "question" ? a.id : void 0), o = Wt(i, t);
900
+ }), i = Ar(n, (a) => a && a.type === "question" ? a.id : void 0), o = Wt(i, t);
903
901
  return { $store: n, $extendedStore: o, updateExtendedQuestion: (a) => {
904
902
  const u = o.get().data, d = (c, f) => {
905
903
  if (!c || !f)
906
904
  return c || f || [];
907
- const y = [];
905
+ const p = [];
908
906
  for (let m = 0; m < c.length; m++)
909
- y.push({
907
+ p.push({
910
908
  ...c[m],
911
909
  ...f[m],
912
910
  correct: c[m].correct,
913
911
  youVoted: c[m].youVoted,
914
912
  pointsEarned: c[m].pointsEarned
915
913
  });
916
- return y;
914
+ return p;
917
915
  };
918
916
  o.mutate({
919
917
  ...a,
918
+ options: u?.options,
919
+ subject: u?.subject,
920
+ appearance: u?.appearance,
920
921
  answers: d(u?.answers, a?.answers)
921
922
  });
922
923
  } };
923
924
  };
924
- var Te;
925
+ var Oe;
925
926
  (function(t) {
926
927
  t.ALLOWED = "allowed", t.DISALLOWED = "disallowed";
927
- })(Te || (Te = {}));
928
- class qi {
928
+ })(Oe || (Oe = {}));
929
+ class Bi {
929
930
  /** sl event id */
930
931
  slStreamId;
931
932
  /** organization id */
@@ -955,22 +956,27 @@ class qi {
955
956
  notifications;
956
957
  log;
957
958
  transport;
959
+ cancels = /* @__PURE__ */ new Set();
958
960
  constructor(e) {
959
- this.transport = e.transport, this.log = ve("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new z(q(void 0), "moderationId").getStore(), this.interactiveAllowed = new z(q(Te.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new z(q(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new X($i(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new X(xi(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.activeQuestionId = new X(ji(this.slStreamId, e.transport), "gamification:activeQuestionId"), this.openedQuestion = Bi(e.transport, this.openedQuestionId, this.feedList.getStore()), this.openedQuestionId.listen((r) => {
960
- this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = Ui(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", (n) => {
961
+ this.transport = e.transport, this.log = Se("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new W(B(void 0), "moderationId").getStore(), this.interactiveAllowed = new W(B(Oe.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new W(B(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new ye(Vi(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new ye(Ui(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.activeQuestionId = $i(this.slStreamId, e.transport), this.openedQuestion = xi(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((r) => {
962
+ this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = Mi(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", (n) => {
961
963
  this.openedQuestion.updateExtendedQuestion(n.data?.attributes?.question);
962
964
  }), this.questionSubscription.connect()) : (this.log.info("cleanup on close question"), this.questionSubscription !== void 0 && (e.transport.removeSubscription(this.questionSubscription), this.questionSubscription = void 0));
963
- }), this.feedSubscription = Mi(this.slStreamId, e.transport), this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
964
- const n = this.activeQuestionId.getStore();
965
- n && n.mutate(r.data?.attributes);
966
- }), this.feedSubscription.addListener("moderation update", (r) => {
965
+ })), this.feedSubscription = ji(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
966
+ const n = this.activeQuestionId.get().data?.question?.id, i = r.data?.attributes?.question;
967
+ i && (n && i.status === ce.RESOLVED && i.id !== n || this.activeQuestionId.mutate(r.data?.attributes));
968
+ })), this.cancels.add(this.feedSubscription.addListener("moderation update", (r) => {
967
969
  window.requestAnimationFrame(() => {
968
970
  r.data?.attributes?.question === void 0 && r.data?.attributes?.moderation && this.moderation.invalidate();
969
971
  });
970
- }), this.feedSubscription.connect(), this.interactiveAllowed.listen(() => {
972
+ })), this.feedSubscription.connect(), this.cancels.add(this.interactiveAllowed.listen(() => {
971
973
  window.requestAnimationFrame(() => {
972
974
  this.activeQuestionId.invalidate();
973
975
  });
976
+ })), e.sdk.onMount(() => () => {
977
+ this.activeQuestionId.off();
978
+ for (const r of this.cancels)
979
+ r(), this.cancels.delete(r);
974
980
  });
975
981
  }
976
982
  /**
@@ -1001,9 +1007,8 @@ class qi {
1001
1007
  this.openedQuestionId.set(void 0), e && this.notifications.markAsViewed(this.getCurrentSessionId({ prefix: "notification", entity: e }));
1002
1008
  };
1003
1009
  }
1004
- class Qi {
1010
+ class qi {
1005
1011
  notificationsList;
1006
- notifications;
1007
1012
  store;
1008
1013
  timeouts;
1009
1014
  waitingQueue;
@@ -1011,7 +1016,7 @@ class Qi {
1011
1016
  options;
1012
1017
  logger;
1013
1018
  constructor(e) {
1014
- this.options = e, this.logger = ve("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notifications = new z(q(/* @__PURE__ */ new Map()), "notifications-queue"), this.notificationsList = this.notifications.getStore();
1019
+ this.options = e, this.logger = Se("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notificationsList = B(/* @__PURE__ */ new Map());
1015
1020
  }
1016
1021
  addToQueue = (e) => {
1017
1022
  if (this.store.has(e.id)) {
@@ -1056,8 +1061,8 @@ class Qi {
1056
1061
  return;
1057
1062
  }
1058
1063
  const n = setTimeout(() => {
1059
- const i = e, o = new Map(this.notifications.getValue());
1060
- o.set(r.id, r), this.notifications.setValue(o);
1064
+ const i = e, o = new Map(this.notificationsList.get());
1065
+ o.set(r.id, r), this.notificationsList.set(o);
1061
1066
  const s = setTimeout(() => {
1062
1067
  this.logger.debug({ notificationId: i, delay: r.autoHideDuration || 5e3 }, "notification hiding by autoHideDuration"), this.closeNotification(i);
1063
1068
  }, r.autoHideDuration || 5e3);
@@ -1066,12 +1071,12 @@ class Qi {
1066
1071
  this.timeouts.set(e, n), this.logger.debug({ notificationId: e }, "active queue tick completed"), this.tickWaitingQueue();
1067
1072
  };
1068
1073
  closeNotification = (e) => {
1069
- const r = new Map(this.notifications.getValue()), n = r.get(e);
1074
+ const r = new Map(this.notificationsList.get()), n = r.get(e);
1070
1075
  if (n) {
1071
- n.hiding = !(this.waitingQueue.size >= this.options.concurrency), this.notifications.setValue(r);
1076
+ n.hiding = !(this.waitingQueue.size >= this.options.concurrency), this.notificationsList.set(r);
1072
1077
  const i = setTimeout(() => {
1073
- const o = new Map(this.notifications.getValue());
1074
- o.delete(e), this.notifications.setValue(o);
1078
+ const o = new Map(this.notificationsList.get());
1079
+ o.delete(e), this.notificationsList.set(o);
1075
1080
  const s = this.timeouts.get(e);
1076
1081
  s !== void 0 && (clearTimeout(s), this.timeouts.delete(e)), this.logger.debug({ notificationId: e }, "notification hidden");
1077
1082
  }, this.options.animationDelay || 0);
@@ -1079,12 +1084,15 @@ class Qi {
1079
1084
  }
1080
1085
  return this.store.delete(e), this.activeQueue.delete(e), this.waitingQueue.delete(e), this.tickWaitingQueue(), this.logger.debug({ notificationId: e }, "notification hiding"), n;
1081
1086
  };
1087
+ drain = () => {
1088
+ this.store.clear(), this.timeouts.clear(), this.waitingQueue.clear(), this.activeQueue.clear(), this.notificationsList.off(), this.notificationsList.set(/* @__PURE__ */ new Map());
1089
+ };
1082
1090
  }
1083
1091
  var gt;
1084
1092
  (function(t) {
1085
1093
  t.OPENED = "opened";
1086
1094
  })(gt || (gt = {}));
1087
- class Gi extends It {
1095
+ class Qi extends Et {
1088
1096
  constructor() {
1089
1097
  super("notification");
1090
1098
  }
@@ -1096,22 +1104,22 @@ class Gi extends It {
1096
1104
  this.clear();
1097
1105
  };
1098
1106
  }
1099
- var me;
1107
+ var be;
1100
1108
  (function(t) {
1101
1109
  t[t.ONBOARDING = 1] = "ONBOARDING", t[t.QUESTION = 2] = "QUESTION", t[t.QUESTION_RESOLVED = 3] = "QUESTION_RESOLVED";
1102
- })(me || (me = {}));
1103
- class Ki {
1110
+ })(be || (be = {}));
1111
+ class Gi {
1104
1112
  queue;
1105
1113
  storage;
1106
1114
  constructor(e = {}) {
1107
- this.storage = new Gi(), this.queue = new Qi({ concurrency: 1, animationDelay: 1600, ...e });
1115
+ this.storage = new Qi(), this.queue = new qi({ concurrency: 1, animationDelay: 1600, ...e });
1108
1116
  }
1109
1117
  add = (e) => {
1110
1118
  if (!this.storage.isOpened(e.id)) {
1111
1119
  if (e.data && e.emitEvent) {
1112
1120
  const n = e.action;
1113
1121
  e.action = (...i) => {
1114
- n && n(...i), he.emit("notification", {
1122
+ n && n(...i), pe.emit("notification", {
1115
1123
  action: "opened",
1116
1124
  payload: {
1117
1125
  questionId: e.data.questionId,
@@ -1131,7 +1139,7 @@ class Ki {
1131
1139
  if (!e?.size)
1132
1140
  return null;
1133
1141
  for (const n of e.values())
1134
- if (n.type === me.ONBOARDING)
1142
+ if (n.type === be.ONBOARDING)
1135
1143
  return n;
1136
1144
  return e.values().next().value;
1137
1145
  };
@@ -1140,29 +1148,31 @@ class Ki {
1140
1148
  this.storage.setOpened(e);
1141
1149
  };
1142
1150
  }
1143
- const zi = (t, e, r) => {
1144
- t.notifications = new Ki(void 0), t.addNotification = t.notifications.add, t.sdk.getNotificationsStore = () => t.notifications.getQueueStore(), t.sdk.getActiveNotification = () => t.notifications.getActiveNotification(), r();
1151
+ const Ki = (t, e, r) => {
1152
+ t.notifications = new Gi(void 0), t.addNotification = t.notifications.add, t.sdk.getNotificationsStore = () => t.notifications.getQueueStore(), t.sdk.getActiveNotification = () => t.notifications.getActiveNotification(), t.sdk.onMount(() => () => {
1153
+ t.notifications.queue.drain();
1154
+ }), r();
1145
1155
  };
1146
1156
  var tt;
1147
1157
  (function(t) {
1148
1158
  t.UNKNOWN = "unknown", t.ALREADY_VOTED = "already_voted";
1149
1159
  })(tt || (tt = {}));
1150
- const Hi = async (t, e) => {
1151
- const { client: r, createRequestOptions: n } = t.createPromiseClient(be, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
1160
+ const zi = async (t, e) => {
1161
+ const { client: r, createRequestOptions: n } = t.createPromiseClient(ve, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
1152
1162
  try {
1153
1163
  return await r.submitAnswer({ data: e }, { contextValues: i });
1154
1164
  } catch (o) {
1155
- throw et.from(o)?.code === te.AlreadyExists ? new Error(tt.ALREADY_VOTED) : new Error(tt.UNKNOWN);
1165
+ throw et.from(o)?.code === ee.AlreadyExists ? new Error(tt.ALREADY_VOTED) : new Error(tt.UNKNOWN);
1156
1166
  }
1157
- }, Wi = (t, e) => {
1158
- const { client: r, createRequestOptions: n } = t.createPromiseClient(be, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
1167
+ }, Hi = (t, e) => {
1168
+ const { client: r, createRequestOptions: n } = t.createPromiseClient(ve, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
1159
1169
  return r.submitInplay({ data: { eventId: +e } }, { contextValues: i });
1160
1170
  };
1161
1171
  var Me;
1162
1172
  (function(t) {
1163
1173
  t.ONBOARDING = "onboarding", t.ONBOARDING_IO = "onboarding_io";
1164
1174
  })(Me || (Me = {}));
1165
- class fn extends It {
1175
+ class fn extends Et {
1166
1176
  constructor() {
1167
1177
  super("gamification");
1168
1178
  }
@@ -1179,64 +1189,49 @@ class fn extends It {
1179
1189
  return window.sessionStorage.getItem(i);
1180
1190
  };
1181
1191
  }
1182
- const Pr = {
1192
+ const Wi = {
1183
1193
  pageSize: 10
1184
1194
  }, Ji = (t, e, r, n, i) => {
1185
1195
  let o = 0;
1186
- const s = q({ pageSize: i?.pageSize || Pr.pageSize, page: 0 }), a = pe({
1196
+ const s = B({ pageSize: i?.pageSize || Wi.pageSize, page: 0 }), a = ie({
1187
1197
  data: [],
1188
1198
  key: Date.now(),
1189
1199
  hasMore: !0,
1190
1200
  loading: void 0,
1191
1201
  error: void 0
1192
- }), u = Ri(t), d = async () => {
1193
- const y = e.get(), m = n.getStore().get().data?.map((b) => b.slId) || [];
1194
- if (y && m?.length) {
1202
+ }), u = Di(t), d = async () => {
1203
+ const p = e.get(), m = n.getStore().get().data?.map((b) => b.slId) || [];
1204
+ if (p && m?.length) {
1195
1205
  const b = r.get();
1196
1206
  b && m.push(b), a.setKey("loading", !0), a.setKey("data", []);
1197
- const w = {
1198
- eventId: y,
1199
- usersIds: m,
1200
- pagination: { page: 0, pageSize: i?.pageSize || Pr.pageSize }
1201
- }, A = await u(w);
1207
+ const E = await u({
1208
+ eventId: p,
1209
+ usersIds: m
1210
+ });
1202
1211
  a.set({
1203
- data: A.data.map((P) => P.attributes),
1204
- hasMore: !0,
1212
+ data: E.data.map((F, V) => ({
1213
+ ...F.attributes,
1214
+ rank: V + 1
1215
+ })),
1216
+ hasMore: !1,
1205
1217
  key: Date.now(),
1206
1218
  loading: !1
1207
- }), A.meta && (o = Math.round(A.meta.count / A.meta.pageSize)), s.set(w.pagination);
1219
+ }), E.meta && (o = Math.round(E.meta.count / E.meta.pageSize));
1208
1220
  }
1209
1221
  }, c = () => {
1210
1222
  d();
1211
- }, f = (y) => {
1212
- const m = s.get(), b = y || m.page + 1;
1223
+ }, f = (p) => {
1224
+ const m = s.get(), b = p || m.page + 1;
1213
1225
  b <= o && s.set({ ...m, page: b });
1214
1226
  };
1215
- return nn(a, () => {
1216
- const y = e.listen(d), m = n.listen(d), b = s.listen(async (w) => {
1217
- const A = e.get();
1218
- if (w.page > 0 && A)
1219
- if (w.page < o) {
1220
- a.setKey("loading", !0);
1221
- const V = await u({
1222
- eventId: A,
1223
- pagination: w
1224
- }), j = a.get().data || [];
1225
- a.set({
1226
- data: [...j, ...V.data.map((K) => K.attributes)],
1227
- key: a.get().key,
1228
- loading: !1,
1229
- hasMore: !0
1230
- });
1231
- } else
1232
- a.setKey("hasMore", !1);
1233
- });
1227
+ return sr(a, () => {
1228
+ const p = e.listen(d), m = n.listen(d);
1234
1229
  return () => {
1235
- y(), m(), b();
1230
+ p(), m();
1236
1231
  };
1237
1232
  }), { $store: a, fetchMore: f, invalidate: c };
1238
1233
  };
1239
- class Yi extends It {
1234
+ class Yi extends Et {
1240
1235
  get = this.read;
1241
1236
  set = this.write;
1242
1237
  del = this.remove;
@@ -1244,7 +1239,7 @@ class Yi extends It {
1244
1239
  super("deep-link-context", window.sessionStorage);
1245
1240
  }
1246
1241
  }
1247
- const Fr = "sldl", Tt = "sldl_uid", pn = "sldl_eid", hn = "sldl_e_eid", Xi = /* @__PURE__ */ new Set([Tt, pn, hn]), Nr = (t) => {
1242
+ const Fr = "sldl", Tt = "sldl_uid", hn = "sldl_eid", pn = "sldl_e_eid", Xi = /* @__PURE__ */ new Set([Tt, hn, pn]), Nr = (t) => {
1248
1243
  const e = {}, r = {};
1249
1244
  for (const [n, i] of t)
1250
1245
  Xi.has(n) ? e[n] = i : r[n] = i;
@@ -1259,29 +1254,29 @@ const Fr = "sldl", Tt = "sldl_uid", pn = "sldl_eid", hn = "sldl_e_eid", Xi = /*
1259
1254
  return { search: Nr(r) };
1260
1255
  }
1261
1256
  return null;
1262
- }, Dr = ve("deep_link"), ie = {
1257
+ }, Dr = Se("deep_link"), ne = {
1263
1258
  debug: (...t) => {
1264
- Dr.debug(...t), console.log(...t);
1259
+ Dr.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1265
1260
  },
1266
1261
  trace: (...t) => {
1267
- Dr.trace(...t), console.log(...t);
1262
+ Dr.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1268
1263
  }
1269
1264
  }, eo = (t, e) => {
1270
1265
  const { hash: r, search: n } = window.location;
1271
- if (ie.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
1266
+ if (ne.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
1272
1267
  const i = Zi({ hash: r, search: n });
1273
- if (ie.debug(i, "parse deep link result"), i) {
1268
+ if (ne.debug(i, "parse deep link result"), i) {
1274
1269
  const { hash: o, search: s } = i, { result: a, remain: u } = o || s;
1275
1270
  if (Object.keys(a).length !== 0) {
1276
1271
  t.setValue("data", a);
1277
1272
  const d = Object.keys(u).length !== 0;
1278
1273
  if (o) {
1279
1274
  let c = "";
1280
- d && (c = `#${new URLSearchParams(u).toString()}`, ie.debug({ updatedHash: c }, "update hash")), window.history.replaceState(null, "", window.location.pathname + window.location.search + c);
1275
+ d && (c = `#${new URLSearchParams(u).toString()}`, ne.debug({ updatedHash: c }, "update hash")), window.history.replaceState(null, "", window.location.pathname + window.location.search + c);
1281
1276
  }
1282
1277
  if (s) {
1283
1278
  let c = "";
1284
- d && (c = `?${new URLSearchParams(u).toString()}`, ie.debug({ updatedSearch: c }, "update search")), window.history.replaceState(null, "", window.location.pathname + c + window.location.hash);
1279
+ d && (c = `?${new URLSearchParams(u).toString()}`, ne.debug({ updatedSearch: c }, "update search")), window.history.replaceState(null, "", window.location.pathname + c + window.location.hash);
1285
1280
  }
1286
1281
  e(a);
1287
1282
  }
@@ -1295,17 +1290,17 @@ const Fr = "sldl", Tt = "sldl_uid", pn = "sldl_eid", hn = "sldl_e_eid", Xi = /*
1295
1290
  try {
1296
1291
  o = JSON.parse(i);
1297
1292
  } catch (a) {
1298
- ie.debug(a);
1293
+ ne.debug(a);
1299
1294
  }
1300
1295
  t.deepLink = {
1301
- $store: new Ie(pe(o), "deep-link-context"),
1296
+ $store: new Te(ie(o), "deep-link-context"),
1302
1297
  getDeepLinkData: () => {
1303
1298
  const { data: a, used: u } = t.deepLink.$store.getValues();
1304
1299
  return { data: a, used: u };
1305
1300
  },
1306
1301
  // we are logged in with inviter id
1307
1302
  deepLinkUsed: (a) => {
1308
- ie.debug(`logged in with inviterId: ${a}`), t.deepLink.$store.setValue("used", !0);
1303
+ ne.debug(`logged in with inviterId: ${a}`), t.deepLink.$store.setValue("used", !0);
1309
1304
  },
1310
1305
  onDeepLinkHandlers: /* @__PURE__ */ new Set()
1311
1306
  }, t.sdk.getInviter = () => {
@@ -1314,28 +1309,28 @@ const Fr = "sldl", Tt = "sldl_uid", pn = "sldl_eid", hn = "sldl_e_eid", Xi = /*
1314
1309
  }, t.sdk.inviteDisplayed = () => {
1315
1310
  t.deepLink.$store.getStore().set({}), t.deepLink.$store.getStore().off(), n.del("sl-deep-link-store");
1316
1311
  }, t.deepLink.$store.subscribe((a) => n.set("sl-deep-link-store", JSON.stringify(a))), t.sdk.addDeepLinkHandler = (a) => {
1317
- ie.trace("adding deep link handler"), t.deepLink.onDeepLinkHandlers.add(a);
1312
+ localStorage.getItem("SL_DEBUG") && ne.trace("adding deep link handler"), t.deepLink.onDeepLinkHandlers.add(a);
1318
1313
  }, e.onDeepLinkHandled && t.sdk.addDeepLinkHandler(e.onDeepLinkHandled), t.sdk.removeDeepLinkHandler = (a) => {
1319
- ie.trace("removing deep link handler"), t.deepLink.onDeepLinkHandlers.delete(a);
1314
+ ne.trace("removing deep link handler"), t.deepLink.onDeepLinkHandlers.delete(a);
1320
1315
  };
1321
1316
  const s = (a) => {
1322
- t.deepLink.$store.setValue("handled", !0), ie.trace({ size: t.deepLink.onDeepLinkHandlers.size }, "deep link handled, call callbacks");
1317
+ t.deepLink.$store.setValue("handled", !0), ne.trace({ size: t.deepLink.onDeepLinkHandlers.size }, "deep link handled, call callbacks");
1323
1318
  for (const u of t.deepLink.onDeepLinkHandlers)
1324
1319
  try {
1325
- ie.trace("called handler"), u(a);
1320
+ ne.trace("called handler"), u(a);
1326
1321
  } catch (d) {
1327
1322
  console.error(d);
1328
1323
  }
1329
1324
  };
1330
1325
  eo(t.deepLink.$store, s), r();
1331
- }, ro = ve("bypass");
1326
+ }, ro = Se("bypass");
1332
1327
  class no extends di {
1333
1328
  $coreStore;
1334
1329
  deepLink;
1335
1330
  transport;
1336
1331
  bypassLogin;
1337
1332
  constructor(e, r, n) {
1338
- super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin = Ii(this.transport), this.connect();
1333
+ super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin = Ei(this.transport), this.connect();
1339
1334
  }
1340
1335
  me = async () => (this.$coreStore.getValues().user.invalidate(), (await this.$coreStore.getValues().user.getValue())?.data);
1341
1336
  /**
@@ -1418,7 +1413,7 @@ class no extends di {
1418
1413
  }
1419
1414
  const We = new je(), io = (t, e, r) => {
1420
1415
  t.auth = new no(t.store, t.transport, t.deepLink), t.stores.status.listen((n) => {
1421
- n === le.READY && t.auth.reLogin();
1416
+ n === de.READY && t.auth.reLogin();
1422
1417
  }), t.sdk.userId = t.stores.user.getAtomStore, t.sdk.authorizationBypass = async (n, i) => {
1423
1418
  if (!(We.getSchema() === n && We.getExternalToken() === i && t.transport.getHeader("authorization")))
1424
1419
  try {
@@ -1429,12 +1424,12 @@ const We = new je(), io = (t, e, r) => {
1429
1424
  }, t.sdk.logout = () => {
1430
1425
  t.auth.logout(), We.clear();
1431
1426
  }, t.sdk.getUserStore = () => t.stores.user.getStore(), t.sdk.isUserAuthorized = () => t.auth.isAuthenticated(), r();
1432
- }, Rr = ve("video_player"), ut = {
1427
+ }, Rr = Se("video_player"), ut = {
1433
1428
  debug: (...t) => {
1434
- Rr.debug(...t), console.log(...t);
1429
+ Rr.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1435
1430
  },
1436
1431
  trace: (...t) => {
1437
- Rr.trace(...t), console.log(...t);
1432
+ Rr.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1438
1433
  }
1439
1434
  }, oo = (t, e, r) => {
1440
1435
  t.videoPlayer = {
@@ -1455,27 +1450,27 @@ const We = new je(), io = (t, e, r) => {
1455
1450
  }
1456
1451
  }, r();
1457
1452
  }, so = (t, e, r) => {
1458
- const n = /* @__PURE__ */ new Set(), i = /* @__PURE__ */ new Set();
1459
- t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.onMount = (o) => {
1460
- n.add(o);
1453
+ const n = { onMountedFired: !1 }, i = /* @__PURE__ */ new Set(), o = /* @__PURE__ */ new Set();
1454
+ t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.onMount = (s) => {
1455
+ i.has(s) || (i.add(s), t?.stores?.enabled?.get() === "on" && o.add(s()));
1461
1456
  }, t.ready = () => {
1462
- t.stores.enabled.subscribe((o) => {
1463
- o === "on" ? n.forEach((s) => i.add(s())) : i.forEach((s) => s());
1457
+ t.stores.enabled.subscribe((s) => {
1458
+ s === "on" && n.onMountedFired === !1 && (i.forEach((a) => o.add(a())), n.onMountedFired = !0), s !== "on" && n.onMountedFired === !0 && (o.forEach((a) => a()), o.clear(), n.onMountedFired = !1);
1464
1459
  });
1465
- }, t.sdk.initializeApp = async (o) => {
1466
- if (t.contextConfig = o, t.stores.enabled.get() === "on")
1460
+ }, t.sdk.initializeApp = async (s) => {
1461
+ if (t.contextConfig = s, t.stores.enabled.get() === "on")
1467
1462
  return { enabled: !0 };
1468
- t.storeSubscribe(), t.stores.enabled.setValue("on"), t.stores.status.setValue(le.INITIALIZATION);
1463
+ t.storeSubscribe(), t.stores.enabled.setValue("on"), t.stores.status.setValue(de.INITIALIZATION);
1469
1464
  try {
1470
- const s = await t.stores.organizationSettings.getValue();
1471
- return s ? (t.stores.status.setValue(le.READY), { enabled: !!s }) : (t.stores.status.setValue(le.FAILED), { err: "failed" });
1472
- } catch (s) {
1473
- return t.stores.enabled.setValue(), t.stores.status.setValue(le.FAILED), { err: `${s}` };
1465
+ const a = await t.stores.organizationSettings.getValue();
1466
+ return a ? (t.stores.status.setValue(de.READY), { enabled: !!a }) : (t.stores.status.setValue(de.FAILED), { err: "failed" });
1467
+ } catch (a) {
1468
+ return t.stores.enabled.setValue(), t.stores.status.setValue(de.FAILED), { err: `${a}` };
1474
1469
  }
1475
1470
  }, t.sdk.disableApp = () => {
1476
- t.stores.enabled.get() === "on" && (t.stores.enabled.setValue(), t.stores.status.setValue(le.DISABLED), t.stores.slStreamId.setValue(), t.stores.providerStreamId.setValue(), t.sdk.closeFeature(!0), t.storeUnsubscribe(), t.transport.disconnect());
1477
- }, t.sdk.createEventSession = (o) => {
1478
- t.stores.providerStreamId.setValue(o);
1471
+ t.stores.enabled.get() === "on" && (t.stores.enabled.setValue(), t.stores.status.setValue(de.DISABLED), t.stores.slStreamId.setValue(), t.stores.providerStreamId.setValue(), t.sdk.closeFeature(!0), t.storeUnsubscribe(), t.transport.disconnect());
1472
+ }, t.sdk.createEventSession = (s) => {
1473
+ t.stores.providerStreamId.setValue(s);
1479
1474
  }, r();
1480
1475
  }, ao = (t, e) => {
1481
1476
  const { client: r, queryKey: n } = t.createPromiseClient(rt, {
@@ -1499,18 +1494,18 @@ const We = new je(), io = (t, e, r) => {
1499
1494
  r.append(n, i);
1500
1495
  return r.toString();
1501
1496
  }, co = (t, e, r, n) => {
1502
- const i = pe({});
1503
- return nn(i, () => ao(t, [e, r]).subscribe(async ({ data: a, error: u, loading: d }) => {
1504
- const c = u ? "https://masters.com" : a?.url, f = n.get() || "", y = e.get() || "", m = r.get() || "", b = {
1497
+ const i = ie({});
1498
+ return sr(i, () => ao(t, [e, r]).subscribe(async ({ data: a, error: u, loading: d }) => {
1499
+ const c = u ? "https://masters.com" : a?.url, f = n.get() || "", p = e.get() || "", m = r.get() || "", b = {
1505
1500
  [Tt]: f,
1506
- [pn]: y,
1507
- [hn]: m
1501
+ [hn]: p,
1502
+ [pn]: m
1508
1503
  };
1509
1504
  if (!d && c) {
1510
1505
  i.setKey("loading", !0);
1511
- let w = window.location.search, A = window.location.hash;
1512
- w && A || A ? w = `?${Vr(w, b)}` : A = `#${Vr("", b)}`;
1513
- const P = window.location.origin + window.location.pathname + w + A, V = await uo(t, { web: P, mobile: c });
1506
+ let T = window.location.search, E = window.location.hash;
1507
+ T && E || E ? T = `?${Vr(T, b)}` : E = `#${Vr("", b)}`;
1508
+ const F = window.location.origin + window.location.pathname + T + E, V = await uo(t, { web: F, mobile: c });
1514
1509
  i.set({
1515
1510
  data: V.data?.link,
1516
1511
  loading: !1
@@ -1519,14 +1514,14 @@ const We = new je(), io = (t, e, r) => {
1519
1514
  i.setKey("loading", !0);
1520
1515
  })), { $store: i, fetch };
1521
1516
  };
1522
- var x;
1517
+ var U;
1523
1518
  (function(t) {
1524
1519
  t.Unset = "unset", t.Required = "required", t.Optional = "optional", t.Completed = "completed", t.Disabled = "disabled", t.Unavailable = "unavailable";
1525
- })(x || (x = {}));
1520
+ })(U || (U = {}));
1526
1521
  const lo = (t, e, r, n) => {
1527
1522
  const { inplayGame: i } = t.featureSettings.get(), o = e.getCurrentSessionId({ prefix: "onboarding" });
1528
1523
  i && r.add({
1529
- type: me.ONBOARDING,
1524
+ type: be.ONBOARDING,
1530
1525
  id: o,
1531
1526
  action: t.openFeature,
1532
1527
  persistent: !0,
@@ -1553,32 +1548,32 @@ const lo = (t, e, r, n) => {
1553
1548
  userId: s,
1554
1549
  organizationId: e.organizationId.get() || "",
1555
1550
  eventId: e.slStreamId.get() || ""
1556
- }) === x.Completed) {
1557
- t.set(x.Completed);
1558
- for (const y of o)
1559
- y();
1551
+ }) === U.Completed) {
1552
+ t.set(U.Completed);
1553
+ for (const p of o)
1554
+ p();
1560
1555
  return;
1561
1556
  }
1562
1557
  const u = e.moderation.getStore().value?.data, d = r.featureSettings.get().inplayGame;
1563
1558
  if (u === void 0 || d === void 0)
1564
1559
  return;
1565
1560
  const c = u?.options?.onboardingEnabled, f = d?.titleCard?.optIn;
1566
- c ? f ? t.set(x.Required) : t.set(x.Optional) : (f ? t.set(x.Unavailable) : t.set(x.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), !1));
1561
+ c ? f ? t.set(U.Required) : t.set(U.Optional) : (f ? t.set(U.Unavailable) : t.set(U.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), !1));
1567
1562
  } catch (s) {
1568
1563
  console.error(s);
1569
1564
  }
1570
1565
  }, fo = (t, e, r, n) => {
1571
1566
  let i = !1;
1572
- const o = new fn(), s = q(x.Unset);
1567
+ const o = new fn(), s = B(U.Unset);
1573
1568
  s.subscribe((d) => {
1574
- d !== x.Unset && ((d === x.Optional || d === x.Required) && i === !1 && (lo(t, e, n, o), i = !0), d === x.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
1569
+ d !== U.Unset && ((d === U.Optional || d === U.Required) && i === !1 && (lo(t, e, n, o), i = !0), d === U.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
1575
1570
  userId: e.userId.get() || "",
1576
1571
  organizationId: e.organizationId.get() || "",
1577
1572
  eventId: e.slStreamId.get() || ""
1578
1573
  }));
1579
1574
  });
1580
1575
  const a = [];
1581
- return ct(s, e, t, n, o, a), s.get() !== x.Completed && (a.push(e.userId.listen((d) => {
1576
+ return ct(s, e, t, n, o, a), s.get() !== U.Completed && (a.push(e.userId.listen((d) => {
1582
1577
  d && ct(s, e, t, n, o, a);
1583
1578
  })), a.push(e.moderation.listen((d) => {
1584
1579
  d.data && ct(s, e, t, n, o, a);
@@ -1587,20 +1582,47 @@ const lo = (t, e, r, n) => {
1587
1582
  }))), { $store: s, submitInplay: async () => {
1588
1583
  const d = e.slStreamId.get();
1589
1584
  if (d) {
1590
- await Wi(r, d), s.set(x.Completed), o.saveOnboardingStatus({
1585
+ await Hi(r, d), s.set(U.Completed), o.saveOnboardingStatus({
1591
1586
  organizationId: e.organizationId.get() || "",
1592
1587
  userId: e.userId.get() || "",
1593
1588
  eventId: d
1594
- }, x.Completed), he.emit("poll", {
1589
+ }, U.Completed), pe.emit("poll", {
1595
1590
  action: "onboardingPassed",
1596
1591
  payload: {}
1597
- });
1592
+ }), t.openFeature();
1598
1593
  const c = e.getCurrentSessionId({ prefix: "onboarding" });
1599
1594
  n.close(c);
1600
1595
  }
1601
1596
  } };
1602
- }, po = /* @__PURE__ */ new Set([D.POLL, D.PREDICTION, D.TRIVIA]);
1603
- class ho extends dn {
1597
+ }, ho = (t, e, r, n) => {
1598
+ const i = ie(void 0), o = dn(n), s = async () => {
1599
+ const u = t.get(), d = e.get(), c = r.getStore().get().data?.map((b) => b.slId);
1600
+ if (!c)
1601
+ return;
1602
+ const f = {
1603
+ eventId: u,
1604
+ userId: d,
1605
+ usersIds: [...c, d]
1606
+ }, p = await o(f), m = i.get()?.summary?.friendsRank;
1607
+ p.data?.attributes?.summary?.friendsRank && m !== void 0 && (p.data.attributes.summary.friendsRank = m), i.set(p.data?.attributes);
1608
+ }, a = () => {
1609
+ s();
1610
+ };
1611
+ return sr(i, () => {
1612
+ const u = t.listen(s), d = r.listen(s), c = e.listen(s);
1613
+ return () => {
1614
+ u(), d(), c();
1615
+ };
1616
+ }), { $store: i, invalidate: a };
1617
+ }, po = async (t, e, r, n, i) => {
1618
+ const o = dn(i), s = t.get(), a = e.get(), u = r.getStore().get().data?.map((p) => p.slId) || [], d = {
1619
+ eventId: s,
1620
+ userId: n,
1621
+ usersIds: [...u, a]
1622
+ };
1623
+ return (await o(d)).data?.attributes?.summary;
1624
+ }, yo = /* @__PURE__ */ new Set([D.POLL, D.PREDICTION, D.TRIVIA]);
1625
+ class go extends ln {
1604
1626
  /** user statistics (leaderboard panel) */
1605
1627
  userSummary;
1606
1628
  /** feed list (pick history) */
@@ -1632,50 +1654,60 @@ class ho extends dn {
1632
1654
  /** Browser cache */
1633
1655
  storage;
1634
1656
  submitAnswerTimeout;
1657
+ cancels = /* @__PURE__ */ new Set();
1635
1658
  constructor(e, r, n) {
1636
- super(e, r), this.background = new qi(n), this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = new fn(), this.userSummary = new X(Di(this.background.slStreamId, this.background.userId, n.transport), "gamification:userSummary"), this.feedList = this.background.feedList, this.friends = new X(Vi(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = q(void 0), this.leaderboardId = new z(q(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = fo(this, this.background, n.transport, n.notifications), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = () => n.sdk.closeFeature(!0), this.openFeature = () => n.sdk.openFeature(N.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = co(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.leaderboardList = Ji(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.userSummary.listen((i) => {
1637
- this.leaderboardList.$store.lc !== 0 && i?.data?.summary && this.leaderboardList.invalidate();
1638
- }), this.background.activeQuestionId.listen(this.showInApp), this.onboardingStatus.$store.listen(this.checkInteractiveFlag), this.background.moderation.getStore().listen(this.checkInteractiveFlag), this.settings.subscribe(this.checkInteractiveFlag);
1659
+ super(e, r), this.background = new Bi(n), this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = new fn(), this.feedList = this.background.feedList, this.friends = new ye(Ri(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = B(void 0), this.leaderboardId = new W(B(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = fo(this, this.background, n.transport, n.notifications), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = () => n.sdk.closeFeature(!0), this.openFeature = () => n.sdk.openFeature(N.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = co(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = ho(this.background.slStreamId, this.background.userId, this.friends, this.transport), this.leaderboardList = Ji(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.cancels.add(this.userSummary.$store.listen((i, o) => {
1660
+ o?.summary && i?.summary && !i.fromLeaderboard && this.leaderboardList.invalidate();
1661
+ })), this.cancels.add(this.leaderboardList.$store.subscribe((i) => {
1662
+ const o = { ...this.userSummary.$store.get() || {} }, s = o?.summary?.userId;
1663
+ if (i.data.length && s) {
1664
+ const a = i.data.find((u) => u.userId === s)?.rank;
1665
+ a !== void 0 && o?.summary && (o.fromLeaderboard = !0, o.summary.friendsRank = a, this.userSummary.$store.set(o));
1666
+ }
1667
+ })), this.cancels.add(this.background.activeQuestionId.listen(this.showInApp)), 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)), n.sdk.onMount(() => () => {
1668
+ for (const i of this.cancels)
1669
+ i(), this.cancels.delete(i);
1670
+ });
1639
1671
  }
1640
1672
  get isInteractiveAllowed() {
1641
- return this.background.interactiveAllowed.get() === Te.ALLOWED;
1673
+ return this.background.interactiveAllowed.get() === Oe.ALLOWED;
1642
1674
  }
1643
1675
  checkInteractiveFlag = () => {
1644
- const e = this.onboardingStatus.$store.get(), r = this.background.moderation.getStore().value?.data?.options?.onboardingEnabled, n = this.settings.getValues().inplayGame?.titleCard?.optIn, i = e === x.Completed, o = !r || i || n !== !0;
1645
- this.background.interactiveAllowed.set(o ? Te.ALLOWED : Te.DISALLOWED);
1676
+ const e = this.onboardingStatus.$store.get(), r = this.background.moderation.getStore().value?.data?.options?.onboardingEnabled, n = this.settings.getValues().inplayGame?.titleCard?.optIn, i = e === U.Completed, o = !r || i || n !== !0;
1677
+ this.background.interactiveAllowed.set(o ? Oe.ALLOWED : Oe.DISALLOWED);
1646
1678
  };
1647
1679
  connect = () => {
1648
- this.background.feedSubscription.addListener("feed-subscription-prediction-close", async (e) => {
1680
+ this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-prediction-close", async (e) => {
1649
1681
  if (!this.isInteractiveAllowed)
1650
1682
  return;
1651
1683
  const r = e.data?.attributes?.question, n = e.data?.attributes?.feedItem;
1652
1684
  if (!r || !n?.attributes)
1653
1685
  return;
1654
1686
  const { status: i, type: o, id: s, answers: a } = r;
1655
- if (i === $e.RESOLVED && o === D.PREDICTION) {
1687
+ if (i === ce.RESOLVED && o === D.PREDICTION) {
1656
1688
  const u = this.background.getCurrentSessionId({
1657
1689
  prefix: `notification-id:${s}`
1658
- }), d = [...this.feedList.getValues().data || []], c = d.findIndex((j) => j.id === s), f = d[c];
1659
- let y = f?.attributes?.attributes?.value?.answerId;
1690
+ }), d = [...this.feedList.getValues().data || []], c = d.findIndex((q) => q.id === s), f = d[c];
1691
+ let p = f?.attributes?.attributes?.value?.answerId;
1660
1692
  const m = Wt(s, this.transport), b = m.subscribe(() => {
1661
1693
  });
1662
1694
  await m.get().promise;
1663
- const w = m.get().data;
1695
+ const T = m.get().data;
1664
1696
  b(), window.requestAnimationFrame(() => {
1665
1697
  m.invalidate();
1666
- }), y || (y = w?.answers.find(({ youVoted: j }) => j)?.id);
1667
- const A = a.find(({ correct: j }) => j), P = y ? a.find(({ id: j }) => j === y) : void 0, V = !!P?.correct;
1698
+ }), p || (p = T?.answers.find(({ youVoted: q }) => q)?.id);
1699
+ const E = a.find(({ correct: q }) => q), F = p ? a.find(({ id: q }) => q === p) : void 0, V = !!F?.correct;
1668
1700
  if (f && d[c]?.attributes?.attributes.case === "question") {
1669
1701
  try {
1670
- d[c].attributes.attributes.value.answerId = y, d[c].attributes.attributes.value.openForVoting = !1, y && (d[c].attributes.attributes.value.status = V ? at.WON : at.LOST);
1702
+ d[c].attributes.attributes.value.answerId = p, d[c].attributes.attributes.value.openForVoting = !1, p && (d[c].attributes.attributes.value.status = V ? at.WON : at.LOST);
1671
1703
  } catch {
1672
1704
  }
1673
1705
  this.feedList.getStore().mutate(d);
1674
1706
  }
1675
- if (!P || !A)
1707
+ if (!F || !E)
1676
1708
  return;
1677
1709
  this.openedQuestionId.get()?.questionId !== r.id && this.notifications.add({
1678
- type: me.QUESTION_RESOLVED,
1710
+ type: be.QUESTION_RESOLVED,
1679
1711
  action: () => this.openQuestion(r.id, n),
1680
1712
  close: () => this.closeQuestion(s),
1681
1713
  autoHideDuration: V ? 15e3 : 12e3,
@@ -1685,24 +1717,24 @@ class ho extends dn {
1685
1717
  questionId: s,
1686
1718
  questionType: D.PREDICTION,
1687
1719
  question: {
1688
- title: V ? `Congratulations! You answered correctly! You won ${A.points} pts!` : `Better luck next time! Correct: ${A?.text}!`,
1720
+ title: V ? `Congratulations! You answered correctly! You won ${E.points} pts!` : `Better luck next time! Correct: ${E?.text}!`,
1689
1721
  votedAnswer: {
1690
- title: P?.text,
1691
- points: P?.points
1722
+ title: F?.text,
1723
+ points: F?.points
1692
1724
  },
1693
- correctAnswerTitle: A?.text,
1725
+ correctAnswerTitle: E?.text,
1694
1726
  correct: !!V,
1695
- predictionResult: i === $e.RESOLVED,
1727
+ predictionResult: i === ce.RESOLVED,
1696
1728
  questionTitle: r?.subject
1697
1729
  }
1698
1730
  }
1699
1731
  }), this.userSummary.invalidate();
1700
1732
  }
1701
- }), this.background.feedSubscription.addListener("feed-subscription-questions-list", (e) => {
1733
+ })), this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list", (e) => {
1702
1734
  const r = [...this.feedList.getStore().value?.data || []], n = e.data?.attributes?.feedItem, i = r.findIndex((o) => o.id === n?.id);
1703
- if (n) {
1735
+ if (n?.attributes && !(n.attributes.status !== ce.ACTIVE && n.attributes.status !== ce.RESOLVED)) {
1704
1736
  if (i !== -1)
1705
- if (n.attributes?.attributes.case === "question" && r[i].attributes?.attributes.case === "question") {
1737
+ if (n.attributes.attributes.case === "question" && r[i].attributes?.attributes.case === "question") {
1706
1738
  const o = r[i];
1707
1739
  o.attributes && (r[i] = {
1708
1740
  ...r[i],
@@ -1728,9 +1760,25 @@ class ho extends dn {
1728
1760
  }
1729
1761
  }
1730
1762
  });
1731
- } else
1732
- r[i] = n;
1733
- i === -1 && (r.unshift(n), he.emit("poll", {
1763
+ } else {
1764
+ const o = r[i];
1765
+ o.attributes && n.attributes && (r[i] = {
1766
+ ...r[i],
1767
+ attributes: {
1768
+ ...o.attributes,
1769
+ attributes: {
1770
+ ...o.attributes.attributes,
1771
+ // eslint-disable-next-line @typescript-eslint/ban-ts-comment
1772
+ // @ts-ignore
1773
+ value: {
1774
+ ...o.attributes.attributes.value,
1775
+ ...n.attributes.attributes.value
1776
+ }
1777
+ }
1778
+ }
1779
+ });
1780
+ }
1781
+ i === -1 && (r.unshift(n), pe.emit("poll", {
1734
1782
  action: "received",
1735
1783
  payload: {
1736
1784
  questionId: n.id,
@@ -1738,7 +1786,7 @@ class ho extends dn {
1738
1786
  }
1739
1787
  })), this.feedList.getStore().mutate(r);
1740
1788
  }
1741
- });
1789
+ }));
1742
1790
  };
1743
1791
  // not used
1744
1792
  disconnect = () => {
@@ -1751,7 +1799,7 @@ class ho extends dn {
1751
1799
  return;
1752
1800
  const s = o.findIndex((d) => d.id === e), a = o[s], u = a?.attributes?.attributes.case === "question" && a.attributes.attributes.value;
1753
1801
  if (u) {
1754
- he.emit("poll", {
1802
+ pe.emit("poll", {
1755
1803
  action: "voted",
1756
1804
  payload: {
1757
1805
  questionId: e,
@@ -1761,8 +1809,10 @@ class ho extends dn {
1761
1809
  const d = n.subscribe(() => {
1762
1810
  }), c = n.get().data;
1763
1811
  if (d(), c) {
1764
- const f = c.answers.find((b) => b.correct === !0), y = c.answers.findIndex((b) => b.id === r), m = c.answers[y];
1765
- o[s].attributes.attributes.value.answerId = r, o[s].attributes.attributes.value.openForVoting = !1, o[s].attributes.attributes.value.text = m?.text || "", f && (o[s].attributes.attributes.value.status = f.id === r ? at.WON : at.LOST), this.feedList.getStore().mutate([...o]), c.answers[y].correct = f?.id === r, c.answers[y].youVoted = !0, f?.id === r && (c.answers[y].pointsEarned = c.status === $e.RESOLVED ? 0 : f.points), n.mutate({ ...c });
1812
+ const f = c.answers.find((b) => b.correct === !0), p = c.answers.findIndex((b) => b.id === r), m = c.answers[p];
1813
+ o[s].attributes.attributes.value.answerId = r, o[s].attributes.attributes.value.openForVoting = !1, o[s].attributes.attributes.value.text = m?.text || "", f && (o[s].attributes.attributes.value.status = f.id === r ? at.WON : at.LOST), this.feedList.getStore().mutate([...o]), c.answers[p].correct = f?.id === r, c.answers[p].youVoted = !0, c.answers.forEach((b) => {
1814
+ b.percentageDecimal = 0;
1815
+ }), f?.id === r && (c.answers[p].pointsEarned = c.status === ce.RESOLVED ? 0 : f.points), n.mutate({ ...c });
1766
1816
  }
1767
1817
  this.submitAnswerTimeout && clearTimeout(this.submitAnswerTimeout), this.submitAnswerTimeout = setTimeout(() => {
1768
1818
  this.userSummary.invalidate();
@@ -1770,7 +1820,7 @@ class ho extends dn {
1770
1820
  }
1771
1821
  };
1772
1822
  try {
1773
- await Hi(this.transport, { questionId: e, answerId: r }), i();
1823
+ await zi(this.transport, { questionId: e, answerId: r }), i();
1774
1824
  } catch (o) {
1775
1825
  if (o.message === tt.ALREADY_VOTED) {
1776
1826
  this.userSummary.invalidate();
@@ -1782,12 +1832,15 @@ class ho extends dn {
1782
1832
  }
1783
1833
  };
1784
1834
  openQuestion = (e, r) => {
1835
+ if (!e)
1836
+ return () => {
1837
+ };
1785
1838
  this.notifications.close(this.background.getCurrentSessionId({
1786
1839
  prefix: "notification",
1787
1840
  entity: e
1788
1841
  }));
1789
1842
  let n = r?.attributes?.type;
1790
- return n || (n = (this.feedList.getStore().value?.data || []).find((o) => o.id === e)?.attributes?.type), he.emit("poll", {
1843
+ return n || (n = (this.feedList.getStore().value?.data || []).find((o) => o.id === e)?.attributes?.type), pe.emit("poll", {
1791
1844
  action: "opened",
1792
1845
  payload: {
1793
1846
  questionId: e,
@@ -1797,9 +1850,24 @@ class ho extends dn {
1797
1850
  }), this.background.openQuestion(e, r);
1798
1851
  };
1799
1852
  closeQuestion = (e) => this.background.closeQuestion(e);
1800
- openUser = (e) => {
1801
- const r = this.leaderboardList.$store.get().data?.find((n) => n.userId === e);
1802
- this.openedUser.set(r);
1853
+ openUser = async (e) => {
1854
+ const r = this.leaderboardList.$store.get().data?.find((i) => i.userId === e);
1855
+ if (!r) {
1856
+ this.openedUser.set(r);
1857
+ return;
1858
+ }
1859
+ if (r.summaryLoaded) {
1860
+ this.openedUser.set(r);
1861
+ return;
1862
+ }
1863
+ const n = { ...r };
1864
+ try {
1865
+ const i = await po(this.background.slStreamId, this.background.userId, this.friends, e, this.transport);
1866
+ i?.inTop !== void 0 && (this.leaderboardList.$store.setKey("data", this.leaderboardList.$store.get().data?.map((o) => (o.userId === e && (o.inTop = i.inTop), o))), n.inTop = i.inTop);
1867
+ } catch (i) {
1868
+ console.error(i);
1869
+ }
1870
+ this.openedUser.set(n);
1803
1871
  };
1804
1872
  closeUser = () => {
1805
1873
  this.openedUser.set(void 0);
@@ -1812,12 +1880,12 @@ class ho extends dn {
1812
1880
  */
1813
1881
  showInApp = (e) => {
1814
1882
  const r = this.onboardingStatus.$store.get();
1815
- if (e && e.data && r && r !== x.Unset && e.data.question?.id !== void 0 && e.data.question.notification !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== Yn.ON && e.data.question.status === $e.ACTIVE && !e.data.question.marketClosed) {
1816
- if (po.has(e.data.question.type))
1883
+ if (e && e.data && r && r !== U.Unset && e.data.question?.id !== void 0 && e.data.question.notification !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== Yn.ON && e.data.question.status === ce.ACTIVE && !e.data.question.marketClosed) {
1884
+ if (yo.has(e.data.question.type))
1817
1885
  this.isInteractiveAllowed && this.notifications.add({
1818
- type: me.QUESTION,
1819
- action: () => e.data?.question && this.openQuestion(e.data.question.id, e.data.feedItem),
1820
- close: () => e.data?.question && this.closeQuestion(e.data.question.id),
1886
+ type: be.QUESTION,
1887
+ action: () => this.openQuestion(e.data?.question?.id, e.data?.feedItem),
1888
+ close: () => this.closeQuestion(e.data?.question?.id),
1821
1889
  autoHideDuration: 1e3 * 60,
1822
1890
  id: this.background.getCurrentSessionId({
1823
1891
  prefix: "notification",
@@ -1836,7 +1904,7 @@ class ho extends dn {
1836
1904
  const n = e.data.question.options?.options.value, i = {
1837
1905
  heading: e.data.question.notification.title,
1838
1906
  body: e.data.question.notification.body,
1839
- imageMode: n.imageMode,
1907
+ imageMode: n?.imageMode,
1840
1908
  image: n?.image,
1841
1909
  video: {
1842
1910
  id: n?.video?.id || "",
@@ -1849,9 +1917,9 @@ class ho extends dn {
1849
1917
  }
1850
1918
  };
1851
1919
  this.notifications.add({
1852
- type: me.QUESTION,
1853
- action: () => e.data?.question && this.openQuestion(e.data.question.id, e.data.feedItem),
1854
- close: () => e.data?.question && this.closeQuestion(e.data.question.id),
1920
+ type: be.QUESTION,
1921
+ action: () => this.openQuestion(e?.data?.question?.id, e?.data?.feedItem),
1922
+ close: () => this.closeQuestion(e?.data?.question?.id),
1855
1923
  autoHideDuration: 1e3 * 120,
1856
1924
  emitEvent: !0,
1857
1925
  id: this.background.getCurrentSessionId({ prefix: "notification", entity: e.data.question.id }),
@@ -1872,9 +1940,9 @@ class ho extends dn {
1872
1940
  tweetId: e.data.question.id
1873
1941
  };
1874
1942
  this.notifications.add({
1875
- type: me.QUESTION,
1876
- action: () => e.data?.question && this.openQuestion(e.data.question.id, e.data.feedItem),
1877
- close: () => e.data?.question && this.closeQuestion(e.data.question.id),
1943
+ type: be.QUESTION,
1944
+ action: () => this.openQuestion(e.data?.question?.id, e.data?.feedItem),
1945
+ close: () => this.closeQuestion(e.data?.question?.id),
1878
1946
  autoHideDuration: 1e3 * 120,
1879
1947
  emitEvent: !0,
1880
1948
  id: this.background.getCurrentSessionId({ prefix: "notification", entity: e.data.question.id }),
@@ -1888,16 +1956,16 @@ class ho extends dn {
1888
1956
  }
1889
1957
  };
1890
1958
  }
1891
- const yo = {
1959
+ const mo = {
1892
1960
  [N.GAMES]: !0
1893
1961
  };
1894
- class go extends dn {
1962
+ class bo extends ln {
1895
1963
  constructor(e, r) {
1896
1964
  super(e, r);
1897
1965
  }
1898
1966
  }
1899
- const mo = (t, e, r) => t.type === N.GAMES ? new ho(t, e, r) : new go(t, e), bo = (t, e, r) => {
1900
- t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new z(q(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new z(q(N.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) => {
1967
+ const vo = (t, e, r) => t.type === N.GAMES ? new go(t, e, r) : new bo(t, e), So = (t, e, r) => {
1968
+ t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new W(B(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new W(B(N.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) => {
1901
1969
  t.activeFeature.setValue(n);
1902
1970
  }, t.sdk.closeFeature = (n = !1) => {
1903
1971
  const i = t.activeFeature.getValue();
@@ -1906,9 +1974,9 @@ const mo = (t, e, r) => t.type === N.GAMES ? new ho(t, e, r) : new go(t, e), bo
1906
1974
  const o = t.sdk.featuresList.getValue();
1907
1975
  o && o.delete(i), t.sdk.featuresList.setValue(o);
1908
1976
  }
1909
- }, t.initFeature = (n, i = ce.ORGANIZATION) => {
1910
- if (n.type in yo && !t.features.has(n.type)) {
1911
- const o = mo(n, i, t);
1977
+ }, t.initFeature = (n, i = le.ORGANIZATION) => {
1978
+ if (n.type in mo && !t.features.has(n.type)) {
1979
+ const o = vo(n, i, t);
1912
1980
  t.features.set(n.type, o);
1913
1981
  let s = t.sdk.featuresList.getValue();
1914
1982
  s ? s.add(n.type) : s = /* @__PURE__ */ new Set([n.type]), t.sdk.featuresList.setValue(new Set(s));
@@ -1923,12 +1991,12 @@ const mo = (t, e, r) => t.type === N.GAMES ? new ho(t, e, r) : new go(t, e), bo
1923
1991
  const n = await t.stores.organizationSettings.getValue();
1924
1992
  t.features.clear(), t.sdk.featuresList.setValue(/* @__PURE__ */ new Set());
1925
1993
  for (const i of n?.overlays || [])
1926
- t.initFeature(i, ce.ORGANIZATION);
1994
+ t.initFeature(i, le.ORGANIZATION);
1927
1995
  }, t.stores.providerStreamId.listen((n) => {
1928
1996
  n || t.reinitializeFeatures();
1929
1997
  }), t.storeSubscribe = () => {
1930
1998
  const n = (o, s) => {
1931
- if (s?.overlays && !(t.contextConfig?.skipOrganizationSettings && o === ce.ORGANIZATION))
1999
+ if (s?.overlays && !(t.contextConfig?.skipOrganizationSettings && o === le.ORGANIZATION))
1932
2000
  for (const a of s.overlays)
1933
2001
  a.sdkEnable === !0 && (t.features.has(a.type) ? t.updateFeature(a, o) : t.initFeature(a, o));
1934
2002
  }, i = {
@@ -1944,7 +2012,7 @@ const mo = (t, e, r) => t.type === N.GAMES ? new ho(t, e, r) : new go(t, e), bo
1944
2012
  organizationSettings: (o) => {
1945
2013
  if (o.data)
1946
2014
  try {
1947
- n(ce.ORGANIZATION, o.data);
2015
+ n(le.ORGANIZATION, o.data);
1948
2016
  } catch (s) {
1949
2017
  console.log(s);
1950
2018
  }
@@ -1952,7 +2020,7 @@ const mo = (t, e, r) => t.type === N.GAMES ? new ho(t, e, r) : new go(t, e), bo
1952
2020
  streamSettings: (o) => {
1953
2021
  if (o.data)
1954
2022
  try {
1955
- n(ce.STREAM, o.data);
2023
+ n(le.STREAM, o.data);
1956
2024
  } catch (s) {
1957
2025
  console.log(s);
1958
2026
  }
@@ -1961,7 +2029,7 @@ const mo = (t, e, r) => t.type === N.GAMES ? new ho(t, e, r) : new go(t, e), bo
1961
2029
  t.store.subscribe(i);
1962
2030
  }, r();
1963
2031
  };
1964
- class vo {
2032
+ class wo {
1965
2033
  analytics;
1966
2034
  constructor(e) {
1967
2035
  this.analytics = e, this.analytics.onConnect(() => {
@@ -1973,31 +2041,31 @@ class vo {
1973
2041
  break;
1974
2042
  }
1975
2043
  };
1976
- return he.listen(r);
2044
+ return pe.listen(r);
1977
2045
  });
1978
2046
  }
1979
2047
  accepted = () => {
1980
2048
  this.analytics.write("invitation", {
1981
2049
  common: {
1982
2050
  ...this.analytics.commonStore.getValues(),
1983
- kind: J.INVITATION_ACCEPTED
2051
+ kind: H.INVITATION_ACCEPTED
1984
2052
  },
1985
- category: vr.GAMES,
1986
- from: Sr.UNSET
2053
+ category: Sr.GAMES,
2054
+ from: wr.UNSET
1987
2055
  });
1988
2056
  };
1989
2057
  sent = ({ from: e }) => {
1990
2058
  this.analytics.write("invitation", {
1991
2059
  common: {
1992
2060
  ...this.analytics.commonStore.getValues(),
1993
- kind: J.INVITATION_SENT
2061
+ kind: H.INVITATION_SENT
1994
2062
  },
1995
- category: vr.GAMES,
1996
- from: e || Sr.UNSET
2063
+ category: Sr.GAMES,
2064
+ from: e || wr.UNSET
1997
2065
  });
1998
2066
  };
1999
2067
  }
2000
- class So {
2068
+ class Ao {
2001
2069
  analytics;
2002
2070
  constructor(e) {
2003
2071
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2012,39 +2080,39 @@ class So {
2012
2080
  break;
2013
2081
  }
2014
2082
  };
2015
- return he.listen(r);
2083
+ return pe.listen(r);
2016
2084
  });
2017
2085
  }
2018
2086
  tap = () => {
2019
2087
  this.analytics.write("interactions", {
2020
2088
  common: {
2021
2089
  ...this.analytics.commonStore.getValues(),
2022
- kind: J.INTERACTIONS
2090
+ kind: H.INTERACTIONS
2023
2091
  },
2024
- actionType: Cr.TAP
2092
+ actionType: Lr.TAP
2025
2093
  });
2026
2094
  };
2027
2095
  scroll = () => {
2028
2096
  this.analytics.write("interactions", {
2029
2097
  common: {
2030
2098
  ...this.analytics.commonStore.getValues(),
2031
- kind: J.INTERACTIONS
2099
+ kind: H.INTERACTIONS
2032
2100
  },
2033
- actionType: Cr.SCROLL
2101
+ actionType: Lr.SCROLL
2034
2102
  });
2035
2103
  };
2036
2104
  }
2037
2105
  const Ye = {
2038
- [D.UNSET]: H.UNSET,
2039
- [D.FACTOID]: H.POLLS_INSIGHT,
2040
- [D.POLL]: H.POLLS_POLL,
2041
- [D.PREDICTION]: H.POLLS_PREDICTION,
2042
- [D.PROMOTION]: H.POLLS_PROMOTION,
2043
- [D.TRIVIA]: H.POLLS_TRIVIA,
2044
- [D.TWEET]: H.POLLS_TWITTER
2106
+ [D.UNSET]: K.UNSET,
2107
+ [D.FACTOID]: K.POLLS_INSIGHT,
2108
+ [D.POLL]: K.POLLS_POLL,
2109
+ [D.PREDICTION]: K.POLLS_PREDICTION,
2110
+ [D.PROMOTION]: K.POLLS_PROMOTION,
2111
+ [D.TRIVIA]: K.POLLS_TRIVIA,
2112
+ [D.TWEET]: K.POLLS_TWITTER
2045
2113
  };
2046
2114
  D.UNSET + "", ae.UNSET, D.FACTOID + "", ae.POLLS, D.POLL + "", ae.POLLS, D.PREDICTION + "", ae.POLLS, D.PROMOTION + "", ae.POLLS, D.TRIVIA + "", ae.POLLS, D.TWEET + "", ae.POLLS;
2047
- const wo = {
2115
+ const Io = {
2048
2116
  [N.UNSET]: Q.UNSET,
2049
2117
  [N.INPLAY]: Q.INPLAY,
2050
2118
  [N.MESSAGING]: Q.MESSAGING,
@@ -2064,7 +2132,7 @@ const wo = {
2064
2132
  [N.HIGHLIGHTS]: Q.HIGHLIGHTS,
2065
2133
  [N.PUBLIC_CHAT]: Q.PUBLIC_CHAT
2066
2134
  };
2067
- class Ao {
2135
+ class Eo {
2068
2136
  analytics;
2069
2137
  constructor(e) {
2070
2138
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2079,16 +2147,16 @@ class Ao {
2079
2147
  break;
2080
2148
  }
2081
2149
  };
2082
- return he.listen(r);
2150
+ return pe.listen(r);
2083
2151
  });
2084
2152
  }
2085
2153
  received = ({ questionId: e, questionType: r }) => {
2086
2154
  this.analytics.write("notification", {
2087
2155
  common: {
2088
2156
  ...this.analytics.commonStore.getValues(),
2089
- kind: J.NOTIFICATION_RECEIVED,
2157
+ kind: H.NOTIFICATION_RECEIVED,
2090
2158
  topicId: e,
2091
- topicType: r ? Ye[r] : H.UNSET
2159
+ topicType: r ? Ye[r] : K.UNSET
2092
2160
  },
2093
2161
  notificationKind: ae.POLLS,
2094
2162
  notificationType: _r.IN_APP
@@ -2098,16 +2166,16 @@ class Ao {
2098
2166
  this.analytics.write("notification", {
2099
2167
  common: {
2100
2168
  ...this.analytics.commonStore.getValues(),
2101
- kind: J.NOTIFICATION_OPENED,
2169
+ kind: H.NOTIFICATION_OPENED,
2102
2170
  topicId: e,
2103
- topicType: r ? Ye[r] : H.UNSET
2171
+ topicType: r ? Ye[r] : K.UNSET
2104
2172
  },
2105
2173
  notificationKind: ae.POLLS,
2106
2174
  notificationType: _r.IN_APP
2107
2175
  });
2108
2176
  };
2109
2177
  }
2110
- class Eo {
2178
+ class To {
2111
2179
  analytics;
2112
2180
  constructor(e) {
2113
2181
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2131,7 +2199,7 @@ class Eo {
2131
2199
  break;
2132
2200
  }
2133
2201
  };
2134
- return he.listen(r);
2202
+ return pe.listen(r);
2135
2203
  });
2136
2204
  }
2137
2205
  // event when a poll is received from subscription or active question request
@@ -2139,11 +2207,11 @@ class Eo {
2139
2207
  this.analytics.write("games", {
2140
2208
  common: {
2141
2209
  ...this.analytics.commonStore.getValues(),
2142
- kind: J.POLLS_RECEIVED,
2210
+ kind: H.POLLS_RECEIVED,
2143
2211
  topicId: e,
2144
- topicType: r ? Ye[r] : H.UNSET
2212
+ topicType: r ? Ye[r] : K.UNSET
2145
2213
  },
2146
- pollOpenedFrom: Ne.UNSET
2214
+ pollOpenedFrom: De.UNSET
2147
2215
  });
2148
2216
  };
2149
2217
  // poll is opened from notification or list
@@ -2151,11 +2219,11 @@ class Eo {
2151
2219
  this.analytics.write("games", {
2152
2220
  common: {
2153
2221
  ...this.analytics.commonStore.getValues(),
2154
- kind: J.POLLS_OPENED,
2222
+ kind: H.POLLS_OPENED,
2155
2223
  topicId: e,
2156
- topicType: r ? Ye[r] : H.UNSET
2224
+ topicType: r ? Ye[r] : K.UNSET
2157
2225
  },
2158
- pollOpenedFrom: n === "list" ? Ne.PICK_HISTORY : Ne.IN_APP
2226
+ pollOpenedFrom: n === "list" ? De.PICK_HISTORY : De.IN_APP
2159
2227
  });
2160
2228
  };
2161
2229
  // poll is voted
@@ -2163,11 +2231,11 @@ class Eo {
2163
2231
  this.analytics.write("games", {
2164
2232
  common: {
2165
2233
  ...this.analytics.commonStore.getValues(),
2166
- kind: J.POLLS_VOTE,
2234
+ kind: H.POLLS_VOTE,
2167
2235
  topicId: e,
2168
- topicType: r ? Ye[r] : H.UNSET
2236
+ topicType: r ? Ye[r] : K.UNSET
2169
2237
  },
2170
- pollOpenedFrom: Ne.UNSET
2238
+ pollOpenedFrom: De.UNSET
2171
2239
  });
2172
2240
  };
2173
2241
  // onboarding passed, user is now able to vote
@@ -2175,9 +2243,9 @@ class Eo {
2175
2243
  this.analytics.write("games", {
2176
2244
  common: {
2177
2245
  ...this.analytics.commonStore.getValues(),
2178
- kind: J.GAMES_JOINED
2246
+ kind: H.GAMES_JOINED
2179
2247
  },
2180
- pollOpenedFrom: Ne.UNSET
2248
+ pollOpenedFrom: De.UNSET
2181
2249
  });
2182
2250
  };
2183
2251
  // user clicked on link in poll and navigated to another page
@@ -2185,51 +2253,51 @@ class Eo {
2185
2253
  this.analytics.write("games", {
2186
2254
  common: {
2187
2255
  ...this.analytics.commonStore.getValues(),
2188
- kind: J.POLLS_NAVIGATED
2256
+ kind: H.POLLS_NAVIGATED
2189
2257
  },
2190
- pollOpenedFrom: Ne.UNSET
2258
+ pollOpenedFrom: De.UNSET
2191
2259
  });
2192
2260
  };
2193
2261
  }
2194
- const Io = ({ transport: t, $commonStore: e }) => {
2262
+ const Oo = ({ transport: t, $commonStore: e }) => {
2195
2263
  let r;
2196
- const n = q(!1), i = 5e3, { client: o, queryKey: s } = t.createPromiseClient(sn, {
2264
+ const n = B(!1), i = 5e3, { client: o, queryKey: s } = t.createPromiseClient(on, {
2197
2265
  method: "send",
2198
2266
  params: [n]
2199
2267
  }), a = t.nanoquery.createFetcherStore(s, {
2200
2268
  fetcher: async () => {
2201
- const y = e.getStore().get();
2269
+ const p = e.getStore().get();
2202
2270
  try {
2203
2271
  await o.unary({
2204
2272
  message: {
2205
2273
  case: "heartbeat",
2206
2274
  value: {
2207
2275
  common: {
2208
- ...y,
2209
- kind: J.SESSION_HEARTBEAT
2276
+ ...p,
2277
+ kind: H.SESSION_HEARTBEAT
2210
2278
  }
2211
2279
  }
2212
2280
  }
2213
2281
  });
2214
2282
  } catch (m) {
2215
- de.error(m, "send heartbeat failed");
2283
+ fe.error(m, "send heartbeat failed");
2216
2284
  }
2217
2285
  return Date.now();
2218
2286
  },
2219
2287
  refetchInterval: i
2220
2288
  }), u = () => {
2221
- de.debug("mounted heartbeat"), r = a.subscribe(() => {
2289
+ fe.debug("mounted heartbeat"), r = a.subscribe(() => {
2222
2290
  });
2223
2291
  }, d = () => {
2224
- de.debug("enabled heartbeat"), n.set(!0), a.lc === 0 && u();
2292
+ fe.debug("enabled heartbeat"), n.set(!0), a.lc === 0 && u();
2225
2293
  }, c = () => {
2226
- de.debug("disabled heartbeat"), n.set(!1);
2294
+ fe.debug("disabled heartbeat"), n.set(!1);
2227
2295
  };
2228
2296
  return { enable: d, disable: c, mount: u, unmount: () => {
2229
- de.debug("unmounted heartbeat"), a.off(), r?.(), r = void 0, c();
2297
+ fe.debug("unmounted heartbeat"), a.off(), r?.(), r = void 0, c();
2230
2298
  } };
2231
- }, de = ve("analytics");
2232
- class To {
2299
+ }, fe = Se("analytics");
2300
+ class Co {
2233
2301
  commonStore;
2234
2302
  notifications;
2235
2303
  polls;
@@ -2241,23 +2309,23 @@ class To {
2241
2309
  listenersCancels;
2242
2310
  connected = !1;
2243
2311
  constructor(e) {
2244
- this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Ie(pe({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = Io({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new Ao(this), this.polls = new Eo(this), this.invitation = new vo(this), this.interactions = new So(this);
2245
- const { client: r } = e.analyticsTransport.createPromiseClient(sn, {
2312
+ this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Te(ie({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = Oo({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new Eo(this), this.polls = new To(this), this.invitation = new wo(this), this.interactions = new Ao(this);
2313
+ const { client: r } = e.analyticsTransport.createPromiseClient(on, {
2246
2314
  method: "send"
2247
2315
  });
2248
2316
  this.analyticsClient = r;
2249
2317
  }
2250
2318
  connect = () => {
2251
- this.writeCommon("sessionId", Gt()), this.heartbeat.enable(), this.listeners.forEach((e) => this.listenersCancels.add(e())), this.connected = !0, de.debug("analytics connected");
2319
+ this.writeCommon("sessionId", Gt()), this.heartbeat.enable(), this.listeners.forEach((e) => this.listenersCancels.add(e())), this.connected = !0, fe.debug("analytics connected");
2252
2320
  };
2253
2321
  disconnect = () => {
2254
- this.writeCommon("sessionId", ""), this.writeCommon("overlaySessionId", ""), this.heartbeat.unmount(), this.listenersCancels.forEach((e) => e()), this.connected = !1, de.debug("analytics disconnected");
2322
+ this.writeCommon("sessionId", ""), this.writeCommon("overlaySessionId", ""), this.heartbeat.unmount(), this.listenersCancels.forEach((e) => e()), this.connected = !1, fe.debug("analytics disconnected");
2255
2323
  };
2256
2324
  write = (e, r) => {
2257
2325
  r && this.analyticsClient.unary({ message: { case: e, value: r } }).then(() => {
2258
- de.trace("send analytics success", e, r);
2326
+ fe.trace("send analytics success", e, r);
2259
2327
  }).catch((n) => {
2260
- de.error(n, "send analytics failed");
2328
+ fe.error(n, "send analytics failed");
2261
2329
  });
2262
2330
  };
2263
2331
  writeCommon = (e, r) => {
@@ -2271,10 +2339,10 @@ class To {
2271
2339
  this.onConnect(() => e.stores.slStreamId.getAtomStore().subscribe((r) => {
2272
2340
  this.writeCommon("eventId", r);
2273
2341
  })), this.onConnect(() => e.sdk.getActiveFeature().subscribe((r) => {
2274
- r && this.writeCommon("category", wo[r]), r !== N.UNSET ? this.writeCommon("overlaySessionId", Gt()) : this.writeCommon("overlaySessionId", "");
2342
+ r && this.writeCommon("category", Io[r]), r !== N.UNSET ? this.writeCommon("overlaySessionId", Gt()) : this.writeCommon("overlaySessionId", "");
2275
2343
  })), this.onConnect(() => {
2276
2344
  const r = window.matchMedia("(orientation: portrait)"), n = (i) => {
2277
- this.writeCommon("screenOrientation", i.matches ? Or.PORTRAIT : Or.LANDSCAPE);
2345
+ this.writeCommon("screenOrientation", i.matches ? Cr.PORTRAIT : Cr.LANDSCAPE);
2278
2346
  };
2279
2347
  return r.addEventListener("change", n), () => {
2280
2348
  r.removeEventListener("change", n);
@@ -2284,17 +2352,17 @@ class To {
2284
2352
  }));
2285
2353
  };
2286
2354
  }
2287
- const Oo = (t, e, r) => {
2288
- t.analytics = new To(t), t.sdk.onMount(() => (t.analytics.connect(), () => {
2355
+ const Lo = (t, e, r) => {
2356
+ t.analytics = new Co(t), t.sdk.onMount(() => (t.analytics.connect(), () => {
2289
2357
  t.analytics.disconnect();
2290
2358
  })), r();
2291
2359
  };
2292
2360
  var yn = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2293
- function Co(t) {
2361
+ function _o(t) {
2294
2362
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
2295
2363
  }
2296
- var ar = { exports: {} }, ur = { exports: {} };
2297
- function _o(t) {
2364
+ var ur = { exports: {} }, cr = { exports: {} };
2365
+ function ko(t) {
2298
2366
  var e = new t(), r = e;
2299
2367
  function n() {
2300
2368
  var o = e;
@@ -2308,14 +2376,14 @@ function _o(t) {
2308
2376
  release: i
2309
2377
  };
2310
2378
  }
2311
- var Lo = _o, ko = Lo;
2379
+ var Po = ko, Fo = Po;
2312
2380
  function gn(t, e, r) {
2313
2381
  if (typeof t == "function" && (r = e, e = t, t = null), r < 1)
2314
2382
  throw new Error("fastqueue concurrency must be greater than 1");
2315
- var n = ko(Po), i = null, o = null, s = 0, a = null, u = {
2316
- push: w,
2317
- drain: W,
2318
- saturated: W,
2383
+ var n = Fo(No), i = null, o = null, s = 0, a = null, u = {
2384
+ push: T,
2385
+ drain: z,
2386
+ saturated: z,
2319
2387
  pause: c,
2320
2388
  paused: !1,
2321
2389
  concurrency: r,
@@ -2323,12 +2391,12 @@ function gn(t, e, r) {
2323
2391
  resume: m,
2324
2392
  idle: b,
2325
2393
  length: f,
2326
- getQueue: y,
2327
- unshift: A,
2328
- empty: W,
2394
+ getQueue: p,
2395
+ unshift: E,
2396
+ empty: z,
2329
2397
  kill: V,
2330
- killAndDrain: j,
2331
- error: K
2398
+ killAndDrain: q,
2399
+ error: J
2332
2400
  };
2333
2401
  return u;
2334
2402
  function d() {
@@ -2338,107 +2406,107 @@ function gn(t, e, r) {
2338
2406
  u.paused = !0;
2339
2407
  }
2340
2408
  function f() {
2341
- for (var L = i, R = 0; L; )
2342
- L = L.next, R++;
2409
+ for (var _ = i, R = 0; _; )
2410
+ _ = _.next, R++;
2343
2411
  return R;
2344
2412
  }
2345
- function y() {
2346
- for (var L = i, R = []; L; )
2347
- R.push(L.value), L = L.next;
2413
+ function p() {
2414
+ for (var _ = i, R = []; _; )
2415
+ R.push(_.value), _ = _.next;
2348
2416
  return R;
2349
2417
  }
2350
2418
  function m() {
2351
2419
  if (u.paused) {
2352
2420
  u.paused = !1;
2353
- for (var L = 0; L < u.concurrency; L++)
2354
- s++, P();
2421
+ for (var _ = 0; _ < u.concurrency; _++)
2422
+ s++, F();
2355
2423
  }
2356
2424
  }
2357
2425
  function b() {
2358
2426
  return s === 0 && u.length() === 0;
2359
2427
  }
2360
- function w(L, R) {
2361
- var T = n.get();
2362
- T.context = t, T.release = P, T.value = L, T.callback = R || W, T.errorHandler = a, s === u.concurrency || u.paused ? o ? (o.next = T, o = T) : (i = T, o = T, u.saturated()) : (s++, e.call(t, T.value, T.worked));
2428
+ function T(_, R) {
2429
+ var I = n.get();
2430
+ I.context = t, I.release = F, I.value = _, I.callback = R || z, I.errorHandler = a, s === u.concurrency || u.paused ? o ? (o.next = I, o = I) : (i = I, o = I, u.saturated()) : (s++, e.call(t, I.value, I.worked));
2363
2431
  }
2364
- function A(L, R) {
2365
- var T = n.get();
2366
- T.context = t, T.release = P, T.value = L, T.callback = R || W, T.errorHandler = a, s === u.concurrency || u.paused ? i ? (T.next = i, i = T) : (i = T, o = T, u.saturated()) : (s++, e.call(t, T.value, T.worked));
2432
+ function E(_, R) {
2433
+ var I = n.get();
2434
+ I.context = t, I.release = F, I.value = _, I.callback = R || z, I.errorHandler = a, s === u.concurrency || u.paused ? i ? (I.next = i, i = I) : (i = I, o = I, u.saturated()) : (s++, e.call(t, I.value, I.worked));
2367
2435
  }
2368
- function P(L) {
2369
- L && n.release(L);
2436
+ function F(_) {
2437
+ _ && n.release(_);
2370
2438
  var R = i;
2371
2439
  R ? u.paused ? s-- : (o === i && (o = null), i = R.next, R.next = null, e.call(t, R.value, R.worked), o === null && u.empty()) : --s === 0 && u.drain();
2372
2440
  }
2373
2441
  function V() {
2374
- i = null, o = null, u.drain = W;
2442
+ i = null, o = null, u.drain = z;
2375
2443
  }
2376
- function j() {
2377
- i = null, o = null, u.drain(), u.drain = W;
2444
+ function q() {
2445
+ i = null, o = null, u.drain(), u.drain = z;
2378
2446
  }
2379
- function K(L) {
2380
- a = L;
2447
+ function J(_) {
2448
+ a = _;
2381
2449
  }
2382
2450
  }
2383
- function W() {
2451
+ function z() {
2384
2452
  }
2385
- function Po() {
2386
- this.value = null, this.callback = W, this.next = null, this.release = W, this.context = null, this.errorHandler = null;
2453
+ function No() {
2454
+ this.value = null, this.callback = z, this.next = null, this.release = z, this.context = null, this.errorHandler = null;
2387
2455
  var t = this;
2388
2456
  this.worked = function(r, n) {
2389
2457
  var i = t.callback, o = t.errorHandler, s = t.value;
2390
- t.value = null, t.callback = W, t.errorHandler && o(r, s), i.call(t.context, r, n), t.release(t);
2458
+ t.value = null, t.callback = z, t.errorHandler && o(r, s), i.call(t.context, r, n), t.release(t);
2391
2459
  };
2392
2460
  }
2393
- function Fo(t, e, r) {
2461
+ function Do(t, e, r) {
2394
2462
  typeof t == "function" && (r = e, e = t, t = null);
2395
2463
  function n(c, f) {
2396
- e.call(this, c).then(function(y) {
2397
- f(null, y);
2464
+ e.call(this, c).then(function(p) {
2465
+ f(null, p);
2398
2466
  }, f);
2399
2467
  }
2400
2468
  var i = gn(t, n, r), o = i.push, s = i.unshift;
2401
2469
  return i.push = a, i.unshift = u, i.drained = d, i;
2402
2470
  function a(c) {
2403
- var f = new Promise(function(y, m) {
2404
- o(c, function(b, w) {
2471
+ var f = new Promise(function(p, m) {
2472
+ o(c, function(b, T) {
2405
2473
  if (b) {
2406
2474
  m(b);
2407
2475
  return;
2408
2476
  }
2409
- y(w);
2477
+ p(T);
2410
2478
  });
2411
2479
  });
2412
- return f.catch(W), f;
2480
+ return f.catch(z), f;
2413
2481
  }
2414
2482
  function u(c) {
2415
- var f = new Promise(function(y, m) {
2416
- s(c, function(b, w) {
2483
+ var f = new Promise(function(p, m) {
2484
+ s(c, function(b, T) {
2417
2485
  if (b) {
2418
2486
  m(b);
2419
2487
  return;
2420
2488
  }
2421
- y(w);
2489
+ p(T);
2422
2490
  });
2423
2491
  });
2424
- return f.catch(W), f;
2492
+ return f.catch(z), f;
2425
2493
  }
2426
2494
  function d() {
2427
2495
  if (i.idle())
2428
- return new Promise(function(y) {
2429
- y();
2496
+ return new Promise(function(p) {
2497
+ p();
2430
2498
  });
2431
- var c = i.drain, f = new Promise(function(y) {
2499
+ var c = i.drain, f = new Promise(function(p) {
2432
2500
  i.drain = function() {
2433
- c(), y();
2501
+ c(), p();
2434
2502
  };
2435
2503
  });
2436
2504
  return f;
2437
2505
  }
2438
2506
  }
2439
- ur.exports = gn;
2440
- ur.exports.promise = Fo;
2441
- var mn = ur.exports, cr = { exports: {} }, Be = typeof Reflect == "object" ? Reflect : null, $r = Be && typeof Be.apply == "function" ? Be.apply : function(e, r, n) {
2507
+ cr.exports = gn;
2508
+ cr.exports.promise = Do;
2509
+ var mn = cr.exports, lr = { exports: {} }, Be = typeof Reflect == "object" ? Reflect : null, $r = Be && typeof Be.apply == "function" ? Be.apply : function(e, r, n) {
2442
2510
  return Function.prototype.apply.call(e, r, n);
2443
2511
  }, dt;
2444
2512
  Be && typeof Be.ownKeys == "function" ? dt = Be.ownKeys : Object.getOwnPropertySymbols ? dt = function(e) {
@@ -2446,7 +2514,7 @@ Be && typeof Be.ownKeys == "function" ? dt = Be.ownKeys : Object.getOwnPropertyS
2446
2514
  } : dt = function(e) {
2447
2515
  return Object.getOwnPropertyNames(e);
2448
2516
  };
2449
- function No(t) {
2517
+ function Ro(t) {
2450
2518
  console && console.warn && console.warn(t);
2451
2519
  }
2452
2520
  var bn = Number.isNaN || function(e) {
@@ -2455,8 +2523,8 @@ var bn = Number.isNaN || function(e) {
2455
2523
  function k() {
2456
2524
  k.init.call(this);
2457
2525
  }
2458
- cr.exports = k;
2459
- cr.exports.once = $o;
2526
+ lr.exports = k;
2527
+ lr.exports.once = Mo;
2460
2528
  k.EventEmitter = k;
2461
2529
  k.prototype._events = void 0;
2462
2530
  k.prototype._eventsCount = 0;
@@ -2512,7 +2580,7 @@ k.prototype.emit = function(e) {
2512
2580
  if (typeof u == "function")
2513
2581
  $r(u, this, r);
2514
2582
  else
2515
- for (var d = u.length, c = In(u, d), n = 0; n < d; ++n)
2583
+ for (var d = u.length, c = En(u, d), n = 0; n < d; ++n)
2516
2584
  $r(c[n], this, r);
2517
2585
  return !0;
2518
2586
  };
@@ -2527,7 +2595,7 @@ function Sn(t, e, r, n) {
2527
2595
  else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), i = vn(t), i > 0 && s.length > i && !s.warned) {
2528
2596
  s.warned = !0;
2529
2597
  var a = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
2530
- a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length, No(a);
2598
+ a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length, Ro(a);
2531
2599
  }
2532
2600
  return t;
2533
2601
  }
@@ -2538,12 +2606,12 @@ k.prototype.on = k.prototype.addListener;
2538
2606
  k.prototype.prependListener = function(e, r) {
2539
2607
  return Sn(this, e, r, !0);
2540
2608
  };
2541
- function Do() {
2609
+ function Vo() {
2542
2610
  if (!this.fired)
2543
2611
  return this.target.removeListener(this.type, this.wrapFn), this.fired = !0, arguments.length === 0 ? this.listener.call(this.target) : this.listener.apply(this.target, arguments);
2544
2612
  }
2545
2613
  function wn(t, e, r) {
2546
- var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i = Do.bind(n);
2614
+ var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i = Vo.bind(n);
2547
2615
  return i.listener = r, n.wrapFn = i, i;
2548
2616
  }
2549
2617
  k.prototype.once = function(e, r) {
@@ -2568,7 +2636,7 @@ k.prototype.removeListener = function(e, r) {
2568
2636
  }
2569
2637
  if (o < 0)
2570
2638
  return this;
2571
- o === 0 ? n.shift() : Ro(n, o), n.length === 1 && (i[e] = n[0]), i.removeListener !== void 0 && this.emit("removeListener", e, a || r);
2639
+ o === 0 ? n.shift() : $o(n, o), n.length === 1 && (i[e] = n[0]), i.removeListener !== void 0 && this.emit("removeListener", e, a || r);
2572
2640
  }
2573
2641
  return this;
2574
2642
  };
@@ -2597,7 +2665,7 @@ function An(t, e, r) {
2597
2665
  if (n === void 0)
2598
2666
  return [];
2599
2667
  var i = n[e];
2600
- return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? Vo(i) : In(i, i.length);
2668
+ return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? jo(i) : En(i, i.length);
2601
2669
  }
2602
2670
  k.prototype.listeners = function(e) {
2603
2671
  return An(this, e, !0);
@@ -2606,10 +2674,10 @@ k.prototype.rawListeners = function(e) {
2606
2674
  return An(this, e, !1);
2607
2675
  };
2608
2676
  k.listenerCount = function(t, e) {
2609
- return typeof t.listenerCount == "function" ? t.listenerCount(e) : En.call(t, e);
2677
+ return typeof t.listenerCount == "function" ? t.listenerCount(e) : In.call(t, e);
2610
2678
  };
2611
- k.prototype.listenerCount = En;
2612
- function En(t) {
2679
+ k.prototype.listenerCount = In;
2680
+ function In(t) {
2613
2681
  var e = this._events;
2614
2682
  if (e !== void 0) {
2615
2683
  var r = e[t];
@@ -2623,22 +2691,22 @@ function En(t) {
2623
2691
  k.prototype.eventNames = function() {
2624
2692
  return this._eventsCount > 0 ? dt(this._events) : [];
2625
2693
  };
2626
- function In(t, e) {
2694
+ function En(t, e) {
2627
2695
  for (var r = new Array(e), n = 0; n < e; ++n)
2628
2696
  r[n] = t[n];
2629
2697
  return r;
2630
2698
  }
2631
- function Ro(t, e) {
2699
+ function $o(t, e) {
2632
2700
  for (; e + 1 < t.length; e++)
2633
2701
  t[e] = t[e + 1];
2634
2702
  t.pop();
2635
2703
  }
2636
- function Vo(t) {
2704
+ function jo(t) {
2637
2705
  for (var e = new Array(t.length), r = 0; r < e.length; ++r)
2638
2706
  e[r] = t[r].listener || t[r];
2639
2707
  return e;
2640
2708
  }
2641
- function $o(t, e) {
2709
+ function Mo(t, e) {
2642
2710
  return new Promise(function(r, n) {
2643
2711
  function i(s) {
2644
2712
  t.removeListener(e, o), n(s);
@@ -2646,10 +2714,10 @@ function $o(t, e) {
2646
2714
  function o() {
2647
2715
  typeof t.removeListener == "function" && t.removeListener("error", i), r([].slice.call(arguments));
2648
2716
  }
2649
- Tn(t, e, o, { once: !0 }), e !== "error" && jo(t, i, { once: !0 });
2717
+ Tn(t, e, o, { once: !0 }), e !== "error" && Uo(t, i, { once: !0 });
2650
2718
  });
2651
2719
  }
2652
- function jo(t, e, r) {
2720
+ function Uo(t, e, r) {
2653
2721
  typeof t.on == "function" && Tn(t, "error", e, r);
2654
2722
  }
2655
2723
  function Tn(t, e, r, n) {
@@ -2662,7 +2730,7 @@ function Tn(t, e, r, n) {
2662
2730
  else
2663
2731
  throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
2664
2732
  }
2665
- var On = cr.exports, Ct = {}, Cn = {}, _n = function() {
2733
+ var On = lr.exports, Ct = {}, Cn = {}, Ln = function() {
2666
2734
  if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
2667
2735
  return !1;
2668
2736
  if (typeof Symbol.iterator == "symbol")
@@ -2685,33 +2753,33 @@ var On = cr.exports, Ct = {}, Cn = {}, _n = function() {
2685
2753
  return !1;
2686
2754
  }
2687
2755
  return !0;
2688
- }, Mo = _n, lr = function() {
2689
- return Mo() && !!Symbol.toStringTag;
2690
- }, Mr = typeof Symbol < "u" && Symbol, Uo = _n, xo = function() {
2691
- return typeof Mr != "function" || typeof Symbol != "function" || typeof Mr("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Uo();
2756
+ }, xo = Ln, dr = function() {
2757
+ return xo() && !!Symbol.toStringTag;
2758
+ }, Mr = typeof Symbol < "u" && Symbol, Bo = Ln, qo = function() {
2759
+ return typeof Mr != "function" || typeof Symbol != "function" || typeof Mr("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Bo();
2692
2760
  }, Ur = {
2693
2761
  foo: {}
2694
- }, Bo = Object, qo = function() {
2695
- return { __proto__: Ur }.foo === Ur.foo && !({ __proto__: null } instanceof Bo);
2696
- }, Qo = "Function.prototype.bind called on incompatible ", Go = Object.prototype.toString, Ko = Math.max, zo = "[object Function]", xr = function(e, r) {
2762
+ }, Qo = Object, Go = function() {
2763
+ return { __proto__: Ur }.foo === Ur.foo && !({ __proto__: null } instanceof Qo);
2764
+ }, Ko = "Function.prototype.bind called on incompatible ", zo = Object.prototype.toString, Ho = Math.max, Wo = "[object Function]", xr = function(e, r) {
2697
2765
  for (var n = [], i = 0; i < e.length; i += 1)
2698
2766
  n[i] = e[i];
2699
2767
  for (var o = 0; o < r.length; o += 1)
2700
2768
  n[o + e.length] = r[o];
2701
2769
  return n;
2702
- }, Ho = function(e, r) {
2770
+ }, Jo = function(e, r) {
2703
2771
  for (var n = [], i = r || 0, o = 0; i < e.length; i += 1, o += 1)
2704
2772
  n[o] = e[i];
2705
2773
  return n;
2706
- }, Wo = function(t, e) {
2774
+ }, Yo = function(t, e) {
2707
2775
  for (var r = "", n = 0; n < t.length; n += 1)
2708
2776
  r += t[n], n + 1 < t.length && (r += e);
2709
2777
  return r;
2710
- }, Jo = function(e) {
2778
+ }, Xo = function(e) {
2711
2779
  var r = this;
2712
- if (typeof r != "function" || Go.apply(r) !== zo)
2713
- throw new TypeError(Qo + r);
2714
- for (var n = Ho(arguments, 1), i, o = function() {
2780
+ if (typeof r != "function" || zo.apply(r) !== Wo)
2781
+ throw new TypeError(Ko + r);
2782
+ for (var n = Jo(arguments, 1), i, o = function() {
2715
2783
  if (this instanceof i) {
2716
2784
  var c = r.apply(
2717
2785
  this,
@@ -2723,56 +2791,56 @@ var On = cr.exports, Ct = {}, Cn = {}, _n = function() {
2723
2791
  e,
2724
2792
  xr(n, arguments)
2725
2793
  );
2726
- }, s = Ko(0, r.length - n.length), a = [], u = 0; u < s; u++)
2794
+ }, s = Ho(0, r.length - n.length), a = [], u = 0; u < s; u++)
2727
2795
  a[u] = "$" + u;
2728
- if (i = Function("binder", "return function (" + Wo(a, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
2796
+ if (i = Function("binder", "return function (" + Yo(a, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
2729
2797
  var d = function() {
2730
2798
  };
2731
2799
  d.prototype = r.prototype, i.prototype = new d(), d.prototype = null;
2732
2800
  }
2733
2801
  return i;
2734
- }, Yo = Jo, dr = Function.prototype.bind || Yo, Xo = Function.prototype.call, Zo = Object.prototype.hasOwnProperty, es = dr, ts = es.call(Xo, Zo), I, Qe = SyntaxError, Ln = Function, qe = TypeError, Pt = function(t) {
2802
+ }, Zo = Xo, fr = Function.prototype.bind || Zo, es = Function.prototype.call, ts = Object.prototype.hasOwnProperty, rs = fr, ns = rs.call(es, ts), A, Qe = SyntaxError, _n = Function, qe = TypeError, Pt = function(t) {
2735
2803
  try {
2736
- return Ln('"use strict"; return (' + t + ").constructor;")();
2804
+ return _n('"use strict"; return (' + t + ").constructor;")();
2737
2805
  } catch {
2738
2806
  }
2739
- }, Oe = Object.getOwnPropertyDescriptor;
2740
- if (Oe)
2807
+ }, Ce = Object.getOwnPropertyDescriptor;
2808
+ if (Ce)
2741
2809
  try {
2742
- Oe({}, "");
2810
+ Ce({}, "");
2743
2811
  } catch {
2744
- Oe = null;
2812
+ Ce = null;
2745
2813
  }
2746
2814
  var Ft = function() {
2747
2815
  throw new qe();
2748
- }, rs = Oe ? function() {
2816
+ }, is = Ce ? function() {
2749
2817
  try {
2750
2818
  return arguments.callee, Ft;
2751
2819
  } catch {
2752
2820
  try {
2753
- return Oe(arguments, "callee").get;
2821
+ return Ce(arguments, "callee").get;
2754
2822
  } catch {
2755
2823
  return Ft;
2756
2824
  }
2757
2825
  }
2758
- }() : Ft, De = xo(), ns = qo(), M = Object.getPrototypeOf || (ns ? function(t) {
2826
+ }() : Ft, Re = qo(), os = Go(), j = Object.getPrototypeOf || (os ? function(t) {
2759
2827
  return t.__proto__;
2760
- } : null), Ve = {}, is = typeof Uint8Array > "u" || !M ? I : M(Uint8Array), Ce = {
2761
- "%AggregateError%": typeof AggregateError > "u" ? I : AggregateError,
2828
+ } : null), $e = {}, ss = typeof Uint8Array > "u" || !j ? A : j(Uint8Array), Le = {
2829
+ "%AggregateError%": typeof AggregateError > "u" ? A : AggregateError,
2762
2830
  "%Array%": Array,
2763
- "%ArrayBuffer%": typeof ArrayBuffer > "u" ? I : ArrayBuffer,
2764
- "%ArrayIteratorPrototype%": De && M ? M([][Symbol.iterator]()) : I,
2765
- "%AsyncFromSyncIteratorPrototype%": I,
2766
- "%AsyncFunction%": Ve,
2767
- "%AsyncGenerator%": Ve,
2768
- "%AsyncGeneratorFunction%": Ve,
2769
- "%AsyncIteratorPrototype%": Ve,
2770
- "%Atomics%": typeof Atomics > "u" ? I : Atomics,
2771
- "%BigInt%": typeof BigInt > "u" ? I : BigInt,
2772
- "%BigInt64Array%": typeof BigInt64Array > "u" ? I : BigInt64Array,
2773
- "%BigUint64Array%": typeof BigUint64Array > "u" ? I : BigUint64Array,
2831
+ "%ArrayBuffer%": typeof ArrayBuffer > "u" ? A : ArrayBuffer,
2832
+ "%ArrayIteratorPrototype%": Re && j ? j([][Symbol.iterator]()) : A,
2833
+ "%AsyncFromSyncIteratorPrototype%": A,
2834
+ "%AsyncFunction%": $e,
2835
+ "%AsyncGenerator%": $e,
2836
+ "%AsyncGeneratorFunction%": $e,
2837
+ "%AsyncIteratorPrototype%": $e,
2838
+ "%Atomics%": typeof Atomics > "u" ? A : Atomics,
2839
+ "%BigInt%": typeof BigInt > "u" ? A : BigInt,
2840
+ "%BigInt64Array%": typeof BigInt64Array > "u" ? A : BigInt64Array,
2841
+ "%BigUint64Array%": typeof BigUint64Array > "u" ? A : BigUint64Array,
2774
2842
  "%Boolean%": Boolean,
2775
- "%DataView%": typeof DataView > "u" ? I : DataView,
2843
+ "%DataView%": typeof DataView > "u" ? A : DataView,
2776
2844
  "%Date%": Date,
2777
2845
  "%decodeURI%": decodeURI,
2778
2846
  "%decodeURIComponent%": decodeURIComponent,
@@ -2782,58 +2850,58 @@ var Ft = function() {
2782
2850
  "%eval%": eval,
2783
2851
  // eslint-disable-line no-eval
2784
2852
  "%EvalError%": EvalError,
2785
- "%Float32Array%": typeof Float32Array > "u" ? I : Float32Array,
2786
- "%Float64Array%": typeof Float64Array > "u" ? I : Float64Array,
2787
- "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? I : FinalizationRegistry,
2788
- "%Function%": Ln,
2789
- "%GeneratorFunction%": Ve,
2790
- "%Int8Array%": typeof Int8Array > "u" ? I : Int8Array,
2791
- "%Int16Array%": typeof Int16Array > "u" ? I : Int16Array,
2792
- "%Int32Array%": typeof Int32Array > "u" ? I : Int32Array,
2853
+ "%Float32Array%": typeof Float32Array > "u" ? A : Float32Array,
2854
+ "%Float64Array%": typeof Float64Array > "u" ? A : Float64Array,
2855
+ "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? A : FinalizationRegistry,
2856
+ "%Function%": _n,
2857
+ "%GeneratorFunction%": $e,
2858
+ "%Int8Array%": typeof Int8Array > "u" ? A : Int8Array,
2859
+ "%Int16Array%": typeof Int16Array > "u" ? A : Int16Array,
2860
+ "%Int32Array%": typeof Int32Array > "u" ? A : Int32Array,
2793
2861
  "%isFinite%": isFinite,
2794
2862
  "%isNaN%": isNaN,
2795
- "%IteratorPrototype%": De && M ? M(M([][Symbol.iterator]())) : I,
2796
- "%JSON%": typeof JSON == "object" ? JSON : I,
2797
- "%Map%": typeof Map > "u" ? I : Map,
2798
- "%MapIteratorPrototype%": typeof Map > "u" || !De || !M ? I : M((/* @__PURE__ */ new Map())[Symbol.iterator]()),
2863
+ "%IteratorPrototype%": Re && j ? j(j([][Symbol.iterator]())) : A,
2864
+ "%JSON%": typeof JSON == "object" ? JSON : A,
2865
+ "%Map%": typeof Map > "u" ? A : Map,
2866
+ "%MapIteratorPrototype%": typeof Map > "u" || !Re || !j ? A : j((/* @__PURE__ */ new Map())[Symbol.iterator]()),
2799
2867
  "%Math%": Math,
2800
2868
  "%Number%": Number,
2801
2869
  "%Object%": Object,
2802
2870
  "%parseFloat%": parseFloat,
2803
2871
  "%parseInt%": parseInt,
2804
- "%Promise%": typeof Promise > "u" ? I : Promise,
2805
- "%Proxy%": typeof Proxy > "u" ? I : Proxy,
2872
+ "%Promise%": typeof Promise > "u" ? A : Promise,
2873
+ "%Proxy%": typeof Proxy > "u" ? A : Proxy,
2806
2874
  "%RangeError%": RangeError,
2807
2875
  "%ReferenceError%": ReferenceError,
2808
- "%Reflect%": typeof Reflect > "u" ? I : Reflect,
2876
+ "%Reflect%": typeof Reflect > "u" ? A : Reflect,
2809
2877
  "%RegExp%": RegExp,
2810
- "%Set%": typeof Set > "u" ? I : Set,
2811
- "%SetIteratorPrototype%": typeof Set > "u" || !De || !M ? I : M((/* @__PURE__ */ new Set())[Symbol.iterator]()),
2812
- "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? I : SharedArrayBuffer,
2878
+ "%Set%": typeof Set > "u" ? A : Set,
2879
+ "%SetIteratorPrototype%": typeof Set > "u" || !Re || !j ? A : j((/* @__PURE__ */ new Set())[Symbol.iterator]()),
2880
+ "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? A : SharedArrayBuffer,
2813
2881
  "%String%": String,
2814
- "%StringIteratorPrototype%": De && M ? M(""[Symbol.iterator]()) : I,
2815
- "%Symbol%": De ? Symbol : I,
2882
+ "%StringIteratorPrototype%": Re && j ? j(""[Symbol.iterator]()) : A,
2883
+ "%Symbol%": Re ? Symbol : A,
2816
2884
  "%SyntaxError%": Qe,
2817
- "%ThrowTypeError%": rs,
2818
- "%TypedArray%": is,
2885
+ "%ThrowTypeError%": is,
2886
+ "%TypedArray%": ss,
2819
2887
  "%TypeError%": qe,
2820
- "%Uint8Array%": typeof Uint8Array > "u" ? I : Uint8Array,
2821
- "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? I : Uint8ClampedArray,
2822
- "%Uint16Array%": typeof Uint16Array > "u" ? I : Uint16Array,
2823
- "%Uint32Array%": typeof Uint32Array > "u" ? I : Uint32Array,
2888
+ "%Uint8Array%": typeof Uint8Array > "u" ? A : Uint8Array,
2889
+ "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? A : Uint8ClampedArray,
2890
+ "%Uint16Array%": typeof Uint16Array > "u" ? A : Uint16Array,
2891
+ "%Uint32Array%": typeof Uint32Array > "u" ? A : Uint32Array,
2824
2892
  "%URIError%": URIError,
2825
- "%WeakMap%": typeof WeakMap > "u" ? I : WeakMap,
2826
- "%WeakRef%": typeof WeakRef > "u" ? I : WeakRef,
2827
- "%WeakSet%": typeof WeakSet > "u" ? I : WeakSet
2893
+ "%WeakMap%": typeof WeakMap > "u" ? A : WeakMap,
2894
+ "%WeakRef%": typeof WeakRef > "u" ? A : WeakRef,
2895
+ "%WeakSet%": typeof WeakSet > "u" ? A : WeakSet
2828
2896
  };
2829
- if (M)
2897
+ if (j)
2830
2898
  try {
2831
2899
  null.error;
2832
2900
  } catch (t) {
2833
- var os = M(M(t));
2834
- Ce["%Error.prototype%"] = os;
2901
+ var as = j(j(t));
2902
+ Le["%Error.prototype%"] = as;
2835
2903
  }
2836
- var ss = function t(e) {
2904
+ var us = function t(e) {
2837
2905
  var r;
2838
2906
  if (e === "%AsyncFunction%")
2839
2907
  r = Pt("async function () {}");
@@ -2846,9 +2914,9 @@ var ss = function t(e) {
2846
2914
  n && (r = n.prototype);
2847
2915
  } else if (e === "%AsyncIteratorPrototype%") {
2848
2916
  var i = t("%AsyncGenerator%");
2849
- i && M && (r = M(i.prototype));
2917
+ i && j && (r = j(i.prototype));
2850
2918
  }
2851
- return Ce[e] = r, r;
2919
+ return Le[e] = r, r;
2852
2920
  }, Br = {
2853
2921
  "%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
2854
2922
  "%ArrayPrototype%": ["Array", "prototype"],
@@ -2901,21 +2969,21 @@ var ss = function t(e) {
2901
2969
  "%URIErrorPrototype%": ["URIError", "prototype"],
2902
2970
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
2903
2971
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
2904
- }, nt = dr, mt = ts, as = nt.call(Function.call, Array.prototype.concat), us = nt.call(Function.apply, Array.prototype.splice), qr = nt.call(Function.call, String.prototype.replace), bt = nt.call(Function.call, String.prototype.slice), cs = nt.call(Function.call, RegExp.prototype.exec), ls = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, ds = /\\(\\)?/g, fs = function(e) {
2972
+ }, nt = fr, mt = ns, cs = nt.call(Function.call, Array.prototype.concat), ls = nt.call(Function.apply, Array.prototype.splice), qr = nt.call(Function.call, String.prototype.replace), bt = nt.call(Function.call, String.prototype.slice), ds = nt.call(Function.call, RegExp.prototype.exec), fs = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, hs = /\\(\\)?/g, ps = function(e) {
2905
2973
  var r = bt(e, 0, 1), n = bt(e, -1);
2906
2974
  if (r === "%" && n !== "%")
2907
2975
  throw new Qe("invalid intrinsic syntax, expected closing `%`");
2908
2976
  if (n === "%" && r !== "%")
2909
2977
  throw new Qe("invalid intrinsic syntax, expected opening `%`");
2910
2978
  var i = [];
2911
- return qr(e, ls, function(o, s, a, u) {
2912
- i[i.length] = a ? qr(u, ds, "$1") : s || o;
2979
+ return qr(e, fs, function(o, s, a, u) {
2980
+ i[i.length] = a ? qr(u, hs, "$1") : s || o;
2913
2981
  }), i;
2914
- }, ps = function(e, r) {
2982
+ }, ys = function(e, r) {
2915
2983
  var n = e, i;
2916
- if (mt(Br, n) && (i = Br[n], n = "%" + i[0] + "%"), mt(Ce, n)) {
2917
- var o = Ce[n];
2918
- if (o === Ve && (o = ss(n)), typeof o > "u" && !r)
2984
+ if (mt(Br, n) && (i = Br[n], n = "%" + i[0] + "%"), mt(Le, n)) {
2985
+ var o = Le[n];
2986
+ if (o === $e && (o = us(n)), typeof o > "u" && !r)
2919
2987
  throw new qe("intrinsic " + e + " exists, but is not available. Please file an issue!");
2920
2988
  return {
2921
2989
  alias: i,
@@ -2929,32 +2997,32 @@ var ss = function t(e) {
2929
2997
  throw new qe("intrinsic name must be a non-empty string");
2930
2998
  if (arguments.length > 1 && typeof r != "boolean")
2931
2999
  throw new qe('"allowMissing" argument must be a boolean');
2932
- if (cs(/^%?[^%]*%?$/, e) === null)
3000
+ if (ds(/^%?[^%]*%?$/, e) === null)
2933
3001
  throw new Qe("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
2934
- var n = fs(e), i = n.length > 0 ? n[0] : "", o = ps("%" + i + "%", r), s = o.name, a = o.value, u = !1, d = o.alias;
2935
- d && (i = d[0], us(n, as([0, 1], d)));
3002
+ var n = ps(e), i = n.length > 0 ? n[0] : "", o = ys("%" + i + "%", r), s = o.name, a = o.value, u = !1, d = o.alias;
3003
+ d && (i = d[0], ls(n, cs([0, 1], d)));
2936
3004
  for (var c = 1, f = !0; c < n.length; c += 1) {
2937
- var y = n[c], m = bt(y, 0, 1), b = bt(y, -1);
3005
+ var p = n[c], m = bt(p, 0, 1), b = bt(p, -1);
2938
3006
  if ((m === '"' || m === "'" || m === "`" || b === '"' || b === "'" || b === "`") && m !== b)
2939
3007
  throw new Qe("property names with quotes must have matching quotes");
2940
- if ((y === "constructor" || !f) && (u = !0), i += "." + y, s = "%" + i + "%", mt(Ce, s))
2941
- a = Ce[s];
3008
+ if ((p === "constructor" || !f) && (u = !0), i += "." + p, s = "%" + i + "%", mt(Le, s))
3009
+ a = Le[s];
2942
3010
  else if (a != null) {
2943
- if (!(y in a)) {
3011
+ if (!(p in a)) {
2944
3012
  if (!r)
2945
3013
  throw new qe("base intrinsic for " + e + " exists, but the property is not available.");
2946
3014
  return;
2947
3015
  }
2948
- if (Oe && c + 1 >= n.length) {
2949
- var w = Oe(a, y);
2950
- f = !!w, f && "get" in w && !("originalValue" in w.get) ? a = w.get : a = a[y];
3016
+ if (Ce && c + 1 >= n.length) {
3017
+ var T = Ce(a, p);
3018
+ f = !!T, f && "get" in T && !("originalValue" in T.get) ? a = T.get : a = a[p];
2951
3019
  } else
2952
- f = mt(a, y), a = a[y];
2953
- f && !u && (Ce[s] = a);
3020
+ f = mt(a, p), a = a[p];
3021
+ f && !u && (Le[s] = a);
2954
3022
  }
2955
3023
  }
2956
3024
  return a;
2957
- }, kn = { exports: {} }, hs = Ke, Jt = hs("%Object.defineProperty%", !0), Yt = function() {
3025
+ }, kn = { exports: {} }, gs = Ke, Jt = gs("%Object.defineProperty%", !0), Yt = function() {
2958
3026
  if (Jt)
2959
3027
  try {
2960
3028
  return Jt({}, "a", { value: 1 }), !0;
@@ -2972,33 +3040,33 @@ Yt.hasArrayLengthDefineBug = function() {
2972
3040
  return !0;
2973
3041
  }
2974
3042
  };
2975
- var Pn = Yt, ys = Ke, ft = ys("%Object.getOwnPropertyDescriptor%", !0);
3043
+ var Pn = Yt, ms = Ke, ft = ms("%Object.getOwnPropertyDescriptor%", !0);
2976
3044
  if (ft)
2977
3045
  try {
2978
3046
  ft([], "length");
2979
3047
  } catch {
2980
3048
  ft = null;
2981
3049
  }
2982
- var fr = ft, gs = Pn(), pr = Ke, Xe = gs && pr("%Object.defineProperty%", !0);
3050
+ var hr = ft, bs = Pn(), pr = Ke, Xe = bs && pr("%Object.defineProperty%", !0);
2983
3051
  if (Xe)
2984
3052
  try {
2985
3053
  Xe({}, "a", { value: 1 });
2986
3054
  } catch {
2987
3055
  Xe = !1;
2988
3056
  }
2989
- var ms = pr("%SyntaxError%"), Re = pr("%TypeError%"), Qr = fr, bs = function(e, r, n) {
3057
+ var vs = pr("%SyntaxError%"), Ve = pr("%TypeError%"), Qr = hr, Ss = function(e, r, n) {
2990
3058
  if (!e || typeof e != "object" && typeof e != "function")
2991
- throw new Re("`obj` must be an object or a function`");
3059
+ throw new Ve("`obj` must be an object or a function`");
2992
3060
  if (typeof r != "string" && typeof r != "symbol")
2993
- throw new Re("`property` must be a string or a symbol`");
3061
+ throw new Ve("`property` must be a string or a symbol`");
2994
3062
  if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null)
2995
- throw new Re("`nonEnumerable`, if provided, must be a boolean or null");
3063
+ throw new Ve("`nonEnumerable`, if provided, must be a boolean or null");
2996
3064
  if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null)
2997
- throw new Re("`nonWritable`, if provided, must be a boolean or null");
3065
+ throw new Ve("`nonWritable`, if provided, must be a boolean or null");
2998
3066
  if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null)
2999
- throw new Re("`nonConfigurable`, if provided, must be a boolean or null");
3067
+ throw new Ve("`nonConfigurable`, if provided, must be a boolean or null");
3000
3068
  if (arguments.length > 6 && typeof arguments[6] != "boolean")
3001
- throw new Re("`loose`, if provided, must be a boolean");
3069
+ throw new Ve("`loose`, if provided, must be a boolean");
3002
3070
  var i = arguments.length > 3 ? arguments[3] : null, o = arguments.length > 4 ? arguments[4] : null, s = arguments.length > 5 ? arguments[5] : null, a = arguments.length > 6 ? arguments[6] : !1, u = !!Qr && Qr(e, r);
3003
3071
  if (Xe)
3004
3072
  Xe(e, r, {
@@ -3010,18 +3078,18 @@ var ms = pr("%SyntaxError%"), Re = pr("%TypeError%"), Qr = fr, bs = function(e,
3010
3078
  else if (a || !i && !o && !s)
3011
3079
  e[r] = n;
3012
3080
  else
3013
- throw new ms("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
3014
- }, Fn = Ke, Gr = bs, vs = Pn(), Kr = fr, zr = Fn("%TypeError%"), Ss = Fn("%Math.floor%"), ws = function(e, r) {
3081
+ throw new vs("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
3082
+ }, Fn = Ke, Gr = Ss, ws = Pn(), Kr = hr, zr = Fn("%TypeError%"), As = Fn("%Math.floor%"), Is = function(e, r) {
3015
3083
  if (typeof e != "function")
3016
3084
  throw new zr("`fn` is not a function");
3017
- if (typeof r != "number" || r < 0 || r > 4294967295 || Ss(r) !== r)
3085
+ if (typeof r != "number" || r < 0 || r > 4294967295 || As(r) !== r)
3018
3086
  throw new zr("`length` must be a positive 32-bit integer");
3019
3087
  var n = arguments.length > 2 && !!arguments[2], i = !0, o = !0;
3020
3088
  if ("length" in e && Kr) {
3021
3089
  var s = Kr(e, "length");
3022
3090
  s && !s.configurable && (i = !1), s && !s.writable && (o = !1);
3023
3091
  }
3024
- return (i || o || !n) && (vs ? Gr(
3092
+ return (i || o || !n) && (ws ? Gr(
3025
3093
  /** @type {Parameters<define>[0]} */
3026
3094
  e,
3027
3095
  "length",
@@ -3036,20 +3104,20 @@ var ms = pr("%SyntaxError%"), Re = pr("%TypeError%"), Qr = fr, bs = function(e,
3036
3104
  )), e;
3037
3105
  };
3038
3106
  (function(t) {
3039
- var e = dr, r = Ke, n = ws, i = r("%TypeError%"), o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = r("%Object.defineProperty%", !0), d = r("%Math.max%");
3107
+ var e = fr, r = Ke, n = Is, i = r("%TypeError%"), o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = r("%Object.defineProperty%", !0), d = r("%Math.max%");
3040
3108
  if (u)
3041
3109
  try {
3042
3110
  u({}, "a", { value: 1 });
3043
3111
  } catch {
3044
3112
  u = null;
3045
3113
  }
3046
- t.exports = function(y) {
3047
- if (typeof y != "function")
3114
+ t.exports = function(p) {
3115
+ if (typeof p != "function")
3048
3116
  throw new i("a function is required");
3049
3117
  var m = a(e, s, arguments);
3050
3118
  return n(
3051
3119
  m,
3052
- 1 + d(0, y.length - (arguments.length - 1)),
3120
+ 1 + d(0, p.length - (arguments.length - 1)),
3053
3121
  !0
3054
3122
  );
3055
3123
  };
@@ -3058,59 +3126,59 @@ var ms = pr("%SyntaxError%"), Re = pr("%TypeError%"), Qr = fr, bs = function(e,
3058
3126
  };
3059
3127
  u ? u(t.exports, "apply", { value: c }) : t.exports.apply = c;
3060
3128
  })(kn);
3061
- var Nn = kn.exports, Dn = Ke, Rn = Nn, As = Rn(Dn("String.prototype.indexOf")), Vn = function(e, r) {
3129
+ var Nn = kn.exports, Dn = Ke, Rn = Nn, Es = Rn(Dn("String.prototype.indexOf")), Vn = function(e, r) {
3062
3130
  var n = Dn(e, !!r);
3063
- return typeof n == "function" && As(e, ".prototype.") > -1 ? Rn(n) : n;
3064
- }, Es = lr(), Is = Vn, Xt = Is("Object.prototype.toString"), _t = function(e) {
3065
- return Es && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : Xt(e) === "[object Arguments]";
3131
+ return typeof n == "function" && Es(e, ".prototype.") > -1 ? Rn(n) : n;
3132
+ }, Ts = dr(), Os = Vn, Xt = Os("Object.prototype.toString"), Lt = function(e) {
3133
+ return Ts && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : Xt(e) === "[object Arguments]";
3066
3134
  }, $n = function(e) {
3067
- return _t(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && Xt(e) !== "[object Array]" && Xt(e.callee) === "[object Function]";
3068
- }, Ts = function() {
3069
- return _t(arguments);
3135
+ return Lt(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && Xt(e) !== "[object Array]" && Xt(e.callee) === "[object Function]";
3136
+ }, Cs = function() {
3137
+ return Lt(arguments);
3070
3138
  }();
3071
- _t.isLegacyArguments = $n;
3072
- var Os = Ts ? _t : $n, Cs = Object.prototype.toString, _s = Function.prototype.toString, Ls = /^\s*(?:function)?\*/, jn = lr(), Nt = Object.getPrototypeOf, ks = function() {
3139
+ Lt.isLegacyArguments = $n;
3140
+ var Ls = Cs ? Lt : $n, _s = Object.prototype.toString, ks = Function.prototype.toString, Ps = /^\s*(?:function)?\*/, jn = dr(), Nt = Object.getPrototypeOf, Fs = function() {
3073
3141
  if (!jn)
3074
3142
  return !1;
3075
3143
  try {
3076
3144
  return Function("return function*() {}")();
3077
3145
  } catch {
3078
3146
  }
3079
- }, Dt, Ps = function(e) {
3147
+ }, Dt, Ns = function(e) {
3080
3148
  if (typeof e != "function")
3081
3149
  return !1;
3082
- if (Ls.test(_s.call(e)))
3150
+ if (Ps.test(ks.call(e)))
3083
3151
  return !0;
3084
3152
  if (!jn) {
3085
- var r = Cs.call(e);
3153
+ var r = _s.call(e);
3086
3154
  return r === "[object GeneratorFunction]";
3087
3155
  }
3088
3156
  if (!Nt)
3089
3157
  return !1;
3090
3158
  if (typeof Dt > "u") {
3091
- var n = ks();
3159
+ var n = Fs();
3092
3160
  Dt = n ? Nt(n) : !1;
3093
3161
  }
3094
3162
  return Nt(e) === Dt;
3095
- }, Mn = Function.prototype.toString, Ue = typeof Reflect == "object" && Reflect !== null && Reflect.apply, Zt, pt;
3163
+ }, Mn = Function.prototype.toString, Ue = typeof Reflect == "object" && Reflect !== null && Reflect.apply, Zt, ht;
3096
3164
  if (typeof Ue == "function" && typeof Object.defineProperty == "function")
3097
3165
  try {
3098
3166
  Zt = Object.defineProperty({}, "length", {
3099
3167
  get: function() {
3100
- throw pt;
3168
+ throw ht;
3101
3169
  }
3102
- }), pt = {}, Ue(function() {
3170
+ }), ht = {}, Ue(function() {
3103
3171
  throw 42;
3104
3172
  }, null, Zt);
3105
3173
  } catch (t) {
3106
- t !== pt && (Ue = null);
3174
+ t !== ht && (Ue = null);
3107
3175
  }
3108
3176
  else
3109
3177
  Ue = null;
3110
- var Fs = /^\s*class\b/, er = function(e) {
3178
+ var Ds = /^\s*class\b/, er = function(e) {
3111
3179
  try {
3112
3180
  var r = Mn.call(e);
3113
- return Fs.test(r);
3181
+ return Ds.test(r);
3114
3182
  } catch {
3115
3183
  return !1;
3116
3184
  }
@@ -3120,22 +3188,22 @@ var Fs = /^\s*class\b/, er = function(e) {
3120
3188
  } catch {
3121
3189
  return !1;
3122
3190
  }
3123
- }, ht = Object.prototype.toString, Ns = "[object Object]", Ds = "[object Function]", Rs = "[object GeneratorFunction]", Vs = "[object HTMLAllCollection]", $s = "[object HTML document.all class]", js = "[object HTMLCollection]", Ms = typeof Symbol == "function" && !!Symbol.toStringTag, Us = !(0 in [,]), tr = function() {
3191
+ }, pt = Object.prototype.toString, Rs = "[object Object]", Vs = "[object Function]", $s = "[object GeneratorFunction]", js = "[object HTMLAllCollection]", Ms = "[object HTML document.all class]", Us = "[object HTMLCollection]", xs = typeof Symbol == "function" && !!Symbol.toStringTag, Bs = !(0 in [,]), tr = function() {
3124
3192
  return !1;
3125
3193
  };
3126
3194
  if (typeof document == "object") {
3127
- var xs = document.all;
3128
- ht.call(xs) === ht.call(document.all) && (tr = function(e) {
3129
- if ((Us || !e) && (typeof e > "u" || typeof e == "object"))
3195
+ var qs = document.all;
3196
+ pt.call(qs) === pt.call(document.all) && (tr = function(e) {
3197
+ if ((Bs || !e) && (typeof e > "u" || typeof e == "object"))
3130
3198
  try {
3131
- var r = ht.call(e);
3132
- return (r === Vs || r === $s || r === js || r === Ns) && e("") == null;
3199
+ var r = pt.call(e);
3200
+ return (r === js || r === Ms || r === Us || r === Rs) && e("") == null;
3133
3201
  } catch {
3134
3202
  }
3135
3203
  return !1;
3136
3204
  });
3137
3205
  }
3138
- var Bs = Ue ? function(e) {
3206
+ var Qs = Ue ? function(e) {
3139
3207
  if (tr(e))
3140
3208
  return !0;
3141
3209
  if (!e || typeof e != "function" && typeof e != "object")
@@ -3143,7 +3211,7 @@ var Bs = Ue ? function(e) {
3143
3211
  try {
3144
3212
  Ue(e, null, Zt);
3145
3213
  } catch (r) {
3146
- if (r !== pt)
3214
+ if (r !== ht)
3147
3215
  return !1;
3148
3216
  }
3149
3217
  return !er(e) && Rt(e);
@@ -3152,27 +3220,27 @@ var Bs = Ue ? function(e) {
3152
3220
  return !0;
3153
3221
  if (!e || typeof e != "function" && typeof e != "object")
3154
3222
  return !1;
3155
- if (Ms)
3223
+ if (xs)
3156
3224
  return Rt(e);
3157
3225
  if (er(e))
3158
3226
  return !1;
3159
- var r = ht.call(e);
3160
- return r !== Ds && r !== Rs && !/^\[object HTML/.test(r) ? !1 : Rt(e);
3161
- }, qs = Bs, Qs = Object.prototype.toString, Un = Object.prototype.hasOwnProperty, Gs = function(e, r, n) {
3227
+ var r = pt.call(e);
3228
+ return r !== Vs && r !== $s && !/^\[object HTML/.test(r) ? !1 : Rt(e);
3229
+ }, Gs = Qs, Ks = Object.prototype.toString, Un = Object.prototype.hasOwnProperty, zs = function(e, r, n) {
3162
3230
  for (var i = 0, o = e.length; i < o; i++)
3163
3231
  Un.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3164
- }, Ks = function(e, r, n) {
3232
+ }, Hs = function(e, r, n) {
3165
3233
  for (var i = 0, o = e.length; i < o; i++)
3166
3234
  n == null ? r(e.charAt(i), i, e) : r.call(n, e.charAt(i), i, e);
3167
- }, zs = function(e, r, n) {
3235
+ }, Ws = function(e, r, n) {
3168
3236
  for (var i in e)
3169
3237
  Un.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3170
- }, Hs = function(e, r, n) {
3171
- if (!qs(r))
3238
+ }, Js = function(e, r, n) {
3239
+ if (!Gs(r))
3172
3240
  throw new TypeError("iterator must be a function");
3173
3241
  var i;
3174
- arguments.length >= 3 && (i = n), Qs.call(e) === "[object Array]" ? Gs(e, r, i) : typeof e == "string" ? Ks(e, r, i) : zs(e, r, i);
3175
- }, Ws = Hs, Vt = [
3242
+ arguments.length >= 3 && (i = n), Ks.call(e) === "[object Array]" ? zs(e, r, i) : typeof e == "string" ? Hs(e, r, i) : Ws(e, r, i);
3243
+ }, Ys = Js, Vt = [
3176
3244
  "BigInt64Array",
3177
3245
  "BigUint64Array",
3178
3246
  "Float32Array",
@@ -3184,11 +3252,11 @@ var Bs = Ue ? function(e) {
3184
3252
  "Uint32Array",
3185
3253
  "Uint8Array",
3186
3254
  "Uint8ClampedArray"
3187
- ], Js = typeof globalThis > "u" ? yn : globalThis, Ys = function() {
3255
+ ], Xs = typeof globalThis > "u" ? yn : globalThis, Zs = function() {
3188
3256
  for (var e = [], r = 0; r < Vt.length; r++)
3189
- typeof Js[Vt[r]] == "function" && (e[e.length] = Vt[r]);
3257
+ typeof Xs[Vt[r]] == "function" && (e[e.length] = Vt[r]);
3190
3258
  return e;
3191
- }, vt = Ws, Xs = Ys, Hr = Nn, hr = Vn, yt = fr, Zs = hr("Object.prototype.toString"), xn = lr(), Wr = typeof globalThis > "u" ? yn : globalThis, rr = Xs(), yr = hr("String.prototype.slice"), $t = Object.getPrototypeOf, ea = hr("Array.prototype.indexOf", !0) || function(e, r) {
3259
+ }, vt = Ys, ea = Zs, Hr = Nn, yr = Vn, yt = hr, ta = yr("Object.prototype.toString"), xn = dr(), Wr = typeof globalThis > "u" ? yn : globalThis, rr = ea(), gr = yr("String.prototype.slice"), $t = Object.getPrototypeOf, ra = yr("Array.prototype.indexOf", !0) || function(e, r) {
3192
3260
  for (var n = 0; n < e.length; n += 1)
3193
3261
  if (e[n] === r)
3194
3262
  return n;
@@ -3208,21 +3276,21 @@ xn && yt && $t ? vt(rr, function(t) {
3208
3276
  var e = new Wr[t](), r = e.slice || e.set;
3209
3277
  r && (St["$" + t] = Hr(r));
3210
3278
  });
3211
- var ta = function(e) {
3279
+ var na = function(e) {
3212
3280
  var r = !1;
3213
3281
  return vt(St, function(n, i) {
3214
3282
  if (!r)
3215
3283
  try {
3216
- "$" + n(e) === i && (r = yr(i, 1));
3284
+ "$" + n(e) === i && (r = gr(i, 1));
3217
3285
  } catch {
3218
3286
  }
3219
3287
  }), r;
3220
- }, ra = function(e) {
3288
+ }, ia = function(e) {
3221
3289
  var r = !1;
3222
3290
  return vt(St, function(n, i) {
3223
3291
  if (!r)
3224
3292
  try {
3225
- n(e), r = yr(i, 1);
3293
+ n(e), r = gr(i, 1);
3226
3294
  } catch {
3227
3295
  }
3228
3296
  }), r;
@@ -3230,198 +3298,198 @@ var ta = function(e) {
3230
3298
  if (!e || typeof e != "object")
3231
3299
  return !1;
3232
3300
  if (!xn) {
3233
- var r = yr(Zs(e), 8, -1);
3234
- return ea(rr, r) > -1 ? r : r !== "Object" ? !1 : ra(e);
3301
+ var r = gr(ta(e), 8, -1);
3302
+ return ra(rr, r) > -1 ? r : r !== "Object" ? !1 : ia(e);
3235
3303
  }
3236
- return yt ? ta(e) : null;
3237
- }, na = Bn, ia = function(e) {
3238
- return !!na(e);
3304
+ return yt ? na(e) : null;
3305
+ }, oa = Bn, sa = function(e) {
3306
+ return !!oa(e);
3239
3307
  };
3240
3308
  (function(t) {
3241
- var e = Os, r = Ps, n = Bn, i = ia;
3242
- function o(h) {
3243
- return h.call.bind(h);
3309
+ var e = Ls, r = Ns, n = Bn, i = sa;
3310
+ function o(y) {
3311
+ return y.call.bind(y);
3244
3312
  }
3245
3313
  var s = typeof BigInt < "u", a = typeof Symbol < "u", u = o(Object.prototype.toString), d = o(Number.prototype.valueOf), c = o(String.prototype.valueOf), f = o(Boolean.prototype.valueOf);
3246
3314
  if (s)
3247
- var y = o(BigInt.prototype.valueOf);
3315
+ var p = o(BigInt.prototype.valueOf);
3248
3316
  if (a)
3249
3317
  var m = o(Symbol.prototype.valueOf);
3250
- function b(h, Wn) {
3251
- if (typeof h != "object")
3318
+ function b(y, Wn) {
3319
+ if (typeof y != "object")
3252
3320
  return !1;
3253
3321
  try {
3254
- return Wn(h), !0;
3322
+ return Wn(y), !0;
3255
3323
  } catch {
3256
3324
  return !1;
3257
3325
  }
3258
3326
  }
3259
3327
  t.isArgumentsObject = e, t.isGeneratorFunction = r, t.isTypedArray = i;
3260
- function w(h) {
3261
- return typeof Promise < "u" && h instanceof Promise || h !== null && typeof h == "object" && typeof h.then == "function" && typeof h.catch == "function";
3328
+ function T(y) {
3329
+ return typeof Promise < "u" && y instanceof Promise || y !== null && typeof y == "object" && typeof y.then == "function" && typeof y.catch == "function";
3262
3330
  }
3263
- t.isPromise = w;
3264
- function A(h) {
3265
- return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(h) : i(h) || p(h);
3331
+ t.isPromise = T;
3332
+ function E(y) {
3333
+ return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(y) : i(y) || h(y);
3266
3334
  }
3267
- t.isArrayBufferView = A;
3268
- function P(h) {
3269
- return n(h) === "Uint8Array";
3335
+ t.isArrayBufferView = E;
3336
+ function F(y) {
3337
+ return n(y) === "Uint8Array";
3270
3338
  }
3271
- t.isUint8Array = P;
3272
- function V(h) {
3273
- return n(h) === "Uint8ClampedArray";
3339
+ t.isUint8Array = F;
3340
+ function V(y) {
3341
+ return n(y) === "Uint8ClampedArray";
3274
3342
  }
3275
3343
  t.isUint8ClampedArray = V;
3276
- function j(h) {
3277
- return n(h) === "Uint16Array";
3344
+ function q(y) {
3345
+ return n(y) === "Uint16Array";
3278
3346
  }
3279
- t.isUint16Array = j;
3280
- function K(h) {
3281
- return n(h) === "Uint32Array";
3347
+ t.isUint16Array = q;
3348
+ function J(y) {
3349
+ return n(y) === "Uint32Array";
3282
3350
  }
3283
- t.isUint32Array = K;
3284
- function L(h) {
3285
- return n(h) === "Int8Array";
3351
+ t.isUint32Array = J;
3352
+ function _(y) {
3353
+ return n(y) === "Int8Array";
3286
3354
  }
3287
- t.isInt8Array = L;
3288
- function R(h) {
3289
- return n(h) === "Int16Array";
3355
+ t.isInt8Array = _;
3356
+ function R(y) {
3357
+ return n(y) === "Int16Array";
3290
3358
  }
3291
3359
  t.isInt16Array = R;
3292
- function T(h) {
3293
- return n(h) === "Int32Array";
3360
+ function I(y) {
3361
+ return n(y) === "Int32Array";
3294
3362
  }
3295
- t.isInt32Array = T;
3296
- function Z(h) {
3297
- return n(h) === "Float32Array";
3363
+ t.isInt32Array = I;
3364
+ function X(y) {
3365
+ return n(y) === "Float32Array";
3298
3366
  }
3299
- t.isFloat32Array = Z;
3300
- function ee(h) {
3301
- return n(h) === "Float64Array";
3367
+ t.isFloat32Array = X;
3368
+ function Z(y) {
3369
+ return n(y) === "Float64Array";
3302
3370
  }
3303
- t.isFloat64Array = ee;
3304
- function _e(h) {
3305
- return n(h) === "BigInt64Array";
3371
+ t.isFloat64Array = Z;
3372
+ function _e(y) {
3373
+ return n(y) === "BigInt64Array";
3306
3374
  }
3307
3375
  t.isBigInt64Array = _e;
3308
- function Se(h) {
3309
- return n(h) === "BigUint64Array";
3376
+ function we(y) {
3377
+ return n(y) === "BigUint64Array";
3310
3378
  }
3311
- t.isBigUint64Array = Se;
3312
- function oe(h) {
3313
- return u(h) === "[object Map]";
3379
+ t.isBigUint64Array = we;
3380
+ function oe(y) {
3381
+ return u(y) === "[object Map]";
3314
3382
  }
3315
3383
  oe.working = typeof Map < "u" && oe(/* @__PURE__ */ new Map());
3316
- function Lt(h) {
3317
- return typeof Map > "u" ? !1 : oe.working ? oe(h) : h instanceof Map;
3384
+ function _t(y) {
3385
+ return typeof Map > "u" ? !1 : oe.working ? oe(y) : y instanceof Map;
3318
3386
  }
3319
- t.isMap = Lt;
3320
- function ge(h) {
3321
- return u(h) === "[object Set]";
3387
+ t.isMap = _t;
3388
+ function me(y) {
3389
+ return u(y) === "[object Set]";
3322
3390
  }
3323
- ge.working = typeof Set < "u" && ge(/* @__PURE__ */ new Set());
3324
- function He(h) {
3325
- return typeof Set > "u" ? !1 : ge.working ? ge(h) : h instanceof Set;
3391
+ me.working = typeof Set < "u" && me(/* @__PURE__ */ new Set());
3392
+ function He(y) {
3393
+ return typeof Set > "u" ? !1 : me.working ? me(y) : y instanceof Set;
3326
3394
  }
3327
3395
  t.isSet = He;
3328
- function Le(h) {
3329
- return u(h) === "[object WeakMap]";
3396
+ function ke(y) {
3397
+ return u(y) === "[object WeakMap]";
3330
3398
  }
3331
- Le.working = typeof WeakMap < "u" && Le(/* @__PURE__ */ new WeakMap());
3332
- function kt(h) {
3333
- return typeof WeakMap > "u" ? !1 : Le.working ? Le(h) : h instanceof WeakMap;
3399
+ ke.working = typeof WeakMap < "u" && ke(/* @__PURE__ */ new WeakMap());
3400
+ function kt(y) {
3401
+ return typeof WeakMap > "u" ? !1 : ke.working ? ke(y) : y instanceof WeakMap;
3334
3402
  }
3335
3403
  t.isWeakMap = kt;
3336
- function ke(h) {
3337
- return u(h) === "[object WeakSet]";
3404
+ function Pe(y) {
3405
+ return u(y) === "[object WeakSet]";
3338
3406
  }
3339
- ke.working = typeof WeakSet < "u" && ke(/* @__PURE__ */ new WeakSet());
3340
- function se(h) {
3341
- return ke(h);
3407
+ Pe.working = typeof WeakSet < "u" && Pe(/* @__PURE__ */ new WeakSet());
3408
+ function se(y) {
3409
+ return Pe(y);
3342
3410
  }
3343
3411
  t.isWeakSet = se;
3344
- function Pe(h) {
3345
- return u(h) === "[object ArrayBuffer]";
3412
+ function Fe(y) {
3413
+ return u(y) === "[object ArrayBuffer]";
3346
3414
  }
3347
- Pe.working = typeof ArrayBuffer < "u" && Pe(new ArrayBuffer());
3348
- function it(h) {
3349
- return typeof ArrayBuffer > "u" ? !1 : Pe.working ? Pe(h) : h instanceof ArrayBuffer;
3415
+ Fe.working = typeof ArrayBuffer < "u" && Fe(new ArrayBuffer());
3416
+ function it(y) {
3417
+ return typeof ArrayBuffer > "u" ? !1 : Fe.working ? Fe(y) : y instanceof ArrayBuffer;
3350
3418
  }
3351
3419
  t.isArrayBuffer = it;
3352
- function l(h) {
3353
- return u(h) === "[object DataView]";
3420
+ function l(y) {
3421
+ return u(y) === "[object DataView]";
3354
3422
  }
3355
3423
  l.working = typeof ArrayBuffer < "u" && typeof DataView < "u" && l(new DataView(new ArrayBuffer(1), 0, 1));
3356
- function p(h) {
3357
- return typeof DataView > "u" ? !1 : l.working ? l(h) : h instanceof DataView;
3424
+ function h(y) {
3425
+ return typeof DataView > "u" ? !1 : l.working ? l(y) : y instanceof DataView;
3358
3426
  }
3359
- t.isDataView = p;
3427
+ t.isDataView = h;
3360
3428
  var g = typeof SharedArrayBuffer < "u" ? SharedArrayBuffer : void 0;
3361
- function v(h) {
3362
- return u(h) === "[object SharedArrayBuffer]";
3429
+ function v(y) {
3430
+ return u(y) === "[object SharedArrayBuffer]";
3363
3431
  }
3364
- function C(h) {
3365
- return typeof g > "u" ? !1 : (typeof v.working > "u" && (v.working = v(new g())), v.working ? v(h) : h instanceof g);
3432
+ function C(y) {
3433
+ return typeof g > "u" ? !1 : (typeof v.working > "u" && (v.working = v(new g())), v.working ? v(y) : y instanceof g);
3366
3434
  }
3367
3435
  t.isSharedArrayBuffer = C;
3368
- function _(h) {
3369
- return u(h) === "[object AsyncFunction]";
3436
+ function L(y) {
3437
+ return u(y) === "[object AsyncFunction]";
3370
3438
  }
3371
- t.isAsyncFunction = _;
3372
- function E(h) {
3373
- return u(h) === "[object Map Iterator]";
3439
+ t.isAsyncFunction = L;
3440
+ function w(y) {
3441
+ return u(y) === "[object Map Iterator]";
3374
3442
  }
3375
- t.isMapIterator = E;
3376
- function O(h) {
3377
- return u(h) === "[object Set Iterator]";
3443
+ t.isMapIterator = w;
3444
+ function O(y) {
3445
+ return u(y) === "[object Set Iterator]";
3378
3446
  }
3379
3447
  t.isSetIterator = O;
3380
- function F(h) {
3381
- return u(h) === "[object Generator]";
3448
+ function P(y) {
3449
+ return u(y) === "[object Generator]";
3382
3450
  }
3383
- t.isGeneratorObject = F;
3384
- function G(h) {
3385
- return u(h) === "[object WebAssembly.Module]";
3451
+ t.isGeneratorObject = P;
3452
+ function G(y) {
3453
+ return u(y) === "[object WebAssembly.Module]";
3386
3454
  }
3387
3455
  t.isWebAssemblyCompiledModule = G;
3388
- function we(h) {
3389
- return b(h, d);
3456
+ function Ae(y) {
3457
+ return b(y, d);
3390
3458
  }
3391
- t.isNumberObject = we;
3392
- function ot(h) {
3393
- return b(h, c);
3459
+ t.isNumberObject = Ae;
3460
+ function ot(y) {
3461
+ return b(y, c);
3394
3462
  }
3395
3463
  t.isStringObject = ot;
3396
- function Fe(h) {
3397
- return b(h, f);
3464
+ function Ne(y) {
3465
+ return b(y, f);
3398
3466
  }
3399
- t.isBooleanObject = Fe;
3400
- function st(h) {
3401
- return s && b(h, y);
3467
+ t.isBooleanObject = Ne;
3468
+ function st(y) {
3469
+ return s && b(y, p);
3402
3470
  }
3403
3471
  t.isBigIntObject = st;
3404
- function br(h) {
3405
- return a && b(h, m);
3472
+ function vr(y) {
3473
+ return a && b(y, m);
3406
3474
  }
3407
- t.isSymbolObject = br;
3408
- function zn(h) {
3409
- return we(h) || ot(h) || Fe(h) || st(h) || br(h);
3475
+ t.isSymbolObject = vr;
3476
+ function zn(y) {
3477
+ return Ae(y) || ot(y) || Ne(y) || st(y) || vr(y);
3410
3478
  }
3411
3479
  t.isBoxedPrimitive = zn;
3412
- function Hn(h) {
3413
- return typeof Uint8Array < "u" && (it(h) || C(h));
3480
+ function Hn(y) {
3481
+ return typeof Uint8Array < "u" && (it(y) || C(y));
3414
3482
  }
3415
- t.isAnyArrayBuffer = Hn, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(h) {
3416
- Object.defineProperty(t, h, {
3483
+ t.isAnyArrayBuffer = Hn, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(y) {
3484
+ Object.defineProperty(t, y, {
3417
3485
  enumerable: !1,
3418
3486
  value: function() {
3419
- throw new Error(h + " is not supported in userland");
3487
+ throw new Error(y + " is not supported in userland");
3420
3488
  }
3421
3489
  });
3422
3490
  });
3423
3491
  })(Cn);
3424
- var oa = function(e) {
3492
+ var aa = function(e) {
3425
3493
  return e && typeof e == "object" && typeof e.copy == "function" && typeof e.fill == "function" && typeof e.readUInt8 == "function";
3426
3494
  }, nr = { exports: {} };
3427
3495
  typeof Object.create == "function" ? nr.exports = function(e, r) {
@@ -3441,20 +3509,20 @@ typeof Object.create == "function" ? nr.exports = function(e, r) {
3441
3509
  n.prototype = r.prototype, e.prototype = new n(), e.prototype.constructor = e;
3442
3510
  }
3443
3511
  };
3444
- var sa = nr.exports;
3512
+ var ua = nr.exports;
3445
3513
  (function(t) {
3446
- var e = Object.getOwnPropertyDescriptors || function(p) {
3447
- for (var g = Object.keys(p), v = {}, C = 0; C < g.length; C++)
3448
- v[g[C]] = Object.getOwnPropertyDescriptor(p, g[C]);
3514
+ var e = Object.getOwnPropertyDescriptors || function(h) {
3515
+ for (var g = Object.keys(h), v = {}, C = 0; C < g.length; C++)
3516
+ v[g[C]] = Object.getOwnPropertyDescriptor(h, g[C]);
3449
3517
  return v;
3450
3518
  }, r = /%[sdj%]/g;
3451
3519
  t.format = function(l) {
3452
- if (!L(l)) {
3453
- for (var p = [], g = 0; g < arguments.length; g++)
3454
- p.push(s(arguments[g]));
3455
- return p.join(" ");
3520
+ if (!_(l)) {
3521
+ for (var h = [], g = 0; g < arguments.length; g++)
3522
+ h.push(s(arguments[g]));
3523
+ return h.join(" ");
3456
3524
  }
3457
- for (var g = 1, v = arguments, C = v.length, _ = String(l).replace(r, function(O) {
3525
+ for (var g = 1, v = arguments, C = v.length, L = String(l).replace(r, function(O) {
3458
3526
  if (O === "%%")
3459
3527
  return "%";
3460
3528
  if (g >= C)
@@ -3473,22 +3541,22 @@ var sa = nr.exports;
3473
3541
  default:
3474
3542
  return O;
3475
3543
  }
3476
- }), E = v[g]; g < C; E = v[++g])
3477
- V(E) || !ee(E) ? _ += " " + E : _ += " " + s(E);
3478
- return _;
3479
- }, t.deprecate = function(l, p) {
3544
+ }), w = v[g]; g < C; w = v[++g])
3545
+ V(w) || !Z(w) ? L += " " + w : L += " " + s(w);
3546
+ return L;
3547
+ }, t.deprecate = function(l, h) {
3480
3548
  if (typeof S < "u" && S.noDeprecation === !0)
3481
3549
  return l;
3482
3550
  if (typeof S > "u")
3483
3551
  return function() {
3484
- return t.deprecate(l, p).apply(this, arguments);
3552
+ return t.deprecate(l, h).apply(this, arguments);
3485
3553
  };
3486
3554
  var g = !1;
3487
3555
  function v() {
3488
3556
  if (!g) {
3489
3557
  if (S.throwDeprecation)
3490
- throw new Error(p);
3491
- S.traceDeprecation ? console.trace(p) : console.error(p), g = !0;
3558
+ throw new Error(h);
3559
+ S.traceDeprecation ? console.trace(h) : console.error(h), g = !0;
3492
3560
  }
3493
3561
  return l.apply(this, arguments);
3494
3562
  }
@@ -3502,22 +3570,22 @@ var sa = nr.exports;
3502
3570
  t.debuglog = function(l) {
3503
3571
  if (l = l.toUpperCase(), !n[l])
3504
3572
  if (i.test(l)) {
3505
- var p = S.pid;
3573
+ var h = S.pid;
3506
3574
  n[l] = function() {
3507
3575
  var g = t.format.apply(t, arguments);
3508
- console.error("%s %d: %s", l, p, g);
3576
+ console.error("%s %d: %s", l, h, g);
3509
3577
  };
3510
3578
  } else
3511
3579
  n[l] = function() {
3512
3580
  };
3513
3581
  return n[l];
3514
3582
  };
3515
- function s(l, p) {
3583
+ function s(l, h) {
3516
3584
  var g = {
3517
3585
  seen: [],
3518
3586
  stylize: u
3519
3587
  };
3520
- return arguments.length >= 3 && (g.depth = arguments[2]), arguments.length >= 4 && (g.colors = arguments[3]), P(p) ? g.showHidden = p : p && t._extend(g, p), T(g.showHidden) && (g.showHidden = !1), T(g.depth) && (g.depth = 2), T(g.colors) && (g.colors = !1), T(g.customInspect) && (g.customInspect = !0), g.colors && (g.stylize = a), c(g, l, g.depth);
3588
+ return arguments.length >= 3 && (g.depth = arguments[2]), arguments.length >= 4 && (g.colors = arguments[3]), F(h) ? g.showHidden = h : h && t._extend(g, h), I(g.showHidden) && (g.showHidden = !1), I(g.depth) && (g.depth = 2), I(g.colors) && (g.colors = !1), I(g.customInspect) && (g.customInspect = !0), g.colors && (g.stylize = a), c(g, l, g.depth);
3521
3589
  }
3522
3590
  t.inspect = s, s.colors = {
3523
3591
  bold: [1, 22],
@@ -3544,101 +3612,101 @@ var sa = nr.exports;
3544
3612
  // "name": intentionally not styling
3545
3613
  regexp: "red"
3546
3614
  };
3547
- function a(l, p) {
3548
- var g = s.styles[p];
3615
+ function a(l, h) {
3616
+ var g = s.styles[h];
3549
3617
  return g ? "\x1B[" + s.colors[g][0] + "m" + l + "\x1B[" + s.colors[g][1] + "m" : l;
3550
3618
  }
3551
- function u(l, p) {
3619
+ function u(l, h) {
3552
3620
  return l;
3553
3621
  }
3554
3622
  function d(l) {
3555
- var p = {};
3623
+ var h = {};
3556
3624
  return l.forEach(function(g, v) {
3557
- p[g] = !0;
3558
- }), p;
3559
- }
3560
- function c(l, p, g) {
3561
- if (l.customInspect && p && oe(p.inspect) && // Filter out the util module, it's inspect function is special
3562
- p.inspect !== t.inspect && // Also filter out any prototype objects using the circular check.
3563
- !(p.constructor && p.constructor.prototype === p)) {
3564
- var v = p.inspect(g, l);
3565
- return L(v) || (v = c(l, v, g)), v;
3625
+ h[g] = !0;
3626
+ }), h;
3627
+ }
3628
+ function c(l, h, g) {
3629
+ if (l.customInspect && h && oe(h.inspect) && // Filter out the util module, it's inspect function is special
3630
+ h.inspect !== t.inspect && // Also filter out any prototype objects using the circular check.
3631
+ !(h.constructor && h.constructor.prototype === h)) {
3632
+ var v = h.inspect(g, l);
3633
+ return _(v) || (v = c(l, v, g)), v;
3566
3634
  }
3567
- var C = f(l, p);
3635
+ var C = f(l, h);
3568
3636
  if (C)
3569
3637
  return C;
3570
- var _ = Object.keys(p), E = d(_);
3571
- if (l.showHidden && (_ = Object.getOwnPropertyNames(p)), Se(p) && (_.indexOf("message") >= 0 || _.indexOf("description") >= 0))
3572
- return y(p);
3573
- if (_.length === 0) {
3574
- if (oe(p)) {
3575
- var O = p.name ? ": " + p.name : "";
3638
+ var L = Object.keys(h), w = d(L);
3639
+ if (l.showHidden && (L = Object.getOwnPropertyNames(h)), we(h) && (L.indexOf("message") >= 0 || L.indexOf("description") >= 0))
3640
+ return p(h);
3641
+ if (L.length === 0) {
3642
+ if (oe(h)) {
3643
+ var O = h.name ? ": " + h.name : "";
3576
3644
  return l.stylize("[Function" + O + "]", "special");
3577
3645
  }
3578
- if (Z(p))
3579
- return l.stylize(RegExp.prototype.toString.call(p), "regexp");
3580
- if (_e(p))
3581
- return l.stylize(Date.prototype.toString.call(p), "date");
3582
- if (Se(p))
3583
- return y(p);
3646
+ if (X(h))
3647
+ return l.stylize(RegExp.prototype.toString.call(h), "regexp");
3648
+ if (_e(h))
3649
+ return l.stylize(Date.prototype.toString.call(h), "date");
3650
+ if (we(h))
3651
+ return p(h);
3584
3652
  }
3585
- var F = "", G = !1, we = ["{", "}"];
3586
- if (A(p) && (G = !0, we = ["[", "]"]), oe(p)) {
3587
- var ot = p.name ? ": " + p.name : "";
3588
- F = " [Function" + ot + "]";
3653
+ var P = "", G = !1, Ae = ["{", "}"];
3654
+ if (E(h) && (G = !0, Ae = ["[", "]"]), oe(h)) {
3655
+ var ot = h.name ? ": " + h.name : "";
3656
+ P = " [Function" + ot + "]";
3589
3657
  }
3590
- if (Z(p) && (F = " " + RegExp.prototype.toString.call(p)), _e(p) && (F = " " + Date.prototype.toUTCString.call(p)), Se(p) && (F = " " + y(p)), _.length === 0 && (!G || p.length == 0))
3591
- return we[0] + F + we[1];
3658
+ if (X(h) && (P = " " + RegExp.prototype.toString.call(h)), _e(h) && (P = " " + Date.prototype.toUTCString.call(h)), we(h) && (P = " " + p(h)), L.length === 0 && (!G || h.length == 0))
3659
+ return Ae[0] + P + Ae[1];
3592
3660
  if (g < 0)
3593
- return Z(p) ? l.stylize(RegExp.prototype.toString.call(p), "regexp") : l.stylize("[Object]", "special");
3594
- l.seen.push(p);
3595
- var Fe;
3596
- return G ? Fe = m(l, p, g, E, _) : Fe = _.map(function(st) {
3597
- return b(l, p, g, E, st, G);
3598
- }), l.seen.pop(), w(Fe, F, we);
3599
- }
3600
- function f(l, p) {
3601
- if (T(p))
3661
+ return X(h) ? l.stylize(RegExp.prototype.toString.call(h), "regexp") : l.stylize("[Object]", "special");
3662
+ l.seen.push(h);
3663
+ var Ne;
3664
+ return G ? Ne = m(l, h, g, w, L) : Ne = L.map(function(st) {
3665
+ return b(l, h, g, w, st, G);
3666
+ }), l.seen.pop(), T(Ne, P, Ae);
3667
+ }
3668
+ function f(l, h) {
3669
+ if (I(h))
3602
3670
  return l.stylize("undefined", "undefined");
3603
- if (L(p)) {
3604
- var g = "'" + JSON.stringify(p).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
3671
+ if (_(h)) {
3672
+ var g = "'" + JSON.stringify(h).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
3605
3673
  return l.stylize(g, "string");
3606
3674
  }
3607
- if (K(p))
3608
- return l.stylize("" + p, "number");
3609
- if (P(p))
3610
- return l.stylize("" + p, "boolean");
3611
- if (V(p))
3675
+ if (J(h))
3676
+ return l.stylize("" + h, "number");
3677
+ if (F(h))
3678
+ return l.stylize("" + h, "boolean");
3679
+ if (V(h))
3612
3680
  return l.stylize("null", "null");
3613
3681
  }
3614
- function y(l) {
3682
+ function p(l) {
3615
3683
  return "[" + Error.prototype.toString.call(l) + "]";
3616
3684
  }
3617
- function m(l, p, g, v, C) {
3618
- for (var _ = [], E = 0, O = p.length; E < O; ++E)
3619
- ke(p, String(E)) ? _.push(b(
3685
+ function m(l, h, g, v, C) {
3686
+ for (var L = [], w = 0, O = h.length; w < O; ++w)
3687
+ Pe(h, String(w)) ? L.push(b(
3620
3688
  l,
3621
- p,
3689
+ h,
3622
3690
  g,
3623
3691
  v,
3624
- String(E),
3692
+ String(w),
3625
3693
  !0
3626
- )) : _.push("");
3627
- return C.forEach(function(F) {
3628
- F.match(/^\d+$/) || _.push(b(
3694
+ )) : L.push("");
3695
+ return C.forEach(function(P) {
3696
+ P.match(/^\d+$/) || L.push(b(
3629
3697
  l,
3630
- p,
3698
+ h,
3631
3699
  g,
3632
3700
  v,
3633
- F,
3701
+ P,
3634
3702
  !0
3635
3703
  ));
3636
- }), _;
3704
+ }), L;
3637
3705
  }
3638
- function b(l, p, g, v, C, _) {
3639
- var E, O, F;
3640
- if (F = Object.getOwnPropertyDescriptor(p, C) || { value: p[C] }, F.get ? F.set ? O = l.stylize("[Getter/Setter]", "special") : O = l.stylize("[Getter]", "special") : F.set && (O = l.stylize("[Setter]", "special")), ke(v, C) || (E = "[" + C + "]"), O || (l.seen.indexOf(F.value) < 0 ? (V(g) ? O = c(l, F.value, null) : O = c(l, F.value, g - 1), O.indexOf(`
3641
- `) > -1 && (_ ? O = O.split(`
3706
+ function b(l, h, g, v, C, L) {
3707
+ var w, O, P;
3708
+ if (P = Object.getOwnPropertyDescriptor(h, C) || { value: h[C] }, P.get ? P.set ? O = l.stylize("[Getter/Setter]", "special") : O = l.stylize("[Getter]", "special") : P.set && (O = l.stylize("[Setter]", "special")), Pe(v, C) || (w = "[" + C + "]"), O || (l.seen.indexOf(P.value) < 0 ? (V(g) ? O = c(l, P.value, null) : O = c(l, P.value, g - 1), O.indexOf(`
3709
+ `) > -1 && (L ? O = O.split(`
3642
3710
  `).map(function(G) {
3643
3711
  return " " + G;
3644
3712
  }).join(`
@@ -3647,87 +3715,87 @@ var sa = nr.exports;
3647
3715
  `).map(function(G) {
3648
3716
  return " " + G;
3649
3717
  }).join(`
3650
- `))) : O = l.stylize("[Circular]", "special")), T(E)) {
3651
- if (_ && C.match(/^\d+$/))
3718
+ `))) : O = l.stylize("[Circular]", "special")), I(w)) {
3719
+ if (L && C.match(/^\d+$/))
3652
3720
  return O;
3653
- E = JSON.stringify("" + C), E.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (E = E.slice(1, -1), E = l.stylize(E, "name")) : (E = E.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), E = l.stylize(E, "string"));
3721
+ w = JSON.stringify("" + C), w.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (w = w.slice(1, -1), w = l.stylize(w, "name")) : (w = w.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), w = l.stylize(w, "string"));
3654
3722
  }
3655
- return E + ": " + O;
3723
+ return w + ": " + O;
3656
3724
  }
3657
- function w(l, p, g) {
3658
- var v = l.reduce(function(C, _) {
3659
- return _.indexOf(`
3660
- `) >= 0, C + _.replace(/\u001b\[\d\d?m/g, "").length + 1;
3725
+ function T(l, h, g) {
3726
+ var v = l.reduce(function(C, L) {
3727
+ return L.indexOf(`
3728
+ `) >= 0, C + L.replace(/\u001b\[\d\d?m/g, "").length + 1;
3661
3729
  }, 0);
3662
- return v > 60 ? g[0] + (p === "" ? "" : p + `
3730
+ return v > 60 ? g[0] + (h === "" ? "" : h + `
3663
3731
  `) + " " + l.join(`,
3664
- `) + " " + g[1] : g[0] + p + " " + l.join(", ") + " " + g[1];
3732
+ `) + " " + g[1] : g[0] + h + " " + l.join(", ") + " " + g[1];
3665
3733
  }
3666
3734
  t.types = Cn;
3667
- function A(l) {
3735
+ function E(l) {
3668
3736
  return Array.isArray(l);
3669
3737
  }
3670
- t.isArray = A;
3671
- function P(l) {
3738
+ t.isArray = E;
3739
+ function F(l) {
3672
3740
  return typeof l == "boolean";
3673
3741
  }
3674
- t.isBoolean = P;
3742
+ t.isBoolean = F;
3675
3743
  function V(l) {
3676
3744
  return l === null;
3677
3745
  }
3678
3746
  t.isNull = V;
3679
- function j(l) {
3747
+ function q(l) {
3680
3748
  return l == null;
3681
3749
  }
3682
- t.isNullOrUndefined = j;
3683
- function K(l) {
3750
+ t.isNullOrUndefined = q;
3751
+ function J(l) {
3684
3752
  return typeof l == "number";
3685
3753
  }
3686
- t.isNumber = K;
3687
- function L(l) {
3754
+ t.isNumber = J;
3755
+ function _(l) {
3688
3756
  return typeof l == "string";
3689
3757
  }
3690
- t.isString = L;
3758
+ t.isString = _;
3691
3759
  function R(l) {
3692
3760
  return typeof l == "symbol";
3693
3761
  }
3694
3762
  t.isSymbol = R;
3695
- function T(l) {
3763
+ function I(l) {
3696
3764
  return l === void 0;
3697
3765
  }
3698
- t.isUndefined = T;
3699
- function Z(l) {
3700
- return ee(l) && ge(l) === "[object RegExp]";
3766
+ t.isUndefined = I;
3767
+ function X(l) {
3768
+ return Z(l) && me(l) === "[object RegExp]";
3701
3769
  }
3702
- t.isRegExp = Z, t.types.isRegExp = Z;
3703
- function ee(l) {
3770
+ t.isRegExp = X, t.types.isRegExp = X;
3771
+ function Z(l) {
3704
3772
  return typeof l == "object" && l !== null;
3705
3773
  }
3706
- t.isObject = ee;
3774
+ t.isObject = Z;
3707
3775
  function _e(l) {
3708
- return ee(l) && ge(l) === "[object Date]";
3776
+ return Z(l) && me(l) === "[object Date]";
3709
3777
  }
3710
3778
  t.isDate = _e, t.types.isDate = _e;
3711
- function Se(l) {
3712
- return ee(l) && (ge(l) === "[object Error]" || l instanceof Error);
3779
+ function we(l) {
3780
+ return Z(l) && (me(l) === "[object Error]" || l instanceof Error);
3713
3781
  }
3714
- t.isError = Se, t.types.isNativeError = Se;
3782
+ t.isError = we, t.types.isNativeError = we;
3715
3783
  function oe(l) {
3716
3784
  return typeof l == "function";
3717
3785
  }
3718
3786
  t.isFunction = oe;
3719
- function Lt(l) {
3787
+ function _t(l) {
3720
3788
  return l === null || typeof l == "boolean" || typeof l == "number" || typeof l == "string" || typeof l == "symbol" || // ES6 symbol
3721
3789
  typeof l > "u";
3722
3790
  }
3723
- t.isPrimitive = Lt, t.isBuffer = oa;
3724
- function ge(l) {
3791
+ t.isPrimitive = _t, t.isBuffer = aa;
3792
+ function me(l) {
3725
3793
  return Object.prototype.toString.call(l);
3726
3794
  }
3727
3795
  function He(l) {
3728
3796
  return l < 10 ? "0" + l.toString(10) : l.toString(10);
3729
3797
  }
3730
- var Le = [
3798
+ var ke = [
3731
3799
  "Jan",
3732
3800
  "Feb",
3733
3801
  "Mar",
@@ -3742,31 +3810,31 @@ var sa = nr.exports;
3742
3810
  "Dec"
3743
3811
  ];
3744
3812
  function kt() {
3745
- var l = /* @__PURE__ */ new Date(), p = [
3813
+ var l = /* @__PURE__ */ new Date(), h = [
3746
3814
  He(l.getHours()),
3747
3815
  He(l.getMinutes()),
3748
3816
  He(l.getSeconds())
3749
3817
  ].join(":");
3750
- return [l.getDate(), Le[l.getMonth()], p].join(" ");
3818
+ return [l.getDate(), ke[l.getMonth()], h].join(" ");
3751
3819
  }
3752
3820
  t.log = function() {
3753
3821
  console.log("%s - %s", kt(), t.format.apply(t, arguments));
3754
- }, t.inherits = sa, t._extend = function(l, p) {
3755
- if (!p || !ee(p))
3822
+ }, t.inherits = ua, t._extend = function(l, h) {
3823
+ if (!h || !Z(h))
3756
3824
  return l;
3757
- for (var g = Object.keys(p), v = g.length; v--; )
3758
- l[g[v]] = p[g[v]];
3825
+ for (var g = Object.keys(h), v = g.length; v--; )
3826
+ l[g[v]] = h[g[v]];
3759
3827
  return l;
3760
3828
  };
3761
- function ke(l, p) {
3762
- return Object.prototype.hasOwnProperty.call(l, p);
3829
+ function Pe(l, h) {
3830
+ return Object.prototype.hasOwnProperty.call(l, h);
3763
3831
  }
3764
3832
  var se = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
3765
- t.promisify = function(p) {
3766
- if (typeof p != "function")
3833
+ t.promisify = function(h) {
3834
+ if (typeof h != "function")
3767
3835
  throw new TypeError('The "original" argument must be of type Function');
3768
- if (se && p[se]) {
3769
- var g = p[se];
3836
+ if (se && h[se]) {
3837
+ var g = h[se];
3770
3838
  if (typeof g != "function")
3771
3839
  throw new TypeError('The "util.promisify.custom" argument must be of type Function');
3772
3840
  return Object.defineProperty(g, se, {
@@ -3777,67 +3845,67 @@ var sa = nr.exports;
3777
3845
  }), g;
3778
3846
  }
3779
3847
  function g() {
3780
- for (var v, C, _ = new Promise(function(F, G) {
3781
- v = F, C = G;
3782
- }), E = [], O = 0; O < arguments.length; O++)
3783
- E.push(arguments[O]);
3784
- E.push(function(F, G) {
3785
- F ? C(F) : v(G);
3848
+ for (var v, C, L = new Promise(function(P, G) {
3849
+ v = P, C = G;
3850
+ }), w = [], O = 0; O < arguments.length; O++)
3851
+ w.push(arguments[O]);
3852
+ w.push(function(P, G) {
3853
+ P ? C(P) : v(G);
3786
3854
  });
3787
3855
  try {
3788
- p.apply(this, E);
3789
- } catch (F) {
3790
- C(F);
3856
+ h.apply(this, w);
3857
+ } catch (P) {
3858
+ C(P);
3791
3859
  }
3792
- return _;
3860
+ return L;
3793
3861
  }
3794
- return Object.setPrototypeOf(g, Object.getPrototypeOf(p)), se && Object.defineProperty(g, se, {
3862
+ return Object.setPrototypeOf(g, Object.getPrototypeOf(h)), se && Object.defineProperty(g, se, {
3795
3863
  value: g,
3796
3864
  enumerable: !1,
3797
3865
  writable: !1,
3798
3866
  configurable: !0
3799
3867
  }), Object.defineProperties(
3800
3868
  g,
3801
- e(p)
3869
+ e(h)
3802
3870
  );
3803
3871
  }, t.promisify.custom = se;
3804
- function Pe(l, p) {
3872
+ function Fe(l, h) {
3805
3873
  if (!l) {
3806
3874
  var g = new Error("Promise was rejected with a falsy value");
3807
3875
  g.reason = l, l = g;
3808
3876
  }
3809
- return p(l);
3877
+ return h(l);
3810
3878
  }
3811
3879
  function it(l) {
3812
3880
  if (typeof l != "function")
3813
3881
  throw new TypeError('The "original" argument must be of type Function');
3814
- function p() {
3882
+ function h() {
3815
3883
  for (var g = [], v = 0; v < arguments.length; v++)
3816
3884
  g.push(arguments[v]);
3817
3885
  var C = g.pop();
3818
3886
  if (typeof C != "function")
3819
3887
  throw new TypeError("The last argument must be of type Function");
3820
- var _ = this, E = function() {
3821
- return C.apply(_, arguments);
3888
+ var L = this, w = function() {
3889
+ return C.apply(L, arguments);
3822
3890
  };
3823
3891
  l.apply(this, g).then(
3824
3892
  function(O) {
3825
- S.nextTick(E.bind(null, null, O));
3893
+ S.nextTick(w.bind(null, null, O));
3826
3894
  },
3827
3895
  function(O) {
3828
- S.nextTick(Pe.bind(null, O, E));
3896
+ S.nextTick(Fe.bind(null, O, w));
3829
3897
  }
3830
3898
  );
3831
3899
  }
3832
- return Object.setPrototypeOf(p, Object.getPrototypeOf(l)), Object.defineProperties(
3833
- p,
3900
+ return Object.setPrototypeOf(h, Object.getPrototypeOf(l)), Object.defineProperties(
3901
+ h,
3834
3902
  e(l)
3835
- ), p;
3903
+ ), h;
3836
3904
  }
3837
3905
  t.callbackify = it;
3838
3906
  })(Ct);
3839
- const { inherits: aa, format: jt } = Ct;
3840
- function Ae(t, e, r = Error) {
3907
+ const { inherits: ca, format: jt } = Ct;
3908
+ function Ie(t, e, r = Error) {
3841
3909
  if (!t)
3842
3910
  throw new Error("Avvio error code must not be empty");
3843
3911
  if (!e)
@@ -3849,35 +3917,35 @@ function Ae(t, e, r = Error) {
3849
3917
  }
3850
3918
  return n.prototype[Symbol.toStringTag] = "Error", n.prototype.toString = function() {
3851
3919
  return `${this.name} [${this.code}]: ${this.message}`;
3852
- }, aa(n, r), n;
3920
+ }, ca(n, r), n;
3853
3921
  }
3854
3922
  var qn = {
3855
- createError: Ae,
3856
- AVV_ERR_EXPOSE_ALREADY_DEFINED: Ae(
3923
+ createError: Ie,
3924
+ AVV_ERR_EXPOSE_ALREADY_DEFINED: Ie(
3857
3925
  "AVV_ERR_EXPOSE_ALREADY_DEFINED",
3858
3926
  "'%s' () is already defined, specify an expose option"
3859
3927
  ),
3860
- AVV_ERR_CALLBACK_NOT_FN: Ae(
3928
+ AVV_ERR_CALLBACK_NOT_FN: Ie(
3861
3929
  "AVV_ERR_CALLBACK_NOT_FN",
3862
3930
  "Callback for '%s' hook is not a function. Received: '%s'"
3863
3931
  ),
3864
- AVV_ERR_PLUGIN_NOT_VALID: Ae(
3932
+ AVV_ERR_PLUGIN_NOT_VALID: Ie(
3865
3933
  "AVV_ERR_PLUGIN_NOT_VALID",
3866
3934
  "Plugin must be a function or a promise. Received: '%s'"
3867
3935
  ),
3868
- AVV_ERR_ROOT_PLG_BOOTED: Ae(
3936
+ AVV_ERR_ROOT_PLG_BOOTED: Ie(
3869
3937
  "AVV_ERR_PLUGIN_NOT_VALID",
3870
3938
  "Root plugin has already booted"
3871
3939
  ),
3872
- AVV_ERR_PARENT_PLG_LOADED: Ae(
3940
+ AVV_ERR_PARENT_PLG_LOADED: Ie(
3873
3941
  "AVV_ERR_PARENT_PLG_LOADED",
3874
3942
  "Impossible to load '%s' plugin because the parent '%s' was already loaded"
3875
3943
  ),
3876
- AVV_ERR_READY_TIMEOUT: Ae(
3944
+ AVV_ERR_READY_TIMEOUT: Ie(
3877
3945
  "AVV_ERR_READY_TIMEOUT",
3878
3946
  "Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise"
3879
3947
  )
3880
- }, ua = function t(e, r, n) {
3948
+ }, la = function t(e, r, n) {
3881
3949
  r === void 0 && (r = ""), n || (n = {});
3882
3950
  var i = function(u) {
3883
3951
  var d = {
@@ -3895,12 +3963,12 @@ var qn = {
3895
3963
  ` + r + (o.length ? i("│") : " ") + " ";
3896
3964
  return r + s.join(a) + `
3897
3965
  ` + o.map(function(u, d) {
3898
- var c = d === o.length - 1, f = u.nodes && u.nodes.length, y = r + (c ? " " : i("│")) + " ";
3899
- return r + i(c ? "└" : "├") + i("─") + i(f ? "┬" : "─") + " " + t(u, y, n).slice(r.length + 2);
3966
+ var c = d === o.length - 1, f = u.nodes && u.nodes.length, p = r + (c ? " " : i("│")) + " ";
3967
+ return r + i(c ? "└" : "├") + i("─") + i(f ? "┬" : "─") + " " + t(u, p, n).slice(r.length + 2);
3900
3968
  }).join("");
3901
3969
  };
3902
- const ca = ua, Jr = Symbol("avvio.TimeTree.untrackNode"), Mt = Symbol("avvio.TimeTree.trackNode"), Yr = Symbol("avvio.TimeTree.getParent"), Xr = Symbol("avvio.TimeTree.getNode"), Zr = Symbol("avvio.TimeTree.addNode");
3903
- let la = class {
3970
+ const da = la, Jr = Symbol("avvio.TimeTree.untrackNode"), Mt = Symbol("avvio.TimeTree.trackNode"), Yr = Symbol("avvio.TimeTree.getParent"), Xr = Symbol("avvio.TimeTree.getNode"), Zr = Symbol("avvio.TimeTree.addNode");
3971
+ let fa = class {
3904
3972
  constructor() {
3905
3973
  this.root = null, this.tableId = /* @__PURE__ */ new Map(), this.tableLabel = /* @__PURE__ */ new Map();
3906
3974
  }
@@ -3954,21 +4022,21 @@ let la = class {
3954
4022
  }
3955
4023
  prittyPrint() {
3956
4024
  const e = (n) => (n.label = `${n.label} ${n.diff} ms`, n.nodes.length > 0 && (n.nodes = n.nodes.map((i) => e(i))), n), r = e(this.toJSON());
3957
- return ca(r);
4025
+ return da(r);
3958
4026
  }
3959
4027
  };
3960
- var da = la, gr = { exports: {} }, ir = { exports: {} }, Ut, en;
3961
- function fa() {
4028
+ var ha = fa, mr = { exports: {} }, ir = { exports: {} }, Ut, en;
4029
+ function pa() {
3962
4030
  if (en)
3963
4031
  return Ut;
3964
4032
  en = 1;
3965
4033
  var t = 1e3, e = t * 60, r = e * 60, n = r * 24, i = n * 7, o = n * 365.25;
3966
4034
  Ut = function(c, f) {
3967
4035
  f = f || {};
3968
- var y = typeof c;
3969
- if (y === "string" && c.length > 0)
4036
+ var p = typeof c;
4037
+ if (p === "string" && c.length > 0)
3970
4038
  return s(c);
3971
- if (y === "number" && isFinite(c))
4039
+ if (p === "number" && isFinite(c))
3972
4040
  return f.long ? u(c) : a(c);
3973
4041
  throw new Error(
3974
4042
  "val is not a non-empty string or a valid number. val=" + JSON.stringify(c)
@@ -3980,46 +4048,46 @@ function fa() {
3980
4048
  c
3981
4049
  );
3982
4050
  if (f) {
3983
- var y = parseFloat(f[1]), m = (f[2] || "ms").toLowerCase();
4051
+ var p = parseFloat(f[1]), m = (f[2] || "ms").toLowerCase();
3984
4052
  switch (m) {
3985
4053
  case "years":
3986
4054
  case "year":
3987
4055
  case "yrs":
3988
4056
  case "yr":
3989
4057
  case "y":
3990
- return y * o;
4058
+ return p * o;
3991
4059
  case "weeks":
3992
4060
  case "week":
3993
4061
  case "w":
3994
- return y * i;
4062
+ return p * i;
3995
4063
  case "days":
3996
4064
  case "day":
3997
4065
  case "d":
3998
- return y * n;
4066
+ return p * n;
3999
4067
  case "hours":
4000
4068
  case "hour":
4001
4069
  case "hrs":
4002
4070
  case "hr":
4003
4071
  case "h":
4004
- return y * r;
4072
+ return p * r;
4005
4073
  case "minutes":
4006
4074
  case "minute":
4007
4075
  case "mins":
4008
4076
  case "min":
4009
4077
  case "m":
4010
- return y * e;
4078
+ return p * e;
4011
4079
  case "seconds":
4012
4080
  case "second":
4013
4081
  case "secs":
4014
4082
  case "sec":
4015
4083
  case "s":
4016
- return y * t;
4084
+ return p * t;
4017
4085
  case "milliseconds":
4018
4086
  case "millisecond":
4019
4087
  case "msecs":
4020
4088
  case "msec":
4021
4089
  case "ms":
4022
- return y;
4090
+ return p;
4023
4091
  default:
4024
4092
  return;
4025
4093
  }
@@ -4034,62 +4102,62 @@ function fa() {
4034
4102
  var f = Math.abs(c);
4035
4103
  return f >= n ? d(c, f, n, "day") : f >= r ? d(c, f, r, "hour") : f >= e ? d(c, f, e, "minute") : f >= t ? d(c, f, t, "second") : c + " ms";
4036
4104
  }
4037
- function d(c, f, y, m) {
4038
- var b = f >= y * 1.5;
4039
- return Math.round(c / y) + " " + m + (b ? "s" : "");
4105
+ function d(c, f, p, m) {
4106
+ var b = f >= p * 1.5;
4107
+ return Math.round(c / p) + " " + m + (b ? "s" : "");
4040
4108
  }
4041
4109
  return Ut;
4042
4110
  }
4043
- function pa(t) {
4044
- r.debug = r, r.default = r, r.coerce = u, r.disable = o, r.enable = i, r.enabled = s, r.humanize = fa(), r.destroy = d, Object.keys(t).forEach((c) => {
4111
+ function ya(t) {
4112
+ r.debug = r, r.default = r, r.coerce = u, r.disable = o, r.enable = i, r.enabled = s, r.humanize = pa(), r.destroy = d, Object.keys(t).forEach((c) => {
4045
4113
  r[c] = t[c];
4046
4114
  }), r.names = [], r.skips = [], r.formatters = {};
4047
4115
  function e(c) {
4048
4116
  let f = 0;
4049
- for (let y = 0; y < c.length; y++)
4050
- f = (f << 5) - f + c.charCodeAt(y), f |= 0;
4117
+ for (let p = 0; p < c.length; p++)
4118
+ f = (f << 5) - f + c.charCodeAt(p), f |= 0;
4051
4119
  return r.colors[Math.abs(f) % r.colors.length];
4052
4120
  }
4053
4121
  r.selectColor = e;
4054
4122
  function r(c) {
4055
- let f, y = null, m, b;
4056
- function w(...A) {
4057
- if (!w.enabled)
4123
+ let f, p = null, m, b;
4124
+ function T(...E) {
4125
+ if (!T.enabled)
4058
4126
  return;
4059
- const P = w, V = Number(/* @__PURE__ */ new Date()), j = V - (f || V);
4060
- P.diff = j, P.prev = f, P.curr = V, f = V, A[0] = r.coerce(A[0]), typeof A[0] != "string" && A.unshift("%O");
4061
- let K = 0;
4062
- A[0] = A[0].replace(/%([a-zA-Z%])/g, (R, T) => {
4127
+ const F = T, V = Number(/* @__PURE__ */ new Date()), q = V - (f || V);
4128
+ F.diff = q, F.prev = f, F.curr = V, f = V, E[0] = r.coerce(E[0]), typeof E[0] != "string" && E.unshift("%O");
4129
+ let J = 0;
4130
+ E[0] = E[0].replace(/%([a-zA-Z%])/g, (R, I) => {
4063
4131
  if (R === "%%")
4064
4132
  return "%";
4065
- K++;
4066
- const Z = r.formatters[T];
4067
- if (typeof Z == "function") {
4068
- const ee = A[K];
4069
- R = Z.call(P, ee), A.splice(K, 1), K--;
4133
+ J++;
4134
+ const X = r.formatters[I];
4135
+ if (typeof X == "function") {
4136
+ const Z = E[J];
4137
+ R = X.call(F, Z), E.splice(J, 1), J--;
4070
4138
  }
4071
4139
  return R;
4072
- }), r.formatArgs.call(P, A), (P.log || r.log).apply(P, A);
4140
+ }), r.formatArgs.call(F, E), (F.log || r.log).apply(F, E);
4073
4141
  }
4074
- return w.namespace = c, w.useColors = r.useColors(), w.color = r.selectColor(c), w.extend = n, w.destroy = r.destroy, Object.defineProperty(w, "enabled", {
4142
+ return T.namespace = c, T.useColors = r.useColors(), T.color = r.selectColor(c), T.extend = n, T.destroy = r.destroy, Object.defineProperty(T, "enabled", {
4075
4143
  enumerable: !0,
4076
4144
  configurable: !1,
4077
- get: () => y !== null ? y : (m !== r.namespaces && (m = r.namespaces, b = r.enabled(c)), b),
4078
- set: (A) => {
4079
- y = A;
4145
+ get: () => p !== null ? p : (m !== r.namespaces && (m = r.namespaces, b = r.enabled(c)), b),
4146
+ set: (E) => {
4147
+ p = E;
4080
4148
  }
4081
- }), typeof r.init == "function" && r.init(w), w;
4149
+ }), typeof r.init == "function" && r.init(T), T;
4082
4150
  }
4083
4151
  function n(c, f) {
4084
- const y = r(this.namespace + (typeof f > "u" ? ":" : f) + c);
4085
- return y.log = this.log, y;
4152
+ const p = r(this.namespace + (typeof f > "u" ? ":" : f) + c);
4153
+ return p.log = this.log, p;
4086
4154
  }
4087
4155
  function i(c) {
4088
4156
  r.save(c), r.namespaces = c, r.names = [], r.skips = [];
4089
4157
  let f;
4090
- const y = (typeof c == "string" ? c : "").split(/[\s,]+/), m = y.length;
4158
+ const p = (typeof c == "string" ? c : "").split(/[\s,]+/), m = p.length;
4091
4159
  for (f = 0; f < m; f++)
4092
- y[f] && (c = y[f].replace(/\*/g, ".*?"), c[0] === "-" ? r.skips.push(new RegExp("^" + c.slice(1) + "$")) : r.names.push(new RegExp("^" + c + "$")));
4160
+ p[f] && (c = p[f].replace(/\*/g, ".*?"), c[0] === "-" ? r.skips.push(new RegExp("^" + c.slice(1) + "$")) : r.names.push(new RegExp("^" + c + "$")));
4093
4161
  }
4094
4162
  function o() {
4095
4163
  const c = [
@@ -4101,11 +4169,11 @@ function pa(t) {
4101
4169
  function s(c) {
4102
4170
  if (c[c.length - 1] === "*")
4103
4171
  return !0;
4104
- let f, y;
4105
- for (f = 0, y = r.skips.length; f < y; f++)
4172
+ let f, p;
4173
+ for (f = 0, p = r.skips.length; f < p; f++)
4106
4174
  if (r.skips[f].test(c))
4107
4175
  return !1;
4108
- for (f = 0, y = r.names.length; f < y; f++)
4176
+ for (f = 0, p = r.names.length; f < p; f++)
4109
4177
  if (r.names[f].test(c))
4110
4178
  return !0;
4111
4179
  return !1;
@@ -4121,7 +4189,7 @@ function pa(t) {
4121
4189
  }
4122
4190
  return r.enable(r.load()), r;
4123
4191
  }
4124
- var ha = pa;
4192
+ var ga = ya;
4125
4193
  (function(t, e) {
4126
4194
  e.formatArgs = n, e.save = i, e.load = o, e.useColors = r, e.storage = s(), e.destroy = /* @__PURE__ */ (() => {
4127
4195
  let u = !1;
@@ -4219,8 +4287,8 @@ var ha = pa;
4219
4287
  const d = "color: " + this.color;
4220
4288
  u.splice(1, 0, d, "color: inherit");
4221
4289
  let c = 0, f = 0;
4222
- u[0].replace(/%[a-zA-Z%]/g, (y) => {
4223
- y !== "%%" && (c++, y === "%c" && (f = c));
4290
+ u[0].replace(/%[a-zA-Z%]/g, (p) => {
4291
+ p !== "%%" && (c++, p === "%c" && (f = c));
4224
4292
  }), u.splice(f, 0, d);
4225
4293
  }
4226
4294
  e.log = console.debug || console.log || (() => {
@@ -4245,7 +4313,7 @@ var ha = pa;
4245
4313
  } catch {
4246
4314
  }
4247
4315
  }
4248
- t.exports = ha(e);
4316
+ t.exports = ga(e);
4249
4317
  const { formatters: a } = t.exports;
4250
4318
  a.j = function(u) {
4251
4319
  try {
@@ -4256,27 +4324,27 @@ var ha = pa;
4256
4324
  };
4257
4325
  })(ir, ir.exports);
4258
4326
  var Qn = ir.exports;
4259
- const ya = mn, ga = On.EventEmitter, ma = Ct.inherits, U = Qn("avvio"), { AVV_ERR_READY_TIMEOUT: ba } = qn, xt = Symbol.for("plugin-meta");
4260
- function va(t, e) {
4327
+ const ma = mn, ba = On.EventEmitter, va = Ct.inherits, M = Qn("avvio"), { AVV_ERR_READY_TIMEOUT: Sa } = qn, xt = Symbol.for("plugin-meta");
4328
+ function wa(t, e) {
4261
4329
  return t[xt] && t[xt].name ? t[xt].name : typeof e < "u" && typeof e != "function" && e.name ? e.name : t.name ? t.name : t.toString().split(`
4262
4330
  `).slice(0, 2).map((r) => r.trim()).join(" -- ");
4263
4331
  }
4264
- function Sa() {
4332
+ function Aa() {
4265
4333
  const t = {};
4266
4334
  return t.promise = new Promise((e, r) => {
4267
4335
  t.resolve = e, t.reject = r;
4268
4336
  }), t;
4269
4337
  }
4270
4338
  function ze(t, e, r, n, i) {
4271
- this.started = !1, this.func = e, this.opts = r, this.onFinish = null, this.parent = t, this.timeout = i === void 0 ? t._timeout : i, this.name = va(e, r), this.isAfter = n, this.q = ya(t, wa, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
4339
+ this.started = !1, this.func = e, this.opts = r, this.onFinish = null, this.parent = t, this.timeout = i === void 0 ? t._timeout : i, this.name = wa(e, r), this.isAfter = n, this.q = ma(t, Ia, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
4272
4340
  }
4273
- ma(ze, ga);
4341
+ va(ze, ba);
4274
4342
  ze.prototype.exec = function(t, e) {
4275
4343
  const r = this.func;
4276
4344
  let n = !1;
4277
4345
  const i = this.name;
4278
4346
  if (this.parent._error && !this.isAfter) {
4279
- U("skipping loading of plugin as parent errored and it is not an after", i), S.nextTick(e);
4347
+ M("skipping loading of plugin as parent errored and it is not an after", i), S.nextTick(e);
4280
4348
  return;
4281
4349
  }
4282
4350
  if (this.isAfter)
@@ -4285,24 +4353,24 @@ ze.prototype.exec = function(t, e) {
4285
4353
  try {
4286
4354
  this.server = this.parent.override(t, r, this.opts);
4287
4355
  } catch (u) {
4288
- return U("override errored", i), e(u);
4356
+ return M("override errored", i), e(u);
4289
4357
  }
4290
- this.opts = typeof this.opts == "function" ? this.opts(this.server) : this.opts, U("exec", i);
4358
+ this.opts = typeof this.opts == "function" ? this.opts(this.server) : this.opts, M("exec", i);
4291
4359
  let o;
4292
4360
  const s = (u) => {
4293
4361
  if (n) {
4294
- U("loading complete", i);
4362
+ M("loading complete", i);
4295
4363
  return;
4296
4364
  }
4297
- this._error = u, U(u ? "exec errored" : "exec completed", i), n = !0, o && clearTimeout(o), e(u);
4365
+ this._error = u, M(u ? "exec errored" : "exec completed", i), n = !0, o && clearTimeout(o), e(u);
4298
4366
  };
4299
- this.timeout > 0 && (U("setting up timeout", i, this.timeout), o = setTimeout(function() {
4300
- U("timed out", i), o = null;
4301
- const u = new ba(i);
4367
+ this.timeout > 0 && (M("setting up timeout", i, this.timeout), o = setTimeout(function() {
4368
+ M("timed out", i), o = null;
4369
+ const u = new Sa(i);
4302
4370
  u.fn = r, s(u);
4303
4371
  }, this.timeout)), this.started = !0, this.emit("start", this.server ? this.server.name : null, this.name, Date.now());
4304
4372
  const a = r(this.server, this.opts, s);
4305
- a && typeof a.then == "function" && (U("exec: resolving promise", i), a.then(
4373
+ a && typeof a.then == "function" && (M("exec: resolving promise", i), a.then(
4306
4374
  () => S.nextTick(s),
4307
4375
  (u) => S.nextTick(s, u)
4308
4376
  ));
@@ -4312,48 +4380,48 @@ ze.prototype.loadedSoFar = function() {
4312
4380
  return Promise.resolve();
4313
4381
  const t = () => {
4314
4382
  this.server.after((r, n) => {
4315
- this._error = r, this.q.pause(), r ? (U("rejecting promise", this.name, r), this._promise.reject(r)) : (U("resolving promise", this.name), this._promise.resolve()), this._promise = null, S.nextTick(n, r);
4383
+ this._error = r, this.q.pause(), r ? (M("rejecting promise", this.name, r), this._promise.reject(r)) : (M("resolving promise", this.name), this._promise.resolve()), this._promise = null, S.nextTick(n, r);
4316
4384
  }), this.q.resume();
4317
4385
  };
4318
4386
  let e;
4319
- return this._promise ? e = Promise.resolve() : (this._promise = Sa(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
4387
+ return this._promise ? e = Promise.resolve() : (this._promise = Aa(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
4320
4388
  };
4321
4389
  ze.prototype.enqueue = function(t, e) {
4322
- U("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
4390
+ M("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
4323
4391
  };
4324
4392
  ze.prototype.finish = function(t, e) {
4325
- U("finish", this.name, t);
4393
+ M("finish", this.name, t);
4326
4394
  const r = () => {
4327
- this.loaded || (U("loaded", this.name), this.emit("loaded", this.server ? this.server.name : null, this.name, Date.now()), this.loaded = !0, e(t));
4395
+ this.loaded || (M("loaded", this.name), this.emit("loaded", this.server ? this.server.name : null, this.name, Date.now()), this.loaded = !0, e(t));
4328
4396
  };
4329
4397
  if (t) {
4330
4398
  this._promise && (this._promise.reject(t), this._promise = null), r();
4331
4399
  return;
4332
4400
  }
4333
4401
  const n = () => {
4334
- if (U("check", this.name, this.q.length(), this.q.running(), this._promise), this.q.length() === 0 && this.q.running() === 0)
4402
+ if (M("check", this.name, this.q.length(), this.q.running(), this._promise), this.q.length() === 0 && this.q.running() === 0)
4335
4403
  if (this._promise) {
4336
4404
  const i = () => {
4337
- U("wrap"), queueMicrotask(n);
4405
+ M("wrap"), queueMicrotask(n);
4338
4406
  };
4339
4407
  this._promise.resolve(), this._promise.promise.then(i, i), this._promise = null;
4340
4408
  } else
4341
4409
  r();
4342
4410
  else
4343
- U("delayed", this.name), this.q.drain = () => {
4344
- U("drain", this.name), this.q.drain = Aa, queueMicrotask(n);
4411
+ M("delayed", this.name), this.q.drain = () => {
4412
+ M("drain", this.name), this.q.drain = Ea, queueMicrotask(n);
4345
4413
  };
4346
4414
  };
4347
4415
  queueMicrotask(n), this.q.resume();
4348
4416
  };
4349
- function wa(t, e) {
4417
+ function Ia(t, e) {
4350
4418
  const r = this;
4351
- S.nextTick(mr.bind(r), t, e);
4419
+ S.nextTick(br.bind(r), t, e);
4352
4420
  }
4353
- function mr(t, e) {
4421
+ function br(t, e) {
4354
4422
  if (typeof t.func.then == "function") {
4355
4423
  t.func.then((n) => {
4356
- typeof n.default == "function" && (n = n.default), t.func = n, mr.call(this, t, e);
4424
+ typeof n.default == "function" && (n = n.default), t.func = n, br.call(this, t, e);
4357
4425
  }, e);
4358
4426
  return;
4359
4427
  }
@@ -4364,19 +4432,19 @@ function mr(t, e) {
4364
4432
  });
4365
4433
  });
4366
4434
  }
4367
- function Aa() {
4435
+ function Ea() {
4368
4436
  }
4369
- gr.exports = ze;
4370
- gr.exports.loadPlugin = mr;
4371
- var Ea = gr.exports;
4372
- const tn = mn, Ia = On.EventEmitter, Ta = Ct.inherits, {
4437
+ mr.exports = ze;
4438
+ mr.exports.loadPlugin = br;
4439
+ var Ta = mr.exports;
4440
+ const tn = mn, Oa = On.EventEmitter, Ca = Ct.inherits, {
4373
4441
  AVV_ERR_EXPOSE_ALREADY_DEFINED: Bt,
4374
4442
  AVV_ERR_CALLBACK_NOT_FN: Ze,
4375
- AVV_ERR_PLUGIN_NOT_VALID: Oa,
4376
- AVV_ERR_ROOT_PLG_BOOTED: Ca,
4377
- AVV_ERR_READY_TIMEOUT: _a
4378
- } = qn, La = da, or = Ea, Ge = Qn("avvio"), wt = Symbol("kAvvio"), qt = Symbol("kThenifyDoNotWrap");
4379
- function ka(t, e, r) {
4443
+ AVV_ERR_PLUGIN_NOT_VALID: La,
4444
+ AVV_ERR_ROOT_PLG_BOOTED: _a,
4445
+ AVV_ERR_READY_TIMEOUT: ka
4446
+ } = qn, Pa = ha, or = Ta, Ge = Qn("avvio"), wt = Symbol("kAvvio"), qt = Symbol("kThenifyDoNotWrap");
4447
+ function Fa(t, e, r) {
4380
4448
  const n = e.expose || {}, i = n.use || "use", o = n.after || "after", s = n.ready || "ready", a = n.onClose || "onClose", u = n.close || "close";
4381
4449
  if (t[i])
4382
4450
  throw new Bt(i);
@@ -4395,23 +4463,23 @@ function ka(t, e, r) {
4395
4463
  }, t[a] = function(d) {
4396
4464
  if (typeof d != "function")
4397
4465
  throw new Ze(a, typeof d);
4398
- return r.onClose(Ra(d, this)), this;
4466
+ return r.onClose($a(d, this)), this;
4399
4467
  }, t[u] = function(d) {
4400
4468
  if (d && typeof d != "function")
4401
4469
  throw new Ze(u, typeof d);
4402
4470
  return d ? (r.close(Qt(d, this)), this) : r.close();
4403
4471
  };
4404
4472
  }
4405
- function B(t, e, r) {
4406
- if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof B)) {
4407
- const n = new B(t, e, r);
4408
- return t && ka(t, e, n), n;
4473
+ function x(t, e, r) {
4474
+ if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof x)) {
4475
+ const n = new x(t, e, r);
4476
+ return t && Fa(t, e, n), n;
4409
4477
  }
4410
- 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 La(), this._readyQ = tn(this, Kn, 1), this._readyQ.pause(), this._readyQ.drain = () => {
4478
+ 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 Pa(), this._readyQ = tn(this, Kn, 1), this._readyQ.pause(), this._readyQ.drain = () => {
4411
4479
  this.emit("start"), this._readyQ.drain = rn;
4412
- }, this._closeQ = tn(this, Da, 1), this._closeQ.pause(), this._closeQ.drain = () => {
4480
+ }, this._closeQ = tn(this, Va, 1), this._closeQ.pause(), this._closeQ.drain = () => {
4413
4481
  this.emit("close"), this._closeQ.drain = rn;
4414
- }, this._doStart = null, this._root = new or(this, Pa.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
4482
+ }, this._doStart = null, this._root = new or(this, Na.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
4415
4483
  const s = this.pluginTree.start(null, i, o);
4416
4484
  this._root.once("loaded", (a, u, d) => {
4417
4485
  this.pluginTree.stop(s, d);
@@ -4431,33 +4499,33 @@ function B(t, e, r) {
4431
4499
  this._readyQ.resume();
4432
4500
  });
4433
4501
  }
4434
- function Pa(t, e, r) {
4502
+ function Na(t, e, r) {
4435
4503
  this._doStart = r, e.autostart && this.start();
4436
4504
  }
4437
- Ta(B, Ia);
4438
- B.prototype.start = function() {
4505
+ Ca(x, Oa);
4506
+ x.prototype.start = function() {
4439
4507
  return this.started = !0, S.nextTick(this._doStart), this;
4440
4508
  };
4441
- B.prototype.override = function(t, e, r) {
4509
+ x.prototype.override = function(t, e, r) {
4442
4510
  return t;
4443
4511
  };
4444
- function Fa(t) {
4512
+ function Da(t) {
4445
4513
  if (t && typeof t == "object" && typeof t.default == "function" && (t = t.default), !(t && (typeof t == "function" || typeof t.then == "function")))
4446
- throw new Oa(typeof t);
4514
+ throw new La(typeof t);
4447
4515
  return t;
4448
4516
  }
4449
- B.prototype[wt] = !0;
4450
- B.prototype.use = function(t, e) {
4517
+ x.prototype[wt] = !0;
4518
+ x.prototype.use = function(t, e) {
4451
4519
  return this._lastUsed = this._addPlugin(t, e, !1), this;
4452
4520
  };
4453
- B.prototype._loadRegistered = function() {
4521
+ x.prototype._loadRegistered = function() {
4454
4522
  const t = this._current[0];
4455
4523
  return !this.started && !this.booted && S.nextTick(() => this._root.q.resume()), t ? t.loadedSoFar() : Promise.resolve();
4456
4524
  };
4457
- Object.defineProperty(B.prototype, "then", { get: Gn });
4458
- B.prototype._addPlugin = function(t, e, r) {
4459
- if (t = Fa(t), e = e || {}, this.booted)
4460
- throw new Ca();
4525
+ Object.defineProperty(x.prototype, "then", { get: Gn });
4526
+ x.prototype._addPlugin = function(t, e, r) {
4527
+ if (t = Da(t), e = e || {}, this.booted)
4528
+ throw new _a();
4461
4529
  const n = this._current[0], i = new or(this, t, e, r);
4462
4530
  if (i.once("start", (o, s, a) => {
4463
4531
  const u = this.pluginTree.start(n.name, s, a);
@@ -4470,7 +4538,7 @@ B.prototype._addPlugin = function(t, e, r) {
4470
4538
  o && (this._error = o);
4471
4539
  }), i;
4472
4540
  };
4473
- B.prototype.after = function(t) {
4541
+ x.prototype.after = function(t) {
4474
4542
  if (!t)
4475
4543
  return this._loadRegistered();
4476
4544
  this._addPlugin(e.bind(this), {}, !0);
@@ -4479,7 +4547,7 @@ B.prototype.after = function(t) {
4479
4547
  }
4480
4548
  return this;
4481
4549
  };
4482
- B.prototype.onClose = function(t) {
4550
+ x.prototype.onClose = function(t) {
4483
4551
  if (typeof t != "function")
4484
4552
  throw new Error("not a function");
4485
4553
  t[this._isOnCloseHandlerKey] = !0, this._closeQ.unshift(t, e.bind(this));
@@ -4488,7 +4556,7 @@ B.prototype.onClose = function(t) {
4488
4556
  }
4489
4557
  return this;
4490
4558
  };
4491
- B.prototype.close = function(t) {
4559
+ x.prototype.close = function(t) {
4492
4560
  let e;
4493
4561
  if (t) {
4494
4562
  if (typeof t != "function")
@@ -4505,7 +4573,7 @@ B.prototype.close = function(t) {
4505
4573
  this._error = null, this._closeQ.push(t), S.nextTick(this._closeQ.resume.bind(this._closeQ));
4506
4574
  }), e;
4507
4575
  };
4508
- B.prototype.ready = function(t) {
4576
+ x.prototype.ready = function(t) {
4509
4577
  if (t) {
4510
4578
  if (typeof t != "function")
4511
4579
  throw new Ze("ready", typeof t);
@@ -4520,10 +4588,10 @@ B.prototype.ready = function(t) {
4520
4588
  }
4521
4589
  });
4522
4590
  };
4523
- B.prototype.prettyPrint = function() {
4591
+ x.prototype.prettyPrint = function() {
4524
4592
  return this.pluginTree.prittyPrint();
4525
4593
  };
4526
- B.prototype.toJSON = function() {
4594
+ x.prototype.toJSON = function() {
4527
4595
  return this.pluginTree.toJSON();
4528
4596
  };
4529
4597
  function rn() {
@@ -4552,14 +4620,14 @@ function Kn(t, e) {
4552
4620
  };
4553
4621
  t.length === 2 ? t(n, o) : t(n, r, o);
4554
4622
  } else
4555
- Na.call(this, t, n, r, e);
4623
+ Ra.call(this, t, n, r, e);
4556
4624
  }
4557
- function Na(t, e, r, n) {
4625
+ function Ra(t, e, r, n) {
4558
4626
  const i = t.name;
4559
4627
  Ge("setting up ready timeout", i, this._timeout);
4560
4628
  let o = setTimeout(() => {
4561
4629
  Ge("timed out", i), o = null;
4562
- const a = new _a(i);
4630
+ const a = new ka(i);
4563
4631
  a.fn = t, this._error = a, n(a);
4564
4632
  }, this._timeout);
4565
4633
  t.length === 2 ? t(e, s.bind(this)) : t(e, r, s.bind(this));
@@ -4567,7 +4635,7 @@ function Na(t, e, r, n) {
4567
4635
  o && (clearTimeout(o), this._error = a, n(this._error));
4568
4636
  }
4569
4637
  }
4570
- function Da(t, e) {
4638
+ function Va(t, e) {
4571
4639
  const r = this._server, n = t[this._isOnCloseHandlerKey];
4572
4640
  if (t.length === 0 || t.length === 1) {
4573
4641
  let i;
@@ -4578,7 +4646,7 @@ function Da(t, e) {
4578
4646
  } else
4579
4647
  t.length === 2 ? t(n ? r : this._error, e) : n ? t(r, e) : t(this._error, r, e);
4580
4648
  }
4581
- function Ra(t, e) {
4649
+ function $a(t, e) {
4582
4650
  return r.bind(e);
4583
4651
  function r(n, i) {
4584
4652
  let o;
@@ -4600,16 +4668,16 @@ function Qt(t, e) {
4600
4668
  }, i) : S.nextTick(i)) : t.length === 2 ? t(n, i) : t(n, this, i) : S.nextTick(i);
4601
4669
  }
4602
4670
  }
4603
- ar.exports = B;
4604
- ar.exports.express = function(t) {
4605
- return B(t, {
4671
+ ur.exports = x;
4672
+ ur.exports.express = function(t) {
4673
+ return x(t, {
4606
4674
  expose: {
4607
4675
  use: "load"
4608
4676
  }
4609
4677
  });
4610
4678
  };
4611
- var Va = ar.exports;
4612
- const $a = /* @__PURE__ */ Co(Va);
4679
+ var ja = ur.exports;
4680
+ const Ma = /* @__PURE__ */ _o(ja);
4613
4681
  (function() {
4614
4682
  if (window.requestAnimationFrame && window.cancelAnimationFrame)
4615
4683
  return;
@@ -4627,10 +4695,9 @@ const $a = /* @__PURE__ */ Co(Va);
4627
4695
  }, window.cancelAnimationFrame = clearTimeout;
4628
4696
  }
4629
4697
  })();
4630
- function au(t, e = !0, r = !0, n) {
4631
- console.log("start sdk");
4632
- const i = e ? "https://grpc-sdk.streamlayer.io:443" : "https://grpc-sdk.next.streamlayer.io:443", o = e ? "https://grpc.streamlayer.io:443" : "https://grpc.next.streamlayer.io:443", s = $a(/* @__PURE__ */ Object.create({}), { autostart: !1 });
4633
- return s.use(so), s.use(to, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(oo, { videoPlayerController: n?.videoPlayerController }), s.use(_i, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(Ni), s.use(io), s.use(bo), s.use(zi), s.use(Oo), s.after((a, u, d) => {
4698
+ function cu(t, e = !0, r = !0, n) {
4699
+ const i = e ? "https://grpc-sdk.streamlayer.io:443" : "https://grpc-sdk.next.streamlayer.io:443", o = e ? "https://grpc.streamlayer.io:443" : "https://grpc.next.streamlayer.io:443", s = Ma(/* @__PURE__ */ Object.create({}), { autostart: !1 });
4700
+ return s.use(so), s.use(to, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(oo, { videoPlayerController: n?.videoPlayerController }), s.use(Li, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(Ni), s.use(io), s.use(So), s.use(Ki), s.use(Lo), s.after((a, u, d) => {
4634
4701
  if (a)
4635
4702
  throw a;
4636
4703
  u.ready(), d();
@@ -4643,5 +4710,5 @@ function au(t, e = !0, r = !0, n) {
4643
4710
  }), s;
4644
4711
  }
4645
4712
  export {
4646
- au as StreamLayer
4713
+ cu as StreamLayer
4647
4714
  };