@streamlayer/sdk-web 1.6.7 → 1.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/es/index.js CHANGED
@@ -1,11 +1,11 @@
1
1
  import { pino as wi } from "pino";
2
- import { QuestionType as _, QuestionStatus as Z, PromotionType as W, NotificationEnabled as $r, SilenceSetting as Ai } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
2
+ import { QuestionType as _, QuestionStatus as Z, PromotionType as W, NotificationEnabled as $r, SilenceSetting as Ai, UseAsNotification as Ei } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
3
3
  import { PickHistoryStatus as lt } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
4
4
  import { SdkOverlayType as R } from "@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb";
5
- import { InvitationCategory as Br, InvitationFrom as Mr } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
6
- import { computed as Ei, map as Ii, atom as kt, batched as qr, onMount as Sr } from "nanostores";
5
+ import { InvitationCategory as Mr, InvitationFrom as Br } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
6
+ import { computed as Ii, map as Ti, atom as kt, batched as qr, onMount as Sr } from "nanostores";
7
7
  import { nanoid as ir } from "nanoid";
8
- import { ConnectError as rt, Code as se, createContextKey as jr, createClient as Ur, createContextValues as Ti } from "@connectrpc/connect";
8
+ import { ConnectError as rt, Code as ie, createContextKey as Ur, createClient as jr, createContextValues as Oi } from "@connectrpc/connect";
9
9
  import { createGrpcWebTransport as xr } from "@connectrpc/connect-web";
10
10
  import { nanoquery as Qr } from "@nanostores/query";
11
11
  import { Events as On } from "@streamlayer/sl-eslib/sports/events/events_connect";
@@ -14,12 +14,12 @@ import { Users as wr } from "@streamlayer/sl-eslib/users/users_connect";
14
14
  import { Feed as te } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
15
15
  import { Leaderboard as _n } from "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_connect";
16
16
  import "@streamlayer/sl-eslib/interactive/leaderboard/interactive.leaderboard_pb";
17
- import { LinksClient as Oi } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
17
+ import { LinksClient as _i } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
18
18
  import { Kind as Q, TopicSubType as Ae, TopicType as x, PollOpenedFrom as Y, Category as z, ScreenOrientation as Gr } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
19
19
  import { AnalyticsService as Ln } from "@streamlayer/sl-eslib/analytics/v2/streaming/streaming_connect";
20
20
  import { InteractionActionType as Kr } from "@streamlayer/sl-eslib/analytics/v1/interactions/interactions_pb";
21
21
  import { NotificationKind as he, NotificationType as zr } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
22
- function _i(t) {
22
+ function Li(t) {
23
23
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
24
24
  }
25
25
  var Cn = { exports: {} }, $ = Cn.exports = {}, ae, ue;
@@ -56,7 +56,7 @@ function kn(t) {
56
56
  }
57
57
  }
58
58
  }
59
- function Li(t) {
59
+ function Ci(t) {
60
60
  if (ue === clearTimeout)
61
61
  return clearTimeout(t);
62
62
  if ((ue === sr || !ue) && clearTimeout)
@@ -72,19 +72,19 @@ function Li(t) {
72
72
  }
73
73
  }
74
74
  var ve = [], Qe = !1, _e, ht = -1;
75
- function Ci() {
75
+ function ki() {
76
76
  !Qe || !_e || (Qe = !1, _e.length ? ve = _e.concat(ve) : ht = -1, ve.length && Pn());
77
77
  }
78
78
  function Pn() {
79
79
  if (!Qe) {
80
- var t = kn(Ci);
80
+ var t = kn(ki);
81
81
  Qe = !0;
82
82
  for (var e = ve.length; e; ) {
83
83
  for (_e = ve, ve = []; ++ht < e; )
84
84
  _e && _e[ht].run();
85
85
  ht = -1, e = ve.length;
86
86
  }
87
- _e = null, Qe = !1, Li(t);
87
+ _e = null, Qe = !1, Ci(t);
88
88
  }
89
89
  }
90
90
  $.nextTick = function(t) {
@@ -132,8 +132,8 @@ $.chdir = function(t) {
132
132
  $.umask = function() {
133
133
  return 0;
134
134
  };
135
- var ki = Cn.exports;
136
- const E = /* @__PURE__ */ _i(ki), Pi = wi({
135
+ var Pi = Cn.exports;
136
+ const E = /* @__PURE__ */ Li(Pi), Ni = wi({
137
137
  level: "trace",
138
138
  enabled: typeof window < "u" && !!window.localStorage.getItem("SL_DEBUG"),
139
139
  browser: {
@@ -141,23 +141,23 @@ const E = /* @__PURE__ */ _i(ki), Pi = wi({
141
141
  console.log(t);
142
142
  }
143
143
  }
144
- }), de = (t, e) => Pi.child({ name: t }, e);
145
- class Ni extends Event {
144
+ }), de = (t, e) => Ni.child({ name: t }, e);
145
+ class Fi extends Event {
146
146
  slEventBus;
147
147
  constructor(e, r) {
148
148
  super(e), this.slEventBus = r;
149
149
  }
150
150
  }
151
- const Fi = de("event-bus");
152
- class Di {
151
+ const Di = de("event-bus");
152
+ class Ri {
153
153
  name;
154
154
  listeners;
155
155
  constructor(e = "sl-event-bus") {
156
156
  this.name = e, this.listeners = /* @__PURE__ */ new Set();
157
157
  }
158
158
  emit = (e, r) => {
159
- const n = new Ni(this.name, { ...r, type: e });
160
- Fi.debug(n, "Emitting event"), window.dispatchEvent(n);
159
+ const n = new Fi(this.name, { ...r, type: e });
160
+ Di.debug(n, "Emitting event"), window.dispatchEvent(n);
161
161
  };
162
162
  listen(e) {
163
163
  return window.addEventListener(this.name, e), this.listeners.add(e), () => {
@@ -173,7 +173,7 @@ class Di {
173
173
  }), this.listeners.clear();
174
174
  };
175
175
  }
176
- class Ri {
176
+ class Vi {
177
177
  }
178
178
  window.slStore = /* @__PURE__ */ Object.create(null);
179
179
  class Pt {
@@ -192,9 +192,9 @@ class Pt {
192
192
  return this.store;
193
193
  }
194
194
  }
195
- const Vi = (t) => {
195
+ const $i = (t) => {
196
196
  const e = Object.keys(t);
197
- return Ei(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
197
+ return Ii(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
198
198
  };
199
199
  class Le extends Pt {
200
200
  getValues = () => this.getStore().get();
@@ -203,12 +203,12 @@ class Le extends Pt {
203
203
  subscribe = (...e) => this.getStore().subscribe(...e);
204
204
  unsubscribe = () => this.getStore().off();
205
205
  }
206
- const J = (t) => Ii(t);
206
+ const J = (t) => Ti(t);
207
207
  var me;
208
208
  (function(t) {
209
209
  t.ORGANIZATION = "ORGANIZATION", t.STREAM = "STREAM";
210
210
  })(me || (me = {}));
211
- const $i = {
211
+ const Mi = {
212
212
  [R.BETTING]: "betting",
213
213
  [R.GAMES]: "games",
214
214
  [R.PUBLIC_CHAT]: "publicChat",
@@ -226,7 +226,7 @@ class Fn {
226
226
  listeners = /* @__PURE__ */ new Set();
227
227
  settingsKey;
228
228
  constructor({ settings: e, ...r }, n) {
229
- this.settingsKey = $i[r.type], this.status = kt(Ze.Suspended), this.config = new Le(J(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Le(J(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Le(J({}), `feature:settings:${this.settingsKey}`), this.source = n;
229
+ this.settingsKey = Mi[r.type], this.status = kt(Ze.Suspended), this.config = new Le(J(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Le(J(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Le(J({}), `feature:settings:${this.settingsKey}`), this.source = n;
230
230
  }
231
231
  get featureConfig() {
232
232
  return this.config.getStore();
@@ -315,7 +315,7 @@ class le extends Pt {
315
315
  key = () => this.getStore().key;
316
316
  off = () => this.getStore().off();
317
317
  }
318
- const M = new Di();
318
+ const B = new Ri();
319
319
  async function* Bi(t, e) {
320
320
  for await (const r of e) {
321
321
  t.response.message = r, t.received_at = Date.now(), t.id = Dn++;
@@ -327,7 +327,7 @@ async function* Bi(t, e) {
327
327
  }
328
328
  }
329
329
  let Dn = 0;
330
- const Mi = () => (t) => async (e) => {
330
+ const qi = () => (t) => async (e) => {
331
331
  const r = {
332
332
  id: Dn++,
333
333
  name: e.url,
@@ -421,7 +421,7 @@ var ne;
421
421
  t.Init = "init", t.Ready = "ready", t.Connecting = "connecting", t.Connected = "connected", t.Disconnected = "disconnected", t.Failed = "failed", t.Reconnect = "reconnect", t.Reconnecting = "reconnecting";
422
422
  })(ne || (ne = {}));
423
423
  const Hr = de("grpc:stream");
424
- class qi {
424
+ class Ui {
425
425
  params;
426
426
  streamCancel;
427
427
  method;
@@ -482,7 +482,7 @@ class qi {
482
482
  for await (const o of i)
483
483
  this.attempt = 0, this.onData(o);
484
484
  } catch (n) {
485
- n instanceof rt && n.code != se.Canceled && this.onStreamError(n);
485
+ n instanceof rt && n.code != ie.Canceled && this.onStreamError(n);
486
486
  }
487
487
  })(), this.updateState(ne.Connected);
488
488
  };
@@ -522,8 +522,8 @@ class qi {
522
522
  */
523
523
  onStreamError = (e) => {
524
524
  if (this.addStateLog(`error => ${e ? JSON.stringify(e) : "undefined"}}`), e !== void 0) {
525
- if (e instanceof rt && e.code !== se.Canceled) {
526
- this.updateState(ne.Failed), this.state.setValue("error", e), this.reconnect();
525
+ if (e instanceof rt && e.code !== ie.Canceled) {
526
+ this.updateState(ne.Failed), this.state.setValue("error", e), e.code === ie.Unknown && e.cause === "missing trailer" && (this.attempt = 0), this.reconnect();
527
527
  return;
528
528
  }
529
529
  this.disconnect();
@@ -531,14 +531,14 @@ class qi {
531
531
  };
532
532
  }
533
533
  const ji = /* @__PURE__ */ new Set([
534
- se.Unknown,
535
- se.Internal,
536
- se.DeadlineExceeded,
537
- se.ResourceExhausted,
538
- se.FailedPrecondition,
539
- se.Unavailable,
540
- se.DataLoss
541
- ]), Wr = de("grpc:retry"), Ui = (t) => async (e) => {
534
+ ie.Unknown,
535
+ ie.Internal,
536
+ ie.DeadlineExceeded,
537
+ ie.ResourceExhausted,
538
+ ie.FailedPrecondition,
539
+ ie.Unavailable,
540
+ ie.DataLoss
541
+ ]), Wr = de("grpc:retry"), xi = (t) => async (e) => {
542
542
  const r = e.contextValues.get(ar.retryAttempts), n = 300, i = e.contextValues.get(ar.retryDelay);
543
543
  if (e.stream || r === 0)
544
544
  return t(e);
@@ -555,15 +555,15 @@ const ji = /* @__PURE__ */ new Set([
555
555
  await new Promise((c) => setTimeout(c, l));
556
556
  }
557
557
  }, ar = {
558
- retryAttempts: jr(10, { description: "Number of attempts to retry" }),
559
- retryDelay: jr(3e4, { description: "Max delay between retries in milliseconds" })
560
- }, xi = () => {
558
+ retryAttempts: Ur(10, { description: "Number of attempts to retry" }),
559
+ retryDelay: Ur(3e4, { description: "Max delay between retries in milliseconds" })
560
+ }, Qi = () => {
561
561
  const t = localStorage.getItem("sl-device-id");
562
562
  if (t)
563
563
  return t;
564
564
  const e = ir();
565
565
  return localStorage.setItem("sl-device-id", e), e;
566
- }, Qi = () => navigator.userAgentData?.platform || navigator.platform;
566
+ }, Gi = () => navigator.userAgentData?.platform || navigator.platform;
567
567
  class Yr {
568
568
  toJsonOptions = {
569
569
  emitDefaultValues: !1,
@@ -584,8 +584,8 @@ class Yr {
584
584
  opts;
585
585
  constructor(e, r) {
586
586
  this.host = e, this.opts = r, this.$headers = new Le(J({
587
- "sl-device-id": xi(),
588
- "sl-device-os": Qi()
587
+ "sl-device-id": Qi(),
588
+ "sl-device-os": Gi()
589
589
  }), "transport:headers"), this.initInterceptors(), this.clients = /* @__PURE__ */ new Map(), this.streamClients = /* @__PURE__ */ new Map(), this.subscriptions = /* @__PURE__ */ new Map();
590
590
  const [n, i, o] = Qr({
591
591
  dedupeTime: r?.dedupeTime,
@@ -609,7 +609,7 @@ class Yr {
609
609
  const i = this.subscriptions.get(r);
610
610
  if (i)
611
611
  return i;
612
- const o = new qi(this.$headers, e, r, n);
612
+ const o = new Ui(this.$headers, e, r, n);
613
613
  return this.subscriptions.set(r, o), o;
614
614
  };
615
615
  removeSubscription = (e) => {
@@ -636,14 +636,14 @@ class Yr {
636
636
  const r = e.typeName;
637
637
  if (this.clients.has(r))
638
638
  return this.clients.get(r);
639
- const n = Ur(e, this.transport);
639
+ const n = jr(e, this.transport);
640
640
  return this.clients.set(r, n), n;
641
641
  };
642
642
  getStreamClient = (e) => {
643
643
  const r = `stream-${e.typeName}`;
644
644
  if (this.clients.has(r))
645
645
  return this.clients.get(r);
646
- const n = Ur(e, this.streamTransport);
646
+ const n = jr(e, this.streamTransport);
647
647
  return this.clients.set(r, n), n;
648
648
  };
649
649
  // create unary client, used for query request
@@ -654,7 +654,7 @@ class Yr {
654
654
  ...Array.isArray(r) ? r : [r]
655
655
  ], a = [e.typeName, o.charAt(0).toLowerCase() + o.slice(1)];
656
656
  return { client: i, createRequestOptions: (l) => {
657
- const c = Ti();
657
+ const c = Oi();
658
658
  for (const f in l) {
659
659
  const p = ar[f];
660
660
  c.set(p, l[f]);
@@ -682,10 +682,10 @@ class Yr {
682
682
  n.header.set(o, i[o]);
683
683
  return r(n);
684
684
  };
685
- this.interceptors.push(e), this.interceptors.push(Mi()), this.opts?.retryable && this.interceptors.push(Ui);
685
+ this.interceptors.push(e), this.interceptors.push(qi()), this.opts?.retryable && this.interceptors.push(xi);
686
686
  };
687
687
  }
688
- const Gi = (t, e) => {
688
+ const Ki = (t, e) => {
689
689
  const { client: r, queryKey: n } = e.createPromiseClient(On, {
690
690
  method: "retrieveEventId",
691
691
  params: [t]
@@ -703,7 +703,7 @@ const Gi = (t, e) => {
703
703
  }
704
704
  }
705
705
  });
706
- }, Ki = (t, e) => {
706
+ }, zi = (t, e) => {
707
707
  const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "getStream", params: [t] });
708
708
  return e.nanoquery.createFetcherStore(n, {
709
709
  fetcher: async (i, o, s) => s ? (await r.getStream({
@@ -711,14 +711,14 @@ const Gi = (t, e) => {
711
711
  // we are sure that id is a string
712
712
  })).data?.attributes : void 0
713
713
  });
714
- }, zi = (t, e) => {
714
+ }, Hi = (t, e) => {
715
715
  const { client: r, queryKey: n } = e.createPromiseClient(On, { method: "summary", params: [t] });
716
716
  return e.nanoquery.createFetcherStore(n, {
717
717
  fetcher: async (i, o, s) => s ? (await r.summary({
718
718
  id: s
719
719
  })).data?.attributes : void 0
720
720
  });
721
- }, Hi = (t, e) => {
721
+ }, Wi = (t, e) => {
722
722
  const { queryKey: r, client: n } = e.createPromiseClient(wr, { method: "me", params: [t] });
723
723
  return e.nanoquery.createFetcherStore(r, {
724
724
  fetcher: async () => {
@@ -726,15 +726,15 @@ const Gi = (t, e) => {
726
726
  return { data: i };
727
727
  }
728
728
  });
729
- }, Wi = (t) => {
729
+ }, Yi = (t) => {
730
730
  const { client: e, createRequestOptions: r } = t.createPromiseClient(wr, { method: "bypassAuth" }), n = r({ retryAttempts: 0 });
731
731
  return ({ userKey: i, schema: o, init: s, inviterKey: a }) => e.bypassAuth({ userKey: i, schema: o, init: s, inviterKey: a }, { contextValues: n });
732
- }, Yi = (t, e) => {
732
+ }, Ji = (t, e) => {
733
733
  const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "get", params: [t] });
734
734
  return e.nanoquery.createFetcherStore(n, {
735
735
  fetcher: async () => (await r.get({})).data?.attributes
736
736
  });
737
- }, Ji = (t, e) => {
737
+ }, Xi = (t, e) => {
738
738
  const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "getOrganization", params: [t] });
739
739
  return e.nanoquery.createFetcherStore(n, {
740
740
  fetcher: async () => {
@@ -745,7 +745,7 @@ const Gi = (t, e) => {
745
745
  } : void 0;
746
746
  }
747
747
  });
748
- }, Xi = (t, e) => {
748
+ }, Zi = (t, e) => {
749
749
  const { client: r, queryKey: n } = e.createPromiseClient(it, {
750
750
  method: "getOrganizationAdvertising",
751
751
  params: [t]
@@ -753,7 +753,7 @@ const Gi = (t, e) => {
753
753
  return e.nanoquery.createFetcherStore(n, {
754
754
  fetcher: async () => (await r.getOrganizationAdvertising({})).data?.attributes
755
755
  });
756
- }, Zi = (t, e, r) => {
756
+ }, eo = (t, e, r) => {
757
757
  t.transport = new Yr(e.host, {
758
758
  dedupeTime: 1e3 * 60 * 5,
759
759
  refetchInterval: 1e3 * 60 * 5,
@@ -768,7 +768,7 @@ var ye;
768
768
  (function(t) {
769
769
  t.SCHEMA = "schema", t.EXTERNAL_TOKEN = "eToken", t.TOKEN = "token";
770
770
  })(ye || (ye = {}));
771
- class je extends We {
771
+ class Ue extends We {
772
772
  constructor() {
773
773
  super("user");
774
774
  }
@@ -795,19 +795,19 @@ var ge;
795
795
  (function(t) {
796
796
  t.DISABLED = "disabled", t.INITIALIZATION = "initialization", t.READY = "ready", t.FAILED = "failed", t.SUSPENDED = "suspended";
797
797
  })(ge || (ge = {}));
798
- const eo = (t) => {
799
- const e = new je(), r = new ee(q(e.getExternalToken()), "userKey"), n = new ee(q(e.getToken()), "userToken"), i = new le(Hi(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, l) => {
798
+ const to = (t) => {
799
+ const e = new Ue(), r = new ee(q(e.getExternalToken()), "userKey"), n = new ee(q(e.getToken()), "userToken"), i = new le(Wi(n.getStore(), t), "user", ({ data: s, error: a, loading: u }, l) => {
800
800
  if (!a)
801
801
  return s?.data?.id ? s.data.id : u === !1 ? void 0 : l;
802
- }), o = new le(Yi(n.getStore(), t), "userSettings");
802
+ }), o = new le(Ji(n.getStore(), t), "userSettings");
803
803
  return {
804
804
  userKey: r,
805
805
  userToken: n,
806
806
  user: i,
807
807
  userSettings: o
808
808
  };
809
- }, to = (t) => {
810
- const e = new ee(q(void 0), "providerStreamId"), r = new le(Gi(e.getStore(), t), "slStreamId", (o) => o?.data), n = new le(Ki(r.getAtomStore(), t), "streamSettings"), i = new le(zi(r.getAtomStore(), t), "streamSettings");
809
+ }, ro = (t) => {
810
+ const e = new ee(q(void 0), "providerStreamId"), r = new le(Ki(e.getStore(), t), "slStreamId", (o) => o?.data), n = new le(zi(r.getAtomStore(), t), "streamSettings"), i = new le(Hi(r.getAtomStore(), t), "streamSettings");
811
811
  return r.getAtomStore().listen((o) => {
812
812
  (o === "" || o === void 0) && (n.getStore().mutate(void 0), i.getStore().mutate(void 0));
813
813
  }), {
@@ -816,8 +816,8 @@ const eo = (t) => {
816
816
  streamSettings: n,
817
817
  streamSummary: i
818
818
  };
819
- }, ro = (t) => {
820
- const e = new ee(q(void 0), "enabled"), r = new ee(q(ge.DISABLED), "status"), n = new le(Ji(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new le(Xi(n.getAtomStore(), t), "organizationAdvertising"), o = eo(t), s = to(t);
819
+ }, no = (t) => {
820
+ const e = new ee(q(void 0), "enabled"), r = new ee(q(ge.DISABLED), "status"), n = new le(Xi(e.getStore(), t), "organizationSettings", (a) => a?.data?.id), i = new le(Zi(n.getAtomStore(), t), "organizationAdvertising"), o = to(t), s = ro(t);
821
821
  return {
822
822
  enabled: e,
823
823
  status: r,
@@ -833,10 +833,10 @@ const eo = (t) => {
833
833
  organizationAdvertising: i
834
834
  };
835
835
  };
836
- class no extends Pt {
836
+ class io extends Pt {
837
837
  stores;
838
838
  constructor(e) {
839
- const r = ro(e), n = Vi(r);
839
+ const r = no(e), n = $i(r);
840
840
  super(n, "core"), this.stores = r;
841
841
  }
842
842
  getValue() {
@@ -857,17 +857,17 @@ class no extends Pt {
857
857
  };
858
858
  unsubscribe = () => this.getStore().off();
859
859
  }
860
- const io = (t, e, r) => {
861
- t.store = new no(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.sdk.streamSummary = () => t.stores.streamSummary.getStore(), t.storeUnsubscribe = () => {
860
+ const oo = (t, e, r) => {
861
+ t.store = new io(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.sdk.streamSummary = () => t.stores.streamSummary.getStore(), t.storeUnsubscribe = () => {
862
862
  t.store.unsubscribe();
863
863
  }, r();
864
- }, oo = (t) => {
864
+ }, so = (t) => {
865
865
  const { client: e } = t.createPromiseClient(_n, { method: "list" });
866
866
  return (r) => e.list(r);
867
867
  }, Vn = (t) => {
868
868
  const { client: e } = t.createPromiseClient(_n, { method: "summary" });
869
869
  return (r) => e.summary(r);
870
- }, so = (t, e) => {
870
+ }, ao = (t, e) => {
871
871
  const { client: r, queryKey: n } = e.createPromiseClient(wr, {
872
872
  method: "getFriends",
873
873
  params: [t]
@@ -883,7 +883,7 @@ const io = (t, e, r) => {
883
883
  }
884
884
  }
885
885
  });
886
- }, ao = (t, e) => {
886
+ }, uo = (t, e) => {
887
887
  const { client: r, queryKey: n } = e.createPromiseClient(te, { method: "get", params: [t] });
888
888
  return e.nanoquery.createFetcherStore(n, {
889
889
  fetcher: async (i, o, s) => (await r.get({
@@ -892,7 +892,7 @@ const io = (t, e, r) => {
892
892
  refetchInterval: 0,
893
893
  dedupeTime: 1e3 * 60 * 60
894
894
  });
895
- }, uo = (t, e) => {
895
+ }, co = (t, e) => {
896
896
  const { client: r, queryKey: n } = e.createPromiseClient(te, { method: "syncQuestion", params: [t] });
897
897
  return e.nanoquery.createFetcherStore(n, {
898
898
  fetcher: async (i, o, s) => {
@@ -910,20 +910,20 @@ const io = (t, e, r) => {
910
910
  // 10 minutes
911
911
  refetchInterval: 0
912
912
  });
913
- }, co = async (t, e) => {
913
+ }, lo = async (t, e) => {
914
914
  const { client: r } = e.createPromiseClient(te, { method: "item", params: [t] });
915
915
  return (await r.item({
916
916
  id: t
917
917
  })).data;
918
- }, lo = (t, e) => {
918
+ }, fo = (t, e) => {
919
919
  const { client: r } = e.createStreamClient(te), n = kt({ eventId: t.get() || "", feedId: "" });
920
920
  return t.subscribe((o = "") => {
921
921
  n.set({ eventId: o, feedId: "" });
922
922
  }), e.addSubscription(r.subscription, n, { name: "feedSubscription" });
923
- }, fo = (t, e) => {
923
+ }, po = (t, e) => {
924
924
  const { client: r } = e.createStreamClient(te);
925
925
  return e.addSubscription(r.questionSubscription, { questionId: t }, { name: "questionSubscription" });
926
- }, po = async (t, e) => {
926
+ }, ho = async (t, e) => {
927
927
  const { client: r } = e.createPromiseClient(te, { method: "questionByUser", params: [t] });
928
928
  return (await r.questionByUser({
929
929
  questionId: t
@@ -946,7 +946,7 @@ const io = (t, e, r) => {
946
946
  return;
947
947
  const { options: i, notification: o, ...s } = n.data.attributes, a = i?.options.case === "promotion" ? i?.options.value : void 0;
948
948
  return { id: s.id, question: s, promotion: a, notification: o };
949
- }, ho = (t, e, r) => {
949
+ }, yo = (t, e, r) => {
950
950
  const { client: n, queryKey: i } = r.createPromiseClient(te, {
951
951
  method: "list",
952
952
  params: [t, e]
@@ -962,7 +962,7 @@ const io = (t, e, r) => {
962
962
  dedupeTime: 0,
963
963
  refetchInterval: 0
964
964
  });
965
- }, yo = (t, e) => {
965
+ }, mo = (t, e) => {
966
966
  const { client: r, queryKey: n } = e.createPromiseClient(te, {
967
967
  method: "list",
968
968
  params: [t]
@@ -988,7 +988,7 @@ const io = (t, e, r) => {
988
988
  dedupeTime: 0,
989
989
  refetchInterval: 0
990
990
  });
991
- }, mo = (t, e, r) => {
991
+ }, go = (t, e, r) => {
992
992
  const n = qr([e, r], () => {
993
993
  const a = e.get();
994
994
  if (!a)
@@ -1024,7 +1024,7 @@ var wt;
1024
1024
  (function(t) {
1025
1025
  t.SHOWED = "showed";
1026
1026
  })(wt || (wt = {}));
1027
- class go extends We {
1027
+ class bo extends We {
1028
1028
  constructor() {
1029
1029
  super("advertisement");
1030
1030
  }
@@ -1033,7 +1033,7 @@ class go extends We {
1033
1033
  };
1034
1034
  isViewed = (e) => this.read(wt.SHOWED, e);
1035
1035
  }
1036
- const bo = (t) => {
1036
+ const vo = (t) => {
1037
1037
  const e = t.data?.attributes?.question;
1038
1038
  if ((t.data?.attributes?.feedItem?.type === "promotion" ? t.data.attributes.feedItem : void 0) === void 0 || !e)
1039
1039
  return;
@@ -1044,7 +1044,7 @@ const bo = (t) => {
1044
1044
  notification: i,
1045
1045
  promotion: s
1046
1046
  };
1047
- }, dt = (t) => t.startsWith("http://") || t.startsWith("https://") ? new URL(t).toString() : t, vo = ({ gamOptions: t, gamBaseUrl: e }) => {
1047
+ }, dt = (t) => t.startsWith("http://") || t.startsWith("https://") ? new URL(t).toString() : t, So = ({ gamOptions: t, gamBaseUrl: e }) => {
1048
1048
  const r = `${e}?`, n = [];
1049
1049
  for (const i in t) {
1050
1050
  const o = i.replace(/([a-zA-Z])(?=[A-Z])/g, "$1_").toLowerCase(), s = t[i];
@@ -1059,13 +1059,13 @@ const bo = (t) => {
1059
1059
  }
1060
1060
  }
1061
1061
  return r + n.join("&");
1062
- }, $e = (t) => (t?.promotion?.type === W.INGAME_IAB11_LBAR || t?.promotion?.type === W.INGAME_IAB21_LBAR) && !!t.promotion.additionalBanner?.imageUrl, So = (t, e, r) => {
1062
+ }, $e = (t) => (t?.promotion?.type === W.INGAME_IAB11_LBAR || t?.promotion?.type === W.INGAME_IAB21_LBAR) && !!t.promotion.additionalBanner?.imageUrl, wo = (t, e, r) => {
1063
1063
  let n = !1;
1064
- const i = r.transport, o = de("advertisement"), s = new go(), a = J({}), u = yo(t, i), l = (b) => {
1064
+ const i = r.transport, o = de("advertisement"), s = new bo(), a = J({}), u = mo(t, i), l = (b) => {
1065
1065
  if (b?.fromNotification) {
1066
1066
  a.setKey("hasNotification", !1);
1067
1067
  const g = a.get(), S = g.data?.question.id, F = g.data?.promotion?.type;
1068
- S && (M.emit("advertisement", {
1068
+ S && (B.emit("advertisement", {
1069
1069
  action: "opened",
1070
1070
  payload: {
1071
1071
  id: S,
@@ -1073,7 +1073,7 @@ const bo = (t) => {
1073
1073
  hasBanner: $e(g.data),
1074
1074
  openedFrom: "notification"
1075
1075
  }
1076
- }), M.emit("advertisement", {
1076
+ }), B.emit("advertisement", {
1077
1077
  action: "notification-opened",
1078
1078
  payload: {
1079
1079
  id: S,
@@ -1084,7 +1084,7 @@ const bo = (t) => {
1084
1084
  }
1085
1085
  }, c = () => {
1086
1086
  const b = a.get(), g = b.data?.question.id, S = b.data?.promotion?.type, F = a.get()?.isOpened;
1087
- g && !F && (o.debug({ id: g }, "markAsViewed: %o"), s.setShowed(g), a.setKey("isOpened", !0), M.emit("advertisement", {
1087
+ g && !F && (o.debug({ id: g }, "markAsViewed: %o"), s.setShowed(g), a.setKey("isOpened", !0), B.emit("advertisement", {
1088
1088
  action: "viewed",
1089
1089
  payload: {
1090
1090
  id: g,
@@ -1118,10 +1118,10 @@ const bo = (t) => {
1118
1118
  a.subscribe((b, g) => {
1119
1119
  if (!(b.data?.id === g?.data?.id && b.isPaused !== g?.isPaused)) {
1120
1120
  if (b.data?.promotion?.type === W.EXTERNAL_AD && !b?.externalAd && b.data.promotion.adCampaigns?.gamOptions && b.data.promotion.adCampaigns?.gamBaseUrl) {
1121
- const S = vo(b.data.promotion.adCampaigns);
1121
+ const S = So(b.data.promotion.adCampaigns);
1122
1122
  a.setKey("externalAd", { type: "gam", url: S });
1123
1123
  }
1124
- b.data?.promotion && !b.isOpened && (M.emit("advertisement", {
1124
+ b.data?.promotion && !b.isOpened && (B.emit("advertisement", {
1125
1125
  action: "received",
1126
1126
  payload: {
1127
1127
  id: b.data.question.id,
@@ -1131,7 +1131,7 @@ const bo = (t) => {
1131
1131
  isViewed: !!s.isViewed(b.data.question.id)
1132
1132
  },
1133
1133
  skipAnalytics: b.data.question.id === g?.data?.question.id
1134
- }), b.data.question.id !== g?.data?.question.id && !s.isViewed(b.data.question.id) && M.emit("advertisement", {
1134
+ }), b.data.question.id !== g?.data?.question.id && !s.isViewed(b.data.question.id) && B.emit("advertisement", {
1135
1135
  action: "notification-received",
1136
1136
  payload: {
1137
1137
  id: b.data.question.id,
@@ -1140,7 +1140,7 @@ const bo = (t) => {
1140
1140
  hasBanner: $e(b.data),
1141
1141
  isViewed: !1
1142
1142
  }
1143
- })), !b?.data && g?.data && M.emit("advertisement", {
1143
+ })), !b?.data && g?.data && B.emit("advertisement", {
1144
1144
  action: "closed",
1145
1145
  payload: {
1146
1146
  id: g.data.question.id,
@@ -1161,7 +1161,7 @@ const bo = (t) => {
1161
1161
  n || (n = !0, u.subscribe((b, g) => {
1162
1162
  b.data && (!g?.data || b.data.id !== g.data.id) && f(b.data.question.id, b.data);
1163
1163
  }), e.addListener("promotion", (b) => {
1164
- const g = bo(b);
1164
+ const g = vo(b);
1165
1165
  if (g) {
1166
1166
  if (g.question.status === Z.RESOLVED) {
1167
1167
  p(g.question.id), o.debug({ promotion: g }, "resolved: %o");
@@ -1180,7 +1180,7 @@ var Ce;
1180
1180
  (function(t) {
1181
1181
  t.ALLOWED = "allowed", t.DISALLOWED = "disallowed";
1182
1182
  })(Ce || (Ce = {}));
1183
- class wo {
1183
+ class Ao {
1184
1184
  /** sl event id */
1185
1185
  slStreamId;
1186
1186
  /** organization id */
@@ -1213,11 +1213,11 @@ class wo {
1213
1213
  transport;
1214
1214
  cancels = /* @__PURE__ */ new Set();
1215
1215
  constructor(e) {
1216
- this.transport = e.transport, this.log = de("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new ee(q(void 0), "moderationId").getStore(), this.interactiveAllowed = new ee(q(Ce.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new ee(q(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new le(ao(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new le(ho(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.activeQuestionId = uo(this.slStreamId, e.transport), this.openedQuestion = mo(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((r) => {
1217
- this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = fo(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", (n) => {
1216
+ this.transport = e.transport, this.log = de("gamification-background"), this.slStreamId = e.stores.slStreamId.getAtomStore(), this.organizationId = e.stores.organizationSettings.getAtomStore(), this.userId = e.stores.user.getAtomStore(), this.moderationId = new ee(q(void 0), "moderationId").getStore(), this.interactiveAllowed = new ee(q(Ce.DISALLOWED), "interactiveAllowed").getStore(), this.openedQuestionId = new ee(q(void 0), "openedQuestionId").getStore(), this.notifications = e.notifications, this.moderation = new le(uo(this.slStreamId, e.transport), "gamification:moderation"), this.feedList = new le(yo(this.slStreamId, this.interactiveAllowed, e.transport), "gamification:feedList"), this.activeQuestionId = co(this.slStreamId, e.transport), this.openedQuestion = go(e.transport, this.openedQuestionId, this.feedList.getStore()), this.cancels.add(this.openedQuestionId.listen((r) => {
1217
+ this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription = po(r.questionId, e.transport), this.questionSubscription.addListener("feed-subscription-opened-question", (n) => {
1218
1218
  this.openedQuestion.updateExtendedQuestion(n.data?.attributes?.question);
1219
1219
  }), this.questionSubscription.connect()) : (this.log.info("cleanup on close question"), this.questionSubscription !== void 0 && (e.transport.removeSubscription(this.questionSubscription), this.questionSubscription = void 0));
1220
- })), this.feedSubscription = lo(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
1220
+ })), this.feedSubscription = fo(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
1221
1221
  const n = this.activeQuestionId.get().data?.question?.id, i = r.data?.attributes?.question;
1222
1222
  if (!(!i || i.type === _.PROMOTION)) {
1223
1223
  if (i.status === Z.RESOLVED) {
@@ -1260,7 +1260,7 @@ class wo {
1260
1260
  this.activeQuestionId.off();
1261
1261
  for (const r of this.cancels)
1262
1262
  r(), this.cancels.delete(r);
1263
- }), this.advertisement = So(this.slStreamId, this.feedSubscription, e);
1263
+ }), this.advertisement = wo(this.slStreamId, this.feedSubscription, e);
1264
1264
  }
1265
1265
  /**
1266
1266
  * Get id for notifications and link with current session
@@ -1290,7 +1290,7 @@ class wo {
1290
1290
  this.openedQuestionId.set(void 0), e && this.notifications.markAsViewed(this.getCurrentSessionId({ prefix: "notification", entity: e }));
1291
1291
  };
1292
1292
  }
1293
- class Ao {
1293
+ class Eo {
1294
1294
  notificationsList;
1295
1295
  store;
1296
1296
  timeouts;
@@ -1343,7 +1343,7 @@ class Ao {
1343
1343
  this.logger.debug({ notificationId: e }, "active queue tick skipped, notification not exist");
1344
1344
  return;
1345
1345
  }
1346
- M.emit("notification", {
1346
+ B.emit("notification", {
1347
1347
  action: "received",
1348
1348
  payload: {
1349
1349
  questionId: r.data.questionId,
@@ -1368,7 +1368,7 @@ class Ao {
1368
1368
  const s = new Map(this.notificationsList.get());
1369
1369
  s.delete(e), this.notificationsList.set(s);
1370
1370
  const a = this.timeouts.get(e);
1371
- a !== void 0 && (clearTimeout(a), this.timeouts.delete(e)), this.logger.debug({ notificationId: e }, "notification hidden"), i.hiding && M.emit("notification", {
1371
+ a !== void 0 && (clearTimeout(a), this.timeouts.delete(e)), this.logger.debug({ notificationId: e }, "notification hidden"), i.hiding && B.emit("notification", {
1372
1372
  action: "closed",
1373
1373
  payload: {
1374
1374
  questionId: i.data.questionId,
@@ -1388,7 +1388,7 @@ var At;
1388
1388
  (function(t) {
1389
1389
  t.OPENED = "opened";
1390
1390
  })(At || (At = {}));
1391
- class Eo extends We {
1391
+ class Io extends We {
1392
1392
  constructor() {
1393
1393
  super("notification");
1394
1394
  }
@@ -1404,11 +1404,11 @@ var Ee;
1404
1404
  (function(t) {
1405
1405
  t[t.ONBOARDING = 1] = "ONBOARDING", t[t.QUESTION = 2] = "QUESTION", t[t.QUESTION_RESOLVED = 3] = "QUESTION_RESOLVED";
1406
1406
  })(Ee || (Ee = {}));
1407
- class Io {
1407
+ class To {
1408
1408
  queue;
1409
1409
  storage;
1410
1410
  constructor(e = {}) {
1411
- this.storage = new Eo(), this.queue = new Ao({ concurrency: 1, animationDelay: 1600, ...e });
1411
+ this.storage = new Io(), this.queue = new Eo({ concurrency: 1, animationDelay: 1600, ...e });
1412
1412
  }
1413
1413
  isViewed = (e) => this.storage.isOpened(e);
1414
1414
  add = (e) => {
@@ -1416,7 +1416,7 @@ class Io {
1416
1416
  if (e.data && e.emitEvent) {
1417
1417
  const n = e.action;
1418
1418
  e.action = (...i) => {
1419
- n && n(...i), M.emit("notification", {
1419
+ n && n(...i), B.emit("notification", {
1420
1420
  action: "opened",
1421
1421
  payload: {
1422
1422
  questionId: e.data.questionId,
@@ -1445,8 +1445,8 @@ class Io {
1445
1445
  this.storage.setOpened(e);
1446
1446
  };
1447
1447
  }
1448
- const To = (t, e, r) => {
1449
- t.notifications = new Io(void 0), t.addNotification = t.notifications.add, t.sdk.getNotificationsStore = () => t.notifications.getQueueStore(), t.sdk.getActiveNotification = () => t.notifications.getActiveNotification(), t.sdk.onMount({ name: "notifications" }, () => () => {
1448
+ const Oo = (t, e, r) => {
1449
+ t.notifications = new To(void 0), t.addNotification = t.notifications.add, t.sdk.getNotificationsStore = () => t.notifications.getQueueStore(), t.sdk.getActiveNotification = () => t.notifications.getActiveNotification(), t.sdk.onMount({ name: "notifications" }, () => () => {
1450
1450
  t.notifications.queue.drain();
1451
1451
  }), r();
1452
1452
  };
@@ -1454,22 +1454,22 @@ var nt;
1454
1454
  (function(t) {
1455
1455
  t.UNKNOWN = "unknown", t.ALREADY_VOTED = "already_voted";
1456
1456
  })(nt || (nt = {}));
1457
- const Oo = async (t, e) => {
1457
+ const _o = async (t, e) => {
1458
1458
  const { client: r, createRequestOptions: n } = t.createPromiseClient(te, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
1459
1459
  try {
1460
1460
  return await r.submitAnswer({ data: e }, { contextValues: i });
1461
1461
  } catch (o) {
1462
- throw rt.from(o)?.code === se.AlreadyExists ? new Error(nt.ALREADY_VOTED) : new Error(nt.UNKNOWN);
1462
+ throw rt.from(o)?.code === ie.AlreadyExists ? new Error(nt.ALREADY_VOTED) : new Error(nt.UNKNOWN);
1463
1463
  }
1464
- }, _o = (t, e) => {
1464
+ }, Lo = (t, e) => {
1465
1465
  const { client: r, createRequestOptions: n } = t.createPromiseClient(te, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
1466
1466
  return r.submitInplay({ data: { eventId: +e } }, { contextValues: i });
1467
1467
  };
1468
- var Ue;
1468
+ var je;
1469
1469
  (function(t) {
1470
1470
  t.ONBOARDING = "onboarding", t.ONBOARDING_IO = "onboarding_io";
1471
- })(Ue || (Ue = {}));
1472
- class Lo extends We {
1471
+ })(je || (je = {}));
1472
+ class Co extends We {
1473
1473
  constructor() {
1474
1474
  super("gamification-session", window.sessionStorage);
1475
1475
  }
@@ -1478,31 +1478,31 @@ class Lo extends We {
1478
1478
  };
1479
1479
  readValue = (e) => this.read(...e);
1480
1480
  }
1481
- class Bn extends We {
1481
+ class Mn extends We {
1482
1482
  sessionStorage;
1483
1483
  constructor() {
1484
- super("gamification"), this.sessionStorage = new Lo();
1484
+ super("gamification"), this.sessionStorage = new Co();
1485
1485
  }
1486
1486
  saveOnboardingStatus = ({ userId: e, eventId: r, organizationId: n }, i) => {
1487
- this.write(Ue.ONBOARDING, n, e, r, i);
1487
+ this.write(je.ONBOARDING, n, e, r, i);
1488
1488
  };
1489
- getOnboardingStatus = ({ userId: e, eventId: r, organizationId: n }) => this.read(Ue.ONBOARDING, n, e, r);
1489
+ getOnboardingStatus = ({ userId: e, eventId: r, organizationId: n }) => this.read(je.ONBOARDING, n, e, r);
1490
1490
  setOnboardingInstantOpen = ({ userId: e, eventId: r, organizationId: n }) => {
1491
- this.sessionStorage.writeValue([Ue.ONBOARDING_IO, n, e, r], "1");
1491
+ this.sessionStorage.writeValue([je.ONBOARDING_IO, n, e, r], "1");
1492
1492
  };
1493
- getOnboardingInstantOpen = ({ userId: e, eventId: r, organizationId: n }) => this.sessionStorage.readValue([Ue.ONBOARDING_IO, n, e, r]);
1493
+ getOnboardingInstantOpen = ({ userId: e, eventId: r, organizationId: n }) => this.sessionStorage.readValue([je.ONBOARDING_IO, n, e, r]);
1494
1494
  }
1495
- const Co = {
1495
+ const ko = {
1496
1496
  pageSize: 10
1497
- }, ko = (t, e, r, n, i) => {
1497
+ }, Po = (t, e, r, n, i) => {
1498
1498
  let o = 0;
1499
- const s = q({ pageSize: Co.pageSize, page: 0 }), a = J({
1499
+ const s = q({ pageSize: ko.pageSize, page: 0 }), a = J({
1500
1500
  data: [],
1501
1501
  key: Date.now(),
1502
1502
  hasMore: !0,
1503
1503
  loading: void 0,
1504
1504
  error: void 0
1505
- }), u = oo(t), l = async () => {
1505
+ }), u = so(t), l = async () => {
1506
1506
  const p = e.get(), v = n.getStore().get().data?.map((w) => w.slId) || [];
1507
1507
  if (p && v?.length) {
1508
1508
  const w = r.get();
@@ -1534,7 +1534,7 @@ const Co = {
1534
1534
  };
1535
1535
  }), { $store: a, fetchMore: f, invalidate: c };
1536
1536
  };
1537
- class Po extends We {
1537
+ class No extends We {
1538
1538
  get = this.read;
1539
1539
  set = this.write;
1540
1540
  del = this.remove;
@@ -1542,12 +1542,12 @@ class Po extends We {
1542
1542
  super("deep-link-context", window.sessionStorage);
1543
1543
  }
1544
1544
  }
1545
- const Jr = "sldl", Nt = "sldl_uid", Mn = "sldl_eid", qn = "sldl_e_eid", No = /* @__PURE__ */ new Set([Nt, Mn, qn]), Xr = (t) => {
1545
+ const Jr = "sldl", Nt = "sldl_uid", Bn = "sldl_eid", qn = "sldl_e_eid", Fo = /* @__PURE__ */ new Set([Nt, Bn, qn]), Xr = (t) => {
1546
1546
  const e = {}, r = {};
1547
1547
  for (const [n, i] of t)
1548
- No.has(n) ? e[n] = i : r[n] = i;
1548
+ Fo.has(n) ? e[n] = i : r[n] = i;
1549
1549
  return { result: e, remain: r };
1550
- }, Fo = ({ hash: t, search: e }) => {
1550
+ }, Do = ({ hash: t, search: e }) => {
1551
1551
  if (t && t.includes(Jr)) {
1552
1552
  const r = new URLSearchParams(t.substr(1));
1553
1553
  return { hash: Xr(r) };
@@ -1564,10 +1564,10 @@ const Jr = "sldl", Nt = "sldl_uid", Mn = "sldl_eid", qn = "sldl_e_eid", No = /*
1564
1564
  trace: (...t) => {
1565
1565
  Zr.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1566
1566
  }
1567
- }, Do = (t, e) => {
1567
+ }, Ro = (t, e) => {
1568
1568
  const { hash: r, search: n } = window.location;
1569
1569
  if (ce.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
1570
- const i = Fo({ hash: r, search: n });
1570
+ const i = Do({ hash: r, search: n });
1571
1571
  if (ce.debug(i, "parse deep link result"), i) {
1572
1572
  const { hash: o, search: s } = i, { result: a, remain: u } = o || s;
1573
1573
  if (Object.keys(a).length !== 0) {
@@ -1586,8 +1586,8 @@ const Jr = "sldl", Nt = "sldl_uid", Mn = "sldl_eid", qn = "sldl_e_eid", No = /*
1586
1586
  }
1587
1587
  }
1588
1588
  t.setValue("parsed", !0);
1589
- }, Ro = (t, e, r) => {
1590
- const n = new Po(), i = n.get("sl-deep-link-store");
1589
+ }, Vo = (t, e, r) => {
1590
+ const n = new No(), i = n.get("sl-deep-link-store");
1591
1591
  let o = {};
1592
1592
  if (i)
1593
1593
  try {
@@ -1625,15 +1625,15 @@ const Jr = "sldl", Nt = "sldl_uid", Mn = "sldl_eid", qn = "sldl_e_eid", No = /*
1625
1625
  console.error(l);
1626
1626
  }
1627
1627
  };
1628
- Do(t.deepLink.$store, s), r();
1629
- }, Vo = de("bypass");
1630
- class $o extends Ri {
1628
+ Ro(t.deepLink.$store, s), r();
1629
+ }, $o = de("bypass");
1630
+ class Mo extends Vi {
1631
1631
  $coreStore;
1632
1632
  deepLink;
1633
1633
  transport;
1634
1634
  bypassLogin;
1635
1635
  constructor(e, r, n) {
1636
- super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin = Wi(this.transport), this.connect();
1636
+ super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin = Yi(this.transport), this.connect();
1637
1637
  }
1638
1638
  me = async () => (this.$coreStore.getValues().user.invalidate(), (await this.$coreStore.getValues().user.getValue())?.data);
1639
1639
  /**
@@ -1645,7 +1645,7 @@ class $o extends Ri {
1645
1645
  login = async (e, r) => {
1646
1646
  this.$coreStore.getValues().userKey.setValue(r);
1647
1647
  const { used: n, data: i } = this.deepLink.getDeepLinkData(), o = n ? "" : i?.[Nt];
1648
- Vo.debug({ inviterKey: o }, "login with inviterKey");
1648
+ $o.debug({ inviterKey: o }, "login with inviterKey");
1649
1649
  const s = await this.bypassLogin({
1650
1650
  schema: e,
1651
1651
  userKey: r,
@@ -1661,14 +1661,14 @@ class $o extends Ri {
1661
1661
  * Logout user. Clears the all user data from the store.
1662
1662
  */
1663
1663
  logout = () => {
1664
- this.$coreStore.getValues().user.setValue(), this.$coreStore.getValues().userKey.setValue(), this.$coreStore.getValues().userToken.setValue(), this.transport.setAuth("", ""), new je().clear();
1664
+ this.$coreStore.getValues().user.setValue(), this.$coreStore.getValues().userKey.setValue(), this.$coreStore.getValues().userToken.setValue(), this.transport.setAuth("", ""), new Ue().clear();
1665
1665
  };
1666
1666
  /**
1667
1667
  * Soft logout, only clears the StreamLayer user data from the store.
1668
1668
  * Does not clear the external token. And automatically tries to re-login by external token.
1669
1669
  */
1670
1670
  softLogout = () => {
1671
- const e = new je();
1671
+ const e = new Ue();
1672
1672
  this.transport.setAuth("", ""), e.setToken(""), this.reLogin();
1673
1673
  };
1674
1674
  /**
@@ -1679,7 +1679,7 @@ class $o extends Ri {
1679
1679
  * - If no one of the above is true, then logout.
1680
1680
  */
1681
1681
  reLogin = () => {
1682
- const e = new je(), r = e.getToken(), n = e.getExternalToken();
1682
+ const e = new Ue(), r = e.getToken(), n = e.getExternalToken();
1683
1683
  if (this.$coreStore.getValues().userKey.setValue(n), r)
1684
1684
  return this.saveUser(r, ""), this.me().then((i) => {
1685
1685
  if (i?.id) {
@@ -1698,7 +1698,7 @@ class $o extends Ri {
1698
1698
  * Write token to the Transport and UserStore
1699
1699
  */
1700
1700
  saveUser = (e, r) => {
1701
- this.transport.setAuth(e, r), this.$coreStore.getValues().userToken.setValue(e), new je().setToken(e);
1701
+ this.transport.setAuth(e, r), this.$coreStore.getValues().userToken.setValue(e), new Ue().setToken(e);
1702
1702
  };
1703
1703
  /**
1704
1704
  * Add interceptor to the Transport to handle 401 and 403 errors.
@@ -1714,8 +1714,8 @@ class $o extends Ri {
1714
1714
  });
1715
1715
  };
1716
1716
  }
1717
- const Xe = new je(), Bo = (t, e, r) => {
1718
- t.auth = new $o(t.store, t.transport, t.deepLink), t.stores.status.listen((n) => {
1717
+ const Xe = new Ue(), Bo = (t, e, r) => {
1718
+ t.auth = new Mo(t.store, t.transport, t.deepLink), t.stores.status.listen((n) => {
1719
1719
  n === ge.READY && t.auth.reLogin();
1720
1720
  }), t.sdk.userId = t.stores.user.getAtomStore, t.sdk.authorizationBypass = async (n, i) => {
1721
1721
  if (!(Xe.getSchema() === n && Xe.getExternalToken() === i && t.transport.getHeader("authorization")))
@@ -1734,7 +1734,7 @@ const Xe = new je(), Bo = (t, e, r) => {
1734
1734
  trace: (...t) => {
1735
1735
  en.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
1736
1736
  }
1737
- }, Mo = (t, e, r) => {
1737
+ }, qo = (t, e, r) => {
1738
1738
  t.videoPlayer = {
1739
1739
  controllers: /* @__PURE__ */ new Set()
1740
1740
  }, t.sdk.addVideoPlayerController = (n) => {
@@ -1752,7 +1752,7 @@ const Xe = new je(), Bo = (t, e, r) => {
1752
1752
  }
1753
1753
  }
1754
1754
  }, r();
1755
- }, qo = {
1755
+ }, Uo = {
1756
1756
  [_.FACTOID]: "insight",
1757
1757
  [_.POLL]: "poll",
1758
1758
  [_.TRIVIA]: "trivia",
@@ -1785,7 +1785,7 @@ const Xe = new je(), Bo = (t, e, r) => {
1785
1785
  };
1786
1786
  t.onQuestionActivate = ({ questionType: i, ...o }) => {
1787
1787
  if (t.ui.onContentActivate) {
1788
- const s = o.type || i && qo[i] || "question";
1788
+ const s = o.type || i && Uo[i] || "question";
1789
1789
  t.ui.onContentActivate({ ...o, type: s });
1790
1790
  }
1791
1791
  }, t.sdk.onMount({ name: "ui" }, () => {
@@ -1854,14 +1854,14 @@ const Xe = new je(), Bo = (t, e, r) => {
1854
1854
  break;
1855
1855
  }
1856
1856
  }
1857
- }, o = M.listen(i), s = t.activeFeature.subscribe((a) => {
1858
- a ? t.ui.enableApp() : t.ui.disableApp();
1857
+ }, o = B.listen(i), s = t.activeFeature.subscribe((a) => {
1858
+ a ? (t.ui.enableApp(), t.sdk.uiState.set({ app: !0 })) : t.ui.disableApp();
1859
1859
  });
1860
1860
  return () => {
1861
1861
  o(), s();
1862
1862
  };
1863
1863
  }), r();
1864
- }, Uo = (t, e, r) => {
1864
+ }, xo = (t, e, r) => {
1865
1865
  const n = { onMountedFired: !1 }, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
1866
1866
  t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.options = J(e), t.sdk.withAuth = !1, t.sdk.onMount = ({ name: s, clear: a }, u) => {
1867
1867
  if (i.has(s)) {
@@ -1888,7 +1888,7 @@ const Xe = new je(), Bo = (t, e, r) => {
1888
1888
  }, t.sdk.createEventSession = (s) => {
1889
1889
  t.stores.providerStreamId.setValue(s);
1890
1890
  }, r();
1891
- }, xo = (t, e) => {
1891
+ }, Qo = (t, e) => {
1892
1892
  const { client: r, queryKey: n } = t.createPromiseClient(it, {
1893
1893
  method: "generateDeepLink",
1894
1894
  params: e
@@ -1909,20 +1909,20 @@ const Xe = new je(), Bo = (t, e, r) => {
1909
1909
  // 24 hours
1910
1910
  refetchInterval: 0
1911
1911
  });
1912
- }, Qo = (t, { web: e, mobile: r }) => {
1913
- const { client: n } = t.createPromiseClient(Oi, { method: "generate" });
1912
+ }, Go = (t, { web: e, mobile: r }) => {
1913
+ const { client: n } = t.createPromiseClient(_i, { method: "generate" });
1914
1914
  return n.generate({ web: e, mobile: r });
1915
1915
  }, tn = (t, e) => {
1916
1916
  const r = new URLSearchParams(t);
1917
1917
  for (const [n, i] of Object.entries(e))
1918
1918
  r.append(n, i);
1919
1919
  return r.toString();
1920
- }, Go = (t, e, r, n) => {
1920
+ }, Ko = (t, e, r, n) => {
1921
1921
  const i = J({});
1922
- return Sr(i, () => xo(t, [e, r]).subscribe(async ({ data: a, loading: u }) => {
1922
+ return Sr(i, () => Qo(t, [e, r]).subscribe(async ({ data: a, loading: u }) => {
1923
1923
  const l = a === void 0 && u === !1 ? "https://streamlayer.io" : a?.url, c = n.get() || "", f = e.get() || "", p = r.get() || "", v = {
1924
1924
  [Nt]: c,
1925
- [Mn]: f,
1925
+ [Bn]: f,
1926
1926
  [qn]: p
1927
1927
  };
1928
1928
  if (!u && l) {
@@ -1931,7 +1931,7 @@ const Xe = new je(), Bo = (t, e, r) => {
1931
1931
  w && b || b ? w = `?${tn(w, v)}` : b = `#${tn("", v)}`;
1932
1932
  const g = window.location.origin + window.location.pathname + w + b;
1933
1933
  try {
1934
- const S = await Qo(t, { web: g, mobile: l });
1934
+ const S = await Go(t, { web: g, mobile: l });
1935
1935
  i.set({
1936
1936
  data: S.data?.link,
1937
1937
  loading: !1
@@ -1947,11 +1947,11 @@ const Xe = new je(), Bo = (t, e, r) => {
1947
1947
  i.setKey("loading", !0);
1948
1948
  })), { $store: i, fetch };
1949
1949
  };
1950
- var B;
1950
+ var M;
1951
1951
  (function(t) {
1952
1952
  t.Unset = "unset", t.Required = "required", t.Optional = "optional", t.Completed = "completed", t.Disabled = "disabled", t.Unavailable = "unavailable";
1953
- })(B || (B = {}));
1954
- const Ko = (t, e, r, n) => {
1953
+ })(M || (M = {}));
1954
+ const zo = (t, e, r, n) => {
1955
1955
  const { inplayGame: i } = t.featureSettings.get(), o = e.getCurrentSessionId({ prefix: "onboarding" });
1956
1956
  i && r.add({
1957
1957
  type: Ee.ONBOARDING,
@@ -1984,8 +1984,8 @@ const Ko = (t, e, r, n) => {
1984
1984
  userId: s,
1985
1985
  organizationId: e.organizationId.get() || "",
1986
1986
  eventId: e.slStreamId.get() || ""
1987
- }) === B.Completed) {
1988
- t.set(B.Completed);
1987
+ }) === M.Completed) {
1988
+ t.set(M.Completed);
1989
1989
  for (const p of o)
1990
1990
  p();
1991
1991
  return;
@@ -1994,22 +1994,22 @@ const Ko = (t, e, r, n) => {
1994
1994
  if (u === void 0 || l === void 0)
1995
1995
  return;
1996
1996
  const c = u?.options?.onboardingEnabled, f = l?.titleCard?.optIn;
1997
- c ? f ? t.set(B.Required) : t.set(B.Optional) : (f ? t.set(B.Unavailable) : t.set(B.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), { markAsViewed: !1 }));
1997
+ c ? f ? t.set(M.Required) : t.set(M.Optional) : (f ? t.set(M.Unavailable) : t.set(M.Disabled), n.close(e.getCurrentSessionId({ prefix: "onboarding" }), { markAsViewed: !1 }));
1998
1998
  } catch (s) {
1999
1999
  console.error(s);
2000
2000
  }
2001
- }, zo = (t, e, r, n) => {
2001
+ }, Ho = (t, e, r, n) => {
2002
2002
  let i = !1;
2003
- const o = new Bn(), s = q(B.Unset);
2003
+ const o = new Mn(), s = q(M.Unset);
2004
2004
  s.subscribe((l) => {
2005
- l !== B.Unset && (l === B.Optional || l === B.Required ? i === !1 && (Ko(t, e, n, o), i = !0) : t.onboardingProcessed.set(!0), l === B.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
2005
+ l !== M.Unset && (l === M.Optional || l === M.Required ? i === !1 && (zo(t, e, n, o), i = !0) : t.onboardingProcessed.set(!0), l === M.Completed && e.activeQuestionId.invalidate(), o.setOnboardingInstantOpen({
2006
2006
  userId: e.userId.get() || "",
2007
2007
  organizationId: e.organizationId.get() || "",
2008
2008
  eventId: e.slStreamId.get() || ""
2009
2009
  }));
2010
2010
  });
2011
2011
  const a = [];
2012
- return pt(s, e, t, n, o, a), s.get() !== B.Completed && (a.push(e.userId.listen((l) => {
2012
+ return pt(s, e, t, n, o, a), s.get() !== M.Completed && (a.push(e.userId.listen((l) => {
2013
2013
  l && pt(s, e, t, n, o, a);
2014
2014
  })), a.push(e.moderation.listen((l) => {
2015
2015
  l.data && pt(s, e, t, n, o, a);
@@ -2018,11 +2018,11 @@ const Ko = (t, e, r, n) => {
2018
2018
  }))), { $store: s, submitInplay: async () => {
2019
2019
  const l = e.slStreamId.get();
2020
2020
  if (l) {
2021
- await _o(r, l), s.set(B.Completed), o.saveOnboardingStatus({
2021
+ await Lo(r, l), s.set(M.Completed), o.saveOnboardingStatus({
2022
2022
  organizationId: e.organizationId.get() || "",
2023
2023
  userId: e.userId.get() || "",
2024
2024
  eventId: l
2025
- }, B.Completed), M.emit("poll", {
2025
+ }, M.Completed), B.emit("poll", {
2026
2026
  action: "onboardingPassed",
2027
2027
  payload: {}
2028
2028
  }), t.openFeature();
@@ -2030,7 +2030,7 @@ const Ko = (t, e, r, n) => {
2030
2030
  n.close(c);
2031
2031
  }
2032
2032
  } };
2033
- }, Ho = (t, e, r, n) => {
2033
+ }, Wo = (t, e, r, n) => {
2034
2034
  const i = J(void 0), o = Vn(n), s = async () => {
2035
2035
  const u = t.get(), l = e.get(), c = r.getStore().get().data?.map((v) => v.slId);
2036
2036
  if (!c)
@@ -2050,15 +2050,15 @@ const Ko = (t, e, r, n) => {
2050
2050
  u(), l(), c();
2051
2051
  };
2052
2052
  }), { $store: i, invalidate: a };
2053
- }, Wo = async (t, e, r, n, i) => {
2053
+ }, Yo = async (t, e, r, n, i) => {
2054
2054
  const o = Vn(i), s = t.get(), a = e.get(), u = r.getStore().get().data?.map((p) => p.slId) || [], l = {
2055
2055
  eventId: s,
2056
2056
  userId: n,
2057
2057
  usersIds: [...u, a]
2058
2058
  };
2059
2059
  return (await o(l)).data?.attributes?.summary;
2060
- }, Yo = /* @__PURE__ */ new Set([_.POLL, _.PREDICTION, _.TRIVIA]);
2061
- class Jo extends Fn {
2060
+ }, Jo = /* @__PURE__ */ new Set([_.POLL, _.PREDICTION, _.TRIVIA]);
2061
+ class Xo extends Fn {
2062
2062
  /** user statistics (leaderboard panel) */
2063
2063
  userSummary;
2064
2064
  /** feed list (pick history) */
@@ -2096,10 +2096,10 @@ class Jo extends Fn {
2096
2096
  cancels = /* @__PURE__ */ new Set();
2097
2097
  onQuestionActivate;
2098
2098
  constructor(e, r, n) {
2099
- super(e, r), this.background = new wo(n), this.advertisement = this.background.advertisement, this.onQuestionActivate = n.onQuestionActivate, this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = new Bn(), this.feedList = this.background.feedList, this.friends = new le(so(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = q(void 0), this.onboardingProcessed = q(!n.sdk.withAuth), this.leaderboardId = new ee(q(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = zo(this, this.background, n.transport, n.notifications), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = (i = !0) => n.sdk.closeFeature(i), this.openFeature = () => n.sdk.openFeature(R.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = Go(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 = ko(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.cancels.add(this.userSummary.$store.listen((i, o) => {
2099
+ super(e, r), this.background = new Ao(n), this.advertisement = this.background.advertisement, this.onQuestionActivate = n.onQuestionActivate, this.feedSubscription = this.background.feedSubscription, this.activeQuestionId = this.background.activeQuestionId, this.openedQuestionId = this.background.openedQuestionId, this.storage = new Mn(), this.feedList = this.background.feedList, this.friends = new le(ao(this.background.userId, n.transport), "gamification:friends"), this.currentUserId = this.background.userId, this.openedUser = q(void 0), this.onboardingProcessed = q(!n.sdk.withAuth), this.leaderboardId = new ee(q(this.settings.getValue("pinnedLeaderboardId")), "pinnedLeaderboardId").getStore(), this.onboardingStatus = Ho(this, this.background, n.transport, n.notifications), this.notifications = n.notifications, this.transport = n.transport, this.closeFeature = (i = !0) => n.sdk.closeFeature(i), this.openFeature = () => n.sdk.openFeature(R.GAMES), this.openedQuestion = this.background.openedQuestion, this.deepLink = Ko(this.transport, this.background.slStreamId, n.stores.providerStreamId.getStore(), this.background.userId), this.userSummary = Wo(this.background.slStreamId, this.background.userId, this.friends, this.transport), this.leaderboardList = Po(this.transport, this.background.slStreamId, this.background.userId, this.friends), this.connect(), this.cancels.add(this.userSummary.$store.listen((i, o) => {
2100
2100
  o?.summary && i?.summary && this.leaderboardList.invalidate();
2101
2101
  })), this.cancels.add(this.onboardingStatus.$store.listen(this.checkInteractiveFlag)), this.cancels.add(this.background.moderation.getStore().listen(this.checkInteractiveFlag)), this.cancels.add(this.settings.subscribe(this.checkInteractiveFlag)), this.cancels.add(this.onboardingStatus.$store.listen((i, o) => {
2102
- (o === void 0 || i !== B.Unset) && this.background.activeQuestionId.invalidate();
2102
+ (o === void 0 || i !== M.Unset) && this.background.activeQuestionId.invalidate();
2103
2103
  })), this.background.activeQuestionId.listen(this.showInApp), this.friendsTabEnabled = q(!1), this.cancels.add(n.sdk.options.subscribe((i) => {
2104
2104
  i.friendsTab === "disabled" ? this.friendsTabEnabled.set(!1) : i.friendsTab === "enabled" && this.friendsTabEnabled.set(!0);
2105
2105
  })), this.cancels.add(this.settings.subscribe((i) => {
@@ -2113,7 +2113,7 @@ class Jo extends Fn {
2113
2113
  return this.background.interactiveAllowed.get() === Ce.ALLOWED;
2114
2114
  }
2115
2115
  checkInteractiveFlag = () => {
2116
- const e = this.onboardingStatus.$store.get(), r = this.background.moderation.getStore().value?.data?.options?.onboardingEnabled, n = this.settings.getValues().inplayGame?.titleCard?.optIn, i = e === B.Completed, o = !r || i || n !== !0;
2116
+ const e = this.onboardingStatus.$store.get(), r = this.background.moderation.getStore().value?.data?.options?.onboardingEnabled, n = this.settings.getValues().inplayGame?.titleCard?.optIn, i = e === M.Completed, o = !r || i || n !== !0;
2117
2117
  this.background.interactiveAllowed.set(o ? Ce.ALLOWED : Ce.DISALLOWED);
2118
2118
  };
2119
2119
  connect = () => {
@@ -2135,7 +2135,7 @@ class Jo extends Fn {
2135
2135
  });
2136
2136
  await v.get().promise;
2137
2137
  let b = v.get().data;
2138
- b || (b = await po(s, this.transport)), w(), window.requestAnimationFrame(() => {
2138
+ b || (b = await ho(s, this.transport)), w(), window.requestAnimationFrame(() => {
2139
2139
  v.invalidate();
2140
2140
  }), p || (p = b?.answers.find(({ youVoted: K }) => K)?.id);
2141
2141
  const g = a.find(({ correct: K }) => K), S = p ? a.find(({ id: K }) => K === p) : void 0, F = !!S?.correct;
@@ -2220,7 +2220,7 @@ class Jo extends Fn {
2220
2220
  }
2221
2221
  });
2222
2222
  }
2223
- i === -1 && (r.unshift(n), M.emit("poll", {
2223
+ i === -1 && (r.unshift(n), B.emit("poll", {
2224
2224
  action: "received",
2225
2225
  payload: {
2226
2226
  questionId: n.id,
@@ -2242,7 +2242,7 @@ class Jo extends Fn {
2242
2242
  return;
2243
2243
  const u = a.findIndex((f) => f.id === e), l = a[u], c = l?.attributes?.attributes.case === "question" && l.attributes.attributes.value;
2244
2244
  if (c) {
2245
- M.emit("poll", {
2245
+ B.emit("poll", {
2246
2246
  action: "voted",
2247
2247
  payload: {
2248
2248
  questionId: e,
@@ -2262,7 +2262,7 @@ class Jo extends Fn {
2262
2262
  }
2263
2263
  };
2264
2264
  try {
2265
- await Oo(this.transport, { questionId: e, answerId: r }), s();
2265
+ await _o(this.transport, { questionId: e, answerId: r }), s();
2266
2266
  } catch (a) {
2267
2267
  if (a.message === nt.ALREADY_VOTED) {
2268
2268
  this.userSummary.invalidate();
@@ -2284,16 +2284,16 @@ class Jo extends Fn {
2284
2284
  animateHiding: !1
2285
2285
  });
2286
2286
  let n = r?.attributes?.type;
2287
- return n || (n = (this.feedList.getStore().value?.data || []).find((o) => o.id === e)?.attributes?.type), M.emit("poll", {
2287
+ return n || (n = (this.feedList.getStore().value?.data || []).find((o) => o.id === e)?.attributes?.type), B.emit("poll", {
2288
2288
  action: "opened",
2289
2289
  payload: {
2290
2290
  questionId: e,
2291
2291
  questionType: n,
2292
2292
  questionOpenedFrom: r?.openedFrom
2293
2293
  }
2294
- }), this.background.openQuestion(e, r);
2294
+ }), this.openFeature(), this.background.openQuestion(e, r);
2295
2295
  };
2296
- getFeedItem = (e) => co(e, this.transport);
2296
+ getFeedItem = (e) => lo(e, this.transport);
2297
2297
  isOpenedQuestion = (e) => !!this.notifications.isViewed(e);
2298
2298
  closeQuestion = (e) => (e && this.onQuestionActivate({
2299
2299
  stage: "deactivate",
@@ -2315,7 +2315,7 @@ class Jo extends Fn {
2315
2315
  }
2316
2316
  const n = { ...r };
2317
2317
  try {
2318
- const i = await Wo(this.background.slStreamId, this.background.userId, this.friends, e, this.transport);
2318
+ const i = await Yo(this.background.slStreamId, this.background.userId, this.friends, e, this.transport);
2319
2319
  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);
2320
2320
  } catch (i) {
2321
2321
  console.error(i);
@@ -2333,8 +2333,8 @@ class Jo extends Fn {
2333
2333
  */
2334
2334
  showInApp = (e) => {
2335
2335
  const r = this.onboardingStatus.$store.get();
2336
- if (e && e.data && r && r !== B.Unset && e.data.question?.id !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== Ai.ON && e.data.question.status === Z.ACTIVE && !e.data.question.marketClosed) {
2337
- if (Yo.has(e.data.question.type))
2336
+ if (e && e.data && r && r !== M.Unset && e.data.question?.id !== void 0 && e.data.question?.bypassNotifications?.inAppSilence !== Ai.ON && e.data.question.status === Z.ACTIVE && !e.data.question.marketClosed) {
2337
+ if (Jo.has(e.data.question.type))
2338
2338
  this.isInteractiveAllowed && e.data.question.notification !== void 0 && this.notifications.add({
2339
2339
  type: Ee.QUESTION,
2340
2340
  action: () => this.openQuestion(e.data?.question?.id, e.data?.feedItem),
@@ -2350,6 +2350,11 @@ class Jo extends Fn {
2350
2350
  questionType: e.data.question.type,
2351
2351
  question: {
2352
2352
  title: e.data.question.notification.title
2353
+ },
2354
+ inApp: {
2355
+ notification: e.data.question.notification,
2356
+ appearance: e.data.question.appearance,
2357
+ sponsorship: e.data.question.sponsorship
2353
2358
  }
2354
2359
  }
2355
2360
  });
@@ -2379,18 +2384,36 @@ class Jo extends Fn {
2379
2384
  data: {
2380
2385
  questionId: e.data.question.id,
2381
2386
  questionType: e.data.question.type,
2382
- insight: s
2387
+ insight: s,
2388
+ inApp: {
2389
+ useMediaFromContent: n.useAsNotification === Ei.ENABLED,
2390
+ notification: e.data.question.notification,
2391
+ appearance: e.data.question.appearance,
2392
+ sponsorship: e.data.question.sponsorship
2393
+ }
2383
2394
  }
2384
2395
  });
2385
2396
  } else if (e.data.question.type === _.TWEET && e.data.question.notification !== void 0) {
2386
2397
  const n = e.data.question.options?.options.value, i = {
2398
+ image: "",
2399
+ video: ""
2400
+ };
2401
+ if (n.tweetMeta?.tweet?.meta?.extendedEntities?.media?.[0]) {
2402
+ const s = n.tweetMeta.tweet.meta.extendedEntities.media;
2403
+ if (s) {
2404
+ const a = s.find(({ type: u }) => u === "photo") || s[0];
2405
+ i.image = a.mediaUrlHttps, a.type === "video" && (i.video = a.url);
2406
+ }
2407
+ }
2408
+ const o = {
2387
2409
  title: e.data.question.notification?.title,
2388
2410
  body: e.data.question.notification?.body,
2389
2411
  image: e.data.question.notification?.image,
2390
2412
  account: n?.tweetMeta?.account || "",
2391
2413
  accountVerified: !!n?.tweetMeta?.accountVerified,
2392
2414
  tweet: n?.tweetMeta?.tweet,
2393
- tweetId: e.data.question.id
2415
+ tweetId: e.data.question.id,
2416
+ tweetMedia: i
2394
2417
  };
2395
2418
  this.notifications.add({
2396
2419
  type: Ee.QUESTION,
@@ -2402,22 +2425,27 @@ class Jo extends Fn {
2402
2425
  data: {
2403
2426
  questionId: e.data.question.id,
2404
2427
  questionType: e.data.question.type,
2405
- tweet: i
2428
+ tweet: o,
2429
+ inApp: {
2430
+ notification: e.data.question.notification,
2431
+ appearance: e.data.question.appearance,
2432
+ sponsorship: e.data.question.sponsorship
2433
+ }
2406
2434
  }
2407
2435
  });
2408
2436
  }
2409
2437
  }
2410
2438
  };
2411
2439
  }
2412
- const Xo = {
2440
+ const Zo = {
2413
2441
  [R.GAMES]: !0
2414
2442
  };
2415
- class Zo extends Fn {
2443
+ class es extends Fn {
2416
2444
  constructor(e, r) {
2417
2445
  super(e, r);
2418
2446
  }
2419
2447
  }
2420
- const es = (t, e, r) => t.type === R.GAMES ? new Jo(t, e, r) : new Zo(t, e), ts = (t, e, r) => {
2448
+ const ts = (t, e, r) => t.type === R.GAMES ? new Xo(t, e, r) : new es(t, e), rs = (t, e, r) => {
2421
2449
  t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new ee(q(/* @__PURE__ */ new Set()), "features-list"), t.activeFeature = new ee(q(R.UNSET), "activeFeature"), t.sdk.getFeatures = () => t.features, t.sdk.getFeature = (n) => t.features.get(n), t.sdk.getActiveFeature = () => t.activeFeature.getStore(), t.sdk.openFeature = (n) => {
2422
2450
  t.activeFeature.setValue(n);
2423
2451
  }, t.sdk.closeFeature = (n = !1) => {
@@ -2428,8 +2456,8 @@ const es = (t, e, r) => t.type === R.GAMES ? new Jo(t, e, r) : new Zo(t, e), ts
2428
2456
  o && o.delete(i), t.sdk.featuresList.setValue(o);
2429
2457
  }
2430
2458
  }, t.initFeature = (n, i = me.ORGANIZATION) => {
2431
- if (n.type in Xo && !t.features.has(n.type)) {
2432
- const o = es(n, i, t);
2459
+ if (n.type in Zo && !t.features.has(n.type)) {
2460
+ const o = ts(n, i, t);
2433
2461
  t.features.set(n.type, o);
2434
2462
  let s = t.sdk.featuresList.getValue();
2435
2463
  s ? s.add(n.type) : s = /* @__PURE__ */ new Set([n.type]), t.sdk.featuresList.setValue(new Set(s));
@@ -2482,7 +2510,7 @@ const es = (t, e, r) => t.type === R.GAMES ? new Jo(t, e, r) : new Zo(t, e), ts
2482
2510
  t.store.subscribe(i);
2483
2511
  }, r();
2484
2512
  };
2485
- class rs {
2513
+ class ns {
2486
2514
  analytics;
2487
2515
  constructor(e) {
2488
2516
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2494,7 +2522,7 @@ class rs {
2494
2522
  break;
2495
2523
  }
2496
2524
  };
2497
- return M.listen(r);
2525
+ return B.listen(r);
2498
2526
  });
2499
2527
  }
2500
2528
  accepted = () => {
@@ -2503,8 +2531,8 @@ class rs {
2503
2531
  ...this.analytics.commonStore.getValues(),
2504
2532
  kind: Q.INVITATION_ACCEPTED
2505
2533
  },
2506
- category: Br.GAMES,
2507
- from: Mr.UNSET
2534
+ category: Mr.GAMES,
2535
+ from: Br.UNSET
2508
2536
  });
2509
2537
  };
2510
2538
  sent = ({ from: e }) => {
@@ -2513,12 +2541,12 @@ class rs {
2513
2541
  ...this.analytics.commonStore.getValues(),
2514
2542
  kind: Q.INVITATION_SENT
2515
2543
  },
2516
- category: Br.GAMES,
2517
- from: e || Mr.UNSET
2544
+ category: Mr.GAMES,
2545
+ from: e || Br.UNSET
2518
2546
  });
2519
2547
  };
2520
2548
  }
2521
- class ns {
2549
+ class is {
2522
2550
  analytics;
2523
2551
  constructor(e) {
2524
2552
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2533,7 +2561,7 @@ class ns {
2533
2561
  break;
2534
2562
  }
2535
2563
  };
2536
- return M.listen(r);
2564
+ return B.listen(r);
2537
2565
  });
2538
2566
  }
2539
2567
  tap = () => {
@@ -2555,7 +2583,7 @@ class ns {
2555
2583
  });
2556
2584
  };
2557
2585
  }
2558
- const is = {
2586
+ const os = {
2559
2587
  [W.UNSET]: Ae.UNSET,
2560
2588
  [W.INGAME_IAB21]: Ae.PROMOTION_INGAME_IAB21,
2561
2589
  [W.INGAME_IAB11_LBAR]: Ae.PROMOTION_INGAME_IAB11_LBAR,
@@ -2563,8 +2591,8 @@ const is = {
2563
2591
  [W.INGAME_IAB21_LBAR]: Ae.PROMOTION_INGAME_IAB21_LBAR,
2564
2592
  [W.INGAME_IAB61]: Ae.PROMOTION_INGAME_IAB61,
2565
2593
  [W.EXTERNAL_AD]: Ae.PROMOTION_GAM
2566
- }, cr = (t) => t ? is[t] : Ae.UNSET;
2567
- class os {
2594
+ }, cr = (t) => t ? os[t] : Ae.UNSET;
2595
+ class ss {
2568
2596
  analytics;
2569
2597
  constructor(e) {
2570
2598
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2593,7 +2621,7 @@ class os {
2593
2621
  }
2594
2622
  }
2595
2623
  };
2596
- return M.listen(r);
2624
+ return B.listen(r);
2597
2625
  });
2598
2626
  }
2599
2627
  received = ({ id: e }, { topicSubType: r }) => {
@@ -2679,7 +2707,7 @@ const et = {
2679
2707
  [_.TWEET]: x.POLLS_TWITTER
2680
2708
  };
2681
2709
  _.UNSET + "", he.UNSET, _.FACTOID + "", he.POLLS, _.POLL + "", he.POLLS, _.PREDICTION + "", he.POLLS, _.PROMOTION + "", he.POLLS, _.TRIVIA + "", he.POLLS, _.TWEET + "", he.POLLS;
2682
- const ss = {
2710
+ const as = {
2683
2711
  [R.UNSET]: z.UNSET,
2684
2712
  [R.INPLAY]: z.INPLAY,
2685
2713
  [R.MESSAGING]: z.MESSAGING,
@@ -2699,7 +2727,7 @@ const ss = {
2699
2727
  [R.HIGHLIGHTS]: z.HIGHLIGHTS,
2700
2728
  [R.PUBLIC_CHAT]: z.PUBLIC_CHAT
2701
2729
  };
2702
- class as {
2730
+ class us {
2703
2731
  analytics;
2704
2732
  constructor(e) {
2705
2733
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2731,7 +2759,7 @@ class as {
2731
2759
  break;
2732
2760
  }
2733
2761
  };
2734
- return M.listen(r);
2762
+ return B.listen(r);
2735
2763
  });
2736
2764
  }
2737
2765
  received = ({ questionId: e, questionType: r, topicSubType: n }) => {
@@ -2761,7 +2789,7 @@ class as {
2761
2789
  });
2762
2790
  };
2763
2791
  }
2764
- class us {
2792
+ class cs {
2765
2793
  analytics;
2766
2794
  constructor(e) {
2767
2795
  this.analytics = e, this.analytics.onConnect(() => {
@@ -2785,7 +2813,7 @@ class us {
2785
2813
  break;
2786
2814
  }
2787
2815
  };
2788
- return M.listen(r);
2816
+ return B.listen(r);
2789
2817
  });
2790
2818
  }
2791
2819
  // event when a poll is received from subscription or active question request
@@ -2845,7 +2873,7 @@ class us {
2845
2873
  });
2846
2874
  };
2847
2875
  }
2848
- const cs = ({ transport: t, $commonStore: e }) => {
2876
+ const ls = ({ transport: t, $commonStore: e }) => {
2849
2877
  let r;
2850
2878
  const n = q(!1), i = 5e3, { client: o, queryKey: s } = t.createPromiseClient(Ln, {
2851
2879
  method: "send",
@@ -2883,7 +2911,7 @@ const cs = ({ transport: t, $commonStore: e }) => {
2883
2911
  be.debug("unmounted heartbeat"), a.off(), r?.(), r = void 0, c();
2884
2912
  } };
2885
2913
  }, be = de("analytics");
2886
- class ls {
2914
+ class ds {
2887
2915
  commonStore;
2888
2916
  notifications;
2889
2917
  polls;
@@ -2896,7 +2924,7 @@ class ls {
2896
2924
  listenersCancels;
2897
2925
  connected = !1;
2898
2926
  constructor(e) {
2899
- this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Le(J({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = cs({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new as(this), this.polls = new us(this), this.invitation = new rs(this), this.interactions = new ns(this), this.advertisement = new os(this);
2927
+ this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Le(J({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = ls({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new us(this), this.polls = new cs(this), this.invitation = new ns(this), this.interactions = new is(this), this.advertisement = new ss(this);
2900
2928
  const { client: r } = e.analyticsTransport.createPromiseClient(Ln, {
2901
2929
  method: "send"
2902
2930
  });
@@ -2926,7 +2954,7 @@ class ls {
2926
2954
  this.onConnect(() => e.stores.slStreamId.getAtomStore().subscribe((r) => {
2927
2955
  this.writeCommon("eventId", r);
2928
2956
  })), this.onConnect(() => e.sdk.getActiveFeature().subscribe((r) => {
2929
- r && this.writeCommon("category", ss[r]), r !== R.UNSET ? this.writeCommon("overlaySessionId", ir()) : this.writeCommon("overlaySessionId", "");
2957
+ r && this.writeCommon("category", as[r]), r !== R.UNSET ? this.writeCommon("overlaySessionId", ir()) : this.writeCommon("overlaySessionId", "");
2930
2958
  })), this.onConnect(() => {
2931
2959
  const r = window.matchMedia("(orientation: portrait)"), n = (i) => {
2932
2960
  this.writeCommon("screenOrientation", i.matches ? Gr.PORTRAIT : Gr.LANDSCAPE);
@@ -2939,17 +2967,17 @@ class ls {
2939
2967
  }));
2940
2968
  };
2941
2969
  }
2942
- const ds = (t, e, r) => {
2943
- t.analytics = new ls(t), t.sdk.onMount({ name: "analytics" }, () => (t.analytics.connect(), () => {
2970
+ const fs = (t, e, r) => {
2971
+ t.analytics = new ds(t), t.sdk.onMount({ name: "analytics" }, () => (t.analytics.connect(), () => {
2944
2972
  t.analytics.disconnect();
2945
2973
  })), r();
2946
2974
  };
2947
2975
  var Ar = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
2948
- function fs(t) {
2976
+ function ps(t) {
2949
2977
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
2950
2978
  }
2951
2979
  var Er = { exports: {} }, Ir = { exports: {} };
2952
- function ps(t) {
2980
+ function hs(t) {
2953
2981
  var e = new t(), r = e;
2954
2982
  function n() {
2955
2983
  var o = e;
@@ -2963,11 +2991,11 @@ function ps(t) {
2963
2991
  release: i
2964
2992
  };
2965
2993
  }
2966
- var hs = ps, ys = hs;
2967
- function jn(t, e, r) {
2994
+ var ys = hs, ms = ys;
2995
+ function Un(t, e, r) {
2968
2996
  if (typeof t == "function" && (r = e, e = t, t = null), !(r >= 1))
2969
2997
  throw new Error("fastqueue concurrency must be equal to or greater than 1");
2970
- var n = ys(ms), i = null, o = null, s = 0, a = null, u = {
2998
+ var n = ms(gs), i = null, o = null, s = 0, a = null, u = {
2971
2999
  push: b,
2972
3000
  drain: X,
2973
3001
  saturated: X,
@@ -3049,7 +3077,7 @@ function jn(t, e, r) {
3049
3077
  }
3050
3078
  function X() {
3051
3079
  }
3052
- function ms() {
3080
+ function gs() {
3053
3081
  this.value = null, this.callback = X, this.next = null, this.release = X, this.context = null, this.errorHandler = null;
3054
3082
  var t = this;
3055
3083
  this.worked = function(r, n) {
@@ -3057,14 +3085,14 @@ function ms() {
3057
3085
  t.value = null, t.callback = X, t.errorHandler && o(r, s), i.call(t.context, r, n), t.release(t);
3058
3086
  };
3059
3087
  }
3060
- function gs(t, e, r) {
3088
+ function bs(t, e, r) {
3061
3089
  typeof t == "function" && (r = e, e = t, t = null);
3062
3090
  function n(c, f) {
3063
3091
  e.call(this, c).then(function(p) {
3064
3092
  f(null, p);
3065
3093
  }, f);
3066
3094
  }
3067
- var i = jn(t, n, r), o = i.push, s = i.unshift;
3095
+ var i = Un(t, n, r), o = i.push, s = i.unshift;
3068
3096
  return i.push = a, i.unshift = u, i.drained = l, i;
3069
3097
  function a(c) {
3070
3098
  var f = new Promise(function(p, v) {
@@ -3103,9 +3131,9 @@ function gs(t, e, r) {
3103
3131
  return f;
3104
3132
  }
3105
3133
  }
3106
- Ir.exports = jn;
3107
- Ir.exports.promise = gs;
3108
- var Un = Ir.exports, Tr = { exports: {} }, Ge = typeof Reflect == "object" ? Reflect : null, rn = Ge && typeof Ge.apply == "function" ? Ge.apply : function(e, r, n) {
3134
+ Ir.exports = Un;
3135
+ Ir.exports.promise = bs;
3136
+ var jn = Ir.exports, Tr = { exports: {} }, Ge = typeof Reflect == "object" ? Reflect : null, rn = Ge && typeof Ge.apply == "function" ? Ge.apply : function(e, r, n) {
3109
3137
  return Function.prototype.apply.call(e, r, n);
3110
3138
  }, yt;
3111
3139
  Ge && typeof Ge.ownKeys == "function" ? yt = Ge.ownKeys : Object.getOwnPropertySymbols ? yt = function(e) {
@@ -3113,7 +3141,7 @@ Ge && typeof Ge.ownKeys == "function" ? yt = Ge.ownKeys : Object.getOwnPropertyS
3113
3141
  } : yt = function(e) {
3114
3142
  return Object.getOwnPropertyNames(e);
3115
3143
  };
3116
- function bs(t) {
3144
+ function vs(t) {
3117
3145
  console && console.warn && console.warn(t);
3118
3146
  }
3119
3147
  var xn = Number.isNaN || function(e) {
@@ -3123,7 +3151,7 @@ function N() {
3123
3151
  N.init.call(this);
3124
3152
  }
3125
3153
  Tr.exports = N;
3126
- Tr.exports.once = As;
3154
+ Tr.exports.once = Es;
3127
3155
  N.EventEmitter = N;
3128
3156
  N.prototype._events = void 0;
3129
3157
  N.prototype._eventsCount = 0;
@@ -3193,7 +3221,7 @@ function Gn(t, e, r, n) {
3193
3221
  else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), i = Qn(t), i > 0 && s.length > i && !s.warned) {
3194
3222
  s.warned = !0;
3195
3223
  var a = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
3196
- a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length, bs(a);
3224
+ a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length, vs(a);
3197
3225
  }
3198
3226
  return t;
3199
3227
  }
@@ -3204,12 +3232,12 @@ N.prototype.on = N.prototype.addListener;
3204
3232
  N.prototype.prependListener = function(e, r) {
3205
3233
  return Gn(this, e, r, !0);
3206
3234
  };
3207
- function vs() {
3235
+ function Ss() {
3208
3236
  if (!this.fired)
3209
3237
  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);
3210
3238
  }
3211
3239
  function Kn(t, e, r) {
3212
- var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i = vs.bind(n);
3240
+ var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i = Ss.bind(n);
3213
3241
  return i.listener = r, n.wrapFn = i, i;
3214
3242
  }
3215
3243
  N.prototype.once = function(e, r) {
@@ -3234,7 +3262,7 @@ N.prototype.removeListener = function(e, r) {
3234
3262
  }
3235
3263
  if (o < 0)
3236
3264
  return this;
3237
- o === 0 ? n.shift() : Ss(n, o), n.length === 1 && (i[e] = n[0]), i.removeListener !== void 0 && this.emit("removeListener", e, a || r);
3265
+ o === 0 ? n.shift() : ws(n, o), n.length === 1 && (i[e] = n[0]), i.removeListener !== void 0 && this.emit("removeListener", e, a || r);
3238
3266
  }
3239
3267
  return this;
3240
3268
  };
@@ -3263,7 +3291,7 @@ function zn(t, e, r) {
3263
3291
  if (n === void 0)
3264
3292
  return [];
3265
3293
  var i = n[e];
3266
- return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? ws(i) : Wn(i, i.length);
3294
+ return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? As(i) : Wn(i, i.length);
3267
3295
  }
3268
3296
  N.prototype.listeners = function(e) {
3269
3297
  return zn(this, e, !0);
@@ -3294,17 +3322,17 @@ function Wn(t, e) {
3294
3322
  r[n] = t[n];
3295
3323
  return r;
3296
3324
  }
3297
- function Ss(t, e) {
3325
+ function ws(t, e) {
3298
3326
  for (; e + 1 < t.length; e++)
3299
3327
  t[e] = t[e + 1];
3300
3328
  t.pop();
3301
3329
  }
3302
- function ws(t) {
3330
+ function As(t) {
3303
3331
  for (var e = new Array(t.length), r = 0; r < e.length; ++r)
3304
3332
  e[r] = t[r].listener || t[r];
3305
3333
  return e;
3306
3334
  }
3307
- function As(t, e) {
3335
+ function Es(t, e) {
3308
3336
  return new Promise(function(r, n) {
3309
3337
  function i(s) {
3310
3338
  t.removeListener(e, o), n(s);
@@ -3312,10 +3340,10 @@ function As(t, e) {
3312
3340
  function o() {
3313
3341
  typeof t.removeListener == "function" && t.removeListener("error", i), r([].slice.call(arguments));
3314
3342
  }
3315
- Yn(t, e, o, { once: !0 }), e !== "error" && Es(t, i, { once: !0 });
3343
+ Yn(t, e, o, { once: !0 }), e !== "error" && Is(t, i, { once: !0 });
3316
3344
  });
3317
3345
  }
3318
- function Es(t, e, r) {
3346
+ function Is(t, e, r) {
3319
3347
  typeof t.on == "function" && Yn(t, "error", e, r);
3320
3348
  }
3321
3349
  function Yn(t, e, r, n) {
@@ -3351,16 +3379,16 @@ var Jn = Tr.exports, Dt = {}, Xn = {}, Zn = function() {
3351
3379
  return !1;
3352
3380
  }
3353
3381
  return !0;
3354
- }, Is = Zn, Rt = function() {
3355
- return Is() && !!Symbol.toStringTag;
3356
- }, Ts = Error, Os = EvalError, _s = RangeError, Ls = ReferenceError, ei = SyntaxError, Vt = TypeError, Cs = URIError, on = typeof Symbol < "u" && Symbol, ks = Zn, Ps = function() {
3357
- return typeof on != "function" || typeof Symbol != "function" || typeof on("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : ks();
3358
- }, jt = {
3382
+ }, Ts = Zn, Rt = function() {
3383
+ return Ts() && !!Symbol.toStringTag;
3384
+ }, Os = Error, _s = EvalError, Ls = RangeError, Cs = ReferenceError, ei = SyntaxError, Vt = TypeError, ks = URIError, on = typeof Symbol < "u" && Symbol, Ps = Zn, Ns = function() {
3385
+ return typeof on != "function" || typeof Symbol != "function" || typeof on("foo") != "symbol" || typeof Symbol("bar") != "symbol" ? !1 : Ps();
3386
+ }, Ut = {
3359
3387
  __proto__: null,
3360
3388
  foo: {}
3361
- }, Ns = Object, Fs = function() {
3362
- return { __proto__: jt }.foo === jt.foo && !(jt instanceof Ns);
3363
- }, Ds = "Function.prototype.bind called on incompatible ", Rs = Object.prototype.toString, Vs = Math.max, $s = "[object Function]", sn = function(e, r) {
3389
+ }, Fs = Object, Ds = function() {
3390
+ return { __proto__: Ut }.foo === Ut.foo && !(Ut instanceof Fs);
3391
+ }, Rs = "Function.prototype.bind called on incompatible ", Vs = Object.prototype.toString, $s = Math.max, Ms = "[object Function]", sn = function(e, r) {
3364
3392
  for (var n = [], i = 0; i < e.length; i += 1)
3365
3393
  n[i] = e[i];
3366
3394
  for (var o = 0; o < r.length; o += 1)
@@ -3370,14 +3398,14 @@ var Jn = Tr.exports, Dt = {}, Xn = {}, Zn = function() {
3370
3398
  for (var n = [], i = r, o = 0; i < e.length; i += 1, o += 1)
3371
3399
  n[o] = e[i];
3372
3400
  return n;
3373
- }, Ms = function(t, e) {
3401
+ }, qs = function(t, e) {
3374
3402
  for (var r = "", n = 0; n < t.length; n += 1)
3375
3403
  r += t[n], n + 1 < t.length && (r += e);
3376
3404
  return r;
3377
- }, qs = function(e) {
3405
+ }, Us = function(e) {
3378
3406
  var r = this;
3379
- if (typeof r != "function" || Rs.apply(r) !== $s)
3380
- throw new TypeError(Ds + r);
3407
+ if (typeof r != "function" || Vs.apply(r) !== Ms)
3408
+ throw new TypeError(Rs + r);
3381
3409
  for (var n = Bs(arguments, 1), i, o = function() {
3382
3410
  if (this instanceof i) {
3383
3411
  var c = r.apply(
@@ -3390,15 +3418,15 @@ var Jn = Tr.exports, Dt = {}, Xn = {}, Zn = function() {
3390
3418
  e,
3391
3419
  sn(n, arguments)
3392
3420
  );
3393
- }, s = Vs(0, r.length - n.length), a = [], u = 0; u < s; u++)
3421
+ }, s = $s(0, r.length - n.length), a = [], u = 0; u < s; u++)
3394
3422
  a[u] = "$" + u;
3395
- if (i = Function("binder", "return function (" + Ms(a, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
3423
+ if (i = Function("binder", "return function (" + qs(a, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
3396
3424
  var l = function() {
3397
3425
  };
3398
3426
  l.prototype = r.prototype, i.prototype = new l(), l.prototype = null;
3399
3427
  }
3400
3428
  return i;
3401
- }, js = qs, Or = Function.prototype.bind || js, Us = Function.prototype.call, xs = Object.prototype.hasOwnProperty, Qs = Or, Gs = Qs.call(Us, xs), T, Ks = Ts, zs = Os, Hs = _s, Ws = Ls, ze = ei, Ke = Vt, Ys = Cs, ti = Function, Ut = function(t) {
3429
+ }, js = Us, Or = Function.prototype.bind || js, xs = Function.prototype.call, Qs = Object.prototype.hasOwnProperty, Gs = Or, Ks = Gs.call(xs, Qs), T, zs = Os, Hs = _s, Ws = Ls, Ys = Cs, ze = ei, Ke = Vt, Js = ks, ti = Function, jt = function(t) {
3402
3430
  try {
3403
3431
  return ti('"use strict"; return (' + t + ").constructor;")();
3404
3432
  } catch {
@@ -3412,7 +3440,7 @@ if (ke)
3412
3440
  }
3413
3441
  var xt = function() {
3414
3442
  throw new Ke();
3415
- }, Js = ke ? function() {
3443
+ }, Xs = ke ? function() {
3416
3444
  try {
3417
3445
  return arguments.callee, xt;
3418
3446
  } catch {
@@ -3422,14 +3450,14 @@ var xt = function() {
3422
3450
  return xt;
3423
3451
  }
3424
3452
  }
3425
- }() : xt, Be = Ps(), Xs = Fs(), j = Object.getPrototypeOf || (Xs ? function(t) {
3453
+ }() : xt, Me = Ns(), Zs = Ds(), U = Object.getPrototypeOf || (Zs ? function(t) {
3426
3454
  return t.__proto__;
3427
- } : null), qe = {}, Zs = typeof Uint8Array > "u" || !j ? T : j(Uint8Array), Pe = {
3455
+ } : null), qe = {}, ea = typeof Uint8Array > "u" || !U ? T : U(Uint8Array), Pe = {
3428
3456
  __proto__: null,
3429
3457
  "%AggregateError%": typeof AggregateError > "u" ? T : AggregateError,
3430
3458
  "%Array%": Array,
3431
3459
  "%ArrayBuffer%": typeof ArrayBuffer > "u" ? T : ArrayBuffer,
3432
- "%ArrayIteratorPrototype%": Be && j ? j([][Symbol.iterator]()) : T,
3460
+ "%ArrayIteratorPrototype%": Me && U ? U([][Symbol.iterator]()) : T,
3433
3461
  "%AsyncFromSyncIteratorPrototype%": T,
3434
3462
  "%AsyncFunction%": qe,
3435
3463
  "%AsyncGenerator%": qe,
@@ -3446,10 +3474,10 @@ var xt = function() {
3446
3474
  "%decodeURIComponent%": decodeURIComponent,
3447
3475
  "%encodeURI%": encodeURI,
3448
3476
  "%encodeURIComponent%": encodeURIComponent,
3449
- "%Error%": Ks,
3477
+ "%Error%": zs,
3450
3478
  "%eval%": eval,
3451
3479
  // eslint-disable-line no-eval
3452
- "%EvalError%": zs,
3480
+ "%EvalError%": Hs,
3453
3481
  "%Float32Array%": typeof Float32Array > "u" ? T : Float32Array,
3454
3482
  "%Float64Array%": typeof Float64Array > "u" ? T : Float64Array,
3455
3483
  "%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? T : FinalizationRegistry,
@@ -3460,10 +3488,10 @@ var xt = function() {
3460
3488
  "%Int32Array%": typeof Int32Array > "u" ? T : Int32Array,
3461
3489
  "%isFinite%": isFinite,
3462
3490
  "%isNaN%": isNaN,
3463
- "%IteratorPrototype%": Be && j ? j(j([][Symbol.iterator]())) : T,
3491
+ "%IteratorPrototype%": Me && U ? U(U([][Symbol.iterator]())) : T,
3464
3492
  "%JSON%": typeof JSON == "object" ? JSON : T,
3465
3493
  "%Map%": typeof Map > "u" ? T : Map,
3466
- "%MapIteratorPrototype%": typeof Map > "u" || !Be || !j ? T : j((/* @__PURE__ */ new Map())[Symbol.iterator]()),
3494
+ "%MapIteratorPrototype%": typeof Map > "u" || !Me || !U ? T : U((/* @__PURE__ */ new Map())[Symbol.iterator]()),
3467
3495
  "%Math%": Math,
3468
3496
  "%Number%": Number,
3469
3497
  "%Object%": Object,
@@ -3471,50 +3499,50 @@ var xt = function() {
3471
3499
  "%parseInt%": parseInt,
3472
3500
  "%Promise%": typeof Promise > "u" ? T : Promise,
3473
3501
  "%Proxy%": typeof Proxy > "u" ? T : Proxy,
3474
- "%RangeError%": Hs,
3475
- "%ReferenceError%": Ws,
3502
+ "%RangeError%": Ws,
3503
+ "%ReferenceError%": Ys,
3476
3504
  "%Reflect%": typeof Reflect > "u" ? T : Reflect,
3477
3505
  "%RegExp%": RegExp,
3478
3506
  "%Set%": typeof Set > "u" ? T : Set,
3479
- "%SetIteratorPrototype%": typeof Set > "u" || !Be || !j ? T : j((/* @__PURE__ */ new Set())[Symbol.iterator]()),
3507
+ "%SetIteratorPrototype%": typeof Set > "u" || !Me || !U ? T : U((/* @__PURE__ */ new Set())[Symbol.iterator]()),
3480
3508
  "%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? T : SharedArrayBuffer,
3481
3509
  "%String%": String,
3482
- "%StringIteratorPrototype%": Be && j ? j(""[Symbol.iterator]()) : T,
3483
- "%Symbol%": Be ? Symbol : T,
3510
+ "%StringIteratorPrototype%": Me && U ? U(""[Symbol.iterator]()) : T,
3511
+ "%Symbol%": Me ? Symbol : T,
3484
3512
  "%SyntaxError%": ze,
3485
- "%ThrowTypeError%": Js,
3486
- "%TypedArray%": Zs,
3513
+ "%ThrowTypeError%": Xs,
3514
+ "%TypedArray%": ea,
3487
3515
  "%TypeError%": Ke,
3488
3516
  "%Uint8Array%": typeof Uint8Array > "u" ? T : Uint8Array,
3489
3517
  "%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? T : Uint8ClampedArray,
3490
3518
  "%Uint16Array%": typeof Uint16Array > "u" ? T : Uint16Array,
3491
3519
  "%Uint32Array%": typeof Uint32Array > "u" ? T : Uint32Array,
3492
- "%URIError%": Ys,
3520
+ "%URIError%": Js,
3493
3521
  "%WeakMap%": typeof WeakMap > "u" ? T : WeakMap,
3494
3522
  "%WeakRef%": typeof WeakRef > "u" ? T : WeakRef,
3495
3523
  "%WeakSet%": typeof WeakSet > "u" ? T : WeakSet
3496
3524
  };
3497
- if (j)
3525
+ if (U)
3498
3526
  try {
3499
3527
  null.error;
3500
3528
  } catch (t) {
3501
- var ea = j(j(t));
3502
- Pe["%Error.prototype%"] = ea;
3529
+ var ta = U(U(t));
3530
+ Pe["%Error.prototype%"] = ta;
3503
3531
  }
3504
- var ta = function t(e) {
3532
+ var ra = function t(e) {
3505
3533
  var r;
3506
3534
  if (e === "%AsyncFunction%")
3507
- r = Ut("async function () {}");
3535
+ r = jt("async function () {}");
3508
3536
  else if (e === "%GeneratorFunction%")
3509
- r = Ut("function* () {}");
3537
+ r = jt("function* () {}");
3510
3538
  else if (e === "%AsyncGeneratorFunction%")
3511
- r = Ut("async function* () {}");
3539
+ r = jt("async function* () {}");
3512
3540
  else if (e === "%AsyncGenerator%") {
3513
3541
  var n = t("%AsyncGeneratorFunction%");
3514
3542
  n && (r = n.prototype);
3515
3543
  } else if (e === "%AsyncIteratorPrototype%") {
3516
3544
  var i = t("%AsyncGenerator%");
3517
- i && j && (r = j(i.prototype));
3545
+ i && U && (r = U(i.prototype));
3518
3546
  }
3519
3547
  return Pe[e] = r, r;
3520
3548
  }, an = {
@@ -3570,21 +3598,21 @@ var ta = function t(e) {
3570
3598
  "%URIErrorPrototype%": ["URIError", "prototype"],
3571
3599
  "%WeakMapPrototype%": ["WeakMap", "prototype"],
3572
3600
  "%WeakSetPrototype%": ["WeakSet", "prototype"]
3573
- }, ot = Or, Et = Gs, ra = ot.call(Function.call, Array.prototype.concat), na = ot.call(Function.apply, Array.prototype.splice), un = ot.call(Function.call, String.prototype.replace), It = ot.call(Function.call, String.prototype.slice), ia = ot.call(Function.call, RegExp.prototype.exec), oa = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, sa = /\\(\\)?/g, aa = function(e) {
3601
+ }, ot = Or, Et = Ks, na = ot.call(Function.call, Array.prototype.concat), ia = ot.call(Function.apply, Array.prototype.splice), un = ot.call(Function.call, String.prototype.replace), It = ot.call(Function.call, String.prototype.slice), oa = ot.call(Function.call, RegExp.prototype.exec), sa = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, aa = /\\(\\)?/g, ua = function(e) {
3574
3602
  var r = It(e, 0, 1), n = It(e, -1);
3575
3603
  if (r === "%" && n !== "%")
3576
3604
  throw new ze("invalid intrinsic syntax, expected closing `%`");
3577
3605
  if (n === "%" && r !== "%")
3578
3606
  throw new ze("invalid intrinsic syntax, expected opening `%`");
3579
3607
  var i = [];
3580
- return un(e, oa, function(o, s, a, u) {
3581
- i[i.length] = a ? un(u, sa, "$1") : s || o;
3608
+ return un(e, sa, function(o, s, a, u) {
3609
+ i[i.length] = a ? un(u, aa, "$1") : s || o;
3582
3610
  }), i;
3583
- }, ua = function(e, r) {
3611
+ }, ca = function(e, r) {
3584
3612
  var n = e, i;
3585
3613
  if (Et(an, n) && (i = an[n], n = "%" + i[0] + "%"), Et(Pe, n)) {
3586
3614
  var o = Pe[n];
3587
- if (o === qe && (o = ta(n)), typeof o > "u" && !r)
3615
+ if (o === qe && (o = ra(n)), typeof o > "u" && !r)
3588
3616
  throw new Ke("intrinsic " + e + " exists, but is not available. Please file an issue!");
3589
3617
  return {
3590
3618
  alias: i,
@@ -3598,10 +3626,10 @@ var ta = function t(e) {
3598
3626
  throw new Ke("intrinsic name must be a non-empty string");
3599
3627
  if (arguments.length > 1 && typeof r != "boolean")
3600
3628
  throw new Ke('"allowMissing" argument must be a boolean');
3601
- if (ia(/^%?[^%]*%?$/, e) === null)
3629
+ if (oa(/^%?[^%]*%?$/, e) === null)
3602
3630
  throw new ze("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
3603
- var n = aa(e), i = n.length > 0 ? n[0] : "", o = ua("%" + i + "%", r), s = o.name, a = o.value, u = !1, l = o.alias;
3604
- l && (i = l[0], na(n, ra([0, 1], l)));
3631
+ var n = ua(e), i = n.length > 0 ? n[0] : "", o = ca("%" + i + "%", r), s = o.name, a = o.value, u = !1, l = o.alias;
3632
+ l && (i = l[0], ia(n, na([0, 1], l)));
3605
3633
  for (var c = 1, f = !0; c < n.length; c += 1) {
3606
3634
  var p = n[c], v = It(p, 0, 1), w = It(p, -1);
3607
3635
  if ((v === '"' || v === "'" || v === "`" || w === '"' || w === "'" || w === "`") && v !== w)
@@ -3636,26 +3664,26 @@ function _r() {
3636
3664
  }
3637
3665
  return Qt = e, Qt;
3638
3666
  }
3639
- var ca = st, mt = ca("%Object.getOwnPropertyDescriptor%", !0);
3667
+ var la = st, mt = la("%Object.getOwnPropertyDescriptor%", !0);
3640
3668
  if (mt)
3641
3669
  try {
3642
3670
  mt([], "length");
3643
3671
  } catch {
3644
3672
  mt = null;
3645
3673
  }
3646
- var $t = mt, ln = _r(), la = ei, Me = Vt, dn = $t, da = function(e, r, n) {
3674
+ var $t = mt, ln = _r(), da = ei, Be = Vt, dn = $t, fa = function(e, r, n) {
3647
3675
  if (!e || typeof e != "object" && typeof e != "function")
3648
- throw new Me("`obj` must be an object or a function`");
3676
+ throw new Be("`obj` must be an object or a function`");
3649
3677
  if (typeof r != "string" && typeof r != "symbol")
3650
- throw new Me("`property` must be a string or a symbol`");
3678
+ throw new Be("`property` must be a string or a symbol`");
3651
3679
  if (arguments.length > 3 && typeof arguments[3] != "boolean" && arguments[3] !== null)
3652
- throw new Me("`nonEnumerable`, if provided, must be a boolean or null");
3680
+ throw new Be("`nonEnumerable`, if provided, must be a boolean or null");
3653
3681
  if (arguments.length > 4 && typeof arguments[4] != "boolean" && arguments[4] !== null)
3654
- throw new Me("`nonWritable`, if provided, must be a boolean or null");
3682
+ throw new Be("`nonWritable`, if provided, must be a boolean or null");
3655
3683
  if (arguments.length > 5 && typeof arguments[5] != "boolean" && arguments[5] !== null)
3656
- throw new Me("`nonConfigurable`, if provided, must be a boolean or null");
3684
+ throw new Be("`nonConfigurable`, if provided, must be a boolean or null");
3657
3685
  if (arguments.length > 6 && typeof arguments[6] != "boolean")
3658
- throw new Me("`loose`, if provided, must be a boolean");
3686
+ throw new Be("`loose`, if provided, must be a boolean");
3659
3687
  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 = !!dn && dn(e, r);
3660
3688
  if (ln)
3661
3689
  ln(e, r, {
@@ -3667,7 +3695,7 @@ var $t = mt, ln = _r(), la = ei, Me = Vt, dn = $t, da = function(e, r, n) {
3667
3695
  else if (a || !i && !o && !s)
3668
3696
  e[r] = n;
3669
3697
  else
3670
- throw new la("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
3698
+ throw new da("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
3671
3699
  }, lr = _r(), ni = function() {
3672
3700
  return !!lr;
3673
3701
  };
@@ -3680,17 +3708,17 @@ ni.hasArrayLengthDefineBug = function() {
3680
3708
  return !0;
3681
3709
  }
3682
3710
  };
3683
- var fa = ni, pa = st, fn = da, ha = fa(), pn = $t, hn = Vt, ya = pa("%Math.floor%"), ma = function(e, r) {
3711
+ var pa = ni, ha = st, fn = fa, ya = pa(), pn = $t, hn = Vt, ma = ha("%Math.floor%"), ga = function(e, r) {
3684
3712
  if (typeof e != "function")
3685
3713
  throw new hn("`fn` is not a function");
3686
- if (typeof r != "number" || r < 0 || r > 4294967295 || ya(r) !== r)
3714
+ if (typeof r != "number" || r < 0 || r > 4294967295 || ma(r) !== r)
3687
3715
  throw new hn("`length` must be a positive 32-bit integer");
3688
3716
  var n = arguments.length > 2 && !!arguments[2], i = !0, o = !0;
3689
3717
  if ("length" in e && pn) {
3690
3718
  var s = pn(e, "length");
3691
3719
  s && !s.configurable && (i = !1), s && !s.writable && (o = !1);
3692
3720
  }
3693
- return (i || o || !n) && (ha ? fn(
3721
+ return (i || o || !n) && (ya ? fn(
3694
3722
  /** @type {Parameters<define>[0]} */
3695
3723
  e,
3696
3724
  "length",
@@ -3705,7 +3733,7 @@ var fa = ni, pa = st, fn = da, ha = fa(), pn = $t, hn = Vt, ya = pa("%Math.floor
3705
3733
  )), e;
3706
3734
  };
3707
3735
  (function(t) {
3708
- var e = Or, r = st, n = ma, i = Vt, o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = _r(), l = r("%Math.max%");
3736
+ var e = Or, r = st, n = ga, i = Vt, o = r("%Function.prototype.apply%"), s = r("%Function.prototype.call%"), a = r("%Reflect.apply%", !0) || e.call(s, o), u = _r(), l = r("%Math.max%");
3709
3737
  t.exports = function(p) {
3710
3738
  if (typeof p != "function")
3711
3739
  throw new i("a function is required");
@@ -3721,37 +3749,37 @@ var fa = ni, pa = st, fn = da, ha = fa(), pn = $t, hn = Vt, ya = pa("%Math.floor
3721
3749
  };
3722
3750
  u ? u(t.exports, "apply", { value: c }) : t.exports.apply = c;
3723
3751
  })(ri);
3724
- var Lr = ri.exports, ii = st, oi = Lr, ga = oi(ii("String.prototype.indexOf")), Cr = function(e, r) {
3752
+ var Lr = ri.exports, ii = st, oi = Lr, ba = oi(ii("String.prototype.indexOf")), Cr = function(e, r) {
3725
3753
  var n = ii(e, !!r);
3726
- return typeof n == "function" && ga(e, ".prototype.") > -1 ? oi(n) : n;
3727
- }, ba = Rt(), va = Cr, dr = va("Object.prototype.toString"), Bt = function(e) {
3728
- return ba && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : dr(e) === "[object Arguments]";
3754
+ return typeof n == "function" && ba(e, ".prototype.") > -1 ? oi(n) : n;
3755
+ }, va = Rt(), Sa = Cr, dr = Sa("Object.prototype.toString"), Mt = function(e) {
3756
+ return va && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : dr(e) === "[object Arguments]";
3729
3757
  }, si = function(e) {
3730
- return Bt(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && dr(e) !== "[object Array]" && dr(e.callee) === "[object Function]";
3731
- }, Sa = function() {
3732
- return Bt(arguments);
3758
+ return Mt(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && dr(e) !== "[object Array]" && dr(e.callee) === "[object Function]";
3759
+ }, wa = function() {
3760
+ return Mt(arguments);
3733
3761
  }();
3734
- Bt.isLegacyArguments = si;
3735
- var wa = Sa ? Bt : si, Aa = Object.prototype.toString, Ea = Function.prototype.toString, Ia = /^\s*(?:function)?\*/, ai = Rt(), Gt = Object.getPrototypeOf, Ta = function() {
3762
+ Mt.isLegacyArguments = si;
3763
+ var Aa = wa ? Mt : si, Ea = Object.prototype.toString, Ia = Function.prototype.toString, Ta = /^\s*(?:function)?\*/, ai = Rt(), Gt = Object.getPrototypeOf, Oa = function() {
3736
3764
  if (!ai)
3737
3765
  return !1;
3738
3766
  try {
3739
3767
  return Function("return function*() {}")();
3740
3768
  } catch {
3741
3769
  }
3742
- }, Kt, Oa = function(e) {
3770
+ }, Kt, _a = function(e) {
3743
3771
  if (typeof e != "function")
3744
3772
  return !1;
3745
- if (Ia.test(Ea.call(e)))
3773
+ if (Ta.test(Ia.call(e)))
3746
3774
  return !0;
3747
3775
  if (!ai) {
3748
- var r = Aa.call(e);
3776
+ var r = Ea.call(e);
3749
3777
  return r === "[object GeneratorFunction]";
3750
3778
  }
3751
3779
  if (!Gt)
3752
3780
  return !1;
3753
3781
  if (typeof Kt > "u") {
3754
- var n = Ta();
3782
+ var n = Oa();
3755
3783
  Kt = n ? Gt(n) : !1;
3756
3784
  }
3757
3785
  return Gt(e) === Kt;
@@ -3770,10 +3798,10 @@ if (typeof xe == "function" && typeof Object.defineProperty == "function")
3770
3798
  }
3771
3799
  else
3772
3800
  xe = null;
3773
- var _a = /^\s*class\b/, pr = function(e) {
3801
+ var La = /^\s*class\b/, pr = function(e) {
3774
3802
  try {
3775
3803
  var r = ui.call(e);
3776
- return _a.test(r);
3804
+ return La.test(r);
3777
3805
  } catch {
3778
3806
  return !1;
3779
3807
  }
@@ -3783,22 +3811,22 @@ var _a = /^\s*class\b/, pr = function(e) {
3783
3811
  } catch {
3784
3812
  return !1;
3785
3813
  }
3786
- }, bt = Object.prototype.toString, La = "[object Object]", Ca = "[object Function]", ka = "[object GeneratorFunction]", Pa = "[object HTMLAllCollection]", Na = "[object HTML document.all class]", Fa = "[object HTMLCollection]", Da = typeof Symbol == "function" && !!Symbol.toStringTag, Ra = !(0 in [,]), hr = function() {
3814
+ }, bt = Object.prototype.toString, Ca = "[object Object]", ka = "[object Function]", Pa = "[object GeneratorFunction]", Na = "[object HTMLAllCollection]", Fa = "[object HTML document.all class]", Da = "[object HTMLCollection]", Ra = typeof Symbol == "function" && !!Symbol.toStringTag, Va = !(0 in [,]), hr = function() {
3787
3815
  return !1;
3788
3816
  };
3789
3817
  if (typeof document == "object") {
3790
- var Va = document.all;
3791
- bt.call(Va) === bt.call(document.all) && (hr = function(e) {
3792
- if ((Ra || !e) && (typeof e > "u" || typeof e == "object"))
3818
+ var $a = document.all;
3819
+ bt.call($a) === bt.call(document.all) && (hr = function(e) {
3820
+ if ((Va || !e) && (typeof e > "u" || typeof e == "object"))
3793
3821
  try {
3794
3822
  var r = bt.call(e);
3795
- return (r === Pa || r === Na || r === Fa || r === La) && e("") == null;
3823
+ return (r === Na || r === Fa || r === Da || r === Ca) && e("") == null;
3796
3824
  } catch {
3797
3825
  }
3798
3826
  return !1;
3799
3827
  });
3800
3828
  }
3801
- var $a = xe ? function(e) {
3829
+ var Ma = xe ? function(e) {
3802
3830
  if (hr(e))
3803
3831
  return !0;
3804
3832
  if (!e || typeof e != "function" && typeof e != "object")
@@ -3815,27 +3843,27 @@ var $a = xe ? function(e) {
3815
3843
  return !0;
3816
3844
  if (!e || typeof e != "function" && typeof e != "object")
3817
3845
  return !1;
3818
- if (Da)
3846
+ if (Ra)
3819
3847
  return zt(e);
3820
3848
  if (pr(e))
3821
3849
  return !1;
3822
3850
  var r = bt.call(e);
3823
- return r !== Ca && r !== ka && !/^\[object HTML/.test(r) ? !1 : zt(e);
3824
- }, Ba = $a, Ma = Object.prototype.toString, ci = Object.prototype.hasOwnProperty, qa = function(e, r, n) {
3851
+ return r !== ka && r !== Pa && !/^\[object HTML/.test(r) ? !1 : zt(e);
3852
+ }, Ba = Ma, qa = Object.prototype.toString, ci = Object.prototype.hasOwnProperty, Ua = function(e, r, n) {
3825
3853
  for (var i = 0, o = e.length; i < o; i++)
3826
3854
  ci.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3827
3855
  }, ja = function(e, r, n) {
3828
3856
  for (var i = 0, o = e.length; i < o; i++)
3829
3857
  n == null ? r(e.charAt(i), i, e) : r.call(n, e.charAt(i), i, e);
3830
- }, Ua = function(e, r, n) {
3858
+ }, xa = function(e, r, n) {
3831
3859
  for (var i in e)
3832
3860
  ci.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
3833
- }, xa = function(e, r, n) {
3861
+ }, Qa = function(e, r, n) {
3834
3862
  if (!Ba(r))
3835
3863
  throw new TypeError("iterator must be a function");
3836
3864
  var i;
3837
- arguments.length >= 3 && (i = n), Ma.call(e) === "[object Array]" ? qa(e, r, i) : typeof e == "string" ? ja(e, r, i) : Ua(e, r, i);
3838
- }, li = xa, Qa = [
3865
+ arguments.length >= 3 && (i = n), qa.call(e) === "[object Array]" ? Ua(e, r, i) : typeof e == "string" ? ja(e, r, i) : xa(e, r, i);
3866
+ }, li = Qa, Ga = [
3839
3867
  "Float32Array",
3840
3868
  "Float64Array",
3841
3869
  "Int8Array",
@@ -3847,11 +3875,11 @@ var $a = xe ? function(e) {
3847
3875
  "Uint32Array",
3848
3876
  "BigInt64Array",
3849
3877
  "BigUint64Array"
3850
- ], Ht = Qa, Ga = typeof globalThis > "u" ? Ar : globalThis, di = function() {
3878
+ ], Ht = Ga, Ka = typeof globalThis > "u" ? Ar : globalThis, di = function() {
3851
3879
  for (var e = [], r = 0; r < Ht.length; r++)
3852
- typeof Ga[Ht[r]] == "function" && (e[e.length] = Ht[r]);
3880
+ typeof Ka[Ht[r]] == "function" && (e[e.length] = Ht[r]);
3853
3881
  return e;
3854
- }, Tt = li, Ka = di, yn = Lr, kr = Cr, vt = $t, za = kr("Object.prototype.toString"), fi = Rt(), mn = typeof globalThis > "u" ? Ar : globalThis, yr = Ka(), Pr = kr("String.prototype.slice"), Wt = Object.getPrototypeOf, Ha = kr("Array.prototype.indexOf", !0) || function(e, r) {
3882
+ }, Tt = li, za = di, yn = Lr, kr = Cr, vt = $t, Ha = kr("Object.prototype.toString"), fi = Rt(), mn = typeof globalThis > "u" ? Ar : globalThis, yr = za(), Pr = kr("String.prototype.slice"), Wt = Object.getPrototypeOf, Wa = kr("Array.prototype.indexOf", !0) || function(e, r) {
3855
3883
  for (var n = 0; n < e.length; n += 1)
3856
3884
  if (e[n] === r)
3857
3885
  return n;
@@ -3871,7 +3899,7 @@ fi && vt && Wt ? Tt(yr, function(t) {
3871
3899
  var e = new mn[t](), r = e.slice || e.set;
3872
3900
  r && (Ot["$" + t] = yn(r));
3873
3901
  });
3874
- var Wa = function(e) {
3902
+ var Ya = function(e) {
3875
3903
  var r = !1;
3876
3904
  return Tt(Ot, function(n, i) {
3877
3905
  if (!r)
@@ -3880,7 +3908,7 @@ var Wa = function(e) {
3880
3908
  } catch {
3881
3909
  }
3882
3910
  }), r;
3883
- }, Ya = function(e) {
3911
+ }, Ja = function(e) {
3884
3912
  var r = !1;
3885
3913
  return Tt(Ot, function(n, i) {
3886
3914
  if (!r)
@@ -3889,15 +3917,15 @@ var Wa = function(e) {
3889
3917
  } catch {
3890
3918
  }
3891
3919
  }), r;
3892
- }, Ja = function(e) {
3920
+ }, Xa = function(e) {
3893
3921
  if (!e || typeof e != "object")
3894
3922
  return !1;
3895
3923
  if (!fi) {
3896
- var r = Pr(za(e), 8, -1);
3897
- return Ha(yr, r) > -1 ? r : r !== "Object" ? !1 : Ya(e);
3924
+ var r = Pr(Ha(e), 8, -1);
3925
+ return Wa(yr, r) > -1 ? r : r !== "Object" ? !1 : Ja(e);
3898
3926
  }
3899
- return vt ? Wa(e) : null;
3900
- }, _t = li, Xa = di, gn = Lr, Nr = Cr, St = $t, Za = Nr("Object.prototype.toString"), pi = Rt(), bn = typeof globalThis > "u" ? Ar : globalThis, mr = Xa(), Fr = Nr("String.prototype.slice"), Yt = Object.getPrototypeOf, eu = Nr("Array.prototype.indexOf", !0) || function(e, r) {
3927
+ return vt ? Ya(e) : null;
3928
+ }, _t = li, Za = di, gn = Lr, Nr = Cr, St = $t, eu = Nr("Object.prototype.toString"), pi = Rt(), bn = typeof globalThis > "u" ? Ar : globalThis, mr = Za(), Fr = Nr("String.prototype.slice"), Yt = Object.getPrototypeOf, tu = Nr("Array.prototype.indexOf", !0) || function(e, r) {
3901
3929
  for (var n = 0; n < e.length; n += 1)
3902
3930
  if (e[n] === r)
3903
3931
  return n;
@@ -3917,7 +3945,7 @@ pi && St && Yt ? _t(mr, function(t) {
3917
3945
  var e = new bn[t](), r = e.slice || e.set;
3918
3946
  r && (Lt["$" + t] = gn(r));
3919
3947
  });
3920
- var tu = function(e) {
3948
+ var ru = function(e) {
3921
3949
  var r = !1;
3922
3950
  return _t(
3923
3951
  // eslint-disable-next-line no-extra-parens
@@ -3933,7 +3961,7 @@ var tu = function(e) {
3933
3961
  }
3934
3962
  }
3935
3963
  ), r;
3936
- }, ru = function(e) {
3964
+ }, nu = function(e) {
3937
3965
  var r = !1;
3938
3966
  return _t(
3939
3967
  // eslint-disable-next-line no-extra-parens
@@ -3949,19 +3977,19 @@ var tu = function(e) {
3949
3977
  }
3950
3978
  }
3951
3979
  ), r;
3952
- }, nu = function(e) {
3980
+ }, iu = function(e) {
3953
3981
  if (!e || typeof e != "object")
3954
3982
  return !1;
3955
3983
  if (!pi) {
3956
- var r = Fr(Za(e), 8, -1);
3957
- return eu(mr, r) > -1 ? r : r !== "Object" ? !1 : ru(e);
3984
+ var r = Fr(eu(e), 8, -1);
3985
+ return tu(mr, r) > -1 ? r : r !== "Object" ? !1 : nu(e);
3958
3986
  }
3959
- return St ? tu(e) : null;
3960
- }, iu = nu, ou = function(e) {
3961
- return !!iu(e);
3987
+ return St ? ru(e) : null;
3988
+ }, ou = iu, su = function(e) {
3989
+ return !!ou(e);
3962
3990
  };
3963
3991
  (function(t) {
3964
- var e = wa, r = Oa, n = Ja, i = ou;
3992
+ var e = Aa, r = _a, n = Xa, i = su;
3965
3993
  function o(y) {
3966
3994
  return y.call.bind(y);
3967
3995
  }
@@ -4016,14 +4044,14 @@ var tu = function(e) {
4016
4044
  return n(y) === "Int32Array";
4017
4045
  }
4018
4046
  t.isInt32Array = O;
4019
- function ie(y) {
4047
+ function oe(y) {
4020
4048
  return n(y) === "Float32Array";
4021
4049
  }
4022
- t.isFloat32Array = ie;
4023
- function oe(y) {
4050
+ t.isFloat32Array = oe;
4051
+ function se(y) {
4024
4052
  return n(y) === "Float64Array";
4025
4053
  }
4026
- t.isFloat64Array = oe;
4054
+ t.isFloat64Array = se;
4027
4055
  function Ne(y) {
4028
4056
  return n(y) === "BigInt64Array";
4029
4057
  }
@@ -4036,10 +4064,10 @@ var tu = function(e) {
4036
4064
  return u(y) === "[object Map]";
4037
4065
  }
4038
4066
  fe.working = typeof Map < "u" && fe(/* @__PURE__ */ new Map());
4039
- function Mt(y) {
4067
+ function Bt(y) {
4040
4068
  return typeof Map > "u" ? !1 : fe.working ? fe(y) : y instanceof Map;
4041
4069
  }
4042
- t.isMap = Mt;
4070
+ t.isMap = Bt;
4043
4071
  function we(y) {
4044
4072
  return u(y) === "[object Set]";
4045
4073
  }
@@ -4144,7 +4172,7 @@ var tu = function(e) {
4144
4172
  });
4145
4173
  });
4146
4174
  })(Xn);
4147
- var su = function(e) {
4175
+ var au = function(e) {
4148
4176
  return e && typeof e == "object" && typeof e.copy == "function" && typeof e.fill == "function" && typeof e.readUInt8 == "function";
4149
4177
  }, gr = { exports: {} };
4150
4178
  typeof Object.create == "function" ? gr.exports = function(e, r) {
@@ -4164,7 +4192,7 @@ typeof Object.create == "function" ? gr.exports = function(e, r) {
4164
4192
  n.prototype = r.prototype, e.prototype = new n(), e.prototype.constructor = e;
4165
4193
  }
4166
4194
  };
4167
- var au = gr.exports;
4195
+ var uu = gr.exports;
4168
4196
  (function(t) {
4169
4197
  var e = Object.getOwnPropertyDescriptors || function(h) {
4170
4198
  for (var m = Object.keys(h), A = {}, C = 0; C < m.length; C++)
@@ -4195,7 +4223,7 @@ var au = gr.exports;
4195
4223
  return L;
4196
4224
  }
4197
4225
  }), I = A[m]; m < C; I = A[++m])
4198
- F(I) || !oe(I) ? k += " " + I : k += " " + s(I);
4226
+ F(I) || !se(I) ? k += " " + I : k += " " + s(I);
4199
4227
  return k;
4200
4228
  }, t.deprecate = function(d, h) {
4201
4229
  if (typeof E < "u" && E.noDeprecation === !0)
@@ -4296,7 +4324,7 @@ var au = gr.exports;
4296
4324
  var L = h.name ? ": " + h.name : "";
4297
4325
  return d.stylize("[Function" + L + "]", "special");
4298
4326
  }
4299
- if (ie(h))
4327
+ if (oe(h))
4300
4328
  return d.stylize(RegExp.prototype.toString.call(h), "regexp");
4301
4329
  if (Ne(h))
4302
4330
  return d.stylize(Date.prototype.toString.call(h), "date");
@@ -4308,10 +4336,10 @@ var au = gr.exports;
4308
4336
  var ut = h.name ? ": " + h.name : "";
4309
4337
  D = " [Function" + ut + "]";
4310
4338
  }
4311
- if (ie(h) && (D = " " + RegExp.prototype.toString.call(h)), Ne(h) && (D = " " + Date.prototype.toUTCString.call(h)), Ie(h) && (D = " " + p(h)), k.length === 0 && (!H || h.length == 0))
4339
+ if (oe(h) && (D = " " + RegExp.prototype.toString.call(h)), Ne(h) && (D = " " + Date.prototype.toUTCString.call(h)), Ie(h) && (D = " " + p(h)), k.length === 0 && (!H || h.length == 0))
4312
4340
  return Te[0] + D + Te[1];
4313
4341
  if (m < 0)
4314
- return ie(h) ? d.stylize(RegExp.prototype.toString.call(h), "regexp") : d.stylize("[Object]", "special");
4342
+ return oe(h) ? d.stylize(RegExp.prototype.toString.call(h), "regexp") : d.stylize("[Object]", "special");
4315
4343
  d.seen.push(h);
4316
4344
  var Ve;
4317
4345
  return H ? Ve = v(d, h, m, I, k) : Ve = k.map(function(ct) {
@@ -4417,31 +4445,31 @@ var au = gr.exports;
4417
4445
  return d === void 0;
4418
4446
  }
4419
4447
  t.isUndefined = O;
4420
- function ie(d) {
4421
- return oe(d) && we(d) === "[object RegExp]";
4422
- }
4423
- t.isRegExp = ie, t.types.isRegExp = ie;
4424
4448
  function oe(d) {
4449
+ return se(d) && we(d) === "[object RegExp]";
4450
+ }
4451
+ t.isRegExp = oe, t.types.isRegExp = oe;
4452
+ function se(d) {
4425
4453
  return typeof d == "object" && d !== null;
4426
4454
  }
4427
- t.isObject = oe;
4455
+ t.isObject = se;
4428
4456
  function Ne(d) {
4429
- return oe(d) && we(d) === "[object Date]";
4457
+ return se(d) && we(d) === "[object Date]";
4430
4458
  }
4431
4459
  t.isDate = Ne, t.types.isDate = Ne;
4432
4460
  function Ie(d) {
4433
- return oe(d) && (we(d) === "[object Error]" || d instanceof Error);
4461
+ return se(d) && (we(d) === "[object Error]" || d instanceof Error);
4434
4462
  }
4435
4463
  t.isError = Ie, t.types.isNativeError = Ie;
4436
4464
  function fe(d) {
4437
4465
  return typeof d == "function";
4438
4466
  }
4439
4467
  t.isFunction = fe;
4440
- function Mt(d) {
4468
+ function Bt(d) {
4441
4469
  return d === null || typeof d == "boolean" || typeof d == "number" || typeof d == "string" || typeof d == "symbol" || // ES6 symbol
4442
4470
  typeof d > "u";
4443
4471
  }
4444
- t.isPrimitive = Mt, t.isBuffer = su;
4472
+ t.isPrimitive = Bt, t.isBuffer = au;
4445
4473
  function we(d) {
4446
4474
  return Object.prototype.toString.call(d);
4447
4475
  }
@@ -4472,8 +4500,8 @@ var au = gr.exports;
4472
4500
  }
4473
4501
  t.log = function() {
4474
4502
  console.log("%s - %s", qt(), t.format.apply(t, arguments));
4475
- }, t.inherits = au, t._extend = function(d, h) {
4476
- if (!h || !oe(h)) return d;
4503
+ }, t.inherits = uu, t._extend = function(d, h) {
4504
+ if (!h || !se(h)) return d;
4477
4505
  for (var m = Object.keys(h), A = m.length; A--; )
4478
4506
  d[m[A]] = h[m[A]];
4479
4507
  return d;
@@ -4556,7 +4584,7 @@ var au = gr.exports;
4556
4584
  }
4557
4585
  t.callbackify = at;
4558
4586
  })(Dt);
4559
- const { inherits: uu, format: Jt } = Dt;
4587
+ const { inherits: cu, format: Jt } = Dt;
4560
4588
  function Oe(t, e, r = Error) {
4561
4589
  if (!t) throw new Error("Avvio error code must not be empty");
4562
4590
  if (!e) throw new Error("Avvio base error message must not be empty");
@@ -4567,7 +4595,7 @@ function Oe(t, e, r = Error) {
4567
4595
  }
4568
4596
  return n.prototype[Symbol.toStringTag] = "Error", n.prototype.toString = function() {
4569
4597
  return `${this.name} [${this.code}]: ${this.message}`;
4570
- }, uu(n, r), n;
4598
+ }, cu(n, r), n;
4571
4599
  }
4572
4600
  var hi = {
4573
4601
  createError: Oe,
@@ -4595,7 +4623,7 @@ var hi = {
4595
4623
  "AVV_ERR_READY_TIMEOUT",
4596
4624
  "Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise"
4597
4625
  )
4598
- }, cu = function t(e, r, n) {
4626
+ }, lu = function t(e, r, n) {
4599
4627
  r === void 0 && (r = ""), n || (n = {});
4600
4628
  var i = function(u) {
4601
4629
  var l = {
@@ -4617,8 +4645,8 @@ var hi = {
4617
4645
  return r + i(c ? "└" : "├") + i("─") + i(f ? "┬" : "─") + " " + t(u, p, n).slice(r.length + 2);
4618
4646
  }).join("");
4619
4647
  };
4620
- const lu = cu, vn = Symbol("avvio.TimeTree.untrackNode"), Xt = Symbol("avvio.TimeTree.trackNode"), Sn = Symbol("avvio.TimeTree.getParent"), wn = Symbol("avvio.TimeTree.getNode"), An = Symbol("avvio.TimeTree.addNode");
4621
- let du = class {
4648
+ const du = lu, vn = Symbol("avvio.TimeTree.untrackNode"), Xt = Symbol("avvio.TimeTree.trackNode"), Sn = Symbol("avvio.TimeTree.getParent"), wn = Symbol("avvio.TimeTree.getNode"), An = Symbol("avvio.TimeTree.addNode");
4649
+ let fu = class {
4622
4650
  constructor() {
4623
4651
  this.root = null, this.tableId = /* @__PURE__ */ new Map(), this.tableLabel = /* @__PURE__ */ new Map();
4624
4652
  }
@@ -4672,11 +4700,11 @@ let du = class {
4672
4700
  }
4673
4701
  prittyPrint() {
4674
4702
  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());
4675
- return lu(r);
4703
+ return du(r);
4676
4704
  }
4677
4705
  };
4678
- var fu = du, Dr = { exports: {} }, br = { exports: {} }, Zt, En;
4679
- function pu() {
4706
+ var pu = fu, Dr = { exports: {} }, br = { exports: {} }, Zt, En;
4707
+ function hu() {
4680
4708
  if (En) return Zt;
4681
4709
  En = 1;
4682
4710
  var t = 1e3, e = t * 60, r = e * 60, n = r * 24, i = n * 7, o = n * 365.25;
@@ -4757,8 +4785,8 @@ function pu() {
4757
4785
  }
4758
4786
  return Zt;
4759
4787
  }
4760
- function hu(t) {
4761
- r.debug = r, r.default = r, r.coerce = u, r.disable = o, r.enable = i, r.enabled = s, r.humanize = pu(), r.destroy = l, Object.keys(t).forEach((c) => {
4788
+ function yu(t) {
4789
+ r.debug = r, r.default = r, r.coerce = u, r.disable = o, r.enable = i, r.enabled = s, r.humanize = hu(), r.destroy = l, Object.keys(t).forEach((c) => {
4762
4790
  r[c] = t[c];
4763
4791
  }), r.names = [], r.skips = [], r.formatters = {};
4764
4792
  function e(c) {
@@ -4780,10 +4808,10 @@ function hu(t) {
4780
4808
  if (V === "%%")
4781
4809
  return "%";
4782
4810
  re++;
4783
- const ie = r.formatters[O];
4784
- if (typeof ie == "function") {
4785
- const oe = g[re];
4786
- V = ie.call(S, oe), g.splice(re, 1), re--;
4811
+ const oe = r.formatters[O];
4812
+ if (typeof oe == "function") {
4813
+ const se = g[re];
4814
+ V = oe.call(S, se), g.splice(re, 1), re--;
4787
4815
  }
4788
4816
  return V;
4789
4817
  }), r.formatArgs.call(S, g), (S.log || r.log).apply(S, g);
@@ -4838,7 +4866,7 @@ function hu(t) {
4838
4866
  }
4839
4867
  return r.enable(r.load()), r;
4840
4868
  }
4841
- var yu = hu;
4869
+ var mu = yu;
4842
4870
  (function(t, e) {
4843
4871
  e.formatArgs = n, e.save = i, e.load = o, e.useColors = r, e.storage = s(), e.destroy = /* @__PURE__ */ (() => {
4844
4872
  let u = !1;
@@ -4962,7 +4990,7 @@ var yu = hu;
4962
4990
  } catch {
4963
4991
  }
4964
4992
  }
4965
- t.exports = yu(e);
4993
+ t.exports = mu(e);
4966
4994
  const { formatters: a } = t.exports;
4967
4995
  a.j = function(u) {
4968
4996
  try {
@@ -4973,27 +5001,27 @@ var yu = hu;
4973
5001
  };
4974
5002
  })(br, br.exports);
4975
5003
  var yi = br.exports;
4976
- const mu = Un, gu = Jn.EventEmitter, bu = Dt.inherits, U = yi("avvio"), { AVV_ERR_READY_TIMEOUT: vu } = hi, er = Symbol.for("plugin-meta");
4977
- function Su(t, e) {
5004
+ const gu = jn, bu = Jn.EventEmitter, vu = Dt.inherits, j = yi("avvio"), { AVV_ERR_READY_TIMEOUT: Su } = hi, er = Symbol.for("plugin-meta");
5005
+ function wu(t, e) {
4978
5006
  return t[er] && t[er].name ? t[er].name : typeof e < "u" && typeof e != "function" && e.name ? e.name : t.name ? t.name : t.toString().split(`
4979
5007
  `).slice(0, 2).map((r) => r.trim()).join(" -- ");
4980
5008
  }
4981
- function wu() {
5009
+ function Au() {
4982
5010
  const t = {};
4983
5011
  return t.promise = new Promise((e, r) => {
4984
5012
  t.resolve = e, t.reject = r;
4985
5013
  }), t;
4986
5014
  }
4987
5015
  function Ye(t, e, r, n, i) {
4988
- 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 = Su(e, r), this.isAfter = n, this.q = mu(t, Au, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
5016
+ 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 = wu(e, r), this.isAfter = n, this.q = gu(t, Eu, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
4989
5017
  }
4990
- bu(Ye, gu);
5018
+ vu(Ye, bu);
4991
5019
  Ye.prototype.exec = function(t, e) {
4992
5020
  const r = this.func;
4993
5021
  let n = !1;
4994
5022
  const i = this.name;
4995
5023
  if (this.parent._error && !this.isAfter) {
4996
- U("skipping loading of plugin as parent errored and it is not an after", i), E.nextTick(e);
5024
+ j("skipping loading of plugin as parent errored and it is not an after", i), E.nextTick(e);
4997
5025
  return;
4998
5026
  }
4999
5027
  if (this.isAfter)
@@ -5002,24 +5030,24 @@ Ye.prototype.exec = function(t, e) {
5002
5030
  try {
5003
5031
  this.server = this.parent.override(t, r, this.opts);
5004
5032
  } catch (u) {
5005
- return U("override errored", i), e(u);
5033
+ return j("override errored", i), e(u);
5006
5034
  }
5007
- this.opts = typeof this.opts == "function" ? this.opts(this.server) : this.opts, U("exec", i);
5035
+ this.opts = typeof this.opts == "function" ? this.opts(this.server) : this.opts, j("exec", i);
5008
5036
  let o;
5009
5037
  const s = (u) => {
5010
5038
  if (n) {
5011
- U("loading complete", i);
5039
+ j("loading complete", i);
5012
5040
  return;
5013
5041
  }
5014
- this._error = u, U(u ? "exec errored" : "exec completed", i), n = !0, o && clearTimeout(o), e(u);
5042
+ this._error = u, j(u ? "exec errored" : "exec completed", i), n = !0, o && clearTimeout(o), e(u);
5015
5043
  };
5016
- this.timeout > 0 && (U("setting up timeout", i, this.timeout), o = setTimeout(function() {
5017
- U("timed out", i), o = null;
5018
- const u = new vu(i);
5044
+ this.timeout > 0 && (j("setting up timeout", i, this.timeout), o = setTimeout(function() {
5045
+ j("timed out", i), o = null;
5046
+ const u = new Su(i);
5019
5047
  u.fn = r, s(u);
5020
5048
  }, this.timeout)), this.started = !0, this.emit("start", this.server ? this.server.name : null, this.name, Date.now());
5021
5049
  const a = r(this.server, this.opts, s);
5022
- a && typeof a.then == "function" && (U("exec: resolving promise", i), a.then(
5050
+ a && typeof a.then == "function" && (j("exec: resolving promise", i), a.then(
5023
5051
  () => E.nextTick(s),
5024
5052
  (u) => E.nextTick(s, u)
5025
5053
  ));
@@ -5029,41 +5057,41 @@ Ye.prototype.loadedSoFar = function() {
5029
5057
  return Promise.resolve();
5030
5058
  const t = () => {
5031
5059
  this.server.after((r, n) => {
5032
- 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, E.nextTick(n, r);
5060
+ this._error = r, this.q.pause(), r ? (j("rejecting promise", this.name, r), this._promise.reject(r)) : (j("resolving promise", this.name), this._promise.resolve()), this._promise = null, E.nextTick(n, r);
5033
5061
  }), this.q.resume();
5034
5062
  };
5035
5063
  let e;
5036
- return this._promise ? e = Promise.resolve() : (this._promise = wu(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
5064
+ return this._promise ? e = Promise.resolve() : (this._promise = Au(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
5037
5065
  };
5038
5066
  Ye.prototype.enqueue = function(t, e) {
5039
- U("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
5067
+ j("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
5040
5068
  };
5041
5069
  Ye.prototype.finish = function(t, e) {
5042
- U("finish", this.name, t);
5070
+ j("finish", this.name, t);
5043
5071
  const r = () => {
5044
- this.loaded || (U("loaded", this.name), this.emit("loaded", this.server ? this.server.name : null, this.name, Date.now()), this.loaded = !0, e(t));
5072
+ this.loaded || (j("loaded", this.name), this.emit("loaded", this.server ? this.server.name : null, this.name, Date.now()), this.loaded = !0, e(t));
5045
5073
  };
5046
5074
  if (t) {
5047
5075
  this._promise && (this._promise.reject(t), this._promise = null), r();
5048
5076
  return;
5049
5077
  }
5050
5078
  const n = () => {
5051
- if (U("check", this.name, this.q.length(), this.q.running(), this._promise), this.q.length() === 0 && this.q.running() === 0)
5079
+ if (j("check", this.name, this.q.length(), this.q.running(), this._promise), this.q.length() === 0 && this.q.running() === 0)
5052
5080
  if (this._promise) {
5053
5081
  const i = () => {
5054
- U("wrap"), queueMicrotask(n);
5082
+ j("wrap"), queueMicrotask(n);
5055
5083
  };
5056
5084
  this._promise.resolve(), this._promise.promise.then(i, i), this._promise = null;
5057
5085
  } else
5058
5086
  r();
5059
5087
  else
5060
- U("delayed", this.name), this.q.drain = () => {
5061
- U("drain", this.name), this.q.drain = Eu, queueMicrotask(n);
5088
+ j("delayed", this.name), this.q.drain = () => {
5089
+ j("drain", this.name), this.q.drain = Iu, queueMicrotask(n);
5062
5090
  };
5063
5091
  };
5064
5092
  queueMicrotask(n), this.q.resume();
5065
5093
  };
5066
- function Au(t, e) {
5094
+ function Eu(t, e) {
5067
5095
  const r = this;
5068
5096
  E.nextTick(Rr.bind(r), t, e);
5069
5097
  }
@@ -5081,19 +5109,19 @@ function Rr(t, e) {
5081
5109
  });
5082
5110
  });
5083
5111
  }
5084
- function Eu() {
5112
+ function Iu() {
5085
5113
  }
5086
5114
  Dr.exports = Ye;
5087
5115
  Dr.exports.loadPlugin = Rr;
5088
- var Iu = Dr.exports;
5089
- const In = Un, Tu = Jn.EventEmitter, Ou = Dt.inherits, {
5116
+ var Tu = Dr.exports;
5117
+ const In = jn, Ou = Jn.EventEmitter, _u = Dt.inherits, {
5090
5118
  AVV_ERR_EXPOSE_ALREADY_DEFINED: tr,
5091
5119
  AVV_ERR_CALLBACK_NOT_FN: tt,
5092
- AVV_ERR_PLUGIN_NOT_VALID: _u,
5093
- AVV_ERR_ROOT_PLG_BOOTED: Lu,
5094
- AVV_ERR_READY_TIMEOUT: Cu
5095
- } = hi, ku = fu, vr = Iu, He = yi("avvio"), Ct = Symbol("kAvvio"), rr = Symbol("kThenifyDoNotWrap");
5096
- function Pu(t, e, r) {
5120
+ AVV_ERR_PLUGIN_NOT_VALID: Lu,
5121
+ AVV_ERR_ROOT_PLG_BOOTED: Cu,
5122
+ AVV_ERR_READY_TIMEOUT: ku
5123
+ } = hi, Pu = pu, vr = Tu, He = yi("avvio"), Ct = Symbol("kAvvio"), rr = Symbol("kThenifyDoNotWrap");
5124
+ function Nu(t, e, r) {
5097
5125
  const n = e.expose || {}, i = n.use || "use", o = n.after || "after", s = n.ready || "ready", a = n.onClose || "onClose", u = n.close || "close";
5098
5126
  if (t[i])
5099
5127
  throw new tr(i);
@@ -5112,7 +5140,7 @@ function Pu(t, e, r) {
5112
5140
  }, t[a] = function(l) {
5113
5141
  if (typeof l != "function")
5114
5142
  throw new tt(a, typeof l);
5115
- return r.onClose(Vu(l, this)), this;
5143
+ return r.onClose($u(l, this)), this;
5116
5144
  }, t[u] = function(l) {
5117
5145
  if (l && typeof l != "function")
5118
5146
  throw new tt(u, typeof l);
@@ -5122,13 +5150,13 @@ function Pu(t, e, r) {
5122
5150
  function G(t, e, r) {
5123
5151
  if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof G)) {
5124
5152
  const n = new G(t, e, r);
5125
- return t && Pu(t, e, n), n;
5153
+ return t && Nu(t, e, n), n;
5126
5154
  }
5127
- e.autostart !== !1 && (e.autostart = !0), t = t || this, this._timeout = Number(e.timeout) || 0, this._server = t, this._current = [], this._error = null, this._isOnCloseHandlerKey = Symbol("isOnCloseHandler"), this._lastUsed = null, this.setMaxListeners(0), r && this.once("start", r), this.started = !1, this.booted = !1, this.pluginTree = new ku(), this._readyQ = In(this, gi, 1), this._readyQ.pause(), this._readyQ.drain = () => {
5155
+ e.autostart !== !1 && (e.autostart = !0), t = t || this, this._timeout = Number(e.timeout) || 0, this._server = t, this._current = [], this._error = null, this._isOnCloseHandlerKey = Symbol("isOnCloseHandler"), this._lastUsed = null, this.setMaxListeners(0), r && this.once("start", r), this.started = !1, this.booted = !1, this.pluginTree = new Pu(), this._readyQ = In(this, gi, 1), this._readyQ.pause(), this._readyQ.drain = () => {
5128
5156
  this.emit("start"), this._readyQ.drain = Tn;
5129
- }, this._closeQ = In(this, Ru, 1), this._closeQ.pause(), this._closeQ.drain = () => {
5157
+ }, this._closeQ = In(this, Vu, 1), this._closeQ.pause(), this._closeQ.drain = () => {
5130
5158
  this.emit("close"), this._closeQ.drain = Tn;
5131
- }, this._doStart = null, this._root = new vr(this, Nu.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
5159
+ }, this._doStart = null, this._root = new vr(this, Fu.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
5132
5160
  const s = this.pluginTree.start(null, i, o);
5133
5161
  this._root.once("loaded", (a, u, l) => {
5134
5162
  this.pluginTree.stop(s, l);
@@ -5148,19 +5176,19 @@ function G(t, e, r) {
5148
5176
  this._readyQ.resume();
5149
5177
  });
5150
5178
  }
5151
- function Nu(t, e, r) {
5179
+ function Fu(t, e, r) {
5152
5180
  this._doStart = r, e.autostart && this.start();
5153
5181
  }
5154
- Ou(G, Tu);
5182
+ _u(G, Ou);
5155
5183
  G.prototype.start = function() {
5156
5184
  return this.started = !0, E.nextTick(this._doStart), this;
5157
5185
  };
5158
5186
  G.prototype.override = function(t, e, r) {
5159
5187
  return t;
5160
5188
  };
5161
- function Fu(t) {
5189
+ function Du(t) {
5162
5190
  if (t && typeof t == "object" && typeof t.default == "function" && (t = t.default), !(t && (typeof t == "function" || typeof t.then == "function")))
5163
- throw new _u(typeof t);
5191
+ throw new Lu(typeof t);
5164
5192
  return t;
5165
5193
  }
5166
5194
  G.prototype[Ct] = !0;
@@ -5173,8 +5201,8 @@ G.prototype._loadRegistered = function() {
5173
5201
  };
5174
5202
  Object.defineProperty(G.prototype, "then", { get: mi });
5175
5203
  G.prototype._addPlugin = function(t, e, r) {
5176
- if (t = Fu(t), e = e || {}, this.booted)
5177
- throw new Lu();
5204
+ if (t = Du(t), e = e || {}, this.booted)
5205
+ throw new Cu();
5178
5206
  const n = this._current[0], i = new vr(this, t, e, r);
5179
5207
  if (i.once("start", (o, s, a) => {
5180
5208
  const u = this.pluginTree.start(n.name, s, a);
@@ -5269,14 +5297,14 @@ function gi(t, e) {
5269
5297
  };
5270
5298
  t.length === 2 ? t(n, o) : t(n, r, o);
5271
5299
  } else
5272
- Du.call(this, t, n, r, e);
5300
+ Ru.call(this, t, n, r, e);
5273
5301
  }
5274
- function Du(t, e, r, n) {
5302
+ function Ru(t, e, r, n) {
5275
5303
  const i = t.name;
5276
5304
  He("setting up ready timeout", i, this._timeout);
5277
5305
  let o = setTimeout(() => {
5278
5306
  He("timed out", i), o = null;
5279
- const a = new Cu(i);
5307
+ const a = new ku(i);
5280
5308
  a.fn = t, this._error = a, n(a);
5281
5309
  }, this._timeout);
5282
5310
  t.length === 2 ? t(e, s.bind(this)) : t(e, r, s.bind(this));
@@ -5284,7 +5312,7 @@ function Du(t, e, r, n) {
5284
5312
  o && (clearTimeout(o), this._error = a, n(this._error));
5285
5313
  }
5286
5314
  }
5287
- function Ru(t, e) {
5315
+ function Vu(t, e) {
5288
5316
  const r = this._server, n = t[this._isOnCloseHandlerKey];
5289
5317
  if (t.length === 0 || t.length === 1) {
5290
5318
  let i;
@@ -5294,7 +5322,7 @@ function Ru(t, e) {
5294
5322
  )) : E.nextTick(e);
5295
5323
  } else t.length === 2 ? t(n ? r : this._error, e) : n ? t(r, e) : t(this._error, r, e);
5296
5324
  }
5297
- function Vu(t, e) {
5325
+ function $u(t, e) {
5298
5326
  return r.bind(e);
5299
5327
  function r(n, i) {
5300
5328
  let o;
@@ -5324,8 +5352,8 @@ Er.exports.express = function(t) {
5324
5352
  }
5325
5353
  });
5326
5354
  };
5327
- var $u = Er.exports;
5328
- const Bu = /* @__PURE__ */ fs($u);
5355
+ var Mu = Er.exports;
5356
+ const Bu = /* @__PURE__ */ ps(Mu);
5329
5357
  (function() {
5330
5358
  if (window.requestAnimationFrame && window.cancelAnimationFrame)
5331
5359
  return;
@@ -5343,13 +5371,13 @@ const Bu = /* @__PURE__ */ fs($u);
5343
5371
  }, window.cancelAnimationFrame = clearTimeout;
5344
5372
  }
5345
5373
  })();
5346
- function uc(t, e = !0, r = !0, n = { friendsTab: "enabled" }) {
5374
+ function cc(t, e = !0, r = !0, n = { friendsTab: "enabled" }) {
5347
5375
  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 = Bu(/* @__PURE__ */ Object.create({}), { autostart: !1 });
5348
- return s.use(Uo, { friendsTab: n.friendsTab }), s.use(Ro, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(Mo, { videoPlayerController: n?.videoPlayerController }), s.use(jo, {
5376
+ return s.use(xo, { friendsTab: n.friendsTab, theme: n.theme, themeMode: n.themeMode }), s.use(Vo, { onDeepLinkHandled: n?.onDeepLinkHandled }), s.use(qo, { videoPlayerController: n?.videoPlayerController }), s.use(jo, {
5349
5377
  onContentActivate: n?.onContentActivate,
5350
5378
  withAd: n?.withAd,
5351
5379
  withAdNotification: n?.withAdNotification
5352
- }), s.use(Zi, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(io), s.use(Bo), s.use(ts), s.use(To), s.use(ds), s.after((a, u, l) => {
5380
+ }), s.use(eo, { sdkKey: t, host: i, analyticsHost: o, version: n?.version }), s.use(oo), s.use(Bo), s.use(rs), s.use(Oo), s.use(fs), s.after((a, u, l) => {
5353
5381
  if (a)
5354
5382
  throw a;
5355
5383
  u.ready(), l();
@@ -5362,5 +5390,5 @@ function uc(t, e = !0, r = !0, n = { friendsTab: "enabled" }) {
5362
5390
  }), s;
5363
5391
  }
5364
5392
  export {
5365
- uc as StreamLayer
5393
+ cc as StreamLayer
5366
5394
  };