@streamlayer/sdk-web 1.6.4 → 1.6.6
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 +7 -7
- package/lib/es/index.js +1039 -983
- package/package.json +13 -13
package/lib/es/index.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
|
-
import { pino as
|
|
2
|
-
import { QuestionType as
|
|
3
|
-
import { PickHistoryStatus as
|
|
4
|
-
import { SdkOverlayType as
|
|
5
|
-
import { InvitationCategory as
|
|
6
|
-
import { computed as
|
|
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";
|
|
3
|
+
import { PickHistoryStatus as lt } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_pb";
|
|
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";
|
|
7
7
|
import { nanoid as ir } from "nanoid";
|
|
8
|
-
import { ConnectError as
|
|
9
|
-
import { createGrpcWebTransport as
|
|
10
|
-
import { nanoquery as
|
|
11
|
-
import { Events as
|
|
12
|
-
import { Client as
|
|
13
|
-
import { Users as
|
|
14
|
-
import { Feed as
|
|
15
|
-
import { Leaderboard as
|
|
8
|
+
import { ConnectError as rt, Code as se, createContextKey as jr, createClient as Ur, createContextValues as Ti } from "@connectrpc/connect";
|
|
9
|
+
import { createGrpcWebTransport as xr } from "@connectrpc/connect-web";
|
|
10
|
+
import { nanoquery as Qr } from "@nanostores/query";
|
|
11
|
+
import { Events as On } from "@streamlayer/sl-eslib/sports/events/events_connect";
|
|
12
|
+
import { Client as it } from "@streamlayer/sl-eslib/sdkSettings/client/client_connect";
|
|
13
|
+
import { Users as wr } from "@streamlayer/sl-eslib/users/users_connect";
|
|
14
|
+
import { Feed as te } from "@streamlayer/sl-eslib/interactive/feed/interactive.feed_connect";
|
|
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
|
|
18
|
-
import { Kind as Q, TopicSubType as Ae, TopicType as x, PollOpenedFrom as
|
|
19
|
-
import { AnalyticsService as
|
|
20
|
-
import { InteractionActionType as
|
|
21
|
-
import { NotificationKind as
|
|
22
|
-
function
|
|
17
|
+
import { LinksClient as Oi } from "@streamlayer/sl-eslib/shortLinks/linksClient_connect";
|
|
18
|
+
import { Kind as Q, TopicSubType as Ae, TopicType as x, PollOpenedFrom as Y, Category as z, ScreenOrientation as Gr } from "@streamlayer/sl-eslib/analytics/v1/common/analytics.common_pb";
|
|
19
|
+
import { AnalyticsService as Ln } from "@streamlayer/sl-eslib/analytics/v2/streaming/streaming_connect";
|
|
20
|
+
import { InteractionActionType as Kr } from "@streamlayer/sl-eslib/analytics/v1/interactions/interactions_pb";
|
|
21
|
+
import { NotificationKind as he, NotificationType as zr } from "@streamlayer/sl-eslib/analytics/v1/notifications/notifications_pb";
|
|
22
|
+
function _i(t) {
|
|
23
23
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
24
24
|
}
|
|
25
|
-
var
|
|
25
|
+
var Cn = { exports: {} }, $ = Cn.exports = {}, ae, ue;
|
|
26
26
|
function or() {
|
|
27
27
|
throw new Error("setTimeout has not been defined");
|
|
28
28
|
}
|
|
@@ -41,7 +41,7 @@ function sr() {
|
|
|
41
41
|
ue = sr;
|
|
42
42
|
}
|
|
43
43
|
})();
|
|
44
|
-
function
|
|
44
|
+
function kn(t) {
|
|
45
45
|
if (ae === setTimeout)
|
|
46
46
|
return setTimeout(t, 0);
|
|
47
47
|
if ((ae === or || !ae) && setTimeout)
|
|
@@ -56,7 +56,7 @@ function Cn(t) {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Li(t) {
|
|
60
60
|
if (ue === clearTimeout)
|
|
61
61
|
return clearTimeout(t);
|
|
62
62
|
if ((ue === sr || !ue) && clearTimeout)
|
|
@@ -71,20 +71,20 @@ function Oi(t) {
|
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
73
|
}
|
|
74
|
-
var
|
|
75
|
-
function
|
|
76
|
-
!
|
|
74
|
+
var ve = [], Qe = !1, _e, ht = -1;
|
|
75
|
+
function Ci() {
|
|
76
|
+
!Qe || !_e || (Qe = !1, _e.length ? ve = _e.concat(ve) : ht = -1, ve.length && Pn());
|
|
77
77
|
}
|
|
78
|
-
function
|
|
79
|
-
if (!
|
|
80
|
-
var t =
|
|
81
|
-
|
|
82
|
-
for (var e =
|
|
83
|
-
for (_e =
|
|
78
|
+
function Pn() {
|
|
79
|
+
if (!Qe) {
|
|
80
|
+
var t = kn(Ci);
|
|
81
|
+
Qe = !0;
|
|
82
|
+
for (var e = ve.length; e; ) {
|
|
83
|
+
for (_e = ve, ve = []; ++ht < e; )
|
|
84
84
|
_e && _e[ht].run();
|
|
85
|
-
ht = -1, e =
|
|
85
|
+
ht = -1, e = ve.length;
|
|
86
86
|
}
|
|
87
|
-
_e = null,
|
|
87
|
+
_e = null, Qe = !1, Li(t);
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
$.nextTick = function(t) {
|
|
@@ -92,12 +92,12 @@ $.nextTick = function(t) {
|
|
|
92
92
|
if (arguments.length > 1)
|
|
93
93
|
for (var r = 1; r < arguments.length; r++)
|
|
94
94
|
e[r - 1] = arguments[r];
|
|
95
|
-
|
|
95
|
+
ve.push(new Nn(t, e)), ve.length === 1 && !Qe && kn(Pn);
|
|
96
96
|
};
|
|
97
|
-
function
|
|
97
|
+
function Nn(t, e) {
|
|
98
98
|
this.fun = t, this.array = e;
|
|
99
99
|
}
|
|
100
|
-
|
|
100
|
+
Nn.prototype.run = function() {
|
|
101
101
|
this.fun.apply(null, this.array);
|
|
102
102
|
};
|
|
103
103
|
$.title = "browser";
|
|
@@ -106,17 +106,17 @@ $.env = {};
|
|
|
106
106
|
$.argv = [];
|
|
107
107
|
$.version = "";
|
|
108
108
|
$.versions = {};
|
|
109
|
-
function
|
|
109
|
+
function Se() {
|
|
110
110
|
}
|
|
111
|
-
$.on =
|
|
112
|
-
$.addListener =
|
|
113
|
-
$.once =
|
|
114
|
-
$.off =
|
|
115
|
-
$.removeListener =
|
|
116
|
-
$.removeAllListeners =
|
|
117
|
-
$.emit =
|
|
118
|
-
$.prependListener =
|
|
119
|
-
$.prependOnceListener =
|
|
111
|
+
$.on = Se;
|
|
112
|
+
$.addListener = Se;
|
|
113
|
+
$.once = Se;
|
|
114
|
+
$.off = Se;
|
|
115
|
+
$.removeListener = Se;
|
|
116
|
+
$.removeAllListeners = Se;
|
|
117
|
+
$.emit = Se;
|
|
118
|
+
$.prependListener = Se;
|
|
119
|
+
$.prependOnceListener = Se;
|
|
120
120
|
$.listeners = function(t) {
|
|
121
121
|
return [];
|
|
122
122
|
};
|
|
@@ -132,8 +132,8 @@ $.chdir = function(t) {
|
|
|
132
132
|
$.umask = function() {
|
|
133
133
|
return 0;
|
|
134
134
|
};
|
|
135
|
-
var
|
|
136
|
-
const E = /* @__PURE__ */
|
|
135
|
+
var ki = Cn.exports;
|
|
136
|
+
const E = /* @__PURE__ */ _i(ki), Pi = 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__ */ Ti(Ci), Li = vi({
|
|
|
141
141
|
console.log(t);
|
|
142
142
|
}
|
|
143
143
|
}
|
|
144
|
-
}),
|
|
145
|
-
class
|
|
144
|
+
}), de = (t, e) => Pi.child({ name: t }, e);
|
|
145
|
+
class Ni extends Event {
|
|
146
146
|
slEventBus;
|
|
147
147
|
constructor(e, r) {
|
|
148
148
|
super(e), this.slEventBus = r;
|
|
149
149
|
}
|
|
150
150
|
}
|
|
151
|
-
const
|
|
152
|
-
class
|
|
151
|
+
const Fi = de("event-bus");
|
|
152
|
+
class Di {
|
|
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
|
|
160
|
-
|
|
159
|
+
const n = new Ni(this.name, { ...r, type: e });
|
|
160
|
+
Fi.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 Ni {
|
|
|
173
173
|
}), this.listeners.clear();
|
|
174
174
|
};
|
|
175
175
|
}
|
|
176
|
-
class
|
|
176
|
+
class Ri {
|
|
177
177
|
}
|
|
178
178
|
window.slStore = /* @__PURE__ */ Object.create(null);
|
|
179
179
|
class Pt {
|
|
@@ -192,33 +192,33 @@ class Pt {
|
|
|
192
192
|
return this.store;
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
|
-
const
|
|
195
|
+
const Vi = (t) => {
|
|
196
196
|
const e = Object.keys(t);
|
|
197
|
-
return
|
|
197
|
+
return Ei(e.map((r) => t[r].getStore()), (...r) => Object.fromEntries(e.map((n, i) => [n, r[i]])));
|
|
198
198
|
};
|
|
199
|
-
class
|
|
199
|
+
class Le extends Pt {
|
|
200
200
|
getValues = () => this.getStore().get();
|
|
201
201
|
getValue = (e) => this.getStore().get()[e];
|
|
202
202
|
setValue = (e, r) => this.getStore().setKey(e, r);
|
|
203
203
|
subscribe = (...e) => this.getStore().subscribe(...e);
|
|
204
204
|
unsubscribe = () => this.getStore().off();
|
|
205
205
|
}
|
|
206
|
-
const
|
|
207
|
-
var
|
|
206
|
+
const J = (t) => Ii(t);
|
|
207
|
+
var me;
|
|
208
208
|
(function(t) {
|
|
209
209
|
t.ORGANIZATION = "ORGANIZATION", t.STREAM = "STREAM";
|
|
210
|
-
})(
|
|
211
|
-
const
|
|
212
|
-
[
|
|
213
|
-
[
|
|
214
|
-
[
|
|
215
|
-
[
|
|
210
|
+
})(me || (me = {}));
|
|
211
|
+
const $i = {
|
|
212
|
+
[R.BETTING]: "betting",
|
|
213
|
+
[R.GAMES]: "games",
|
|
214
|
+
[R.PUBLIC_CHAT]: "publicChat",
|
|
215
|
+
[R.TWITTER]: "twitter"
|
|
216
216
|
};
|
|
217
|
-
var
|
|
217
|
+
var Ze;
|
|
218
218
|
(function(t) {
|
|
219
219
|
t.Ready = "ready", t.Suspended = "suspended";
|
|
220
|
-
})(
|
|
221
|
-
class
|
|
220
|
+
})(Ze || (Ze = {}));
|
|
221
|
+
class Fn {
|
|
222
222
|
status;
|
|
223
223
|
source;
|
|
224
224
|
config;
|
|
@@ -226,7 +226,7 @@ class Pn {
|
|
|
226
226
|
listeners = /* @__PURE__ */ new Set();
|
|
227
227
|
settingsKey;
|
|
228
228
|
constructor({ settings: e, ...r }, n) {
|
|
229
|
-
this.settingsKey =
|
|
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;
|
|
230
230
|
}
|
|
231
231
|
get featureConfig() {
|
|
232
232
|
return this.config.getStore();
|
|
@@ -238,10 +238,10 @@ class Pn {
|
|
|
238
238
|
this.listeners.add(e);
|
|
239
239
|
}
|
|
240
240
|
enable = () => {
|
|
241
|
-
this.status.set(
|
|
241
|
+
this.status.set(Ze.Ready);
|
|
242
242
|
};
|
|
243
243
|
disable = () => {
|
|
244
|
-
this.status.set(
|
|
244
|
+
this.status.set(Ze.Suspended);
|
|
245
245
|
};
|
|
246
246
|
setFeatureConfig = ({ settings: e, ...r }) => {
|
|
247
247
|
let n;
|
|
@@ -257,7 +257,7 @@ class Pn {
|
|
|
257
257
|
}
|
|
258
258
|
};
|
|
259
259
|
update = (e, r) => {
|
|
260
|
-
this.source ===
|
|
260
|
+
this.source === me.STREAM && r === me.ORGANIZATION || (this.setFeatureConfig(e), this.source = r);
|
|
261
261
|
};
|
|
262
262
|
fireEvent(e) {
|
|
263
263
|
for (const r of this.listeners.values())
|
|
@@ -268,7 +268,7 @@ class Pn {
|
|
|
268
268
|
}
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
class
|
|
271
|
+
class ee extends Pt {
|
|
272
272
|
getValue = () => this.getStore().get();
|
|
273
273
|
getValues() {
|
|
274
274
|
throw new Error("not implemented");
|
|
@@ -283,7 +283,7 @@ class Z extends Pt {
|
|
|
283
283
|
return this.getStore().get();
|
|
284
284
|
}
|
|
285
285
|
}
|
|
286
|
-
const
|
|
286
|
+
const q = (t) => kt(t);
|
|
287
287
|
class le extends Pt {
|
|
288
288
|
atomStore;
|
|
289
289
|
constructor(e, r, n) {
|
|
@@ -315,10 +315,10 @@ class le extends Pt {
|
|
|
315
315
|
key = () => this.getStore().key;
|
|
316
316
|
off = () => this.getStore().off();
|
|
317
317
|
}
|
|
318
|
-
const
|
|
319
|
-
async function*
|
|
318
|
+
const M = new Di();
|
|
319
|
+
async function* Bi(t, e) {
|
|
320
320
|
for await (const r of e) {
|
|
321
|
-
t.response.message = r, t.received_at = Date.now(), t.id =
|
|
321
|
+
t.response.message = r, t.received_at = Date.now(), t.id = Dn++;
|
|
322
322
|
const n = {
|
|
323
323
|
type: "__GRPC_DEVTOOLS_EXTENSION__",
|
|
324
324
|
data: t
|
|
@@ -326,10 +326,10 @@ async function* Vi(t, e) {
|
|
|
326
326
|
window.postMessage(n), yield r;
|
|
327
327
|
}
|
|
328
328
|
}
|
|
329
|
-
let
|
|
330
|
-
const
|
|
329
|
+
let Dn = 0;
|
|
330
|
+
const Mi = () => (t) => async (e) => {
|
|
331
331
|
const r = {
|
|
332
|
-
id:
|
|
332
|
+
id: Dn++,
|
|
333
333
|
name: e.url,
|
|
334
334
|
stream: e.stream,
|
|
335
335
|
sent_at: Date.now(),
|
|
@@ -356,7 +356,7 @@ const $i = () => (t) => async (e) => {
|
|
|
356
356
|
};
|
|
357
357
|
return window.postMessage(i), {
|
|
358
358
|
...n,
|
|
359
|
-
message:
|
|
359
|
+
message: Bi(r, n.message)
|
|
360
360
|
};
|
|
361
361
|
} else {
|
|
362
362
|
r.response.message = n.message, r.latency = r.received_at - r.sent_at;
|
|
@@ -380,7 +380,7 @@ const $i = () => (t) => async (e) => {
|
|
|
380
380
|
}
|
|
381
381
|
};
|
|
382
382
|
window.dispatchEvent(new CustomEvent("grpc_devtools_loaded"));
|
|
383
|
-
function
|
|
383
|
+
function Rn(t) {
|
|
384
384
|
return t instanceof DOMException && // everything except Firefox
|
|
385
385
|
(t.code === 22 || // Firefox
|
|
386
386
|
t.code === 1014 || // test name field too, because code might not be present
|
|
@@ -388,7 +388,7 @@ function Fn(t) {
|
|
|
388
388
|
t.name === "QuotaExceededError" || // Firefox
|
|
389
389
|
t.name === "NS_ERROR_DOM_QUOTA_REACHED");
|
|
390
390
|
}
|
|
391
|
-
class
|
|
391
|
+
class We {
|
|
392
392
|
delimiter = ":";
|
|
393
393
|
prefix;
|
|
394
394
|
storage;
|
|
@@ -405,7 +405,7 @@ class He {
|
|
|
405
405
|
try {
|
|
406
406
|
this.storage.setItem(n, r);
|
|
407
407
|
} catch (i) {
|
|
408
|
-
|
|
408
|
+
Rn(i) && this.storage === window.sessionStorage && (window.sessionStorage.removeItem("slstreamlogs"), this.storage.setItem(n, r));
|
|
409
409
|
}
|
|
410
410
|
};
|
|
411
411
|
read = (...e) => {
|
|
@@ -416,11 +416,12 @@ class He {
|
|
|
416
416
|
this.storage.removeItem(this.generateKey(e));
|
|
417
417
|
};
|
|
418
418
|
}
|
|
419
|
-
var
|
|
419
|
+
var ne;
|
|
420
420
|
(function(t) {
|
|
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
|
-
})(
|
|
423
|
-
|
|
422
|
+
})(ne || (ne = {}));
|
|
423
|
+
const Hr = de("grpc:stream");
|
|
424
|
+
class qi {
|
|
424
425
|
params;
|
|
425
426
|
streamCancel;
|
|
426
427
|
method;
|
|
@@ -434,32 +435,34 @@ class Mi {
|
|
|
434
435
|
attempt = 0;
|
|
435
436
|
constructor(e, r, n, i) {
|
|
436
437
|
const o = {
|
|
437
|
-
status:
|
|
438
|
+
status: ne.Init,
|
|
438
439
|
ts: /* @__PURE__ */ new Date(),
|
|
439
440
|
log: []
|
|
440
441
|
};
|
|
441
|
-
this.state = new
|
|
442
|
+
this.state = new Le(J(o), `subscription:${i.name}:state`), this.options = {
|
|
442
443
|
...i,
|
|
443
444
|
reconnectDelay: i.reconnectDelay ?? 1e3,
|
|
444
445
|
reconnectMaxDelay: i.reconnectMaxDelay ?? 3e4,
|
|
445
446
|
reconnectMaxAttempts: i.reconnectMaxAttempts ?? 10,
|
|
446
447
|
withStore: i.withStore ?? !1
|
|
447
|
-
}, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new
|
|
448
|
-
this.state.getValue("status") ===
|
|
449
|
-
})), this.updateState(
|
|
448
|
+
}, this.headers = e, this.listeners = /* @__PURE__ */ new Map(), this.params = n, this.method = r, i.withStore && (this.store = new ee(q(null), `subscription:${i.name}:store`)), "subscribe" in n && typeof n.subscribe == "function" && (this.paramsListener = n.subscribe((s) => {
|
|
449
|
+
this.state.getValue("status") === ne.Connected && (this.addStateLog(`params updated, reconnect => ${JSON.stringify(s)}`), this.reconnect());
|
|
450
|
+
})), this.updateState(ne.Ready);
|
|
450
451
|
}
|
|
451
452
|
updateState = (e) => {
|
|
452
453
|
this.state.setValue("status", e), this.state.setValue("ts", /* @__PURE__ */ new Date()), this.addStateLog(`status => ${e}`);
|
|
453
454
|
};
|
|
454
455
|
addStateLog = (e) => {
|
|
455
456
|
const r = this.state.getStore().get().log, n = `${this.options.name} ${(/* @__PURE__ */ new Date()).toISOString()}: ${e}`;
|
|
456
|
-
if (r.push(n), this.state.setValue("log", r), localStorage.getItem("SL_DEBUG"))
|
|
457
|
+
if (r.push(n), this.state.setValue("log", r), localStorage.getItem("SL_DEBUG")) {
|
|
458
|
+
e.startsWith("received data") ? Hr.trace({ name: this.options.name, attempt: this.attempt }, "received data") : Hr.trace({ name: this.options.name, attempt: this.attempt }, e);
|
|
457
459
|
try {
|
|
458
460
|
window.sessionStorage.setItem("slstreamlogs", window.sessionStorage.getItem("slstreamlogs") + `
|
|
459
461
|
` + n);
|
|
460
462
|
} catch (i) {
|
|
461
|
-
|
|
463
|
+
Rn(i) && window.sessionStorage.removeItem("slstreamlogs"), window.sessionStorage.setItem("slstreamlogs", n);
|
|
462
464
|
}
|
|
465
|
+
}
|
|
463
466
|
};
|
|
464
467
|
addListener = (e, r) => this.listeners.has(e) ? (this.addStateLog(`listener '${e}' not added, already exists`), () => {
|
|
465
468
|
}) : (this.listeners.set(e, r), this.addStateLog(`listener '${e}' added`), () => this.removeListener(e));
|
|
@@ -467,7 +470,7 @@ class Mi {
|
|
|
467
470
|
this.listeners.delete(e), this.addStateLog(`listener '${e}' removed`);
|
|
468
471
|
};
|
|
469
472
|
connect = () => {
|
|
470
|
-
this.updateState(
|
|
473
|
+
this.updateState(ne.Connecting), this.streamCancel && (this.addStateLog("disconnect prev connection"), this.streamCancel.abort(), this.streamCancel = void 0);
|
|
471
474
|
const e = "get" in this.params && typeof this.params.get == "function" ? this.params.get() : this.params;
|
|
472
475
|
(async () => {
|
|
473
476
|
this.streamCancel = new AbortController();
|
|
@@ -479,12 +482,12 @@ class Mi {
|
|
|
479
482
|
for await (const o of i)
|
|
480
483
|
this.attempt = 0, this.onData(o);
|
|
481
484
|
} catch (n) {
|
|
482
|
-
n instanceof
|
|
485
|
+
n instanceof rt && n.code != se.Canceled && this.onStreamError(n);
|
|
483
486
|
}
|
|
484
|
-
})(), this.updateState(
|
|
487
|
+
})(), this.updateState(ne.Connected);
|
|
485
488
|
};
|
|
486
489
|
disconnect = () => {
|
|
487
|
-
this.streamCancel && this.streamCancel.abort(), this.listeners.clear(), this.paramsListener?.(), clearTimeout(this.reconnectTimeout), this.reconnectTimeout = void 0, this.updateState(
|
|
490
|
+
this.streamCancel && this.streamCancel.abort(), this.listeners.clear(), this.paramsListener?.(), clearTimeout(this.reconnectTimeout), this.reconnectTimeout = void 0, this.updateState(ne.Disconnected);
|
|
488
491
|
};
|
|
489
492
|
/**
|
|
490
493
|
* Reconnect after delay, if not already reconnecting, otherwise do nothing
|
|
@@ -493,10 +496,10 @@ class Mi {
|
|
|
493
496
|
if (this.reconnectTimeout)
|
|
494
497
|
this.addStateLog("already reconnecting");
|
|
495
498
|
else if (this.attempt < this.options.reconnectMaxAttempts) {
|
|
496
|
-
this.updateState(
|
|
499
|
+
this.updateState(ne.Reconnect);
|
|
497
500
|
const e = Math.min(this.options.reconnectMaxDelay, Math.pow(2, this.attempt) * this.options.reconnectDelay), r = Math.round(e * (1 + Math.random()) / 2);
|
|
498
501
|
this.reconnectTimeout = setTimeout(() => {
|
|
499
|
-
this.attempt++, this.updateState(
|
|
502
|
+
this.attempt++, this.updateState(ne.Reconnecting), this.addStateLog(`reconnect attempt ${this.attempt} after ${r}ms`), this.connect(), this.reconnectTimeout = void 0;
|
|
500
503
|
}, r);
|
|
501
504
|
} else
|
|
502
505
|
this.addStateLog("max reconnect attempts reached"), this.disconnect();
|
|
@@ -519,15 +522,15 @@ class Mi {
|
|
|
519
522
|
*/
|
|
520
523
|
onStreamError = (e) => {
|
|
521
524
|
if (this.addStateLog(`error => ${e ? JSON.stringify(e) : "undefined"}}`), e !== void 0) {
|
|
522
|
-
if (e instanceof
|
|
523
|
-
this.updateState(
|
|
525
|
+
if (e instanceof rt && e.code !== se.Canceled) {
|
|
526
|
+
this.updateState(ne.Failed), this.state.setValue("error", e), this.reconnect();
|
|
524
527
|
return;
|
|
525
528
|
}
|
|
526
529
|
this.disconnect();
|
|
527
530
|
}
|
|
528
531
|
};
|
|
529
532
|
}
|
|
530
|
-
const
|
|
533
|
+
const ji = /* @__PURE__ */ new Set([
|
|
531
534
|
se.Unknown,
|
|
532
535
|
se.Internal,
|
|
533
536
|
se.DeadlineExceeded,
|
|
@@ -535,18 +538,18 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
535
538
|
se.FailedPrecondition,
|
|
536
539
|
se.Unavailable,
|
|
537
540
|
se.DataLoss
|
|
538
|
-
]),
|
|
541
|
+
]), Wr = de("grpc:retry"), Ui = (t) => async (e) => {
|
|
539
542
|
const r = e.contextValues.get(ar.retryAttempts), n = 300, i = e.contextValues.get(ar.retryDelay);
|
|
540
543
|
if (e.stream || r === 0)
|
|
541
544
|
return t(e);
|
|
542
|
-
|
|
545
|
+
Wr.trace({ url: e.url, attempts: r, maxDelay: i }, "retry options");
|
|
543
546
|
for (let o = 0; ; o++)
|
|
544
547
|
try {
|
|
545
548
|
return await t(e);
|
|
546
549
|
} catch (s) {
|
|
547
|
-
|
|
548
|
-
const a =
|
|
549
|
-
if (o >= r || !(a instanceof
|
|
550
|
+
Wr.trace({ attempt: o, error: s }, "retry attempt");
|
|
551
|
+
const a = rt.from(s);
|
|
552
|
+
if (o >= r || !(a instanceof rt) || !ji.has(a.code))
|
|
550
553
|
throw s;
|
|
551
554
|
const u = Math.min(i, Math.pow(2, o) * n), l = Math.round(u * (1 + Math.random()) / 2);
|
|
552
555
|
await new Promise((c) => setTimeout(c, l));
|
|
@@ -554,14 +557,14 @@ const Bi = /* @__PURE__ */ new Set([
|
|
|
554
557
|
}, ar = {
|
|
555
558
|
retryAttempts: jr(10, { description: "Number of attempts to retry" }),
|
|
556
559
|
retryDelay: jr(3e4, { description: "Max delay between retries in milliseconds" })
|
|
557
|
-
},
|
|
560
|
+
}, xi = () => {
|
|
558
561
|
const t = localStorage.getItem("sl-device-id");
|
|
559
562
|
if (t)
|
|
560
563
|
return t;
|
|
561
564
|
const e = ir();
|
|
562
565
|
return localStorage.setItem("sl-device-id", e), e;
|
|
563
|
-
},
|
|
564
|
-
class
|
|
566
|
+
}, Qi = () => navigator.userAgentData?.platform || navigator.platform;
|
|
567
|
+
class Yr {
|
|
565
568
|
toJsonOptions = {
|
|
566
569
|
emitDefaultValues: !1,
|
|
567
570
|
enumAsInteger: !0,
|
|
@@ -580,20 +583,20 @@ class Hr {
|
|
|
580
583
|
subscriptions;
|
|
581
584
|
opts;
|
|
582
585
|
constructor(e, r) {
|
|
583
|
-
this.host = e, this.opts = r, this.$headers = new
|
|
584
|
-
"sl-device-id":
|
|
585
|
-
"sl-device-os":
|
|
586
|
+
this.host = e, this.opts = r, this.$headers = new Le(J({
|
|
587
|
+
"sl-device-id": xi(),
|
|
588
|
+
"sl-device-os": Qi()
|
|
586
589
|
}), "transport:headers"), this.initInterceptors(), this.clients = /* @__PURE__ */ new Map(), this.streamClients = /* @__PURE__ */ new Map(), this.subscriptions = /* @__PURE__ */ new Map();
|
|
587
|
-
const [n, i, o] =
|
|
590
|
+
const [n, i, o] = Qr({
|
|
588
591
|
dedupeTime: r?.dedupeTime,
|
|
589
592
|
refetchInterval: r?.refetchInterval
|
|
590
593
|
});
|
|
591
|
-
this.nanoquery = { createFetcherStore: n, createMutatorStore: i, utils: o }, this.transport =
|
|
594
|
+
this.nanoquery = { createFetcherStore: n, createMutatorStore: i, utils: o }, this.transport = xr({
|
|
592
595
|
baseUrl: e,
|
|
593
596
|
defaultTimeoutMs: 1e4,
|
|
594
597
|
interceptors: this.interceptors
|
|
595
598
|
// useBinaryFormat: true,
|
|
596
|
-
}), this.streamTransport =
|
|
599
|
+
}), this.streamTransport = xr({
|
|
597
600
|
baseUrl: e,
|
|
598
601
|
interceptors: this.interceptors
|
|
599
602
|
// useBinaryFormat: true,
|
|
@@ -606,7 +609,7 @@ class Hr {
|
|
|
606
609
|
const i = this.subscriptions.get(r);
|
|
607
610
|
if (i)
|
|
608
611
|
return i;
|
|
609
|
-
const o = new
|
|
612
|
+
const o = new qi(this.$headers, e, r, n);
|
|
610
613
|
return this.subscriptions.set(r, o), o;
|
|
611
614
|
};
|
|
612
615
|
removeSubscription = (e) => {
|
|
@@ -617,7 +620,7 @@ class Hr {
|
|
|
617
620
|
for (const [i, o] of this.subscriptions)
|
|
618
621
|
o.disconnect(), this.subscriptions.delete(i);
|
|
619
622
|
this.clients.clear(), this.streamClients.clear(), this.subscriptions.clear();
|
|
620
|
-
const [e, r, n] =
|
|
623
|
+
const [e, r, n] = Qr({
|
|
621
624
|
dedupeTime: this.opts?.dedupeTime,
|
|
622
625
|
refetchInterval: this.opts?.refetchInterval
|
|
623
626
|
});
|
|
@@ -651,7 +654,7 @@ class Hr {
|
|
|
651
654
|
...Array.isArray(r) ? r : [r]
|
|
652
655
|
], a = [e.typeName, o.charAt(0).toLowerCase() + o.slice(1)];
|
|
653
656
|
return { client: i, createRequestOptions: (l) => {
|
|
654
|
-
const c =
|
|
657
|
+
const c = Ti();
|
|
655
658
|
for (const f in l) {
|
|
656
659
|
const p = ar[f];
|
|
657
660
|
c.set(p, l[f]);
|
|
@@ -679,11 +682,11 @@ class Hr {
|
|
|
679
682
|
n.header.set(o, i[o]);
|
|
680
683
|
return r(n);
|
|
681
684
|
};
|
|
682
|
-
this.interceptors.push(e), this.interceptors.push(
|
|
685
|
+
this.interceptors.push(e), this.interceptors.push(Mi()), this.opts?.retryable && this.interceptors.push(Ui);
|
|
683
686
|
};
|
|
684
687
|
}
|
|
685
|
-
const
|
|
686
|
-
const { client: r, queryKey: n } = e.createPromiseClient(
|
|
688
|
+
const Gi = (t, e) => {
|
|
689
|
+
const { client: r, queryKey: n } = e.createPromiseClient(On, {
|
|
687
690
|
method: "retrieveEventId",
|
|
688
691
|
params: [t]
|
|
689
692
|
});
|
|
@@ -700,39 +703,39 @@ const xi = (t, e) => {
|
|
|
700
703
|
}
|
|
701
704
|
}
|
|
702
705
|
});
|
|
703
|
-
},
|
|
704
|
-
const { client: r, queryKey: n } = e.createPromiseClient(
|
|
706
|
+
}, Ki = (t, e) => {
|
|
707
|
+
const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "getStream", params: [t] });
|
|
705
708
|
return e.nanoquery.createFetcherStore(n, {
|
|
706
709
|
fetcher: async (i, o, s) => s ? (await r.getStream({
|
|
707
710
|
id: s
|
|
708
711
|
// we are sure that id is a string
|
|
709
712
|
})).data?.attributes : void 0
|
|
710
713
|
});
|
|
711
|
-
},
|
|
712
|
-
const { client: r, queryKey: n } = e.createPromiseClient(
|
|
714
|
+
}, zi = (t, e) => {
|
|
715
|
+
const { client: r, queryKey: n } = e.createPromiseClient(On, { method: "summary", params: [t] });
|
|
713
716
|
return e.nanoquery.createFetcherStore(n, {
|
|
714
717
|
fetcher: async (i, o, s) => s ? (await r.summary({
|
|
715
718
|
id: s
|
|
716
719
|
})).data?.attributes : void 0
|
|
717
720
|
});
|
|
718
|
-
},
|
|
719
|
-
const { queryKey: r, client: n } = e.createPromiseClient(
|
|
721
|
+
}, Hi = (t, e) => {
|
|
722
|
+
const { queryKey: r, client: n } = e.createPromiseClient(wr, { method: "me", params: [t] });
|
|
720
723
|
return e.nanoquery.createFetcherStore(r, {
|
|
721
724
|
fetcher: async () => {
|
|
722
725
|
const { data: i } = await n.me({});
|
|
723
726
|
return { data: i };
|
|
724
727
|
}
|
|
725
728
|
});
|
|
726
|
-
},
|
|
727
|
-
const { client: e, createRequestOptions: r } = t.createPromiseClient(
|
|
729
|
+
}, Wi = (t) => {
|
|
730
|
+
const { client: e, createRequestOptions: r } = t.createPromiseClient(wr, { method: "bypassAuth" }), n = r({ retryAttempts: 0 });
|
|
728
731
|
return ({ userKey: i, schema: o, init: s, inviterKey: a }) => e.bypassAuth({ userKey: i, schema: o, init: s, inviterKey: a }, { contextValues: n });
|
|
729
|
-
},
|
|
730
|
-
const { client: r, queryKey: n } = e.createPromiseClient(
|
|
732
|
+
}, Yi = (t, e) => {
|
|
733
|
+
const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "get", params: [t] });
|
|
731
734
|
return e.nanoquery.createFetcherStore(n, {
|
|
732
735
|
fetcher: async () => (await r.get({})).data?.attributes
|
|
733
736
|
});
|
|
734
|
-
},
|
|
735
|
-
const { client: r, queryKey: n } = e.createPromiseClient(
|
|
737
|
+
}, Ji = (t, e) => {
|
|
738
|
+
const { client: r, queryKey: n } = e.createPromiseClient(it, { method: "getOrganization", params: [t] });
|
|
736
739
|
return e.nanoquery.createFetcherStore(n, {
|
|
737
740
|
fetcher: async () => {
|
|
738
741
|
const i = await r.getOrganization({});
|
|
@@ -742,69 +745,69 @@ const xi = (t, e) => {
|
|
|
742
745
|
} : void 0;
|
|
743
746
|
}
|
|
744
747
|
});
|
|
745
|
-
},
|
|
746
|
-
const { client: r, queryKey: n } = e.createPromiseClient(
|
|
748
|
+
}, Xi = (t, e) => {
|
|
749
|
+
const { client: r, queryKey: n } = e.createPromiseClient(it, {
|
|
747
750
|
method: "getOrganizationAdvertising",
|
|
748
751
|
params: [t]
|
|
749
752
|
});
|
|
750
753
|
return e.nanoquery.createFetcherStore(n, {
|
|
751
754
|
fetcher: async () => (await r.getOrganizationAdvertising({})).data?.attributes
|
|
752
755
|
});
|
|
753
|
-
},
|
|
754
|
-
t.transport = new
|
|
756
|
+
}, Zi = (t, e, r) => {
|
|
757
|
+
t.transport = new Yr(e.host, {
|
|
755
758
|
dedupeTime: 1e3 * 60 * 5,
|
|
756
759
|
refetchInterval: 1e3 * 60 * 5,
|
|
757
760
|
retryable: !0
|
|
758
|
-
}), t.analyticsTransport = new
|
|
761
|
+
}), t.analyticsTransport = new Yr(e.analyticsHost), t.sdk.host = t.transport.host, t.transport.setSdkKey(e.sdkKey), t.transport.setHeader("sl-sdk-version", e.version || "-"), t.transport.$headers.subscribe((n) => {
|
|
759
762
|
t.analyticsTransport.$headers.getStore().set(n);
|
|
760
763
|
}), t.sdk.onMount({ name: "transport" }, () => () => {
|
|
761
764
|
t.transport.disconnect(), t.analyticsTransport.disconnect();
|
|
762
765
|
}), r();
|
|
763
766
|
};
|
|
764
|
-
var
|
|
767
|
+
var ye;
|
|
765
768
|
(function(t) {
|
|
766
769
|
t.SCHEMA = "schema", t.EXTERNAL_TOKEN = "eToken", t.TOKEN = "token";
|
|
767
|
-
})(
|
|
768
|
-
class je extends
|
|
770
|
+
})(ye || (ye = {}));
|
|
771
|
+
class je extends We {
|
|
769
772
|
constructor() {
|
|
770
773
|
super("user");
|
|
771
774
|
}
|
|
772
775
|
// Schema
|
|
773
776
|
setSchema = (e) => {
|
|
774
|
-
this.write(
|
|
777
|
+
this.write(ye.SCHEMA, e);
|
|
775
778
|
};
|
|
776
|
-
getSchema = () => this.read(
|
|
779
|
+
getSchema = () => this.read(ye.SCHEMA);
|
|
777
780
|
// Token
|
|
778
781
|
setToken = (e) => {
|
|
779
|
-
this.write(
|
|
782
|
+
this.write(ye.TOKEN, e);
|
|
780
783
|
};
|
|
781
|
-
getToken = () => this.read(
|
|
784
|
+
getToken = () => this.read(ye.TOKEN);
|
|
782
785
|
// External Token
|
|
783
786
|
setExternalToken = (e) => {
|
|
784
|
-
this.write(
|
|
787
|
+
this.write(ye.EXTERNAL_TOKEN, e);
|
|
785
788
|
};
|
|
786
|
-
getExternalToken = () => this.read(
|
|
789
|
+
getExternalToken = () => this.read(ye.EXTERNAL_TOKEN);
|
|
787
790
|
removeToken = () => {
|
|
788
|
-
this.remove(
|
|
791
|
+
this.remove(ye.TOKEN);
|
|
789
792
|
};
|
|
790
793
|
}
|
|
791
|
-
var
|
|
794
|
+
var ge;
|
|
792
795
|
(function(t) {
|
|
793
796
|
t.DISABLED = "disabled", t.INITIALIZATION = "initialization", t.READY = "ready", t.FAILED = "failed", t.SUSPENDED = "suspended";
|
|
794
|
-
})(
|
|
795
|
-
const
|
|
796
|
-
const e = new je(), r = new
|
|
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) => {
|
|
797
800
|
if (!a)
|
|
798
801
|
return s?.data?.id ? s.data.id : u === !1 ? void 0 : l;
|
|
799
|
-
}), o = new le(
|
|
802
|
+
}), o = new le(Yi(n.getStore(), t), "userSettings");
|
|
800
803
|
return {
|
|
801
804
|
userKey: r,
|
|
802
805
|
userToken: n,
|
|
803
806
|
user: i,
|
|
804
807
|
userSettings: o
|
|
805
808
|
};
|
|
806
|
-
},
|
|
807
|
-
const e = new
|
|
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");
|
|
808
811
|
return r.getAtomStore().listen((o) => {
|
|
809
812
|
(o === "" || o === void 0) && (n.getStore().mutate(void 0), i.getStore().mutate(void 0));
|
|
810
813
|
}), {
|
|
@@ -813,8 +816,8 @@ const Xi = (t) => {
|
|
|
813
816
|
streamSettings: n,
|
|
814
817
|
streamSummary: i
|
|
815
818
|
};
|
|
816
|
-
},
|
|
817
|
-
const e = new
|
|
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);
|
|
818
821
|
return {
|
|
819
822
|
enabled: e,
|
|
820
823
|
status: r,
|
|
@@ -830,10 +833,10 @@ const Xi = (t) => {
|
|
|
830
833
|
organizationAdvertising: i
|
|
831
834
|
};
|
|
832
835
|
};
|
|
833
|
-
class
|
|
836
|
+
class no extends Pt {
|
|
834
837
|
stores;
|
|
835
838
|
constructor(e) {
|
|
836
|
-
const r =
|
|
839
|
+
const r = ro(e), n = Vi(r);
|
|
837
840
|
super(n, "core"), this.stores = r;
|
|
838
841
|
}
|
|
839
842
|
getValue() {
|
|
@@ -854,18 +857,18 @@ class to extends Pt {
|
|
|
854
857
|
};
|
|
855
858
|
unsubscribe = () => this.getStore().off();
|
|
856
859
|
}
|
|
857
|
-
const
|
|
858
|
-
t.store = new
|
|
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 = () => {
|
|
859
862
|
t.store.unsubscribe();
|
|
860
863
|
}, r();
|
|
861
|
-
},
|
|
862
|
-
const { client: e } = t.createPromiseClient(
|
|
864
|
+
}, oo = (t) => {
|
|
865
|
+
const { client: e } = t.createPromiseClient(_n, { method: "list" });
|
|
863
866
|
return (r) => e.list(r);
|
|
864
|
-
},
|
|
865
|
-
const { client: e } = t.createPromiseClient(
|
|
867
|
+
}, Vn = (t) => {
|
|
868
|
+
const { client: e } = t.createPromiseClient(_n, { method: "summary" });
|
|
866
869
|
return (r) => e.summary(r);
|
|
867
|
-
},
|
|
868
|
-
const { client: r, queryKey: n } = e.createPromiseClient(
|
|
870
|
+
}, so = (t, e) => {
|
|
871
|
+
const { client: r, queryKey: n } = e.createPromiseClient(wr, {
|
|
869
872
|
method: "getFriends",
|
|
870
873
|
params: [t]
|
|
871
874
|
});
|
|
@@ -880,8 +883,8 @@ const ro = (t, e, r) => {
|
|
|
880
883
|
}
|
|
881
884
|
}
|
|
882
885
|
});
|
|
883
|
-
},
|
|
884
|
-
const { client: r, queryKey: n } = e.createPromiseClient(
|
|
886
|
+
}, ao = (t, e) => {
|
|
887
|
+
const { client: r, queryKey: n } = e.createPromiseClient(te, { method: "get", params: [t] });
|
|
885
888
|
return e.nanoquery.createFetcherStore(n, {
|
|
886
889
|
fetcher: async (i, o, s) => (await r.get({
|
|
887
890
|
eventId: s
|
|
@@ -889,8 +892,8 @@ const ro = (t, e, r) => {
|
|
|
889
892
|
refetchInterval: 0,
|
|
890
893
|
dedupeTime: 1e3 * 60 * 60
|
|
891
894
|
});
|
|
892
|
-
},
|
|
893
|
-
const { client: r, queryKey: n } = e.createPromiseClient(
|
|
895
|
+
}, uo = (t, e) => {
|
|
896
|
+
const { client: r, queryKey: n } = e.createPromiseClient(te, { method: "syncQuestion", params: [t] });
|
|
894
897
|
return e.nanoquery.createFetcherStore(n, {
|
|
895
898
|
fetcher: async (i, o, s) => {
|
|
896
899
|
if (!s)
|
|
@@ -900,51 +903,51 @@ const ro = (t, e, r) => {
|
|
|
900
903
|
eventId: s
|
|
901
904
|
}
|
|
902
905
|
});
|
|
903
|
-
if (a.data?.attributes?.question?.type !==
|
|
906
|
+
if (a.data?.attributes?.question?.type !== _.PROMOTION)
|
|
904
907
|
return a.data?.attributes;
|
|
905
908
|
},
|
|
906
909
|
dedupeTime: 1e3 * 60 * 10,
|
|
907
910
|
// 10 minutes
|
|
908
911
|
refetchInterval: 0
|
|
909
912
|
});
|
|
910
|
-
},
|
|
911
|
-
const { client: r } = e.createPromiseClient(
|
|
913
|
+
}, co = async (t, e) => {
|
|
914
|
+
const { client: r } = e.createPromiseClient(te, { method: "item", params: [t] });
|
|
912
915
|
return (await r.item({
|
|
913
916
|
id: t
|
|
914
917
|
})).data;
|
|
915
|
-
},
|
|
916
|
-
const { client: r } = e.createStreamClient(
|
|
918
|
+
}, lo = (t, e) => {
|
|
919
|
+
const { client: r } = e.createStreamClient(te), n = kt({ eventId: t.get() || "", feedId: "" });
|
|
917
920
|
return t.subscribe((o = "") => {
|
|
918
921
|
n.set({ eventId: o, feedId: "" });
|
|
919
922
|
}), e.addSubscription(r.subscription, n, { name: "feedSubscription" });
|
|
920
|
-
},
|
|
921
|
-
const { client: r } = e.createStreamClient(
|
|
923
|
+
}, fo = (t, e) => {
|
|
924
|
+
const { client: r } = e.createStreamClient(te);
|
|
922
925
|
return e.addSubscription(r.questionSubscription, { questionId: t }, { name: "questionSubscription" });
|
|
923
|
-
},
|
|
924
|
-
const { client: r } = e.createPromiseClient(
|
|
926
|
+
}, po = async (t, e) => {
|
|
927
|
+
const { client: r } = e.createPromiseClient(te, { method: "questionByUser", params: [t] });
|
|
925
928
|
return (await r.questionByUser({
|
|
926
929
|
questionId: t
|
|
927
930
|
})).data?.attributes?.question;
|
|
928
931
|
}, ur = (t, e) => {
|
|
929
|
-
const { client: r, queryKey: n } = e.createPromiseClient(
|
|
932
|
+
const { client: r, queryKey: n } = e.createPromiseClient(te, { method: "questionByUser", params: [t] });
|
|
930
933
|
return e.nanoquery.createFetcherStore(n, {
|
|
931
934
|
fetcher: async (i, o, s) => (await r.questionByUser({
|
|
932
935
|
questionId: s
|
|
933
936
|
})).data?.attributes?.question,
|
|
934
937
|
dedupeTime: 1e3 * 60 * 5
|
|
935
938
|
});
|
|
936
|
-
},
|
|
939
|
+
}, $n = async (t, e) => {
|
|
937
940
|
if (!t)
|
|
938
941
|
return;
|
|
939
|
-
const { client: r } = e.createPromiseClient(
|
|
942
|
+
const { client: r } = e.createPromiseClient(te, { method: "getQuestion", params: [t] }), n = await r.getQuestion({
|
|
940
943
|
id: t
|
|
941
944
|
});
|
|
942
945
|
if (!n.data?.attributes)
|
|
943
946
|
return;
|
|
944
947
|
const { options: i, notification: o, ...s } = n.data.attributes, a = i?.options.case === "promotion" ? i?.options.value : void 0;
|
|
945
948
|
return { id: s.id, question: s, promotion: a, notification: o };
|
|
946
|
-
},
|
|
947
|
-
const { client: n, queryKey: i } = r.createPromiseClient(
|
|
949
|
+
}, ho = (t, e, r) => {
|
|
950
|
+
const { client: n, queryKey: i } = r.createPromiseClient(te, {
|
|
948
951
|
method: "list",
|
|
949
952
|
params: [t, e]
|
|
950
953
|
});
|
|
@@ -952,15 +955,15 @@ const ro = (t, e, r) => {
|
|
|
952
955
|
fetcher: async (o, s, a, u) => a ? (await n.list({
|
|
953
956
|
eventId: a,
|
|
954
957
|
filter: {
|
|
955
|
-
types: u ===
|
|
956
|
-
statuses: [
|
|
958
|
+
types: u === Ce.ALLOWED ? [] : [_.FACTOID, _.PROMOTION, _.TWEET],
|
|
959
|
+
statuses: [Z.ACTIVE, Z.RESOLVED]
|
|
957
960
|
}
|
|
958
961
|
})).data : [],
|
|
959
962
|
dedupeTime: 0,
|
|
960
963
|
refetchInterval: 0
|
|
961
964
|
});
|
|
962
|
-
},
|
|
963
|
-
const { client: r, queryKey: n } = e.createPromiseClient(
|
|
965
|
+
}, yo = (t, e) => {
|
|
966
|
+
const { client: r, queryKey: n } = e.createPromiseClient(te, {
|
|
964
967
|
method: "list",
|
|
965
968
|
params: [t]
|
|
966
969
|
});
|
|
@@ -971,8 +974,8 @@ const ro = (t, e, r) => {
|
|
|
971
974
|
const u = (await r.list({
|
|
972
975
|
eventId: s,
|
|
973
976
|
filter: {
|
|
974
|
-
types: [
|
|
975
|
-
statuses: [
|
|
977
|
+
types: [_.PROMOTION],
|
|
978
|
+
statuses: [Z.ACTIVE]
|
|
976
979
|
},
|
|
977
980
|
pagination: {
|
|
978
981
|
page: 0,
|
|
@@ -980,19 +983,19 @@ const ro = (t, e, r) => {
|
|
|
980
983
|
}
|
|
981
984
|
})).data?.[0];
|
|
982
985
|
if (u.type === "promotion")
|
|
983
|
-
return
|
|
986
|
+
return $n(u.id, e);
|
|
984
987
|
},
|
|
985
988
|
dedupeTime: 0,
|
|
986
989
|
refetchInterval: 0
|
|
987
990
|
});
|
|
988
|
-
},
|
|
989
|
-
const n =
|
|
991
|
+
}, mo = (t, e, r) => {
|
|
992
|
+
const n = qr([e, r], () => {
|
|
990
993
|
const a = e.get();
|
|
991
994
|
if (!a)
|
|
992
995
|
return;
|
|
993
996
|
const u = r.get().data?.find((c) => c.id === a?.questionId), l = a?.question?.openedFrom;
|
|
994
997
|
return u ? (u.openedFrom = l, u) : a.question;
|
|
995
|
-
}), i =
|
|
998
|
+
}), i = qr(n, (a) => a && a.type === "question" ? a.id : void 0), o = ur(i, t);
|
|
996
999
|
return { $store: n, $extendedStore: o, updateExtendedQuestion: (a) => {
|
|
997
1000
|
const u = o.get().data, l = (c, f) => {
|
|
998
1001
|
if (!c || !f)
|
|
@@ -1021,7 +1024,7 @@ var wt;
|
|
|
1021
1024
|
(function(t) {
|
|
1022
1025
|
t.SHOWED = "showed";
|
|
1023
1026
|
})(wt || (wt = {}));
|
|
1024
|
-
class
|
|
1027
|
+
class go extends We {
|
|
1025
1028
|
constructor() {
|
|
1026
1029
|
super("advertisement");
|
|
1027
1030
|
}
|
|
@@ -1030,7 +1033,7 @@ class yo extends He {
|
|
|
1030
1033
|
};
|
|
1031
1034
|
isViewed = (e) => this.read(wt.SHOWED, e);
|
|
1032
1035
|
}
|
|
1033
|
-
const
|
|
1036
|
+
const bo = (t) => {
|
|
1034
1037
|
const e = t.data?.attributes?.question;
|
|
1035
1038
|
if ((t.data?.attributes?.feedItem?.type === "promotion" ? t.data.attributes.feedItem : void 0) === void 0 || !e)
|
|
1036
1039
|
return;
|
|
@@ -1041,42 +1044,52 @@ const mo = (t) => {
|
|
|
1041
1044
|
notification: i,
|
|
1042
1045
|
promotion: s
|
|
1043
1046
|
};
|
|
1044
|
-
},
|
|
1047
|
+
}, dt = (t) => t.startsWith("http://") || t.startsWith("https://") ? new URL(t).toString() : t, vo = ({ gamOptions: t, gamBaseUrl: e }) => {
|
|
1045
1048
|
const r = `${e}?`, n = [];
|
|
1046
1049
|
for (const i in t) {
|
|
1047
1050
|
const o = i.replace(/([a-zA-Z])(?=[A-Z])/g, "$1_").toLowerCase(), s = t[i];
|
|
1048
1051
|
if (s)
|
|
1049
1052
|
if (typeof s == "string")
|
|
1050
|
-
n.push(`${o}=${
|
|
1053
|
+
n.push(`${o}=${dt(s)}`);
|
|
1051
1054
|
else if (Array.isArray(s))
|
|
1052
|
-
n.push(`${o}=${s.map(
|
|
1055
|
+
n.push(`${o}=${s.map(dt).join(",")}`);
|
|
1053
1056
|
else {
|
|
1054
|
-
const a = Object.entries(s).map(([u, l]) => Array.isArray(l) ? `${u}=${l.map(
|
|
1057
|
+
const a = Object.entries(s).map(([u, l]) => Array.isArray(l) ? `${u}=${l.map(dt).join(",")}` : typeof l == "string" ? `${u}=${dt(l)}` : `${u}=${l}`).join("&").replaceAll("=", "%3D").replaceAll("&", "%26").replaceAll(",", "%2C");
|
|
1055
1058
|
n.push(`${o}=${a}`);
|
|
1056
1059
|
}
|
|
1057
1060
|
}
|
|
1058
1061
|
return r + n.join("&");
|
|
1059
|
-
},
|
|
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) => {
|
|
1060
1063
|
let n = !1;
|
|
1061
|
-
const i = r.transport, o =
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1064
|
+
const i = r.transport, o = de("advertisement"), s = new go(), a = J({}), u = yo(t, i), l = (b) => {
|
|
1065
|
+
if (b?.fromNotification) {
|
|
1066
|
+
a.setKey("hasNotification", !1);
|
|
1067
|
+
const g = a.get(), S = g.data?.question.id, F = g.data?.promotion?.type;
|
|
1068
|
+
S && (M.emit("advertisement", {
|
|
1069
|
+
action: "opened",
|
|
1070
|
+
payload: {
|
|
1071
|
+
id: S,
|
|
1072
|
+
type: F,
|
|
1073
|
+
hasBanner: $e(g.data),
|
|
1074
|
+
openedFrom: "notification"
|
|
1075
|
+
}
|
|
1076
|
+
}), M.emit("advertisement", {
|
|
1077
|
+
action: "notification-opened",
|
|
1078
|
+
payload: {
|
|
1079
|
+
id: S,
|
|
1080
|
+
type: F,
|
|
1081
|
+
hasBanner: $e(g.data)
|
|
1082
|
+
}
|
|
1083
|
+
}));
|
|
1084
|
+
}
|
|
1072
1085
|
}, c = () => {
|
|
1073
|
-
const b = a.get(), g = b.data?.question.id, S = b.data?.promotion?.type,
|
|
1074
|
-
g && !
|
|
1075
|
-
action: "
|
|
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", {
|
|
1088
|
+
action: "viewed",
|
|
1076
1089
|
payload: {
|
|
1077
1090
|
id: g,
|
|
1078
1091
|
type: S,
|
|
1079
|
-
hasBanner:
|
|
1092
|
+
hasBanner: $e(b.data)
|
|
1080
1093
|
}
|
|
1081
1094
|
}));
|
|
1082
1095
|
}, f = (b, g) => {
|
|
@@ -1084,17 +1097,17 @@ const mo = (t) => {
|
|
|
1084
1097
|
loading: !1,
|
|
1085
1098
|
error: void 0,
|
|
1086
1099
|
data: g,
|
|
1087
|
-
hasNotification: g?.notification?.enabled ===
|
|
1100
|
+
hasNotification: g?.notification?.enabled === $r.NOTIFICATION_ENABLED,
|
|
1088
1101
|
close: () => p(g.question.id),
|
|
1089
1102
|
togglePause: (S) => v(g.question.id, S),
|
|
1090
1103
|
isViewed: !!s.isViewed(g.question.id)
|
|
1091
|
-
}) : (a.setKey("loading", !0),
|
|
1104
|
+
}) : (a.setKey("loading", !0), $n(b, i).then((S) => a.set({
|
|
1092
1105
|
loading: !1,
|
|
1093
1106
|
error: void 0,
|
|
1094
1107
|
data: S,
|
|
1095
|
-
hasNotification: S?.notification?.enabled ===
|
|
1108
|
+
hasNotification: S?.notification?.enabled === $r.NOTIFICATION_ENABLED,
|
|
1096
1109
|
close: () => p(S?.question.id),
|
|
1097
|
-
togglePause: (
|
|
1110
|
+
togglePause: (F) => v(S?.question.id, F),
|
|
1098
1111
|
isViewed: S && !!s.isViewed(S.question.id)
|
|
1099
1112
|
})).catch((S) => a.set({
|
|
1100
1113
|
loading: !1,
|
|
@@ -1105,26 +1118,35 @@ const mo = (t) => {
|
|
|
1105
1118
|
a.subscribe((b, g) => {
|
|
1106
1119
|
if (!(b.data?.id === g?.data?.id && b.isPaused !== g?.isPaused)) {
|
|
1107
1120
|
if (b.data?.promotion?.type === W.EXTERNAL_AD && !b?.externalAd && b.data.promotion.adCampaigns?.gamOptions && b.data.promotion.adCampaigns?.gamBaseUrl) {
|
|
1108
|
-
const S =
|
|
1121
|
+
const S = vo(b.data.promotion.adCampaigns);
|
|
1109
1122
|
a.setKey("externalAd", { type: "gam", url: S });
|
|
1110
1123
|
}
|
|
1111
|
-
b.data?.promotion && !b.isOpened &&
|
|
1124
|
+
b.data?.promotion && !b.isOpened && (M.emit("advertisement", {
|
|
1112
1125
|
action: "received",
|
|
1113
1126
|
payload: {
|
|
1114
1127
|
id: b.data.question.id,
|
|
1115
1128
|
type: b.data.promotion.type,
|
|
1116
1129
|
hasNotification: !!b.hasNotification,
|
|
1117
|
-
hasBanner:
|
|
1130
|
+
hasBanner: $e(b.data),
|
|
1118
1131
|
isViewed: !!s.isViewed(b.data.question.id)
|
|
1119
1132
|
},
|
|
1120
1133
|
skipAnalytics: b.data.question.id === g?.data?.question.id
|
|
1121
|
-
}),
|
|
1134
|
+
}), b.data.question.id !== g?.data?.question.id && !s.isViewed(b.data.question.id) && M.emit("advertisement", {
|
|
1135
|
+
action: "notification-received",
|
|
1136
|
+
payload: {
|
|
1137
|
+
id: b.data.question.id,
|
|
1138
|
+
type: b.data.promotion.type,
|
|
1139
|
+
hasNotification: !0,
|
|
1140
|
+
hasBanner: $e(b.data),
|
|
1141
|
+
isViewed: !1
|
|
1142
|
+
}
|
|
1143
|
+
})), !b?.data && g?.data && M.emit("advertisement", {
|
|
1122
1144
|
action: "closed",
|
|
1123
1145
|
payload: {
|
|
1124
1146
|
id: g.data.question.id,
|
|
1125
1147
|
type: g.data.promotion?.type,
|
|
1126
1148
|
hasNotification: !!g.hasNotification,
|
|
1127
|
-
hasBanner:
|
|
1149
|
+
hasBanner: $e(g.data),
|
|
1128
1150
|
isViewed: !!s.isViewed(g.data.question.id)
|
|
1129
1151
|
}
|
|
1130
1152
|
});
|
|
@@ -1139,13 +1161,13 @@ const mo = (t) => {
|
|
|
1139
1161
|
n || (n = !0, u.subscribe((b, g) => {
|
|
1140
1162
|
b.data && (!g?.data || b.data.id !== g.data.id) && f(b.data.question.id, b.data);
|
|
1141
1163
|
}), e.addListener("promotion", (b) => {
|
|
1142
|
-
const g =
|
|
1164
|
+
const g = bo(b);
|
|
1143
1165
|
if (g) {
|
|
1144
|
-
if (g.question.status ===
|
|
1166
|
+
if (g.question.status === Z.RESOLVED) {
|
|
1145
1167
|
p(g.question.id), o.debug({ promotion: g }, "resolved: %o");
|
|
1146
1168
|
return;
|
|
1147
1169
|
}
|
|
1148
|
-
if (g.question.status ===
|
|
1170
|
+
if (g.question.status === Z.ACTIVE) {
|
|
1149
1171
|
o.debug({ promotion: g }, "active: %o"), f(g.question.id, g);
|
|
1150
1172
|
return;
|
|
1151
1173
|
}
|
|
@@ -1154,11 +1176,11 @@ const mo = (t) => {
|
|
|
1154
1176
|
}));
|
|
1155
1177
|
}, hide: p, show: f, open: l, markAsViewed: c, $store: a };
|
|
1156
1178
|
};
|
|
1157
|
-
var
|
|
1179
|
+
var Ce;
|
|
1158
1180
|
(function(t) {
|
|
1159
1181
|
t.ALLOWED = "allowed", t.DISALLOWED = "disallowed";
|
|
1160
|
-
})(
|
|
1161
|
-
class
|
|
1182
|
+
})(Ce || (Ce = {}));
|
|
1183
|
+
class wo {
|
|
1162
1184
|
/** sl event id */
|
|
1163
1185
|
slStreamId;
|
|
1164
1186
|
/** organization id */
|
|
@@ -1191,14 +1213,14 @@ class vo {
|
|
|
1191
1213
|
transport;
|
|
1192
1214
|
cancels = /* @__PURE__ */ new Set();
|
|
1193
1215
|
constructor(e) {
|
|
1194
|
-
this.transport = e.transport, this.log =
|
|
1195
|
-
this.log.debug({ item: r }, "received question"), r?.questionId ? (this.questionSubscription =
|
|
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) => {
|
|
1196
1218
|
this.openedQuestion.updateExtendedQuestion(n.data?.attributes?.question);
|
|
1197
1219
|
}), this.questionSubscription.connect()) : (this.log.info("cleanup on close question"), this.questionSubscription !== void 0 && (e.transport.removeSubscription(this.questionSubscription), this.questionSubscription = void 0));
|
|
1198
|
-
})), this.feedSubscription =
|
|
1220
|
+
})), this.feedSubscription = lo(this.slStreamId, e.transport), this.cancels.add(this.feedSubscription.addListener("feed-subscription-active-question", (r) => {
|
|
1199
1221
|
const n = this.activeQuestionId.get().data?.question?.id, i = r.data?.attributes?.question;
|
|
1200
|
-
if (!(!i || i.type ===
|
|
1201
|
-
if (i.status ===
|
|
1222
|
+
if (!(!i || i.type === _.PROMOTION)) {
|
|
1223
|
+
if (i.status === Z.RESOLVED) {
|
|
1202
1224
|
n === i.id && this.activeQuestionId.mutate(void 0);
|
|
1203
1225
|
return;
|
|
1204
1226
|
}
|
|
@@ -1238,7 +1260,7 @@ class vo {
|
|
|
1238
1260
|
this.activeQuestionId.off();
|
|
1239
1261
|
for (const r of this.cancels)
|
|
1240
1262
|
r(), this.cancels.delete(r);
|
|
1241
|
-
}), this.advertisement =
|
|
1263
|
+
}), this.advertisement = So(this.slStreamId, this.feedSubscription, e);
|
|
1242
1264
|
}
|
|
1243
1265
|
/**
|
|
1244
1266
|
* Get id for notifications and link with current session
|
|
@@ -1268,7 +1290,7 @@ class vo {
|
|
|
1268
1290
|
this.openedQuestionId.set(void 0), e && this.notifications.markAsViewed(this.getCurrentSessionId({ prefix: "notification", entity: e }));
|
|
1269
1291
|
};
|
|
1270
1292
|
}
|
|
1271
|
-
class
|
|
1293
|
+
class Ao {
|
|
1272
1294
|
notificationsList;
|
|
1273
1295
|
store;
|
|
1274
1296
|
timeouts;
|
|
@@ -1277,7 +1299,7 @@ class So {
|
|
|
1277
1299
|
options;
|
|
1278
1300
|
logger;
|
|
1279
1301
|
constructor(e) {
|
|
1280
|
-
this.options = e, this.logger =
|
|
1302
|
+
this.options = e, this.logger = de("notifications"), this.store = /* @__PURE__ */ new Map(), this.timeouts = /* @__PURE__ */ new Map(), this.waitingQueue = /* @__PURE__ */ new Set(), this.activeQueue = /* @__PURE__ */ new Set(), this.notificationsList = q(/* @__PURE__ */ new Map());
|
|
1281
1303
|
}
|
|
1282
1304
|
addToQueue = (e) => {
|
|
1283
1305
|
if (this.store.has(e.id)) {
|
|
@@ -1321,7 +1343,7 @@ class So {
|
|
|
1321
1343
|
this.logger.debug({ notificationId: e }, "active queue tick skipped, notification not exist");
|
|
1322
1344
|
return;
|
|
1323
1345
|
}
|
|
1324
|
-
|
|
1346
|
+
M.emit("notification", {
|
|
1325
1347
|
action: "received",
|
|
1326
1348
|
payload: {
|
|
1327
1349
|
questionId: r.data.questionId,
|
|
@@ -1346,7 +1368,7 @@ class So {
|
|
|
1346
1368
|
const s = new Map(this.notificationsList.get());
|
|
1347
1369
|
s.delete(e), this.notificationsList.set(s);
|
|
1348
1370
|
const a = this.timeouts.get(e);
|
|
1349
|
-
a !== void 0 && (clearTimeout(a), this.timeouts.delete(e)), this.logger.debug({ notificationId: e }, "notification hidden"), i.hiding &&
|
|
1371
|
+
a !== void 0 && (clearTimeout(a), this.timeouts.delete(e)), this.logger.debug({ notificationId: e }, "notification hidden"), i.hiding && M.emit("notification", {
|
|
1350
1372
|
action: "closed",
|
|
1351
1373
|
payload: {
|
|
1352
1374
|
questionId: i.data.questionId,
|
|
@@ -1366,7 +1388,7 @@ var At;
|
|
|
1366
1388
|
(function(t) {
|
|
1367
1389
|
t.OPENED = "opened";
|
|
1368
1390
|
})(At || (At = {}));
|
|
1369
|
-
class
|
|
1391
|
+
class Eo extends We {
|
|
1370
1392
|
constructor() {
|
|
1371
1393
|
super("notification");
|
|
1372
1394
|
}
|
|
@@ -1382,11 +1404,11 @@ var Ee;
|
|
|
1382
1404
|
(function(t) {
|
|
1383
1405
|
t[t.ONBOARDING = 1] = "ONBOARDING", t[t.QUESTION = 2] = "QUESTION", t[t.QUESTION_RESOLVED = 3] = "QUESTION_RESOLVED";
|
|
1384
1406
|
})(Ee || (Ee = {}));
|
|
1385
|
-
class
|
|
1407
|
+
class Io {
|
|
1386
1408
|
queue;
|
|
1387
1409
|
storage;
|
|
1388
1410
|
constructor(e = {}) {
|
|
1389
|
-
this.storage = new
|
|
1411
|
+
this.storage = new Eo(), this.queue = new Ao({ concurrency: 1, animationDelay: 1600, ...e });
|
|
1390
1412
|
}
|
|
1391
1413
|
isViewed = (e) => this.storage.isOpened(e);
|
|
1392
1414
|
add = (e) => {
|
|
@@ -1394,7 +1416,7 @@ class Ao {
|
|
|
1394
1416
|
if (e.data && e.emitEvent) {
|
|
1395
1417
|
const n = e.action;
|
|
1396
1418
|
e.action = (...i) => {
|
|
1397
|
-
n && n(...i),
|
|
1419
|
+
n && n(...i), M.emit("notification", {
|
|
1398
1420
|
action: "opened",
|
|
1399
1421
|
payload: {
|
|
1400
1422
|
questionId: e.data.questionId,
|
|
@@ -1423,31 +1445,31 @@ class Ao {
|
|
|
1423
1445
|
this.storage.setOpened(e);
|
|
1424
1446
|
};
|
|
1425
1447
|
}
|
|
1426
|
-
const
|
|
1427
|
-
t.notifications = new
|
|
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" }, () => () => {
|
|
1428
1450
|
t.notifications.queue.drain();
|
|
1429
1451
|
}), r();
|
|
1430
1452
|
};
|
|
1431
|
-
var
|
|
1453
|
+
var nt;
|
|
1432
1454
|
(function(t) {
|
|
1433
1455
|
t.UNKNOWN = "unknown", t.ALREADY_VOTED = "already_voted";
|
|
1434
|
-
})(
|
|
1435
|
-
const
|
|
1436
|
-
const { client: r, createRequestOptions: n } = t.createPromiseClient(
|
|
1456
|
+
})(nt || (nt = {}));
|
|
1457
|
+
const Oo = async (t, e) => {
|
|
1458
|
+
const { client: r, createRequestOptions: n } = t.createPromiseClient(te, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
|
|
1437
1459
|
try {
|
|
1438
1460
|
return await r.submitAnswer({ data: e }, { contextValues: i });
|
|
1439
1461
|
} catch (o) {
|
|
1440
|
-
throw
|
|
1462
|
+
throw rt.from(o)?.code === se.AlreadyExists ? new Error(nt.ALREADY_VOTED) : new Error(nt.UNKNOWN);
|
|
1441
1463
|
}
|
|
1442
|
-
},
|
|
1443
|
-
const { client: r, createRequestOptions: n } = t.createPromiseClient(
|
|
1464
|
+
}, _o = (t, e) => {
|
|
1465
|
+
const { client: r, createRequestOptions: n } = t.createPromiseClient(te, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
|
|
1444
1466
|
return r.submitInplay({ data: { eventId: +e } }, { contextValues: i });
|
|
1445
1467
|
};
|
|
1446
1468
|
var Ue;
|
|
1447
1469
|
(function(t) {
|
|
1448
1470
|
t.ONBOARDING = "onboarding", t.ONBOARDING_IO = "onboarding_io";
|
|
1449
1471
|
})(Ue || (Ue = {}));
|
|
1450
|
-
class
|
|
1472
|
+
class Lo extends We {
|
|
1451
1473
|
constructor() {
|
|
1452
1474
|
super("gamification-session", window.sessionStorage);
|
|
1453
1475
|
}
|
|
@@ -1456,10 +1478,10 @@ class Oo extends He {
|
|
|
1456
1478
|
};
|
|
1457
1479
|
readValue = (e) => this.read(...e);
|
|
1458
1480
|
}
|
|
1459
|
-
class
|
|
1481
|
+
class Bn extends We {
|
|
1460
1482
|
sessionStorage;
|
|
1461
1483
|
constructor() {
|
|
1462
|
-
super("gamification"), this.sessionStorage = new
|
|
1484
|
+
super("gamification"), this.sessionStorage = new Lo();
|
|
1463
1485
|
}
|
|
1464
1486
|
saveOnboardingStatus = ({ userId: e, eventId: r, organizationId: n }, i) => {
|
|
1465
1487
|
this.write(Ue.ONBOARDING, n, e, r, i);
|
|
@@ -1470,17 +1492,17 @@ class Vn extends He {
|
|
|
1470
1492
|
};
|
|
1471
1493
|
getOnboardingInstantOpen = ({ userId: e, eventId: r, organizationId: n }) => this.sessionStorage.readValue([Ue.ONBOARDING_IO, n, e, r]);
|
|
1472
1494
|
}
|
|
1473
|
-
const
|
|
1495
|
+
const Co = {
|
|
1474
1496
|
pageSize: 10
|
|
1475
|
-
},
|
|
1497
|
+
}, ko = (t, e, r, n, i) => {
|
|
1476
1498
|
let o = 0;
|
|
1477
|
-
const s =
|
|
1499
|
+
const s = q({ pageSize: Co.pageSize, page: 0 }), a = J({
|
|
1478
1500
|
data: [],
|
|
1479
1501
|
key: Date.now(),
|
|
1480
1502
|
hasMore: !0,
|
|
1481
1503
|
loading: void 0,
|
|
1482
1504
|
error: void 0
|
|
1483
|
-
}), u =
|
|
1505
|
+
}), u = oo(t), l = async () => {
|
|
1484
1506
|
const p = e.get(), v = n.getStore().get().data?.map((w) => w.slId) || [];
|
|
1485
1507
|
if (p && v?.length) {
|
|
1486
1508
|
const w = r.get();
|
|
@@ -1490,9 +1512,9 @@ const _o = {
|
|
|
1490
1512
|
usersIds: v
|
|
1491
1513
|
});
|
|
1492
1514
|
a.set({
|
|
1493
|
-
data: g.data.map((S,
|
|
1515
|
+
data: g.data.map((S, F) => ({
|
|
1494
1516
|
...S.attributes,
|
|
1495
|
-
friendsRank:
|
|
1517
|
+
friendsRank: F + 1
|
|
1496
1518
|
})),
|
|
1497
1519
|
hasMore: !1,
|
|
1498
1520
|
key: Date.now(),
|
|
@@ -1505,14 +1527,14 @@ const _o = {
|
|
|
1505
1527
|
const v = s.get(), w = p || v.page + 1;
|
|
1506
1528
|
w <= o && s.set({ ...v, page: w });
|
|
1507
1529
|
};
|
|
1508
|
-
return
|
|
1530
|
+
return Sr(a, () => {
|
|
1509
1531
|
const p = e.listen(l), v = n.listen(l);
|
|
1510
1532
|
return () => {
|
|
1511
1533
|
p(), v();
|
|
1512
1534
|
};
|
|
1513
1535
|
}), { $store: a, fetchMore: f, invalidate: c };
|
|
1514
1536
|
};
|
|
1515
|
-
class
|
|
1537
|
+
class Po extends We {
|
|
1516
1538
|
get = this.read;
|
|
1517
1539
|
set = this.write;
|
|
1518
1540
|
del = this.remove;
|
|
@@ -1520,32 +1542,32 @@ class Lo extends He {
|
|
|
1520
1542
|
super("deep-link-context", window.sessionStorage);
|
|
1521
1543
|
}
|
|
1522
1544
|
}
|
|
1523
|
-
const
|
|
1545
|
+
const Jr = "sldl", Nt = "sldl_uid", Mn = "sldl_eid", qn = "sldl_e_eid", No = /* @__PURE__ */ new Set([Nt, Mn, qn]), Xr = (t) => {
|
|
1524
1546
|
const e = {}, r = {};
|
|
1525
1547
|
for (const [n, i] of t)
|
|
1526
|
-
|
|
1548
|
+
No.has(n) ? e[n] = i : r[n] = i;
|
|
1527
1549
|
return { result: e, remain: r };
|
|
1528
|
-
},
|
|
1529
|
-
if (t && t.includes(
|
|
1550
|
+
}, Fo = ({ hash: t, search: e }) => {
|
|
1551
|
+
if (t && t.includes(Jr)) {
|
|
1530
1552
|
const r = new URLSearchParams(t.substr(1));
|
|
1531
|
-
return { hash:
|
|
1553
|
+
return { hash: Xr(r) };
|
|
1532
1554
|
}
|
|
1533
|
-
if (e && e.includes(
|
|
1555
|
+
if (e && e.includes(Jr)) {
|
|
1534
1556
|
const r = new URLSearchParams(e);
|
|
1535
|
-
return { search:
|
|
1557
|
+
return { search: Xr(r) };
|
|
1536
1558
|
}
|
|
1537
1559
|
return null;
|
|
1538
|
-
},
|
|
1560
|
+
}, Zr = de("deep_link"), ce = {
|
|
1539
1561
|
debug: (...t) => {
|
|
1540
|
-
|
|
1562
|
+
Zr.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
|
|
1541
1563
|
},
|
|
1542
1564
|
trace: (...t) => {
|
|
1543
|
-
|
|
1565
|
+
Zr.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
|
|
1544
1566
|
}
|
|
1545
|
-
},
|
|
1567
|
+
}, Do = (t, e) => {
|
|
1546
1568
|
const { hash: r, search: n } = window.location;
|
|
1547
1569
|
if (ce.debug({ hash: r, search: n }, "get deep link data from"), r || n) {
|
|
1548
|
-
const i =
|
|
1570
|
+
const i = Fo({ hash: r, search: n });
|
|
1549
1571
|
if (ce.debug(i, "parse deep link result"), i) {
|
|
1550
1572
|
const { hash: o, search: s } = i, { result: a, remain: u } = o || s;
|
|
1551
1573
|
if (Object.keys(a).length !== 0) {
|
|
@@ -1564,8 +1586,8 @@ const Wr = "sldl", Nt = "sldl_uid", $n = "sldl_eid", Mn = "sldl_e_eid", ko = /*
|
|
|
1564
1586
|
}
|
|
1565
1587
|
}
|
|
1566
1588
|
t.setValue("parsed", !0);
|
|
1567
|
-
},
|
|
1568
|
-
const n = new
|
|
1589
|
+
}, Ro = (t, e, r) => {
|
|
1590
|
+
const n = new Po(), i = n.get("sl-deep-link-store");
|
|
1569
1591
|
let o = {};
|
|
1570
1592
|
if (i)
|
|
1571
1593
|
try {
|
|
@@ -1574,7 +1596,7 @@ const Wr = "sldl", Nt = "sldl_uid", $n = "sldl_eid", Mn = "sldl_e_eid", ko = /*
|
|
|
1574
1596
|
ce.debug(a);
|
|
1575
1597
|
}
|
|
1576
1598
|
t.deepLink = {
|
|
1577
|
-
$store: new
|
|
1599
|
+
$store: new Le(J(o), "deep-link-context"),
|
|
1578
1600
|
getDeepLinkData: () => {
|
|
1579
1601
|
const { data: a, used: u } = t.deepLink.$store.getValues();
|
|
1580
1602
|
return { data: a, used: u };
|
|
@@ -1603,15 +1625,15 @@ const Wr = "sldl", Nt = "sldl_uid", $n = "sldl_eid", Mn = "sldl_e_eid", ko = /*
|
|
|
1603
1625
|
console.error(l);
|
|
1604
1626
|
}
|
|
1605
1627
|
};
|
|
1606
|
-
|
|
1607
|
-
},
|
|
1608
|
-
class
|
|
1628
|
+
Do(t.deepLink.$store, s), r();
|
|
1629
|
+
}, Vo = de("bypass");
|
|
1630
|
+
class $o extends Ri {
|
|
1609
1631
|
$coreStore;
|
|
1610
1632
|
deepLink;
|
|
1611
1633
|
transport;
|
|
1612
1634
|
bypassLogin;
|
|
1613
1635
|
constructor(e, r, n) {
|
|
1614
|
-
super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin =
|
|
1636
|
+
super(), this.$coreStore = e, this.deepLink = n, this.transport = r, this.bypassLogin = Wi(this.transport), this.connect();
|
|
1615
1637
|
}
|
|
1616
1638
|
me = async () => (this.$coreStore.getValues().user.invalidate(), (await this.$coreStore.getValues().user.getValue())?.data);
|
|
1617
1639
|
/**
|
|
@@ -1623,7 +1645,7 @@ class Ro extends Fi {
|
|
|
1623
1645
|
login = async (e, r) => {
|
|
1624
1646
|
this.$coreStore.getValues().userKey.setValue(r);
|
|
1625
1647
|
const { used: n, data: i } = this.deepLink.getDeepLinkData(), o = n ? "" : i?.[Nt];
|
|
1626
|
-
|
|
1648
|
+
Vo.debug({ inviterKey: o }, "login with inviterKey");
|
|
1627
1649
|
const s = await this.bypassLogin({
|
|
1628
1650
|
schema: e,
|
|
1629
1651
|
userKey: r,
|
|
@@ -1692,27 +1714,27 @@ class Ro extends Fi {
|
|
|
1692
1714
|
});
|
|
1693
1715
|
};
|
|
1694
1716
|
}
|
|
1695
|
-
const
|
|
1696
|
-
t.auth = new
|
|
1697
|
-
n ===
|
|
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) => {
|
|
1719
|
+
n === ge.READY && t.auth.reLogin();
|
|
1698
1720
|
}), t.sdk.userId = t.stores.user.getAtomStore, t.sdk.authorizationBypass = async (n, i) => {
|
|
1699
|
-
if (!(
|
|
1721
|
+
if (!(Xe.getSchema() === n && Xe.getExternalToken() === i && t.transport.getHeader("authorization")))
|
|
1700
1722
|
try {
|
|
1701
|
-
await t.auth.login(n, i),
|
|
1723
|
+
await t.auth.login(n, i), Xe.setSchema(n), Xe.setExternalToken(i);
|
|
1702
1724
|
} catch {
|
|
1703
1725
|
t.sdk.logout();
|
|
1704
1726
|
}
|
|
1705
1727
|
}, t.sdk.logout = () => {
|
|
1706
|
-
t.auth.logout(),
|
|
1728
|
+
t.auth.logout(), Xe.clear();
|
|
1707
1729
|
}, t.sdk.getUserStore = () => t.stores.user.getStore(), t.sdk.isUserAuthorized = () => t.auth.isAuthenticated(), r();
|
|
1708
|
-
},
|
|
1730
|
+
}, en = de("video_player"), ft = {
|
|
1709
1731
|
debug: (...t) => {
|
|
1710
|
-
|
|
1732
|
+
en.debug(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
|
|
1711
1733
|
},
|
|
1712
1734
|
trace: (...t) => {
|
|
1713
|
-
|
|
1735
|
+
en.trace(...t), localStorage.getItem("SL_DEBUG") && console.log(...t);
|
|
1714
1736
|
}
|
|
1715
|
-
},
|
|
1737
|
+
}, Mo = (t, e, r) => {
|
|
1716
1738
|
t.videoPlayer = {
|
|
1717
1739
|
controllers: /* @__PURE__ */ new Set()
|
|
1718
1740
|
}, t.sdk.addVideoPlayerController = (n) => {
|
|
@@ -1730,14 +1752,14 @@ const Je = new je(), Vo = (t, e, r) => {
|
|
|
1730
1752
|
}
|
|
1731
1753
|
}
|
|
1732
1754
|
}, r();
|
|
1733
|
-
},
|
|
1734
|
-
[
|
|
1735
|
-
[
|
|
1736
|
-
[
|
|
1737
|
-
[
|
|
1738
|
-
[
|
|
1739
|
-
},
|
|
1740
|
-
t.sdk.uiState =
|
|
1755
|
+
}, qo = {
|
|
1756
|
+
[_.FACTOID]: "insight",
|
|
1757
|
+
[_.POLL]: "poll",
|
|
1758
|
+
[_.TRIVIA]: "trivia",
|
|
1759
|
+
[_.PREDICTION]: "prediction",
|
|
1760
|
+
[_.TWEET]: "tweet"
|
|
1761
|
+
}, jo = (t, e, r) => {
|
|
1762
|
+
t.sdk.uiState = J({}), t.ui = {
|
|
1741
1763
|
enableAppNotification: function() {
|
|
1742
1764
|
t.sdk.uiState.setKey("appNotification", !0);
|
|
1743
1765
|
},
|
|
@@ -1763,7 +1785,7 @@ const Je = new je(), Vo = (t, e, r) => {
|
|
|
1763
1785
|
};
|
|
1764
1786
|
t.onQuestionActivate = ({ questionType: i, ...o }) => {
|
|
1765
1787
|
if (t.ui.onContentActivate) {
|
|
1766
|
-
const s = o.type || i &&
|
|
1788
|
+
const s = o.type || i && qo[i] || "question";
|
|
1767
1789
|
t.ui.onContentActivate({ ...o, type: s });
|
|
1768
1790
|
}
|
|
1769
1791
|
}, t.sdk.onMount({ name: "ui" }, () => {
|
|
@@ -1832,16 +1854,16 @@ const Je = new je(), Vo = (t, e, r) => {
|
|
|
1832
1854
|
break;
|
|
1833
1855
|
}
|
|
1834
1856
|
}
|
|
1835
|
-
}, o =
|
|
1857
|
+
}, o = M.listen(i), s = t.activeFeature.subscribe((a) => {
|
|
1836
1858
|
a ? t.ui.enableApp() : t.ui.disableApp();
|
|
1837
1859
|
});
|
|
1838
1860
|
return () => {
|
|
1839
1861
|
o(), s();
|
|
1840
1862
|
};
|
|
1841
1863
|
}), r();
|
|
1842
|
-
},
|
|
1864
|
+
}, Uo = (t, e, r) => {
|
|
1843
1865
|
const n = { onMountedFired: !1 }, i = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map();
|
|
1844
|
-
t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.options =
|
|
1866
|
+
t.sdk = /* @__PURE__ */ Object.create(null), t.sdk.options = J(e), t.sdk.withAuth = !1, t.sdk.onMount = ({ name: s, clear: a }, u) => {
|
|
1845
1867
|
if (i.has(s)) {
|
|
1846
1868
|
const l = o.get(s);
|
|
1847
1869
|
l && l(), i.delete(s), o.delete(s);
|
|
@@ -1854,20 +1876,20 @@ const Je = new je(), Vo = (t, e, r) => {
|
|
|
1854
1876
|
}, t.sdk.initializeApp = async (s) => {
|
|
1855
1877
|
if (t.contextConfig = s, t.stores.enabled.get() === "on")
|
|
1856
1878
|
return { enabled: !0 };
|
|
1857
|
-
t.storeSubscribe(), t.stores.enabled.setValue("on"), t.stores.status.setValue(
|
|
1879
|
+
t.storeSubscribe(), t.stores.enabled.setValue("on"), t.stores.status.setValue(ge.INITIALIZATION);
|
|
1858
1880
|
try {
|
|
1859
1881
|
const a = await t.stores.organizationSettings.getValue();
|
|
1860
|
-
return a ? (t.stores.status.setValue(
|
|
1882
|
+
return a ? (t.stores.status.setValue(ge.READY), { enabled: !!a }) : (t.stores.status.setValue(ge.FAILED), { err: "failed" });
|
|
1861
1883
|
} catch (a) {
|
|
1862
|
-
return t.stores.enabled.setValue(), t.stores.status.setValue(
|
|
1884
|
+
return t.stores.enabled.setValue(), t.stores.status.setValue(ge.FAILED), { err: `${a}` };
|
|
1863
1885
|
}
|
|
1864
1886
|
}, t.sdk.disableApp = () => {
|
|
1865
|
-
t.stores.enabled.get() === "on" && (t.stores.enabled.setValue(), t.stores.status.setValue(
|
|
1887
|
+
t.stores.enabled.get() === "on" && (t.stores.enabled.setValue(), t.stores.status.setValue(ge.DISABLED), t.stores.slStreamId.setValue(), t.stores.providerStreamId.setValue(), t.sdk.closeFeature(!0), t.storeUnsubscribe(), t.transport.disconnect());
|
|
1866
1888
|
}, t.sdk.createEventSession = (s) => {
|
|
1867
1889
|
t.stores.providerStreamId.setValue(s);
|
|
1868
1890
|
}, r();
|
|
1869
|
-
},
|
|
1870
|
-
const { client: r, queryKey: n } = t.createPromiseClient(
|
|
1891
|
+
}, xo = (t, e) => {
|
|
1892
|
+
const { client: r, queryKey: n } = t.createPromiseClient(it, {
|
|
1871
1893
|
method: "generateDeepLink",
|
|
1872
1894
|
params: e
|
|
1873
1895
|
});
|
|
@@ -1887,29 +1909,29 @@ const Je = new je(), Vo = (t, e, r) => {
|
|
|
1887
1909
|
// 24 hours
|
|
1888
1910
|
refetchInterval: 0
|
|
1889
1911
|
});
|
|
1890
|
-
},
|
|
1891
|
-
const { client: n } = t.createPromiseClient(
|
|
1912
|
+
}, Qo = (t, { web: e, mobile: r }) => {
|
|
1913
|
+
const { client: n } = t.createPromiseClient(Oi, { method: "generate" });
|
|
1892
1914
|
return n.generate({ web: e, mobile: r });
|
|
1893
|
-
},
|
|
1915
|
+
}, tn = (t, e) => {
|
|
1894
1916
|
const r = new URLSearchParams(t);
|
|
1895
1917
|
for (const [n, i] of Object.entries(e))
|
|
1896
1918
|
r.append(n, i);
|
|
1897
1919
|
return r.toString();
|
|
1898
|
-
},
|
|
1899
|
-
const i =
|
|
1900
|
-
return
|
|
1920
|
+
}, Go = (t, e, r, n) => {
|
|
1921
|
+
const i = J({});
|
|
1922
|
+
return Sr(i, () => xo(t, [e, r]).subscribe(async ({ data: a, loading: u }) => {
|
|
1901
1923
|
const l = a === void 0 && u === !1 ? "https://streamlayer.io" : a?.url, c = n.get() || "", f = e.get() || "", p = r.get() || "", v = {
|
|
1902
1924
|
[Nt]: c,
|
|
1903
|
-
[
|
|
1904
|
-
[
|
|
1925
|
+
[Mn]: f,
|
|
1926
|
+
[qn]: p
|
|
1905
1927
|
};
|
|
1906
1928
|
if (!u && l) {
|
|
1907
1929
|
i.setKey("loading", !0);
|
|
1908
1930
|
let w = window.location.search, b = window.location.hash;
|
|
1909
|
-
w && b || b ? w = `?${
|
|
1931
|
+
w && b || b ? w = `?${tn(w, v)}` : b = `#${tn("", v)}`;
|
|
1910
1932
|
const g = window.location.origin + window.location.pathname + w + b;
|
|
1911
1933
|
try {
|
|
1912
|
-
const S = await
|
|
1934
|
+
const S = await Qo(t, { web: g, mobile: l });
|
|
1913
1935
|
i.set({
|
|
1914
1936
|
data: S.data?.link,
|
|
1915
1937
|
loading: !1
|
|
@@ -1925,11 +1947,11 @@ const Je = new je(), Vo = (t, e, r) => {
|
|
|
1925
1947
|
i.setKey("loading", !0);
|
|
1926
1948
|
})), { $store: i, fetch };
|
|
1927
1949
|
};
|
|
1928
|
-
var
|
|
1950
|
+
var B;
|
|
1929
1951
|
(function(t) {
|
|
1930
1952
|
t.Unset = "unset", t.Required = "required", t.Optional = "optional", t.Completed = "completed", t.Disabled = "disabled", t.Unavailable = "unavailable";
|
|
1931
|
-
})(
|
|
1932
|
-
const
|
|
1953
|
+
})(B || (B = {}));
|
|
1954
|
+
const Ko = (t, e, r, n) => {
|
|
1933
1955
|
const { inplayGame: i } = t.featureSettings.get(), o = e.getCurrentSessionId({ prefix: "onboarding" });
|
|
1934
1956
|
i && r.add({
|
|
1935
1957
|
type: Ee.ONBOARDING,
|
|
@@ -1942,7 +1964,7 @@ const Qo = (t, e, r, n) => {
|
|
|
1942
1964
|
autoHideDuration: 1e6,
|
|
1943
1965
|
data: {
|
|
1944
1966
|
questionId: "onboarding",
|
|
1945
|
-
questionType:
|
|
1967
|
+
questionType: _.UNSET,
|
|
1946
1968
|
onboarding: {
|
|
1947
1969
|
...i,
|
|
1948
1970
|
instantOpen: !n.getOnboardingInstantOpen({
|
|
@@ -1962,8 +1984,8 @@ const Qo = (t, e, r, n) => {
|
|
|
1962
1984
|
userId: s,
|
|
1963
1985
|
organizationId: e.organizationId.get() || "",
|
|
1964
1986
|
eventId: e.slStreamId.get() || ""
|
|
1965
|
-
}) ===
|
|
1966
|
-
t.set(
|
|
1987
|
+
}) === B.Completed) {
|
|
1988
|
+
t.set(B.Completed);
|
|
1967
1989
|
for (const p of o)
|
|
1968
1990
|
p();
|
|
1969
1991
|
return;
|
|
@@ -1972,22 +1994,22 @@ const Qo = (t, e, r, n) => {
|
|
|
1972
1994
|
if (u === void 0 || l === void 0)
|
|
1973
1995
|
return;
|
|
1974
1996
|
const c = u?.options?.onboardingEnabled, f = l?.titleCard?.optIn;
|
|
1975
|
-
c ? f ? t.set(
|
|
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 }));
|
|
1976
1998
|
} catch (s) {
|
|
1977
1999
|
console.error(s);
|
|
1978
2000
|
}
|
|
1979
|
-
},
|
|
2001
|
+
}, zo = (t, e, r, n) => {
|
|
1980
2002
|
let i = !1;
|
|
1981
|
-
const o = new
|
|
2003
|
+
const o = new Bn(), s = q(B.Unset);
|
|
1982
2004
|
s.subscribe((l) => {
|
|
1983
|
-
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({
|
|
1984
2006
|
userId: e.userId.get() || "",
|
|
1985
2007
|
organizationId: e.organizationId.get() || "",
|
|
1986
2008
|
eventId: e.slStreamId.get() || ""
|
|
1987
2009
|
}));
|
|
1988
2010
|
});
|
|
1989
2011
|
const a = [];
|
|
1990
|
-
return pt(s, e, t, n, o, a), s.get() !==
|
|
2012
|
+
return pt(s, e, t, n, o, a), s.get() !== B.Completed && (a.push(e.userId.listen((l) => {
|
|
1991
2013
|
l && pt(s, e, t, n, o, a);
|
|
1992
2014
|
})), a.push(e.moderation.listen((l) => {
|
|
1993
2015
|
l.data && pt(s, e, t, n, o, a);
|
|
@@ -1996,11 +2018,11 @@ const Qo = (t, e, r, n) => {
|
|
|
1996
2018
|
}))), { $store: s, submitInplay: async () => {
|
|
1997
2019
|
const l = e.slStreamId.get();
|
|
1998
2020
|
if (l) {
|
|
1999
|
-
await
|
|
2021
|
+
await _o(r, l), s.set(B.Completed), o.saveOnboardingStatus({
|
|
2000
2022
|
organizationId: e.organizationId.get() || "",
|
|
2001
2023
|
userId: e.userId.get() || "",
|
|
2002
2024
|
eventId: l
|
|
2003
|
-
},
|
|
2025
|
+
}, B.Completed), M.emit("poll", {
|
|
2004
2026
|
action: "onboardingPassed",
|
|
2005
2027
|
payload: {}
|
|
2006
2028
|
}), t.openFeature();
|
|
@@ -2008,8 +2030,8 @@ const Qo = (t, e, r, n) => {
|
|
|
2008
2030
|
n.close(c);
|
|
2009
2031
|
}
|
|
2010
2032
|
} };
|
|
2011
|
-
},
|
|
2012
|
-
const i =
|
|
2033
|
+
}, Ho = (t, e, r, n) => {
|
|
2034
|
+
const i = J(void 0), o = Vn(n), s = async () => {
|
|
2013
2035
|
const u = t.get(), l = e.get(), c = r.getStore().get().data?.map((v) => v.slId);
|
|
2014
2036
|
if (!c)
|
|
2015
2037
|
return;
|
|
@@ -2022,21 +2044,21 @@ const Qo = (t, e, r, n) => {
|
|
|
2022
2044
|
}, a = () => {
|
|
2023
2045
|
s();
|
|
2024
2046
|
};
|
|
2025
|
-
return
|
|
2047
|
+
return Sr(i, () => {
|
|
2026
2048
|
const u = t.listen(s), l = r.listen(s), c = e.listen(s);
|
|
2027
2049
|
return () => {
|
|
2028
2050
|
u(), l(), c();
|
|
2029
2051
|
};
|
|
2030
2052
|
}), { $store: i, invalidate: a };
|
|
2031
|
-
},
|
|
2032
|
-
const o =
|
|
2053
|
+
}, Wo = async (t, e, r, n, i) => {
|
|
2054
|
+
const o = Vn(i), s = t.get(), a = e.get(), u = r.getStore().get().data?.map((p) => p.slId) || [], l = {
|
|
2033
2055
|
eventId: s,
|
|
2034
2056
|
userId: n,
|
|
2035
2057
|
usersIds: [...u, a]
|
|
2036
2058
|
};
|
|
2037
2059
|
return (await o(l)).data?.attributes?.summary;
|
|
2038
|
-
},
|
|
2039
|
-
class
|
|
2060
|
+
}, Yo = /* @__PURE__ */ new Set([_.POLL, _.PREDICTION, _.TRIVIA]);
|
|
2061
|
+
class Jo extends Fn {
|
|
2040
2062
|
/** user statistics (leaderboard panel) */
|
|
2041
2063
|
userSummary;
|
|
2042
2064
|
/** feed list (pick history) */
|
|
@@ -2074,11 +2096,11 @@ class Wo extends Pn {
|
|
|
2074
2096
|
cancels = /* @__PURE__ */ new Set();
|
|
2075
2097
|
onQuestionActivate;
|
|
2076
2098
|
constructor(e, r, n) {
|
|
2077
|
-
super(e, r), this.background = new
|
|
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) => {
|
|
2078
2100
|
o?.summary && i?.summary && this.leaderboardList.invalidate();
|
|
2079
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) => {
|
|
2080
|
-
(o === void 0 || i !==
|
|
2081
|
-
})), this.background.activeQuestionId.listen(this.showInApp), this.friendsTabEnabled =
|
|
2102
|
+
(o === void 0 || i !== B.Unset) && this.background.activeQuestionId.invalidate();
|
|
2103
|
+
})), this.background.activeQuestionId.listen(this.showInApp), this.friendsTabEnabled = q(!1), this.cancels.add(n.sdk.options.subscribe((i) => {
|
|
2082
2104
|
i.friendsTab === "disabled" ? this.friendsTabEnabled.set(!1) : i.friendsTab === "enabled" && this.friendsTabEnabled.set(!0);
|
|
2083
2105
|
})), this.cancels.add(this.settings.subscribe((i) => {
|
|
2084
2106
|
n.sdk.options.get().friendsTab === "activatedGame" && this.friendsTabEnabled.set(!!i.inplayGame?.titleCard?.optIn);
|
|
@@ -2088,11 +2110,11 @@ class Wo extends Pn {
|
|
|
2088
2110
|
});
|
|
2089
2111
|
}
|
|
2090
2112
|
get isInteractiveAllowed() {
|
|
2091
|
-
return this.background.interactiveAllowed.get() ===
|
|
2113
|
+
return this.background.interactiveAllowed.get() === Ce.ALLOWED;
|
|
2092
2114
|
}
|
|
2093
2115
|
checkInteractiveFlag = () => {
|
|
2094
|
-
const e = this.onboardingStatus.$store.get(), r = this.background.moderation.getStore().value?.data?.options?.onboardingEnabled, n = this.settings.getValues().inplayGame?.titleCard?.optIn, i = e ===
|
|
2095
|
-
this.background.interactiveAllowed.set(o ?
|
|
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;
|
|
2117
|
+
this.background.interactiveAllowed.set(o ? Ce.ALLOWED : Ce.DISALLOWED);
|
|
2096
2118
|
};
|
|
2097
2119
|
connect = () => {
|
|
2098
2120
|
this.onboardingProcessed.subscribe((e) => {
|
|
@@ -2104,7 +2126,7 @@ class Wo extends Pn {
|
|
|
2104
2126
|
if (!r || !n?.attributes)
|
|
2105
2127
|
return;
|
|
2106
2128
|
const { status: i, type: o, id: s, answers: a } = r;
|
|
2107
|
-
if (i ===
|
|
2129
|
+
if (i === Z.RESOLVED && o === _.PREDICTION) {
|
|
2108
2130
|
const u = this.background.getCurrentSessionId({
|
|
2109
2131
|
prefix: `notification-id:${s}`
|
|
2110
2132
|
}), l = [...this.feedList.getValues().data || []], c = l.findIndex((K) => K.id === s), f = l[c];
|
|
@@ -2113,13 +2135,13 @@ class Wo extends Pn {
|
|
|
2113
2135
|
});
|
|
2114
2136
|
await v.get().promise;
|
|
2115
2137
|
let b = v.get().data;
|
|
2116
|
-
b || (b = await
|
|
2138
|
+
b || (b = await po(s, this.transport)), w(), window.requestAnimationFrame(() => {
|
|
2117
2139
|
v.invalidate();
|
|
2118
2140
|
}), p || (p = b?.answers.find(({ youVoted: K }) => K)?.id);
|
|
2119
|
-
const g = a.find(({ correct: K }) => K), S = p ? a.find(({ id: K }) => K === p) : void 0,
|
|
2141
|
+
const g = a.find(({ correct: K }) => K), S = p ? a.find(({ id: K }) => K === p) : void 0, F = !!S?.correct;
|
|
2120
2142
|
if (f && l[c]?.attributes?.attributes.case === "question") {
|
|
2121
2143
|
try {
|
|
2122
|
-
l[c].attributes.attributes.value.answerId = p, l[c].attributes.attributes.value.openForVoting = !1, p && (l[c].attributes.attributes.value.status =
|
|
2144
|
+
l[c].attributes.attributes.value.answerId = p, l[c].attributes.attributes.value.openForVoting = !1, p && (l[c].attributes.attributes.value.status = F ? lt.WON : lt.LOST);
|
|
2123
2145
|
} catch {
|
|
2124
2146
|
}
|
|
2125
2147
|
this.feedList.getStore().mutate(l);
|
|
@@ -2130,21 +2152,21 @@ class Wo extends Pn {
|
|
|
2130
2152
|
type: Ee.QUESTION_RESOLVED,
|
|
2131
2153
|
action: () => this.openQuestion(r.id, n),
|
|
2132
2154
|
close: () => this.closeQuestion(s),
|
|
2133
|
-
autoHideDuration:
|
|
2155
|
+
autoHideDuration: F ? 15e3 : 12e3,
|
|
2134
2156
|
id: u,
|
|
2135
2157
|
emitEvent: !1,
|
|
2136
2158
|
data: {
|
|
2137
2159
|
questionId: s,
|
|
2138
|
-
questionType:
|
|
2160
|
+
questionType: _.PREDICTION,
|
|
2139
2161
|
question: {
|
|
2140
|
-
title:
|
|
2162
|
+
title: F ? `Congratulations! You answered correctly! You won ${g.points} pts!` : `Better luck next time! Correct: ${g?.text}!`,
|
|
2141
2163
|
votedAnswer: {
|
|
2142
2164
|
title: S?.text,
|
|
2143
2165
|
points: S?.points
|
|
2144
2166
|
},
|
|
2145
2167
|
correctAnswerTitle: g?.text,
|
|
2146
|
-
correct: !!
|
|
2147
|
-
predictionResult: i ===
|
|
2168
|
+
correct: !!F,
|
|
2169
|
+
predictionResult: i === Z.RESOLVED,
|
|
2148
2170
|
questionTitle: r?.subject
|
|
2149
2171
|
}
|
|
2150
2172
|
}
|
|
@@ -2152,7 +2174,7 @@ class Wo extends Pn {
|
|
|
2152
2174
|
}
|
|
2153
2175
|
})), this.cancels.add(this.background.feedSubscription.addListener("feed-subscription-questions-list", (e) => {
|
|
2154
2176
|
const r = [...this.feedList.getStore().value?.data || []], n = e.data?.attributes?.feedItem, i = r.findIndex((o) => o.id === n?.id);
|
|
2155
|
-
if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !==
|
|
2177
|
+
if (n?.attributes && n.attributes.attributes.case !== "promotion" && !(n.attributes.status !== Z.ACTIVE && n.attributes.status !== Z.RESOLVED)) {
|
|
2156
2178
|
if (i !== -1)
|
|
2157
2179
|
if (n.attributes.attributes.case === "question" && r[i].attributes?.attributes.case === "question") {
|
|
2158
2180
|
const o = r[i];
|
|
@@ -2198,7 +2220,7 @@ class Wo extends Pn {
|
|
|
2198
2220
|
}
|
|
2199
2221
|
});
|
|
2200
2222
|
}
|
|
2201
|
-
i === -1 && (r.unshift(n),
|
|
2223
|
+
i === -1 && (r.unshift(n), M.emit("poll", {
|
|
2202
2224
|
action: "received",
|
|
2203
2225
|
payload: {
|
|
2204
2226
|
questionId: n.id,
|
|
@@ -2220,7 +2242,7 @@ class Wo extends Pn {
|
|
|
2220
2242
|
return;
|
|
2221
2243
|
const u = a.findIndex((f) => f.id === e), l = a[u], c = l?.attributes?.attributes.case === "question" && l.attributes.attributes.value;
|
|
2222
2244
|
if (c) {
|
|
2223
|
-
|
|
2245
|
+
M.emit("poll", {
|
|
2224
2246
|
action: "voted",
|
|
2225
2247
|
payload: {
|
|
2226
2248
|
questionId: e,
|
|
@@ -2230,9 +2252,9 @@ class Wo extends Pn {
|
|
|
2230
2252
|
const f = n.get().data;
|
|
2231
2253
|
if (i(), f) {
|
|
2232
2254
|
const p = f.answers.find((g) => g.correct === !0), v = f.answers.findIndex((g) => g.id === r), w = f.answers[v], b = f.answers.every(({ percentageDecimal: g }, S) => g === o?.answers[S].percentageDecimal);
|
|
2233
|
-
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 ?
|
|
2255
|
+
a[u].attributes.attributes.value.answerId = r, a[u].attributes.attributes.value.openForVoting = !1, a[u].attributes.attributes.value.text = w?.text || "", p && (a[u].attributes.attributes.value.status = p.id === r ? lt.WON : lt.LOST), this.feedList.getStore().mutate([...a]), f.answers[v].correct = p?.id === r, f.answers[v].youVoted = !0, b && f.answers.forEach((g) => {
|
|
2234
2256
|
g.percentageDecimal = 0;
|
|
2235
|
-
}), p?.id === r && (f.answers[v].pointsEarned = f.status ===
|
|
2257
|
+
}), p?.id === r && (f.answers[v].pointsEarned = f.status === Z.RESOLVED ? 0 : p.points), n.mutate({ ...f });
|
|
2236
2258
|
}
|
|
2237
2259
|
this.submitAnswerTimeout && clearTimeout(this.submitAnswerTimeout), this.submitAnswerTimeout = setTimeout(() => {
|
|
2238
2260
|
this.userSummary.invalidate();
|
|
@@ -2240,9 +2262,9 @@ class Wo extends Pn {
|
|
|
2240
2262
|
}
|
|
2241
2263
|
};
|
|
2242
2264
|
try {
|
|
2243
|
-
await
|
|
2265
|
+
await Oo(this.transport, { questionId: e, answerId: r }), s();
|
|
2244
2266
|
} catch (a) {
|
|
2245
|
-
if (a.message ===
|
|
2267
|
+
if (a.message === nt.ALREADY_VOTED) {
|
|
2246
2268
|
this.userSummary.invalidate();
|
|
2247
2269
|
const u = n.subscribe(() => {
|
|
2248
2270
|
});
|
|
@@ -2262,7 +2284,7 @@ class Wo extends Pn {
|
|
|
2262
2284
|
animateHiding: !1
|
|
2263
2285
|
});
|
|
2264
2286
|
let n = r?.attributes?.type;
|
|
2265
|
-
return n || (n = (this.feedList.getStore().value?.data || []).find((o) => o.id === e)?.attributes?.type),
|
|
2287
|
+
return n || (n = (this.feedList.getStore().value?.data || []).find((o) => o.id === e)?.attributes?.type), M.emit("poll", {
|
|
2266
2288
|
action: "opened",
|
|
2267
2289
|
payload: {
|
|
2268
2290
|
questionId: e,
|
|
@@ -2271,7 +2293,7 @@ class Wo extends Pn {
|
|
|
2271
2293
|
}
|
|
2272
2294
|
}), this.background.openQuestion(e, r);
|
|
2273
2295
|
};
|
|
2274
|
-
getFeedItem = (e) =>
|
|
2296
|
+
getFeedItem = (e) => co(e, this.transport);
|
|
2275
2297
|
isOpenedQuestion = (e) => !!this.notifications.isViewed(e);
|
|
2276
2298
|
closeQuestion = (e) => (e && this.onQuestionActivate({
|
|
2277
2299
|
stage: "deactivate",
|
|
@@ -2293,7 +2315,7 @@ class Wo extends Pn {
|
|
|
2293
2315
|
}
|
|
2294
2316
|
const n = { ...r };
|
|
2295
2317
|
try {
|
|
2296
|
-
const i = await
|
|
2318
|
+
const i = await Wo(this.background.slStreamId, this.background.userId, this.friends, e, this.transport);
|
|
2297
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);
|
|
2298
2320
|
} catch (i) {
|
|
2299
2321
|
console.error(i);
|
|
@@ -2311,8 +2333,8 @@ class Wo extends Pn {
|
|
|
2311
2333
|
*/
|
|
2312
2334
|
showInApp = (e) => {
|
|
2313
2335
|
const r = this.onboardingStatus.$store.get();
|
|
2314
|
-
if (e && e.data && r && r !==
|
|
2315
|
-
if (
|
|
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))
|
|
2316
2338
|
this.isInteractiveAllowed && e.data.question.notification !== void 0 && this.notifications.add({
|
|
2317
2339
|
type: Ee.QUESTION,
|
|
2318
2340
|
action: () => this.openQuestion(e.data?.question?.id, e.data?.feedItem),
|
|
@@ -2331,7 +2353,7 @@ class Wo extends Pn {
|
|
|
2331
2353
|
}
|
|
2332
2354
|
}
|
|
2333
2355
|
});
|
|
2334
|
-
else if (e.data.question.type ===
|
|
2356
|
+
else if (e.data.question.type === _.FACTOID) {
|
|
2335
2357
|
const n = e.data.question.options?.options.value, i = e.data.question.notification?.title || e.data.question.subject || "", o = e.data.question.notification?.body || n.body, s = {
|
|
2336
2358
|
heading: i,
|
|
2337
2359
|
body: o,
|
|
@@ -2360,7 +2382,7 @@ class Wo extends Pn {
|
|
|
2360
2382
|
insight: s
|
|
2361
2383
|
}
|
|
2362
2384
|
});
|
|
2363
|
-
} else if (e.data.question.type ===
|
|
2385
|
+
} else if (e.data.question.type === _.TWEET && e.data.question.notification !== void 0) {
|
|
2364
2386
|
const n = e.data.question.options?.options.value, i = {
|
|
2365
2387
|
title: e.data.question.notification?.title,
|
|
2366
2388
|
body: e.data.question.notification?.body,
|
|
@@ -2387,27 +2409,27 @@ class Wo extends Pn {
|
|
|
2387
2409
|
}
|
|
2388
2410
|
};
|
|
2389
2411
|
}
|
|
2390
|
-
const
|
|
2391
|
-
[
|
|
2412
|
+
const Xo = {
|
|
2413
|
+
[R.GAMES]: !0
|
|
2392
2414
|
};
|
|
2393
|
-
class
|
|
2415
|
+
class Zo extends Fn {
|
|
2394
2416
|
constructor(e, r) {
|
|
2395
2417
|
super(e, r);
|
|
2396
2418
|
}
|
|
2397
2419
|
}
|
|
2398
|
-
const
|
|
2399
|
-
t.features = /* @__PURE__ */ new Map(), t.sdk.featuresList = new
|
|
2420
|
+
const es = (t, e, r) => t.type === R.GAMES ? new Jo(t, e, r) : new Zo(t, e), ts = (t, e, r) => {
|
|
2421
|
+
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) => {
|
|
2400
2422
|
t.activeFeature.setValue(n);
|
|
2401
2423
|
}, t.sdk.closeFeature = (n = !1) => {
|
|
2402
2424
|
const i = t.activeFeature.getValue();
|
|
2403
|
-
if (t.activeFeature.setValue(
|
|
2425
|
+
if (t.activeFeature.setValue(R.UNSET), n && i) {
|
|
2404
2426
|
t.features.delete(i);
|
|
2405
2427
|
const o = t.sdk.featuresList.getValue();
|
|
2406
2428
|
o && o.delete(i), t.sdk.featuresList.setValue(o);
|
|
2407
2429
|
}
|
|
2408
|
-
}, t.initFeature = (n, i =
|
|
2409
|
-
if (n.type in
|
|
2410
|
-
const o =
|
|
2430
|
+
}, t.initFeature = (n, i = me.ORGANIZATION) => {
|
|
2431
|
+
if (n.type in Xo && !t.features.has(n.type)) {
|
|
2432
|
+
const o = es(n, i, t);
|
|
2411
2433
|
t.features.set(n.type, o);
|
|
2412
2434
|
let s = t.sdk.featuresList.getValue();
|
|
2413
2435
|
s ? s.add(n.type) : s = /* @__PURE__ */ new Set([n.type]), t.sdk.featuresList.setValue(new Set(s));
|
|
@@ -2422,12 +2444,12 @@ const Xo = (t, e, r) => t.type === D.GAMES ? new Wo(t, e, r) : new Jo(t, e), Zo
|
|
|
2422
2444
|
const n = await t.stores.organizationSettings.getValue();
|
|
2423
2445
|
t.features.clear(), t.sdk.featuresList.setValue(/* @__PURE__ */ new Set());
|
|
2424
2446
|
for (const i of n?.overlays || [])
|
|
2425
|
-
t.initFeature(i,
|
|
2447
|
+
t.initFeature(i, me.ORGANIZATION);
|
|
2426
2448
|
}, t.stores.providerStreamId.listen((n) => {
|
|
2427
2449
|
n || t.reinitializeFeatures();
|
|
2428
2450
|
}), t.storeSubscribe = () => {
|
|
2429
2451
|
const n = (o, s) => {
|
|
2430
|
-
if (s?.overlays && !(t.contextConfig?.skipOrganizationSettings && o ===
|
|
2452
|
+
if (s?.overlays && !(t.contextConfig?.skipOrganizationSettings && o === me.ORGANIZATION))
|
|
2431
2453
|
for (const a of s.overlays)
|
|
2432
2454
|
a.sdkEnable === !0 && (t.features.has(a.type) ? t.updateFeature(a, o) : t.initFeature(a, o));
|
|
2433
2455
|
}, i = {
|
|
@@ -2443,7 +2465,7 @@ const Xo = (t, e, r) => t.type === D.GAMES ? new Wo(t, e, r) : new Jo(t, e), Zo
|
|
|
2443
2465
|
organizationSettings: (o) => {
|
|
2444
2466
|
if (o.data)
|
|
2445
2467
|
try {
|
|
2446
|
-
n(
|
|
2468
|
+
n(me.ORGANIZATION, o.data);
|
|
2447
2469
|
} catch (s) {
|
|
2448
2470
|
console.log(s);
|
|
2449
2471
|
}
|
|
@@ -2451,7 +2473,7 @@ const Xo = (t, e, r) => t.type === D.GAMES ? new Wo(t, e, r) : new Jo(t, e), Zo
|
|
|
2451
2473
|
streamSettings: (o) => {
|
|
2452
2474
|
if (o.data)
|
|
2453
2475
|
try {
|
|
2454
|
-
n(
|
|
2476
|
+
n(me.STREAM, o.data);
|
|
2455
2477
|
} catch (s) {
|
|
2456
2478
|
console.log(s);
|
|
2457
2479
|
}
|
|
@@ -2460,7 +2482,7 @@ const Xo = (t, e, r) => t.type === D.GAMES ? new Wo(t, e, r) : new Jo(t, e), Zo
|
|
|
2460
2482
|
t.store.subscribe(i);
|
|
2461
2483
|
}, r();
|
|
2462
2484
|
};
|
|
2463
|
-
class
|
|
2485
|
+
class rs {
|
|
2464
2486
|
analytics;
|
|
2465
2487
|
constructor(e) {
|
|
2466
2488
|
this.analytics = e, this.analytics.onConnect(() => {
|
|
@@ -2472,7 +2494,7 @@ class es {
|
|
|
2472
2494
|
break;
|
|
2473
2495
|
}
|
|
2474
2496
|
};
|
|
2475
|
-
return
|
|
2497
|
+
return M.listen(r);
|
|
2476
2498
|
});
|
|
2477
2499
|
}
|
|
2478
2500
|
accepted = () => {
|
|
@@ -2481,7 +2503,7 @@ class es {
|
|
|
2481
2503
|
...this.analytics.commonStore.getValues(),
|
|
2482
2504
|
kind: Q.INVITATION_ACCEPTED
|
|
2483
2505
|
},
|
|
2484
|
-
category:
|
|
2506
|
+
category: Br.GAMES,
|
|
2485
2507
|
from: Mr.UNSET
|
|
2486
2508
|
});
|
|
2487
2509
|
};
|
|
@@ -2491,12 +2513,12 @@ class es {
|
|
|
2491
2513
|
...this.analytics.commonStore.getValues(),
|
|
2492
2514
|
kind: Q.INVITATION_SENT
|
|
2493
2515
|
},
|
|
2494
|
-
category:
|
|
2516
|
+
category: Br.GAMES,
|
|
2495
2517
|
from: e || Mr.UNSET
|
|
2496
2518
|
});
|
|
2497
2519
|
};
|
|
2498
2520
|
}
|
|
2499
|
-
class
|
|
2521
|
+
class ns {
|
|
2500
2522
|
analytics;
|
|
2501
2523
|
constructor(e) {
|
|
2502
2524
|
this.analytics = e, this.analytics.onConnect(() => {
|
|
@@ -2511,7 +2533,7 @@ class ts {
|
|
|
2511
2533
|
break;
|
|
2512
2534
|
}
|
|
2513
2535
|
};
|
|
2514
|
-
return
|
|
2536
|
+
return M.listen(r);
|
|
2515
2537
|
});
|
|
2516
2538
|
}
|
|
2517
2539
|
tap = () => {
|
|
@@ -2520,7 +2542,7 @@ class ts {
|
|
|
2520
2542
|
...this.analytics.commonStore.getValues(),
|
|
2521
2543
|
kind: Q.INTERACTIONS
|
|
2522
2544
|
},
|
|
2523
|
-
actionType:
|
|
2545
|
+
actionType: Kr.TAP
|
|
2524
2546
|
});
|
|
2525
2547
|
};
|
|
2526
2548
|
scroll = () => {
|
|
@@ -2529,11 +2551,11 @@ class ts {
|
|
|
2529
2551
|
...this.analytics.commonStore.getValues(),
|
|
2530
2552
|
kind: Q.INTERACTIONS
|
|
2531
2553
|
},
|
|
2532
|
-
actionType:
|
|
2554
|
+
actionType: Kr.SCROLL
|
|
2533
2555
|
});
|
|
2534
2556
|
};
|
|
2535
2557
|
}
|
|
2536
|
-
const
|
|
2558
|
+
const is = {
|
|
2537
2559
|
[W.UNSET]: Ae.UNSET,
|
|
2538
2560
|
[W.INGAME_IAB21]: Ae.PROMOTION_INGAME_IAB21,
|
|
2539
2561
|
[W.INGAME_IAB11_LBAR]: Ae.PROMOTION_INGAME_IAB11_LBAR,
|
|
@@ -2541,14 +2563,14 @@ const rs = {
|
|
|
2541
2563
|
[W.INGAME_IAB21_LBAR]: Ae.PROMOTION_INGAME_IAB21_LBAR,
|
|
2542
2564
|
[W.INGAME_IAB61]: Ae.PROMOTION_INGAME_IAB61,
|
|
2543
2565
|
[W.EXTERNAL_AD]: Ae.PROMOTION_GAM
|
|
2544
|
-
};
|
|
2545
|
-
class
|
|
2566
|
+
}, cr = (t) => t ? is[t] : Ae.UNSET;
|
|
2567
|
+
class os {
|
|
2546
2568
|
analytics;
|
|
2547
2569
|
constructor(e) {
|
|
2548
2570
|
this.analytics = e, this.analytics.onConnect(() => {
|
|
2549
2571
|
const r = (n) => {
|
|
2550
2572
|
if (!n.slEventBus?.skipAnalytics && n.slEventBus?.type === "advertisement") {
|
|
2551
|
-
const i = n.slEventBus.payload.type
|
|
2573
|
+
const i = cr(n.slEventBus.payload.type);
|
|
2552
2574
|
switch (n.slEventBus.action) {
|
|
2553
2575
|
case "videoPlay":
|
|
2554
2576
|
this.videoPlay(n.slEventBus.payload, { topicSubType: i });
|
|
@@ -2565,10 +2587,13 @@ class ns {
|
|
|
2565
2587
|
case "opened":
|
|
2566
2588
|
this.opened(n.slEventBus.payload, { topicSubType: i });
|
|
2567
2589
|
break;
|
|
2590
|
+
case "viewed":
|
|
2591
|
+
this.viewed(n.slEventBus.payload, { topicSubType: i });
|
|
2592
|
+
break;
|
|
2568
2593
|
}
|
|
2569
2594
|
}
|
|
2570
2595
|
};
|
|
2571
|
-
return
|
|
2596
|
+
return M.listen(r);
|
|
2572
2597
|
});
|
|
2573
2598
|
}
|
|
2574
2599
|
received = ({ id: e }, { topicSubType: r }) => {
|
|
@@ -2580,10 +2605,22 @@ class ns {
|
|
|
2580
2605
|
topicType: x.POLLS_PROMOTION,
|
|
2581
2606
|
topicSubType: r
|
|
2582
2607
|
},
|
|
2583
|
-
pollOpenedFrom:
|
|
2608
|
+
pollOpenedFrom: Y.UNSET
|
|
2584
2609
|
});
|
|
2585
2610
|
};
|
|
2586
|
-
opened = ({ id: e }, { topicSubType:
|
|
2611
|
+
opened = ({ id: e, openedFrom: r }, { topicSubType: n }) => {
|
|
2612
|
+
this.analytics.write("games", {
|
|
2613
|
+
common: {
|
|
2614
|
+
...this.analytics.commonStore.getValues(),
|
|
2615
|
+
kind: Q.POLLS_OPENED,
|
|
2616
|
+
topicId: e,
|
|
2617
|
+
topicType: x.POLLS_PROMOTION,
|
|
2618
|
+
topicSubType: n
|
|
2619
|
+
},
|
|
2620
|
+
pollOpenedFrom: r === "notification" ? Y.IN_APP : Y.UNSET
|
|
2621
|
+
});
|
|
2622
|
+
};
|
|
2623
|
+
viewed = ({ id: e }, { topicSubType: r }) => {
|
|
2587
2624
|
this.analytics.write("games", {
|
|
2588
2625
|
common: {
|
|
2589
2626
|
...this.analytics.commonStore.getValues(),
|
|
@@ -2592,7 +2629,7 @@ class ns {
|
|
|
2592
2629
|
topicType: x.POLLS_PROMOTION,
|
|
2593
2630
|
topicSubType: r
|
|
2594
2631
|
},
|
|
2595
|
-
pollOpenedFrom:
|
|
2632
|
+
pollOpenedFrom: Y.UNSET
|
|
2596
2633
|
});
|
|
2597
2634
|
};
|
|
2598
2635
|
videoPlay = ({ id: e }, { topicSubType: r }) => {
|
|
@@ -2604,7 +2641,7 @@ class ns {
|
|
|
2604
2641
|
topicType: x.POLLS_PROMOTION,
|
|
2605
2642
|
topicSubType: r
|
|
2606
2643
|
},
|
|
2607
|
-
pollOpenedFrom:
|
|
2644
|
+
pollOpenedFrom: Y.UNSET
|
|
2608
2645
|
});
|
|
2609
2646
|
};
|
|
2610
2647
|
buttonSelect = ({ id: e }, { topicSubType: r }) => {
|
|
@@ -2616,7 +2653,7 @@ class ns {
|
|
|
2616
2653
|
topicType: x.POLLS_PROMOTION,
|
|
2617
2654
|
topicSubType: r
|
|
2618
2655
|
},
|
|
2619
|
-
pollOpenedFrom:
|
|
2656
|
+
pollOpenedFrom: Y.UNSET
|
|
2620
2657
|
});
|
|
2621
2658
|
};
|
|
2622
2659
|
bannerSelect = ({ id: e }, { topicSubType: r }) => {
|
|
@@ -2628,41 +2665,41 @@ class ns {
|
|
|
2628
2665
|
topicType: x.POLLS_PROMOTION,
|
|
2629
2666
|
topicSubType: r
|
|
2630
2667
|
},
|
|
2631
|
-
pollOpenedFrom:
|
|
2668
|
+
pollOpenedFrom: Y.UNSET
|
|
2632
2669
|
});
|
|
2633
2670
|
};
|
|
2634
2671
|
}
|
|
2635
|
-
const
|
|
2636
|
-
[
|
|
2637
|
-
[
|
|
2638
|
-
[
|
|
2639
|
-
[
|
|
2640
|
-
[
|
|
2641
|
-
[
|
|
2642
|
-
[
|
|
2672
|
+
const et = {
|
|
2673
|
+
[_.UNSET]: x.UNSET,
|
|
2674
|
+
[_.FACTOID]: x.POLLS_INSIGHT,
|
|
2675
|
+
[_.POLL]: x.POLLS_POLL,
|
|
2676
|
+
[_.PREDICTION]: x.POLLS_PREDICTION,
|
|
2677
|
+
[_.PROMOTION]: x.POLLS_PROMOTION,
|
|
2678
|
+
[_.TRIVIA]: x.POLLS_TRIVIA,
|
|
2679
|
+
[_.TWEET]: x.POLLS_TWITTER
|
|
2643
2680
|
};
|
|
2644
|
-
|
|
2645
|
-
const
|
|
2646
|
-
[
|
|
2647
|
-
[
|
|
2648
|
-
[
|
|
2649
|
-
[
|
|
2650
|
-
[
|
|
2651
|
-
[
|
|
2652
|
-
[
|
|
2653
|
-
[
|
|
2654
|
-
[
|
|
2655
|
-
[
|
|
2656
|
-
[
|
|
2657
|
-
[
|
|
2658
|
-
[
|
|
2681
|
+
_.UNSET + "", he.UNSET, _.FACTOID + "", he.POLLS, _.POLL + "", he.POLLS, _.PREDICTION + "", he.POLLS, _.PROMOTION + "", he.POLLS, _.TRIVIA + "", he.POLLS, _.TWEET + "", he.POLLS;
|
|
2682
|
+
const ss = {
|
|
2683
|
+
[R.UNSET]: z.UNSET,
|
|
2684
|
+
[R.INPLAY]: z.INPLAY,
|
|
2685
|
+
[R.MESSAGING]: z.MESSAGING,
|
|
2686
|
+
[R.STATISTICS]: z.STATS,
|
|
2687
|
+
[R.BETTING]: z.BETTING,
|
|
2688
|
+
[R.TWITTER]: z.TWITTER,
|
|
2689
|
+
[R.MERCHANDISE]: z.MERCHANDISE,
|
|
2690
|
+
[R.CONTESTS]: z.CONTESTS,
|
|
2691
|
+
[R.VOICE_CHAT]: z.CALLING,
|
|
2692
|
+
[R.TICKETS]: z.TICKETS,
|
|
2693
|
+
[R.WHOIS_WATCHING]: z.WHOISWATCHING,
|
|
2694
|
+
[R.PROFILE]: z.PROFILE,
|
|
2695
|
+
[R.GAMES]: z.POLLS,
|
|
2659
2696
|
// ??
|
|
2660
|
-
[
|
|
2697
|
+
[R.GOLF_STATISTICS]: z.STATS,
|
|
2661
2698
|
// ??
|
|
2662
|
-
[
|
|
2663
|
-
[
|
|
2699
|
+
[R.HIGHLIGHTS]: z.HIGHLIGHTS,
|
|
2700
|
+
[R.PUBLIC_CHAT]: z.PUBLIC_CHAT
|
|
2664
2701
|
};
|
|
2665
|
-
class
|
|
2702
|
+
class as {
|
|
2666
2703
|
analytics;
|
|
2667
2704
|
constructor(e) {
|
|
2668
2705
|
this.analytics = e, this.analytics.onConnect(() => {
|
|
@@ -2676,36 +2713,55 @@ class os {
|
|
|
2676
2713
|
this.opened(n.slEventBus.payload);
|
|
2677
2714
|
break;
|
|
2678
2715
|
}
|
|
2716
|
+
if (n.slEventBus?.type === "advertisement")
|
|
2717
|
+
switch (n.slEventBus.action) {
|
|
2718
|
+
case "notification-received":
|
|
2719
|
+
this.received({
|
|
2720
|
+
questionId: n.slEventBus.payload.id,
|
|
2721
|
+
questionType: _.PROMOTION,
|
|
2722
|
+
topicSubType: cr(n.slEventBus.payload.type)
|
|
2723
|
+
});
|
|
2724
|
+
break;
|
|
2725
|
+
case "notification-opened":
|
|
2726
|
+
this.opened({
|
|
2727
|
+
questionId: n.slEventBus.payload.id,
|
|
2728
|
+
questionType: _.PROMOTION,
|
|
2729
|
+
topicSubType: cr(n.slEventBus.payload.type)
|
|
2730
|
+
});
|
|
2731
|
+
break;
|
|
2732
|
+
}
|
|
2679
2733
|
};
|
|
2680
|
-
return
|
|
2734
|
+
return M.listen(r);
|
|
2681
2735
|
});
|
|
2682
2736
|
}
|
|
2683
|
-
received = ({ questionId: e, questionType: r }) => {
|
|
2737
|
+
received = ({ questionId: e, questionType: r, topicSubType: n }) => {
|
|
2684
2738
|
this.analytics.write("notification", {
|
|
2685
2739
|
common: {
|
|
2686
2740
|
...this.analytics.commonStore.getValues(),
|
|
2687
2741
|
kind: Q.NOTIFICATION_RECEIVED,
|
|
2688
2742
|
topicId: e,
|
|
2689
|
-
topicType: r ?
|
|
2743
|
+
topicType: r ? et[r] : x.UNSET,
|
|
2744
|
+
topicSubType: n
|
|
2690
2745
|
},
|
|
2691
|
-
notificationKind:
|
|
2692
|
-
notificationType:
|
|
2746
|
+
notificationKind: he.POLLS,
|
|
2747
|
+
notificationType: zr.IN_APP
|
|
2693
2748
|
});
|
|
2694
2749
|
};
|
|
2695
|
-
opened = ({ questionId: e, questionType: r }) => {
|
|
2750
|
+
opened = ({ questionId: e, questionType: r, topicSubType: n }) => {
|
|
2696
2751
|
this.analytics.write("notification", {
|
|
2697
2752
|
common: {
|
|
2698
2753
|
...this.analytics.commonStore.getValues(),
|
|
2699
2754
|
kind: Q.NOTIFICATION_OPENED,
|
|
2700
2755
|
topicId: e,
|
|
2701
|
-
topicType: r ?
|
|
2756
|
+
topicType: r ? et[r] : x.UNSET,
|
|
2757
|
+
topicSubType: n
|
|
2702
2758
|
},
|
|
2703
|
-
notificationKind:
|
|
2704
|
-
notificationType:
|
|
2759
|
+
notificationKind: he.POLLS,
|
|
2760
|
+
notificationType: zr.IN_APP
|
|
2705
2761
|
});
|
|
2706
2762
|
};
|
|
2707
2763
|
}
|
|
2708
|
-
class
|
|
2764
|
+
class us {
|
|
2709
2765
|
analytics;
|
|
2710
2766
|
constructor(e) {
|
|
2711
2767
|
this.analytics = e, this.analytics.onConnect(() => {
|
|
@@ -2729,7 +2785,7 @@ class ss {
|
|
|
2729
2785
|
break;
|
|
2730
2786
|
}
|
|
2731
2787
|
};
|
|
2732
|
-
return
|
|
2788
|
+
return M.listen(r);
|
|
2733
2789
|
});
|
|
2734
2790
|
}
|
|
2735
2791
|
// event when a poll is received from subscription or active question request
|
|
@@ -2739,9 +2795,9 @@ class ss {
|
|
|
2739
2795
|
...this.analytics.commonStore.getValues(),
|
|
2740
2796
|
kind: Q.POLLS_RECEIVED,
|
|
2741
2797
|
topicId: e,
|
|
2742
|
-
topicType: r ?
|
|
2798
|
+
topicType: r ? et[r] : x.UNSET
|
|
2743
2799
|
},
|
|
2744
|
-
pollOpenedFrom:
|
|
2800
|
+
pollOpenedFrom: Y.UNSET
|
|
2745
2801
|
});
|
|
2746
2802
|
};
|
|
2747
2803
|
// poll is opened from notification or list
|
|
@@ -2751,9 +2807,9 @@ class ss {
|
|
|
2751
2807
|
...this.analytics.commonStore.getValues(),
|
|
2752
2808
|
kind: Q.POLLS_OPENED,
|
|
2753
2809
|
topicId: e,
|
|
2754
|
-
topicType: r ?
|
|
2810
|
+
topicType: r ? et[r] : x.UNSET
|
|
2755
2811
|
},
|
|
2756
|
-
pollOpenedFrom: n === "list" ?
|
|
2812
|
+
pollOpenedFrom: n === "list" ? Y.PICK_HISTORY : Y.IN_APP
|
|
2757
2813
|
});
|
|
2758
2814
|
};
|
|
2759
2815
|
// poll is voted
|
|
@@ -2763,9 +2819,9 @@ class ss {
|
|
|
2763
2819
|
...this.analytics.commonStore.getValues(),
|
|
2764
2820
|
kind: Q.POLLS_VOTE,
|
|
2765
2821
|
topicId: e,
|
|
2766
|
-
topicType: r ?
|
|
2822
|
+
topicType: r ? et[r] : x.UNSET
|
|
2767
2823
|
},
|
|
2768
|
-
pollOpenedFrom:
|
|
2824
|
+
pollOpenedFrom: Y.UNSET
|
|
2769
2825
|
});
|
|
2770
2826
|
};
|
|
2771
2827
|
// onboarding passed, user is now able to vote
|
|
@@ -2775,7 +2831,7 @@ class ss {
|
|
|
2775
2831
|
...this.analytics.commonStore.getValues(),
|
|
2776
2832
|
kind: Q.GAMES_JOINED
|
|
2777
2833
|
},
|
|
2778
|
-
pollOpenedFrom:
|
|
2834
|
+
pollOpenedFrom: Y.UNSET
|
|
2779
2835
|
});
|
|
2780
2836
|
};
|
|
2781
2837
|
// user clicked on link in poll and navigated to another page
|
|
@@ -2785,13 +2841,13 @@ class ss {
|
|
|
2785
2841
|
...this.analytics.commonStore.getValues(),
|
|
2786
2842
|
kind: Q.POLLS_NAVIGATED
|
|
2787
2843
|
},
|
|
2788
|
-
pollOpenedFrom:
|
|
2844
|
+
pollOpenedFrom: Y.UNSET
|
|
2789
2845
|
});
|
|
2790
2846
|
};
|
|
2791
2847
|
}
|
|
2792
|
-
const
|
|
2848
|
+
const cs = ({ transport: t, $commonStore: e }) => {
|
|
2793
2849
|
let r;
|
|
2794
|
-
const n =
|
|
2850
|
+
const n = q(!1), i = 5e3, { client: o, queryKey: s } = t.createPromiseClient(Ln, {
|
|
2795
2851
|
method: "send",
|
|
2796
2852
|
params: [n]
|
|
2797
2853
|
}), a = t.nanoquery.createFetcherStore(s, {
|
|
@@ -2810,24 +2866,24 @@ const as = ({ transport: t, $commonStore: e }) => {
|
|
|
2810
2866
|
}
|
|
2811
2867
|
});
|
|
2812
2868
|
} catch (v) {
|
|
2813
|
-
|
|
2869
|
+
be.error(v, "send heartbeat failed");
|
|
2814
2870
|
}
|
|
2815
2871
|
return Date.now();
|
|
2816
2872
|
},
|
|
2817
2873
|
refetchInterval: i
|
|
2818
2874
|
}), u = () => {
|
|
2819
|
-
|
|
2875
|
+
be.debug("mounted heartbeat"), r = a.subscribe(() => {
|
|
2820
2876
|
});
|
|
2821
2877
|
}, l = () => {
|
|
2822
|
-
|
|
2878
|
+
be.debug("enabled heartbeat"), n.set(!0), a.lc === 0 && u();
|
|
2823
2879
|
}, c = () => {
|
|
2824
|
-
|
|
2880
|
+
be.debug("disabled heartbeat"), n.set(!1);
|
|
2825
2881
|
};
|
|
2826
2882
|
return { enable: l, disable: c, mount: u, unmount: () => {
|
|
2827
|
-
|
|
2883
|
+
be.debug("unmounted heartbeat"), a.off(), r?.(), r = void 0, c();
|
|
2828
2884
|
} };
|
|
2829
|
-
},
|
|
2830
|
-
class
|
|
2885
|
+
}, be = de("analytics");
|
|
2886
|
+
class ls {
|
|
2831
2887
|
commonStore;
|
|
2832
2888
|
notifications;
|
|
2833
2889
|
polls;
|
|
@@ -2840,23 +2896,23 @@ class us {
|
|
|
2840
2896
|
listenersCancels;
|
|
2841
2897
|
connected = !1;
|
|
2842
2898
|
constructor(e) {
|
|
2843
|
-
this.listeners = /* @__PURE__ */ new Set(), this.listenersCancels = /* @__PURE__ */ new Set(), this.commonStore = new
|
|
2844
|
-
const { client: r } = e.analyticsTransport.createPromiseClient(
|
|
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);
|
|
2900
|
+
const { client: r } = e.analyticsTransport.createPromiseClient(Ln, {
|
|
2845
2901
|
method: "send"
|
|
2846
2902
|
});
|
|
2847
2903
|
this.analyticsClient = r;
|
|
2848
2904
|
}
|
|
2849
2905
|
connect = () => {
|
|
2850
|
-
this.writeCommon("sessionId", ir()), this.heartbeat.enable(), this.listeners.forEach((e) => this.listenersCancels.add(e())), this.connected = !0,
|
|
2906
|
+
this.writeCommon("sessionId", ir()), this.heartbeat.enable(), this.listeners.forEach((e) => this.listenersCancels.add(e())), this.connected = !0, be.debug("analytics connected");
|
|
2851
2907
|
};
|
|
2852
2908
|
disconnect = () => {
|
|
2853
|
-
this.writeCommon("sessionId", ""), this.writeCommon("overlaySessionId", ""), this.heartbeat.unmount(), this.listenersCancels.forEach((e) => e()), this.connected = !1,
|
|
2909
|
+
this.writeCommon("sessionId", ""), this.writeCommon("overlaySessionId", ""), this.heartbeat.unmount(), this.listenersCancels.forEach((e) => e()), this.connected = !1, be.debug("analytics disconnected");
|
|
2854
2910
|
};
|
|
2855
2911
|
write = (e, r) => {
|
|
2856
2912
|
r && this.analyticsClient.unary({ message: { case: e, value: r } }).then(() => {
|
|
2857
|
-
|
|
2913
|
+
be.trace("send analytics success", e, r);
|
|
2858
2914
|
}).catch((n) => {
|
|
2859
|
-
|
|
2915
|
+
be.error(n, "send analytics failed");
|
|
2860
2916
|
});
|
|
2861
2917
|
};
|
|
2862
2918
|
writeCommon = (e, r) => {
|
|
@@ -2870,10 +2926,10 @@ class us {
|
|
|
2870
2926
|
this.onConnect(() => e.stores.slStreamId.getAtomStore().subscribe((r) => {
|
|
2871
2927
|
this.writeCommon("eventId", r);
|
|
2872
2928
|
})), this.onConnect(() => e.sdk.getActiveFeature().subscribe((r) => {
|
|
2873
|
-
r && this.writeCommon("category",
|
|
2929
|
+
r && this.writeCommon("category", ss[r]), r !== R.UNSET ? this.writeCommon("overlaySessionId", ir()) : this.writeCommon("overlaySessionId", "");
|
|
2874
2930
|
})), this.onConnect(() => {
|
|
2875
2931
|
const r = window.matchMedia("(orientation: portrait)"), n = (i) => {
|
|
2876
|
-
this.writeCommon("screenOrientation", i.matches ?
|
|
2932
|
+
this.writeCommon("screenOrientation", i.matches ? Gr.PORTRAIT : Gr.LANDSCAPE);
|
|
2877
2933
|
};
|
|
2878
2934
|
return r.addEventListener("change", n), () => {
|
|
2879
2935
|
r.removeEventListener("change", n);
|
|
@@ -2883,17 +2939,17 @@ class us {
|
|
|
2883
2939
|
}));
|
|
2884
2940
|
};
|
|
2885
2941
|
}
|
|
2886
|
-
const
|
|
2887
|
-
t.analytics = new
|
|
2942
|
+
const ds = (t, e, r) => {
|
|
2943
|
+
t.analytics = new ls(t), t.sdk.onMount({ name: "analytics" }, () => (t.analytics.connect(), () => {
|
|
2888
2944
|
t.analytics.disconnect();
|
|
2889
2945
|
})), r();
|
|
2890
2946
|
};
|
|
2891
|
-
var
|
|
2892
|
-
function
|
|
2947
|
+
var Ar = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
|
|
2948
|
+
function fs(t) {
|
|
2893
2949
|
return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
|
|
2894
2950
|
}
|
|
2895
|
-
var
|
|
2896
|
-
function
|
|
2951
|
+
var Er = { exports: {} }, Ir = { exports: {} };
|
|
2952
|
+
function ps(t) {
|
|
2897
2953
|
var e = new t(), r = e;
|
|
2898
2954
|
function n() {
|
|
2899
2955
|
var o = e;
|
|
@@ -2907,14 +2963,14 @@ function ds(t) {
|
|
|
2907
2963
|
release: i
|
|
2908
2964
|
};
|
|
2909
2965
|
}
|
|
2910
|
-
var
|
|
2911
|
-
function
|
|
2966
|
+
var hs = ps, ys = hs;
|
|
2967
|
+
function jn(t, e, r) {
|
|
2912
2968
|
if (typeof t == "function" && (r = e, e = t, t = null), !(r >= 1))
|
|
2913
2969
|
throw new Error("fastqueue concurrency must be equal to or greater than 1");
|
|
2914
|
-
var n =
|
|
2970
|
+
var n = ys(ms), i = null, o = null, s = 0, a = null, u = {
|
|
2915
2971
|
push: b,
|
|
2916
|
-
drain:
|
|
2917
|
-
saturated:
|
|
2972
|
+
drain: X,
|
|
2973
|
+
saturated: X,
|
|
2918
2974
|
pause: c,
|
|
2919
2975
|
paused: !1,
|
|
2920
2976
|
get concurrency() {
|
|
@@ -2933,10 +2989,10 @@ function Bn(t, e, r) {
|
|
|
2933
2989
|
length: f,
|
|
2934
2990
|
getQueue: p,
|
|
2935
2991
|
unshift: g,
|
|
2936
|
-
empty:
|
|
2937
|
-
kill:
|
|
2992
|
+
empty: X,
|
|
2993
|
+
kill: F,
|
|
2938
2994
|
killAndDrain: K,
|
|
2939
|
-
error:
|
|
2995
|
+
error: re
|
|
2940
2996
|
};
|
|
2941
2997
|
return u;
|
|
2942
2998
|
function l() {
|
|
@@ -2970,45 +3026,45 @@ function Bn(t, e, r) {
|
|
|
2970
3026
|
}
|
|
2971
3027
|
function b(P, V) {
|
|
2972
3028
|
var O = n.get();
|
|
2973
|
-
O.context = t, O.release = S, O.value = P, O.callback = V ||
|
|
3029
|
+
O.context = t, O.release = S, O.value = P, O.callback = V || X, O.errorHandler = a, s >= r || u.paused ? o ? (o.next = O, o = O) : (i = O, o = O, u.saturated()) : (s++, e.call(t, O.value, O.worked));
|
|
2974
3030
|
}
|
|
2975
3031
|
function g(P, V) {
|
|
2976
3032
|
var O = n.get();
|
|
2977
|
-
O.context = t, O.release = S, O.value = P, O.callback = V ||
|
|
3033
|
+
O.context = t, O.release = S, O.value = P, O.callback = V || X, O.errorHandler = a, s >= r || u.paused ? i ? (O.next = i, i = O) : (i = O, o = O, u.saturated()) : (s++, e.call(t, O.value, O.worked));
|
|
2978
3034
|
}
|
|
2979
3035
|
function S(P) {
|
|
2980
3036
|
P && n.release(P);
|
|
2981
3037
|
var V = i;
|
|
2982
3038
|
V && s <= r ? u.paused ? s-- : (o === i && (o = null), i = V.next, V.next = null, e.call(t, V.value, V.worked), o === null && u.empty()) : --s === 0 && u.drain();
|
|
2983
3039
|
}
|
|
2984
|
-
function
|
|
2985
|
-
i = null, o = null, u.drain =
|
|
3040
|
+
function F() {
|
|
3041
|
+
i = null, o = null, u.drain = X;
|
|
2986
3042
|
}
|
|
2987
3043
|
function K() {
|
|
2988
|
-
i = null, o = null, u.drain(), u.drain =
|
|
3044
|
+
i = null, o = null, u.drain(), u.drain = X;
|
|
2989
3045
|
}
|
|
2990
|
-
function
|
|
3046
|
+
function re(P) {
|
|
2991
3047
|
a = P;
|
|
2992
3048
|
}
|
|
2993
3049
|
}
|
|
2994
|
-
function
|
|
3050
|
+
function X() {
|
|
2995
3051
|
}
|
|
2996
|
-
function
|
|
2997
|
-
this.value = null, this.callback =
|
|
3052
|
+
function ms() {
|
|
3053
|
+
this.value = null, this.callback = X, this.next = null, this.release = X, this.context = null, this.errorHandler = null;
|
|
2998
3054
|
var t = this;
|
|
2999
3055
|
this.worked = function(r, n) {
|
|
3000
3056
|
var i = t.callback, o = t.errorHandler, s = t.value;
|
|
3001
|
-
t.value = null, t.callback =
|
|
3057
|
+
t.value = null, t.callback = X, t.errorHandler && o(r, s), i.call(t.context, r, n), t.release(t);
|
|
3002
3058
|
};
|
|
3003
3059
|
}
|
|
3004
|
-
function
|
|
3060
|
+
function gs(t, e, r) {
|
|
3005
3061
|
typeof t == "function" && (r = e, e = t, t = null);
|
|
3006
3062
|
function n(c, f) {
|
|
3007
3063
|
e.call(this, c).then(function(p) {
|
|
3008
3064
|
f(null, p);
|
|
3009
3065
|
}, f);
|
|
3010
3066
|
}
|
|
3011
|
-
var i =
|
|
3067
|
+
var i = jn(t, n, r), o = i.push, s = i.unshift;
|
|
3012
3068
|
return i.push = a, i.unshift = u, i.drained = l, i;
|
|
3013
3069
|
function a(c) {
|
|
3014
3070
|
var f = new Promise(function(p, v) {
|
|
@@ -3020,7 +3076,7 @@ function ys(t, e, r) {
|
|
|
3020
3076
|
p(b);
|
|
3021
3077
|
});
|
|
3022
3078
|
});
|
|
3023
|
-
return f.catch(
|
|
3079
|
+
return f.catch(X), f;
|
|
3024
3080
|
}
|
|
3025
3081
|
function u(c) {
|
|
3026
3082
|
var f = new Promise(function(p, v) {
|
|
@@ -3032,7 +3088,7 @@ function ys(t, e, r) {
|
|
|
3032
3088
|
p(b);
|
|
3033
3089
|
});
|
|
3034
3090
|
});
|
|
3035
|
-
return f.catch(
|
|
3091
|
+
return f.catch(X), f;
|
|
3036
3092
|
}
|
|
3037
3093
|
function l() {
|
|
3038
3094
|
if (i.idle())
|
|
@@ -3047,32 +3103,32 @@ function ys(t, e, r) {
|
|
|
3047
3103
|
return f;
|
|
3048
3104
|
}
|
|
3049
3105
|
}
|
|
3050
|
-
|
|
3051
|
-
|
|
3052
|
-
var
|
|
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) {
|
|
3053
3109
|
return Function.prototype.apply.call(e, r, n);
|
|
3054
3110
|
}, yt;
|
|
3055
|
-
|
|
3111
|
+
Ge && typeof Ge.ownKeys == "function" ? yt = Ge.ownKeys : Object.getOwnPropertySymbols ? yt = function(e) {
|
|
3056
3112
|
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
|
|
3057
3113
|
} : yt = function(e) {
|
|
3058
3114
|
return Object.getOwnPropertyNames(e);
|
|
3059
3115
|
};
|
|
3060
|
-
function
|
|
3116
|
+
function bs(t) {
|
|
3061
3117
|
console && console.warn && console.warn(t);
|
|
3062
3118
|
}
|
|
3063
|
-
var
|
|
3119
|
+
var xn = Number.isNaN || function(e) {
|
|
3064
3120
|
return e !== e;
|
|
3065
3121
|
};
|
|
3066
3122
|
function N() {
|
|
3067
3123
|
N.init.call(this);
|
|
3068
3124
|
}
|
|
3069
|
-
|
|
3070
|
-
|
|
3125
|
+
Tr.exports = N;
|
|
3126
|
+
Tr.exports.once = As;
|
|
3071
3127
|
N.EventEmitter = N;
|
|
3072
3128
|
N.prototype._events = void 0;
|
|
3073
3129
|
N.prototype._eventsCount = 0;
|
|
3074
3130
|
N.prototype._maxListeners = void 0;
|
|
3075
|
-
var
|
|
3131
|
+
var nn = 10;
|
|
3076
3132
|
function Ft(t) {
|
|
3077
3133
|
if (typeof t != "function")
|
|
3078
3134
|
throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t);
|
|
@@ -3080,27 +3136,27 @@ function Ft(t) {
|
|
|
3080
3136
|
Object.defineProperty(N, "defaultMaxListeners", {
|
|
3081
3137
|
enumerable: !0,
|
|
3082
3138
|
get: function() {
|
|
3083
|
-
return
|
|
3139
|
+
return nn;
|
|
3084
3140
|
},
|
|
3085
3141
|
set: function(t) {
|
|
3086
|
-
if (typeof t != "number" || t < 0 ||
|
|
3142
|
+
if (typeof t != "number" || t < 0 || xn(t))
|
|
3087
3143
|
throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + ".");
|
|
3088
|
-
|
|
3144
|
+
nn = t;
|
|
3089
3145
|
}
|
|
3090
3146
|
});
|
|
3091
3147
|
N.init = function() {
|
|
3092
3148
|
(this._events === void 0 || this._events === Object.getPrototypeOf(this)._events) && (this._events = /* @__PURE__ */ Object.create(null), this._eventsCount = 0), this._maxListeners = this._maxListeners || void 0;
|
|
3093
3149
|
};
|
|
3094
3150
|
N.prototype.setMaxListeners = function(e) {
|
|
3095
|
-
if (typeof e != "number" || e < 0 ||
|
|
3151
|
+
if (typeof e != "number" || e < 0 || xn(e))
|
|
3096
3152
|
throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + ".");
|
|
3097
3153
|
return this._maxListeners = e, this;
|
|
3098
3154
|
};
|
|
3099
|
-
function
|
|
3155
|
+
function Qn(t) {
|
|
3100
3156
|
return t._maxListeners === void 0 ? N.defaultMaxListeners : t._maxListeners;
|
|
3101
3157
|
}
|
|
3102
3158
|
N.prototype.getMaxListeners = function() {
|
|
3103
|
-
return
|
|
3159
|
+
return Qn(this);
|
|
3104
3160
|
};
|
|
3105
3161
|
N.prototype.emit = function(e) {
|
|
3106
3162
|
for (var r = [], n = 1; n < arguments.length; n++) r.push(arguments[n]);
|
|
@@ -3120,13 +3176,13 @@ N.prototype.emit = function(e) {
|
|
|
3120
3176
|
if (u === void 0)
|
|
3121
3177
|
return !1;
|
|
3122
3178
|
if (typeof u == "function")
|
|
3123
|
-
|
|
3179
|
+
rn(u, this, r);
|
|
3124
3180
|
else
|
|
3125
|
-
for (var l = u.length, c =
|
|
3126
|
-
|
|
3181
|
+
for (var l = u.length, c = Wn(u, l), n = 0; n < l; ++n)
|
|
3182
|
+
rn(c[n], this, r);
|
|
3127
3183
|
return !0;
|
|
3128
3184
|
};
|
|
3129
|
-
function
|
|
3185
|
+
function Gn(t, e, r, n) {
|
|
3130
3186
|
var i, o, s;
|
|
3131
3187
|
if (Ft(r), o = t._events, o === void 0 ? (o = t._events = /* @__PURE__ */ Object.create(null), t._eventsCount = 0) : (o.newListener !== void 0 && (t.emit(
|
|
3132
3188
|
"newListener",
|
|
@@ -3134,33 +3190,33 @@ function xn(t, e, r, n) {
|
|
|
3134
3190
|
r.listener ? r.listener : r
|
|
3135
3191
|
), o = t._events), s = o[e]), s === void 0)
|
|
3136
3192
|
s = o[e] = r, ++t._eventsCount;
|
|
3137
|
-
else if (typeof s == "function" ? s = o[e] = n ? [r, s] : [s, r] : n ? s.unshift(r) : s.push(r), i =
|
|
3193
|
+
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) {
|
|
3138
3194
|
s.warned = !0;
|
|
3139
3195
|
var a = new Error("Possible EventEmitter memory leak detected. " + s.length + " " + String(e) + " listeners added. Use emitter.setMaxListeners() to increase limit");
|
|
3140
|
-
a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length,
|
|
3196
|
+
a.name = "MaxListenersExceededWarning", a.emitter = t, a.type = e, a.count = s.length, bs(a);
|
|
3141
3197
|
}
|
|
3142
3198
|
return t;
|
|
3143
3199
|
}
|
|
3144
3200
|
N.prototype.addListener = function(e, r) {
|
|
3145
|
-
return
|
|
3201
|
+
return Gn(this, e, r, !1);
|
|
3146
3202
|
};
|
|
3147
3203
|
N.prototype.on = N.prototype.addListener;
|
|
3148
3204
|
N.prototype.prependListener = function(e, r) {
|
|
3149
|
-
return
|
|
3205
|
+
return Gn(this, e, r, !0);
|
|
3150
3206
|
};
|
|
3151
|
-
function
|
|
3207
|
+
function vs() {
|
|
3152
3208
|
if (!this.fired)
|
|
3153
3209
|
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);
|
|
3154
3210
|
}
|
|
3155
|
-
function
|
|
3156
|
-
var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i =
|
|
3211
|
+
function Kn(t, e, r) {
|
|
3212
|
+
var n = { fired: !1, wrapFn: void 0, target: t, type: e, listener: r }, i = vs.bind(n);
|
|
3157
3213
|
return i.listener = r, n.wrapFn = i, i;
|
|
3158
3214
|
}
|
|
3159
3215
|
N.prototype.once = function(e, r) {
|
|
3160
|
-
return Ft(r), this.on(e,
|
|
3216
|
+
return Ft(r), this.on(e, Kn(this, e, r)), this;
|
|
3161
3217
|
};
|
|
3162
3218
|
N.prototype.prependOnceListener = function(e, r) {
|
|
3163
|
-
return Ft(r), this.prependListener(e,
|
|
3219
|
+
return Ft(r), this.prependListener(e, Kn(this, e, r)), this;
|
|
3164
3220
|
};
|
|
3165
3221
|
N.prototype.removeListener = function(e, r) {
|
|
3166
3222
|
var n, i, o, s, a;
|
|
@@ -3178,7 +3234,7 @@ N.prototype.removeListener = function(e, r) {
|
|
|
3178
3234
|
}
|
|
3179
3235
|
if (o < 0)
|
|
3180
3236
|
return this;
|
|
3181
|
-
o === 0 ? n.shift() :
|
|
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);
|
|
3182
3238
|
}
|
|
3183
3239
|
return this;
|
|
3184
3240
|
};
|
|
@@ -3202,24 +3258,24 @@ N.prototype.removeAllListeners = function(e) {
|
|
|
3202
3258
|
this.removeListener(e, r[i]);
|
|
3203
3259
|
return this;
|
|
3204
3260
|
};
|
|
3205
|
-
function
|
|
3261
|
+
function zn(t, e, r) {
|
|
3206
3262
|
var n = t._events;
|
|
3207
3263
|
if (n === void 0)
|
|
3208
3264
|
return [];
|
|
3209
3265
|
var i = n[e];
|
|
3210
|
-
return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ?
|
|
3266
|
+
return i === void 0 ? [] : typeof i == "function" ? r ? [i.listener || i] : [i] : r ? ws(i) : Wn(i, i.length);
|
|
3211
3267
|
}
|
|
3212
3268
|
N.prototype.listeners = function(e) {
|
|
3213
|
-
return
|
|
3269
|
+
return zn(this, e, !0);
|
|
3214
3270
|
};
|
|
3215
3271
|
N.prototype.rawListeners = function(e) {
|
|
3216
|
-
return
|
|
3272
|
+
return zn(this, e, !1);
|
|
3217
3273
|
};
|
|
3218
3274
|
N.listenerCount = function(t, e) {
|
|
3219
|
-
return typeof t.listenerCount == "function" ? t.listenerCount(e) :
|
|
3275
|
+
return typeof t.listenerCount == "function" ? t.listenerCount(e) : Hn.call(t, e);
|
|
3220
3276
|
};
|
|
3221
|
-
N.prototype.listenerCount =
|
|
3222
|
-
function
|
|
3277
|
+
N.prototype.listenerCount = Hn;
|
|
3278
|
+
function Hn(t) {
|
|
3223
3279
|
var e = this._events;
|
|
3224
3280
|
if (e !== void 0) {
|
|
3225
3281
|
var r = e[t];
|
|
@@ -3233,22 +3289,22 @@ function Kn(t) {
|
|
|
3233
3289
|
N.prototype.eventNames = function() {
|
|
3234
3290
|
return this._eventsCount > 0 ? yt(this._events) : [];
|
|
3235
3291
|
};
|
|
3236
|
-
function
|
|
3292
|
+
function Wn(t, e) {
|
|
3237
3293
|
for (var r = new Array(e), n = 0; n < e; ++n)
|
|
3238
3294
|
r[n] = t[n];
|
|
3239
3295
|
return r;
|
|
3240
3296
|
}
|
|
3241
|
-
function
|
|
3297
|
+
function Ss(t, e) {
|
|
3242
3298
|
for (; e + 1 < t.length; e++)
|
|
3243
3299
|
t[e] = t[e + 1];
|
|
3244
3300
|
t.pop();
|
|
3245
3301
|
}
|
|
3246
|
-
function
|
|
3302
|
+
function ws(t) {
|
|
3247
3303
|
for (var e = new Array(t.length), r = 0; r < e.length; ++r)
|
|
3248
3304
|
e[r] = t[r].listener || t[r];
|
|
3249
3305
|
return e;
|
|
3250
3306
|
}
|
|
3251
|
-
function
|
|
3307
|
+
function As(t, e) {
|
|
3252
3308
|
return new Promise(function(r, n) {
|
|
3253
3309
|
function i(s) {
|
|
3254
3310
|
t.removeListener(e, o), n(s);
|
|
@@ -3256,13 +3312,13 @@ function Ss(t, e) {
|
|
|
3256
3312
|
function o() {
|
|
3257
3313
|
typeof t.removeListener == "function" && t.removeListener("error", i), r([].slice.call(arguments));
|
|
3258
3314
|
}
|
|
3259
|
-
|
|
3315
|
+
Yn(t, e, o, { once: !0 }), e !== "error" && Es(t, i, { once: !0 });
|
|
3260
3316
|
});
|
|
3261
3317
|
}
|
|
3262
|
-
function
|
|
3263
|
-
typeof t.on == "function" &&
|
|
3318
|
+
function Es(t, e, r) {
|
|
3319
|
+
typeof t.on == "function" && Yn(t, "error", e, r);
|
|
3264
3320
|
}
|
|
3265
|
-
function
|
|
3321
|
+
function Yn(t, e, r, n) {
|
|
3266
3322
|
if (typeof t.on == "function")
|
|
3267
3323
|
n.once ? t.once(e, r) : t.on(e, r);
|
|
3268
3324
|
else if (typeof t.addEventListener == "function")
|
|
@@ -3272,7 +3328,7 @@ function Hn(t, e, r, n) {
|
|
|
3272
3328
|
else
|
|
3273
3329
|
throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t);
|
|
3274
3330
|
}
|
|
3275
|
-
var
|
|
3331
|
+
var Jn = Tr.exports, Dt = {}, Xn = {}, Zn = function() {
|
|
3276
3332
|
if (typeof Symbol != "function" || typeof Object.getOwnPropertySymbols != "function")
|
|
3277
3333
|
return !1;
|
|
3278
3334
|
if (typeof Symbol.iterator == "symbol")
|
|
@@ -3295,56 +3351,56 @@ var Wn = Ir.exports, Dt = {}, Yn = {}, Jn = function() {
|
|
|
3295
3351
|
return !1;
|
|
3296
3352
|
}
|
|
3297
3353
|
return !0;
|
|
3298
|
-
},
|
|
3299
|
-
return
|
|
3300
|
-
},
|
|
3301
|
-
return typeof
|
|
3302
|
-
},
|
|
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 = {
|
|
3303
3359
|
__proto__: null,
|
|
3304
3360
|
foo: {}
|
|
3305
|
-
},
|
|
3306
|
-
return { __proto__:
|
|
3307
|
-
},
|
|
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) {
|
|
3308
3364
|
for (var n = [], i = 0; i < e.length; i += 1)
|
|
3309
3365
|
n[i] = e[i];
|
|
3310
3366
|
for (var o = 0; o < r.length; o += 1)
|
|
3311
3367
|
n[o + e.length] = r[o];
|
|
3312
3368
|
return n;
|
|
3313
|
-
},
|
|
3369
|
+
}, Bs = function(e, r) {
|
|
3314
3370
|
for (var n = [], i = r, o = 0; i < e.length; i += 1, o += 1)
|
|
3315
3371
|
n[o] = e[i];
|
|
3316
3372
|
return n;
|
|
3317
|
-
},
|
|
3373
|
+
}, Ms = function(t, e) {
|
|
3318
3374
|
for (var r = "", n = 0; n < t.length; n += 1)
|
|
3319
3375
|
r += t[n], n + 1 < t.length && (r += e);
|
|
3320
3376
|
return r;
|
|
3321
|
-
},
|
|
3377
|
+
}, qs = function(e) {
|
|
3322
3378
|
var r = this;
|
|
3323
|
-
if (typeof r != "function" ||
|
|
3324
|
-
throw new TypeError(
|
|
3325
|
-
for (var n =
|
|
3379
|
+
if (typeof r != "function" || Rs.apply(r) !== $s)
|
|
3380
|
+
throw new TypeError(Ds + r);
|
|
3381
|
+
for (var n = Bs(arguments, 1), i, o = function() {
|
|
3326
3382
|
if (this instanceof i) {
|
|
3327
3383
|
var c = r.apply(
|
|
3328
3384
|
this,
|
|
3329
|
-
|
|
3385
|
+
sn(n, arguments)
|
|
3330
3386
|
);
|
|
3331
3387
|
return Object(c) === c ? c : this;
|
|
3332
3388
|
}
|
|
3333
3389
|
return r.apply(
|
|
3334
3390
|
e,
|
|
3335
|
-
|
|
3391
|
+
sn(n, arguments)
|
|
3336
3392
|
);
|
|
3337
|
-
}, s =
|
|
3393
|
+
}, s = Vs(0, r.length - n.length), a = [], u = 0; u < s; u++)
|
|
3338
3394
|
a[u] = "$" + u;
|
|
3339
|
-
if (i = Function("binder", "return function (" +
|
|
3395
|
+
if (i = Function("binder", "return function (" + Ms(a, ",") + "){ return binder.apply(this,arguments); }")(o), r.prototype) {
|
|
3340
3396
|
var l = function() {
|
|
3341
3397
|
};
|
|
3342
3398
|
l.prototype = r.prototype, i.prototype = new l(), l.prototype = null;
|
|
3343
3399
|
}
|
|
3344
3400
|
return i;
|
|
3345
|
-
},
|
|
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) {
|
|
3346
3402
|
try {
|
|
3347
|
-
return
|
|
3403
|
+
return ti('"use strict"; return (' + t + ").constructor;")();
|
|
3348
3404
|
} catch {
|
|
3349
3405
|
}
|
|
3350
3406
|
}, ke = Object.getOwnPropertyDescriptor;
|
|
@@ -3355,8 +3411,8 @@ if (ke)
|
|
|
3355
3411
|
ke = null;
|
|
3356
3412
|
}
|
|
3357
3413
|
var xt = function() {
|
|
3358
|
-
throw new
|
|
3359
|
-
},
|
|
3414
|
+
throw new Ke();
|
|
3415
|
+
}, Js = ke ? function() {
|
|
3360
3416
|
try {
|
|
3361
3417
|
return arguments.callee, xt;
|
|
3362
3418
|
} catch {
|
|
@@ -3366,19 +3422,19 @@ var xt = function() {
|
|
|
3366
3422
|
return xt;
|
|
3367
3423
|
}
|
|
3368
3424
|
}
|
|
3369
|
-
}() : xt,
|
|
3425
|
+
}() : xt, Be = Ps(), Xs = Fs(), j = Object.getPrototypeOf || (Xs ? function(t) {
|
|
3370
3426
|
return t.__proto__;
|
|
3371
|
-
} : null),
|
|
3427
|
+
} : null), qe = {}, Zs = typeof Uint8Array > "u" || !j ? T : j(Uint8Array), Pe = {
|
|
3372
3428
|
__proto__: null,
|
|
3373
3429
|
"%AggregateError%": typeof AggregateError > "u" ? T : AggregateError,
|
|
3374
3430
|
"%Array%": Array,
|
|
3375
3431
|
"%ArrayBuffer%": typeof ArrayBuffer > "u" ? T : ArrayBuffer,
|
|
3376
|
-
"%ArrayIteratorPrototype%":
|
|
3432
|
+
"%ArrayIteratorPrototype%": Be && j ? j([][Symbol.iterator]()) : T,
|
|
3377
3433
|
"%AsyncFromSyncIteratorPrototype%": T,
|
|
3378
|
-
"%AsyncFunction%":
|
|
3379
|
-
"%AsyncGenerator%":
|
|
3380
|
-
"%AsyncGeneratorFunction%":
|
|
3381
|
-
"%AsyncIteratorPrototype%":
|
|
3434
|
+
"%AsyncFunction%": qe,
|
|
3435
|
+
"%AsyncGenerator%": qe,
|
|
3436
|
+
"%AsyncGeneratorFunction%": qe,
|
|
3437
|
+
"%AsyncIteratorPrototype%": qe,
|
|
3382
3438
|
"%Atomics%": typeof Atomics > "u" ? T : Atomics,
|
|
3383
3439
|
"%BigInt%": typeof BigInt > "u" ? T : BigInt,
|
|
3384
3440
|
"%BigInt64Array%": typeof BigInt64Array > "u" ? T : BigInt64Array,
|
|
@@ -3390,24 +3446,24 @@ var xt = function() {
|
|
|
3390
3446
|
"%decodeURIComponent%": decodeURIComponent,
|
|
3391
3447
|
"%encodeURI%": encodeURI,
|
|
3392
3448
|
"%encodeURIComponent%": encodeURIComponent,
|
|
3393
|
-
"%Error%":
|
|
3449
|
+
"%Error%": Ks,
|
|
3394
3450
|
"%eval%": eval,
|
|
3395
3451
|
// eslint-disable-line no-eval
|
|
3396
|
-
"%EvalError%":
|
|
3452
|
+
"%EvalError%": zs,
|
|
3397
3453
|
"%Float32Array%": typeof Float32Array > "u" ? T : Float32Array,
|
|
3398
3454
|
"%Float64Array%": typeof Float64Array > "u" ? T : Float64Array,
|
|
3399
3455
|
"%FinalizationRegistry%": typeof FinalizationRegistry > "u" ? T : FinalizationRegistry,
|
|
3400
|
-
"%Function%":
|
|
3401
|
-
"%GeneratorFunction%":
|
|
3456
|
+
"%Function%": ti,
|
|
3457
|
+
"%GeneratorFunction%": qe,
|
|
3402
3458
|
"%Int8Array%": typeof Int8Array > "u" ? T : Int8Array,
|
|
3403
3459
|
"%Int16Array%": typeof Int16Array > "u" ? T : Int16Array,
|
|
3404
3460
|
"%Int32Array%": typeof Int32Array > "u" ? T : Int32Array,
|
|
3405
3461
|
"%isFinite%": isFinite,
|
|
3406
3462
|
"%isNaN%": isNaN,
|
|
3407
|
-
"%IteratorPrototype%":
|
|
3463
|
+
"%IteratorPrototype%": Be && j ? j(j([][Symbol.iterator]())) : T,
|
|
3408
3464
|
"%JSON%": typeof JSON == "object" ? JSON : T,
|
|
3409
3465
|
"%Map%": typeof Map > "u" ? T : Map,
|
|
3410
|
-
"%MapIteratorPrototype%": typeof Map > "u" ||
|
|
3466
|
+
"%MapIteratorPrototype%": typeof Map > "u" || !Be || !j ? T : j((/* @__PURE__ */ new Map())[Symbol.iterator]()),
|
|
3411
3467
|
"%Math%": Math,
|
|
3412
3468
|
"%Number%": Number,
|
|
3413
3469
|
"%Object%": Object,
|
|
@@ -3415,25 +3471,25 @@ var xt = function() {
|
|
|
3415
3471
|
"%parseInt%": parseInt,
|
|
3416
3472
|
"%Promise%": typeof Promise > "u" ? T : Promise,
|
|
3417
3473
|
"%Proxy%": typeof Proxy > "u" ? T : Proxy,
|
|
3418
|
-
"%RangeError%":
|
|
3419
|
-
"%ReferenceError%":
|
|
3474
|
+
"%RangeError%": Hs,
|
|
3475
|
+
"%ReferenceError%": Ws,
|
|
3420
3476
|
"%Reflect%": typeof Reflect > "u" ? T : Reflect,
|
|
3421
3477
|
"%RegExp%": RegExp,
|
|
3422
3478
|
"%Set%": typeof Set > "u" ? T : Set,
|
|
3423
|
-
"%SetIteratorPrototype%": typeof Set > "u" ||
|
|
3479
|
+
"%SetIteratorPrototype%": typeof Set > "u" || !Be || !j ? T : j((/* @__PURE__ */ new Set())[Symbol.iterator]()),
|
|
3424
3480
|
"%SharedArrayBuffer%": typeof SharedArrayBuffer > "u" ? T : SharedArrayBuffer,
|
|
3425
3481
|
"%String%": String,
|
|
3426
|
-
"%StringIteratorPrototype%":
|
|
3427
|
-
"%Symbol%":
|
|
3428
|
-
"%SyntaxError%":
|
|
3429
|
-
"%ThrowTypeError%":
|
|
3430
|
-
"%TypedArray%":
|
|
3431
|
-
"%TypeError%":
|
|
3482
|
+
"%StringIteratorPrototype%": Be && j ? j(""[Symbol.iterator]()) : T,
|
|
3483
|
+
"%Symbol%": Be ? Symbol : T,
|
|
3484
|
+
"%SyntaxError%": ze,
|
|
3485
|
+
"%ThrowTypeError%": Js,
|
|
3486
|
+
"%TypedArray%": Zs,
|
|
3487
|
+
"%TypeError%": Ke,
|
|
3432
3488
|
"%Uint8Array%": typeof Uint8Array > "u" ? T : Uint8Array,
|
|
3433
3489
|
"%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? T : Uint8ClampedArray,
|
|
3434
3490
|
"%Uint16Array%": typeof Uint16Array > "u" ? T : Uint16Array,
|
|
3435
3491
|
"%Uint32Array%": typeof Uint32Array > "u" ? T : Uint32Array,
|
|
3436
|
-
"%URIError%":
|
|
3492
|
+
"%URIError%": Ys,
|
|
3437
3493
|
"%WeakMap%": typeof WeakMap > "u" ? T : WeakMap,
|
|
3438
3494
|
"%WeakRef%": typeof WeakRef > "u" ? T : WeakRef,
|
|
3439
3495
|
"%WeakSet%": typeof WeakSet > "u" ? T : WeakSet
|
|
@@ -3442,17 +3498,17 @@ if (j)
|
|
|
3442
3498
|
try {
|
|
3443
3499
|
null.error;
|
|
3444
3500
|
} catch (t) {
|
|
3445
|
-
var
|
|
3446
|
-
Pe["%Error.prototype%"] =
|
|
3501
|
+
var ea = j(j(t));
|
|
3502
|
+
Pe["%Error.prototype%"] = ea;
|
|
3447
3503
|
}
|
|
3448
|
-
var
|
|
3504
|
+
var ta = function t(e) {
|
|
3449
3505
|
var r;
|
|
3450
3506
|
if (e === "%AsyncFunction%")
|
|
3451
|
-
r =
|
|
3507
|
+
r = Ut("async function () {}");
|
|
3452
3508
|
else if (e === "%GeneratorFunction%")
|
|
3453
|
-
r =
|
|
3509
|
+
r = Ut("function* () {}");
|
|
3454
3510
|
else if (e === "%AsyncGeneratorFunction%")
|
|
3455
|
-
r =
|
|
3511
|
+
r = Ut("async function* () {}");
|
|
3456
3512
|
else if (e === "%AsyncGenerator%") {
|
|
3457
3513
|
var n = t("%AsyncGeneratorFunction%");
|
|
3458
3514
|
n && (r = n.prototype);
|
|
@@ -3461,7 +3517,7 @@ var Zs = function t(e) {
|
|
|
3461
3517
|
i && j && (r = j(i.prototype));
|
|
3462
3518
|
}
|
|
3463
3519
|
return Pe[e] = r, r;
|
|
3464
|
-
},
|
|
3520
|
+
}, an = {
|
|
3465
3521
|
__proto__: null,
|
|
3466
3522
|
"%ArrayBufferPrototype%": ["ArrayBuffer", "prototype"],
|
|
3467
3523
|
"%ArrayPrototype%": ["Array", "prototype"],
|
|
@@ -3514,48 +3570,48 @@ var Zs = function t(e) {
|
|
|
3514
3570
|
"%URIErrorPrototype%": ["URIError", "prototype"],
|
|
3515
3571
|
"%WeakMapPrototype%": ["WeakMap", "prototype"],
|
|
3516
3572
|
"%WeakSetPrototype%": ["WeakSet", "prototype"]
|
|
3517
|
-
},
|
|
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) {
|
|
3518
3574
|
var r = It(e, 0, 1), n = It(e, -1);
|
|
3519
3575
|
if (r === "%" && n !== "%")
|
|
3520
|
-
throw new
|
|
3576
|
+
throw new ze("invalid intrinsic syntax, expected closing `%`");
|
|
3521
3577
|
if (n === "%" && r !== "%")
|
|
3522
|
-
throw new
|
|
3578
|
+
throw new ze("invalid intrinsic syntax, expected opening `%`");
|
|
3523
3579
|
var i = [];
|
|
3524
|
-
return
|
|
3525
|
-
i[i.length] = a ?
|
|
3580
|
+
return un(e, oa, function(o, s, a, u) {
|
|
3581
|
+
i[i.length] = a ? un(u, sa, "$1") : s || o;
|
|
3526
3582
|
}), i;
|
|
3527
|
-
},
|
|
3583
|
+
}, ua = function(e, r) {
|
|
3528
3584
|
var n = e, i;
|
|
3529
|
-
if (Et(
|
|
3585
|
+
if (Et(an, n) && (i = an[n], n = "%" + i[0] + "%"), Et(Pe, n)) {
|
|
3530
3586
|
var o = Pe[n];
|
|
3531
|
-
if (o ===
|
|
3532
|
-
throw new
|
|
3587
|
+
if (o === qe && (o = ta(n)), typeof o > "u" && !r)
|
|
3588
|
+
throw new Ke("intrinsic " + e + " exists, but is not available. Please file an issue!");
|
|
3533
3589
|
return {
|
|
3534
3590
|
alias: i,
|
|
3535
3591
|
name: n,
|
|
3536
3592
|
value: o
|
|
3537
3593
|
};
|
|
3538
3594
|
}
|
|
3539
|
-
throw new
|
|
3540
|
-
},
|
|
3595
|
+
throw new ze("intrinsic " + e + " does not exist!");
|
|
3596
|
+
}, st = function(e, r) {
|
|
3541
3597
|
if (typeof e != "string" || e.length === 0)
|
|
3542
|
-
throw new
|
|
3598
|
+
throw new Ke("intrinsic name must be a non-empty string");
|
|
3543
3599
|
if (arguments.length > 1 && typeof r != "boolean")
|
|
3544
|
-
throw new
|
|
3545
|
-
if (
|
|
3546
|
-
throw new
|
|
3547
|
-
var n =
|
|
3548
|
-
l && (i = l[0],
|
|
3600
|
+
throw new Ke('"allowMissing" argument must be a boolean');
|
|
3601
|
+
if (ia(/^%?[^%]*%?$/, e) === null)
|
|
3602
|
+
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)));
|
|
3549
3605
|
for (var c = 1, f = !0; c < n.length; c += 1) {
|
|
3550
3606
|
var p = n[c], v = It(p, 0, 1), w = It(p, -1);
|
|
3551
3607
|
if ((v === '"' || v === "'" || v === "`" || w === '"' || w === "'" || w === "`") && v !== w)
|
|
3552
|
-
throw new
|
|
3608
|
+
throw new ze("property names with quotes must have matching quotes");
|
|
3553
3609
|
if ((p === "constructor" || !f) && (u = !0), i += "." + p, s = "%" + i + "%", Et(Pe, s))
|
|
3554
3610
|
a = Pe[s];
|
|
3555
3611
|
else if (a != null) {
|
|
3556
3612
|
if (!(p in a)) {
|
|
3557
3613
|
if (!r)
|
|
3558
|
-
throw new
|
|
3614
|
+
throw new Ke("base intrinsic for " + e + " exists, but the property is not available.");
|
|
3559
3615
|
return;
|
|
3560
3616
|
}
|
|
3561
3617
|
if (ke && c + 1 >= n.length) {
|
|
@@ -3567,11 +3623,11 @@ var Zs = function t(e) {
|
|
|
3567
3623
|
}
|
|
3568
3624
|
}
|
|
3569
3625
|
return a;
|
|
3570
|
-
},
|
|
3571
|
-
function
|
|
3572
|
-
if (
|
|
3573
|
-
|
|
3574
|
-
var t =
|
|
3626
|
+
}, ri = { exports: {} }, Qt, cn;
|
|
3627
|
+
function _r() {
|
|
3628
|
+
if (cn) return Qt;
|
|
3629
|
+
cn = 1;
|
|
3630
|
+
var t = st, e = t("%Object.defineProperty%", !0) || !1;
|
|
3575
3631
|
if (e)
|
|
3576
3632
|
try {
|
|
3577
3633
|
e({}, "a", { value: 1 });
|
|
@@ -3580,14 +3636,14 @@ function Or() {
|
|
|
3580
3636
|
}
|
|
3581
3637
|
return Qt = e, Qt;
|
|
3582
3638
|
}
|
|
3583
|
-
var
|
|
3639
|
+
var ca = st, mt = ca("%Object.getOwnPropertyDescriptor%", !0);
|
|
3584
3640
|
if (mt)
|
|
3585
3641
|
try {
|
|
3586
3642
|
mt([], "length");
|
|
3587
3643
|
} catch {
|
|
3588
3644
|
mt = null;
|
|
3589
3645
|
}
|
|
3590
|
-
var $t = mt,
|
|
3646
|
+
var $t = mt, ln = _r(), la = ei, Me = Vt, dn = $t, da = function(e, r, n) {
|
|
3591
3647
|
if (!e || typeof e != "object" && typeof e != "function")
|
|
3592
3648
|
throw new Me("`obj` must be an object or a function`");
|
|
3593
3649
|
if (typeof r != "string" && typeof r != "symbol")
|
|
@@ -3600,9 +3656,9 @@ var $t = mt, un = Or(), ua = Xn, Me = Vt, cn = $t, ca = function(e, r, n) {
|
|
|
3600
3656
|
throw new Me("`nonConfigurable`, if provided, must be a boolean or null");
|
|
3601
3657
|
if (arguments.length > 6 && typeof arguments[6] != "boolean")
|
|
3602
3658
|
throw new Me("`loose`, if provided, must be a boolean");
|
|
3603
|
-
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 = !!
|
|
3604
|
-
if (
|
|
3605
|
-
|
|
3659
|
+
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
|
+
if (ln)
|
|
3661
|
+
ln(e, r, {
|
|
3606
3662
|
configurable: s === null && u ? u.configurable : !s,
|
|
3607
3663
|
enumerable: i === null && u ? u.enumerable : !i,
|
|
3608
3664
|
value: n,
|
|
@@ -3611,37 +3667,37 @@ var $t = mt, un = Or(), ua = Xn, Me = Vt, cn = $t, ca = function(e, r, n) {
|
|
|
3611
3667
|
else if (a || !i && !o && !s)
|
|
3612
3668
|
e[r] = n;
|
|
3613
3669
|
else
|
|
3614
|
-
throw new
|
|
3615
|
-
},
|
|
3616
|
-
return !!
|
|
3670
|
+
throw new la("This environment does not support defining a property as non-configurable, non-writable, or non-enumerable.");
|
|
3671
|
+
}, lr = _r(), ni = function() {
|
|
3672
|
+
return !!lr;
|
|
3617
3673
|
};
|
|
3618
|
-
|
|
3619
|
-
if (!
|
|
3674
|
+
ni.hasArrayLengthDefineBug = function() {
|
|
3675
|
+
if (!lr)
|
|
3620
3676
|
return null;
|
|
3621
3677
|
try {
|
|
3622
|
-
return
|
|
3678
|
+
return lr([], "length", { value: 1 }).length !== 1;
|
|
3623
3679
|
} catch {
|
|
3624
3680
|
return !0;
|
|
3625
3681
|
}
|
|
3626
3682
|
};
|
|
3627
|
-
var
|
|
3683
|
+
var fa = ni, pa = st, fn = da, ha = fa(), pn = $t, hn = Vt, ya = pa("%Math.floor%"), ma = function(e, r) {
|
|
3628
3684
|
if (typeof e != "function")
|
|
3629
|
-
throw new
|
|
3630
|
-
if (typeof r != "number" || r < 0 || r > 4294967295 ||
|
|
3631
|
-
throw new
|
|
3685
|
+
throw new hn("`fn` is not a function");
|
|
3686
|
+
if (typeof r != "number" || r < 0 || r > 4294967295 || ya(r) !== r)
|
|
3687
|
+
throw new hn("`length` must be a positive 32-bit integer");
|
|
3632
3688
|
var n = arguments.length > 2 && !!arguments[2], i = !0, o = !0;
|
|
3633
|
-
if ("length" in e &&
|
|
3634
|
-
var s =
|
|
3689
|
+
if ("length" in e && pn) {
|
|
3690
|
+
var s = pn(e, "length");
|
|
3635
3691
|
s && !s.configurable && (i = !1), s && !s.writable && (o = !1);
|
|
3636
3692
|
}
|
|
3637
|
-
return (i || o || !n) && (
|
|
3693
|
+
return (i || o || !n) && (ha ? fn(
|
|
3638
3694
|
/** @type {Parameters<define>[0]} */
|
|
3639
3695
|
e,
|
|
3640
3696
|
"length",
|
|
3641
3697
|
r,
|
|
3642
3698
|
!0,
|
|
3643
3699
|
!0
|
|
3644
|
-
) :
|
|
3700
|
+
) : fn(
|
|
3645
3701
|
/** @type {Parameters<define>[0]} */
|
|
3646
3702
|
e,
|
|
3647
3703
|
"length",
|
|
@@ -3649,7 +3705,7 @@ var la = ti, da = ot, ln = ca, fa = la(), dn = $t, fn = Vt, pa = da("%Math.floor
|
|
|
3649
3705
|
)), e;
|
|
3650
3706
|
};
|
|
3651
3707
|
(function(t) {
|
|
3652
|
-
var e =
|
|
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%");
|
|
3653
3709
|
t.exports = function(p) {
|
|
3654
3710
|
if (typeof p != "function")
|
|
3655
3711
|
throw new i("a function is required");
|
|
@@ -3664,122 +3720,122 @@ var la = ti, da = ot, ln = ca, fa = la(), dn = $t, fn = Vt, pa = da("%Math.floor
|
|
|
3664
3720
|
return a(e, o, arguments);
|
|
3665
3721
|
};
|
|
3666
3722
|
u ? u(t.exports, "apply", { value: c }) : t.exports.apply = c;
|
|
3667
|
-
})(
|
|
3668
|
-
var
|
|
3669
|
-
var n =
|
|
3670
|
-
return typeof n == "function" &&
|
|
3671
|
-
},
|
|
3672
|
-
return
|
|
3673
|
-
},
|
|
3674
|
-
return
|
|
3675
|
-
},
|
|
3676
|
-
return
|
|
3723
|
+
})(ri);
|
|
3724
|
+
var Lr = ri.exports, ii = st, oi = Lr, ga = oi(ii("String.prototype.indexOf")), Cr = function(e, r) {
|
|
3725
|
+
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]";
|
|
3729
|
+
}, 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);
|
|
3677
3733
|
}();
|
|
3678
|
-
|
|
3679
|
-
var
|
|
3680
|
-
if (!
|
|
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() {
|
|
3736
|
+
if (!ai)
|
|
3681
3737
|
return !1;
|
|
3682
3738
|
try {
|
|
3683
3739
|
return Function("return function*() {}")();
|
|
3684
3740
|
} catch {
|
|
3685
3741
|
}
|
|
3686
|
-
}, Kt,
|
|
3742
|
+
}, Kt, Oa = function(e) {
|
|
3687
3743
|
if (typeof e != "function")
|
|
3688
3744
|
return !1;
|
|
3689
|
-
if (
|
|
3745
|
+
if (Ia.test(Ea.call(e)))
|
|
3690
3746
|
return !0;
|
|
3691
|
-
if (!
|
|
3692
|
-
var r =
|
|
3747
|
+
if (!ai) {
|
|
3748
|
+
var r = Aa.call(e);
|
|
3693
3749
|
return r === "[object GeneratorFunction]";
|
|
3694
3750
|
}
|
|
3695
3751
|
if (!Gt)
|
|
3696
3752
|
return !1;
|
|
3697
3753
|
if (typeof Kt > "u") {
|
|
3698
|
-
var n =
|
|
3754
|
+
var n = Ta();
|
|
3699
3755
|
Kt = n ? Gt(n) : !1;
|
|
3700
3756
|
}
|
|
3701
3757
|
return Gt(e) === Kt;
|
|
3702
|
-
},
|
|
3703
|
-
if (typeof
|
|
3758
|
+
}, ui = Function.prototype.toString, xe = typeof Reflect == "object" && Reflect !== null && Reflect.apply, fr, gt;
|
|
3759
|
+
if (typeof xe == "function" && typeof Object.defineProperty == "function")
|
|
3704
3760
|
try {
|
|
3705
|
-
|
|
3761
|
+
fr = Object.defineProperty({}, "length", {
|
|
3706
3762
|
get: function() {
|
|
3707
3763
|
throw gt;
|
|
3708
3764
|
}
|
|
3709
|
-
}), gt = {},
|
|
3765
|
+
}), gt = {}, xe(function() {
|
|
3710
3766
|
throw 42;
|
|
3711
|
-
}, null,
|
|
3767
|
+
}, null, fr);
|
|
3712
3768
|
} catch (t) {
|
|
3713
|
-
t !== gt && (
|
|
3769
|
+
t !== gt && (xe = null);
|
|
3714
3770
|
}
|
|
3715
3771
|
else
|
|
3716
|
-
|
|
3717
|
-
var
|
|
3772
|
+
xe = null;
|
|
3773
|
+
var _a = /^\s*class\b/, pr = function(e) {
|
|
3718
3774
|
try {
|
|
3719
|
-
var r =
|
|
3720
|
-
return
|
|
3775
|
+
var r = ui.call(e);
|
|
3776
|
+
return _a.test(r);
|
|
3721
3777
|
} catch {
|
|
3722
3778
|
return !1;
|
|
3723
3779
|
}
|
|
3724
3780
|
}, zt = function(e) {
|
|
3725
3781
|
try {
|
|
3726
|
-
return
|
|
3782
|
+
return pr(e) ? !1 : (ui.call(e), !0);
|
|
3727
3783
|
} catch {
|
|
3728
3784
|
return !1;
|
|
3729
3785
|
}
|
|
3730
|
-
}, bt = Object.prototype.toString,
|
|
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() {
|
|
3731
3787
|
return !1;
|
|
3732
3788
|
};
|
|
3733
3789
|
if (typeof document == "object") {
|
|
3734
|
-
var
|
|
3735
|
-
bt.call(
|
|
3736
|
-
if ((
|
|
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"))
|
|
3737
3793
|
try {
|
|
3738
3794
|
var r = bt.call(e);
|
|
3739
|
-
return (r ===
|
|
3795
|
+
return (r === Pa || r === Na || r === Fa || r === La) && e("") == null;
|
|
3740
3796
|
} catch {
|
|
3741
3797
|
}
|
|
3742
3798
|
return !1;
|
|
3743
3799
|
});
|
|
3744
3800
|
}
|
|
3745
|
-
var
|
|
3746
|
-
if (
|
|
3801
|
+
var $a = xe ? function(e) {
|
|
3802
|
+
if (hr(e))
|
|
3747
3803
|
return !0;
|
|
3748
3804
|
if (!e || typeof e != "function" && typeof e != "object")
|
|
3749
3805
|
return !1;
|
|
3750
3806
|
try {
|
|
3751
|
-
|
|
3807
|
+
xe(e, null, fr);
|
|
3752
3808
|
} catch (r) {
|
|
3753
3809
|
if (r !== gt)
|
|
3754
3810
|
return !1;
|
|
3755
3811
|
}
|
|
3756
|
-
return !
|
|
3812
|
+
return !pr(e) && zt(e);
|
|
3757
3813
|
} : function(e) {
|
|
3758
|
-
if (
|
|
3814
|
+
if (hr(e))
|
|
3759
3815
|
return !0;
|
|
3760
3816
|
if (!e || typeof e != "function" && typeof e != "object")
|
|
3761
3817
|
return !1;
|
|
3762
|
-
if (
|
|
3818
|
+
if (Da)
|
|
3763
3819
|
return zt(e);
|
|
3764
|
-
if (
|
|
3820
|
+
if (pr(e))
|
|
3765
3821
|
return !1;
|
|
3766
3822
|
var r = bt.call(e);
|
|
3767
|
-
return r !==
|
|
3768
|
-
},
|
|
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) {
|
|
3769
3825
|
for (var i = 0, o = e.length; i < o; i++)
|
|
3770
|
-
|
|
3771
|
-
},
|
|
3826
|
+
ci.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
|
|
3827
|
+
}, ja = function(e, r, n) {
|
|
3772
3828
|
for (var i = 0, o = e.length; i < o; i++)
|
|
3773
3829
|
n == null ? r(e.charAt(i), i, e) : r.call(n, e.charAt(i), i, e);
|
|
3774
|
-
}, ja = function(e, r, n) {
|
|
3775
|
-
for (var i in e)
|
|
3776
|
-
ai.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
|
|
3777
3830
|
}, Ua = function(e, r, n) {
|
|
3778
|
-
|
|
3831
|
+
for (var i in e)
|
|
3832
|
+
ci.call(e, i) && (n == null ? r(e[i], i, e) : r.call(n, e[i], i, e));
|
|
3833
|
+
}, xa = function(e, r, n) {
|
|
3834
|
+
if (!Ba(r))
|
|
3779
3835
|
throw new TypeError("iterator must be a function");
|
|
3780
3836
|
var i;
|
|
3781
|
-
arguments.length >= 3 && (i = n),
|
|
3782
|
-
},
|
|
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 = [
|
|
3783
3839
|
"Float32Array",
|
|
3784
3840
|
"Float64Array",
|
|
3785
3841
|
"Int8Array",
|
|
@@ -3791,121 +3847,121 @@ var Ra = qe ? function(e) {
|
|
|
3791
3847
|
"Uint32Array",
|
|
3792
3848
|
"BigInt64Array",
|
|
3793
3849
|
"BigUint64Array"
|
|
3794
|
-
], Ht =
|
|
3850
|
+
], Ht = Qa, Ga = typeof globalThis > "u" ? Ar : globalThis, di = function() {
|
|
3795
3851
|
for (var e = [], r = 0; r < Ht.length; r++)
|
|
3796
|
-
typeof
|
|
3852
|
+
typeof Ga[Ht[r]] == "function" && (e[e.length] = Ht[r]);
|
|
3797
3853
|
return e;
|
|
3798
|
-
}, Tt =
|
|
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) {
|
|
3799
3855
|
for (var n = 0; n < e.length; n += 1)
|
|
3800
3856
|
if (e[n] === r)
|
|
3801
3857
|
return n;
|
|
3802
3858
|
return -1;
|
|
3803
3859
|
}, Ot = { __proto__: null };
|
|
3804
|
-
|
|
3805
|
-
var e = new
|
|
3860
|
+
fi && vt && Wt ? Tt(yr, function(t) {
|
|
3861
|
+
var e = new mn[t]();
|
|
3806
3862
|
if (Symbol.toStringTag in e) {
|
|
3807
3863
|
var r = Wt(e), n = vt(r, Symbol.toStringTag);
|
|
3808
3864
|
if (!n) {
|
|
3809
3865
|
var i = Wt(r);
|
|
3810
3866
|
n = vt(i, Symbol.toStringTag);
|
|
3811
3867
|
}
|
|
3812
|
-
Ot["$" + t] =
|
|
3868
|
+
Ot["$" + t] = yn(n.get);
|
|
3813
3869
|
}
|
|
3814
|
-
}) : Tt(
|
|
3815
|
-
var e = new
|
|
3816
|
-
r && (Ot["$" + t] =
|
|
3870
|
+
}) : Tt(yr, function(t) {
|
|
3871
|
+
var e = new mn[t](), r = e.slice || e.set;
|
|
3872
|
+
r && (Ot["$" + t] = yn(r));
|
|
3817
3873
|
});
|
|
3818
|
-
var
|
|
3874
|
+
var Wa = function(e) {
|
|
3819
3875
|
var r = !1;
|
|
3820
3876
|
return Tt(Ot, function(n, i) {
|
|
3821
3877
|
if (!r)
|
|
3822
3878
|
try {
|
|
3823
|
-
"$" + n(e) === i && (r =
|
|
3879
|
+
"$" + n(e) === i && (r = Pr(i, 1));
|
|
3824
3880
|
} catch {
|
|
3825
3881
|
}
|
|
3826
3882
|
}), r;
|
|
3827
|
-
},
|
|
3883
|
+
}, Ya = function(e) {
|
|
3828
3884
|
var r = !1;
|
|
3829
3885
|
return Tt(Ot, function(n, i) {
|
|
3830
3886
|
if (!r)
|
|
3831
3887
|
try {
|
|
3832
|
-
n(e), r =
|
|
3888
|
+
n(e), r = Pr(i, 1);
|
|
3833
3889
|
} catch {
|
|
3834
3890
|
}
|
|
3835
3891
|
}), r;
|
|
3836
|
-
},
|
|
3892
|
+
}, Ja = function(e) {
|
|
3837
3893
|
if (!e || typeof e != "object")
|
|
3838
3894
|
return !1;
|
|
3839
|
-
if (!
|
|
3840
|
-
var r =
|
|
3841
|
-
return
|
|
3895
|
+
if (!fi) {
|
|
3896
|
+
var r = Pr(za(e), 8, -1);
|
|
3897
|
+
return Ha(yr, r) > -1 ? r : r !== "Object" ? !1 : Ya(e);
|
|
3842
3898
|
}
|
|
3843
|
-
return vt ?
|
|
3844
|
-
}, _t =
|
|
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) {
|
|
3845
3901
|
for (var n = 0; n < e.length; n += 1)
|
|
3846
3902
|
if (e[n] === r)
|
|
3847
3903
|
return n;
|
|
3848
3904
|
return -1;
|
|
3849
|
-
},
|
|
3850
|
-
|
|
3851
|
-
var e = new
|
|
3905
|
+
}, Lt = { __proto__: null };
|
|
3906
|
+
pi && St && Yt ? _t(mr, function(t) {
|
|
3907
|
+
var e = new bn[t]();
|
|
3852
3908
|
if (Symbol.toStringTag in e) {
|
|
3853
3909
|
var r = Yt(e), n = St(r, Symbol.toStringTag);
|
|
3854
3910
|
if (!n) {
|
|
3855
3911
|
var i = Yt(r);
|
|
3856
3912
|
n = St(i, Symbol.toStringTag);
|
|
3857
3913
|
}
|
|
3858
|
-
|
|
3914
|
+
Lt["$" + t] = gn(n.get);
|
|
3859
3915
|
}
|
|
3860
|
-
}) : _t(
|
|
3861
|
-
var e = new
|
|
3862
|
-
r && (
|
|
3916
|
+
}) : _t(mr, function(t) {
|
|
3917
|
+
var e = new bn[t](), r = e.slice || e.set;
|
|
3918
|
+
r && (Lt["$" + t] = gn(r));
|
|
3863
3919
|
});
|
|
3864
|
-
var
|
|
3920
|
+
var tu = function(e) {
|
|
3865
3921
|
var r = !1;
|
|
3866
3922
|
return _t(
|
|
3867
3923
|
// eslint-disable-next-line no-extra-parens
|
|
3868
3924
|
/** @type {Record<`\$${TypedArrayName}`, Getter>} */
|
|
3869
3925
|
/** @type {any} */
|
|
3870
|
-
|
|
3926
|
+
Lt,
|
|
3871
3927
|
/** @type {(getter: Getter, name: `\$${import('.').TypedArrayName}`) => void} */
|
|
3872
3928
|
function(n, i) {
|
|
3873
3929
|
if (!r)
|
|
3874
3930
|
try {
|
|
3875
|
-
"$" + n(e) === i && (r =
|
|
3931
|
+
"$" + n(e) === i && (r = Fr(i, 1));
|
|
3876
3932
|
} catch {
|
|
3877
3933
|
}
|
|
3878
3934
|
}
|
|
3879
3935
|
), r;
|
|
3880
|
-
},
|
|
3936
|
+
}, ru = function(e) {
|
|
3881
3937
|
var r = !1;
|
|
3882
3938
|
return _t(
|
|
3883
3939
|
// eslint-disable-next-line no-extra-parens
|
|
3884
3940
|
/** @type {Record<`\$${TypedArrayName}`, Getter>} */
|
|
3885
3941
|
/** @type {any} */
|
|
3886
|
-
|
|
3942
|
+
Lt,
|
|
3887
3943
|
/** @type {(getter: typeof cache, name: `\$${import('.').TypedArrayName}`) => void} */
|
|
3888
3944
|
function(n, i) {
|
|
3889
3945
|
if (!r)
|
|
3890
3946
|
try {
|
|
3891
|
-
n(e), r =
|
|
3947
|
+
n(e), r = Fr(i, 1);
|
|
3892
3948
|
} catch {
|
|
3893
3949
|
}
|
|
3894
3950
|
}
|
|
3895
3951
|
), r;
|
|
3896
|
-
},
|
|
3952
|
+
}, nu = function(e) {
|
|
3897
3953
|
if (!e || typeof e != "object")
|
|
3898
3954
|
return !1;
|
|
3899
|
-
if (!
|
|
3900
|
-
var r =
|
|
3901
|
-
return
|
|
3955
|
+
if (!pi) {
|
|
3956
|
+
var r = Fr(Za(e), 8, -1);
|
|
3957
|
+
return eu(mr, r) > -1 ? r : r !== "Object" ? !1 : ru(e);
|
|
3902
3958
|
}
|
|
3903
|
-
return St ?
|
|
3904
|
-
},
|
|
3905
|
-
return !!
|
|
3959
|
+
return St ? tu(e) : null;
|
|
3960
|
+
}, iu = nu, ou = function(e) {
|
|
3961
|
+
return !!iu(e);
|
|
3906
3962
|
};
|
|
3907
3963
|
(function(t) {
|
|
3908
|
-
var e =
|
|
3964
|
+
var e = wa, r = Oa, n = Ja, i = ou;
|
|
3909
3965
|
function o(y) {
|
|
3910
3966
|
return y.call.bind(y);
|
|
3911
3967
|
}
|
|
@@ -3914,11 +3970,11 @@ var Za = function(e) {
|
|
|
3914
3970
|
var p = o(BigInt.prototype.valueOf);
|
|
3915
3971
|
if (a)
|
|
3916
3972
|
var v = o(Symbol.prototype.valueOf);
|
|
3917
|
-
function w(y,
|
|
3973
|
+
function w(y, Si) {
|
|
3918
3974
|
if (typeof y != "object")
|
|
3919
3975
|
return !1;
|
|
3920
3976
|
try {
|
|
3921
|
-
return
|
|
3977
|
+
return Si(y), !0;
|
|
3922
3978
|
} catch {
|
|
3923
3979
|
return !1;
|
|
3924
3980
|
}
|
|
@@ -3936,18 +3992,18 @@ var Za = function(e) {
|
|
|
3936
3992
|
return n(y) === "Uint8Array";
|
|
3937
3993
|
}
|
|
3938
3994
|
t.isUint8Array = S;
|
|
3939
|
-
function
|
|
3995
|
+
function F(y) {
|
|
3940
3996
|
return n(y) === "Uint8ClampedArray";
|
|
3941
3997
|
}
|
|
3942
|
-
t.isUint8ClampedArray =
|
|
3998
|
+
t.isUint8ClampedArray = F;
|
|
3943
3999
|
function K(y) {
|
|
3944
4000
|
return n(y) === "Uint16Array";
|
|
3945
4001
|
}
|
|
3946
4002
|
t.isUint16Array = K;
|
|
3947
|
-
function
|
|
4003
|
+
function re(y) {
|
|
3948
4004
|
return n(y) === "Uint32Array";
|
|
3949
4005
|
}
|
|
3950
|
-
t.isUint32Array =
|
|
4006
|
+
t.isUint32Array = re;
|
|
3951
4007
|
function P(y) {
|
|
3952
4008
|
return n(y) === "Int8Array";
|
|
3953
4009
|
}
|
|
@@ -3976,46 +4032,46 @@ var Za = function(e) {
|
|
|
3976
4032
|
return n(y) === "BigUint64Array";
|
|
3977
4033
|
}
|
|
3978
4034
|
t.isBigUint64Array = Ie;
|
|
3979
|
-
function
|
|
4035
|
+
function fe(y) {
|
|
3980
4036
|
return u(y) === "[object Map]";
|
|
3981
4037
|
}
|
|
3982
|
-
|
|
3983
|
-
function
|
|
3984
|
-
return typeof Map > "u" ? !1 :
|
|
4038
|
+
fe.working = typeof Map < "u" && fe(/* @__PURE__ */ new Map());
|
|
4039
|
+
function Mt(y) {
|
|
4040
|
+
return typeof Map > "u" ? !1 : fe.working ? fe(y) : y instanceof Map;
|
|
3985
4041
|
}
|
|
3986
|
-
t.isMap =
|
|
4042
|
+
t.isMap = Mt;
|
|
3987
4043
|
function we(y) {
|
|
3988
4044
|
return u(y) === "[object Set]";
|
|
3989
4045
|
}
|
|
3990
4046
|
we.working = typeof Set < "u" && we(/* @__PURE__ */ new Set());
|
|
3991
|
-
function
|
|
4047
|
+
function Je(y) {
|
|
3992
4048
|
return typeof Set > "u" ? !1 : we.working ? we(y) : y instanceof Set;
|
|
3993
4049
|
}
|
|
3994
|
-
t.isSet =
|
|
4050
|
+
t.isSet = Je;
|
|
3995
4051
|
function Fe(y) {
|
|
3996
4052
|
return u(y) === "[object WeakMap]";
|
|
3997
4053
|
}
|
|
3998
4054
|
Fe.working = typeof WeakMap < "u" && Fe(/* @__PURE__ */ new WeakMap());
|
|
3999
|
-
function
|
|
4055
|
+
function qt(y) {
|
|
4000
4056
|
return typeof WeakMap > "u" ? !1 : Fe.working ? Fe(y) : y instanceof WeakMap;
|
|
4001
4057
|
}
|
|
4002
|
-
t.isWeakMap =
|
|
4058
|
+
t.isWeakMap = qt;
|
|
4003
4059
|
function De(y) {
|
|
4004
4060
|
return u(y) === "[object WeakSet]";
|
|
4005
4061
|
}
|
|
4006
4062
|
De.working = typeof WeakSet < "u" && De(/* @__PURE__ */ new WeakSet());
|
|
4007
|
-
function
|
|
4063
|
+
function pe(y) {
|
|
4008
4064
|
return De(y);
|
|
4009
4065
|
}
|
|
4010
|
-
t.isWeakSet =
|
|
4066
|
+
t.isWeakSet = pe;
|
|
4011
4067
|
function Re(y) {
|
|
4012
4068
|
return u(y) === "[object ArrayBuffer]";
|
|
4013
4069
|
}
|
|
4014
4070
|
Re.working = typeof ArrayBuffer < "u" && Re(new ArrayBuffer());
|
|
4015
|
-
function
|
|
4071
|
+
function at(y) {
|
|
4016
4072
|
return typeof ArrayBuffer > "u" ? !1 : Re.working ? Re(y) : y instanceof ArrayBuffer;
|
|
4017
4073
|
}
|
|
4018
|
-
t.isArrayBuffer =
|
|
4074
|
+
t.isArrayBuffer = at;
|
|
4019
4075
|
function d(y) {
|
|
4020
4076
|
return u(y) === "[object DataView]";
|
|
4021
4077
|
}
|
|
@@ -4028,10 +4084,10 @@ var Za = function(e) {
|
|
|
4028
4084
|
function A(y) {
|
|
4029
4085
|
return u(y) === "[object SharedArrayBuffer]";
|
|
4030
4086
|
}
|
|
4031
|
-
function
|
|
4087
|
+
function C(y) {
|
|
4032
4088
|
return typeof m > "u" ? !1 : (typeof A.working > "u" && (A.working = A(new m())), A.working ? A(y) : y instanceof m);
|
|
4033
4089
|
}
|
|
4034
|
-
t.isSharedArrayBuffer =
|
|
4090
|
+
t.isSharedArrayBuffer = C;
|
|
4035
4091
|
function k(y) {
|
|
4036
4092
|
return u(y) === "[object AsyncFunction]";
|
|
4037
4093
|
}
|
|
@@ -4040,14 +4096,14 @@ var Za = function(e) {
|
|
|
4040
4096
|
return u(y) === "[object Map Iterator]";
|
|
4041
4097
|
}
|
|
4042
4098
|
t.isMapIterator = I;
|
|
4043
|
-
function
|
|
4099
|
+
function L(y) {
|
|
4044
4100
|
return u(y) === "[object Set Iterator]";
|
|
4045
4101
|
}
|
|
4046
|
-
t.isSetIterator =
|
|
4047
|
-
function
|
|
4102
|
+
t.isSetIterator = L;
|
|
4103
|
+
function D(y) {
|
|
4048
4104
|
return u(y) === "[object Generator]";
|
|
4049
4105
|
}
|
|
4050
|
-
t.isGeneratorObject =
|
|
4106
|
+
t.isGeneratorObject = D;
|
|
4051
4107
|
function H(y) {
|
|
4052
4108
|
return u(y) === "[object WebAssembly.Module]";
|
|
4053
4109
|
}
|
|
@@ -4056,30 +4112,30 @@ var Za = function(e) {
|
|
|
4056
4112
|
return w(y, l);
|
|
4057
4113
|
}
|
|
4058
4114
|
t.isNumberObject = Te;
|
|
4059
|
-
function
|
|
4115
|
+
function ut(y) {
|
|
4060
4116
|
return w(y, c);
|
|
4061
4117
|
}
|
|
4062
|
-
t.isStringObject =
|
|
4118
|
+
t.isStringObject = ut;
|
|
4063
4119
|
function Ve(y) {
|
|
4064
4120
|
return w(y, f);
|
|
4065
4121
|
}
|
|
4066
4122
|
t.isBooleanObject = Ve;
|
|
4067
|
-
function
|
|
4123
|
+
function ct(y) {
|
|
4068
4124
|
return s && w(y, p);
|
|
4069
4125
|
}
|
|
4070
|
-
t.isBigIntObject =
|
|
4071
|
-
function
|
|
4126
|
+
t.isBigIntObject = ct;
|
|
4127
|
+
function Vr(y) {
|
|
4072
4128
|
return a && w(y, v);
|
|
4073
4129
|
}
|
|
4074
|
-
t.isSymbolObject =
|
|
4075
|
-
function
|
|
4076
|
-
return Te(y) ||
|
|
4130
|
+
t.isSymbolObject = Vr;
|
|
4131
|
+
function bi(y) {
|
|
4132
|
+
return Te(y) || ut(y) || Ve(y) || ct(y) || Vr(y);
|
|
4077
4133
|
}
|
|
4078
|
-
t.isBoxedPrimitive =
|
|
4079
|
-
function
|
|
4080
|
-
return typeof Uint8Array < "u" && (
|
|
4134
|
+
t.isBoxedPrimitive = bi;
|
|
4135
|
+
function vi(y) {
|
|
4136
|
+
return typeof Uint8Array < "u" && (at(y) || C(y));
|
|
4081
4137
|
}
|
|
4082
|
-
t.isAnyArrayBuffer =
|
|
4138
|
+
t.isAnyArrayBuffer = vi, ["isProxy", "isExternal", "isModuleNamespaceObject"].forEach(function(y) {
|
|
4083
4139
|
Object.defineProperty(t, y, {
|
|
4084
4140
|
enumerable: !1,
|
|
4085
4141
|
value: function() {
|
|
@@ -4087,11 +4143,11 @@ var Za = function(e) {
|
|
|
4087
4143
|
}
|
|
4088
4144
|
});
|
|
4089
4145
|
});
|
|
4090
|
-
})(
|
|
4091
|
-
var
|
|
4146
|
+
})(Xn);
|
|
4147
|
+
var su = function(e) {
|
|
4092
4148
|
return e && typeof e == "object" && typeof e.copy == "function" && typeof e.fill == "function" && typeof e.readUInt8 == "function";
|
|
4093
|
-
},
|
|
4094
|
-
typeof Object.create == "function" ?
|
|
4149
|
+
}, gr = { exports: {} };
|
|
4150
|
+
typeof Object.create == "function" ? gr.exports = function(e, r) {
|
|
4095
4151
|
r && (e.super_ = r, e.prototype = Object.create(r.prototype, {
|
|
4096
4152
|
constructor: {
|
|
4097
4153
|
value: e,
|
|
@@ -4100,7 +4156,7 @@ typeof Object.create == "function" ? mr.exports = function(e, r) {
|
|
|
4100
4156
|
configurable: !0
|
|
4101
4157
|
}
|
|
4102
4158
|
}));
|
|
4103
|
-
} :
|
|
4159
|
+
} : gr.exports = function(e, r) {
|
|
4104
4160
|
if (r) {
|
|
4105
4161
|
e.super_ = r;
|
|
4106
4162
|
var n = function() {
|
|
@@ -4108,11 +4164,11 @@ typeof Object.create == "function" ? mr.exports = function(e, r) {
|
|
|
4108
4164
|
n.prototype = r.prototype, e.prototype = new n(), e.prototype.constructor = e;
|
|
4109
4165
|
}
|
|
4110
4166
|
};
|
|
4111
|
-
var
|
|
4167
|
+
var au = gr.exports;
|
|
4112
4168
|
(function(t) {
|
|
4113
4169
|
var e = Object.getOwnPropertyDescriptors || function(h) {
|
|
4114
|
-
for (var m = Object.keys(h), A = {},
|
|
4115
|
-
A[m[
|
|
4170
|
+
for (var m = Object.keys(h), A = {}, C = 0; C < m.length; C++)
|
|
4171
|
+
A[m[C]] = Object.getOwnPropertyDescriptor(h, m[C]);
|
|
4116
4172
|
return A;
|
|
4117
4173
|
}, r = /%[sdj%]/g;
|
|
4118
4174
|
t.format = function(d) {
|
|
@@ -4121,10 +4177,10 @@ var ou = mr.exports;
|
|
|
4121
4177
|
h.push(s(arguments[m]));
|
|
4122
4178
|
return h.join(" ");
|
|
4123
4179
|
}
|
|
4124
|
-
for (var m = 1, A = arguments,
|
|
4125
|
-
if (
|
|
4126
|
-
if (m >=
|
|
4127
|
-
switch (
|
|
4180
|
+
for (var m = 1, A = arguments, C = A.length, k = String(d).replace(r, function(L) {
|
|
4181
|
+
if (L === "%%") return "%";
|
|
4182
|
+
if (m >= C) return L;
|
|
4183
|
+
switch (L) {
|
|
4128
4184
|
case "%s":
|
|
4129
4185
|
return String(A[m++]);
|
|
4130
4186
|
case "%d":
|
|
@@ -4136,10 +4192,10 @@ var ou = mr.exports;
|
|
|
4136
4192
|
return "[Circular]";
|
|
4137
4193
|
}
|
|
4138
4194
|
default:
|
|
4139
|
-
return
|
|
4195
|
+
return L;
|
|
4140
4196
|
}
|
|
4141
|
-
}), I = A[m]; m <
|
|
4142
|
-
|
|
4197
|
+
}), I = A[m]; m < C; I = A[++m])
|
|
4198
|
+
F(I) || !oe(I) ? k += " " + I : k += " " + s(I);
|
|
4143
4199
|
return k;
|
|
4144
4200
|
}, t.deprecate = function(d, h) {
|
|
4145
4201
|
if (typeof E < "u" && E.noDeprecation === !0)
|
|
@@ -4223,22 +4279,22 @@ var ou = mr.exports;
|
|
|
4223
4279
|
}), h;
|
|
4224
4280
|
}
|
|
4225
4281
|
function c(d, h, m) {
|
|
4226
|
-
if (d.customInspect && h &&
|
|
4282
|
+
if (d.customInspect && h && fe(h.inspect) && // Filter out the util module, it's inspect function is special
|
|
4227
4283
|
h.inspect !== t.inspect && // Also filter out any prototype objects using the circular check.
|
|
4228
4284
|
!(h.constructor && h.constructor.prototype === h)) {
|
|
4229
4285
|
var A = h.inspect(m, d);
|
|
4230
4286
|
return P(A) || (A = c(d, A, m)), A;
|
|
4231
4287
|
}
|
|
4232
|
-
var
|
|
4233
|
-
if (
|
|
4234
|
-
return
|
|
4288
|
+
var C = f(d, h);
|
|
4289
|
+
if (C)
|
|
4290
|
+
return C;
|
|
4235
4291
|
var k = Object.keys(h), I = l(k);
|
|
4236
4292
|
if (d.showHidden && (k = Object.getOwnPropertyNames(h)), Ie(h) && (k.indexOf("message") >= 0 || k.indexOf("description") >= 0))
|
|
4237
4293
|
return p(h);
|
|
4238
4294
|
if (k.length === 0) {
|
|
4239
|
-
if (
|
|
4240
|
-
var
|
|
4241
|
-
return d.stylize("[Function" +
|
|
4295
|
+
if (fe(h)) {
|
|
4296
|
+
var L = h.name ? ": " + h.name : "";
|
|
4297
|
+
return d.stylize("[Function" + L + "]", "special");
|
|
4242
4298
|
}
|
|
4243
4299
|
if (ie(h))
|
|
4244
4300
|
return d.stylize(RegExp.prototype.toString.call(h), "regexp");
|
|
@@ -4247,20 +4303,20 @@ var ou = mr.exports;
|
|
|
4247
4303
|
if (Ie(h))
|
|
4248
4304
|
return p(h);
|
|
4249
4305
|
}
|
|
4250
|
-
var
|
|
4251
|
-
if (g(h) && (H = !0, Te = ["[", "]"]),
|
|
4252
|
-
var
|
|
4253
|
-
|
|
4306
|
+
var D = "", H = !1, Te = ["{", "}"];
|
|
4307
|
+
if (g(h) && (H = !0, Te = ["[", "]"]), fe(h)) {
|
|
4308
|
+
var ut = h.name ? ": " + h.name : "";
|
|
4309
|
+
D = " [Function" + ut + "]";
|
|
4254
4310
|
}
|
|
4255
|
-
if (ie(h) && (
|
|
4256
|
-
return Te[0] +
|
|
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))
|
|
4312
|
+
return Te[0] + D + Te[1];
|
|
4257
4313
|
if (m < 0)
|
|
4258
4314
|
return ie(h) ? d.stylize(RegExp.prototype.toString.call(h), "regexp") : d.stylize("[Object]", "special");
|
|
4259
4315
|
d.seen.push(h);
|
|
4260
4316
|
var Ve;
|
|
4261
|
-
return H ? Ve = v(d, h, m, I, k) : Ve = k.map(function(
|
|
4262
|
-
return w(d, h, m, I,
|
|
4263
|
-
}), d.seen.pop(), b(Ve,
|
|
4317
|
+
return H ? Ve = v(d, h, m, I, k) : Ve = k.map(function(ct) {
|
|
4318
|
+
return w(d, h, m, I, ct, H);
|
|
4319
|
+
}), d.seen.pop(), b(Ve, D, Te);
|
|
4264
4320
|
}
|
|
4265
4321
|
function f(d, h) {
|
|
4266
4322
|
if (O(h))
|
|
@@ -4269,18 +4325,18 @@ var ou = mr.exports;
|
|
|
4269
4325
|
var m = "'" + JSON.stringify(h).replace(/^"|"$/g, "").replace(/'/g, "\\'").replace(/\\"/g, '"') + "'";
|
|
4270
4326
|
return d.stylize(m, "string");
|
|
4271
4327
|
}
|
|
4272
|
-
if (
|
|
4328
|
+
if (re(h))
|
|
4273
4329
|
return d.stylize("" + h, "number");
|
|
4274
4330
|
if (S(h))
|
|
4275
4331
|
return d.stylize("" + h, "boolean");
|
|
4276
|
-
if (
|
|
4332
|
+
if (F(h))
|
|
4277
4333
|
return d.stylize("null", "null");
|
|
4278
4334
|
}
|
|
4279
4335
|
function p(d) {
|
|
4280
4336
|
return "[" + Error.prototype.toString.call(d) + "]";
|
|
4281
4337
|
}
|
|
4282
|
-
function v(d, h, m, A,
|
|
4283
|
-
for (var k = [], I = 0,
|
|
4338
|
+
function v(d, h, m, A, C) {
|
|
4339
|
+
for (var k = [], I = 0, L = h.length; I < L; ++I)
|
|
4284
4340
|
De(h, String(I)) ? k.push(w(
|
|
4285
4341
|
d,
|
|
4286
4342
|
h,
|
|
@@ -4289,46 +4345,46 @@ var ou = mr.exports;
|
|
|
4289
4345
|
String(I),
|
|
4290
4346
|
!0
|
|
4291
4347
|
)) : k.push("");
|
|
4292
|
-
return
|
|
4293
|
-
|
|
4348
|
+
return C.forEach(function(D) {
|
|
4349
|
+
D.match(/^\d+$/) || k.push(w(
|
|
4294
4350
|
d,
|
|
4295
4351
|
h,
|
|
4296
4352
|
m,
|
|
4297
4353
|
A,
|
|
4298
|
-
|
|
4354
|
+
D,
|
|
4299
4355
|
!0
|
|
4300
4356
|
));
|
|
4301
4357
|
}), k;
|
|
4302
4358
|
}
|
|
4303
|
-
function w(d, h, m, A,
|
|
4304
|
-
var I,
|
|
4305
|
-
if (
|
|
4306
|
-
`) > -1 && (k ?
|
|
4359
|
+
function w(d, h, m, A, C, k) {
|
|
4360
|
+
var I, L, D;
|
|
4361
|
+
if (D = Object.getOwnPropertyDescriptor(h, C) || { value: h[C] }, D.get ? D.set ? L = d.stylize("[Getter/Setter]", "special") : L = d.stylize("[Getter]", "special") : D.set && (L = d.stylize("[Setter]", "special")), De(A, C) || (I = "[" + C + "]"), L || (d.seen.indexOf(D.value) < 0 ? (F(m) ? L = c(d, D.value, null) : L = c(d, D.value, m - 1), L.indexOf(`
|
|
4362
|
+
`) > -1 && (k ? L = L.split(`
|
|
4307
4363
|
`).map(function(H) {
|
|
4308
4364
|
return " " + H;
|
|
4309
4365
|
}).join(`
|
|
4310
|
-
`).slice(2) :
|
|
4311
|
-
` +
|
|
4366
|
+
`).slice(2) : L = `
|
|
4367
|
+
` + L.split(`
|
|
4312
4368
|
`).map(function(H) {
|
|
4313
4369
|
return " " + H;
|
|
4314
4370
|
}).join(`
|
|
4315
|
-
`))) :
|
|
4316
|
-
if (k &&
|
|
4317
|
-
return
|
|
4318
|
-
I = JSON.stringify("" +
|
|
4371
|
+
`))) : L = d.stylize("[Circular]", "special")), O(I)) {
|
|
4372
|
+
if (k && C.match(/^\d+$/))
|
|
4373
|
+
return L;
|
|
4374
|
+
I = JSON.stringify("" + C), I.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/) ? (I = I.slice(1, -1), I = d.stylize(I, "name")) : (I = I.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"), I = d.stylize(I, "string"));
|
|
4319
4375
|
}
|
|
4320
|
-
return I + ": " +
|
|
4376
|
+
return I + ": " + L;
|
|
4321
4377
|
}
|
|
4322
4378
|
function b(d, h, m) {
|
|
4323
|
-
var A = d.reduce(function(
|
|
4379
|
+
var A = d.reduce(function(C, k) {
|
|
4324
4380
|
return k.indexOf(`
|
|
4325
|
-
`) >= 0,
|
|
4381
|
+
`) >= 0, C + k.replace(/\u001b\[\d\d?m/g, "").length + 1;
|
|
4326
4382
|
}, 0);
|
|
4327
4383
|
return A > 60 ? m[0] + (h === "" ? "" : h + `
|
|
4328
4384
|
`) + " " + d.join(`,
|
|
4329
4385
|
`) + " " + m[1] : m[0] + h + " " + d.join(", ") + " " + m[1];
|
|
4330
4386
|
}
|
|
4331
|
-
t.types =
|
|
4387
|
+
t.types = Xn;
|
|
4332
4388
|
function g(d) {
|
|
4333
4389
|
return Array.isArray(d);
|
|
4334
4390
|
}
|
|
@@ -4337,18 +4393,18 @@ var ou = mr.exports;
|
|
|
4337
4393
|
return typeof d == "boolean";
|
|
4338
4394
|
}
|
|
4339
4395
|
t.isBoolean = S;
|
|
4340
|
-
function
|
|
4396
|
+
function F(d) {
|
|
4341
4397
|
return d === null;
|
|
4342
4398
|
}
|
|
4343
|
-
t.isNull =
|
|
4399
|
+
t.isNull = F;
|
|
4344
4400
|
function K(d) {
|
|
4345
4401
|
return d == null;
|
|
4346
4402
|
}
|
|
4347
4403
|
t.isNullOrUndefined = K;
|
|
4348
|
-
function
|
|
4404
|
+
function re(d) {
|
|
4349
4405
|
return typeof d == "number";
|
|
4350
4406
|
}
|
|
4351
|
-
t.isNumber =
|
|
4407
|
+
t.isNumber = re;
|
|
4352
4408
|
function P(d) {
|
|
4353
4409
|
return typeof d == "string";
|
|
4354
4410
|
}
|
|
@@ -4377,19 +4433,19 @@ var ou = mr.exports;
|
|
|
4377
4433
|
return oe(d) && (we(d) === "[object Error]" || d instanceof Error);
|
|
4378
4434
|
}
|
|
4379
4435
|
t.isError = Ie, t.types.isNativeError = Ie;
|
|
4380
|
-
function
|
|
4436
|
+
function fe(d) {
|
|
4381
4437
|
return typeof d == "function";
|
|
4382
4438
|
}
|
|
4383
|
-
t.isFunction =
|
|
4384
|
-
function
|
|
4439
|
+
t.isFunction = fe;
|
|
4440
|
+
function Mt(d) {
|
|
4385
4441
|
return d === null || typeof d == "boolean" || typeof d == "number" || typeof d == "string" || typeof d == "symbol" || // ES6 symbol
|
|
4386
4442
|
typeof d > "u";
|
|
4387
4443
|
}
|
|
4388
|
-
t.isPrimitive =
|
|
4444
|
+
t.isPrimitive = Mt, t.isBuffer = su;
|
|
4389
4445
|
function we(d) {
|
|
4390
4446
|
return Object.prototype.toString.call(d);
|
|
4391
4447
|
}
|
|
4392
|
-
function
|
|
4448
|
+
function Je(d) {
|
|
4393
4449
|
return d < 10 ? "0" + d.toString(10) : d.toString(10);
|
|
4394
4450
|
}
|
|
4395
4451
|
var Fe = [
|
|
@@ -4406,17 +4462,17 @@ var ou = mr.exports;
|
|
|
4406
4462
|
"Nov",
|
|
4407
4463
|
"Dec"
|
|
4408
4464
|
];
|
|
4409
|
-
function
|
|
4465
|
+
function qt() {
|
|
4410
4466
|
var d = /* @__PURE__ */ new Date(), h = [
|
|
4411
|
-
|
|
4412
|
-
|
|
4413
|
-
|
|
4467
|
+
Je(d.getHours()),
|
|
4468
|
+
Je(d.getMinutes()),
|
|
4469
|
+
Je(d.getSeconds())
|
|
4414
4470
|
].join(":");
|
|
4415
4471
|
return [d.getDate(), Fe[d.getMonth()], h].join(" ");
|
|
4416
4472
|
}
|
|
4417
4473
|
t.log = function() {
|
|
4418
|
-
console.log("%s - %s",
|
|
4419
|
-
}, t.inherits =
|
|
4474
|
+
console.log("%s - %s", qt(), t.format.apply(t, arguments));
|
|
4475
|
+
}, t.inherits = au, t._extend = function(d, h) {
|
|
4420
4476
|
if (!h || !oe(h)) return d;
|
|
4421
4477
|
for (var m = Object.keys(h), A = m.length; A--; )
|
|
4422
4478
|
d[m[A]] = h[m[A]];
|
|
@@ -4425,15 +4481,15 @@ var ou = mr.exports;
|
|
|
4425
4481
|
function De(d, h) {
|
|
4426
4482
|
return Object.prototype.hasOwnProperty.call(d, h);
|
|
4427
4483
|
}
|
|
4428
|
-
var
|
|
4484
|
+
var pe = typeof Symbol < "u" ? Symbol("util.promisify.custom") : void 0;
|
|
4429
4485
|
t.promisify = function(h) {
|
|
4430
4486
|
if (typeof h != "function")
|
|
4431
4487
|
throw new TypeError('The "original" argument must be of type Function');
|
|
4432
|
-
if (
|
|
4433
|
-
var m = h[
|
|
4488
|
+
if (pe && h[pe]) {
|
|
4489
|
+
var m = h[pe];
|
|
4434
4490
|
if (typeof m != "function")
|
|
4435
4491
|
throw new TypeError('The "util.promisify.custom" argument must be of type Function');
|
|
4436
|
-
return Object.defineProperty(m,
|
|
4492
|
+
return Object.defineProperty(m, pe, {
|
|
4437
4493
|
value: m,
|
|
4438
4494
|
enumerable: !1,
|
|
4439
4495
|
writable: !1,
|
|
@@ -4441,21 +4497,21 @@ var ou = mr.exports;
|
|
|
4441
4497
|
}), m;
|
|
4442
4498
|
}
|
|
4443
4499
|
function m() {
|
|
4444
|
-
for (var A,
|
|
4445
|
-
A =
|
|
4446
|
-
}), I = [],
|
|
4447
|
-
I.push(arguments[
|
|
4448
|
-
I.push(function(
|
|
4449
|
-
|
|
4500
|
+
for (var A, C, k = new Promise(function(D, H) {
|
|
4501
|
+
A = D, C = H;
|
|
4502
|
+
}), I = [], L = 0; L < arguments.length; L++)
|
|
4503
|
+
I.push(arguments[L]);
|
|
4504
|
+
I.push(function(D, H) {
|
|
4505
|
+
D ? C(D) : A(H);
|
|
4450
4506
|
});
|
|
4451
4507
|
try {
|
|
4452
4508
|
h.apply(this, I);
|
|
4453
|
-
} catch (
|
|
4454
|
-
|
|
4509
|
+
} catch (D) {
|
|
4510
|
+
C(D);
|
|
4455
4511
|
}
|
|
4456
4512
|
return k;
|
|
4457
4513
|
}
|
|
4458
|
-
return Object.setPrototypeOf(m, Object.getPrototypeOf(h)),
|
|
4514
|
+
return Object.setPrototypeOf(m, Object.getPrototypeOf(h)), pe && Object.defineProperty(m, pe, {
|
|
4459
4515
|
value: m,
|
|
4460
4516
|
enumerable: !1,
|
|
4461
4517
|
writable: !1,
|
|
@@ -4464,7 +4520,7 @@ var ou = mr.exports;
|
|
|
4464
4520
|
m,
|
|
4465
4521
|
e(h)
|
|
4466
4522
|
);
|
|
4467
|
-
}, t.promisify.custom =
|
|
4523
|
+
}, t.promisify.custom = pe;
|
|
4468
4524
|
function Re(d, h) {
|
|
4469
4525
|
if (!d) {
|
|
4470
4526
|
var m = new Error("Promise was rejected with a falsy value");
|
|
@@ -4472,24 +4528,24 @@ var ou = mr.exports;
|
|
|
4472
4528
|
}
|
|
4473
4529
|
return h(d);
|
|
4474
4530
|
}
|
|
4475
|
-
function
|
|
4531
|
+
function at(d) {
|
|
4476
4532
|
if (typeof d != "function")
|
|
4477
4533
|
throw new TypeError('The "original" argument must be of type Function');
|
|
4478
4534
|
function h() {
|
|
4479
4535
|
for (var m = [], A = 0; A < arguments.length; A++)
|
|
4480
4536
|
m.push(arguments[A]);
|
|
4481
|
-
var
|
|
4482
|
-
if (typeof
|
|
4537
|
+
var C = m.pop();
|
|
4538
|
+
if (typeof C != "function")
|
|
4483
4539
|
throw new TypeError("The last argument must be of type Function");
|
|
4484
4540
|
var k = this, I = function() {
|
|
4485
|
-
return
|
|
4541
|
+
return C.apply(k, arguments);
|
|
4486
4542
|
};
|
|
4487
4543
|
d.apply(this, m).then(
|
|
4488
|
-
function(
|
|
4489
|
-
E.nextTick(I.bind(null, null,
|
|
4544
|
+
function(L) {
|
|
4545
|
+
E.nextTick(I.bind(null, null, L));
|
|
4490
4546
|
},
|
|
4491
|
-
function(
|
|
4492
|
-
E.nextTick(Re.bind(null,
|
|
4547
|
+
function(L) {
|
|
4548
|
+
E.nextTick(Re.bind(null, L, I));
|
|
4493
4549
|
}
|
|
4494
4550
|
);
|
|
4495
4551
|
}
|
|
@@ -4498,9 +4554,9 @@ var ou = mr.exports;
|
|
|
4498
4554
|
e(d)
|
|
4499
4555
|
), h;
|
|
4500
4556
|
}
|
|
4501
|
-
t.callbackify =
|
|
4557
|
+
t.callbackify = at;
|
|
4502
4558
|
})(Dt);
|
|
4503
|
-
const { inherits:
|
|
4559
|
+
const { inherits: uu, format: Jt } = Dt;
|
|
4504
4560
|
function Oe(t, e, r = Error) {
|
|
4505
4561
|
if (!t) throw new Error("Avvio error code must not be empty");
|
|
4506
4562
|
if (!e) throw new Error("Avvio base error message must not be empty");
|
|
@@ -4511,9 +4567,9 @@ function Oe(t, e, r = Error) {
|
|
|
4511
4567
|
}
|
|
4512
4568
|
return n.prototype[Symbol.toStringTag] = "Error", n.prototype.toString = function() {
|
|
4513
4569
|
return `${this.name} [${this.code}]: ${this.message}`;
|
|
4514
|
-
},
|
|
4570
|
+
}, uu(n, r), n;
|
|
4515
4571
|
}
|
|
4516
|
-
var
|
|
4572
|
+
var hi = {
|
|
4517
4573
|
createError: Oe,
|
|
4518
4574
|
AVV_ERR_EXPOSE_ALREADY_DEFINED: Oe(
|
|
4519
4575
|
"AVV_ERR_EXPOSE_ALREADY_DEFINED",
|
|
@@ -4539,7 +4595,7 @@ var fi = {
|
|
|
4539
4595
|
"AVV_ERR_READY_TIMEOUT",
|
|
4540
4596
|
"Plugin did not start in time: '%s'. You may have forgotten to call 'done' function or to resolve a Promise"
|
|
4541
4597
|
)
|
|
4542
|
-
},
|
|
4598
|
+
}, cu = function t(e, r, n) {
|
|
4543
4599
|
r === void 0 && (r = ""), n || (n = {});
|
|
4544
4600
|
var i = function(u) {
|
|
4545
4601
|
var l = {
|
|
@@ -4561,15 +4617,15 @@ var fi = {
|
|
|
4561
4617
|
return r + i(c ? "└" : "├") + i("─") + i(f ? "┬" : "─") + " " + t(u, p, n).slice(r.length + 2);
|
|
4562
4618
|
}).join("");
|
|
4563
4619
|
};
|
|
4564
|
-
const
|
|
4565
|
-
let
|
|
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 {
|
|
4566
4622
|
constructor() {
|
|
4567
4623
|
this.root = null, this.tableId = /* @__PURE__ */ new Map(), this.tableLabel = /* @__PURE__ */ new Map();
|
|
4568
4624
|
}
|
|
4569
4625
|
[Xt](e) {
|
|
4570
4626
|
this.tableId.set(e.id, e), this.tableLabel.has(e.label) ? this.tableLabel.get(e.label).push(e) : this.tableLabel.set(e.label, [e]);
|
|
4571
4627
|
}
|
|
4572
|
-
[
|
|
4628
|
+
[vn](e) {
|
|
4573
4629
|
this.tableId.delete(e.id);
|
|
4574
4630
|
const r = this.tableLabel.get(e.label);
|
|
4575
4631
|
if (r.id) {
|
|
@@ -4578,16 +4634,16 @@ let cu = class {
|
|
|
4578
4634
|
}
|
|
4579
4635
|
r.pop(), r.length === 0 && this.tableLabel.delete(e.label);
|
|
4580
4636
|
}
|
|
4581
|
-
[
|
|
4637
|
+
[Sn](e) {
|
|
4582
4638
|
if (e === null)
|
|
4583
4639
|
return this.root;
|
|
4584
4640
|
const r = this.tableLabel.get(e);
|
|
4585
4641
|
return r.id ? r : r[r.length - 1];
|
|
4586
4642
|
}
|
|
4587
|
-
[
|
|
4643
|
+
[wn](e) {
|
|
4588
4644
|
return this.tableId.get(e);
|
|
4589
4645
|
}
|
|
4590
|
-
[
|
|
4646
|
+
[An](e, r, n) {
|
|
4591
4647
|
if (e === null)
|
|
4592
4648
|
return this.root = {
|
|
4593
4649
|
id: "root",
|
|
@@ -4595,7 +4651,7 @@ let cu = class {
|
|
|
4595
4651
|
start: n,
|
|
4596
4652
|
nodes: []
|
|
4597
4653
|
}, this[Xt](this.root), this.root.id;
|
|
4598
|
-
const o = this[
|
|
4654
|
+
const o = this[Sn](e), s = `${r}-${Math.random()}`, a = {
|
|
4599
4655
|
id: s,
|
|
4600
4656
|
parent: e,
|
|
4601
4657
|
start: n,
|
|
@@ -4605,24 +4661,24 @@ let cu = class {
|
|
|
4605
4661
|
return o.nodes.push(a), this[Xt](a), s;
|
|
4606
4662
|
}
|
|
4607
4663
|
start(e, r, n = Date.now()) {
|
|
4608
|
-
return this[
|
|
4664
|
+
return this[An](e, r, n);
|
|
4609
4665
|
}
|
|
4610
4666
|
stop(e, r = Date.now()) {
|
|
4611
|
-
const n = this[
|
|
4612
|
-
n && (n.stop = r, n.diff = n.stop - n.start || 0, this[
|
|
4667
|
+
const n = this[wn](e);
|
|
4668
|
+
n && (n.stop = r, n.diff = n.stop - n.start || 0, this[vn](n));
|
|
4613
4669
|
}
|
|
4614
4670
|
toJSON() {
|
|
4615
4671
|
return Object.assign({}, this.root);
|
|
4616
4672
|
}
|
|
4617
4673
|
prittyPrint() {
|
|
4618
4674
|
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());
|
|
4619
|
-
return
|
|
4675
|
+
return lu(r);
|
|
4620
4676
|
}
|
|
4621
4677
|
};
|
|
4622
|
-
var
|
|
4623
|
-
function
|
|
4624
|
-
if (
|
|
4625
|
-
|
|
4678
|
+
var fu = du, Dr = { exports: {} }, br = { exports: {} }, Zt, En;
|
|
4679
|
+
function pu() {
|
|
4680
|
+
if (En) return Zt;
|
|
4681
|
+
En = 1;
|
|
4626
4682
|
var t = 1e3, e = t * 60, r = e * 60, n = r * 24, i = n * 7, o = n * 365.25;
|
|
4627
4683
|
Zt = function(c, f) {
|
|
4628
4684
|
f = f || {};
|
|
@@ -4701,8 +4757,8 @@ function du() {
|
|
|
4701
4757
|
}
|
|
4702
4758
|
return Zt;
|
|
4703
4759
|
}
|
|
4704
|
-
function
|
|
4705
|
-
r.debug = r, r.default = r, r.coerce = u, r.disable = o, r.enable = i, r.enabled = s, r.humanize =
|
|
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) => {
|
|
4706
4762
|
r[c] = t[c];
|
|
4707
4763
|
}), r.names = [], r.skips = [], r.formatters = {};
|
|
4708
4764
|
function e(c) {
|
|
@@ -4717,17 +4773,17 @@ function fu(t) {
|
|
|
4717
4773
|
function b(...g) {
|
|
4718
4774
|
if (!b.enabled)
|
|
4719
4775
|
return;
|
|
4720
|
-
const S = b,
|
|
4721
|
-
S.diff = K, S.prev = f, S.curr =
|
|
4722
|
-
let
|
|
4776
|
+
const S = b, F = Number(/* @__PURE__ */ new Date()), K = F - (f || F);
|
|
4777
|
+
S.diff = K, S.prev = f, S.curr = F, f = F, g[0] = r.coerce(g[0]), typeof g[0] != "string" && g.unshift("%O");
|
|
4778
|
+
let re = 0;
|
|
4723
4779
|
g[0] = g[0].replace(/%([a-zA-Z%])/g, (V, O) => {
|
|
4724
4780
|
if (V === "%%")
|
|
4725
4781
|
return "%";
|
|
4726
|
-
|
|
4782
|
+
re++;
|
|
4727
4783
|
const ie = r.formatters[O];
|
|
4728
4784
|
if (typeof ie == "function") {
|
|
4729
|
-
const oe = g[
|
|
4730
|
-
V = ie.call(S, oe), g.splice(
|
|
4785
|
+
const oe = g[re];
|
|
4786
|
+
V = ie.call(S, oe), g.splice(re, 1), re--;
|
|
4731
4787
|
}
|
|
4732
4788
|
return V;
|
|
4733
4789
|
}), r.formatArgs.call(S, g), (S.log || r.log).apply(S, g);
|
|
@@ -4782,7 +4838,7 @@ function fu(t) {
|
|
|
4782
4838
|
}
|
|
4783
4839
|
return r.enable(r.load()), r;
|
|
4784
4840
|
}
|
|
4785
|
-
var
|
|
4841
|
+
var yu = hu;
|
|
4786
4842
|
(function(t, e) {
|
|
4787
4843
|
e.formatArgs = n, e.save = i, e.load = o, e.useColors = r, e.storage = s(), e.destroy = /* @__PURE__ */ (() => {
|
|
4788
4844
|
let u = !1;
|
|
@@ -4906,7 +4962,7 @@ var pu = fu;
|
|
|
4906
4962
|
} catch {
|
|
4907
4963
|
}
|
|
4908
4964
|
}
|
|
4909
|
-
t.exports =
|
|
4965
|
+
t.exports = yu(e);
|
|
4910
4966
|
const { formatters: a } = t.exports;
|
|
4911
4967
|
a.j = function(u) {
|
|
4912
4968
|
try {
|
|
@@ -4915,24 +4971,24 @@ var pu = fu;
|
|
|
4915
4971
|
return "[UnexpectedJSONParseError]: " + l.message;
|
|
4916
4972
|
}
|
|
4917
4973
|
};
|
|
4918
|
-
})(
|
|
4919
|
-
var
|
|
4920
|
-
const
|
|
4921
|
-
function
|
|
4974
|
+
})(br, br.exports);
|
|
4975
|
+
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) {
|
|
4922
4978
|
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(`
|
|
4923
4979
|
`).slice(0, 2).map((r) => r.trim()).join(" -- ");
|
|
4924
4980
|
}
|
|
4925
|
-
function
|
|
4981
|
+
function wu() {
|
|
4926
4982
|
const t = {};
|
|
4927
4983
|
return t.promise = new Promise((e, r) => {
|
|
4928
4984
|
t.resolve = e, t.reject = r;
|
|
4929
4985
|
}), t;
|
|
4930
4986
|
}
|
|
4931
|
-
function
|
|
4932
|
-
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 =
|
|
4987
|
+
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;
|
|
4933
4989
|
}
|
|
4934
|
-
|
|
4935
|
-
|
|
4990
|
+
bu(Ye, gu);
|
|
4991
|
+
Ye.prototype.exec = function(t, e) {
|
|
4936
4992
|
const r = this.func;
|
|
4937
4993
|
let n = !1;
|
|
4938
4994
|
const i = this.name;
|
|
@@ -4959,7 +5015,7 @@ We.prototype.exec = function(t, e) {
|
|
|
4959
5015
|
};
|
|
4960
5016
|
this.timeout > 0 && (U("setting up timeout", i, this.timeout), o = setTimeout(function() {
|
|
4961
5017
|
U("timed out", i), o = null;
|
|
4962
|
-
const u = new
|
|
5018
|
+
const u = new vu(i);
|
|
4963
5019
|
u.fn = r, s(u);
|
|
4964
5020
|
}, this.timeout)), this.started = !0, this.emit("start", this.server ? this.server.name : null, this.name, Date.now());
|
|
4965
5021
|
const a = r(this.server, this.opts, s);
|
|
@@ -4968,7 +5024,7 @@ We.prototype.exec = function(t, e) {
|
|
|
4968
5024
|
(u) => E.nextTick(s, u)
|
|
4969
5025
|
));
|
|
4970
5026
|
};
|
|
4971
|
-
|
|
5027
|
+
Ye.prototype.loadedSoFar = function() {
|
|
4972
5028
|
if (this.loaded)
|
|
4973
5029
|
return Promise.resolve();
|
|
4974
5030
|
const t = () => {
|
|
@@ -4977,12 +5033,12 @@ We.prototype.loadedSoFar = function() {
|
|
|
4977
5033
|
}), this.q.resume();
|
|
4978
5034
|
};
|
|
4979
5035
|
let e;
|
|
4980
|
-
return this._promise ? e = Promise.resolve() : (this._promise =
|
|
5036
|
+
return this._promise ? e = Promise.resolve() : (this._promise = wu(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
|
|
4981
5037
|
};
|
|
4982
|
-
|
|
5038
|
+
Ye.prototype.enqueue = function(t, e) {
|
|
4983
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);
|
|
4984
5040
|
};
|
|
4985
|
-
|
|
5041
|
+
Ye.prototype.finish = function(t, e) {
|
|
4986
5042
|
U("finish", this.name, t);
|
|
4987
5043
|
const r = () => {
|
|
4988
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));
|
|
@@ -5002,19 +5058,19 @@ We.prototype.finish = function(t, e) {
|
|
|
5002
5058
|
r();
|
|
5003
5059
|
else
|
|
5004
5060
|
U("delayed", this.name), this.q.drain = () => {
|
|
5005
|
-
U("drain", this.name), this.q.drain =
|
|
5061
|
+
U("drain", this.name), this.q.drain = Eu, queueMicrotask(n);
|
|
5006
5062
|
};
|
|
5007
5063
|
};
|
|
5008
5064
|
queueMicrotask(n), this.q.resume();
|
|
5009
5065
|
};
|
|
5010
|
-
function
|
|
5066
|
+
function Au(t, e) {
|
|
5011
5067
|
const r = this;
|
|
5012
|
-
E.nextTick(
|
|
5068
|
+
E.nextTick(Rr.bind(r), t, e);
|
|
5013
5069
|
}
|
|
5014
|
-
function
|
|
5070
|
+
function Rr(t, e) {
|
|
5015
5071
|
if (typeof t.func.then == "function") {
|
|
5016
5072
|
t.func.then((n) => {
|
|
5017
|
-
typeof n.default == "function" && (n = n.default), t.func = n,
|
|
5073
|
+
typeof n.default == "function" && (n = n.default), t.func = n, Rr.call(this, t, e);
|
|
5018
5074
|
}, e);
|
|
5019
5075
|
return;
|
|
5020
5076
|
}
|
|
@@ -5025,19 +5081,19 @@ function Dr(t, e) {
|
|
|
5025
5081
|
});
|
|
5026
5082
|
});
|
|
5027
5083
|
}
|
|
5028
|
-
function
|
|
5084
|
+
function Eu() {
|
|
5029
5085
|
}
|
|
5030
|
-
|
|
5031
|
-
|
|
5032
|
-
var
|
|
5033
|
-
const
|
|
5086
|
+
Dr.exports = Ye;
|
|
5087
|
+
Dr.exports.loadPlugin = Rr;
|
|
5088
|
+
var Iu = Dr.exports;
|
|
5089
|
+
const In = Un, Tu = Jn.EventEmitter, Ou = Dt.inherits, {
|
|
5034
5090
|
AVV_ERR_EXPOSE_ALREADY_DEFINED: tr,
|
|
5035
|
-
AVV_ERR_CALLBACK_NOT_FN:
|
|
5036
|
-
AVV_ERR_PLUGIN_NOT_VALID:
|
|
5037
|
-
AVV_ERR_ROOT_PLG_BOOTED:
|
|
5038
|
-
AVV_ERR_READY_TIMEOUT:
|
|
5039
|
-
} =
|
|
5040
|
-
function
|
|
5091
|
+
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) {
|
|
5041
5097
|
const n = e.expose || {}, i = n.use || "use", o = n.after || "after", s = n.ready || "ready", a = n.onClose || "onClose", u = n.close || "close";
|
|
5042
5098
|
if (t[i])
|
|
5043
5099
|
throw new tr(i);
|
|
@@ -5047,38 +5103,38 @@ function Lu(t, e, r) {
|
|
|
5047
5103
|
throw new tr(s);
|
|
5048
5104
|
t[i] = function(l, c) {
|
|
5049
5105
|
return r.use(l, c), this;
|
|
5050
|
-
}, Object.defineProperty(t, "then", { get:
|
|
5106
|
+
}, Object.defineProperty(t, "then", { get: mi.bind(r) }), t[Ct] = !0, t[o] = function(l) {
|
|
5051
5107
|
return typeof l != "function" ? r._loadRegistered() : (r.after(nr(l, this)), this);
|
|
5052
5108
|
}, t[s] = function(l) {
|
|
5053
5109
|
if (l && typeof l != "function")
|
|
5054
|
-
throw new
|
|
5110
|
+
throw new tt(s, typeof l);
|
|
5055
5111
|
return r.ready(l ? nr(l, this) : void 0);
|
|
5056
5112
|
}, t[a] = function(l) {
|
|
5057
5113
|
if (typeof l != "function")
|
|
5058
|
-
throw new
|
|
5059
|
-
return r.onClose(
|
|
5114
|
+
throw new tt(a, typeof l);
|
|
5115
|
+
return r.onClose(Vu(l, this)), this;
|
|
5060
5116
|
}, t[u] = function(l) {
|
|
5061
5117
|
if (l && typeof l != "function")
|
|
5062
|
-
throw new
|
|
5118
|
+
throw new tt(u, typeof l);
|
|
5063
5119
|
return l ? (r.close(nr(l, this)), this) : r.close();
|
|
5064
5120
|
};
|
|
5065
5121
|
}
|
|
5066
|
-
function
|
|
5067
|
-
if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof
|
|
5068
|
-
const n = new
|
|
5069
|
-
return t &&
|
|
5070
|
-
}
|
|
5071
|
-
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
|
|
5072
|
-
this.emit("start"), this._readyQ.drain =
|
|
5073
|
-
}, this._closeQ =
|
|
5074
|
-
this.emit("close"), this._closeQ.drain =
|
|
5075
|
-
}, this._doStart = null, this._root = new
|
|
5122
|
+
function G(t, e, r) {
|
|
5123
|
+
if (typeof t == "function" && arguments.length === 1 && (r = t, e = {}, t = null), typeof e == "function" && (r = e, e = {}), e = e || {}, !(this instanceof G)) {
|
|
5124
|
+
const n = new G(t, e, r);
|
|
5125
|
+
return t && Pu(t, e, n), n;
|
|
5126
|
+
}
|
|
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 = () => {
|
|
5128
|
+
this.emit("start"), this._readyQ.drain = Tn;
|
|
5129
|
+
}, this._closeQ = In(this, Ru, 1), this._closeQ.pause(), this._closeQ.drain = () => {
|
|
5130
|
+
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) => {
|
|
5076
5132
|
const s = this.pluginTree.start(null, i, o);
|
|
5077
5133
|
this._root.once("loaded", (a, u, l) => {
|
|
5078
5134
|
this.pluginTree.stop(s, l);
|
|
5079
5135
|
});
|
|
5080
|
-
}),
|
|
5081
|
-
|
|
5136
|
+
}), vr.loadPlugin.call(this, this._root, (n) => {
|
|
5137
|
+
He("root plugin ready");
|
|
5082
5138
|
try {
|
|
5083
5139
|
this.emit("preReady"), this._root = null;
|
|
5084
5140
|
} catch (i) {
|
|
@@ -5092,34 +5148,34 @@ function q(t, e, r) {
|
|
|
5092
5148
|
this._readyQ.resume();
|
|
5093
5149
|
});
|
|
5094
5150
|
}
|
|
5095
|
-
function
|
|
5151
|
+
function Nu(t, e, r) {
|
|
5096
5152
|
this._doStart = r, e.autostart && this.start();
|
|
5097
5153
|
}
|
|
5098
|
-
|
|
5099
|
-
|
|
5154
|
+
Ou(G, Tu);
|
|
5155
|
+
G.prototype.start = function() {
|
|
5100
5156
|
return this.started = !0, E.nextTick(this._doStart), this;
|
|
5101
5157
|
};
|
|
5102
|
-
|
|
5158
|
+
G.prototype.override = function(t, e, r) {
|
|
5103
5159
|
return t;
|
|
5104
5160
|
};
|
|
5105
|
-
function
|
|
5161
|
+
function Fu(t) {
|
|
5106
5162
|
if (t && typeof t == "object" && typeof t.default == "function" && (t = t.default), !(t && (typeof t == "function" || typeof t.then == "function")))
|
|
5107
|
-
throw new
|
|
5163
|
+
throw new _u(typeof t);
|
|
5108
5164
|
return t;
|
|
5109
5165
|
}
|
|
5110
|
-
|
|
5111
|
-
|
|
5166
|
+
G.prototype[Ct] = !0;
|
|
5167
|
+
G.prototype.use = function(t, e) {
|
|
5112
5168
|
return this._lastUsed = this._addPlugin(t, e, !1), this;
|
|
5113
5169
|
};
|
|
5114
|
-
|
|
5170
|
+
G.prototype._loadRegistered = function() {
|
|
5115
5171
|
const t = this._current[0];
|
|
5116
5172
|
return !this.started && !this.booted && E.nextTick(() => this._root.q.resume()), t ? t.loadedSoFar() : Promise.resolve();
|
|
5117
5173
|
};
|
|
5118
|
-
Object.defineProperty(
|
|
5119
|
-
|
|
5120
|
-
if (t =
|
|
5121
|
-
throw new
|
|
5122
|
-
const n = this._current[0], i = new
|
|
5174
|
+
Object.defineProperty(G.prototype, "then", { get: mi });
|
|
5175
|
+
G.prototype._addPlugin = function(t, e, r) {
|
|
5176
|
+
if (t = Fu(t), e = e || {}, this.booted)
|
|
5177
|
+
throw new Lu();
|
|
5178
|
+
const n = this._current[0], i = new vr(this, t, e, r);
|
|
5123
5179
|
if (i.once("start", (o, s, a) => {
|
|
5124
5180
|
const u = this.pluginTree.start(n.name, s, a);
|
|
5125
5181
|
i.once("loaded", (l, c, f) => {
|
|
@@ -5131,16 +5187,16 @@ q.prototype._addPlugin = function(t, e, r) {
|
|
|
5131
5187
|
o && (this._error = o);
|
|
5132
5188
|
}), i;
|
|
5133
5189
|
};
|
|
5134
|
-
|
|
5190
|
+
G.prototype.after = function(t) {
|
|
5135
5191
|
if (!t)
|
|
5136
5192
|
return this._loadRegistered();
|
|
5137
5193
|
this._addPlugin(e.bind(this), {}, !0);
|
|
5138
5194
|
function e(r, n, i) {
|
|
5139
|
-
|
|
5195
|
+
gi.call(this, t, i);
|
|
5140
5196
|
}
|
|
5141
5197
|
return this;
|
|
5142
5198
|
};
|
|
5143
|
-
|
|
5199
|
+
G.prototype.onClose = function(t) {
|
|
5144
5200
|
if (typeof t != "function")
|
|
5145
5201
|
throw new Error("not a function");
|
|
5146
5202
|
t[this._isOnCloseHandlerKey] = !0, this._closeQ.unshift(t, e.bind(this));
|
|
@@ -5149,11 +5205,11 @@ q.prototype.onClose = function(t) {
|
|
|
5149
5205
|
}
|
|
5150
5206
|
return this;
|
|
5151
5207
|
};
|
|
5152
|
-
|
|
5208
|
+
G.prototype.close = function(t) {
|
|
5153
5209
|
let e;
|
|
5154
5210
|
if (t) {
|
|
5155
5211
|
if (typeof t != "function")
|
|
5156
|
-
throw new
|
|
5212
|
+
throw new tt("close", typeof t);
|
|
5157
5213
|
} else
|
|
5158
5214
|
e = new Promise(function(r, n) {
|
|
5159
5215
|
t = function(i) {
|
|
@@ -5166,10 +5222,10 @@ q.prototype.close = function(t) {
|
|
|
5166
5222
|
this._error = null, this._closeQ.push(t), E.nextTick(this._closeQ.resume.bind(this._closeQ));
|
|
5167
5223
|
}), e;
|
|
5168
5224
|
};
|
|
5169
|
-
|
|
5225
|
+
G.prototype.ready = function(t) {
|
|
5170
5226
|
if (t) {
|
|
5171
5227
|
if (typeof t != "function")
|
|
5172
|
-
throw new
|
|
5228
|
+
throw new tt("ready", typeof t);
|
|
5173
5229
|
this._readyQ.push(t), queueMicrotask(this.start.bind(this));
|
|
5174
5230
|
return;
|
|
5175
5231
|
}
|
|
@@ -5181,46 +5237,46 @@ q.prototype.ready = function(t) {
|
|
|
5181
5237
|
}
|
|
5182
5238
|
});
|
|
5183
5239
|
};
|
|
5184
|
-
|
|
5240
|
+
G.prototype.prettyPrint = function() {
|
|
5185
5241
|
return this.pluginTree.prittyPrint();
|
|
5186
5242
|
};
|
|
5187
|
-
|
|
5243
|
+
G.prototype.toJSON = function() {
|
|
5188
5244
|
return this.pluginTree.toJSON();
|
|
5189
5245
|
};
|
|
5190
|
-
function
|
|
5246
|
+
function Tn() {
|
|
5191
5247
|
}
|
|
5192
|
-
function
|
|
5248
|
+
function mi() {
|
|
5193
5249
|
if (this.booted) {
|
|
5194
|
-
|
|
5250
|
+
He("thenify returning null because we are already booted");
|
|
5195
5251
|
return;
|
|
5196
5252
|
}
|
|
5197
5253
|
if (this[rr]) {
|
|
5198
5254
|
this[rr] = !1;
|
|
5199
5255
|
return;
|
|
5200
5256
|
}
|
|
5201
|
-
return
|
|
5257
|
+
return He("thenify"), (t, e) => this._loadRegistered().then(() => (this[rr] = !0, t(this._server)), e);
|
|
5202
5258
|
}
|
|
5203
|
-
function
|
|
5259
|
+
function gi(t, e) {
|
|
5204
5260
|
const r = this._server, n = this._error;
|
|
5205
5261
|
let i;
|
|
5206
5262
|
if (this._error = null, t.length === 0)
|
|
5207
|
-
this._error = n, i = t(), i && !i[
|
|
5263
|
+
this._error = n, i = t(), i && !i[Ct] && typeof i.then == "function" ? i.then(() => E.nextTick(e), (o) => E.nextTick(e, o)) : E.nextTick(e);
|
|
5208
5264
|
else if (t.length === 1)
|
|
5209
|
-
i = t(n), i && !i[
|
|
5265
|
+
i = t(n), i && !i[Ct] && typeof i.then == "function" ? i.then(() => E.nextTick(e), (o) => E.nextTick(e, o)) : E.nextTick(e);
|
|
5210
5266
|
else if (this._timeout === 0) {
|
|
5211
5267
|
const o = (s) => {
|
|
5212
5268
|
this._error = s, e(this._error);
|
|
5213
5269
|
};
|
|
5214
5270
|
t.length === 2 ? t(n, o) : t(n, r, o);
|
|
5215
5271
|
} else
|
|
5216
|
-
|
|
5272
|
+
Du.call(this, t, n, r, e);
|
|
5217
5273
|
}
|
|
5218
|
-
function
|
|
5274
|
+
function Du(t, e, r, n) {
|
|
5219
5275
|
const i = t.name;
|
|
5220
|
-
|
|
5276
|
+
He("setting up ready timeout", i, this._timeout);
|
|
5221
5277
|
let o = setTimeout(() => {
|
|
5222
|
-
|
|
5223
|
-
const a = new
|
|
5278
|
+
He("timed out", i), o = null;
|
|
5279
|
+
const a = new Cu(i);
|
|
5224
5280
|
a.fn = t, this._error = a, n(a);
|
|
5225
5281
|
}, this._timeout);
|
|
5226
5282
|
t.length === 2 ? t(e, s.bind(this)) : t(e, r, s.bind(this));
|
|
@@ -5228,17 +5284,17 @@ function Nu(t, e, r, n) {
|
|
|
5228
5284
|
o && (clearTimeout(o), this._error = a, n(this._error));
|
|
5229
5285
|
}
|
|
5230
5286
|
}
|
|
5231
|
-
function
|
|
5287
|
+
function Ru(t, e) {
|
|
5232
5288
|
const r = this._server, n = t[this._isOnCloseHandlerKey];
|
|
5233
5289
|
if (t.length === 0 || t.length === 1) {
|
|
5234
5290
|
let i;
|
|
5235
|
-
n ? i = t(r) : i = t(this._error), i && typeof i.then == "function" ? (
|
|
5291
|
+
n ? i = t(r) : i = t(this._error), i && typeof i.then == "function" ? (He("resolving close/onClose promise"), i.then(
|
|
5236
5292
|
() => E.nextTick(e),
|
|
5237
5293
|
(o) => E.nextTick(e, o)
|
|
5238
5294
|
)) : E.nextTick(e);
|
|
5239
5295
|
} else t.length === 2 ? t(n ? r : this._error, e) : n ? t(r, e) : t(this._error, r, e);
|
|
5240
5296
|
}
|
|
5241
|
-
function
|
|
5297
|
+
function Vu(t, e) {
|
|
5242
5298
|
return r.bind(e);
|
|
5243
5299
|
function r(n, i) {
|
|
5244
5300
|
let o;
|
|
@@ -5260,16 +5316,16 @@ function nr(t, e) {
|
|
|
5260
5316
|
}, i) : E.nextTick(i)) : t.length === 2 ? t(n, i) : t(n, this, i) : E.nextTick(i);
|
|
5261
5317
|
}
|
|
5262
5318
|
}
|
|
5263
|
-
|
|
5264
|
-
|
|
5265
|
-
return
|
|
5319
|
+
Er.exports = G;
|
|
5320
|
+
Er.exports.express = function(t) {
|
|
5321
|
+
return G(t, {
|
|
5266
5322
|
expose: {
|
|
5267
5323
|
use: "load"
|
|
5268
5324
|
}
|
|
5269
5325
|
});
|
|
5270
5326
|
};
|
|
5271
|
-
var
|
|
5272
|
-
const
|
|
5327
|
+
var $u = Er.exports;
|
|
5328
|
+
const Bu = /* @__PURE__ */ fs($u);
|
|
5273
5329
|
(function() {
|
|
5274
5330
|
if (window.requestAnimationFrame && window.cancelAnimationFrame)
|
|
5275
5331
|
return;
|
|
@@ -5287,13 +5343,13 @@ const Vu = /* @__PURE__ */ ls(Ru);
|
|
|
5287
5343
|
}, window.cancelAnimationFrame = clearTimeout;
|
|
5288
5344
|
}
|
|
5289
5345
|
})();
|
|
5290
|
-
function
|
|
5291
|
-
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 =
|
|
5292
|
-
return s.use(
|
|
5346
|
+
function uc(t, e = !0, r = !0, n = { friendsTab: "enabled" }) {
|
|
5347
|
+
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, {
|
|
5293
5349
|
onContentActivate: n?.onContentActivate,
|
|
5294
5350
|
withAd: n?.withAd,
|
|
5295
5351
|
withAdNotification: n?.withAdNotification
|
|
5296
|
-
}), s.use(
|
|
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) => {
|
|
5297
5353
|
if (a)
|
|
5298
5354
|
throw a;
|
|
5299
5355
|
u.ready(), l();
|
|
@@ -5306,5 +5362,5 @@ function sc(t, e = !0, r = !0, n = { friendsTab: "enabled" }) {
|
|
|
5306
5362
|
}), s;
|
|
5307
5363
|
}
|
|
5308
5364
|
export {
|
|
5309
|
-
|
|
5365
|
+
uc as StreamLayer
|
|
5310
5366
|
};
|