@streamlayer/sdk-web 1.10.0 → 1.10.1
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 +4 -4
- package/lib/es/index.js +88 -79
- package/package.json +11 -11
package/lib/es/index.js
CHANGED
|
@@ -5,7 +5,7 @@ import { SdkOverlayType as R } from "@streamlayer/sl-eslib/sdkSettings/sdkSettin
|
|
|
5
5
|
import { InvitationCategory as Mr, InvitationFrom as Ur } from "@streamlayer/sl-eslib/analytics/v1/invitations/invitations_pb";
|
|
6
6
|
import { computed as Ti, map as _i, atom as Lt, batched as qr, onMount as wr } from "nanostores";
|
|
7
7
|
import { v4 as or } from "uuid";
|
|
8
|
-
import { ConnectError as
|
|
8
|
+
import { ConnectError as it, Code as oe, createContextKey as jr, createClient as xr, createContextValues as ki } from "@connectrpc/connect";
|
|
9
9
|
import { createGrpcWebTransport as Qr } from "@connectrpc/connect-web";
|
|
10
10
|
import { nanoquery as Gr } from "@nanostores/query";
|
|
11
11
|
import { Events as Pn } from "@streamlayer/sl-eslib/sports/events/events_connect";
|
|
@@ -218,10 +218,10 @@ const Ui = {
|
|
|
218
218
|
[R.PUBLIC_CHAT]: "publicChat",
|
|
219
219
|
[R.TWITTER]: "twitter"
|
|
220
220
|
};
|
|
221
|
-
var
|
|
221
|
+
var tt;
|
|
222
222
|
(function(t) {
|
|
223
223
|
t.Ready = "ready", t.Suspended = "suspended";
|
|
224
|
-
})(
|
|
224
|
+
})(tt || (tt = {}));
|
|
225
225
|
class Vn {
|
|
226
226
|
status;
|
|
227
227
|
source;
|
|
@@ -230,7 +230,7 @@ class Vn {
|
|
|
230
230
|
listeners = /* @__PURE__ */ new Set();
|
|
231
231
|
settingsKey;
|
|
232
232
|
constructor({ settings: e, ...r }, n) {
|
|
233
|
-
this.settingsKey = Ui[r.type], this.status = Lt(
|
|
233
|
+
this.settingsKey = Ui[r.type], this.status = Lt(tt.Suspended), this.config = new Ce(Z(r), `feature:config:${this.settingsKey}`), this.settingsKey !== void 0 && e?.overlaySettings.case === this.settingsKey ? this.settings = new Ce(Z(e.overlaySettings.value), `feature:settings:${this.settingsKey}`) : this.settings = new Ce(Z({}), `feature:settings:${this.settingsKey}`), this.source = n;
|
|
234
234
|
}
|
|
235
235
|
get featureConfig() {
|
|
236
236
|
return this.config.getStore();
|
|
@@ -242,10 +242,10 @@ class Vn {
|
|
|
242
242
|
this.listeners.add(e);
|
|
243
243
|
}
|
|
244
244
|
enable = () => {
|
|
245
|
-
this.status.set(
|
|
245
|
+
this.status.set(tt.Ready);
|
|
246
246
|
};
|
|
247
247
|
disable = () => {
|
|
248
|
-
this.status.set(
|
|
248
|
+
this.status.set(tt.Suspended);
|
|
249
249
|
};
|
|
250
250
|
setFeatureConfig = ({ settings: e, ...r }) => {
|
|
251
251
|
let n;
|
|
@@ -391,7 +391,7 @@ function $n(t) {
|
|
|
391
391
|
t.name === "QuotaExceededError" || // Firefox
|
|
392
392
|
t.name === "NS_ERROR_DOM_QUOTA_REACHED");
|
|
393
393
|
}
|
|
394
|
-
class
|
|
394
|
+
class Je {
|
|
395
395
|
delimiter = ":";
|
|
396
396
|
prefix;
|
|
397
397
|
storage;
|
|
@@ -485,7 +485,7 @@ class xi {
|
|
|
485
485
|
for await (const o of i)
|
|
486
486
|
this.attempt = 0, this.onData(o);
|
|
487
487
|
} catch (n) {
|
|
488
|
-
n instanceof
|
|
488
|
+
n instanceof it && n.code != oe.Canceled && this.onStreamError(n);
|
|
489
489
|
}
|
|
490
490
|
})(), this.updateState(ie.Connected);
|
|
491
491
|
};
|
|
@@ -525,7 +525,7 @@ class xi {
|
|
|
525
525
|
*/
|
|
526
526
|
onStreamError = (e) => {
|
|
527
527
|
if (this.addStateLog(`error => ${e ? JSON.stringify(e) : "undefined"}}`), e !== void 0) {
|
|
528
|
-
if (e instanceof
|
|
528
|
+
if (e instanceof it && e.code !== oe.Canceled) {
|
|
529
529
|
this.updateState(ie.Failed), this.state.setValue("error", e), e.code === oe.Unknown && e.cause === "missing trailer" && (this.attempt = 0), this.reconnect();
|
|
530
530
|
return;
|
|
531
531
|
}
|
|
@@ -551,8 +551,8 @@ const Qi = /* @__PURE__ */ new Set([
|
|
|
551
551
|
return await t(e);
|
|
552
552
|
} catch (s) {
|
|
553
553
|
Yr.trace({ attempt: o, error: s, url: e.url }, "retry attempt");
|
|
554
|
-
const a =
|
|
555
|
-
if (o >= r || !(a instanceof
|
|
554
|
+
const a = it.from(s);
|
|
555
|
+
if (o >= r || !(a instanceof it) || !Qi.has(a.code))
|
|
556
556
|
throw s;
|
|
557
557
|
const u = Math.min(i, Math.pow(2, o) * n), d = Math.round(u * (1 + Math.random()) / 2);
|
|
558
558
|
await new Promise((c) => setTimeout(c, d));
|
|
@@ -771,7 +771,7 @@ var ge;
|
|
|
771
771
|
(function(t) {
|
|
772
772
|
t.SCHEMA = "schema", t.EXTERNAL_TOKEN = "eToken", t.TOKEN = "token";
|
|
773
773
|
})(ge || (ge = {}));
|
|
774
|
-
class je extends
|
|
774
|
+
class je extends Je {
|
|
775
775
|
constructor() {
|
|
776
776
|
super("user");
|
|
777
777
|
}
|
|
@@ -934,7 +934,7 @@ const ao = (t, e, r) => {
|
|
|
934
934
|
return (await r.questionByUser({
|
|
935
935
|
questionId: t
|
|
936
936
|
})).data?.attributes?.question;
|
|
937
|
-
},
|
|
937
|
+
}, Ge = (t, e) => {
|
|
938
938
|
const { client: r, queryKey: n } = e.createPromiseClient(ee, { method: "questionByUser", params: [t] });
|
|
939
939
|
return e.nanoquery.createFetcherStore(n, {
|
|
940
940
|
fetcher: async (i, o, s) => (await r.questionByUser({
|
|
@@ -1041,7 +1041,7 @@ const ao = (t, e, r) => {
|
|
|
1041
1041
|
return;
|
|
1042
1042
|
const u = r.get().data?.find((c) => c.id === a?.questionId), d = a?.question?.openedFrom;
|
|
1043
1043
|
return u ? (u.openedFrom = d, u) : a.question;
|
|
1044
|
-
}), i = qr(n, (a) => a && a.type === "question" ? a.id : void 0), o =
|
|
1044
|
+
}), i = qr(n, (a) => a && a.type === "question" ? a.id : void 0), o = Ge(i, t);
|
|
1045
1045
|
return { $store: n, $extendedStore: o, updateExtendedQuestion: (a) => {
|
|
1046
1046
|
const u = o.get().data, d = (c, f) => {
|
|
1047
1047
|
if (!c || !f)
|
|
@@ -1070,7 +1070,7 @@ var At;
|
|
|
1070
1070
|
(function(t) {
|
|
1071
1071
|
t.SHOWED = "showed";
|
|
1072
1072
|
})(At || (At = {}));
|
|
1073
|
-
class So extends
|
|
1073
|
+
class So extends Je {
|
|
1074
1074
|
constructor() {
|
|
1075
1075
|
super("advertisement");
|
|
1076
1076
|
}
|
|
@@ -1223,7 +1223,7 @@ var ce;
|
|
|
1223
1223
|
(function(t) {
|
|
1224
1224
|
t.ONBOARDING = "onboarding", t.ONBOARDING_IO = "onboarding_io", t.BET_PACK_ITEM_RECEIVED = "bp-item-received", t.QUESTION_OPENED = "q-opened";
|
|
1225
1225
|
})(ce || (ce = {}));
|
|
1226
|
-
class Io extends
|
|
1226
|
+
class Io extends Je {
|
|
1227
1227
|
constructor() {
|
|
1228
1228
|
super("gamification-session", window.sessionStorage);
|
|
1229
1229
|
}
|
|
@@ -1232,7 +1232,7 @@ class Io extends We {
|
|
|
1232
1232
|
};
|
|
1233
1233
|
readValue = (e) => this.read(...e);
|
|
1234
1234
|
}
|
|
1235
|
-
class Oo extends
|
|
1235
|
+
class Oo extends Je {
|
|
1236
1236
|
sessionStorage;
|
|
1237
1237
|
constructor() {
|
|
1238
1238
|
super("gamification"), this.sessionStorage = new Io();
|
|
@@ -1301,7 +1301,7 @@ class To {
|
|
|
1301
1301
|
if (this.openedQuestion.updateExtendedQuestion(o), o?.type === I.PREDICTION && (o.status === G.ACTIVE || o.status === G.RESOLVED)) {
|
|
1302
1302
|
const s = this.betPack.getValues().data || {};
|
|
1303
1303
|
if (s?.[o.id] || Object.keys(s).length < 5) {
|
|
1304
|
-
const u =
|
|
1304
|
+
const u = Ge(o.id, this.transport), d = u.subscribe(() => {
|
|
1305
1305
|
});
|
|
1306
1306
|
await u.get().promise;
|
|
1307
1307
|
let c = u.get().data;
|
|
@@ -1319,7 +1319,7 @@ class To {
|
|
|
1319
1319
|
if (i?.type === I.PREDICTION && (i.status === G.ACTIVE || i.status === G.RESOLVED)) {
|
|
1320
1320
|
const o = this.betPack.getValues().data || {};
|
|
1321
1321
|
if (o?.[i.id] || Object.keys(o).length < 5) {
|
|
1322
|
-
const a =
|
|
1322
|
+
const a = Ge(i.id, this.transport), u = a.subscribe(() => {
|
|
1323
1323
|
});
|
|
1324
1324
|
await a.get().promise;
|
|
1325
1325
|
let d = a.get().data;
|
|
@@ -1504,7 +1504,7 @@ var Et;
|
|
|
1504
1504
|
(function(t) {
|
|
1505
1505
|
t.OPENED = "opened";
|
|
1506
1506
|
})(Et || (Et = {}));
|
|
1507
|
-
class ko extends
|
|
1507
|
+
class ko extends Je {
|
|
1508
1508
|
constructor() {
|
|
1509
1509
|
super("notification");
|
|
1510
1510
|
}
|
|
@@ -1562,16 +1562,16 @@ const Co = (t, e, r) => {
|
|
|
1562
1562
|
t.notifications.queue.drain();
|
|
1563
1563
|
}), r();
|
|
1564
1564
|
};
|
|
1565
|
-
var
|
|
1565
|
+
var He;
|
|
1566
1566
|
(function(t) {
|
|
1567
1567
|
t.UNKNOWN = "unknown", t.ALREADY_VOTED = "already_voted";
|
|
1568
|
-
})(
|
|
1568
|
+
})(He || (He = {}));
|
|
1569
1569
|
const Xr = async (t, e) => {
|
|
1570
1570
|
const { client: r, createRequestOptions: n } = t.createPromiseClient(ee, { method: "submitAnswer" }), i = n({ retryAttempts: 0 });
|
|
1571
1571
|
try {
|
|
1572
1572
|
return await r.submitAnswer({ data: e }, { contextValues: i });
|
|
1573
1573
|
} catch (o) {
|
|
1574
|
-
throw
|
|
1574
|
+
throw it.from(o)?.code === oe.AlreadyExists ? new Error(He.ALREADY_VOTED) : new Error(He.UNKNOWN);
|
|
1575
1575
|
}
|
|
1576
1576
|
}, Un = (t, e) => {
|
|
1577
1577
|
const { client: r, createRequestOptions: n } = t.createPromiseClient(ee, { method: "submitInplay" }), i = n({ retryAttempts: 0 });
|
|
@@ -1618,7 +1618,7 @@ const Xr = async (t, e) => {
|
|
|
1618
1618
|
};
|
|
1619
1619
|
}), { $store: a, fetchMore: f, invalidate: c };
|
|
1620
1620
|
};
|
|
1621
|
-
class Fo extends
|
|
1621
|
+
class Fo extends Je {
|
|
1622
1622
|
get = this.read;
|
|
1623
1623
|
set = this.write;
|
|
1624
1624
|
del = this.remove;
|
|
@@ -1799,18 +1799,18 @@ class Mo extends Bi {
|
|
|
1799
1799
|
});
|
|
1800
1800
|
};
|
|
1801
1801
|
}
|
|
1802
|
-
const
|
|
1802
|
+
const et = new je(), Uo = (t, e, r) => {
|
|
1803
1803
|
t.auth = new Mo(t.store, t.transport, t.deepLink), t.stores.status.listen((n) => {
|
|
1804
1804
|
n === ve.READY && t.auth.reLogin();
|
|
1805
1805
|
}), t.sdk.userId = t.stores.user.getAtomStore, t.sdk.authorizationBypass = async (n, i) => {
|
|
1806
|
-
if (!(
|
|
1806
|
+
if (!(et.getSchema() === n && et.getExternalToken() === i && t.transport.getHeader("authorization")))
|
|
1807
1807
|
try {
|
|
1808
|
-
await t.auth.login(n, i),
|
|
1808
|
+
await t.auth.login(n, i), et.setSchema(n), et.setExternalToken(i);
|
|
1809
1809
|
} catch {
|
|
1810
1810
|
t.sdk.logout();
|
|
1811
1811
|
}
|
|
1812
1812
|
}, t.sdk.logout = () => {
|
|
1813
|
-
t.auth.logout(),
|
|
1813
|
+
t.auth.logout(), et.clear();
|
|
1814
1814
|
}, t.sdk.getUserStore = () => t.stores.user.getStore(), t.sdk.isUserAuthorized = () => t.auth.isAuthenticated(), r();
|
|
1815
1815
|
}, rn = pe("video_player"), pt = {
|
|
1816
1816
|
debug: (...t) => {
|
|
@@ -2270,7 +2270,7 @@ class Xo extends Vn {
|
|
|
2270
2270
|
prefix: `notification-id:${s}`
|
|
2271
2271
|
}), d = [...this.feedList.getValues().data || []], c = d.findIndex((H) => H.id === s), f = d[c];
|
|
2272
2272
|
let p = f?.attributes?.attributes?.value?.answerId;
|
|
2273
|
-
const v =
|
|
2273
|
+
const v = Ge(s, this.transport), w = v.subscribe(() => {
|
|
2274
2274
|
});
|
|
2275
2275
|
await v.get().promise;
|
|
2276
2276
|
let m = v.get().data;
|
|
@@ -2374,7 +2374,16 @@ class Xo extends Vn {
|
|
|
2374
2374
|
this.background.feedSubscription.removeListener("feed-subscription-prediction-close"), this.background.feedSubscription.removeListener("feed-subscription-questions-list");
|
|
2375
2375
|
};
|
|
2376
2376
|
betPackVote = async (e, r) => {
|
|
2377
|
-
|
|
2377
|
+
try {
|
|
2378
|
+
await Xr(this.transport, { questionId: e, answerId: r });
|
|
2379
|
+
} catch (o) {
|
|
2380
|
+
if (o.message === He.ALREADY_VOTED) {
|
|
2381
|
+
const s = Ge(e, this.transport), a = s.subscribe(() => {
|
|
2382
|
+
});
|
|
2383
|
+
s.invalidate(), a();
|
|
2384
|
+
}
|
|
2385
|
+
throw o;
|
|
2386
|
+
}
|
|
2378
2387
|
const n = { ...this.betPack.getValues().data }, i = n?.[e];
|
|
2379
2388
|
i && (B.emit("poll", {
|
|
2380
2389
|
action: "voted",
|
|
@@ -2388,7 +2397,7 @@ class Xo extends Vn {
|
|
|
2388
2397
|
} : o), this.betPack.getStore().mutate(n));
|
|
2389
2398
|
};
|
|
2390
2399
|
submitAnswer = async (e, r) => {
|
|
2391
|
-
const n =
|
|
2400
|
+
const n = Ge(e, this.transport), i = n.subscribe(() => {
|
|
2392
2401
|
}), o = { ...n.get().data || {} }, s = () => {
|
|
2393
2402
|
const a = this.feedList.getValues().data;
|
|
2394
2403
|
if (!a)
|
|
@@ -2417,7 +2426,7 @@ class Xo extends Vn {
|
|
|
2417
2426
|
try {
|
|
2418
2427
|
await Xr(this.transport, { questionId: e, answerId: r }), s();
|
|
2419
2428
|
} catch (a) {
|
|
2420
|
-
if (a.message ===
|
|
2429
|
+
if (a.message === He.ALREADY_VOTED) {
|
|
2421
2430
|
this.userSummary.invalidate();
|
|
2422
2431
|
const u = n.subscribe(() => {
|
|
2423
2432
|
});
|
|
@@ -2869,7 +2878,7 @@ class ss {
|
|
|
2869
2878
|
});
|
|
2870
2879
|
};
|
|
2871
2880
|
}
|
|
2872
|
-
const
|
|
2881
|
+
const rt = {
|
|
2873
2882
|
[I.UNSET]: Q.UNSET,
|
|
2874
2883
|
[I.FACTOID]: Q.POLLS_INSIGHT,
|
|
2875
2884
|
[I.POLL]: Q.POLLS_POLL,
|
|
@@ -2940,7 +2949,7 @@ class us {
|
|
|
2940
2949
|
...this.analytics.commonStore.getValues(),
|
|
2941
2950
|
kind: K.NOTIFICATION_RECEIVED,
|
|
2942
2951
|
topicId: e,
|
|
2943
|
-
topicType: r ?
|
|
2952
|
+
topicType: r ? rt[r] : Q.UNSET,
|
|
2944
2953
|
topicSubType: n
|
|
2945
2954
|
},
|
|
2946
2955
|
notificationKind: me.POLLS,
|
|
@@ -2953,7 +2962,7 @@ class us {
|
|
|
2953
2962
|
...this.analytics.commonStore.getValues(),
|
|
2954
2963
|
kind: K.NOTIFICATION_OPENED,
|
|
2955
2964
|
topicId: e,
|
|
2956
|
-
topicType: r ?
|
|
2965
|
+
topicType: r ? rt[r] : Q.UNSET,
|
|
2957
2966
|
topicSubType: n
|
|
2958
2967
|
},
|
|
2959
2968
|
notificationKind: me.POLLS,
|
|
@@ -2995,7 +3004,7 @@ class cs {
|
|
|
2995
3004
|
...this.analytics.commonStore.getValues(),
|
|
2996
3005
|
kind: K.POLLS_RECEIVED,
|
|
2997
3006
|
topicId: e,
|
|
2998
|
-
topicType: r ?
|
|
3007
|
+
topicType: r ? rt[r] : Q.UNSET
|
|
2999
3008
|
},
|
|
3000
3009
|
pollOpenedFrom: X.UNSET
|
|
3001
3010
|
});
|
|
@@ -3007,7 +3016,7 @@ class cs {
|
|
|
3007
3016
|
...this.analytics.commonStore.getValues(),
|
|
3008
3017
|
kind: K.POLLS_OPENED,
|
|
3009
3018
|
topicId: e,
|
|
3010
|
-
topicType: r ?
|
|
3019
|
+
topicType: r ? rt[r] : Q.UNSET
|
|
3011
3020
|
},
|
|
3012
3021
|
pollOpenedFrom: n === "list" ? X.PICK_HISTORY : X.IN_APP
|
|
3013
3022
|
});
|
|
@@ -3019,7 +3028,7 @@ class cs {
|
|
|
3019
3028
|
...this.analytics.commonStore.getValues(),
|
|
3020
3029
|
kind: K.POLLS_VOTE,
|
|
3021
3030
|
topicId: e,
|
|
3022
|
-
topicType: r ?
|
|
3031
|
+
topicType: r ? rt[r] : Q.UNSET
|
|
3023
3032
|
},
|
|
3024
3033
|
pollOpenedFrom: X.UNSET
|
|
3025
3034
|
});
|
|
@@ -3305,10 +3314,10 @@ function bs(t, e, r) {
|
|
|
3305
3314
|
}
|
|
3306
3315
|
Or.exports = xn;
|
|
3307
3316
|
Or.exports.promise = bs;
|
|
3308
|
-
var Qn = Or.exports, Tr = { exports: {} },
|
|
3317
|
+
var Qn = Or.exports, Tr = { exports: {} }, Ke = typeof Reflect == "object" ? Reflect : null, sn = Ke && typeof Ke.apply == "function" ? Ke.apply : function(e, r, n) {
|
|
3309
3318
|
return Function.prototype.apply.call(e, r, n);
|
|
3310
3319
|
}, mt;
|
|
3311
|
-
|
|
3320
|
+
Ke && typeof Ke.ownKeys == "function" ? mt = Ke.ownKeys : Object.getOwnPropertySymbols ? mt = function(e) {
|
|
3312
3321
|
return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e));
|
|
3313
3322
|
} : mt = function(e) {
|
|
3314
3323
|
return Object.getOwnPropertyNames(e);
|
|
@@ -3598,7 +3607,7 @@ var Zn = Tr.exports, Rt = {}, ei = {}, ti = function() {
|
|
|
3598
3607
|
d.prototype = r.prototype, i.prototype = new d(), d.prototype = null;
|
|
3599
3608
|
}
|
|
3600
3609
|
return i;
|
|
3601
|
-
}, js = qs, _r = Function.prototype.bind || js, xs = Function.prototype.call, Qs = Object.prototype.hasOwnProperty, Gs = _r, Ks = Gs.call(xs, Qs), T, zs = Ts, Hs = _s, Ws = ks, Ys = Ps,
|
|
3610
|
+
}, js = qs, _r = Function.prototype.bind || js, xs = Function.prototype.call, Qs = Object.prototype.hasOwnProperty, Gs = _r, Ks = Gs.call(xs, Qs), T, zs = Ts, Hs = _s, Ws = ks, Ys = Ps, We = ri, ze = $t, Js = Cs, ni = Function, xt = function(t) {
|
|
3602
3611
|
try {
|
|
3603
3612
|
return ni('"use strict"; return (' + t + ").constructor;")();
|
|
3604
3613
|
} catch {
|
|
@@ -3611,7 +3620,7 @@ if (Le)
|
|
|
3611
3620
|
Le = null;
|
|
3612
3621
|
}
|
|
3613
3622
|
var Qt = function() {
|
|
3614
|
-
throw new
|
|
3623
|
+
throw new ze();
|
|
3615
3624
|
}, Xs = Le ? function() {
|
|
3616
3625
|
try {
|
|
3617
3626
|
return arguments.callee, Qt;
|
|
@@ -3681,10 +3690,10 @@ var Qt = function() {
|
|
|
3681
3690
|
"%String%": String,
|
|
3682
3691
|
"%StringIteratorPrototype%": Me && j ? j(""[Symbol.iterator]()) : T,
|
|
3683
3692
|
"%Symbol%": Me ? Symbol : T,
|
|
3684
|
-
"%SyntaxError%":
|
|
3693
|
+
"%SyntaxError%": We,
|
|
3685
3694
|
"%ThrowTypeError%": Xs,
|
|
3686
3695
|
"%TypedArray%": ea,
|
|
3687
|
-
"%TypeError%":
|
|
3696
|
+
"%TypeError%": ze,
|
|
3688
3697
|
"%Uint8Array%": typeof Uint8Array > "u" ? T : Uint8Array,
|
|
3689
3698
|
"%Uint8ClampedArray%": typeof Uint8ClampedArray > "u" ? T : Uint8ClampedArray,
|
|
3690
3699
|
"%Uint16Array%": typeof Uint16Array > "u" ? T : Uint16Array,
|
|
@@ -3773,9 +3782,9 @@ var ra = function t(e) {
|
|
|
3773
3782
|
}, st = _r, It = Ks, na = st.call(Function.call, Array.prototype.concat), ia = st.call(Function.apply, Array.prototype.splice), ln = st.call(Function.call, String.prototype.replace), Ot = st.call(Function.call, String.prototype.slice), oa = st.call(Function.call, RegExp.prototype.exec), sa = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g, aa = /\\(\\)?/g, ua = function(e) {
|
|
3774
3783
|
var r = Ot(e, 0, 1), n = Ot(e, -1);
|
|
3775
3784
|
if (r === "%" && n !== "%")
|
|
3776
|
-
throw new
|
|
3785
|
+
throw new We("invalid intrinsic syntax, expected closing `%`");
|
|
3777
3786
|
if (n === "%" && r !== "%")
|
|
3778
|
-
throw new
|
|
3787
|
+
throw new We("invalid intrinsic syntax, expected opening `%`");
|
|
3779
3788
|
var i = [];
|
|
3780
3789
|
return ln(e, sa, function(o, s, a, u) {
|
|
3781
3790
|
i[i.length] = a ? ln(u, aa, "$1") : s || o;
|
|
@@ -3785,33 +3794,33 @@ var ra = function t(e) {
|
|
|
3785
3794
|
if (It(dn, n) && (i = dn[n], n = "%" + i[0] + "%"), It(Ne, n)) {
|
|
3786
3795
|
var o = Ne[n];
|
|
3787
3796
|
if (o === qe && (o = ra(n)), typeof o > "u" && !r)
|
|
3788
|
-
throw new
|
|
3797
|
+
throw new ze("intrinsic " + e + " exists, but is not available. Please file an issue!");
|
|
3789
3798
|
return {
|
|
3790
3799
|
alias: i,
|
|
3791
3800
|
name: n,
|
|
3792
3801
|
value: o
|
|
3793
3802
|
};
|
|
3794
3803
|
}
|
|
3795
|
-
throw new
|
|
3804
|
+
throw new We("intrinsic " + e + " does not exist!");
|
|
3796
3805
|
}, at = function(e, r) {
|
|
3797
3806
|
if (typeof e != "string" || e.length === 0)
|
|
3798
|
-
throw new
|
|
3807
|
+
throw new ze("intrinsic name must be a non-empty string");
|
|
3799
3808
|
if (arguments.length > 1 && typeof r != "boolean")
|
|
3800
|
-
throw new
|
|
3809
|
+
throw new ze('"allowMissing" argument must be a boolean');
|
|
3801
3810
|
if (oa(/^%?[^%]*%?$/, e) === null)
|
|
3802
|
-
throw new
|
|
3811
|
+
throw new We("`%` may not be present anywhere but at the beginning and end of the intrinsic name");
|
|
3803
3812
|
var n = ua(e), i = n.length > 0 ? n[0] : "", o = ca("%" + i + "%", r), s = o.name, a = o.value, u = !1, d = o.alias;
|
|
3804
3813
|
d && (i = d[0], ia(n, na([0, 1], d)));
|
|
3805
3814
|
for (var c = 1, f = !0; c < n.length; c += 1) {
|
|
3806
3815
|
var p = n[c], v = Ot(p, 0, 1), w = Ot(p, -1);
|
|
3807
3816
|
if ((v === '"' || v === "'" || v === "`" || w === '"' || w === "'" || w === "`") && v !== w)
|
|
3808
|
-
throw new
|
|
3817
|
+
throw new We("property names with quotes must have matching quotes");
|
|
3809
3818
|
if ((p === "constructor" || !f) && (u = !0), i += "." + p, s = "%" + i + "%", It(Ne, s))
|
|
3810
3819
|
a = Ne[s];
|
|
3811
3820
|
else if (a != null) {
|
|
3812
3821
|
if (!(p in a)) {
|
|
3813
3822
|
if (!r)
|
|
3814
|
-
throw new
|
|
3823
|
+
throw new ze("base intrinsic for " + e + " exists, but the property is not available.");
|
|
3815
3824
|
return;
|
|
3816
3825
|
}
|
|
3817
3826
|
if (Le && c + 1 >= n.length) {
|
|
@@ -4244,10 +4253,10 @@ var ru = function(e) {
|
|
|
4244
4253
|
return u(y) === "[object Set]";
|
|
4245
4254
|
}
|
|
4246
4255
|
Ie.working = typeof Set < "u" && Ie(/* @__PURE__ */ new Set());
|
|
4247
|
-
function
|
|
4256
|
+
function Ze(y) {
|
|
4248
4257
|
return typeof Set > "u" ? !1 : Ie.working ? Ie(y) : y instanceof Set;
|
|
4249
4258
|
}
|
|
4250
|
-
t.isSet =
|
|
4259
|
+
t.isSet = Ze;
|
|
4251
4260
|
function De(y) {
|
|
4252
4261
|
return u(y) === "[object WeakMap]";
|
|
4253
4262
|
}
|
|
@@ -4645,7 +4654,7 @@ var uu = br.exports;
|
|
|
4645
4654
|
function Ie(l) {
|
|
4646
4655
|
return Object.prototype.toString.call(l);
|
|
4647
4656
|
}
|
|
4648
|
-
function
|
|
4657
|
+
function Ze(l) {
|
|
4649
4658
|
return l < 10 ? "0" + l.toString(10) : l.toString(10);
|
|
4650
4659
|
}
|
|
4651
4660
|
var De = [
|
|
@@ -4664,9 +4673,9 @@ var uu = br.exports;
|
|
|
4664
4673
|
];
|
|
4665
4674
|
function qt() {
|
|
4666
4675
|
var l = /* @__PURE__ */ new Date(), h = [
|
|
4667
|
-
|
|
4668
|
-
|
|
4669
|
-
|
|
4676
|
+
Ze(l.getHours()),
|
|
4677
|
+
Ze(l.getMinutes()),
|
|
4678
|
+
Ze(l.getSeconds())
|
|
4670
4679
|
].join(":");
|
|
4671
4680
|
return [l.getDate(), De[l.getMonth()], h].join(" ");
|
|
4672
4681
|
}
|
|
@@ -5184,11 +5193,11 @@ function Au() {
|
|
|
5184
5193
|
t.resolve = e, t.reject = r;
|
|
5185
5194
|
}), t;
|
|
5186
5195
|
}
|
|
5187
|
-
function
|
|
5196
|
+
function Xe(t, e, r, n, i) {
|
|
5188
5197
|
this.started = !1, this.func = e, this.opts = r, this.onFinish = null, this.parent = t, this.timeout = i === void 0 ? t._timeout : i, this.name = wu(e, r), this.isAfter = n, this.q = gu(t, Eu, 1), this.q.pause(), this._error = null, this.loaded = !1, this._promise = null;
|
|
5189
5198
|
}
|
|
5190
|
-
vu(
|
|
5191
|
-
|
|
5199
|
+
vu(Xe, bu);
|
|
5200
|
+
Xe.prototype.exec = function(t, e) {
|
|
5192
5201
|
const r = this.func;
|
|
5193
5202
|
let n = !1;
|
|
5194
5203
|
const i = this.name;
|
|
@@ -5224,7 +5233,7 @@ Ye.prototype.exec = function(t, e) {
|
|
|
5224
5233
|
(u) => E.nextTick(s, u)
|
|
5225
5234
|
));
|
|
5226
5235
|
};
|
|
5227
|
-
|
|
5236
|
+
Xe.prototype.loadedSoFar = function() {
|
|
5228
5237
|
if (this.loaded)
|
|
5229
5238
|
return Promise.resolve();
|
|
5230
5239
|
const t = () => {
|
|
@@ -5235,10 +5244,10 @@ Ye.prototype.loadedSoFar = function() {
|
|
|
5235
5244
|
let e;
|
|
5236
5245
|
return this._promise ? e = Promise.resolve() : (this._promise = Au(), e = this._promise.promise, this.server ? t() : this.on("start", t)), e;
|
|
5237
5246
|
};
|
|
5238
|
-
|
|
5247
|
+
Xe.prototype.enqueue = function(t, e) {
|
|
5239
5248
|
x("enqueue", this.name, t.name), this.emit("enqueue", this.server ? this.server.name : null, this.name, Date.now()), this.q.push(t, e);
|
|
5240
5249
|
};
|
|
5241
|
-
|
|
5250
|
+
Xe.prototype.finish = function(t, e) {
|
|
5242
5251
|
x("finish", this.name, t);
|
|
5243
5252
|
const r = () => {
|
|
5244
5253
|
this.loaded || (x("loaded", this.name), this.emit("loaded", this.server ? this.server.name : null, this.name, Date.now()), this.loaded = !0, e(t));
|
|
@@ -5283,16 +5292,16 @@ function Vr(t, e) {
|
|
|
5283
5292
|
}
|
|
5284
5293
|
function Iu() {
|
|
5285
5294
|
}
|
|
5286
|
-
Rr.exports =
|
|
5295
|
+
Rr.exports = Xe;
|
|
5287
5296
|
Rr.exports.loadPlugin = Vr;
|
|
5288
5297
|
var Ou = Rr.exports;
|
|
5289
5298
|
const _n = Qn, Tu = Zn.EventEmitter, _u = Rt.inherits, {
|
|
5290
5299
|
AVV_ERR_EXPOSE_ALREADY_DEFINED: rr,
|
|
5291
|
-
AVV_ERR_CALLBACK_NOT_FN:
|
|
5300
|
+
AVV_ERR_CALLBACK_NOT_FN: nt,
|
|
5292
5301
|
AVV_ERR_PLUGIN_NOT_VALID: ku,
|
|
5293
5302
|
AVV_ERR_ROOT_PLG_BOOTED: Pu,
|
|
5294
5303
|
AVV_ERR_READY_TIMEOUT: Cu
|
|
5295
|
-
} = mi, Lu = pu, Sr = Ou,
|
|
5304
|
+
} = mi, Lu = pu, Sr = Ou, Ye = gi("avvio"), Ct = Symbol("kAvvio"), nr = Symbol("kThenifyDoNotWrap");
|
|
5296
5305
|
function Nu(t, e, r) {
|
|
5297
5306
|
const n = e.expose || {}, i = n.use || "use", o = n.after || "after", s = n.ready || "ready", a = n.onClose || "onClose", u = n.close || "close";
|
|
5298
5307
|
if (t[i])
|
|
@@ -5307,15 +5316,15 @@ function Nu(t, e, r) {
|
|
|
5307
5316
|
return typeof d != "function" ? r._loadRegistered() : (r.after(ir(d, this)), this);
|
|
5308
5317
|
}, t[s] = function(d) {
|
|
5309
5318
|
if (d && typeof d != "function")
|
|
5310
|
-
throw new
|
|
5319
|
+
throw new nt(s, typeof d);
|
|
5311
5320
|
return r.ready(d ? ir(d, this) : void 0);
|
|
5312
5321
|
}, t[a] = function(d) {
|
|
5313
5322
|
if (typeof d != "function")
|
|
5314
|
-
throw new
|
|
5323
|
+
throw new nt(a, typeof d);
|
|
5315
5324
|
return r.onClose($u(d, this)), this;
|
|
5316
5325
|
}, t[u] = function(d) {
|
|
5317
5326
|
if (d && typeof d != "function")
|
|
5318
|
-
throw new
|
|
5327
|
+
throw new nt(u, typeof d);
|
|
5319
5328
|
return d ? (r.close(ir(d, this)), this) : r.close();
|
|
5320
5329
|
};
|
|
5321
5330
|
}
|
|
@@ -5334,7 +5343,7 @@ function z(t, e, r) {
|
|
|
5334
5343
|
this.pluginTree.stop(s, d);
|
|
5335
5344
|
});
|
|
5336
5345
|
}), Sr.loadPlugin.call(this, this._root, (n) => {
|
|
5337
|
-
|
|
5346
|
+
Ye("root plugin ready");
|
|
5338
5347
|
try {
|
|
5339
5348
|
this.emit("preReady"), this._root = null;
|
|
5340
5349
|
} catch (i) {
|
|
@@ -5409,7 +5418,7 @@ z.prototype.close = function(t) {
|
|
|
5409
5418
|
let e;
|
|
5410
5419
|
if (t) {
|
|
5411
5420
|
if (typeof t != "function")
|
|
5412
|
-
throw new
|
|
5421
|
+
throw new nt("close", typeof t);
|
|
5413
5422
|
} else
|
|
5414
5423
|
e = new Promise(function(r, n) {
|
|
5415
5424
|
t = function(i) {
|
|
@@ -5425,7 +5434,7 @@ z.prototype.close = function(t) {
|
|
|
5425
5434
|
z.prototype.ready = function(t) {
|
|
5426
5435
|
if (t) {
|
|
5427
5436
|
if (typeof t != "function")
|
|
5428
|
-
throw new
|
|
5437
|
+
throw new nt("ready", typeof t);
|
|
5429
5438
|
this._readyQ.push(t), queueMicrotask(this.start.bind(this));
|
|
5430
5439
|
return;
|
|
5431
5440
|
}
|
|
@@ -5447,14 +5456,14 @@ function kn() {
|
|
|
5447
5456
|
}
|
|
5448
5457
|
function bi() {
|
|
5449
5458
|
if (this.booted) {
|
|
5450
|
-
|
|
5459
|
+
Ye("thenify returning null because we are already booted");
|
|
5451
5460
|
return;
|
|
5452
5461
|
}
|
|
5453
5462
|
if (this[nr]) {
|
|
5454
5463
|
this[nr] = !1;
|
|
5455
5464
|
return;
|
|
5456
5465
|
}
|
|
5457
|
-
return
|
|
5466
|
+
return Ye("thenify"), (t, e) => this._loadRegistered().then(() => (this[nr] = !0, t(this._server)), e);
|
|
5458
5467
|
}
|
|
5459
5468
|
function vi(t, e) {
|
|
5460
5469
|
const r = this._server, n = this._error;
|
|
@@ -5473,9 +5482,9 @@ function vi(t, e) {
|
|
|
5473
5482
|
}
|
|
5474
5483
|
function Ru(t, e, r, n) {
|
|
5475
5484
|
const i = t.name;
|
|
5476
|
-
|
|
5485
|
+
Ye("setting up ready timeout", i, this._timeout);
|
|
5477
5486
|
let o = setTimeout(() => {
|
|
5478
|
-
|
|
5487
|
+
Ye("timed out", i), o = null;
|
|
5479
5488
|
const a = new Cu(i);
|
|
5480
5489
|
a.fn = t, this._error = a, n(a);
|
|
5481
5490
|
}, this._timeout);
|
|
@@ -5488,7 +5497,7 @@ function Vu(t, e) {
|
|
|
5488
5497
|
const r = this._server, n = t[this._isOnCloseHandlerKey];
|
|
5489
5498
|
if (t.length === 0 || t.length === 1) {
|
|
5490
5499
|
let i;
|
|
5491
|
-
n ? i = t(r) : i = t(this._error), i && typeof i.then == "function" ? (
|
|
5500
|
+
n ? i = t(r) : i = t(this._error), i && typeof i.then == "function" ? (Ye("resolving close/onClose promise"), i.then(
|
|
5492
5501
|
() => E.nextTick(e),
|
|
5493
5502
|
(o) => E.nextTick(e, o)
|
|
5494
5503
|
)) : E.nextTick(e);
|
package/package.json
CHANGED
|
@@ -24,18 +24,18 @@
|
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"avvio": "=8.2.1",
|
|
26
26
|
"tslib": "^2.7.0",
|
|
27
|
-
"@streamlayer/feature-gamification": "^1.16.
|
|
28
|
-
"@streamlayer/sdk-web-analytics": "^1.7.
|
|
29
|
-
"@streamlayer/sdk-web-api": "^1.8.
|
|
30
|
-
"@streamlayer/sdk-web-core": "^1.11.
|
|
31
|
-
"@streamlayer/sdk-web-features": "^1.0.
|
|
32
|
-
"@streamlayer/sdk-web-interfaces": "^1.4.
|
|
33
|
-
"@streamlayer/sdk-web-logger": "^1.0.
|
|
34
|
-
"@streamlayer/sdk-web-notifications": "^1.3.
|
|
35
|
-
"@streamlayer/sdk-web-storage": "^1.0.
|
|
36
|
-
"@streamlayer/sdk-web-types": "^1.10.
|
|
27
|
+
"@streamlayer/feature-gamification": "^1.16.1",
|
|
28
|
+
"@streamlayer/sdk-web-analytics": "^1.7.1",
|
|
29
|
+
"@streamlayer/sdk-web-api": "^1.8.1",
|
|
30
|
+
"@streamlayer/sdk-web-core": "^1.11.3",
|
|
31
|
+
"@streamlayer/sdk-web-features": "^1.0.48",
|
|
32
|
+
"@streamlayer/sdk-web-interfaces": "^1.4.14",
|
|
33
|
+
"@streamlayer/sdk-web-logger": "^1.0.48",
|
|
34
|
+
"@streamlayer/sdk-web-notifications": "^1.3.10",
|
|
35
|
+
"@streamlayer/sdk-web-storage": "^1.0.48",
|
|
36
|
+
"@streamlayer/sdk-web-types": "^1.10.5"
|
|
37
37
|
},
|
|
38
|
-
"version": "1.10.
|
|
38
|
+
"version": "1.10.1",
|
|
39
39
|
"type": "module",
|
|
40
40
|
"main": "./src/index.js",
|
|
41
41
|
"typings": "./src/index.d.ts"
|