@streamlayer/react 1.20.6 → 1.21.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/app/pause-ad.d.ts +1 -1
- package/lib/cjs/advertisement.js +29 -29
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/index2.js +4 -4
- package/lib/cjs/insight.js +1 -1
- package/lib/cjs/masters2.js +7 -7
- package/lib/cjs/notification.js +1 -1
- package/lib/cjs/pause-ad.js +1 -1
- package/lib/cjs/points.js +1 -1
- package/lib/cjs/provider.js +15 -39
- package/lib/cjs/useStreamLayerApp2.js +14 -15
- package/lib/classic/app/pause-ad.d.ts +1 -1
- package/lib/classic/cjs/advertisement.js +29 -29
- package/lib/classic/cjs/bet-pack.js +4 -4
- package/lib/classic/cjs/index.js +1 -1
- package/lib/classic/cjs/insight.js +1 -1
- package/lib/classic/cjs/notification.js +1 -1
- package/lib/classic/cjs/pause-ad.js +1 -1
- package/lib/classic/cjs/points.js +1 -1
- package/lib/classic/cjs/provider.js +10 -34
- package/lib/classic/cjs/useStreamLayerApp2.js +14 -15
- package/lib/classic/es/advertisement.js +2193 -2265
- package/lib/classic/es/bet-pack.js +14 -12
- package/lib/classic/es/index.js +16 -11
- package/lib/classic/es/insight.js +35 -30
- package/lib/classic/es/notification.js +108 -103
- package/lib/classic/es/pause-ad.js +196 -148
- package/lib/classic/es/points.js +28 -23
- package/lib/classic/es/provider.js +4290 -10434
- package/lib/classic/es/useStreamLayerApp.js +1 -1
- package/lib/classic/es/useStreamLayerApp2.js +3249 -5821
- package/lib/classic/index.d.ts +1 -1
- package/lib/classic/masters.d.ts +1 -1
- package/lib/dist/cjs/gamification-feature2.js +1 -1
- package/lib/dist/cjs/index.js +1 -1
- package/lib/dist/cjs/masters.js +35 -60
- package/lib/dist/es/gamification-feature2.js +112 -105
- package/lib/dist/es/index.js +12 -7
- package/lib/dist/es/masters.js +9837 -18573
- package/lib/dist/style.css +1 -1
- package/lib/es/advertisement.js +2193 -2265
- package/lib/es/index.js +16 -11
- package/lib/es/index2.js +12 -10
- package/lib/es/insight.js +35 -30
- package/lib/es/masters2.js +28 -25
- package/lib/es/notification.js +135 -130
- package/lib/es/pause-ad.js +196 -148
- package/lib/es/points.js +28 -23
- package/lib/es/provider.js +4317 -10469
- package/lib/es/useStreamLayerApp.js +1 -1
- package/lib/es/useStreamLayerApp2.js +3249 -5821
- package/lib/index.d.ts +1 -1
- package/lib/masters.d.ts +1 -1
- package/lib/style.css +1 -1
- package/package.json +15 -15
|
@@ -1,7 +1,12 @@
|
|
|
1
|
-
import { s as n, B as A, D as As, t as Is, x as _, v as K, w as hs, E as $s, O as x, y as gs, d as ws, a as ys, e as Ts, N as O, u as bs, b as Cs, r as fs, h as ks } from "./provider.js";
|
|
2
1
|
import { jsxs as l, jsx as s } from "react/jsx-runtime";
|
|
3
|
-
import { useState as w, useRef as
|
|
4
|
-
import
|
|
2
|
+
import { useState as w, useRef as _, useEffect as y, useCallback as As, useMemo as hs } from "react";
|
|
3
|
+
import "@nanostores/react";
|
|
4
|
+
import "nanostores";
|
|
5
|
+
import { s as n, B as A, D as Is, v as $s, x as K, w as G, z as gs, E as ws, O as x, y as ys, f as Ts, e as bs, i as Cs, N as O, u as fs, d as ks, c as Ns, h as qs } from "./provider.js";
|
|
6
|
+
import "lodash.throttle";
|
|
7
|
+
import "react-dom";
|
|
8
|
+
import "react-countup";
|
|
9
|
+
import { Q as v, h as I, i as H, j as L, S as Es, A as R } from "./useStreamLayerApp2.js";
|
|
5
10
|
const b = /* @__PURE__ */ n("div")({
|
|
6
11
|
name: "Media",
|
|
7
12
|
class: "m1bcvojl",
|
|
@@ -22,7 +27,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
22
27
|
name: "MediaImgCentered",
|
|
23
28
|
class: "m1bwv0gx",
|
|
24
29
|
propsAsIs: !0
|
|
25
|
-
}),
|
|
30
|
+
}), js = () => b, Bs = /* @__PURE__ */ n(js())({
|
|
26
31
|
name: "MediaImgInsight",
|
|
27
32
|
class: "mntjanp",
|
|
28
33
|
propsAsIs: !0
|
|
@@ -30,14 +35,14 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
30
35
|
name: "VideoIcon",
|
|
31
36
|
class: "v1kofb47",
|
|
32
37
|
propsAsIs: !1
|
|
33
|
-
}),
|
|
38
|
+
}), zs = {
|
|
34
39
|
[v.UNSET]: E,
|
|
35
40
|
[v.NONE]: E,
|
|
36
41
|
[v.ROUNDED]: Ms,
|
|
37
42
|
[v.CENTERED]: Rs,
|
|
38
43
|
[v.TRANSPARENT]: Ss,
|
|
39
44
|
[v.SOLID]: E
|
|
40
|
-
},
|
|
45
|
+
}, j = ({
|
|
41
46
|
src: e,
|
|
42
47
|
imageMode: i = v.UNSET,
|
|
43
48
|
withVideo: t,
|
|
@@ -45,7 +50,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
45
50
|
}) => {
|
|
46
51
|
if (i === v.NONE)
|
|
47
52
|
return null;
|
|
48
|
-
const a = o ?
|
|
53
|
+
const a = o ? Bs : zs[i];
|
|
49
54
|
return /* @__PURE__ */ l(a, {
|
|
50
55
|
children: [/* @__PURE__ */ s("img", {
|
|
51
56
|
src: e,
|
|
@@ -56,7 +61,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
56
61
|
})
|
|
57
62
|
})]
|
|
58
63
|
});
|
|
59
|
-
},
|
|
64
|
+
}, Us = /* @__PURE__ */ n("div")({
|
|
60
65
|
name: "NotificationContent",
|
|
61
66
|
class: "nuraq9m",
|
|
62
67
|
propsAsIs: !1
|
|
@@ -101,7 +106,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
101
106
|
return /* @__PURE__ */ l(Hs, { children: [
|
|
102
107
|
p && /* @__PURE__ */ s(_s, { children: /* @__PURE__ */ s(Ks, { children: p }) }),
|
|
103
108
|
/* @__PURE__ */ s(
|
|
104
|
-
|
|
109
|
+
Is,
|
|
105
110
|
{
|
|
106
111
|
image: e,
|
|
107
112
|
name: (d = i == null ? void 0 : i.meta) == null ? void 0 : d.accountName,
|
|
@@ -110,11 +115,11 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
110
115
|
createdTweet: i == null ? void 0 : i.date
|
|
111
116
|
}
|
|
112
117
|
),
|
|
113
|
-
/* @__PURE__ */ s(Gs, { children:
|
|
118
|
+
/* @__PURE__ */ s(Gs, { children: $s(a) })
|
|
114
119
|
] });
|
|
115
120
|
}, Xs = ({ title: e, questionType: i, questionTypeData: t }) => /* @__PURE__ */ l(J, { children: [
|
|
116
121
|
/* @__PURE__ */ s(
|
|
117
|
-
|
|
122
|
+
K,
|
|
118
123
|
{
|
|
119
124
|
questionTypeData: t,
|
|
120
125
|
questionType: i,
|
|
@@ -125,23 +130,23 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
125
130
|
] }), Zs = ({ tweet: e }) => e ? /* @__PURE__ */ s(J, { children: /* @__PURE__ */ s(Js, { ...e, controlVideo: () => {
|
|
126
131
|
} }) }) : null, se = ({ action: e, questionType: i, inApp: t, insight: o, tweet: a }) => {
|
|
127
132
|
var p;
|
|
128
|
-
const d =
|
|
133
|
+
const d = G[i], r = gs[i];
|
|
129
134
|
if (!d || !t || !t.notification)
|
|
130
135
|
return null;
|
|
131
|
-
const { title:
|
|
132
|
-
let
|
|
133
|
-
i ===
|
|
134
|
-
const g = t.useMediaFromContent && (o == null ? void 0 : o.image), c = i ===
|
|
135
|
-
return /* @__PURE__ */ s(Vs, { "data-a": "intr", className: "SL_InApp", onClick: e, children: /* @__PURE__ */ l(
|
|
136
|
-
|
|
137
|
-
g && /* @__PURE__ */ s(
|
|
138
|
-
i ===
|
|
136
|
+
const { title: m, image: u, imageMode: $ } = t.notification;
|
|
137
|
+
let h = u;
|
|
138
|
+
i === I.TWEET && a != null && a.tweetMedia && (h = a.tweetMedia.image), $ === v.NONE && (h = "");
|
|
139
|
+
const g = t.useMediaFromContent && (o == null ? void 0 : o.image), c = i === I.TWEET && ((p = a == null ? void 0 : a.tweetMedia) == null ? void 0 : p.video) || i === I.FACTOID && (o == null ? void 0 : o.video);
|
|
140
|
+
return /* @__PURE__ */ s(Vs, { "data-a": "intr", className: "SL_InApp", onClick: e, children: /* @__PURE__ */ l(Us, { style: h ? {} : { paddingLeft: "1.5rem" }, children: [
|
|
141
|
+
h && !g && /* @__PURE__ */ s(j, { src: h, imageMode: $, withVideo: !!c }),
|
|
142
|
+
g && /* @__PURE__ */ s(j, { src: g, fromInsight: !0, withVideo: !!c }),
|
|
143
|
+
i === I.TWEET ? /* @__PURE__ */ s(Zs, { tweet: a }) : /* @__PURE__ */ s(Xs, { questionTypeData: d, questionType: i, title: m }),
|
|
139
144
|
/* @__PURE__ */ s(Qs, { name: "inapp-button", children: r || "Open" }),
|
|
140
145
|
/* @__PURE__ */ s(Ys, { name: "chevronRight" })
|
|
141
146
|
] }) });
|
|
142
147
|
}, ee = () => ({
|
|
143
148
|
color: e
|
|
144
|
-
}) => e,
|
|
149
|
+
}) => e, B = /* @__PURE__ */ n("div")({
|
|
145
150
|
name: "MediaComponentWrap",
|
|
146
151
|
class: "mek728j",
|
|
147
152
|
propsAsIs: !1,
|
|
@@ -172,7 +177,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
172
177
|
name: "MediaImgRounded",
|
|
173
178
|
class: "mc7lij",
|
|
174
179
|
propsAsIs: !0
|
|
175
|
-
}),
|
|
180
|
+
}), me = () => T, ue = /* @__PURE__ */ n(me())({
|
|
176
181
|
name: "MediaImgCentered",
|
|
177
182
|
class: "mwwaw7o",
|
|
178
183
|
propsAsIs: !0
|
|
@@ -180,11 +185,11 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
180
185
|
name: "MediaNone",
|
|
181
186
|
class: "mqfzyyr",
|
|
182
187
|
propsAsIs: !0
|
|
183
|
-
}), Ae = "v170mtgf",
|
|
188
|
+
}), Ae = "v170mtgf", he = {
|
|
184
189
|
[v.UNSET]: S,
|
|
185
190
|
[v.NONE]: S,
|
|
186
191
|
[v.ROUNDED]: pe,
|
|
187
|
-
[v.CENTERED]:
|
|
192
|
+
[v.CENTERED]: ue,
|
|
188
193
|
[v.TRANSPARENT]: oe,
|
|
189
194
|
[v.SOLID]: le
|
|
190
195
|
}, P = ({
|
|
@@ -196,15 +201,15 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
196
201
|
thumbnailUrl: p
|
|
197
202
|
}) => {
|
|
198
203
|
if (!e)
|
|
199
|
-
return /* @__PURE__ */ s(
|
|
204
|
+
return /* @__PURE__ */ s(B, {
|
|
200
205
|
color: o,
|
|
201
206
|
children: /* @__PURE__ */ s(S, {})
|
|
202
207
|
});
|
|
203
|
-
const d = a === L.ENABLED ? re :
|
|
204
|
-
return /* @__PURE__ */ s(
|
|
208
|
+
const d = a === L.ENABLED ? re : he[i];
|
|
209
|
+
return /* @__PURE__ */ s(B, {
|
|
205
210
|
color: o,
|
|
206
211
|
children: t ? /* @__PURE__ */ s(te, {
|
|
207
|
-
children: /* @__PURE__ */ s(
|
|
212
|
+
children: /* @__PURE__ */ s(ws, {
|
|
208
213
|
className: Ae,
|
|
209
214
|
source: e,
|
|
210
215
|
poster: p || ""
|
|
@@ -216,14 +221,14 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
216
221
|
})
|
|
217
222
|
})
|
|
218
223
|
});
|
|
219
|
-
},
|
|
224
|
+
}, Ie = () => ({
|
|
220
225
|
withoutPadding: e
|
|
221
226
|
}) => e ? "0px" : "1rem", X = /* @__PURE__ */ n("div")({
|
|
222
227
|
name: "NotificationContent",
|
|
223
228
|
class: "n1p3bk1c",
|
|
224
229
|
propsAsIs: !1,
|
|
225
230
|
vars: {
|
|
226
|
-
"n1p3bk1c-0": [
|
|
231
|
+
"n1p3bk1c-0": [Ie()]
|
|
227
232
|
}
|
|
228
233
|
}), $e = /* @__PURE__ */ n("div")({
|
|
229
234
|
name: "MainContent",
|
|
@@ -239,7 +244,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
239
244
|
propsAsIs: !1
|
|
240
245
|
}), ye = () => ({
|
|
241
246
|
questionType: e
|
|
242
|
-
}) => e ===
|
|
247
|
+
}) => e === I.FACTOID ? "7.3rem" : "4.5rem", Te = () => ({
|
|
243
248
|
webos: e
|
|
244
249
|
}) => e ? "11px 0px 8px 0px" : "11px 0px", be = () => ({
|
|
245
250
|
imageMode: e,
|
|
@@ -299,13 +304,13 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
299
304
|
name: "DismissButton",
|
|
300
305
|
class: "ds000hw",
|
|
301
306
|
propsAsIs: !0
|
|
302
|
-
}),
|
|
307
|
+
}), je = () => es, Be = /* @__PURE__ */ n(je())({
|
|
303
308
|
name: "AnswerButton",
|
|
304
309
|
class: "a1nz9hoe",
|
|
305
310
|
propsAsIs: !0
|
|
306
311
|
}), Pe = ({ title: e, questionType: i, questionTypeData: t, description: o, imageMode: a, webos: p }) => /* @__PURE__ */ l(Ce, { imageMode: a, questionType: i, webos: p, children: [
|
|
307
312
|
/* @__PURE__ */ s(
|
|
308
|
-
|
|
313
|
+
K,
|
|
309
314
|
{
|
|
310
315
|
questionTypeData: t,
|
|
311
316
|
questionType: i,
|
|
@@ -314,11 +319,11 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
314
319
|
),
|
|
315
320
|
e && /* @__PURE__ */ s(Ee, { webos: p, children: e }),
|
|
316
321
|
o && /* @__PURE__ */ s(Le, { children: o })
|
|
317
|
-
] }),
|
|
322
|
+
] }), ze = x(De), Ue = x(Re), Ve = x(Be), Fe = ({
|
|
318
323
|
sponsorLogo: e,
|
|
319
324
|
onClick: i,
|
|
320
325
|
webos: t
|
|
321
|
-
}) => /* @__PURE__ */ s(
|
|
326
|
+
}) => /* @__PURE__ */ s(ze, { autoFocus: !0, webos: t, onClick: i, "data-webos": t, children: /* @__PURE__ */ s(X, { withoutPadding: !0, children: /* @__PURE__ */ s(ss, { src: e }) }) }), Qe = ({
|
|
322
327
|
action: e,
|
|
323
328
|
close: i,
|
|
324
329
|
questionType: t,
|
|
@@ -327,21 +332,21 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
327
332
|
color: p,
|
|
328
333
|
webos: d
|
|
329
334
|
}) => {
|
|
330
|
-
var r,
|
|
331
|
-
const [$,
|
|
332
|
-
y(() => (o != null && o.sponsorLogo && (
|
|
333
|
-
|
|
335
|
+
var r, m, u;
|
|
336
|
+
const [$, h] = w(!1), g = _();
|
|
337
|
+
y(() => (o != null && o.sponsorLogo && (h(!0), g.current = setTimeout(() => {
|
|
338
|
+
h(!1);
|
|
334
339
|
}, 5e3)), () => clearTimeout(g.current)), [o == null ? void 0 : o.sponsorLogo]);
|
|
335
|
-
const c =
|
|
340
|
+
const c = G[t];
|
|
336
341
|
if (!c || !o || !o.notification)
|
|
337
342
|
return null;
|
|
338
|
-
const { title: ds, image: ps, imageMode: f, useContentMedia: k } = o.notification,
|
|
343
|
+
const { title: ds, image: ps, imageMode: f, useContentMedia: k } = o.notification, ms = t === I.FACTOID ? a == null ? void 0 : a.heading : ds, us = t === I.FACTOID ? a == null ? void 0 : a.body : "", vs = ps, N = t === I.FACTOID && ((r = a == null ? void 0 : a.video) == null ? void 0 : r.url) && (o == null ? void 0 : o.isVideo) && k === L.ENABLED, q = k === L.ENABLED ? N ? (m = a == null ? void 0 : a.video) == null ? void 0 : m.url : a == null ? void 0 : a.image : "";
|
|
339
344
|
return o != null && o.sponsorLogo && $ ? /* @__PURE__ */ s(
|
|
340
345
|
Fe,
|
|
341
346
|
{
|
|
342
347
|
sponsorLogo: o == null ? void 0 : o.sponsorLogo,
|
|
343
348
|
webos: d,
|
|
344
|
-
onClick: () =>
|
|
349
|
+
onClick: () => h(!1)
|
|
345
350
|
}
|
|
346
351
|
) : /* @__PURE__ */ l(
|
|
347
352
|
Z,
|
|
@@ -351,7 +356,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
351
356
|
onClick: (C) => {
|
|
352
357
|
d || e == null || e(C);
|
|
353
358
|
},
|
|
354
|
-
"data-is-insight": t ===
|
|
359
|
+
"data-is-insight": t === I.FACTOID,
|
|
355
360
|
"data-webos": d,
|
|
356
361
|
children: [
|
|
357
362
|
(o == null ? void 0 : o.sponsorLogo) && /* @__PURE__ */ s(Se, { children: /* @__PURE__ */ s(ss, { src: o == null ? void 0 : o.sponsorLogo }) }),
|
|
@@ -366,7 +371,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
366
371
|
withVideo: !!N,
|
|
367
372
|
color: p,
|
|
368
373
|
useContentMedia: k,
|
|
369
|
-
thumbnailUrl: (
|
|
374
|
+
thumbnailUrl: (u = a == null ? void 0 : a.video) == null ? void 0 : u.thumbnailUrl
|
|
370
375
|
}
|
|
371
376
|
),
|
|
372
377
|
/* @__PURE__ */ s(
|
|
@@ -374,8 +379,8 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
374
379
|
{
|
|
375
380
|
questionTypeData: c,
|
|
376
381
|
questionType: t,
|
|
377
|
-
title:
|
|
378
|
-
description:
|
|
382
|
+
title: ms,
|
|
383
|
+
description: us,
|
|
379
384
|
imageMode: f,
|
|
380
385
|
webos: d
|
|
381
386
|
}
|
|
@@ -384,7 +389,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
384
389
|
!d && /* @__PURE__ */ s(we, { name: "chevronRight" }),
|
|
385
390
|
d && /* @__PURE__ */ l(Me, { children: [
|
|
386
391
|
/* @__PURE__ */ s(
|
|
387
|
-
|
|
392
|
+
Ue,
|
|
388
393
|
{
|
|
389
394
|
webos: !0,
|
|
390
395
|
"data-close-btn": "true",
|
|
@@ -404,7 +409,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
404
409
|
name: "NotificationContainer",
|
|
405
410
|
class: "n11jcrxe",
|
|
406
411
|
propsAsIs: !1
|
|
407
|
-
}),
|
|
412
|
+
}), z = /* @__PURE__ */ n("img")({
|
|
408
413
|
name: "Icon",
|
|
409
414
|
class: "i1vmpt6u",
|
|
410
415
|
propsAsIs: !1
|
|
@@ -416,7 +421,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
416
421
|
name: "TitleIcon",
|
|
417
422
|
class: "t16zzzei",
|
|
418
423
|
propsAsIs: !0
|
|
419
|
-
}), Ge = () =>
|
|
424
|
+
}), Ge = () => ys, He = /* @__PURE__ */ n(Ge())({
|
|
420
425
|
name: "Close",
|
|
421
426
|
class: "c1sur0q2",
|
|
422
427
|
propsAsIs: !0
|
|
@@ -451,9 +456,9 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
451
456
|
},
|
|
452
457
|
children: [
|
|
453
458
|
/* @__PURE__ */ l(Ye, { children: [
|
|
454
|
-
/* @__PURE__ */ s(
|
|
459
|
+
/* @__PURE__ */ s(z, { className: "on-light", src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification.png" }),
|
|
455
460
|
/* @__PURE__ */ s(
|
|
456
|
-
|
|
461
|
+
z,
|
|
457
462
|
{
|
|
458
463
|
className: "on-dark",
|
|
459
464
|
src: "https://cdn.streamlayer.io/assets/sdk-web/onboarding-steps/notification-dark.png"
|
|
@@ -509,19 +514,19 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
509
514
|
name: "Subtitle",
|
|
510
515
|
class: "sz7237i",
|
|
511
516
|
propsAsIs: !1
|
|
512
|
-
}),
|
|
517
|
+
}), mn = ({
|
|
513
518
|
step: e,
|
|
514
519
|
children: i,
|
|
515
520
|
answer: t,
|
|
516
521
|
state: o = "pending"
|
|
517
522
|
}) => {
|
|
518
|
-
const [a, p] = w(0), [d] = w(() => new ResizeObserver((
|
|
523
|
+
const [a, p] = w(0), [d] = w(() => new ResizeObserver((m) => {
|
|
519
524
|
window.requestAnimationFrame(() => {
|
|
520
|
-
var
|
|
521
|
-
p((($ = (
|
|
525
|
+
var u, $;
|
|
526
|
+
p((($ = (u = m == null ? void 0 : m[0]) == null ? void 0 : u.contentRect) == null ? void 0 : $.width) ?? 0);
|
|
522
527
|
});
|
|
523
|
-
})), r =
|
|
524
|
-
|
|
528
|
+
})), r = As((m) => {
|
|
529
|
+
m ? d.observe(m) : d.disconnect();
|
|
525
530
|
}, [d]);
|
|
526
531
|
return y(() => () => {
|
|
527
532
|
d.disconnect();
|
|
@@ -547,7 +552,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
547
552
|
})
|
|
548
553
|
})]
|
|
549
554
|
});
|
|
550
|
-
},
|
|
555
|
+
}, un = /* @__PURE__ */ n("div")({
|
|
551
556
|
name: "Container",
|
|
552
557
|
class: "ckyzolp",
|
|
553
558
|
propsAsIs: !1
|
|
@@ -559,7 +564,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
559
564
|
name: "Line1",
|
|
560
565
|
class: "le78kvg",
|
|
561
566
|
propsAsIs: !0
|
|
562
|
-
}),
|
|
567
|
+
}), hn = () => D, In = /* @__PURE__ */ n(hn())({
|
|
563
568
|
name: "Line2",
|
|
564
569
|
class: "l1o7966d",
|
|
565
570
|
propsAsIs: !0
|
|
@@ -567,10 +572,10 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
567
572
|
name: "Line3",
|
|
568
573
|
class: "lu9lyxq",
|
|
569
574
|
propsAsIs: !0
|
|
570
|
-
}), wn = () => /* @__PURE__ */ l(
|
|
575
|
+
}), wn = () => /* @__PURE__ */ l(un, {
|
|
571
576
|
children: [/* @__PURE__ */ s(An, {
|
|
572
577
|
children: /* @__PURE__ */ s("div", {})
|
|
573
|
-
}), /* @__PURE__ */ s(
|
|
578
|
+
}), /* @__PURE__ */ s(In, {
|
|
574
579
|
children: /* @__PURE__ */ s("div", {})
|
|
575
580
|
}), /* @__PURE__ */ s(gn, {
|
|
576
581
|
children: /* @__PURE__ */ s("div", {})
|
|
@@ -645,24 +650,24 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
645
650
|
name: "Title",
|
|
646
651
|
class: "t903f8n",
|
|
647
652
|
propsAsIs: !1
|
|
648
|
-
}), Rn = () => A,
|
|
653
|
+
}), Rn = () => A, jn = /* @__PURE__ */ n(Rn())({
|
|
649
654
|
name: "CheckIcon",
|
|
650
655
|
class: "ceyu3qj",
|
|
651
656
|
propsAsIs: !0
|
|
652
|
-
}),
|
|
657
|
+
}), Bn = ({
|
|
653
658
|
points: e
|
|
654
659
|
}) => /* @__PURE__ */ l(Mn, {
|
|
655
660
|
children: [/* @__PURE__ */ l(On, {
|
|
656
|
-
children: ["You won ", /* @__PURE__ */ s(
|
|
661
|
+
children: ["You won ", /* @__PURE__ */ s(Ts, {
|
|
657
662
|
delay: 0.5,
|
|
658
663
|
prefix: "+",
|
|
659
664
|
suffix: " points",
|
|
660
665
|
value: e
|
|
661
666
|
})]
|
|
662
|
-
}), /* @__PURE__ */ s(
|
|
667
|
+
}), /* @__PURE__ */ s(jn, {
|
|
663
668
|
name: "icon-trophy-solid"
|
|
664
669
|
})]
|
|
665
|
-
}),
|
|
670
|
+
}), U = /* @__PURE__ */ n("div")({
|
|
666
671
|
name: "Container",
|
|
667
672
|
class: "cq3agu2",
|
|
668
673
|
propsAsIs: !1
|
|
@@ -678,28 +683,28 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
678
683
|
}, Pn = ({ close: e, action: i, setStep: t, votedAnswer: o, correct: a, correctAnswerTitle: p, questionTitle: d, step: r }) => {
|
|
679
684
|
if (y(() => {
|
|
680
685
|
if (t) {
|
|
681
|
-
const
|
|
686
|
+
const u = setTimeout(() => {
|
|
682
687
|
F[r + 1] && (a || r < 3) ? t(r + 1) : e == null || e();
|
|
683
688
|
}, F[r]);
|
|
684
689
|
return () => {
|
|
685
|
-
|
|
690
|
+
u && clearTimeout(u);
|
|
686
691
|
};
|
|
687
692
|
}
|
|
688
693
|
return () => {
|
|
689
694
|
};
|
|
690
695
|
}, [t, r, e, a]), r === 1)
|
|
691
|
-
return /* @__PURE__ */ s(
|
|
692
|
-
let
|
|
693
|
-
return (r === 3 || r === 4) && (
|
|
696
|
+
return /* @__PURE__ */ s(U, { children: /* @__PURE__ */ s(V, { children: /* @__PURE__ */ s(Cn, {}) }) });
|
|
697
|
+
let m = "pending";
|
|
698
|
+
return (r === 3 || r === 4) && (m = a ? "correct" : "incorrect"), /* @__PURE__ */ s(U, { "data-a": "intr", onClick: () => i == null ? void 0 : i(), children: /* @__PURE__ */ l(V, { children: [
|
|
694
699
|
r !== 1 && /* @__PURE__ */ s(wn, {}, r),
|
|
695
|
-
/* @__PURE__ */ l(
|
|
700
|
+
/* @__PURE__ */ l(mn, { state: m, step: r, answer: (o == null ? void 0 : o.title) || "unknown", children: [
|
|
696
701
|
r === 2 && /* @__PURE__ */ s(qn, { title: d || "unknown" }),
|
|
697
702
|
r === 3 && a && /* @__PURE__ */ s(xn, {}),
|
|
698
703
|
r === 3 && !a && /* @__PURE__ */ s(Dn, { title: p || "unknown" }),
|
|
699
|
-
r === 4 && /* @__PURE__ */ s(
|
|
704
|
+
r === 4 && /* @__PURE__ */ s(Bn, { points: (o == null ? void 0 : o.points) || 0 })
|
|
700
705
|
] })
|
|
701
706
|
] }) });
|
|
702
|
-
},
|
|
707
|
+
}, zn = ({ close: e, action: i, votedAnswer: t, correct: o, correctAnswerTitle: a, questionTitle: p }) => {
|
|
703
708
|
const [d, r] = w(1);
|
|
704
709
|
return /* @__PURE__ */ s(
|
|
705
710
|
Pn,
|
|
@@ -715,11 +720,11 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
715
720
|
title: ""
|
|
716
721
|
}
|
|
717
722
|
);
|
|
718
|
-
},
|
|
723
|
+
}, Un = /* @__PURE__ */ n("div")({
|
|
719
724
|
name: "NotificationContainer",
|
|
720
725
|
class: "n1i4h28u",
|
|
721
726
|
propsAsIs: !1
|
|
722
|
-
}), Vn = (e) => /* @__PURE__ */ s(
|
|
727
|
+
}), Vn = (e) => /* @__PURE__ */ s(Un, { children: /* @__PURE__ */ s(zn, { ...e }) }), Fn = /* @__PURE__ */ n("div")({
|
|
723
728
|
name: "Container",
|
|
724
729
|
class: "cwa9tgs",
|
|
725
730
|
propsAsIs: !1
|
|
@@ -740,9 +745,9 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
740
745
|
return y(() => {
|
|
741
746
|
const p = new ResizeObserver((d) => {
|
|
742
747
|
window.requestAnimationFrame(() => {
|
|
743
|
-
var r,
|
|
744
|
-
const
|
|
745
|
-
a(
|
|
748
|
+
var r, m;
|
|
749
|
+
const u = ((m = (r = d == null ? void 0 : d[0]) == null ? void 0 : r.contentRect) == null ? void 0 : m.width) ?? 0;
|
|
750
|
+
a(u);
|
|
746
751
|
});
|
|
747
752
|
});
|
|
748
753
|
return () => {
|
|
@@ -836,7 +841,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
836
841
|
name: "Title",
|
|
837
842
|
class: "tv66n4w",
|
|
838
843
|
propsAsIs: !1
|
|
839
|
-
}),
|
|
844
|
+
}), mo = () => A, uo = /* @__PURE__ */ n(mo())({
|
|
840
845
|
name: "CorrectIcon",
|
|
841
846
|
class: "cx0vlv2",
|
|
842
847
|
propsAsIs: !0
|
|
@@ -850,7 +855,7 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
850
855
|
children: [/* @__PURE__ */ s(as, {
|
|
851
856
|
children: "Congratulations! You answered correctly."
|
|
852
857
|
}), /* @__PURE__ */ l(rs, {
|
|
853
|
-
children: [/* @__PURE__ */ s(
|
|
858
|
+
children: [/* @__PURE__ */ s(uo, {
|
|
854
859
|
name: "icon-correct"
|
|
855
860
|
}), "Your Pick: ", e]
|
|
856
861
|
})]
|
|
@@ -875,33 +880,33 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
875
880
|
1: 3e3,
|
|
876
881
|
2: 4e3,
|
|
877
882
|
3: 4e3
|
|
878
|
-
},
|
|
883
|
+
}, ho = ({ close: e, action: i, setStep: t, votedAnswer: o, correct: a, correctAnswerTitle: p, questionTitle: d, step: r }) => {
|
|
879
884
|
if (y(() => {
|
|
880
885
|
if (t) {
|
|
881
|
-
const
|
|
886
|
+
const u = setTimeout(() => {
|
|
882
887
|
Y[r + 1] && (a || r < 3) ? t(r + 1) : e == null || e();
|
|
883
888
|
}, Y[r]);
|
|
884
889
|
return () => {
|
|
885
|
-
|
|
890
|
+
u && clearTimeout(u);
|
|
886
891
|
};
|
|
887
892
|
}
|
|
888
893
|
return () => {
|
|
889
894
|
};
|
|
890
895
|
}, [t, r, e, a]), r === 1)
|
|
891
896
|
return /* @__PURE__ */ s(Q, { children: /* @__PURE__ */ s(W, { children: /* @__PURE__ */ s(io, {}) }) });
|
|
892
|
-
let
|
|
893
|
-
return r === 3 && (
|
|
897
|
+
let m = "pending";
|
|
898
|
+
return r === 3 && (m = a ? "correct" : "incorrect"), /* @__PURE__ */ s(Q, { "data-a": "intr", onClick: () => i == null ? void 0 : i(), children: /* @__PURE__ */ l(W, { children: [
|
|
894
899
|
r !== 1 && /* @__PURE__ */ s(so, {}, r),
|
|
895
|
-
/* @__PURE__ */ l(Yn, { state:
|
|
900
|
+
/* @__PURE__ */ l(Yn, { state: m, step: r, children: [
|
|
896
901
|
r === 2 && /* @__PURE__ */ s(po, { title: d || "unknown", answer: (o == null ? void 0 : o.title) || "unknown" }),
|
|
897
902
|
r === 3 && a && /* @__PURE__ */ s(vo, { answer: (o == null ? void 0 : o.title) || "unknown" }),
|
|
898
903
|
r === 3 && !a && /* @__PURE__ */ s(Ao, { title: p || "unknown", answer: (o == null ? void 0 : o.title) || "unknown" })
|
|
899
904
|
] })
|
|
900
905
|
] }) });
|
|
901
|
-
},
|
|
906
|
+
}, Io = ({ close: e, action: i, votedAnswer: t, correct: o, correctAnswerTitle: a, questionTitle: p }) => {
|
|
902
907
|
const [d, r] = w(1);
|
|
903
908
|
return /* @__PURE__ */ s(
|
|
904
|
-
|
|
909
|
+
ho,
|
|
905
910
|
{
|
|
906
911
|
close: e,
|
|
907
912
|
action: i,
|
|
@@ -941,28 +946,28 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
941
946
|
propsAsIs: !1
|
|
942
947
|
}), bo = ({ sponsorLogo: e, onClick: i }) => /* @__PURE__ */ s(yo, { onClick: i, children: /* @__PURE__ */ s(go, { withoutPadding: !0, children: /* @__PURE__ */ s(ls, { src: e }) }) }), Co = (e) => {
|
|
943
948
|
var i, t, o, a, p;
|
|
944
|
-
const [d, r] = w(!1),
|
|
949
|
+
const [d, r] = w(!1), m = _();
|
|
945
950
|
return y(() => {
|
|
946
|
-
var
|
|
947
|
-
return (
|
|
951
|
+
var u;
|
|
952
|
+
return (u = e == null ? void 0 : e.inApp) != null && u.sponsorLogo && (r(!0), m.current = setTimeout(() => {
|
|
948
953
|
r(!1);
|
|
949
|
-
}, 5e3)), () => clearTimeout(
|
|
954
|
+
}, 5e3)), () => clearTimeout(m.current);
|
|
950
955
|
}, [(i = e == null ? void 0 : e.inApp) == null ? void 0 : i.sponsorLogo]), (t = e == null ? void 0 : e.inApp) != null && t.sponsorLogo && d ? /* @__PURE__ */ s(bo, { sponsorLogo: (o = e.inApp) == null ? void 0 : o.sponsorLogo, onClick: () => r(!1) }) : /* @__PURE__ */ s(cs, { children: /* @__PURE__ */ l("div", { children: [
|
|
951
956
|
((a = e == null ? void 0 : e.inApp) == null ? void 0 : a.sponsorLogo) && /* @__PURE__ */ s(To, { children: /* @__PURE__ */ s(ls, { src: (p = e == null ? void 0 : e.inApp) == null ? void 0 : p.sponsorLogo }) }),
|
|
952
|
-
/* @__PURE__ */ s(
|
|
957
|
+
/* @__PURE__ */ s(Io, { ...e })
|
|
953
958
|
] }) });
|
|
954
959
|
}, fo = ({ sdk: e, webos: i }) => {
|
|
955
|
-
var t, o, a, p, d, r,
|
|
956
|
-
const [$] = w(e.getNotificationsStore()),
|
|
960
|
+
var t, o, a, p, d, r, m, u;
|
|
961
|
+
const [$] = w(e.getNotificationsStore()), h = bs($), g = e.getFeature(Es.GAMES), c = hs(() => e.getActiveNotification(), [e, h]);
|
|
957
962
|
return y(() => {
|
|
958
|
-
c &&
|
|
963
|
+
c && Cs.emit("notification", {
|
|
959
964
|
action: "rendered",
|
|
960
965
|
payload: {
|
|
961
966
|
questionId: c.data.questionId,
|
|
962
967
|
questionType: c.data.questionType
|
|
963
968
|
}
|
|
964
969
|
});
|
|
965
|
-
}, [c]), c && c.type === O.QUESTION_RESOLVED ? c.data.question && c.data.questionType ===
|
|
970
|
+
}, [c]), c && c.type === O.QUESTION_RESOLVED ? c.data.question && c.data.questionType === I.PREDICTION ? c && ((t = c.data.inApp) == null ? void 0 : t.adUnit) === R.STANDART ? /* @__PURE__ */ s(
|
|
966
971
|
Co,
|
|
967
972
|
{
|
|
968
973
|
action: c.action,
|
|
@@ -990,15 +995,15 @@ const b = /* @__PURE__ */ n("div")({
|
|
|
990
995
|
...c.data,
|
|
991
996
|
action: c.action,
|
|
992
997
|
close: c.close,
|
|
993
|
-
color: ((d = (p = (a = c == null ? void 0 : c.data) == null ? void 0 : a.inApp) == null ? void 0 : p.notification) == null ? void 0 : d.indicatorColor) || ((
|
|
998
|
+
color: ((d = (p = (a = c == null ? void 0 : c.data) == null ? void 0 : a.inApp) == null ? void 0 : p.notification) == null ? void 0 : d.indicatorColor) || ((u = (m = (r = c == null ? void 0 : c.data) == null ? void 0 : r.inApp) == null ? void 0 : m.appearance) == null ? void 0 : u.primaryColor),
|
|
994
999
|
webos: i
|
|
995
1000
|
}
|
|
996
1001
|
) : c && /* @__PURE__ */ s(se, { ...c.data, action: c.action });
|
|
997
|
-
},
|
|
998
|
-
const i =
|
|
999
|
-
return i && (o.appNotification || o.onboardingNotification) ? o.app && !o.onboardingNotification ? null : /* @__PURE__ */ s("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ s(
|
|
1002
|
+
}, Oo = ({ theme: e }) => {
|
|
1003
|
+
const i = fs(), t = ks(), o = Ns();
|
|
1004
|
+
return i && (o.appNotification || o.onboardingNotification) ? o.app && !o.onboardingNotification ? null : /* @__PURE__ */ s("div", { className: "StreamLayerSDK", children: /* @__PURE__ */ s(qs, { customTheme: e ?? t.theme, themeMode: t.themeMode, children: /* @__PURE__ */ s(fo, { sdk: i }) }) }) : null;
|
|
1000
1005
|
};
|
|
1001
1006
|
export {
|
|
1002
|
-
|
|
1007
|
+
Oo as StreamLayerSDKNotification,
|
|
1003
1008
|
fo as StreamLayerSDKNotificationUI
|
|
1004
1009
|
};
|