@streamlayer/sdk-web 1.14.7 → 1.15.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/cjs/index.js +6 -6
- package/lib/es/index.js +121 -94
- package/package.json +12 -12
package/lib/es/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { pino as _i } from "pino";
|
|
2
|
-
import { QuestionType as T, QuestionStatus as Y, AdUnit as ie, PromotionType as D, NotificationEnabled as $r, SilenceSetting as ki, NotificationUseContentTexts as Ur, UseAsNotification as Pi, FactoidMediaMode as
|
|
2
|
+
import { QuestionType as T, QuestionStatus as Y, AdUnit as ie, PromotionType as D, NotificationEnabled as $r, SilenceSetting as ki, NotificationUseContentTexts as Ur, UseAsNotification as Pi, FactoidMediaMode as Li } from "@streamlayer/sl-eslib/interactive/interactive.common_pb";
|
|
3
3
|
import { Feed as te, PickHistoryStatus as pt } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
|
|
4
4
|
import { SdkOverlayType as $ } from "@streamlayer/sl-eslib/sdkSettings/sdkSettings.common_pb";
|
|
5
5
|
import { InvitationCategory as qr, InvitationFrom as jr } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
|
|
6
|
-
import { computed as
|
|
6
|
+
import { computed as Ni, map as Ci, atom as Rt, batched as xr, onMount as Er, onStart as Di } from "nanostores";
|
|
7
7
|
import { v4 as Ot } from "uuid";
|
|
8
8
|
import { ConnectError as st, Code as se, createContextKey as Qr, createClient as Gr, createContextValues as Ri } from "@connectrpc/connect";
|
|
9
9
|
import { createGrpcWebTransport as Hr } from "@connectrpc/connect-web";
|
|
@@ -69,20 +69,20 @@ function Bi(t) {
|
|
|
69
69
|
}
|
|
70
70
|
}
|
|
71
71
|
}
|
|
72
|
-
var Ee = [], Ke = !1,
|
|
72
|
+
var Ee = [], Ke = !1, Le, gt = -1;
|
|
73
73
|
function Mi() {
|
|
74
|
-
!Ke || !
|
|
74
|
+
!Ke || !Le || (Ke = !1, Le.length ? Ee = Le.concat(Ee) : gt = -1, Ee.length && Bn());
|
|
75
75
|
}
|
|
76
76
|
function Bn() {
|
|
77
77
|
if (!Ke) {
|
|
78
78
|
var t = Vn(Mi);
|
|
79
79
|
Ke = !0;
|
|
80
80
|
for (var e = Ee.length; e; ) {
|
|
81
|
-
for (
|
|
82
|
-
|
|
81
|
+
for (Le = Ee, Ee = []; ++gt < e; )
|
|
82
|
+
Le && Le[gt].run();
|
|
83
83
|
gt = -1, e = Ee.length;
|
|
84
84
|
}
|
|
85
|
-
|
|
85
|
+
Le = null, Ke = !1, Bi(t);
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
G.nextTick = function(t) {
|
|
@@ -196,9 +196,9 @@ class Ft {
|
|
|
196
196
|
}
|
|
197
197
|
const Gi = (t) => {
|
|
198
198
|
const e = Object.keys(t);
|
|
199
|
-
return
|
|
199
|
+
return Ni(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
|
|
200
200
|
};
|
|
201
|
-
class
|
|
201
|
+
class Ne extends Ft {
|
|
202
202
|
getValues = () => this.getStore().get();
|
|
203
203
|
getValue = (e) => this.getStore().get()[e];
|
|
204
204
|
setValue = (e, r) => this.getStore().setKey(e, r);
|
|
@@ -239,7 +239,7 @@ class $n {
|
|
|
239
239
|
listeners = /* @__PURE__ */ new Set();
|
|
240
240
|
settingsKey;
|
|
241
241
|
constructor({ settings: e, ...r }, n) {
|
|
242
|
-
this.settingsKey = Hi[r.type], this.status = Rt(nt.Suspended), this.config = new
|
|
242
|
+
this.settingsKey = Hi[r.type], this.status = Rt(nt.Suspended), this.config = new Ne(ee(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Ne(ee(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Ne(ee({}), `feature:settings:${this.settingsKey}`), this.source = n;
|
|
243
243
|
}
|
|
244
244
|
get featureConfig() {
|
|
245
245
|
return this.config.getStore();
|
|
@@ -352,10 +352,14 @@ const Wi = () => (t) => async (e) => {
|
|
|
352
352
|
},
|
|
353
353
|
response: {}
|
|
354
354
|
};
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
355
|
+
try {
|
|
356
|
+
window.postMessage({
|
|
357
|
+
type: "__GRPC_DEVTOOLS_EXTENSION__",
|
|
358
|
+
data: r
|
|
359
|
+
});
|
|
360
|
+
} catch (n) {
|
|
361
|
+
console.log("devtools error", n);
|
|
362
|
+
}
|
|
359
363
|
try {
|
|
360
364
|
const n = await t(e);
|
|
361
365
|
if (r.received_at = Date.now(), r.response.header = Object.fromEntries(n.header.entries()), r.response.trailer = Object.fromEntries(n.trailer.entries()), e.stream) {
|
|
@@ -366,7 +370,12 @@ const Wi = () => (t) => async (e) => {
|
|
|
366
370
|
stream: !0
|
|
367
371
|
}
|
|
368
372
|
};
|
|
369
|
-
|
|
373
|
+
try {
|
|
374
|
+
window.postMessage(i);
|
|
375
|
+
} catch (o) {
|
|
376
|
+
console.log("devtools error", o);
|
|
377
|
+
}
|
|
378
|
+
return {
|
|
370
379
|
...n,
|
|
371
380
|
message: zi(r, n.message)
|
|
372
381
|
};
|
|
@@ -376,7 +385,11 @@ const Wi = () => (t) => async (e) => {
|
|
|
376
385
|
type: "__GRPC_DEVTOOLS_EXTENSION__",
|
|
377
386
|
data: r
|
|
378
387
|
};
|
|
379
|
-
|
|
388
|
+
try {
|
|
389
|
+
window.postMessage(i);
|
|
390
|
+
} catch (o) {
|
|
391
|
+
console.log("devtools error", o);
|
|
392
|
+
}
|
|
380
393
|
}
|
|
381
394
|
return n;
|
|
382
395
|
} catch (n) {
|
|
@@ -388,7 +401,12 @@ const Wi = () => (t) => async (e) => {
|
|
|
388
401
|
type: "__GRPC_DEVTOOLS_EXTENSION__",
|
|
389
402
|
data: r
|
|
390
403
|
};
|
|
391
|
-
|
|
404
|
+
try {
|
|
405
|
+
window.postMessage(i);
|
|
406
|
+
} catch (o) {
|
|
407
|
+
console.log("devtools error", o);
|
|
408
|
+
}
|
|
409
|
+
throw n;
|
|
392
410
|
}
|
|
393
411
|
};
|
|
394
412
|
window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));
|
|
@@ -451,7 +469,7 @@ class Yi {
|
|
|
451
469
|
ts: /* @__PURE__ */ new Date(),
|
|
452
470
|
log: []
|
|
453
471
|
};
|
|
454
|
-
this.state = new
|
|
472
|
+
this.state = new Ne(ee(o), `subscription:${i.name}:state`), this.options = {
|
|
455
473
|
...i,
|
|
456
474
|
reconnectDelay: i.reconnectDelay ?? 1e3,
|
|
457
475
|
reconnectMaxDelay: i.reconnectMaxDelay ?? 3e4,
|
|
@@ -597,7 +615,7 @@ class Zr {
|
|
|
597
615
|
subscriptions;
|
|
598
616
|
opts;
|
|
599
617
|
constructor(e, r) {
|
|
600
|
-
this.host = e, this.opts = r, this.$headers = new
|
|
618
|
+
this.host = e, this.opts = r, this.$headers = new Ne(ee({
|
|
601
619
|
"sl-device-id": Zi(),
|
|
602
620
|
"sl-device-os": eo(),
|
|
603
621
|
"sl-platform": to(r?.webOS)
|
|
@@ -704,7 +722,7 @@ class Zr {
|
|
|
704
722
|
n.header.set(o, i[o]);
|
|
705
723
|
return r(n);
|
|
706
724
|
};
|
|
707
|
-
this.interceptors.push(e), this.interceptors.push(Wi()), this.opts?.retryable && this.interceptors.push(Xi);
|
|
725
|
+
this.interceptors.push(e), window.localStorage.getItem("SL_GRPC_DEVTOOLS") === "true" ? this.interceptors.push(Wi()) : console.warn("SL GRPC DevTools is disabled. To enable, set SL_GRPC_DEVTOOLS to true in localStorage."), this.opts?.retryable && this.interceptors.push(Xi);
|
|
708
726
|
};
|
|
709
727
|
}
|
|
710
728
|
const ro = (t, e) => {
|
|
@@ -1087,7 +1105,7 @@ const mo = (t, e, r) => {
|
|
|
1087
1105
|
questionId: v.id,
|
|
1088
1106
|
questionType: v.type
|
|
1089
1107
|
}
|
|
1090
|
-
}), n.saveQuestionReceived(E, v.id)), v.answers = v.answers.sort((
|
|
1108
|
+
}), n.saveQuestionReceived(E, v.id)), v.answers = v.answers.sort((N, b) => N.id > b.id ? 1 : -1), { ...g, [v.id]: v };
|
|
1091
1109
|
}, {})
|
|
1092
1110
|
};
|
|
1093
1111
|
},
|
|
@@ -1154,7 +1172,7 @@ const Po = (t) => {
|
|
|
1154
1172
|
notification: i,
|
|
1155
1173
|
promotion: s
|
|
1156
1174
|
};
|
|
1157
|
-
}, ht = (t) => t.startsWith("http://") || t.startsWith("https://") ? new URL(t).toString() : t,
|
|
1175
|
+
}, ht = (t) => t.startsWith("http://") || t.startsWith("https://") ? new URL(t).toString() : t, Lo = ({ gamOptions: t, gamBaseUrl: e }) => {
|
|
1158
1176
|
const r = `${e}?`, n = [];
|
|
1159
1177
|
for (const i in t) {
|
|
1160
1178
|
const o = i.replace(/([a-zA-Z])(?=[A-Z])/g, "$1_").toLowerCase(), s = t[i];
|
|
@@ -1169,7 +1187,7 @@ const Po = (t) => {
|
|
|
1169
1187
|
}
|
|
1170
1188
|
}
|
|
1171
1189
|
return r + n.join("&");
|
|
1172
|
-
}, $e = (t) => (t?.promotion?.type === D.INGAME_IAB11_LBAR || t?.promotion?.type === D.INGAME_IAB21_LBAR) && !!t.promotion.additionalBanner?.imageUrl,
|
|
1190
|
+
}, $e = (t) => (t?.promotion?.type === D.INGAME_IAB11_LBAR || t?.promotion?.type === D.INGAME_IAB21_LBAR) && !!t.promotion.additionalBanner?.imageUrl, No = (t, e, r) => {
|
|
1173
1191
|
let n = !1;
|
|
1174
1192
|
const i = r.transport, o = he("advertisement"), s = new ko(), a = (b, S) => {
|
|
1175
1193
|
s.fireEvent(b, S);
|
|
@@ -1238,7 +1256,7 @@ const Po = (t) => {
|
|
|
1238
1256
|
d.subscribe((b, S) => {
|
|
1239
1257
|
if (!(b.data?.id === S?.data?.id && b.isPaused !== S?.isPaused)) {
|
|
1240
1258
|
if (b.data?.promotion?.type === D.EXTERNAL_AD && !b?.externalAd && b.data.promotion.adCampaigns?.desktopWebSettings) {
|
|
1241
|
-
const _ =
|
|
1259
|
+
const _ = Lo(b.data.promotion.adCampaigns.desktopWebSettings);
|
|
1242
1260
|
d.setKey("externalAd", { type: "gam", url: _ });
|
|
1243
1261
|
}
|
|
1244
1262
|
b.data?.promotion && !b.isOpened && (U.emit("advertisement", {
|
|
@@ -1478,7 +1496,7 @@ class Ro {
|
|
|
1478
1496
|
this.activeQuestionId.off();
|
|
1479
1497
|
for (const n of this.cancels)
|
|
1480
1498
|
n(), this.cancels.delete(n);
|
|
1481
|
-
}), r || (this.advertisement =
|
|
1499
|
+
}), r || (this.advertisement = No(this.slStreamId, this.feedSubscription, e));
|
|
1482
1500
|
}
|
|
1483
1501
|
/**
|
|
1484
1502
|
* Get id for notifications and link with current session
|
|
@@ -1710,8 +1728,8 @@ const en = async (t, e) => {
|
|
|
1710
1728
|
leaderboardId: ""
|
|
1711
1729
|
});
|
|
1712
1730
|
a.set({
|
|
1713
|
-
data: E.data.map((
|
|
1714
|
-
...
|
|
1731
|
+
data: E.data.map((N, b) => ({
|
|
1732
|
+
...N.attributes,
|
|
1715
1733
|
friendsRank: b + 1
|
|
1716
1734
|
})),
|
|
1717
1735
|
hasMore: !1,
|
|
@@ -1794,7 +1812,7 @@ const tn = "sldl", Vt = "sldl_uid", Gn = "sldl_eid", Hn = "sldl_e_eid", jo = /*
|
|
|
1794
1812
|
pe.debug(a);
|
|
1795
1813
|
}
|
|
1796
1814
|
t.deepLink = {
|
|
1797
|
-
$store: new
|
|
1815
|
+
$store: new Ne(ee(o), "deep-link-context"),
|
|
1798
1816
|
getDeepLinkData: () => {
|
|
1799
1817
|
const { data: a, used: u } = t.deepLink.$store.getValues();
|
|
1800
1818
|
return { data: a, used: u };
|
|
@@ -2010,6 +2028,15 @@ const rt = new Qe(), zo = (t, e, r) => {
|
|
|
2010
2028
|
}
|
|
2011
2029
|
}, t.sdk.onMount({ name: "ui" }, () => {
|
|
2012
2030
|
const i = (a) => {
|
|
2031
|
+
if (a.slEventBus?.type === "exposedPauseAd")
|
|
2032
|
+
switch (a.slEventBus.action) {
|
|
2033
|
+
case "enabled":
|
|
2034
|
+
t.ui.enableExposedPauseAd();
|
|
2035
|
+
break;
|
|
2036
|
+
case "disabled":
|
|
2037
|
+
t.ui.disableExposedPauseAd();
|
|
2038
|
+
break;
|
|
2039
|
+
}
|
|
2013
2040
|
if (a.slEventBus?.type === "app")
|
|
2014
2041
|
switch (a.slEventBus.action) {
|
|
2015
2042
|
case "open":
|
|
@@ -2199,9 +2226,9 @@ const rt = new Qe(), zo = (t, e, r) => {
|
|
|
2199
2226
|
w && v || v ? w = `?${sn(w, g)}` : v = `#${sn("", g)}`;
|
|
2200
2227
|
const E = window.location.origin + window.location.pathname + w + v;
|
|
2201
2228
|
try {
|
|
2202
|
-
const
|
|
2229
|
+
const N = await es(t, { web: E, mobile: d });
|
|
2203
2230
|
i.set({
|
|
2204
|
-
data:
|
|
2231
|
+
data: N.data?.link,
|
|
2205
2232
|
loading: !1
|
|
2206
2233
|
});
|
|
2207
2234
|
} catch {
|
|
@@ -2440,7 +2467,7 @@ class os extends $n {
|
|
|
2440
2467
|
v || (v = await jn(s, this.transport), g.mutate(v)), w(), window.requestAnimationFrame(() => {
|
|
2441
2468
|
g.invalidate();
|
|
2442
2469
|
}), p || (p = v?.answers.find(({ youVoted: S }) => S)?.id);
|
|
2443
|
-
const E = a.find(({ correct: S }) => S),
|
|
2470
|
+
const E = a.find(({ correct: S }) => S), N = p ? a.find(({ id: S }) => S === p) : void 0, b = !!N?.correct;
|
|
2444
2471
|
if (l && d[c]?.attributes?.attributes.case === "question") {
|
|
2445
2472
|
try {
|
|
2446
2473
|
d[c].attributes.attributes.value.answerId = p, d[c].attributes.attributes.value.openForVoting = !1, p && (d[c].attributes.attributes.value.status = b ? pt.WON : pt.LOST);
|
|
@@ -2448,7 +2475,7 @@ class os extends $n {
|
|
|
2448
2475
|
}
|
|
2449
2476
|
this.feedList.getStore().mutate(d);
|
|
2450
2477
|
}
|
|
2451
|
-
if (!
|
|
2478
|
+
if (!N || !E)
|
|
2452
2479
|
return;
|
|
2453
2480
|
this.openedQuestionId.get()?.questionId !== r.id && this.notifications.add({
|
|
2454
2481
|
type: Ae.QUESTION_RESOLVED,
|
|
@@ -2463,8 +2490,8 @@ class os extends $n {
|
|
|
2463
2490
|
question: {
|
|
2464
2491
|
title: b ? `Congratulations! You answered correctly! You won ${E.points} pts!` : `Better luck next time! Correct: ${E?.text}!`,
|
|
2465
2492
|
votedAnswer: {
|
|
2466
|
-
title:
|
|
2467
|
-
points:
|
|
2493
|
+
title: N?.text,
|
|
2494
|
+
points: N?.points
|
|
2468
2495
|
},
|
|
2469
2496
|
correctAnswerTitle: E?.text,
|
|
2470
2497
|
correct: !!b,
|
|
@@ -2596,7 +2623,7 @@ class os extends $n {
|
|
|
2596
2623
|
});
|
|
2597
2624
|
const l = n.get().data;
|
|
2598
2625
|
if (i(), l) {
|
|
2599
|
-
const p = l.answers.find((E) => E.correct === !0), g = l.answers.findIndex((E) => E.id === r), w = l.answers[g], v = l.answers.every(({ percentageDecimal: E },
|
|
2626
|
+
const p = l.answers.find((E) => E.correct === !0), g = l.answers.findIndex((E) => E.id === r), w = l.answers[g], v = l.answers.every(({ percentageDecimal: E }, N) => E === o?.answers[N].percentageDecimal);
|
|
2600
2627
|
a[u].attributes.attributes.value.answerId = r, a[u].attributes.attributes.value.openForVoting = !1, a[u].attributes.attributes.value.text = w?.text || "", p && (a[u].attributes.attributes.value.status = p.id === r ? pt.WON : pt.LOST), this.feedList.getStore().mutate([...a]), l.answers[g].correct = p?.id === r, l.answers[g].youVoted = !0, v && l.answers.forEach((E) => {
|
|
2601
2628
|
E.percentageDecimal = 0;
|
|
2602
2629
|
}), p?.id === r && (l.answers[g].pointsEarned = l.status === Y.RESOLVED ? 0 : p.points), n.mutate({ ...l });
|
|
@@ -2775,7 +2802,7 @@ class os extends $n {
|
|
|
2775
2802
|
sponsorship: e.data.question.sponsorship,
|
|
2776
2803
|
adUnit: e.data.question?.adUnit,
|
|
2777
2804
|
sponsorLogo: e.data.question.promotion?.sponsor?.logo,
|
|
2778
|
-
isVideo: i?.mode ===
|
|
2805
|
+
isVideo: i?.mode === Li.VIDEO
|
|
2779
2806
|
}
|
|
2780
2807
|
}
|
|
2781
2808
|
});
|
|
@@ -3417,7 +3444,7 @@ class vs {
|
|
|
3417
3444
|
listenersCancels;
|
|
3418
3445
|
connected = !1;
|
|
3419
3446
|
constructor(e) {
|
|
3420
|
-
this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new
|
|
3447
|
+
this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new Ne(ee({}), "common-analytics"), this.connectToSDK(e), this.heartbeat = bs({ transport: e.analyticsTransport, $commonStore: this.commonStore }), this.notifications = new ms(this), this.polls = new gs(this), this.invitation = new ds(this), this.interactions = new ls(this), this.advertisement = new hs(this);
|
|
3421
3448
|
const { client: r } = e.analyticsTransport.createPromiseClient(Rn, {
|
|
3422
3449
|
method: "send"
|
|
3423
3450
|
});
|
|
@@ -3504,7 +3531,7 @@ function Kn(t, e, r) {
|
|
|
3504
3531
|
throw new Error("fastqueue concurrency must be equal to or greater than 1");
|
|
3505
3532
|
if (r = A, !u.paused)
|
|
3506
3533
|
for (; i && s < r; )
|
|
3507
|
-
s++,
|
|
3534
|
+
s++, N();
|
|
3508
3535
|
},
|
|
3509
3536
|
running: d,
|
|
3510
3537
|
resume: g,
|
|
@@ -3537,25 +3564,25 @@ function Kn(t, e, r) {
|
|
|
3537
3564
|
function g() {
|
|
3538
3565
|
if (u.paused) {
|
|
3539
3566
|
if (u.paused = !1, i === null) {
|
|
3540
|
-
s++,
|
|
3567
|
+
s++, N();
|
|
3541
3568
|
return;
|
|
3542
3569
|
}
|
|
3543
3570
|
for (; i && s < r; )
|
|
3544
|
-
s++,
|
|
3571
|
+
s++, N();
|
|
3545
3572
|
}
|
|
3546
3573
|
}
|
|
3547
3574
|
function w() {
|
|
3548
3575
|
return s === 0 && u.length() === 0;
|
|
3549
3576
|
}
|
|
3550
3577
|
function v(A, q) {
|
|
3551
|
-
var
|
|
3552
|
-
|
|
3578
|
+
var L = n.get();
|
|
3579
|
+
L.context = t, L.release = N, L.value = A, L.callback = q || re, L.errorHandler = a, s >= r || u.paused ? o ? (o.next = L, o = L) : (i = L, o = L, u.saturated()) : (s++, e.call(t, L.value, L.worked));
|
|
3553
3580
|
}
|
|
3554
3581
|
function E(A, q) {
|
|
3555
|
-
var
|
|
3556
|
-
|
|
3582
|
+
var L = n.get();
|
|
3583
|
+
L.context = t, L.release = N, L.value = A, L.callback = q || re, L.errorHandler = a, s >= r || u.paused ? i ? (L.next = i, i = L) : (i = L, o = L, u.saturated()) : (s++, e.call(t, L.value, L.worked));
|
|
3557
3584
|
}
|
|
3558
|
-
function
|
|
3585
|
+
function N(A) {
|
|
3559
3586
|
A && n.release(A);
|
|
3560
3587
|
var q = i;
|
|
3561
3588
|
q && s <= r ? u.paused ? s-- : (o === i && (o = null), i = q.next, q.next = null, e.call(t, q.value, q.worked), o === null && u.empty()) : --s === 0 && u.drain();
|
|
@@ -3646,7 +3673,7 @@ function B() {
|
|
|
3646
3673
|
B.init.call(this);
|
|
3647
3674
|
}
|
|
3648
3675
|
_r.exports = B;
|
|
3649
|
-
_r.exports.once =
|
|
3676
|
+
_r.exports.once = Ns;
|
|
3650
3677
|
B.EventEmitter = B;
|
|
3651
3678
|
B.prototype._events = void 0;
|
|
3652
3679
|
B.prototype._eventsCount = 0;
|
|
@@ -3786,7 +3813,7 @@ function Zn(t, e, r) {
|
|
|
3786
3813
|
if (n === void 0)
|
|
3787
3814
|
return [];
|
|
3788
3815
|
var i = n[e];
|
|
3789
|
-
return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ?
|
|
3816
|
+
return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? Ls(i) : ti(i, i.length);
|
|
3790
3817
|
}
|
|
3791
3818
|
B.prototype.listeners = function(e) {
|
|
3792
3819
|
return Zn(this, e, !0);
|
|
@@ -3822,12 +3849,12 @@ function Ps(t, e) {
|
|
|
3822
3849
|
t[e] = t[e + 1];
|
|
3823
3850
|
t.pop();
|
|
3824
3851
|
}
|
|
3825
|
-
function
|
|
3852
|
+
function Ls(t) {
|
|
3826
3853
|
for (var e = new Array(t.length), r = 0; r < e.length; ++r)
|
|
3827
3854
|
e[r] = t[r].listener || t[r];
|
|
3828
3855
|
return e;
|
|
3829
3856
|
}
|
|
3830
|
-
function
|
|
3857
|
+
function Ns(t, e) {
|
|
3831
3858
|
return new Promise(function(r, n) {
|
|
3832
3859
|
function i(s) {
|
|
3833
3860
|
t.removeListener(e, o), n(s);
|
|
@@ -4244,10 +4271,10 @@ var wa = ci, Ea = ct, bn = Sa, Aa = wa(), vn = qt, Sn = Ut, Ia = Ea("%Math.floor
|
|
|
4244
4271
|
};
|
|
4245
4272
|
u ? u(t.exports, "apply", { value: c }) : t.exports.apply = c;
|
|
4246
4273
|
})(ui);
|
|
4247
|
-
var
|
|
4274
|
+
var Lr = ui.exports, di = ct, li = Lr, Ta = li(di("String.prototype.indexOf")), Nr = function(e, r) {
|
|
4248
4275
|
var n = di(e, !!r);
|
|
4249
4276
|
return typeof n == "function" && Ta(e, ".prototype.") > -1 ? li(n) : n;
|
|
4250
|
-
}, _a = $t(), ka =
|
|
4277
|
+
}, _a = $t(), ka = Nr, pr = ka("Object.prototype.toString"), jt = function(e) {
|
|
4251
4278
|
return _a && e && typeof e == "object" && Symbol.toStringTag in e ? !1 : pr(e) === "[object Arguments]";
|
|
4252
4279
|
}, fi = function(e) {
|
|
4253
4280
|
return jt(e) ? !0 : e !== null && typeof e == "object" && typeof e.length == "number" && e.length >= 0 && pr(e) !== "[object Array]" && pr(e.callee) === "[object Function]";
|
|
@@ -4255,7 +4282,7 @@ var Nr = ui.exports, di = ct, li = Nr, Ta = li(di("String.prototype.indexOf")),
|
|
|
4255
4282
|
return jt(arguments);
|
|
4256
4283
|
}();
|
|
4257
4284
|
jt.isLegacyArguments = fi;
|
|
4258
|
-
var
|
|
4285
|
+
var La = Pa ? jt : fi, Na = Object.prototype.toString, Ca = Function.prototype.toString, Da = /^\s*(?:function)?\*/, pi = $t(), Wt = Object.getPrototypeOf, Ra = function() {
|
|
4259
4286
|
if (!pi)
|
|
4260
4287
|
return !1;
|
|
4261
4288
|
try {
|
|
@@ -4268,7 +4295,7 @@ var Na = Pa ? jt : fi, La = Object.prototype.toString, Ca = Function.prototype.t
|
|
|
4268
4295
|
if (Da.test(Ca.call(e)))
|
|
4269
4296
|
return !0;
|
|
4270
4297
|
if (!pi) {
|
|
4271
|
-
var r =
|
|
4298
|
+
var r = Na.call(e);
|
|
4272
4299
|
return r === "[object GeneratorFunction]";
|
|
4273
4300
|
}
|
|
4274
4301
|
if (!Wt)
|
|
@@ -4374,12 +4401,12 @@ var Ha = He ? function(e) {
|
|
|
4374
4401
|
for (var e = [], r = 0; r < Xt.length; r++)
|
|
4375
4402
|
typeof eu[Xt[r]] == "function" && (e[e.length] = Xt[r]);
|
|
4376
4403
|
return e;
|
|
4377
|
-
}, Pt = mi, tu = gi, wn =
|
|
4404
|
+
}, Pt = mi, tu = gi, wn = Lr, Cr = Nr, At = qt, ru = Cr("Object.prototype.toString"), bi = $t(), En = typeof globalThis > "u" ? Ir : globalThis, gr = tu(), Dr = Cr("String.prototype.slice"), Zt = Object.getPrototypeOf, nu = Cr("Array.prototype.indexOf", !0) || function(e, r) {
|
|
4378
4405
|
for (var n = 0; n < e.length; n += 1)
|
|
4379
4406
|
if (e[n] === r)
|
|
4380
4407
|
return n;
|
|
4381
4408
|
return -1;
|
|
4382
|
-
},
|
|
4409
|
+
}, Lt = { __proto__: null };
|
|
4383
4410
|
bi && At && Zt ? Pt(gr, function(t) {
|
|
4384
4411
|
var e = new En[t]();
|
|
4385
4412
|
if (Symbol.toStringTag in e) {
|
|
@@ -4388,15 +4415,15 @@ bi && At && Zt ? Pt(gr, function(t) {
|
|
|
4388
4415
|
var i = Zt(r);
|
|
4389
4416
|
n = At(i, Symbol.toStringTag);
|
|
4390
4417
|
}
|
|
4391
|
-
|
|
4418
|
+
Lt["$" + t] = wn(n.get);
|
|
4392
4419
|
}
|
|
4393
4420
|
}) : Pt(gr, function(t) {
|
|
4394
4421
|
var e = new En[t](), r = e.slice || e.set;
|
|
4395
|
-
r && (
|
|
4422
|
+
r && (Lt["$" + t] = wn(r));
|
|
4396
4423
|
});
|
|
4397
4424
|
var iu = function(e) {
|
|
4398
4425
|
var r = !1;
|
|
4399
|
-
return Pt(
|
|
4426
|
+
return Pt(Lt, function(n, i) {
|
|
4400
4427
|
if (!r)
|
|
4401
4428
|
try {
|
|
4402
4429
|
"$" + n(e) === i && (r = Dr(i, 1));
|
|
@@ -4405,7 +4432,7 @@ var iu = function(e) {
|
|
|
4405
4432
|
}), r;
|
|
4406
4433
|
}, ou = function(e) {
|
|
4407
4434
|
var r = !1;
|
|
4408
|
-
return Pt(
|
|
4435
|
+
return Pt(Lt, function(n, i) {
|
|
4409
4436
|
if (!r)
|
|
4410
4437
|
try {
|
|
4411
4438
|
n(e), r = Dr(i, 1);
|
|
@@ -4420,13 +4447,13 @@ var iu = function(e) {
|
|
|
4420
4447
|
return nu(gr, r) > -1 ? r : r !== "Object" ? !1 : ou(e);
|
|
4421
4448
|
}
|
|
4422
4449
|
return At ? iu(e) : null;
|
|
4423
|
-
},
|
|
4450
|
+
}, Nt = mi, au = gi, An = Lr, Rr = Nr, It = qt, uu = Rr("Object.prototype.toString"), vi = $t(), In = typeof globalThis > "u" ? Ir : globalThis, br = au(), Fr = Rr("String.prototype.slice"), er = Object.getPrototypeOf, cu = Rr("Array.prototype.indexOf", !0) || function(e, r) {
|
|
4424
4451
|
for (var n = 0; n < e.length; n += 1)
|
|
4425
4452
|
if (e[n] === r)
|
|
4426
4453
|
return n;
|
|
4427
4454
|
return -1;
|
|
4428
4455
|
}, Ct = { __proto__: null };
|
|
4429
|
-
vi && It && er ?
|
|
4456
|
+
vi && It && er ? Nt(br, function(t) {
|
|
4430
4457
|
var e = new In[t]();
|
|
4431
4458
|
if (Symbol.toStringTag in e) {
|
|
4432
4459
|
var r = er(e), n = It(r, Symbol.toStringTag);
|
|
@@ -4436,13 +4463,13 @@ vi && It && er ? Lt(br, function(t) {
|
|
|
4436
4463
|
}
|
|
4437
4464
|
Ct["$" + t] = An(n.get);
|
|
4438
4465
|
}
|
|
4439
|
-
}) :
|
|
4466
|
+
}) : Nt(br, function(t) {
|
|
4440
4467
|
var e = new In[t](), r = e.slice || e.set;
|
|
4441
4468
|
r && (Ct["$" + t] = An(r));
|
|
4442
4469
|
});
|
|
4443
4470
|
var du = function(e) {
|
|
4444
4471
|
var r = !1;
|
|
4445
|
-
return
|
|
4472
|
+
return Nt(
|
|
4446
4473
|
// eslint-disable-next-line no-extra-parens
|
|
4447
4474
|
/** @type {Record<`\$${TypedArrayName}`, Getter>} */
|
|
4448
4475
|
/** @type {any} */
|
|
@@ -4458,7 +4485,7 @@ var du = function(e) {
|
|
|
4458
4485
|
), r;
|
|
4459
4486
|
}, lu = function(e) {
|
|
4460
4487
|
var r = !1;
|
|
4461
|
-
return
|
|
4488
|
+
return Nt(
|
|
4462
4489
|
// eslint-disable-next-line no-extra-parens
|
|
4463
4490
|
/** @type {Record<`\$${TypedArrayName}`, Getter>} */
|
|
4464
4491
|
/** @type {any} */
|
|
@@ -4484,7 +4511,7 @@ var du = function(e) {
|
|
|
4484
4511
|
return !!pu(e);
|
|
4485
4512
|
};
|
|
4486
4513
|
(function(t) {
|
|
4487
|
-
var e =
|
|
4514
|
+
var e = La, r = Fa, n = su, i = hu;
|
|
4488
4515
|
function o(y) {
|
|
4489
4516
|
return y.call.bind(y);
|
|
4490
4517
|
}
|
|
@@ -4511,10 +4538,10 @@ var du = function(e) {
|
|
|
4511
4538
|
return typeof ArrayBuffer < "u" && ArrayBuffer.isView ? ArrayBuffer.isView(y) : i(y) || h(y);
|
|
4512
4539
|
}
|
|
4513
4540
|
t.isArrayBufferView = E;
|
|
4514
|
-
function
|
|
4541
|
+
function N(y) {
|
|
4515
4542
|
return n(y) === "Uint8Array";
|
|
4516
4543
|
}
|
|
4517
|
-
t.isUint8Array =
|
|
4544
|
+
t.isUint8Array = N;
|
|
4518
4545
|
function b(y) {
|
|
4519
4546
|
return n(y) === "Uint8ClampedArray";
|
|
4520
4547
|
}
|
|
@@ -4535,10 +4562,10 @@ var du = function(e) {
|
|
|
4535
4562
|
return n(y) === "Int16Array";
|
|
4536
4563
|
}
|
|
4537
4564
|
t.isInt16Array = q;
|
|
4538
|
-
function
|
|
4565
|
+
function L(y) {
|
|
4539
4566
|
return n(y) === "Int32Array";
|
|
4540
4567
|
}
|
|
4541
|
-
t.isInt32Array =
|
|
4568
|
+
t.isInt32Array = L;
|
|
4542
4569
|
function ue(y) {
|
|
4543
4570
|
return n(y) === "Float32Array";
|
|
4544
4571
|
}
|
|
@@ -4761,7 +4788,7 @@ var mu = vr.exports;
|
|
|
4761
4788
|
seen: [],
|
|
4762
4789
|
stylize: u
|
|
4763
4790
|
};
|
|
4764
|
-
return arguments.length >= 3 && (m.depth = arguments[2]), arguments.length >= 4 && (m.colors = arguments[3]),
|
|
4791
|
+
return arguments.length >= 3 && (m.depth = arguments[2]), arguments.length >= 4 && (m.colors = arguments[3]), N(h) ? m.showHidden = h : h && t._extend(m, h), L(m.showHidden) && (m.showHidden = !1), L(m.depth) && (m.depth = 2), L(m.colors) && (m.colors = !1), L(m.customInspect) && (m.customInspect = !0), m.colors && (m.stylize = a), c(m, f, m.depth);
|
|
4765
4792
|
}
|
|
4766
4793
|
t.inspect = s, s.colors = {
|
|
4767
4794
|
bold: [1, 22],
|
|
@@ -4842,7 +4869,7 @@ var mu = vr.exports;
|
|
|
4842
4869
|
}), f.seen.pop(), v(Me, M, ke);
|
|
4843
4870
|
}
|
|
4844
4871
|
function l(f, h) {
|
|
4845
|
-
if (
|
|
4872
|
+
if (L(h))
|
|
4846
4873
|
return f.stylize("undefined", "undefined");
|
|
4847
4874
|
if (A(h)) {
|
|
4848
4875
|
var m = "'" + JSON.stringify(h).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
|
|
@@ -4850,7 +4877,7 @@ var mu = vr.exports;
|
|
|
4850
4877
|
}
|
|
4851
4878
|
if (_(h))
|
|
4852
4879
|
return f.stylize("" + h, "number");
|
|
4853
|
-
if (
|
|
4880
|
+
if (N(h))
|
|
4854
4881
|
return f.stylize("" + h, "boolean");
|
|
4855
4882
|
if (b(h))
|
|
4856
4883
|
return f.stylize("null", "null");
|
|
@@ -4891,7 +4918,7 @@ var mu = vr.exports;
|
|
|
4891
4918
|
`).map(function(Z) {
|
|
4892
4919
|
return " " + Z;
|
|
4893
4920
|
}).join(`
|
|
4894
|
-
`))) : C = f.stylize("[Circular]", "special")),
|
|
4921
|
+
`))) : C = f.stylize("[Circular]", "special")), L(k)) {
|
|
4895
4922
|
if (F && R.match(/^\d+$/))
|
|
4896
4923
|
return C;
|
|
4897
4924
|
k = JSON.stringify("" + R), k.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (k = k.slice(1, -1), k = f.stylize(k, "name")) : (k = k.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), k = f.stylize(k, "string"));
|
|
@@ -4912,10 +4939,10 @@ var mu = vr.exports;
|
|
|
4912
4939
|
return Array.isArray(f);
|
|
4913
4940
|
}
|
|
4914
4941
|
t.isArray = E;
|
|
4915
|
-
function
|
|
4942
|
+
function N(f) {
|
|
4916
4943
|
return typeof f == "boolean";
|
|
4917
4944
|
}
|
|
4918
|
-
t.isBoolean =
|
|
4945
|
+
t.isBoolean = N;
|
|
4919
4946
|
function b(f) {
|
|
4920
4947
|
return f === null;
|
|
4921
4948
|
}
|
|
@@ -4936,10 +4963,10 @@ var mu = vr.exports;
|
|
|
4936
4963
|
return typeof f == "symbol";
|
|
4937
4964
|
}
|
|
4938
4965
|
t.isSymbol = q;
|
|
4939
|
-
function
|
|
4966
|
+
function L(f) {
|
|
4940
4967
|
return f === void 0;
|
|
4941
4968
|
}
|
|
4942
|
-
t.isUndefined =
|
|
4969
|
+
t.isUndefined = L;
|
|
4943
4970
|
function ue(f) {
|
|
4944
4971
|
return ce(f) && Oe(f) === "[object RegExp]";
|
|
4945
4972
|
}
|
|
@@ -5296,20 +5323,20 @@ function Au(t) {
|
|
|
5296
5323
|
function v(...E) {
|
|
5297
5324
|
if (!v.enabled)
|
|
5298
5325
|
return;
|
|
5299
|
-
const
|
|
5300
|
-
|
|
5326
|
+
const N = v, b = Number(/* @__PURE__ */ new Date()), S = b - (l || b);
|
|
5327
|
+
N.diff = S, N.prev = l, N.curr = b, l = b, E[0] = r.coerce(E[0]), typeof E[0] != "string" && E.unshift("%O");
|
|
5301
5328
|
let _ = 0;
|
|
5302
|
-
E[0] = E[0].replace(/%([a-zA-Z%])/g, (q,
|
|
5329
|
+
E[0] = E[0].replace(/%([a-zA-Z%])/g, (q, L) => {
|
|
5303
5330
|
if (q === "%%")
|
|
5304
5331
|
return "%";
|
|
5305
5332
|
_++;
|
|
5306
|
-
const ue = r.formatters[
|
|
5333
|
+
const ue = r.formatters[L];
|
|
5307
5334
|
if (typeof ue == "function") {
|
|
5308
5335
|
const ce = E[_];
|
|
5309
|
-
q = ue.call(
|
|
5336
|
+
q = ue.call(N, ce), E.splice(_, 1), _--;
|
|
5310
5337
|
}
|
|
5311
5338
|
return q;
|
|
5312
|
-
}), r.formatArgs.call(
|
|
5339
|
+
}), r.formatArgs.call(N, E), (N.log || r.log).apply(N, E);
|
|
5313
5340
|
}
|
|
5314
5341
|
return v.namespace = c, v.useColors = r.useColors(), v.color = r.selectColor(c), v.extend = n, v.destroy = r.destroy, Object.defineProperty(v, "enabled", {
|
|
5315
5342
|
enumerable: !0,
|
|
@@ -5501,14 +5528,14 @@ function Pu(t, e) {
|
|
|
5501
5528
|
return t[ir] && t[ir].name ? t[ir].name : typeof e < "u" && typeof e != "function" && e.name ? e.name : t.name ? t.name : t.toString().split(`
|
|
5502
5529
|
`).slice(0, 2).map((r) => r.trim()).join(" -- ");
|
|
5503
5530
|
}
|
|
5504
|
-
function
|
|
5531
|
+
function Lu() {
|
|
5505
5532
|
const t = {};
|
|
5506
5533
|
return t.promise = new Promise((e, r) => {
|
|
5507
5534
|
t.resolve = e, t.reject = r;
|
|
5508
5535
|
}), t;
|
|
5509
5536
|
}
|
|
5510
5537
|
function et(t, e, r, n, i) {
|
|
5511
|
-
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 = Pu(e, r), this.isAfter = n, this.q = Ou(t,
|
|
5538
|
+
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 = Pu(e, r), this.isAfter = n, this.q = Ou(t, Nu, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
|
|
5512
5539
|
}
|
|
5513
5540
|
_u(et, Tu);
|
|
5514
5541
|
et.prototype.exec = function(t, e) {
|
|
@@ -5556,7 +5583,7 @@ et.prototype.loadedSoFar = function() {
|
|
|
5556
5583
|
}), this.q.resume();
|
|
5557
5584
|
};
|
|
5558
5585
|
let e;
|
|
5559
|
-
return this._promise ? e = Promise.resolve() : (this._promise =
|
|
5586
|
+
return this._promise ? e = Promise.resolve() : (this._promise = Lu(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
|
|
5560
5587
|
};
|
|
5561
5588
|
et.prototype.enqueue = function(t, e) {
|
|
5562
5589
|
W("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
|
|
@@ -5586,7 +5613,7 @@ et.prototype.finish = function(t, e) {
|
|
|
5586
5613
|
};
|
|
5587
5614
|
queueMicrotask(n), this.q.resume();
|
|
5588
5615
|
};
|
|
5589
|
-
function
|
|
5616
|
+
function Nu(t, e) {
|
|
5590
5617
|
const r = this;
|
|
5591
5618
|
O.nextTick(Br.bind(r), t, e);
|
|
5592
5619
|
}
|
|
@@ -5609,7 +5636,7 @@ function Cu() {
|
|
|
5609
5636
|
Vr.exports = et;
|
|
5610
5637
|
Vr.exports.loadPlugin = Br;
|
|
5611
5638
|
var Du = Vr.exports;
|
|
5612
|
-
const
|
|
5639
|
+
const Ln = zn, Ru = ni.EventEmitter, Fu = Mt.inherits, {
|
|
5613
5640
|
AVV_ERR_EXPOSE_ALREADY_DEFINED: or,
|
|
5614
5641
|
AVV_ERR_CALLBACK_NOT_FN: ot,
|
|
5615
5642
|
AVV_ERR_PLUGIN_NOT_VALID: Vu,
|
|
@@ -5647,10 +5674,10 @@ function J(t, e, r) {
|
|
|
5647
5674
|
const n = new J(t, e, r);
|
|
5648
5675
|
return t && Uu(t, e, n), n;
|
|
5649
5676
|
}
|
|
5650
|
-
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 $u(), this._readyQ =
|
|
5651
|
-
this.emit("start"), this._readyQ.drain =
|
|
5652
|
-
}, this._closeQ =
|
|
5653
|
-
this.emit("close"), this._closeQ.drain =
|
|
5677
|
+
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 $u(), this._readyQ = Ln(this, Ai, 1), this._readyQ.pause(), this._readyQ.drain = () => {
|
|
5678
|
+
this.emit("start"), this._readyQ.drain = Nn;
|
|
5679
|
+
}, this._closeQ = Ln(this, Qu, 1), this._closeQ.pause(), this._closeQ.drain = () => {
|
|
5680
|
+
this.emit("close"), this._closeQ.drain = Nn;
|
|
5654
5681
|
}, this._doStart = null, this._root = new wr(this, qu.bind(this), e, !1, 0), this._root.once("start", (n, i, o) => {
|
|
5655
5682
|
const s = this.pluginTree.start(null, i, o);
|
|
5656
5683
|
this._root.once("loaded", (a, u, d) => {
|
|
@@ -5766,7 +5793,7 @@ J.prototype.prettyPrint = function() {
|
|
|
5766
5793
|
J.prototype.toJSON = function() {
|
|
5767
5794
|
return this.pluginTree.toJSON();
|
|
5768
5795
|
};
|
|
5769
|
-
function
|
|
5796
|
+
function Nn() {
|
|
5770
5797
|
}
|
|
5771
5798
|
function Ei() {
|
|
5772
5799
|
if (this.booted) {
|
|
@@ -5888,7 +5915,7 @@ function yc(t, e = !0, r = !0, n = { friendsTab: "enabled" }) {
|
|
|
5888
5915
|
throw a;
|
|
5889
5916
|
await u.sdk.initializeApp(), d();
|
|
5890
5917
|
}), s.onClose(() => {
|
|
5891
|
-
console.log("close");
|
|
5918
|
+
console.log("close StreamLayer instance");
|
|
5892
5919
|
}), s;
|
|
5893
5920
|
}
|
|
5894
5921
|
export {
|